@42-central/ui-react 0.18.2 → 0.19.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/dist/{chunk-YXE4B6X3.js → chunk-2NNZHVKD.js} +3 -3
- package/dist/{chunk-YXE4B6X3.js.map → chunk-2NNZHVKD.js.map} +1 -1
- package/dist/{chunk-5JHDSVEZ.js → chunk-4NNGTNPV.js} +10 -8
- package/dist/chunk-4NNGTNPV.js.map +1 -0
- package/dist/{chunk-7NZSTCJO.js → chunk-57BTVRRB.js} +4 -9
- package/dist/chunk-57BTVRRB.js.map +1 -0
- package/dist/{chunk-S2HWWR2H.js → chunk-64T6Z7BA.js} +3 -3
- package/dist/{chunk-S2HWWR2H.js.map → chunk-64T6Z7BA.js.map} +1 -1
- package/dist/{chunk-MI2WZRK3.js → chunk-A6MYJTJI.js} +4 -4
- package/dist/{chunk-MI2WZRK3.js.map → chunk-A6MYJTJI.js.map} +1 -1
- package/dist/{chunk-RQL7FVCS.js → chunk-BTFBBNRW.js} +11 -6
- package/dist/chunk-BTFBBNRW.js.map +1 -0
- package/dist/{chunk-OWG4BCQR.js → chunk-CYWMES5P.js} +4 -4
- package/dist/{chunk-OWG4BCQR.js.map → chunk-CYWMES5P.js.map} +1 -1
- package/dist/{chunk-YBJB7FGE.js → chunk-CZEKZ5HR.js} +6 -6
- package/dist/chunk-CZEKZ5HR.js.map +1 -0
- package/dist/{chunk-HAQJQFE6.js → chunk-DBTJEBMO.js} +11 -4
- package/dist/{chunk-HAQJQFE6.js.map → chunk-DBTJEBMO.js.map} +1 -1
- package/dist/{chunk-AE7QTLJ5.js → chunk-FAOBC4IS.js} +4 -4
- package/dist/{chunk-AE7QTLJ5.js.map → chunk-FAOBC4IS.js.map} +1 -1
- package/dist/{chunk-NF5JM2YO.js → chunk-FOMR74VE.js} +3 -3
- package/dist/{chunk-NF5JM2YO.js.map → chunk-FOMR74VE.js.map} +1 -1
- package/dist/{chunk-FZIHZT5R.js → chunk-GCGX4FEF.js} +16 -10
- package/dist/chunk-GCGX4FEF.js.map +1 -0
- package/dist/{chunk-B2YJKRNQ.js → chunk-HCYULRWT.js} +13 -9
- package/dist/chunk-HCYULRWT.js.map +1 -0
- package/dist/{chunk-B2LCHXUB.js → chunk-INJUILCN.js} +9 -4
- package/dist/chunk-INJUILCN.js.map +1 -0
- package/dist/{chunk-ZDXQ64A7.js → chunk-K5UWVH6P.js} +5 -5
- package/dist/{chunk-ZDXQ64A7.js.map → chunk-K5UWVH6P.js.map} +1 -1
- package/dist/{chunk-6GDMSENK.js → chunk-LM6F6DLR.js} +3 -24
- package/dist/chunk-LM6F6DLR.js.map +1 -0
- package/dist/{chunk-KHMFNH3X.js → chunk-MQO42HZL.js} +7 -7
- package/dist/chunk-MQO42HZL.js.map +1 -0
- package/dist/chunk-OC7I2CTA.js +8 -0
- package/dist/chunk-OC7I2CTA.js.map +1 -0
- package/dist/{chunk-O23Y5ML4.js → chunk-OGJFDNIS.js} +249 -231
- package/dist/chunk-OGJFDNIS.js.map +1 -0
- package/dist/{chunk-6OLTJYSX.js → chunk-PINENGML.js} +12 -5
- package/dist/chunk-PINENGML.js.map +1 -0
- package/dist/{chunk-NSDM3FEB.js → chunk-PS2PZFXH.js} +5 -3
- package/dist/chunk-PS2PZFXH.js.map +1 -0
- package/dist/{chunk-RAUOFTUH.js → chunk-QIDAXFKK.js} +4 -4
- package/dist/{chunk-RAUOFTUH.js.map → chunk-QIDAXFKK.js.map} +1 -1
- package/dist/{chunk-S7N4LGLZ.js → chunk-RIP5G47F.js} +4 -4
- package/dist/{chunk-S7N4LGLZ.js.map → chunk-RIP5G47F.js.map} +1 -1
- package/dist/{chunk-Z2Z5EXVT.js → chunk-RKYXG6X7.js} +3 -3
- package/dist/{chunk-Z2Z5EXVT.js.map → chunk-RKYXG6X7.js.map} +1 -1
- package/dist/{chunk-WQN64ZHG.js → chunk-SVKU3GUN.js} +10 -6
- package/dist/chunk-SVKU3GUN.js.map +1 -0
- package/dist/{chunk-FHG54IT5.js → chunk-TBTSEPGP.js} +13 -4
- package/dist/chunk-TBTSEPGP.js.map +1 -0
- package/dist/{chunk-HT5JAHR3.js → chunk-UJZIF2BA.js} +20 -9
- package/dist/chunk-UJZIF2BA.js.map +1 -0
- package/dist/{chunk-UHNRAI6V.js → chunk-VZBUQNLX.js} +68 -29
- package/dist/chunk-VZBUQNLX.js.map +1 -0
- package/dist/{chunk-JITF6I7N.js → chunk-WJOHNCYY.js} +11 -4
- package/dist/{chunk-JITF6I7N.js.map → chunk-WJOHNCYY.js.map} +1 -1
- package/dist/{chunk-EBREIC3L.js → chunk-YQHOKMSV.js} +26 -8
- package/dist/chunk-YQHOKMSV.js.map +1 -0
- package/dist/{chunk-WHKKN3ZK.js → chunk-YW6Q6ERX.js} +10 -8
- package/dist/chunk-YW6Q6ERX.js.map +1 -0
- package/dist/{chunk-PH354ECN.js → chunk-Z43YWH4R.js} +13 -4
- package/dist/chunk-Z43YWH4R.js.map +1 -0
- package/dist/{chunk-5OQLFX47.js → chunk-Z6RPMRFH.js} +3 -3
- package/dist/{chunk-5OQLFX47.js.map → chunk-Z6RPMRFH.js.map} +1 -1
- package/dist/{chunk-TCWYBVIL.js → chunk-ZB5VMGKB.js} +10 -7
- package/dist/chunk-ZB5VMGKB.js.map +1 -0
- package/dist/colors.css +15 -10
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/action-icon/index.js +3 -3
- package/dist/components/alert/index.js +3 -3
- package/dist/components/app-shell/index.js +4 -4
- package/dist/components/autocomplete/autocomplete.d.ts +8 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.d.ts +1 -1
- package/dist/components/autocomplete/index.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +10 -7
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/index.js +3 -3
- package/dist/components/button-multi-select/index.js +5 -5
- package/dist/components/button-select/index.js +5 -5
- package/dist/components/calendar/calendar-zone-sync.d.ts +41 -0
- package/dist/components/calendar/calendar-zone-sync.d.ts.map +1 -0
- package/dist/components/calendar/calendar.d.ts +6 -5
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.js +8 -5
- package/dist/components/chart/chart.d.ts +17 -10
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.js +50 -7
- package/dist/components/chart/index.js.map +1 -1
- package/dist/components/chart/styles.css +100 -0
- package/dist/components/checkbox/index.js +4 -4
- package/dist/components/choice-card-group/index.d.ts.map +1 -1
- package/dist/components/choice-card-group/index.js +4 -3
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/copy.d.ts.map +1 -1
- package/dist/components/clipboard/index.js +5 -5
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +4 -4
- package/dist/components/code-block/index.js +5 -5
- package/dist/components/combobox/combobox.d.ts +20 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/combobox/index.js +4 -4
- package/dist/components/combobox-list/combobox-list.d.ts +8 -1
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/index.d.ts +1 -1
- package/dist/components/combobox-list/index.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +5 -5
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/index.d.ts +5 -1
- package/dist/components/data-table/data-table-filter/index.d.ts.map +1 -1
- package/dist/components/data-table/data-table-header-cell.d.ts +11 -15
- package/dist/components/data-table/data-table-header-cell.d.ts.map +1 -1
- package/dist/components/data-table/data-table-meta.d.ts +2 -2
- package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
- package/dist/components/data-table/data-table-pagination.d.ts +3 -0
- package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts +5 -2
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +3 -1
- package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
- package/dist/components/data-table/data-table-translations.d.ts +68 -0
- package/dist/components/data-table/data-table-translations.d.ts.map +1 -0
- package/dist/components/data-table/data-table.d.ts +5 -8
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.d.ts +2 -1
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +162 -79
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +13 -9
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +16 -15
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +9 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/index.d.ts.map +1 -1
- package/dist/components/drawer/index.js +4 -4
- package/dist/components/field/field.d.ts +9 -2
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/file-upload/file-upload.d.ts +13 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +16 -7
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/input/index.js +2 -2
- package/dist/components/kbd/index.js +1 -1
- package/dist/components/menu/index.js +2 -2
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +4 -4
- package/dist/components/modal/modal.d.ts +9 -1
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.d.ts +1 -1
- package/dist/components/multi-combobox-list/index.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +7 -5
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +8 -1
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.d.ts +1 -1
- package/dist/components/multi-select/index.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +20 -9
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +11 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.d.ts +1 -1
- package/dist/components/nav-link/index.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +2 -2
- package/dist/components/nav-link/nav-link.d.ts +12 -0
- package/dist/components/nav-link/nav-link.d.ts.map +1 -1
- package/dist/components/nav-link/navigation.d.ts +3 -1
- package/dist/components/nav-link/navigation.d.ts.map +1 -1
- package/dist/components/nav-link/tanstack.js +2 -2
- package/dist/components/notification/create-notifier.d.ts +12 -1
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.d.ts +2 -2
- package/dist/components/notification/index.d.ts.map +1 -1
- package/dist/components/notification/index.js +9 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +14 -1
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/number-input/index.d.ts +1 -1
- package/dist/components/number-input/index.d.ts.map +1 -1
- package/dist/components/number-input/index.js +4 -4
- package/dist/components/number-input/number-input.d.ts +20 -2
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/index.js +6 -6
- package/dist/components/password-input/index.d.ts +1 -1
- package/dist/components/password-input/index.d.ts.map +1 -1
- package/dist/components/password-input/index.js +68 -7
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +45 -6
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/pill/index.js +2 -2
- package/dist/components/pills-input/index.js +5 -5
- package/dist/components/pin-input/index.js +2 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.d.ts +0 -10
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.js.map +1 -1
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/radio-group/index.js +3 -3
- package/dist/components/rating/index.js +2 -2
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.js +60 -48
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/schedule/now-cursor-line.d.ts +10 -5
- package/dist/components/schedule/now-cursor-line.d.ts.map +1 -1
- package/dist/components/schedule/schedule-dates.d.ts +11 -26
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-chip.d.ts +4 -1
- package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-details.d.ts +3 -2
- package/dist/components/schedule/schedule-event-details.d.ts.map +1 -1
- package/dist/components/schedule/schedule-geometry.d.ts +20 -21
- package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
- package/dist/components/schedule/schedule-grid-gesture.d.ts +5 -9
- package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
- package/dist/components/schedule/schedule-segments.d.ts +2 -3
- package/dist/components/schedule/schedule-segments.d.ts.map +1 -1
- package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
- package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
- package/dist/components/segment-group/index.js +4 -3
- package/dist/components/segment-group/segment-group.d.ts +3 -2
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +6 -4
- package/dist/components/select/select.d.ts +12 -2
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/switch/index.js +2 -2
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +4 -3
- package/dist/components/tabs/tabs.d.ts +3 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tags-input/index.d.ts +1 -1
- package/dist/components/tags-input/index.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +9 -7
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +9 -2
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/theme-icon/index.js +2 -2
- package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
- package/dist/components/time-input/index.js +24 -8
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/time-input/time-input.d.ts.map +1 -1
- package/dist/components/time-input/time-row.d.ts +16 -3
- package/dist/components/time-input/time-row.d.ts.map +1 -1
- package/dist/components/timeline/index.js +11 -3
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/tree-multi-select/index.d.ts +1 -1
- package/dist/components/tree-multi-select/index.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.js +62 -44
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +10 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.d.ts +1 -1
- package/dist/components/tree-select/index.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +45 -15
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +10 -1
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/date-value.d.ts +14 -1
- package/dist/lib/date-value.d.ts.map +1 -1
- package/dist/lib/focus-styles.d.ts +13 -5
- package/dist/lib/focus-styles.d.ts.map +1 -1
- package/dist/theme.css +24 -2
- package/package.json +1 -1
- package/src/colors.css +15 -10
- package/src/components/autocomplete/autocomplete.test.tsx +32 -0
- package/src/components/autocomplete/autocomplete.tsx +17 -5
- package/src/components/autocomplete/index.ts +5 -1
- package/src/components/button/button.test.tsx +6 -0
- package/src/components/calendar/calendar-zone-sync.tsx +79 -0
- package/src/components/calendar/calendar.test.tsx +134 -14
- package/src/components/calendar/calendar.tsx +36 -22
- package/src/components/chart/chart.test.tsx +115 -8
- package/src/components/chart/chart.tsx +115 -25
- package/src/components/chart/styles.css +100 -0
- package/src/components/choice-card-group/index.ts +2 -0
- package/src/components/circular-progress/circular-progress.tsx +2 -0
- package/src/components/clipboard/clipboard.test.tsx +54 -22
- package/src/components/clipboard/clipboard.tsx +2 -0
- package/src/components/clipboard/copy.tsx +2 -0
- package/src/components/clipboard/index.ts +3 -3
- package/src/components/combobox/combobox.test.tsx +22 -0
- package/src/components/combobox/combobox.tsx +20 -0
- package/src/components/combobox/index.ts +1 -0
- package/src/components/combobox-list/combobox-list.test.tsx +19 -0
- package/src/components/combobox-list/combobox-list.tsx +16 -2
- package/src/components/combobox-list/index.ts +5 -1
- package/src/components/data-table/data-table-filter/data-table-date-filter.tsx +5 -4
- package/src/components/data-table/data-table-filter/data-table-number-filter.tsx +16 -2
- package/src/components/data-table/data-table-filter/data-table-select-filter.tsx +9 -1
- package/src/components/data-table/data-table-filter/index.tsx +15 -1
- package/src/components/data-table/data-table-filter.test.tsx +33 -0
- package/src/components/data-table/data-table-header-cell.tsx +37 -22
- package/src/components/data-table/data-table-meta.ts +2 -2
- package/src/components/data-table/data-table-pagination.tsx +6 -0
- package/src/components/data-table/data-table-stack.tsx +26 -14
- package/src/components/data-table/data-table-toolbar.tsx +4 -1
- package/src/components/data-table/data-table-translations.ts +105 -0
- package/src/components/data-table/data-table.test.tsx +121 -0
- package/src/components/data-table/data-table.tsx +37 -17
- package/src/components/data-table/index.ts +9 -1
- package/src/components/date-picker/date-picker.test.tsx +197 -5
- package/src/components/date-picker/date-picker.tsx +42 -16
- package/src/components/drawer/drawer.tsx +14 -1
- package/src/components/drawer/index.ts +1 -0
- package/src/components/field/field.tsx +29 -3
- package/src/components/file-upload/file-upload.test.tsx +21 -0
- package/src/components/file-upload/file-upload.tsx +26 -3
- package/src/components/file-upload/index.ts +1 -1
- package/src/components/modal/index.ts +1 -0
- package/src/components/modal/modal-translations.test.tsx +27 -0
- package/src/components/modal/modal.tsx +14 -1
- package/src/components/multi-combobox-list/index.ts +5 -1
- package/src/components/multi-combobox-list/multi-combobox-list.test.tsx +19 -0
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +26 -4
- package/src/components/multi-select/index.ts +1 -1
- package/src/components/multi-select/multi-select.test.tsx +38 -0
- package/src/components/multi-select/multi-select.tsx +28 -4
- package/src/components/nav-link/index.ts +6 -1
- package/src/components/nav-link/nav-link.test.tsx +16 -0
- package/src/components/nav-link/nav-link.tsx +19 -1
- package/src/components/nav-link/navigation.test.tsx +18 -0
- package/src/components/nav-link/navigation.tsx +8 -4
- package/src/components/notification/create-notifier.tsx +20 -4
- package/src/components/notification/index.ts +7 -1
- package/src/components/notification/notification.test.tsx +49 -0
- package/src/components/notification/notification.tsx +39 -5
- package/src/components/number-input/index.ts +1 -1
- package/src/components/number-input/number-input.test.tsx +37 -0
- package/src/components/number-input/number-input.tsx +33 -4
- package/src/components/password-input/index.ts +5 -1
- package/src/components/password-input/password-input.test.tsx +201 -4
- package/src/components/password-input/password-input.tsx +162 -13
- package/src/components/popover/popover.tsx +0 -29
- package/src/components/progress/index.ts +3 -3
- package/src/components/progress/progress.tsx +2 -0
- package/src/components/rating/rating.tsx +2 -0
- package/src/components/schedule/now-cursor-line.test.tsx +56 -28
- package/src/components/schedule/now-cursor-line.tsx +30 -16
- package/src/components/schedule/schedule-agenda-view.test.tsx +1 -1
- package/src/components/schedule/schedule-dates.test.ts +19 -0
- package/src/components/schedule/schedule-dates.ts +16 -30
- package/src/components/schedule/schedule-details-popover.test.tsx +77 -6
- package/src/components/schedule/schedule-event-chip.tsx +17 -6
- package/src/components/schedule/schedule-event-details.test.tsx +38 -0
- package/src/components/schedule/schedule-event-details.tsx +7 -5
- package/src/components/schedule/schedule-geometry.test.ts +21 -18
- package/src/components/schedule/schedule-geometry.ts +37 -24
- package/src/components/schedule/schedule-grid-gesture.ts +5 -9
- package/src/components/schedule/schedule-segments.ts +2 -3
- package/src/components/schedule/schedule-timed-grid.tsx +43 -20
- package/src/components/schedule/schedule.test.tsx +34 -11
- package/src/components/schedule/use-event-resize.ts +6 -13
- package/src/components/segment-group/segment-group.test.tsx +23 -0
- package/src/components/segment-group/segment-group.tsx +13 -7
- package/src/components/select/index.ts +1 -1
- package/src/components/select/select.test.tsx +32 -0
- package/src/components/select/select.tsx +15 -1
- package/src/components/spinner/spinner.test.tsx +26 -0
- package/src/components/spinner/spinner.tsx +4 -1
- package/src/components/table/table.test.tsx +13 -0
- package/src/components/table/table.tsx +9 -5
- package/src/components/tabs/tabs.test.tsx +11 -0
- package/src/components/tabs/tabs.tsx +6 -4
- package/src/components/tags-input/index.ts +1 -1
- package/src/components/tags-input/tags-input.test.tsx +28 -0
- package/src/components/tags-input/tags-input.tsx +17 -1
- package/src/components/theme-icon/theme-icon.tsx +8 -3
- package/src/components/time-input/time-input.test.tsx +75 -0
- package/src/components/time-input/time-input.tsx +27 -3
- package/src/components/time-input/time-row.tsx +27 -3
- package/src/components/timeline/timeline.test.tsx +4 -1
- package/src/components/timeline/timeline.tsx +11 -3
- package/src/components/tree-multi-select/index.ts +5 -1
- package/src/components/tree-multi-select/tree-multi-select.test.tsx +72 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +156 -115
- package/src/components/tree-select/index.ts +1 -1
- package/src/components/tree-select/tree-select.test.tsx +69 -0
- package/src/components/tree-select/tree-select.tsx +128 -74
- package/src/lib/date-value.test.ts +19 -0
- package/src/lib/date-value.ts +21 -5
- package/src/lib/focus-styles.test.ts +21 -2
- package/src/lib/focus-styles.ts +24 -5
- package/src/theme.css +24 -2
- package/src/use-client-barrels.test.ts +80 -0
- package/dist/chunk-5JHDSVEZ.js.map +0 -1
- package/dist/chunk-6GDMSENK.js.map +0 -1
- package/dist/chunk-6OLTJYSX.js.map +0 -1
- package/dist/chunk-7NZSTCJO.js.map +0 -1
- package/dist/chunk-B2LCHXUB.js.map +0 -1
- package/dist/chunk-B2YJKRNQ.js.map +0 -1
- package/dist/chunk-EBREIC3L.js.map +0 -1
- package/dist/chunk-FHG54IT5.js.map +0 -1
- package/dist/chunk-FZIHZT5R.js.map +0 -1
- package/dist/chunk-HT5JAHR3.js.map +0 -1
- package/dist/chunk-KHMFNH3X.js.map +0 -1
- package/dist/chunk-NSDM3FEB.js.map +0 -1
- package/dist/chunk-O23Y5ML4.js.map +0 -1
- package/dist/chunk-PH354ECN.js.map +0 -1
- package/dist/chunk-RQL7FVCS.js.map +0 -1
- package/dist/chunk-TCWYBVIL.js.map +0 -1
- package/dist/chunk-UHNRAI6V.js.map +0 -1
- package/dist/chunk-WHKKN3ZK.js.map +0 -1
- package/dist/chunk-WQN64ZHG.js.map +0 -1
- package/dist/chunk-YBJB7FGE.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-select.d.ts","sourceRoot":"","sources":["../../../src/components/tree-select/tree-select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tree-select.d.ts","sourceRoot":"","sources":["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AAA;AAEH,gGAAgG;AAChG,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,GAAG;IACrF,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAkCD,eAAO,MAAM,UAAU,GAAI,KAAK,CAAC,IAAI,SAAS,cAAc,GAAG,YAAY,EAAE,+TA+B1E,eAAe,CAAC,IAAI,CAAC,gCA4bvB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_THEME_STORAGE_KEY, resolveTheme, applyThemeAttribute, getSystemTheme, isThemeMode, disableTransitionsDuringChange } from './chunk-EEMRRRYS.js';
|
|
2
2
|
export { DEFAULT_THEME_STORAGE_KEY, THEME_MODES, buildThemeInitScript, getSystemTheme, isThemeMode, resolveTheme } from './chunk-EEMRRRYS.js';
|
|
3
|
-
export { DEFAULT_LOCALE, DEFAULT_TIME_ZONE, IntlProvider, useLocale, useTimeZone } from './chunk-
|
|
3
|
+
export { DEFAULT_LOCALE, DEFAULT_TIME_ZONE, IntlProvider, useLocale, useTimeZone } from './chunk-57BTVRRB.js';
|
|
4
|
+
import './chunk-OC7I2CTA.js';
|
|
4
5
|
export { COLORS } from './chunk-VIYVN4WF.js';
|
|
5
6
|
export { useContainerQuery } from './chunk-P3XMBETI.js';
|
|
6
7
|
export { LinkComponentProvider, useLinkComponent } from './chunk-GTKKRV5N.js';
|
|
@@ -8,7 +9,7 @@ import { useIsomorphicLayoutEffect } from './chunk-BUIHQJGE.js';
|
|
|
8
9
|
export { useIsomorphicLayoutEffect } from './chunk-BUIHQJGE.js';
|
|
9
10
|
export { HEADING_SIZE_ALIASES, TYPOGRAPHY_SIZE_CLASSES } from './chunk-2GILNBZW.js';
|
|
10
11
|
export { useUncontrolled } from './chunk-BEL75C7N.js';
|
|
11
|
-
export { focusStyles } from './chunk-
|
|
12
|
+
export { focusStyles } from './chunk-INJUILCN.js';
|
|
12
13
|
export { cn } from './chunk-QP4I37PA.js';
|
|
13
14
|
import { useState, useRef, useCallback, useSyncExternalStore, useMemo, useEffect } from 'react';
|
|
14
15
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/sizes.ts","../src/lib/use-disclosure.ts","../src/lib/use-local-storage.ts","../src/lib/use-logger.ts","../src/lib/use-media-query.ts","../src/lib/use-theme.ts"],"names":["useRef","useCallback","subscribe","getServerSnapshot","useSyncExternalStore","useState","useEffect"],"mappings":";;;;;;;;;;;;;;;AAiBO,IAAM,QAAQ,CAAC,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,MAAM,IAAI;ACgB3C,SAAS,aAAA,CACd,cAAc,KAAA,EACd,EAAE,QAAQ,OAAA,EAAQ,GAA4B,EAAC,EACrB;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,WAAW,CAAA;AAK5C,EAAA,MAAM,OAAA,GAAU,OAAO,WAAW,CAAA;AAClC,EAAA,OAAA,CAAQ,OAAA,GAAU,IAAA;AAElB,EAAA,MAAM,WAAA,GAAc,YAAY,MAAM;AACpC,IAAA,IAAI,CAAC,QAAQ,OAAA,EAAS;AACpB,MAAA,OAAA,CAAQ,OAAA,GAAU,IAAA;AAClB,MAAA,MAAA,IAAS;AAAA,IACX;AACA,IAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,EACd,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAA,MAAM,YAAA,GAAe,YAAY,MAAM;AACrC,IAAA,IAAI,QAAQ,OAAA,EAAS;AACnB,MAAA,OAAA,CAAQ,OAAA,GAAU,KAAA;AAClB,MAAA,OAAA,IAAU;AAAA,IACZ;AACA,IAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,EACf,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,aAAA,GAAgB,YAAY,MAAM;AACtC,IAAA,MAAM,IA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,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AAAA,EACzD,GAAG,CAAC,IAAA,EAAM,YAAA,EAAc,eAAA,EAAiB,gBAAgB,CAAC,CAAA;AAO1D,EAAAA,UAAU,MAAM;AACd,IAAA,IAAI,gBAAA,EAAkB;AACtB,IAAA,MAAM,UAAU,MAAM;AACpB,MAAA,IAAI,QAAA,CAAS,oBAAoB,SAAA,EAAW;AAC1C,QAAA,iBAAA,CAAkB,YAAA,CAAa,IAAI,CAAA,EAAG,SAAA,EAAW,eAAe,CAAA;AAAA,MAClE;AAAA,IACF,CAAA;AACA,IAAA,MAAA,CAAO,gBAAA,CAAiB,oBAAoB,OAAO,CAAA;AACnD,IAAA,MAAA,CAAO,gBAAA,CAAiB,SAAS,OAAO,CAAA;AACxC,IAAA,OAAO,MAAM;AACX,MAAA,MAAA,CAAO,mBAAA,CAAoB,oBAAoB,OAAO,CAAA;AACtD,MAAA,MAAA,CAAO,mBAAA,CAAoB,SAAS,OAAO,CAAA;AAAA,IAC7C,CAAA;AAAA,EACF,GAAG,CAAC,IAAA,EAAM,YAAA,EAAc,eAAA,EAAiB,gBAAgB,CAAC,CAAA;AAM1D,EAAAA,UAAU,MAAM;AACd,IAAA,IAAI,gBAAA,EAAkB,mBAAA,CAAoB,gBAAA,EAAkB,SAAS,CAAA;AAAA,EACvE,CAAA,EAAG,CAAC,gBAAA,EAAkB,YAAY,CAAC,CAAA;AAEnC,EAAA,OAAO,EAAE,IAAA,EAAM,aAAA,EAAe,OAAA,EAAQ;AACxC","file":"index.js","sourcesContent":["/**\n * Single source of truth for the `size` prop accepted by sized components\n * (Button, Badge, ActionIcon, Spinner, Slider, Container, Text, Title, …).\n * The const array drives both the type and any runtime iteration (story\n * controls, docs sliders).\n *\n * Listed from smallest to largest — the base tier the playground's size\n * slider sorts against (see `SizeSlider`'s `CANONICAL_ORDER`, which layers\n * further known tiers — Text/Title's `2xl..4xl`, the heading aliases — on\n * top of this array). Strict by design: unlike `Color`, size has no\n * CSS-token escape hatch (no `data-size` slot vars), so widening to\n * `(string & {})` would only let callers slip in values the cva mappings\n * can't honor. Components that need extra tokens (Text/Title's shared\n * `xs..4xl` scale in `lib/typography-size.ts`, Container's `full`) declare\n * them via their own cva variants and export their own widened type —\n * outside this canonical scale.\n */\nexport const SIZES = [\"xs\", \"sm\", \"md\", \"lg\", \"xl\"] as const\n\nexport type Size = (typeof SIZES)[number]\n","import { useCallback, useRef, useState } from \"react\"\n\nexport interface UseDisclosureCallbacks {\n /** Called after the state changes to `true`. */\n onOpen?: () => void\n /** Called after the state changes to `false`. */\n onClose?: () => void\n}\n\nexport interface UseDisclosureHandlers {\n /** Sets the state to `true`. */\n open: () => void\n /** Sets the state to `false`. */\n close: () => void\n /** Flips the state. */\n toggle: () => void\n}\n\nexport type UseDisclosureReturnValue = [boolean, UseDisclosureHandlers]\n\n/**\n * Tracks an open/closed boolean with `open`/`close`/`toggle` handlers —\n * uncontrolled only, no `value` prop. Reach for this when wiring a custom\n * trigger's `aria-expanded`/`aria-controls` onto `Collapse` (or any other\n * boolean-driven UI) without pulling in a whole disclosure component.\n *\n * @example\n * const [opened, { toggle }] = useDisclosure()\n * <button aria-expanded={opened} aria-controls=\"details\" onClick={toggle}>\n * Show more\n * </button>\n * <Collapse id=\"details\" open={opened}>...</Collapse>\n */\nexport function useDisclosure(\n initialOpen = false,\n { onOpen, onClose }: UseDisclosureCallbacks = {},\n): UseDisclosureReturnValue {\n const [open, setOpen] = useState(initialOpen)\n // Mirrors `open` outside of React's state timing, so the transition check\n // and the onOpen/onClose call can happen directly in the handler body\n // instead of inside the setState updater — StrictMode's dev-mode\n // double-invoke of functional updaters would otherwise double-fire them.\n const openRef = useRef(initialOpen)\n openRef.current = open\n\n const openHandler = useCallback(() => {\n if (!openRef.current) {\n openRef.current = true\n onOpen?.()\n }\n setOpen(true)\n }, [onOpen])\n\n const closeHandler = useCallback(() => {\n if (openRef.current) {\n openRef.current = false\n onClose?.()\n }\n setOpen(false)\n }, [onClose])\n\n const toggleHandler = useCallback(() => {\n const next = !openRef.current\n openRef.current = next\n if (next) onOpen?.()\n else onClose?.()\n setOpen(next)\n }, [onOpen, onClose])\n\n return [open, { open: openHandler, close: closeHandler, toggle: toggleHandler }]\n}\n\nexport namespace useDisclosure {\n export type Callbacks = UseDisclosureCallbacks\n export type Handlers = UseDisclosureHandlers\n export type ReturnValue = UseDisclosureReturnValue\n}\n","\"use client\"\n\nimport { useCallback, useMemo, useRef, useSyncExternalStore } from \"react\"\n\n// Module-level (not per-hook-instance) so every useLocalStorage({ key }) call\n// anywhere in this tab shares one listener set per key — a same-tab write\n// notifies every other instance directly, no CustomEvent needed (contrast\n// with a naive per-instance `useState`, which has no shared registry to call\n// into directly and so needs one to fake same-tab sync).\nconst listeners = new Map<string, Set<() => void>>()\n// Per-key override for when a write couldn't reach localStorage (quota\n// exceeded, Safari private browsing — which throws on every write, etc.).\n// Without this, a failed write would leave every instance on that key unable\n// to reflect the change at all, since their snapshot otherwise comes only\n// from reading storage back. Cleared as soon as a write to that key succeeds\n// (localStorage becomes authoritative again), and once the last listener for\n// a key unsubscribes (nothing left observing it — the next mount starts\n// fresh against real storage instead of a possibly stale in-memory value).\nconst memoryFallback = new Map<string, string>()\nlet totalSubscribers = 0\n\nfunction notify(key: string) {\n for (const listener of listeners.get(key) ?? []) listener()\n}\n\nfunction handleStorageEvent(event: StorageEvent) {\n // `key === null` means the whole storage area was cleared — treat that as\n // every tracked key changing.\n if (event.key === null) {\n for (const key of listeners.keys()) notify(key)\n } else {\n notify(event.key)\n }\n}\n\nfunction subscribe(key: string, listener: () => void) {\n let set = listeners.get(key)\n if (!set) {\n set = new Set()\n listeners.set(key, set)\n }\n set.add(listener)\n // Cross-tab only — this tab's own writes are covered by the direct `notify`\n // call in setValue/removeValue below; the native `storage` event never\n // fires in the document that made the change. Ref-counted so N components\n // sharing a key install exactly one listener, not N.\n if (totalSubscribers++ === 0) window.addEventListener(\"storage\", handleStorageEvent)\n\n return () => {\n set?.delete(listener)\n if (set?.size === 0) {\n listeners.delete(key)\n memoryFallback.delete(key)\n }\n if (--totalSubscribers === 0) window.removeEventListener(\"storage\", handleStorageEvent)\n }\n}\n\nfunction readStorage(key: string): string | null {\n const fallback = memoryFallback.get(key)\n if (fallback !== undefined) return fallback\n try {\n return localStorage.getItem(key)\n } catch {\n return null // private mode / storage disabled — behave as unset\n }\n}\n\nfunction writeStorage(key: string, serialized: string) {\n try {\n localStorage.setItem(key, serialized)\n memoryFallback.delete(key)\n } catch {\n // Quota exceeded or storage unavailable — keep this value in memory so\n // the UI still reflects it for the rest of the session, even though it\n // won't survive a reload (persistence is best-effort).\n memoryFallback.set(key, serialized)\n }\n notify(key)\n}\n\nfunction removeStorage(key: string) {\n memoryFallback.delete(key)\n try {\n localStorage.removeItem(key)\n } catch {\n // Storage unavailable — nothing to remove.\n }\n notify(key)\n}\n\n// Stable across every call: the value seen during SSR and during the client's\n// hydration pass — never the real stored value, so the first render always\n// matches between server and client.\nfunction getServerSnapshot(): string | null {\n return null\n}\n\nexport interface UseLocalStorageOptions<T> {\n /** The `localStorage` key backing this value. Every hook instance — this\n * tab or another — sharing this key reads/writes the same value and stays\n * in sync with it. */\n key: string\n /** Returned before the real stored value is read, whenever nothing is\n * stored, or the stored value fails to deserialize. Captured once on\n * mount, like a lazy `useState` initializer — a fresh object/array\n * literal passed on a later render is ignored, so callers can pass\n * `defaultValue={{}}` inline without creating an unstable reference every\n * render. */\n defaultValue: T\n /** @default JSON.stringify */\n serialize?: (value: T) => string\n /** @default JSON.parse */\n deserialize?: (raw: string) => T\n}\n\nexport type UseLocalStorageReturnValue<T> = [\n T,\n /** Accepts a value or an updater resolved against the current value — the\n * same shape react-table's own `OnChangeFn<T>` and this kit's\n * `useUncontrolled` setter use, so it wires into e.g. `DataTable`'s\n * `onColumnSizingChange` directly, no wrapper needed. */\n (value: T | ((previous: T) => T)) => void,\n /** Deletes the key; every instance on this key falls back to\n * `defaultValue` until something is stored again. */\n () => void,\n]\n\n/**\n * Persists a piece of state to `localStorage`, kept in sync across every\n * component using the same `key` — both within this tab (a write in one\n * instance is reflected in every other instance immediately) and across tabs\n * (via the native `storage` event). SSR-safe: `useSyncExternalStore`'s\n * `getServerSnapshot` guarantees the server-rendered and first-client-render\n * markup agree (always `defaultValue`), so there's no hydration mismatch to\n * guard against.\n *\n * const [columnSizing, setColumnSizing] = useLocalStorage({\n * key: \"users-table\",\n * defaultValue: {},\n * })\n * <DataTable columnSizing={columnSizing} onColumnSizingChange={setColumnSizing} />\n */\nexport function useLocalStorage<T>({\n key,\n defaultValue,\n serialize = JSON.stringify,\n deserialize = JSON.parse,\n}: UseLocalStorageOptions<T>): UseLocalStorageReturnValue<T> {\n const defaultValueRef = useRef(defaultValue)\n\n const subscribeToKey = useCallback((listener: () => void) => subscribe(key, listener), [key])\n const getSnapshot = useCallback(() => readStorage(key), [key])\n const raw = useSyncExternalStore(subscribeToKey, getSnapshot, getServerSnapshot)\n\n const value = useMemo(() => {\n if (raw === null) return defaultValueRef.current\n try {\n return deserialize(raw)\n } catch {\n return defaultValueRef.current // corrupted value — keep the default\n }\n }, [raw, deserialize])\n\n const setValue = useCallback(\n (next: T | ((previous: T) => T)) => {\n const resolved = typeof next === \"function\" ? (next as (previous: T) => T)(value) : next\n writeStorage(key, serialize(resolved))\n },\n [key, serialize, value],\n )\n\n const removeValue = useCallback(() => {\n removeStorage(key)\n }, [key])\n\n return [value, setValue, removeValue]\n}\n","\"use client\"\n\n/**\n * Development helper that logs a component's lifecycle to the console:\n *\n * - `<name> mounted` with the given values, once on mount\n * - `<name> updated` with the given values, on every change of `props`\n * - `<name> unmounted` on cleanup\n *\n * Note that `props` is compared by the effect dependency array, so pass the values themselves\n * (`useLogger(\"Demo\", [count, open])`), not a fresh object literal.\n */\n\nimport { useEffect, useRef } from \"react\"\n\nexport function useLogger(componentName: string, props: unknown[]): null {\n const mounted = useRef(false)\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: We only want to log on mount/unmount\n useEffect(() => {\n console.log(`${componentName} mounted`, ...props)\n return () => {\n mounted.current = false\n console.log(`${componentName} unmounted`)\n }\n }, [])\n\n // Skip the initial render, then log updates.\n useEffect(() => {\n if (mounted.current) {\n console.log(`${componentName} updated`, ...props)\n } else {\n mounted.current = true\n }\n // biome-ignore lint/correctness/useExhaustiveDependencies: We only want to log props updates\n }, props)\n\n return null\n}\n","\"use client\"\n\nimport { useCallback, useSyncExternalStore } from \"react\"\n\nfunction subscribe(query: string, listener: () => void): () => void {\n const mediaQueryList = window.matchMedia(query)\n mediaQueryList.addEventListener(\"change\", listener)\n return () => mediaQueryList.removeEventListener(\"change\", listener)\n}\n\n// Stable across every call: SSR and the first client render must agree, same\n// reasoning as useLocalStorage's getServerSnapshot — a server can't know the\n// visitor's viewport, so `false` is the only value that can't mismatch.\nfunction getServerSnapshot(): boolean {\n return false\n}\n\n/**\n * Tracks whether a media query currently matches, updating live as the\n * viewport (or whichever media feature) changes. SSR-safe via\n * `useSyncExternalStore`, mirroring `useLocalStorage`'s use of the same hook\n * for the same reason: the hydration snapshot is fixed (`false`) so server\n * and first-client-render markup always agree.\n *\n * const isMobile = useMediaQuery(\"(width < 768px)\")\n */\nexport function useMediaQuery(query: string): boolean {\n const subscribeToQuery = useCallback(\n (listener: () => void) => subscribe(query, listener),\n [query],\n )\n const getSnapshot = useCallback(() => window.matchMedia(query).matches, [query])\n\n return useSyncExternalStore(subscribeToQuery, getSnapshot, getServerSnapshot)\n}\n","\"use client\"\n\nimport { useCallback, useEffect, useState } from \"react\"\nimport {\n applyThemeAttribute,\n DEFAULT_THEME_STORAGE_KEY,\n disableTransitionsDuringChange,\n getSystemTheme,\n isThemeMode,\n type ResolvedTheme,\n resolveTheme,\n type ThemeAttribute,\n type ThemeMode,\n} from \"./theme\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-layout-effect\"\nimport { useLocalStorage } from \"./use-local-storage\"\n\n// Shared by every DOM-writing call site below (setMode, the system-preference\n// listener, the focus/visibility reapply) so `keepTransitions` suppresses\n// transitions around all of them uniformly, not just clicks.\nfunction applyThemeGuarded(\n theme: ResolvedTheme,\n attribute: ThemeAttribute | ThemeAttribute[],\n keepTransitions: boolean,\n): void {\n const restore = keepTransitions ? null : disableTransitionsDuringChange()\n applyThemeAttribute(theme, attribute)\n restore?.()\n}\n\n// Module-level, ref-counted MutationObserver — same shared-subscription idiom\n// as use-local-storage.ts's `listeners` map, just watching <html>'s\n// data-theme/class attributes instead of a storage key. There's only ever\n// one <html>, so a single observer instance (not one per key) is enough.\n// Watches both attributes unconditionally regardless of any one hook\n// instance's configured `attribute` — cheap, and keeps this correct even if\n// two `useTheme()` calls in the same app somehow used different configs\n// (each instance's own `getResolvedThemeSnapshot` call still reads whichever\n// one *it* was configured for).\nconst resolvedThemeListeners = new Set<() => void>()\nlet observer: MutationObserver | null = null\n\nfunction notifyResolvedTheme() {\n for (const listener of resolvedThemeListeners) listener()\n}\n\nfunction subscribeResolvedTheme(listener: () => void): () => void {\n resolvedThemeListeners.add(listener)\n if (resolvedThemeListeners.size === 1 && typeof MutationObserver !== \"undefined\") {\n observer = new MutationObserver(notifyResolvedTheme)\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-theme\", \"class\"],\n })\n }\n return () => {\n resolvedThemeListeners.delete(listener)\n if (resolvedThemeListeners.size === 0) {\n observer?.disconnect()\n observer = null\n }\n }\n}\n\n// Reads the DOM directly rather than deriving from `mode` — see useTheme's\n// doc comment for why a derived write/read here would reintroduce a flash.\n// `data-theme` wins when both are configured (it's the kit's actual\n// contract); `class` is only consulted when `data-theme` isn't configured\n// at all, so `resolvedTheme` still updates correctly in that case.\nfunction getResolvedThemeSnapshot(attribute: ThemeAttribute | ThemeAttribute[]): ResolvedTheme {\n if (typeof document === \"undefined\") return \"light\"\n const attrs = Array.isArray(attribute) ? attribute : [attribute]\n const root = document.documentElement\n if (attrs.includes(\"data-theme\"))\n return root.getAttribute(\"data-theme\") === \"dark\" ? \"dark\" : \"light\"\n return root.classList.contains(\"dark\") ? \"dark\" : \"light\"\n}\n\n// Fixed, matching theme.css's \"no data-theme == light\" contract — SSR and\n// the first client render must agree, exactly like getSystemTheme()'s SSR branch.\nfunction getResolvedThemeServerSnapshot(): ResolvedTheme {\n return \"light\"\n}\n\n// Module-level (not inline in the hook) so it's a stable reference across\n// renders — see UseLocalStorageOptions.deserialize. Throwing on an invalid\n// value makes useLocalStorage fall back to defaultColorScheme.\nfunction deserializeThemeMode(raw: string): ThemeMode {\n const parsed = JSON.parse(raw)\n if (!isThemeMode(parsed)) throw new Error(`invalid stored theme mode: ${raw}`)\n return parsed\n}\n\nexport interface UseThemeOptions {\n /** @default DEFAULT_THEME_STORAGE_KEY — must match whatever key was passed\n * to `<ThemeScript storageKey>` / the pasted init script. */\n storageKey?: string\n /** Fallback used when nothing is stored yet.\n * @default \"system\" */\n defaultColorScheme?: ThemeMode\n /** Pins `mode`/`resolvedTheme` to a fixed value and makes `setMode` a\n * no-op — no storage write, no DOM write. Must also be passed to\n * `<ThemeScript forceColorScheme>` / the pasted init script, or the\n * pre-hydration script and this hook will disagree on first load. */\n forceColorScheme?: ResolvedTheme\n /** @default false — mirrors Mantine's option of the same name (flipped\n * from next-themes' `disableTransitionOnChange`: here, suppression is\n * the default). Transitions are suppressed for one frame around every\n * applied theme change (`setMode`, the live system-preference listener,\n * and the focus/visibility reapply) unless this is `true`. */\n keepTransitions?: boolean\n /** Which DOM mechanism(s) to keep in sync — `\"data-theme\"` is the kit's\n * own contract (`theme.css`'s `@custom-variant dark`); add `\"class\"` for\n * consumers whose *other* CSS reads a literal `.dark` class instead\n * (mirrors next-themes' `attribute` option). Must match whatever\n * `attribute` was passed to `<ThemeScript>` / the pasted init script, or\n * the pre-hydration script and this hook will disagree on first load.\n * @default \"data-theme\" */\n attribute?: ThemeAttribute | ThemeAttribute[]\n}\n\nexport interface UseThemeReturnValue {\n /** The user's explicit, persisted choice — \"system\" included as a real value. */\n mode: ThemeMode\n /** The live, applied light/dark value — \"system\" already resolved. Read\n * this to swap an icon; CSS never needs it directly (the kit's `dark:`\n * utilities key off the `data-theme` attribute this mirrors). */\n resolvedTheme: ResolvedTheme\n /** Persists `mode` (synced cross-tab/same-tab via `useLocalStorage`) AND\n * synchronously applies the DOM attribute this-tab in the same call.\n * Accepts a value or an updater resolved against the current `mode`\n * (`setMode((prev) => ...)`), same shape as `useState`'s setter. A\n * no-op while `forceColorScheme` is set — the updater isn't called. */\n setMode: (mode: ThemeMode | ((prev: ThemeMode) => ThemeMode)) => void\n}\n\n/**\n * Manages a persisted `\"light\" | \"dark\" | \"system\"` choice and keeps\n * `data-theme` on `<html>` in sync with it. Pair with `ThemeScript` (Next.js)\n * or a manually-pasted init script (Vite) to avoid a flash of the wrong\n * theme on first load — see the package README.\n *\n * Read `resolvedTheme` for *logic* (e.g. deciding what a click switches to);\n * don't render it directly. A server can't know the visitor's real\n * preference, so anything rendered from `resolvedTheme` is necessarily\n * wrong in the raw server-rendered HTML — before any JS/hydration runs at\n * all — no matter how quickly the hook itself corrects afterward. Derive\n * the *visible* state from CSS keyed off `data-theme` instead (the kit's\n * own `dark:` variant already matches it — see `theme.css`'s\n * `@custom-variant dark`), so the browser paints it correctly from the\n * very first frame, same as the rest of the page:\n *\n * const { resolvedTheme, setMode } = useTheme()\n * const next = resolvedTheme === \"dark\" ? \"light\" : \"dark\"\n * <button onClick={() => setMode(next)}>\n * <SunIcon className=\"dark:hidden\" />\n * <MoonIcon className=\"hidden dark:block\" />\n * </button>\n *\n * Deliberately does NOT run `applyThemeAttribute(resolveTheme(storedMode))`\n * in a plain effect keyed on the stored mode. During SSR and the first\n * client render, `useLocalStorage`'s `getServerSnapshot` always returns\n * `null`, forcing the stored mode to `defaultColorScheme` regardless of\n * what's actually stored — an effect deriving a DOM write from that stale\n * value could overwrite a `data-theme` an init script already set correctly.\n * `resolvedTheme` reads the DOM instead, so React only ever *reads* what (a)\n * the blocking script, (b) `setMode`, or (c) the system-preference listener\n * below already wrote.\n *\n * `resolvedTheme` is corrected via `useIsomorphicLayoutEffect`, not\n * `useSyncExternalStore`. React's own docs don't specify that\n * `useSyncExternalStore`'s hydration-snapshot correction happens before the\n * browser paints, and empirically it isn't reliably so — the fallback\n * `getResolvedThemeServerSnapshot()` value (\"light\") could get painted for a\n * frame before the real DOM-read value replaced it, a real visible flash.\n * `useLayoutEffect`'s \"flushes before paint\" guarantee is explicit, so the\n * correction is forced there instead — still a pure DOM *read*, same\n * safety property as above, just guaranteed pre-paint. Vitest/jsdom's\n * `act()` can't distinguish these two timings (it flushes every effect\n * synchronously regardless of kind), so a green test run alone doesn't\n * prove no flash — this specific class of bug only shows up in a real\n * browser.\n *\n * `forceColorScheme`, when set, is a constant argument (not derived from\n * `useLocalStorage`'s SSR-diverging state) — identical on server and\n * client, so applying it directly in an effect is safe and doesn't\n * reintroduce the flash bug above.\n *\n * `setMode` also accepts a `useState`-style updater resolved against the\n * current `mode` (e.g. a 3-way cycle: `setMode((m) => NEXT[m])`) — resolved\n * once, synchronously, against `mode` at call time, not queued/batched the\n * way React's own `setState` updater can be.\n */\nexport function useTheme(options: UseThemeOptions = {}): UseThemeReturnValue {\n const storageKey = options.storageKey ?? DEFAULT_THEME_STORAGE_KEY\n const defaultColorScheme = options.defaultColorScheme ?? \"system\"\n const keepTransitions = options.keepTransitions ?? false\n const forceColorScheme = options.forceColorScheme\n const attribute = options.attribute ?? \"data-theme\"\n // An inline array literal (`attribute: [\"class\", \"data-theme\"]`, the\n // documented usage) has a new identity every render — depending on\n // `attribute` directly would tear down and rebuild every subscription/\n // listener below on every render for no reason. Depend on this stable\n // string instead; the effect/callback bodies still close over the real\n // `attribute` value, which is content-equivalent whichever render's\n // closure last ran.\n const attributeKey = Array.isArray(attribute) ? attribute.join(\",\") : attribute\n\n const [storedMode, setStoredMode] = useLocalStorage<ThemeMode>({\n key: storageKey,\n defaultValue: defaultColorScheme,\n deserialize: deserializeThemeMode,\n })\n\n const [domResolvedTheme, setDomResolvedTheme] = useState<ResolvedTheme>(\n getResolvedThemeServerSnapshot,\n )\n useIsomorphicLayoutEffect(() => {\n setDomResolvedTheme(getResolvedThemeSnapshot(attribute))\n return subscribeResolvedTheme(() => setDomResolvedTheme(getResolvedThemeSnapshot(attribute)))\n }, [attributeKey])\n\n const mode = forceColorScheme ?? storedMode\n const resolvedTheme = forceColorScheme ?? domResolvedTheme\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: depends on attributeKey, not attribute — see the layout effect above\n const setMode = useCallback(\n (next: ThemeMode | ((prev: ThemeMode) => ThemeMode)) => {\n if (forceColorScheme) return // hard no-op while forced, matching Mantine — updater not called\n const resolved = typeof next === \"function\" ? next(mode) : next\n setStoredMode(resolved) // cross-tab/same-tab sync, reusing useLocalStorage's existing mechanism\n applyThemeGuarded(resolveTheme(resolved), attribute, keepTransitions) // synchronous, this-tab\n },\n [mode, setStoredMode, attributeKey, keepTransitions, forceColorScheme],\n )\n\n // Live-follow the OS preference, but only while the user's explicit choice\n // is \"system\" and nothing is forced, and only in response to a genuine\n // future \"change\" event — never synchronously on mount, so it can't race\n // the hydration-corrective re-render described above.\n // biome-ignore lint/correctness/useExhaustiveDependencies: depends on attributeKey, not attribute — see the layout effect above\n useEffect(() => {\n if (forceColorScheme || mode !== \"system\" || typeof window === \"undefined\") return\n const mql = window.matchMedia(\"(prefers-color-scheme: dark)\")\n const onChange = () => applyThemeGuarded(getSystemTheme(), attribute, keepTransitions)\n mql.addEventListener(\"change\", onChange)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [mode, attributeKey, keepTransitions, forceColorScheme])\n\n // Closes the everyday cross-tab gap (switch theme in tab A, alt-tab back\n // to B, see it updated) without needing a reload. Safe: only fires from a\n // genuine focus/visibility event, always long after any hydration race\n // has resolved.\n // biome-ignore lint/correctness/useExhaustiveDependencies: depends on attributeKey, not attribute — see the layout effect above\n useEffect(() => {\n if (forceColorScheme) return\n const reapply = () => {\n if (document.visibilityState === \"visible\") {\n applyThemeGuarded(resolveTheme(mode), attribute, keepTransitions)\n }\n }\n window.addEventListener(\"visibilitychange\", reapply)\n window.addEventListener(\"focus\", reapply)\n return () => {\n window.removeEventListener(\"visibilitychange\", reapply)\n window.removeEventListener(\"focus\", reapply)\n }\n }, [mode, attributeKey, keepTransitions, forceColorScheme])\n\n // Misconfiguration safety net: applies a forced scheme even if\n // ThemeScript/the pasted init script wasn't updated with a matching\n // forceColorScheme. Safe as a plain effect — see the doc comment above.\n // biome-ignore lint/correctness/useExhaustiveDependencies: depends on attributeKey, not attribute — see the layout effect above\n useEffect(() => {\n if (forceColorScheme) applyThemeAttribute(forceColorScheme, attribute)\n }, [forceColorScheme, attributeKey])\n\n return { mode, resolvedTheme, setMode }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/sizes.ts","../src/lib/use-disclosure.ts","../src/lib/use-local-storage.ts","../src/lib/use-logger.ts","../src/lib/use-media-query.ts","../src/lib/use-theme.ts"],"names":["useRef","useCallback","subscribe","getServerSnapshot","useSyncExternalStore","useState","useEffect"],"mappings":";;;;;;;;;;;;;;;;AAiBO,IAAM,QAAQ,CAAC,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,MAAM,IAAI;ACgB3C,SAAS,aAAA,CACd,cAAc,KAAA,EACd,EAAE,QAAQ,OAAA,EAAQ,GAA4B,EAAC,EACrB;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,WAAW,CAAA;AAK5C,EAAA,MAAM,OAAA,GAAU,OAAO,WAAW,CAAA;AAClC,EAAA,OAAA,CAAQ,OAAA,GAAU,IAAA;AAElB,EAAA,MAAM,WAAA,GAAc,YAAY,MAAM;AACpC,IAAA,IAAI,CAAC,QAAQ,OAAA,EAAS;AACpB,MAAA,OAAA,CAAQ,OAAA,GAAU,IAAA;AAClB,MAAA,MAAA,IAAS;AAAA,IACX;AACA,IAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,EACd,CAAA,EAA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AAC,CAAA;AAEnC,EAAA,OAAO,EAAE,IAAA,EAAM,aAAA,EAAe,OAAA,EAAQ;AACxC","file":"index.js","sourcesContent":["/**\n * Single source of truth for the `size` prop accepted by sized components\n * (Button, Badge, ActionIcon, Spinner, Slider, Container, Text, Title, …).\n * The const array drives both the type and any runtime iteration (story\n * controls, docs sliders).\n *\n * Listed from smallest to largest — the base tier the playground's size\n * slider sorts against (see `SizeSlider`'s `CANONICAL_ORDER`, which layers\n * further known tiers — Text/Title's `2xl..4xl`, the heading aliases — on\n * top of this array). Strict by design: unlike `Color`, size has no\n * CSS-token escape hatch (no `data-size` slot vars), so widening to\n * `(string & {})` would only let callers slip in values the cva mappings\n * can't honor. Components that need extra tokens (Text/Title's shared\n * `xs..4xl` scale in `lib/typography-size.ts`, Container's `full`) declare\n * them via their own cva variants and export their own widened type —\n * outside this canonical scale.\n */\nexport const SIZES = [\"xs\", \"sm\", \"md\", \"lg\", \"xl\"] as const\n\nexport type Size = (typeof SIZES)[number]\n","import { useCallback, useRef, useState } from \"react\"\n\nexport interface UseDisclosureCallbacks {\n /** Called after the state changes to `true`. */\n onOpen?: () => void\n /** Called after the state changes to `false`. */\n onClose?: () => void\n}\n\nexport interface UseDisclosureHandlers {\n /** Sets the state to `true`. */\n open: () => void\n /** Sets the state to `false`. */\n close: () => void\n /** Flips the state. */\n toggle: () => void\n}\n\nexport type UseDisclosureReturnValue = [boolean, UseDisclosureHandlers]\n\n/**\n * Tracks an open/closed boolean with `open`/`close`/`toggle` handlers —\n * uncontrolled only, no `value` prop. Reach for this when wiring a custom\n * trigger's `aria-expanded`/`aria-controls` onto `Collapse` (or any other\n * boolean-driven UI) without pulling in a whole disclosure component.\n *\n * @example\n * const [opened, { toggle }] = useDisclosure()\n * <button aria-expanded={opened} aria-controls=\"details\" onClick={toggle}>\n * Show more\n * </button>\n * <Collapse id=\"details\" open={opened}>...</Collapse>\n */\nexport function useDisclosure(\n initialOpen = false,\n { onOpen, onClose }: UseDisclosureCallbacks = {},\n): UseDisclosureReturnValue {\n const [open, setOpen] = useState(initialOpen)\n // Mirrors `open` outside of React's state timing, so the transition check\n // and the onOpen/onClose call can happen directly in the handler body\n // instead of inside the setState updater — StrictMode's dev-mode\n // double-invoke of functional updaters would otherwise double-fire them.\n const openRef = useRef(initialOpen)\n openRef.current = open\n\n const openHandler = useCallback(() => {\n if (!openRef.current) {\n openRef.current = true\n onOpen?.()\n }\n setOpen(true)\n }, [onOpen])\n\n const closeHandler = useCallback(() => {\n if (openRef.current) {\n openRef.current = false\n onClose?.()\n }\n setOpen(false)\n }, [onClose])\n\n const toggleHandler = useCallback(() => {\n const next = !openRef.current\n openRef.current = next\n if (next) onOpen?.()\n else onClose?.()\n setOpen(next)\n }, [onOpen, onClose])\n\n return [open, { open: openHandler, close: closeHandler, toggle: toggleHandler }]\n}\n\nexport namespace useDisclosure {\n export type Callbacks = UseDisclosureCallbacks\n export type Handlers = UseDisclosureHandlers\n export type ReturnValue = UseDisclosureReturnValue\n}\n","\"use client\"\n\nimport { useCallback, useMemo, useRef, useSyncExternalStore } from \"react\"\n\n// Module-level (not per-hook-instance) so every useLocalStorage({ key }) call\n// anywhere in this tab shares one listener set per key — a same-tab write\n// notifies every other instance directly, no CustomEvent needed (contrast\n// with a naive per-instance `useState`, which has no shared registry to call\n// into directly and so needs one to fake same-tab sync).\nconst listeners = new Map<string, Set<() => void>>()\n// Per-key override for when a write couldn't reach localStorage (quota\n// exceeded, Safari private browsing — which throws on every write, etc.).\n// Without this, a failed write would leave every instance on that key unable\n// to reflect the change at all, since their snapshot otherwise comes only\n// from reading storage back. Cleared as soon as a write to that key succeeds\n// (localStorage becomes authoritative again), and once the last listener for\n// a key unsubscribes (nothing left observing it — the next mount starts\n// fresh against real storage instead of a possibly stale in-memory value).\nconst memoryFallback = new Map<string, string>()\nlet totalSubscribers = 0\n\nfunction notify(key: string) {\n for (const listener of listeners.get(key) ?? []) listener()\n}\n\nfunction handleStorageEvent(event: StorageEvent) {\n // `key === null` means the whole storage area was cleared — treat that as\n // every tracked key changing.\n if (event.key === null) {\n for (const key of listeners.keys()) notify(key)\n } else {\n notify(event.key)\n }\n}\n\nfunction subscribe(key: string, listener: () => void) {\n let set = listeners.get(key)\n if (!set) {\n set = new Set()\n listeners.set(key, set)\n }\n set.add(listener)\n // Cross-tab only — this tab's own writes are covered by the direct `notify`\n // call in setValue/removeValue below; the native `storage` event never\n // fires in the document that made the change. Ref-counted so N components\n // sharing a key install exactly one listener, not N.\n if (totalSubscribers++ === 0) window.addEventListener(\"storage\", handleStorageEvent)\n\n return () => {\n set?.delete(listener)\n if (set?.size === 0) {\n listeners.delete(key)\n memoryFallback.delete(key)\n }\n if (--totalSubscribers === 0) window.removeEventListener(\"storage\", handleStorageEvent)\n }\n}\n\nfunction readStorage(key: string): string | null {\n const fallback = memoryFallback.get(key)\n if (fallback !== undefined) return fallback\n try {\n return localStorage.getItem(key)\n } catch {\n return null // private mode / storage disabled — behave as unset\n }\n}\n\nfunction writeStorage(key: string, serialized: string) {\n try {\n localStorage.setItem(key, serialized)\n memoryFallback.delete(key)\n } catch {\n // Quota exceeded or storage unavailable — keep this value in memory so\n // the UI still reflects it for the rest of the session, even though it\n // won't survive a reload (persistence is best-effort).\n memoryFallback.set(key, serialized)\n }\n notify(key)\n}\n\nfunction removeStorage(key: string) {\n memoryFallback.delete(key)\n try {\n localStorage.removeItem(key)\n } catch {\n // Storage unavailable — nothing to remove.\n }\n notify(key)\n}\n\n// Stable across every call: the value seen during SSR and during the client's\n// hydration pass — never the real stored value, so the first render always\n// matches between server and client.\nfunction getServerSnapshot(): string | null {\n return null\n}\n\nexport interface UseLocalStorageOptions<T> {\n /** The `localStorage` key backing this value. Every hook instance — this\n * tab or another — sharing this key reads/writes the same value and stays\n * in sync with it. */\n key: string\n /** Returned before the real stored value is read, whenever nothing is\n * stored, or the stored value fails to deserialize. Captured once on\n * mount, like a lazy `useState` initializer — a fresh object/array\n * literal passed on a later render is ignored, so callers can pass\n * `defaultValue={{}}` inline without creating an unstable reference every\n * render. */\n defaultValue: T\n /** @default JSON.stringify */\n serialize?: (value: T) => string\n /** @default JSON.parse */\n deserialize?: (raw: string) => T\n}\n\nexport type UseLocalStorageReturnValue<T> = [\n T,\n /** Accepts a value or an updater resolved against the current value — the\n * same shape react-table's own `OnChangeFn<T>` and this kit's\n * `useUncontrolled` setter use, so it wires into e.g. `DataTable`'s\n * `onColumnSizingChange` directly, no wrapper needed. */\n (value: T | ((previous: T) => T)) => void,\n /** Deletes the key; every instance on this key falls back to\n * `defaultValue` until something is stored again. */\n () => void,\n]\n\n/**\n * Persists a piece of state to `localStorage`, kept in sync across every\n * component using the same `key` — both within this tab (a write in one\n * instance is reflected in every other instance immediately) and across tabs\n * (via the native `storage` event). SSR-safe: `useSyncExternalStore`'s\n * `getServerSnapshot` guarantees the server-rendered and first-client-render\n * markup agree (always `defaultValue`), so there's no hydration mismatch to\n * guard against.\n *\n * const [columnSizing, setColumnSizing] = useLocalStorage({\n * key: \"users-table\",\n * defaultValue: {},\n * })\n * <DataTable columnSizing={columnSizing} onColumnSizingChange={setColumnSizing} />\n */\nexport function useLocalStorage<T>({\n key,\n defaultValue,\n serialize = JSON.stringify,\n deserialize = JSON.parse,\n}: UseLocalStorageOptions<T>): UseLocalStorageReturnValue<T> {\n const defaultValueRef = useRef(defaultValue)\n\n const subscribeToKey = useCallback((listener: () => void) => subscribe(key, listener), [key])\n const getSnapshot = useCallback(() => readStorage(key), [key])\n const raw = useSyncExternalStore(subscribeToKey, getSnapshot, getServerSnapshot)\n\n const value = useMemo(() => {\n if (raw === null) return defaultValueRef.current\n try {\n return deserialize(raw)\n } catch {\n return defaultValueRef.current // corrupted value — keep the default\n }\n }, [raw, deserialize])\n\n const setValue = useCallback(\n (next: T | ((previous: T) => T)) => {\n const resolved = typeof next === \"function\" ? (next as (previous: T) => T)(value) : next\n writeStorage(key, serialize(resolved))\n },\n [key, serialize, value],\n )\n\n const removeValue = useCallback(() => {\n removeStorage(key)\n }, [key])\n\n return [value, setValue, removeValue]\n}\n","\"use client\"\n\n/**\n * Development helper that logs a component's lifecycle to the console:\n *\n * - `<name> mounted` with the given values, once on mount\n * - `<name> updated` with the given values, on every change of `props`\n * - `<name> unmounted` on cleanup\n *\n * Note that `props` is compared by the effect dependency array, so pass the values themselves\n * (`useLogger(\"Demo\", [count, open])`), not a fresh object literal.\n */\n\nimport { useEffect, useRef } from \"react\"\n\nexport function useLogger(componentName: string, props: unknown[]): null {\n const mounted = useRef(false)\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: We only want to log on mount/unmount\n useEffect(() => {\n console.log(`${componentName} mounted`, ...props)\n return () => {\n mounted.current = false\n console.log(`${componentName} unmounted`)\n }\n }, [])\n\n // Skip the initial render, then log updates.\n useEffect(() => {\n if (mounted.current) {\n console.log(`${componentName} updated`, ...props)\n } else {\n mounted.current = true\n }\n // biome-ignore lint/correctness/useExhaustiveDependencies: We only want to log props updates\n }, props)\n\n return null\n}\n","\"use client\"\n\nimport { useCallback, useSyncExternalStore } from \"react\"\n\nfunction subscribe(query: string, listener: () => void): () => void {\n const mediaQueryList = window.matchMedia(query)\n mediaQueryList.addEventListener(\"change\", listener)\n return () => mediaQueryList.removeEventListener(\"change\", listener)\n}\n\n// Stable across every call: SSR and the first client render must agree, same\n// reasoning as useLocalStorage's getServerSnapshot — a server can't know the\n// visitor's viewport, so `false` is the only value that can't mismatch.\nfunction getServerSnapshot(): boolean {\n return false\n}\n\n/**\n * Tracks whether a media query currently matches, updating live as the\n * viewport (or whichever media feature) changes. SSR-safe via\n * `useSyncExternalStore`, mirroring `useLocalStorage`'s use of the same hook\n * for the same reason: the hydration snapshot is fixed (`false`) so server\n * and first-client-render markup always agree.\n *\n * const isMobile = useMediaQuery(\"(width < 768px)\")\n */\nexport function useMediaQuery(query: string): boolean {\n const subscribeToQuery = useCallback(\n (listener: () => void) => subscribe(query, listener),\n [query],\n )\n const getSnapshot = useCallback(() => window.matchMedia(query).matches, [query])\n\n return useSyncExternalStore(subscribeToQuery, getSnapshot, getServerSnapshot)\n}\n","\"use client\"\n\nimport { useCallback, useEffect, useState } from \"react\"\nimport {\n applyThemeAttribute,\n DEFAULT_THEME_STORAGE_KEY,\n disableTransitionsDuringChange,\n getSystemTheme,\n isThemeMode,\n type ResolvedTheme,\n resolveTheme,\n type ThemeAttribute,\n type ThemeMode,\n} from \"./theme\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-layout-effect\"\nimport { useLocalStorage } from \"./use-local-storage\"\n\n// Shared by every DOM-writing call site below (setMode, the system-preference\n// listener, the focus/visibility reapply) so `keepTransitions` suppresses\n// transitions around all of them uniformly, not just clicks.\nfunction applyThemeGuarded(\n theme: ResolvedTheme,\n attribute: ThemeAttribute | ThemeAttribute[],\n keepTransitions: boolean,\n): void {\n const restore = keepTransitions ? null : disableTransitionsDuringChange()\n applyThemeAttribute(theme, attribute)\n restore?.()\n}\n\n// Module-level, ref-counted MutationObserver — same shared-subscription idiom\n// as use-local-storage.ts's `listeners` map, just watching <html>'s\n// data-theme/class attributes instead of a storage key. There's only ever\n// one <html>, so a single observer instance (not one per key) is enough.\n// Watches both attributes unconditionally regardless of any one hook\n// instance's configured `attribute` — cheap, and keeps this correct even if\n// two `useTheme()` calls in the same app somehow used different configs\n// (each instance's own `getResolvedThemeSnapshot` call still reads whichever\n// one *it* was configured for).\nconst resolvedThemeListeners = new Set<() => void>()\nlet observer: MutationObserver | null = null\n\nfunction notifyResolvedTheme() {\n for (const listener of resolvedThemeListeners) listener()\n}\n\nfunction subscribeResolvedTheme(listener: () => void): () => void {\n resolvedThemeListeners.add(listener)\n if (resolvedThemeListeners.size === 1 && typeof MutationObserver !== \"undefined\") {\n observer = new MutationObserver(notifyResolvedTheme)\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-theme\", \"class\"],\n })\n }\n return () => {\n resolvedThemeListeners.delete(listener)\n if (resolvedThemeListeners.size === 0) {\n observer?.disconnect()\n observer = null\n }\n }\n}\n\n// Reads the DOM directly rather than deriving from `mode` — see useTheme's\n// doc comment for why a derived write/read here would reintroduce a flash.\n// `data-theme` wins when both are configured (it's the kit's actual\n// contract); `class` is only consulted when `data-theme` isn't configured\n// at all, so `resolvedTheme` still updates correctly in that case.\nfunction getResolvedThemeSnapshot(attribute: ThemeAttribute | ThemeAttribute[]): ResolvedTheme {\n if (typeof document === \"undefined\") return \"light\"\n const attrs = Array.isArray(attribute) ? attribute : [attribute]\n const root = document.documentElement\n if (attrs.includes(\"data-theme\"))\n return root.getAttribute(\"data-theme\") === \"dark\" ? \"dark\" : \"light\"\n return root.classList.contains(\"dark\") ? \"dark\" : \"light\"\n}\n\n// Fixed, matching theme.css's \"no data-theme == light\" contract — SSR and\n// the first client render must agree, exactly like getSystemTheme()'s SSR branch.\nfunction getResolvedThemeServerSnapshot(): ResolvedTheme {\n return \"light\"\n}\n\n// Module-level (not inline in the hook) so it's a stable reference across\n// renders — see UseLocalStorageOptions.deserialize. Throwing on an invalid\n// value makes useLocalStorage fall back to defaultColorScheme.\nfunction deserializeThemeMode(raw: string): ThemeMode {\n const parsed = JSON.parse(raw)\n if (!isThemeMode(parsed)) throw new Error(`invalid stored theme mode: ${raw}`)\n return parsed\n}\n\nexport interface UseThemeOptions {\n /** @default DEFAULT_THEME_STORAGE_KEY — must match whatever key was passed\n * to `<ThemeScript storageKey>` / the pasted init script. */\n storageKey?: string\n /** Fallback used when nothing is stored yet.\n * @default \"system\" */\n defaultColorScheme?: ThemeMode\n /** Pins `mode`/`resolvedTheme` to a fixed value and makes `setMode` a\n * no-op — no storage write, no DOM write. Must also be passed to\n * `<ThemeScript forceColorScheme>` / the pasted init script, or the\n * pre-hydration script and this hook will disagree on first load. */\n forceColorScheme?: ResolvedTheme\n /** @default false — mirrors Mantine's option of the same name (flipped\n * from next-themes' `disableTransitionOnChange`: here, suppression is\n * the default). Transitions are suppressed for one frame around every\n * applied theme change (`setMode`, the live system-preference listener,\n * and the focus/visibility reapply) unless this is `true`. */\n keepTransitions?: boolean\n /** Which DOM mechanism(s) to keep in sync — `\"data-theme\"` is the kit's\n * own contract (`theme.css`'s `@custom-variant dark`); add `\"class\"` for\n * consumers whose *other* CSS reads a literal `.dark` class instead\n * (mirrors next-themes' `attribute` option). Must match whatever\n * `attribute` was passed to `<ThemeScript>` / the pasted init script, or\n * the pre-hydration script and this hook will disagree on first load.\n * @default \"data-theme\" */\n attribute?: ThemeAttribute | ThemeAttribute[]\n}\n\nexport interface UseThemeReturnValue {\n /** The user's explicit, persisted choice — \"system\" included as a real value. */\n mode: ThemeMode\n /** The live, applied light/dark value — \"system\" already resolved. Read\n * this to swap an icon; CSS never needs it directly (the kit's `dark:`\n * utilities key off the `data-theme` attribute this mirrors). */\n resolvedTheme: ResolvedTheme\n /** Persists `mode` (synced cross-tab/same-tab via `useLocalStorage`) AND\n * synchronously applies the DOM attribute this-tab in the same call.\n * Accepts a value or an updater resolved against the current `mode`\n * (`setMode((prev) => ...)`), same shape as `useState`'s setter. A\n * no-op while `forceColorScheme` is set — the updater isn't called. */\n setMode: (mode: ThemeMode | ((prev: ThemeMode) => ThemeMode)) => void\n}\n\n/**\n * Manages a persisted `\"light\" | \"dark\" | \"system\"` choice and keeps\n * `data-theme` on `<html>` in sync with it. Pair with `ThemeScript` (Next.js)\n * or a manually-pasted init script (Vite) to avoid a flash of the wrong\n * theme on first load — see the package README.\n *\n * Read `resolvedTheme` for *logic* (e.g. deciding what a click switches to);\n * don't render it directly. A server can't know the visitor's real\n * preference, so anything rendered from `resolvedTheme` is necessarily\n * wrong in the raw server-rendered HTML — before any JS/hydration runs at\n * all — no matter how quickly the hook itself corrects afterward. Derive\n * the *visible* state from CSS keyed off `data-theme` instead (the kit's\n * own `dark:` variant already matches it — see `theme.css`'s\n * `@custom-variant dark`), so the browser paints it correctly from the\n * very first frame, same as the rest of the page:\n *\n * const { resolvedTheme, setMode } = useTheme()\n * const next = resolvedTheme === \"dark\" ? \"light\" : \"dark\"\n * <button onClick={() => setMode(next)}>\n * <SunIcon className=\"dark:hidden\" />\n * <MoonIcon className=\"hidden dark:block\" />\n * </button>\n *\n * Deliberately does NOT run `applyThemeAttribute(resolveTheme(storedMode))`\n * in a plain effect keyed on the stored mode. During SSR and the first\n * client render, `useLocalStorage`'s `getServerSnapshot` always returns\n * `null`, forcing the stored mode to `defaultColorScheme` regardless of\n * what's actually stored — an effect deriving a DOM write from that stale\n * value could overwrite a `data-theme` an init script already set correctly.\n * `resolvedTheme` reads the DOM instead, so React only ever *reads* what (a)\n * the blocking script, (b) `setMode`, or (c) the system-preference listener\n * below already wrote.\n *\n * `resolvedTheme` is corrected via `useIsomorphicLayoutEffect`, not\n * `useSyncExternalStore`. React's own docs don't specify that\n * `useSyncExternalStore`'s hydration-snapshot correction happens before the\n * browser paints, and empirically it isn't reliably so — the fallback\n * `getResolvedThemeServerSnapshot()` value (\"light\") could get painted for a\n * frame before the real DOM-read value replaced it, a real visible flash.\n * `useLayoutEffect`'s \"flushes before paint\" guarantee is explicit, so the\n * correction is forced there instead — still a pure DOM *read*, same\n * safety property as above, just guaranteed pre-paint. Vitest/jsdom's\n * `act()` can't distinguish these two timings (it flushes every effect\n * synchronously regardless of kind), so a green test run alone doesn't\n * prove no flash — this specific class of bug only shows up in a real\n * browser.\n *\n * `forceColorScheme`, when set, is a constant argument (not derived from\n * `useLocalStorage`'s SSR-diverging state) — identical on server and\n * client, so applying it directly in an effect is safe and doesn't\n * reintroduce the flash bug above.\n *\n * `setMode` also accepts a `useState`-style updater resolved against the\n * current `mode` (e.g. a 3-way cycle: `setMode((m) => NEXT[m])`) — resolved\n * once, synchronously, against `mode` at call time, not queued/batched the\n * way React's own `setState` updater can be.\n */\nexport function useTheme(options: UseThemeOptions = {}): UseThemeReturnValue {\n const storageKey = options.storageKey ?? DEFAULT_THEME_STORAGE_KEY\n const defaultColorScheme = options.defaultColorScheme ?? \"system\"\n const keepTransitions = options.keepTransitions ?? false\n const forceColorScheme = options.forceColorScheme\n const attribute = options.attribute ?? \"data-theme\"\n // An inline array literal (`attribute: [\"class\", \"data-theme\"]`, the\n // documented usage) has a new identity every render — depending on\n // `attribute` directly would tear down and rebuild every subscription/\n // listener below on every render for no reason. Depend on this stable\n // string instead; the effect/callback bodies still close over the real\n // `attribute` value, which is content-equivalent whichever render's\n // closure last ran.\n const attributeKey = Array.isArray(attribute) ? attribute.join(\",\") : attribute\n\n const [storedMode, setStoredMode] = useLocalStorage<ThemeMode>({\n key: storageKey,\n defaultValue: defaultColorScheme,\n deserialize: deserializeThemeMode,\n })\n\n const [domResolvedTheme, setDomResolvedTheme] = useState<ResolvedTheme>(\n getResolvedThemeServerSnapshot,\n )\n useIsomorphicLayoutEffect(() => {\n setDomResolvedTheme(getResolvedThemeSnapshot(attribute))\n return subscribeResolvedTheme(() => setDomResolvedTheme(getResolvedThemeSnapshot(attribute)))\n }, [attributeKey])\n\n const mode = forceColorScheme ?? storedMode\n const resolvedTheme = forceColorScheme ?? domResolvedTheme\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: depends on attributeKey, not attribute — see the layout effect above\n const setMode = useCallback(\n (next: ThemeMode | ((prev: ThemeMode) => ThemeMode)) => {\n if (forceColorScheme) return // hard no-op while forced, matching Mantine — updater not called\n const resolved = typeof next === \"function\" ? next(mode) : next\n setStoredMode(resolved) // cross-tab/same-tab sync, reusing useLocalStorage's existing mechanism\n applyThemeGuarded(resolveTheme(resolved), attribute, keepTransitions) // synchronous, this-tab\n },\n [mode, setStoredMode, attributeKey, keepTransitions, forceColorScheme],\n )\n\n // Live-follow the OS preference, but only while the user's explicit choice\n // is \"system\" and nothing is forced, and only in response to a genuine\n // future \"change\" event — never synchronously on mount, so it can't race\n // the hydration-corrective re-render described above.\n // biome-ignore lint/correctness/useExhaustiveDependencies: depends on attributeKey, not attribute — see the layout effect above\n useEffect(() => {\n if (forceColorScheme || mode !== \"system\" || typeof window === \"undefined\") return\n const mql = window.matchMedia(\"(prefers-color-scheme: dark)\")\n const onChange = () => applyThemeGuarded(getSystemTheme(), attribute, keepTransitions)\n mql.addEventListener(\"change\", onChange)\n return () => mql.removeEventListener(\"change\", onChange)\n }, [mode, attributeKey, keepTransitions, forceColorScheme])\n\n // Closes the everyday cross-tab gap (switch theme in tab A, alt-tab back\n // to B, see it updated) without needing a reload. Safe: only fires from a\n // genuine focus/visibility event, always long after any hydration race\n // has resolved.\n // biome-ignore lint/correctness/useExhaustiveDependencies: depends on attributeKey, not attribute — see the layout effect above\n useEffect(() => {\n if (forceColorScheme) return\n const reapply = () => {\n if (document.visibilityState === \"visible\") {\n applyThemeGuarded(resolveTheme(mode), attribute, keepTransitions)\n }\n }\n window.addEventListener(\"visibilitychange\", reapply)\n window.addEventListener(\"focus\", reapply)\n return () => {\n window.removeEventListener(\"visibilitychange\", reapply)\n window.removeEventListener(\"focus\", reapply)\n }\n }, [mode, attributeKey, keepTransitions, forceColorScheme])\n\n // Misconfiguration safety net: applies a forced scheme even if\n // ThemeScript/the pasted init script wasn't updated with a matching\n // forceColorScheme. Safe as a plain effect — see the doc comment above.\n // biome-ignore lint/correctness/useExhaustiveDependencies: depends on attributeKey, not attribute — see the layout effect above\n useEffect(() => {\n if (forceColorScheme) applyThemeAttribute(forceColorScheme, attribute)\n }, [forceColorScheme, attributeKey])\n\n return { mode, resolvedTheme, setMode }\n}\n"]}
|
package/dist/lib/date-value.d.ts
CHANGED
|
@@ -20,6 +20,19 @@ export type DateRangeValue = {
|
|
|
20
20
|
};
|
|
21
21
|
/** Convert a native `Date` instant to Ark's `DateValue`, interpreted in `timeZone`. */
|
|
22
22
|
export declare function dateToCalendarValue(date: Date, timeZone: string): DateValue;
|
|
23
|
+
/**
|
|
24
|
+
* Convert a native `Date` instant to the value handed to Ark's machine: the wall-clock date and
|
|
25
|
+
* time it reads as in `timeZone`, as a zone-free `CalendarDateTime`.
|
|
26
|
+
*
|
|
27
|
+
* Not a `ZonedDateTime`, although that is what `dateToCalendarValue` returns, because Ark copies
|
|
28
|
+
* the zone of whatever it is handed into everything it derives from it: the focused day, the
|
|
29
|
+
* visible month, and through those every grid cell, and a pick keeps the zone of the cell it came
|
|
30
|
+
* from. So when the component's zone changes (`timeZone="auto"` after hydration, or the app's
|
|
31
|
+
* `IntlProvider`), the grid would go on producing picks in the *old* zone. Kept zone-free, the
|
|
32
|
+
* machine only ever holds wall-clock values, and the one zone that turns them back into instants
|
|
33
|
+
* is the component's current one, passed to `calendarValueToDate`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function dateToArkValue(date: Date, timeZone: string): DateValue;
|
|
23
36
|
/**
|
|
24
37
|
* Convert Ark's `DateValue` back to a native `Date`. A `ZonedDateTime` (what `dateToCalendarValue`
|
|
25
38
|
* produces) already carries its own zone/offset — its `toDate()` takes no argument and would
|
|
@@ -30,7 +43,7 @@ export declare function dateToCalendarValue(date: Date, timeZone: string): DateV
|
|
|
30
43
|
*/
|
|
31
44
|
export declare function calendarValueToDate(value: DateValue, timeZone: string): Date;
|
|
32
45
|
/**
|
|
33
|
-
* Wrap a public value into Ark's array contract
|
|
46
|
+
* Wrap a public value into Ark's array contract, each `Date` through `dateToArkValue`. `undefined` stays uncontrolled (Ark's own
|
|
34
47
|
* default takes over); `null` — or an all-null range — clears to `[]`; a single `Date` becomes a
|
|
35
48
|
* one-element array; a range pushes only its defined ends, so a mid-selection range
|
|
36
49
|
* (`{ start, end: null }`) naturally comes out length 1.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-value.d.ts","sourceRoot":"","sources":["../../src/lib/date-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"date-value.d.ts","sourceRoot":"","sources":["../../src/lib/date-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,yBAAyB,CAAA;AAEtF;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,CAAA;AAErE,uFAAuF;AACvF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAE3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAEtE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,IAAI,GAAG,cAAc,GAAG,IAAI,GAAG,SAAS,EAC/C,QAAQ,EAAE,MAAM,GACf,SAAS,EAAE,GAAG,SAAS,CAQzB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,EAAE,EACnB,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,GACf,IAAI,GAAG,cAAc,GAAG,IAAI,CAU9B"}
|
|
@@ -49,6 +49,14 @@ export type FocusStylesOptions = {
|
|
|
49
49
|
* mismatched hole and you want to supply your own `ring-offset-*` colors.
|
|
50
50
|
*/
|
|
51
51
|
offset?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Draw the ring *inside* the element's edge instead of around it. For rows
|
|
54
|
+
* stacked flush in a scroller (`TreeSelect`'s tree): an outer ring would be
|
|
55
|
+
* clipped by the scroller's edge and painted under by the next row. Pair it
|
|
56
|
+
* with `offset: false` — an inset gap would sit inside the row, in the page
|
|
57
|
+
* color rather than the surface's.
|
|
58
|
+
*/
|
|
59
|
+
inset?: boolean;
|
|
52
60
|
};
|
|
53
61
|
/**
|
|
54
62
|
* The kit's keyboard-focus treatment — one source of truth for every focus
|
|
@@ -65,7 +73,7 @@ export type FocusStylesOptions = {
|
|
|
65
73
|
* <button type="button" className={cn(focusStyles(), "rounded-full")}>…</button>
|
|
66
74
|
* ```
|
|
67
75
|
*
|
|
68
|
-
*
|
|
76
|
+
* Four axes, and only four. Width and alpha are deliberately *not* options:
|
|
69
77
|
* the point of a single ring is that a keyboard user never has to re-learn what
|
|
70
78
|
* "focused" looks like, so every ring the kit draws is 2px and fully opaque.
|
|
71
79
|
*
|
|
@@ -76,6 +84,9 @@ export type FocusStylesOptions = {
|
|
|
76
84
|
* button get the same ring. `ring: "palette"` is the exception, for a control
|
|
77
85
|
* nested inside a surface that already carries the palette.
|
|
78
86
|
*
|
|
87
|
+
* `inset: true` moves the ring inside the element's edge, for rows stacked flush
|
|
88
|
+
* in a scroller (`TreeSelect`, `TreeMultiSelect`).
|
|
89
|
+
*
|
|
79
90
|
* `offset: true` means *the gap is the page background*. An element on any
|
|
80
91
|
* other surface — a tinted table header, a colored chip — passes
|
|
81
92
|
* `offset: false` and supplies its own `ring-offset-*` pair matched to that
|
|
@@ -85,9 +96,6 @@ export type FocusStylesOptions = {
|
|
|
85
96
|
* - a ring on a **pseudo-element** rather than the element itself (`Schedule`'s
|
|
86
97
|
* resize grip, `DataTable`'s column-resize handle) — it outlines the small
|
|
87
98
|
* visible mark, not the oversized hit box, and has its own shape and offset;
|
|
88
|
-
* - a ring whose color comes from **`currentColor`** (`Notification`'s actions,
|
|
89
|
-
* which inherit the status hue);
|
|
90
|
-
* - **`ring-inset`** rows inside a scroller (`TreeSelect`, `TreeMultiSelect`);
|
|
91
99
|
* - the **shell** idiom — accent border plus a soft halo on a wrapper whose
|
|
92
100
|
* focus lives on a descendant (`Input`'s chrome, `SegmentGroup`'s tray);
|
|
93
101
|
* - a bare `focus:outline-none` with no ring at all, on overlay surfaces that
|
|
@@ -98,5 +106,5 @@ export type FocusStylesOptions = {
|
|
|
98
106
|
* display component (`Badge`, `Kbd`, `ThemeIcon`) can carry them unconditionally
|
|
99
107
|
* and only light up once `asChild` renders it onto a real `<button>`/`<a>`.
|
|
100
108
|
*/
|
|
101
|
-
export declare const focusStyles: ({ source, ring, offset, }?: FocusStylesOptions) => string;
|
|
109
|
+
export declare const focusStyles: ({ source, ring, offset, inset, }?: FocusStylesOptions) => string;
|
|
102
110
|
//# sourceMappingURL=focus-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-styles.d.ts","sourceRoot":"","sources":["../../src/lib/focus-styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,oBAAoB,CAAA;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"focus-styles.d.ts","sourceRoot":"","sources":["../../src/lib/focus-styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,oBAAoB,CAAA;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;AA8C3C,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,WAAW,sCAKrB,kBAAkB,KAAQ,MAC+D,CAAA"}
|
package/dist/theme.css
CHANGED
|
@@ -392,6 +392,29 @@ body {
|
|
|
392
392
|
color: var(--color-gray-dark-50);
|
|
393
393
|
}
|
|
394
394
|
|
|
395
|
+
/* Default border color: the kit's hairline. Tailwind v4 dropped v3's default
|
|
396
|
+
border color, so a bare `border` (a Timeline bullet's edge, Schedule's
|
|
397
|
+
time-column divider) paints in `currentColor`: near-black on a white dot,
|
|
398
|
+
a hard white line on dark surfaces. The docs never showed it because
|
|
399
|
+
Fumadocs adds the same kind of rule; any app without Fumadocs did. Layered
|
|
400
|
+
in `base`, under every utility, so a component that sets its own border
|
|
401
|
+
color keeps it. */
|
|
402
|
+
:root {
|
|
403
|
+
--default-border-color: color-mix(in srgb, var(--color-brand-900) 20%, transparent);
|
|
404
|
+
}
|
|
405
|
+
[data-theme="dark"] {
|
|
406
|
+
--default-border-color: color-mix(in srgb, white 15%, transparent);
|
|
407
|
+
}
|
|
408
|
+
@layer base {
|
|
409
|
+
*,
|
|
410
|
+
::after,
|
|
411
|
+
::before,
|
|
412
|
+
::backdrop,
|
|
413
|
+
::file-selector-button {
|
|
414
|
+
border-color: var(--default-border-color, currentColor);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
395
418
|
@keyframes fade-in {
|
|
396
419
|
from {
|
|
397
420
|
opacity: 0;
|
|
@@ -1185,8 +1208,7 @@ body {
|
|
|
1185
1208
|
==========================================
|
|
1186
1209
|
This kit has no dedicated "page background" token — the `body` rule above
|
|
1187
1210
|
only ever sets text color. `Indicator`'s `withBorder` (and, elsewhere,
|
|
1188
|
-
`AvatarGroup`'s cutout border / `
|
|
1189
|
-
gradient border) all need *some* guess at the surrounding surface color so
|
|
1211
|
+
`AvatarGroup`'s cutout border / `Badge`'s gradient border) all need *some* guess at the surrounding surface color so
|
|
1190
1212
|
the ring reads as a seamless cutout rather than a mismatched outline, so
|
|
1191
1213
|
light=white / dark=gray-dark-900 is that guess — a plausible default for
|
|
1192
1214
|
an unstyled page, in both themes.
|
package/package.json
CHANGED
package/src/colors.css
CHANGED
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
*
|
|
32
32
|
* Disabled slots (--c-*-disabled):
|
|
33
33
|
* A disabled control reads as inactive, so these are deliberately
|
|
34
|
-
* palette-independent — neutral
|
|
34
|
+
* palette-independent — translucent neutral washes (black in light, white
|
|
35
|
+
* in dark) that mute the accent. Translucent, not opaque gray steps, so
|
|
36
|
+
* they take the tint of whatever surface they sit on. They are
|
|
35
37
|
* declared once on `:root` / `[data-theme="dark"]`; every `[data-color]`
|
|
36
38
|
* inherits the same muted appearance, so they are *not* repeated per color.
|
|
37
39
|
* Consumers wanting a palette-specific disabled look can still override
|
|
@@ -55,11 +57,12 @@
|
|
|
55
57
|
--c-soft-hover: color-mix(in oklab, var(--color-black) 35%, transparent);
|
|
56
58
|
--c-text: var(--color-gray-light-700);
|
|
57
59
|
|
|
58
|
-
/* Neutral disabled slots — shared across every palette (see header).
|
|
59
|
-
|
|
60
|
-
--c-
|
|
61
|
-
--c-
|
|
62
|
-
--c-
|
|
60
|
+
/* Neutral disabled slots — shared across every palette (see header).
|
|
61
|
+
Translucent black washes, so they pick up whatever surface they sit on. */
|
|
62
|
+
--c-solid-disabled: color-mix(in oklab, var(--color-black) 16%, transparent);
|
|
63
|
+
--c-on-solid-disabled: color-mix(in oklab, var(--color-black) 55%, transparent);
|
|
64
|
+
--c-soft-disabled: color-mix(in oklab, var(--color-black) 4%, transparent);
|
|
65
|
+
--c-text-disabled: color-mix(in oklab, var(--color-black) 38%, transparent);
|
|
63
66
|
}
|
|
64
67
|
[data-theme="dark"] {
|
|
65
68
|
--c-solid: var(--color-white);
|
|
@@ -69,10 +72,12 @@
|
|
|
69
72
|
--c-soft-hover: color-mix(in oklab, var(--color-white) 35%, transparent);
|
|
70
73
|
--c-text: var(--color-gray-dark-300);
|
|
71
74
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
--c-
|
|
75
|
-
--c-
|
|
75
|
+
/* Translucent white washes: on the blue-tinted brand-950 surface they
|
|
76
|
+
take its tint instead of reading as a flat foreign gray. */
|
|
77
|
+
--c-solid-disabled: color-mix(in oklab, var(--color-white) 20%, transparent);
|
|
78
|
+
--c-on-solid-disabled: color-mix(in oklab, var(--color-white) 50%, transparent);
|
|
79
|
+
--c-soft-disabled: color-mix(in oklab, var(--color-white) 8%, transparent);
|
|
80
|
+
--c-text-disabled: color-mix(in oklab, var(--color-white) 35%, transparent);
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
[data-color="brand"] {
|
|
@@ -118,3 +118,35 @@ describe("Autocomplete — clearSectionMode", () => {
|
|
|
118
118
|
expect(screen.getByRole("button", { name: "Show options" })).toBeTruthy()
|
|
119
119
|
})
|
|
120
120
|
})
|
|
121
|
+
|
|
122
|
+
describe("Autocomplete translations", () => {
|
|
123
|
+
it("names the chevron and clear button from translations", () => {
|
|
124
|
+
render(
|
|
125
|
+
<Autocomplete
|
|
126
|
+
data={data}
|
|
127
|
+
label="Fruit"
|
|
128
|
+
clearable
|
|
129
|
+
clearSectionMode="both"
|
|
130
|
+
defaultValue="App"
|
|
131
|
+
translations={{ triggerLabel: "Afficher les options", clearTriggerLabel: "Effacer" }}
|
|
132
|
+
/>,
|
|
133
|
+
)
|
|
134
|
+
expect(screen.getByRole("button", { name: "Afficher les options" })).toBeTruthy()
|
|
135
|
+
expect(screen.getByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
it("keeps the English default for the key a partial override omits", () => {
|
|
139
|
+
render(
|
|
140
|
+
<Autocomplete
|
|
141
|
+
data={data}
|
|
142
|
+
label="Fruit"
|
|
143
|
+
clearable
|
|
144
|
+
clearSectionMode="both"
|
|
145
|
+
defaultValue="App"
|
|
146
|
+
translations={{ clearTriggerLabel: "Effacer" }}
|
|
147
|
+
/>,
|
|
148
|
+
)
|
|
149
|
+
expect(screen.getByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
150
|
+
expect(screen.getByRole("button", { name: "Show options" })).toBeTruthy()
|
|
151
|
+
})
|
|
152
|
+
})
|
|
@@ -16,7 +16,11 @@ import {
|
|
|
16
16
|
} from "../../lib/select-data"
|
|
17
17
|
import type { WithTestId } from "../../lib/test-id"
|
|
18
18
|
import { useUncontrolled } from "../../lib/use-uncontrolled"
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
Combobox,
|
|
21
|
+
type ComboboxTranslations,
|
|
22
|
+
resolveComboboxTranslations,
|
|
23
|
+
} from "../combobox/combobox"
|
|
20
24
|
import { type FieldProps, FieldShell } from "../field/field"
|
|
21
25
|
import { type InputSize, type InputVariant, inputControlClasses, inputSlot } from "../input/input"
|
|
22
26
|
import { CloseIcon } from "../popover/icons"
|
|
@@ -89,8 +93,15 @@ export type AutocompleteProps<Data extends SelectData = SelectData> = Pick<
|
|
|
89
93
|
ref?: Ref<HTMLInputElement>
|
|
90
94
|
className?: string
|
|
91
95
|
classNames?: AutocompleteClassNames
|
|
96
|
+
/** Overrides the clear button's (`clearTriggerLabel`, default `"Clear value"`) and the
|
|
97
|
+
* chevron's (`triggerLabel`, default `"Show options"`) accessible names. A partial
|
|
98
|
+
* override keeps the other default. */
|
|
99
|
+
translations?: AutocompleteTranslations
|
|
92
100
|
}
|
|
93
101
|
|
|
102
|
+
/** The combobox family's wording, as `Autocomplete` uses it — see `ComboboxTranslations`. */
|
|
103
|
+
export type AutocompleteTranslations = ComboboxTranslations
|
|
104
|
+
|
|
94
105
|
export const Autocomplete = <const Data extends SelectData = SelectData>({
|
|
95
106
|
data,
|
|
96
107
|
value,
|
|
@@ -118,7 +129,9 @@ export const Autocomplete = <const Data extends SelectData = SelectData>({
|
|
|
118
129
|
className,
|
|
119
130
|
classNames,
|
|
120
131
|
testId,
|
|
132
|
+
translations,
|
|
121
133
|
}: AutocompleteProps<Data>) => {
|
|
134
|
+
const resolvedTranslations = resolveComboboxTranslations(translations)
|
|
122
135
|
// Red state is driven independently of the `Field` error slot so a form
|
|
123
136
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
124
137
|
const isInvalid = invalid || error != null
|
|
@@ -172,6 +185,7 @@ export const Autocomplete = <const Data extends SelectData = SelectData>({
|
|
|
172
185
|
size={size}
|
|
173
186
|
variant={variant}
|
|
174
187
|
className={className}
|
|
188
|
+
translations={resolvedTranslations}
|
|
175
189
|
>
|
|
176
190
|
<Combobox.Context>
|
|
177
191
|
{(api) => (
|
|
@@ -205,7 +219,7 @@ export const Autocomplete = <const Data extends SelectData = SelectData>({
|
|
|
205
219
|
{showClear && (
|
|
206
220
|
<button
|
|
207
221
|
type="button"
|
|
208
|
-
aria-label=
|
|
222
|
+
aria-label={resolvedTranslations.clearTriggerLabel}
|
|
209
223
|
onPointerDown={(event) => event.preventDefault()}
|
|
210
224
|
onClick={() => setQuery("")}
|
|
211
225
|
className={popoverClearTrigger}
|
|
@@ -213,9 +227,7 @@ export const Autocomplete = <const Data extends SelectData = SelectData>({
|
|
|
213
227
|
<CloseIcon />
|
|
214
228
|
</button>
|
|
215
229
|
)}
|
|
216
|
-
{(clearSectionMode === "both" || !showClear) &&
|
|
217
|
-
<Combobox.Trigger aria-label="Show options" data-chevron />
|
|
218
|
-
)}
|
|
230
|
+
{(clearSectionMode === "both" || !showClear) && <Combobox.Trigger data-chevron />}
|
|
219
231
|
</Combobox.Control>
|
|
220
232
|
)}
|
|
221
233
|
</Combobox.Context>
|
|
@@ -8,4 +8,8 @@ export type {
|
|
|
8
8
|
SelectItem,
|
|
9
9
|
SelectPayload,
|
|
10
10
|
} from "../../lib/select-data"
|
|
11
|
-
export {
|
|
11
|
+
export {
|
|
12
|
+
Autocomplete,
|
|
13
|
+
type AutocompleteProps,
|
|
14
|
+
type AutocompleteTranslations,
|
|
15
|
+
} from "./autocomplete"
|
|
@@ -51,6 +51,12 @@ describe("Button", () => {
|
|
|
51
51
|
expect(link.getAttribute("aria-busy")).toBe("true")
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
+
it("keeps its own name while loading, with a decorative spinner", () => {
|
|
55
|
+
render(<Button loading>Save</Button>)
|
|
56
|
+
expect(screen.getByRole("button", { name: "Save" }).getAttribute("aria-busy")).toBe("true")
|
|
57
|
+
expect(screen.queryByRole("img")).toBeNull()
|
|
58
|
+
})
|
|
59
|
+
|
|
54
60
|
it("fires onClick normally when not loading", () => {
|
|
55
61
|
const onClick = vi.fn()
|
|
56
62
|
render(<Button onClick={onClick}>Save</Button>)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { type DateValue, useDatePickerContext } from "@ark-ui/react/date-picker"
|
|
4
|
+
import { isSameDay, today } from "@internationalized/date"
|
|
5
|
+
import { type RefObject, useRef } from "react"
|
|
6
|
+
import { calendarValueToDate, dateToArkValue } from "../../lib/date-value"
|
|
7
|
+
import { useIsomorphicLayoutEffect } from "../../lib/use-isomorphic-layout-effect"
|
|
8
|
+
|
|
9
|
+
/** A stable fingerprint of Ark's value array, to recognise one specific `setValue` echo. */
|
|
10
|
+
export const hashArkValues = (values: DateValue[]): string => values.map(String).join(",")
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The value Ark is about to report back from a zone re-seed, or `null`. The root's
|
|
14
|
+
* `onValueChange` swallows the one change whose hash matches it, because re-expressing the
|
|
15
|
+
* selection in a new zone is not a change the user made.
|
|
16
|
+
*/
|
|
17
|
+
export type ZoneReseedRef = RefObject<string | null>
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Keeps an Ark `date-picker` machine's selection on the same **instant** when its `timeZone`
|
|
21
|
+
* changes, without remounting it. Renders nothing; mount it inside `Ark.Root`.
|
|
22
|
+
*
|
|
23
|
+
* Ark reads `defaultValue` once, at mount, and from then on holds the selection as a wall-calendar
|
|
24
|
+
* `DateValue`. A grid pick is a plain `CalendarDate` with no zone at all, so on its own a zone
|
|
25
|
+
* change would keep the *day* and silently move the instant the app was handed by `onChange`. The
|
|
26
|
+
* one zone change every SSR app sees is `timeZone="auto"` going from the UTC hydration snapshot
|
|
27
|
+
* to the host zone, and there the uncontrolled `defaultValue` would stay on the UTC day.
|
|
28
|
+
*
|
|
29
|
+
* So, in a layout effect after the render that changed the zone:
|
|
30
|
+
*
|
|
31
|
+
* - **Uncontrolled**: each value is read back as an instant in the *old* zone (what `onChange`
|
|
32
|
+
* reported) and handed to Ark again in the new one, through `api.setValue`. That may land on
|
|
33
|
+
* another calendar day near midnight, which is the point. `pendingRef` marks the echo so the
|
|
34
|
+
* root doesn't report it through `onChange`.
|
|
35
|
+
* - **Controlled**: nothing to do. The root re-derives Ark's `value` from the app's `Date`s in
|
|
36
|
+
* the new zone on every render, which is already the same instant.
|
|
37
|
+
* - **Focus**: the machine's focused day (the keyboard's roving cell, and the month on show)
|
|
38
|
+
* follows its anchor, the selection or else today, when it sat on that anchor before the
|
|
39
|
+
* change. A month the user navigated to stays put. `setFocusedValue` never moves DOM focus.
|
|
40
|
+
*
|
|
41
|
+
* A remount would do all of this too, but it also resets everything the user did since mount: a
|
|
42
|
+
* pick goes back to `defaultValue`, typed text is cleared, and DOM focus drops to `<body>`.
|
|
43
|
+
*/
|
|
44
|
+
export const CalendarZoneSync = ({
|
|
45
|
+
timeZone,
|
|
46
|
+
controlled,
|
|
47
|
+
pendingRef,
|
|
48
|
+
}: {
|
|
49
|
+
timeZone: string
|
|
50
|
+
controlled: boolean
|
|
51
|
+
pendingRef: ZoneReseedRef
|
|
52
|
+
}) => {
|
|
53
|
+
const api = useDatePickerContext()
|
|
54
|
+
const previous = useRef({ timeZone, value: api.value })
|
|
55
|
+
|
|
56
|
+
// No dependency list on purpose: the previous value has to be the one from the last render,
|
|
57
|
+
// which under a controlled `value` is already the new zone's by the time the zone changes.
|
|
58
|
+
useIsomorphicLayoutEffect(() => {
|
|
59
|
+
const { timeZone: from, value: before } = previous.current
|
|
60
|
+
previous.current = { timeZone, value: api.value }
|
|
61
|
+
if (from === timeZone) return
|
|
62
|
+
|
|
63
|
+
const after = controlled
|
|
64
|
+
? api.value
|
|
65
|
+
: before.map((value) => dateToArkValue(calendarValueToDate(value, from), timeZone))
|
|
66
|
+
if (!controlled && after.length > 0) {
|
|
67
|
+
pendingRef.current = hashArkValues(after)
|
|
68
|
+
api.setValue(after)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// `setValue` also moves the focused day onto the new value, so this runs either way: it
|
|
72
|
+
// either confirms that move or puts back a month the user had navigated to.
|
|
73
|
+
const anchorBefore = before[0] ?? today(from)
|
|
74
|
+
const focused = api.focusedValue
|
|
75
|
+
api.setFocusedValue(isSameDay(focused, anchorBefore) ? (after[0] ?? today(timeZone)) : focused)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
return null
|
|
79
|
+
}
|