@spark-ui/components 14.0.0-beta.1 → 14.0.0
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-BSfXHt21.mjs +61 -0
- package/dist/DialogContent.styles-BSfXHt21.mjs.map +1 -0
- package/dist/DialogContent.styles-bBs6l8Cy.js +2 -0
- package/dist/DialogContent.styles-bBs6l8Cy.js.map +1 -0
- 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/AlertDialogPortal.d.ts +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 +139 -2475
- 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/Dialog.d.ts +13 -13
- package/dist/dialog/DialogClose.d.ts +9 -8
- package/dist/dialog/DialogContent.d.ts +4 -4
- package/dist/dialog/DialogDescription.d.ts +3 -3
- package/dist/dialog/DialogOverlay.d.ts +5 -5
- package/dist/dialog/DialogPortal.d.ts +4 -4
- package/dist/dialog/DialogTitle.d.ts +3 -3
- package/dist/dialog/DialogTrigger.d.ts +5 -9
- 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 +149 -159
- 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/Drawer.d.ts +12 -19
- package/dist/drawer/DrawerClose.d.ts +9 -5
- package/dist/drawer/DrawerContent.d.ts +5 -5
- package/dist/drawer/DrawerDescription.d.ts +4 -4
- package/dist/drawer/DrawerOverlay.d.ts +5 -5
- package/dist/drawer/DrawerPortal.d.ts +4 -4
- package/dist/drawer/DrawerTitle.d.ts +5 -5
- package/dist/drawer/DrawerTrigger.d.ts +5 -5
- package/dist/drawer/index.d.mts +37 -0
- package/dist/drawer/index.d.ts +2 -0
- package/dist/drawer/index.js +1 -1
- package/dist/drawer/index.js.map +1 -1
- package/dist/drawer/index.mjs +143 -114
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/drawer/useRenderSlot.d.ts +3 -0
- 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 +139 -137
- 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 -844
- 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/Slider.d.ts +6 -1
- package/dist/slider/SliderContext.d.ts +4 -1
- 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 +96 -496
- 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/useRenderSlot-DATwjgpo.js +2 -0
- package/dist/useRenderSlot-DATwjgpo.js.map +1 -0
- package/dist/useRenderSlot-LwWj8QbC.mjs +10 -0
- package/dist/useRenderSlot-LwWj8QbC.mjs.map +1 -0
- 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 +7 -6
- package/dist/Button-C3xHNaGl.js +0 -2
- package/dist/DialogContent.styles-BrhKaHc_.js +0 -2
- package/dist/DialogContent.styles-BrhKaHc_.js.map +0 -1
- package/dist/DialogContent.styles-WGWJS9dj.mjs +0 -48
- package/dist/DialogContent.styles-WGWJS9dj.mjs.map +0 -1
- 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
|
@@ -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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EAAO,cAAc;ACDd,MAAME,IAAQ,CAAC,EAAE,WAAAnC,GAAW,KAAAI,GAAK,GAAGgC,QAEvC,gBAAAlD;AAAA,EAACmD;AAAAA,EAAA;AAAA,IACC,wBAAqB;AAAA,IACrB,KAAAjC;AAAA,IACA,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 BaseDialog } from '@base-ui/react/dialog'\nimport { ComponentProps, type ReactElement } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps\n extends Omit<ComponentProps<typeof BaseDialog.Root>, 'onOpenChange' | 'render'> {\n /**\n * Specifies if the dialog is open or not.\n */\n open?: boolean\n /**\n * Default open state.\n */\n defaultOpen?: boolean\n /**\n * Handler executed on every dialog open state change.\n */\n onOpenChange?: (open: boolean) => void\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: boolean\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 * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n}\n\nexport const Dialog = ({ withFade = false, onOpenChange, ...props }: DialogProps): ReactElement => {\n const handleOpenChange = onOpenChange\n ? (open: boolean, _eventDetails: unknown) => {\n onOpenChange(open)\n }\n : undefined\n\n return (\n <DialogProvider withFade={withFade}>\n <BaseDialog.Root data-spark-component=\"dialog\" onOpenChange={handleOpenChange} {...props} />\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 BaseDialog } from '@base-ui/react/dialog'\nimport { ComponentProps, Ref } from 'react'\n\nimport { useRenderSlot } from '../drawer/useRenderSlot'\n\nexport interface CloseProps extends Omit<ComponentProps<typeof BaseDialog.Close>, 'render'> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = ({ asChild = false, ...props }: CloseProps) => {\n const renderSlot = useRenderSlot(asChild, 'button')\n\n return <BaseDialog.Close data-spark-component=\"dialog-close\" render={renderSlot} {...props} />\n}\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 BaseDialog } from '@base-ui/react/dialog'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps\n extends Omit<ComponentProps<typeof BaseDialog.Popup>, 'render'>,\n 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 className,\n isNarrow = false,\n size = 'md',\n ref,\n ...rest\n}: ContentProps) => {\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 <BaseDialog.Popup\n ref={ref}\n data-spark-component=\"dialog-content\"\n role=\"dialog\"\n className={state =>\n cx(\n dialogContentStyles({\n isNarrow,\n size,\n className: typeof className === 'function' ? className(state) : className,\n })\n )\n }\n {...rest}\n />\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as BaseDialog } from '@base-ui/react/dialog'\nimport { ComponentProps, Ref } from 'react'\n\nexport type DescriptionProps = ComponentProps<typeof BaseDialog.Description> & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <BaseDialog.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 { Dialog as BaseDialog } from '@base-ui/react/dialog'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, Ref } from 'react'\n\nexport interface OverlayProps extends Omit<ComponentProps<typeof BaseDialog.Backdrop>, 'render'> {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ...props }: OverlayProps) => {\n return (\n <BaseDialog.Backdrop\n data-spark-component=\"dialog-overlay\"\n className={state =>\n cx(\n 'z-overlay size-screen fixed inset-0',\n 'bg-overlay/dim-1',\n 'data-starting-style:animate-fade-in',\n 'data-ending-style:animate-fade-out',\n typeof className === 'function' ? className(state) : className\n )\n }\n {...props}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as BaseDialog } from '@base-ui/react/dialog'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps } from 'react'\n\nexport type PortalProps = ComponentProps<typeof BaseDialog.Portal>\n\nexport const Portal = ({ className, ...props }: PortalProps) => {\n return (\n <BaseDialog.Portal\n data-spark-component=\"dialog-portal\"\n className={cx(className, 'z-modal absolute')}\n {...props}\n />\n )\n}\n\nPortal.displayName = 'Dialog.Portal'\n","import { Dialog as BaseDialog } from '@base-ui/react/dialog'\nimport { cx } from 'class-variance-authority'\nimport { ComponentProps, Ref } from 'react'\n\nexport type TitleProps = ComponentProps<typeof BaseDialog.Title> & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <BaseDialog.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 BaseDialog } from '@base-ui/react/dialog'\nimport { ComponentProps, Ref } from 'react'\n\nimport { useRenderSlot } from '../drawer/useRenderSlot'\n\nexport interface TriggerProps extends Omit<ComponentProps<typeof BaseDialog.Trigger>, 'render'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = ({ asChild = false, ...props }: TriggerProps) => {\n const renderSlot = useRenderSlot(asChild, 'button')\n\n return <BaseDialog.Trigger data-spark-component=\"dialog-trigger\" render={renderSlot} {...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'\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","onOpenChange","props","handleOpenChange","open","_eventDetails","BaseDialog","Body","children","className","inset","forwardedRef","rest","scrollAreaRef","useRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","Close","asChild","renderSlot","useRenderSlot","Root","ariaLabel","size","intent","design","CloseSVG","IconButton","Icon","CloseButton","Content","isNarrow","useEffect","state","dialogContentStyles","Description","Footer","Header","Overlay","Portal","Title","others","Trigger"],"mappings":";;;;;;;;;;;AAQA,MA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,GAAM;AAAA,EACtB,SAAAqB;AAAA,EACA,QAAAH;AAAA,EACA,SAAAD;AAAA,EACA,SAAAR;AAAA,EACA,QAAAO;AAAA,EACA,MAAAjC;AAAA,EACA,QAAAgC;AAAA,EACA,OAAAnB;AAAA,EACA,aAAAY;AAAA,EACA,OAAAW;AAAA,EACA,aAAAL;AACF,CAAC;AAEDtC,EAAO,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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../node_modules/@radix-ui/react-separator/dist/index.mjs","../../src/divider/variants/intents.tsx","../../src/divider/Divider.styles.ts","../../src/divider/Divider.tsx","../../src/divider/DividerContent.tsx","../../src/divider/index.ts"],"sourcesContent":["// src/separator.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Separator\";\nvar DEFAULT_ORIENTATION = \"horizontal\";\nvar ORIENTATIONS = [\"horizontal\", \"vertical\"];\nvar Separator = React.forwardRef((props, forwardedRef) => {\n const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;\n const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;\n const ariaOrientation = orientation === \"vertical\" ? orientation : void 0;\n const semanticProps = decorative ? { role: \"none\" } : { \"aria-orientation\": ariaOrientation, role: \"separator\" };\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-orientation\": orientation,\n ...semanticProps,\n ...domProps,\n ref: forwardedRef\n }\n );\n});\nSeparator.displayName = NAME;\nfunction isValidOrientation(orientation) {\n return ORIENTATIONS.includes(orientation);\n}\nvar Root = Separator;\nexport {\n Root,\n Separator\n};\n//# sourceMappingURL=index.mjs.map\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const intentVariants = [\n // current\n {\n intent: 'current',\n isEmpty: true,\n class: tw(['border-current']),\n },\n {\n intent: 'current',\n isEmpty: false,\n class: tw(['before:border-current after:border-current']),\n },\n // outline\n {\n intent: 'outline',\n isEmpty: true,\n class: tw(['border-outline']),\n },\n {\n intent: 'outline',\n isEmpty: false,\n class: tw(['before:border-outline after:border-outline']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport { intentVariants } from './variants/intents'\n\nexport const dividerStyles = cva(['overflow-hidden group'], {\n variants: {\n isEmpty: {\n true: ['border-solid'],\n false: ['inline-flex items-center', 'after:border-solid before:border-solid'],\n },\n orientation: {\n vertical: ['w-fit inline-flex'],\n horizontal: ['w-full'],\n },\n writingMode: {\n 'horizontal-tb': [],\n 'vertical-lr': [],\n },\n alignment: {\n start: [],\n end: [],\n center: [],\n },\n intent: {\n current: [],\n outline: [],\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n writingMode: 'horizontal-tb',\n alignment: 'center',\n intent: 'outline',\n },\n compoundVariants: [\n {\n isEmpty: true,\n orientation: 'horizontal',\n class: tw(['my-lg border-t-sm']),\n },\n {\n isEmpty: true,\n orientation: 'vertical',\n class: tw(['mx-lg min-h-sz-24 border-l-sm']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n writingMode: 'horizontal-tb',\n class: tw(['flex-row my-sm grow-0', 'before:border-t-sm', 'after:border-t-sm', '*:px-lg']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n writingMode: 'horizontal-tb',\n class: tw(['flex-col mx-sm', 'before:border-l-sm', 'after:border-l-sm', '*:py-lg']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n writingMode: 'vertical-lr',\n class: tw(['flex-col mx-sm', 'before:border-l-sm', 'after:border-l-sm', '*:px-lg']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'end',\n class: tw(['after:w-sz-40 before:grow after:grow-0']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'start',\n class: tw(['before:w-sz-40 before:grow-0 after:grow']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'center',\n class: tw(['justify-center before:grow after:grow']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'end',\n class: tw(['after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'start',\n class: tw(['before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'center',\n class: tw(['justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40']),\n },\n ...intentVariants,\n ],\n})\n\nexport type DividerStylesProps = VariantProps<typeof dividerStyles>\n","import { cx } from 'class-variance-authority'\nimport { Separator } from 'radix-ui'\nimport { HTMLAttributes, ReactElement, ReactNode, Ref } from 'react'\n\nimport { dividerStyles, type DividerStylesProps } from './Divider.styles'\n\nexport interface DividerProps\n extends HTMLAttributes<HTMLDivElement>,\n Omit<DividerStylesProps, 'isEmpty'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n children?: ReactElement\n /**\n * The orientation of the inner content.\n */\n alignment?: 'start' | 'end' | 'center'\n /**\n * The orientation of the separator.\n */\n orientation?: 'vertical' | 'horizontal'\n /**\n * When true, signifies that it is purely visual, carries no semantic meaning, and ensures it is not present in the accessibility tree.\n */\n isDecorative?: boolean\n /**\n * Color scheme of the divider.\n */\n intent?: 'outline' | 'current'\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Divider = ({\n asChild,\n className,\n isDecorative = false,\n children,\n orientation = 'horizontal',\n writingMode = 'horizontal-tb',\n alignment = 'center',\n intent = 'outline',\n ref,\n ...props\n}: DividerProps) => {\n const isEmpty = asChild ? !(children?.props as { children: ReactNode })?.children : !children\n\n return (\n <Separator.Root\n data-spark-component=\"divider\"\n asChild={asChild}\n className={cx(\n dividerStyles({ isEmpty, orientation, alignment, intent, writingMode }),\n className\n )}\n orientation={orientation}\n ref={ref}\n decorative={isDecorative}\n {...props}\n data-writing-mode={writingMode}\n >\n {children}\n </Separator.Root>\n )\n}\n\nDivider.displayName = 'Divider'\n","import { cx } from 'class-variance-authority'\nimport { HTMLAttributes, ReactNode, Ref } from 'react'\n\nexport interface DividerContentProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n children?: ReactNode\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const DividerContent = ({ children, ref, className, ...props }: DividerContentProps) => {\n return children ? (\n <span\n data-spark-component=\"divider-content\"\n ref={ref}\n {...props}\n className={cx('group-data-[writing-mode=vertical-lr]:[writing-mode:vertical-lr]', className)}\n >\n {children}\n </span>\n ) : null\n}\n\nDividerContent.displayName = 'Divider.Content'\n","import { Divider as Root } from './Divider'\nimport { DividerContent } from './DividerContent'\n\nexport { type DividerContentProps } from './DividerContent'\n\nexport const Divider: typeof Root & {\n Content: typeof DividerContent\n} = Object.assign(Root, {\n Content: DividerContent,\n})\n\nDivider.displayName = 'Divider'\nDivider.Content.displayName = 'Divider.Content'\n"],"names":["NAME","DEFAULT_ORIENTATION","ORIENTATIONS","Separator","React","props","forwardedRef","decorative","orientationProp","domProps","orientation","isValidOrientation","semanticProps","jsx","Primitive","Root","intentVariants","tw","dividerStyles","cva","Divider","asChild","className","isDecorative","children","writingMode","alignment","intent","ref","isEmpty","Separator.Root","cx","DividerContent"],"mappings":"4gBAIA,IAAIA,EAAO,YACPC,EAAsB,aACtBC,EAAe,CAAC,aAAc,UAAU,EACxCC,EAAYC,EAAM,WAAW,CAACC,EAAOC,IAAiB,CACxD,KAAM,CAAE,WAAAC,EAAY,YAAaC,EAAkBP,EAAqB,GAAGQ,CAAQ,EAAKJ,EAClFK,EAAcC,EAAmBH,CAAe,EAAIA,EAAkBP,EAEtEW,EAAgBL,EAAa,CAAE,KAAM,QAAW,CAAE,mBADhCG,IAAgB,WAAaA,EAAc,OAC0B,KAAM,WAAW,EAC9G,OAAuBG,EAAAA,IACrBC,EAAAA,UAAU,IACV,CACE,mBAAoBJ,EACpB,GAAGE,EACH,GAAGH,EACH,IAAKH,CACX,CACA,CACA,CAAC,EACDH,EAAU,YAAcH,EACxB,SAASW,EAAmBD,EAAa,CACvC,OAAOR,EAAa,SAASQ,CAAW,CAC1C,CACA,IAAIK,EAAOZ,ECxBJ,MAAMa,EAAiB,CAE5B,CACE,OAAQ,UACR,QAAS,GACT,MAAOC,EAAAA,GAAG,CAAC,gBAAgB,CAAC,CAAA,EAE9B,CACE,OAAQ,UACR,QAAS,GACT,MAAOA,EAAAA,GAAG,CAAC,4CAA4C,CAAC,CAAA,EAG1D,CACE,OAAQ,UACR,QAAS,GACT,MAAOA,EAAAA,GAAG,CAAC,gBAAgB,CAAC,CAAA,EAE9B,CACE,OAAQ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AOL,EAAM,CACtB,QAASiB,CACX,CAAC,EAEDZ,EAAQ,YAAc,UACtBA,EAAQ,QAAQ,YAAc","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/divider/variants/intents.tsx","../../src/divider/Divider.styles.ts","../../src/divider/Divider.tsx","../../src/divider/DividerContent.tsx","../../src/divider/index.ts"],"sourcesContent":["import { tw } from '@spark-ui/internal-utils'\n\nexport const intentVariants = [\n // current\n {\n intent: 'current',\n isEmpty: true,\n class: tw(['border-current']),\n },\n {\n intent: 'current',\n isEmpty: false,\n class: tw(['before:border-current after:border-current']),\n },\n // outline\n {\n intent: 'outline',\n isEmpty: true,\n class: tw(['border-outline']),\n },\n {\n intent: 'outline',\n isEmpty: false,\n class: tw(['before:border-outline after:border-outline']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport { intentVariants } from './variants/intents'\n\nexport const dividerStyles = cva(['overflow-hidden group'], {\n variants: {\n isEmpty: {\n true: ['border-solid'],\n false: ['inline-flex items-center', 'after:border-solid before:border-solid'],\n },\n orientation: {\n vertical: ['w-fit inline-flex'],\n horizontal: ['w-full'],\n },\n writingMode: {\n 'horizontal-tb': [],\n 'vertical-lr': [],\n },\n alignment: {\n start: [],\n end: [],\n center: [],\n },\n intent: {\n current: [],\n outline: [],\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n writingMode: 'horizontal-tb',\n alignment: 'center',\n intent: 'outline',\n },\n compoundVariants: [\n {\n isEmpty: true,\n orientation: 'horizontal',\n class: tw(['my-lg border-t-sm']),\n },\n {\n isEmpty: true,\n orientation: 'vertical',\n class: tw(['mx-lg min-h-sz-24 border-l-sm']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n writingMode: 'horizontal-tb',\n class: tw(['flex-row my-sm grow-0', 'before:border-t-sm', 'after:border-t-sm', '*:px-lg']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n writingMode: 'horizontal-tb',\n class: tw(['flex-col mx-sm', 'before:border-l-sm', 'after:border-l-sm', '*:py-lg']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n writingMode: 'vertical-lr',\n class: tw(['flex-col mx-sm', 'before:border-l-sm', 'after:border-l-sm', '*:px-lg']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'end',\n class: tw(['after:w-sz-40 before:grow after:grow-0']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'start',\n class: tw(['before:w-sz-40 before:grow-0 after:grow']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'center',\n class: tw(['justify-center before:grow after:grow']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'end',\n class: tw(['after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'start',\n class: tw(['before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'center',\n class: tw(['justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40']),\n },\n ...intentVariants,\n ],\n})\n\nexport type DividerStylesProps = VariantProps<typeof dividerStyles>\n","import { cx } from 'class-variance-authority'\nimport { Separator } from 'radix-ui'\nimport { HTMLAttributes, ReactElement, ReactNode, Ref } from 'react'\n\nimport { dividerStyles, type DividerStylesProps } from './Divider.styles'\n\nexport interface DividerProps\n extends HTMLAttributes<HTMLDivElement>,\n Omit<DividerStylesProps, 'isEmpty'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n children?: ReactElement\n /**\n * The orientation of the inner content.\n */\n alignment?: 'start' | 'end' | 'center'\n /**\n * The orientation of the separator.\n */\n orientation?: 'vertical' | 'horizontal'\n /**\n * When true, signifies that it is purely visual, carries no semantic meaning, and ensures it is not present in the accessibility tree.\n */\n isDecorative?: boolean\n /**\n * Color scheme of the divider.\n */\n intent?: 'outline' | 'current'\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Divider = ({\n asChild,\n className,\n isDecorative = false,\n children,\n orientation = 'horizontal',\n writingMode = 'horizontal-tb',\n alignment = 'center',\n intent = 'outline',\n ref,\n ...props\n}: DividerProps) => {\n const isEmpty = asChild ? !(children?.props as { children: ReactNode })?.children : !children\n\n return (\n <Separator.Root\n data-spark-component=\"divider\"\n asChild={asChild}\n className={cx(\n dividerStyles({ isEmpty, orientation, alignment, intent, writingMode }),\n className\n )}\n orientation={orientation}\n ref={ref}\n decorative={isDecorative}\n {...props}\n data-writing-mode={writingMode}\n >\n {children}\n </Separator.Root>\n )\n}\n\nDivider.displayName = 'Divider'\n","import { cx } from 'class-variance-authority'\nimport { HTMLAttributes, ReactNode, Ref } from 'react'\n\nexport interface DividerContentProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n children?: ReactNode\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const DividerContent = ({ children, ref, className, ...props }: DividerContentProps) => {\n return children ? (\n <span\n data-spark-component=\"divider-content\"\n ref={ref}\n {...props}\n className={cx('group-data-[writing-mode=vertical-lr]:[writing-mode:vertical-lr]', className)}\n >\n {children}\n </span>\n ) : null\n}\n\nDividerContent.displayName = 'Divider.Content'\n","import { Divider as Root } from './Divider'\nimport { DividerContent } from './DividerContent'\n\nexport { type DividerContentProps } from './DividerContent'\n\nexport const Divider: typeof Root & {\n Content: typeof DividerContent\n} = Object.assign(Root, {\n Content: DividerContent,\n})\n\nDivider.displayName = 'Divider'\nDivider.Content.displayName = 'Divider.Content'\n"],"names":["intentVariants","tw","dividerStyles","cva","Divider","asChild","className","isDecorative","children","orientation","writingMode","alignment","intent","ref","props","isEmpty","jsx","Separator","cx","DividerContent","Root"],"mappings":"uNAEaA,EAAiB,CAE5B,CACE,OAAQ,UACR,QAAS,GACT,MAAOC,EAAAA,GAAG,CAAC,gBAAgB,CAAC,CAAA,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,EAAAA,IAAC,OAAA,CACC,uBAAqB,kBACrB,IAAAH,EACC,GAAGC,EACJ,UAAWI,EAAAA,GAAG,mEAAoEZ,CAAS,EAE1F,SAAAE,CAAA,CAAA,EAED,KAGNW,EAAe,YAAc,kBCpBtB,MAAMf,EAET,OAAO,OAAOgB,EAAM,CACtB,QAASD,CACX,CAAC,EAEDf,EAAQ,YAAc,UACtBA,EAAQ,QAAQ,YAAc"}
|
package/dist/divider/index.mjs
CHANGED
|
@@ -1,49 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
var h = "Separator", c = "horizontal", x = ["horizontal", "vertical"], d = z.forwardRef((r, i) => {
|
|
7
|
-
const { decorative: n, orientation: e = c, ...a } = r, o = N(e) ? e : c, s = n ? { role: "none" } : { "aria-orientation": o === "vertical" ? o : void 0, role: "separator" };
|
|
8
|
-
return /* @__PURE__ */ l(
|
|
9
|
-
E.div,
|
|
10
|
-
{
|
|
11
|
-
"data-orientation": o,
|
|
12
|
-
...s,
|
|
13
|
-
...a,
|
|
14
|
-
ref: i
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
d.displayName = h;
|
|
19
|
-
function N(r) {
|
|
20
|
-
return x.includes(r);
|
|
21
|
-
}
|
|
22
|
-
var D = d;
|
|
23
|
-
const O = [
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { cva as w, cx as l } from "class-variance-authority";
|
|
3
|
+
import { Separator as y } from "radix-ui";
|
|
4
|
+
import { tw as e } from "@spark-ui/internal-utils";
|
|
5
|
+
const v = [
|
|
24
6
|
// current
|
|
25
7
|
{
|
|
26
8
|
intent: "current",
|
|
27
9
|
isEmpty: !0,
|
|
28
|
-
class:
|
|
10
|
+
class: e(["border-current"])
|
|
29
11
|
},
|
|
30
12
|
{
|
|
31
13
|
intent: "current",
|
|
32
14
|
isEmpty: !1,
|
|
33
|
-
class:
|
|
15
|
+
class: e(["before:border-current after:border-current"])
|
|
34
16
|
},
|
|
35
17
|
// outline
|
|
36
18
|
{
|
|
37
19
|
intent: "outline",
|
|
38
20
|
isEmpty: !0,
|
|
39
|
-
class:
|
|
21
|
+
class: e(["border-outline"])
|
|
40
22
|
},
|
|
41
23
|
{
|
|
42
24
|
intent: "outline",
|
|
43
25
|
isEmpty: !1,
|
|
44
|
-
class:
|
|
26
|
+
class: e(["before:border-outline after:border-outline"])
|
|
45
27
|
}
|
|
46
|
-
],
|
|
28
|
+
], z = w(["overflow-hidden group"], {
|
|
47
29
|
variants: {
|
|
48
30
|
isEmpty: {
|
|
49
31
|
true: ["border-solid"],
|
|
@@ -77,118 +59,118 @@ const O = [
|
|
|
77
59
|
{
|
|
78
60
|
isEmpty: !0,
|
|
79
61
|
orientation: "horizontal",
|
|
80
|
-
class:
|
|
62
|
+
class: e(["my-lg border-t-sm"])
|
|
81
63
|
},
|
|
82
64
|
{
|
|
83
65
|
isEmpty: !0,
|
|
84
66
|
orientation: "vertical",
|
|
85
|
-
class:
|
|
67
|
+
class: e(["mx-lg min-h-sz-24 border-l-sm"])
|
|
86
68
|
},
|
|
87
69
|
{
|
|
88
70
|
isEmpty: !1,
|
|
89
71
|
orientation: "horizontal",
|
|
90
72
|
writingMode: "horizontal-tb",
|
|
91
|
-
class:
|
|
73
|
+
class: e(["flex-row my-sm grow-0", "before:border-t-sm", "after:border-t-sm", "*:px-lg"])
|
|
92
74
|
},
|
|
93
75
|
{
|
|
94
76
|
isEmpty: !1,
|
|
95
77
|
orientation: "vertical",
|
|
96
78
|
writingMode: "horizontal-tb",
|
|
97
|
-
class:
|
|
79
|
+
class: e(["flex-col mx-sm", "before:border-l-sm", "after:border-l-sm", "*:py-lg"])
|
|
98
80
|
},
|
|
99
81
|
{
|
|
100
82
|
isEmpty: !1,
|
|
101
83
|
orientation: "vertical",
|
|
102
84
|
writingMode: "vertical-lr",
|
|
103
|
-
class:
|
|
85
|
+
class: e(["flex-col mx-sm", "before:border-l-sm", "after:border-l-sm", "*:px-lg"])
|
|
104
86
|
},
|
|
105
87
|
{
|
|
106
88
|
isEmpty: !1,
|
|
107
89
|
orientation: "horizontal",
|
|
108
90
|
alignment: "end",
|
|
109
|
-
class:
|
|
91
|
+
class: e(["after:w-sz-40 before:grow after:grow-0"])
|
|
110
92
|
},
|
|
111
93
|
{
|
|
112
94
|
isEmpty: !1,
|
|
113
95
|
orientation: "horizontal",
|
|
114
96
|
alignment: "start",
|
|
115
|
-
class:
|
|
97
|
+
class: e(["before:w-sz-40 before:grow-0 after:grow"])
|
|
116
98
|
},
|
|
117
99
|
{
|
|
118
100
|
isEmpty: !1,
|
|
119
101
|
orientation: "horizontal",
|
|
120
102
|
alignment: "center",
|
|
121
|
-
class:
|
|
103
|
+
class: e(["justify-center before:grow after:grow"])
|
|
122
104
|
},
|
|
123
105
|
{
|
|
124
106
|
isEmpty: !1,
|
|
125
107
|
orientation: "vertical",
|
|
126
108
|
alignment: "end",
|
|
127
|
-
class:
|
|
109
|
+
class: e(["after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40"])
|
|
128
110
|
},
|
|
129
111
|
{
|
|
130
112
|
isEmpty: !1,
|
|
131
113
|
orientation: "vertical",
|
|
132
114
|
alignment: "start",
|
|
133
|
-
class:
|
|
115
|
+
class: e(["before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40"])
|
|
134
116
|
},
|
|
135
117
|
{
|
|
136
118
|
isEmpty: !1,
|
|
137
119
|
orientation: "vertical",
|
|
138
120
|
alignment: "center",
|
|
139
|
-
class:
|
|
121
|
+
class: e(["justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40"])
|
|
140
122
|
},
|
|
141
|
-
...
|
|
123
|
+
...v
|
|
142
124
|
]
|
|
143
|
-
}),
|
|
144
|
-
asChild:
|
|
145
|
-
className:
|
|
146
|
-
isDecorative:
|
|
147
|
-
children:
|
|
148
|
-
orientation:
|
|
149
|
-
writingMode:
|
|
150
|
-
alignment:
|
|
151
|
-
intent:
|
|
152
|
-
ref:
|
|
153
|
-
...
|
|
125
|
+
}), m = ({
|
|
126
|
+
asChild: t,
|
|
127
|
+
className: o,
|
|
128
|
+
isDecorative: i = !1,
|
|
129
|
+
children: r,
|
|
130
|
+
orientation: n = "horizontal",
|
|
131
|
+
writingMode: a = "horizontal-tb",
|
|
132
|
+
alignment: d = "center",
|
|
133
|
+
intent: p = "outline",
|
|
134
|
+
ref: b,
|
|
135
|
+
...g
|
|
154
136
|
}) => {
|
|
155
|
-
const
|
|
156
|
-
return /* @__PURE__ */
|
|
157
|
-
|
|
137
|
+
const u = t ? !r?.props?.children : !r;
|
|
138
|
+
return /* @__PURE__ */ s(
|
|
139
|
+
y.Root,
|
|
158
140
|
{
|
|
159
141
|
"data-spark-component": "divider",
|
|
160
|
-
asChild:
|
|
161
|
-
className:
|
|
162
|
-
|
|
163
|
-
|
|
142
|
+
asChild: t,
|
|
143
|
+
className: l(
|
|
144
|
+
z({ isEmpty: u, orientation: n, alignment: d, intent: p, writingMode: a }),
|
|
145
|
+
o
|
|
164
146
|
),
|
|
165
|
-
orientation:
|
|
166
|
-
ref:
|
|
167
|
-
decorative:
|
|
168
|
-
...
|
|
169
|
-
"data-writing-mode":
|
|
170
|
-
children:
|
|
147
|
+
orientation: n,
|
|
148
|
+
ref: b,
|
|
149
|
+
decorative: i,
|
|
150
|
+
...g,
|
|
151
|
+
"data-writing-mode": a,
|
|
152
|
+
children: r
|
|
171
153
|
}
|
|
172
154
|
);
|
|
173
155
|
};
|
|
174
|
-
|
|
175
|
-
const
|
|
156
|
+
m.displayName = "Divider";
|
|
157
|
+
const f = ({ children: t, ref: o, className: i, ...r }) => t ? /* @__PURE__ */ s(
|
|
176
158
|
"span",
|
|
177
159
|
{
|
|
178
160
|
"data-spark-component": "divider-content",
|
|
179
|
-
ref:
|
|
180
|
-
...
|
|
181
|
-
className:
|
|
182
|
-
children:
|
|
161
|
+
ref: o,
|
|
162
|
+
...r,
|
|
163
|
+
className: l("group-data-[writing-mode=vertical-lr]:[writing-mode:vertical-lr]", i),
|
|
164
|
+
children: t
|
|
183
165
|
}
|
|
184
166
|
) : null;
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
Content:
|
|
167
|
+
f.displayName = "Divider.Content";
|
|
168
|
+
const c = Object.assign(m, {
|
|
169
|
+
Content: f
|
|
188
170
|
});
|
|
189
|
-
|
|
190
|
-
|
|
171
|
+
c.displayName = "Divider";
|
|
172
|
+
c.Content.displayName = "Divider.Content";
|
|
191
173
|
export {
|
|
192
|
-
|
|
174
|
+
c as Divider
|
|
193
175
|
};
|
|
194
176
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../node_modules/@radix-ui/react-separator/dist/index.mjs","../../src/divider/variants/intents.tsx","../../src/divider/Divider.styles.ts","../../src/divider/Divider.tsx","../../src/divider/DividerContent.tsx","../../src/divider/index.ts"],"sourcesContent":["// src/separator.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Separator\";\nvar DEFAULT_ORIENTATION = \"horizontal\";\nvar ORIENTATIONS = [\"horizontal\", \"vertical\"];\nvar Separator = React.forwardRef((props, forwardedRef) => {\n const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;\n const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;\n const ariaOrientation = orientation === \"vertical\" ? orientation : void 0;\n const semanticProps = decorative ? { role: \"none\" } : { \"aria-orientation\": ariaOrientation, role: \"separator\" };\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-orientation\": orientation,\n ...semanticProps,\n ...domProps,\n ref: forwardedRef\n }\n );\n});\nSeparator.displayName = NAME;\nfunction isValidOrientation(orientation) {\n return ORIENTATIONS.includes(orientation);\n}\nvar Root = Separator;\nexport {\n Root,\n Separator\n};\n//# sourceMappingURL=index.mjs.map\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const intentVariants = [\n // current\n {\n intent: 'current',\n isEmpty: true,\n class: tw(['border-current']),\n },\n {\n intent: 'current',\n isEmpty: false,\n class: tw(['before:border-current after:border-current']),\n },\n // outline\n {\n intent: 'outline',\n isEmpty: true,\n class: tw(['border-outline']),\n },\n {\n intent: 'outline',\n isEmpty: false,\n class: tw(['before:border-outline after:border-outline']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport { intentVariants } from './variants/intents'\n\nexport const dividerStyles = cva(['overflow-hidden group'], {\n variants: {\n isEmpty: {\n true: ['border-solid'],\n false: ['inline-flex items-center', 'after:border-solid before:border-solid'],\n },\n orientation: {\n vertical: ['w-fit inline-flex'],\n horizontal: ['w-full'],\n },\n writingMode: {\n 'horizontal-tb': [],\n 'vertical-lr': [],\n },\n alignment: {\n start: [],\n end: [],\n center: [],\n },\n intent: {\n current: [],\n outline: [],\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n writingMode: 'horizontal-tb',\n alignment: 'center',\n intent: 'outline',\n },\n compoundVariants: [\n {\n isEmpty: true,\n orientation: 'horizontal',\n class: tw(['my-lg border-t-sm']),\n },\n {\n isEmpty: true,\n orientation: 'vertical',\n class: tw(['mx-lg min-h-sz-24 border-l-sm']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n writingMode: 'horizontal-tb',\n class: tw(['flex-row my-sm grow-0', 'before:border-t-sm', 'after:border-t-sm', '*:px-lg']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n writingMode: 'horizontal-tb',\n class: tw(['flex-col mx-sm', 'before:border-l-sm', 'after:border-l-sm', '*:py-lg']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n writingMode: 'vertical-lr',\n class: tw(['flex-col mx-sm', 'before:border-l-sm', 'after:border-l-sm', '*:px-lg']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'end',\n class: tw(['after:w-sz-40 before:grow after:grow-0']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'start',\n class: tw(['before:w-sz-40 before:grow-0 after:grow']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'center',\n class: tw(['justify-center before:grow after:grow']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'end',\n class: tw(['after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'start',\n class: tw(['before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'center',\n class: tw(['justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40']),\n },\n ...intentVariants,\n ],\n})\n\nexport type DividerStylesProps = VariantProps<typeof dividerStyles>\n","import { cx } from 'class-variance-authority'\nimport { Separator } from 'radix-ui'\nimport { HTMLAttributes, ReactElement, ReactNode, Ref } from 'react'\n\nimport { dividerStyles, type DividerStylesProps } from './Divider.styles'\n\nexport interface DividerProps\n extends HTMLAttributes<HTMLDivElement>,\n Omit<DividerStylesProps, 'isEmpty'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n children?: ReactElement\n /**\n * The orientation of the inner content.\n */\n alignment?: 'start' | 'end' | 'center'\n /**\n * The orientation of the separator.\n */\n orientation?: 'vertical' | 'horizontal'\n /**\n * When true, signifies that it is purely visual, carries no semantic meaning, and ensures it is not present in the accessibility tree.\n */\n isDecorative?: boolean\n /**\n * Color scheme of the divider.\n */\n intent?: 'outline' | 'current'\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Divider = ({\n asChild,\n className,\n isDecorative = false,\n children,\n orientation = 'horizontal',\n writingMode = 'horizontal-tb',\n alignment = 'center',\n intent = 'outline',\n ref,\n ...props\n}: DividerProps) => {\n const isEmpty = asChild ? !(children?.props as { children: ReactNode })?.children : !children\n\n return (\n <Separator.Root\n data-spark-component=\"divider\"\n asChild={asChild}\n className={cx(\n dividerStyles({ isEmpty, orientation, alignment, intent, writingMode }),\n className\n )}\n orientation={orientation}\n ref={ref}\n decorative={isDecorative}\n {...props}\n data-writing-mode={writingMode}\n >\n {children}\n </Separator.Root>\n )\n}\n\nDivider.displayName = 'Divider'\n","import { cx } from 'class-variance-authority'\nimport { HTMLAttributes, ReactNode, Ref } from 'react'\n\nexport interface DividerContentProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n children?: ReactNode\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const DividerContent = ({ children, ref, className, ...props }: DividerContentProps) => {\n return children ? (\n <span\n data-spark-component=\"divider-content\"\n ref={ref}\n {...props}\n className={cx('group-data-[writing-mode=vertical-lr]:[writing-mode:vertical-lr]', className)}\n >\n {children}\n </span>\n ) : null\n}\n\nDividerContent.displayName = 'Divider.Content'\n","import { Divider as Root } from './Divider'\nimport { DividerContent } from './DividerContent'\n\nexport { type DividerContentProps } from './DividerContent'\n\nexport const Divider: typeof Root & {\n Content: typeof DividerContent\n} = Object.assign(Root, {\n Content: DividerContent,\n})\n\nDivider.displayName = 'Divider'\nDivider.Content.displayName = 'Divider.Content'\n"],"names":["NAME","DEFAULT_ORIENTATION","ORIENTATIONS","Separator","React","props","forwardedRef","decorative","orientationProp","domProps","orientation","isValidOrientation","semanticProps","jsx","Primitive","Root","intentVariants","tw","dividerStyles","cva","Divider","asChild","className","isDecorative","children","writingMode","alignment","intent","ref","isEmpty","Separator.Root","cx","DividerContent"],"mappings":";;;;;AAIA,IAAIA,IAAO,aACPC,IAAsB,cACtBC,IAAe,CAAC,cAAc,UAAU,GACxCC,IAAYC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACxD,QAAM,EAAE,YAAAC,GAAY,aAAaC,IAAkBP,GAAqB,GAAGQ,EAAQ,IAAKJ,GAClFK,IA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IACL,gBAAAX;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,wBAAqB;AAAA,IACrB,KAAAe;AAAA,IACC,GAAGvB;AAAA,IACJ,WAAW0B,EAAG,oEAAoET,CAAS;AAAA,IAE1F,UAAAE;AAAA,EAAA;AAAA,IAED;AAGNQ,EAAe,cAAc;ACpBtB,MAAMZ,IAET,OAAO,OAAOL,GAAM;AAAA,EACtB,SAASiB;AACX,CAAC;AAEDZ,EAAQ,cAAc;AACtBA,EAAQ,QAAQ,cAAc;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/divider/variants/intents.tsx","../../src/divider/Divider.styles.ts","../../src/divider/Divider.tsx","../../src/divider/DividerContent.tsx","../../src/divider/index.ts"],"sourcesContent":["import { tw } from '@spark-ui/internal-utils'\n\nexport const intentVariants = [\n // current\n {\n intent: 'current',\n isEmpty: true,\n class: tw(['border-current']),\n },\n {\n intent: 'current',\n isEmpty: false,\n class: tw(['before:border-current after:border-current']),\n },\n // outline\n {\n intent: 'outline',\n isEmpty: true,\n class: tw(['border-outline']),\n },\n {\n intent: 'outline',\n isEmpty: false,\n class: tw(['before:border-outline after:border-outline']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport { intentVariants } from './variants/intents'\n\nexport const dividerStyles = cva(['overflow-hidden group'], {\n variants: {\n isEmpty: {\n true: ['border-solid'],\n false: ['inline-flex items-center', 'after:border-solid before:border-solid'],\n },\n orientation: {\n vertical: ['w-fit inline-flex'],\n horizontal: ['w-full'],\n },\n writingMode: {\n 'horizontal-tb': [],\n 'vertical-lr': [],\n },\n alignment: {\n start: [],\n end: [],\n center: [],\n },\n intent: {\n current: [],\n outline: [],\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n writingMode: 'horizontal-tb',\n alignment: 'center',\n intent: 'outline',\n },\n compoundVariants: [\n {\n isEmpty: true,\n orientation: 'horizontal',\n class: tw(['my-lg border-t-sm']),\n },\n {\n isEmpty: true,\n orientation: 'vertical',\n class: tw(['mx-lg min-h-sz-24 border-l-sm']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n writingMode: 'horizontal-tb',\n class: tw(['flex-row my-sm grow-0', 'before:border-t-sm', 'after:border-t-sm', '*:px-lg']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n writingMode: 'horizontal-tb',\n class: tw(['flex-col mx-sm', 'before:border-l-sm', 'after:border-l-sm', '*:py-lg']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n writingMode: 'vertical-lr',\n class: tw(['flex-col mx-sm', 'before:border-l-sm', 'after:border-l-sm', '*:px-lg']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'end',\n class: tw(['after:w-sz-40 before:grow after:grow-0']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'start',\n class: tw(['before:w-sz-40 before:grow-0 after:grow']),\n },\n {\n isEmpty: false,\n orientation: 'horizontal',\n alignment: 'center',\n class: tw(['justify-center before:grow after:grow']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'end',\n class: tw(['after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'start',\n class: tw(['before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40']),\n },\n {\n isEmpty: false,\n orientation: 'vertical',\n alignment: 'center',\n class: tw(['justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40']),\n },\n ...intentVariants,\n ],\n})\n\nexport type DividerStylesProps = VariantProps<typeof dividerStyles>\n","import { cx } from 'class-variance-authority'\nimport { Separator } from 'radix-ui'\nimport { HTMLAttributes, ReactElement, ReactNode, Ref } from 'react'\n\nimport { dividerStyles, type DividerStylesProps } from './Divider.styles'\n\nexport interface DividerProps\n extends HTMLAttributes<HTMLDivElement>,\n Omit<DividerStylesProps, 'isEmpty'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n children?: ReactElement\n /**\n * The orientation of the inner content.\n */\n alignment?: 'start' | 'end' | 'center'\n /**\n * The orientation of the separator.\n */\n orientation?: 'vertical' | 'horizontal'\n /**\n * When true, signifies that it is purely visual, carries no semantic meaning, and ensures it is not present in the accessibility tree.\n */\n isDecorative?: boolean\n /**\n * Color scheme of the divider.\n */\n intent?: 'outline' | 'current'\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Divider = ({\n asChild,\n className,\n isDecorative = false,\n children,\n orientation = 'horizontal',\n writingMode = 'horizontal-tb',\n alignment = 'center',\n intent = 'outline',\n ref,\n ...props\n}: DividerProps) => {\n const isEmpty = asChild ? !(children?.props as { children: ReactNode })?.children : !children\n\n return (\n <Separator.Root\n data-spark-component=\"divider\"\n asChild={asChild}\n className={cx(\n dividerStyles({ isEmpty, orientation, alignment, intent, writingMode }),\n className\n )}\n orientation={orientation}\n ref={ref}\n decorative={isDecorative}\n {...props}\n data-writing-mode={writingMode}\n >\n {children}\n </Separator.Root>\n )\n}\n\nDivider.displayName = 'Divider'\n","import { cx } from 'class-variance-authority'\nimport { HTMLAttributes, ReactNode, Ref } from 'react'\n\nexport interface DividerContentProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n children?: ReactNode\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const DividerContent = ({ children, ref, className, ...props }: DividerContentProps) => {\n return children ? (\n <span\n data-spark-component=\"divider-content\"\n ref={ref}\n {...props}\n className={cx('group-data-[writing-mode=vertical-lr]:[writing-mode:vertical-lr]', className)}\n >\n {children}\n </span>\n ) : null\n}\n\nDividerContent.displayName = 'Divider.Content'\n","import { Divider as Root } from './Divider'\nimport { DividerContent } from './DividerContent'\n\nexport { type DividerContentProps } from './DividerContent'\n\nexport const Divider: typeof Root & {\n Content: typeof DividerContent\n} = Object.assign(Root, {\n Content: DividerContent,\n})\n\nDivider.displayName = 'Divider'\nDivider.Content.displayName = 'Divider.Content'\n"],"names":["intentVariants","tw","dividerStyles","cva","Divider","asChild","className","isDecorative","children","orientation","writingMode","alignment","intent","ref","props","isEmpty","jsx","Separator","cx","DividerContent","Root"],"mappings":";;;;AAEO,MAAMA,IAAiB;AAAA;AAAA,EAE5B;AAAA,IACE,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAOC,EAAG,CAAC,gBAAgB,CAAC;AAAA,EAAA;AAAA,EAE9B;AAAA,IACE,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAOA,EAAG,CAAC,4CAA4C,CAAC;AAAA,EAAA;AAAA;AAAA,EAG1D;AAAA,IACE,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAOA,EAAG,CAAC,gBAAgB,CAAC;AAAA,EAAA;AAAA,EAE9B;AAAA,IACE,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAOA,EAAG,CAAC,4CAA4C,CAAC;AAAA,EAAA;AAE5D,GCpBaC,IAAgBC,EAAI,CAAC,uBAAuB,GAAG;AAAA,EAC1D,UAAU;AAAA,IACR,SAAS;AAAA,MACP,MAAM,CAAC,cAAc;AAAA,MACrB,OAAO,CAAC,4BAA4B,wCAAwC;AAAA,IAAA;AAAA,IAE9E,aAAa;AAAA,MACX,UAAU,CAAC,mBAAmB;AAAA,MAC9B,YAAY,CAAC,QAAQ;AAAA,IAAA;AAAA,IAEvB,aAAa;AAAA,MACX,iBAAiB,CAAA;AAAA,MACjB,eAAe,CAAA;AAAA,IAAC;AAAA,IAElB,WAAW;AAAA,MACT,OAAO,CAAA;AAAA,MACP,KAAK,CAAA;AAAA,MACL,QAAQ,CAAA;AAAA,IAAC;AAAA,IAEX,QAAQ;AAAA,MACN,SAAS,CAAA;AAAA,MACT,SAAS,CAAA;AAAA,IAAC;AAAA,EACZ;AAAA,EAEF,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,aAAa;AAAA,IACb,WAAW;AAAA,IACX,QAAQ;AAAA,EAAA;A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;AACX,CAAC;AAEDf,EAAQ,cAAc;AACtBA,EAAQ,QAAQ,cAAc;"}
|
package/dist/drawer/Drawer.d.ts
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
import { Dialog as
|
|
2
|
-
import {
|
|
3
|
-
export interface DrawerProps {
|
|
4
|
-
/**
|
|
5
|
-
* Children of the component.
|
|
6
|
-
*/
|
|
7
|
-
children?: RadixDrawer.DialogProps['children'];
|
|
1
|
+
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
2
|
+
import { ComponentProps, ReactElement } from 'react';
|
|
3
|
+
export interface DrawerProps extends Omit<ComponentProps<typeof BaseDialog.Root>, 'onOpenChange' | 'render'> {
|
|
8
4
|
/**
|
|
9
5
|
* Specifies if the dialog is open or not.
|
|
10
6
|
*/
|
|
11
|
-
open?:
|
|
7
|
+
open?: boolean;
|
|
12
8
|
/**
|
|
13
9
|
* Default open state.
|
|
14
10
|
*/
|
|
15
|
-
defaultOpen?:
|
|
11
|
+
defaultOpen?: boolean;
|
|
16
12
|
/**
|
|
17
13
|
* Handler executed on every dialog open state change.
|
|
18
14
|
*/
|
|
19
|
-
onOpenChange?:
|
|
15
|
+
onOpenChange?: (open: boolean) => void;
|
|
20
16
|
/**
|
|
21
17
|
* Specifies if the dialog is a modal.
|
|
22
18
|
*/
|
|
23
|
-
modal?:
|
|
19
|
+
modal?: boolean;
|
|
24
20
|
/**
|
|
25
21
|
* Specifies if the drawer should have a fade animation on its body (in case it is scrollable).
|
|
26
22
|
*/
|
|
27
23
|
withFade?: boolean;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
defaultOpen?: boolean;
|
|
33
|
-
onOpenChange?(open: boolean): void;
|
|
34
|
-
modal?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
26
|
+
*/
|
|
27
|
+
asChild?: boolean;
|
|
35
28
|
}
|
|
36
29
|
export declare const Drawer: {
|
|
37
|
-
({
|
|
30
|
+
({ onOpenChange, withFade, ...props }: DrawerProps): ReactElement;
|
|
38
31
|
displayName: string;
|
|
39
32
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Dialog as
|
|
2
|
-
import { Ref } from 'react';
|
|
3
|
-
export
|
|
1
|
+
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
2
|
+
import { ComponentProps, Ref } from 'react';
|
|
3
|
+
export interface DrawerCloseProps extends Omit<ComponentProps<typeof BaseDialog.Close>, 'render'> {
|
|
4
|
+
/**
|
|
5
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
6
|
+
*/
|
|
7
|
+
asChild?: boolean;
|
|
4
8
|
ref?: Ref<HTMLButtonElement>;
|
|
5
|
-
}
|
|
9
|
+
}
|
|
6
10
|
export declare const DrawerClose: {
|
|
7
|
-
(props: DrawerCloseProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
({ asChild, ...props }: DrawerCloseProps): import("react/jsx-runtime").JSX.Element;
|
|
8
12
|
displayName: string;
|
|
9
13
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Dialog as
|
|
2
|
-
import { Ref } from 'react';
|
|
1
|
+
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
2
|
+
import { ComponentProps, Ref } from 'react';
|
|
3
3
|
import { DrawerContentStylesProps } from './DrawerContent.styles';
|
|
4
|
-
export
|
|
4
|
+
export interface DrawerContentProps extends Omit<ComponentProps<typeof BaseDialog.Popup>, 'render'>, DrawerContentStylesProps {
|
|
5
5
|
ref?: Ref<HTMLDivElement>;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
export declare const DrawerContent: {
|
|
8
|
-
({ className, size, side,
|
|
8
|
+
({ className, size, side, ref, ...rest }: DrawerContentProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Dialog as
|
|
2
|
-
import { Ref } from 'react';
|
|
3
|
-
export
|
|
1
|
+
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
2
|
+
import { ComponentProps, Ref } from 'react';
|
|
3
|
+
export interface DrawerDescriptionProps extends Omit<ComponentProps<typeof BaseDialog.Description>, 'render'> {
|
|
4
4
|
ref?: Ref<HTMLParagraphElement>;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
6
|
export declare const DrawerDescription: {
|
|
7
7
|
(props: DrawerDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
displayName: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Dialog as
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
1
|
+
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
2
|
+
import { ComponentProps, Ref } from 'react';
|
|
3
|
+
export interface DrawerOverlayProps extends Omit<ComponentProps<typeof BaseDialog.Backdrop>, 'render'> {
|
|
4
4
|
ref?: Ref<HTMLDivElement>;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
6
|
export declare const DrawerOverlay: {
|
|
7
|
-
({ className,
|
|
7
|
+
({ className, ...props }: DrawerOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
displayName: string;
|
|
9
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Dialog as
|
|
2
|
-
import {
|
|
3
|
-
export type DrawerPortalProps =
|
|
1
|
+
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
export type DrawerPortalProps = ComponentProps<typeof BaseDialog.Portal>;
|
|
4
4
|
export declare const DrawerPortal: {
|
|
5
|
-
({
|
|
5
|
+
({ className, ...props }: DrawerPortalProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|