@kismet-ux/constellation 1.9.0 → 1.11.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/brand/Logo/logo.css +4 -1
- package/dist/form/Checkbox/checkbox.css +48 -34
- package/dist/form/Checkbox/checkbox.d.ts +5 -0
- package/dist/form/Checkbox/checkbox.d.ts.map +1 -1
- package/dist/form/Checkbox/checkbox.js +6 -55
- package/dist/form/Checkbox/checkbox.js.map +1 -1
- package/dist/form/Checkbox/checkbox.module.scss.js +1 -1
- package/dist/form/Combobox/combobox.css +35 -0
- package/dist/form/Combobox/combobox.d.ts +41 -0
- package/dist/form/Combobox/combobox.d.ts.map +1 -0
- package/dist/form/Combobox/combobox.js +152 -0
- package/dist/form/Combobox/combobox.js.map +1 -0
- package/dist/form/Combobox/combobox.module.scss.js +6 -0
- package/dist/form/Combobox/combobox.module.scss.js.map +1 -0
- package/dist/form/Combobox/index.d.ts +2 -0
- package/dist/form/Combobox/index.d.ts.map +1 -0
- package/dist/form/DatePicker/date-picker.d.ts.map +1 -1
- package/dist/form/DatePicker/date-picker.js +5 -53
- package/dist/form/DatePicker/date-picker.js.map +1 -1
- package/dist/form/Input/input.css +12 -0
- package/dist/form/Input/input.d.ts +1 -1
- package/dist/form/Input/input.d.ts.map +1 -1
- package/dist/form/Input/input.js +23 -3
- package/dist/form/Input/input.js.map +1 -1
- package/dist/form/Select/select.css +46 -2
- package/dist/form/Select/select.d.ts +31 -3
- package/dist/form/Select/select.d.ts.map +1 -1
- package/dist/form/Select/select.js +35 -21
- package/dist/form/Select/select.js.map +1 -1
- package/dist/form/Select/select.module.scss.js +2 -2
- package/dist/form/index.d.ts +1 -0
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form.d.ts +1 -1
- package/dist/form.js +2 -1
- package/dist/form.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/layout/index.d.ts +1 -0
- package/dist/hooks/layout/index.d.ts.map +1 -1
- package/dist/hooks/layout/use-flip.d.ts +37 -0
- package/dist/hooks/layout/use-flip.d.ts.map +1 -0
- package/dist/hooks/layout/use-flip.js +128 -0
- package/dist/hooks/layout/use-flip.js.map +1 -0
- package/dist/hooks/use-motion.d.ts +30 -0
- package/dist/hooks/use-motion.d.ts.map +1 -0
- package/dist/hooks/use-motion.js +93 -0
- package/dist/hooks/use-motion.js.map +1 -0
- package/dist/index-2nHZOukj.d.ts +200 -0
- package/dist/index-3Ui8TAHy.d.ts +200 -0
- package/dist/index-59JuNTZm.d.ts +537 -0
- package/dist/index-5QXWn0de.d.ts +200 -0
- package/dist/index-98ozinMf.d.ts +498 -0
- package/dist/index-Ah3YQTri.d.ts +566 -0
- package/dist/index-As2iBOIu.d.ts +527 -0
- package/dist/index-B1Vw0zoR.d.ts +566 -0
- package/dist/index-B25sLBMr.d.ts +498 -0
- package/dist/index-B4B8aA9X.d.ts +272 -0
- package/dist/index-B97hn7Xp.d.ts +514 -0
- package/dist/index-B9B7JjTb.d.ts +204 -0
- package/dist/index-BFWt_pYt.d.ts +566 -0
- package/dist/index-BFZp_Pu6.d.ts +566 -0
- package/dist/index-BGL4DvKQ.d.ts +293 -0
- package/dist/index-BGP_J4I2.d.ts +498 -0
- package/dist/index-BHhoIUD_.d.ts +354 -0
- package/dist/index-BI0iaWmp.d.ts +222 -0
- package/dist/index-BMSRpHb6.d.ts +273 -0
- package/dist/index-BRQWKmfq.d.ts +566 -0
- package/dist/index-BTARYt96.d.ts +537 -0
- package/dist/index-BTrpuZdU.d.ts +566 -0
- package/dist/index-BWTwKQsp.d.ts +354 -0
- package/dist/index-B_05Skyi.d.ts +566 -0
- package/dist/index-BcQqBGNu.d.ts +200 -0
- package/dist/index-Be23E9xD.d.ts +298 -0
- package/dist/index-Bf44Z8ak.d.ts +514 -0
- package/dist/index-Bg42sKjg.d.ts +498 -0
- package/dist/index-Bg_0OPMx.d.ts +566 -0
- package/dist/index-BgjRk9l7.d.ts +537 -0
- package/dist/index-BhLEMn3N.d.ts +537 -0
- package/dist/index-BiqECuUj.d.ts +204 -0
- package/dist/index-BjUQiAs1.d.ts +130 -0
- package/dist/index-BlKqvax0.d.ts +204 -0
- package/dist/index-Bnb0JFqx.d.ts +514 -0
- package/dist/index-BpSD6t7A.d.ts +566 -0
- package/dist/index-BpxKwrv_.d.ts +537 -0
- package/dist/index-Brh7JZAQ.d.ts +514 -0
- package/dist/index-C-n7hM4G.d.ts +354 -0
- package/dist/index-C0wKb28S.d.ts +514 -0
- package/dist/index-C129uthr.d.ts +566 -0
- package/dist/index-C1ef0QtQ.d.ts +204 -0
- package/dist/index-C4BACHGE.d.ts +272 -0
- package/dist/index-C5JU8WTE.d.ts +514 -0
- package/dist/index-C63UYi-T.d.ts +195 -0
- package/dist/index-C8LoYkC7.d.ts +250 -0
- package/dist/index-C9-ECLyr.d.ts +566 -0
- package/dist/index-C9B1F-mr.d.ts +293 -0
- package/dist/index-CAVmbwa8.d.ts +514 -0
- package/dist/index-CBz-v5eM.d.ts +184 -0
- package/dist/index-CCpdo0n4.d.ts +130 -0
- package/dist/index-CDC_ZncW.d.ts +566 -0
- package/dist/index-CFQj-KtR.d.ts +184 -0
- package/dist/index-CFaxW5hv.d.ts +184 -0
- package/dist/index-CG9DKbG9.d.ts +498 -0
- package/dist/index-CGhG7YeI.d.ts +354 -0
- package/dist/index-CHC6kRbR.d.ts +537 -0
- package/dist/index-CH_q-5fk.d.ts +537 -0
- package/dist/index-CIK_SmBm.d.ts +200 -0
- package/dist/index-CJ1KPFOf.d.ts +537 -0
- package/dist/index-CJ5FEGRG.d.ts +537 -0
- package/dist/index-CKX2VNKk.d.ts +240 -0
- package/dist/index-CL7kYZ90.d.ts +231 -0
- package/dist/index-CNl03fCW.d.ts +498 -0
- package/dist/index-CO8Jq0pz.d.ts +298 -0
- package/dist/index-CQ-aS-rp.d.ts +566 -0
- package/dist/index-CQjzBv4q.d.ts +537 -0
- package/dist/index-CRVO4SlF.d.ts +537 -0
- package/dist/index-CSQFy2xe.d.ts +195 -0
- package/dist/index-CWM2ewRz.d.ts +566 -0
- package/dist/index-CY6Xq36O.d.ts +204 -0
- package/dist/index-CYGOs6JT.d.ts +273 -0
- package/dist/index-CYPFkjfk.d.ts +204 -0
- package/dist/index-C_hJJ1fH.d.ts +527 -0
- package/dist/index-CcM-XHTL.d.ts +273 -0
- package/dist/index-CdGF_eEO.d.ts +514 -0
- package/dist/index-CdJTE9Lh.d.ts +566 -0
- package/dist/index-CdOt-pqR.d.ts +537 -0
- package/dist/index-CgeR_2Gi.d.ts +220 -0
- package/dist/index-CjUoZbDi.d.ts +354 -0
- package/dist/index-CjV6KsFc.d.ts +263 -0
- package/dist/index-Ck8LtgBW.d.ts +557 -0
- package/dist/index-Cknm9FUU.d.ts +299 -0
- package/dist/index-Clv3CnXv.d.ts +184 -0
- package/dist/index-Cm4wnJ29.d.ts +514 -0
- package/dist/index-Cmz3q-CI.d.ts +273 -0
- package/dist/index-CnMBzCft.d.ts +514 -0
- package/dist/index-CnVW0FnZ.d.ts +272 -0
- package/dist/index-CpIHT-uo.d.ts +231 -0
- package/dist/index-CtBEDM0b.d.ts +514 -0
- package/dist/index-CtVSiQeY.d.ts +130 -0
- package/dist/index-Cu107rOs.d.ts +293 -0
- package/dist/index-CxyTd3Ag.d.ts +354 -0
- package/dist/index-CywSNvOU.d.ts +200 -0
- package/dist/index-CzJL7Lro.d.ts +566 -0
- package/dist/index-CzJnKY3r.d.ts +272 -0
- package/dist/index-D-R9eOxe.d.ts +354 -0
- package/dist/index-D-hdgIbs.d.ts +273 -0
- package/dist/index-D-slQ9w4.d.ts +537 -0
- package/dist/index-D0jdNDaH.d.ts +204 -0
- package/dist/index-D1ir--Li.d.ts +566 -0
- package/dist/index-D29_-MCZ.d.ts +354 -0
- package/dist/index-D2glATpo.d.ts +273 -0
- package/dist/index-D6ATtbor.d.ts +298 -0
- package/dist/index-D6HktSlo.d.ts +514 -0
- package/dist/index-DB4UBCvy.d.ts +537 -0
- package/dist/index-DBd0PU9y.d.ts +222 -0
- package/dist/index-DE2Nm-iT.d.ts +354 -0
- package/dist/index-DEeJuuvm.d.ts +231 -0
- package/dist/index-DHhzBSfL.d.ts +498 -0
- package/dist/index-DKpWNCb6.d.ts +204 -0
- package/dist/index-DMewi97i.d.ts +566 -0
- package/dist/index-DN0gtpck.d.ts +354 -0
- package/dist/index-DO23vZ-R.d.ts +514 -0
- package/dist/index-DTb2-z6E.d.ts +130 -0
- package/dist/index-DV-CN7c0.d.ts +231 -0
- package/dist/index-DWgCs62z.d.ts +566 -0
- package/dist/index-D_6Qu6ia.d.ts +200 -0
- package/dist/index-D_vn8O-I.d.ts +293 -0
- package/dist/index-Daq4m4Rf.d.ts +514 -0
- package/dist/index-Db6cXpr6.d.ts +537 -0
- package/dist/index-DbZ1s2E-.d.ts +514 -0
- package/dist/index-DbevJPuY.d.ts +354 -0
- package/dist/index-DepmPwP7.d.ts +537 -0
- package/dist/index-DfnTWQCz.d.ts +514 -0
- package/dist/index-Dfu8WhiS.d.ts +273 -0
- package/dist/index-DggMYd7c.d.ts +298 -0
- package/dist/index-DhS2nQjt.d.ts +200 -0
- package/dist/index-Dn3bC8Ki.d.ts +222 -0
- package/dist/index-Dn9bGZvU.d.ts +195 -0
- package/dist/index-DnDt7A4Y.d.ts +354 -0
- package/dist/index-DpdYKBP2.d.ts +498 -0
- package/dist/index-DunP9qIK.d.ts +537 -0
- package/dist/index-DxO6-qt5.d.ts +498 -0
- package/dist/index-ESQ8WM_8.d.ts +130 -0
- package/dist/index-GVz409cm.d.ts +222 -0
- package/dist/index-HAx-aLZ0.d.ts +273 -0
- package/dist/index-Iuzs6nt9.d.ts +498 -0
- package/dist/index-LnEpnlTq.d.ts +566 -0
- package/dist/index-Mm1i2OdU.d.ts +537 -0
- package/dist/index-P0oxVi77.d.ts +537 -0
- package/dist/index-Q5JuPFoN.d.ts +293 -0
- package/dist/index-RJviLtvo.d.ts +566 -0
- package/dist/index-SnQCbfte.d.ts +498 -0
- package/dist/index-Th9It0ZT.d.ts +354 -0
- package/dist/index-UHHmyQM5.d.ts +272 -0
- package/dist/index-VyGmJYQZ.d.ts +537 -0
- package/dist/index-WYH70le_.d.ts +195 -0
- package/dist/index-Wj9RYtTX.d.ts +273 -0
- package/dist/index-Y-wMZeUG.d.ts +298 -0
- package/dist/index-Zo2rSdXz.d.ts +273 -0
- package/dist/index-ZwpWgV4n.d.ts +272 -0
- package/dist/index-_oZ4knIl.d.ts +272 -0
- package/dist/index-an222nAK.d.ts +354 -0
- package/dist/index-daV0QTe0.d.ts +537 -0
- package/dist/index-eGZu2HLC.d.ts +231 -0
- package/dist/index-eswPA0Un.d.ts +204 -0
- package/dist/index-gf6-wf_1.d.ts +566 -0
- package/dist/index-hdVr9Wrv.d.ts +566 -0
- package/dist/index-iygiXYw2.d.ts +537 -0
- package/dist/index-jR29ZGLD.d.ts +514 -0
- package/dist/index-kHgI28TP.d.ts +272 -0
- package/dist/index-lY4_UCOs.d.ts +566 -0
- package/dist/index-miXK87yJ.d.ts +231 -0
- package/dist/index-mwbGtZkk.d.ts +273 -0
- package/dist/index-ru2DFXcm.d.ts +195 -0
- package/dist/index-uj1ll_u-.d.ts +204 -0
- package/dist/index-vfq-aH7U.d.ts +537 -0
- package/dist/index-xqUz9XjP.d.ts +537 -0
- package/dist/index.css +74 -18
- package/dist/index.d.ts +121 -13
- package/dist/index.js +34 -28
- package/dist/index.js.map +1 -1
- package/dist/internal/use-scroll-lock.d.ts +15 -0
- package/dist/internal/use-scroll-lock.d.ts.map +1 -1
- package/dist/internal/use-scroll-lock.js +26 -8
- package/dist/internal/use-scroll-lock.js.map +1 -1
- package/dist/layout/AppContent/app-content.css +1 -1
- package/dist/layout/AppContentBands/app-content-bands.css +21 -0
- package/dist/layout/AppContentBands/app-content-bands.d.ts +26 -0
- package/dist/layout/AppContentBands/app-content-bands.d.ts.map +1 -0
- package/dist/layout/AppContentBands/app-content-bands.js +65 -0
- package/dist/layout/AppContentBands/app-content-bands.js.map +1 -0
- package/dist/layout/AppContentBands/app-content-bands.module.scss.js +6 -0
- package/dist/layout/AppContentBands/app-content-bands.module.scss.js.map +1 -0
- package/dist/layout/AppContentBands/index.d.ts +2 -0
- package/dist/layout/AppContentBands/index.d.ts.map +1 -0
- package/dist/layout/AppContentFooter/app-content-footer.css +9 -0
- package/dist/layout/AppContentFooter/app-content-footer.d.ts +38 -0
- package/dist/layout/AppContentFooter/app-content-footer.d.ts.map +1 -0
- package/dist/layout/AppContentFooter/app-content-footer.js +42 -0
- package/dist/layout/AppContentFooter/app-content-footer.js.map +1 -0
- package/dist/layout/AppContentFooter/app-content-footer.module.scss.js +6 -0
- package/dist/layout/AppContentFooter/app-content-footer.module.scss.js.map +1 -0
- package/dist/layout/AppContentFooter/index.d.ts +2 -0
- package/dist/layout/AppContentFooter/index.d.ts.map +1 -0
- package/dist/layout/AppContentMain/app-content-main.css +6 -0
- package/dist/layout/AppContentMain/app-content-main.d.ts +37 -0
- package/dist/layout/AppContentMain/app-content-main.d.ts.map +1 -0
- package/dist/layout/AppContentMain/app-content-main.js +41 -0
- package/dist/layout/AppContentMain/app-content-main.js.map +1 -0
- package/dist/layout/AppContentMain/app-content-main.module.scss.js +6 -0
- package/dist/layout/AppContentMain/app-content-main.module.scss.js.map +1 -0
- package/dist/layout/AppContentMain/index.d.ts +2 -0
- package/dist/layout/AppContentMain/index.d.ts.map +1 -0
- package/dist/layout/AppFooter/app-footer.js +1 -1
- package/dist/layout/AppSidebar/app-sidebar.js +1 -1
- package/dist/layout/AppSidebarHeader/app-sidebar-header.css +2 -3
- package/dist/layout/AppSidebarHeader/app-sidebar-header.d.ts +10 -2
- package/dist/layout/AppSidebarHeader/app-sidebar-header.d.ts.map +1 -1
- package/dist/layout/AppSidebarHeader/app-sidebar-header.js +12 -32
- package/dist/layout/AppSidebarHeader/app-sidebar-header.js.map +1 -1
- package/dist/layout/Collapse/collapse.css +4 -1
- package/dist/layout/Column/column.css +6 -0
- package/dist/layout/Column/column.d.ts.map +1 -1
- package/dist/layout/Column/column.js +3 -1
- package/dist/layout/Column/column.js.map +1 -1
- package/dist/layout/Column/column.module.scss.js +1 -1
- package/dist/layout/Container/container.css +42 -0
- package/dist/layout/Container/container.d.ts.map +1 -1
- package/dist/layout/Container/container.js +37 -9
- package/dist/layout/Container/container.js.map +1 -1
- package/dist/layout/Container/container.module.scss.js +1 -1
- package/dist/layout/Grid/grid.css +28 -0
- package/dist/layout/Grid/grid.d.ts.map +1 -1
- package/dist/layout/Grid/grid.js +40 -4
- package/dist/layout/Grid/grid.js.map +1 -1
- package/dist/layout/Grid/grid.module.scss.js +1 -1
- package/dist/layout/Row/row.css +42 -0
- package/dist/layout/Row/row.d.ts.map +1 -1
- package/dist/layout/Row/row.js +5 -3
- package/dist/layout/Row/row.js.map +1 -1
- package/dist/layout/Row/row.module.scss.js +1 -1
- package/dist/layout/Sidebar/sidebar.css +4 -2
- package/dist/layout/Sidebar/sidebar.js +1 -1
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout.d.ts +3 -3
- package/dist/layout.js +2 -0
- package/dist/layout.js.map +1 -1
- package/dist/navigation/DropdownMenu/dropdown-menu.d.ts.map +1 -1
- package/dist/navigation/DropdownMenu/dropdown-menu.js +1 -1
- package/dist/navigation/DropdownMenu/dropdown-menu.js.map +1 -1
- package/dist/navigation/NavUser/nav-user.js +2 -2
- package/dist/navigation/Sheet/sheet.css +40 -6
- package/dist/navigation/Sheet/sheet.d.ts +22 -0
- package/dist/navigation/Sheet/sheet.d.ts.map +1 -1
- package/dist/navigation/Sheet/sheet.js +5 -30
- package/dist/navigation/Sheet/sheet.js.map +1 -1
- package/dist/navigation/Sheet/sheet.module.scss.js +1 -1
- package/dist/navigation.d.ts +22 -0
- package/dist/row-CuhTBQhK.d.ts +21 -0
- package/dist/settings/AppearanceDropdown/appearance-dropdown.js +1 -1
- package/dist/settings/AppearanceTabs/appearance-tabs.js +2 -27
- package/dist/settings/AppearanceTabs/appearance-tabs.js.map +1 -1
- package/dist/tokens.css +59 -17
- package/dist/tooltip-1qYeAGE9.d.ts +45 -0
- package/dist/tooltip-3IOkYFQ-.d.ts +45 -0
- package/dist/tooltip-540OmbEG.d.ts +46 -0
- package/dist/tooltip-91Nq_Hl8.d.ts +46 -0
- package/dist/tooltip-B56sWYK0.d.ts +46 -0
- package/dist/tooltip-BIrIF-4z.d.ts +45 -0
- package/dist/tooltip-BOipKW5l.d.ts +46 -0
- package/dist/tooltip-BPC0RH8i.d.ts +46 -0
- package/dist/tooltip-BST1BOCn.d.ts +45 -0
- package/dist/tooltip-BhuxNQwX.d.ts +45 -0
- package/dist/tooltip-BpAJwi3K.d.ts +46 -0
- package/dist/tooltip-C0LBu2Iu.d.ts +45 -0
- package/dist/tooltip-C1ZwALiG.d.ts +45 -0
- package/dist/tooltip-C55-HA0w.d.ts +45 -0
- package/dist/tooltip-CHn6WuDv.d.ts +46 -0
- package/dist/tooltip-CNjH7zKO.d.ts +45 -0
- package/dist/tooltip-CSBby1OT.d.ts +45 -0
- package/dist/tooltip-CXFRzR0L.d.ts +45 -0
- package/dist/tooltip-ChpsbkOU.d.ts +46 -0
- package/dist/tooltip-CspTy2ZW.d.ts +46 -0
- package/dist/tooltip-CvComAZD.d.ts +46 -0
- package/dist/tooltip-D19vhhRn.d.ts +45 -0
- package/dist/tooltip-D32S1g-7.d.ts +46 -0
- package/dist/tooltip-DAvBN683.d.ts +45 -0
- package/dist/tooltip-DQz4_i4m.d.ts +45 -0
- package/dist/tooltip-DVYPUAb1.d.ts +46 -0
- package/dist/tooltip-DXoSckt9.d.ts +46 -0
- package/dist/tooltip-Dtoq3bn_.d.ts +46 -0
- package/dist/tooltip-DxO_DWMO.d.ts +46 -0
- package/dist/tooltip-DxdGb3dX.d.ts +45 -0
- package/dist/tooltip-DzAzC0d7.d.ts +45 -0
- package/dist/tooltip-Lk4RpuSh.d.ts +45 -0
- package/dist/tooltip-ReFyHDhU.d.ts +45 -0
- package/dist/tooltip-_wdlSYAb.d.ts +46 -0
- package/dist/tooltip-nKcM19C9.d.ts +45 -0
- package/dist/types/layout/container.d.ts +28 -1
- package/dist/types/layout/container.d.ts.map +1 -1
- package/dist/types/layout/grid.d.ts +42 -0
- package/dist/types/layout/grid.d.ts.map +1 -1
- package/dist/types/layout/row.d.ts +7 -0
- package/dist/types/layout/row.d.ts.map +1 -1
- package/dist/typography/Typography/typography-variants.d.ts +3 -0
- package/dist/typography/Typography/typography-variants.d.ts.map +1 -1
- package/dist/typography/Typography/typography-variants.js +25 -0
- package/dist/typography/Typography/typography-variants.js.map +1 -1
- package/dist/typography/Typography/typography.css +105 -41
- package/dist/typography/Typography/typography.d.ts +20 -0
- package/dist/typography/Typography/typography.d.ts.map +1 -1
- package/dist/typography/Typography/typography.js +11 -2
- package/dist/typography/Typography/typography.js.map +1 -1
- package/dist/typography/Typography/typography.module.scss.js +1 -1
- package/dist/typography-CTGVc_Gg.d.ts +41 -0
- package/dist/typography.d.ts +2 -2
- package/dist/ui/Alert/alert-provider.d.ts.map +1 -1
- package/dist/ui/Alert/alert-provider.js +1 -1
- package/dist/ui/Alert/alert-provider.js.map +1 -1
- package/dist/ui/Button/button-variants.d.ts +1 -0
- package/dist/ui/Button/button-variants.d.ts.map +1 -1
- package/dist/ui/Button/button-variants.js +3 -0
- package/dist/ui/Button/button-variants.js.map +1 -1
- package/dist/ui/Button/button.css +68 -14
- package/dist/ui/Button/button.d.ts.map +1 -1
- package/dist/ui/Button/button.js +2 -2
- package/dist/ui/Button/button.js.map +1 -1
- package/dist/ui/Button/button.module.scss.js +1 -1
- package/dist/ui/Chip/chip.css +32 -11
- package/dist/ui/Chip/chip.d.ts +16 -0
- package/dist/ui/Chip/chip.d.ts.map +1 -1
- package/dist/ui/Chip/chip.js +4 -2
- package/dist/ui/Chip/chip.js.map +1 -1
- package/dist/ui/CodeBlock/code-block.css +8 -3
- package/dist/ui/Dialog/dialog.css +70 -0
- package/dist/ui/Dialog/dialog.d.ts +45 -2
- package/dist/ui/Dialog/dialog.d.ts.map +1 -1
- package/dist/ui/Dialog/dialog.js +256 -7
- package/dist/ui/Dialog/dialog.js.map +1 -1
- package/dist/ui/Dialog/dialog.module.scss.js +1 -1
- package/dist/ui/Icon/icon.css +14 -7
- package/dist/ui/ProgressBar/progress-bar.css +10 -3
- package/dist/ui/StatCard/stat-card.css +13 -0
- package/dist/ui/StatCard/stat-card.d.ts +9 -0
- package/dist/ui/StatCard/stat-card.d.ts.map +1 -1
- package/dist/ui/StatCard/stat-card.js +2 -2
- package/dist/ui/StatCard/stat-card.js.map +1 -1
- package/dist/ui/StatusDot/status-dot.css +4 -1
- package/dist/ui/StepProgress/step-progress.css +12 -4
- package/dist/ui/Switch/switch.css +6 -2
- package/dist/ui/Tooltip/tooltip.d.ts.map +1 -1
- package/dist/ui/Tooltip/tooltip.js +1 -1
- package/dist/ui/Tooltip/tooltip.js.map +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/user/UserInfo/user-info.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/portal.d.ts +34 -0
- package/dist/utils/portal.d.ts.map +1 -0
- package/dist/utils/portal.js +40 -0
- package/dist/utils/portal.js.map +1 -0
- package/dist/utils.d.ts +35 -1
- package/dist/utils.js +1 -0
- package/dist/utils.js.map +1 -1
- package/package.json +3 -2
- package/src/styles/_mixins.scss +30 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-card.js","sources":["../../../src/ui/StatCard/stat-card.tsx"],"sourcesContent":["import { Column } from '@constellation/layout/Column';\nimport { Container } from '@constellation/layout/Container';\nimport { Typography, type TypographyVariant } from '@constellation/typography/Typography';\nimport cn from 'clsx';\nimport { TrendingDownIcon, TrendingUpIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { statCardVariants } from './stat-card-variants';\nimport s from './stat-card.module.scss';\n\nexport type TrendDirection = 'up' | 'down' | 'neutral';\nexport type StatCardTheme =\n 'default' | 'primary' | 'secondary' | 'destructive' | 'warning' | 'success' | 'info' | 'slate';\nexport type StatCardSize = 'sm' | 'md' | 'lg';\nexport type StatCardVariant = 'unstyled' | 'outlined' | 'filled';\nexport type StatCardDirection = 'row' | 'column';\n\ntype StatCardContainerTheme = Exclude<StatCardTheme, 'default'>;\ntype StatCardVariantOptions = {\n theme?: StatCardTheme;\n size?: StatCardSize;\n variant?: StatCardVariant;\n};\ntype StatCardTypographyConfig = {\n label: TypographyVariant;\n value: TypographyVariant;\n description: TypographyVariant;\n trend: TypographyVariant;\n};\nconst DEFAULT_STAT_CARD_THEME: StatCardTheme = 'default';\nconst DEFAULT_STAT_CARD_SIZE: StatCardSize = 'md';\nconst DEFAULT_STAT_CARD_VARIANT: StatCardVariant = 'outlined';\nconst DEFAULT_STAT_CARD_DIRECTION: StatCardDirection = 'row';\nconst statCardTypographyBySize: Record<StatCardSize, StatCardTypographyConfig> = {\n sm: {\n label: 'body2',\n value: 'body1',\n description: 'caption',\n trend: 'caption',\n },\n md: {\n label: 'body1',\n value: 'subtitle1',\n description: 'body2',\n trend: 'body2',\n },\n lg: {\n label: 'subtitle1',\n value: 'h5',\n description: 'body1',\n trend: 'body1',\n },\n};\n\nexport interface StatCardProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Text label describing the metric. */\n label: string;\n /** The metric value to display. */\n value?: React.ReactNode;\n /** Icon displayed beside the metric. */\n icon?: React.ReactNode;\n /** Optional description below the value. */\n description?: string;\n /** Trend direction indicator. */\n trend?: TrendDirection;\n /** Trend label text (e.g. \"+12%\", \"−3.4%\"). */\n trendLabel?: string;\n /** Visual theme for the card. */\n theme?: StatCardTheme;\n /** Card size. */\n size?: StatCardSize;\n /** Card Direction. */\n direction?: StatCardDirection;\n /** Surface variant. */\n variant?: StatCardVariant;\n}\n\nconst StatCard = React.forwardRef<HTMLDivElement, StatCardProps>(\n (\n {\n label,\n value,\n icon,\n description,\n trend,\n trendLabel,\n theme,\n size,\n direction,\n variant,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const resolvedTheme: StatCardTheme = theme ?? DEFAULT_STAT_CARD_THEME;\n const resolvedSize: StatCardSize = size ?? DEFAULT_STAT_CARD_SIZE;\n const resolvedVariant: StatCardVariant = variant ?? DEFAULT_STAT_CARD_VARIANT;\n const resolvedDirection: StatCardDirection = direction ?? DEFAULT_STAT_CARD_DIRECTION;\n const isFilled = resolvedVariant === 'filled';\n const isOutlined = resolvedVariant === 'outlined';\n const containerTheme: StatCardContainerTheme | undefined =\n resolvedTheme !== 'default' && (isFilled || isOutlined) ? resolvedTheme : undefined;\n const trendTheme = trend === 'up' ? 'success' : trend === 'down' ? 'destructive' : 'muted';\n const rootProps: React.ComponentPropsWithoutRef<'div'> = props;\n const variantOptions: StatCardVariantOptions = {\n theme: resolvedTheme,\n size: resolvedSize,\n variant: resolvedVariant,\n };\n const typographyConfig = statCardTypographyBySize[resolvedSize];\n\n return (\n <Container\n ref={ref}\n data-slot={'stat-card'}\n gap={1}\n styled={isFilled || isOutlined}\n padding={isFilled || isOutlined ? 'md' : 'none'}\n outlined={isFilled || isOutlined}\n theme={containerTheme}\n className={cn(statCardVariants(variantOptions), className)}\n {...rootProps}\n >\n <Container\n styled={false}\n gap={2}\n direction={resolvedDirection}\n align={resolvedDirection === 'row' ? 'start' : 'center'}\n >\n {icon ? (\n <span data-slot={'stat-card-icon'} className={s['stat-card-icon']} aria-hidden={'true'}>\n {icon}\n </span>\n ) : null}\n <Column\n data-slot={'stat-card-header'}\n className={s['stat-card-header']}\n align={resolvedDirection === 'row' ? 'start' : 'center'}\n >\n <Typography\n data-slot={'stat-card-label'}\n variant={typographyConfig.label}\n className={s['stat-card-label']}\n align={resolvedDirection === 'row' ? undefined : 'center'}\n >\n {label}\n </Typography>\n {value ? (\n <Typography\n data-slot={'stat-card-value'}\n variant={typographyConfig.value}\n className={s['stat-card-value']}\n align={resolvedDirection === 'row' ? undefined : 'center'}\n >\n <strong>{value}</strong>\n </Typography>\n ) : null}\n {description ? (\n <Typography\n data-slot={'stat-card-description'}\n variant={typographyConfig.description}\n theme={'muted'}\n className={s['stat-card-description']}\n >\n {description}\n </Typography>\n ) : null}\n {trend ? (\n <Typography\n data-slot={'stat-card-trend'}\n variant={typographyConfig.trend}\n theme={trendTheme}\n className={s['stat-card-trend']}\n >\n {trend === 'up' ? <TrendingUpIcon aria-hidden={'true'} /> : null}\n {trend === 'down' ? <TrendingDownIcon aria-hidden={'true'} /> : null}\n {trendLabel}\n </Typography>\n ) : null}\n </Column>\n </Container>\n {children}\n </Container>\n );\n },\n);\nStatCard.displayName = 'StatCard';\n\nexport { StatCard };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;AA4BA,MAAM,uBAAuB,GAAkB,SAAS;AACxD,MAAM,sBAAsB,GAAiB,IAAI;AACjD,MAAM,yBAAyB,GAAoB,UAAU;AAC7D,MAAM,2BAA2B,GAAsB,KAAK;AAC5D,MAAM,wBAAwB,GAAmD;AAC/E,IAAA,EAAE,EAAE;AACF,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,WAAW,EAAE,SAAS;AACtB,QAAA,KAAK,EAAE,SAAS;AACjB,KAAA;AACD,IAAA,EAAE,EAAE;AACF,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,WAAW;AAClB,QAAA,WAAW,EAAE,OAAO;AACpB,QAAA,KAAK,EAAE,OAAO;AACf,KAAA;AACD,IAAA,EAAE,EAAE;AACF,QAAA,KAAK,EAAE,WAAW;AAClB,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,WAAW,EAAE,OAAO;AACpB,QAAA,KAAK,EAAE,OAAO;AACf,KAAA;CACF;AAyBD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CACE,EACE,KAAK,EACL,KAAK,EACL,IAAI,EACJ,WAAW,EACX,KAAK,EACL,UAAU,EACV,KAAK,EACL,IAAI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,KAAK,IACJD,IAAA,CAAC,UAAU,EAAA,EAAA,WAAA,EACE,iBAAiB,EAC5B,OAAO,EAAE,gBAAgB,CAAC,KAAK,EAC/B,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,CAAC,CAAC,iBAAiB,CAAC,aAE9B,KAAK,KAAK,IAAI,GAAGC,GAAA,CAAC,cAAc,EAAA,EAAA,aAAA,EAAc,MAAM,EAAA,CAAI,GAAG,IAAI,EAC/D,KAAK,KAAK,MAAM,GAAGA,GAAA,CAAC,gBAAgB,EAAA,EAAA,aAAA,EAAc,MAAM,EAAA,CAAI,GAAG,IAAI,EACnE,UAAU,IACA,IACX,IAAI,CAAA,EAAA,CACD,CAAA,EAAA,CACC,EACX,QAAQ,CAAA,EAAA,CACC;AAEhB,CAAC;AAEH,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
|
|
1
|
+
{"version":3,"file":"stat-card.js","sources":["../../../src/ui/StatCard/stat-card.tsx"],"sourcesContent":["import { Column } from '@constellation/layout/Column';\nimport { Container } from '@constellation/layout/Container';\nimport { Typography, type TypographyVariant } from '@constellation/typography/Typography';\nimport cn from 'clsx';\nimport { TrendingDownIcon, TrendingUpIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { statCardVariants } from './stat-card-variants';\nimport s from './stat-card.module.scss';\n\nexport type TrendDirection = 'up' | 'down' | 'neutral';\nexport type StatCardTheme =\n 'default' | 'primary' | 'secondary' | 'destructive' | 'warning' | 'success' | 'info' | 'slate';\nexport type StatCardSize = 'sm' | 'md' | 'lg';\nexport type StatCardVariant = 'unstyled' | 'outlined' | 'filled';\nexport type StatCardDirection = 'row' | 'column';\n\ntype StatCardContainerTheme = Exclude<StatCardTheme, 'default'>;\ntype StatCardVariantOptions = {\n theme?: StatCardTheme;\n size?: StatCardSize;\n variant?: StatCardVariant;\n};\ntype StatCardTypographyConfig = {\n label: TypographyVariant;\n value: TypographyVariant;\n description: TypographyVariant;\n trend: TypographyVariant;\n};\nconst DEFAULT_STAT_CARD_THEME: StatCardTheme = 'default';\nconst DEFAULT_STAT_CARD_SIZE: StatCardSize = 'md';\nconst DEFAULT_STAT_CARD_VARIANT: StatCardVariant = 'outlined';\nconst DEFAULT_STAT_CARD_DIRECTION: StatCardDirection = 'row';\nconst statCardTypographyBySize: Record<StatCardSize, StatCardTypographyConfig> = {\n sm: {\n label: 'body2',\n value: 'body1',\n description: 'caption',\n trend: 'caption',\n },\n md: {\n label: 'body1',\n value: 'subtitle1',\n description: 'body2',\n trend: 'body2',\n },\n lg: {\n label: 'subtitle1',\n value: 'h5',\n description: 'body1',\n trend: 'body1',\n },\n};\n\nexport interface StatCardProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Text label describing the metric. */\n label: string;\n /** The metric value to display. */\n value?: React.ReactNode;\n /** Icon displayed beside the metric. */\n icon?: React.ReactNode;\n /** Optional description below the value. */\n description?: string;\n /** Trend direction indicator. */\n trend?: TrendDirection;\n /** Trend label text (e.g. \"+12%\", \"−3.4%\"). */\n trendLabel?: string;\n /** Visual theme for the card. */\n theme?: StatCardTheme;\n /** Card size. */\n size?: StatCardSize;\n /** Card Direction. */\n direction?: StatCardDirection;\n /** Surface variant. */\n variant?: StatCardVariant;\n /**\n * The element the card renders as.\n *\n * A figure that FILTERS the thing it counts is a control, and should be a\n * real one: `el='button'` makes the whole card the target, so it takes\n * focus, answers the keyboard, and reads as pressable rather than as a\n * number that happens to react to a click.\n */\n el?: React.ElementType<React.HTMLAttributes<HTMLDivElement>>;\n}\n\nconst StatCard = React.forwardRef<HTMLDivElement, StatCardProps>(\n (\n {\n label,\n value,\n icon,\n description,\n trend,\n trendLabel,\n theme,\n size,\n direction,\n variant,\n el,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const resolvedTheme: StatCardTheme = theme ?? DEFAULT_STAT_CARD_THEME;\n const resolvedSize: StatCardSize = size ?? DEFAULT_STAT_CARD_SIZE;\n const resolvedVariant: StatCardVariant = variant ?? DEFAULT_STAT_CARD_VARIANT;\n const resolvedDirection: StatCardDirection = direction ?? DEFAULT_STAT_CARD_DIRECTION;\n const isFilled = resolvedVariant === 'filled';\n const isOutlined = resolvedVariant === 'outlined';\n const containerTheme: StatCardContainerTheme | undefined =\n resolvedTheme !== 'default' && (isFilled || isOutlined) ? resolvedTheme : undefined;\n const trendTheme = trend === 'up' ? 'success' : trend === 'down' ? 'destructive' : 'muted';\n const rootProps: React.ComponentPropsWithoutRef<'div'> = props;\n const variantOptions: StatCardVariantOptions = {\n theme: resolvedTheme,\n size: resolvedSize,\n variant: resolvedVariant,\n };\n const typographyConfig = statCardTypographyBySize[resolvedSize];\n\n return (\n <Container\n ref={ref}\n el={el}\n data-slot={'stat-card'}\n gap={1}\n styled={isFilled || isOutlined}\n padding={isFilled || isOutlined ? 'md' : 'none'}\n outlined={isFilled || isOutlined}\n theme={containerTheme}\n className={cn(statCardVariants(variantOptions), className)}\n {...rootProps}\n >\n <Container\n styled={false}\n gap={2}\n direction={resolvedDirection}\n align={resolvedDirection === 'row' ? 'start' : 'center'}\n >\n {icon ? (\n <span data-slot={'stat-card-icon'} className={s['stat-card-icon']} aria-hidden={'true'}>\n {icon}\n </span>\n ) : null}\n <Column\n data-slot={'stat-card-header'}\n className={s['stat-card-header']}\n align={resolvedDirection === 'row' ? 'start' : 'center'}\n >\n <Typography\n data-slot={'stat-card-label'}\n variant={typographyConfig.label}\n className={s['stat-card-label']}\n align={resolvedDirection === 'row' ? undefined : 'center'}\n >\n {label}\n </Typography>\n {value ? (\n <Typography\n data-slot={'stat-card-value'}\n variant={typographyConfig.value}\n className={s['stat-card-value']}\n align={resolvedDirection === 'row' ? undefined : 'center'}\n >\n <strong>{value}</strong>\n </Typography>\n ) : null}\n {description ? (\n <Typography\n data-slot={'stat-card-description'}\n variant={typographyConfig.description}\n theme={'muted'}\n className={s['stat-card-description']}\n >\n {description}\n </Typography>\n ) : null}\n {trend ? (\n <Typography\n data-slot={'stat-card-trend'}\n variant={typographyConfig.trend}\n theme={trendTheme}\n className={s['stat-card-trend']}\n >\n {trend === 'up' ? <TrendingUpIcon aria-hidden={'true'} /> : null}\n {trend === 'down' ? <TrendingDownIcon aria-hidden={'true'} /> : null}\n {trendLabel}\n </Typography>\n ) : null}\n </Column>\n </Container>\n {children}\n </Container>\n );\n },\n);\nStatCard.displayName = 'StatCard';\n\nexport { StatCard };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;AA4BA,MAAM,uBAAuB,GAAkB,SAAS;AACxD,MAAM,sBAAsB,GAAiB,IAAI;AACjD,MAAM,yBAAyB,GAAoB,UAAU;AAC7D,MAAM,2BAA2B,GAAsB,KAAK;AAC5D,MAAM,wBAAwB,GAAmD;AAC/E,IAAA,EAAE,EAAE;AACF,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,WAAW,EAAE,SAAS;AACtB,QAAA,KAAK,EAAE,SAAS;AACjB,KAAA;AACD,IAAA,EAAE,EAAE;AACF,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,WAAW;AAClB,QAAA,WAAW,EAAE,OAAO;AACpB,QAAA,KAAK,EAAE,OAAO;AACf,KAAA;AACD,IAAA,EAAE,EAAE;AACF,QAAA,KAAK,EAAE,WAAW;AAClB,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,WAAW,EAAE,OAAO;AACpB,QAAA,KAAK,EAAE,OAAO;AACf,KAAA;CACF;AAkCD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CACE,EACE,KAAK,EACL,KAAK,EACL,IAAI,EACJ,WAAW,EACX,KAAK,EACL,UAAU,EACV,KAAK,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EACP,EAAE,EACF,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,KACD;AACF,IAAA,MAAM,aAAa,GAAkB,KAAK,IAAI,uBAAuB;AACrE,IAAA,MAAM,YAAY,GAAiB,IAAI,IAAI,sBAAsB;AACjE,IAAA,M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C,GAAA,CAAC,cAAc,EAAA,EAAA,aAAA,EAAc,MAAM,EAAA,CAAI,GAAG,IAAI,EAC/D,KAAK,KAAK,MAAM,GAAGA,GAAA,CAAC,gBAAgB,EAAA,EAAA,aAAA,EAAc,MAAM,EAAA,CAAI,GAAG,IAAI,EACnE,UAAU,IACA,IACX,IAAI,CAAA,EAAA,CACD,CAAA,EAAA,CACC,EACX,QAAQ,CAAA,EAAA,CACC;AAEhB,CAAC;AAEH,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
|
|
@@ -55,7 +55,10 @@
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
@media (prefers-reduced-motion: reduce) {
|
|
58
|
-
.status-dot-module_status-dot--pulse__Vw5aP {
|
|
58
|
+
:root:not([data-motion=full]) .status-dot-module_status-dot--pulse__Vw5aP {
|
|
59
59
|
animation: none;
|
|
60
60
|
}
|
|
61
|
+
}
|
|
62
|
+
:root[data-motion=reduced] .status-dot-module_status-dot--pulse__Vw5aP {
|
|
63
|
+
animation: none;
|
|
61
64
|
}
|
|
@@ -322,12 +322,20 @@
|
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
@media (prefers-reduced-motion: reduce) {
|
|
325
|
-
.step-progress-module_step-dot--active__W0-o1 {
|
|
325
|
+
:root:not([data-motion=full]) .step-progress-module_step-dot--active__W0-o1 {
|
|
326
326
|
animation: none;
|
|
327
327
|
}
|
|
328
|
-
.step-progress-module_step-dot__P-7MT,
|
|
329
|
-
.step-progress-module_step-connector-fill__hqahw,
|
|
330
|
-
.step-progress-module_step-label__gjjgq {
|
|
328
|
+
:root:not([data-motion=full]) .step-progress-module_step-dot__P-7MT,
|
|
329
|
+
:root:not([data-motion=full]) .step-progress-module_step-connector-fill__hqahw,
|
|
330
|
+
:root:not([data-motion=full]) .step-progress-module_step-label__gjjgq {
|
|
331
331
|
transition: none;
|
|
332
332
|
}
|
|
333
|
+
}
|
|
334
|
+
:root[data-motion=reduced] .step-progress-module_step-dot--active__W0-o1 {
|
|
335
|
+
animation: none;
|
|
336
|
+
}
|
|
337
|
+
:root[data-motion=reduced] .step-progress-module_step-dot__P-7MT,
|
|
338
|
+
:root[data-motion=reduced] .step-progress-module_step-connector-fill__hqahw,
|
|
339
|
+
:root[data-motion=reduced] .step-progress-module_step-label__gjjgq {
|
|
340
|
+
transition: none;
|
|
333
341
|
}
|
|
@@ -109,8 +109,12 @@
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
@media (prefers-reduced-motion: reduce) {
|
|
112
|
-
.switch-module_switch__Ea9Rj,
|
|
113
|
-
.switch-module_switch__Ea9Rj .switch-module_thumb__cVffP {
|
|
112
|
+
:root:not([data-motion=full]) .switch-module_switch__Ea9Rj,
|
|
113
|
+
:root:not([data-motion=full]) .switch-module_switch__Ea9Rj .switch-module_thumb__cVffP {
|
|
114
114
|
transition: none;
|
|
115
115
|
}
|
|
116
|
+
}
|
|
117
|
+
:root[data-motion=reduced] .switch-module_switch__Ea9Rj,
|
|
118
|
+
:root[data-motion=reduced] .switch-module_switch__Ea9Rj .switch-module_thumb__cVffP {
|
|
119
|
+
transition: none;
|
|
116
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/ui/Tooltip/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+C/B,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,aAAwC,GACzC,EAAE;IACD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,qBAMA;AAID,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,K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AAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iBAAS,OAAO,CAAC,EACf,QAAQ,EACR,IAAI,EAAE,cAAc,EACpB,WAAmB,EACnB,YAAY,EACZ,aAAa,GACd,EAAE,YAAY,qBAqBd;AAID,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,iBAAS,cAAc,CAAC,EACtB,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EAAE,mBAAmB,qBA6ErB;AAID,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC/E,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,QAAQ,EACR,IAAY,EACZ,UAAc,EACd,GAAG,KAAK,EACT,EAAE,mBAAmB,4BAyGrB;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -183,7 +183,7 @@ function TooltipContent({ className, children, side = 'top', sideOffset = 8, ...
|
|
|
183
183
|
if (!mounted)
|
|
184
184
|
return null;
|
|
185
185
|
const isReady = positioned && state !== 'idle';
|
|
186
|
-
return createPortal(jsx("div", { ref: measureRef, style: isReady
|
|
186
|
+
return createPortal(jsx("div", { "data-constellation-portal": '', ref: measureRef, style: isReady
|
|
187
187
|
? { ...position, pointerEvents: 'none' }
|
|
188
188
|
: { position: 'fixed', visibility: 'hidden', zIndex: 50, pointerEvents: 'none' }, children: jsxs("div", { "data-slot": 'tooltip-content', "data-side": resolvedSide, "data-state": state === 'idle' ? undefined : state === 'open' ? 'delayed-open' : state, className: cn(s['tooltip-content'], className), ...props, children: [children, jsx("span", { className: s['tooltip-arrow'], "aria-hidden": 'true' })] }) }), document.body);
|
|
189
189
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["../../../src/ui/Tooltip/tooltip.tsx"],"sourcesContent":["import cn from 'clsx';\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { mergeRefs } from '../../internal/merge-refs';\nimport { useAnimationState } from '../../internal/use-animation-state';\nimport s from './tooltip.module.scss';\n\n// ── Context ──────────────────────────────────────────────\n\ntype TooltipContextValue = {\n open: boolean;\n triggerRef: React.RefObject<HTMLElement | null>;\n setOpen: (open: boolean) => void;\n /**\n * Milliseconds to wait on hover-enter before showing the tooltip.\n * `0` means show instantly. Resolved at <Tooltip> from its own\n * `delayDuration` prop with fallback to the <TooltipProvider> default.\n */\n delayDuration: number;\n};\n\nconst TooltipContext = React.createContext<TooltipContextValue | null>(null);\n\nfunction useTooltipContext() {\n const ctx = React.useContext(TooltipContext);\n if (!ctx) throw new Error('Tooltip compound components must be used within <Tooltip>');\n return ctx;\n}\n\n// ── Provider ─────────────────────────────────────────────\n\n/**\n * Default hover-intent delay for tooltips across the design system,\n * in milliseconds. Applied when neither `<Tooltip delayDuration={...}>`\n * nor an ancestor `<TooltipProvider delayDuration={...}>` overrides it.\n * Matches Radix / Material defaults for hover intent.\n */\nconst DEFAULT_TOOLTIP_DELAY_MS = 150;\n\n/**\n * Sets a default `delayDuration` for descendant `<Tooltip>` instances.\n * Wrapping is optional — every `<Tooltip>` inherits the global default\n * (`DEFAULT_TOOLTIP_DELAY_MS`) without a Provider. Use the Provider to\n * override the default for a subtree (e.g. `delayDuration={0}` to make\n * a cluster of tooltips instant).\n */\nconst TooltipDefaultDelayContext = React.createContext<number>(DEFAULT_TOOLTIP_DELAY_MS);\n\nfunction TooltipProvider({\n children,\n delayDuration = DEFAULT_TOOLTIP_DELAY_MS,\n}: {\n children?: React.ReactNode;\n delayDuration?: number;\n}) {\n return (\n <TooltipDefaultDelayContext.Provider value={delayDuration}>\n {children}\n </TooltipDefaultDelayContext.Provider>\n );\n}\n\n// ── Root ─────────────────────────────────────────────────\n\nexport interface TooltipProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n delayDuration?: number;\n}\n\nfunction Tooltip({\n children,\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n delayDuration,\n}: TooltipProps) {\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n const triggerRef = React.useRef<HTMLElement | null>(null);\n const inheritedDelay = React.useContext(TooltipDefaultDelayContext);\n const effectiveDelay = delayDuration ?? inheritedDelay;\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n return (\n <TooltipContext.Provider value={{ open, triggerRef, setOpen, delayDuration: effectiveDelay }}>\n {children}\n </TooltipContext.Provider>\n );\n}\n\n// ── Trigger ──────────────────────────────────────────────\n\nexport interface TooltipTriggerProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nfunction TooltipTrigger({\n asChild,\n children,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ...props\n}: TooltipTriggerProps) {\n const { setOpen, triggerRef, delayDuration } = useTooltipContext();\n const openTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearPendingOpen = React.useCallback(() => {\n if (openTimerRef.current !== null) {\n clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }\n }, []);\n\n // Ensure any pending hover-open timer is cleared if the trigger\n // unmounts mid-delay — otherwise we'd call setOpen on an unmounted tree.\n React.useEffect(() => clearPendingOpen, [clearPendingOpen]);\n\n // Hover open honors the resolved delay (defaults to 0 = instant).\n // Keyboard focus opens instantly — keyboard users expect immediate\n // feedback and there's no \"transient hover\" noise to suppress.\n const handlers = {\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => {\n onMouseEnter?.(e);\n clearPendingOpen();\n if (delayDuration > 0) {\n openTimerRef.current = setTimeout(() => {\n openTimerRef.current = null;\n setOpen(true);\n }, delayDuration);\n } else {\n setOpen(true);\n }\n },\n onMouseLeave: (e: React.MouseEvent<HTMLElement>) => {\n onMouseLeave?.(e);\n clearPendingOpen();\n setOpen(false);\n },\n onFocus: (e: React.FocusEvent<HTMLElement>) => {\n onFocus?.(e);\n clearPendingOpen();\n setOpen(true);\n },\n onBlur: (e: React.FocusEvent<HTMLElement>) => {\n onBlur?.(e);\n clearPendingOpen();\n setOpen(false);\n },\n };\n\n if (asChild && React.isValidElement(children)) {\n const child = children as React.ReactElement<Record<string, unknown>>;\n const childProps = (child.props ?? {}) as Record<string, unknown> & {\n ref?: React.Ref<HTMLElement>;\n };\n\n const composeHandler = <E,>(ours: (e: E) => void, theirs: unknown): ((e: E) => void) =>\n typeof theirs === 'function'\n ? (e: E) => {\n (theirs as (e: E) => void)(e);\n ours(e);\n }\n : ours;\n\n return React.cloneElement(child, {\n ...props,\n onMouseEnter: composeHandler(handlers.onMouseEnter, childProps.onMouseEnter),\n onMouseLeave: composeHandler(handlers.onMouseLeave, childProps.onMouseLeave),\n onFocus: composeHandler(handlers.onFocus, childProps.onFocus),\n onBlur: composeHandler(handlers.onBlur, childProps.onBlur),\n ref: mergeRefs(triggerRef, childProps.ref),\n });\n }\n\n return (\n <span data-slot={'tooltip-trigger'} ref={triggerRef} {...handlers} {...props}>\n {children}\n </span>\n );\n}\n\n// ── Content ──────────────────────────────────────────────\n\nexport interface TooltipContentProps extends React.HTMLAttributes<HTMLDivElement> {\n side?: 'top' | 'right' | 'bottom' | 'left';\n sideOffset?: number;\n}\n\nfunction TooltipContent({\n className,\n children,\n side = 'top',\n sideOffset = 8,\n ...props\n}: TooltipContentProps) {\n const { open, triggerRef } = useTooltipContext();\n const { mounted, state } = useAnimationState(open, 150);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const [positioned, setPositioned] = React.useState(false);\n const [position, setPosition] = React.useState<React.CSSProperties>({});\n const [resolvedSide, setResolvedSide] = React.useState(side);\n\n // Reset positioned flag when unmounted so next open re-measures\n React.useEffect(() => {\n if (!mounted) setPositioned(false);\n }, [mounted]);\n\n const calcPosition = React.useCallback(() => {\n const node = contentRef.current;\n if (!node || !triggerRef.current) return;\n\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const contentRect = node.getBoundingClientRect();\n let top: number;\n let left: number;\n let actualSide = side;\n\n switch (side) {\n case 'top': {\n top = triggerRect.top - sideOffset - contentRect.height;\n left = triggerRect.left + (triggerRect.width - contentRect.width) / 2;\n if (top < 0) {\n top = triggerRect.bottom + sideOffset;\n actualSide = 'bottom';\n }\n break;\n }\n case 'bottom': {\n top = triggerRect.bottom + sideOffset;\n left = triggerRect.left + (triggerRect.width - contentRect.width) / 2;\n break;\n }\n case 'left': {\n top = triggerRect.top + (triggerRect.height - contentRect.height) / 2;\n left = triggerRect.left - sideOffset - contentRect.width;\n break;\n }\n case 'right': {\n top = triggerRect.top + (triggerRect.height - contentRect.height) / 2;\n left = triggerRect.right + sideOffset;\n break;\n }\n }\n\n setResolvedSide(actualSide);\n setPosition({ position: 'fixed', top, left, zIndex: 50 });\n setPositioned(true);\n }, [side, sideOffset, triggerRef]);\n\n // Measure + position via ref callback (fires after DOM mount)\n const measureRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (contentRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (node && mounted && triggerRef.current) {\n calcPosition();\n }\n },\n [mounted, triggerRef, calcPosition],\n );\n\n // Reposition on scroll/resize so the tooltip tracks the trigger.\n React.useEffect(() => {\n if (!mounted) return;\n\n window.addEventListener('scroll', calcPosition, true);\n window.addEventListener('resize', calcPosition);\n return () => {\n window.removeEventListener('scroll', calcPosition, true);\n window.removeEventListener('resize', calcPosition);\n };\n }, [mounted, calcPosition]);\n\n if (!mounted) return null;\n\n const isReady = positioned && state !== 'idle';\n\n return createPortal(\n <div\n ref={measureRef}\n style={\n isReady\n ? { ...position, pointerEvents: 'none' }\n : { position: 'fixed', visibility: 'hidden', zIndex: 50, pointerEvents: 'none' }\n }\n >\n <div\n data-slot={'tooltip-content'}\n data-side={resolvedSide}\n data-state={state === 'idle' ? undefined : state === 'open' ? 'delayed-open' : state}\n className={cn(s['tooltip-content'], className)}\n {...props}\n >\n {children}\n <span className={s['tooltip-arrow']} aria-hidden={'true'} />\n </div>\n </div>,\n document.body,\n );\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;AAqBA,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAA6B,IAAI,CAAC;AAE5E,SAAS,iBAAiB,GAAA;IACxB,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;AAC5C,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC;AACtF,IAAA,OAAO,GAAG;AACZ;AAEA;AAEA;;;;;AAKG;AACH,MAAM,wBAAwB,GAAG,GAAG;AAEpC;;;;;;AAMG;AACH,MAAM,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAAS,wBAAwB,CAAC;AAExF,SAAS,eAAe,CAAC,EACvB,QAAQ,EACR,aAAa,GAAG,wBAAwB,GAIzC,EAAA;AACC,IAAA,QACEA,GAAA,CAAC,0BAA0B,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,aAAa,EAAA,QAAA,EACtD,QAAQ,EAAA,CAC2B;AAE1C;AAYA,SAAS,OAAO,CAAC,EACf,QAAQ,EACR,IAAI,EAAE,cAAc,EACpB,WAAW,GAAG,KAAK,EACnB,YAAY,EACZ,aAAa,GACA,EAAA;AACb,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CA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,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAE3B,IAAA,IAAI,CAAC,OAAO;AAAE,QAAA,OAAO,IAAI;AAEzB,IAAA,MAAM,OAAO,GAAG,UAAU,IAAI,KAAK,KAAK,MAAM;IAE9C,OAAO,YAAY,CACjBA,GAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,UAAU,EACf,KAAK,EACH;cACI,EAAE,GAAG,QAAQ,EAAE,aAAa,EAAE,MAAM;AACtC,cAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,EAAA,QAAA,EAGpFC,IAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACa,iBAAiB,EAAA,WAAA,EACjB,YAAY,EAAA,YAAA,EACX,KAAK,KAAK,MAAM,GAAG,SAAS,GAAG,KAAK,KAAK,MAAM,GAAG,cAAc,GAAG,KAAK,EACpF,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC,KAC1C,KAAK,EAAA,QAAA,EAAA,CAER,QAAQ,EACTD,cAAM,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC,EAAA,aAAA,EAAe,MAAM,EAAA,CAAI,IACxD,EAAA,CACF,EACN,QAAQ,CAAC,IAAI,CACd;AACH;;"}
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../../src/ui/Tooltip/tooltip.tsx"],"sourcesContent":["import cn from 'clsx';\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { mergeRefs } from '../../internal/merge-refs';\nimport { useAnimationState } from '../../internal/use-animation-state';\nimport s from './tooltip.module.scss';\n\n// ── Context ──────────────────────────────────────────────\n\ntype TooltipContextValue = {\n open: boolean;\n triggerRef: React.RefObject<HTMLElement | null>;\n setOpen: (open: boolean) => void;\n /**\n * Milliseconds to wait on hover-enter before showing the tooltip.\n * `0` means show instantly. Resolved at <Tooltip> from its own\n * `delayDuration` prop with fallback to the <TooltipProvider> default.\n */\n delayDuration: number;\n};\n\nconst TooltipContext = React.createContext<TooltipContextValue | null>(null);\n\nfunction useTooltipContext() {\n const ctx = React.useContext(TooltipContext);\n if (!ctx) throw new Error('Tooltip compound components must be used within <Tooltip>');\n return ctx;\n}\n\n// ── Provider ─────────────────────────────────────────────\n\n/**\n * Default hover-intent delay for tooltips across the design system,\n * in milliseconds. Applied when neither `<Tooltip delayDuration={...}>`\n * nor an ancestor `<TooltipProvider delayDuration={...}>` overrides it.\n * Matches Radix / Material defaults for hover intent.\n */\nconst DEFAULT_TOOLTIP_DELAY_MS = 150;\n\n/**\n * Sets a default `delayDuration` for descendant `<Tooltip>` instances.\n * Wrapping is optional — every `<Tooltip>` inherits the global default\n * (`DEFAULT_TOOLTIP_DELAY_MS`) without a Provider. Use the Provider to\n * override the default for a subtree (e.g. `delayDuration={0}` to make\n * a cluster of tooltips instant).\n */\nconst TooltipDefaultDelayContext = React.createContext<number>(DEFAULT_TOOLTIP_DELAY_MS);\n\nfunction TooltipProvider({\n children,\n delayDuration = DEFAULT_TOOLTIP_DELAY_MS,\n}: {\n children?: React.ReactNode;\n delayDuration?: number;\n}) {\n return (\n <TooltipDefaultDelayContext.Provider value={delayDuration}>\n {children}\n </TooltipDefaultDelayContext.Provider>\n );\n}\n\n// ── Root ─────────────────────────────────────────────────\n\nexport interface TooltipProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n delayDuration?: number;\n}\n\nfunction Tooltip({\n children,\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n delayDuration,\n}: TooltipProps) {\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n const triggerRef = React.useRef<HTMLElement | null>(null);\n const inheritedDelay = React.useContext(TooltipDefaultDelayContext);\n const effectiveDelay = delayDuration ?? inheritedDelay;\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n return (\n <TooltipContext.Provider value={{ open, triggerRef, setOpen, delayDuration: effectiveDelay }}>\n {children}\n </TooltipContext.Provider>\n );\n}\n\n// ── Trigger ──────────────────────────────────────────────\n\nexport interface TooltipTriggerProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nfunction TooltipTrigger({\n asChild,\n children,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ...props\n}: TooltipTriggerProps) {\n const { setOpen, triggerRef, delayDuration } = useTooltipContext();\n const openTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearPendingOpen = React.useCallback(() => {\n if (openTimerRef.current !== null) {\n clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }\n }, []);\n\n // Ensure any pending hover-open timer is cleared if the trigger\n // unmounts mid-delay — otherwise we'd call setOpen on an unmounted tree.\n React.useEffect(() => clearPendingOpen, [clearPendingOpen]);\n\n // Hover open honors the resolved delay (defaults to 0 = instant).\n // Keyboard focus opens instantly — keyboard users expect immediate\n // feedback and there's no \"transient hover\" noise to suppress.\n const handlers = {\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => {\n onMouseEnter?.(e);\n clearPendingOpen();\n if (delayDuration > 0) {\n openTimerRef.current = setTimeout(() => {\n openTimerRef.current = null;\n setOpen(true);\n }, delayDuration);\n } else {\n setOpen(true);\n }\n },\n onMouseLeave: (e: React.MouseEvent<HTMLElement>) => {\n onMouseLeave?.(e);\n clearPendingOpen();\n setOpen(false);\n },\n onFocus: (e: React.FocusEvent<HTMLElement>) => {\n onFocus?.(e);\n clearPendingOpen();\n setOpen(true);\n },\n onBlur: (e: React.FocusEvent<HTMLElement>) => {\n onBlur?.(e);\n clearPendingOpen();\n setOpen(false);\n },\n };\n\n if (asChild && React.isValidElement(children)) {\n const child = children as React.ReactElement<Record<string, unknown>>;\n const childProps = (child.props ?? {}) as Record<string, unknown> & {\n ref?: React.Ref<HTMLElement>;\n };\n\n const composeHandler = <E,>(ours: (e: E) => void, theirs: unknown): ((e: E) => void) =>\n typeof theirs === 'function'\n ? (e: E) => {\n (theirs as (e: E) => void)(e);\n ours(e);\n }\n : ours;\n\n return React.cloneElement(child, {\n ...props,\n onMouseEnter: composeHandler(handlers.onMouseEnter, childProps.onMouseEnter),\n onMouseLeave: composeHandler(handlers.onMouseLeave, childProps.onMouseLeave),\n onFocus: composeHandler(handlers.onFocus, childProps.onFocus),\n onBlur: composeHandler(handlers.onBlur, childProps.onBlur),\n ref: mergeRefs(triggerRef, childProps.ref),\n });\n }\n\n return (\n <span data-slot={'tooltip-trigger'} ref={triggerRef} {...handlers} {...props}>\n {children}\n </span>\n );\n}\n\n// ── Content ──────────────────────────────────────────────\n\nexport interface TooltipContentProps extends React.HTMLAttributes<HTMLDivElement> {\n side?: 'top' | 'right' | 'bottom' | 'left';\n sideOffset?: number;\n}\n\nfunction TooltipContent({\n className,\n children,\n side = 'top',\n sideOffset = 8,\n ...props\n}: TooltipContentProps) {\n const { open, triggerRef } = useTooltipContext();\n const { mounted, state } = useAnimationState(open, 150);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const [positioned, setPositioned] = React.useState(false);\n const [position, setPosition] = React.useState<React.CSSProperties>({});\n const [resolvedSide, setResolvedSide] = React.useState(side);\n\n // Reset positioned flag when unmounted so next open re-measures\n React.useEffect(() => {\n if (!mounted) setPositioned(false);\n }, [mounted]);\n\n const calcPosition = React.useCallback(() => {\n const node = contentRef.current;\n if (!node || !triggerRef.current) return;\n\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const contentRect = node.getBoundingClientRect();\n let top: number;\n let left: number;\n let actualSide = side;\n\n switch (side) {\n case 'top': {\n top = triggerRect.top - sideOffset - contentRect.height;\n left = triggerRect.left + (triggerRect.width - contentRect.width) / 2;\n if (top < 0) {\n top = triggerRect.bottom + sideOffset;\n actualSide = 'bottom';\n }\n break;\n }\n case 'bottom': {\n top = triggerRect.bottom + sideOffset;\n left = triggerRect.left + (triggerRect.width - contentRect.width) / 2;\n break;\n }\n case 'left': {\n top = triggerRect.top + (triggerRect.height - contentRect.height) / 2;\n left = triggerRect.left - sideOffset - contentRect.width;\n break;\n }\n case 'right': {\n top = triggerRect.top + (triggerRect.height - contentRect.height) / 2;\n left = triggerRect.right + sideOffset;\n break;\n }\n }\n\n setResolvedSide(actualSide);\n setPosition({ position: 'fixed', top, left, zIndex: 50 });\n setPositioned(true);\n }, [side, sideOffset, triggerRef]);\n\n // Measure + position via ref callback (fires after DOM mount)\n const measureRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (contentRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (node && mounted && triggerRef.current) {\n calcPosition();\n }\n },\n [mounted, triggerRef, calcPosition],\n );\n\n // Reposition on scroll/resize so the tooltip tracks the trigger.\n React.useEffect(() => {\n if (!mounted) return;\n\n window.addEventListener('scroll', calcPosition, true);\n window.addEventListener('resize', calcPosition);\n return () => {\n window.removeEventListener('scroll', calcPosition, true);\n window.removeEventListener('resize', calcPosition);\n };\n }, [mounted, calcPosition]);\n\n if (!mounted) return null;\n\n const isReady = positioned && state !== 'idle';\n\n return createPortal(\n <div\n data-constellation-portal={''}\n ref={measureRef}\n style={\n isReady\n ? { ...position, pointerEvents: 'none' }\n : { position: 'fixed', visibility: 'hidden', zIndex: 50, pointerEvents: 'none' }\n }\n >\n <div\n data-slot={'tooltip-content'}\n data-side={resolvedSide}\n data-state={state === 'idle' ? undefined : state === 'open' ? 'delayed-open' : state}\n className={cn(s['tooltip-content'], className)}\n {...props}\n >\n {children}\n <span className={s['tooltip-arrow']} aria-hidden={'true'} />\n </div>\n </div>,\n document.body,\n );\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;AAqBA,MAAM,cAAc,GA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,EAGpFC,IAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACa,iBAAiB,EAAA,WAAA,EACjB,YAAY,EAAA,YAAA,EACX,KAAK,KAAK,MAAM,GAAG,SAAS,GAAG,KAAK,KAAK,MAAM,GAAG,cAAc,GAAG,KAAK,EACpF,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC,KAC1C,KAAK,EAAA,QAAA,EAAA,CAER,QAAQ,EACTD,cAAM,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC,EAAA,aAAA,EAAe,MAAM,EAAA,CAAI,IACxD,EAAA,CACF,EACN,QAAQ,CAAC,IAAI,CACd;AACH;;"}
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, f as AlertProps, g as AlertProvider, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as CodeBlock, r as CodeBlockProps, D as DevIndicator, s as DevIndicatorProps, t as Dialog, u as DialogClose, v as DialogCloseProps, w as DialogContent, x as DialogContentProps, y as DialogDescription, z as DialogFooter, B as DialogHeader, E as DialogOverlay, F as DialogPortal, G as DialogProps, H as DialogTitle, I as DialogTrigger, J as DialogTriggerProps, K as EmptyState, L as EmptyStateProps, M as Icon, N as IconProps, O as List, P as ListItem, Q as ListItemProps, R as ListProps, T as Pagination, V as ProgressBar, W as ProgressBarProps, Y as Separator, Z as SeparatorProps, a0 as StatCard, a1 as StatCardDirection, a2 as StatCardProps, a3 as StatCardSize, a4 as StatCardTheme, a5 as StatCardVariant, a6 as StatusDot, a7 as StatusDotProps, a8 as Step, a9 as StepProgress, aa as StepProgressProps, ab as Switch, ac as SwitchProps, ad as Table, ae as TableActionCell, af as TableActionCellProps, ag as TableActionItem, ah as TableBody, ai as TableBodyProps, aj as TableCard, ak as TableCell, al as TableFooter, am as TableHead, an as TableHeader, ao as TableRow, ap as TableSortableHeader, aq as TableSortableHeaderProps, ar as TableToolbar, as as TableToolbarProps, at as Toggle, au as ToggleGroup, av as ToggleGroupProps, aw as ToggleProps, ax as TrendDirection, ay as persistAlert, az as statusDotVariants } from './index-
|
|
2
|
-
export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-
|
|
1
|
+
export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, f as AlertProps, g as AlertProvider, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as CodeBlock, r as CodeBlockProps, D as DevIndicator, s as DevIndicatorProps, t as Dialog, u as DialogClose, v as DialogCloseProps, w as DialogContent, x as DialogContentProps, y as DialogDescription, z as DialogFooter, B as DialogHeader, E as DialogOverlay, F as DialogPortal, G as DialogProps, H as DialogTitle, I as DialogTrigger, J as DialogTriggerProps, K as EmptyState, L as EmptyStateProps, M as Icon, N as IconProps, O as List, P as ListItem, Q as ListItemProps, R as ListProps, T as Pagination, V as ProgressBar, W as ProgressBarProps, Y as Separator, Z as SeparatorProps, a0 as StatCard, a1 as StatCardDirection, a2 as StatCardProps, a3 as StatCardSize, a4 as StatCardTheme, a5 as StatCardVariant, a6 as StatusDot, a7 as StatusDotProps, a8 as Step, a9 as StepProgress, aa as StepProgressProps, ab as Switch, ac as SwitchProps, ad as Table, ae as TableActionCell, af as TableActionCellProps, ag as TableActionItem, ah as TableBody, ai as TableBodyProps, aj as TableCard, ak as TableCell, al as TableFooter, am as TableHead, an as TableHeader, ao as TableRow, ap as TableSortableHeader, aq as TableSortableHeaderProps, ar as TableToolbar, as as TableToolbarProps, at as Toggle, au as ToggleGroup, av as ToggleGroupProps, aw as ToggleProps, ax as TrendDirection, ay as persistAlert, az as statusDotVariants } from './index-CWM2ewRz.js';
|
|
2
|
+
export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-BpAJwi3K.js';
|
|
3
3
|
import 'class-variance-authority';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'class-variance-authority/types';
|
|
6
|
-
import './typography-
|
|
6
|
+
import './typography-CTGVc_Gg.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import '../../layout/Sidebar/sidebar-context.js';
|
|
3
2
|
import 'react';
|
|
3
|
+
import '../../layout/Sidebar/sidebar-context.js';
|
|
4
4
|
import '../../ui/Alert/alert-context.js';
|
|
5
5
|
import '../../ui/Table/table-sort-context.js';
|
|
6
6
|
import { useInitials } from '../../hooks/use-initials.js';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every Constellation surface that escapes its parent — Select and Combobox
|
|
3
|
+
* panels, DropdownMenu, DatePicker, Tooltip, Dialog, Sheet, the alert stack —
|
|
4
|
+
* renders through a React portal into `document.body`.
|
|
5
|
+
*
|
|
6
|
+
* React events still bubble through the React tree, so an `onClick` on an
|
|
7
|
+
* ancestor component sees them. A NATIVE `document` listener does not: it sees
|
|
8
|
+
* the event at `document.body`, and an `element.contains(event.target)` test
|
|
9
|
+
* against the component that owns the dropdown returns false.
|
|
10
|
+
*
|
|
11
|
+
* That is how a dismiss-on-outside-click container closes itself the moment
|
|
12
|
+
* someone picks an option from a dropdown it contains — the selection reads as
|
|
13
|
+
* a click somewhere else entirely, and the click that was meant to commit a
|
|
14
|
+
* value tears the panel down instead.
|
|
15
|
+
*
|
|
16
|
+
* So every portal root carries `data-constellation-portal`. Any outside-click
|
|
17
|
+
* handler should treat a hit inside one as INSIDE.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CONSTELLATION_PORTAL_SELECTOR = "[data-constellation-portal]";
|
|
20
|
+
/**
|
|
21
|
+
* Whether `target` sits inside a Constellation portal.
|
|
22
|
+
*
|
|
23
|
+
* Use it to bail out of an outside-click dismissal:
|
|
24
|
+
*
|
|
25
|
+
* ```js
|
|
26
|
+
* const onClick = (e) => {
|
|
27
|
+
* if (el.contains(e.target)) return;
|
|
28
|
+
* if (isInConstellationPortal(e.target)) return;
|
|
29
|
+
* dismiss();
|
|
30
|
+
* };
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function isInConstellationPortal(target: EventTarget | null): boolean;
|
|
34
|
+
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/utils/portal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,6BAA6B,gCAAgC,CAAC;AAE3E;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAG3E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every Constellation surface that escapes its parent — Select and Combobox
|
|
3
|
+
* panels, DropdownMenu, DatePicker, Tooltip, Dialog, Sheet, the alert stack —
|
|
4
|
+
* renders through a React portal into `document.body`.
|
|
5
|
+
*
|
|
6
|
+
* React events still bubble through the React tree, so an `onClick` on an
|
|
7
|
+
* ancestor component sees them. A NATIVE `document` listener does not: it sees
|
|
8
|
+
* the event at `document.body`, and an `element.contains(event.target)` test
|
|
9
|
+
* against the component that owns the dropdown returns false.
|
|
10
|
+
*
|
|
11
|
+
* That is how a dismiss-on-outside-click container closes itself the moment
|
|
12
|
+
* someone picks an option from a dropdown it contains — the selection reads as
|
|
13
|
+
* a click somewhere else entirely, and the click that was meant to commit a
|
|
14
|
+
* value tears the panel down instead.
|
|
15
|
+
*
|
|
16
|
+
* So every portal root carries `data-constellation-portal`. Any outside-click
|
|
17
|
+
* handler should treat a hit inside one as INSIDE.
|
|
18
|
+
*/
|
|
19
|
+
const CONSTELLATION_PORTAL_SELECTOR = '[data-constellation-portal]';
|
|
20
|
+
/**
|
|
21
|
+
* Whether `target` sits inside a Constellation portal.
|
|
22
|
+
*
|
|
23
|
+
* Use it to bail out of an outside-click dismissal:
|
|
24
|
+
*
|
|
25
|
+
* ```js
|
|
26
|
+
* const onClick = (e) => {
|
|
27
|
+
* if (el.contains(e.target)) return;
|
|
28
|
+
* if (isInConstellationPortal(e.target)) return;
|
|
29
|
+
* dismiss();
|
|
30
|
+
* };
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
function isInConstellationPortal(target) {
|
|
34
|
+
if (!target || !(target instanceof Element))
|
|
35
|
+
return false;
|
|
36
|
+
return target.closest(CONSTELLATION_PORTAL_SELECTOR) !== null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { CONSTELLATION_PORTAL_SELECTOR, isInConstellationPortal };
|
|
40
|
+
//# sourceMappingURL=portal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.js","sources":["../../src/utils/portal.ts"],"sourcesContent":["/**\n * Every Constellation surface that escapes its parent — Select and Combobox\n * panels, DropdownMenu, DatePicker, Tooltip, Dialog, Sheet, the alert stack —\n * renders through a React portal into `document.body`.\n *\n * React events still bubble through the React tree, so an `onClick` on an\n * ancestor component sees them. A NATIVE `document` listener does not: it sees\n * the event at `document.body`, and an `element.contains(event.target)` test\n * against the component that owns the dropdown returns false.\n *\n * That is how a dismiss-on-outside-click container closes itself the moment\n * someone picks an option from a dropdown it contains — the selection reads as\n * a click somewhere else entirely, and the click that was meant to commit a\n * value tears the panel down instead.\n *\n * So every portal root carries `data-constellation-portal`. Any outside-click\n * handler should treat a hit inside one as INSIDE.\n */\nexport const CONSTELLATION_PORTAL_SELECTOR = '[data-constellation-portal]';\n\n/**\n * Whether `target` sits inside a Constellation portal.\n *\n * Use it to bail out of an outside-click dismissal:\n *\n * ```js\n * const onClick = (e) => {\n * if (el.contains(e.target)) return;\n * if (isInConstellationPortal(e.target)) return;\n * dismiss();\n * };\n * ```\n */\nexport function isInConstellationPortal(target: EventTarget | null): boolean {\n if (!target || !(target instanceof Element)) return false;\n return target.closest(CONSTELLATION_PORTAL_SELECTOR) !== null;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;AAiBG;AACI,MAAM,6BAA6B,GAAG;AAE7C;;;;;;;;;;;;AAYG;AACG,SAAU,uBAAuB,CAAC,MAA0B,EAAA;IAChE,IAAI,CAAC,MAAM,IAAI,EAAE,MAAM,YAAY,OAAO,CAAC;AAAE,QAAA,OAAO,KAAK;IACzD,OAAO,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,KAAK,IAAI;AAC/D;;"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
1
|
declare const getCsrfToken: () => string;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Every Constellation surface that escapes its parent — Select and Combobox
|
|
5
|
+
* panels, DropdownMenu, DatePicker, Tooltip, Dialog, Sheet, the alert stack —
|
|
6
|
+
* renders through a React portal into `document.body`.
|
|
7
|
+
*
|
|
8
|
+
* React events still bubble through the React tree, so an `onClick` on an
|
|
9
|
+
* ancestor component sees them. A NATIVE `document` listener does not: it sees
|
|
10
|
+
* the event at `document.body`, and an `element.contains(event.target)` test
|
|
11
|
+
* against the component that owns the dropdown returns false.
|
|
12
|
+
*
|
|
13
|
+
* That is how a dismiss-on-outside-click container closes itself the moment
|
|
14
|
+
* someone picks an option from a dropdown it contains — the selection reads as
|
|
15
|
+
* a click somewhere else entirely, and the click that was meant to commit a
|
|
16
|
+
* value tears the panel down instead.
|
|
17
|
+
*
|
|
18
|
+
* So every portal root carries `data-constellation-portal`. Any outside-click
|
|
19
|
+
* handler should treat a hit inside one as INSIDE.
|
|
20
|
+
*/
|
|
21
|
+
declare const CONSTELLATION_PORTAL_SELECTOR = "[data-constellation-portal]";
|
|
22
|
+
/**
|
|
23
|
+
* Whether `target` sits inside a Constellation portal.
|
|
24
|
+
*
|
|
25
|
+
* Use it to bail out of an outside-click dismissal:
|
|
26
|
+
*
|
|
27
|
+
* ```js
|
|
28
|
+
* const onClick = (e) => {
|
|
29
|
+
* if (el.contains(e.target)) return;
|
|
30
|
+
* if (isInConstellationPortal(e.target)) return;
|
|
31
|
+
* dismiss();
|
|
32
|
+
* };
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare function isInConstellationPortal(target: EventTarget | null): boolean;
|
|
36
|
+
|
|
37
|
+
export { CONSTELLATION_PORTAL_SELECTOR, getCsrfToken, isInConstellationPortal };
|
package/dist/utils.js
CHANGED
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kismet-ux/constellation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -147,7 +147,8 @@
|
|
|
147
147
|
"lint": "eslint . --fix",
|
|
148
148
|
"stylelint": "stylelint \"src/**/*.scss\"",
|
|
149
149
|
"stylelint:fix": "stylelint \"src/**/*.scss\" --fix",
|
|
150
|
-
"typecheck": "tsc --noEmit"
|
|
150
|
+
"typecheck": "tsc --noEmit",
|
|
151
|
+
"check:consumed": "node build/check-consumed.mjs"
|
|
151
152
|
},
|
|
152
153
|
"peerDependencies": {
|
|
153
154
|
"lucide-react": ">=0.4.0",
|
package/src/styles/_mixins.scss
CHANGED
|
@@ -27,7 +27,12 @@ $themes: primary, secondary, destructive, warning, success, info, slate;
|
|
|
27
27
|
|
|
28
28
|
$gap-scale: (
|
|
29
29
|
0: 0,
|
|
30
|
+
// Half steps for dense rows; see --size-0-5 in _theme.scss. The keys carry a
|
|
31
|
+
// dash because a class called `.gap-0.5` is not a valid selector, and the
|
|
32
|
+
// components sanitise `gap={0.5}` to match.
|
|
33
|
+
'0-5': var(--size-0-5),
|
|
30
34
|
1: var(--size-1),
|
|
35
|
+
'1-5': var(--size-1-5),
|
|
31
36
|
2: var(--size-2),
|
|
32
37
|
3: var(--size-3),
|
|
33
38
|
4: var(--size-4),
|
|
@@ -103,3 +108,28 @@ $breakpoints: (
|
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
}
|
|
111
|
+
|
|
112
|
+
// Styles that apply when motion should be suppressed.
|
|
113
|
+
//
|
|
114
|
+
// Not just the media query. The app can override the OS with `useMotion`,
|
|
115
|
+
// which writes `data-motion` on <html> — and a media query cannot see a
|
|
116
|
+
// preference held in JavaScript. So this emits both halves: the query, scoped
|
|
117
|
+
// so an explicit "full" wins over it, and the explicit "reduced" case.
|
|
118
|
+
//
|
|
119
|
+
// Include it at the TOP LEVEL and nest the rules inside; the ancestor
|
|
120
|
+
// selectors come from here, so `&` must not appear in the mixin itself.
|
|
121
|
+
//
|
|
122
|
+
// @include m.reduced-motion {
|
|
123
|
+
// .thing { transition: none; }
|
|
124
|
+
// }
|
|
125
|
+
@mixin reduced-motion {
|
|
126
|
+
@media (prefers-reduced-motion: reduce) {
|
|
127
|
+
:root:not([data-motion='full']) {
|
|
128
|
+
@content;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:root[data-motion='reduced'] {
|
|
133
|
+
@content;
|
|
134
|
+
}
|
|
135
|
+
}
|