@@ -8,6 +8,10 @@ import {
88import type { Meta , StoryFn } from "@storybook/react-vite"
99import { useRef , useState } from "react"
1010import { Button } from "#ui/atoms/Button"
11+ import { Icon } from "#ui/atoms/Icon"
12+ import { Spacer } from "#ui/atoms/Spacer"
13+ import { StatusIcon } from "#ui/atoms/StatusIcon"
14+ import { Text } from "#ui/atoms/Text"
1115import { Modal } from "#ui/composite/Modal"
1216import { InputSelect } from "#ui/forms/InputSelect"
1317
@@ -169,3 +173,55 @@ export const WithInput: StoryFn = () => {
169173 </ div >
170174 )
171175}
176+
177+ /**
178+ * Modal as dialog without header
179+ */
180+ export const AsDialog : StoryFn = ( ) => {
181+ const [ show , setShow ] = useState ( false )
182+
183+ const handleClose = ( ) => setShow ( false )
184+ const handleShow = ( ) => setShow ( true )
185+
186+ return (
187+ < div >
188+ < Button onClick = { handleShow } > Open modal</ Button >
189+ < Modal show = { show } onClose = { handleClose } size = "x-small" >
190+ < Modal . Body >
191+ < Spacer top = "4" bottom = "4" >
192+ < StatusIcon name = "check" background = "green" gap = "x-large" />
193+ </ Spacer >
194+ < Text weight = "semibold" align = "center" tag = "div" >
195+ Your coupons are ready.
196+ </ Text >
197+ < Text align = "center" tag = "div" size = "x-small" variant = "info" >
198+ Download now or find them later in Imports.
199+ </ Text >
200+ </ Modal . Body >
201+ < Modal . Footer >
202+ < Button
203+ variant = "primary"
204+ onClick = { ( ) => {
205+ alert ( "Downloaded!" )
206+ handleClose ( )
207+ } }
208+ fullWidth
209+ alignItems = "center"
210+ >
211+ < Icon name = "fileArrowDown" />
212+ Download (CSV)
213+ </ Button >
214+ < Button
215+ variant = "secondary"
216+ onClick = { ( ) => {
217+ handleClose ( )
218+ } }
219+ fullWidth
220+ >
221+ Cancel
222+ </ Button >
223+ </ Modal . Footer >
224+ </ Modal >
225+ </ div >
226+ )
227+ }
0 commit comments