@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
|
@@ -53,7 +53,7 @@ const tableVariants = cva(
|
|
|
53
53
|
"[&_tbody_td]:border-brand-900/20 dark:[&_tbody_td]:border-white/15",
|
|
54
54
|
// Cells
|
|
55
55
|
"[&_td]:align-middle",
|
|
56
|
-
"[&_th]:text-
|
|
56
|
+
"[&_th]:text-start [&_th]:align-middle [&_th]:font-medium [&_th]:text-gray-light-800 dark:[&_th]:text-gray-dark-200",
|
|
57
57
|
// Header — subtle fill + a bottom separator that survives sticky. Same
|
|
58
58
|
// brand-tinted fill Popover/Modal/Drawer use for their own surface, at
|
|
59
59
|
// the same /90 light /85 dark opacity recipe.
|
|
@@ -215,20 +215,24 @@ const TableContent = ({ className, classNames, testId, ...rest }: TableContentPr
|
|
|
215
215
|
{...props({ "data-testid": testId })}
|
|
216
216
|
{...rest}
|
|
217
217
|
className={cn(
|
|
218
|
-
"w-full border-separate border-spacing-0 text-
|
|
218
|
+
"w-full border-separate border-spacing-0 text-start text-gray-light-900 dark:text-gray-dark-25",
|
|
219
219
|
classNames?.table,
|
|
220
220
|
)}
|
|
221
221
|
/>
|
|
222
222
|
</div>
|
|
223
223
|
{/* Horizontal scroll affordance — a soft shadow on each side that still has
|
|
224
|
-
content to scroll to (pure CSS, hidden where unsupported).
|
|
224
|
+
content to scroll to (pure CSS, hidden where unsupported). Pinned to the
|
|
225
|
+
inline edges; a gradient has no logical direction, so `rtl:-scale-x-100`
|
|
226
|
+
mirrors each shadow to fade inward from its own edge. The scroll-driven
|
|
227
|
+
reveal needs no flip: its timeline's progress runs from the inline start
|
|
228
|
+
in either direction. */}
|
|
225
229
|
<div
|
|
226
230
|
aria-hidden="true"
|
|
227
|
-
className="table-fade-start pointer-events-none absolute inset-y-0
|
|
231
|
+
className="table-fade-start pointer-events-none absolute inset-y-0 start-0 w-6 rtl:-scale-x-100"
|
|
228
232
|
/>
|
|
229
233
|
<div
|
|
230
234
|
aria-hidden="true"
|
|
231
|
-
className="table-fade-end pointer-events-none absolute inset-y-0
|
|
235
|
+
className="table-fade-end pointer-events-none absolute inset-y-0 end-0 w-6 rtl:-scale-x-100"
|
|
232
236
|
/>
|
|
233
237
|
</div>
|
|
234
238
|
)
|
|
@@ -170,3 +170,14 @@ describe("Tabs", () => {
|
|
|
170
170
|
expect(html).not.toContain("<button")
|
|
171
171
|
})
|
|
172
172
|
})
|
|
173
|
+
|
|
174
|
+
describe("Tabs separators under RTL", () => {
|
|
175
|
+
// jsdom has no layout, so the class list is the assertable proxy: a physical `left-0` put the
|
|
176
|
+
// rule on the far side of each tab under dir="rtl" (verified in Chromium with ar-EG).
|
|
177
|
+
it("anchors each separator to the logical start edge", () => {
|
|
178
|
+
render(<Tabs data={ITEMS} />)
|
|
179
|
+
const tab = screen.getAllByRole("tab")[1] as HTMLElement
|
|
180
|
+
expect(tab.className).toMatch(/\bbefore:start-0\b/)
|
|
181
|
+
expect(tab.className).not.toMatch(/before:left-|before:-translate-x/)
|
|
182
|
+
})
|
|
183
|
+
})
|
|
@@ -53,7 +53,9 @@ import type { WithTestId } from "../../lib/test-id"
|
|
|
53
53
|
* tab's palette (#140).
|
|
54
54
|
*/
|
|
55
55
|
|
|
56
|
-
/** The tray. `filled` is a
|
|
56
|
+
/** The tray. `filled` is a borderless neutral fill so the colored pill pops,
|
|
57
|
+
* the kit's quiet `bg-black/3 dark:bg-white/4` (light mode darkens because
|
|
58
|
+
* a bare `bg-white/4` vanishes on a near-white page);
|
|
57
59
|
* `light` / `default` frame the pill with the same translucent surface as
|
|
58
60
|
* `Input`'s own `default` shell (`bg-white/4` + the hairline
|
|
59
61
|
* `border-brand-900/20 dark:border-white/15`) rather than an opaque gray
|
|
@@ -67,7 +69,7 @@ const tabsList = cva(
|
|
|
67
69
|
{
|
|
68
70
|
variants: {
|
|
69
71
|
variant: {
|
|
70
|
-
filled: ["bg-
|
|
72
|
+
filled: ["bg-black/3 dark:bg-white/4", "border-transparent"],
|
|
71
73
|
light: ["bg-white/4", "border-brand-900/20 dark:border-white/15"],
|
|
72
74
|
outline: ["bg-transparent border-transparent"],
|
|
73
75
|
subtle: ["bg-transparent border-transparent"],
|
|
@@ -123,8 +125,8 @@ const tabsTrigger = cva(
|
|
|
123
125
|
"data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
124
126
|
"before:absolute before:rounded-full before:bg-gray-light-300 dark:before:bg-gray-dark-600",
|
|
125
127
|
"before:transition-opacity before:duration-200",
|
|
126
|
-
"before:top-1/2 before:
|
|
127
|
-
"in-data-[orientation=vertical]:before:top-0 in-data-[orientation=vertical]:before:
|
|
128
|
+
"before:top-1/2 before:start-0 before:-ms-[0.5px] before:h-1/2 before:w-px before:-translate-y-1/2",
|
|
129
|
+
"in-data-[orientation=vertical]:before:top-0 in-data-[orientation=vertical]:before:start-1/4 in-data-[orientation=vertical]:before:ms-0 in-data-[orientation=vertical]:before:h-px in-data-[orientation=vertical]:before:w-1/2",
|
|
128
130
|
"nth-2:before:hidden",
|
|
129
131
|
"data-selected:before:opacity-0 data-selected:[&+*]:before:opacity-0",
|
|
130
132
|
],
|
|
@@ -83,3 +83,31 @@ describe("TagsInput — testId", () => {
|
|
|
83
83
|
expect(container.querySelector('[data-testid="tags-tag-1"]')).not.toBeNull()
|
|
84
84
|
})
|
|
85
85
|
})
|
|
86
|
+
|
|
87
|
+
describe("TagsInput translations", () => {
|
|
88
|
+
it("forwards Ark's keys to the clear and delete buttons", () => {
|
|
89
|
+
render(
|
|
90
|
+
<TagsInput
|
|
91
|
+
clearable
|
|
92
|
+
defaultValue={["react"]}
|
|
93
|
+
translations={{
|
|
94
|
+
clearTriggerLabel: "Tout effacer",
|
|
95
|
+
deleteTagTriggerLabel: (tag) => `Supprimer ${tag}`,
|
|
96
|
+
}}
|
|
97
|
+
/>,
|
|
98
|
+
)
|
|
99
|
+
expect(screen.getByRole("button", { name: "Tout effacer", hidden: true })).toBeTruthy()
|
|
100
|
+
expect(screen.getByRole("button", { name: "Supprimer react", hidden: true })).toBeTruthy()
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
it("keeps Ark's English default for the key a partial override omits", () => {
|
|
104
|
+
render(
|
|
105
|
+
<TagsInput
|
|
106
|
+
clearable
|
|
107
|
+
defaultValue={["react"]}
|
|
108
|
+
translations={{ deleteTagTriggerLabel: (tag) => `Supprimer ${tag}` }}
|
|
109
|
+
/>,
|
|
110
|
+
)
|
|
111
|
+
expect(screen.getByRole("button", { name: "Clear all tags", hidden: true })).toBeTruthy()
|
|
112
|
+
})
|
|
113
|
+
})
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { useFieldContext } from "@ark-ui/react/field"
|
|
4
4
|
import { TagsInput as Ark } from "@ark-ui/react/tags-input"
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
type ComponentProps,
|
|
7
|
+
type FocusEvent,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
type Ref,
|
|
10
|
+
useEffect,
|
|
11
|
+
useState,
|
|
12
|
+
} from "react"
|
|
6
13
|
import { cn } from "../../lib/cn"
|
|
7
14
|
import type { Color } from "../../lib/colors"
|
|
8
15
|
import { props } from "../../lib/props"
|
|
@@ -87,8 +94,15 @@ export type TagsInputProps = Pick<FieldProps, "label" | "description" | "error"
|
|
|
87
94
|
ref?: Ref<HTMLInputElement>
|
|
88
95
|
className?: string
|
|
89
96
|
classNames?: TagsInputClassNames
|
|
97
|
+
/** Overrides Ark's own English wording — the clear and per-tag delete buttons' names and
|
|
98
|
+
* the screen-reader announcements. Forwarded as-is; unset keys keep Ark's defaults. */
|
|
99
|
+
translations?: TagsInputTranslations
|
|
90
100
|
}
|
|
91
101
|
|
|
102
|
+
/** Ark's own TagsInput `translations` type, derived structurally rather than imported from
|
|
103
|
+
* `@zag-js/tags-input`. Already all-optional, with Ark's English defaults behind every key. */
|
|
104
|
+
export type TagsInputTranslations = NonNullable<ComponentProps<typeof Ark.Root>["translations"]>
|
|
105
|
+
|
|
92
106
|
/**
|
|
93
107
|
* The real, visible typing `<input>`, split out so it reads the `Field`
|
|
94
108
|
* context from *inside* the wrapping `FieldShell` — `TagsInput` itself
|
|
@@ -153,6 +167,7 @@ export const TagsInput = ({
|
|
|
153
167
|
className,
|
|
154
168
|
classNames,
|
|
155
169
|
testId,
|
|
170
|
+
translations,
|
|
156
171
|
}: TagsInputProps) => {
|
|
157
172
|
// Red state is driven independently of the `Field` error slot so a form
|
|
158
173
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
@@ -183,6 +198,7 @@ export const TagsInput = ({
|
|
|
183
198
|
disabled={disabled}
|
|
184
199
|
readOnly={readOnly}
|
|
185
200
|
name={name}
|
|
201
|
+
translations={translations}
|
|
186
202
|
data-color={color}
|
|
187
203
|
className={cn("w-full group/input", className)}
|
|
188
204
|
>
|
|
@@ -52,10 +52,15 @@ const themeIconVariants = cva(
|
|
|
52
52
|
subtle: "bg-transparent text-(--c-text) border-transparent",
|
|
53
53
|
// Palette-independent neutral surface. Unlike ActionIcon's
|
|
54
54
|
// high-contrast inverted `default` (a black/white button look),
|
|
55
|
-
// this stays a muted card in both themes.
|
|
55
|
+
// this stays a muted card in both themes. It sits on the kit's
|
|
56
|
+
// translucent surface recipe (the quiet `bg-black/3 dark:bg-white/4`
|
|
57
|
+
// fill plus the hairline `border-brand-900/20 dark:border-white/15`,
|
|
58
|
+
// as `Kbd` and `Card` do) rather than an opaque gray step, so the tile
|
|
59
|
+
// reads on whatever surface hosts it. Light mode darkens because a
|
|
60
|
+
// bare `bg-white/4` vanishes on a near-white page.
|
|
56
61
|
default: [
|
|
57
|
-
"bg-
|
|
58
|
-
"dark:bg-
|
|
62
|
+
"bg-black/3 text-gray-light-700 border-brand-900/20",
|
|
63
|
+
"dark:bg-white/4 dark:text-gray-dark-300 dark:border-white/15",
|
|
59
64
|
],
|
|
60
65
|
},
|
|
61
66
|
size: {
|
|
@@ -289,4 +289,79 @@ describe("TimeInput", () => {
|
|
|
289
289
|
expect(document.activeElement).toBe(hour)
|
|
290
290
|
})
|
|
291
291
|
})
|
|
292
|
+
|
|
293
|
+
describe("accessible name", () => {
|
|
294
|
+
/** `label[for]`s pointing at an id no element carries — a binding that names nothing. */
|
|
295
|
+
const orphanedLabels = () =>
|
|
296
|
+
[...document.querySelectorAll("label[for]")].filter(
|
|
297
|
+
(label) => !document.getElementById(label.getAttribute("for") ?? ""),
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
it("names the segment group after the field label", () => {
|
|
301
|
+
render(<TimeInput label="Meeting time" hourCycle="h12" />)
|
|
302
|
+
const group = screen.getByRole("group", { name: "Meeting time" })
|
|
303
|
+
expect(group.contains(screen.getByRole("spinbutton", { name: "Hour" }))).toBe(true)
|
|
304
|
+
expect(group.contains(screen.getByRole("radiogroup", { name: "Period" }))).toBe(true)
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
it("leaves no label[for] pointing at a missing id", () => {
|
|
308
|
+
render(<TimeInput label="Meeting time" description="Local time" hourCycle="h12" />)
|
|
309
|
+
expect(orphanedLabels()).toEqual([])
|
|
310
|
+
})
|
|
311
|
+
|
|
312
|
+
it("keeps a start / end pair distinguishable", () => {
|
|
313
|
+
render(
|
|
314
|
+
<>
|
|
315
|
+
<TimeInput label="Start time" hourCycle="h23" />
|
|
316
|
+
<TimeInput label="End time" hourCycle="h23" />
|
|
317
|
+
</>,
|
|
318
|
+
)
|
|
319
|
+
const start = screen.getByRole("group", { name: "Start time" })
|
|
320
|
+
const end = screen.getByRole("group", { name: "End time" })
|
|
321
|
+
expect(start).not.toBe(end)
|
|
322
|
+
expect(start.querySelector("input")).not.toBeNull()
|
|
323
|
+
expect(end.querySelector("input")).not.toBeNull()
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
it("describes the group with the description, then the error once invalid", async () => {
|
|
327
|
+
const { rerender } = render(
|
|
328
|
+
<TimeInput label="Meeting time" description="Local time for all attendees" />,
|
|
329
|
+
)
|
|
330
|
+
await waitFor(() =>
|
|
331
|
+
expect(
|
|
332
|
+
screen.getByRole("group", { name: "Meeting time" }).getAttribute("aria-describedby"),
|
|
333
|
+
).toBe(screen.getByText("Local time for all attendees").id),
|
|
334
|
+
)
|
|
335
|
+
rerender(
|
|
336
|
+
<TimeInput
|
|
337
|
+
label="Meeting time"
|
|
338
|
+
description="Local time for all attendees"
|
|
339
|
+
error="Pick a time"
|
|
340
|
+
/>,
|
|
341
|
+
)
|
|
342
|
+
expect(
|
|
343
|
+
screen.getByRole("group", { name: "Meeting time" }).getAttribute("aria-describedby"),
|
|
344
|
+
).toBe(screen.getByText("Pick a time").id)
|
|
345
|
+
})
|
|
346
|
+
|
|
347
|
+
it('falls back to "Time" without a label, never pointing at a missing one', () => {
|
|
348
|
+
render(<TimeInput description="Local time" hourCycle="h23" />)
|
|
349
|
+
const group = screen.getByRole("group", { name: "Time" })
|
|
350
|
+
expect(group.hasAttribute("aria-labelledby")).toBe(false)
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
it("translations.time renames the fallback", () => {
|
|
354
|
+
render(<TimeInput hourCycle="h23" translations={{ time: "Heure de début" }} />)
|
|
355
|
+
expect(screen.getByRole("group", { name: "Heure de début" })).toBeTruthy()
|
|
356
|
+
})
|
|
357
|
+
})
|
|
358
|
+
})
|
|
359
|
+
|
|
360
|
+
describe("TimeInput stepper translations", () => {
|
|
361
|
+
it("forwards incrementLabel/decrementLabel to every field's steppers", () => {
|
|
362
|
+
render(<TimeInput translations={{ incrementLabel: "Augmenter" }} />)
|
|
363
|
+
expect(screen.getAllByRole("button", { name: "Augmenter" })).toHaveLength(2)
|
|
364
|
+
// The omitted key keeps NumberInput's English default.
|
|
365
|
+
expect(screen.getAllByRole("button", { name: "Decrement" })).toHaveLength(2)
|
|
366
|
+
})
|
|
292
367
|
})
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import { useFieldContext } from "@ark-ui/react/field"
|
|
3
4
|
import { useLocaleContext } from "@ark-ui/react/locale"
|
|
4
5
|
import type { FormControlProps } from "../../lib/form-control"
|
|
5
6
|
import { props } from "../../lib/props"
|
|
6
7
|
import type { Size } from "../../lib/sizes"
|
|
7
8
|
import type { WithTestId } from "../../lib/test-id"
|
|
8
9
|
import { useUncontrolled } from "../../lib/use-uncontrolled"
|
|
9
|
-
import { type FieldProps, FieldShell } from "../field/field"
|
|
10
|
+
import { type FieldProps, FieldShell, fieldA11yProps } from "../field/field"
|
|
10
11
|
import type { InputVariant } from "../input/input"
|
|
11
12
|
import { type HourCycle, is12Hour, resolveHourCycle, to12Hour, to24Hour } from "./hour-cycle"
|
|
12
|
-
import { TimeRow, type TimeRowTranslations } from "./time-row"
|
|
13
|
+
import { TimeRow, type TimeRowProps, type TimeRowTranslations } from "./time-row"
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* TimeInput — a standalone HOUR/MINUTE (+ SECOND) + AM/PM time entry, composed
|
|
@@ -95,6 +96,26 @@ const fromDisplay = (display: DisplayTime, twelveHour: boolean): Exclude<TimeVal
|
|
|
95
96
|
return display.second != null ? { hour, minute, second: display.second } : { hour, minute }
|
|
96
97
|
}
|
|
97
98
|
|
|
99
|
+
/**
|
|
100
|
+
* The `TimeRow`, split out so it reads the `Field` context from *inside* the wrapping
|
|
101
|
+
* `FieldShell` — `TimeInput` itself renders that shell, so calling `useFieldContext()` at its own
|
|
102
|
+
* top level would run too early. The row is the field's real control: its `role="group"` takes
|
|
103
|
+
* the field label as its name and the helper / error text as its description. Outside a
|
|
104
|
+
* `Field` (no label, description, error or `required`) there is no context and nothing to wire.
|
|
105
|
+
*/
|
|
106
|
+
const TimeInputRow = ({ labelled, ...rowProps }: TimeRowProps & { labelled: boolean }) => {
|
|
107
|
+
const field = useFieldContext()
|
|
108
|
+
const a11y = fieldA11yProps(field)
|
|
109
|
+
return (
|
|
110
|
+
<TimeRow
|
|
111
|
+
{...rowProps}
|
|
112
|
+
// A `Field` with only a description or error renders no `<label>` to point at.
|
|
113
|
+
aria-labelledby={labelled ? a11y["aria-labelledby"] : undefined}
|
|
114
|
+
aria-describedby={a11y["aria-describedby"]}
|
|
115
|
+
/>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
98
119
|
export const TimeInput = ({
|
|
99
120
|
value,
|
|
100
121
|
defaultValue,
|
|
@@ -161,11 +182,14 @@ export const TimeInput = ({
|
|
|
161
182
|
disabled={disabled}
|
|
162
183
|
size={size}
|
|
163
184
|
className={classNames?.field}
|
|
185
|
+
// Hour / Minute / [Second] / AM-PM: no single input for the label's `for` to point at.
|
|
186
|
+
composite
|
|
164
187
|
>
|
|
165
188
|
{/* No single focusable control to route `testId` to — Hour/Minute/[Second] +
|
|
166
189
|
AM/PM are each their own field — so it lands on the wrapping shell. */}
|
|
167
190
|
<div className={className} {...props({ "data-testid": testId })}>
|
|
168
|
-
<
|
|
191
|
+
<TimeInputRow
|
|
192
|
+
labelled={label != null}
|
|
169
193
|
hour={display.hour}
|
|
170
194
|
minute={display.minute}
|
|
171
195
|
second={display.second}
|
|
@@ -5,7 +5,7 @@ import type { FocusEvent, KeyboardEvent, Ref } from "react"
|
|
|
5
5
|
import { cn } from "../../lib/cn"
|
|
6
6
|
import type { Size } from "../../lib/sizes"
|
|
7
7
|
import type { InputVariant } from "../input/input"
|
|
8
|
-
import { NumberInput } from "../number-input/number-input"
|
|
8
|
+
import { NumberInput, type NumberInputTranslations } from "../number-input/number-input"
|
|
9
9
|
import { SegmentGroup } from "../segment-group/segment-group"
|
|
10
10
|
import { dayPeriodLabels, type HourCycle, is12Hour, timeUnitLabels } from "./hour-cycle"
|
|
11
11
|
|
|
@@ -26,8 +26,14 @@ type TimeRowClassNames = {
|
|
|
26
26
|
|
|
27
27
|
/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.
|
|
28
28
|
* Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,
|
|
29
|
-
* which read from `Intl` instead).
|
|
30
|
-
|
|
29
|
+
* which read from `Intl` instead). `incrementLabel`/`decrementLabel` are `NumberInput`'s own
|
|
30
|
+
* keys, forwarded to each field's steppers (defaults `"Increment"` / `"Decrement"`). */
|
|
31
|
+
export type TimeRowTranslations = Pick<
|
|
32
|
+
NumberInputTranslations,
|
|
33
|
+
"incrementLabel" | "decrementLabel"
|
|
34
|
+
> & {
|
|
35
|
+
/** The whole row's group name when nothing visible labels it. Default `"Time"`. */
|
|
36
|
+
time?: string
|
|
31
37
|
hour?: string
|
|
32
38
|
minute?: string
|
|
33
39
|
second?: string
|
|
@@ -150,6 +156,15 @@ export type TimeRowProps = {
|
|
|
150
156
|
ref?: Ref<HTMLInputElement>
|
|
151
157
|
/** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */
|
|
152
158
|
onBlur?: (event: FocusEvent<HTMLInputElement>) => void
|
|
159
|
+
/** Names the row's `role="group"` directly when no visible label points at it. Defaults to
|
|
160
|
+
* `translations.time` (`"Time"`), so the group is never anonymous. */
|
|
161
|
+
"aria-label"?: string
|
|
162
|
+
/** Names the row's `role="group"` from a visible label, e.g. `TimeInput`'s field label or
|
|
163
|
+
* `DatePicker`'s "Start time" / "End time". Without a name a screen reader enters the group
|
|
164
|
+
* hearing only "Hour". */
|
|
165
|
+
"aria-labelledby"?: string
|
|
166
|
+
/** Helper / error text read after the group's name. */
|
|
167
|
+
"aria-describedby"?: string
|
|
153
168
|
className?: string
|
|
154
169
|
classNames?: TimeRowClassNames
|
|
155
170
|
}
|
|
@@ -176,6 +191,9 @@ export const TimeRow = ({
|
|
|
176
191
|
invalid,
|
|
177
192
|
ref,
|
|
178
193
|
onBlur,
|
|
194
|
+
"aria-label": ariaLabel,
|
|
195
|
+
"aria-labelledby": ariaLabelledBy,
|
|
196
|
+
"aria-describedby": ariaDescribedBy,
|
|
179
197
|
className,
|
|
180
198
|
classNames,
|
|
181
199
|
}: TimeRowProps) => {
|
|
@@ -196,6 +214,9 @@ export const TimeRow = ({
|
|
|
196
214
|
// biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics
|
|
197
215
|
<div
|
|
198
216
|
role="group"
|
|
217
|
+
aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? translations?.time ?? "Time")}
|
|
218
|
+
aria-labelledby={ariaLabelledBy}
|
|
219
|
+
aria-describedby={ariaDescribedBy}
|
|
199
220
|
className={cn("flex flex-wrap items-end gap-2", className)}
|
|
200
221
|
onKeyDown={(event) => moveAcrossFields(event, dir)}
|
|
201
222
|
>
|
|
@@ -219,6 +240,7 @@ export const TimeRow = ({
|
|
|
219
240
|
// "Hour" stays the accessible name (sr-only keeps it in the a11y tree,
|
|
220
241
|
// just visually hidden) — the unit suffix is a decorative stand-in,
|
|
221
242
|
// right next to the value once it's right-aligned (`text-end`).
|
|
243
|
+
translations={translations}
|
|
222
244
|
suffix={units.hour}
|
|
223
245
|
className={classNames?.hour}
|
|
224
246
|
classNames={{
|
|
@@ -242,6 +264,7 @@ export const TimeRow = ({
|
|
|
242
264
|
disabled={disabled}
|
|
243
265
|
readOnly={readOnly}
|
|
244
266
|
invalid={invalid}
|
|
267
|
+
translations={translations}
|
|
245
268
|
suffix={units.minute}
|
|
246
269
|
className={classNames?.minute}
|
|
247
270
|
classNames={{
|
|
@@ -266,6 +289,7 @@ export const TimeRow = ({
|
|
|
266
289
|
disabled={disabled}
|
|
267
290
|
readOnly={readOnly}
|
|
268
291
|
invalid={invalid}
|
|
292
|
+
translations={translations}
|
|
269
293
|
suffix={units.second}
|
|
270
294
|
className={classNames?.second}
|
|
271
295
|
classNames={{
|
|
@@ -537,7 +537,10 @@ describe("Timeline", () => {
|
|
|
537
537
|
// ring/ring-offset pair — that's what keeps every variant at the same
|
|
538
538
|
// total footprint.
|
|
539
539
|
expect(bullet.className).toContain("ring-inset")
|
|
540
|
-
|
|
540
|
+
// The ring band shows the fill through a transparent ring, so a
|
|
541
|
+
// translucent fill (pending's disabled wash) isn't painted twice.
|
|
542
|
+
expect(bullet.className).toContain("ring-transparent")
|
|
543
|
+
expect(bullet.className).not.toContain("ring-(--c-solid)")
|
|
541
544
|
})
|
|
542
545
|
|
|
543
546
|
it("forces bullet icons to white in dark mode on the colored variants, not default/gradient", () => {
|
|
@@ -168,10 +168,13 @@ const timelineBulletVariants = cva(["rounded-full shrink-0"], {
|
|
|
168
168
|
default:
|
|
169
169
|
"dark:bg-gray-light-50 dark:text-gray-light-900 bg-gray-dark-900 text-gray-dark-25 border",
|
|
170
170
|
// from-*/to-* are the CSS defaults for --tw-gradient-from/to — see Badge.
|
|
171
|
+
// The inner cut-out ring (and the ring offsets in the compounds below)
|
|
172
|
+
// paint the page background, `brand-50` / `brand-950`, so the gap reads
|
|
173
|
+
// as a hole through to the page rather than a gray outline.
|
|
171
174
|
gradient: [
|
|
172
175
|
"bg-linear-to-r from-purple-300 to-pink-400 text-black",
|
|
173
176
|
"relative",
|
|
174
|
-
"before:absolute before:inset-px before:border-2
|
|
177
|
+
"before:absolute before:inset-px before:border-2 before:border-brand-50 dark:before:border-brand-950 before:rounded-full",
|
|
175
178
|
],
|
|
176
179
|
},
|
|
177
180
|
/** Internal only — never exposed on `TimelineItemProps` (see `Omit` on
|
|
@@ -192,17 +195,22 @@ const timelineBulletVariants = cva(["rounded-full shrink-0"], {
|
|
|
192
195
|
},
|
|
193
196
|
},
|
|
194
197
|
compoundVariants: [
|
|
198
|
+
// The ring is transparent on purpose: its band sits over the bullet's own
|
|
199
|
+
// `--c-solid` fill, so the fill already paints it — the ring utility is
|
|
200
|
+
// only there to draw the offset gap. Painting `--c-solid` again would
|
|
201
|
+
// double a translucent fill (the pending `--c-solid-disabled` wash) and
|
|
202
|
+
// make the band read brighter than the center.
|
|
195
203
|
{
|
|
196
204
|
variant: "filled",
|
|
197
205
|
ringed: true,
|
|
198
206
|
class:
|
|
199
|
-
"border ring-2 ring-offset-2 dark:ring-offset-
|
|
207
|
+
"border ring-2 ring-offset-2 ring-offset-brand-50 dark:ring-offset-brand-950 ring-transparent ring-inset",
|
|
200
208
|
},
|
|
201
209
|
{
|
|
202
210
|
variant: "default",
|
|
203
211
|
ringed: true,
|
|
204
212
|
class:
|
|
205
|
-
"ring-2 ring-offset-2 dark:ring-offset-
|
|
213
|
+
"ring-2 ring-offset-2 ring-offset-brand-50 dark:ring-offset-brand-950 ring-gray-light-950 dark:ring-gray-light-50 ring-inset",
|
|
206
214
|
},
|
|
207
215
|
// An upcoming `default` step: just the outer ring, no center, in the
|
|
208
216
|
// disabled color — `TimelineItem` also turns `ringed` off for it, which
|
|
@@ -8,4 +8,8 @@ export type {
|
|
|
8
8
|
TreeSelectData,
|
|
9
9
|
TreeValue,
|
|
10
10
|
} from "../../lib/tree-data"
|
|
11
|
-
export {
|
|
11
|
+
export {
|
|
12
|
+
TreeMultiSelect,
|
|
13
|
+
type TreeMultiSelectProps,
|
|
14
|
+
type TreeMultiSelectTranslations,
|
|
15
|
+
} from "./tree-multi-select"
|
|
@@ -325,3 +325,75 @@ describe("TreeMultiSelect", () => {
|
|
|
325
325
|
})
|
|
326
326
|
})
|
|
327
327
|
})
|
|
328
|
+
|
|
329
|
+
describe("TreeMultiSelect — field a11y", () => {
|
|
330
|
+
it("names the combobox from its label", () => {
|
|
331
|
+
render(<TreeMultiSelect data={data} label="Files" />)
|
|
332
|
+
const trigger = screen.getByRole("combobox", { name: "Files" })
|
|
333
|
+
const labelledById = trigger.getAttribute("aria-labelledby")
|
|
334
|
+
expect(document.getElementById(labelledById as string)?.textContent).toBe("Files")
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
it("wires description to aria-describedby on the trigger", () => {
|
|
338
|
+
render(<TreeMultiSelect data={data} label="Files" description="Pick a file" />)
|
|
339
|
+
const trigger = screen.getByRole("combobox", { name: "Files" })
|
|
340
|
+
const describedById = trigger.getAttribute("aria-describedby")
|
|
341
|
+
expect(describedById).toBeTruthy()
|
|
342
|
+
expect(document.getElementById(describedById as string)?.textContent).toBe("Pick a file")
|
|
343
|
+
})
|
|
344
|
+
|
|
345
|
+
it("wires error to aria-describedby, aria-errormessage and aria-invalid", () => {
|
|
346
|
+
render(<TreeMultiSelect data={data} label="Files" error="Required" />)
|
|
347
|
+
const trigger = screen.getByRole("combobox", { name: "Files" })
|
|
348
|
+
expect(trigger.getAttribute("aria-invalid")).toBe("true")
|
|
349
|
+
const errorMessageId = trigger.getAttribute("aria-errormessage")
|
|
350
|
+
expect(document.getElementById(errorMessageId as string)?.textContent).toBe("Required")
|
|
351
|
+
expect(trigger.getAttribute("aria-describedby")).toBe(errorMessageId)
|
|
352
|
+
})
|
|
353
|
+
|
|
354
|
+
it("points aria-controls at the tree, closed and open", async () => {
|
|
355
|
+
render(<TreeMultiSelect data={data} label="Files" />)
|
|
356
|
+
const trigger = screen.getByRole("combobox", { name: "Files" })
|
|
357
|
+
const controlsId = trigger.getAttribute("aria-controls")
|
|
358
|
+
expect(document.getElementById(controlsId as string)?.getAttribute("role")).toBe("tree")
|
|
359
|
+
const tree = await open()
|
|
360
|
+
expect(trigger.getAttribute("aria-controls")).toBe(tree.id)
|
|
361
|
+
})
|
|
362
|
+
})
|
|
363
|
+
|
|
364
|
+
describe("TreeMultiSelect translations", () => {
|
|
365
|
+
it("names the clear-all button, value pills and search field from translations", async () => {
|
|
366
|
+
render(
|
|
367
|
+
<TreeMultiSelect
|
|
368
|
+
data={data}
|
|
369
|
+
defaultValue={["apple"]}
|
|
370
|
+
clearable
|
|
371
|
+
searchable
|
|
372
|
+
label="Food"
|
|
373
|
+
translations={{
|
|
374
|
+
clearTriggerLabel: "Tout effacer",
|
|
375
|
+
searchLabel: "Rechercher",
|
|
376
|
+
removeValue: (label) => `Retirer ${label}`,
|
|
377
|
+
}}
|
|
378
|
+
/>,
|
|
379
|
+
)
|
|
380
|
+
expect(screen.getByRole("button", { name: "Tout effacer" })).toBeTruthy()
|
|
381
|
+
expect(screen.getByRole("button", { name: "Retirer Apple" })).toBeTruthy()
|
|
382
|
+
await open()
|
|
383
|
+
expect(screen.getByRole("textbox", { name: "Rechercher" })).toBeTruthy()
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
it("keeps the English defaults for the keys a partial override omits", () => {
|
|
387
|
+
render(
|
|
388
|
+
<TreeMultiSelect
|
|
389
|
+
data={data}
|
|
390
|
+
defaultValue={["apple"]}
|
|
391
|
+
clearable
|
|
392
|
+
label="Food"
|
|
393
|
+
translations={{ searchLabel: "Rechercher" }}
|
|
394
|
+
/>,
|
|
395
|
+
)
|
|
396
|
+
expect(screen.getByRole("button", { name: "Clear all" })).toBeTruthy()
|
|
397
|
+
expect(screen.getByRole("button", { name: "Remove" })).toBeTruthy()
|
|
398
|
+
})
|
|
399
|
+
})
|