@42-central/ui-react 0.18.2 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-YXE4B6X3.js → chunk-2NNZHVKD.js} +3 -3
- package/dist/{chunk-YXE4B6X3.js.map → chunk-2NNZHVKD.js.map} +1 -1
- package/dist/{chunk-5JHDSVEZ.js → chunk-4NNGTNPV.js} +10 -8
- package/dist/chunk-4NNGTNPV.js.map +1 -0
- package/dist/{chunk-7NZSTCJO.js → chunk-57BTVRRB.js} +4 -9
- package/dist/chunk-57BTVRRB.js.map +1 -0
- package/dist/{chunk-S2HWWR2H.js → chunk-64T6Z7BA.js} +3 -3
- package/dist/{chunk-S2HWWR2H.js.map → chunk-64T6Z7BA.js.map} +1 -1
- package/dist/{chunk-MI2WZRK3.js → chunk-A6MYJTJI.js} +4 -4
- package/dist/{chunk-MI2WZRK3.js.map → chunk-A6MYJTJI.js.map} +1 -1
- package/dist/{chunk-RQL7FVCS.js → chunk-BTFBBNRW.js} +11 -6
- package/dist/chunk-BTFBBNRW.js.map +1 -0
- package/dist/{chunk-OWG4BCQR.js → chunk-CYWMES5P.js} +4 -4
- package/dist/{chunk-OWG4BCQR.js.map → chunk-CYWMES5P.js.map} +1 -1
- package/dist/{chunk-YBJB7FGE.js → chunk-CZEKZ5HR.js} +6 -6
- package/dist/chunk-CZEKZ5HR.js.map +1 -0
- package/dist/{chunk-HAQJQFE6.js → chunk-DBTJEBMO.js} +11 -4
- package/dist/{chunk-HAQJQFE6.js.map → chunk-DBTJEBMO.js.map} +1 -1
- package/dist/{chunk-AE7QTLJ5.js → chunk-FAOBC4IS.js} +4 -4
- package/dist/{chunk-AE7QTLJ5.js.map → chunk-FAOBC4IS.js.map} +1 -1
- package/dist/{chunk-NF5JM2YO.js → chunk-FOMR74VE.js} +3 -3
- package/dist/{chunk-NF5JM2YO.js.map → chunk-FOMR74VE.js.map} +1 -1
- package/dist/{chunk-FZIHZT5R.js → chunk-GCGX4FEF.js} +16 -10
- package/dist/chunk-GCGX4FEF.js.map +1 -0
- package/dist/{chunk-B2YJKRNQ.js → chunk-HCYULRWT.js} +13 -9
- package/dist/chunk-HCYULRWT.js.map +1 -0
- package/dist/{chunk-B2LCHXUB.js → chunk-INJUILCN.js} +9 -4
- package/dist/chunk-INJUILCN.js.map +1 -0
- package/dist/{chunk-ZDXQ64A7.js → chunk-K5UWVH6P.js} +5 -5
- package/dist/{chunk-ZDXQ64A7.js.map → chunk-K5UWVH6P.js.map} +1 -1
- package/dist/{chunk-6GDMSENK.js → chunk-LM6F6DLR.js} +3 -24
- package/dist/chunk-LM6F6DLR.js.map +1 -0
- package/dist/{chunk-KHMFNH3X.js → chunk-MQO42HZL.js} +7 -7
- package/dist/chunk-MQO42HZL.js.map +1 -0
- package/dist/chunk-OC7I2CTA.js +8 -0
- package/dist/chunk-OC7I2CTA.js.map +1 -0
- package/dist/{chunk-O23Y5ML4.js → chunk-OGJFDNIS.js} +249 -231
- package/dist/chunk-OGJFDNIS.js.map +1 -0
- package/dist/{chunk-6OLTJYSX.js → chunk-PINENGML.js} +12 -5
- package/dist/chunk-PINENGML.js.map +1 -0
- package/dist/{chunk-NSDM3FEB.js → chunk-PS2PZFXH.js} +5 -3
- package/dist/chunk-PS2PZFXH.js.map +1 -0
- package/dist/{chunk-RAUOFTUH.js → chunk-QIDAXFKK.js} +4 -4
- package/dist/{chunk-RAUOFTUH.js.map → chunk-QIDAXFKK.js.map} +1 -1
- package/dist/{chunk-S7N4LGLZ.js → chunk-RIP5G47F.js} +4 -4
- package/dist/{chunk-S7N4LGLZ.js.map → chunk-RIP5G47F.js.map} +1 -1
- package/dist/{chunk-Z2Z5EXVT.js → chunk-RKYXG6X7.js} +3 -3
- package/dist/{chunk-Z2Z5EXVT.js.map → chunk-RKYXG6X7.js.map} +1 -1
- package/dist/{chunk-WQN64ZHG.js → chunk-SVKU3GUN.js} +10 -6
- package/dist/chunk-SVKU3GUN.js.map +1 -0
- package/dist/{chunk-FHG54IT5.js → chunk-TBTSEPGP.js} +13 -4
- package/dist/chunk-TBTSEPGP.js.map +1 -0
- package/dist/{chunk-HT5JAHR3.js → chunk-UJZIF2BA.js} +20 -9
- package/dist/chunk-UJZIF2BA.js.map +1 -0
- package/dist/{chunk-UHNRAI6V.js → chunk-VZBUQNLX.js} +68 -29
- package/dist/chunk-VZBUQNLX.js.map +1 -0
- package/dist/{chunk-JITF6I7N.js → chunk-WJOHNCYY.js} +11 -4
- package/dist/{chunk-JITF6I7N.js.map → chunk-WJOHNCYY.js.map} +1 -1
- package/dist/{chunk-EBREIC3L.js → chunk-YQHOKMSV.js} +26 -8
- package/dist/chunk-YQHOKMSV.js.map +1 -0
- package/dist/{chunk-WHKKN3ZK.js → chunk-YW6Q6ERX.js} +10 -8
- package/dist/chunk-YW6Q6ERX.js.map +1 -0
- package/dist/{chunk-PH354ECN.js → chunk-Z43YWH4R.js} +13 -4
- package/dist/chunk-Z43YWH4R.js.map +1 -0
- package/dist/{chunk-5OQLFX47.js → chunk-Z6RPMRFH.js} +3 -3
- package/dist/{chunk-5OQLFX47.js.map → chunk-Z6RPMRFH.js.map} +1 -1
- package/dist/{chunk-TCWYBVIL.js → chunk-ZB5VMGKB.js} +10 -7
- package/dist/chunk-ZB5VMGKB.js.map +1 -0
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/action-icon/index.js +3 -3
- package/dist/components/alert/index.js +3 -3
- package/dist/components/app-shell/index.js +4 -4
- package/dist/components/autocomplete/autocomplete.d.ts +8 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.d.ts +1 -1
- package/dist/components/autocomplete/index.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +10 -7
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/index.js +3 -3
- package/dist/components/button-multi-select/index.js +5 -5
- package/dist/components/button-select/index.js +5 -5
- package/dist/components/calendar/calendar-zone-sync.d.ts +41 -0
- package/dist/components/calendar/calendar-zone-sync.d.ts.map +1 -0
- package/dist/components/calendar/calendar.d.ts +6 -5
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.js +8 -5
- package/dist/components/chart/chart.d.ts +17 -10
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.js +50 -7
- package/dist/components/chart/index.js.map +1 -1
- package/dist/components/chart/styles.css +100 -0
- package/dist/components/checkbox/index.js +4 -4
- package/dist/components/choice-card-group/index.d.ts.map +1 -1
- package/dist/components/choice-card-group/index.js +4 -3
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/copy.d.ts.map +1 -1
- package/dist/components/clipboard/index.js +5 -5
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +4 -4
- package/dist/components/code-block/index.js +5 -5
- package/dist/components/combobox/combobox.d.ts +20 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/combobox/index.js +4 -4
- package/dist/components/combobox-list/combobox-list.d.ts +8 -1
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/index.d.ts +1 -1
- package/dist/components/combobox-list/index.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +5 -5
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-select-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/index.d.ts +5 -1
- package/dist/components/data-table/data-table-filter/index.d.ts.map +1 -1
- package/dist/components/data-table/data-table-header-cell.d.ts +11 -15
- package/dist/components/data-table/data-table-header-cell.d.ts.map +1 -1
- package/dist/components/data-table/data-table-meta.d.ts +2 -2
- package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
- package/dist/components/data-table/data-table-pagination.d.ts +3 -0
- package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts +5 -2
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +3 -1
- package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
- package/dist/components/data-table/data-table-translations.d.ts +68 -0
- package/dist/components/data-table/data-table-translations.d.ts.map +1 -0
- package/dist/components/data-table/data-table.d.ts +5 -8
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.d.ts +2 -1
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +162 -79
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +13 -9
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +16 -15
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +9 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/index.d.ts.map +1 -1
- package/dist/components/drawer/index.js +4 -4
- package/dist/components/field/field.d.ts +9 -2
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/file-upload/file-upload.d.ts +13 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +16 -7
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/input/index.js +2 -2
- package/dist/components/kbd/index.js +1 -1
- package/dist/components/menu/index.js +2 -2
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +4 -4
- package/dist/components/modal/modal.d.ts +9 -1
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.d.ts +1 -1
- package/dist/components/multi-combobox-list/index.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +7 -5
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +8 -1
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.d.ts +1 -1
- package/dist/components/multi-select/index.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +20 -9
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +11 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.d.ts +1 -1
- package/dist/components/nav-link/index.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +2 -2
- package/dist/components/nav-link/nav-link.d.ts +12 -0
- package/dist/components/nav-link/nav-link.d.ts.map +1 -1
- package/dist/components/nav-link/navigation.d.ts +3 -1
- package/dist/components/nav-link/navigation.d.ts.map +1 -1
- package/dist/components/nav-link/tanstack.js +2 -2
- package/dist/components/notification/create-notifier.d.ts +12 -1
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.d.ts +2 -2
- package/dist/components/notification/index.d.ts.map +1 -1
- package/dist/components/notification/index.js +9 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +14 -1
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/number-input/index.d.ts +1 -1
- package/dist/components/number-input/index.d.ts.map +1 -1
- package/dist/components/number-input/index.js +4 -4
- package/dist/components/number-input/number-input.d.ts +20 -2
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/index.js +6 -6
- package/dist/components/password-input/index.d.ts +1 -1
- package/dist/components/password-input/index.d.ts.map +1 -1
- package/dist/components/password-input/index.js +68 -7
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +45 -6
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/pill/index.js +2 -2
- package/dist/components/pills-input/index.js +5 -5
- package/dist/components/pin-input/index.js +2 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.d.ts +0 -10
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.js.map +1 -1
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/radio-group/index.js +3 -3
- package/dist/components/rating/index.js +2 -2
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.js +60 -48
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/schedule/now-cursor-line.d.ts +10 -5
- package/dist/components/schedule/now-cursor-line.d.ts.map +1 -1
- package/dist/components/schedule/schedule-dates.d.ts +11 -26
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-chip.d.ts +4 -1
- package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-details.d.ts +3 -2
- package/dist/components/schedule/schedule-event-details.d.ts.map +1 -1
- package/dist/components/schedule/schedule-geometry.d.ts +20 -21
- package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
- package/dist/components/schedule/schedule-grid-gesture.d.ts +5 -9
- package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
- package/dist/components/schedule/schedule-segments.d.ts +2 -3
- package/dist/components/schedule/schedule-segments.d.ts.map +1 -1
- package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
- package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
- package/dist/components/segment-group/index.js +4 -3
- package/dist/components/segment-group/segment-group.d.ts +3 -2
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +6 -4
- package/dist/components/select/select.d.ts +12 -2
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/switch/index.js +2 -2
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +4 -3
- package/dist/components/tabs/tabs.d.ts +3 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tags-input/index.d.ts +1 -1
- package/dist/components/tags-input/index.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +9 -7
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +9 -2
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/theme-icon/index.js +2 -2
- package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
- package/dist/components/time-input/index.js +24 -8
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/time-input/time-input.d.ts.map +1 -1
- package/dist/components/time-input/time-row.d.ts +16 -3
- package/dist/components/time-input/time-row.d.ts.map +1 -1
- package/dist/components/timeline/index.js +6 -3
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/tree-multi-select/index.d.ts +1 -1
- package/dist/components/tree-multi-select/index.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.js +62 -44
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +10 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.d.ts +1 -1
- package/dist/components/tree-select/index.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +45 -15
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +10 -1
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/date-value.d.ts +14 -1
- package/dist/lib/date-value.d.ts.map +1 -1
- package/dist/lib/focus-styles.d.ts +13 -5
- package/dist/lib/focus-styles.d.ts.map +1 -1
- package/dist/theme.css +1 -2
- package/package.json +1 -1
- package/src/components/autocomplete/autocomplete.test.tsx +32 -0
- package/src/components/autocomplete/autocomplete.tsx +17 -5
- package/src/components/autocomplete/index.ts +5 -1
- package/src/components/button/button.test.tsx +6 -0
- package/src/components/calendar/calendar-zone-sync.tsx +79 -0
- package/src/components/calendar/calendar.test.tsx +134 -14
- package/src/components/calendar/calendar.tsx +36 -22
- package/src/components/chart/chart.test.tsx +115 -8
- package/src/components/chart/chart.tsx +115 -25
- package/src/components/chart/styles.css +100 -0
- package/src/components/choice-card-group/index.ts +2 -0
- package/src/components/circular-progress/circular-progress.tsx +2 -0
- package/src/components/clipboard/clipboard.test.tsx +54 -22
- package/src/components/clipboard/clipboard.tsx +2 -0
- package/src/components/clipboard/copy.tsx +2 -0
- package/src/components/clipboard/index.ts +3 -3
- package/src/components/combobox/combobox.test.tsx +22 -0
- package/src/components/combobox/combobox.tsx +20 -0
- package/src/components/combobox/index.ts +1 -0
- package/src/components/combobox-list/combobox-list.test.tsx +19 -0
- package/src/components/combobox-list/combobox-list.tsx +16 -2
- package/src/components/combobox-list/index.ts +5 -1
- package/src/components/data-table/data-table-filter/data-table-date-filter.tsx +5 -4
- package/src/components/data-table/data-table-filter/data-table-number-filter.tsx +16 -2
- package/src/components/data-table/data-table-filter/data-table-select-filter.tsx +9 -1
- package/src/components/data-table/data-table-filter/index.tsx +15 -1
- package/src/components/data-table/data-table-filter.test.tsx +33 -0
- package/src/components/data-table/data-table-header-cell.tsx +37 -22
- package/src/components/data-table/data-table-meta.ts +2 -2
- package/src/components/data-table/data-table-pagination.tsx +6 -0
- package/src/components/data-table/data-table-stack.tsx +26 -14
- package/src/components/data-table/data-table-toolbar.tsx +4 -1
- package/src/components/data-table/data-table-translations.ts +105 -0
- package/src/components/data-table/data-table.test.tsx +121 -0
- package/src/components/data-table/data-table.tsx +37 -17
- package/src/components/data-table/index.ts +9 -1
- package/src/components/date-picker/date-picker.test.tsx +197 -5
- package/src/components/date-picker/date-picker.tsx +42 -16
- package/src/components/drawer/drawer.tsx +14 -1
- package/src/components/drawer/index.ts +1 -0
- package/src/components/field/field.tsx +29 -3
- package/src/components/file-upload/file-upload.test.tsx +21 -0
- package/src/components/file-upload/file-upload.tsx +26 -3
- package/src/components/file-upload/index.ts +1 -1
- package/src/components/modal/index.ts +1 -0
- package/src/components/modal/modal-translations.test.tsx +27 -0
- package/src/components/modal/modal.tsx +14 -1
- package/src/components/multi-combobox-list/index.ts +5 -1
- package/src/components/multi-combobox-list/multi-combobox-list.test.tsx +19 -0
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +26 -4
- package/src/components/multi-select/index.ts +1 -1
- package/src/components/multi-select/multi-select.test.tsx +38 -0
- package/src/components/multi-select/multi-select.tsx +28 -4
- package/src/components/nav-link/index.ts +6 -1
- package/src/components/nav-link/nav-link.test.tsx +16 -0
- package/src/components/nav-link/nav-link.tsx +19 -1
- package/src/components/nav-link/navigation.test.tsx +18 -0
- package/src/components/nav-link/navigation.tsx +8 -4
- package/src/components/notification/create-notifier.tsx +20 -4
- package/src/components/notification/index.ts +7 -1
- package/src/components/notification/notification.test.tsx +49 -0
- package/src/components/notification/notification.tsx +39 -5
- package/src/components/number-input/index.ts +1 -1
- package/src/components/number-input/number-input.test.tsx +37 -0
- package/src/components/number-input/number-input.tsx +33 -4
- package/src/components/password-input/index.ts +5 -1
- package/src/components/password-input/password-input.test.tsx +201 -4
- package/src/components/password-input/password-input.tsx +162 -13
- package/src/components/popover/popover.tsx +0 -29
- package/src/components/progress/index.ts +3 -3
- package/src/components/progress/progress.tsx +2 -0
- package/src/components/rating/rating.tsx +2 -0
- package/src/components/schedule/now-cursor-line.test.tsx +56 -28
- package/src/components/schedule/now-cursor-line.tsx +30 -16
- package/src/components/schedule/schedule-agenda-view.test.tsx +1 -1
- package/src/components/schedule/schedule-dates.test.ts +19 -0
- package/src/components/schedule/schedule-dates.ts +16 -30
- package/src/components/schedule/schedule-details-popover.test.tsx +77 -6
- package/src/components/schedule/schedule-event-chip.tsx +17 -6
- package/src/components/schedule/schedule-event-details.test.tsx +38 -0
- package/src/components/schedule/schedule-event-details.tsx +7 -5
- package/src/components/schedule/schedule-geometry.test.ts +21 -18
- package/src/components/schedule/schedule-geometry.ts +37 -24
- package/src/components/schedule/schedule-grid-gesture.ts +5 -9
- package/src/components/schedule/schedule-segments.ts +2 -3
- package/src/components/schedule/schedule-timed-grid.tsx +43 -20
- package/src/components/schedule/schedule.test.tsx +34 -11
- package/src/components/schedule/use-event-resize.ts +6 -13
- package/src/components/segment-group/segment-group.test.tsx +23 -0
- package/src/components/segment-group/segment-group.tsx +13 -7
- package/src/components/select/index.ts +1 -1
- package/src/components/select/select.test.tsx +32 -0
- package/src/components/select/select.tsx +15 -1
- package/src/components/spinner/spinner.test.tsx +26 -0
- package/src/components/spinner/spinner.tsx +4 -1
- package/src/components/table/table.test.tsx +13 -0
- package/src/components/table/table.tsx +9 -5
- package/src/components/tabs/tabs.test.tsx +11 -0
- package/src/components/tabs/tabs.tsx +6 -4
- package/src/components/tags-input/index.ts +1 -1
- package/src/components/tags-input/tags-input.test.tsx +28 -0
- package/src/components/tags-input/tags-input.tsx +17 -1
- package/src/components/theme-icon/theme-icon.tsx +8 -3
- package/src/components/time-input/time-input.test.tsx +75 -0
- package/src/components/time-input/time-input.tsx +27 -3
- package/src/components/time-input/time-row.tsx +27 -3
- package/src/components/timeline/timeline.tsx +6 -3
- package/src/components/tree-multi-select/index.ts +5 -1
- package/src/components/tree-multi-select/tree-multi-select.test.tsx +72 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +156 -115
- package/src/components/tree-select/index.ts +1 -1
- package/src/components/tree-select/tree-select.test.tsx +69 -0
- package/src/components/tree-select/tree-select.tsx +128 -74
- package/src/lib/date-value.test.ts +19 -0
- package/src/lib/date-value.ts +21 -5
- package/src/lib/focus-styles.test.ts +21 -2
- package/src/lib/focus-styles.ts +24 -5
- package/src/theme.css +1 -2
- package/src/use-client-barrels.test.ts +80 -0
- package/dist/chunk-5JHDSVEZ.js.map +0 -1
- package/dist/chunk-6GDMSENK.js.map +0 -1
- package/dist/chunk-6OLTJYSX.js.map +0 -1
- package/dist/chunk-7NZSTCJO.js.map +0 -1
- package/dist/chunk-B2LCHXUB.js.map +0 -1
- package/dist/chunk-B2YJKRNQ.js.map +0 -1
- package/dist/chunk-EBREIC3L.js.map +0 -1
- package/dist/chunk-FHG54IT5.js.map +0 -1
- package/dist/chunk-FZIHZT5R.js.map +0 -1
- package/dist/chunk-HT5JAHR3.js.map +0 -1
- package/dist/chunk-KHMFNH3X.js.map +0 -1
- package/dist/chunk-NSDM3FEB.js.map +0 -1
- package/dist/chunk-O23Y5ML4.js.map +0 -1
- package/dist/chunk-PH354ECN.js.map +0 -1
- package/dist/chunk-RQL7FVCS.js.map +0 -1
- package/dist/chunk-TCWYBVIL.js.map +0 -1
- package/dist/chunk-UHNRAI6V.js.map +0 -1
- package/dist/chunk-WHKKN3ZK.js.map +0 -1
- package/dist/chunk-WQN64ZHG.js.map +0 -1
- package/dist/chunk-YBJB7FGE.js.map +0 -1
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import { useFieldContext } from "@ark-ui/react/field"
|
|
3
4
|
import { cva } from "class-variance-authority"
|
|
4
5
|
import {
|
|
6
|
+
type ComponentProps,
|
|
5
7
|
type FocusEvent,
|
|
6
8
|
Fragment,
|
|
7
9
|
type ReactNode,
|
|
8
10
|
type Ref,
|
|
9
11
|
useEffect,
|
|
12
|
+
useId,
|
|
10
13
|
useMemo,
|
|
11
14
|
useRef,
|
|
12
15
|
useState,
|
|
13
16
|
} from "react"
|
|
14
17
|
import { cn } from "../../lib/cn"
|
|
15
18
|
import type { Color } from "../../lib/colors"
|
|
19
|
+
import { focusStyles } from "../../lib/focus-styles"
|
|
16
20
|
import { props } from "../../lib/props"
|
|
17
21
|
import type { ClearSectionMode } from "../../lib/select-data"
|
|
18
22
|
import type { WithTestId } from "../../lib/test-id"
|
|
@@ -28,7 +32,8 @@ import {
|
|
|
28
32
|
type TreeValue,
|
|
29
33
|
} from "../../lib/tree-data"
|
|
30
34
|
import { useUncontrolled } from "../../lib/use-uncontrolled"
|
|
31
|
-
import {
|
|
35
|
+
import { controlIndicator } from "../checkbox/control"
|
|
36
|
+
import { type FieldProps, FieldShell, fieldA11yProps } from "../field/field"
|
|
32
37
|
import {
|
|
33
38
|
type InputSize,
|
|
34
39
|
type InputVariant,
|
|
@@ -37,6 +42,7 @@ import {
|
|
|
37
42
|
inputSlot,
|
|
38
43
|
placeholderColor,
|
|
39
44
|
} from "../input/input"
|
|
45
|
+
import type { MultiSelectTranslations } from "../multi-select/multi-select"
|
|
40
46
|
import { Pill } from "../pill/pill"
|
|
41
47
|
import {
|
|
42
48
|
PillOverflowCounter,
|
|
@@ -46,6 +52,7 @@ import {
|
|
|
46
52
|
} from "../pills-input/pills-input"
|
|
47
53
|
import { CheckIcon, ChevronIcon, CloseIcon, MinusIcon } from "../popover/icons"
|
|
48
54
|
import { Popover, popoverChevron, popoverClearTrigger, popoverEmpty } from "../popover/popover"
|
|
55
|
+
import type { TreeSelectTranslations } from "../tree-select/tree-select"
|
|
49
56
|
|
|
50
57
|
/**
|
|
51
58
|
* TreeMultiSelect — pick several values from hierarchical data, shown as a fully
|
|
@@ -108,7 +115,10 @@ const treeRow = cva(
|
|
|
108
115
|
"hover:bg-black/5 dark:hover:bg-white/8",
|
|
109
116
|
"data-active:bg-black/5 dark:data-active:bg-white/8",
|
|
110
117
|
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
111
|
-
|
|
118
|
+
// Palette, not brand: the focused row is also the active one, and brand-500
|
|
119
|
+
// measured 2.73:1 against that light fill. `--c-text` (the popover's
|
|
120
|
+
// `data-color`, neutral by default) clears it in both themes.
|
|
121
|
+
focusStyles({ ring: "palette", offset: false, inset: true }),
|
|
112
122
|
],
|
|
113
123
|
{
|
|
114
124
|
variants: {
|
|
@@ -124,29 +134,6 @@ const treeRow = cva(
|
|
|
124
134
|
},
|
|
125
135
|
)
|
|
126
136
|
|
|
127
|
-
const treeCheckbox = cva(
|
|
128
|
-
[
|
|
129
|
-
"inline-flex shrink-0 items-center justify-center rounded-xs border transition-colors",
|
|
130
|
-
"border-gray-light-300 dark:border-gray-dark-700",
|
|
131
|
-
"bg-gray-light-25 dark:bg-gray-dark-900",
|
|
132
|
-
"text-(--c-on-solid)",
|
|
133
|
-
"group-data-checked/row:border-(--c-solid) group-data-checked/row:bg-(--c-solid)",
|
|
134
|
-
"group-data-mixed/row:border-(--c-solid) group-data-mixed/row:bg-(--c-solid)",
|
|
135
|
-
],
|
|
136
|
-
{
|
|
137
|
-
variants: {
|
|
138
|
-
size: {
|
|
139
|
-
xs: "size-3.5 [&_svg]:size-2.5",
|
|
140
|
-
sm: "size-4 [&_svg]:size-3",
|
|
141
|
-
md: "size-4 [&_svg]:size-3",
|
|
142
|
-
lg: "size-4.5 [&_svg]:size-3.5",
|
|
143
|
-
xl: "size-5 [&_svg]:size-4",
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
defaultVariants: { size: "md" },
|
|
147
|
-
},
|
|
148
|
-
)
|
|
149
|
-
|
|
150
137
|
type TreeMultiSelectClassNames = {
|
|
151
138
|
field?: string
|
|
152
139
|
trigger?: string
|
|
@@ -213,8 +200,50 @@ export type TreeMultiSelectProps<Data extends TreeSelectData = TreeNodeData[]> =
|
|
|
213
200
|
ref?: Ref<HTMLDivElement>
|
|
214
201
|
className?: string
|
|
215
202
|
classNames?: TreeMultiSelectClassNames
|
|
203
|
+
/** Overrides the control's accessible names — see `TreeMultiSelectTranslations`. A partial
|
|
204
|
+
* override keeps the other defaults. */
|
|
205
|
+
translations?: TreeMultiSelectTranslations
|
|
216
206
|
}
|
|
217
207
|
|
|
208
|
+
/** `TreeSelect`'s keys — `clearTriggerLabel` (here the clear-all button, default
|
|
209
|
+
* `"Clear all"`) and `searchLabel` (default `"Search"`) — plus `MultiSelect`'s `removeValue`:
|
|
210
|
+
* a value pill's remove-button name, given the value's label (default `"Remove"`). */
|
|
211
|
+
export type TreeMultiSelectTranslations = TreeSelectTranslations &
|
|
212
|
+
Pick<MultiSelectTranslations, "removeValue">
|
|
213
|
+
|
|
214
|
+
const TREE_MULTI_SELECT_DEFAULT_TRANSLATIONS = {
|
|
215
|
+
clearTriggerLabel: "Clear all",
|
|
216
|
+
searchLabel: "Search",
|
|
217
|
+
removeValue: () => "Remove",
|
|
218
|
+
} as const satisfies TreeMultiSelectTranslations
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The real, focusable `<div role="combobox">`, split out so it reads the
|
|
222
|
+
* `Field` context from *inside* the wrapping `FieldShell` — `TreeMultiSelect` itself
|
|
223
|
+
* renders that shell, so calling `useFieldContext()` at its own top level
|
|
224
|
+
* would run too early. `Popover.Trigger` stamps its own id on the element, so
|
|
225
|
+
* the `<label for>` never reaches it: the name comes from `aria-labelledby`.
|
|
226
|
+
*/
|
|
227
|
+
const TreeMultiSelectTrigger = ({
|
|
228
|
+
open,
|
|
229
|
+
disabled,
|
|
230
|
+
...rest
|
|
231
|
+
}: Omit<ComponentProps<"div">, "role" | "tabIndex"> & { open: boolean; disabled?: boolean }) => {
|
|
232
|
+
const field = useFieldContext()
|
|
233
|
+
return (
|
|
234
|
+
<Popover.Trigger asChild>
|
|
235
|
+
<div
|
|
236
|
+
role="combobox"
|
|
237
|
+
aria-expanded={open}
|
|
238
|
+
aria-haspopup="tree"
|
|
239
|
+
tabIndex={disabled ? -1 : 0}
|
|
240
|
+
{...fieldA11yProps(field)}
|
|
241
|
+
{...rest}
|
|
242
|
+
/>
|
|
243
|
+
</Popover.Trigger>
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
|
+
|
|
218
247
|
export const TreeMultiSelect = <const Data extends TreeSelectData = TreeNodeData[]>({
|
|
219
248
|
data,
|
|
220
249
|
value: valueProp,
|
|
@@ -246,7 +275,9 @@ export const TreeMultiSelect = <const Data extends TreeSelectData = TreeNodeData
|
|
|
246
275
|
className,
|
|
247
276
|
classNames,
|
|
248
277
|
testId,
|
|
278
|
+
translations,
|
|
249
279
|
}: TreeMultiSelectProps<Data>) => {
|
|
280
|
+
const resolvedTranslations = { ...TREE_MULTI_SELECT_DEFAULT_TRANSLATIONS, ...translations }
|
|
250
281
|
const [value, setValue] = useUncontrolled<TreeValue<Data>[]>({
|
|
251
282
|
value: valueProp,
|
|
252
283
|
defaultValue: defaultValue ?? [],
|
|
@@ -254,6 +285,7 @@ export const TreeMultiSelect = <const Data extends TreeSelectData = TreeNodeData
|
|
|
254
285
|
finalValue: [],
|
|
255
286
|
})
|
|
256
287
|
const [open, setOpen] = useState(false)
|
|
288
|
+
const treeId = useId()
|
|
257
289
|
const [search, setSearch] = useState("")
|
|
258
290
|
|
|
259
291
|
// Red state is driven independently of the `Field` error slot so a form
|
|
@@ -382,8 +414,14 @@ export const TreeMultiSelect = <const Data extends TreeSelectData = TreeNodeData
|
|
|
382
414
|
})
|
|
383
415
|
) : (
|
|
384
416
|
<>
|
|
385
|
-
{/*
|
|
386
|
-
|
|
417
|
+
{/* Presentational checkbox: state lives on the row's aria-checked. It
|
|
418
|
+
borrows Checkbox's own box, driven by `data-state` the way Ark
|
|
419
|
+
drives the real one, so checked and indeterminate match Checkbox. */}
|
|
420
|
+
<span
|
|
421
|
+
aria-hidden
|
|
422
|
+
data-state={checked ? "checked" : mixed ? "indeterminate" : "unchecked"}
|
|
423
|
+
className={cn(controlIndicator({ size, variant: "filled" }), classNames?.checkbox)}
|
|
424
|
+
>
|
|
387
425
|
{checked && <CheckIcon />}
|
|
388
426
|
{mixed && <MinusIcon />}
|
|
389
427
|
</span>
|
|
@@ -472,95 +510,97 @@ export const TreeMultiSelect = <const Data extends TreeSelectData = TreeNodeData
|
|
|
472
510
|
autoFocus={false}
|
|
473
511
|
width="target"
|
|
474
512
|
>
|
|
475
|
-
<
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
{endSlot != null && <span className={inputSlot}>{endSlot}</span>}
|
|
540
|
-
{showClear && (
|
|
541
|
-
<button
|
|
542
|
-
type="button"
|
|
543
|
-
aria-label="Clear all"
|
|
544
|
-
onPointerDown={(event) => {
|
|
545
|
-
event.preventDefault()
|
|
546
|
-
event.stopPropagation()
|
|
547
|
-
}}
|
|
548
|
-
onClick={(event) => {
|
|
549
|
-
event.stopPropagation()
|
|
550
|
-
setValue([])
|
|
551
|
-
}}
|
|
552
|
-
className={popoverClearTrigger}
|
|
553
|
-
>
|
|
554
|
-
<CloseIcon />
|
|
555
|
-
</button>
|
|
556
|
-
)}
|
|
557
|
-
{(clearSectionMode === "both" || !showClear) && (
|
|
558
|
-
<span aria-hidden data-chevron className={cn(popoverChevron, open && "rotate-180")}>
|
|
559
|
-
<ChevronIcon />
|
|
560
|
-
</span>
|
|
513
|
+
<TreeMultiSelectTrigger
|
|
514
|
+
ref={ref}
|
|
515
|
+
open={open}
|
|
516
|
+
disabled={disabled}
|
|
517
|
+
// Ark points this at the popover's dialog wrapper; point it at the
|
|
518
|
+
// tree itself instead. The content stays mounted while closed, so the
|
|
519
|
+
// (hidden) tree is a valid target then too, as in the APG combobox.
|
|
520
|
+
// With no tree (search matched nothing), Ark's own target stands.
|
|
521
|
+
aria-controls={flat.length > 0 ? treeId : undefined}
|
|
522
|
+
aria-invalid={isInvalid || undefined}
|
|
523
|
+
data-color={color}
|
|
524
|
+
{...props({
|
|
525
|
+
"data-disabled": disabled,
|
|
526
|
+
"data-readonly": readOnly,
|
|
527
|
+
"data-invalid": isInvalid,
|
|
528
|
+
"data-with-start-slot": startSlot != null,
|
|
529
|
+
// The trigger always ends in a chevron (and optional clear).
|
|
530
|
+
"data-with-end-slot": true,
|
|
531
|
+
// The shell IS the tabbable/focusable element here (no separate
|
|
532
|
+
// inner control to route to), so `testId` lands directly on it.
|
|
533
|
+
"data-testid": testId,
|
|
534
|
+
})}
|
|
535
|
+
onBlur={onBlur}
|
|
536
|
+
onKeyDown={(event) => {
|
|
537
|
+
if (disabled || readOnly) return
|
|
538
|
+
if (event.key === "Enter" || event.key === " " || event.key === "ArrowDown") {
|
|
539
|
+
event.preventDefault()
|
|
540
|
+
setOpen(true)
|
|
541
|
+
}
|
|
542
|
+
}}
|
|
543
|
+
className={cn(
|
|
544
|
+
inputShell({ size, variant }),
|
|
545
|
+
pillsShell,
|
|
546
|
+
"cursor-pointer",
|
|
547
|
+
className,
|
|
548
|
+
classNames?.trigger,
|
|
549
|
+
)}
|
|
550
|
+
>
|
|
551
|
+
{startSlot != null && (
|
|
552
|
+
<span className={inputSlot} aria-hidden>
|
|
553
|
+
{startSlot}
|
|
554
|
+
</span>
|
|
555
|
+
)}
|
|
556
|
+
<div ref={containerRef} className={pillsContent({ size })}>
|
|
557
|
+
{value.length === 0 ? (
|
|
558
|
+
<span className={cn("min-w-0 flex-1 truncate", placeholderColor)}>{placeholder}</span>
|
|
559
|
+
) : (
|
|
560
|
+
<>
|
|
561
|
+
{value.slice(0, visibleCount).map((v) => (
|
|
562
|
+
<Pill
|
|
563
|
+
key={v}
|
|
564
|
+
size={size}
|
|
565
|
+
disabled={disabled}
|
|
566
|
+
withRemoveButton={!disabled && !readOnly}
|
|
567
|
+
onRemove={() => removeValue(v)}
|
|
568
|
+
removeLabel={resolvedTranslations.removeValue(labelMap.get(v) ?? v)}
|
|
569
|
+
className={classNames?.pill}
|
|
570
|
+
data-overflow-item
|
|
571
|
+
>
|
|
572
|
+
{labelMap.get(v) ?? v}
|
|
573
|
+
</Pill>
|
|
574
|
+
))}
|
|
575
|
+
{hiddenCount > 0 && <PillOverflowCounter count={hiddenCount} size={size} />}
|
|
576
|
+
</>
|
|
561
577
|
)}
|
|
562
578
|
</div>
|
|
563
|
-
|
|
579
|
+
|
|
580
|
+
{endSlot != null && <span className={inputSlot}>{endSlot}</span>}
|
|
581
|
+
{showClear && (
|
|
582
|
+
<button
|
|
583
|
+
type="button"
|
|
584
|
+
aria-label={resolvedTranslations.clearTriggerLabel}
|
|
585
|
+
onPointerDown={(event) => {
|
|
586
|
+
event.preventDefault()
|
|
587
|
+
event.stopPropagation()
|
|
588
|
+
}}
|
|
589
|
+
onClick={(event) => {
|
|
590
|
+
event.stopPropagation()
|
|
591
|
+
setValue([])
|
|
592
|
+
}}
|
|
593
|
+
className={popoverClearTrigger}
|
|
594
|
+
>
|
|
595
|
+
<CloseIcon />
|
|
596
|
+
</button>
|
|
597
|
+
)}
|
|
598
|
+
{(clearSectionMode === "both" || !showClear) && (
|
|
599
|
+
<span aria-hidden data-chevron className={cn(popoverChevron, open && "rotate-180")}>
|
|
600
|
+
<ChevronIcon />
|
|
601
|
+
</span>
|
|
602
|
+
)}
|
|
603
|
+
</TreeMultiSelectTrigger>
|
|
564
604
|
|
|
565
605
|
<Popover.Content data-color={color} className={classNames?.popover}>
|
|
566
606
|
{searchable && (
|
|
@@ -572,7 +612,7 @@ export const TreeMultiSelect = <const Data extends TreeSelectData = TreeNodeData
|
|
|
572
612
|
onChange={(event) => setSearch(event.target.value)}
|
|
573
613
|
onKeyDown={onSearchKeyDown}
|
|
574
614
|
placeholder={searchPlaceholder}
|
|
575
|
-
aria-label=
|
|
615
|
+
aria-label={resolvedTranslations.searchLabel}
|
|
576
616
|
className={cn(inputControlClasses, "text-sm", classNames?.search)}
|
|
577
617
|
/>
|
|
578
618
|
</Popover.Header>
|
|
@@ -583,6 +623,7 @@ export const TreeMultiSelect = <const Data extends TreeSelectData = TreeNodeData
|
|
|
583
623
|
<div className={popoverEmpty}>{empty}</div>
|
|
584
624
|
) : (
|
|
585
625
|
<div
|
|
626
|
+
id={treeId}
|
|
586
627
|
role="tree"
|
|
587
628
|
aria-multiselectable="true"
|
|
588
629
|
aria-orientation="vertical"
|
|
@@ -374,3 +374,72 @@ describe("TreeSelect", () => {
|
|
|
374
374
|
})
|
|
375
375
|
})
|
|
376
376
|
})
|
|
377
|
+
|
|
378
|
+
describe("TreeSelect — field a11y", () => {
|
|
379
|
+
it("names the combobox from its label", () => {
|
|
380
|
+
render(<TreeSelect data={data} label="Files" />)
|
|
381
|
+
const trigger = screen.getByRole("combobox", { name: "Files" })
|
|
382
|
+
const labelledById = trigger.getAttribute("aria-labelledby")
|
|
383
|
+
expect(document.getElementById(labelledById as string)?.textContent).toBe("Files")
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
it("wires description to aria-describedby on the trigger", () => {
|
|
387
|
+
render(<TreeSelect data={data} label="Files" description="Pick a file" />)
|
|
388
|
+
const trigger = screen.getByRole("combobox", { name: "Files" })
|
|
389
|
+
const describedById = trigger.getAttribute("aria-describedby")
|
|
390
|
+
expect(describedById).toBeTruthy()
|
|
391
|
+
expect(document.getElementById(describedById as string)?.textContent).toBe("Pick a file")
|
|
392
|
+
})
|
|
393
|
+
|
|
394
|
+
it("wires error to aria-describedby, aria-errormessage and aria-invalid", () => {
|
|
395
|
+
render(<TreeSelect data={data} label="Files" error="Required" />)
|
|
396
|
+
const trigger = screen.getByRole("combobox", { name: "Files" })
|
|
397
|
+
expect(trigger.getAttribute("aria-invalid")).toBe("true")
|
|
398
|
+
const errorMessageId = trigger.getAttribute("aria-errormessage")
|
|
399
|
+
expect(document.getElementById(errorMessageId as string)?.textContent).toBe("Required")
|
|
400
|
+
expect(trigger.getAttribute("aria-describedby")).toBe(errorMessageId)
|
|
401
|
+
})
|
|
402
|
+
|
|
403
|
+
it("points aria-controls at the tree, closed and open", async () => {
|
|
404
|
+
render(<TreeSelect data={data} label="Files" />)
|
|
405
|
+
const trigger = screen.getByRole("combobox", { name: "Files" })
|
|
406
|
+
const controlsId = trigger.getAttribute("aria-controls")
|
|
407
|
+
expect(document.getElementById(controlsId as string)?.getAttribute("role")).toBe("tree")
|
|
408
|
+
const tree = await open()
|
|
409
|
+
expect(trigger.getAttribute("aria-controls")).toBe(tree.id)
|
|
410
|
+
})
|
|
411
|
+
})
|
|
412
|
+
|
|
413
|
+
describe("TreeSelect translations", () => {
|
|
414
|
+
it("names the clear button and search field from translations", async () => {
|
|
415
|
+
render(
|
|
416
|
+
<TreeSelect
|
|
417
|
+
data={data}
|
|
418
|
+
defaultValue="apple"
|
|
419
|
+
clearable
|
|
420
|
+
searchable
|
|
421
|
+
label="Food"
|
|
422
|
+
translations={{ clearTriggerLabel: "Effacer", searchLabel: "Rechercher" }}
|
|
423
|
+
/>,
|
|
424
|
+
)
|
|
425
|
+
expect(screen.getByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
426
|
+
await open()
|
|
427
|
+
expect(screen.getByRole("textbox", { name: "Rechercher" })).toBeTruthy()
|
|
428
|
+
})
|
|
429
|
+
|
|
430
|
+
it("keeps the English default for the key a partial override omits", async () => {
|
|
431
|
+
render(
|
|
432
|
+
<TreeSelect
|
|
433
|
+
data={data}
|
|
434
|
+
defaultValue="apple"
|
|
435
|
+
clearable
|
|
436
|
+
searchable
|
|
437
|
+
label="Food"
|
|
438
|
+
translations={{ searchLabel: "Rechercher" }}
|
|
439
|
+
/>,
|
|
440
|
+
)
|
|
441
|
+
expect(screen.getByRole("button", { name: "Clear" })).toBeTruthy()
|
|
442
|
+
await open()
|
|
443
|
+
expect(screen.getByRole("textbox", { name: "Rechercher" })).toBeTruthy()
|
|
444
|
+
})
|
|
445
|
+
})
|