@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
|
@@ -11,26 +11,19 @@ import { Popover } from "../popover/popover"
|
|
|
11
11
|
import type { DataTableFeatures } from "./data-table-features"
|
|
12
12
|
import { DataTableFilterControl, hasActiveFilterValue } from "./data-table-filter"
|
|
13
13
|
import type { DataTableHeaderMode } from "./data-table-meta"
|
|
14
|
+
import type { ResolvedDataTableTranslations } from "./data-table-translations"
|
|
14
15
|
|
|
15
16
|
/** Step (px) an `ArrowLeft`/`ArrowRight` nudge resizes a column by — the
|
|
16
17
|
* keyboard equivalent of a drag, since `getResizeHandler` only wires mouse
|
|
17
18
|
* and touch. */
|
|
18
19
|
const RESIZE_STEP = 5
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
desc: {
|
|
27
|
-
icon: ChevronDownIcon,
|
|
28
|
-
label: "descending",
|
|
29
|
-
},
|
|
30
|
-
none: {
|
|
31
|
-
icon: ChevronsUpDownIcon,
|
|
32
|
-
label: "none",
|
|
33
|
-
},
|
|
21
|
+
/** The sort affordance's icon per state — its accessible name comes from
|
|
22
|
+
* `translations.sortColumn`. */
|
|
23
|
+
export const SORT_ICON = {
|
|
24
|
+
asc: ChevronUpIcon,
|
|
25
|
+
desc: ChevronDownIcon,
|
|
26
|
+
none: ChevronsUpDownIcon,
|
|
34
27
|
} as const
|
|
35
28
|
|
|
36
29
|
/** A column's label as plain text — `meta.label`, else its string `header`,
|
|
@@ -75,9 +68,11 @@ const tableHeaderCell = cva(["flex items-center gap-3"], {
|
|
|
75
68
|
*/
|
|
76
69
|
export function DataTableHeaderCell<TEntity extends RowData>({
|
|
77
70
|
header,
|
|
71
|
+
translations,
|
|
78
72
|
truncate = true,
|
|
79
73
|
}: {
|
|
80
74
|
header: Header<DataTableFeatures, TEntity, unknown>
|
|
75
|
+
translations: ResolvedDataTableTranslations
|
|
81
76
|
/** Ellipsize the label instead of letting it grow the column — off under
|
|
82
77
|
* `sizing="auto"`, where a column's width already tracks its content, so
|
|
83
78
|
* there's nothing to truncate against. Default `true`. */
|
|
@@ -97,13 +92,24 @@ export function DataTableHeaderCell<TEntity extends RowData>({
|
|
|
97
92
|
return (
|
|
98
93
|
<div className={tableHeaderCell({ align })}>
|
|
99
94
|
{canSort ? (
|
|
100
|
-
<DataTablerHeaderSort
|
|
95
|
+
<DataTablerHeaderSort
|
|
96
|
+
column={column}
|
|
97
|
+
label={translations.sortColumn(ariaLabel, column.getIsSorted() || "none")}
|
|
98
|
+
labelClassName={labelClassName}
|
|
99
|
+
>
|
|
101
100
|
{label}
|
|
102
101
|
</DataTablerHeaderSort>
|
|
103
102
|
) : (
|
|
104
103
|
<span className={labelClassName}>{label}</span>
|
|
105
104
|
)}
|
|
106
|
-
{filter ?
|
|
105
|
+
{filter ? (
|
|
106
|
+
<DataTableHeaderFilter
|
|
107
|
+
column={column}
|
|
108
|
+
filter={filter}
|
|
109
|
+
label={ariaLabel}
|
|
110
|
+
translations={translations}
|
|
111
|
+
/>
|
|
112
|
+
) : null}
|
|
107
113
|
</div>
|
|
108
114
|
)
|
|
109
115
|
}
|
|
@@ -119,8 +125,10 @@ export function DataTableHeaderCell<TEntity extends RowData>({
|
|
|
119
125
|
*/
|
|
120
126
|
export function DataTableColumnResizeHandle<TEntity extends RowData>({
|
|
121
127
|
header,
|
|
128
|
+
translations,
|
|
122
129
|
}: {
|
|
123
130
|
header: Header<DataTableFeatures, TEntity, unknown>
|
|
131
|
+
translations: ResolvedDataTableTranslations
|
|
124
132
|
}) {
|
|
125
133
|
const { column } = header
|
|
126
134
|
const ref = useRef<HTMLDivElement>(null)
|
|
@@ -159,7 +167,7 @@ export function DataTableColumnResizeHandle<TEntity extends RowData>({
|
|
|
159
167
|
onKeyDown={handleKeyDown}
|
|
160
168
|
role="separator"
|
|
161
169
|
aria-orientation="vertical"
|
|
162
|
-
aria-label={
|
|
170
|
+
aria-label={translations.resizeColumn(label)}
|
|
163
171
|
aria-valuenow={header.getSize()}
|
|
164
172
|
aria-valuemin={minSize}
|
|
165
173
|
aria-valuemax={maxSize === Number.MAX_SAFE_INTEGER ? undefined : maxSize}
|
|
@@ -198,12 +206,12 @@ function DataTablerHeaderSort({
|
|
|
198
206
|
children,
|
|
199
207
|
}: {
|
|
200
208
|
column: SortableColumn
|
|
209
|
+
/** The full accessible name, already resolved through `translations.sortColumn`. */
|
|
201
210
|
label: string
|
|
202
211
|
labelClassName?: string
|
|
203
212
|
children: ReactNode
|
|
204
213
|
}) {
|
|
205
|
-
const
|
|
206
|
-
const { icon: Icon, label: mode } = SORT_LOOKUP[sort]
|
|
214
|
+
const Icon = SORT_ICON[column.getIsSorted() || "none"]
|
|
207
215
|
|
|
208
216
|
return (
|
|
209
217
|
<button
|
|
@@ -219,7 +227,7 @@ function DataTablerHeaderSort({
|
|
|
219
227
|
// surface-matched pair rather than the helper's own offset.
|
|
220
228
|
"focus-visible:ring-offset-2 focus-visible:ring-offset-brand-50 dark:focus-visible:ring-offset-brand-950",
|
|
221
229
|
)}
|
|
222
|
-
aria-label={
|
|
230
|
+
aria-label={label}
|
|
223
231
|
>
|
|
224
232
|
<span className={cn("truncate", labelClassName)}>{children}</span>
|
|
225
233
|
<Icon
|
|
@@ -237,10 +245,12 @@ function DataTableHeaderFilter({
|
|
|
237
245
|
column,
|
|
238
246
|
filter,
|
|
239
247
|
label,
|
|
248
|
+
translations,
|
|
240
249
|
}: {
|
|
241
250
|
column: Parameters<typeof DataTableFilterControl>[0]["column"]
|
|
242
251
|
filter: NonNullable<Parameters<typeof DataTableFilterControl>[0]["filter"]>
|
|
243
252
|
label: string
|
|
253
|
+
translations: ResolvedDataTableTranslations
|
|
244
254
|
}) {
|
|
245
255
|
const active = hasActiveFilterValue(column.getFilterValue())
|
|
246
256
|
// Controlled so a single-select pick (ComboboxList, via DataTableFilterControl's
|
|
@@ -277,14 +287,19 @@ function DataTableHeaderFilter({
|
|
|
277
287
|
active,
|
|
278
288
|
},
|
|
279
289
|
)}
|
|
280
|
-
aria-label={
|
|
290
|
+
aria-label={translations.filterColumn(label, active)}
|
|
281
291
|
>
|
|
282
292
|
<ListFilterIcon />
|
|
283
293
|
</button>
|
|
284
294
|
</Popover.Trigger>
|
|
285
295
|
<Popover.Content className="min-w-48">
|
|
286
296
|
<Popover.Body className="overflow-visible p-0">
|
|
287
|
-
<DataTableFilterControl
|
|
297
|
+
<DataTableFilterControl
|
|
298
|
+
column={column}
|
|
299
|
+
filter={filter}
|
|
300
|
+
translations={translations}
|
|
301
|
+
onClose={() => setOpen(false)}
|
|
302
|
+
/>
|
|
288
303
|
</Popover.Body>
|
|
289
304
|
</Popover.Content>
|
|
290
305
|
</Popover.Root>
|
|
@@ -27,8 +27,8 @@ export type DataTableColumnFilter =
|
|
|
27
27
|
/** A date + comparison operator (on / after / on or after / before / on or before), edited via
|
|
28
28
|
* the same calendar + presets(+ time) popover `DatePicker` itself uses. `presets`/`timeZone`
|
|
29
29
|
* mirror `DatePicker`'s own props — `presets: true` for a mode-appropriate default set, or a
|
|
30
|
-
* custom array; `timeZone` overrides the
|
|
31
|
-
* same
|
|
30
|
+
* custom array; `timeZone` overrides the zone the `Date ↔ DateValue` boundary uses, resolved
|
|
31
|
+
* the same way as `DatePicker`/`Calendar` (prop → `IntlProvider` → host zone). */
|
|
32
32
|
| {
|
|
33
33
|
type: "date"
|
|
34
34
|
withTime?: boolean
|
|
@@ -5,6 +5,7 @@ import { ChevronLeft, ChevronRight } from "lucide-react"
|
|
|
5
5
|
import type { ReactNode } from "react"
|
|
6
6
|
import { cn } from "../../lib/cn"
|
|
7
7
|
import { ActionIcon } from "../action-icon/action-icon"
|
|
8
|
+
import { COMBOBOX_DEFAULT_TRANSLATIONS } from "../combobox/combobox"
|
|
8
9
|
import { Select } from "../select/select"
|
|
9
10
|
import { Text } from "../text/text"
|
|
10
11
|
import { Tooltip } from "../tooltip"
|
|
@@ -24,6 +25,9 @@ export type DataTablePaginationTranslations = {
|
|
|
24
25
|
previousPage?: string
|
|
25
26
|
/** Accessible name for the next-page button. */
|
|
26
27
|
nextPage?: string
|
|
28
|
+
/** Accessible name of the page-size `Select`'s chevron — the combobox family's key, forwarded
|
|
29
|
+
* to that `Select`. Default `"Show options"`. */
|
|
30
|
+
triggerLabel?: string
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
export type DataTablePaginationProps<TEntity extends RowData> = {
|
|
@@ -49,6 +53,7 @@ const DEFAULT_TRANSLATIONS = {
|
|
|
49
53
|
totalKnown ? `${from} to ${to} of ${hits}` : `${from} to ${to}`,
|
|
50
54
|
previousPage: "Previous page",
|
|
51
55
|
nextPage: "Next page",
|
|
56
|
+
triggerLabel: COMBOBOX_DEFAULT_TRANSLATIONS.triggerLabel,
|
|
52
57
|
} as const satisfies DataTablePaginationTranslations
|
|
53
58
|
|
|
54
59
|
/**
|
|
@@ -131,6 +136,7 @@ export function DataTablePagination<TEntity extends RowData>({
|
|
|
131
136
|
value={String(pageSize)}
|
|
132
137
|
onChange={(value) => value && table.setPageSize(Number(value))}
|
|
133
138
|
disabled={sizeOptions.length <= 1}
|
|
139
|
+
translations={{ triggerLabel: translations.triggerLabel }}
|
|
134
140
|
className="w-24"
|
|
135
141
|
/>
|
|
136
142
|
<div className="flex items-center gap-3">
|
|
@@ -23,12 +23,13 @@ import { Text } from "../text/text"
|
|
|
23
23
|
import { ThemeIcon } from "../theme-icon"
|
|
24
24
|
import type { DataTableFeatures, Row } from "./data-table-features"
|
|
25
25
|
import { DataTableFilterControl, hasActiveFilterValue } from "./data-table-filter"
|
|
26
|
-
import { columnLabel, renderColumnHeader,
|
|
26
|
+
import { columnLabel, renderColumnHeader, SORT_ICON } from "./data-table-header-cell"
|
|
27
27
|
import {
|
|
28
28
|
type DataTablePlaceholder,
|
|
29
29
|
type DataTableView,
|
|
30
30
|
RenderPlaceholder,
|
|
31
31
|
} from "./data-table-placeholder"
|
|
32
|
+
import type { ResolvedDataTableTranslations } from "./data-table-translations"
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* The `responsive="stack"` body: below the container-query breakpoint, each
|
|
@@ -54,6 +55,7 @@ export function DataTableStackedRows<TEntity extends RowData>({
|
|
|
54
55
|
table,
|
|
55
56
|
className,
|
|
56
57
|
skeletonRowCount,
|
|
58
|
+
translations,
|
|
57
59
|
}: {
|
|
58
60
|
rows: Row<TEntity>[]
|
|
59
61
|
/** Resolved once in `DataTable` (see the `match` there) and passed down so
|
|
@@ -68,6 +70,7 @@ export function DataTableStackedRows<TEntity extends RowData>({
|
|
|
68
70
|
table: ReactTableInstance<DataTableFeatures, TEntity>
|
|
69
71
|
className?: string
|
|
70
72
|
skeletonRowCount: number
|
|
73
|
+
translations: ResolvedDataTableTranslations
|
|
71
74
|
}) {
|
|
72
75
|
return (
|
|
73
76
|
<div className={cn("flex flex-1 min-h-0 flex-col gap-2 overflow-y-auto p-3", className)}>
|
|
@@ -91,7 +94,7 @@ export function DataTableStackedRows<TEntity extends RowData>({
|
|
|
91
94
|
startSlot={<RotateCwIcon />}
|
|
92
95
|
onClick={onRetry}
|
|
93
96
|
>
|
|
94
|
-
|
|
97
|
+
{translations.retry}
|
|
95
98
|
</Button>
|
|
96
99
|
)
|
|
97
100
|
}
|
|
@@ -132,7 +135,7 @@ export function DataTableStackedRows<TEntity extends RowData>({
|
|
|
132
135
|
startSlot={<EraserIcon />}
|
|
133
136
|
onClick={() => table.resetColumnFilters()}
|
|
134
137
|
>
|
|
135
|
-
|
|
138
|
+
{translations.clearFilters}
|
|
136
139
|
</Button>
|
|
137
140
|
}
|
|
138
141
|
/>
|
|
@@ -213,6 +216,7 @@ export function DataTableStackedRows<TEntity extends RowData>({
|
|
|
213
216
|
export function DataTableStackOptions<TEntity extends RowData>({
|
|
214
217
|
table,
|
|
215
218
|
enableColumnVisibility,
|
|
219
|
+
translations,
|
|
216
220
|
className,
|
|
217
221
|
}: {
|
|
218
222
|
table: ReactTableInstance<DataTableFeatures, TEntity>
|
|
@@ -220,6 +224,7 @@ export function DataTableStackOptions<TEntity extends RowData>({
|
|
|
220
224
|
* — passed straight through so both surfaces agree on when column
|
|
221
225
|
* visibility is editable. */
|
|
222
226
|
enableColumnVisibility?: boolean
|
|
227
|
+
translations: ResolvedDataTableTranslations
|
|
223
228
|
className?: string
|
|
224
229
|
}) {
|
|
225
230
|
const [open, setOpen] = useState(false)
|
|
@@ -255,15 +260,18 @@ export function DataTableStackOptions<TEntity extends RowData>({
|
|
|
255
260
|
startSlot={<ListFilterIcon />}
|
|
256
261
|
endSlot={activeCount > 0 ? <Pill size="xs">{activeCount}</Pill> : undefined}
|
|
257
262
|
onClick={() => setOpen(true)}
|
|
258
|
-
aria-label={
|
|
263
|
+
aria-label={
|
|
264
|
+
activeCount > 0 ? translations.tableOptionsActive(activeCount) : translations.tableOptions
|
|
265
|
+
}
|
|
259
266
|
>
|
|
260
|
-
|
|
267
|
+
{translations.tableOptions}
|
|
261
268
|
</Button>
|
|
262
269
|
<Drawer
|
|
263
270
|
placement="bottom"
|
|
264
271
|
withGrabber
|
|
265
272
|
size="lg"
|
|
266
|
-
title=
|
|
273
|
+
title={translations.tableOptions}
|
|
274
|
+
translations={{ closeTriggerLabel: translations.closeTriggerLabel }}
|
|
267
275
|
open={open}
|
|
268
276
|
onOpenChange={setOpen}
|
|
269
277
|
>
|
|
@@ -272,7 +280,7 @@ export function DataTableStackOptions<TEntity extends RowData>({
|
|
|
272
280
|
<div className="flex flex-col gap-3">
|
|
273
281
|
<Text size="xs" c="muted" className="uppercase tracking-wide">
|
|
274
282
|
<span aria-hidden>{"// "}</span>
|
|
275
|
-
|
|
283
|
+
{translations.columns}
|
|
276
284
|
</Text>
|
|
277
285
|
<div className="flex flex-col gap-1.5">
|
|
278
286
|
{table
|
|
@@ -298,7 +306,7 @@ export function DataTableStackOptions<TEntity extends RowData>({
|
|
|
298
306
|
<div className="flex items-center justify-between">
|
|
299
307
|
<Text size="xs" c="muted" className="uppercase tracking-wide">
|
|
300
308
|
<span aria-hidden>{"// "}</span>
|
|
301
|
-
|
|
309
|
+
{translations.sortBy}
|
|
302
310
|
</Text>
|
|
303
311
|
{activeSortCount > 0 ? (
|
|
304
312
|
<button
|
|
@@ -306,14 +314,14 @@ export function DataTableStackOptions<TEntity extends RowData>({
|
|
|
306
314
|
onClick={() => table.resetSorting()}
|
|
307
315
|
className="text-xs font-medium text-gray-light-500 hover:text-gray-light-900 dark:text-gray-dark-400 dark:hover:text-gray-dark-100"
|
|
308
316
|
>
|
|
309
|
-
|
|
317
|
+
{translations.clearSorts}
|
|
310
318
|
</button>
|
|
311
319
|
) : null}
|
|
312
320
|
</div>
|
|
313
321
|
<div className="flex flex-col gap-0.5">
|
|
314
322
|
{sortableColumns.map((column) => {
|
|
315
323
|
const sort = column.getIsSorted() || "none"
|
|
316
|
-
const
|
|
324
|
+
const Icon = SORT_ICON[sort]
|
|
317
325
|
const label = columnLabel(column)
|
|
318
326
|
return (
|
|
319
327
|
<button
|
|
@@ -321,7 +329,7 @@ export function DataTableStackOptions<TEntity extends RowData>({
|
|
|
321
329
|
type="button"
|
|
322
330
|
onClick={column.getToggleSortingHandler()}
|
|
323
331
|
className="flex items-center justify-start gap-2 rounded-md py-1.5 text-sm font-medium hover:bg-black/5 dark:hover:bg-white/8"
|
|
324
|
-
aria-label={
|
|
332
|
+
aria-label={translations.sortColumn(label, sort)}
|
|
325
333
|
>
|
|
326
334
|
<Icon
|
|
327
335
|
aria-hidden="true"
|
|
@@ -344,7 +352,7 @@ export function DataTableStackOptions<TEntity extends RowData>({
|
|
|
344
352
|
<div className="flex items-center justify-between">
|
|
345
353
|
<Text size="xs" c="muted" className="uppercase tracking-wide">
|
|
346
354
|
<span aria-hidden>{"// "}</span>
|
|
347
|
-
|
|
355
|
+
{translations.filters}
|
|
348
356
|
</Text>
|
|
349
357
|
{activeFilterCount > 0 ? (
|
|
350
358
|
<button
|
|
@@ -352,7 +360,7 @@ export function DataTableStackOptions<TEntity extends RowData>({
|
|
|
352
360
|
onClick={() => table.resetColumnFilters()}
|
|
353
361
|
className="text-xs font-medium text-gray-light-500 hover:text-gray-light-900 dark:text-gray-dark-400 dark:hover:text-gray-dark-100"
|
|
354
362
|
>
|
|
355
|
-
|
|
363
|
+
{translations.clearFilters}
|
|
356
364
|
</button>
|
|
357
365
|
) : null}
|
|
358
366
|
</div>
|
|
@@ -364,7 +372,11 @@ export function DataTableStackOptions<TEntity extends RowData>({
|
|
|
364
372
|
<Text size="xs" className="font-medium">
|
|
365
373
|
{columnLabel(column)}
|
|
366
374
|
</Text>
|
|
367
|
-
<DataTableFilterControl
|
|
375
|
+
<DataTableFilterControl
|
|
376
|
+
column={column}
|
|
377
|
+
filter={filter}
|
|
378
|
+
translations={translations}
|
|
379
|
+
/>
|
|
368
380
|
</div>
|
|
369
381
|
)
|
|
370
382
|
})}
|
|
@@ -43,9 +43,12 @@ export function DataTableGlobalFilter({
|
|
|
43
43
|
* checked and disabled. */
|
|
44
44
|
export function DataTableColumnVisibilityMenu<TEntity extends RowData>({
|
|
45
45
|
table,
|
|
46
|
+
label,
|
|
46
47
|
className,
|
|
47
48
|
}: {
|
|
48
49
|
table: ReactTableInstance<DataTableFeatures, TEntity>
|
|
50
|
+
/** The trigger's accessible name — `translations.columnVisibility`. */
|
|
51
|
+
label: string
|
|
49
52
|
className?: string
|
|
50
53
|
}) {
|
|
51
54
|
const columns = table.getAllLeafColumns().filter((column) => !column.columnDef.meta?.hideFromMenu)
|
|
@@ -57,7 +60,7 @@ export function DataTableColumnVisibilityMenu<TEntity extends RowData>({
|
|
|
57
60
|
variant="subtle"
|
|
58
61
|
color="neutral"
|
|
59
62
|
size="sm"
|
|
60
|
-
aria-label=
|
|
63
|
+
aria-label={label}
|
|
61
64
|
className={className}
|
|
62
65
|
>
|
|
63
66
|
<Columns3CogIcon strokeWidth={1} />
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { SortDirection } from "@tanstack/react-table"
|
|
2
|
+
import { COMBOBOX_DEFAULT_TRANSLATIONS } from "../combobox/combobox"
|
|
3
|
+
import type { DrawerTranslations } from "../drawer/drawer"
|
|
4
|
+
import {
|
|
5
|
+
NUMBER_INPUT_DEFAULT_TRANSLATIONS,
|
|
6
|
+
type NumberInputTranslations,
|
|
7
|
+
} from "../number-input/number-input"
|
|
8
|
+
import type { DataTablePaginationTranslations } from "./data-table-pagination"
|
|
9
|
+
|
|
10
|
+
/** A column's current sort state, as the sort controls name it — `"none"` when unsorted. */
|
|
11
|
+
export type DataTableSortMode = SortDirection | "none"
|
|
12
|
+
|
|
13
|
+
/** `DataTable`'s own wording, outside the pagination footer. Every key is optional; a partial
|
|
14
|
+
* override only replaces the keys it sets. Label-bearing keys are functions so word order stays
|
|
15
|
+
* the translator's call (`(label) => \`Redimensionner la colonne ${label}\``). */
|
|
16
|
+
export type DataTableOwnTranslations = {
|
|
17
|
+
/** Accessible name of the header's select-all checkbox. Default `"Select all rows"`. */
|
|
18
|
+
selectAllRows?: string
|
|
19
|
+
/** Accessible name of a row's checkbox. Default `` (id) => `Select row ${id}` ``. */
|
|
20
|
+
selectRow?: (rowId: string) => string
|
|
21
|
+
/** Accessible name of the toolbar's column-visibility menu trigger. Default
|
|
22
|
+
* `"Toggle column visibility"`. */
|
|
23
|
+
columnVisibility?: string
|
|
24
|
+
/** Accessible name of a column's resize handle. Default `` (label) => `Resize ${label} column` ``. */
|
|
25
|
+
resizeColumn?: (label: string) => string
|
|
26
|
+
/** Accessible name of a column's sort toggle, in the header and the stacked options drawer.
|
|
27
|
+
* Default `` (label, mode) => `Sort ${label} (ascending)` `` — `"ascending"`, `"descending"`
|
|
28
|
+
* or `"none"` after `mode`. */
|
|
29
|
+
sortColumn?: (label: string, mode: DataTableSortMode) => string
|
|
30
|
+
/** Accessible name of a column's filter trigger. Default `` `Filter ${label}` ``, with
|
|
31
|
+
* `" (active)"` appended while a filter value is set. */
|
|
32
|
+
filterColumn?: (label: string, active: boolean) => string
|
|
33
|
+
/** The stacked layout's options button text and drawer title. Default `"Table options"`. */
|
|
34
|
+
tableOptions?: string
|
|
35
|
+
/** The options button's accessible name while filters or sorting are active. Default
|
|
36
|
+
* `` (count) => `Table options (${count} active)` ``. */
|
|
37
|
+
tableOptionsActive?: (count: number) => string
|
|
38
|
+
/** The options drawer's column-visibility section heading. Default `"Columns"`. */
|
|
39
|
+
columns?: string
|
|
40
|
+
/** The options drawer's sort section heading. Default `"Sort by"`. */
|
|
41
|
+
sortBy?: string
|
|
42
|
+
/** The options drawer's reset-sorting button. Default `"Clear sorts"`. */
|
|
43
|
+
clearSorts?: string
|
|
44
|
+
/** The options drawer's filter section heading. Default `"Filters"`. */
|
|
45
|
+
filters?: string
|
|
46
|
+
/** Resets every column filter — the empty state's action and the options drawer's button.
|
|
47
|
+
* Default `"Clear filters"`. */
|
|
48
|
+
clearFilters?: string
|
|
49
|
+
/** The error state's retry button, shown when `onRetry` is set. Default `"Retry"`. */
|
|
50
|
+
retry?: string
|
|
51
|
+
/** Placeholder of a `number` filter's lower bound. Default `"Min"`. */
|
|
52
|
+
min?: string
|
|
53
|
+
/** Placeholder of a `number` filter's upper bound. Default `"Max"`. */
|
|
54
|
+
max?: string
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Overrides `DataTable`'s wording, as one prop: its own (`DataTableOwnTranslations`), the
|
|
58
|
+
* pagination footer's (`DataTablePaginationTranslations`), and the keys of the controls its
|
|
59
|
+
* column filters render — `clearTriggerLabel` for the `select` and `number` filters' clear
|
|
60
|
+
* buttons, `incrementLabel`/`decrementLabel` for the `number` filter's steppers,
|
|
61
|
+
* `closeTriggerLabel` for the stacked options drawer's close button. */
|
|
62
|
+
export type DataTableTranslations = DataTablePaginationTranslations &
|
|
63
|
+
DataTableOwnTranslations &
|
|
64
|
+
Pick<NumberInputTranslations, "clearTriggerLabel" | "incrementLabel" | "decrementLabel"> &
|
|
65
|
+
Pick<DrawerTranslations, "closeTriggerLabel">
|
|
66
|
+
|
|
67
|
+
/** What the internal parts receive: every own and forwarded key filled in. */
|
|
68
|
+
export type ResolvedDataTableTranslations = Required<DataTableOwnTranslations> & {
|
|
69
|
+
clearTriggerLabel: string
|
|
70
|
+
incrementLabel: string
|
|
71
|
+
decrementLabel: string
|
|
72
|
+
/** Left unset by default — the drawer applies its own. */
|
|
73
|
+
closeTriggerLabel?: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const SORT_MODE_LABEL = { asc: "ascending", desc: "descending", none: "none" } as const
|
|
77
|
+
|
|
78
|
+
export const DATA_TABLE_DEFAULT_TRANSLATIONS: ResolvedDataTableTranslations = {
|
|
79
|
+
selectAllRows: "Select all rows",
|
|
80
|
+
selectRow: (rowId) => `Select row ${rowId}`,
|
|
81
|
+
columnVisibility: "Toggle column visibility",
|
|
82
|
+
resizeColumn: (label) => `Resize ${label} column`,
|
|
83
|
+
sortColumn: (label, mode) => `Sort ${label} (${SORT_MODE_LABEL[mode]})`,
|
|
84
|
+
filterColumn: (label, active) => (active ? `Filter ${label} (active)` : `Filter ${label}`),
|
|
85
|
+
tableOptions: "Table options",
|
|
86
|
+
tableOptionsActive: (count) => `Table options (${count} active)`,
|
|
87
|
+
columns: "Columns",
|
|
88
|
+
sortBy: "Sort by",
|
|
89
|
+
clearSorts: "Clear sorts",
|
|
90
|
+
filters: "Filters",
|
|
91
|
+
clearFilters: "Clear filters",
|
|
92
|
+
retry: "Retry",
|
|
93
|
+
min: "Min",
|
|
94
|
+
max: "Max",
|
|
95
|
+
clearTriggerLabel: COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel,
|
|
96
|
+
incrementLabel: NUMBER_INPUT_DEFAULT_TRANSLATIONS.incrementLabel,
|
|
97
|
+
decrementLabel: NUMBER_INPUT_DEFAULT_TRANSLATIONS.decrementLabel,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Shallow per-key merge over the English defaults. The pagination keys ride along untouched —
|
|
101
|
+
* `DataTablePagination` merges its own. */
|
|
102
|
+
export const resolveDataTableTranslations = (
|
|
103
|
+
overrides?: DataTableTranslations,
|
|
104
|
+
): ResolvedDataTableTranslations & DataTablePaginationTranslations =>
|
|
105
|
+
overrides ? { ...DATA_TABLE_DEFAULT_TRANSLATIONS, ...overrides } : DATA_TABLE_DEFAULT_TRANSLATIONS
|
|
@@ -1232,3 +1232,124 @@ describe('DataTable sizing="auto"', () => {
|
|
|
1232
1232
|
expect(sort?.className).not.toContain("outline-0")
|
|
1233
1233
|
})
|
|
1234
1234
|
})
|
|
1235
|
+
|
|
1236
|
+
describe("DataTable own translations", () => {
|
|
1237
|
+
const filterColumns = [
|
|
1238
|
+
col.accessor("name", { header: "Name" }),
|
|
1239
|
+
col.accessor("age", { header: "Age", meta: { filter: { type: "number" } } }),
|
|
1240
|
+
]
|
|
1241
|
+
const renderFull = (translations?: Parameters<typeof DataTable<User>>[0]["translations"]) =>
|
|
1242
|
+
render(
|
|
1243
|
+
<DataTable
|
|
1244
|
+
columns={filterColumns}
|
|
1245
|
+
data={USERS}
|
|
1246
|
+
enableRowSelection
|
|
1247
|
+
enableColumnVisibility
|
|
1248
|
+
enableColumnResizing
|
|
1249
|
+
title="Users"
|
|
1250
|
+
translations={translations}
|
|
1251
|
+
/>,
|
|
1252
|
+
)
|
|
1253
|
+
|
|
1254
|
+
it("uses the English defaults for every header control and checkbox", () => {
|
|
1255
|
+
renderFull()
|
|
1256
|
+
expect(screen.getByRole("checkbox", { name: "Select all rows" })).toBeTruthy()
|
|
1257
|
+
expect(screen.getByRole("checkbox", { name: "Select row 0" })).toBeTruthy()
|
|
1258
|
+
expect(screen.getByRole("button", { name: "Toggle column visibility" })).toBeTruthy()
|
|
1259
|
+
expect(screen.getByRole("button", { name: "Sort Name (none)" })).toBeTruthy()
|
|
1260
|
+
expect(screen.getByRole("separator", { name: "Resize Name column" })).toBeTruthy()
|
|
1261
|
+
expect(screen.getByRole("button", { name: "Filter Age" })).toBeTruthy()
|
|
1262
|
+
})
|
|
1263
|
+
|
|
1264
|
+
it("routes every own key into the matching accessible name", async () => {
|
|
1265
|
+
renderFull({
|
|
1266
|
+
selectAllRows: "Tout sélectionner",
|
|
1267
|
+
selectRow: (id) => `Sélectionner la ligne ${id}`,
|
|
1268
|
+
columnVisibility: "Colonnes visibles",
|
|
1269
|
+
sortColumn: (label, mode) => `Trier ${label} [${mode}]`,
|
|
1270
|
+
resizeColumn: (label) => `Redimensionner ${label}`,
|
|
1271
|
+
filterColumn: (label, active) => `Filtrer ${label}${active ? " *" : ""}`,
|
|
1272
|
+
min: "Minimum",
|
|
1273
|
+
max: "Maximum",
|
|
1274
|
+
})
|
|
1275
|
+
expect(screen.getByRole("checkbox", { name: "Tout sélectionner" })).toBeTruthy()
|
|
1276
|
+
expect(screen.getByRole("checkbox", { name: "Sélectionner la ligne 0" })).toBeTruthy()
|
|
1277
|
+
expect(screen.getByRole("button", { name: "Colonnes visibles" })).toBeTruthy()
|
|
1278
|
+
expect(screen.getByRole("separator", { name: "Redimensionner Name" })).toBeTruthy()
|
|
1279
|
+
|
|
1280
|
+
fireEvent.click(screen.getByRole("button", { name: "Trier Name [none]" }))
|
|
1281
|
+
expect(await screen.findByRole("button", { name: "Trier Name [asc]" })).toBeTruthy()
|
|
1282
|
+
|
|
1283
|
+
fireEvent.click(screen.getByRole("button", { name: "Filtrer Age" }))
|
|
1284
|
+
expect(await screen.findByPlaceholderText("Minimum")).toBeTruthy()
|
|
1285
|
+
expect(screen.getByPlaceholderText("Maximum")).toBeTruthy()
|
|
1286
|
+
})
|
|
1287
|
+
|
|
1288
|
+
it("keeps the English default for any own key a partial override omits", () => {
|
|
1289
|
+
renderFull({ selectAllRows: "Tout sélectionner" })
|
|
1290
|
+
expect(screen.getByRole("checkbox", { name: "Tout sélectionner" })).toBeTruthy()
|
|
1291
|
+
expect(screen.getByRole("checkbox", { name: "Select row 0" })).toBeTruthy()
|
|
1292
|
+
expect(screen.getByRole("button", { name: "Sort Name (none)" })).toBeTruthy()
|
|
1293
|
+
expect(screen.getByRole("button", { name: "Next page" })).toBeTruthy()
|
|
1294
|
+
})
|
|
1295
|
+
|
|
1296
|
+
it("forwards the child controls' keys to the filters and the page-size Select", async () => {
|
|
1297
|
+
render(
|
|
1298
|
+
<DataTable
|
|
1299
|
+
columns={[
|
|
1300
|
+
col.accessor("name", {
|
|
1301
|
+
header: "Name",
|
|
1302
|
+
meta: { filter: { type: "select", options: ["Ada", "Grace"] } },
|
|
1303
|
+
}),
|
|
1304
|
+
col.accessor("age", { header: "Age", meta: { filter: { type: "number" } } }),
|
|
1305
|
+
]}
|
|
1306
|
+
data={USERS}
|
|
1307
|
+
initialState={{ filters: [{ id: "name", value: "Ada" }] }}
|
|
1308
|
+
translations={{
|
|
1309
|
+
triggerLabel: "Afficher les options",
|
|
1310
|
+
clearTriggerLabel: "Effacer",
|
|
1311
|
+
incrementLabel: "Augmenter",
|
|
1312
|
+
}}
|
|
1313
|
+
/>,
|
|
1314
|
+
)
|
|
1315
|
+
expect(screen.getByRole("button", { name: "Afficher les options" })).toBeTruthy()
|
|
1316
|
+
|
|
1317
|
+
fireEvent.click(screen.getByRole("button", { name: "Filter Name (active)" }))
|
|
1318
|
+
expect(await screen.findByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
1319
|
+
|
|
1320
|
+
fireEvent.click(screen.getByRole("button", { name: "Filter Age" }))
|
|
1321
|
+
expect((await screen.findAllByRole("button", { name: "Augmenter" })).length).toBe(2)
|
|
1322
|
+
expect(screen.getAllByRole("button", { name: "Decrement" }).length).toBe(2)
|
|
1323
|
+
})
|
|
1324
|
+
|
|
1325
|
+
it("translates the stacked layout's options button and drawer", async () => {
|
|
1326
|
+
render(
|
|
1327
|
+
<DataTable
|
|
1328
|
+
columns={filterColumns}
|
|
1329
|
+
data={USERS}
|
|
1330
|
+
responsive="stack"
|
|
1331
|
+
translations={{ tableOptions: "Options du tableau", closeTriggerLabel: "Fermer" }}
|
|
1332
|
+
/>,
|
|
1333
|
+
)
|
|
1334
|
+
fireEvent.click(screen.getByRole("button", { name: "Options du tableau" }))
|
|
1335
|
+
expect(await screen.findByRole("button", { name: "Fermer" })).toBeTruthy()
|
|
1336
|
+
})
|
|
1337
|
+
|
|
1338
|
+
it("translates the empty and error state actions", () => {
|
|
1339
|
+
const { unmount } = render(
|
|
1340
|
+
<DataTable columns={columns} data={[]} translations={{ clearFilters: "Effacer" }} />,
|
|
1341
|
+
)
|
|
1342
|
+
expect(screen.getByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
1343
|
+
unmount()
|
|
1344
|
+
render(
|
|
1345
|
+
<DataTable
|
|
1346
|
+
columns={columns}
|
|
1347
|
+
data={USERS}
|
|
1348
|
+
error="Oops"
|
|
1349
|
+
onRetry={() => {}}
|
|
1350
|
+
translations={{ retry: "Réessayer" }}
|
|
1351
|
+
/>,
|
|
1352
|
+
)
|
|
1353
|
+
expect(screen.getByRole("button", { name: "Réessayer" })).toBeTruthy()
|
|
1354
|
+
})
|
|
1355
|
+
})
|