@42-central/ui-react 0.18.2 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-YXE4B6X3.js → chunk-2NNZHVKD.js} +3 -3
- package/dist/{chunk-YXE4B6X3.js.map → chunk-2NNZHVKD.js.map} +1 -1
- package/dist/{chunk-5JHDSVEZ.js → chunk-4NNGTNPV.js} +10 -8
- package/dist/chunk-4NNGTNPV.js.map +1 -0
- package/dist/{chunk-7NZSTCJO.js → chunk-57BTVRRB.js} +4 -9
- package/dist/chunk-57BTVRRB.js.map +1 -0
- package/dist/{chunk-S2HWWR2H.js → chunk-64T6Z7BA.js} +3 -3
- package/dist/{chunk-S2HWWR2H.js.map → chunk-64T6Z7BA.js.map} +1 -1
- package/dist/{chunk-MI2WZRK3.js → chunk-A6MYJTJI.js} +4 -4
- package/dist/{chunk-MI2WZRK3.js.map → chunk-A6MYJTJI.js.map} +1 -1
- package/dist/{chunk-RQL7FVCS.js → chunk-BTFBBNRW.js} +11 -6
- package/dist/chunk-BTFBBNRW.js.map +1 -0
- package/dist/{chunk-OWG4BCQR.js → chunk-CYWMES5P.js} +4 -4
- package/dist/{chunk-OWG4BCQR.js.map → chunk-CYWMES5P.js.map} +1 -1
- package/dist/{chunk-YBJB7FGE.js → chunk-CZEKZ5HR.js} +6 -6
- package/dist/chunk-CZEKZ5HR.js.map +1 -0
- package/dist/{chunk-HAQJQFE6.js → chunk-DBTJEBMO.js} +11 -4
- package/dist/{chunk-HAQJQFE6.js.map → chunk-DBTJEBMO.js.map} +1 -1
- package/dist/{chunk-AE7QTLJ5.js → chunk-FAOBC4IS.js} +4 -4
- package/dist/{chunk-AE7QTLJ5.js.map → chunk-FAOBC4IS.js.map} +1 -1
- package/dist/{chunk-NF5JM2YO.js → chunk-FOMR74VE.js} +3 -3
- package/dist/{chunk-NF5JM2YO.js.map → chunk-FOMR74VE.js.map} +1 -1
- package/dist/{chunk-FZIHZT5R.js → chunk-GCGX4FEF.js} +16 -10
- package/dist/chunk-GCGX4FEF.js.map +1 -0
- package/dist/{chunk-B2YJKRNQ.js → chunk-HCYULRWT.js} +13 -9
- package/dist/chunk-HCYULRWT.js.map +1 -0
- package/dist/{chunk-B2LCHXUB.js → chunk-INJUILCN.js} +9 -4
- package/dist/chunk-INJUILCN.js.map +1 -0
- package/dist/{chunk-ZDXQ64A7.js → chunk-K5UWVH6P.js} +5 -5
- package/dist/{chunk-ZDXQ64A7.js.map → chunk-K5UWVH6P.js.map} +1 -1
- package/dist/{chunk-6GDMSENK.js → chunk-LM6F6DLR.js} +3 -24
- package/dist/chunk-LM6F6DLR.js.map +1 -0
- package/dist/{chunk-KHMFNH3X.js → chunk-MQO42HZL.js} +7 -7
- package/dist/chunk-MQO42HZL.js.map +1 -0
- package/dist/chunk-OC7I2CTA.js +8 -0
- package/dist/chunk-OC7I2CTA.js.map +1 -0
- package/dist/{chunk-O23Y5ML4.js → chunk-OGJFDNIS.js} +249 -231
- package/dist/chunk-OGJFDNIS.js.map +1 -0
- package/dist/{chunk-6OLTJYSX.js → chunk-PINENGML.js} +12 -5
- package/dist/chunk-PINENGML.js.map +1 -0
- package/dist/{chunk-NSDM3FEB.js → chunk-PS2PZFXH.js} +5 -3
- package/dist/chunk-PS2PZFXH.js.map +1 -0
- package/dist/{chunk-RAUOFTUH.js → chunk-QIDAXFKK.js} +4 -4
- package/dist/{chunk-RAUOFTUH.js.map → chunk-QIDAXFKK.js.map} +1 -1
- package/dist/{chunk-S7N4LGLZ.js → chunk-RIP5G47F.js} +4 -4
- package/dist/{chunk-S7N4LGLZ.js.map → chunk-RIP5G47F.js.map} +1 -1
- package/dist/{chunk-Z2Z5EXVT.js → chunk-RKYXG6X7.js} +3 -3
- package/dist/{chunk-Z2Z5EXVT.js.map → chunk-RKYXG6X7.js.map} +1 -1
- package/dist/{chunk-WQN64ZHG.js → chunk-SVKU3GUN.js} +10 -6
- package/dist/chunk-SVKU3GUN.js.map +1 -0
- package/dist/{chunk-FHG54IT5.js → chunk-TBTSEPGP.js} +13 -4
- package/dist/chunk-TBTSEPGP.js.map +1 -0
- package/dist/{chunk-HT5JAHR3.js → chunk-UJZIF2BA.js} +20 -9
- package/dist/chunk-UJZIF2BA.js.map +1 -0
- package/dist/{chunk-UHNRAI6V.js → chunk-VZBUQNLX.js} +68 -29
- package/dist/chunk-VZBUQNLX.js.map +1 -0
- package/dist/{chunk-JITF6I7N.js → chunk-WJOHNCYY.js} +11 -4
- package/dist/{chunk-JITF6I7N.js.map → chunk-WJOHNCYY.js.map} +1 -1
- package/dist/{chunk-EBREIC3L.js → chunk-YQHOKMSV.js} +26 -8
- package/dist/chunk-YQHOKMSV.js.map +1 -0
- package/dist/{chunk-WHKKN3ZK.js → chunk-YW6Q6ERX.js} +10 -8
- package/dist/chunk-YW6Q6ERX.js.map +1 -0
- package/dist/{chunk-PH354ECN.js → chunk-Z43YWH4R.js} +13 -4
- package/dist/chunk-Z43YWH4R.js.map +1 -0
- package/dist/{chunk-5OQLFX47.js → chunk-Z6RPMRFH.js} +3 -3
- package/dist/{chunk-5OQLFX47.js.map → chunk-Z6RPMRFH.js.map} +1 -1
- package/dist/{chunk-TCWYBVIL.js → chunk-ZB5VMGKB.js} +10 -7
- package/dist/chunk-ZB5VMGKB.js.map +1 -0
- package/dist/colors.css +15 -10
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/action-icon/index.js +3 -3
- package/dist/components/alert/index.js +3 -3
- package/dist/components/app-shell/index.js +4 -4
- package/dist/components/autocomplete/autocomplete.d.ts +8 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.d.ts +1 -1
- package/dist/components/autocomplete/index.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +10 -7
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/index.js +3 -3
- package/dist/components/button-multi-select/index.js +5 -5
- package/dist/components/button-select/index.js +5 -5
- package/dist/components/calendar/calendar-zone-sync.d.ts +41 -0
- package/dist/components/calendar/calendar-zone-sync.d.ts.map +1 -0
- package/dist/components/calendar/calendar.d.ts +6 -5
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.js +8 -5
- package/dist/components/chart/chart.d.ts +17 -10
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.js +50 -7
- package/dist/components/chart/index.js.map +1 -1
- package/dist/components/chart/styles.css +100 -0
- package/dist/components/checkbox/index.js +4 -4
- package/dist/components/choice-card-group/index.d.ts.map +1 -1
- package/dist/components/choice-card-group/index.js +4 -3
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/copy.d.ts.map +1 -1
- package/dist/components/clipboard/index.js +5 -5
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +4 -4
- package/dist/components/code-block/index.js +5 -5
- package/dist/components/combobox/combobox.d.ts +20 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/combobox/index.js +4 -4
- package/dist/components/combobox-list/combobox-list.d.ts +8 -1
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/index.d.ts +1 -1
- package/dist/components/combobox-list/index.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +5 -5
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/index.d.ts +5 -1
- package/dist/components/data-table/data-table-filter/index.d.ts.map +1 -1
- package/dist/components/data-table/data-table-header-cell.d.ts +11 -15
- package/dist/components/data-table/data-table-header-cell.d.ts.map +1 -1
- package/dist/components/data-table/data-table-meta.d.ts +2 -2
- package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
- package/dist/components/data-table/data-table-pagination.d.ts +3 -0
- package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts +5 -2
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +3 -1
- package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
- package/dist/components/data-table/data-table-translations.d.ts +68 -0
- package/dist/components/data-table/data-table-translations.d.ts.map +1 -0
- package/dist/components/data-table/data-table.d.ts +5 -8
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.d.ts +2 -1
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +162 -79
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +13 -9
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +16 -15
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +9 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/index.d.ts.map +1 -1
- package/dist/components/drawer/index.js +4 -4
- package/dist/components/field/field.d.ts +9 -2
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/file-upload/file-upload.d.ts +13 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +16 -7
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/input/index.js +2 -2
- package/dist/components/kbd/index.js +1 -1
- package/dist/components/menu/index.js +2 -2
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +4 -4
- package/dist/components/modal/modal.d.ts +9 -1
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.d.ts +1 -1
- package/dist/components/multi-combobox-list/index.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +7 -5
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +8 -1
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.d.ts +1 -1
- package/dist/components/multi-select/index.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +20 -9
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +11 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.d.ts +1 -1
- package/dist/components/nav-link/index.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +2 -2
- package/dist/components/nav-link/nav-link.d.ts +12 -0
- package/dist/components/nav-link/nav-link.d.ts.map +1 -1
- package/dist/components/nav-link/navigation.d.ts +3 -1
- package/dist/components/nav-link/navigation.d.ts.map +1 -1
- package/dist/components/nav-link/tanstack.js +2 -2
- package/dist/components/notification/create-notifier.d.ts +12 -1
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.d.ts +2 -2
- package/dist/components/notification/index.d.ts.map +1 -1
- package/dist/components/notification/index.js +9 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +14 -1
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/number-input/index.d.ts +1 -1
- package/dist/components/number-input/index.d.ts.map +1 -1
- package/dist/components/number-input/index.js +4 -4
- package/dist/components/number-input/number-input.d.ts +20 -2
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/index.js +6 -6
- package/dist/components/password-input/index.d.ts +1 -1
- package/dist/components/password-input/index.d.ts.map +1 -1
- package/dist/components/password-input/index.js +68 -7
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +45 -6
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/pill/index.js +2 -2
- package/dist/components/pills-input/index.js +5 -5
- package/dist/components/pin-input/index.js +2 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.d.ts +0 -10
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.js.map +1 -1
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/radio-group/index.js +3 -3
- package/dist/components/rating/index.js +2 -2
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.js +60 -48
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/schedule/now-cursor-line.d.ts +10 -5
- package/dist/components/schedule/now-cursor-line.d.ts.map +1 -1
- package/dist/components/schedule/schedule-dates.d.ts +11 -26
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-chip.d.ts +4 -1
- package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-details.d.ts +3 -2
- package/dist/components/schedule/schedule-event-details.d.ts.map +1 -1
- package/dist/components/schedule/schedule-geometry.d.ts +20 -21
- package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
- package/dist/components/schedule/schedule-grid-gesture.d.ts +5 -9
- package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
- package/dist/components/schedule/schedule-segments.d.ts +2 -3
- package/dist/components/schedule/schedule-segments.d.ts.map +1 -1
- package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
- package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
- package/dist/components/segment-group/index.js +4 -3
- package/dist/components/segment-group/segment-group.d.ts +3 -2
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +6 -4
- package/dist/components/select/select.d.ts +12 -2
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/switch/index.js +2 -2
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +4 -3
- package/dist/components/tabs/tabs.d.ts +3 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tags-input/index.d.ts +1 -1
- package/dist/components/tags-input/index.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +9 -7
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +9 -2
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/theme-icon/index.js +2 -2
- package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
- package/dist/components/time-input/index.js +24 -8
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/time-input/time-input.d.ts.map +1 -1
- package/dist/components/time-input/time-row.d.ts +16 -3
- package/dist/components/time-input/time-row.d.ts.map +1 -1
- package/dist/components/timeline/index.js +11 -3
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/tree-multi-select/index.d.ts +1 -1
- package/dist/components/tree-multi-select/index.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.js +62 -44
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +10 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.d.ts +1 -1
- package/dist/components/tree-select/index.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +45 -15
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +10 -1
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/date-value.d.ts +14 -1
- package/dist/lib/date-value.d.ts.map +1 -1
- package/dist/lib/focus-styles.d.ts +13 -5
- package/dist/lib/focus-styles.d.ts.map +1 -1
- package/dist/theme.css +24 -2
- package/package.json +1 -1
- package/src/colors.css +15 -10
- package/src/components/autocomplete/autocomplete.test.tsx +32 -0
- package/src/components/autocomplete/autocomplete.tsx +17 -5
- package/src/components/autocomplete/index.ts +5 -1
- package/src/components/button/button.test.tsx +6 -0
- package/src/components/calendar/calendar-zone-sync.tsx +79 -0
- package/src/components/calendar/calendar.test.tsx +134 -14
- package/src/components/calendar/calendar.tsx +36 -22
- package/src/components/chart/chart.test.tsx +115 -8
- package/src/components/chart/chart.tsx +115 -25
- package/src/components/chart/styles.css +100 -0
- package/src/components/choice-card-group/index.ts +2 -0
- package/src/components/circular-progress/circular-progress.tsx +2 -0
- package/src/components/clipboard/clipboard.test.tsx +54 -22
- package/src/components/clipboard/clipboard.tsx +2 -0
- package/src/components/clipboard/copy.tsx +2 -0
- package/src/components/clipboard/index.ts +3 -3
- package/src/components/combobox/combobox.test.tsx +22 -0
- package/src/components/combobox/combobox.tsx +20 -0
- package/src/components/combobox/index.ts +1 -0
- package/src/components/combobox-list/combobox-list.test.tsx +19 -0
- package/src/components/combobox-list/combobox-list.tsx +16 -2
- package/src/components/combobox-list/index.ts +5 -1
- package/src/components/data-table/data-table-filter/data-table-date-filter.tsx +5 -4
- package/src/components/data-table/data-table-filter/data-table-number-filter.tsx +16 -2
- package/src/components/data-table/data-table-filter/data-table-select-filter.tsx +9 -1
- package/src/components/data-table/data-table-filter/index.tsx +15 -1
- package/src/components/data-table/data-table-filter.test.tsx +33 -0
- package/src/components/data-table/data-table-header-cell.tsx +37 -22
- package/src/components/data-table/data-table-meta.ts +2 -2
- package/src/components/data-table/data-table-pagination.tsx +6 -0
- package/src/components/data-table/data-table-stack.tsx +26 -14
- package/src/components/data-table/data-table-toolbar.tsx +4 -1
- package/src/components/data-table/data-table-translations.ts +105 -0
- package/src/components/data-table/data-table.test.tsx +121 -0
- package/src/components/data-table/data-table.tsx +37 -17
- package/src/components/data-table/index.ts +9 -1
- package/src/components/date-picker/date-picker.test.tsx +197 -5
- package/src/components/date-picker/date-picker.tsx +42 -16
- package/src/components/drawer/drawer.tsx +14 -1
- package/src/components/drawer/index.ts +1 -0
- package/src/components/field/field.tsx +29 -3
- package/src/components/file-upload/file-upload.test.tsx +21 -0
- package/src/components/file-upload/file-upload.tsx +26 -3
- package/src/components/file-upload/index.ts +1 -1
- package/src/components/modal/index.ts +1 -0
- package/src/components/modal/modal-translations.test.tsx +27 -0
- package/src/components/modal/modal.tsx +14 -1
- package/src/components/multi-combobox-list/index.ts +5 -1
- package/src/components/multi-combobox-list/multi-combobox-list.test.tsx +19 -0
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +26 -4
- package/src/components/multi-select/index.ts +1 -1
- package/src/components/multi-select/multi-select.test.tsx +38 -0
- package/src/components/multi-select/multi-select.tsx +28 -4
- package/src/components/nav-link/index.ts +6 -1
- package/src/components/nav-link/nav-link.test.tsx +16 -0
- package/src/components/nav-link/nav-link.tsx +19 -1
- package/src/components/nav-link/navigation.test.tsx +18 -0
- package/src/components/nav-link/navigation.tsx +8 -4
- package/src/components/notification/create-notifier.tsx +20 -4
- package/src/components/notification/index.ts +7 -1
- package/src/components/notification/notification.test.tsx +49 -0
- package/src/components/notification/notification.tsx +39 -5
- package/src/components/number-input/index.ts +1 -1
- package/src/components/number-input/number-input.test.tsx +37 -0
- package/src/components/number-input/number-input.tsx +33 -4
- package/src/components/password-input/index.ts +5 -1
- package/src/components/password-input/password-input.test.tsx +201 -4
- package/src/components/password-input/password-input.tsx +162 -13
- package/src/components/popover/popover.tsx +0 -29
- package/src/components/progress/index.ts +3 -3
- package/src/components/progress/progress.tsx +2 -0
- package/src/components/rating/rating.tsx +2 -0
- package/src/components/schedule/now-cursor-line.test.tsx +56 -28
- package/src/components/schedule/now-cursor-line.tsx +30 -16
- package/src/components/schedule/schedule-agenda-view.test.tsx +1 -1
- package/src/components/schedule/schedule-dates.test.ts +19 -0
- package/src/components/schedule/schedule-dates.ts +16 -30
- package/src/components/schedule/schedule-details-popover.test.tsx +77 -6
- package/src/components/schedule/schedule-event-chip.tsx +17 -6
- package/src/components/schedule/schedule-event-details.test.tsx +38 -0
- package/src/components/schedule/schedule-event-details.tsx +7 -5
- package/src/components/schedule/schedule-geometry.test.ts +21 -18
- package/src/components/schedule/schedule-geometry.ts +37 -24
- package/src/components/schedule/schedule-grid-gesture.ts +5 -9
- package/src/components/schedule/schedule-segments.ts +2 -3
- package/src/components/schedule/schedule-timed-grid.tsx +43 -20
- package/src/components/schedule/schedule.test.tsx +34 -11
- package/src/components/schedule/use-event-resize.ts +6 -13
- package/src/components/segment-group/segment-group.test.tsx +23 -0
- package/src/components/segment-group/segment-group.tsx +13 -7
- package/src/components/select/index.ts +1 -1
- package/src/components/select/select.test.tsx +32 -0
- package/src/components/select/select.tsx +15 -1
- package/src/components/spinner/spinner.test.tsx +26 -0
- package/src/components/spinner/spinner.tsx +4 -1
- package/src/components/table/table.test.tsx +13 -0
- package/src/components/table/table.tsx +9 -5
- package/src/components/tabs/tabs.test.tsx +11 -0
- package/src/components/tabs/tabs.tsx +6 -4
- package/src/components/tags-input/index.ts +1 -1
- package/src/components/tags-input/tags-input.test.tsx +28 -0
- package/src/components/tags-input/tags-input.tsx +17 -1
- package/src/components/theme-icon/theme-icon.tsx +8 -3
- package/src/components/time-input/time-input.test.tsx +75 -0
- package/src/components/time-input/time-input.tsx +27 -3
- package/src/components/time-input/time-row.tsx +27 -3
- package/src/components/timeline/timeline.test.tsx +4 -1
- package/src/components/timeline/timeline.tsx +11 -3
- package/src/components/tree-multi-select/index.ts +5 -1
- package/src/components/tree-multi-select/tree-multi-select.test.tsx +72 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +156 -115
- package/src/components/tree-select/index.ts +1 -1
- package/src/components/tree-select/tree-select.test.tsx +69 -0
- package/src/components/tree-select/tree-select.tsx +128 -74
- package/src/lib/date-value.test.ts +19 -0
- package/src/lib/date-value.ts +21 -5
- package/src/lib/focus-styles.test.ts +21 -2
- package/src/lib/focus-styles.ts +24 -5
- package/src/theme.css +24 -2
- package/src/use-client-barrels.test.ts +80 -0
- package/dist/chunk-5JHDSVEZ.js.map +0 -1
- package/dist/chunk-6GDMSENK.js.map +0 -1
- package/dist/chunk-6OLTJYSX.js.map +0 -1
- package/dist/chunk-7NZSTCJO.js.map +0 -1
- package/dist/chunk-B2LCHXUB.js.map +0 -1
- package/dist/chunk-B2YJKRNQ.js.map +0 -1
- package/dist/chunk-EBREIC3L.js.map +0 -1
- package/dist/chunk-FHG54IT5.js.map +0 -1
- package/dist/chunk-FZIHZT5R.js.map +0 -1
- package/dist/chunk-HT5JAHR3.js.map +0 -1
- package/dist/chunk-KHMFNH3X.js.map +0 -1
- package/dist/chunk-NSDM3FEB.js.map +0 -1
- package/dist/chunk-O23Y5ML4.js.map +0 -1
- package/dist/chunk-PH354ECN.js.map +0 -1
- package/dist/chunk-RQL7FVCS.js.map +0 -1
- package/dist/chunk-TCWYBVIL.js.map +0 -1
- package/dist/chunk-UHNRAI6V.js.map +0 -1
- package/dist/chunk-WHKKN3ZK.js.map +0 -1
- package/dist/chunk-WQN64ZHG.js.map +0 -1
- package/dist/chunk-YBJB7FGE.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { ark } from "@ark-ui/react/factory"
|
|
4
|
+
import { Field as Ark, type UseFieldContext, useFieldContext } from "@ark-ui/react/field"
|
|
4
5
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
6
|
import type { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
6
7
|
import type { NoAsChild } from "../../lib/as-child"
|
|
@@ -124,6 +125,13 @@ export type FieldProps = NoAsChild<Omit<ComponentPropsWithoutRef<typeof Ark.Root
|
|
|
124
125
|
description?: ReactNode
|
|
125
126
|
/** Error message below the control; its presence sets `invalid`. */
|
|
126
127
|
error?: ReactNode
|
|
128
|
+
/**
|
|
129
|
+
* The control is a composite — a radio group, a row of inputs — with no single labelable
|
|
130
|
+
* element for the `<label>` to point at. The label then renders as plain text with no `for`
|
|
131
|
+
* (which would otherwise reference an id nothing carries) and names the control only through
|
|
132
|
+
* the `aria-labelledby` that `fieldA11yProps` puts on it.
|
|
133
|
+
*/
|
|
134
|
+
composite?: boolean
|
|
127
135
|
/** Styles the field root (matching the kit's other components). */
|
|
128
136
|
className?: string
|
|
129
137
|
classNames?: FieldClassNames
|
|
@@ -146,6 +154,7 @@ export const FieldShell = ({
|
|
|
146
154
|
className,
|
|
147
155
|
classNames,
|
|
148
156
|
testId,
|
|
157
|
+
composite,
|
|
149
158
|
children,
|
|
150
159
|
}: Pick<
|
|
151
160
|
FieldProps,
|
|
@@ -158,6 +167,7 @@ export const FieldShell = ({
|
|
|
158
167
|
| "className"
|
|
159
168
|
| "classNames"
|
|
160
169
|
| "testId"
|
|
170
|
+
| "composite"
|
|
161
171
|
> & { children: ReactNode }) => {
|
|
162
172
|
const hasField = label != null || description != null || error != null || Boolean(required)
|
|
163
173
|
if (!hasField) return children
|
|
@@ -172,12 +182,26 @@ export const FieldShell = ({
|
|
|
172
182
|
className={className}
|
|
173
183
|
classNames={classNames}
|
|
174
184
|
testId={testId}
|
|
185
|
+
composite={composite}
|
|
175
186
|
>
|
|
176
187
|
{children}
|
|
177
188
|
</Field>
|
|
178
189
|
)
|
|
179
190
|
}
|
|
180
191
|
|
|
192
|
+
/**
|
|
193
|
+
* `Ark.Label`'s props on a `<span>`, minus its `for`: Ark always binds the label to
|
|
194
|
+
* `field.ids.control`, an id only `Ark.Input` (or a machine reading it, like `NumberInput`'s) ever
|
|
195
|
+
* renders. A composite control has no such element, so the binding would dangle — and a `<label>`
|
|
196
|
+
* with nothing to label is no better. Its name comes from `aria-labelledby` pointing at this
|
|
197
|
+
* span's id instead. Ark's `mergeProps` ignores an `undefined` override, so `htmlFor` has to be
|
|
198
|
+
* left out rather than unset on `Ark.Label`.
|
|
199
|
+
*/
|
|
200
|
+
const CompositeLabel = (labelProps: ComponentPropsWithoutRef<"span">) => {
|
|
201
|
+
const { htmlFor: _htmlFor, ...fieldLabelProps } = useFieldContext().getLabelProps()
|
|
202
|
+
return <ark.span {...fieldLabelProps} {...labelProps} />
|
|
203
|
+
}
|
|
204
|
+
|
|
181
205
|
export const Field = ({
|
|
182
206
|
label,
|
|
183
207
|
description,
|
|
@@ -189,10 +213,12 @@ export const Field = ({
|
|
|
189
213
|
className,
|
|
190
214
|
classNames,
|
|
191
215
|
testId,
|
|
216
|
+
composite,
|
|
192
217
|
asChild: _asChild,
|
|
193
218
|
...rest
|
|
194
219
|
}: FieldProps) => {
|
|
195
220
|
const isInvalid = invalid ?? error != null
|
|
221
|
+
const Label = composite ? CompositeLabel : Ark.Label
|
|
196
222
|
|
|
197
223
|
return (
|
|
198
224
|
<Ark.Root
|
|
@@ -203,7 +229,7 @@ export const Field = ({
|
|
|
203
229
|
{...rest}
|
|
204
230
|
>
|
|
205
231
|
{label != null && (
|
|
206
|
-
<
|
|
232
|
+
<Label className={cn(fieldLabel({ size }), classNames?.label)}>
|
|
207
233
|
{label}
|
|
208
234
|
{required && (
|
|
209
235
|
<Ark.RequiredIndicator
|
|
@@ -212,7 +238,7 @@ export const Field = ({
|
|
|
212
238
|
*
|
|
213
239
|
</Ark.RequiredIndicator>
|
|
214
240
|
)}
|
|
215
|
-
</
|
|
241
|
+
</Label>
|
|
216
242
|
)}
|
|
217
243
|
|
|
218
244
|
{description != null && (
|
|
@@ -45,3 +45,24 @@ describe("FileUpload", () => {
|
|
|
45
45
|
expect(dropzone.contains(screen.getByText(/drop files here or click to browse/i))).toBe(true)
|
|
46
46
|
})
|
|
47
47
|
})
|
|
48
|
+
|
|
49
|
+
describe("FileUpload translations", () => {
|
|
50
|
+
const file = new File(["x"], "cv.pdf", { type: "application/pdf" })
|
|
51
|
+
|
|
52
|
+
it("names each file's remove button and the browse button from translations", () => {
|
|
53
|
+
render(
|
|
54
|
+
<FileUpload
|
|
55
|
+
withButton
|
|
56
|
+
value={[file]}
|
|
57
|
+
translations={{ deleteFile: (f) => `Retirer ${f.name}`, browseFiles: "Parcourir" }}
|
|
58
|
+
/>,
|
|
59
|
+
)
|
|
60
|
+
expect(screen.getByRole("button", { name: "Retirer cv.pdf" })).toBeTruthy()
|
|
61
|
+
expect(screen.getByRole("button", { name: "Parcourir" })).toBeTruthy()
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it("keeps the English defaults for the keys a partial override omits", () => {
|
|
65
|
+
render(<FileUpload withButton value={[file]} translations={{ browseFiles: "Parcourir" }} />)
|
|
66
|
+
expect(screen.getByRole("button", { name: "Remove cv.pdf" })).toBeTruthy()
|
|
67
|
+
})
|
|
68
|
+
})
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
FileVideo,
|
|
12
12
|
UploadCloud,
|
|
13
13
|
} from "lucide-react"
|
|
14
|
-
import type { ReactNode, Ref } from "react"
|
|
14
|
+
import type { ComponentProps, ReactNode, Ref } from "react"
|
|
15
15
|
import { match, P } from "ts-pattern"
|
|
16
16
|
import { cn } from "../../lib/cn"
|
|
17
17
|
import { props } from "../../lib/props"
|
|
@@ -84,8 +84,26 @@ export type FileUploadProps = Pick<FieldProps, "label" | "description" | "error"
|
|
|
84
84
|
hint?: ReactNode
|
|
85
85
|
className?: string
|
|
86
86
|
classNames?: FileUploadClassNames
|
|
87
|
+
/** Overrides the browse button's text and the accessible names — see
|
|
88
|
+
* `FileUploadTranslations`. A partial override keeps the other defaults. */
|
|
89
|
+
translations?: FileUploadTranslations
|
|
87
90
|
}
|
|
88
91
|
|
|
92
|
+
/** Ark's own FileUpload `translations` type, derived structurally rather than imported from
|
|
93
|
+
* `@zag-js/file-upload`: `deleteFile(file)` names each file's remove button (default
|
|
94
|
+
* `` `Remove ${file.name}` ``), `dropzone` and `itemPreview(file)` keep Ark's English
|
|
95
|
+
* defaults. Plus `browseFiles`, the `withButton` trigger's text (default `"Browse files"`). */
|
|
96
|
+
export type FileUploadTranslations = NonNullable<
|
|
97
|
+
ComponentProps<typeof Ark.Root>["translations"]
|
|
98
|
+
> & {
|
|
99
|
+
browseFiles?: ReactNode
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const FILE_UPLOAD_DEFAULT_TRANSLATIONS = {
|
|
103
|
+
deleteFile: (file: File) => `Remove ${file.name}`,
|
|
104
|
+
browseFiles: "Browse files",
|
|
105
|
+
} as const satisfies FileUploadTranslations
|
|
106
|
+
|
|
89
107
|
export const FileUpload = ({
|
|
90
108
|
value,
|
|
91
109
|
onChange,
|
|
@@ -108,7 +126,12 @@ export const FileUpload = ({
|
|
|
108
126
|
className,
|
|
109
127
|
classNames,
|
|
110
128
|
testId,
|
|
129
|
+
translations,
|
|
111
130
|
}: FileUploadProps) => {
|
|
131
|
+
const { browseFiles, ...arkTranslations } = {
|
|
132
|
+
...FILE_UPLOAD_DEFAULT_TRANSLATIONS,
|
|
133
|
+
...translations,
|
|
134
|
+
}
|
|
112
135
|
// Red state is driven independently of the `Field` error slot so a form
|
|
113
136
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
114
137
|
const isInvalid = invalid || error != null
|
|
@@ -125,6 +148,7 @@ export const FileUpload = ({
|
|
|
125
148
|
invalid={isInvalid}
|
|
126
149
|
name={name}
|
|
127
150
|
id={id}
|
|
151
|
+
translations={arkTranslations}
|
|
128
152
|
onFileChange={onChange ? (d) => onChange(d.acceptedFiles) : undefined}
|
|
129
153
|
// `relative` contains the absolutely positioned hidden input, which would
|
|
130
154
|
// otherwise escape any scroller this control sits in.
|
|
@@ -167,7 +191,7 @@ export const FileUpload = ({
|
|
|
167
191
|
type="button"
|
|
168
192
|
disabled={disabled}
|
|
169
193
|
>
|
|
170
|
-
|
|
194
|
+
{browseFiles}
|
|
171
195
|
</Button>
|
|
172
196
|
</Ark.Trigger>
|
|
173
197
|
)}
|
|
@@ -197,7 +221,6 @@ export const FileUpload = ({
|
|
|
197
221
|
<Ark.ItemSizeText className="text-xs text-gray-light-600 dark:text-gray-dark-400" />
|
|
198
222
|
</div>
|
|
199
223
|
<Ark.ItemDeleteTrigger
|
|
200
|
-
aria-label={`Remove ${file.name}`}
|
|
201
224
|
className={cn(
|
|
202
225
|
"inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm me-1",
|
|
203
226
|
"text-gray-light-500 dark:text-gray-dark-400",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react"
|
|
2
|
+
import { describe, expect, it } from "vitest"
|
|
3
|
+
import { Drawer } from "../drawer/drawer"
|
|
4
|
+
import { Modal } from "./modal"
|
|
5
|
+
|
|
6
|
+
describe.each([
|
|
7
|
+
["Modal", Modal],
|
|
8
|
+
["Drawer", Drawer],
|
|
9
|
+
] as const)("%s translations", (_, Overlay) => {
|
|
10
|
+
it("names the default close button from translations", async () => {
|
|
11
|
+
render(
|
|
12
|
+
<Overlay defaultOpen title="Session" translations={{ closeTriggerLabel: "Fermer" }}>
|
|
13
|
+
Body
|
|
14
|
+
</Overlay>,
|
|
15
|
+
)
|
|
16
|
+
expect(await screen.findByRole("button", { name: "Fermer" })).toBeTruthy()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it("keeps the English default without an override", async () => {
|
|
20
|
+
render(
|
|
21
|
+
<Overlay defaultOpen title="Session" translations={{}}>
|
|
22
|
+
Body
|
|
23
|
+
</Overlay>,
|
|
24
|
+
)
|
|
25
|
+
expect(await screen.findByRole("button", { name: "Close" })).toBeTruthy()
|
|
26
|
+
})
|
|
27
|
+
})
|
|
@@ -323,8 +323,15 @@ export type ModalProps = Omit<
|
|
|
323
323
|
children?: ReactNode
|
|
324
324
|
className?: string
|
|
325
325
|
classNames?: ModalClassNames
|
|
326
|
+
/** Overrides the default close button's accessible name (`closeTriggerLabel`, default
|
|
327
|
+
* `"Close"`). The compound `ModalCloseTrigger` part takes a plain `aria-label` instead. */
|
|
328
|
+
translations?: ModalTranslations
|
|
326
329
|
}
|
|
327
330
|
|
|
331
|
+
/** The ready-made modal's wording — `closeTriggerLabel` follows Ark's naming for the
|
|
332
|
+
* same control. */
|
|
333
|
+
export type ModalTranslations = { closeTriggerLabel?: string }
|
|
334
|
+
|
|
328
335
|
const ModalComponent = ({
|
|
329
336
|
open,
|
|
330
337
|
defaultOpen,
|
|
@@ -347,6 +354,7 @@ const ModalComponent = ({
|
|
|
347
354
|
className,
|
|
348
355
|
classNames,
|
|
349
356
|
testId,
|
|
357
|
+
translations,
|
|
350
358
|
...rest
|
|
351
359
|
}: ModalProps) => {
|
|
352
360
|
const hasHeader = title != null || description != null || withCloseButton
|
|
@@ -401,7 +409,12 @@ const ModalComponent = ({
|
|
|
401
409
|
</ModalDescription>
|
|
402
410
|
)}
|
|
403
411
|
</div>
|
|
404
|
-
{withCloseButton &&
|
|
412
|
+
{withCloseButton && (
|
|
413
|
+
<ModalCloseTrigger
|
|
414
|
+
aria-label={translations?.closeTriggerLabel}
|
|
415
|
+
className={classNames?.closeButton}
|
|
416
|
+
/>
|
|
417
|
+
)}
|
|
405
418
|
</ModalHeader>
|
|
406
419
|
)}
|
|
407
420
|
<ModalBody
|
|
@@ -188,3 +188,22 @@ describe("MultiComboboxList — renders a built-in label from props", () => {
|
|
|
188
188
|
expect(screen.getByText("Roles")).toBeTruthy()
|
|
189
189
|
})
|
|
190
190
|
})
|
|
191
|
+
|
|
192
|
+
describe("MultiComboboxList translations", () => {
|
|
193
|
+
it("names the clear button from translations", () => {
|
|
194
|
+
render(
|
|
195
|
+
<MultiComboboxList
|
|
196
|
+
data={data}
|
|
197
|
+
clearable
|
|
198
|
+
defaultValue={["Staff"]}
|
|
199
|
+
translations={{ clearTriggerLabel: "Effacer" }}
|
|
200
|
+
/>,
|
|
201
|
+
)
|
|
202
|
+
expect(screen.getByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
it("keeps the English default without an override", () => {
|
|
206
|
+
render(<MultiComboboxList data={data} clearable defaultValue={["Staff"]} translations={{}} />)
|
|
207
|
+
expect(screen.getByRole("button", { name: "Clear value" })).toBeTruthy()
|
|
208
|
+
})
|
|
209
|
+
})
|
|
@@ -16,7 +16,12 @@ 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 { controlIndicator } from "../checkbox/control"
|
|
20
|
+
import {
|
|
21
|
+
COMBOBOX_DEFAULT_TRANSLATIONS,
|
|
22
|
+
Combobox,
|
|
23
|
+
type ComboboxTranslations,
|
|
24
|
+
} from "../combobox/combobox"
|
|
20
25
|
import { type FieldProps, FieldShell } from "../field/field"
|
|
21
26
|
import {
|
|
22
27
|
type InputSize,
|
|
@@ -26,7 +31,7 @@ import {
|
|
|
26
31
|
inputSlot,
|
|
27
32
|
} from "../input/input"
|
|
28
33
|
import { CheckIcon, CloseIcon } from "../popover/icons"
|
|
29
|
-
import {
|
|
34
|
+
import { popoverClearTrigger } from "../popover/popover"
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
37
|
* MultiComboboxList — a searchable, multi-value option list with no trigger of
|
|
@@ -108,8 +113,15 @@ export type MultiComboboxListProps<Data extends SelectData = SelectData> = Pick<
|
|
|
108
113
|
ref?: Ref<HTMLInputElement>
|
|
109
114
|
className?: string
|
|
110
115
|
classNames?: MultiComboboxListClassNames
|
|
116
|
+
/** Overrides the clear button's accessible name (`clearTriggerLabel`, default
|
|
117
|
+
* `"Clear value"`) — the same key as the rest of the combobox family. */
|
|
118
|
+
translations?: MultiComboboxListTranslations
|
|
111
119
|
}
|
|
112
120
|
|
|
121
|
+
/** The combobox family's `clearTriggerLabel` — the only family key this always-open list
|
|
122
|
+
* renders (it has no chevron). */
|
|
123
|
+
export type MultiComboboxListTranslations = Pick<ComboboxTranslations, "clearTriggerLabel">
|
|
124
|
+
|
|
113
125
|
export const MultiComboboxList = <const Data extends SelectData = SelectData>({
|
|
114
126
|
data,
|
|
115
127
|
value: valueProp,
|
|
@@ -136,7 +148,10 @@ export const MultiComboboxList = <const Data extends SelectData = SelectData>({
|
|
|
136
148
|
className,
|
|
137
149
|
classNames,
|
|
138
150
|
testId,
|
|
151
|
+
translations,
|
|
139
152
|
}: MultiComboboxListProps<Data>) => {
|
|
153
|
+
const clearLabel =
|
|
154
|
+
translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel
|
|
140
155
|
type Item = SelectValue<Data>
|
|
141
156
|
|
|
142
157
|
// Red state is driven independently of the `Field` error slot so a form
|
|
@@ -190,7 +205,14 @@ export const MultiComboboxList = <const Data extends SelectData = SelectData>({
|
|
|
190
205
|
renderItem(item as unknown as RenderableItem<Data>, state)
|
|
191
206
|
) : (
|
|
192
207
|
<>
|
|
193
|
-
|
|
208
|
+
{/* Presentational: the option row owns the selection semantics.
|
|
209
|
+
It borrows Checkbox's own box, driven by `data-state` the way
|
|
210
|
+
Ark drives the real one, so the two never drift apart. */}
|
|
211
|
+
<span
|
|
212
|
+
aria-hidden
|
|
213
|
+
data-state={state.selected ? "checked" : "unchecked"}
|
|
214
|
+
className={cn(controlIndicator({ size, variant: "filled" }), classNames?.checkbox)}
|
|
215
|
+
>
|
|
194
216
|
<ArkCombobox.ItemIndicator>
|
|
195
217
|
<CheckIcon />
|
|
196
218
|
</ArkCombobox.ItemIndicator>
|
|
@@ -258,7 +280,7 @@ export const MultiComboboxList = <const Data extends SelectData = SelectData>({
|
|
|
258
280
|
{canClear && (
|
|
259
281
|
<button
|
|
260
282
|
type="button"
|
|
261
|
-
aria-label=
|
|
283
|
+
aria-label={clearLabel}
|
|
262
284
|
aria-hidden={!showClear}
|
|
263
285
|
tabIndex={showClear ? 0 : -1}
|
|
264
286
|
onPointerDown={(event) => event.preventDefault()}
|
|
@@ -246,3 +246,41 @@ describe("MultiSelect — searchPlaceholder", () => {
|
|
|
246
246
|
expect(screen.getByRole("combobox").getAttribute("placeholder")).toBe("Pick values")
|
|
247
247
|
})
|
|
248
248
|
})
|
|
249
|
+
|
|
250
|
+
describe("MultiSelect translations", () => {
|
|
251
|
+
it("names the chevron, clear button and value pills from translations", () => {
|
|
252
|
+
render(
|
|
253
|
+
<MultiSelect
|
|
254
|
+
data={data}
|
|
255
|
+
label="Letters"
|
|
256
|
+
clearable
|
|
257
|
+
clearSectionMode="both"
|
|
258
|
+
defaultValue={["Alpha"]}
|
|
259
|
+
translations={{
|
|
260
|
+
triggerLabel: "Afficher les options",
|
|
261
|
+
clearTriggerLabel: "Tout effacer",
|
|
262
|
+
removeValue: (label) => `Retirer ${label}`,
|
|
263
|
+
}}
|
|
264
|
+
/>,
|
|
265
|
+
)
|
|
266
|
+
expect(screen.getByRole("button", { name: "Afficher les options" })).toBeTruthy()
|
|
267
|
+
expect(screen.getByRole("button", { name: "Tout effacer" })).toBeTruthy()
|
|
268
|
+
expect(screen.getByRole("button", { name: "Retirer Alpha" })).toBeTruthy()
|
|
269
|
+
})
|
|
270
|
+
|
|
271
|
+
it("keeps the English defaults for the keys a partial override omits", () => {
|
|
272
|
+
render(
|
|
273
|
+
<MultiSelect
|
|
274
|
+
data={data}
|
|
275
|
+
label="Letters"
|
|
276
|
+
clearable
|
|
277
|
+
clearSectionMode="both"
|
|
278
|
+
defaultValue={["Alpha"]}
|
|
279
|
+
translations={{ triggerLabel: "Afficher les options" }}
|
|
280
|
+
/>,
|
|
281
|
+
)
|
|
282
|
+
expect(screen.getByRole("button", { name: "Afficher les options" })).toBeTruthy()
|
|
283
|
+
expect(screen.getByRole("button", { name: "Clear value" })).toBeTruthy()
|
|
284
|
+
expect(screen.getByRole("button", { name: "Remove" })).toBeTruthy()
|
|
285
|
+
})
|
|
286
|
+
})
|
|
@@ -17,7 +17,11 @@ import {
|
|
|
17
17
|
} from "../../lib/select-data"
|
|
18
18
|
import type { WithTestId } from "../../lib/test-id"
|
|
19
19
|
import { useUncontrolled } from "../../lib/use-uncontrolled"
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
COMBOBOX_DEFAULT_TRANSLATIONS,
|
|
22
|
+
Combobox,
|
|
23
|
+
type ComboboxTranslations,
|
|
24
|
+
} from "../combobox/combobox"
|
|
21
25
|
import { type FieldProps, FieldShell } from "../field/field"
|
|
22
26
|
import {
|
|
23
27
|
type InputSize,
|
|
@@ -115,8 +119,22 @@ export type MultiSelectProps<Data extends SelectData> = Pick<
|
|
|
115
119
|
ref?: Ref<HTMLInputElement>
|
|
116
120
|
className?: string
|
|
117
121
|
classNames?: MultiSelectClassNames
|
|
122
|
+
/** Overrides the control's wording — see `MultiSelectTranslations`. A partial override keeps
|
|
123
|
+
* the other defaults. */
|
|
124
|
+
translations?: MultiSelectTranslations
|
|
118
125
|
}
|
|
119
126
|
|
|
127
|
+
/** The combobox family's `triggerLabel` (default `"Show options"`) and `clearTriggerLabel`
|
|
128
|
+
* (default `"Clear value"`), plus `removeValue`: a value pill's remove-button name, given the
|
|
129
|
+
* value's label (default `"Remove"` for every pill). */
|
|
130
|
+
export type MultiSelectTranslations = ComboboxTranslations & {
|
|
131
|
+
removeValue?: (label: string) => string
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const MULTI_SELECT_DEFAULT_TRANSLATIONS = {
|
|
135
|
+
removeValue: () => "Remove",
|
|
136
|
+
} as const satisfies MultiSelectTranslations
|
|
137
|
+
|
|
120
138
|
export const MultiSelect = <const Data extends SelectData>({
|
|
121
139
|
data,
|
|
122
140
|
value: valueProp,
|
|
@@ -149,7 +167,13 @@ export const MultiSelect = <const Data extends SelectData>({
|
|
|
149
167
|
className,
|
|
150
168
|
classNames,
|
|
151
169
|
testId,
|
|
170
|
+
translations,
|
|
152
171
|
}: MultiSelectProps<Data>) => {
|
|
172
|
+
const resolvedTranslations = {
|
|
173
|
+
...COMBOBOX_DEFAULT_TRANSLATIONS,
|
|
174
|
+
...MULTI_SELECT_DEFAULT_TRANSLATIONS,
|
|
175
|
+
...translations,
|
|
176
|
+
}
|
|
153
177
|
type Item = SelectValue<Data>
|
|
154
178
|
|
|
155
179
|
// Red state is driven independently of the `Field` error slot so a form
|
|
@@ -226,6 +250,7 @@ export const MultiSelect = <const Data extends SelectData>({
|
|
|
226
250
|
size={size}
|
|
227
251
|
variant={variant}
|
|
228
252
|
className={cn(className, classNames?.root)}
|
|
253
|
+
translations={resolvedTranslations}
|
|
229
254
|
>
|
|
230
255
|
<ArkCombobox.Context>
|
|
231
256
|
{(api) => {
|
|
@@ -259,6 +284,7 @@ export const MultiSelect = <const Data extends SelectData>({
|
|
|
259
284
|
disabled={disabled}
|
|
260
285
|
withRemoveButton={!readOnly}
|
|
261
286
|
onRemove={() => removeValue(v)}
|
|
287
|
+
removeLabel={resolvedTranslations.removeValue(itemMap.get(v)?.label ?? v)}
|
|
262
288
|
className={classNames?.pill}
|
|
263
289
|
data-overflow-item
|
|
264
290
|
>
|
|
@@ -312,9 +338,7 @@ export const MultiSelect = <const Data extends SelectData>({
|
|
|
312
338
|
</div>
|
|
313
339
|
{endSlot != null && <span className={inputSlot}>{endSlot}</span>}
|
|
314
340
|
{showClear && <Combobox.ClearTrigger />}
|
|
315
|
-
{(clearSectionMode === "both" || !showClear) &&
|
|
316
|
-
<Combobox.Trigger aria-label="Show options" data-chevron />
|
|
317
|
-
)}
|
|
341
|
+
{(clearSectionMode === "both" || !showClear) && <Combobox.Trigger data-chevron />}
|
|
318
342
|
{/* Hidden inputs carry the real selection so a native `<form>`
|
|
319
343
|
submits the value array (the search input is unnamed). When
|
|
320
344
|
controlled by a form library the value flows through `onChange`
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export {
|
|
4
|
+
NavLink,
|
|
5
|
+
type NavLinkClassNames,
|
|
6
|
+
type NavLinkProps,
|
|
7
|
+
type NavLinkTranslations,
|
|
8
|
+
} from "./nav-link"
|
|
4
9
|
export { Navigation, type NavigationItem, type NavigationProps } from "./navigation"
|
|
@@ -105,3 +105,19 @@ describe("NavLink", () => {
|
|
|
105
105
|
expect(document.querySelector("[data-stub-link]")).toBeTruthy()
|
|
106
106
|
})
|
|
107
107
|
})
|
|
108
|
+
|
|
109
|
+
describe("NavLink translations", () => {
|
|
110
|
+
it("names the chevron from translations, keeping the omitted key's default", () => {
|
|
111
|
+
render(
|
|
112
|
+
<NavLink
|
|
113
|
+
label="Settings"
|
|
114
|
+
linkOptions={{ href: "/settings" }}
|
|
115
|
+
translations={{ expandLabel: "Déplier" }}
|
|
116
|
+
>
|
|
117
|
+
<NavLink label="Profile" linkOptions={{ href: "/settings/profile" }} />
|
|
118
|
+
</NavLink>,
|
|
119
|
+
)
|
|
120
|
+
fireEvent.click(screen.getByRole("button", { name: "Déplier" }))
|
|
121
|
+
expect(screen.getByRole("button", { name: "Collapse" })).toBeTruthy()
|
|
122
|
+
})
|
|
123
|
+
})
|
|
@@ -78,6 +78,16 @@ export type NavLinkClassNames = {
|
|
|
78
78
|
items?: string
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/** The expand/collapse chevron's accessible names — the same keys as `Notification`'s. Only
|
|
82
|
+
* rendered for a row that is both a link and has children (a pure toggle row is its own
|
|
83
|
+
* button, named by its label). */
|
|
84
|
+
export type NavLinkTranslations = {
|
|
85
|
+
/** While the children are revealed. Default `"Collapse"`. */
|
|
86
|
+
collapseLabel?: string
|
|
87
|
+
/** While the children are hidden. Default `"Expand"`. */
|
|
88
|
+
expandLabel?: string
|
|
89
|
+
}
|
|
90
|
+
|
|
81
91
|
export type NavLinkProps<TOptions = unknown> = {
|
|
82
92
|
label: ReactNode
|
|
83
93
|
/** Leading slot (icon, avatar, etc). */
|
|
@@ -99,6 +109,9 @@ export type NavLinkProps<TOptions = unknown> = {
|
|
|
99
109
|
linkComponent?: ElementType
|
|
100
110
|
classNames?: NavLinkClassNames
|
|
101
111
|
className?: string
|
|
112
|
+
/** Overrides the expand/collapse chevron's accessible names. A partial override keeps the
|
|
113
|
+
* other default. */
|
|
114
|
+
translations?: NavLinkTranslations
|
|
102
115
|
/** Nested `<NavLink>` elements, revealed when `open`. */
|
|
103
116
|
children?: ReactNode
|
|
104
117
|
}
|
|
@@ -116,6 +129,7 @@ function NavLinkImpl({
|
|
|
116
129
|
linkComponent,
|
|
117
130
|
classNames,
|
|
118
131
|
className,
|
|
132
|
+
translations,
|
|
119
133
|
children,
|
|
120
134
|
}: NavLinkProps) {
|
|
121
135
|
const [isOpen, setOpen] = useUncontrolled<boolean>({
|
|
@@ -168,7 +182,11 @@ function NavLinkImpl({
|
|
|
168
182
|
<button
|
|
169
183
|
type="button"
|
|
170
184
|
aria-expanded={isOpen}
|
|
171
|
-
aria-label={
|
|
185
|
+
aria-label={
|
|
186
|
+
isOpen
|
|
187
|
+
? (translations?.collapseLabel ?? "Collapse")
|
|
188
|
+
: (translations?.expandLabel ?? "Expand")
|
|
189
|
+
}
|
|
172
190
|
onClick={() => setOpen(!isOpen)}
|
|
173
191
|
className={chevronButton}
|
|
174
192
|
>
|
|
@@ -115,3 +115,21 @@ describe("Navigation", () => {
|
|
|
115
115
|
expect(toggle.getAttribute("aria-expanded")).toBe("false")
|
|
116
116
|
})
|
|
117
117
|
})
|
|
118
|
+
|
|
119
|
+
describe("Navigation translations", () => {
|
|
120
|
+
it("forwards NavLink's chevron names to every generated row", () => {
|
|
121
|
+
render(
|
|
122
|
+
<Navigation
|
|
123
|
+
translations={{ expandLabel: "Déplier" }}
|
|
124
|
+
data={[
|
|
125
|
+
{
|
|
126
|
+
label: "Settings",
|
|
127
|
+
linkOptions: { href: "/settings" },
|
|
128
|
+
items: [{ label: "Profile", linkOptions: { href: "/settings/profile" } }],
|
|
129
|
+
},
|
|
130
|
+
]}
|
|
131
|
+
/>,
|
|
132
|
+
)
|
|
133
|
+
expect(screen.getByRole("button", { name: "Déplier" })).toBeTruthy()
|
|
134
|
+
})
|
|
135
|
+
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import type { ElementType, ReactNode } from "react"
|
|
4
|
-
import { NavLink, type NavLinkClassNames } from "./nav-link"
|
|
4
|
+
import { NavLink, type NavLinkClassNames, type NavLinkTranslations } from "./nav-link"
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* `Navigation` — the `data`-driven convenience wrapper over `NavLink` (same
|
|
@@ -43,12 +43,15 @@ export type NavigationProps<TOptions = unknown> = {
|
|
|
43
43
|
data: readonly NavigationItem<TOptions>[]
|
|
44
44
|
/** Overrides the app-wide `<LinkComponentProvider>` for every generated row. */
|
|
45
45
|
linkComponent?: ElementType
|
|
46
|
+
/** `NavLink`'s chevron names, forwarded to every generated row. */
|
|
47
|
+
translations?: NavLinkTranslations
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
const renderItem = (
|
|
49
51
|
item: NavigationItem,
|
|
50
52
|
key: string,
|
|
51
53
|
linkComponent: ElementType | undefined,
|
|
54
|
+
translations: NavLinkTranslations | undefined,
|
|
52
55
|
): ReactNode => (
|
|
53
56
|
<NavLink
|
|
54
57
|
key={key}
|
|
@@ -63,15 +66,16 @@ const renderItem = (
|
|
|
63
66
|
linkOptions={item.linkOptions}
|
|
64
67
|
linkComponent={linkComponent}
|
|
65
68
|
classNames={item.classNames}
|
|
69
|
+
translations={translations}
|
|
66
70
|
>
|
|
67
71
|
{item.items && item.items.length > 0
|
|
68
|
-
? item.items.map((child, i) => renderItem(child, `${key}.${i}`, linkComponent))
|
|
72
|
+
? item.items.map((child, i) => renderItem(child, `${key}.${i}`, linkComponent, translations))
|
|
69
73
|
: undefined}
|
|
70
74
|
</NavLink>
|
|
71
75
|
)
|
|
72
76
|
|
|
73
|
-
function NavigationImpl({ data, linkComponent }: NavigationProps) {
|
|
74
|
-
return <>{data.map((item, i) => renderItem(item, `nav-${i}`, linkComponent))}</>
|
|
77
|
+
function NavigationImpl({ data, linkComponent, translations }: NavigationProps) {
|
|
78
|
+
return <>{data.map((item, i) => renderItem(item, `nav-${i}`, linkComponent, translations))}</>
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
/** Generic for the same reason as `NavLink` — see its doc comment. */
|