@42-central/ui-react 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{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/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 +6 -3
- 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 +206 -84
- 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 +30 -15
- package/dist/components/kbd/index.js.map +1 -1
- package/dist/components/kbd/kbd.d.ts.map +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 +62 -49
- 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 +3 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts +2 -0
- package/dist/components/switch/switch.d.ts.map +1 -1
- 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 +6 -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 +1 -2
- package/package.json +1 -1
- 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 +31 -17
- 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 +212 -0
- package/src/components/data-table/data-table.tsx +92 -23
- 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/kbd/kbd.test.tsx +31 -0
- package/src/components/kbd/kbd.tsx +29 -14
- 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 +74 -27
- package/src/components/schedule/now-cursor-line.tsx +40 -17
- 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/switch/switch.test.tsx +12 -0
- package/src/components/switch/switch.tsx +3 -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.tsx +6 -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 +1 -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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,CAAA,GAAI,IAAA;AAAA,EACtD;AACA,EAAA,MAAM,CAAC,KAAA,EAAO,GAAG,CAAA,GAAI,MAAA;AACrB,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,KAAA,GAAQ,mBAAA,CAAoB,KAAA,EAAO,QAAQ,CAAA,GAAI,IAAA;AAAA,IACtD,GAAA,EAAK,GAAA,GAAM,mBAAA,CAAoB,GAAA,EAAK,QAAQ,CAAA,GAAI;AAAA,GAClD;AACF","file":"chunk-ZB5VMGKB.js","sourcesContent":["import { type DateValue, fromDate, toCalendarDateTime } from \"@internationalized/date\"\n\n/**\n * The `Date ↔ DateValue` boundary (RFC §4/§13, `docs/rfcs/date-picker.md`) — the one place a\n * native `Date` *instant* converts to/from Ark's wall-calendar `DateValue`\n * (`CalendarDate | CalendarDateTime | ZonedDateTime`). `Calendar` and (later) `DatePicker` both\n * funnel every conversion through here, so there is exactly one audited crossing point instead\n * of one per component.\n *\n * `@internationalized/date` internals are deliberately NOT re-exported from this module — keep\n * the public surface to the boundary functions below (PR3's `date-picker/index.ts` re-exports\n * exactly one unrelated helper, `getLocalTimeZone`, directly from the library itself).\n */\n\n/**\n * A range value: `{ start, end }`, each independently nullable (a real \"unset\" endpoint, never\n * `undefined`). Mirrors `Calendar`/`DatePicker`'s `range` value shape.\n */\nexport type DateRangeValue = { start: Date | null; end: Date | null }\n\n/** Convert a native `Date` instant to Ark's `DateValue`, interpreted in `timeZone`. */\nexport function dateToCalendarValue(date: Date, timeZone: string): DateValue {\n return fromDate(date, timeZone)\n}\n\n/**\n * Convert a native `Date` instant to the value handed to Ark's machine: the wall-clock date and\n * time it reads as in `timeZone`, as a zone-free `CalendarDateTime`.\n *\n * Not a `ZonedDateTime`, although that is what `dateToCalendarValue` returns, because Ark copies\n * the zone of whatever it is handed into everything it derives from it: the focused day, the\n * visible month, and through those every grid cell, and a pick keeps the zone of the cell it came\n * from. So when the component's zone changes (`timeZone=\"auto\"` after hydration, or the app's\n * `IntlProvider`), the grid would go on producing picks in the *old* zone. Kept zone-free, the\n * machine only ever holds wall-clock values, and the one zone that turns them back into instants\n * is the component's current one, passed to `calendarValueToDate`.\n */\nexport function dateToArkValue(date: Date, timeZone: string): DateValue {\n return toCalendarDateTime(fromDate(date, timeZone))\n}\n\n/**\n * Convert Ark's `DateValue` back to a native `Date`. A `ZonedDateTime` (what `dateToCalendarValue`\n * produces) already carries its own zone/offset — its `toDate()` takes no argument and would\n * silently ignore a mismatched `timeZone` here — while a plain `CalendarDate`/`CalendarDateTime`\n * (what the day-grid's own calendar arithmetic produces) needs one to resolve to an instant, so\n * branch on which shape we actually got rather than assuming the caller's `dateToCalendarValue`\n * origin.\n */\nexport function calendarValueToDate(value: DateValue, timeZone: string): Date {\n return \"timeZone\" in value ? value.toDate() : value.toDate(timeZone)\n}\n\n/**\n * Wrap a public value into Ark's array contract, each `Date` through `dateToArkValue`. `undefined` stays uncontrolled (Ark's own\n * default takes over); `null` — or an all-null range — clears to `[]`; a single `Date` becomes a\n * one-element array; a range pushes only its defined ends, so a mid-selection range\n * (`{ start, end: null }`) naturally comes out length 1.\n */\nexport function toArkValues(\n value: Date | DateRangeValue | null | undefined,\n timeZone: string,\n): DateValue[] | undefined {\n if (value === undefined) return undefined\n if (value === null) return []\n if (value instanceof Date) return [dateToArkValue(value, timeZone)]\n const values: DateValue[] = []\n if (value.start !== null) values.push(dateToArkValue(value.start, timeZone))\n if (value.end !== null) values.push(dateToArkValue(value.end, timeZone))\n return values\n}\n\n/**\n * The inverse of `toArkValues` — Ark's `value` array back to the public shape. `range` picks\n * which shape to produce; a length-1 array under `range` is a mid-selection (`start` set,\n * `end` still `null`), not an error.\n */\nexport function fromArkValues(\n values: DateValue[],\n range: boolean,\n timeZone: string,\n): Date | DateRangeValue | null {\n if (!range) {\n const [only] = values\n return only ? calendarValueToDate(only, timeZone) : null\n }\n const [start, end] = values\n return {\n start: start ? calendarValueToDate(start, timeZone) : null,\n end: end ? calendarValueToDate(end, timeZone) : null,\n }\n}\n"]}
|
|
@@ -5,7 +5,7 @@ import { ChevronIcon } from '../../chunk-IG7FBZVM.js';
|
|
|
5
5
|
import { Collapse } from '../../chunk-WSIVRDRB.js';
|
|
6
6
|
import { composeChildren } from '../../chunk-I4SQQIP5.js';
|
|
7
7
|
import { props } from '../../chunk-WYCMIIRR.js';
|
|
8
|
-
import { focusStyles } from '../../chunk-
|
|
8
|
+
import { focusStyles } from '../../chunk-INJUILCN.js';
|
|
9
9
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
10
10
|
import { Accordion as Accordion$1 } from '@ark-ui/react/accordion';
|
|
11
11
|
import { cva } from 'class-variance-authority';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { ActionIcon } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
export { ActionIcon } from '../../chunk-RIP5G47F.js';
|
|
3
|
+
import '../../chunk-PS2PZFXH.js';
|
|
4
4
|
import '../../chunk-I4SQQIP5.js';
|
|
5
5
|
import '../../chunk-WYCMIIRR.js';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-INJUILCN.js';
|
|
7
7
|
import '../../chunk-QP4I37PA.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { CloseTrigger, ActionTrigger, Description, Title, Icon, TOAST_STATUS } from '../../chunk-
|
|
2
|
+
import { CloseTrigger, ActionTrigger, Description, Title, Icon, TOAST_STATUS } from '../../chunk-YQHOKMSV.js';
|
|
3
3
|
import '../../chunk-BEL75C7N.js';
|
|
4
4
|
import '../../chunk-IG7FBZVM.js';
|
|
5
5
|
import '../../chunk-WSIVRDRB.js';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-PS2PZFXH.js';
|
|
7
7
|
import { withAsChildContent } from '../../chunk-I4SQQIP5.js';
|
|
8
8
|
import { props } from '../../chunk-WYCMIIRR.js';
|
|
9
|
-
import { focusStyles } from '../../chunk-
|
|
9
|
+
import { focusStyles } from '../../chunk-INJUILCN.js';
|
|
10
10
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
11
11
|
import { ark } from '@ark-ui/react';
|
|
12
12
|
import { cva } from 'class-variance-authority';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { mergeRefs } from '../../chunk-UVYTJQTJ.js';
|
|
3
|
-
import { Drawer } from '../../chunk-
|
|
3
|
+
import { Drawer } from '../../chunk-DBTJEBMO.js';
|
|
4
4
|
import { useContainerQuery } from '../../chunk-P3XMBETI.js';
|
|
5
5
|
import '../../chunk-AIQG7IIT.js';
|
|
6
6
|
import '../../chunk-7P32XCEU.js';
|
|
7
7
|
import '../../chunk-BUIHQJGE.js';
|
|
8
|
-
import '../../chunk-
|
|
9
|
-
import '../../chunk-
|
|
8
|
+
import '../../chunk-RIP5G47F.js';
|
|
9
|
+
import '../../chunk-PS2PZFXH.js';
|
|
10
10
|
import '../../chunk-I4SQQIP5.js';
|
|
11
11
|
import { props } from '../../chunk-WYCMIIRR.js';
|
|
12
|
-
import '../../chunk-
|
|
12
|
+
import '../../chunk-INJUILCN.js';
|
|
13
13
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
14
14
|
import { ark } from '@ark-ui/react';
|
|
15
15
|
import { createContext, useRef, useState, useContext } from 'react';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type FocusEvent, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type ClearSectionMode, type ItemRenderState, type NormalizedItem, type SelectData, type SelectPayload } from "../../lib/select-data";
|
|
3
3
|
import type { WithTestId } from "../../lib/test-id";
|
|
4
|
+
import { type ComboboxTranslations } from "../combobox/combobox";
|
|
4
5
|
import { type FieldProps } from "../field/field";
|
|
5
6
|
import { type InputSize, type InputVariant } from "../input/input";
|
|
6
7
|
/**
|
|
@@ -64,7 +65,13 @@ export type AutocompleteProps<Data extends SelectData = SelectData> = Pick<Field
|
|
|
64
65
|
ref?: Ref<HTMLInputElement>;
|
|
65
66
|
className?: string;
|
|
66
67
|
classNames?: AutocompleteClassNames;
|
|
68
|
+
/** Overrides the clear button's (`clearTriggerLabel`, default `"Clear value"`) and the
|
|
69
|
+
* chevron's (`triggerLabel`, default `"Show options"`) accessible names. A partial
|
|
70
|
+
* override keeps the other default. */
|
|
71
|
+
translations?: AutocompleteTranslations;
|
|
67
72
|
};
|
|
68
|
-
|
|
73
|
+
/** The combobox family's wording, as `Autocomplete` uses it — see `ComboboxTranslations`. */
|
|
74
|
+
export type AutocompleteTranslations = ComboboxTranslations;
|
|
75
|
+
export declare const Autocomplete: <const Data extends SelectData = SelectData>({ data, value, defaultValue, onChange, renderItem, placeholder, clearable, clearSectionMode, startSlot, endSlot, empty, size, variant, disabled, readOnly, required, invalid, name, onBlur, ref, label, description, error, className, classNames, testId, translations, }: AutocompleteProps<Data>) => import("react").JSX.Element;
|
|
69
76
|
export {};
|
|
70
77
|
//# sourceMappingURL=autocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAW,MAAM,OAAO,CAAA;AAI1E,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,eAAe,EACpB,KAAK,cAAc,EAEnB,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK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ACpB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,yGAAyG;IACzG,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,4CAA4C;IAC5C,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,yEAAyE;IACzE,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACtD,2DAA2D;IAC3D,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,sBAAsB,CAAA;IACnC;;4CAEwC;IACxC,YAAY,CAAC,EAAE,wBAAwB,CAAA;CACxC,CAAA;AAEH,6FAA6F;AAC7F,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CAAA;AAE3D,eAAO,MAAM,YAAY,GAAI,KAAK,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,8QA4BpE,iBAAiB,CAAC,IAAI,CAAC,gCAgIzB,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { ItemRenderState, NormalizedItem, SelectData, SelectGroup, SelectItem, SelectPayload, } from "../../lib/select-data";
|
|
2
|
-
export { Autocomplete, type AutocompleteProps } from "./autocomplete";
|
|
2
|
+
export { Autocomplete, type AutocompleteProps, type AutocompleteTranslations, } from "./autocomplete";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,aAAa,GACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,aAAa,GACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,GAC9B,MAAM,gBAAgB,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { controlOpenProps } from '../../chunk-5FDOOG4J.js';
|
|
3
3
|
import { normalizeSelectData, filterSelectData } from '../../chunk-TWGCWKRV.js';
|
|
4
|
-
import { Combobox } from '../../chunk-
|
|
5
|
-
import { inputControlClasses, inputSlot } from '../../chunk-
|
|
6
|
-
import { FieldShell } from '../../chunk-
|
|
7
|
-
import { popoverClearTrigger } from '../../chunk-
|
|
4
|
+
import { resolveComboboxTranslations, Combobox } from '../../chunk-PINENGML.js';
|
|
5
|
+
import { inputControlClasses, inputSlot } from '../../chunk-Z6RPMRFH.js';
|
|
6
|
+
import { FieldShell } from '../../chunk-TBTSEPGP.js';
|
|
7
|
+
import { popoverClearTrigger } from '../../chunk-LM6F6DLR.js';
|
|
8
8
|
import '../../chunk-AIQG7IIT.js';
|
|
9
9
|
import '../../chunk-7P32XCEU.js';
|
|
10
10
|
import '../../chunk-BUIHQJGE.js';
|
|
@@ -43,8 +43,10 @@ var Autocomplete = ({
|
|
|
43
43
|
error,
|
|
44
44
|
className,
|
|
45
45
|
classNames,
|
|
46
|
-
testId
|
|
46
|
+
testId,
|
|
47
|
+
translations
|
|
47
48
|
}) => {
|
|
49
|
+
const resolvedTranslations = resolveComboboxTranslations(translations);
|
|
48
50
|
const isInvalid = invalid || error != null;
|
|
49
51
|
const [query, setQuery] = useUncontrolled({
|
|
50
52
|
value,
|
|
@@ -86,6 +88,7 @@ var Autocomplete = ({
|
|
|
86
88
|
size,
|
|
87
89
|
variant,
|
|
88
90
|
className,
|
|
91
|
+
translations: resolvedTranslations,
|
|
89
92
|
children: [
|
|
90
93
|
/* @__PURE__ */ jsx(Combobox.Context, { children: (api) => /* @__PURE__ */ jsxs(
|
|
91
94
|
Combobox.Control,
|
|
@@ -112,14 +115,14 @@ var Autocomplete = ({
|
|
|
112
115
|
"button",
|
|
113
116
|
{
|
|
114
117
|
type: "button",
|
|
115
|
-
"aria-label":
|
|
118
|
+
"aria-label": resolvedTranslations.clearTriggerLabel,
|
|
116
119
|
onPointerDown: (event) => event.preventDefault(),
|
|
117
120
|
onClick: () => setQuery(""),
|
|
118
121
|
className: popoverClearTrigger,
|
|
119
122
|
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
120
123
|
}
|
|
121
124
|
),
|
|
122
|
-
(clearSectionMode === "both" || !showClear) && /* @__PURE__ */ jsx(Combobox.Trigger, { "
|
|
125
|
+
(clearSectionMode === "both" || !showClear) && /* @__PURE__ */ jsx(Combobox.Trigger, { "data-chevron": true })
|
|
123
126
|
]
|
|
124
127
|
}
|
|
125
128
|
) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/autocomplete/autocomplete.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;;;;;;AA6FO,IAAM,eAAe,CAA6C;AAAA,EACvE,IAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA,GAAmB,SAAA;AAAA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zB,SAAS,IAAA,oBAAQ,GAAA,CAAC,QAAA,CAAS,KAAA,EAAT,EAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,SAAA,EAC3C;AAAA;AAAA;AAAA,GACF;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport { props } from \"../../lib/props\"\nimport {\n type ClearSectionMode,\n filterSelectData,\n type ItemRenderState,\n type NormalizedItem,\n normalizeSelectData,\n type SelectData,\n type SelectPayload,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Combobox } from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport { type InputSize, type InputVariant, inputControlClasses, inputSlot } from \"../input/input\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { popoverClearTrigger } from \"../popover/popover\"\n\n/**\n * Autocomplete — free-text input with a suggestion popover, on the `Combobox`\n * engine. Unlike `Select`, the **value is the typed string** (`allowCustomValue`):\n * `data` are only suggestions, and the user can type anything or pick one.\n *\n * - `data` accepts the same shapes as `Select` (strings / objects / groups).\n * - Suggestions filter as you type. Once the query exactly\n * matches a suggestion (e.g. right after picking one) the full list shows\n * again rather than collapsing to that single match.\n * - Label / description / error come from the built-in `Field` wrapper.\n */\n\ntype AutocompleteClassNames = {\n field?: string\n control?: string\n input?: string\n option?: string\n popover?: string\n}\n\nexport type AutocompleteProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Suggestions: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled input text (this is the value). */\n value?: string\n /** Uncontrolled initial text. */\n defaultValue?: string\n /** Fires with the input text on every change (typing or picking a suggestion). */\n onChange?: (value: string) => void\n /**\n * Render each suggestion yourself. Receives the item — including its typed\n * `payload` — and its live `{ selected, highlighted }` state; you own the whole\n * row, including any check affordance. Omit it to render the label + selected\n * check.\n */\n renderItem?: (item: NormalizedItem<SelectPayload<Data>>, state: ItemRenderState) => ReactNode\n /** Placeholder shown while the field is empty — this same field also filters the\n * suggestion list, so there's no separate search placeholder. */\n placeholder?: string\n /** Show a clear button once there's text. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the clear button / chevron. */\n endSlot?: ReactNode\n /** Message shown when no suggestion matches. Pass `null` to render nothing. */\n empty?: ReactNode\n size?: InputSize\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for the underlying input (form submission). */\n name?: string\n /** Forwarded to the input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: AutocompleteClassNames\n }\n\nexport const Autocomplete = <const Data extends SelectData = SelectData>({\n data,\n value,\n defaultValue,\n onChange,\n renderItem,\n placeholder,\n clearable,\n clearSectionMode = \"replace\",\n startSlot,\n endSlot,\n empty = \"Nothing found\",\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: AutocompleteProps<Data>) => {\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [query, setQuery] = useUncontrolled({\n value,\n defaultValue,\n onChange,\n finalValue: \"\",\n })\n\n // Clear shows once there's text; in \"replace\" mode it hides the chevron.\n const showClear = Boolean(clearable && query)\n\n // Normalize once per `data`; only the filter re-runs as the query changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const { collection, items, groups } = useMemo(() => {\n const q = query.trim().toLowerCase()\n // Once the query exactly matches an option (e.g. right after\n // picking one) show the full list again rather than just that match.\n const exact = normalized.items.some((i) => i.label.toLowerCase() === q)\n const shouldFilter = q.length > 0 && !exact\n return filterSelectData(\n normalized,\n (item) => !shouldFilter || item.label.toLowerCase().includes(q),\n )\n }, [normalized, query])\n\n const renderOption = (item: NormalizedItem) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item as NormalizedItem<SelectPayload<Data>>, state)\n : item.label}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root\n collection={collection}\n inputValue={query}\n onInputValueChange={(details) => setQuery(details.inputValue)}\n allowCustomValue\n openOnClick\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={className}\n >\n <Combobox.Context>\n {(api) => (\n <Combobox.Control\n className={classNames?.control}\n startSlot={startSlot}\n {...props({ \"data-invalid\": isInvalid })}\n // Tablet affordance: a tap on the field's dead zones (start/end slots,\n // padding) opens the suggestions and focuses the input. The input,\n // clear ✕ and chevron keep their own taps. Inert when disabled/readOnly.\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n >\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on the\n real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`, replicated\n here. `onBlur` / `aria-invalid` pass straight through. */}\n <ArkCombobox.Input\n placeholder={placeholder}\n name={name}\n onBlur={onBlur}\n ref={ref}\n aria-invalid={isInvalid || undefined}\n {...props({ \"data-testid\": testId })}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {/* The value here is the typed text, not a machine selection, so Ark's\n `value`-gated ClearTrigger stays hidden — clear the input directly\n instead. A real (tabbable) button; `preventDefault` keeps focus on\n the input through the tap. */}\n {showClear && (\n <button\n type=\"button\"\n aria-label=\"Clear value\"\n onPointerDown={(event) => event.preventDefault()}\n onClick={() => setQuery(\"\")}\n className={popoverClearTrigger}\n >\n <CloseIcon />\n </button>\n )}\n {(clearSectionMode === \"both\" || !showClear) && (\n <Combobox.Trigger aria-label=\"Show options\" data-chevron />\n )}\n </Combobox.Control>\n )}\n </Combobox.Context>\n\n <Combobox.Content className={classNames?.popover}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Content>\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/autocomplete/autocomplete.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;;;;;;AAwGO,IAAM,eAAe,CAA6C;AAAA,EACvE,IAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA,GAAmB,SAAA;AAAA,EACnB,SAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA,GAAQ,eAAA;AAAA,EACR,IAAA,GAAO,IAAA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AQ,GAAA,CAAC,QAAA,CAAS,KAAA,EAAT,EAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,SAAA,EAC3C;AAAA;AAAA;AAAA,GACF;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport { props } from \"../../lib/props\"\nimport {\n type ClearSectionMode,\n filterSelectData,\n type ItemRenderState,\n type NormalizedItem,\n normalizeSelectData,\n type SelectData,\n type SelectPayload,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport {\n Combobox,\n type ComboboxTranslations,\n resolveComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport { type InputSize, type InputVariant, inputControlClasses, inputSlot } from \"../input/input\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { popoverClearTrigger } from \"../popover/popover\"\n\n/**\n * Autocomplete — free-text input with a suggestion popover, on the `Combobox`\n * engine. Unlike `Select`, the **value is the typed string** (`allowCustomValue`):\n * `data` are only suggestions, and the user can type anything or pick one.\n *\n * - `data` accepts the same shapes as `Select` (strings / objects / groups).\n * - Suggestions filter as you type. Once the query exactly\n * matches a suggestion (e.g. right after picking one) the full list shows\n * again rather than collapsing to that single match.\n * - Label / description / error come from the built-in `Field` wrapper.\n */\n\ntype AutocompleteClassNames = {\n field?: string\n control?: string\n input?: string\n option?: string\n popover?: string\n}\n\nexport type AutocompleteProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Suggestions: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled input text (this is the value). */\n value?: string\n /** Uncontrolled initial text. */\n defaultValue?: string\n /** Fires with the input text on every change (typing or picking a suggestion). */\n onChange?: (value: string) => void\n /**\n * Render each suggestion yourself. Receives the item — including its typed\n * `payload` — and its live `{ selected, highlighted }` state; you own the whole\n * row, including any check affordance. Omit it to render the label + selected\n * check.\n */\n renderItem?: (item: NormalizedItem<SelectPayload<Data>>, state: ItemRenderState) => ReactNode\n /** Placeholder shown while the field is empty — this same field also filters the\n * suggestion list, so there's no separate search placeholder. */\n placeholder?: string\n /** Show a clear button once there's text. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the clear button / chevron. */\n endSlot?: ReactNode\n /** Message shown when no suggestion matches. Pass `null` to render nothing. */\n empty?: ReactNode\n size?: InputSize\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for the underlying input (form submission). */\n name?: string\n /** Forwarded to the input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: AutocompleteClassNames\n /** Overrides the clear button's (`clearTriggerLabel`, default `\"Clear value\"`) and the\n * chevron's (`triggerLabel`, default `\"Show options\"`) accessible names. A partial\n * override keeps the other default. */\n translations?: AutocompleteTranslations\n }\n\n/** The combobox family's wording, as `Autocomplete` uses it — see `ComboboxTranslations`. */\nexport type AutocompleteTranslations = ComboboxTranslations\n\nexport const Autocomplete = <const Data extends SelectData = SelectData>({\n data,\n value,\n defaultValue,\n onChange,\n renderItem,\n placeholder,\n clearable,\n clearSectionMode = \"replace\",\n startSlot,\n endSlot,\n empty = \"Nothing found\",\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n}: AutocompleteProps<Data>) => {\n const resolvedTranslations = resolveComboboxTranslations(translations)\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [query, setQuery] = useUncontrolled({\n value,\n defaultValue,\n onChange,\n finalValue: \"\",\n })\n\n // Clear shows once there's text; in \"replace\" mode it hides the chevron.\n const showClear = Boolean(clearable && query)\n\n // Normalize once per `data`; only the filter re-runs as the query changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const { collection, items, groups } = useMemo(() => {\n const q = query.trim().toLowerCase()\n // Once the query exactly matches an option (e.g. right after\n // picking one) show the full list again rather than just that match.\n const exact = normalized.items.some((i) => i.label.toLowerCase() === q)\n const shouldFilter = q.length > 0 && !exact\n return filterSelectData(\n normalized,\n (item) => !shouldFilter || item.label.toLowerCase().includes(q),\n )\n }, [normalized, query])\n\n const renderOption = (item: NormalizedItem) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item as NormalizedItem<SelectPayload<Data>>, state)\n : item.label}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root\n collection={collection}\n inputValue={query}\n onInputValueChange={(details) => setQuery(details.inputValue)}\n allowCustomValue\n openOnClick\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={className}\n translations={resolvedTranslations}\n >\n <Combobox.Context>\n {(api) => (\n <Combobox.Control\n className={classNames?.control}\n startSlot={startSlot}\n {...props({ \"data-invalid\": isInvalid })}\n // Tablet affordance: a tap on the field's dead zones (start/end slots,\n // padding) opens the suggestions and focuses the input. The input,\n // clear ✕ and chevron keep their own taps. Inert when disabled/readOnly.\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n >\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on the\n real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`, replicated\n here. `onBlur` / `aria-invalid` pass straight through. */}\n <ArkCombobox.Input\n placeholder={placeholder}\n name={name}\n onBlur={onBlur}\n ref={ref}\n aria-invalid={isInvalid || undefined}\n {...props({ \"data-testid\": testId })}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {/* The value here is the typed text, not a machine selection, so Ark's\n `value`-gated ClearTrigger stays hidden — clear the input directly\n instead. A real (tabbable) button; `preventDefault` keeps focus on\n the input through the tap. */}\n {showClear && (\n <button\n type=\"button\"\n aria-label={resolvedTranslations.clearTriggerLabel}\n onPointerDown={(event) => event.preventDefault()}\n onClick={() => setQuery(\"\")}\n className={popoverClearTrigger}\n >\n <CloseIcon />\n </button>\n )}\n {(clearSectionMode === \"both\" || !showClear) && <Combobox.Trigger data-chevron />}\n </Combobox.Control>\n )}\n </Combobox.Context>\n\n <Combobox.Content className={classNames?.popover}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Content>\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GRADIENT_DIR_CLASS, buildGradientVars } from '../../chunk-SKPM2FRX.js';
|
|
2
2
|
import { props } from '../../chunk-WYCMIIRR.js';
|
|
3
|
-
import { focusStyles } from '../../chunk-
|
|
3
|
+
import { focusStyles } from '../../chunk-INJUILCN.js';
|
|
4
4
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
5
5
|
import { ark } from '@ark-ui/react';
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import '../../chunk-ORTCK34Y.js';
|
|
3
|
-
export { Button } from '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
3
|
+
export { Button } from '../../chunk-QIDAXFKK.js';
|
|
4
|
+
import '../../chunk-PS2PZFXH.js';
|
|
5
5
|
import '../../chunk-I4SQQIP5.js';
|
|
6
6
|
import '../../chunk-WYCMIIRR.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-INJUILCN.js';
|
|
8
8
|
import '../../chunk-QP4I37PA.js';
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Context, Item, MultiRoot, ButtonSelectControl } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
2
|
+
import { Context, Item, MultiRoot, ButtonSelectControl } from '../../chunk-A6MYJTJI.js';
|
|
3
|
+
import '../../chunk-TBTSEPGP.js';
|
|
4
|
+
import '../../chunk-QIDAXFKK.js';
|
|
5
5
|
import '../../chunk-2SVX3MQQ.js';
|
|
6
6
|
import { useUncontrolled } from '../../chunk-BEL75C7N.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-PS2PZFXH.js';
|
|
8
8
|
import '../../chunk-I4SQQIP5.js';
|
|
9
9
|
import '../../chunk-WYCMIIRR.js';
|
|
10
|
-
import '../../chunk-
|
|
10
|
+
import '../../chunk-INJUILCN.js';
|
|
11
11
|
import '../../chunk-QP4I37PA.js';
|
|
12
12
|
import { jsx } from 'react/jsx-runtime';
|
|
13
13
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Context, Item, Root, ButtonSelectControl } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
2
|
+
import { Context, Item, Root, ButtonSelectControl } from '../../chunk-A6MYJTJI.js';
|
|
3
|
+
import '../../chunk-TBTSEPGP.js';
|
|
4
|
+
import '../../chunk-QIDAXFKK.js';
|
|
5
5
|
import '../../chunk-2SVX3MQQ.js';
|
|
6
6
|
import { useUncontrolled } from '../../chunk-BEL75C7N.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-PS2PZFXH.js';
|
|
8
8
|
import '../../chunk-I4SQQIP5.js';
|
|
9
9
|
import '../../chunk-WYCMIIRR.js';
|
|
10
|
-
import '../../chunk-
|
|
10
|
+
import '../../chunk-INJUILCN.js';
|
|
11
11
|
import '../../chunk-QP4I37PA.js';
|
|
12
12
|
import { jsx } from 'react/jsx-runtime';
|
|
13
13
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type DateValue } from "@ark-ui/react/date-picker";
|
|
2
|
+
import { type RefObject } from "react";
|
|
3
|
+
/** A stable fingerprint of Ark's value array, to recognise one specific `setValue` echo. */
|
|
4
|
+
export declare const hashArkValues: (values: DateValue[]) => string;
|
|
5
|
+
/**
|
|
6
|
+
* The value Ark is about to report back from a zone re-seed, or `null`. The root's
|
|
7
|
+
* `onValueChange` swallows the one change whose hash matches it, because re-expressing the
|
|
8
|
+
* selection in a new zone is not a change the user made.
|
|
9
|
+
*/
|
|
10
|
+
export type ZoneReseedRef = RefObject<string | null>;
|
|
11
|
+
/**
|
|
12
|
+
* Keeps an Ark `date-picker` machine's selection on the same **instant** when its `timeZone`
|
|
13
|
+
* changes, without remounting it. Renders nothing; mount it inside `Ark.Root`.
|
|
14
|
+
*
|
|
15
|
+
* Ark reads `defaultValue` once, at mount, and from then on holds the selection as a wall-calendar
|
|
16
|
+
* `DateValue`. A grid pick is a plain `CalendarDate` with no zone at all, so on its own a zone
|
|
17
|
+
* change would keep the *day* and silently move the instant the app was handed by `onChange`. The
|
|
18
|
+
* one zone change every SSR app sees is `timeZone="auto"` going from the UTC hydration snapshot
|
|
19
|
+
* to the host zone, and there the uncontrolled `defaultValue` would stay on the UTC day.
|
|
20
|
+
*
|
|
21
|
+
* So, in a layout effect after the render that changed the zone:
|
|
22
|
+
*
|
|
23
|
+
* - **Uncontrolled**: each value is read back as an instant in the *old* zone (what `onChange`
|
|
24
|
+
* reported) and handed to Ark again in the new one, through `api.setValue`. That may land on
|
|
25
|
+
* another calendar day near midnight, which is the point. `pendingRef` marks the echo so the
|
|
26
|
+
* root doesn't report it through `onChange`.
|
|
27
|
+
* - **Controlled**: nothing to do. The root re-derives Ark's `value` from the app's `Date`s in
|
|
28
|
+
* the new zone on every render, which is already the same instant.
|
|
29
|
+
* - **Focus**: the machine's focused day (the keyboard's roving cell, and the month on show)
|
|
30
|
+
* follows its anchor, the selection or else today, when it sat on that anchor before the
|
|
31
|
+
* change. A month the user navigated to stays put. `setFocusedValue` never moves DOM focus.
|
|
32
|
+
*
|
|
33
|
+
* A remount would do all of this too, but it also resets everything the user did since mount: a
|
|
34
|
+
* pick goes back to `defaultValue`, typed text is cleared, and DOM focus drops to `<body>`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const CalendarZoneSync: ({ timeZone, controlled, pendingRef, }: {
|
|
37
|
+
timeZone: string;
|
|
38
|
+
controlled: boolean;
|
|
39
|
+
pendingRef: ZoneReseedRef;
|
|
40
|
+
}) => null;
|
|
41
|
+
//# sourceMappingURL=calendar-zone-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-zone-sync.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/calendar-zone-sync.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,2BAA2B,CAAA;AAEhF,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAA;AAI9C,4FAA4F;AAC5F,eAAO,MAAM,aAAa,WAAY,SAAS,EAAE,KAAG,MAAsC,CAAA;AAE1F;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,gBAAgB,0CAI1B;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,aAAa,CAAA;CAC1B,SA2BA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatePicker as Ark, type DatePickerDateView as DateView } from "@ark-ui/react/date-picker";
|
|
2
|
-
import type
|
|
2
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
3
3
|
import type { DatePredicate } from "../../lib/date-predicates";
|
|
4
4
|
import { type DateRangeValue } from "../../lib/date-value";
|
|
5
5
|
import type { FormControlProps } from "../../lib/form-control";
|
|
@@ -70,10 +70,11 @@ export type CalendarProps<Range extends boolean = false> = FormControlProps<Rang
|
|
|
70
70
|
withWeekNumbers?: boolean;
|
|
71
71
|
/** Overrides the active locale context. Drives month/day names and first-day-of-week. */
|
|
72
72
|
locale?: string;
|
|
73
|
-
/** Overrides the
|
|
74
|
-
* `
|
|
75
|
-
*
|
|
76
|
-
*
|
|
73
|
+
/** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves
|
|
74
|
+
* **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Schedule` — **not** Ark's
|
|
75
|
+
* own machine default (`"UTC"`), which is why the resolved zone is forwarded to `Ark.Root`
|
|
76
|
+
* explicitly rather than only used in this component's own conversions (see
|
|
77
|
+
* `lib/date-value.ts`'s module doc). Accepts `"auto"` to follow the host zone. */
|
|
77
78
|
timeZone?: string;
|
|
78
79
|
/** Overrides Ark's own built-in aria-label/accessible-name strings (day cells, prev/next, the
|
|
79
80
|
* view-cycling header, week numbers) — English by default. Unlike `locale`, nothing here
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,KAAK,kBAAkB,IAAI,QAAQ,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,KAAK,kBAAkB,IAAI,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAElG,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAA;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAG9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAgB,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAG3E;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG;IACxD,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;sEAEsE;AACtE,KAAK,eAAe,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAA;AAEnF;;0FAE0F;AAC1F,MAAM,MAAM,oBAAoB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AA;IAClB,UAAU,CAAC,EAAE,kBAAkB,CAAA;CAChC,CAAA;AAEH,eAAO,MAAM,QAAQ,GAAI,KAAK,SAAS,OAAO,GAAG,KAAK,oRA6BnD,aAAa,CAAC,KAAK,CAAC,gCAoFtB,CAAA"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Calendar } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
2
|
+
export { Calendar } from '../../chunk-VZBUQNLX.js';
|
|
3
|
+
import '../../chunk-ZB5VMGKB.js';
|
|
4
|
+
import '../../chunk-57BTVRRB.js';
|
|
5
|
+
import '../../chunk-OC7I2CTA.js';
|
|
6
|
+
import '../../chunk-BUIHQJGE.js';
|
|
7
|
+
import '../../chunk-RIP5G47F.js';
|
|
5
8
|
import '../../chunk-IG7FBZVM.js';
|
|
6
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-PS2PZFXH.js';
|
|
7
10
|
import '../../chunk-I4SQQIP5.js';
|
|
8
11
|
import '../../chunk-WYCMIIRR.js';
|
|
9
|
-
import '../../chunk-
|
|
12
|
+
import '../../chunk-INJUILCN.js';
|
|
10
13
|
import '../../chunk-QP4I37PA.js';
|
|
11
14
|
//# sourceMappingURL=index.js.map
|
|
12
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -13,8 +13,9 @@ import type { WithTestId } from "../../lib/test-id";
|
|
|
13
13
|
* of this kit's own hues that clears every check in the dataviz skill's
|
|
14
14
|
* `validate_palette.js` (lightness band, CVD Delta E, and normal-vision
|
|
15
15
|
* separation, all-pairs, not just adjacent) without relying on a specific
|
|
16
|
-
* order
|
|
17
|
-
*
|
|
16
|
+
* order, as measured at the 500 step (the dark-mode fill; light mode reads
|
|
17
|
+
* one step darker, see `styles.css`). Every other pairing among the
|
|
18
|
+
* remaining five hues fails outright there — `red`/`orange` and
|
|
18
19
|
* `teal`/`green` read as near-duplicates even to normal color vision, and
|
|
19
20
|
* `purple`/`blue` and `cyan`/`pink` fail the colorblind-safety floor. Rather
|
|
20
21
|
* than drop those five hues from a consumer's options entirely, they're
|
|
@@ -36,15 +37,17 @@ export declare const CHART_PALETTE: Color[];
|
|
|
36
37
|
export declare function chartColors(colors?: Color[]): string[];
|
|
37
38
|
export type ChartProps<TDatum = unknown, TXValue extends ChartValue = ChartValue, TYValue extends ChartValue = ChartValue> = Omit<TanStackChartProps<TDatum, TXValue, TYValue>, "renderSvg"> & WithTestId & {
|
|
38
39
|
/**
|
|
39
|
-
* Single accent for a one-series chart: sets `data-color`
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* `
|
|
40
|
+
* Single accent for a one-series chart: sets `data-color` on the root,
|
|
41
|
+
* and the series paints with that palette's chart fill — its 600 step in
|
|
42
|
+
* light mode, its `--c-solid` in dark (also mirrored into
|
|
43
|
+
* `--ts-chart-1`). Omitted, a one-series chart inherits the nearest
|
|
44
|
+
* ancestor's `data-color` instead, like every other colored component.
|
|
45
|
+
* Ignored for the palette slots when `colors` has several entries.
|
|
43
46
|
*/
|
|
44
47
|
color?: Color;
|
|
45
48
|
/**
|
|
46
49
|
* Ordered palette for a multi-series chart — see `CHART_PALETTE`/
|
|
47
|
-
* `chartColors`.
|
|
50
|
+
* `chartColors`. A single entry behaves exactly like `color`. Otherwise sets `--ts-chart-1` through `--ts-chart-N`, one per
|
|
48
51
|
* entry, for TanStack's own default categorical color scale to pick up
|
|
49
52
|
* with zero changes to how the chart's `definition` builds its scales.
|
|
50
53
|
* Beyond `--ts-chart-6`, only a custom `scaleOrdinal().range(...)` (see
|
|
@@ -85,8 +88,12 @@ export type ChartProps<TDatum = unknown, TXValue extends ChartValue = ChartValue
|
|
|
85
88
|
* - The DOM tooltip surface/text/shadow/border and its "active row"
|
|
86
89
|
* highlight theme through `--ts-chart-tooltip-*` / `--ts-chart-tooltip-
|
|
87
90
|
* active-row-*`, also set in `styles.css`.
|
|
88
|
-
* -
|
|
89
|
-
*
|
|
91
|
+
* - A one-series chart paints with `--chart-solid`, so it follows `color`
|
|
92
|
+
* or an inherited `data-color` (see `inheritedColorScale`); `colors`
|
|
93
|
+
* themes a multi-series palette via `--ts-chart-N`, TanStack's own
|
|
94
|
+
* default color-scale slots. Both read `styles.css`'s per-color chart
|
|
95
|
+
* fill: the 600 step in light mode, so a mark clears 3:1 against the
|
|
96
|
+
* page, and the unchanged solid in dark.
|
|
90
97
|
*
|
|
91
98
|
* Not routed through Ark's `ark.*` factory (no `asChild`): TanStack's
|
|
92
99
|
* `<Chart>` owns its entire internal DOM/SVG tree end to end, so there's no
|
|
@@ -99,5 +106,5 @@ export type ChartProps<TDatum = unknown, TXValue extends ChartValue = ChartValue
|
|
|
99
106
|
* `className`/`style` reach its DOM), so this root is the only element that
|
|
100
107
|
* can carry them.
|
|
101
108
|
*/
|
|
102
|
-
export declare function Chart<TDatum, TXValue extends ChartValue = ChartValue, TYValue extends ChartValue = ChartValue>({ color, colors, className, style, testId, renderer, renderSvg, onRender, ...rest }: ChartProps<TDatum, TXValue, TYValue>): import("react").JSX.Element;
|
|
109
|
+
export declare function Chart<TDatum, TXValue extends ChartValue = ChartValue, TYValue extends ChartValue = ChartValue>({ color, colors, className, style, testId, definition, renderer, renderSvg, onRender, ...rest }: ChartProps<TDatum, TXValue, TYValue>): import("react").JSX.Element;
|
|
103
110
|
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/chart/chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/chart/chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,UAAU,EAGX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,UAAU,IAAI,kBAAkB,EACtC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAEL,KAAK,UAAU,IAA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EAAE,OAAO,CAAC,+BA0CtC"}
|
|
@@ -4,10 +4,45 @@ import { props } from '../../chunk-WYCMIIRR.js';
|
|
|
4
4
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
5
5
|
import { Chart as Chart$2 } from '@tanstack/charts/react';
|
|
6
6
|
import { Chart as Chart$1 } from '@tanstack/charts/react/core';
|
|
7
|
+
import { useMemo } from 'react';
|
|
7
8
|
import { jsx } from 'react/jsx-runtime';
|
|
8
9
|
|
|
9
10
|
var KNOWN_COLORS = COLORS;
|
|
10
|
-
var resolveChartColor = (color) => KNOWN_COLORS.includes(color) ? `var(--
|
|
11
|
+
var resolveChartColor = (color) => KNOWN_COLORS.includes(color) ? `var(--chart-${color})` : color;
|
|
12
|
+
var INHERITED_SOLID = "var(--chart-solid)";
|
|
13
|
+
var isChartKey = (value) => typeof value === "string" || typeof value === "number";
|
|
14
|
+
var inheritedColorScale = {
|
|
15
|
+
id: "42ui-inherited-color",
|
|
16
|
+
resolve: ({ values, domain, range, theme }) => {
|
|
17
|
+
const keys = [...new Set((domain ?? values).filter(isChartKey))];
|
|
18
|
+
if (!keys.length) {
|
|
19
|
+
return {
|
|
20
|
+
type: "ordinal",
|
|
21
|
+
kind: "categorical",
|
|
22
|
+
domain: [],
|
|
23
|
+
range: [INHERITED_SOLID],
|
|
24
|
+
map: () => INHERITED_SOLID
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const slots = range?.length ? range : theme.palette;
|
|
28
|
+
return {
|
|
29
|
+
type: "ordinal",
|
|
30
|
+
kind: "categorical",
|
|
31
|
+
domain: keys,
|
|
32
|
+
range: slots,
|
|
33
|
+
map: (value) => {
|
|
34
|
+
if (value == null) return slots[0] ?? "currentColor";
|
|
35
|
+
let index = keys.indexOf(value);
|
|
36
|
+
if (index < 0) index = keys.push(value) - 1;
|
|
37
|
+
return slots[index % slots.length] ?? "currentColor";
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
function withInheritedColor(definition) {
|
|
43
|
+
if ("chart" in definition || definition.color || definition.theme?.palette) return definition;
|
|
44
|
+
return { ...definition, color: { resolver: inheritedColorScale } };
|
|
45
|
+
}
|
|
11
46
|
var CHART_PALETTE = [
|
|
12
47
|
"blue",
|
|
13
48
|
"green",
|
|
@@ -28,16 +63,23 @@ function Chart({
|
|
|
28
63
|
className,
|
|
29
64
|
style,
|
|
30
65
|
testId,
|
|
66
|
+
definition,
|
|
31
67
|
renderer,
|
|
32
68
|
renderSvg,
|
|
33
69
|
onRender,
|
|
34
70
|
...rest
|
|
35
71
|
}) {
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
const multiPalette = colors && colors.length > 1 ? colors : void 0;
|
|
73
|
+
const dataColor = multiPalette ? color : color ?? colors?.[0];
|
|
74
|
+
const slots = multiPalette ? chartColors(multiPalette) : dataColor ? [INHERITED_SOLID] : [];
|
|
75
|
+
const paletteStyle = Object.fromEntries(
|
|
76
|
+
slots.map((value, index) => [`--ts-chart-${index + 1}`, value])
|
|
77
|
+
);
|
|
78
|
+
const keepsOwnPalette = multiPalette !== void 0;
|
|
79
|
+
const resolved = useMemo(
|
|
80
|
+
() => keepsOwnPalette ? definition : withInheritedColor(definition),
|
|
81
|
+
[definition, keepsOwnPalette]
|
|
82
|
+
);
|
|
41
83
|
return /* @__PURE__ */ jsx(
|
|
42
84
|
"div",
|
|
43
85
|
{
|
|
@@ -56,11 +98,12 @@ function Chart({
|
|
|
56
98
|
Chart$1,
|
|
57
99
|
{
|
|
58
100
|
renderer,
|
|
101
|
+
definition: resolved,
|
|
59
102
|
onRender,
|
|
60
103
|
...rest
|
|
61
104
|
}
|
|
62
105
|
)
|
|
63
|
-
) : /* @__PURE__ */ jsx(Chart$2, { renderSvg, onRender, ...rest })
|
|
106
|
+
) : /* @__PURE__ */ jsx(Chart$2, { definition: resolved, renderSvg, onRender, ...rest })
|
|
64
107
|
}
|
|
65
108
|
);
|
|
66
109
|
}
|