@spark-ui/components 13.1.3 → 13.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button-B6rA3-e5.js +2 -0
- package/dist/{Button-C3xHNaGl.js.map → Button-B6rA3-e5.js.map} +1 -1
- package/dist/{Button-D32Avk2j.mjs → Button-C3C0aixy.mjs} +4 -4
- package/dist/{Button-D32Avk2j.mjs.map → Button-C3C0aixy.mjs.map} +1 -1
- package/dist/DialogContent.styles-B5pR8ECK.js +2 -0
- package/dist/{DialogContent.styles-BrhKaHc_.js.map → DialogContent.styles-B5pR8ECK.js.map} +1 -1
- package/dist/{DialogContent.styles-WGWJS9dj.mjs → DialogContent.styles-_lRDsl8c.mjs} +4 -4
- package/dist/{DialogContent.styles-WGWJS9dj.mjs.map → DialogContent.styles-_lRDsl8c.mjs.map} +1 -1
- package/dist/Icon-CF0W0LKr.js +2 -0
- package/dist/{Icon-Bf0XrmiR.js.map → Icon-CF0W0LKr.js.map} +1 -1
- package/dist/{Icon-D1RueiPY.mjs → Icon-Ck-dhfLd.mjs} +6 -6
- package/dist/{Icon-D1RueiPY.mjs.map → Icon-Ck-dhfLd.mjs.map} +1 -1
- package/dist/{IconButton-BY3gYXtU.mjs → IconButton-C62-axzv.mjs} +6 -6
- package/dist/{IconButton-BY3gYXtU.mjs.map → IconButton-C62-axzv.mjs.map} +1 -1
- package/dist/IconButton-D3g86WpZ.js +2 -0
- package/dist/{IconButton-Bf-EDzpI.js.map → IconButton-D3g86WpZ.js.map} +1 -1
- package/dist/Slot-D2Bbf8Gw.mjs +14 -0
- package/dist/{Slot-C98rL4yy.mjs.map → Slot-D2Bbf8Gw.mjs.map} +1 -1
- package/dist/Slot-DQ8z2zsy.js +2 -0
- package/dist/{Slot-ghrohQLA.js.map → Slot-DQ8z2zsy.js.map} +1 -1
- package/dist/Spinner-_Kffli3B.js +2 -0
- package/dist/{Spinner-DK8VEsaR.js.map → Spinner-_Kffli3B.js.map} +1 -1
- package/dist/{Spinner-CYL5kyzM.mjs → Spinner-jF3-zoh_.mjs} +3 -3
- package/dist/{Spinner-CYL5kyzM.mjs.map → Spinner-jF3-zoh_.mjs.map} +1 -1
- package/dist/{TextLink-3MEVs3No.mjs → TextLink-BuzFRWO6.mjs} +3 -3
- package/dist/{TextLink-3MEVs3No.mjs.map → TextLink-BuzFRWO6.mjs.map} +1 -1
- package/dist/TextLink-C3xDLsbC.js +2 -0
- package/dist/{TextLink-DD0VO37q.js.map → TextLink-C3xDLsbC.js.map} +1 -1
- package/dist/{VisuallyHidden-AoRh4WRK.js → VisuallyHidden-CB6Nx76j.js} +2 -2
- package/dist/{VisuallyHidden-AoRh4WRK.js.map → VisuallyHidden-CB6Nx76j.js.map} +1 -1
- package/dist/{VisuallyHidden-ByNP7ZUI.mjs → VisuallyHidden-KH1biLx-.mjs} +2 -2
- package/dist/{VisuallyHidden-ByNP7ZUI.mjs.map → VisuallyHidden-KH1biLx-.mjs.map} +1 -1
- package/dist/accordion/index.d.mts +15 -0
- package/dist/accordion/index.js +1 -1
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +90 -608
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert-dialog/index.d.mts +38 -0
- package/dist/alert-dialog/index.js +1 -34
- package/dist/alert-dialog/index.js.map +1 -1
- package/dist/alert-dialog/index.mjs +130 -2473
- package/dist/alert-dialog/index.mjs.map +1 -1
- package/dist/avatar/index.d.mts +15 -0
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar/index.mjs +4 -4
- package/dist/badge/index.d.mts +1 -0
- package/dist/badge/index.js +1 -1
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +6 -6
- package/dist/breadcrumb/index.d.mts +12 -0
- package/dist/breadcrumb/index.js +1 -1
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/breadcrumb/index.mjs +21 -21
- package/dist/button/Button.d.ts +1 -1
- package/dist/button/index.d.mts +1 -0
- package/dist/button/index.js +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/button/variants/index.d.mts +5 -0
- package/dist/card/index.d.mts +8 -0
- package/dist/card/index.js +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +2 -2
- package/dist/carousel/index.d.mts +19 -0
- package/dist/carousel/index.js +1 -1
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +3 -3
- package/dist/checkbox/index.d.mts +2 -0
- package/dist/checkbox/index.js +1 -1
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs +128 -364
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chip/index.d.mts +15 -0
- package/dist/chip/index.js +1 -1
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/index.mjs +196 -370
- package/dist/chip/index.mjs.map +1 -1
- package/dist/chip/variants/index.d.mts +3 -0
- package/dist/collapsible/index.d.mts +7 -0
- package/dist/collapsible/index.js +1 -1
- package/dist/collapsible/index.js.map +1 -1
- package/dist/collapsible/index.mjs +38 -213
- package/dist/collapsible/index.mjs.map +1 -1
- package/dist/combobox/index.d.mts +35 -0
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +7 -7
- package/dist/combobox/utils/index.d.mts +14 -0
- package/dist/dialog/index.d.mts +37 -0
- package/dist/dialog/index.js +1 -1
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +120 -120
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/divider/index.d.mts +6 -0
- package/dist/divider/index.js +1 -1
- package/dist/divider/index.js.map +1 -1
- package/dist/divider/index.mjs +58 -76
- package/dist/divider/index.mjs.map +1 -1
- package/dist/drawer/index.d.mts +35 -0
- package/dist/drawer/index.js +1 -1
- package/dist/drawer/index.js.map +1 -1
- package/dist/drawer/index.mjs +88 -88
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown/index.d.mts +29 -0
- package/dist/dropdown/index.js +1 -1
- package/dist/dropdown/index.js.map +1 -1
- package/dist/dropdown/index.mjs +5 -5
- package/dist/file-upload/index.d.mts +22 -0
- package/dist/file-upload/index.js +1 -1
- package/dist/file-upload/index.js.map +1 -1
- package/dist/file-upload/index.mjs +6 -6
- package/dist/form-field/index.d.mts +31 -0
- package/dist/form-field/index.js +1 -1
- package/dist/form-field/index.js.map +1 -1
- package/dist/form-field/index.mjs +47 -47
- package/dist/icon/index.d.mts +1 -0
- package/dist/icon/index.js +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/icon-button/index.d.mts +1 -0
- package/dist/icon-button/index.js +1 -1
- package/dist/icon-button/index.mjs +1 -1
- package/dist/input/index.d.mts +21 -0
- package/dist/input/index.js +1 -1
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +4 -4
- package/dist/input-otp/index.d.mts +14 -0
- package/dist/input-otp/index.js +1 -1
- package/dist/input-otp/index.js.map +1 -1
- package/dist/input-otp/index.mjs +63 -61
- package/dist/input-otp/index.mjs.map +1 -1
- package/dist/kbd/index.d.mts +1 -0
- package/dist/label/index.d.mts +7 -0
- package/dist/label/index.js +1 -1
- package/dist/label/index.js.map +1 -1
- package/dist/label/index.mjs +37 -2
- package/dist/label/index.mjs.map +1 -1
- package/dist/link-box/index.d.mts +9 -0
- package/dist/link-box/index.js +1 -1
- package/dist/link-box/index.js.map +1 -1
- package/dist/link-box/index.mjs +7 -7
- package/dist/pagination/index.d.mts +18 -0
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/index.js.map +1 -1
- package/dist/pagination/index.mjs +126 -784
- package/dist/pagination/index.mjs.map +1 -1
- package/dist/popover/index.d.mts +17 -0
- package/dist/popover/index.js +1 -1
- package/dist/popover/index.js.map +1 -1
- package/dist/popover/index.mjs +119 -1748
- package/dist/popover/index.mjs.map +1 -1
- package/dist/portal/index.d.mts +1 -0
- package/dist/portal/index.js +1 -1
- package/dist/portal/index.js.map +1 -1
- package/dist/portal/index.mjs +3 -3
- package/dist/portal/index.mjs.map +1 -1
- package/dist/progress/index.d.mts +13 -0
- package/dist/progress/index.js +1 -6
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +87 -162
- package/dist/progress/index.mjs.map +1 -1
- package/dist/progress-tracker/index.d.mts +10 -0
- package/dist/progress-tracker/index.js +1 -1
- package/dist/progress-tracker/index.js.map +1 -1
- package/dist/progress-tracker/index.mjs +14 -14
- package/dist/radio-group/index.d.mts +7 -0
- package/dist/radio-group/index.js +1 -1
- package/dist/radio-group/index.js.map +1 -1
- package/dist/radio-group/index.mjs +85 -312
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/rating/index.d.mts +1 -0
- package/dist/rating/index.js +1 -1
- package/dist/rating/index.js.map +1 -1
- package/dist/rating/index.mjs +11 -11
- package/dist/scrolling-list/index.d.mts +15 -0
- package/dist/scrolling-list/index.js +1 -1
- package/dist/scrolling-list/index.js.map +1 -1
- package/dist/scrolling-list/index.mjs +168 -333
- package/dist/scrolling-list/index.mjs.map +1 -1
- package/dist/segmented-gauge/index.d.mts +13 -0
- package/dist/segmented-gauge/index.js +1 -1
- package/dist/segmented-gauge/index.js.map +1 -1
- package/dist/segmented-gauge/index.mjs +1 -1
- package/dist/select/index.d.mts +21 -0
- package/dist/select/index.js +1 -1
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +21 -21
- package/dist/skeleton/index.d.mts +8 -0
- package/dist/skeleton/index.js +1 -1
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs +2 -2
- package/dist/slider/index.d.mts +8 -0
- package/dist/slider/index.js +1 -1
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs +62 -486
- package/dist/slider/index.mjs.map +1 -1
- package/dist/slot/index.d.mts +1 -0
- package/dist/slot/index.js +1 -1
- package/dist/slot/index.mjs +1 -1
- package/dist/snackbar/index.d.mts +13 -0
- package/dist/snackbar/index.js +1 -1
- package/dist/snackbar/index.js.map +1 -1
- package/dist/snackbar/index.mjs +189 -1105
- package/dist/snackbar/index.mjs.map +1 -1
- package/dist/spinner/index.d.mts +1 -0
- package/dist/spinner/index.js +1 -1
- package/dist/spinner/index.mjs +1 -1
- package/dist/stepper/index.d.mts +9 -0
- package/dist/stepper/index.js +1 -7
- package/dist/stepper/index.js.map +1 -1
- package/dist/stepper/index.mjs +137 -2317
- package/dist/stepper/index.mjs.map +1 -1
- package/dist/switch/index.d.mts +1 -0
- package/dist/switch/index.js +1 -1
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +85 -208
- package/dist/switch/index.mjs.map +1 -1
- package/dist/tabs/index.d.mts +13 -0
- package/dist/tabs/index.js +1 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +179 -329
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/tag/index.d.mts +1 -0
- package/dist/tag/index.js +1 -1
- package/dist/tag/index.js.map +1 -1
- package/dist/tag/index.mjs +2 -2
- package/dist/tag/variants/index.d.mts +3 -0
- package/dist/text-link/index.d.mts +1 -0
- package/dist/text-link/index.js +1 -1
- package/dist/text-link/index.mjs +1 -1
- package/dist/textarea/index.d.mts +14 -0
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +6 -6
- package/dist/toast/index.d.mts +20 -0
- package/dist/toast/index.js +1 -1
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/index.mjs +146 -1008
- package/dist/toast/index.mjs.map +1 -1
- package/dist/visually-hidden/index.d.mts +1 -0
- package/dist/visually-hidden/index.js +1 -1
- package/dist/visually-hidden/index.mjs +1 -1
- package/package.json +5 -4
- package/dist/Button-C3xHNaGl.js +0 -2
- package/dist/DialogContent.styles-BrhKaHc_.js +0 -2
- package/dist/Icon-Bf0XrmiR.js +0 -2
- package/dist/IconButton-Bf-EDzpI.js +0 -2
- package/dist/Slot-C98rL4yy.mjs +0 -14
- package/dist/Slot-ghrohQLA.js +0 -2
- package/dist/Spinner-DK8VEsaR.js +0 -2
- package/dist/TextLink-DD0VO37q.js +0 -2
- package/dist/composite-Br3kM5N9.mjs +0 -40
- package/dist/composite-Br3kM5N9.mjs.map +0 -1
- package/dist/composite-fJD9R7R0.js +0 -2
- package/dist/composite-fJD9R7R0.js.map +0 -1
- package/dist/detectBrowser-Bc7rk5fI.mjs +0 -44
- package/dist/detectBrowser-Bc7rk5fI.mjs.map +0 -1
- package/dist/detectBrowser-DTbs_30X.js +0 -2
- package/dist/detectBrowser-DTbs_30X.js.map +0 -1
- package/dist/downshift.esm-Ncwetv0s.mjs +0 -3038
- package/dist/downshift.esm-Ncwetv0s.mjs.map +0 -1
- package/dist/downshift.esm-PfCOUbxq.js +0 -37
- package/dist/downshift.esm-PfCOUbxq.js.map +0 -1
- package/dist/floating-ui.utils.dom-CCN4I08l.js +0 -2
- package/dist/floating-ui.utils.dom-CCN4I08l.js.map +0 -1
- package/dist/floating-ui.utils.dom-uiDUZc_y.mjs +0 -136
- package/dist/floating-ui.utils.dom-uiDUZc_y.mjs.map +0 -1
- package/dist/index-0KYGKeVg.js +0 -2
- package/dist/index-0KYGKeVg.js.map +0 -1
- package/dist/index-1WIgmEZh.js +0 -2
- package/dist/index-1WIgmEZh.js.map +0 -1
- package/dist/index-BRi38DTc.mjs +0 -21
- package/dist/index-BRi38DTc.mjs.map +0 -1
- package/dist/index-BZAtNKwE.mjs +0 -71
- package/dist/index-BZAtNKwE.mjs.map +0 -1
- package/dist/index-BZPx6jYI.mjs +0 -9
- package/dist/index-BZPx6jYI.mjs.map +0 -1
- package/dist/index-BlkdpEIe.mjs +0 -55
- package/dist/index-BlkdpEIe.mjs.map +0 -1
- package/dist/index-BmAFn37q.mjs +0 -49
- package/dist/index-BmAFn37q.mjs.map +0 -1
- package/dist/index-C-J_tHdS.js +0 -6
- package/dist/index-C-J_tHdS.js.map +0 -1
- package/dist/index-C1qb0595.mjs +0 -28
- package/dist/index-C1qb0595.mjs.map +0 -1
- package/dist/index-C34GgsKQ.mjs +0 -54
- package/dist/index-C34GgsKQ.mjs.map +0 -1
- package/dist/index-CCKe-Mpx.mjs +0 -7
- package/dist/index-CCKe-Mpx.mjs.map +0 -1
- package/dist/index-CDBBjNXc.js +0 -2
- package/dist/index-CDBBjNXc.js.map +0 -1
- package/dist/index-CYjGhVvU.mjs +0 -243
- package/dist/index-CYjGhVvU.mjs.map +0 -1
- package/dist/index-ChLwd62c.js +0 -2
- package/dist/index-ChLwd62c.js.map +0 -1
- package/dist/index-Cjj_rUPu.js +0 -2
- package/dist/index-Cjj_rUPu.js.map +0 -1
- package/dist/index-CyMbLkj0.js +0 -2
- package/dist/index-CyMbLkj0.js.map +0 -1
- package/dist/index-DFZozV_h.mjs +0 -69
- package/dist/index-DFZozV_h.mjs.map +0 -1
- package/dist/index-DKuHkHFX.js +0 -2
- package/dist/index-DKuHkHFX.js.map +0 -1
- package/dist/index-DLHLIYPI.mjs +0 -16
- package/dist/index-DLHLIYPI.mjs.map +0 -1
- package/dist/index-DO-atGp-.js +0 -2
- package/dist/index-DO-atGp-.js.map +0 -1
- package/dist/index-DWlg8lkk.mjs +0 -179
- package/dist/index-DWlg8lkk.mjs.map +0 -1
- package/dist/index-DYxWvftI.js +0 -2
- package/dist/index-DYxWvftI.js.map +0 -1
- package/dist/index-D_lWkK39.mjs +0 -803
- package/dist/index-D_lWkK39.mjs.map +0 -1
- package/dist/index-DdkVj7D0.js +0 -18
- package/dist/index-DdkVj7D0.js.map +0 -1
- package/dist/index-De-6atSi.js +0 -2
- package/dist/index-De-6atSi.js.map +0 -1
- package/dist/index-DhGWNzsz.mjs +0 -83
- package/dist/index-DhGWNzsz.mjs.map +0 -1
- package/dist/index-Dkj4QRX8.js +0 -2
- package/dist/index-Dkj4QRX8.js.map +0 -1
- package/dist/index-DlIFg0Eu.mjs +0 -60
- package/dist/index-DlIFg0Eu.mjs.map +0 -1
- package/dist/index-DnaHaH_0.js +0 -2
- package/dist/index-DnaHaH_0.js.map +0 -1
- package/dist/index-MHF2-CYX.js +0 -2
- package/dist/index-MHF2-CYX.js.map +0 -1
- package/dist/index-MQ0c3ZX_.js +0 -2
- package/dist/index-MQ0c3ZX_.js.map +0 -1
- package/dist/index-MSR-vgWR.mjs +0 -37
- package/dist/index-MSR-vgWR.mjs.map +0 -1
- package/dist/index-VL0YEmOW.mjs +0 -125
- package/dist/index-VL0YEmOW.mjs.map +0 -1
- package/dist/index-tXqxYME3.js +0 -42
- package/dist/index-tXqxYME3.js.map +0 -1
- package/dist/inertValue-Bif5Sqs6.mjs +0 -522
- package/dist/inertValue-Bif5Sqs6.mjs.map +0 -1
- package/dist/inertValue-ShwihJSN.js +0 -5
- package/dist/inertValue-ShwihJSN.js.map +0 -1
- package/dist/useCollapsiblePanel-D1dCo0lf.js +0 -4
- package/dist/useCollapsiblePanel-D1dCo0lf.js.map +0 -1
- package/dist/useCollapsiblePanel-kbMNl4Z4.mjs +0 -287
- package/dist/useCollapsiblePanel-kbMNl4Z4.mjs.map +0 -1
- package/dist/useFocusWithin-CFNEka2I.js +0 -2
- package/dist/useFocusWithin-CFNEka2I.js.map +0 -1
- package/dist/useFocusWithin-CoL4390f.mjs +0 -796
- package/dist/useFocusWithin-CoL4390f.mjs.map +0 -1
- package/dist/useOpenChangeComplete-Dk-u_f2y.js +0 -2
- package/dist/useOpenChangeComplete-Dk-u_f2y.js.map +0 -1
- package/dist/useOpenChangeComplete-RUbg6RBw.mjs +0 -582
- package/dist/useOpenChangeComplete-RUbg6RBw.mjs.map +0 -1
- package/dist/useTransitionStatus-CktVVKxz.mjs +0 -46
- package/dist/useTransitionStatus-CktVVKxz.mjs.map +0 -1
- package/dist/useTransitionStatus-CqbEyvIj.js +0 -2
- package/dist/useTransitionStatus-CqbEyvIj.js.map +0 -1
package/dist/dialog/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/dialog/DialogContext.tsx","../../src/dialog/Dialog.tsx","../../src/dialog/DialogBody.tsx","../../src/dialog/DialogClose.tsx","../../src/dialog/DialogCloseButton.tsx","../../src/dialog/DialogContent.tsx","../../src/dialog/DialogDescription.tsx","../../src/dialog/DialogFooter.tsx","../../src/dialog/DialogHeader.tsx","../../src/dialog/DialogOverlay.tsx","../../src/dialog/DialogPortal.tsx","../../src/dialog/DialogTitle.tsx","../../src/dialog/DialogTrigger.tsx","../../src/dialog/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\nexport interface DialogContextState {\n isFullScreen: boolean\n setIsFullScreen: (value: boolean) => void\n withFade: boolean\n}\n\nconst DialogContext = createContext<DialogContextState | null>(null)\n\nexport const DialogProvider = ({\n children: childrenProp,\n withFade = false,\n}: {\n children: ReactNode\n withFade?: boolean\n}) => {\n const [isFullScreen, setIsFullScreen] = useState(false)\n\n return (\n <DialogContext.Provider\n value={{\n isFullScreen,\n setIsFullScreen,\n withFade,\n }}\n >\n {childrenProp}\n </DialogContext.Provider>\n )\n}\n\nexport const useDialog = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw Error('useDialog must be used within a Dialog provider')\n }\n\n return context\n}\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps {\n /**\n * Children of the component.\n */\n children?: RadixDialog.DialogProps['children']\n /**\n * Specifies if the dialog is open or not.\n */\n open?: RadixDialog.DialogProps['open']\n /**\n * Default open state.\n */\n defaultOpen?: RadixDialog.DialogProps['defaultOpen']\n /**\n * Handler executen on every dialog open state change.\n */\n onOpenChange?: RadixDialog.DialogProps['onOpenChange']\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: RadixDialog.DialogProps['modal']\n /**\n * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).\n */\n withFade?: boolean\n}\n\nexport const Dialog = ({ children, withFade = false, ...rest }: DialogProps): ReactElement => {\n const open = rest.open\n const activeElementRef = useRef<Element>(null)\n\n /**\n * This function captures the active element when the Dialog is opened\n * and sets focus back to it when the Dialog is closed.\n */\n function handleActiveElementFocus() {\n if (open && document.activeElement) {\n activeElementRef.current = document.activeElement\n }\n\n if (!open) {\n setTimeout(() => {\n if (!(activeElementRef.current instanceof HTMLElement)) return\n activeElementRef.current.focus()\n }, 0)\n }\n }\n\n useEffect(handleActiveElementFocus, [open])\n\n return (\n <DialogProvider withFade={withFade}>\n <RadixDialog.Root {...rest}>{children}</RadixDialog.Root>\n </DialogProvider>\n )\n}\n\nDialog.displayName = 'Dialog.Root'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { useScrollOverflow } from '@spark-ui/hooks/use-scroll-overflow'\nimport { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref, useRef } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport interface BodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const Body = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: BodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useDialog()\n\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"dialog-body\"\n ref={ref}\n className={cx(\n 'focus-visible:u-outline relative grow overflow-y-auto outline-hidden',\n 'transition-all duration-300',\n {\n ['px-xl py-lg']: !inset,\n },\n className\n )}\n style={{\n ...(withFade && {\n maskImage:\n 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))',\n maskSize: `100% calc(100% + ${overflow.top ? '0px' : '44px'} + ${overflow.bottom ? '0px' : '44px'})`,\n maskPosition: `0 ${overflow.top ? '0px' : '-44px'}`,\n }),\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dialog.Body'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type CloseProps = RadixDialog.DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = (props: CloseProps) => <RadixDialog.Close {...props} />\n\nClose.displayName = 'Dialog.Close'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport { Close, CloseProps } from './DialogClose'\n\nexport type CloseButtonProps = CloseProps &\n Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>\n\nconst Root = ({\n 'aria-label': ariaLabel,\n className,\n size = 'md',\n intent = 'neutral',\n design = 'ghost',\n children = <CloseSVG />,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <Close\n data-spark-component=\"dialog-close-button\"\n data-part=\"close\"\n ref={ref}\n className={cx(['absolute', 'top-md', 'right-xl'], className)}\n asChild\n {...rest}\n >\n <IconButton intent={intent} size={size} design={design} aria-label={ariaLabel}>\n <Icon>{children}</Icon>\n </IconButton>\n </Close>\n )\n}\n\nexport const CloseButton = Object.assign(Root, {\n id: 'CloseButton',\n})\n\nRoot.displayName = 'Dialog.CloseButton'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {\n /**\n * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.\n */\n isNarrow?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Content = ({\n children,\n className,\n isNarrow = false,\n size = 'md',\n onInteractOutside,\n ref,\n ...rest\n}: ContentProps): ReactElement => {\n const { setIsFullScreen } = useDialog()\n\n useEffect(() => {\n if (size === 'fullscreen') setIsFullScreen(true)\n\n return () => setIsFullScreen(false)\n }, [setIsFullScreen, size])\n\n return (\n <RadixDialog.Content\n data-spark-component=\"dialog-content\"\n ref={ref}\n className={dialogContentStyles({\n className,\n isNarrow,\n size,\n })}\n onInteractOutside={e => {\n const isForegroundElement = (e.target as HTMLElement).closest('.z-toast, .z-popover')\n\n /**\n * The focus trap of the dialog applies `pointer-events-none` on the body of the page in the background, but\n * some components with an higher z-index have `pointer-events-auto` applied on them to remain interactive and ignore the focust trap (ex: a Snackbar with actions).\n *\n * Clicking on the snackbar will be considered as an \"outside click\" and close the dialog. We want to prevent this.\n */\n if (isForegroundElement) {\n e.preventDefault()\n }\n\n onInteractOutside?.(e)\n }}\n {...rest}\n >\n {children}\n </RadixDialog.Content>\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type DescriptionProps = RadixDialog.DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <RadixDialog.Description data-spark-component=\"dialog-description\" {...props} />\n)\n\nDescription.displayName = 'Dialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface FooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Footer = ({ children, className, ref, ...rest }: FooterProps): ReactElement => (\n <footer\n data-spark-component=\"dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nFooter.displayName = 'Dialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps): ReactElement => (\n <header\n data-spark-component=\"dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nHeader.displayName = 'Dialog.Header'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport type OverlayProps = RadixDialog.DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ref, ...rest }: OverlayProps): ReactElement | null => {\n const { isFullScreen } = useDialog()\n\n return (\n <RadixDialog.Overlay\n data-spark-component=\"dialog-overlay\"\n ref={ref}\n className={cx(\n isFullScreen ? 'hidden' : 'fixed',\n ['top-0', 'left-0', 'w-screen', 'h-screen', 'z-overlay'],\n ['bg-overlay/dim-1'],\n ['data-[state=open]:animate-fade-in'],\n ['data-[state=closed]:animate-fade-out'],\n className\n )}\n {...rest}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement } from 'react'\n\nexport type PortalProps = RadixDialog.DialogPortalProps\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixDialog.Portal {...rest}>{children}</RadixDialog.Portal>\n)\n\nPortal.displayName = 'Dialog.Portal'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TitleProps = RadixDialog.DialogTitleProps & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <RadixDialog.Title\n data-spark-component=\"dialog-title\"\n ref={ref}\n className={cx(\n 'text-headline-1 text-on-surface',\n 'group-has-data-[part=close]:pr-3xl',\n className\n )}\n {...others}\n />\n )\n}\n\nTitle.displayName = 'Dialog.Title'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, ReactNode, Ref } from 'react'\n\nexport interface TriggerProps {\n /**\n * Children of the component.\n */\n children?: ReactNode\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: RadixDialog.DialogTriggerProps['asChild']\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = (props: TriggerProps): ReactElement => (\n <RadixDialog.Trigger data-spark-component=\"dialog-trigger\" {...props} />\n)\n\nTrigger.displayName = 'Dialog.Trigger'\n","import { Dialog as Root } from './Dialog'\nimport { Body } from './DialogBody'\nimport { Close } from './DialogClose'\nimport { CloseButton } from './DialogCloseButton'\nimport { Content } from './DialogContent'\nimport { Description } from './DialogDescription' // aria-describedby\nimport { Footer } from './DialogFooter'\nimport { Header } from './DialogHeader'\nimport { Overlay } from './DialogOverlay'\nimport { Portal } from './DialogPortal'\nimport { Title } from './DialogTitle' // aria-labelledby\nimport { Trigger } from './DialogTrigger'\n\nexport const Dialog: typeof Root & {\n Trigger: typeof Trigger\n Portal: typeof Portal\n Overlay: typeof Overlay\n Content: typeof Content\n Header: typeof Header\n Body: typeof Body\n Footer: typeof Footer\n Close: typeof Close\n CloseButton: typeof CloseButton\n Title: typeof Title\n Description: typeof Description\n} = Object.assign(Root, {\n Trigger,\n Portal,\n Overlay,\n Content,\n Header,\n Body,\n Footer,\n Close,\n CloseButton,\n Title,\n Description,\n})\n\nDialog.displayName = 'Dialog'\nDialog.Trigger.displayName = 'Dialog.Trigger'\nTrigger.displayName = 'Dialog.Trigger'\nPortal.displayName = 'Dialog.Portal'\nOverlay.displayName = 'Dialog.Overlay'\nContent.displayName = 'Dialog.Content'\nHeader.displayName = 'Dialog.Header'\nBody.displayName = 'Dialog.Body'\nFooter.displayName = 'Dialog.Footer'\nCloseButton.displayName = 'Dialog.CloseButton'\nTitle.displayName = 'Dialog.Title'\nDescription.displayName = 'Dialog.Description'\n\nexport { type DialogProps } from './Dialog'\nexport { type ContentProps as DialogContentProps } from './DialogContent'\nexport { type HeaderProps as DialogHeaderProps } from './DialogHeader'\nexport { type BodyProps as DialogBodyProps } from './DialogBody'\nexport { type FooterProps as DialogFooterProps } from './DialogFooter'\nexport { type TriggerProps as DialogTriggerProps } from './DialogTrigger'\nexport { type OverlayProps as DialogOverlayProps } from './DialogOverlay'\nexport { type PortalProps as DialogPortalProps } from './DialogPortal'\nexport { type TitleProps as DialogTitleProps } from './DialogTitle'\nexport { type DescriptionProps as DialogDescriptionProps } from './DialogDescription'\nexport { type CloseProps as DialogCloseProps } from './DialogClose'\nexport { type CloseButtonProps as DialogCloseButtonProps } from './DialogCloseButton'\n"],"names":["DialogContext","createContext","DialogProvider","childrenProp","withFade","isFullScreen","setIsFullScreen","useState","jsx","useDialog","context","useContext","Dialog","children","rest","open","activeElementRef","useRef","handleActiveElementFocus","useEffect","RadixDialog.Root","Body","className","inset","forwardedRef","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","Close","props","RadixDialog.Close","Root","ariaLabel","size","intent","design","CloseSVG","IconButton","Icon","CloseButton","Content","isNarrow","onInteractOutside","RadixDialog.Content","dialogContentStyles","e","Description","RadixDialog.Description","Footer","Header","Overlay","RadixDialog.Overlay","Portal","RadixDialog.Portal","Title","others","RadixDialog.Title","Trigger","RadixDialog.Trigger"],"mappings":"qcAQMA,EAAgBC,EAAAA,cAAyC,IAAI,EAEtDC,EAAiB,CAAC,CAC7B,SAAUC,EACV,SAAAC,EAAW,EACb,IAGM,CACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAAA,SAAS,EAAK,EAEtD,OACEC,EAAAA,IAACR,EAAc,SAAd,CACC,MAAO,CACL,aAAAK,EACA,gBAAAC,EACA,SAAAF,CAAA,EAGD,SAAAD,CAAA,CAAA,CAGP,EAEaM,EAAY,IAAM,CAC7B,MAAMC,EAAUC,EAAAA,WAAWX,CAAa,EAExC,GAAI,CAACU,EACH,MAAM,MAAM,iDAAiD,EAG/D,OAAOA,CACT,ECRaE,EAAS,CAAC,CAAE,SAAAC,EAAU,SAAAT,EAAW,GAAO,GAAGU,KAAsC,CAC5F,MAAMC,EAAOD,EAAK,KACZE,EAAmBC,EAAAA,OAAgB,IAAI,EAM7C,SAASC,GAA2B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oC,CAAA,CAAA,EAKVD,EAAM,YAAc,eCRb,MAAMG,EAAW5B,GACtBxB,MAACqD,EAAAA,QAAA,CAAoB,uBAAqB,iBAAkB,GAAG7B,EAAO,EAGxE4B,EAAQ,YAAc,iBCNf,MAAMhD,EAYT,OAAO,OAAOsB,EAAM,CACtB,QAAA0B,EACA,OAAAL,EACA,QAAAF,EACA,QAAAV,EACA,OAAAS,EACA,KAAA/B,EACA,OAAA8B,EACA,MAAApB,EACA,YAAAW,EACA,MAAAe,EACA,YAAAR,CACF,CAAC,EAEDrC,EAAO,YAAc,SACrBA,EAAO,QAAQ,YAAc,iBAC7BgD,EAAQ,YAAc,iBACtBL,EAAO,YAAc,gBACrBF,EAAQ,YAAc,iBACtBV,EAAQ,YAAc,iBACtBS,EAAO,YAAc,gBACrB/B,EAAK,YAAc,cACnB8B,EAAO,YAAc,gBACrBT,EAAY,YAAc,qBAC1Be,EAAM,YAAc,eACpBR,EAAY,YAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/dialog/DialogContext.tsx","../../src/dialog/Dialog.tsx","../../src/dialog/DialogBody.tsx","../../src/dialog/DialogClose.tsx","../../src/dialog/DialogCloseButton.tsx","../../src/dialog/DialogContent.tsx","../../src/dialog/DialogDescription.tsx","../../src/dialog/DialogFooter.tsx","../../src/dialog/DialogHeader.tsx","../../src/dialog/DialogOverlay.tsx","../../src/dialog/DialogPortal.tsx","../../src/dialog/DialogTitle.tsx","../../src/dialog/DialogTrigger.tsx","../../src/dialog/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\nexport interface DialogContextState {\n isFullScreen: boolean\n setIsFullScreen: (value: boolean) => void\n withFade: boolean\n}\n\nconst DialogContext = createContext<DialogContextState | null>(null)\n\nexport const DialogProvider = ({\n children: childrenProp,\n withFade = false,\n}: {\n children: ReactNode\n withFade?: boolean\n}) => {\n const [isFullScreen, setIsFullScreen] = useState(false)\n\n return (\n <DialogContext.Provider\n value={{\n isFullScreen,\n setIsFullScreen,\n withFade,\n }}\n >\n {childrenProp}\n </DialogContext.Provider>\n )\n}\n\nexport const useDialog = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw Error('useDialog must be used within a Dialog provider')\n }\n\n return context\n}\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps {\n /**\n * Children of the component.\n */\n children?: RadixDialog.DialogProps['children']\n /**\n * Specifies if the dialog is open or not.\n */\n open?: RadixDialog.DialogProps['open']\n /**\n * Default open state.\n */\n defaultOpen?: RadixDialog.DialogProps['defaultOpen']\n /**\n * Handler executen on every dialog open state change.\n */\n onOpenChange?: RadixDialog.DialogProps['onOpenChange']\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: RadixDialog.DialogProps['modal']\n /**\n * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).\n */\n withFade?: boolean\n}\n\nexport const Dialog = ({ children, withFade = false, ...rest }: DialogProps): ReactElement => {\n const open = rest.open\n const activeElementRef = useRef<Element>(null)\n\n /**\n * This function captures the active element when the Dialog is opened\n * and sets focus back to it when the Dialog is closed.\n */\n function handleActiveElementFocus() {\n if (open && document.activeElement) {\n activeElementRef.current = document.activeElement\n }\n\n if (!open) {\n setTimeout(() => {\n if (!(activeElementRef.current instanceof HTMLElement)) return\n activeElementRef.current.focus()\n }, 0)\n }\n }\n\n useEffect(handleActiveElementFocus, [open])\n\n return (\n <DialogProvider withFade={withFade}>\n <RadixDialog.Root {...rest}>{children}</RadixDialog.Root>\n </DialogProvider>\n )\n}\n\nDialog.displayName = 'Dialog.Root'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { useScrollOverflow } from '@spark-ui/hooks/use-scroll-overflow'\nimport { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref, useRef } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport interface BodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const Body = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: BodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useDialog()\n\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"dialog-body\"\n ref={ref}\n className={cx(\n 'focus-visible:u-outline relative grow overflow-y-auto outline-hidden',\n 'transition-all duration-300',\n {\n ['px-xl py-lg']: !inset,\n },\n className\n )}\n style={{\n ...(withFade && {\n maskImage:\n 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))',\n maskSize: `100% calc(100% + ${overflow.top ? '0px' : '44px'} + ${overflow.bottom ? '0px' : '44px'})`,\n maskPosition: `0 ${overflow.top ? '0px' : '-44px'}`,\n }),\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dialog.Body'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type CloseProps = RadixDialog.DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = (props: CloseProps) => <RadixDialog.Close {...props} />\n\nClose.displayName = 'Dialog.Close'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport { Close, CloseProps } from './DialogClose'\n\nexport type CloseButtonProps = CloseProps &\n Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>\n\nconst Root = ({\n 'aria-label': ariaLabel,\n className,\n size = 'md',\n intent = 'neutral',\n design = 'ghost',\n children = <CloseSVG />,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <Close\n data-spark-component=\"dialog-close-button\"\n data-part=\"close\"\n ref={ref}\n className={cx(['absolute', 'top-md', 'right-xl'], className)}\n asChild\n {...rest}\n >\n <IconButton intent={intent} size={size} design={design} aria-label={ariaLabel}>\n <Icon>{children}</Icon>\n </IconButton>\n </Close>\n )\n}\n\nexport const CloseButton = Object.assign(Root, {\n id: 'CloseButton',\n})\n\nRoot.displayName = 'Dialog.CloseButton'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {\n /**\n * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.\n */\n isNarrow?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Content = ({\n children,\n className,\n isNarrow = false,\n size = 'md',\n onInteractOutside,\n ref,\n ...rest\n}: ContentProps): ReactElement => {\n const { setIsFullScreen } = useDialog()\n\n useEffect(() => {\n if (size === 'fullscreen') setIsFullScreen(true)\n\n return () => setIsFullScreen(false)\n }, [setIsFullScreen, size])\n\n return (\n <RadixDialog.Content\n data-spark-component=\"dialog-content\"\n ref={ref}\n className={dialogContentStyles({\n className,\n isNarrow,\n size,\n })}\n onInteractOutside={e => {\n const isForegroundElement = (e.target as HTMLElement).closest('.z-toast, .z-popover')\n\n /**\n * The focus trap of the dialog applies `pointer-events-none` on the body of the page in the background, but\n * some components with an higher z-index have `pointer-events-auto` applied on them to remain interactive and ignore the focust trap (ex: a Snackbar with actions).\n *\n * Clicking on the snackbar will be considered as an \"outside click\" and close the dialog. We want to prevent this.\n */\n if (isForegroundElement) {\n e.preventDefault()\n }\n\n onInteractOutside?.(e)\n }}\n {...rest}\n >\n {children}\n </RadixDialog.Content>\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type DescriptionProps = RadixDialog.DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <RadixDialog.Description data-spark-component=\"dialog-description\" {...props} />\n)\n\nDescription.displayName = 'Dialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface FooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Footer = ({ children, className, ref, ...rest }: FooterProps): ReactElement => (\n <footer\n data-spark-component=\"dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nFooter.displayName = 'Dialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps): ReactElement => (\n <header\n data-spark-component=\"dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nHeader.displayName = 'Dialog.Header'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport type OverlayProps = RadixDialog.DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ref, ...rest }: OverlayProps): ReactElement | null => {\n const { isFullScreen } = useDialog()\n\n return (\n <RadixDialog.Overlay\n data-spark-component=\"dialog-overlay\"\n ref={ref}\n className={cx(\n isFullScreen ? 'hidden' : 'fixed',\n ['top-0', 'left-0', 'w-screen', 'h-screen', 'z-overlay'],\n ['bg-overlay/dim-1'],\n ['data-[state=open]:animate-fade-in'],\n ['data-[state=closed]:animate-fade-out'],\n className\n )}\n {...rest}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement } from 'react'\n\nexport type PortalProps = RadixDialog.DialogPortalProps\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixDialog.Portal {...rest}>{children}</RadixDialog.Portal>\n)\n\nPortal.displayName = 'Dialog.Portal'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TitleProps = RadixDialog.DialogTitleProps & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <RadixDialog.Title\n data-spark-component=\"dialog-title\"\n ref={ref}\n className={cx(\n 'text-headline-1 text-on-surface',\n 'group-has-data-[part=close]:pr-3xl',\n className\n )}\n {...others}\n />\n )\n}\n\nTitle.displayName = 'Dialog.Title'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, ReactNode, Ref } from 'react'\n\nexport interface TriggerProps {\n /**\n * Children of the component.\n */\n children?: ReactNode\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: RadixDialog.DialogTriggerProps['asChild']\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = (props: TriggerProps): ReactElement => (\n <RadixDialog.Trigger data-spark-component=\"dialog-trigger\" {...props} />\n)\n\nTrigger.displayName = 'Dialog.Trigger'\n","import { Dialog as Root } from './Dialog'\nimport { Body } from './DialogBody'\nimport { Close } from './DialogClose'\nimport { CloseButton } from './DialogCloseButton'\nimport { Content } from './DialogContent'\nimport { Description } from './DialogDescription' // aria-describedby\nimport { Footer } from './DialogFooter'\nimport { Header } from './DialogHeader'\nimport { Overlay } from './DialogOverlay'\nimport { Portal } from './DialogPortal'\nimport { Title } from './DialogTitle' // aria-labelledby\nimport { Trigger } from './DialogTrigger'\n\nexport const Dialog: typeof Root & {\n Trigger: typeof Trigger\n Portal: typeof Portal\n Overlay: typeof Overlay\n Content: typeof Content\n Header: typeof Header\n Body: typeof Body\n Footer: typeof Footer\n Close: typeof Close\n CloseButton: typeof CloseButton\n Title: typeof Title\n Description: typeof Description\n} = Object.assign(Root, {\n Trigger,\n Portal,\n Overlay,\n Content,\n Header,\n Body,\n Footer,\n Close,\n CloseButton,\n Title,\n Description,\n})\n\nDialog.displayName = 'Dialog'\nDialog.Trigger.displayName = 'Dialog.Trigger'\nTrigger.displayName = 'Dialog.Trigger'\nPortal.displayName = 'Dialog.Portal'\nOverlay.displayName = 'Dialog.Overlay'\nContent.displayName = 'Dialog.Content'\nHeader.displayName = 'Dialog.Header'\nBody.displayName = 'Dialog.Body'\nFooter.displayName = 'Dialog.Footer'\nCloseButton.displayName = 'Dialog.CloseButton'\nTitle.displayName = 'Dialog.Title'\nDescription.displayName = 'Dialog.Description'\n\nexport { type DialogProps } from './Dialog'\nexport { type ContentProps as DialogContentProps } from './DialogContent'\nexport { type HeaderProps as DialogHeaderProps } from './DialogHeader'\nexport { type BodyProps as DialogBodyProps } from './DialogBody'\nexport { type FooterProps as DialogFooterProps } from './DialogFooter'\nexport { type TriggerProps as DialogTriggerProps } from './DialogTrigger'\nexport { type OverlayProps as DialogOverlayProps } from './DialogOverlay'\nexport { type PortalProps as DialogPortalProps } from './DialogPortal'\nexport { type TitleProps as DialogTitleProps } from './DialogTitle'\nexport { type DescriptionProps as DialogDescriptionProps } from './DialogDescription'\nexport { type CloseProps as DialogCloseProps } from './DialogClose'\nexport { type CloseButtonProps as DialogCloseButtonProps } from './DialogCloseButton'\n"],"names":["DialogContext","createContext","DialogProvider","childrenProp","withFade","isFullScreen","setIsFullScreen","useState","jsx","useDialog","context","useContext","Dialog","children","rest","open","activeElementRef","useRef","handleActiveElementFocus","useEffect","RadixDialog","Body","className","inset","forwardedRef","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","Close","props","Root","ariaLabel","size","intent","design","CloseSVG","IconButton","Icon","CloseButton","Content","isNarrow","onInteractOutside","dialogContentStyles","e","Description","Foot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BW,EAAM,YAAc,eACpBL,EAAY,YAAc"}
|
package/dist/dialog/index.mjs
CHANGED
|
@@ -1,166 +1,166 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useMergeRefs as
|
|
5
|
-
import { useScrollOverflow as
|
|
6
|
-
import {
|
|
7
|
-
import { Close as
|
|
8
|
-
import { I as
|
|
9
|
-
import { I as
|
|
10
|
-
import { d as
|
|
11
|
-
const T =
|
|
2
|
+
import { Dialog as s } from "radix-ui";
|
|
3
|
+
import { createContext as I, useState as O, useContext as S, useRef as b, useEffect as k } from "react";
|
|
4
|
+
import { useMergeRefs as P } from "@spark-ui/hooks/use-merge-refs";
|
|
5
|
+
import { useScrollOverflow as R } from "@spark-ui/hooks/use-scroll-overflow";
|
|
6
|
+
import { cx as d } from "class-variance-authority";
|
|
7
|
+
import { Close as $ } from "@spark-ui/icons/Close";
|
|
8
|
+
import { I as H } from "../Icon-Ck-dhfLd.mjs";
|
|
9
|
+
import { I as j } from "../IconButton-C62-axzv.mjs";
|
|
10
|
+
import { d as z } from "../DialogContent.styles-_lRDsl8c.mjs";
|
|
11
|
+
const T = I(null), A = ({
|
|
12
12
|
children: e,
|
|
13
|
-
withFade:
|
|
13
|
+
withFade: o = !1
|
|
14
14
|
}) => {
|
|
15
|
-
const [t,
|
|
15
|
+
const [t, a] = O(!1);
|
|
16
16
|
return /* @__PURE__ */ l(
|
|
17
17
|
T.Provider,
|
|
18
18
|
{
|
|
19
19
|
value: {
|
|
20
20
|
isFullScreen: t,
|
|
21
|
-
setIsFullScreen:
|
|
22
|
-
withFade:
|
|
21
|
+
setIsFullScreen: a,
|
|
22
|
+
withFade: o
|
|
23
23
|
},
|
|
24
24
|
children: e
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
|
-
},
|
|
28
|
-
const e =
|
|
27
|
+
}, m = () => {
|
|
28
|
+
const e = S(T);
|
|
29
29
|
if (!e)
|
|
30
30
|
throw Error("useDialog must be used within a Dialog provider");
|
|
31
31
|
return e;
|
|
32
|
-
},
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
}, F = ({ children: e, withFade: o = !1, ...t }) => {
|
|
33
|
+
const a = t.open, r = b(null);
|
|
34
|
+
function i() {
|
|
35
|
+
a && document.activeElement && (r.current = document.activeElement), a || setTimeout(() => {
|
|
36
|
+
r.current instanceof HTMLElement && r.current.focus();
|
|
37
37
|
}, 0);
|
|
38
38
|
}
|
|
39
|
-
return
|
|
39
|
+
return k(i, [a]), /* @__PURE__ */ l(A, { withFade: o, children: /* @__PURE__ */ l(s.Root, { ...t, children: e }) });
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
const
|
|
41
|
+
F.displayName = "Dialog.Root";
|
|
42
|
+
const g = ({
|
|
43
43
|
children: e,
|
|
44
|
-
className:
|
|
44
|
+
className: o,
|
|
45
45
|
inset: t = !1,
|
|
46
|
-
ref:
|
|
47
|
-
...
|
|
46
|
+
ref: a,
|
|
47
|
+
...r
|
|
48
48
|
}) => {
|
|
49
|
-
const
|
|
49
|
+
const i = b(null), p = P(a, i), { withFade: n } = m(), { overflow: c } = R(i);
|
|
50
50
|
return /* @__PURE__ */ l(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
53
|
"data-spark-component": "dialog-body",
|
|
54
|
-
ref:
|
|
55
|
-
className:
|
|
54
|
+
ref: p,
|
|
55
|
+
className: d(
|
|
56
56
|
"focus-visible:u-outline relative grow overflow-y-auto outline-hidden",
|
|
57
57
|
"transition-all duration-300",
|
|
58
58
|
{
|
|
59
59
|
"px-xl py-lg": !t
|
|
60
60
|
},
|
|
61
|
-
|
|
61
|
+
o
|
|
62
62
|
),
|
|
63
63
|
style: {
|
|
64
|
-
...
|
|
64
|
+
...n && {
|
|
65
65
|
maskImage: "linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
|
|
66
|
-
maskSize: `100% calc(100% + ${
|
|
67
|
-
maskPosition: `0 ${
|
|
66
|
+
maskSize: `100% calc(100% + ${c.top ? "0px" : "44px"} + ${c.bottom ? "0px" : "44px"})`,
|
|
67
|
+
maskPosition: `0 ${c.top ? "0px" : "-44px"}`
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
...
|
|
70
|
+
...r,
|
|
71
71
|
children: e
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
74
|
};
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const
|
|
75
|
+
g.displayName = "Dialog.Body";
|
|
76
|
+
const u = (e) => /* @__PURE__ */ l(s.Close, { ...e });
|
|
77
|
+
u.displayName = "Dialog.Close";
|
|
78
|
+
const E = ({
|
|
79
79
|
"aria-label": e,
|
|
80
|
-
className:
|
|
80
|
+
className: o,
|
|
81
81
|
size: t = "md",
|
|
82
|
-
intent:
|
|
83
|
-
design:
|
|
84
|
-
children:
|
|
85
|
-
ref:
|
|
86
|
-
...
|
|
82
|
+
intent: a = "neutral",
|
|
83
|
+
design: r = "ghost",
|
|
84
|
+
children: i = /* @__PURE__ */ l($, {}),
|
|
85
|
+
ref: p,
|
|
86
|
+
...n
|
|
87
87
|
}) => /* @__PURE__ */ l(
|
|
88
|
-
|
|
88
|
+
u,
|
|
89
89
|
{
|
|
90
90
|
"data-spark-component": "dialog-close-button",
|
|
91
91
|
"data-part": "close",
|
|
92
|
-
ref:
|
|
93
|
-
className:
|
|
92
|
+
ref: p,
|
|
93
|
+
className: d(["absolute", "top-md", "right-xl"], o),
|
|
94
94
|
asChild: !0,
|
|
95
|
-
...
|
|
96
|
-
children: /* @__PURE__ */ l(
|
|
95
|
+
...n,
|
|
96
|
+
children: /* @__PURE__ */ l(j, { intent: a, size: t, design: r, "aria-label": e, children: /* @__PURE__ */ l(H, { children: i }) })
|
|
97
97
|
}
|
|
98
|
-
),
|
|
98
|
+
), w = Object.assign(E, {
|
|
99
99
|
id: "CloseButton"
|
|
100
100
|
});
|
|
101
|
-
|
|
102
|
-
const
|
|
101
|
+
E.displayName = "Dialog.CloseButton";
|
|
102
|
+
const f = ({
|
|
103
103
|
children: e,
|
|
104
|
-
className:
|
|
104
|
+
className: o,
|
|
105
105
|
isNarrow: t = !1,
|
|
106
|
-
size:
|
|
107
|
-
onInteractOutside:
|
|
108
|
-
ref:
|
|
109
|
-
...
|
|
106
|
+
size: a = "md",
|
|
107
|
+
onInteractOutside: r,
|
|
108
|
+
ref: i,
|
|
109
|
+
...p
|
|
110
110
|
}) => {
|
|
111
|
-
const { setIsFullScreen:
|
|
112
|
-
return
|
|
113
|
-
|
|
111
|
+
const { setIsFullScreen: n } = m();
|
|
112
|
+
return k(() => (a === "fullscreen" && n(!0), () => n(!1)), [n, a]), /* @__PURE__ */ l(
|
|
113
|
+
s.Content,
|
|
114
114
|
{
|
|
115
115
|
"data-spark-component": "dialog-content",
|
|
116
|
-
ref:
|
|
117
|
-
className:
|
|
118
|
-
className:
|
|
116
|
+
ref: i,
|
|
117
|
+
className: z({
|
|
118
|
+
className: o,
|
|
119
119
|
isNarrow: t,
|
|
120
|
-
size:
|
|
120
|
+
size: a
|
|
121
121
|
}),
|
|
122
|
-
onInteractOutside: (
|
|
123
|
-
|
|
122
|
+
onInteractOutside: (c) => {
|
|
123
|
+
c.target.closest(".z-toast, .z-popover") && c.preventDefault(), r?.(c);
|
|
124
124
|
},
|
|
125
|
-
...
|
|
125
|
+
...p,
|
|
126
126
|
children: e
|
|
127
127
|
}
|
|
128
128
|
);
|
|
129
129
|
};
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
const
|
|
130
|
+
f.displayName = "Dialog.Content";
|
|
131
|
+
const y = (e) => /* @__PURE__ */ l(s.Description, { "data-spark-component": "dialog-description", ...e });
|
|
132
|
+
y.displayName = "Dialog.Description";
|
|
133
|
+
const D = ({ children: e, className: o, ref: t, ...a }) => /* @__PURE__ */ l(
|
|
134
134
|
"footer",
|
|
135
135
|
{
|
|
136
136
|
"data-spark-component": "dialog-footer",
|
|
137
137
|
ref: t,
|
|
138
|
-
className:
|
|
139
|
-
...
|
|
138
|
+
className: d(o, ["px-xl", "py-lg"]),
|
|
139
|
+
...a,
|
|
140
140
|
children: e
|
|
141
141
|
}
|
|
142
142
|
);
|
|
143
|
-
|
|
144
|
-
const
|
|
143
|
+
D.displayName = "Dialog.Footer";
|
|
144
|
+
const N = ({ children: e, className: o, ref: t, ...a }) => /* @__PURE__ */ l(
|
|
145
145
|
"header",
|
|
146
146
|
{
|
|
147
147
|
"data-spark-component": "dialog-header",
|
|
148
148
|
ref: t,
|
|
149
|
-
className:
|
|
150
|
-
...
|
|
149
|
+
className: d(o, ["px-xl", "py-lg"]),
|
|
150
|
+
...a,
|
|
151
151
|
children: e
|
|
152
152
|
}
|
|
153
153
|
);
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
const { isFullScreen:
|
|
154
|
+
N.displayName = "Dialog.Header";
|
|
155
|
+
const x = ({ className: e, ref: o, ...t }) => {
|
|
156
|
+
const { isFullScreen: a } = m();
|
|
157
157
|
return /* @__PURE__ */ l(
|
|
158
|
-
|
|
158
|
+
s.Overlay,
|
|
159
159
|
{
|
|
160
160
|
"data-spark-component": "dialog-overlay",
|
|
161
|
-
ref:
|
|
162
|
-
className:
|
|
163
|
-
|
|
161
|
+
ref: o,
|
|
162
|
+
className: d(
|
|
163
|
+
a ? "hidden" : "fixed",
|
|
164
164
|
["top-0", "left-0", "w-screen", "h-screen", "z-overlay"],
|
|
165
165
|
["bg-overlay/dim-1"],
|
|
166
166
|
["data-[state=open]:animate-fade-in"],
|
|
@@ -171,15 +171,15 @@ const N = ({ className: e, ref: a, ...t }) => {
|
|
|
171
171
|
}
|
|
172
172
|
);
|
|
173
173
|
};
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
|
|
174
|
+
x.displayName = "Dialog.Overlay";
|
|
175
|
+
const v = ({ children: e, ...o }) => /* @__PURE__ */ l(s.Portal, { ...o, children: e });
|
|
176
|
+
v.displayName = "Dialog.Portal";
|
|
177
|
+
const h = ({ className: e, ref: o, ...t }) => /* @__PURE__ */ l(
|
|
178
|
+
s.Title,
|
|
179
179
|
{
|
|
180
180
|
"data-spark-component": "dialog-title",
|
|
181
|
-
ref:
|
|
182
|
-
className:
|
|
181
|
+
ref: o,
|
|
182
|
+
className: d(
|
|
183
183
|
"text-headline-1 text-on-surface",
|
|
184
184
|
"group-has-data-[part=close]:pr-3xl",
|
|
185
185
|
e
|
|
@@ -187,35 +187,35 @@ const v = ({ className: e, ref: a, ...t }) => /* @__PURE__ */ l(
|
|
|
187
187
|
...t
|
|
188
188
|
}
|
|
189
189
|
);
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
Trigger:
|
|
195
|
-
Portal:
|
|
196
|
-
Overlay:
|
|
197
|
-
Content:
|
|
198
|
-
Header:
|
|
199
|
-
Body:
|
|
200
|
-
Footer:
|
|
201
|
-
Close:
|
|
202
|
-
CloseButton:
|
|
203
|
-
Title:
|
|
204
|
-
Description:
|
|
190
|
+
h.displayName = "Dialog.Title";
|
|
191
|
+
const C = (e) => /* @__PURE__ */ l(s.Trigger, { "data-spark-component": "dialog-trigger", ...e });
|
|
192
|
+
C.displayName = "Dialog.Trigger";
|
|
193
|
+
const B = Object.assign(F, {
|
|
194
|
+
Trigger: C,
|
|
195
|
+
Portal: v,
|
|
196
|
+
Overlay: x,
|
|
197
|
+
Content: f,
|
|
198
|
+
Header: N,
|
|
199
|
+
Body: g,
|
|
200
|
+
Footer: D,
|
|
201
|
+
Close: u,
|
|
202
|
+
CloseButton: w,
|
|
203
|
+
Title: h,
|
|
204
|
+
Description: y
|
|
205
205
|
});
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
206
|
+
B.displayName = "Dialog";
|
|
207
|
+
B.Trigger.displayName = "Dialog.Trigger";
|
|
208
|
+
C.displayName = "Dialog.Trigger";
|
|
209
|
+
v.displayName = "Dialog.Portal";
|
|
210
|
+
x.displayName = "Dialog.Overlay";
|
|
211
|
+
f.displayName = "Dialog.Content";
|
|
212
|
+
N.displayName = "Dialog.Header";
|
|
213
|
+
g.displayName = "Dialog.Body";
|
|
214
|
+
D.displayName = "Dialog.Footer";
|
|
215
|
+
w.displayName = "Dialog.CloseButton";
|
|
216
|
+
h.displayName = "Dialog.Title";
|
|
217
|
+
y.displayName = "Dialog.Description";
|
|
218
218
|
export {
|
|
219
|
-
|
|
219
|
+
B as Dialog
|
|
220
220
|
};
|
|
221
221
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/dialog/DialogContext.tsx","../../src/dialog/Dialog.tsx","../../src/dialog/DialogBody.tsx","../../src/dialog/DialogClose.tsx","../../src/dialog/DialogCloseButton.tsx","../../src/dialog/DialogContent.tsx","../../src/dialog/DialogDescription.tsx","../../src/dialog/DialogFooter.tsx","../../src/dialog/DialogHeader.tsx","../../src/dialog/DialogOverlay.tsx","../../src/dialog/DialogPortal.tsx","../../src/dialog/DialogTitle.tsx","../../src/dialog/DialogTrigger.tsx","../../src/dialog/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\nexport interface DialogContextState {\n isFullScreen: boolean\n setIsFullScreen: (value: boolean) => void\n withFade: boolean\n}\n\nconst DialogContext = createContext<DialogContextState | null>(null)\n\nexport const DialogProvider = ({\n children: childrenProp,\n withFade = false,\n}: {\n children: ReactNode\n withFade?: boolean\n}) => {\n const [isFullScreen, setIsFullScreen] = useState(false)\n\n return (\n <DialogContext.Provider\n value={{\n isFullScreen,\n setIsFullScreen,\n withFade,\n }}\n >\n {childrenProp}\n </DialogContext.Provider>\n )\n}\n\nexport const useDialog = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw Error('useDialog must be used within a Dialog provider')\n }\n\n return context\n}\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps {\n /**\n * Children of the component.\n */\n children?: RadixDialog.DialogProps['children']\n /**\n * Specifies if the dialog is open or not.\n */\n open?: RadixDialog.DialogProps['open']\n /**\n * Default open state.\n */\n defaultOpen?: RadixDialog.DialogProps['defaultOpen']\n /**\n * Handler executen on every dialog open state change.\n */\n onOpenChange?: RadixDialog.DialogProps['onOpenChange']\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: RadixDialog.DialogProps['modal']\n /**\n * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).\n */\n withFade?: boolean\n}\n\nexport const Dialog = ({ children, withFade = false, ...rest }: DialogProps): ReactElement => {\n const open = rest.open\n const activeElementRef = useRef<Element>(null)\n\n /**\n * This function captures the active element when the Dialog is opened\n * and sets focus back to it when the Dialog is closed.\n */\n function handleActiveElementFocus() {\n if (open && document.activeElement) {\n activeElementRef.current = document.activeElement\n }\n\n if (!open) {\n setTimeout(() => {\n if (!(activeElementRef.current instanceof HTMLElement)) return\n activeElementRef.current.focus()\n }, 0)\n }\n }\n\n useEffect(handleActiveElementFocus, [open])\n\n return (\n <DialogProvider withFade={withFade}>\n <RadixDialog.Root {...rest}>{children}</RadixDialog.Root>\n </DialogProvider>\n )\n}\n\nDialog.displayName = 'Dialog.Root'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { useScrollOverflow } from '@spark-ui/hooks/use-scroll-overflow'\nimport { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref, useRef } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport interface BodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const Body = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: BodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useDialog()\n\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"dialog-body\"\n ref={ref}\n className={cx(\n 'focus-visible:u-outline relative grow overflow-y-auto outline-hidden',\n 'transition-all duration-300',\n {\n ['px-xl py-lg']: !inset,\n },\n className\n )}\n style={{\n ...(withFade && {\n maskImage:\n 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))',\n maskSize: `100% calc(100% + ${overflow.top ? '0px' : '44px'} + ${overflow.bottom ? '0px' : '44px'})`,\n maskPosition: `0 ${overflow.top ? '0px' : '-44px'}`,\n }),\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dialog.Body'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type CloseProps = RadixDialog.DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = (props: CloseProps) => <RadixDialog.Close {...props} />\n\nClose.displayName = 'Dialog.Close'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport { Close, CloseProps } from './DialogClose'\n\nexport type CloseButtonProps = CloseProps &\n Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>\n\nconst Root = ({\n 'aria-label': ariaLabel,\n className,\n size = 'md',\n intent = 'neutral',\n design = 'ghost',\n children = <CloseSVG />,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <Close\n data-spark-component=\"dialog-close-button\"\n data-part=\"close\"\n ref={ref}\n className={cx(['absolute', 'top-md', 'right-xl'], className)}\n asChild\n {...rest}\n >\n <IconButton intent={intent} size={size} design={design} aria-label={ariaLabel}>\n <Icon>{children}</Icon>\n </IconButton>\n </Close>\n )\n}\n\nexport const CloseButton = Object.assign(Root, {\n id: 'CloseButton',\n})\n\nRoot.displayName = 'Dialog.CloseButton'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {\n /**\n * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.\n */\n isNarrow?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Content = ({\n children,\n className,\n isNarrow = false,\n size = 'md',\n onInteractOutside,\n ref,\n ...rest\n}: ContentProps): ReactElement => {\n const { setIsFullScreen } = useDialog()\n\n useEffect(() => {\n if (size === 'fullscreen') setIsFullScreen(true)\n\n return () => setIsFullScreen(false)\n }, [setIsFullScreen, size])\n\n return (\n <RadixDialog.Content\n data-spark-component=\"dialog-content\"\n ref={ref}\n className={dialogContentStyles({\n className,\n isNarrow,\n size,\n })}\n onInteractOutside={e => {\n const isForegroundElement = (e.target as HTMLElement).closest('.z-toast, .z-popover')\n\n /**\n * The focus trap of the dialog applies `pointer-events-none` on the body of the page in the background, but\n * some components with an higher z-index have `pointer-events-auto` applied on them to remain interactive and ignore the focust trap (ex: a Snackbar with actions).\n *\n * Clicking on the snackbar will be considered as an \"outside click\" and close the dialog. We want to prevent this.\n */\n if (isForegroundElement) {\n e.preventDefault()\n }\n\n onInteractOutside?.(e)\n }}\n {...rest}\n >\n {children}\n </RadixDialog.Content>\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type DescriptionProps = RadixDialog.DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <RadixDialog.Description data-spark-component=\"dialog-description\" {...props} />\n)\n\nDescription.displayName = 'Dialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface FooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Footer = ({ children, className, ref, ...rest }: FooterProps): ReactElement => (\n <footer\n data-spark-component=\"dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nFooter.displayName = 'Dialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps): ReactElement => (\n <header\n data-spark-component=\"dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nHeader.displayName = 'Dialog.Header'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport type OverlayProps = RadixDialog.DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ref, ...rest }: OverlayProps): ReactElement | null => {\n const { isFullScreen } = useDialog()\n\n return (\n <RadixDialog.Overlay\n data-spark-component=\"dialog-overlay\"\n ref={ref}\n className={cx(\n isFullScreen ? 'hidden' : 'fixed',\n ['top-0', 'left-0', 'w-screen', 'h-screen', 'z-overlay'],\n ['bg-overlay/dim-1'],\n ['data-[state=open]:animate-fade-in'],\n ['data-[state=closed]:animate-fade-out'],\n className\n )}\n {...rest}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement } from 'react'\n\nexport type PortalProps = RadixDialog.DialogPortalProps\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixDialog.Portal {...rest}>{children}</RadixDialog.Portal>\n)\n\nPortal.displayName = 'Dialog.Portal'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TitleProps = RadixDialog.DialogTitleProps & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <RadixDialog.Title\n data-spark-component=\"dialog-title\"\n ref={ref}\n className={cx(\n 'text-headline-1 text-on-surface',\n 'group-has-data-[part=close]:pr-3xl',\n className\n )}\n {...others}\n />\n )\n}\n\nTitle.displayName = 'Dialog.Title'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, ReactNode, Ref } from 'react'\n\nexport interface TriggerProps {\n /**\n * Children of the component.\n */\n children?: ReactNode\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: RadixDialog.DialogTriggerProps['asChild']\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = (props: TriggerProps): ReactElement => (\n <RadixDialog.Trigger data-spark-component=\"dialog-trigger\" {...props} />\n)\n\nTrigger.displayName = 'Dialog.Trigger'\n","import { Dialog as Root } from './Dialog'\nimport { Body } from './DialogBody'\nimport { Close } from './DialogClose'\nimport { CloseButton } from './DialogCloseButton'\nimport { Content } from './DialogContent'\nimport { Description } from './DialogDescription' // aria-describedby\nimport { Footer } from './DialogFooter'\nimport { Header } from './DialogHeader'\nimport { Overlay } from './DialogOverlay'\nimport { Portal } from './DialogPortal'\nimport { Title } from './DialogTitle' // aria-labelledby\nimport { Trigger } from './DialogTrigger'\n\nexport const Dialog: typeof Root & {\n Trigger: typeof Trigger\n Portal: typeof Portal\n Overlay: typeof Overlay\n Content: typeof Content\n Header: typeof Header\n Body: typeof Body\n Footer: typeof Footer\n Close: typeof Close\n CloseButton: typeof CloseButton\n Title: typeof Title\n Description: typeof Description\n} = Object.assign(Root, {\n Trigger,\n Portal,\n Overlay,\n Content,\n Header,\n Body,\n Footer,\n Close,\n CloseButton,\n Title,\n Description,\n})\n\nDialog.displayName = 'Dialog'\nDialog.Trigger.displayName = 'Dialog.Trigger'\nTrigger.displayName = 'Dialog.Trigger'\nPortal.displayName = 'Dialog.Portal'\nOverlay.displayName = 'Dialog.Overlay'\nContent.displayName = 'Dialog.Content'\nHeader.displayName = 'Dialog.Header'\nBody.displayName = 'Dialog.Body'\nFooter.displayName = 'Dialog.Footer'\nCloseButton.displayName = 'Dialog.CloseButton'\nTitle.displayName = 'Dialog.Title'\nDescription.displayName = 'Dialog.Description'\n\nexport { type DialogProps } from './Dialog'\nexport { type ContentProps as DialogContentProps } from './DialogContent'\nexport { type HeaderProps as DialogHeaderProps } from './DialogHeader'\nexport { type BodyProps as DialogBodyProps } from './DialogBody'\nexport { type FooterProps as DialogFooterProps } from './DialogFooter'\nexport { type TriggerProps as DialogTriggerProps } from './DialogTrigger'\nexport { type OverlayProps as DialogOverlayProps } from './DialogOverlay'\nexport { type PortalProps as DialogPortalProps } from './DialogPortal'\nexport { type TitleProps as DialogTitleProps } from './DialogTitle'\nexport { type DescriptionProps as DialogDescriptionProps } from './DialogDescription'\nexport { type CloseProps as DialogCloseProps } from './DialogClose'\nexport { type CloseButtonProps as DialogCloseButtonProps } from './DialogCloseButton'\n"],"names":["DialogContext","createContext","DialogProvider","childrenProp","withFade","isFullScreen","setIsFullScreen","useState","jsx","useDialog","context","useContext","Dialog","children","rest","open","activeElementRef","useRef","handleActiveElementFocus","useEffect","RadixDialog.Root","Body","className","inset","forwardedRef","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","Close","props","RadixDialog.Close","Root","ariaLabel","size","intent","design","CloseSVG","IconButton","Icon","CloseButton","Content","isNarrow","onInteractOutside","RadixDialog.Content","dialogContentStyles","e","Description","RadixDialog.Description","Footer","Header","Overlay","RadixDialog.Overlay","Portal","RadixDialog.Portal","Title","others","RadixDialog.Title","Trigger","RadixDialog.Trigger"],"mappings":";;;;;;;;;;AAQA,MAAMA,IAAgBC,EAAyC,IAAI,GAEtDC,IAAiB,CAAC;AAAA,EAC7B,UAAUC;AAAA,EACV,UAAAC,IAAW;AACb,MAGM;AACJ,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAS,EAAK;AAEtD,SACE,gBAAAC;AAAA,IAACR,EAAc;AAAA,IAAd;AAAA,MACC,OAAO;AAAA,QACL,cAAAK;AAAA,QACA,iBAAAC;AAAA,QACA,UAAAF;AAAA,MAAA;AAAA,MAGD,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP,GAEaM,IAAY,MAAM;AAC7B,QAAMC,IAAUC,EAAWX,CAAa;AAExC,MAAI,CAACU;AACH,UAAM,MAAM,iDAAiD;AAG/D,SAAOA;AACT,GCRaE,IAAS,CAAC,EAAE,UAAAC,GAAU,UAAAT,IAAW,IAAO,GAAGU,QAAsC;AAC5F,QAAMC,IAAOD,EAAK,MACZE,IAAmBC,EAAgB,IAAI;AAM7C,WAASC,IAA2B;AAClC,IAAIH,KAAQ,SAAS,kBACnBC,EAAiB,UAAU,SAAS,gBAGjCD,KACH,WAAW,MAAM;AACf,MAAMC,EAAiB,mBAAmB,eAC1CA,EAAiB,QAAQ,MAAA;AAAA,IAC3B,GAAG,CAAC;AAAA,EAER;AAEA,SAAAG,EAAUD,GAA0B,CAACH,CAAI,CAAC,GAGxC,gBAAAP,EAACN,GAAA,EAAe,UAAAE,GACd,UAAA,gBAAAI,EAACY,GAAA,EAAkB,GAAGN,GAAO,UAAAD,EAAA,CAAS,EAAA,CACxC;AAEJ;AAEAD,EAAO,cAAc;AC/Cd,MAAMS,IAAO,CAAC;AAAA,EACnB,UAAAR;AAAA,EACA,WAAAS;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,KAAKC;AAAA,EACL,GAAGV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A,WAAWI;AAAA,MACT;AAAA,MACA;AAAA,MACAR;AAAA,IAAA;AAAA,IAED,GAAGoC;AAAA,EAAA;AAAA;AAKVD,EAAM,cAAc;ACRb,MAAMG,IAAU,CAAC5B,MACtB,gBAAAxB,EAACqD,GAAA,EAAoB,wBAAqB,kBAAkB,GAAG7B,GAAO;AAGxE4B,EAAQ,cAAc;ACNf,MAAMhD,IAYT,OAAO,OAAOsB,GAAM;AAAA,EACtB,SAAA0B;AAAA,EACA,QAAAL;AAAA,EACA,SAAAF;AAAA,EACA,SAAAV;AAAA,EACA,QAAAS;AAAA,EACA,MAAA/B;AAAA,EACA,QAAA8B;AAAA,EACA,OAAApB;AAAA,EACA,aAAAW;AAAA,EACA,OAAAe;AAAA,EACA,aAAAR;AACF,CAAC;AAEDrC,EAAO,cAAc;AACrBA,EAAO,QAAQ,cAAc;AAC7BgD,EAAQ,cAAc;AACtBL,EAAO,cAAc;AACrBF,EAAQ,cAAc;AACtBV,EAAQ,cAAc;AACtBS,EAAO,cAAc;AACrB/B,EAAK,cAAc;AACnB8B,EAAO,cAAc;AACrBT,EAAY,cAAc;AAC1Be,EAAM,cAAc;AACpBR,EAAY,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/dialog/DialogContext.tsx","../../src/dialog/Dialog.tsx","../../src/dialog/DialogBody.tsx","../../src/dialog/DialogClose.tsx","../../src/dialog/DialogCloseButton.tsx","../../src/dialog/DialogContent.tsx","../../src/dialog/DialogDescription.tsx","../../src/dialog/DialogFooter.tsx","../../src/dialog/DialogHeader.tsx","../../src/dialog/DialogOverlay.tsx","../../src/dialog/DialogPortal.tsx","../../src/dialog/DialogTitle.tsx","../../src/dialog/DialogTrigger.tsx","../../src/dialog/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\nexport interface DialogContextState {\n isFullScreen: boolean\n setIsFullScreen: (value: boolean) => void\n withFade: boolean\n}\n\nconst DialogContext = createContext<DialogContextState | null>(null)\n\nexport const DialogProvider = ({\n children: childrenProp,\n withFade = false,\n}: {\n children: ReactNode\n withFade?: boolean\n}) => {\n const [isFullScreen, setIsFullScreen] = useState(false)\n\n return (\n <DialogContext.Provider\n value={{\n isFullScreen,\n setIsFullScreen,\n withFade,\n }}\n >\n {childrenProp}\n </DialogContext.Provider>\n )\n}\n\nexport const useDialog = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw Error('useDialog must be used within a Dialog provider')\n }\n\n return context\n}\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps {\n /**\n * Children of the component.\n */\n children?: RadixDialog.DialogProps['children']\n /**\n * Specifies if the dialog is open or not.\n */\n open?: RadixDialog.DialogProps['open']\n /**\n * Default open state.\n */\n defaultOpen?: RadixDialog.DialogProps['defaultOpen']\n /**\n * Handler executen on every dialog open state change.\n */\n onOpenChange?: RadixDialog.DialogProps['onOpenChange']\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: RadixDialog.DialogProps['modal']\n /**\n * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).\n */\n withFade?: boolean\n}\n\nexport const Dialog = ({ children, withFade = false, ...rest }: DialogProps): ReactElement => {\n const open = rest.open\n const activeElementRef = useRef<Element>(null)\n\n /**\n * This function captures the active element when the Dialog is opened\n * and sets focus back to it when the Dialog is closed.\n */\n function handleActiveElementFocus() {\n if (open && document.activeElement) {\n activeElementRef.current = document.activeElement\n }\n\n if (!open) {\n setTimeout(() => {\n if (!(activeElementRef.current instanceof HTMLElement)) return\n activeElementRef.current.focus()\n }, 0)\n }\n }\n\n useEffect(handleActiveElementFocus, [open])\n\n return (\n <DialogProvider withFade={withFade}>\n <RadixDialog.Root {...rest}>{children}</RadixDialog.Root>\n </DialogProvider>\n )\n}\n\nDialog.displayName = 'Dialog.Root'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { useScrollOverflow } from '@spark-ui/hooks/use-scroll-overflow'\nimport { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref, useRef } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport interface BodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const Body = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: BodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useDialog()\n\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"dialog-body\"\n ref={ref}\n className={cx(\n 'focus-visible:u-outline relative grow overflow-y-auto outline-hidden',\n 'transition-all duration-300',\n {\n ['px-xl py-lg']: !inset,\n },\n className\n )}\n style={{\n ...(withFade && {\n maskImage:\n 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))',\n maskSize: `100% calc(100% + ${overflow.top ? '0px' : '44px'} + ${overflow.bottom ? '0px' : '44px'})`,\n maskPosition: `0 ${overflow.top ? '0px' : '-44px'}`,\n }),\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dialog.Body'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type CloseProps = RadixDialog.DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = (props: CloseProps) => <RadixDialog.Close {...props} />\n\nClose.displayName = 'Dialog.Close'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport { Close, CloseProps } from './DialogClose'\n\nexport type CloseButtonProps = CloseProps &\n Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>\n\nconst Root = ({\n 'aria-label': ariaLabel,\n className,\n size = 'md',\n intent = 'neutral',\n design = 'ghost',\n children = <CloseSVG />,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <Close\n data-spark-component=\"dialog-close-button\"\n data-part=\"close\"\n ref={ref}\n className={cx(['absolute', 'top-md', 'right-xl'], className)}\n asChild\n {...rest}\n >\n <IconButton intent={intent} size={size} design={design} aria-label={ariaLabel}>\n <Icon>{children}</Icon>\n </IconButton>\n </Close>\n )\n}\n\nexport const CloseButton = Object.assign(Root, {\n id: 'CloseButton',\n})\n\nRoot.displayName = 'Dialog.CloseButton'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {\n /**\n * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.\n */\n isNarrow?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Content = ({\n children,\n className,\n isNarrow = false,\n size = 'md',\n onInteractOutside,\n ref,\n ...rest\n}: ContentProps): ReactElement => {\n const { setIsFullScreen } = useDialog()\n\n useEffect(() => {\n if (size === 'fullscreen') setIsFullScreen(true)\n\n return () => setIsFullScreen(false)\n }, [setIsFullScreen, size])\n\n return (\n <RadixDialog.Content\n data-spark-component=\"dialog-content\"\n ref={ref}\n className={dialogContentStyles({\n className,\n isNarrow,\n size,\n })}\n onInteractOutside={e => {\n const isForegroundElement = (e.target as HTMLElement).closest('.z-toast, .z-popover')\n\n /**\n * The focus trap of the dialog applies `pointer-events-none` on the body of the page in the background, but\n * some components with an higher z-index have `pointer-events-auto` applied on them to remain interactive and ignore the focust trap (ex: a Snackbar with actions).\n *\n * Clicking on the snackbar will be considered as an \"outside click\" and close the dialog. We want to prevent this.\n */\n if (isForegroundElement) {\n e.preventDefault()\n }\n\n onInteractOutside?.(e)\n }}\n {...rest}\n >\n {children}\n </RadixDialog.Content>\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type DescriptionProps = RadixDialog.DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <RadixDialog.Description data-spark-component=\"dialog-description\" {...props} />\n)\n\nDescription.displayName = 'Dialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface FooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Footer = ({ children, className, ref, ...rest }: FooterProps): ReactElement => (\n <footer\n data-spark-component=\"dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nFooter.displayName = 'Dialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps): ReactElement => (\n <header\n data-spark-component=\"dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nHeader.displayName = 'Dialog.Header'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport type OverlayProps = RadixDialog.DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ref, ...rest }: OverlayProps): ReactElement | null => {\n const { isFullScreen } = useDialog()\n\n return (\n <RadixDialog.Overlay\n data-spark-component=\"dialog-overlay\"\n ref={ref}\n className={cx(\n isFullScreen ? 'hidden' : 'fixed',\n ['top-0', 'left-0', 'w-screen', 'h-screen', 'z-overlay'],\n ['bg-overlay/dim-1'],\n ['data-[state=open]:animate-fade-in'],\n ['data-[state=closed]:animate-fade-out'],\n className\n )}\n {...rest}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement } from 'react'\n\nexport type PortalProps = RadixDialog.DialogPortalProps\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixDialog.Portal {...rest}>{children}</RadixDialog.Portal>\n)\n\nPortal.displayName = 'Dialog.Portal'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TitleProps = RadixDialog.DialogTitleProps & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <RadixDialog.Title\n data-spark-component=\"dialog-title\"\n ref={ref}\n className={cx(\n 'text-headline-1 text-on-surface',\n 'group-has-data-[part=close]:pr-3xl',\n className\n )}\n {...others}\n />\n )\n}\n\nTitle.displayName = 'Dialog.Title'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, ReactNode, Ref } from 'react'\n\nexport interface TriggerProps {\n /**\n * Children of the component.\n */\n children?: ReactNode\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: RadixDialog.DialogTriggerProps['asChild']\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = (props: TriggerProps): ReactElement => (\n <RadixDialog.Trigger data-spark-component=\"dialog-trigger\" {...props} />\n)\n\nTrigger.displayName = 'Dialog.Trigger'\n","import { Dialog as Root } from './Dialog'\nimport { Body } from './DialogBody'\nimport { Close } from './DialogClose'\nimport { CloseButton } from './DialogCloseButton'\nimport { Content } from './DialogContent'\nimport { Description } from './DialogDescription' // aria-describedby\nimport { Footer } from './DialogFooter'\nimport { Header } from './DialogHeader'\nimport { Overlay } from './DialogOverlay'\nimport { Portal } from './DialogPortal'\nimport { Title } from './DialogTitle' // aria-labelledby\nimport { Trigger } from './DialogTrigger'\n\nexport const Dialog: typeof Root & {\n Trigger: typeof Trigger\n Portal: typeof Portal\n Overlay: typeof Overlay\n Content: typeof Content\n Header: typeof Header\n Body: typeof Body\n Footer: typeof Footer\n Close: typeof Close\n CloseButton: typeof CloseButton\n Title: typeof Title\n Description: typeof Description\n} = Object.assign(Root, {\n Trigger,\n Portal,\n Overlay,\n Content,\n Header,\n Body,\n Footer,\n Close,\n CloseButton,\n Title,\n Description,\n})\n\nDialog.displayName = 'Dialog'\nDialog.Trigger.displayName = 'Dialog.Trigger'\nTrigger.displayName = 'Dialog.Trigger'\nPortal.displayName = 'Dialog.Portal'\nOverlay.displayName = 'Dialog.Overlay'\nContent.displayName = 'Dialog.Content'\nHeader.displayName = 'Dialog.Header'\nBody.displayName = 'Dialog.Body'\nFooter.displayName = 'Dialog.Footer'\nCloseButton.displayName = 'Dialog.CloseButton'\nTitle.displayName = 'Dialog.Title'\nDescription.displayName = 'Dialog.Description'\n\nexport { type DialogProps } from './Dialog'\nexport { type ContentProps as DialogContentProps } from './DialogContent'\nexport { type HeaderProps as DialogHeaderProps } from './DialogHeader'\nexport { type BodyProps as DialogBodyProps } from './DialogBody'\nexport { type FooterProps as DialogFooterProps } from './DialogFooter'\nexport { type TriggerProps as DialogTriggerProps } from './DialogTrigger'\nexport { type OverlayProps as DialogOverlayProps } from './DialogOverlay'\nexport { type PortalProps as DialogPortalProps } from './DialogPortal'\nexport { type TitleProps as DialogTitleProps } from './DialogTitle'\nexport { type DescriptionProps as DialogDescriptionProps } from './DialogDescription'\nexport { type CloseProps as DialogCloseProps } from './DialogClose'\nexport { type CloseButtonProps as DialogCloseButtonProps } from './DialogCloseButton'\n"],"names":["DialogContext","createContext","DialogProvider","childrenProp","withFade","isFullScreen","setIsFullScreen","useState","jsx","useDialog","context","useContext","Dialog","children","rest","open","activeElementRef","useRef","handleActiveElementFocus","useEffect","RadixDialog","Body","className","inset","forwardedRef","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","Close","props","Root","ariaLabel","size","intent","design","CloseSVG","IconButton","Icon","CloseButton","Content","isNarrow","onInteractOutside","dialogContentStyles","e","Description","Footer","Header","Overlay","Portal","Title","others","Trigger"],"mappings":";;;;;;;;;;AAQA,MAAMA,IAAgBC,EAAyC,IAAI,GAEtDC,IAAiB,CAAC;AAAA,EAC7B,UAAUC;AAAA,EACV,UAAAC,IAAW;AACb,MAGM;AACJ,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAS,EAAK;AAEtD,SACE,gBAAAC;AAAA,IAACR,EAAc;AAAA,IAAd;AAAA,MACC,OAAO;AAAA,QACL,cAAAK;AAAA,QACA,iBAAAC;AAAA,QACA,UAAAF;AAAA,MAAA;AAAA,MAGD,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP,GAEaM,IAAY,MAAM;AAC7B,QAAMC,IAAUC,EAAWX,CAAa;AAExC,MAAI,CAACU;AACH,UAAM,MAAM,iDAAiD;AAG/D,SAAOA;AACT,GCRaE,IAAS,CAAC,EAAE,UAAAC,GAAU,UAAAT,IAAW,IAAO,GAAGU,QAAsC;AAC5F,QAAMC,IAAOD,EAAK,MACZE,IAAmBC,EAAgB,IAAI;AAM7C,WAASC,IAA2B;AAClC,IAAIH,KAAQ,SAAS,kBACnBC,EAAiB,UAAU,SAAS,gBAGjCD,KACH,WAAW,MAAM;AACf,MAAMC,EAAiB,mBAAmB,eAC1CA,EAAiB,QAAQ,MAAA;AAAA,IAC3B,GAAG,CAAC;AAAA,EAER;AAEA,SAAAG,EAAUD,GAA0B,CAACH,CAAI,CAAC,GAGxC,gBAAAP,EAACN,GAAA,EAAe,UAAAE,GACd,UAAA,gBAAAI,EAACY,EAAY,MAAZ,EAAkB,GAAGN,GAAO,UAAAD,EAAA,CAAS,EAAA,CACxC;AAEJ;AAEAD,EAAO,cAAc;AC/Cd,MAAMS,IAAO,CAAC;AAAA,EACnB,UAAAR;AAAA,E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,GAAG2B,QAEvC,gBAAA7C;AAAA,EAACY,EAAY;AAAA,EAAZ;AAAA,IACC,wBAAqB;AAAA,IACrB,KAAAM;AAAA,IACA,WAAWI;AAAA,MACT;AAAA,MACA;AAAA,MACAR;AAAA,IAAA;AAAA,IAED,GAAG+B;AAAA,EAAA;AAAA;AAKVD,EAAM,cAAc;ACRb,MAAME,IAAU,CAACtB,MACtB,gBAAAxB,EAACY,EAAY,SAAZ,EAAoB,wBAAqB,kBAAkB,GAAGY,GAAO;AAGxEsB,EAAQ,cAAc;ACNf,MAAM1C,IAYT,OAAO,OAAOqB,GAAM;AAAA,EACtB,SAAAqB;AAAA,EACA,QAAAH;AAAA,EACA,SAAAD;AAAA,EACA,SAAAR;AAAA,EACA,QAAAO;AAAA,EACA,MAAA5B;AAAA,EACA,QAAA2B;AAAA,EACA,OAAAjB;AAAA,EACA,aAAAU;AAAA,EACA,OAAAW;AAAA,EACA,aAAAL;AACF,CAAC;AAEDnC,EAAO,cAAc;AACrBA,EAAO,QAAQ,cAAc;AAC7B0C,EAAQ,cAAc;AACtBH,EAAO,cAAc;AACrBD,EAAQ,cAAc;AACtBR,EAAQ,cAAc;AACtBO,EAAO,cAAc;AACrB5B,EAAK,cAAc;AACnB2B,EAAO,cAAc;AACrBP,EAAY,cAAc;AAC1BW,EAAM,cAAc;AACpBL,EAAY,cAAc;"}
|
package/dist/divider/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),n=require("class-variance-authority"),p=require("radix-ui"),t=require("@spark-ui/internal-utils"),y=[{intent:"current",isEmpty:!0,class:t.tw(["border-current"])},{intent:"current",isEmpty:!1,class:t.tw(["before:border-current after:border-current"])},{intent:"outline",isEmpty:!0,class:t.tw(["border-outline"])},{intent:"outline",isEmpty:!1,class:t.tw(["before:border-outline after:border-outline"])}],v=n.cva(["overflow-hidden group"],{variants:{isEmpty:{true:["border-solid"],false:["inline-flex items-center","after:border-solid before:border-solid"]},orientation:{vertical:["w-fit inline-flex"],horizontal:["w-full"]},writingMode:{"horizontal-tb":[],"vertical-lr":[]},alignment:{start:[],end:[],center:[]},intent:{current:[],outline:[]}},defaultVariants:{orientation:"horizontal",writingMode:"horizontal-tb",alignment:"center",intent:"outline"},compoundVariants:[{isEmpty:!0,orientation:"horizontal",class:t.tw(["my-lg border-t-sm"])},{isEmpty:!0,orientation:"vertical",class:t.tw(["mx-lg min-h-sz-24 border-l-sm"])},{isEmpty:!1,orientation:"horizontal",writingMode:"horizontal-tb",class:t.tw(["flex-row my-sm grow-0","before:border-t-sm","after:border-t-sm","*:px-lg"])},{isEmpty:!1,orientation:"vertical",writingMode:"horizontal-tb",class:t.tw(["flex-col mx-sm","before:border-l-sm","after:border-l-sm","*:py-lg"])},{isEmpty:!1,orientation:"vertical",writingMode:"vertical-lr",class:t.tw(["flex-col mx-sm","before:border-l-sm","after:border-l-sm","*:px-lg"])},{isEmpty:!1,orientation:"horizontal",alignment:"end",class:t.tw(["after:w-sz-40 before:grow after:grow-0"])},{isEmpty:!1,orientation:"horizontal",alignment:"start",class:t.tw(["before:w-sz-40 before:grow-0 after:grow"])},{isEmpty:!1,orientation:"horizontal",alignment:"center",class:t.tw(["justify-center before:grow after:grow"])},{isEmpty:!1,orientation:"vertical",alignment:"end",class:t.tw(["after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"start",class:t.tw(["before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"center",class:t.tw(["justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40"])},...y]}),m=({asChild:e,className:i,isDecorative:o=!1,children:r,orientation:s="horizontal",writingMode:l="horizontal-tb",alignment:f="center",intent:b="outline",ref:w,...g})=>{const u=e?!r?.props?.children:!r;return c.jsx(p.Separator.Root,{"data-spark-component":"divider",asChild:e,className:n.cx(v({isEmpty:u,orientation:s,alignment:f,intent:b,writingMode:l}),i),orientation:s,ref:w,decorative:o,...g,"data-writing-mode":l,children:r})};m.displayName="Divider";const d=({children:e,ref:i,className:o,...r})=>e?c.jsx("span",{"data-spark-component":"divider-content",ref:i,...r,className:n.cx("group-data-[writing-mode=vertical-lr]:[writing-mode:vertical-lr]",o),children:e}):null;d.displayName="Divider.Content";const a=Object.assign(m,{Content:d});a.displayName="Divider";a.Content.displayName="Divider.Content";exports.Divider=a;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|