@42-central/ui-react 0.18.2 → 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 +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 +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 +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.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/dist/chunk-YBJB7FGE.js.map +0 -1
|
@@ -48,3 +48,103 @@
|
|
|
48
48
|
--ts-chart-crosshair-marker-fill: var(--color-gray-dark-950);
|
|
49
49
|
--ts-chart-focus-fill: var(--color-gray-dark-950);
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* Series fill — one map, two consumers.
|
|
54
|
+
*
|
|
55
|
+
* `--c-solid` (the 500 step) is tuned for a filled button, where the label
|
|
56
|
+
* sits ON the fill. A chart mark has nothing on it: what matters is the fill
|
|
57
|
+
* against the page, and in light mode most 500s land under the 3:1 WCAG 1.4.11
|
|
58
|
+
* non-text minimum (blue 2.89, orange 2.81, green 2.46 on the docs page). So
|
|
59
|
+
* chart fills step one shade darker in light mode — 600 — and keep the solid
|
|
60
|
+
* as-is in dark, where every 500 already clears it. `--c-solid` itself is left
|
|
61
|
+
* alone: every other colored component still fills with it.
|
|
62
|
+
*
|
|
63
|
+
* `--chart-<name>` is that map, per theme. Yellow is the one entry off the
|
|
64
|
+
* step: its solid is already 400, and its 600 still only reaches ~2.7:1, so
|
|
65
|
+
* it takes 700 (the first step past 3:1). `neutral` is black / white, as its
|
|
66
|
+
* solid already is.
|
|
67
|
+
*
|
|
68
|
+
* It is declared on `:root` / `[data-theme="dark"]` so a value resolves at the
|
|
69
|
+
* same place `colors.css` theme flips do, and both consumers read it:
|
|
70
|
+
* - multi-series slots — `chartColors()` emits `var(--chart-<name>)` into
|
|
71
|
+
* the root's inline `--ts-chart-N`, so the inline style only names the
|
|
72
|
+
* slot and this stylesheet picks the step;
|
|
73
|
+
* - a single series — `var(--chart-solid)`, bridged below from the nearest
|
|
74
|
+
* `data-color` (the chart's own `color`, or an ancestor's).
|
|
75
|
+
*/
|
|
76
|
+
:root {
|
|
77
|
+
--chart-brand: var(--color-brand-600);
|
|
78
|
+
--chart-neutral: var(--color-black);
|
|
79
|
+
--chart-red: var(--color-red-600);
|
|
80
|
+
--chart-orange: var(--color-orange-600);
|
|
81
|
+
--chart-yellow: var(--color-yellow-700);
|
|
82
|
+
--chart-green: var(--color-green-600);
|
|
83
|
+
--chart-teal: var(--color-teal-600);
|
|
84
|
+
--chart-cyan: var(--color-cyan-600);
|
|
85
|
+
--chart-blue: var(--color-blue-600);
|
|
86
|
+
--chart-purple: var(--color-purple-600);
|
|
87
|
+
--chart-pink: var(--color-pink-600);
|
|
88
|
+
}
|
|
89
|
+
[data-theme="dark"] {
|
|
90
|
+
--chart-brand: var(--color-brand-500);
|
|
91
|
+
--chart-neutral: var(--color-white);
|
|
92
|
+
--chart-red: var(--color-red-500);
|
|
93
|
+
--chart-orange: var(--color-orange-500);
|
|
94
|
+
--chart-yellow: var(--color-yellow-500);
|
|
95
|
+
--chart-green: var(--color-green-500);
|
|
96
|
+
--chart-teal: var(--color-teal-500);
|
|
97
|
+
--chart-cyan: var(--color-cyan-500);
|
|
98
|
+
--chart-blue: var(--color-blue-500);
|
|
99
|
+
--chart-purple: var(--color-purple-500);
|
|
100
|
+
--chart-pink: var(--color-pink-500);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/*
|
|
104
|
+
* `--chart-solid`: the single-series fill, set on every `data-color` element
|
|
105
|
+
* so it inherits from the NEAREST one, exactly like `--c-solid` does. Each
|
|
106
|
+
* known color points at its map entry (resolved right here, where the theme's
|
|
107
|
+
* map is in scope); anything else — the `:root` default, a custom color, the
|
|
108
|
+
* deprecated `gray` alias — falls back to that element's own `--c-solid`.
|
|
109
|
+
* In dark mode every element falls back to `--c-solid`, so a dark single
|
|
110
|
+
* series is unchanged (yellow keeps its 400 solid there). The dark selector
|
|
111
|
+
* outranks the per-color ones on specificity (0,2,0 over 0,1,0), never on
|
|
112
|
+
* source order.
|
|
113
|
+
*/
|
|
114
|
+
:root,
|
|
115
|
+
[data-color],
|
|
116
|
+
[data-theme="dark"],
|
|
117
|
+
[data-theme="dark"][data-color],
|
|
118
|
+
[data-theme="dark"] [data-color] {
|
|
119
|
+
--chart-solid: var(--c-solid);
|
|
120
|
+
}
|
|
121
|
+
[data-color="brand"] {
|
|
122
|
+
--chart-solid: var(--chart-brand);
|
|
123
|
+
}
|
|
124
|
+
[data-color="red"] {
|
|
125
|
+
--chart-solid: var(--chart-red);
|
|
126
|
+
}
|
|
127
|
+
[data-color="orange"] {
|
|
128
|
+
--chart-solid: var(--chart-orange);
|
|
129
|
+
}
|
|
130
|
+
[data-color="yellow"] {
|
|
131
|
+
--chart-solid: var(--chart-yellow);
|
|
132
|
+
}
|
|
133
|
+
[data-color="green"] {
|
|
134
|
+
--chart-solid: var(--chart-green);
|
|
135
|
+
}
|
|
136
|
+
[data-color="teal"] {
|
|
137
|
+
--chart-solid: var(--chart-teal);
|
|
138
|
+
}
|
|
139
|
+
[data-color="cyan"] {
|
|
140
|
+
--chart-solid: var(--chart-cyan);
|
|
141
|
+
}
|
|
142
|
+
[data-color="blue"] {
|
|
143
|
+
--chart-solid: var(--chart-blue);
|
|
144
|
+
}
|
|
145
|
+
[data-color="purple"] {
|
|
146
|
+
--chart-solid: var(--chart-purple);
|
|
147
|
+
}
|
|
148
|
+
[data-color="pink"] {
|
|
149
|
+
--chart-solid: var(--chart-pink);
|
|
150
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { fireEvent, render, screen, waitFor } from "@testing-library/react"
|
|
1
|
+
import { act, fireEvent, render, screen, waitFor } from "@testing-library/react"
|
|
2
2
|
import { useState } from "react"
|
|
3
|
-
import { beforeEach, describe, expect, it, vi } from "vitest"
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"
|
|
4
4
|
import { Clipboard } from "./clipboard"
|
|
5
5
|
import { Copy } from "./copy"
|
|
6
6
|
|
|
@@ -18,29 +18,53 @@ beforeEach(() => {
|
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
describe("Copy", () => {
|
|
21
|
-
//
|
|
22
|
-
// `
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
// never
|
|
26
|
-
//
|
|
27
|
-
//
|
|
21
|
+
// Ark's clipboard `timeout` rides zag-js's `setRafTimeout`
|
|
22
|
+
// (`@zag-js/utils` timers): a `requestAnimationFrame` loop that compares each
|
|
23
|
+
// frame's timestamp against a start read from `performance.now()`. Faking
|
|
24
|
+
// `requestAnimationFrame` alone leaves that start on the real clock, so the
|
|
25
|
+
// fake frame timestamps never catch up with it and the timeout never fires;
|
|
26
|
+
// faking `performance` too puts both on the same clock, and advancing it
|
|
27
|
+
// drives the revert deterministically, with no real-time wait to overshoot
|
|
28
|
+
// under CPU load.
|
|
29
|
+
const useClipboardFakeTimers = () =>
|
|
30
|
+
vi.useFakeTimers({
|
|
31
|
+
toFake: [
|
|
32
|
+
"setTimeout",
|
|
33
|
+
"clearTimeout",
|
|
34
|
+
"requestAnimationFrame",
|
|
35
|
+
"cancelAnimationFrame",
|
|
36
|
+
"performance",
|
|
37
|
+
],
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
afterEach(() => {
|
|
41
|
+
vi.useRealTimers()
|
|
42
|
+
})
|
|
43
|
+
|
|
28
44
|
it("copies the value and reverts the icon after timeout", async () => {
|
|
45
|
+
useClipboardFakeTimers()
|
|
29
46
|
const onCopiedChange = vi.fn()
|
|
30
|
-
render(<Copy value="hello world" timeout={
|
|
47
|
+
render(<Copy value="hello world" timeout={1000} onCopiedChange={onCopiedChange} />)
|
|
31
48
|
|
|
32
49
|
const button = screen.getByRole("button")
|
|
33
50
|
expect(button.querySelector('svg[data-state="idle"]')).not.toBeNull()
|
|
34
51
|
|
|
35
|
-
|
|
52
|
+
await act(async () => {
|
|
53
|
+
fireEvent.click(button)
|
|
54
|
+
})
|
|
36
55
|
|
|
37
|
-
|
|
38
|
-
|
|
56
|
+
expect(onCopiedChange).toHaveBeenCalledWith(true)
|
|
57
|
+
expect(button.querySelector('svg[data-state="copied"]')).not.toBeNull()
|
|
39
58
|
|
|
40
|
-
//
|
|
41
|
-
await
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
// Still copied just short of `timeout`...
|
|
60
|
+
await act(() => vi.advanceTimersByTimeAsync(900))
|
|
61
|
+
expect(button.querySelector('svg[data-state="copied"]')).not.toBeNull()
|
|
62
|
+
|
|
63
|
+
// ...and reverted to idle once it has elapsed (plus a frame).
|
|
64
|
+
await act(() => vi.advanceTimersByTimeAsync(200))
|
|
65
|
+
expect(button.querySelector('svg[data-state="idle"]')).not.toBeNull()
|
|
66
|
+
// Ark's machine never emits on the automatic revert (documented on the prop).
|
|
67
|
+
expect(onCopiedChange).toHaveBeenCalledTimes(1)
|
|
44
68
|
})
|
|
45
69
|
|
|
46
70
|
it("uses Ark's default translated label as the accessible name", () => {
|
|
@@ -83,9 +107,10 @@ describe("Copy", () => {
|
|
|
83
107
|
})
|
|
84
108
|
|
|
85
109
|
it("copy() performs a real copy and updates copied/fires onCopiedChange, same as the default button", async () => {
|
|
110
|
+
useClipboardFakeTimers()
|
|
86
111
|
const onCopiedChange = vi.fn()
|
|
87
112
|
render(
|
|
88
|
-
<Copy value="hello world" timeout={
|
|
113
|
+
<Copy value="hello world" timeout={1000} onCopiedChange={onCopiedChange}>
|
|
89
114
|
{({ copied, copy }) => (
|
|
90
115
|
<button type="button" onClick={copy} data-testid="custom-trigger">
|
|
91
116
|
{copied ? "Copied!" : "Copy"}
|
|
@@ -97,14 +122,21 @@ describe("Copy", () => {
|
|
|
97
122
|
const trigger = screen.getByTestId("custom-trigger")
|
|
98
123
|
expect(trigger.textContent).toBe("Copy")
|
|
99
124
|
|
|
100
|
-
|
|
125
|
+
await act(async () => {
|
|
126
|
+
fireEvent.click(trigger)
|
|
127
|
+
})
|
|
101
128
|
|
|
102
|
-
|
|
103
|
-
|
|
129
|
+
expect(onCopiedChange).toHaveBeenCalledWith(true)
|
|
130
|
+
expect(trigger.textContent).toBe("Copied!")
|
|
104
131
|
expect(navigator.clipboard.writeText).toHaveBeenCalledWith("hello world")
|
|
105
132
|
|
|
133
|
+
await act(() => vi.advanceTimersByTimeAsync(900))
|
|
134
|
+
expect(trigger.textContent).toBe("Copied!")
|
|
135
|
+
|
|
106
136
|
// Reverts back once `timeout` elapses, exactly like the default button.
|
|
107
|
-
await
|
|
137
|
+
await act(() => vi.advanceTimersByTimeAsync(200))
|
|
138
|
+
expect(trigger.textContent).toBe("Copy")
|
|
139
|
+
expect(onCopiedChange).toHaveBeenCalledTimes(1)
|
|
108
140
|
})
|
|
109
141
|
|
|
110
142
|
it("does not attach a click handler on the consumer's behalf", () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
// "use client"
|
|
4
|
-
// the first file consumers import (`@42/ui-react/clipboard`
|
|
5
|
-
// not the implementation files it re-exports.
|
|
3
|
+
// "use client" is on the barrel as well as the leaves because tsup's entry
|
|
4
|
+
// classifier reads the first file consumers import (`@42/ui-react/clipboard`
|
|
5
|
+
// resolves here), not the implementation files it re-exports.
|
|
6
6
|
export {
|
|
7
7
|
Clipboard,
|
|
8
8
|
type ClipboardInputProps,
|
|
@@ -36,3 +36,25 @@ describe("Combobox triggers under asChild", () => {
|
|
|
36
36
|
expect(trigger.querySelector("svg")).toBeNull()
|
|
37
37
|
})
|
|
38
38
|
})
|
|
39
|
+
|
|
40
|
+
describe("Combobox translations", () => {
|
|
41
|
+
const renderTrigger = (translations?: { triggerLabel?: string; clearTriggerLabel?: string }) =>
|
|
42
|
+
render(
|
|
43
|
+
<Combobox.Root collection={collection} translations={translations}>
|
|
44
|
+
<Combobox.Control>
|
|
45
|
+
<Combobox.Input />
|
|
46
|
+
<Combobox.Trigger />
|
|
47
|
+
</Combobox.Control>
|
|
48
|
+
</Combobox.Root>,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
it("names the trigger with the kit's English default, not zag's", () => {
|
|
52
|
+
renderTrigger()
|
|
53
|
+
expect(screen.getByRole("button", { name: "Show options" })).toBeTruthy()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it("names the trigger from a partial override", () => {
|
|
57
|
+
renderTrigger({ triggerLabel: "Afficher les options" })
|
|
58
|
+
expect(screen.getByRole("button", { name: "Afficher les options" })).toBeTruthy()
|
|
59
|
+
})
|
|
60
|
+
})
|
|
@@ -74,6 +74,23 @@ const ComboboxStyleContext = createContext<ComboboxStyle>({
|
|
|
74
74
|
variant: "default",
|
|
75
75
|
})
|
|
76
76
|
|
|
77
|
+
/** The combobox family's wording — Ark's own Combobox `translations` type, derived structurally
|
|
78
|
+
* rather than imported by name (`IntlTranslations` lives in `@zag-js/combobox`, a transitive
|
|
79
|
+
* dependency). `triggerLabel` names the chevron toggle, `clearTriggerLabel` the clear (×)
|
|
80
|
+
* button. Shared by `Combobox`, `Autocomplete`, `MultiSelect`, `ComboboxList` and
|
|
81
|
+
* `MultiComboboxList`, so one translation pack covers the family. */
|
|
82
|
+
export type ComboboxTranslations = NonNullable<Ark.RootProps<Ark.CollectionItem>["translations"]>
|
|
83
|
+
|
|
84
|
+
/** The family's English defaults — the kit's own wording, not zag's ("Toggle suggestions"). */
|
|
85
|
+
export const COMBOBOX_DEFAULT_TRANSLATIONS = {
|
|
86
|
+
triggerLabel: "Show options",
|
|
87
|
+
clearTriggerLabel: "Clear value",
|
|
88
|
+
} as const satisfies ComboboxTranslations
|
|
89
|
+
|
|
90
|
+
/** Shallow per-key merge over `COMBOBOX_DEFAULT_TRANSLATIONS`. */
|
|
91
|
+
export const resolveComboboxTranslations = (overrides?: ComboboxTranslations) =>
|
|
92
|
+
overrides ? { ...COMBOBOX_DEFAULT_TRANSLATIONS, ...overrides } : COMBOBOX_DEFAULT_TRANSLATIONS
|
|
93
|
+
|
|
77
94
|
export type ComboboxRootProps<T extends Ark.CollectionItem = Ark.CollectionItem> = Omit<
|
|
78
95
|
Ark.RootProps<T>,
|
|
79
96
|
"color" | "className"
|
|
@@ -96,6 +113,7 @@ const Root = <T extends Ark.CollectionItem = Ark.CollectionItem>({
|
|
|
96
113
|
className,
|
|
97
114
|
children,
|
|
98
115
|
testId,
|
|
116
|
+
translations,
|
|
99
117
|
...rest
|
|
100
118
|
}: ComboboxRootProps<T>) => (
|
|
101
119
|
<ComboboxStyleContext.Provider value={{ size, variant }}>
|
|
@@ -108,6 +126,8 @@ const Root = <T extends Ark.CollectionItem = Ark.CollectionItem>({
|
|
|
108
126
|
// `rest` can still override.
|
|
109
127
|
scrollToIndexFn={scrollHighlightedIntoView}
|
|
110
128
|
className={cn("w-full", className)}
|
|
129
|
+
// The kit's English wording over zag's; a partial override keeps the other key.
|
|
130
|
+
translations={resolveComboboxTranslations(translations)}
|
|
111
131
|
{...props({ "data-testid": testId })}
|
|
112
132
|
{...rest}
|
|
113
133
|
>
|
|
@@ -146,3 +146,22 @@ describe("ComboboxList — renders a built-in label from props", () => {
|
|
|
146
146
|
expect(screen.getByText("Role")).toBeTruthy()
|
|
147
147
|
})
|
|
148
148
|
})
|
|
149
|
+
|
|
150
|
+
describe("ComboboxList translations", () => {
|
|
151
|
+
it("names the clear button from translations", () => {
|
|
152
|
+
render(
|
|
153
|
+
<ComboboxList
|
|
154
|
+
data={data}
|
|
155
|
+
clearable
|
|
156
|
+
defaultValue="Staff"
|
|
157
|
+
translations={{ clearTriggerLabel: "Effacer" }}
|
|
158
|
+
/>,
|
|
159
|
+
)
|
|
160
|
+
expect(screen.getByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
it("keeps the English default without an override", () => {
|
|
164
|
+
render(<ComboboxList data={data} clearable defaultValue="Staff" translations={{}} />)
|
|
165
|
+
expect(screen.getByRole("button", { name: "Clear value" })).toBeTruthy()
|
|
166
|
+
})
|
|
167
|
+
})
|
|
@@ -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_DEFAULT_TRANSLATIONS,
|
|
21
|
+
Combobox,
|
|
22
|
+
type ComboboxTranslations,
|
|
23
|
+
} from "../combobox/combobox"
|
|
20
24
|
import { type FieldProps, FieldShell } from "../field/field"
|
|
21
25
|
import {
|
|
22
26
|
type InputSize,
|
|
@@ -102,8 +106,15 @@ export type ComboboxListProps<Data extends SelectData = SelectData> = Pick<
|
|
|
102
106
|
ref?: Ref<HTMLInputElement>
|
|
103
107
|
className?: string
|
|
104
108
|
classNames?: ComboboxListClassNames
|
|
109
|
+
/** Overrides the clear button's accessible name (`clearTriggerLabel`, default
|
|
110
|
+
* `"Clear value"`) — the same key as the rest of the combobox family. */
|
|
111
|
+
translations?: ComboboxListTranslations
|
|
105
112
|
}
|
|
106
113
|
|
|
114
|
+
/** The combobox family's `clearTriggerLabel` — the only family key this always-open list
|
|
115
|
+
* renders (it has no chevron). */
|
|
116
|
+
export type ComboboxListTranslations = Pick<ComboboxTranslations, "clearTriggerLabel">
|
|
117
|
+
|
|
107
118
|
/** Wrap a scalar value into Ark's array contract (or clear with `[]`) — same
|
|
108
119
|
* bridge `Select` uses (`toArkValue`, `select.tsx`). */
|
|
109
120
|
const toArkValue = (v: string | null): string[] => (v === null ? [] : [v])
|
|
@@ -132,7 +143,10 @@ export const ComboboxList = <const Data extends SelectData = SelectData>({
|
|
|
132
143
|
className,
|
|
133
144
|
classNames,
|
|
134
145
|
testId,
|
|
146
|
+
translations,
|
|
135
147
|
}: ComboboxListProps<Data>) => {
|
|
148
|
+
const clearLabel =
|
|
149
|
+
translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel
|
|
136
150
|
type Item = SelectValue<Data>
|
|
137
151
|
|
|
138
152
|
// Red state is driven independently of the `Field` error slot so a form
|
|
@@ -227,7 +241,7 @@ export const ComboboxList = <const Data extends SelectData = SelectData>({
|
|
|
227
241
|
{canClear && (
|
|
228
242
|
<button
|
|
229
243
|
type="button"
|
|
230
|
-
aria-label=
|
|
244
|
+
aria-label={clearLabel}
|
|
231
245
|
aria-hidden={!showClear}
|
|
232
246
|
tabIndex={showClear ? 0 : -1}
|
|
233
247
|
onPointerDown={(event) => event.preventDefault()}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import type { DateValue as ArkDateValue } from "@ark-ui/react/date-picker"
|
|
4
4
|
import { useLocaleContext } from "@ark-ui/react/locale"
|
|
5
|
-
import {
|
|
5
|
+
import { parseDate, parseDateTime } from "@internationalized/date"
|
|
6
6
|
import { cn } from "../../../lib/cn"
|
|
7
|
+
import { useTimeZone } from "../../../lib/intl"
|
|
7
8
|
import { type CalendarTranslations, resolveCalendarTranslations } from "../../calendar/calendar"
|
|
8
9
|
import {
|
|
9
10
|
DatePicker,
|
|
@@ -109,15 +110,15 @@ const DateFilterPopover = ({
|
|
|
109
110
|
bounds: [string, string]
|
|
110
111
|
withTime?: boolean
|
|
111
112
|
presets?: DatePreset[] | boolean
|
|
112
|
-
/** Overrides the
|
|
113
|
-
* `
|
|
113
|
+
/** Overrides the time zone for the `Date ↔ DateValue` boundary. Resolves
|
|
114
|
+
* **prop → `IntlProvider` → host zone** — same convention as `DatePicker`/`Calendar`. */
|
|
114
115
|
timeZone?: string
|
|
115
116
|
translations?: DateFilterTranslations
|
|
116
117
|
onCommit: (values: ArkDateValue[]) => void
|
|
117
118
|
onClose?: () => void
|
|
118
119
|
}) => {
|
|
119
120
|
const { locale } = useLocaleContext()
|
|
120
|
-
const timeZone = timeZoneProp
|
|
121
|
+
const timeZone = useTimeZone(timeZoneProp)
|
|
121
122
|
const hourCycle = resolveHourCycle({ locale })
|
|
122
123
|
|
|
123
124
|
return (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ArrowDownToLineIcon, ArrowUpToLineIcon } from "lucide-react"
|
|
2
2
|
import { NumberInput } from "../../number-input"
|
|
3
|
+
import type { ResolvedDataTableTranslations } from "../data-table-translations"
|
|
3
4
|
import {
|
|
4
5
|
type AnyColumn,
|
|
5
6
|
getNumberFilterValue,
|
|
@@ -25,12 +26,23 @@ export const NumberFilter = ({
|
|
|
25
26
|
column,
|
|
26
27
|
min,
|
|
27
28
|
max,
|
|
29
|
+
translations,
|
|
28
30
|
}: {
|
|
29
31
|
column: AnyColumn
|
|
30
32
|
min?: number
|
|
31
33
|
max?: number
|
|
34
|
+
/** `DataTable`'s resolved wording: the bounds' placeholders and the inputs' own keys. */
|
|
35
|
+
translations: Pick<
|
|
36
|
+
ResolvedDataTableTranslations,
|
|
37
|
+
"min" | "max" | "clearTriggerLabel" | "incrementLabel" | "decrementLabel"
|
|
38
|
+
>
|
|
32
39
|
}) => {
|
|
33
40
|
const [lo, hi] = toBounds(getNumberFilterValue(column))
|
|
41
|
+
const inputTranslations = {
|
|
42
|
+
clearTriggerLabel: translations.clearTriggerLabel,
|
|
43
|
+
incrementLabel: translations.incrementLabel,
|
|
44
|
+
decrementLabel: translations.decrementLabel,
|
|
45
|
+
}
|
|
34
46
|
|
|
35
47
|
const commit = (nextLo: number | null, nextHi: number | null) => {
|
|
36
48
|
if (nextLo == null && nextHi == null) {
|
|
@@ -49,23 +61,25 @@ export const NumberFilter = ({
|
|
|
49
61
|
<div className="flex flex-col gap-2 p-1">
|
|
50
62
|
<NumberInput
|
|
51
63
|
size="sm"
|
|
52
|
-
placeholder=
|
|
64
|
+
placeholder={translations.max}
|
|
53
65
|
testId="number-filter-max"
|
|
54
66
|
min={min}
|
|
55
67
|
max={max}
|
|
56
68
|
value={hi}
|
|
57
69
|
clearable
|
|
70
|
+
translations={inputTranslations}
|
|
58
71
|
startSlot={<ArrowUpToLineIcon />}
|
|
59
72
|
onChange={(next) => commit(lo, next)}
|
|
60
73
|
/>
|
|
61
74
|
<NumberInput
|
|
62
75
|
size="sm"
|
|
63
|
-
placeholder=
|
|
76
|
+
placeholder={translations.min}
|
|
64
77
|
testId="number-filter-min"
|
|
65
78
|
min={min}
|
|
66
79
|
max={max}
|
|
67
80
|
value={lo}
|
|
68
81
|
clearable
|
|
82
|
+
translations={inputTranslations}
|
|
69
83
|
startSlot={<ArrowDownToLineIcon />}
|
|
70
84
|
onChange={(next) => commit(next, hi)}
|
|
71
85
|
/>
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import type { RenderItem, SelectData } from "../../../lib/select-data"
|
|
4
4
|
import { ComboboxList } from "../../combobox-list/combobox-list"
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
MultiComboboxList,
|
|
7
|
+
type MultiComboboxListTranslations,
|
|
8
|
+
} from "../../multi-combobox-list/multi-combobox-list"
|
|
6
9
|
import type { AnyColumn } from "./utils"
|
|
7
10
|
|
|
8
11
|
export const SelectFilter = ({
|
|
@@ -10,6 +13,7 @@ export const SelectFilter = ({
|
|
|
10
13
|
options,
|
|
11
14
|
multiple,
|
|
12
15
|
renderItem,
|
|
16
|
+
translations,
|
|
13
17
|
onClose,
|
|
14
18
|
}: {
|
|
15
19
|
column: AnyColumn
|
|
@@ -18,6 +22,8 @@ export const SelectFilter = ({
|
|
|
18
22
|
/** Same escape hatch `ComboboxList`/`MultiComboboxList` already expose —
|
|
19
23
|
* passed straight through, one render function for both pickers. */
|
|
20
24
|
renderItem?: RenderItem<SelectData>
|
|
25
|
+
/** `DataTable`'s forwarded combobox-family key, shared by both pickers. */
|
|
26
|
+
translations?: MultiComboboxListTranslations
|
|
21
27
|
/** Called after a single-value pick — closes the header popover, matching
|
|
22
28
|
* `Select`'s own close-on-pick habit. Multi-select stays open so more
|
|
23
29
|
* values can be toggled. */
|
|
@@ -29,6 +35,7 @@ export const SelectFilter = ({
|
|
|
29
35
|
data={options}
|
|
30
36
|
clearable
|
|
31
37
|
renderItem={renderItem}
|
|
38
|
+
translations={translations}
|
|
32
39
|
value={(column.getFilterValue() as string[] | undefined) ?? []}
|
|
33
40
|
onChange={(value) => column.setFilterValue(value.length > 0 ? value : undefined)}
|
|
34
41
|
/>
|
|
@@ -38,6 +45,7 @@ export const SelectFilter = ({
|
|
|
38
45
|
data={options}
|
|
39
46
|
clearable
|
|
40
47
|
renderItem={renderItem}
|
|
48
|
+
translations={translations}
|
|
41
49
|
value={(column.getFilterValue() as string | undefined) ?? null}
|
|
42
50
|
onChange={(value) => {
|
|
43
51
|
column.setFilterValue(value ?? undefined)
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { match } from "ts-pattern"
|
|
4
4
|
import type { DataTableColumnFilter } from "../data-table-meta"
|
|
5
|
+
import {
|
|
6
|
+
DATA_TABLE_DEFAULT_TRANSLATIONS,
|
|
7
|
+
type ResolvedDataTableTranslations,
|
|
8
|
+
} from "../data-table-translations"
|
|
5
9
|
import { DateFilter, DateRangeFilter } from "./data-table-date-filter"
|
|
6
10
|
import { NumberFilter } from "./data-table-number-filter"
|
|
7
11
|
import { SelectFilter } from "./data-table-select-filter"
|
|
@@ -16,10 +20,17 @@ export { hasActiveFilterValue, resolveFilterFn } from "./data-table-filter-fns"
|
|
|
16
20
|
export const DataTableFilterControl = ({
|
|
17
21
|
column,
|
|
18
22
|
filter,
|
|
23
|
+
translations = DATA_TABLE_DEFAULT_TRANSLATIONS,
|
|
19
24
|
onClose,
|
|
20
25
|
}: {
|
|
21
26
|
column: AnyColumn
|
|
22
27
|
filter: DataTableColumnFilter
|
|
28
|
+
/** `DataTable`'s resolved wording — the `number` filter's placeholders and the `select` /
|
|
29
|
+
* `number` controls' own keys. Default: the English defaults. */
|
|
30
|
+
translations?: Pick<
|
|
31
|
+
ResolvedDataTableTranslations,
|
|
32
|
+
"min" | "max" | "clearTriggerLabel" | "incrementLabel" | "decrementLabel"
|
|
33
|
+
>
|
|
23
34
|
/** Called when a control wants its host popover dismissed — the
|
|
24
35
|
* single-select filter after a pick, and the date/date-range filters once
|
|
25
36
|
* a range selection completes (or is cleared). */
|
|
@@ -35,10 +46,13 @@ export const DataTableFilterControl = ({
|
|
|
35
46
|
options={f.options}
|
|
36
47
|
multiple={f.multiple}
|
|
37
48
|
renderItem={f.renderItem}
|
|
49
|
+
translations={{ clearTriggerLabel: translations.clearTriggerLabel }}
|
|
38
50
|
onClose={onClose}
|
|
39
51
|
/>
|
|
40
52
|
))
|
|
41
|
-
.with({ type: "number" }, (f) =>
|
|
53
|
+
.with({ type: "number" }, (f) => (
|
|
54
|
+
<NumberFilter column={column} min={f.min} max={f.max} translations={translations} />
|
|
55
|
+
))
|
|
42
56
|
.with({ type: "date" }, (f) => (
|
|
43
57
|
<DateFilter
|
|
44
58
|
column={column}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { today } from "@internationalized/date"
|
|
1
2
|
import { fireEvent, render, screen, waitFor, within } from "@testing-library/react"
|
|
2
3
|
import { useState } from "react"
|
|
3
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"
|
|
5
|
+
import { IntlProvider } from "../../lib/intl"
|
|
4
6
|
import { DataTableFilterControl, hasActiveFilterValue } from "./data-table-filter"
|
|
5
7
|
import type { AnyColumn } from "./data-table-filter/utils"
|
|
6
8
|
import type { DataTableColumnFilter } from "./data-table-meta"
|
|
@@ -363,3 +365,34 @@ describe("DataTableFilterControl", () => {
|
|
|
363
365
|
})
|
|
364
366
|
})
|
|
365
367
|
})
|
|
368
|
+
|
|
369
|
+
describe("DataTableFilterControl — IntlProvider time zone", () => {
|
|
370
|
+
// Kiritimati (UTC+14) and Midway (UTC−11) are 25 hours apart, so their "today" is never the
|
|
371
|
+
// same calendar day, whatever the clock reads when the suite runs. The grid marks today in its
|
|
372
|
+
// own zone, which is what these read back.
|
|
373
|
+
const todayCell = (container: HTMLElement) =>
|
|
374
|
+
container.querySelector('[role="button"][data-today]')?.getAttribute("data-value")?.slice(0, 10)
|
|
375
|
+
|
|
376
|
+
it("uses the provider's time zone when the filter sets none", async () => {
|
|
377
|
+
const { container } = render(
|
|
378
|
+
<IntlProvider timeZone="Pacific/Kiritimati">
|
|
379
|
+
<DataTableFilterControl column={makeColumn()} filter={{ type: "date" }} />
|
|
380
|
+
</IntlProvider>,
|
|
381
|
+
)
|
|
382
|
+
await flush()
|
|
383
|
+
expect(todayCell(container)).toBe(today("Pacific/Kiritimati").toString())
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
it("lets the filter's timeZone override the provider", async () => {
|
|
387
|
+
const { container } = render(
|
|
388
|
+
<IntlProvider timeZone="Pacific/Kiritimati">
|
|
389
|
+
<DataTableFilterControl
|
|
390
|
+
column={makeColumn()}
|
|
391
|
+
filter={{ type: "date", timeZone: "Pacific/Midway" }}
|
|
392
|
+
/>
|
|
393
|
+
</IntlProvider>,
|
|
394
|
+
)
|
|
395
|
+
await flush()
|
|
396
|
+
expect(todayCell(container)).toBe(today("Pacific/Midway").toString())
|
|
397
|
+
})
|
|
398
|
+
})
|