@42-central/ui-react 0.0.0 → 0.17.1
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/README.md +315 -2
- package/dist/chunk-2762HZYX.js +284 -0
- package/dist/chunk-2762HZYX.js.map +1 -0
- package/dist/chunk-2GILNBZW.js +31 -0
- package/dist/chunk-2GILNBZW.js.map +1 -0
- package/dist/chunk-2H46IXW4.js +264 -0
- package/dist/chunk-2H46IXW4.js.map +1 -0
- package/dist/chunk-2SVX3MQQ.js +78 -0
- package/dist/chunk-2SVX3MQQ.js.map +1 -0
- package/dist/chunk-3GYOIQW7.js +242 -0
- package/dist/chunk-3GYOIQW7.js.map +1 -0
- package/dist/chunk-3NZXWCGF.js +152 -0
- package/dist/chunk-3NZXWCGF.js.map +1 -0
- package/dist/chunk-44OV3PNH.js +294 -0
- package/dist/chunk-44OV3PNH.js.map +1 -0
- package/dist/chunk-5FDOOG4J.js +15 -0
- package/dist/chunk-5FDOOG4J.js.map +1 -0
- package/dist/chunk-6I4R3HR6.js +90 -0
- package/dist/chunk-6I4R3HR6.js.map +1 -0
- package/dist/chunk-6SWK4XG5.js +128 -0
- package/dist/chunk-6SWK4XG5.js.map +1 -0
- package/dist/chunk-7NZSTCJO.js +82 -0
- package/dist/chunk-7NZSTCJO.js.map +1 -0
- package/dist/chunk-7P32XCEU.js +15 -0
- package/dist/chunk-7P32XCEU.js.map +1 -0
- package/dist/chunk-AIQG7IIT.js +39 -0
- package/dist/chunk-AIQG7IIT.js.map +1 -0
- package/dist/chunk-B2LCHXUB.js +26 -0
- package/dist/chunk-B2LCHXUB.js.map +1 -0
- package/dist/chunk-BEL75C7N.js +35 -0
- package/dist/chunk-BEL75C7N.js.map +1 -0
- package/dist/chunk-BJZLQTAZ.js +3 -0
- package/dist/chunk-BJZLQTAZ.js.map +1 -0
- package/dist/chunk-BUIHQJGE.js +8 -0
- package/dist/chunk-BUIHQJGE.js.map +1 -0
- package/dist/chunk-CHTN5AHI.js +106 -0
- package/dist/chunk-CHTN5AHI.js.map +1 -0
- package/dist/chunk-CSCVTESP.js +58 -0
- package/dist/chunk-CSCVTESP.js.map +1 -0
- package/dist/chunk-EEMRRRYS.js +60 -0
- package/dist/chunk-EEMRRRYS.js.map +1 -0
- package/dist/chunk-EVVMHTCL.js +216 -0
- package/dist/chunk-EVVMHTCL.js.map +1 -0
- package/dist/chunk-FD6P6PLQ.js +153 -0
- package/dist/chunk-FD6P6PLQ.js.map +1 -0
- package/dist/chunk-FMMKEYHB.js +3 -0
- package/dist/chunk-FMMKEYHB.js.map +1 -0
- package/dist/chunk-FUWSTUDM.js +219 -0
- package/dist/chunk-FUWSTUDM.js.map +1 -0
- package/dist/chunk-G52U24GR.js +10 -0
- package/dist/chunk-G52U24GR.js.map +1 -0
- package/dist/chunk-GTKKRV5N.js +14 -0
- package/dist/chunk-GTKKRV5N.js.map +1 -0
- package/dist/chunk-HWNPXAEN.js +31 -0
- package/dist/chunk-HWNPXAEN.js.map +1 -0
- package/dist/chunk-IFWCCAQV.js +222 -0
- package/dist/chunk-IFWCCAQV.js.map +1 -0
- package/dist/chunk-IG7FBZVM.js +101 -0
- package/dist/chunk-IG7FBZVM.js.map +1 -0
- package/dist/chunk-IHYFYMHJ.js +167 -0
- package/dist/chunk-IHYFYMHJ.js.map +1 -0
- package/dist/chunk-IRXZHLUL.js +51 -0
- package/dist/chunk-IRXZHLUL.js.map +1 -0
- package/dist/chunk-IXKELBJA.js +202 -0
- package/dist/chunk-IXKELBJA.js.map +1 -0
- package/dist/chunk-J3PELDH3.js +279 -0
- package/dist/chunk-J3PELDH3.js.map +1 -0
- package/dist/chunk-JBVFWSRQ.js +21 -0
- package/dist/chunk-JBVFWSRQ.js.map +1 -0
- package/dist/chunk-MOI7B3KH.js +217 -0
- package/dist/chunk-MOI7B3KH.js.map +1 -0
- package/dist/chunk-NF5JM2YO.js +57 -0
- package/dist/chunk-NF5JM2YO.js.map +1 -0
- package/dist/chunk-NGAQITWP.js +156 -0
- package/dist/chunk-NGAQITWP.js.map +1 -0
- package/dist/chunk-NSDM3FEB.js +82 -0
- package/dist/chunk-NSDM3FEB.js.map +1 -0
- package/dist/chunk-NSOA3GMZ.js +376 -0
- package/dist/chunk-NSOA3GMZ.js.map +1 -0
- package/dist/chunk-ORTCK34Y.js +3 -0
- package/dist/chunk-ORTCK34Y.js.map +1 -0
- package/dist/chunk-P3XMBETI.js +26 -0
- package/dist/chunk-P3XMBETI.js.map +1 -0
- package/dist/chunk-P7A3BCAC.js +93 -0
- package/dist/chunk-P7A3BCAC.js.map +1 -0
- package/dist/chunk-POKDSVQT.js +223 -0
- package/dist/chunk-POKDSVQT.js.map +1 -0
- package/dist/chunk-QMW7D5GU.js +207 -0
- package/dist/chunk-QMW7D5GU.js.map +1 -0
- package/dist/chunk-QP4I37PA.js +14 -0
- package/dist/chunk-QP4I37PA.js.map +1 -0
- package/dist/chunk-R5GMMWAY.js +3 -0
- package/dist/chunk-R5GMMWAY.js.map +1 -0
- package/dist/chunk-S53FHWNG.js +30 -0
- package/dist/chunk-S53FHWNG.js.map +1 -0
- package/dist/chunk-SIG4DMNZ.js +238 -0
- package/dist/chunk-SIG4DMNZ.js.map +1 -0
- package/dist/chunk-SKPM2FRX.js +44 -0
- package/dist/chunk-SKPM2FRX.js.map +1 -0
- package/dist/chunk-TCWYBVIL.js +33 -0
- package/dist/chunk-TCWYBVIL.js.map +1 -0
- package/dist/chunk-TNNH3FVQ.js +155 -0
- package/dist/chunk-TNNH3FVQ.js.map +1 -0
- package/dist/chunk-TWGCWKRV.js +44 -0
- package/dist/chunk-TWGCWKRV.js.map +1 -0
- package/dist/chunk-U5GW5EBR.js +150 -0
- package/dist/chunk-U5GW5EBR.js.map +1 -0
- package/dist/chunk-UNSAA7YG.js +148 -0
- package/dist/chunk-UNSAA7YG.js.map +1 -0
- package/dist/chunk-UVYTJQTJ.js +14 -0
- package/dist/chunk-UVYTJQTJ.js.map +1 -0
- package/dist/chunk-VLUKI3HL.js +120 -0
- package/dist/chunk-VLUKI3HL.js.map +1 -0
- package/dist/chunk-VZ2TPU4B.js +348 -0
- package/dist/chunk-VZ2TPU4B.js.map +1 -0
- package/dist/chunk-VZH6TS7M.js +153 -0
- package/dist/chunk-VZH6TS7M.js.map +1 -0
- package/dist/chunk-WYCMIIRR.js +12 -0
- package/dist/chunk-WYCMIIRR.js.map +1 -0
- package/dist/chunk-WZB6LPQI.js +47 -0
- package/dist/chunk-WZB6LPQI.js.map +1 -0
- package/dist/chunk-YBJB7FGE.js +187 -0
- package/dist/chunk-YBJB7FGE.js.map +1 -0
- package/dist/chunk-YIQI2CF3.js +92 -0
- package/dist/chunk-YIQI2CF3.js.map +1 -0
- package/dist/chunk-YKUCSV34.js +72 -0
- package/dist/chunk-YKUCSV34.js.map +1 -0
- package/dist/chunk-YON5Y336.js +639 -0
- package/dist/chunk-YON5Y336.js.map +1 -0
- package/dist/chunk-ZP6EBROY.js +3 -0
- package/dist/chunk-ZP6EBROY.js.map +1 -0
- package/dist/colors.css +296 -0
- package/dist/components/accordion/accordion-data.d.ts +52 -0
- package/dist/components/accordion/accordion-data.d.ts.map +1 -0
- package/dist/components/accordion/accordion.d.ts +116 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/index.d.ts +3 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/index.js +206 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/action-icon/action-icon.d.ts +51 -0
- package/dist/components/action-icon/action-icon.d.ts.map +1 -0
- package/dist/components/action-icon/index.d.ts +2 -0
- package/dist/components/action-icon/index.d.ts.map +1 -0
- package/dist/components/action-icon/index.js +8 -0
- package/dist/components/action-icon/index.js.map +1 -0
- package/dist/components/alert/alert.d.ts +90 -0
- package/dist/components/alert/alert.d.ts.map +1 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/alert/index.js +74 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/ambient-background/ambient-background.d.ts +47 -0
- package/dist/components/ambient-background/ambient-background.d.ts.map +1 -0
- package/dist/components/ambient-background/index.d.ts +2 -0
- package/dist/components/ambient-background/index.d.ts.map +1 -0
- package/dist/components/ambient-background/index.js +35 -0
- package/dist/components/ambient-background/index.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +185 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell/index.d.ts +2 -0
- package/dist/components/app-shell/index.d.ts.map +1 -0
- package/dist/components/app-shell/index.js +243 -0
- package/dist/components/app-shell/index.js.map +1 -0
- package/dist/components/autocomplete/autocomplete.d.ts +70 -0
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -0
- package/dist/components/autocomplete/index.d.ts +3 -0
- package/dist/components/autocomplete/index.d.ts.map +1 -0
- package/dist/components/autocomplete/index.js +149 -0
- package/dist/components/autocomplete/index.js.map +1 -0
- package/dist/components/avatar/avatar.d.ts +105 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +211 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/badge/badge.d.ts +48 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/badge/index.js +102 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +64 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.js +203 -0
- package/dist/components/breadcrumb/index.js.map +1 -0
- package/dist/components/button/button.d.ts +72 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/button/index.js +9 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +49 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.d.ts.map +1 -0
- package/dist/components/button-group/index.js +5 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/button-multi-select/button-multi-select.d.ts +39 -0
- package/dist/components/button-multi-select/button-multi-select.d.ts.map +1 -0
- package/dist/components/button-multi-select/index.d.ts +5 -0
- package/dist/components/button-multi-select/index.d.ts.map +1 -0
- package/dist/components/button-multi-select/index.js +45 -0
- package/dist/components/button-multi-select/index.js.map +1 -0
- package/dist/components/button-select/button-select-control.d.ts +56 -0
- package/dist/components/button-select/button-select-control.d.ts.map +1 -0
- package/dist/components/button-select/button-select-data.d.ts +53 -0
- package/dist/components/button-select/button-select-data.d.ts.map +1 -0
- package/dist/components/button-select/button-select-items.d.ts +72 -0
- package/dist/components/button-select/button-select-items.d.ts.map +1 -0
- package/dist/components/button-select/button-select.d.ts +98 -0
- package/dist/components/button-select/button-select.d.ts.map +1 -0
- package/dist/components/button-select/index.d.ts +5 -0
- package/dist/components/button-select/index.d.ts.map +1 -0
- package/dist/components/button-select/index.js +45 -0
- package/dist/components/button-select/index.js.map +1 -0
- package/dist/components/calendar/calendar-body.d.ts +48 -0
- package/dist/components/calendar/calendar-body.d.ts.map +1 -0
- package/dist/components/calendar/calendar.d.ts +88 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -0
- package/dist/components/calendar/index.d.ts +4 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +11 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/card/card.d.ts +69 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/card/index.js +6 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/chart/chart.d.ts +103 -0
- package/dist/components/chart/chart.d.ts.map +1 -0
- package/dist/components/chart/index.d.ts +2 -0
- package/dist/components/chart/index.d.ts.map +1 -0
- package/dist/components/chart/index.js +70 -0
- package/dist/components/chart/index.js.map +1 -0
- package/dist/components/chart/styles.css +50 -0
- package/dist/components/checkbox/checkbox.d.ts +74 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/control.d.ts +28 -0
- package/dist/components/checkbox/control.d.ts.map +1 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.d.ts.map +1 -0
- package/dist/components/checkbox/index.js +10 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/choice-card-group/choice-card-group.d.ts +148 -0
- package/dist/components/choice-card-group/choice-card-group.d.ts.map +1 -0
- package/dist/components/choice-card-group/index.d.ts +2 -0
- package/dist/components/choice-card-group/index.d.ts.map +1 -0
- package/dist/components/choice-card-group/index.js +280 -0
- package/dist/components/choice-card-group/index.js.map +1 -0
- package/dist/components/circular-progress/circular-progress.d.ts +49 -0
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -0
- package/dist/components/circular-progress/index.d.ts +2 -0
- package/dist/components/circular-progress/index.d.ts.map +1 -0
- package/dist/components/circular-progress/index.js +133 -0
- package/dist/components/circular-progress/index.js.map +1 -0
- package/dist/components/clipboard/clipboard.d.ts +95 -0
- package/dist/components/clipboard/clipboard.d.ts.map +1 -0
- package/dist/components/clipboard/copy.d.ts +67 -0
- package/dist/components/clipboard/copy.d.ts.map +1 -0
- package/dist/components/clipboard/index.d.ts +3 -0
- package/dist/components/clipboard/index.d.ts.map +1 -0
- package/dist/components/clipboard/index.js +86 -0
- package/dist/components/clipboard/index.js.map +1 -0
- package/dist/components/code/code.d.ts +37 -0
- package/dist/components/code/code.d.ts.map +1 -0
- package/dist/components/code/index.d.ts +2 -0
- package/dist/components/code/index.d.ts.map +1 -0
- package/dist/components/code/index.js +28 -0
- package/dist/components/code/index.js.map +1 -0
- package/dist/components/code-block/chrome.d.ts +77 -0
- package/dist/components/code-block/chrome.d.ts.map +1 -0
- package/dist/components/code-block/chrome.js +15 -0
- package/dist/components/code-block/chrome.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +99 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/code-block/diff.d.ts +79 -0
- package/dist/components/code-block/diff.d.ts.map +1 -0
- package/dist/components/code-block/diff.js +23 -0
- package/dist/components/code-block/diff.js.map +1 -0
- package/dist/components/code-block/gutters.d.ts +100 -0
- package/dist/components/code-block/gutters.d.ts.map +1 -0
- package/dist/components/code-block/highlighter.d.ts +84 -0
- package/dist/components/code-block/highlighter.d.ts.map +1 -0
- package/dist/components/code-block/index.d.ts +23 -0
- package/dist/components/code-block/index.d.ts.map +1 -0
- package/dist/components/code-block/index.js +463 -0
- package/dist/components/code-block/index.js.map +1 -0
- package/dist/components/code-block/notation.d.ts +126 -0
- package/dist/components/code-block/notation.d.ts.map +1 -0
- package/dist/components/code-block/presets.d.ts +23 -0
- package/dist/components/code-block/presets.d.ts.map +1 -0
- package/dist/components/code-block/static.d.ts +65 -0
- package/dist/components/code-block/static.d.ts.map +1 -0
- package/dist/components/code-block/static.js +380 -0
- package/dist/components/code-block/static.js.map +1 -0
- package/dist/components/code-block/styles.css +198 -0
- package/dist/components/collapse/collapse.d.ts +50 -0
- package/dist/components/collapse/collapse.d.ts.map +1 -0
- package/dist/components/collapse/index.d.ts +2 -0
- package/dist/components/collapse/index.d.ts.map +1 -0
- package/dist/components/collapse/index.js +5 -0
- package/dist/components/collapse/index.js.map +1 -0
- package/dist/components/combobox/combobox.d.ts +78 -0
- package/dist/components/combobox/combobox.d.ts.map +1 -0
- package/dist/components/combobox/index.d.ts +3 -0
- package/dist/components/combobox/index.d.ts.map +1 -0
- package/dist/components/combobox/index.js +15 -0
- package/dist/components/combobox/index.js.map +1 -0
- package/dist/components/combobox-list/combobox-list.d.ts +77 -0
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -0
- package/dist/components/combobox-list/index.d.ts +2 -0
- package/dist/components/combobox-list/index.d.ts.map +1 -0
- package/dist/components/combobox-list/index.js +16 -0
- package/dist/components/combobox-list/index.js.map +1 -0
- package/dist/components/container/container.d.ts +18 -0
- package/dist/components/container/container.d.ts.map +1 -0
- package/dist/components/container/index.d.ts +2 -0
- package/dist/components/container/index.d.ts.map +1 -0
- package/dist/components/container/index.js +40 -0
- package/dist/components/container/index.js.map +1 -0
- package/dist/components/data-table/data-table-features.d.ts +80 -0
- package/dist/components/data-table/data-table-features.d.ts.map +1 -0
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts +53 -0
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts.map +1 -0
- package/dist/components/data-table/data-table-filter/data-table-filter-fns.d.ts +18 -0
- package/dist/components/data-table/data-table-filter/data-table-filter-fns.d.ts.map +1 -0
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts +7 -0
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts.map +1 -0
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts +15 -0
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts.map +1 -0
- package/dist/components/data-table/data-table-filter/data-table-text-filter.d.ts +7 -0
- package/dist/components/data-table/data-table-filter/data-table-text-filter.d.ts.map +1 -0
- package/dist/components/data-table/data-table-filter/index.d.ts +15 -0
- package/dist/components/data-table/data-table-filter/index.d.ts.map +1 -0
- package/dist/components/data-table/data-table-filter/utils.d.ts +52 -0
- package/dist/components/data-table/data-table-filter/utils.d.ts.map +1 -0
- package/dist/components/data-table/data-table-header-cell.d.ts +65 -0
- package/dist/components/data-table/data-table-header-cell.d.ts.map +1 -0
- package/dist/components/data-table/data-table-meta.d.ts +103 -0
- package/dist/components/data-table/data-table-meta.d.ts.map +1 -0
- package/dist/components/data-table/data-table-pagination.d.ts +56 -0
- package/dist/components/data-table/data-table-pagination.d.ts.map +1 -0
- package/dist/components/data-table/data-table-placeholder.d.ts +18 -0
- package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -0
- package/dist/components/data-table/data-table-schema.d.ts +45 -0
- package/dist/components/data-table/data-table-schema.d.ts.map +1 -0
- package/dist/components/data-table/data-table-skeleton.d.ts +10 -0
- package/dist/components/data-table/data-table-skeleton.d.ts.map +1 -0
- package/dist/components/data-table/data-table-stack.d.ts +48 -0
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -0
- package/dist/components/data-table/data-table-state.d.ts +10 -0
- package/dist/components/data-table/data-table-state.d.ts.map +1 -0
- package/dist/components/data-table/data-table-toolbar.d.ts +21 -0
- package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -0
- package/dist/components/data-table/data-table.d.ts +194 -0
- package/dist/components/data-table/data-table.d.ts.map +1 -0
- package/dist/components/data-table/index.d.ts +14 -0
- package/dist/components/data-table/index.d.ts.map +1 -0
- package/dist/components/data-table/index.js +1603 -0
- package/dist/components/data-table/index.js.map +1 -0
- package/dist/components/date-picker/aliases.d.ts +11 -0
- package/dist/components/date-picker/aliases.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.d.ts +204 -0
- package/dist/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker/date-time-text.d.ts +32 -0
- package/dist/components/date-picker/date-time-text.d.ts.map +1 -0
- package/dist/components/date-picker/index.d.ts +7 -0
- package/dist/components/date-picker/index.d.ts.map +1 -0
- package/dist/components/date-picker/index.js +48 -0
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/divider/divider.d.ts +79 -0
- package/dist/components/divider/divider.d.ts.map +1 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.d.ts.map +1 -0
- package/dist/components/divider/index.js +5 -0
- package/dist/components/divider/index.js.map +1 -0
- package/dist/components/drawer/drawer.d.ts +103 -0
- package/dist/components/drawer/drawer.d.ts.map +1 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.d.ts.map +1 -0
- package/dist/components/drawer/index.js +13 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/field/field.d.ts +79 -0
- package/dist/components/field/field.d.ts.map +1 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.d.ts.map +1 -0
- package/dist/components/field/index.js +6 -0
- package/dist/components/field/index.js.map +1 -0
- package/dist/components/file-upload/file-upload.d.ts +68 -0
- package/dist/components/file-upload/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/index.d.ts.map +1 -0
- package/dist/components/file-upload/index.js +189 -0
- package/dist/components/file-upload/index.js.map +1 -0
- package/dist/components/flex/flex.d.ts +25 -0
- package/dist/components/flex/flex.d.ts.map +1 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.d.ts.map +1 -0
- package/dist/components/flex/index.js +5 -0
- package/dist/components/flex/index.js.map +1 -0
- package/dist/components/grid/grid.d.ts +21 -0
- package/dist/components/grid/grid.d.ts.map +1 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/index.d.ts.map +1 -0
- package/dist/components/grid/index.js +44 -0
- package/dist/components/grid/index.js.map +1 -0
- package/dist/components/hover-card/hover-card.d.ts +122 -0
- package/dist/components/hover-card/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hover-card/index.d.ts.map +1 -0
- package/dist/components/hover-card/index.js +157 -0
- package/dist/components/hover-card/index.js.map +1 -0
- package/dist/components/indicator/index.d.ts +2 -0
- package/dist/components/indicator/index.d.ts.map +1 -0
- package/dist/components/indicator/index.js +152 -0
- package/dist/components/indicator/index.js.map +1 -0
- package/dist/components/indicator/indicator.d.ts +69 -0
- package/dist/components/indicator/indicator.d.ts.map +1 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/input/index.js +7 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input/input.d.ts +116 -0
- package/dist/components/input/input.d.ts.map +1 -0
- package/dist/components/kbd/index.d.ts +2 -0
- package/dist/components/kbd/index.d.ts.map +1 -0
- package/dist/components/kbd/index.js +65 -0
- package/dist/components/kbd/index.js.map +1 -0
- package/dist/components/kbd/kbd.d.ts +43 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -0
- package/dist/components/mark/index.d.ts +2 -0
- package/dist/components/mark/index.d.ts.map +1 -0
- package/dist/components/mark/index.js +5 -0
- package/dist/components/mark/index.js.map +1 -0
- package/dist/components/mark/mark.d.ts +50 -0
- package/dist/components/mark/mark.d.ts.map +1 -0
- package/dist/components/menu/index.d.ts +3 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +88 -0
- package/dist/components/menu/index.js.map +1 -0
- package/dist/components/menu/menu-data.d.ts +119 -0
- package/dist/components/menu/menu-data.d.ts.map +1 -0
- package/dist/components/menu/menu.d.ts +123 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.d.ts.map +1 -0
- package/dist/components/modal/index.js +12 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/modal/modal.d.ts +100 -0
- package/dist/components/modal/modal.d.ts.map +1 -0
- package/dist/components/multi-combobox-list/index.d.ts +2 -0
- package/dist/components/multi-combobox-list/index.d.ts.map +1 -0
- package/dist/components/multi-combobox-list/index.js +16 -0
- package/dist/components/multi-combobox-list/index.js.map +1 -0
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +83 -0
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -0
- package/dist/components/multi-select/index.d.ts +3 -0
- package/dist/components/multi-select/index.d.ts.map +1 -0
- package/dist/components/multi-select/index.js +203 -0
- package/dist/components/multi-select/index.js.map +1 -0
- package/dist/components/multi-select/multi-select.d.ts +83 -0
- package/dist/components/multi-select/multi-select.d.ts.map +1 -0
- package/dist/components/nav-link/index.d.ts +3 -0
- package/dist/components/nav-link/index.d.ts.map +1 -0
- package/dist/components/nav-link/index.js +11 -0
- package/dist/components/nav-link/index.js.map +1 -0
- package/dist/components/nav-link/nav-link.d.ts +40 -0
- package/dist/components/nav-link/nav-link.d.ts.map +1 -0
- package/dist/components/nav-link/navigation.d.ts +45 -0
- package/dist/components/nav-link/navigation.d.ts.map +1 -0
- package/dist/components/nav-link/tanstack.d.ts +38 -0
- package/dist/components/nav-link/tanstack.d.ts.map +1 -0
- package/dist/components/nav-link/tanstack.js +21 -0
- package/dist/components/nav-link/tanstack.js.map +1 -0
- package/dist/components/notification/create-notifier.d.ts +117 -0
- package/dist/components/notification/create-notifier.d.ts.map +1 -0
- package/dist/components/notification/index.d.ts +5 -0
- package/dist/components/notification/index.d.ts.map +1 -0
- package/dist/components/notification/index.js +388 -0
- package/dist/components/notification/index.js.map +1 -0
- package/dist/components/notification/notification.d.ts +124 -0
- package/dist/components/notification/notification.d.ts.map +1 -0
- package/dist/components/notification/store.d.ts +42 -0
- package/dist/components/notification/store.d.ts.map +1 -0
- package/dist/components/notification/types.d.ts +62 -0
- package/dist/components/notification/types.d.ts.map +1 -0
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/number-input/index.d.ts.map +1 -0
- package/dist/components/number-input/index.js +16 -0
- package/dist/components/number-input/index.js.map +1 -0
- package/dist/components/number-input/number-input.d.ts +105 -0
- package/dist/components/number-input/number-input.d.ts.map +1 -0
- package/dist/components/overlays/create-overlays.d.ts +77 -0
- package/dist/components/overlays/create-overlays.d.ts.map +1 -0
- package/dist/components/overlays/index.d.ts +4 -0
- package/dist/components/overlays/index.d.ts.map +1 -0
- package/dist/components/overlays/index.js +332 -0
- package/dist/components/overlays/index.js.map +1 -0
- package/dist/components/overlays/renderer.d.ts +30 -0
- package/dist/components/overlays/renderer.d.ts.map +1 -0
- package/dist/components/overlays/store.d.ts +33 -0
- package/dist/components/overlays/store.d.ts.map +1 -0
- package/dist/components/overlays/types.d.ts +119 -0
- package/dist/components/overlays/types.d.ts.map +1 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/password-input/index.d.ts.map +1 -0
- package/dist/components/password-input/index.js +125 -0
- package/dist/components/password-input/index.js.map +1 -0
- package/dist/components/password-input/password-input.d.ts +65 -0
- package/dist/components/password-input/password-input.d.ts.map +1 -0
- package/dist/components/pill/index.d.ts +2 -0
- package/dist/components/pill/index.d.ts.map +1 -0
- package/dist/components/pill/index.js +8 -0
- package/dist/components/pill/index.js.map +1 -0
- package/dist/components/pill/pill.d.ts +69 -0
- package/dist/components/pill/pill.d.ts.map +1 -0
- package/dist/components/pills-input/index.d.ts +2 -0
- package/dist/components/pills-input/index.d.ts.map +1 -0
- package/dist/components/pills-input/index.js +10 -0
- package/dist/components/pills-input/index.js.map +1 -0
- package/dist/components/pills-input/pills-input.d.ts +146 -0
- package/dist/components/pills-input/pills-input.d.ts.map +1 -0
- package/dist/components/pin-input/index.d.ts +2 -0
- package/dist/components/pin-input/index.d.ts.map +1 -0
- package/dist/components/pin-input/index.js +107 -0
- package/dist/components/pin-input/index.js.map +1 -0
- package/dist/components/pin-input/pin-input.d.ts +80 -0
- package/dist/components/pin-input/pin-input.d.ts.map +1 -0
- package/dist/components/popover/icons.d.ts +24 -0
- package/dist/components/popover/icons.d.ts.map +1 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.d.ts.map +1 -0
- package/dist/components/popover/index.js +10 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/popover/popover.d.ts +190 -0
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/index.d.ts.map +1 -0
- package/dist/components/progress/index.js +111 -0
- package/dist/components/progress/index.js.map +1 -0
- package/dist/components/progress/progress.d.ts +47 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.d.ts.map +1 -0
- package/dist/components/radio-group/index.js +104 -0
- package/dist/components/radio-group/index.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +86 -0
- package/dist/components/radio-group/radio-group.d.ts.map +1 -0
- package/dist/components/rating/icons.d.ts +19 -0
- package/dist/components/rating/icons.d.ts.map +1 -0
- package/dist/components/rating/index.d.ts +2 -0
- package/dist/components/rating/index.d.ts.map +1 -0
- package/dist/components/rating/index.js +194 -0
- package/dist/components/rating/index.js.map +1 -0
- package/dist/components/rating/rating.d.ts +119 -0
- package/dist/components/rating/rating.d.ts.map +1 -0
- package/dist/components/schedule/index.d.ts +98 -0
- package/dist/components/schedule/index.d.ts.map +1 -0
- package/dist/components/schedule/index.js +6656 -0
- package/dist/components/schedule/index.js.map +1 -0
- package/dist/components/schedule/now-cursor-line.d.ts +97 -0
- package/dist/components/schedule/now-cursor-line.d.ts.map +1 -0
- package/dist/components/schedule/schedule-agenda-list.d.ts +55 -0
- package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -0
- package/dist/components/schedule/schedule-agenda-view.d.ts +48 -0
- package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -0
- package/dist/components/schedule/schedule-all-day-row.d.ts +100 -0
- package/dist/components/schedule/schedule-all-day-row.d.ts.map +1 -0
- package/dist/components/schedule/schedule-create-draft.d.ts +30 -0
- package/dist/components/schedule/schedule-create-draft.d.ts.map +1 -0
- package/dist/components/schedule/schedule-dates.d.ts +359 -0
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -0
- package/dist/components/schedule/schedule-day-view.d.ts +24 -0
- package/dist/components/schedule/schedule-day-view.d.ts.map +1 -0
- package/dist/components/schedule/schedule-days-view.d.ts +60 -0
- package/dist/components/schedule/schedule-days-view.d.ts.map +1 -0
- package/dist/components/schedule/schedule-disabled-overlay.d.ts +34 -0
- package/dist/components/schedule/schedule-disabled-overlay.d.ts.map +1 -0
- package/dist/components/schedule/schedule-drag-ghost.d.ts +31 -0
- package/dist/components/schedule/schedule-drag-ghost.d.ts.map +1 -0
- package/dist/components/schedule/schedule-event-chip.d.ts +101 -0
- package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -0
- package/dist/components/schedule/schedule-event-details.d.ts +37 -0
- package/dist/components/schedule/schedule-event-details.d.ts.map +1 -0
- package/dist/components/schedule/schedule-event-list-popover-content.d.ts +41 -0
- package/dist/components/schedule/schedule-event-list-popover-content.d.ts.map +1 -0
- package/dist/components/schedule/schedule-event-styles.d.ts +58 -0
- package/dist/components/schedule/schedule-event-styles.d.ts.map +1 -0
- package/dist/components/schedule/schedule-geometry.d.ts +307 -0
- package/dist/components/schedule/schedule-geometry.d.ts.map +1 -0
- package/dist/components/schedule/schedule-grid-gesture.d.ts +311 -0
- package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -0
- package/dist/components/schedule/schedule-layout.d.ts +83 -0
- package/dist/components/schedule/schedule-layout.d.ts.map +1 -0
- package/dist/components/schedule/schedule-month-view.d.ts +44 -0
- package/dist/components/schedule/schedule-month-view.d.ts.map +1 -0
- package/dist/components/schedule/schedule-next-up-grouping.d.ts +37 -0
- package/dist/components/schedule/schedule-next-up-grouping.d.ts.map +1 -0
- package/dist/components/schedule/schedule-next-up.d.ts +79 -0
- package/dist/components/schedule/schedule-next-up.d.ts.map +1 -0
- package/dist/components/schedule/schedule-overflow-chip.d.ts +45 -0
- package/dist/components/schedule/schedule-overflow-chip.d.ts.map +1 -0
- package/dist/components/schedule/schedule-overflow-popover.d.ts +57 -0
- package/dist/components/schedule/schedule-overflow-popover.d.ts.map +1 -0
- package/dist/components/schedule/schedule-segments.d.ts +89 -0
- package/dist/components/schedule/schedule-segments.d.ts.map +1 -0
- package/dist/components/schedule/schedule-snap.d.ts +204 -0
- package/dist/components/schedule/schedule-snap.d.ts.map +1 -0
- package/dist/components/schedule/schedule-timed-grid.d.ts +78 -0
- package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -0
- package/dist/components/schedule/schedule-toolbar.d.ts +107 -0
- package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -0
- package/dist/components/schedule/schedule-types.d.ts +844 -0
- package/dist/components/schedule/schedule-types.d.ts.map +1 -0
- package/dist/components/schedule/schedule-views.d.ts +197 -0
- package/dist/components/schedule/schedule-views.d.ts.map +1 -0
- package/dist/components/schedule/schedule-week-view.d.ts +19 -0
- package/dist/components/schedule/schedule-week-view.d.ts.map +1 -0
- package/dist/components/schedule/schedule-year-view.d.ts +38 -0
- package/dist/components/schedule/schedule-year-view.d.ts.map +1 -0
- package/dist/components/schedule/schedule.d.ts +163 -0
- package/dist/components/schedule/schedule.d.ts.map +1 -0
- package/dist/components/schedule/use-event-create.d.ts +54 -0
- package/dist/components/schedule/use-event-create.d.ts.map +1 -0
- package/dist/components/schedule/use-event-drag.d.ts +95 -0
- package/dist/components/schedule/use-event-drag.d.ts.map +1 -0
- package/dist/components/schedule/use-event-resize.d.ts +63 -0
- package/dist/components/schedule/use-event-resize.d.ts.map +1 -0
- package/dist/components/schedule/use-schedule-selection.d.ts +74 -0
- package/dist/components/schedule/use-schedule-selection.d.ts.map +1 -0
- package/dist/components/schedule/use-schedule.d.ts +78 -0
- package/dist/components/schedule/use-schedule.d.ts.map +1 -0
- package/dist/components/segment-group/index.d.ts +2 -0
- package/dist/components/segment-group/index.d.ts.map +1 -0
- package/dist/components/segment-group/index.js +10 -0
- package/dist/components/segment-group/index.js.map +1 -0
- package/dist/components/segment-group/segment-group.d.ts +187 -0
- package/dist/components/segment-group/segment-group.d.ts.map +1 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/index.d.ts.map +1 -0
- package/dist/components/select/index.js +17 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/select/select.d.ts +83 -0
- package/dist/components/select/select.d.ts.map +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.js +5 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +83 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.d.ts.map +1 -0
- package/dist/components/slider/index.js +258 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/slider/slider.d.ts +90 -0
- package/dist/components/slider/slider.d.ts.map +1 -0
- package/dist/components/slider/sliderThumb.d.ts +1 -0
- package/dist/components/slider/sliderThumb.d.ts.map +1 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/components/spinner/index.js +5 -0
- package/dist/components/spinner/index.js.map +1 -0
- package/dist/components/spinner/spinner.d.ts +61 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.d.ts.map +1 -0
- package/dist/components/switch/index.js +140 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/switch/switch.d.ts +48 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.js +5 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/table.d.ts +113 -0
- package/dist/components/table/table.d.ts.map +1 -0
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/tabs/index.d.ts.map +1 -0
- package/dist/components/tabs/index.js +8 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs/tabs-data.d.ts +67 -0
- package/dist/components/tabs/tabs-data.d.ts.map +1 -0
- package/dist/components/tabs/tabs.d.ts +96 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tags-input/index.d.ts +2 -0
- package/dist/components/tags-input/index.d.ts.map +1 -0
- package/dist/components/tags-input/index.js +203 -0
- package/dist/components/tags-input/index.js.map +1 -0
- package/dist/components/tags-input/tags-input.d.ts +68 -0
- package/dist/components/tags-input/tags-input.d.ts.map +1 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +6 -0
- package/dist/components/text/index.js.map +1 -0
- package/dist/components/text/text.d.ts +50 -0
- package/dist/components/text/text.d.ts.map +1 -0
- package/dist/components/text-input/index.d.ts +2 -0
- package/dist/components/text-input/index.d.ts.map +1 -0
- package/dist/components/text-input/index.js +34 -0
- package/dist/components/text-input/index.js.map +1 -0
- package/dist/components/text-input/text-input.d.ts +56 -0
- package/dist/components/text-input/text-input.d.ts.map +1 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/components/textarea/index.js +116 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +48 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -0
- package/dist/components/theme-icon/index.d.ts +2 -0
- package/dist/components/theme-icon/index.d.ts.map +1 -0
- package/dist/components/theme-icon/index.js +6 -0
- package/dist/components/theme-icon/index.js.map +1 -0
- package/dist/components/theme-icon/theme-icon.d.ts +34 -0
- package/dist/components/theme-icon/theme-icon.d.ts.map +1 -0
- package/dist/components/theme-script/index.d.ts +2 -0
- package/dist/components/theme-script/index.d.ts.map +1 -0
- package/dist/components/theme-script/index.js +29 -0
- package/dist/components/theme-script/index.js.map +1 -0
- package/dist/components/theme-script/theme-script.d.ts +41 -0
- package/dist/components/theme-script/theme-script.d.ts.map +1 -0
- package/dist/components/time-input/hour-cycle.d.ts +32 -0
- package/dist/components/time-input/hour-cycle.d.ts.map +1 -0
- package/dist/components/time-input/index.d.ts +3 -0
- package/dist/components/time-input/index.d.ts.map +1 -0
- package/dist/components/time-input/index.js +125 -0
- package/dist/components/time-input/index.js.map +1 -0
- package/dist/components/time-input/time-input.d.ts +63 -0
- package/dist/components/time-input/time-input.d.ts.map +1 -0
- package/dist/components/time-input/time-row.d.ts +72 -0
- package/dist/components/time-input/time-row.d.ts.map +1 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/timeline/index.d.ts.map +1 -0
- package/dist/components/timeline/index.js +372 -0
- package/dist/components/timeline/index.js.map +1 -0
- package/dist/components/timeline/timeline.d.ts +194 -0
- package/dist/components/timeline/timeline.d.ts.map +1 -0
- package/dist/components/title/index.d.ts +2 -0
- package/dist/components/title/index.d.ts.map +1 -0
- package/dist/components/title/index.js +6 -0
- package/dist/components/title/index.js.map +1 -0
- package/dist/components/title/title.d.ts +47 -0
- package/dist/components/title/title.d.ts.map +1 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/components/tooltip/index.js +10 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +70 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/tree-multi-select/index.d.ts +3 -0
- package/dist/components/tree-multi-select/index.d.ts.map +1 -0
- package/dist/components/tree-multi-select/index.js +424 -0
- package/dist/components/tree-multi-select/index.js.map +1 -0
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +72 -0
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -0
- package/dist/components/tree-select/index.d.ts +3 -0
- package/dist/components/tree-select/index.d.ts.map +1 -0
- package/dist/components/tree-select/index.js +425 -0
- package/dist/components/tree-select/index.js.map +1 -0
- package/dist/components/tree-select/tree-select.d.ts +68 -0
- package/dist/components/tree-select/tree-select.d.ts.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +269 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/align.d.ts +7 -0
- package/dist/lib/align.d.ts.map +1 -0
- package/dist/lib/available-if.d.ts +114 -0
- package/dist/lib/available-if.d.ts.map +1 -0
- package/dist/lib/brand.d.ts +22 -0
- package/dist/lib/brand.d.ts.map +1 -0
- package/dist/lib/cn.d.ts +14 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +3 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/colors.d.ts +14 -0
- package/dist/lib/colors.d.ts.map +1 -0
- package/dist/lib/control-open.d.ts +28 -0
- package/dist/lib/control-open.d.ts.map +1 -0
- package/dist/lib/date-predicates.d.ts +28 -0
- package/dist/lib/date-predicates.d.ts.map +1 -0
- package/dist/lib/date-value.d.ts +45 -0
- package/dist/lib/date-value.d.ts.map +1 -0
- package/dist/lib/dev-warn.d.ts +2 -0
- package/dist/lib/dev-warn.d.ts.map +1 -0
- package/dist/lib/focus-styles.d.ts +102 -0
- package/dist/lib/focus-styles.d.ts.map +1 -0
- package/dist/lib/form-control.d.ts +72 -0
- package/dist/lib/form-control.d.ts.map +1 -0
- package/dist/lib/gradient.d.ts +31 -0
- package/dist/lib/gradient.d.ts.map +1 -0
- package/dist/lib/intl.d.ts +77 -0
- package/dist/lib/intl.d.ts.map +1 -0
- package/dist/lib/link-component.d.ts +13 -0
- package/dist/lib/link-component.d.ts.map +1 -0
- package/dist/lib/merge-refs.d.ts +12 -0
- package/dist/lib/merge-refs.d.ts.map +1 -0
- package/dist/lib/overlay-container.d.ts +14 -0
- package/dist/lib/overlay-container.d.ts.map +1 -0
- package/dist/lib/overlay-layer.d.ts +51 -0
- package/dist/lib/overlay-layer.d.ts.map +1 -0
- package/dist/lib/placement.d.ts +16 -0
- package/dist/lib/placement.d.ts.map +1 -0
- package/dist/lib/props.d.ts +40 -0
- package/dist/lib/props.d.ts.map +1 -0
- package/dist/lib/required-if.d.ts +46 -0
- package/dist/lib/required-if.d.ts.map +1 -0
- package/dist/lib/schedule-predicates.d.ts +72 -0
- package/dist/lib/schedule-predicates.d.ts.map +1 -0
- package/dist/lib/select-data.d.ts +135 -0
- package/dist/lib/select-data.d.ts.map +1 -0
- package/dist/lib/sizes.d.ts +20 -0
- package/dist/lib/sizes.d.ts.map +1 -0
- package/dist/lib/test-id.d.ts +30 -0
- package/dist/lib/test-id.d.ts.map +1 -0
- package/dist/lib/theme-init-runtime.d.ts +26 -0
- package/dist/lib/theme-init-runtime.d.ts.map +1 -0
- package/dist/lib/theme.d.ts +93 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/tree-data.d.ts +99 -0
- package/dist/lib/tree-data.d.ts.map +1 -0
- package/dist/lib/typography-size.d.ts +49 -0
- package/dist/lib/typography-size.d.ts.map +1 -0
- package/dist/lib/use-container-query.d.ts +19 -0
- package/dist/lib/use-container-query.d.ts.map +1 -0
- package/dist/lib/use-disclosure.d.ts +35 -0
- package/dist/lib/use-disclosure.d.ts.map +1 -0
- package/dist/lib/use-isomorphic-layout-effect.d.ts +12 -0
- package/dist/lib/use-isomorphic-layout-effect.d.ts.map +1 -0
- package/dist/lib/use-local-storage.d.ts +45 -0
- package/dist/lib/use-local-storage.d.ts.map +1 -0
- package/dist/lib/use-logger.d.ts +2 -0
- package/dist/lib/use-logger.d.ts.map +1 -0
- package/dist/lib/use-media-query.d.ts +11 -0
- package/dist/lib/use-media-query.d.ts.map +1 -0
- package/dist/lib/use-now.d.ts +7 -0
- package/dist/lib/use-now.d.ts.map +1 -0
- package/dist/lib/use-theme.d.ts +101 -0
- package/dist/lib/use-theme.d.ts.map +1 -0
- package/dist/lib/use-uncontrolled.d.ts +45 -0
- package/dist/lib/use-uncontrolled.d.ts.map +1 -0
- package/dist/styles.css +17 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/theme-init-script.d.ts +2 -0
- package/dist/theme-init-script.d.ts.map +1 -0
- package/dist/theme-init.js +2 -0
- package/dist/theme-init.js.map +1 -0
- package/dist/theme.css +1281 -0
- package/package.json +99 -3
- package/src/colors.css +296 -0
- package/src/components/accordion/accordion-data.tsx +86 -0
- package/src/components/accordion/accordion.test.tsx +234 -0
- package/src/components/accordion/accordion.tsx +336 -0
- package/src/components/accordion/index.ts +18 -0
- package/src/components/action-icon/action-icon.test.tsx +57 -0
- package/src/components/action-icon/action-icon.tsx +180 -0
- package/src/components/action-icon/index.ts +12 -0
- package/src/components/alert/alert.test.tsx +131 -0
- package/src/components/alert/alert.tsx +165 -0
- package/src/components/alert/index.ts +3 -0
- package/src/components/ambient-background/ambient-background.test.tsx +64 -0
- package/src/components/ambient-background/ambient-background.tsx +76 -0
- package/src/components/ambient-background/index.ts +1 -0
- package/src/components/app-shell/app-shell.test.tsx +271 -0
- package/src/components/app-shell/app-shell.tsx +492 -0
- package/src/components/app-shell/index.ts +17 -0
- package/src/components/autocomplete/autocomplete.test.tsx +120 -0
- package/src/components/autocomplete/autocomplete.tsx +249 -0
- package/src/components/autocomplete/index.ts +11 -0
- package/src/components/avatar/avatar.test.tsx +345 -0
- package/src/components/avatar/avatar.tsx +456 -0
- package/src/components/avatar/index.ts +12 -0
- package/src/components/badge/badge.test.tsx +51 -0
- package/src/components/badge/badge.tsx +148 -0
- package/src/components/badge/index.ts +6 -0
- package/src/components/breadcrumb/breadcrumb.test.tsx +238 -0
- package/src/components/breadcrumb/breadcrumb.tsx +348 -0
- package/src/components/breadcrumb/index.ts +9 -0
- package/src/components/button/button.test.tsx +87 -0
- package/src/components/button/button.tsx +253 -0
- package/src/components/button/index.ts +12 -0
- package/src/components/button-group/button-group.test.tsx +168 -0
- package/src/components/button-group/button-group.tsx +121 -0
- package/src/components/button-group/index.ts +1 -0
- package/src/components/button-multi-select/button-multi-select.test.tsx +146 -0
- package/src/components/button-multi-select/button-multi-select.tsx +76 -0
- package/src/components/button-multi-select/index.ts +17 -0
- package/src/components/button-select/button-select-control.tsx +153 -0
- package/src/components/button-select/button-select-data.tsx +96 -0
- package/src/components/button-select/button-select-items.ts +103 -0
- package/src/components/button-select/button-select.test.tsx +239 -0
- package/src/components/button-select/button-select.tsx +323 -0
- package/src/components/button-select/index.ts +14 -0
- package/src/components/calendar/calendar-body.tsx +410 -0
- package/src/components/calendar/calendar.test.tsx +278 -0
- package/src/components/calendar/calendar.tsx +220 -0
- package/src/components/calendar/index.ts +10 -0
- package/src/components/card/card.tsx +211 -0
- package/src/components/card/index.ts +12 -0
- package/src/components/chart/chart.test.tsx +98 -0
- package/src/components/chart/chart.tsx +192 -0
- package/src/components/chart/index.ts +8 -0
- package/src/components/chart/styles.css +50 -0
- package/src/components/checkbox/checkbox.test.tsx +113 -0
- package/src/components/checkbox/checkbox.tsx +182 -0
- package/src/components/checkbox/control.ts +76 -0
- package/src/components/checkbox/index.ts +3 -0
- package/src/components/choice-card-group/choice-card-group.test.tsx +250 -0
- package/src/components/choice-card-group/choice-card-group.tsx +549 -0
- package/src/components/choice-card-group/index.ts +9 -0
- package/src/components/circular-progress/circular-progress.test.tsx +120 -0
- package/src/components/circular-progress/circular-progress.tsx +214 -0
- package/src/components/circular-progress/index.ts +15 -0
- package/src/components/clipboard/clipboard.test.tsx +229 -0
- package/src/components/clipboard/clipboard.tsx +128 -0
- package/src/components/clipboard/copy.tsx +127 -0
- package/src/components/clipboard/index.ts +12 -0
- package/src/components/code/code.test.tsx +57 -0
- package/src/components/code/code.tsx +54 -0
- package/src/components/code/index.ts +1 -0
- package/src/components/code-block/chrome.tsx +347 -0
- package/src/components/code-block/code-block.test.tsx +252 -0
- package/src/components/code-block/code-block.tsx +254 -0
- package/src/components/code-block/diff.test.ts +177 -0
- package/src/components/code-block/diff.ts +114 -0
- package/src/components/code-block/gutters.test.ts +280 -0
- package/src/components/code-block/gutters.ts +260 -0
- package/src/components/code-block/highlighter.test.ts +261 -0
- package/src/components/code-block/highlighter.ts +290 -0
- package/src/components/code-block/index.ts +53 -0
- package/src/components/code-block/notation.test.ts +166 -0
- package/src/components/code-block/notation.ts +233 -0
- package/src/components/code-block/presets.test.ts +43 -0
- package/src/components/code-block/presets.ts +28 -0
- package/src/components/code-block/static.tsx +130 -0
- package/src/components/code-block/styles.css +198 -0
- package/src/components/collapse/collapse.test.tsx +96 -0
- package/src/components/collapse/collapse.tsx +81 -0
- package/src/components/collapse/index.ts +1 -0
- package/src/components/combobox/combobox.tsx +317 -0
- package/src/components/combobox/index.ts +15 -0
- package/src/components/combobox-list/combobox-list.test.tsx +148 -0
- package/src/components/combobox-list/combobox-list.tsx +276 -0
- package/src/components/combobox-list/index.ts +3 -0
- package/src/components/container/container.tsx +47 -0
- package/src/components/container/index.ts +1 -0
- package/src/components/data-table/data-table-features.ts +127 -0
- package/src/components/data-table/data-table-filter/data-table-date-filter.tsx +275 -0
- package/src/components/data-table/data-table-filter/data-table-filter-fns.ts +126 -0
- package/src/components/data-table/data-table-filter/data-table-number-filter.tsx +74 -0
- package/src/components/data-table/data-table-filter/data-table-select-filter.tsx +47 -0
- package/src/components/data-table/data-table-filter/data-table-text-filter.tsx +29 -0
- package/src/components/data-table/data-table-filter/index.tsx +62 -0
- package/src/components/data-table/data-table-filter/utils.ts +112 -0
- package/src/components/data-table/data-table-filter-fns.test.tsx +145 -0
- package/src/components/data-table/data-table-filter.test.tsx +365 -0
- package/src/components/data-table/data-table-header-cell.tsx +292 -0
- package/src/components/data-table/data-table-meta.ts +102 -0
- package/src/components/data-table/data-table-pagination.tsx +175 -0
- package/src/components/data-table/data-table-placeholder.tsx +61 -0
- package/src/components/data-table/data-table-schema.test.tsx +22 -0
- package/src/components/data-table/data-table-schema.ts +23 -0
- package/src/components/data-table/data-table-skeleton.ts +9 -0
- package/src/components/data-table/data-table-stack.tsx +376 -0
- package/src/components/data-table/data-table-state.ts +35 -0
- package/src/components/data-table/data-table-toolbar.tsx +81 -0
- package/src/components/data-table/data-table.test.tsx +1143 -0
- package/src/components/data-table/data-table.tsx +829 -0
- package/src/components/data-table/index.ts +46 -0
- package/src/components/date-picker/aliases.tsx +15 -0
- package/src/components/date-picker/date-picker.test.tsx +699 -0
- package/src/components/date-picker/date-picker.tsx +1000 -0
- package/src/components/date-picker/date-time-text.test.ts +68 -0
- package/src/components/date-picker/date-time-text.ts +103 -0
- package/src/components/date-picker/index.ts +32 -0
- package/src/components/divider/divider.test.tsx +106 -0
- package/src/components/divider/divider.tsx +162 -0
- package/src/components/divider/index.ts +8 -0
- package/src/components/drawer/drawer.tsx +405 -0
- package/src/components/drawer/index.ts +21 -0
- package/src/components/field/field.tsx +235 -0
- package/src/components/field/index.ts +3 -0
- package/src/components/file-upload/file-upload.test.tsx +47 -0
- package/src/components/file-upload/file-upload.tsx +280 -0
- package/src/components/file-upload/index.ts +3 -0
- package/src/components/flex/flex.tsx +81 -0
- package/src/components/flex/index.ts +1 -0
- package/src/components/grid/grid.tsx +52 -0
- package/src/components/grid/index.ts +1 -0
- package/src/components/hover-card/hover-card.test.tsx +192 -0
- package/src/components/hover-card/hover-card.tsx +376 -0
- package/src/components/hover-card/index.ts +9 -0
- package/src/components/indicator/index.ts +6 -0
- package/src/components/indicator/indicator.test.tsx +241 -0
- package/src/components/indicator/indicator.tsx +275 -0
- package/src/components/input/index.ts +12 -0
- package/src/components/input/input.test.tsx +111 -0
- package/src/components/input/input.tsx +320 -0
- package/src/components/kbd/index.ts +1 -0
- package/src/components/kbd/kbd.test.tsx +20 -0
- package/src/components/kbd/kbd.tsx +98 -0
- package/src/components/mark/index.ts +1 -0
- package/src/components/mark/mark.test.tsx +85 -0
- package/src/components/mark/mark.tsx +79 -0
- package/src/components/menu/index.ts +27 -0
- package/src/components/menu/menu-data.tsx +230 -0
- package/src/components/menu/menu.test.tsx +547 -0
- package/src/components/menu/menu.tsx +514 -0
- package/src/components/modal/index.ts +14 -0
- package/src/components/modal/modal.tsx +420 -0
- package/src/components/multi-combobox-list/index.ts +3 -0
- package/src/components/multi-combobox-list/multi-combobox-list.test.tsx +190 -0
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +308 -0
- package/src/components/multi-select/index.ts +12 -0
- package/src/components/multi-select/multi-select.test.tsx +248 -0
- package/src/components/multi-select/multi-select.tsx +355 -0
- package/src/components/nav-link/index.ts +4 -0
- package/src/components/nav-link/nav-link.test.tsx +107 -0
- package/src/components/nav-link/nav-link.tsx +205 -0
- package/src/components/nav-link/navigation.test.tsx +117 -0
- package/src/components/nav-link/navigation.tsx +81 -0
- package/src/components/nav-link/tanstack.tsx +67 -0
- package/src/components/notification/create-notifier.tsx +518 -0
- package/src/components/notification/index.ts +20 -0
- package/src/components/notification/notification.test.tsx +321 -0
- package/src/components/notification/notification.tsx +353 -0
- package/src/components/notification/store.ts +159 -0
- package/src/components/notification/types.ts +67 -0
- package/src/components/number-input/index.ts +3 -0
- package/src/components/number-input/number-input.test.tsx +291 -0
- package/src/components/number-input/number-input.tsx +407 -0
- package/src/components/overlays/create-overlays.tsx +267 -0
- package/src/components/overlays/index.ts +25 -0
- package/src/components/overlays/renderer.tsx +214 -0
- package/src/components/overlays/store.ts +103 -0
- package/src/components/overlays/types.ts +150 -0
- package/src/components/password-input/index.ts +3 -0
- package/src/components/password-input/password-input.test.tsx +94 -0
- package/src/components/password-input/password-input.tsx +191 -0
- package/src/components/pill/index.ts +9 -0
- package/src/components/pill/pill.test.tsx +22 -0
- package/src/components/pill/pill.tsx +221 -0
- package/src/components/pills-input/index.ts +12 -0
- package/src/components/pills-input/pills-input.test.ts +136 -0
- package/src/components/pills-input/pills-input.tsx +422 -0
- package/src/components/pin-input/index.ts +3 -0
- package/src/components/pin-input/pin-input.test.tsx +74 -0
- package/src/components/pin-input/pin-input.tsx +186 -0
- package/src/components/popover/icons.tsx +129 -0
- package/src/components/popover/index.ts +8 -0
- package/src/components/popover/popover.test.tsx +223 -0
- package/src/components/popover/popover.tsx +635 -0
- package/src/components/progress/index.ts +18 -0
- package/src/components/progress/progress.test.tsx +112 -0
- package/src/components/progress/progress.tsx +194 -0
- package/src/components/radio-group/index.ts +9 -0
- package/src/components/radio-group/radio-group.test.tsx +107 -0
- package/src/components/radio-group/radio-group.tsx +207 -0
- package/src/components/rating/icons.tsx +35 -0
- package/src/components/rating/index.ts +9 -0
- package/src/components/rating/rating.test.tsx +288 -0
- package/src/components/rating/rating.tsx +389 -0
- package/src/components/schedule/index.ts +170 -0
- package/src/components/schedule/now-cursor-line.test.tsx +262 -0
- package/src/components/schedule/now-cursor-line.tsx +343 -0
- package/src/components/schedule/schedule-agenda-list.tsx +480 -0
- package/src/components/schedule/schedule-agenda-view.test.tsx +333 -0
- package/src/components/schedule/schedule-agenda-view.tsx +211 -0
- package/src/components/schedule/schedule-all-day-row.test.ts +187 -0
- package/src/components/schedule/schedule-all-day-row.tsx +616 -0
- package/src/components/schedule/schedule-create-draft.tsx +190 -0
- package/src/components/schedule/schedule-dates.test.ts +771 -0
- package/src/components/schedule/schedule-dates.ts +722 -0
- package/src/components/schedule/schedule-day-view.tsx +30 -0
- package/src/components/schedule/schedule-days-view.tsx +279 -0
- package/src/components/schedule/schedule-details-popover.test.tsx +765 -0
- package/src/components/schedule/schedule-disabled-overlay.tsx +51 -0
- package/src/components/schedule/schedule-drag-ghost.tsx +172 -0
- package/src/components/schedule/schedule-event-chip.tsx +1183 -0
- package/src/components/schedule/schedule-event-details.tsx +101 -0
- package/src/components/schedule/schedule-event-list-popover-content.tsx +149 -0
- package/src/components/schedule/schedule-event-styles.ts +60 -0
- package/src/components/schedule/schedule-geometry.test.ts +426 -0
- package/src/components/schedule/schedule-geometry.ts +482 -0
- package/src/components/schedule/schedule-grid-gesture.test.ts +235 -0
- package/src/components/schedule/schedule-grid-gesture.ts +606 -0
- package/src/components/schedule/schedule-layout.test.ts +260 -0
- package/src/components/schedule/schedule-layout.ts +270 -0
- package/src/components/schedule/schedule-month-view.test.tsx +193 -0
- package/src/components/schedule/schedule-month-view.tsx +690 -0
- package/src/components/schedule/schedule-next-up-grouping.test.ts +95 -0
- package/src/components/schedule/schedule-next-up-grouping.ts +69 -0
- package/src/components/schedule/schedule-next-up.test.tsx +189 -0
- package/src/components/schedule/schedule-next-up.tsx +138 -0
- package/src/components/schedule/schedule-overflow-chip.tsx +156 -0
- package/src/components/schedule/schedule-overflow-popover.tsx +173 -0
- package/src/components/schedule/schedule-segments.test.ts +201 -0
- package/src/components/schedule/schedule-segments.ts +120 -0
- package/src/components/schedule/schedule-snap.test.ts +546 -0
- package/src/components/schedule/schedule-snap.ts +380 -0
- package/src/components/schedule/schedule-timed-grid.tsx +1647 -0
- package/src/components/schedule/schedule-toolbar.tsx +270 -0
- package/src/components/schedule/schedule-type-cost.test.ts +104 -0
- package/src/components/schedule/schedule-types.test.ts +64 -0
- package/src/components/schedule/schedule-types.ts +1152 -0
- package/src/components/schedule/schedule-views.test.ts +263 -0
- package/src/components/schedule/schedule-views.ts +293 -0
- package/src/components/schedule/schedule-week-view.tsx +25 -0
- package/src/components/schedule/schedule-year-view.test.tsx +105 -0
- package/src/components/schedule/schedule-year-view.tsx +307 -0
- package/src/components/schedule/schedule.test.tsx +4386 -0
- package/src/components/schedule/schedule.tsx +1040 -0
- package/src/components/schedule/use-event-create.ts +591 -0
- package/src/components/schedule/use-event-drag.ts +510 -0
- package/src/components/schedule/use-event-resize.ts +565 -0
- package/src/components/schedule/use-schedule-selection.ts +119 -0
- package/src/components/schedule/use-schedule.test.ts +91 -0
- package/src/components/schedule/use-schedule.ts +135 -0
- package/src/components/segment-group/index.ts +15 -0
- package/src/components/segment-group/segment-group.test.tsx +172 -0
- package/src/components/segment-group/segment-group.tsx +570 -0
- package/src/components/select/index.ts +12 -0
- package/src/components/select/select.test.tsx +173 -0
- package/src/components/select/select.tsx +405 -0
- package/src/components/skeleton/index.ts +7 -0
- package/src/components/skeleton/skeleton.test.tsx +96 -0
- package/src/components/skeleton/skeleton.tsx +178 -0
- package/src/components/slider/index.ts +3 -0
- package/src/components/slider/slider.test.tsx +136 -0
- package/src/components/slider/slider.tsx +390 -0
- package/src/components/slider/sliderThumb.tsx +0 -0
- package/src/components/spinner/index.ts +6 -0
- package/src/components/spinner/spinner.tsx +136 -0
- package/src/components/switch/index.ts +3 -0
- package/src/components/switch/switch.test.tsx +98 -0
- package/src/components/switch/switch.tsx +234 -0
- package/src/components/table/index.ts +14 -0
- package/src/components/table/table.test.tsx +262 -0
- package/src/components/table/table.tsx +309 -0
- package/src/components/tabs/index.ts +17 -0
- package/src/components/tabs/tabs-data.tsx +125 -0
- package/src/components/tabs/tabs.test.tsx +172 -0
- package/src/components/tabs/tabs.tsx +292 -0
- package/src/components/tags-input/index.ts +3 -0
- package/src/components/tags-input/tags-input.test.tsx +85 -0
- package/src/components/tags-input/tags-input.tsx +294 -0
- package/src/components/text/index.ts +1 -0
- package/src/components/text/text.test.tsx +73 -0
- package/src/components/text/text.tsx +107 -0
- package/src/components/text-input/index.ts +3 -0
- package/src/components/text-input/text-input.test.tsx +129 -0
- package/src/components/text-input/text-input.tsx +88 -0
- package/src/components/textarea/index.ts +3 -0
- package/src/components/textarea/textarea.test.tsx +88 -0
- package/src/components/textarea/textarea.tsx +205 -0
- package/src/components/theme-icon/index.ts +7 -0
- package/src/components/theme-icon/theme-icon.test.tsx +20 -0
- package/src/components/theme-icon/theme-icon.tsx +114 -0
- package/src/components/theme-script/index.ts +1 -0
- package/src/components/theme-script/theme-script.tsx +68 -0
- package/src/components/time-input/hour-cycle.ts +61 -0
- package/src/components/time-input/index.ts +4 -0
- package/src/components/time-input/time-input.test.tsx +292 -0
- package/src/components/time-input/time-input.tsx +196 -0
- package/src/components/time-input/time-row.tsx +305 -0
- package/src/components/timeline/index.ts +11 -0
- package/src/components/timeline/timeline.test.tsx +701 -0
- package/src/components/timeline/timeline.tsx +720 -0
- package/src/components/title/index.ts +1 -0
- package/src/components/title/title.test.tsx +68 -0
- package/src/components/title/title.tsx +95 -0
- package/src/components/tooltip/index.ts +9 -0
- package/src/components/tooltip/tooltip.test.tsx +96 -0
- package/src/components/tooltip/tooltip.tsx +255 -0
- package/src/components/tree-multi-select/index.ts +11 -0
- package/src/components/tree-multi-select/tree-multi-select.test.tsx +327 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +626 -0
- package/src/components/tree-select/index.ts +11 -0
- package/src/components/tree-select/tree-select.test.tsx +376 -0
- package/src/components/tree-select/tree-select.tsx +634 -0
- package/src/index.ts +64 -0
- package/src/lib/align.ts +6 -0
- package/src/lib/available-if.test.ts +76 -0
- package/src/lib/available-if.ts +114 -0
- package/src/lib/brand.ts +19 -0
- package/src/lib/cn.test.ts +13 -0
- package/src/lib/cn.ts +28 -0
- package/src/lib/colors.ts +31 -0
- package/src/lib/control-open.ts +38 -0
- package/src/lib/date-predicates.test.ts +149 -0
- package/src/lib/date-predicates.ts +83 -0
- package/src/lib/date-value.test.ts +107 -0
- package/src/lib/date-value.ts +76 -0
- package/src/lib/dev-warn.ts +18 -0
- package/src/lib/focus-styles.test.ts +138 -0
- package/src/lib/focus-styles.ts +145 -0
- package/src/lib/form-control.ts +72 -0
- package/src/lib/gradient.ts +81 -0
- package/src/lib/intl-direction.test.tsx +96 -0
- package/src/lib/intl.test.tsx +162 -0
- package/src/lib/intl.tsx +210 -0
- package/src/lib/link-component.test.tsx +46 -0
- package/src/lib/link-component.tsx +32 -0
- package/src/lib/merge-refs.ts +20 -0
- package/src/lib/overlay-container.test.tsx +69 -0
- package/src/lib/overlay-container.tsx +64 -0
- package/src/lib/overlay-layer.test.tsx +139 -0
- package/src/lib/overlay-layer.tsx +81 -0
- package/src/lib/placement.ts +23 -0
- package/src/lib/props.ts +48 -0
- package/src/lib/required-if.ts +57 -0
- package/src/lib/schedule-predicates.test.ts +230 -0
- package/src/lib/schedule-predicates.ts +193 -0
- package/src/lib/select-data.ts +227 -0
- package/src/lib/sizes.ts +20 -0
- package/src/lib/test-id.ts +27 -0
- package/src/lib/theme-init-runtime.test.ts +152 -0
- package/src/lib/theme-init-runtime.ts +79 -0
- package/src/lib/theme.test.ts +223 -0
- package/src/lib/theme.ts +153 -0
- package/src/lib/tree-data.ts +159 -0
- package/src/lib/typography-size.ts +59 -0
- package/src/lib/use-container-query.test.ts +83 -0
- package/src/lib/use-container-query.ts +44 -0
- package/src/lib/use-disclosure.test.ts +85 -0
- package/src/lib/use-disclosure.ts +77 -0
- package/src/lib/use-isomorphic-layout-effect.ts +12 -0
- package/src/lib/use-local-storage.test.ts +165 -0
- package/src/lib/use-local-storage.ts +178 -0
- package/src/lib/use-logger.ts +39 -0
- package/src/lib/use-media-query.test.ts +77 -0
- package/src/lib/use-media-query.ts +35 -0
- package/src/lib/use-now.ts +59 -0
- package/src/lib/use-theme.test.ts +305 -0
- package/src/lib/use-theme.ts +279 -0
- package/src/lib/use-uncontrolled.test.ts +207 -0
- package/src/lib/use-uncontrolled.ts +85 -0
- package/src/styles.css +17 -0
- package/src/test-setup.ts +130 -0
- package/src/theme-init-script.ts +10 -0
- package/src/theme.css +1281 -0
- package/src/theme.forced-colors.test.tsx +215 -0
- package/src/theme.test.ts +221 -0
- package/src/visually-hidden-containment.test.tsx +98 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useLocaleContext, LocaleProvider } from '@ark-ui/react/locale';
|
|
2
|
+
import { getLocalTimeZone } from '@internationalized/date';
|
|
3
|
+
import { createContext, useSyncExternalStore, useContext, useCallback } from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/lib/intl.tsx
|
|
7
|
+
|
|
8
|
+
// src/lib/dev-warn.ts
|
|
9
|
+
function devWarn(message) {
|
|
10
|
+
console.warn(message);
|
|
11
|
+
}
|
|
12
|
+
var AUTO = "auto";
|
|
13
|
+
var DEFAULT_LOCALE = "en-US";
|
|
14
|
+
var DEFAULT_TIME_ZONE = "UTC";
|
|
15
|
+
function subscribeToLanguage(onStoreChange) {
|
|
16
|
+
window.addEventListener("languagechange", onStoreChange);
|
|
17
|
+
return () => window.removeEventListener("languagechange", onStoreChange);
|
|
18
|
+
}
|
|
19
|
+
function getLanguageSnapshot() {
|
|
20
|
+
return navigator.language || DEFAULT_LOCALE;
|
|
21
|
+
}
|
|
22
|
+
function getLanguageServerSnapshot() {
|
|
23
|
+
return DEFAULT_LOCALE;
|
|
24
|
+
}
|
|
25
|
+
var unsubscribeFromTimeZone = () => {
|
|
26
|
+
};
|
|
27
|
+
function subscribeToTimeZone() {
|
|
28
|
+
return unsubscribeFromTimeZone;
|
|
29
|
+
}
|
|
30
|
+
function getTimeZoneSnapshot() {
|
|
31
|
+
return getLocalTimeZone() || DEFAULT_TIME_ZONE;
|
|
32
|
+
}
|
|
33
|
+
function getTimeZoneServerSnapshot() {
|
|
34
|
+
return DEFAULT_TIME_ZONE;
|
|
35
|
+
}
|
|
36
|
+
var TimeZoneContext = createContext(void 0);
|
|
37
|
+
var useLocale = (override) => {
|
|
38
|
+
const { locale: provided } = useLocaleContext();
|
|
39
|
+
const requested = override ?? provided;
|
|
40
|
+
const hostLocale = useSyncExternalStore(
|
|
41
|
+
subscribeToLanguage,
|
|
42
|
+
getLanguageSnapshot,
|
|
43
|
+
getLanguageServerSnapshot
|
|
44
|
+
);
|
|
45
|
+
return requested === AUTO ? hostLocale : requested;
|
|
46
|
+
};
|
|
47
|
+
var useTimeZone = (override) => {
|
|
48
|
+
const provided = useContext(TimeZoneContext);
|
|
49
|
+
const requested = override ?? provided ?? AUTO;
|
|
50
|
+
const hostTimeZone = useSyncExternalStore(
|
|
51
|
+
subscribeToTimeZone,
|
|
52
|
+
getTimeZoneSnapshot,
|
|
53
|
+
getTimeZoneServerSnapshot
|
|
54
|
+
);
|
|
55
|
+
return requested === AUTO ? hostTimeZone : requested;
|
|
56
|
+
};
|
|
57
|
+
var warnedDirection = false;
|
|
58
|
+
var useDirectionCheck = () => {
|
|
59
|
+
const { dir } = useLocaleContext();
|
|
60
|
+
return useCallback(
|
|
61
|
+
(node) => {
|
|
62
|
+
const parent = node?.parentElement;
|
|
63
|
+
if (warnedDirection || !parent) return;
|
|
64
|
+
const inherited = getComputedStyle(parent).direction;
|
|
65
|
+
if (inherited === dir) return;
|
|
66
|
+
warnedDirection = true;
|
|
67
|
+
devWarn(
|
|
68
|
+
`[@42/ui-react] This page is dir="${inherited}", but the locale resolves to dir="${dir}", so Ark-backed parts (Tabs, SegmentGroup, Menu\u2026) render and navigate ${dir}. Direction comes from the locale: wrap the app in <IntlProvider locale="\u2026"> with a matching locale. See "Text direction" in the Internationalization docs.`
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
[dir]
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
var IntlProvider = ({ locale, timeZone, children }) => {
|
|
75
|
+
const resolvedLocale = useLocale(locale);
|
|
76
|
+
const resolvedTimeZone = useTimeZone(timeZone);
|
|
77
|
+
return /* @__PURE__ */ jsx(LocaleProvider, { locale: resolvedLocale, children: /* @__PURE__ */ jsx(TimeZoneContext.Provider, { value: resolvedTimeZone, children }) });
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { DEFAULT_LOCALE, DEFAULT_TIME_ZONE, IntlProvider, devWarn, useDirectionCheck, useLocale, useTimeZone };
|
|
81
|
+
//# sourceMappingURL=chunk-7NZSTCJO.js.map
|
|
82
|
+
//# sourceMappingURL=chunk-7NZSTCJO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/dev-warn.ts","../src/lib/intl.tsx"],"names":[],"mappings":";;;;;;;;AAcO,SAAS,QAAQ,OAAA,EAAuB;AAE7C,EAAA,OAAA,CAAQ,KAAK,OAAO,CAAA;AACtB;ACgBA,IAAM,IAAA,GAAO,MAAA;AAQN,IAAM,cAAA,GAAiB;AAQvB,IAAM,iBAAA,GAAoB;AAcjC,SAAS,oBAAoB,aAAA,EAA2B;AACtD,EAAA,MAAA,CAAO,gBAAA,CAAiB,kBAAkB,aAAa,CAAA;AACvD,EAAA,OAAO,MAAM,MAAA,CAAO,mBAAA,CAAoB,gBAAA,EAAkB,aAAa,CAAA;AACzE;AAEA,SAAS,mBAAA,GAAsB;AAC7B,EAAA,OAAO,UAAU,QAAA,IAAY,cAAA;AAC/B;AAEA,SAAS,yBAAA,GAA4B;AACnC,EAAA,OAAO,cAAA;AACT;AAKA,IAAM,0BAA0B,MAAM;AAAC,CAAA;AAEvC,SAAS,mBAAA,GAAsB;AAC7B,EAAA,OAAO,uBAAA;AACT;AAEA,SAAS,mBAAA,GAAsB;AAI7B,EAAA,OAAO,kBAAiB,IAAK,iBAAA;AAC/B;AAEA,SAAS,yBAAA,GAA4B;AACnC,EAAA,OAAO,iBAAA;AACT;AAEA,IAAM,eAAA,GAAkB,cAAkC,MAAS,CAAA;AAU5D,IAAM,SAAA,GAAY,CAAC,QAAA,KAA8C;AACtE,EAAA,MAAM,EAAE,MAAA,EAAQ,QAAA,EAAS,GAAI,gBAAA,EAAiB;AAC9C,EAAA,MAAM,YAAY,QAAA,IAAY,QAAA;AAC9B,EAAA,MAAM,UAAA,GAAa,oBAAA;AAAA,IACjB,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,OAAO,SAAA,KAAc,OAAO,UAAA,GAAa,SAAA;AAC3C;AAaO,IAAM,WAAA,GAAc,CAAC,QAAA,KAA8C;AACxE,EAAA,MAAM,QAAA,GAAW,WAAW,eAAe,CAAA;AAC3C,EAAA,MAAM,SAAA,GAAY,YAAY,QAAA,IAAY,IAAA;AAC1C,EAAA,MAAM,YAAA,GAAe,oBAAA;AAAA,IACnB,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,OAAO,SAAA,KAAc,OAAO,YAAA,GAAe,SAAA;AAC7C;AAIA,IAAI,eAAA,GAAkB,KAAA;AAYf,IAAM,oBAAoB,MAAM;AACrC,EAAA,MAAM,EAAE,GAAA,EAAI,GAAI,gBAAA,EAAiB;AACjC,EAAA,OAAO,WAAA;AAAA,IACL,CAAC,IAAA,KAA6B;AAC5B,MAAA,MAAM,SAAS,IAAA,EAAM,aAAA;AACrB,MAAA,IAAI,eAAA,IAAmB,CAAC,MAAA,EAAQ;AAEhC,MAAA,MAAM,SAAA,GAAY,gBAAA,CAAiB,MAAM,CAAA,CAAE,SAAA;AAC3C,MAAA,IAAI,cAAc,GAAA,EAAK;AACvB,MAAA,eAAA,GAAkB,IAAA;AAClB,MAAA,OAAA;AAAA,QACE,CAAA,iCAAA,EAAoC,SAAS,CAAA,mCAAA,EAAsC,GAAG,+EAA0E,GAAG,CAAA,gKAAA;AAAA,OACrK;AAAA,IACF,CAAA;AAAA,IACA,CAAC,GAAG;AAAA,GACN;AACF;AA+BO,IAAM,eAAe,CAAC,EAAE,MAAA,EAAQ,QAAA,EAAU,UAAS,KAAyB;AACjF,EAAA,MAAM,cAAA,GAAiB,UAAU,MAAM,CAAA;AACvC,EAAA,MAAM,gBAAA,GAAmB,YAAY,QAAQ,CAAA;AAE7C,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,MAAA,EAAQ,cAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,eAAA,CAAgB,QAAA,EAAhB,EAAyB,KAAA,EAAO,gBAAA,EAAmB,QAAA,EAAS,CAAA,EAC/D,CAAA;AAEJ","file":"chunk-7NZSTCJO.js","sourcesContent":["/**\n * Dev-mode-only warning helper — the first pattern in the kit for a runtime\n * misconfiguration check (Schedule's `editable` prop is the first feature\n * that needs one). `process.env.NODE_ENV === \"production\"` is the standard,\n * universally-bundler-replaced idiom for stripping this from production\n * builds via dead-code elimination (React itself uses it) — `process` is\n * declared locally rather than pulling in `@types/node`, which this\n * otherwise-browser-only package has no other reason to depend on.\n * `typeof process !== \"undefined\"` is the safe check in a bundler-less\n * environment where the global was never defined at all (unlike directly\n * referencing `process`, `typeof` on an undeclared identifier never throws).\n */\ndeclare const process: { env?: { NODE_ENV?: string } } | undefined\n\nexport function devWarn(message: string): void {\n if (typeof process !== \"undefined\" && process?.env?.NODE_ENV === \"production\") return\n console.warn(message)\n}\n","\"use client\"\n\nimport { LocaleProvider, useLocaleContext } from \"@ark-ui/react/locale\"\nimport { getLocalTimeZone } from \"@internationalized/date\"\nimport { createContext, type ReactNode, useCallback, useContext, useSyncExternalStore } from \"react\"\nimport { devWarn } from \"./dev-warn\"\n\n/**\n * The one seam where \"which locale\" and \"which time zone\" are decided.\n *\n * Every `Intl` constructor takes a locale as its first argument and a `timeZone` as an option,\n * and both have a runtime default — `Intl.DateTimeFormat()` resolves to Node's `en-US` on a\n * server and to the visitor's locale in a browser; `getLocalTimeZone()` resolves to the server's\n * zone (UTC on most hosts) and to the visitor's. Reading either implicitly therefore makes the\n * rendered output a property of *where the code ran*, which is a hydration mismatch waiting for\n * the first visitor configured differently from the build server. So nothing in this kit reads\n * them implicitly: components resolve both through the hooks below, and the value they get is\n * either something the app stated or a documented constant.\n *\n * Locale and time zone stay **fully independent** — separate prop, separate hook, separate\n * per-instance override, no coupling. They share only this module and `IntlProvider`'s single\n * mount point, because the resolution mechanism is the whole of the fix and writing it twice is\n * how the two would drift apart.\n *\n * Locale deliberately needs no context of its own: `IntlProvider` renders Ark's own\n * `LocaleProvider`, so Ark's state machines (`Calendar`, `DatePicker`, `NumberInput`,\n * `FileUpload`) and this kit's own formatting can only ever read one value — and `dir`/RTL comes\n * along for free for the components already reading `useLocaleContext().dir` (`menu.tsx`,\n * `tooltip.tsx`, `hover-card.tsx`). An app that mounts Ark's `LocaleProvider` directly still\n * works. Only the time zone needs a new context, since Ark has no equivalent.\n */\n\n/** Follow the host runtime. Accepted anywhere a locale or zone is: provider, or a single prop. */\nconst AUTO = \"auto\"\n\n/**\n * The locale used when nothing configures one, and what `\"auto\"` reports during SSR and the\n * hydration render. Pinned to the same tag as Ark's own `useLocaleContext()` default so the two\n * halves of a `Calendar` — Ark's machine and this kit's formatting around it — cannot disagree,\n * the same \"one constant, two readers\" reasoning `lib/theme.ts` uses for the theme storage key.\n */\nexport const DEFAULT_LOCALE = \"en-US\"\n\n/**\n * What `timeZone=\"auto\"` reports during SSR and the hydration render, before the host zone is\n * readable. Note this is *not* the default for the `timeZone` prop itself — that is `\"auto\"`\n * (see `useTimeZone`), because a wrong zone is wrong data rather than merely an unfamiliar\n * format. UTC is the one zone every runtime agrees on.\n */\nexport const DEFAULT_TIME_ZONE = \"UTC\"\n\n// `\"auto\"` is resolved through `useSyncExternalStore` with a fixed `getServerSnapshot`, the same\n// shape (and for the same reason) as `use-media-query.ts`, `use-local-storage.ts` and\n// `use-now.ts`: the server and the first client render are handed a value that cannot differ, so\n// hydration always matches, and React swaps in the real one immediately afterwards. A plain\n// `useEffect` would work too, but this way the fallback is declared once next to the real read\n// instead of living in a `useState` initializer somewhere else.\n//\n// Caveat worth knowing before reaching for `\"auto\"` under SSR, carried over from `use-theme.ts`:\n// React does not specify that the post-hydration correction lands before the browser paints, and\n// empirically it does not reliably, so the default value can be visible for a frame. That is the\n// accepted cost of opting in, and precisely why `locale` does not default to `\"auto\"`.\n\nfunction subscribeToLanguage(onStoreChange: () => void) {\n window.addEventListener(\"languagechange\", onStoreChange)\n return () => window.removeEventListener(\"languagechange\", onStoreChange)\n}\n\nfunction getLanguageSnapshot() {\n return navigator.language || DEFAULT_LOCALE\n}\n\nfunction getLanguageServerSnapshot() {\n return DEFAULT_LOCALE\n}\n\n// The host zone has no change event to listen for — a machine moving zone mid-session re-resolves\n// on the next render at worst. `subscribe` still has to return an unsubscribe function, and it\n// has to be a stable reference or `useSyncExternalStore` resubscribes on every render.\nconst unsubscribeFromTimeZone = () => {}\n\nfunction subscribeToTimeZone() {\n return unsubscribeFromTimeZone\n}\n\nfunction getTimeZoneSnapshot() {\n // `getLocalTimeZone()` is `Intl.DateTimeFormat().resolvedOptions().timeZone` behind a cache.\n // This is the only call to it left in the kit, which is the point: one reader of the ambient\n // zone, wrapped in the hydration-safe store, instead of ~13 scattered prop defaults.\n return getLocalTimeZone() || DEFAULT_TIME_ZONE\n}\n\nfunction getTimeZoneServerSnapshot() {\n return DEFAULT_TIME_ZONE\n}\n\nconst TimeZoneContext = createContext<string | undefined>(undefined)\n\n/**\n * The active locale as a concrete BCP-47 tag, never `\"auto\"` and never `undefined`.\n *\n * `override` is the component's own `locale` prop, so precedence reads\n * **prop → provider → `DEFAULT_LOCALE`** — the same shape as `useLinkComponent`.\n *\n * const locale = useLocale(props.locale)\n */\nexport const useLocale = (override?: \"auto\" | (string & {})): string => {\n const { locale: provided } = useLocaleContext()\n const requested = override ?? provided\n const hostLocale = useSyncExternalStore(\n subscribeToLanguage,\n getLanguageSnapshot,\n getLanguageServerSnapshot,\n )\n return requested === AUTO ? hostLocale : requested\n}\n\n/**\n * The active time zone as a concrete IANA name, never `\"auto\"` and never `undefined`.\n *\n * `override` is the component's own `timeZone` prop, so precedence reads\n * **prop → provider → `\"auto\"`**. The default is `\"auto\"` rather than a fixed zone because a\n * wrong zone shows wrong times, not merely an unfamiliar format — and `\"auto\"` costs a\n * client-only app nothing, since `getServerSnapshot` never runs there and the first render is\n * already the true zone.\n *\n * const timeZone = useTimeZone(props.timeZone)\n */\nexport const useTimeZone = (override?: \"auto\" | (string & {})): string => {\n const provided = useContext(TimeZoneContext)\n const requested = override ?? provided ?? AUTO\n const hostTimeZone = useSyncExternalStore(\n subscribeToTimeZone,\n getTimeZoneSnapshot,\n getTimeZoneServerSnapshot,\n )\n return requested === AUTO ? hostTimeZone : requested\n}\n\n// One warning per page, however many components run the check: the fix is a single provider at\n// the app root, so repeating the message per Tabs would only bury it.\nlet warnedDirection = false\n\n/**\n * Dev-only guard for the one RTL setup that silently breaks: direction stated on the DOM\n * (`<html dir=\"rtl\">`, or an ancestor) while no locale says so. Ark derives `dir` from the\n * locale alone and stamps it on every part, so its parts render `ltr` inside an `rtl` page —\n * and its arrow-key handling runs `ltr` too, which is why the kit can't simply let the parts\n * inherit from the DOM: the direction has to be known in JS, i.e. come from `IntlProvider`.\n *\n * Returns a callback ref for an Ark root. It reads the **parent**'s direction, since the root\n * itself carries Ark's stamped `dir`. Runs on attach, so SSR and hydration never see it.\n */\nexport const useDirectionCheck = () => {\n const { dir } = useLocaleContext()\n return useCallback(\n (node: HTMLElement | null) => {\n const parent = node?.parentElement\n if (warnedDirection || !parent) return\n // Computed rather than `closest(\"[dir]\")`, so a CSS-only `direction: rtl` counts too.\n const inherited = getComputedStyle(parent).direction\n if (inherited === dir) return\n warnedDirection = true\n devWarn(\n `[@42/ui-react] This page is dir=\"${inherited}\", but the locale resolves to dir=\"${dir}\", so Ark-backed parts (Tabs, SegmentGroup, Menu…) render and navigate ${dir}. Direction comes from the locale: wrap the app in <IntlProvider locale=\"…\"> with a matching locale. See \"Text direction\" in the Internationalization docs.`,\n )\n },\n [dir],\n )\n}\n\nexport type IntlProviderProps = {\n /** A BCP-47 tag (`\"fr-FR\"`), or `\"auto\"` to follow the browser. Inherited from an outer\n * `IntlProvider` when omitted, and `\"en-US\"` when there is none. */\n locale?: \"auto\" | (string & {})\n /** An IANA zone (`\"Europe/Paris\"`), or `\"auto\"` to follow the host. Inherited from an outer\n * `IntlProvider` when omitted, and `\"auto\"` when there is none. @default \"auto\" */\n timeZone?: \"auto\" | (string & {})\n children?: ReactNode\n}\n\n/**\n * Wrap the app once to state how it formats dates, times and numbers:\n * `<IntlProvider locale=\"fr-FR\" timeZone=\"Europe/Paris\"><App /></IntlProvider>`.\n *\n * Both props are optional and independent — setting only `timeZone` leaves the locale alone, and\n * a nested provider inherits whichever value it doesn't set, so a section can override one\n * without restating the other.\n *\n * It resolves both values and publishes the results, so `\"auto\"` is subscribed to once here\n * rather than once per component, and everything downstream — Ark's machines included — reads a\n * concrete tag and zone.\n *\n * Text direction follows the locale: `locale=\"ar\"` makes every Ark part `rtl`. `<html dir=\"rtl\">`\n * alone never reaches Ark, which is what `useDirectionCheck` warns about in development.\n *\n * This provider carries the inputs to `Intl`, and nothing else. Translated microcopy stays on\n * each component's own `translations` prop by design (`code-style.md`); there is deliberately no\n * message context here.\n */\nexport const IntlProvider = ({ locale, timeZone, children }: IntlProviderProps) => {\n const resolvedLocale = useLocale(locale)\n const resolvedTimeZone = useTimeZone(timeZone)\n\n return (\n <LocaleProvider locale={resolvedLocale}>\n <TimeZoneContext.Provider value={resolvedTimeZone}>{children}</TimeZoneContext.Provider>\n </LocaleProvider>\n )\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/lib/overlay-container.tsx
|
|
5
|
+
var OverlayContainerContext = createContext(null);
|
|
6
|
+
var OverlayContainerProvider = ({ value, children }) => /* @__PURE__ */ jsx(OverlayContainerContext.Provider, { value, children });
|
|
7
|
+
var useOverlayContainer = (override) => {
|
|
8
|
+
const inherited = useContext(OverlayContainerContext);
|
|
9
|
+
const own = useMemo(() => override ? { current: override } : null, [override]);
|
|
10
|
+
return own ?? inherited ?? void 0;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { OverlayContainerProvider, useOverlayContainer };
|
|
14
|
+
//# sourceMappingURL=chunk-7P32XCEU.js.map
|
|
15
|
+
//# sourceMappingURL=chunk-7P32XCEU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/overlay-container.tsx"],"names":[],"mappings":";;;;AAsCA,IAAM,uBAAA,GAA0B,cAAoD,IAAI,CAAA;AAUjF,IAAM,wBAAA,GAA2B,CAAC,EAAE,KAAA,EAAO,QAAA,EAAS,qBACzD,GAAA,CAAC,uBAAA,CAAwB,QAAA,EAAxB,EAAiC,KAAA,EAAe,QAAA,EAAS;AAMrD,IAAM,mBAAA,GAAsB,CACjC,QAAA,KAC8C;AAC9C,EAAA,MAAM,SAAA,GAAY,WAAW,uBAAuB,CAAA;AAGpD,EAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,MAAO,QAAA,GAAW,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,IAAA,EAAO,CAAC,QAAQ,CAAC,CAAA;AAC/E,EAAA,OAAO,OAAO,SAAA,IAAa,MAAA;AAC7B","file":"chunk-7P32XCEU.js","sourcesContent":["\"use client\"\n\nimport { createContext, type ReactNode, type RefObject, useContext, useMemo } from \"react\"\n\n/**\n * Shared \"where do nested overlays portal to\" context.\n *\n * Every floating surface in this kit portals to `document.body` by default so\n * it escapes clipping ancestors. That's right at page level, but it breaks down\n * inside a Modal/Drawer: the panel becomes a *sibling* of the dialog rather\n * than a descendant, so the only thing keeping it visible is a z-index tall\n * enough to clear `--modal-z` — and any number picked for that is wrong the\n * moment dialogs and overlays nest the other way around.\n *\n * So `Modal`/`Drawer` publish their own positioner here (see their\n * `Positioner` parts), and every overlay opened inside one portals *into* it.\n * Being a descendant of a surface that already outranks the page, the panel\n * stays above it structurally, whatever its own z-index band says — which is\n * also what frees `--toast-z` to sit between the overlay and modal bands\n * instead of above both (see `theme.css`).\n *\n * `Schedule` publishes its scroller the same way, for a different reason: its\n * popovers should scroll and clip with the grid, not float over the page.\n *\n * Modal and Drawer deliberately don't *consume* this: dialog-on-dialog order\n * is already handled by `--modal-z` plus zag's `--layer-index`, and nesting one\n * fixed, scroll-locking container inside another buys nothing.\n */\n/**\n * A ref, not the element. The element only exists after its first commit, so\n * publishing it as state costs every provider a second render of its whole\n * subtree just to hand the node down — and each portal a third, to move there.\n * Ark's `Portal` reads `container.current` itself when it first renders, so a\n * ref is enough: an overlay that mounts once the container is attached (a\n * lazily mounted panel, opened later) lands in the right place on its first\n * render, and one mounted in the same commit as the container is moved there\n * by `Portal`'s own mount effect, by which time the ref is set.\n */\nconst OverlayContainerContext = createContext<RefObject<HTMLElement | null> | null>(null)\n\nexport type OverlayContainerProviderProps = {\n /** A ref to the element nested overlays should portal into — a\n * Modal/Drawer positioner, a Schedule scroller. Still `null` (not yet\n * attached) reads as \"no container\", i.e. `document.body`. */\n value: RefObject<HTMLElement | null>\n children?: ReactNode\n}\n\nexport const OverlayContainerProvider = ({ value, children }: OverlayContainerProviderProps) => (\n <OverlayContainerContext.Provider value={value}>{children}</OverlayContainerContext.Provider>\n)\n\n/** Resolves an overlay's portal target, shaped for Ark's `<Portal container>`:\n * `override` (a per-instance `container` prop) wins; else the enclosing\n * provider's ref; else `undefined` — Ark falls back to `document.body`. */\nexport const useOverlayContainer = (\n override?: HTMLElement | null,\n): RefObject<HTMLElement | null> | undefined => {\n const inherited = useContext(OverlayContainerContext)\n // Ark's `Portal` keys its container effect on this object's identity, so\n // keep it stable while the element is.\n const own = useMemo(() => (override ? { current: override } : null), [override])\n return own ?? inherited ?? undefined\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from './chunk-BUIHQJGE.js';
|
|
2
|
+
import { createContext, useRef, useCallback, useContext } from 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var OverlayLayerContext = createContext(null);
|
|
6
|
+
var useLayerGuard = (onPointerDownOutside) => {
|
|
7
|
+
const layers = useRef(/* @__PURE__ */ new Set()).current;
|
|
8
|
+
const guard = useCallback(
|
|
9
|
+
(event) => {
|
|
10
|
+
onPointerDownOutside?.(event);
|
|
11
|
+
if (layers.size > 0) event.preventDefault();
|
|
12
|
+
},
|
|
13
|
+
[layers, onPointerDownOutside]
|
|
14
|
+
);
|
|
15
|
+
return { layers, onPointerDownOutside: guard };
|
|
16
|
+
};
|
|
17
|
+
var OverlayLayerProvider = ({
|
|
18
|
+
value,
|
|
19
|
+
children
|
|
20
|
+
}) => /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value, children });
|
|
21
|
+
var useNestedLayer = (open) => {
|
|
22
|
+
const parent = useContext(OverlayLayerContext);
|
|
23
|
+
useIsomorphicLayoutEffect(() => {
|
|
24
|
+
if (!open || !parent) return;
|
|
25
|
+
const token = /* @__PURE__ */ Symbol();
|
|
26
|
+
parent.add(token);
|
|
27
|
+
return () => {
|
|
28
|
+
parent.delete(token);
|
|
29
|
+
};
|
|
30
|
+
}, [open, parent]);
|
|
31
|
+
};
|
|
32
|
+
var NestedLayer = ({ open }) => {
|
|
33
|
+
useNestedLayer(open);
|
|
34
|
+
return null;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { NestedLayer, OverlayLayerProvider, useLayerGuard, useNestedLayer };
|
|
38
|
+
//# sourceMappingURL=chunk-AIQG7IIT.js.map
|
|
39
|
+
//# sourceMappingURL=chunk-AIQG7IIT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/overlay-layer.tsx"],"names":[],"mappings":";;;;AAiCA,IAAM,mBAAA,GAAsB,cAAoC,IAAI,CAAA;AAM7D,IAAM,aAAA,GAAgB,CAAkB,oBAAA,KAA8C;AAC3F,EAAA,MAAM,MAAA,GAAS,MAAA,iBAAsB,IAAI,GAAA,EAAK,CAAA,CAAE,OAAA;AAChD,EAAA,MAAM,KAAA,GAAQ,WAAA;AAAA,IACZ,CAAC,KAAA,KAAa;AACZ,MAAA,oBAAA,GAAuB,KAAK,CAAA;AAC5B,MAAA,IAAI,MAAA,CAAO,IAAA,GAAO,CAAA,EAAG,KAAA,CAAM,cAAA,EAAe;AAAA,IAC5C,CAAA;AAAA,IACA,CAAC,QAAQ,oBAAoB;AAAA,GAC/B;AACA,EAAA,OAAO,EAAE,MAAA,EAAQ,oBAAA,EAAsB,KAAA,EAAM;AAC/C;AAEO,IAAM,uBAAuB,CAAC;AAAA,EACnC,KAAA;AAAA,EACA;AACF,CAAA,qBAGM,GAAA,CAAC,mBAAA,CAAoB,QAAA,EAApB,EAA6B,OAAe,QAAA,EAAS;AAMrD,IAAM,cAAA,GAAiB,CAAC,IAAA,KAAkB;AAC/C,EAAA,MAAM,MAAA,GAAS,WAAW,mBAAmB,CAAA;AAC7C,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,IAAI,CAAC,IAAA,IAAQ,CAAC,MAAA,EAAQ;AACtB,IAAA,MAAM,wBAAQ,MAAA,EAAO;AACrB,IAAA,MAAA,CAAO,IAAI,KAAK,CAAA;AAChB,IAAA,OAAO,MAAM;AACX,MAAA,MAAA,CAAO,OAAO,KAAK,CAAA;AAAA,IACrB,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,IAAA,EAAM,MAAM,CAAC,CAAA;AACnB;AAIO,IAAM,WAAA,GAAc,CAAC,EAAE,IAAA,EAAK,KAAyB;AAC1D,EAAA,cAAA,CAAe,IAAI,CAAA;AACnB,EAAA,OAAO,IAAA;AACT","file":"chunk-AIQG7IIT.js","sourcesContent":["\"use client\"\n\nimport { createContext, type ReactNode, useCallback, useContext, useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-layout-effect\"\n\n/**\n * One outside click dismisses one layer.\n *\n * Every dismissable surface (zag's `trackDismissableElement`) listens for\n * pointerdown on the whole document and closes itself when the target falls\n * outside it. Nested layers don't coordinate: a click on a Modal's backdrop\n * while a DatePicker inside it is open lands outside *both*, so both close —\n * the picker and the dialog the user was filling in. Zag only spares the\n * parent when the child is pointer-blocking (pickers aren't) or was removed a\n * tick earlier (the parent's listener runs first, so it never is), and its\n * `layerStack` isn't exported for us to ask.\n *\n * So the kit tracks it itself. A parent (`Modal`, `Drawer`, `Popover`) owns a\n * set of open children and vetoes its own outside-dismiss while that set is\n * non-empty; every floating panel registers with its nearest parent while\n * open. The click that would have cascaded closes the innermost layer only,\n * and the next one closes the parent.\n *\n * Context rather than DOM queries because context crosses portals: the\n * registration reaches the right parent wherever the panel was portaled to —\n * the parent's positioner, `document.body`, a custom `container`, or nowhere\n * (`withinPortal={false}`).\n *\n * Pointer-down only. Escape is already top-most-only in zag, and focus can't\n * leave a modal for a sibling layer it doesn't own.\n */\nexport type OverlayLayers = Set<symbol>\n\nconst OverlayLayerContext = createContext<OverlayLayers | null>(null)\n\n/** For a parent layer. Spread `onPointerDownOutside` onto the Ark root\n * (composed with the caller's own) and wrap the children that may open nested\n * layers in `OverlayLayerProvider`. A ref'd set, not state: it's read synchronously while\n * zag dispatches the outside event, and changing it must not re-render. */\nexport const useLayerGuard = <E extends Event>(onPointerDownOutside?: (event: E) => void) => {\n const layers = useRef<OverlayLayers>(new Set()).current\n const guard = useCallback(\n (event: E) => {\n onPointerDownOutside?.(event)\n if (layers.size > 0) event.preventDefault()\n },\n [layers, onPointerDownOutside],\n )\n return { layers, onPointerDownOutside: guard }\n}\n\nexport const OverlayLayerProvider = ({\n value,\n children,\n}: {\n value: OverlayLayers\n children?: ReactNode\n}) => <OverlayLayerContext.Provider value={value}>{children}</OverlayLayerContext.Provider>\n\n/** For a child layer: registers with the nearest parent while `open`. Keyed on\n * `open`, not presence, so a panel playing its exit animation no longer holds\n * the parent's next click. A layout effect so the registration is in place\n * before the browser can deliver the next pointerdown. */\nexport const useNestedLayer = (open: boolean) => {\n const parent = useContext(OverlayLayerContext)\n useIsomorphicLayoutEffect(() => {\n if (!open || !parent) return\n const token = Symbol()\n parent.add(token)\n return () => {\n parent.delete(token)\n }\n }, [open, parent])\n}\n\n/** `useNestedLayer` as an element, for call sites that only have the machine's\n * `open` inside a render prop (`<Ark.Context>{(api) => …}</Ark.Context>`). */\nexport const NestedLayer = ({ open }: { open: boolean }) => {\n useNestedLayer(open)\n return null\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from './chunk-QP4I37PA.js';
|
|
2
|
+
|
|
3
|
+
// src/lib/focus-styles.ts
|
|
4
|
+
var FOCUS_RING = {
|
|
5
|
+
"focus-visible": {
|
|
6
|
+
brand: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500",
|
|
7
|
+
palette: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--c-text)"
|
|
8
|
+
},
|
|
9
|
+
"data-focus-visible": {
|
|
10
|
+
brand: "data-focus-visible:ring-2 data-focus-visible:ring-brand-500",
|
|
11
|
+
palette: "data-focus-visible:ring-2 data-focus-visible:ring-(--c-text)"
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var FOCUS_OFFSET = {
|
|
15
|
+
"focus-visible": "focus-visible:ring-offset-2 focus-visible:ring-offset-brand-50 dark:focus-visible:ring-offset-brand-950",
|
|
16
|
+
"data-focus-visible": "data-focus-visible:ring-offset-2 data-focus-visible:ring-offset-brand-50 dark:data-focus-visible:ring-offset-brand-950"
|
|
17
|
+
};
|
|
18
|
+
var focusStyles = ({
|
|
19
|
+
source = "focus-visible",
|
|
20
|
+
ring = "brand",
|
|
21
|
+
offset = true
|
|
22
|
+
} = {}) => cn(FOCUS_RING[source][ring], offset && FOCUS_OFFSET[source]);
|
|
23
|
+
|
|
24
|
+
export { focusStyles };
|
|
25
|
+
//# sourceMappingURL=chunk-B2LCHXUB.js.map
|
|
26
|
+
//# sourceMappingURL=chunk-B2LCHXUB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/focus-styles.ts"],"names":[],"mappings":";;;AA8CA,IAAM,UAAA,GAA6D;AAAA,EACjE,eAAA,EAAiB;AAAA,IACf,KAAA,EAAO,8EAAA;AAAA,IACP,OAAA,EAAS;AAAA,GACX;AAAA,EACA,oBAAA,EAAsB;AAAA,IACpB,KAAA,EAAO,6DAAA;AAAA,IACP,OAAA,EAAS;AAAA;AAEb,CAAA;AAQA,IAAM,YAAA,GAA4C;AAAA,EAChD,eAAA,EACE,yGAAA;AAAA,EACF,oBAAA,EACE;AACJ,CAAA;AAwEO,IAAM,cAAc,CAAC;AAAA,EAC1B,MAAA,GAAS,eAAA;AAAA,EACT,IAAA,GAAO,OAAA;AAAA,EACP,MAAA,GAAS;AACX,CAAA,GAAwB,EAAC,KAAc,EAAA,CAAG,UAAA,CAAW,MAAM,CAAA,CAAE,IAAI,CAAA,EAAG,MAAA,IAAU,YAAA,CAAa,MAAM,CAAC","file":"chunk-B2LCHXUB.js","sourcesContent":["import { cn } from \"./cn\"\n\n/**\n * Where the focused state lives — which selector the ring hangs off.\n *\n * - `focus-visible` — the CSS pseudo-class, on the element itself. The default,\n * and what you want for any ordinary `<button>`, `<a>` or `tabIndex` element.\n * - `data-focus-visible` — Zag's attribute, mirrored onto every part of a\n * machine-driven control (`Checkbox`, `RadioGroup`, `Switch`,\n * `ChoiceCardGroup`) whose real focus target is a visually-hidden `<input>`.\n * The visible part never receives DOM focus, so `:focus-visible` can never\n * match it.\n */\nexport type FocusSource = \"focus-visible\" | \"data-focus-visible\"\n\n/**\n * Which color the ring paints in.\n *\n * - `brand` — a fixed `brand-500`, independent of the element's own `color`.\n * The right answer almost everywhere, and the default.\n * - `palette` — the active palette's `--c-text`. Only for a control that sits\n * *inside* an already-accented surface, where a brand ring would read as a\n * second, unrelated color stacked on the one the surface carries.\n *\n * `--c-text`, not `--c-solid`, and at full opacity — because it is the one\n * slot that flips with the theme (700 light, 300 dark), so it can be dark on\n * a pale surface and pale on a dark one. `--c-solid` is 500 in *both*, which\n * leaves it a mid-tone with nowhere to go against a light background, and no\n * alpha can fix that: opacity only ever composites the ring toward whatever\n * sits behind it. Measured on a Schedule chip, `--c-solid` rings at 2.69:1\n * against the grid and 1.80:1 against the chip's own border; `--c-text` rings\n * at 5.41:1 and 3.62:1, clearing the 3:1 that WCAG 2.2 SC 1.4.11 asks for.\n */\nexport type FocusRing = \"brand\" | \"palette\"\n\n/**\n * The ring itself, per source × color.\n *\n * Every entry is a complete class literal, and nothing here is assembled at\n * runtime. Tailwind v4 scans the *built* JS for whole strings, so a class that\n * only ever exists as `` `${prefix}:ring-2` `` is never generated and the ring\n * silently disappears in consumer builds. `focus-styles.test.ts` enforces it.\n *\n * The `data-focus-visible` rows carry no `outline-none`: the part they land on\n * is not focusable, so there is no native outline to suppress.\n */\nconst FOCUS_RING: Record<FocusSource, Record<FocusRing, string>> = {\n \"focus-visible\": {\n brand: \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500\",\n palette: \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--c-text)\",\n },\n \"data-focus-visible\": {\n brand: \"data-focus-visible:ring-2 data-focus-visible:ring-brand-500\",\n palette: \"data-focus-visible:ring-2 data-focus-visible:ring-(--c-text)\",\n },\n}\n\n/**\n * The offset gap, per source. The gap is painted in the *page* background —\n * `brand-50` light, `brand-950` dark — which is what makes it read as a gap\n * rather than as a second colored band. A neutral white / gray gap would show\n * as a thin off-ramp halo against the brand-tinted page.\n */\nconst FOCUS_OFFSET: Record<FocusSource, string> = {\n \"focus-visible\":\n \"focus-visible:ring-offset-2 focus-visible:ring-offset-brand-50 dark:focus-visible:ring-offset-brand-950\",\n \"data-focus-visible\":\n \"data-focus-visible:ring-offset-2 data-focus-visible:ring-offset-brand-50 dark:data-focus-visible:ring-offset-brand-950\",\n}\n\nexport type FocusStylesOptions = {\n /**\n * Where the focused state lives — the CSS pseudo-class (default), or Zag's\n * `data-focus-visible` attribute when you're styling a part of an Ark/Zag\n * machine whose real focus target is a visually-hidden input.\n */\n source?: FocusSource\n /**\n * Ring color: the kit's fixed `brand-500` (default), or the active palette's\n * `--c-text` for a control nested inside an accented surface.\n */\n ring?: FocusRing\n /**\n * Gap between the element and its ring, painted in the page background. Keep\n * it on (the default) so the ring stays legible against the element's own\n * fill. Turn it off for something flush inside a container — or sitting on\n * any surface that *isn't* the page background, where the gap would punch a\n * mismatched hole and you want to supply your own `ring-offset-*` colors.\n */\n offset?: boolean\n}\n\n/**\n * The kit's keyboard-focus treatment — one source of truth for every focus\n * ring in the library, and the supported way for consumers to put that same\n * ring on their own elements.\n *\n * Reach for it whenever you render something focusable that isn't already a\n * kit component: a custom trigger, a bare `<button>` wrapping a display\n * component, a link styled as something else.\n *\n * ```tsx\n * import { cn, focusStyles } from \"@42/ui-react\"\n *\n * <button type=\"button\" className={cn(focusStyles(), \"rounded-full\")}>…</button>\n * ```\n *\n * Three axes, and only three. Width and alpha are deliberately *not* options:\n * the point of a single ring is that a keyboard user never has to re-learn what\n * \"focused\" looks like, so every ring the kit draws is 2px and fully opaque.\n *\n * The ring is `brand-500` by default rather than the `--c-solid` slot the rest\n * of the color system runs on. That's deliberate: focus is an accessibility\n * affordance, not decoration, so it stays the same recognisable shape no matter\n * what `color` the thing it sits on happens to use — a green badge and a red\n * button get the same ring. `ring: \"palette\"` is the exception, for a control\n * nested inside a surface that already carries the palette.\n *\n * `offset: true` means *the gap is the page background*. An element on any\n * other surface — a tinted table header, a colored chip — passes\n * `offset: false` and supplies its own `ring-offset-*` pair matched to that\n * surface.\n *\n * What stays hand-written, on purpose:\n * - a ring on a **pseudo-element** rather than the element itself (`Schedule`'s\n * resize grip, `DataTable`'s column-resize handle) — it outlines the small\n * visible mark, not the oversized hit box, and has its own shape and offset;\n * - a ring whose color comes from **`currentColor`** (`Notification`'s actions,\n * which inherit the status hue);\n * - **`ring-inset`** rows inside a scroller (`TreeSelect`, `TreeMultiSelect`);\n * - the **shell** idiom — accent border plus a soft halo on a wrapper whose\n * focus lives on a descendant (`Input`'s chrome, `SegmentGroup`'s tray);\n * - a bare `focus:outline-none` with no ring at all, on overlay surfaces that\n * receive *programmatic* focus (`Modal`, `Drawer`, `Popover`, `Tooltip`).\n *\n * Note these classes are inert until the element they land on is actually\n * focusable — `:focus-visible` never matches a plain `<span>` or `<div>`. So a\n * display component (`Badge`, `Kbd`, `ThemeIcon`) can carry them unconditionally\n * and only light up once `asChild` renders it onto a real `<button>`/`<a>`.\n */\nexport const focusStyles = ({\n source = \"focus-visible\",\n ring = \"brand\",\n offset = true,\n}: FocusStylesOptions = {}): string => cn(FOCUS_RING[source][ring], offset && FOCUS_OFFSET[source])\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useState, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/lib/use-uncontrolled.ts
|
|
4
|
+
var resolveUpdater = (updater, previous) => typeof updater === "function" ? updater(previous) : updater;
|
|
5
|
+
function useUncontrolled({
|
|
6
|
+
value,
|
|
7
|
+
defaultValue,
|
|
8
|
+
finalValue,
|
|
9
|
+
onChange = () => {
|
|
10
|
+
}
|
|
11
|
+
}) {
|
|
12
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(
|
|
13
|
+
defaultValue !== void 0 ? defaultValue : finalValue
|
|
14
|
+
);
|
|
15
|
+
const uncontrolledRef = useRef(uncontrolledValue);
|
|
16
|
+
uncontrolledRef.current = uncontrolledValue;
|
|
17
|
+
const handleUncontrolledChange = (updater, ...payload) => {
|
|
18
|
+
const resolved = resolveUpdater(updater, uncontrolledRef.current);
|
|
19
|
+
uncontrolledRef.current = resolved;
|
|
20
|
+
setUncontrolledValue(resolved);
|
|
21
|
+
onChange?.(resolved, ...payload);
|
|
22
|
+
};
|
|
23
|
+
if (value !== void 0) {
|
|
24
|
+
return [
|
|
25
|
+
value,
|
|
26
|
+
(updater, ...payload) => onChange?.(resolveUpdater(updater, value), ...payload),
|
|
27
|
+
true
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
return [uncontrolledValue, handleUncontrolledChange, false];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { useUncontrolled };
|
|
34
|
+
//# sourceMappingURL=chunk-BEL75C7N.js.map
|
|
35
|
+
//# sourceMappingURL=chunk-BEL75C7N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/use-uncontrolled.ts"],"names":[],"mappings":";;;AAwBA,IAAM,cAAA,GAAiB,CAAI,OAAA,EAAqB,QAAA,KAC9C,OAAO,OAAA,KAAY,UAAA,GAAc,OAAA,CAA+B,QAAQ,CAAA,GAAI,OAAA;AAsBvE,SAAS,eAAA,CAAoD;AAAA,EAClE,KAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAW,MAAM;AAAA,EAAC;AACpB,CAAA,EAAmE;AACjE,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,QAAA;AAAA,IAChD,YAAA,KAAiB,SAAY,YAAA,GAAe;AAAA,GAC9C;AAIA,EAAA,MAAM,eAAA,GAAkB,OAAO,iBAAiB,CAAA;AAChD,EAAA,eAAA,CAAgB,OAAA,GAAU,iBAAA;AAE1B,EAAA,MAAM,wBAAA,GAA2B,CAAC,OAAA,EAAA,GAAwB,OAAA,KAAe;AACvE,IAAA,MAAM,QAAA,GAAW,cAAA,CAAe,OAAA,EAAS,eAAA,CAAgB,OAAY,CAAA;AACrE,IAAA,eAAA,CAAgB,OAAA,GAAU,QAAA;AAC1B,IAAA,oBAAA,CAAqB,QAAQ,CAAA;AAC7B,IAAA,QAAA,GAAW,QAAA,EAAU,GAAG,OAAO,CAAA;AAAA,EACjC,CAAA;AAEA,EAAA,IAAI,UAAU,MAAA,EAAW;AACvB,IAAA,OAAO;AAAA,MACL,KAAA;AAAA,MACA,CAAC,YAAwB,OAAA,KACvB,QAAA,GAAW,eAAe,OAAA,EAAS,KAAU,CAAA,EAAG,GAAG,OAAO,CAAA;AAAA,MAC5D;AAAA,KACF;AAAA,EACF;AAEA,EAAA,OAAO,CAAC,iBAAA,EAAwB,wBAAA,EAA0B,KAAK,CAAA;AACjE","file":"chunk-BEL75C7N.js","sourcesContent":["import { useRef, useState } from \"react\"\n\nexport interface UseUncontrolledOptions<T, P extends unknown[]> {\n /** Value for controlled state */\n value?: T\n /** Initial value for uncontrolled state */\n defaultValue?: T\n /**\n * Final value for uncontrolled state when value and defaultValue are not provided\n * This is used as the initial value for uncontrolled state where the component is uncontrolled,\n * but the author of the component has provided a default value to be used as the initial value.\n * This avoids the default value being used as the initial value for controlled state for components authors.\n */\n finalValue?: T\n /** Controlled state onChange handler */\n onChange?: (value: T, ...payload: P) => void\n}\n\n/** A value, or a function deriving the next value from the previous one —\n * the same shape React's own `useState` setter (and react-table's\n * `Updater<T>`) accepts. Supporting it here means every consumer of\n * `useUncontrolled` gets functional updates for free. */\nexport type Updater<T> = T | ((previous: T) => T)\n\nconst resolveUpdater = <T>(updater: Updater<T>, previous: T): T =>\n typeof updater === \"function\" ? (updater as (previous: T) => T)(previous) : updater\n\nexport type UseUncontrolledReturnValue<T, P extends unknown[] = unknown[]> = [\n T,\n /** Handler to update the state. Accepts a value or an updater function,\n * resolves it against the current value, then passes the resolved value\n * and `payload` to `onChange`. */\n (updater: Updater<T>, ...payload: P) => void,\n /** True if the state is controlled, false if uncontrolled */\n boolean,\n]\n\n/**\n * A hook that manages the state of a value, either controlled or uncontrolled.\n *\n * Note: When `value` is provided, the state is controlled and `defaultValue` is ignored.\n * state is uncontrolled only when `value` is undefined.\n * `null` is treated as a valid value and should be used instead of `undefined` when the value is optional.\n *\n * @param options - The options for the hook.\n * @returns A tuple containing the value, a handler to update the state, and a boolean indicating if the state is controlled.\n */\nexport function useUncontrolled<T, P extends unknown[] = unknown[]>({\n value,\n defaultValue,\n finalValue,\n onChange = () => {},\n}: UseUncontrolledOptions<T, P>): UseUncontrolledReturnValue<T, P> {\n const [uncontrolledValue, setUncontrolledValue] = useState(\n defaultValue !== undefined ? defaultValue : finalValue,\n )\n // Mirrors uncontrolledValue outside of React's state timing, so a setter\n // called more than once in the same tick resolves each updater against the\n // previous call's result rather than a stale render-time value.\n const uncontrolledRef = useRef(uncontrolledValue)\n uncontrolledRef.current = uncontrolledValue\n\n const handleUncontrolledChange = (updater: Updater<T>, ...payload: P) => {\n const resolved = resolveUpdater(updater, uncontrolledRef.current as T)\n uncontrolledRef.current = resolved\n setUncontrolledValue(resolved)\n onChange?.(resolved, ...payload)\n }\n\n if (value !== undefined) {\n return [\n value as T,\n (updater: Updater<T>, ...payload: P) =>\n onChange?.(resolveUpdater(updater, value as T), ...payload),\n true,\n ]\n }\n\n return [uncontrolledValue as T, handleUncontrolledChange, false]\n}\n\nexport namespace useUncontrolled {\n export type Options<T, P extends unknown[] = unknown[]> = UseUncontrolledOptions<T, P>\n export type ReturnValue<T, P extends unknown[] = unknown[]> = UseUncontrolledReturnValue<T, P>\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-BJZLQTAZ.js"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/lib/use-isomorphic-layout-effect.ts
|
|
4
|
+
var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
5
|
+
|
|
6
|
+
export { useIsomorphicLayoutEffect };
|
|
7
|
+
//# sourceMappingURL=chunk-BUIHQJGE.js.map
|
|
8
|
+
//# sourceMappingURL=chunk-BUIHQJGE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/use-isomorphic-layout-effect.ts"],"names":[],"mappings":";;;AAWO,IAAM,yBAAA,GAA4B,OAAO,MAAA,KAAW,WAAA,GAAc,SAAA,GAAY","file":"chunk-BUIHQJGE.js","sourcesContent":["import { useEffect, useLayoutEffect } from \"react\"\n\n/**\n * `useLayoutEffect` warns when it runs during actual server rendering (a\n * harmless no-op there — effects never run during SSR at all), since Client\n * Components in frameworks like Next.js's App Router still execute once on\n * the server to produce the initial HTML. Swapping to `useEffect` for that\n * one pass silences the warning with no behavior change; on the client this\n * stays `useLayoutEffect`, preserving its \"flushes before the browser\n * paints\" guarantee.\n */\nexport const useIsomorphicLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect\n"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { props } from './chunk-WYCMIIRR.js';
|
|
2
|
+
import { cn } from './chunk-QP4I37PA.js';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var skeletonVariants = cva(
|
|
7
|
+
["animate-pulse bg-black/15 dark:bg-white/8 motion-reduce:animate-none"],
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
shape: {
|
|
11
|
+
rectangular: "w-full rounded-xs",
|
|
12
|
+
circular: "shrink-0 rounded-full"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
xs: "",
|
|
16
|
+
sm: "",
|
|
17
|
+
md: "",
|
|
18
|
+
lg: "",
|
|
19
|
+
xl: ""
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
compoundVariants: [
|
|
23
|
+
{ shape: "rectangular", size: "xs", class: "h-2" },
|
|
24
|
+
{ shape: "rectangular", size: "sm", class: "h-3" },
|
|
25
|
+
{ shape: "rectangular", size: "md", class: "h-4" },
|
|
26
|
+
{ shape: "rectangular", size: "lg", class: "h-5" },
|
|
27
|
+
{ shape: "rectangular", size: "xl", class: "h-6" },
|
|
28
|
+
{ shape: "circular", size: "xs", class: "size-2" },
|
|
29
|
+
{ shape: "circular", size: "sm", class: "size-3" },
|
|
30
|
+
{ shape: "circular", size: "md", class: "size-4" },
|
|
31
|
+
{ shape: "circular", size: "lg", class: "size-5" },
|
|
32
|
+
{ shape: "circular", size: "xl", class: "size-6" }
|
|
33
|
+
],
|
|
34
|
+
defaultVariants: { shape: "rectangular", size: "md" }
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
var Skeleton = ({
|
|
38
|
+
className,
|
|
39
|
+
classNames,
|
|
40
|
+
shape,
|
|
41
|
+
size,
|
|
42
|
+
width,
|
|
43
|
+
height,
|
|
44
|
+
animate = true,
|
|
45
|
+
loading = true,
|
|
46
|
+
style,
|
|
47
|
+
children,
|
|
48
|
+
testId,
|
|
49
|
+
...rest
|
|
50
|
+
}) => {
|
|
51
|
+
if (children != null) {
|
|
52
|
+
return /* @__PURE__ */ jsxs(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
...props({ "data-loading": loading, "aria-busy": loading, "data-testid": testId }),
|
|
56
|
+
...rest,
|
|
57
|
+
style,
|
|
58
|
+
className: cn("relative inline-block", className),
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
"data-part": "content",
|
|
64
|
+
"aria-hidden": loading || void 0,
|
|
65
|
+
className: cn(loading && "invisible"),
|
|
66
|
+
children
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
loading && /* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
"data-part": "skeleton",
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
className: cn(
|
|
75
|
+
skeletonVariants({ shape, size }),
|
|
76
|
+
"absolute inset-0 size-full",
|
|
77
|
+
!animate && "animate-none",
|
|
78
|
+
classNames?.skeleton
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
if (!loading) return null;
|
|
87
|
+
return /* @__PURE__ */ jsx(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
"data-part": "skeleton",
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
...props({ "data-testid": testId }),
|
|
93
|
+
...rest,
|
|
94
|
+
style: {
|
|
95
|
+
...width !== void 0 && { width },
|
|
96
|
+
...height !== void 0 && { height },
|
|
97
|
+
...style
|
|
98
|
+
},
|
|
99
|
+
className: cn(skeletonVariants({ shape, size }), !animate && "animate-none", className)
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { Skeleton };
|
|
105
|
+
//# sourceMappingURL=chunk-CHTN5AHI.js.map
|
|
106
|
+
//# sourceMappingURL=chunk-CHTN5AHI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":";;;;;AAsBA,IAAM,gBAAA,GAAmB,GAAA;AAAA,EACvB,CAAC,sEAAsE,CAAA;AAAA,EACvE;AAAA,IACE,QAAA,EAAU;AAAA,MACR,KAAA,EAAO;AAAA,QACL,WAAA,EAAa,mBAAA;AAAA,QACb,QAAA,EAAU;AAAA,OACZ;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,EAAA;AAAA,QACJ,EAAA,EAAI,EAAA;AAAA,QACJ,EAAA,EAAI,EAAA;AAAA,QACJ,EAAA,EAAI,EAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACN,KACF;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,EAAE,KAAA,EAAO,aAAA,EAAe,IAAA,EAAM,IAAA,EAAM,OAAO,KAAA,EAAM;AAAA,MACjD,EAAE,KAAA,EAAO,aAAA,EAAe,IAAA,EAAM,IAAA,EAAM,OAAO,KAAA,EAAM;AAAA,MACjD,EAAE,KAAA,EAAO,aAAA,EAAe,IAAA,EAAM,IAAA,EAAM,OAAO,KAAA,EAAM;AAAA,MACjD,EAAE,KAAA,EAAO,aAAA,EAAe,IAAA,EAAM,IAAA,EAAM,OAAO,KAAA,EAAM;AAAA,MACjD,EAAE,KAAA,EAAO,aAAA,EAAe,IAAA,EAAM,IAAA,EAAM,OAAO,KAAA,EAAM;AAAA,MACjD,EAAE,KAAA,EAAO,UAAA,EAAY,IAAA,EAAM,IAAA,EAAM,OAAO,QAAA,EAAS;AAAA,MACjD,EAAE,KAAA,EAAO,UAAA,EAAY,IAAA,EAAM,IAAA,EAAM,OAAO,QAAA,EAAS;AAAA,MACjD,EAAE,KAAA,EAAO,UAAA,EAAY,IAAA,EAAM,IAAA,EAAM,OAAO,QAAA,EAAS;AAAA,MACjD,EAAE,KAAA,EAAO,UAAA,EAAY,IAAA,EAAM,IAAA,EAAM,OAAO,QAAA,EAAS;AAAA,MACjD,EAAE,KAAA,EAAO,UAAA,EAAY,IAAA,EAAM,IAAA,EAAM,OAAO,QAAA;AAAS,KACnD;AAAA,IACA,eAAA,EAAiB,EAAE,KAAA,EAAO,aAAA,EAAe,MAAM,IAAA;AAAK;AAExD,CAAA;AAgEO,IAAM,WAAW,CAAC;AAAA,EACvB,SAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,GAAU,IAAA;AAAA,EACV,OAAA,GAAU,IAAA;AAAA,EACV,KAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAqB;AACnB,EAAA,IAAI,YAAY,IAAA,EAAM;AACpB,IAAA,uBACE,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACE,GAAG,MAAU,EAAE,cAAA,EAAgB,SAAS,WAAA,EAAa,OAAA,EAAS,aAAA,EAAe,MAAA,EAAQ,CAAA;AAAA,QACrF,GAAG,IAAA;AAAA,QACJ,KAAA;AAAA,QACA,SAAA,EAAW,EAAA,CAAG,uBAAA,EAAyB,SAAS,CAAA;AAAA,QAEhD,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,WAAA,EAAU,SAAA;AAAA,cACV,eAAa,OAAA,IAAW,MAAA;AAAA,cACxB,SAAA,EAAW,EAAA,CAAG,OAAA,IAAW,WAAW,CAAA;AAAA,cAEnC;AAAA;AAAA,WACH;AAAA,UACC,OAAA,oBACC,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,WAAA,EAAU,UAAA;AAAA,cACV,aAAA,EAAY,MAAA;AAAA,cACZ,SAAA,EAAW,EAAA;AAAA,gBACT,gBAAA,CAAiB,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA;AAAA,gBAChC,4BAAA;AAAA,gBACA,CAAC,OAAA,IAAW,cAAA;AAAA,gBACZ,UAAA,EAAY;AAAA;AACd;AAAA;AACF;AAAA;AAAA,KAEJ;AAAA,EAEJ;AAEA,EAAA,IAAI,CAAC,SAAS,OAAO,IAAA;AAErB,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,UAAA;AAAA,MACV,aAAA,EAAY,MAAA;AAAA,MACX,GAAG,KAAA,CAAU,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MACtC,GAAG,IAAA;AAAA,MACJ,KAAA,EAAO;AAAA,QACL,GAAI,KAAA,KAAU,MAAA,IAAa,EAAE,KAAA,EAAM;AAAA,QACnC,GAAI,MAAA,KAAW,MAAA,IAAa,EAAE,MAAA,EAAO;AAAA,QACrC,GAAG;AAAA,OACL;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,gBAAA,CAAiB,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA,EAAG,CAAC,OAAA,IAAW,cAAA,EAAgB,SAAS;AAAA;AAAA,GACxF;AAEJ","file":"chunk-CHTN5AHI.js","sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props as dataProps } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Reproduces DataTable's own `DATA_TABLE_SKELETON_CLASS` exactly at the\n * rectangular default (`animate-pulse rounded-xs bg-black/15 dark:bg-white/8`)\n * — DataTable renders through this component internally, so pixel parity here\n * is load-bearing, not incidental. Monochrome by design: no `color` prop —\n * this is a shape axis, not a fill-treatment axis (see code-style.md's\n * variant/color split), and a loading placeholder should stay neutral rather\n * than compete with the content it precedes.\n *\n * `size` reuses the kit's shared `xs..xl` scale (`lib/sizes.ts`) at the same\n * `h-2..h-6` steps DataTable's own density scale already used — a text-line\n * bar height for `rectangular`, or (via the matching `size-2..size-6` step on\n * both axes) a small dot diameter for `circular`. Not wide enough for a\n * typical avatar circle by design — pass `width`/`height` for that.\n */\nconst skeletonVariants = cva(\n [\"animate-pulse bg-black/15 dark:bg-white/8 motion-reduce:animate-none\"],\n {\n variants: {\n shape: {\n rectangular: \"w-full rounded-xs\",\n circular: \"shrink-0 rounded-full\",\n },\n size: {\n xs: \"\",\n sm: \"\",\n md: \"\",\n lg: \"\",\n xl: \"\",\n },\n },\n compoundVariants: [\n { shape: \"rectangular\", size: \"xs\", class: \"h-2\" },\n { shape: \"rectangular\", size: \"sm\", class: \"h-3\" },\n { shape: \"rectangular\", size: \"md\", class: \"h-4\" },\n { shape: \"rectangular\", size: \"lg\", class: \"h-5\" },\n { shape: \"rectangular\", size: \"xl\", class: \"h-6\" },\n { shape: \"circular\", size: \"xs\", class: \"size-2\" },\n { shape: \"circular\", size: \"sm\", class: \"size-3\" },\n { shape: \"circular\", size: \"md\", class: \"size-4\" },\n { shape: \"circular\", size: \"lg\", class: \"size-5\" },\n { shape: \"circular\", size: \"xl\", class: \"size-6\" },\n ],\n defaultVariants: { shape: \"rectangular\", size: \"md\" },\n },\n)\n\nexport type SkeletonShape = NonNullable<VariantProps<typeof skeletonVariants>[\"shape\"]>\nexport type SkeletonSize = Size\n\nexport type SkeletonClassNames = {\n /** The placeholder box itself in wrap mode — separate from the wrapper's\n * own `className` so a caller can restyle just the placeholder (radius,\n * background) without touching the wrapper's layout. */\n skeleton?: string\n}\n\n/**\n * Skeleton — a loading placeholder. Not routed through Ark's `ark.*` factory\n * (no `asChild`): wrap mode below repurposes `children` to mean \"real content\n * to reveal,\" which collides with `asChild`'s usual meaning (the one child to\n * merge root props onto) — the same bespoke-primitive rationale as `Collapse`.\n *\n * **Standalone mode** (no `children`) — a fixed placeholder shape:\n *\n * <Skeleton />\n * <Skeleton shape=\"circular\" width={40} height={40} />\n *\n * **Wrap mode** (`children` passed) — sizes a placeholder to the real\n * content's own box (no measurement, pure CSS: the content stays mounted but\n * `invisible` while loading, so it keeps contributing its box to the relative\n * wrapper the placeholder absolutely fills), then reveals the content once\n * `loading` is `false`:\n *\n * <Skeleton loading={isLoading}>\n * <Avatar src={user.avatarUrl} />\n * </Skeleton>\n *\n * For complex card-style layouts, compose multiple `Skeleton`s inside the\n * kit's existing `Card`/`Flex`/`Grid` — Skeleton itself has no layout logic.\n *\n * The wrapper shrink-wraps to the content's *intrinsic* size (`inline-block`)\n * — content that itself stretches to fill its container (`w-full`, `flex-1`,\n * an unconstrained block paragraph) won't get a full-width overlay from wrap\n * mode alone. Add `className=\"block w-full\"` in that case, or use standalone\n * mode with an explicit `width` instead.\n */\nexport type SkeletonProps = ComponentPropsWithoutRef<\"div\"> &\n VariantProps<typeof skeletonVariants> &\n WithTestId & {\n /** Fixed width. Standalone mode only (no `children`) — wrap mode sizes\n * itself off the real content instead. Needed for an avatar-scale\n * `circular` placeholder, since `size`'s scale tops out at 24px. */\n width?: CSSProperties[\"width\"]\n /** Fixed height. Standalone mode only — see `width`. */\n height?: CSSProperties[\"height\"]\n /** Plays the pulse animation. Default `true`. */\n animate?: boolean\n /** Standalone (no `children`): `false` renders nothing. Wrap mode\n * (`children` set): `false` reveals the real children instead of the\n * placeholder. Default `true`. */\n loading?: boolean\n /** Wrap mode: real content to size the placeholder against, revealed\n * once `loading` is `false`. Omit for a standalone fixed-shape\n * placeholder. */\n children?: ReactNode\n classNames?: SkeletonClassNames\n }\n\nexport const Skeleton = ({\n className,\n classNames,\n shape,\n size,\n width,\n height,\n animate = true,\n loading = true,\n style,\n children,\n testId,\n ...rest\n}: SkeletonProps) => {\n if (children != null) {\n return (\n <div\n {...dataProps({ \"data-loading\": loading, \"aria-busy\": loading, \"data-testid\": testId })}\n {...rest}\n style={style}\n className={cn(\"relative inline-block\", className)}\n >\n <div\n data-part=\"content\"\n aria-hidden={loading || undefined}\n className={cn(loading && \"invisible\")}\n >\n {children}\n </div>\n {loading && (\n <div\n data-part=\"skeleton\"\n aria-hidden=\"true\"\n className={cn(\n skeletonVariants({ shape, size }),\n \"absolute inset-0 size-full\",\n !animate && \"animate-none\",\n classNames?.skeleton,\n )}\n />\n )}\n </div>\n )\n }\n\n if (!loading) return null\n\n return (\n <div\n data-part=\"skeleton\"\n aria-hidden=\"true\"\n {...dataProps({ \"data-testid\": testId })}\n {...rest}\n style={{\n ...(width !== undefined && { width }),\n ...(height !== undefined && { height }),\n ...style,\n }}\n className={cn(skeletonVariants({ shape, size }), !animate && \"animate-none\", className)}\n />\n )\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TYPOGRAPHY_SHADE_CLASSES, TYPOGRAPHY_SIZE_CLASSES, resolveHeadingSize } from './chunk-2GILNBZW.js';
|
|
2
|
+
import { props } from './chunk-WYCMIIRR.js';
|
|
3
|
+
import { cn } from './chunk-QP4I37PA.js';
|
|
4
|
+
import { ark } from '@ark-ui/react';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var textVariants = cva("", {
|
|
9
|
+
variants: {
|
|
10
|
+
size: TYPOGRAPHY_SIZE_CLASSES,
|
|
11
|
+
c: {
|
|
12
|
+
default: "",
|
|
13
|
+
...TYPOGRAPHY_SHADE_CLASSES
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
size: "md",
|
|
18
|
+
c: "default"
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
var Text = ({
|
|
22
|
+
className,
|
|
23
|
+
size,
|
|
24
|
+
c,
|
|
25
|
+
prefix,
|
|
26
|
+
span,
|
|
27
|
+
children,
|
|
28
|
+
asChild,
|
|
29
|
+
testId,
|
|
30
|
+
...rest
|
|
31
|
+
}) => {
|
|
32
|
+
const Comp = span ? ark.span : ark.p;
|
|
33
|
+
const resolvedSize = size ? resolveHeadingSize(size) : void 0;
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
Comp,
|
|
36
|
+
{
|
|
37
|
+
...props({ "data-testid": testId }),
|
|
38
|
+
...rest,
|
|
39
|
+
asChild,
|
|
40
|
+
className: cn(textVariants({ size: resolvedSize, c }), className),
|
|
41
|
+
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
prefix !== void 0 && /* @__PURE__ */ jsx(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
className: "select-none text-gray-light-600 dark:text-gray-dark-400",
|
|
47
|
+
children: prefix
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
children
|
|
51
|
+
] })
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { Text };
|
|
57
|
+
//# sourceMappingURL=chunk-CSCVTESP.js.map
|
|
58
|
+
//# sourceMappingURL=chunk-CSCVTESP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/text/text.tsx"],"names":[],"mappings":";;;;;;;AAqCA,IAAM,YAAA,GAAe,IAAI,EAAA,EAAI;AAAA,EAC3B,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,uBAAA;AAAA,IACN,CAAA,EAAG;AAAA,MACD,OAAA,EAAS,EAAA;AAAA,MACT,GAAG;AAAA;AACL,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM,IAAA;AAAA,IACN,CAAA,EAAG;AAAA;AAEP,CAAC,CAAA;AAoBM,IAAM,OAAO,CAAC;AAAA,EACnB,SAAA;AAAA,EACA,IAAA;AAAA,EACA,CAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAiB;AACf,EAAA,MAAM,IAAA,GAAO,IAAA,GAAO,GAAA,CAAI,IAAA,GAAO,GAAA,CAAI,CAAA;AACnC,EAAA,MAAM,YAAA,GAAe,IAAA,GAAO,kBAAA,CAAmB,IAAI,CAAA,GAAI,MAAA;AACvD,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,OAAA;AAAA,MACA,SAAA,EAAW,GAAG,YAAA,CAAa,EAAE,MAAM,YAAA,EAAc,CAAA,EAAG,CAAA,EAAG,SAAS,CAAA;AAAA,MAE/D,QAAA,EAAA,OAAA,GACC,2BAEA,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,QAAA,MAAA,KAAW,MAAA,oBACV,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,aAAA,EAAY,MAAA;AAAA,YACZ,SAAA,EAAU,yDAAA;AAAA,YAET,QAAA,EAAA;AAAA;AAAA,SACH;AAAA,QAED;AAAA,OAAA,EACH;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-CSCVTESP.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport {\n type HeadingSizeAlias,\n resolveHeadingSize,\n TYPOGRAPHY_SHADE_CLASSES,\n TYPOGRAPHY_SIZE_CLASSES,\n} from \"../../lib/typography-size\"\n\n/**\n * Text — styled paragraph primitive.\n *\n * Pure React Server Component. Renders `<p>` by default and exposes a tight\n * prop surface: size (visual scale) and a `c` shade switch (default / secondary /\n * muted), matching the 42 UI Kit Figma's text-color tiers: `secondary` is\n * `text-secondary` (labels, section headings — gray-700/gray-300) and `muted`\n * is `text-tertiary` (supporting/paragraph text — gray-600/gray-400). For\n * headings use `Title`.\n *\n * `size` also accepts the heading aliases (`h1`..`h6`, `p`) as friendlier\n * names for the same scale — e.g. `size=\"h2\"` is identical to `size=\"3xl\"`.\n * These are visual-only: Text always renders `<p>`/`<span>`, never a\n * heading element, regardless of which size alias is used.\n *\n * The `prefix` slot lets callers prepend a decorative leader (the classic\n * `// ` for the code-themed aesthetic) without compromising assistive tech:\n * - `aria-hidden=\"true\"` keeps screen readers from announcing it\n * - `select-none` keeps it out of clipboard copies\n *\n * Pass `span` when a `<p>` isn't valid HTML where Text is composed — e.g.\n * nested inside a consumer's own paragraph, or inside another phrasing-\n * content-only element. Visually identical; only the tag changes.\n */\nconst textVariants = cva(\"\", {\n variants: {\n size: TYPOGRAPHY_SIZE_CLASSES,\n c: {\n default: \"\",\n ...TYPOGRAPHY_SHADE_CLASSES,\n },\n },\n defaultVariants: {\n size: \"md\",\n c: \"default\",\n },\n})\n\nexport type TextSize = NonNullable<VariantProps<typeof textVariants>[\"size\"]>\n\nexport type TextProps = Omit<HTMLArkProps<\"p\">, \"prefix\"> &\n Omit<VariantProps<typeof textVariants>, \"size\"> &\n WithTestId & {\n /** Visual scale. Also accepts the heading aliases (`h1`..`h6`, `p`). */\n size?: TextSize | HeadingSizeAlias\n /**\n * Decorative prefix rendered inside the paragraph. Hidden from screen\n * readers and the clipboard via `aria-hidden` + `select-none`. Ignored\n * when `asChild` is true — the consumer owns the inner structure.\n */\n prefix?: ReactNode\n /** Renders a `<span>` instead of the default `<p>`. Same styling — only\n * the tag changes, for composing Text where a `<p>` isn't valid HTML. */\n span?: boolean\n }\n\nexport const Text = ({\n className,\n size,\n c,\n prefix,\n span,\n children,\n asChild,\n testId,\n ...rest\n}: TextProps) => {\n const Comp = span ? ark.span : ark.p\n const resolvedSize = size ? resolveHeadingSize(size) : undefined\n return (\n <Comp\n {...props({ \"data-testid\": testId })}\n {...rest}\n asChild={asChild}\n className={cn(textVariants({ size: resolvedSize, c }), className)}\n >\n {asChild ? (\n children\n ) : (\n <>\n {prefix !== undefined && (\n <span\n aria-hidden=\"true\"\n className=\"select-none text-gray-light-600 dark:text-gray-dark-400\"\n >\n {prefix}\n </span>\n )}\n {children}\n </>\n )}\n </Comp>\n )\n}\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/lib/theme.ts
|
|
2
|
+
var THEME_MODES = ["light", "dark", "system"];
|
|
3
|
+
var DEFAULT_THEME_STORAGE_KEY = "ui-theme";
|
|
4
|
+
function isThemeMode(value) {
|
|
5
|
+
return typeof value === "string" && THEME_MODES.includes(value);
|
|
6
|
+
}
|
|
7
|
+
function getSystemTheme() {
|
|
8
|
+
if (typeof window === "undefined") return "light";
|
|
9
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
10
|
+
}
|
|
11
|
+
function resolveTheme(mode) {
|
|
12
|
+
return mode === "system" ? getSystemTheme() : mode;
|
|
13
|
+
}
|
|
14
|
+
function applyThemeAttribute(theme, attribute = "data-theme") {
|
|
15
|
+
if (typeof document === "undefined") return;
|
|
16
|
+
const attrs = Array.isArray(attribute) ? attribute : [attribute];
|
|
17
|
+
const root = document.documentElement;
|
|
18
|
+
if (attrs.includes("data-theme")) root.setAttribute("data-theme", theme);
|
|
19
|
+
if (attrs.includes("class")) root.classList.toggle("dark", theme === "dark");
|
|
20
|
+
}
|
|
21
|
+
function disableTransitionsDuringChange() {
|
|
22
|
+
if (typeof document === "undefined" || typeof window === "undefined") return () => {
|
|
23
|
+
};
|
|
24
|
+
const style = document.createElement("style");
|
|
25
|
+
style.textContent = "*{transition:none!important}";
|
|
26
|
+
document.head.appendChild(style);
|
|
27
|
+
return () => {
|
|
28
|
+
(() => window.getComputedStyle(document.body))();
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
document.head.removeChild(style);
|
|
31
|
+
}, 1);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
var THEME_INIT_SCRIPT_BODY = `(function(cfg){try{
|
|
35
|
+
var d;
|
|
36
|
+
if(cfg.force){
|
|
37
|
+
d=cfg.force;
|
|
38
|
+
}else{
|
|
39
|
+
var s=localStorage.getItem(cfg.key),v=null;
|
|
40
|
+
if(s){try{v=JSON.parse(s)}catch(e){v=null}}
|
|
41
|
+
if(["light","dark","system"].indexOf(v)===-1)v=cfg.def;
|
|
42
|
+
d=v==="system"?(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"):v;
|
|
43
|
+
}
|
|
44
|
+
if(cfg.attr.indexOf("data-theme")!==-1)document.documentElement.setAttribute("data-theme",d);
|
|
45
|
+
if(cfg.attr.indexOf("class")!==-1)document.documentElement.classList.toggle("dark",d==="dark");
|
|
46
|
+
}catch(e){}})(`;
|
|
47
|
+
function buildThemeInitScript(options = {}) {
|
|
48
|
+
const attribute = options.attribute ?? "data-theme";
|
|
49
|
+
const config = {
|
|
50
|
+
key: options.storageKey ?? DEFAULT_THEME_STORAGE_KEY,
|
|
51
|
+
def: options.defaultColorScheme ?? "system",
|
|
52
|
+
force: options.forceColorScheme ?? null,
|
|
53
|
+
attr: Array.isArray(attribute) ? attribute : [attribute]
|
|
54
|
+
};
|
|
55
|
+
return `${THEME_INIT_SCRIPT_BODY}${JSON.stringify(config)});`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { DEFAULT_THEME_STORAGE_KEY, THEME_MODES, applyThemeAttribute, buildThemeInitScript, disableTransitionsDuringChange, getSystemTheme, isThemeMode, resolveTheme };
|
|
59
|
+
//# sourceMappingURL=chunk-EEMRRRYS.js.map
|
|
60
|
+
//# sourceMappingURL=chunk-EEMRRRYS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/theme.ts"],"names":[],"mappings":";AAaO,IAAM,WAAA,GAAc,CAAC,OAAA,EAAS,MAAA,EAAQ,QAAQ;AAU9C,IAAM,yBAAA,GAA4B;AAElC,SAAS,YAAY,KAAA,EAAoC;AAC9D,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAa,WAAA,CAAkC,SAAS,KAAK,CAAA;AACvF;AAIO,SAAS,cAAA,GAAgC;AAC9C,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,EAAa,OAAO,OAAA;AAC1C,EAAA,OAAO,MAAA,CAAO,UAAA,CAAW,8BAA8B,CAAA,CAAE,UAAU,MAAA,GAAS,OAAA;AAC9E;AAEO,SAAS,aAAa,IAAA,EAAgC;AAC3D,EAAA,OAAO,IAAA,KAAS,QAAA,GAAW,cAAA,EAAe,GAAI,IAAA;AAChD;AAYO,SAAS,mBAAA,CACd,KAAA,EACA,SAAA,GAA+C,YAAA,EACzC;AACN,EAAA,IAAI,OAAO,aAAa,WAAA,EAAa;AACrC,EAAA,MAAM,QAAQ,KAAA,CAAM,OAAA,CAAQ,SAAS,CAAA,GAAI,SAAA,GAAY,CAAC,SAAS,CAAA;AAC/D,EAAA,MAAM,OAAO,QAAA,CAAS,eAAA;AACtB,EAAA,IAAI,MAAM,QAAA,CAAS,YAAY,GAAG,IAAA,CAAK,YAAA,CAAa,cAAc,KAAK,CAAA;AACvE,EAAA,IAAI,KAAA,CAAM,SAAS,OAAO,CAAA,OAAQ,SAAA,CAAU,MAAA,CAAO,MAAA,EAAQ,KAAA,KAAU,MAAM,CAAA;AAC7E;AAYO,SAAS,8BAAA,GAA6C;AAC3D,EAAA,IAAI,OAAO,QAAA,KAAa,WAAA,IAAe,OAAO,MAAA,KAAW,WAAA,SAAoB,MAAM;AAAA,EAAC,CAAA;AACpF,EAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,aAAA,CAAc,OAAO,CAAA;AAC5C,EAAA,KAAA,CAAM,WAAA,GAAc,8BAAA;AACpB,EAAA,QAAA,CAAS,IAAA,CAAK,YAAY,KAAK,CAAA;AAC/B,EAAA,OAAO,MAAM;AAGV,IAAA,CAAC,MAAM,MAAA,CAAO,gBAAA,CAAiB,QAAA,CAAS,IAAI,CAAA,GAAG;AAChD,IAAA,UAAA,CAAW,MAAM;AACf,MAAA,QAAA,CAAS,IAAA,CAAK,YAAY,KAAK,CAAA;AAAA,IACjC,GAAG,CAAC,CAAA;AAAA,EACN,CAAA;AACF;AAmCO,IAAM,sBAAA,GAAyB,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,CAAA;AAwB/B,SAAS,oBAAA,CAAqB,OAAA,GAAuC,EAAC,EAAW;AACtF,EAAA,MAAM,SAAA,GAAY,QAAQ,SAAA,IAAa,YAAA;AACvC,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,GAAA,EAAK,QAAQ,UAAA,IAAc,yBAAA;AAAA,IAC3B,GAAA,EAAK,QAAQ,kBAAA,IAAsB,QAAA;AAAA,IACnC,KAAA,EAAO,QAAQ,gBAAA,IAAoB,IAAA;AAAA,IACnC,MAAM,KAAA,CAAM,OAAA,CAAQ,SAAS,CAAA,GAAI,SAAA,GAAY,CAAC,SAAS;AAAA,GACzD;AACA,EAAA,OAAO,GAAG,sBAAsB,CAAA,EAAG,IAAA,CAAK,SAAA,CAAU,MAAM,CAAC,CAAA,EAAA,CAAA;AAC3D","file":"chunk-EEMRRRYS.js","sourcesContent":["/**\n * Framework-agnostic theme core — types, storage-key contract, and the pure\n * read/resolve/apply functions. No React import, no \"use client\": this\n * module is dual-purpose. `buildThemeInitScript` must be safely callable\n * from a genuine server/Node context (it only ever returns a string), while\n * the DOM-touching functions self-guard with `typeof document === \"undefined\"`\n * checks, mirroring `apps/docs/lib/direction.ts`'s `readDirection()`.\n *\n * `use-theme.ts` and `components/theme-script` both import from here so the\n * storage key, mode validation, and light/dark resolution can never drift\n * between the pre-hydration blocking script and the post-hydration hook.\n */\n\nexport const THEME_MODES = [\"light\", \"dark\", \"system\"] as const\nexport type ThemeMode = (typeof THEME_MODES)[number]\nexport type ResolvedTheme = Exclude<ThemeMode, \"system\">\n\nexport const THEME_ATTRIBUTES = [\"data-theme\", \"class\"] as const\nexport type ThemeAttribute = (typeof THEME_ATTRIBUTES)[number]\n\n/** Shared default for `useTheme({ storageKey })` and `<ThemeScript storageKey>` —\n * always pass the same value to both, or the persisted preference and the\n * pre-hydration DOM attribute will disagree. */\nexport const DEFAULT_THEME_STORAGE_KEY = \"ui-theme\"\n\nexport function isThemeMode(value: unknown): value is ThemeMode {\n return typeof value === \"string\" && (THEME_MODES as readonly string[]).includes(value)\n}\n\n/** SSR-safe: no `window` means no OS preference to read — defaults to\n * \"light\", matching theme.css's \"absence of data-theme means light\" contract. */\nexport function getSystemTheme(): ResolvedTheme {\n if (typeof window === \"undefined\") return \"light\"\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\"\n}\n\nexport function resolveTheme(mode: ThemeMode): ResolvedTheme {\n return mode === \"system\" ? getSystemTheme() : mode\n}\n\n/**\n * `data-theme` is the one contract this whole feature exists to drive —\n * `theme.css`'s `@custom-variant dark` matches on it. `class` is opt-in, for\n * consumers whose *other* CSS (Fumadocs' bundled styles, Tailwind's default\n * `dark` strategy, third-party components) reads a literal `.dark` class\n * instead — mirrors next-themes' `attribute` option of the same name, so\n * `@42/ui-react` can drive that too instead of every consumer hand-rolling\n * their own mirror script/observer.\n * @default \"data-theme\"\n */\nexport function applyThemeAttribute(\n theme: ResolvedTheme,\n attribute: ThemeAttribute | ThemeAttribute[] = \"data-theme\",\n): void {\n if (typeof document === \"undefined\") return\n const attrs = Array.isArray(attribute) ? attribute : [attribute]\n const root = document.documentElement\n if (attrs.includes(\"data-theme\")) root.setAttribute(\"data-theme\", theme)\n if (attrs.includes(\"class\")) root.classList.toggle(\"dark\", theme === \"dark\")\n}\n\n/**\n * Mirrors next-themes' `disableTransitionOnChange`: without this, any\n * element with a `transition` on a color/border/background property\n * visibly animates through a theme swap instead of snapping instantly.\n * Call before changing `data-theme`, then call the returned function right\n * after — it forces a reflow (so the browser actually observes the\n * suppression instead of coalescing both style mutations into one frame)\n * and removes the override on the next tick, restoring normal transitions\n * for everything unrelated to the swap.\n */\nexport function disableTransitionsDuringChange(): () => void {\n if (typeof document === \"undefined\" || typeof window === \"undefined\") return () => {}\n const style = document.createElement(\"style\")\n style.textContent = \"*{transition:none!important}\"\n document.head.appendChild(style)\n return () => {\n // Force a reflow before removing the override, or the browser may batch\n // both style mutations into a single frame and never suppress anything.\n ;(() => window.getComputedStyle(document.body))()\n setTimeout(() => {\n document.head.removeChild(style)\n }, 1)\n }\n}\n\nexport interface BuildThemeInitScriptOptions {\n /** @default DEFAULT_THEME_STORAGE_KEY */\n storageKey?: string\n /** Fallback used when nothing is stored yet.\n * @default \"system\" */\n defaultColorScheme?: ThemeMode\n /** Pins the applied theme, skipping the localStorage/OS-preference read\n * entirely. Must match whatever `forceColorScheme` is passed to\n * `useTheme()`, or the pre-hydration script and the hook will disagree. */\n forceColorScheme?: ResolvedTheme\n /** Which DOM mechanism(s) to write. Must match whatever `attribute` is\n * passed to `useTheme()`, or the pre-hydration script and the hook will\n * disagree on what to keep in sync.\n * @default \"data-theme\" */\n attribute?: ThemeAttribute | ThemeAttribute[]\n}\n\n/**\n * Body of the synchronous, blocking script meant to run before first paint:\n * reads the persisted mode, resolves \"system\" against the real OS\n * preference, and writes `data-theme` (and/or `.dark`, see `attribute`) —\n * before React/hydration exists. One-shot only, deliberately no listeners\n * registered here (kept minimal because it blocks HTML parsing) — live\n * \"system\" follow-up after this point is `useTheme`'s job (see `use-theme.ts`).\n *\n * A genuine constant: every option this module supports is data the IIFE\n * reads off its own `cfg` argument at runtime (`cfg.force`, `cfg.key`,\n * `cfg.def`, `cfg.attr`), never text spliced in ahead of time — so this\n * string is identical byte-for-byte no matter what callers pass to\n * `buildThemeInitScript`, which only ever appends a `JSON.stringify`d config\n * object after it. That's what lets `ThemeScript` render the same script\n * source on every request instead of a freshly-assembled one per render.\n */\nexport const THEME_INIT_SCRIPT_BODY = `(function(cfg){try{\n var d;\n if(cfg.force){\n d=cfg.force;\n }else{\n var s=localStorage.getItem(cfg.key),v=null;\n if(s){try{v=JSON.parse(s)}catch(e){v=null}}\n if([\"light\",\"dark\",\"system\"].indexOf(v)===-1)v=cfg.def;\n d=v===\"system\"?(window.matchMedia&&window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"):v;\n }\n if(cfg.attr.indexOf(\"data-theme\")!==-1)document.documentElement.setAttribute(\"data-theme\",d);\n if(cfg.attr.indexOf(\"class\")!==-1)document.documentElement.classList.toggle(\"dark\",d===\"dark\");\n}catch(e){}})(`\n\n/**\n * Framework-agnostic string, not JSX — `ThemeScript` (a component under\n * `src/components/theme-script/`) is the Next.js-facing wrapper; the\n * package README covers pasting this same output into a Vite `index.html`.\n *\n * Only ever concatenates `THEME_INIT_SCRIPT_BODY` (always the same) with a\n * `JSON.stringify`d config object (the only part that varies per call) — the\n * script's actual logic never branches per-caller, so it stays the same\n * static source for every combination of options.\n */\nexport function buildThemeInitScript(options: BuildThemeInitScriptOptions = {}): string {\n const attribute = options.attribute ?? \"data-theme\"\n const config = {\n key: options.storageKey ?? DEFAULT_THEME_STORAGE_KEY,\n def: options.defaultColorScheme ?? \"system\",\n force: options.forceColorScheme ?? null,\n attr: Array.isArray(attribute) ? attribute : [attribute],\n }\n return `${THEME_INIT_SCRIPT_BODY}${JSON.stringify(config)});`\n}\n"]}
|