@42-central/ui-react 0.18.1 → 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 +6 -3
- 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 +206 -84
- 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 +30 -15
- package/dist/components/kbd/index.js.map +1 -1
- package/dist/components/kbd/kbd.d.ts.map +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 +62 -49
- 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 +3 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts +2 -0
- package/dist/components/switch/switch.d.ts.map +1 -1
- 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 +31 -17
- 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 +212 -0
- package/src/components/data-table/data-table.tsx +92 -23
- 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/kbd/kbd.test.tsx +31 -0
- package/src/components/kbd/kbd.tsx +29 -14
- 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 +74 -27
- package/src/components/schedule/now-cursor-line.tsx +40 -17
- 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/switch/switch.test.tsx +12 -0
- package/src/components/switch/switch.tsx +3 -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,4 +1,5 @@
|
|
|
1
1
|
import { devWarn } from "../../lib/dev-warn"
|
|
2
|
+
import { dayBoundary } from "./schedule-dates"
|
|
2
3
|
import type { ScheduleLayoutResult } from "./schedule-layout"
|
|
3
4
|
import type { ScheduleSlotDuration } from "./schedule-types"
|
|
4
5
|
|
|
@@ -10,9 +11,15 @@ import type { ScheduleSlotDuration } from "./schedule-types"
|
|
|
10
11
|
* §18).
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
|
-
/** Minutes since
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/** Minutes since midnight **in `timeZone`**, including fractional seconds.
|
|
15
|
+
*
|
|
16
|
+
* Measured from `dayBoundary(date, 0, timeZone)`, the same zone the timed
|
|
17
|
+
* grid cuts its rows in (`segmentEvents`), so the now-line positioned with
|
|
18
|
+
* this lands on the same axis as the chips. It used to read the host's
|
|
19
|
+
* `getHours()`, which put the line at the host's hour on a grid whose rows
|
|
20
|
+
* are the schedule's. */
|
|
21
|
+
export function minutesFromMidnight(date: Date, timeZone: string): number {
|
|
22
|
+
return (date.getTime() - dayBoundary(date, 0, timeZone).getTime()) / 60_000
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
export function minutesToPixels(minutes: number, pxPerMinute: number): number {
|
|
@@ -36,19 +43,13 @@ export function pixelsToMinutes(pixels: number, pxPerMinute: number): number {
|
|
|
36
43
|
return pxPerMinute === 0 ? 0 : pixels / pxPerMinute
|
|
37
44
|
}
|
|
38
45
|
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
46
|
+
/** The instant on `day`'s calendar date at `minutes` past midnight,
|
|
47
|
+
* **host-local** — the host-zone inverse of `minutesFromMidnight`.
|
|
41
48
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* What remains host-local by deliberate decision is the now-line's position
|
|
47
|
-
* (`nowIndicatorTop` below, via `minutesFromMidnight`) and the hour-axis
|
|
48
|
-
* gutter's labels — see `clockTimeLabel`'s note in `schedule-dates.ts` for
|
|
49
|
-
* why those two stay that way. This helper is only reachable from its own
|
|
50
|
-
* test today; anything new that needs a day-relative instant should take a
|
|
51
|
-
* `timeZone` and use `dayBoundary` instead. */
|
|
49
|
+
* Nothing in the schedule reads the host's zone any more: rows, chips, the
|
|
50
|
+
* now-line and every time label are in the schedule's `timeZone`. This helper
|
|
51
|
+
* is only reachable from its own test today; anything new that needs a
|
|
52
|
+
* day-relative instant should take a `timeZone` and use `dayBoundary`. */
|
|
52
53
|
export function dateAtMinutes(day: Date, minutes: number): Date {
|
|
53
54
|
const base = new Date(day)
|
|
54
55
|
base.setHours(0, 0, 0, 0)
|
|
@@ -255,14 +256,18 @@ export function resolvePxPerMinute(dayColumnEl: Element, rect?: DOMRect): number
|
|
|
255
256
|
* component (`rangesOverlap`, `disableOutsideHours`): `now` exactly at
|
|
256
257
|
* `startHour:00` is inside, `now` exactly at `endHour:00` is already out.
|
|
257
258
|
*
|
|
258
|
-
*
|
|
259
|
-
* below is built from,
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* about which instant "now" is, which is the whole point of having the gate.
|
|
259
|
+
* Reads the same `minutesFromMidnight` in the same `timeZone` the position
|
|
260
|
+
* below is built from, which is what keeps the gate and the position from
|
|
261
|
+
* ever disagreeing about which instant "now" is — the whole point of having
|
|
262
|
+
* the gate.
|
|
263
263
|
*/
|
|
264
|
-
export function isNowInBand(
|
|
265
|
-
|
|
264
|
+
export function isNowInBand(
|
|
265
|
+
now: Date,
|
|
266
|
+
startHour: number,
|
|
267
|
+
endHour: number,
|
|
268
|
+
timeZone: string,
|
|
269
|
+
): boolean {
|
|
270
|
+
const minutes = minutesFromMidnight(now, timeZone)
|
|
266
271
|
return minutes >= startHour * 60 && minutes < endHour * 60
|
|
267
272
|
}
|
|
268
273
|
|
|
@@ -279,9 +284,17 @@ export function isNowInBand(now: Date, startHour: number, endHour: number): bool
|
|
|
279
284
|
* reaches the clamp — it stays purely so a direct caller can't produce a
|
|
280
285
|
* position outside the column.
|
|
281
286
|
*/
|
|
282
|
-
export function nowIndicatorTop(
|
|
287
|
+
export function nowIndicatorTop(
|
|
288
|
+
now: Date,
|
|
289
|
+
startHour: number,
|
|
290
|
+
endHour: number,
|
|
291
|
+
timeZone: string,
|
|
292
|
+
): number {
|
|
283
293
|
const totalWindowMinutes = (endHour - startHour) * 60
|
|
284
|
-
const rawPercent = minutesToPercent(
|
|
294
|
+
const rawPercent = minutesToPercent(
|
|
295
|
+
minutesFromMidnight(now, timeZone) - startHour * 60,
|
|
296
|
+
totalWindowMinutes,
|
|
297
|
+
)
|
|
285
298
|
return Math.min(Math.max(rawPercent, 0), 100)
|
|
286
299
|
}
|
|
287
300
|
|
|
@@ -211,15 +211,11 @@ export const edgePressure = (position: number, min: number, max: number): number
|
|
|
211
211
|
* the gesture with one, and for the same reason: once the view can move under
|
|
212
212
|
* the pointer, the grid behind it stops answering "where will this land".
|
|
213
213
|
*
|
|
214
|
-
* Formatted in the schedule's own `timeZone`,
|
|
215
|
-
* the
|
|
216
|
-
* `
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
* day than the box it sits in — on a UTC+13 host, a `timeZone="UTC"` schedule
|
|
220
|
-
* rendered "Thu 11:00" as "Fri 12:00 AM". The whole point of the readout is
|
|
221
|
-
* to answer "which day does this land on", so it has to answer in the
|
|
222
|
-
* schedule's own clock.
|
|
214
|
+
* Formatted in the schedule's own `timeZone`, like every other time label
|
|
215
|
+
* in the schedule: this readout floats over a draft box whose position was
|
|
216
|
+
* derived from `dayBoundary` in that same zone, so a host-local reading of it
|
|
217
|
+
* would name a different day than the box it sits in — on a UTC+13 host, a
|
|
218
|
+
* `timeZone="UTC"` schedule once rendered "Thu 11:00" as "Fri 12:00 AM".
|
|
223
219
|
*
|
|
224
220
|
* `hour: "2-digit"`, not `"numeric"` — the same SSR/ICU reasoning as
|
|
225
221
|
* `schedule-dates.ts`'s own `timeRangeLabel`. */
|
|
@@ -44,9 +44,8 @@ import type { ScheduleAnyEvent } from "./schedule-types"
|
|
|
44
44
|
* host-local band and rendered nothing.)
|
|
45
45
|
*
|
|
46
46
|
* Each segment therefore also carries `offsetMinutes`, its distance from the
|
|
47
|
-
* band's own start, so the renderer positions chips from that rather
|
|
48
|
-
*
|
|
49
|
-
* disagreement one layer up.
|
|
47
|
+
* band's own start, so the renderer positions chips from that directly rather
|
|
48
|
+
* than re-deriving a time of day from the instant.
|
|
50
49
|
*/
|
|
51
50
|
|
|
52
51
|
export type ScheduleSegment<P = unknown> = {
|
|
@@ -697,6 +697,7 @@ function DayColumn<P = unknown>({
|
|
|
697
697
|
nowRef={nowRef}
|
|
698
698
|
startHour={startHour}
|
|
699
699
|
endHour={endHour}
|
|
700
|
+
timeZone={timeZone}
|
|
700
701
|
hideDot={isFirstDayColumn}
|
|
701
702
|
className={classNames?.nowIndicator}
|
|
702
703
|
/>
|
|
@@ -899,12 +900,14 @@ export function ScheduleTimedGrid<P = unknown>({
|
|
|
899
900
|
announce(
|
|
900
901
|
translations.eventCreated.replace(
|
|
901
902
|
"{range}",
|
|
902
|
-
ranges
|
|
903
|
+
ranges
|
|
904
|
+
.map((range) => timeRangeLabel(range.start, range.end, locale, timeZone))
|
|
905
|
+
.join(", "),
|
|
903
906
|
),
|
|
904
907
|
)
|
|
905
908
|
onEventCreate?.(ranges)
|
|
906
909
|
},
|
|
907
|
-
[onEventCreate, translations, locale, announce],
|
|
910
|
+
[onEventCreate, translations, locale, timeZone, announce],
|
|
908
911
|
)
|
|
909
912
|
|
|
910
913
|
// An explicit `hourHeight` prop always wins; absent, it scales with
|
|
@@ -1309,16 +1312,30 @@ export function ScheduleTimedGrid<P = unknown>({
|
|
|
1309
1312
|
// full-width now-guide below — an absolutely-positioned grid item
|
|
1310
1313
|
// resolves its containing block to its own grid area (per the CSS
|
|
1311
1314
|
// Grid spec) only when the grid container itself is positioned;
|
|
1312
|
-
// without it, `top` was resolving against the page instead.
|
|
1313
|
-
// gives this grid a
|
|
1314
|
-
// component's own `h-full overflow-auto` root, itself
|
|
1315
|
-
// against a definite-height ancestor further up — the same
|
|
1316
|
-
// that already makes scrolling work
|
|
1317
|
-
// row's `1fr` track below
|
|
1318
|
-
//
|
|
1319
|
-
//
|
|
1320
|
-
//
|
|
1321
|
-
//
|
|
1315
|
+
// without it, `top` was resolving against the page instead.
|
|
1316
|
+
// `min-h-full` gives this grid a definite *minimum* height (resolving
|
|
1317
|
+
// against this component's own `h-full overflow-auto` root, itself
|
|
1318
|
+
// resolving against a definite-height ancestor further up — the same
|
|
1319
|
+
// chain that already makes scrolling work). That is enough for the
|
|
1320
|
+
// timed row's `1fr` track below: when the floor fits, CSS Grid
|
|
1321
|
+
// re-resolves the flex fraction against the container's min-height,
|
|
1322
|
+
// so `1fr` still stretches the row to fill the viewport; when it
|
|
1323
|
+
// doesn't, the row sits at its floor. `minmax(floor, 1fr)` is the
|
|
1324
|
+
// actual "min-height for the slot, CSS resizes to fill" behavior: at
|
|
1325
|
+
// least the floor, else however much real space is left.
|
|
1326
|
+
//
|
|
1327
|
+
// `min-h-full`, not `h-full` — this box is the header block's sticky
|
|
1328
|
+
// containing block, and a `position: sticky` item can only travel to
|
|
1329
|
+
// the edge of *this box*. Pinned at `h-full`, the wrapper was exactly
|
|
1330
|
+
// viewport-tall while the hour rows overflowed it, so the header
|
|
1331
|
+
// detached and scrolled away once `scrollTop` passed `clientHeight -
|
|
1332
|
+
// headerHeight` (measured: a 380px grid scrolled to 809 put the header
|
|
1333
|
+
// 466px above the scroller; a 196px one lost it 41px in, at 200).
|
|
1334
|
+
// Growing to the rows' real height makes the sticky containing block
|
|
1335
|
+
// the full scrollable height — the vertical twin of `min-w-max`
|
|
1336
|
+
// below. Nothing else moves: the in-flow items already stretched to
|
|
1337
|
+
// the row track, not to the container, and the now-guide and piece
|
|
1338
|
+
// pool sit in in-flow `row-2` wrappers for exactly that reason.
|
|
1322
1339
|
// `min-w-max` is what lets the hour gutter (and the header block's
|
|
1323
1340
|
// corner cell) stay pinned across a horizontal scroll. Without it this
|
|
1324
1341
|
// wrapper is `width: 100%` of the scrollport while its own tracks
|
|
@@ -1349,18 +1366,20 @@ export function ScheduleTimedGrid<P = unknown>({
|
|
|
1349
1366
|
// here would take that away. `clip` establishes no scrollport, so the
|
|
1350
1367
|
// gutter keeps sticking to the real one and only the painting is cut.
|
|
1351
1368
|
//
|
|
1352
|
-
// `overflow-x` alone, not both axes:
|
|
1353
|
-
//
|
|
1354
|
-
//
|
|
1355
|
-
//
|
|
1356
|
-
//
|
|
1369
|
+
// `overflow-x` alone, not both axes: the vertical overflow the outer
|
|
1370
|
+
// root scrolls is the entire timed grid, and the drag/create pieces'
|
|
1371
|
+
// own vertical overshoot is already contained by `overflow-y-clip`
|
|
1372
|
+
// on the day columns and the piece pool. Back when this wrapper was
|
|
1373
|
+
// `h-full` (see above), the hours overflowed it vertically, and
|
|
1374
|
+
// clipping both axes silently removed the grid's vertical scrollbar
|
|
1375
|
+
// (measured: `scrollHeight` collapsed to `clientHeight`). `clip` on one axis and `visible` on
|
|
1357
1376
|
// the other is well-defined and stays scrollport-free — unlike
|
|
1358
1377
|
// `hidden`, where a `visible` counterpart would compute to `auto`.
|
|
1359
1378
|
//
|
|
1360
1379
|
// The animation itself is unchanged: the band still travels the same
|
|
1361
1380
|
// distance on the same curve. It is only clipped at the edge it was
|
|
1362
1381
|
// already sliding in from, which is what it looked like anyway.
|
|
1363
|
-
className="relative grid h-full min-w-max overflow-x-clip"
|
|
1382
|
+
className="relative grid min-h-full min-w-max overflow-x-clip"
|
|
1364
1383
|
style={{
|
|
1365
1384
|
gridTemplateColumns: columnsTemplate,
|
|
1366
1385
|
gridTemplateRows: `auto minmax(${minTimedHeightPx}px, 1fr)`,
|
|
@@ -1513,6 +1532,7 @@ export function ScheduleTimedGrid<P = unknown>({
|
|
|
1513
1532
|
now={now}
|
|
1514
1533
|
startHour={startHour}
|
|
1515
1534
|
endHour={endHour}
|
|
1535
|
+
timeZone={timeZone}
|
|
1516
1536
|
// Declutters the hour that `NowCursorLabel` already covers —
|
|
1517
1537
|
// same gate as the label itself, so the number only ever
|
|
1518
1538
|
// disappears while its stand-in is actually on screen.
|
|
@@ -1539,6 +1559,7 @@ export function ScheduleTimedGrid<P = unknown>({
|
|
|
1539
1559
|
now={now}
|
|
1540
1560
|
startHour={startHour}
|
|
1541
1561
|
endHour={endHour}
|
|
1562
|
+
timeZone={timeZone}
|
|
1542
1563
|
locale={locale}
|
|
1543
1564
|
className={classNames?.nowIndicator}
|
|
1544
1565
|
/>
|
|
@@ -1556,8 +1577,9 @@ export function ScheduleTimedGrid<P = unknown>({
|
|
|
1556
1577
|
* (`position: absolute`) root — correction after the fill-height
|
|
1557
1578
|
* refactor shipped: an absolutely-positioned grid item's containing
|
|
1558
1579
|
* block resolves against the grid *container's own* definite size
|
|
1559
|
-
* (this grid's `h-full`,
|
|
1560
|
-
* visible
|
|
1580
|
+
* (this grid's own box — then `h-full`, pinned to whatever was
|
|
1581
|
+
* visible; even at `min-h-full` it still includes the header row),
|
|
1582
|
+
* not the row's real `minmax(floor, 1fr)`-resolved track
|
|
1561
1583
|
* size that in-flow items (`DayColumn`, the gutter) correctly
|
|
1562
1584
|
* stretch to and can overflow past — so once the floor exceeds the
|
|
1563
1585
|
* visible area (forcing a scroll), the guide line drifted to a
|
|
@@ -1580,6 +1602,7 @@ export function ScheduleTimedGrid<P = unknown>({
|
|
|
1580
1602
|
now={now}
|
|
1581
1603
|
startHour={startHour}
|
|
1582
1604
|
endHour={endHour}
|
|
1605
|
+
timeZone={timeZone}
|
|
1583
1606
|
variant="guide"
|
|
1584
1607
|
className={classNames?.nowIndicator}
|
|
1585
1608
|
/>
|
|
@@ -596,11 +596,9 @@ describe("ScheduleRoot — scroll-to-now", () => {
|
|
|
596
596
|
|
|
597
597
|
describe("ScheduleRoot — the now-cursor is scoped to the painted window", () => {
|
|
598
598
|
// Host-local by construction, unlike this file's UTC-based `day()` helper,
|
|
599
|
-
// and with no `timeZone` prop
|
|
600
|
-
//
|
|
601
|
-
//
|
|
602
|
-
// would mean a different wall-clock hour on a UTC CI box than on a Paris
|
|
603
|
-
// laptop and this whole block would pass or fail by timezone.
|
|
599
|
+
// and with no `timeZone` prop, so the schedule's zone is the host's: these
|
|
600
|
+
// cases are about the window gate, not the zone. The zone mismatch case is
|
|
601
|
+
// the last test of this block.
|
|
604
602
|
const localAt = (h: number, m = 0) => new Date(2026, 0, 15, h, m)
|
|
605
603
|
const LINE = '[data-schedule-part="now-indicator"]'
|
|
606
604
|
const LABEL = '[data-schedule-part="now-indicator-label"]'
|
|
@@ -612,6 +610,32 @@ describe("ScheduleRoot — the now-cursor is scoped to the painted window", () =
|
|
|
612
610
|
expect(document.querySelector(LABEL)).not.toBeNull()
|
|
613
611
|
})
|
|
614
612
|
|
|
613
|
+
it("places the cursor by the schedule's zone, not the host's", () => {
|
|
614
|
+
// 09:30 in a zone that is never the host's. Read host-local, that instant
|
|
615
|
+
// is some other hour entirely (15:30 in Paris, 14:30 in UTC) — outside the
|
|
616
|
+
// 7–13 window, so the cursor used to vanish from a grid whose rows (and
|
|
617
|
+
// chips) put 09:30 squarely inside it.
|
|
618
|
+
const hostZone = Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
619
|
+
const zone = hostZone === "America/New_York" ? "Asia/Tokyo" : "America/New_York"
|
|
620
|
+
const offsetHours = zone === "America/New_York" ? -5 : 9
|
|
621
|
+
const now = new Date(Date.UTC(2026, 0, 15, 9 - offsetHours, 30))
|
|
622
|
+
render(
|
|
623
|
+
<ScheduleRoot
|
|
624
|
+
data={[]}
|
|
625
|
+
now={now}
|
|
626
|
+
timeZone={zone}
|
|
627
|
+
locale="en-US"
|
|
628
|
+
view="days"
|
|
629
|
+
startHour={7}
|
|
630
|
+
endHour={13}
|
|
631
|
+
/>,
|
|
632
|
+
)
|
|
633
|
+
const marker = document.querySelector<HTMLElement>(`${LINE}[data-variant="marker"]`)
|
|
634
|
+
// 2h30 into a 6h window.
|
|
635
|
+
expect(Number.parseFloat(marker?.style.top ?? "")).toBeCloseTo((150 / 360) * 100)
|
|
636
|
+
expect(document.querySelector(LABEL)?.textContent).toBe("09:30 AM")
|
|
637
|
+
})
|
|
638
|
+
|
|
615
639
|
it("draws none of the three when now is past endHour", () => {
|
|
616
640
|
render(<ScheduleRoot data={[]} now={localAt(18, 50)} view="days" startHour={7} endHour={13} />)
|
|
617
641
|
expect(document.querySelector(LINE)).toBeNull()
|
|
@@ -1474,9 +1498,8 @@ describe("ScheduleEventChip — vertical fit", () => {
|
|
|
1474
1498
|
it("keeps the full time range in the accessible name whether or not the row is shown", () => {
|
|
1475
1499
|
render(<ScheduleRoot data={EVENTS} now={NOW} timeZone="UTC" />)
|
|
1476
1500
|
const event = EVENTS[0] as ScheduleEvent
|
|
1477
|
-
//
|
|
1478
|
-
|
|
1479
|
-
const range = timeRangeLabel(event.start, event.end)
|
|
1501
|
+
// Formatted in the schedule's own zone, whatever the host's is.
|
|
1502
|
+
const range = timeRangeLabel(event.start, event.end, undefined, "UTC")
|
|
1480
1503
|
expect(chipOf("e1").getAttribute("aria-label")).toBe(`${event.title}, ${range}`)
|
|
1481
1504
|
})
|
|
1482
1505
|
|
|
@@ -1609,9 +1632,9 @@ describe("ScheduleEventChip — remove button space reservation", () => {
|
|
|
1609
1632
|
|
|
1610
1633
|
describe("ScheduleRoot — day-boundary segmentation", () => {
|
|
1611
1634
|
// Host-local fixtures, and no `timeZone` override, because that is what real
|
|
1612
|
-
// usage looks like: `ScheduleRoot` defaults to `getLocalTimeZone()
|
|
1613
|
-
// hour axis
|
|
1614
|
-
//
|
|
1635
|
+
// usage looks like: `ScheduleRoot` defaults to `getLocalTimeZone()`, so the
|
|
1636
|
+
// hour axis (cut in the schedule's zone, see `segmentEvents`) is host-local
|
|
1637
|
+
// wall-clock here. Building these in UTC on a non-UTC host would test a mismatch
|
|
1615
1638
|
// between the day buckets and the painted band rather than the clipping.
|
|
1616
1639
|
const local = (y: number, m: number, d: number, h = 0, min = 0) => new Date(y, m, d, h, min, 0, 0)
|
|
1617
1640
|
const MONDAY = local(2026, 0, 12, 12)
|
|
@@ -9,8 +9,8 @@ import type {
|
|
|
9
9
|
import { useCallback, useRef } from "react"
|
|
10
10
|
import { match } from "ts-pattern"
|
|
11
11
|
import type { ScheduleSlotPredicate } from "../../lib/schedule-predicates"
|
|
12
|
-
import { addCalendarDays, checkRangeCommit, dayBoundary } from "./schedule-dates"
|
|
13
|
-
import { pixelsToMinutes, resolvePxPerMinute } from "./schedule-geometry"
|
|
12
|
+
import { addCalendarDays, checkRangeCommit, dayBoundary, timeLabel } from "./schedule-dates"
|
|
13
|
+
import { minutesFromMidnight, pixelsToMinutes, resolvePxPerMinute } from "./schedule-geometry"
|
|
14
14
|
import {
|
|
15
15
|
CREATE_DRAFT,
|
|
16
16
|
collectPieces,
|
|
@@ -116,8 +116,6 @@ type ResizeState = EdgeState & {
|
|
|
116
116
|
cleanup: () => void
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
const minutesSinceMidnight = (date: Date) => date.getHours() * 60 + date.getMinutes()
|
|
120
|
-
|
|
121
119
|
/** Dim every chip of the event while the draft preview has taken over — the
|
|
122
120
|
* same `data-dragging` treatment a dragged chip gets, so "this chip is no
|
|
123
121
|
* longer showing you the truth" reads identically across both gestures. */
|
|
@@ -543,17 +541,12 @@ export function useEventResize({
|
|
|
543
541
|
role: "separator" as const,
|
|
544
542
|
"aria-orientation": "horizontal" as const,
|
|
545
543
|
tabIndex: 0,
|
|
546
|
-
|
|
544
|
+
// Both in the schedule's zone, the one the rows are cut in — a host
|
|
545
|
+
// reading would announce a different hour than the row the edge is on.
|
|
546
|
+
"aria-valuenow": Math.floor(minutesFromMidnight(value, timeZone)),
|
|
547
547
|
"aria-valuemin": 0,
|
|
548
548
|
"aria-valuemax": MINUTES_IN_DAY,
|
|
549
|
-
|
|
550
|
-
// as `schedule-dates.ts`'s `timeRangeLabel`: `"numeric"`'s
|
|
551
|
-
// zero-padding isn't guaranteed identical between Node's and a
|
|
552
|
-
// browser's bundled ICU data.
|
|
553
|
-
"aria-valuetext": new Intl.DateTimeFormat(locale, {
|
|
554
|
-
hour: "2-digit",
|
|
555
|
-
minute: "2-digit",
|
|
556
|
-
}).format(value),
|
|
549
|
+
"aria-valuetext": timeLabel(value, timeZone, locale),
|
|
557
550
|
"aria-label": `${edge === "start" ? "Adjust start time" : "Adjust end time"} of ${event.title}`,
|
|
558
551
|
"data-schedule-part": "resize-handle" as const,
|
|
559
552
|
onPointerDown,
|
|
@@ -169,4 +169,27 @@ describe("SegmentGroup", () => {
|
|
|
169
169
|
expect(screen.getByText("List").className).not.toContain("--c-on-solid-hover")
|
|
170
170
|
},
|
|
171
171
|
)
|
|
172
|
+
|
|
173
|
+
it("names the radio group from its label without a dangling label[for]", () => {
|
|
174
|
+
render(<SegmentGroup data={ITEMS} label="View" />)
|
|
175
|
+
expect(screen.getByRole("radiogroup", { name: "View" })).toBeTruthy()
|
|
176
|
+
// A radio group has no single labelable element, so the field label is plain text with no `for`
|
|
177
|
+
// (each item's own `<label for>` still points at its radio).
|
|
178
|
+
expect(screen.getByText("View").hasAttribute("for")).toBe(false)
|
|
179
|
+
const orphaned = [...document.querySelectorAll("label[for]")].filter(
|
|
180
|
+
(label) => !document.getElementById(label.getAttribute("for") ?? ""),
|
|
181
|
+
)
|
|
182
|
+
expect(orphaned).toEqual([])
|
|
183
|
+
})
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
describe("SegmentGroup separators under RTL", () => {
|
|
187
|
+
// jsdom has no layout, so the class list is the assertable proxy: a physical `left-0` put the
|
|
188
|
+
// rule on the far side of each segment under dir="rtl" (verified in Chromium with ar-EG).
|
|
189
|
+
it("anchors each separator to the logical start edge", () => {
|
|
190
|
+
const { container } = render(<SegmentGroup data={ITEMS} />)
|
|
191
|
+
const item = container.querySelectorAll('[data-part="item"]')[1] as HTMLElement
|
|
192
|
+
expect(item.className).toMatch(/\bbefore:start-0\b/)
|
|
193
|
+
expect(item.className).not.toMatch(/before:left-|before:-translate-x/)
|
|
194
|
+
})
|
|
172
195
|
})
|
|
@@ -121,10 +121,13 @@ const segItemWrap = cva([
|
|
|
121
121
|
"before:absolute before:rounded-full before:bg-gray-light-300 dark:before:bg-gray-dark-600",
|
|
122
122
|
"group-data-invalid:before:bg-red-500/30",
|
|
123
123
|
"before:transition-opacity before:duration-200",
|
|
124
|
-
// Horizontal: a vertical rule centered on the leading edge, sitting in the gap.
|
|
125
|
-
|
|
126
|
-
//
|
|
127
|
-
"
|
|
124
|
+
// Horizontal: a vertical rule centered on the leading edge, sitting in the gap. Logical
|
|
125
|
+
// (`start`, `-ms-[0.5px]` to center the 1px rule), so under `dir="rtl"` the rule still lands
|
|
126
|
+
// between a segment and the one before it instead of on the far side.
|
|
127
|
+
"before:top-1/2 before:start-0 before:-ms-[0.5px] before:h-1/2 before:w-px before:-translate-y-1/2",
|
|
128
|
+
// Vertical: a horizontal rule centered on the top edge instead (`start-1/4` + `w-1/2` is
|
|
129
|
+
// centered in either direction).
|
|
130
|
+
"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
131
|
// No separator before the first segment, or flanking the active pill.
|
|
129
132
|
"nth-2:before:hidden",
|
|
130
133
|
"data-[state=checked]:before:opacity-0 data-[state=checked]:[&+*]:before:opacity-0",
|
|
@@ -153,8 +156,9 @@ const segIndicator = cva("z-0", {
|
|
|
153
156
|
})
|
|
154
157
|
|
|
155
158
|
/**
|
|
156
|
-
* The tray. Mirrors the `Button` variants: `filled` is a
|
|
157
|
-
* the colored pill pops
|
|
159
|
+
* The tray. Mirrors the `Button` variants: `filled` is a borderless neutral fill
|
|
160
|
+
* so the colored pill pops (the kit's quiet `bg-black/3 dark:bg-white/4`; light
|
|
161
|
+
* mode darkens because a bare `bg-white/4` vanishes on a near-white page), `light` / `default` frame the pill with the same
|
|
158
162
|
* translucent surface as `Input`'s own `default` shell (`bg-white/4` + the
|
|
159
163
|
* hairline `border-brand-900/20 dark:border-white/15`) rather than an opaque
|
|
160
164
|
* gray step, so the tray reads correctly on any host background, `subtle` /
|
|
@@ -184,7 +188,7 @@ const segTray = cva(
|
|
|
184
188
|
{
|
|
185
189
|
variants: {
|
|
186
190
|
variant: {
|
|
187
|
-
filled: ["bg-
|
|
191
|
+
filled: ["bg-black/3 dark:bg-white/4", "border-transparent"],
|
|
188
192
|
light: ["bg-white/4", "border-brand-900/20 dark:border-white/15"],
|
|
189
193
|
outline: ["bg-transparent border-transparent"],
|
|
190
194
|
subtle: ["bg-transparent border-transparent"],
|
|
@@ -477,6 +481,8 @@ export const SegmentGroup = <const Data extends SegmentGroupData = SegmentGroupD
|
|
|
477
481
|
size={size}
|
|
478
482
|
className={classNames?.field}
|
|
479
483
|
classNames={{ label: classNames?.label }}
|
|
484
|
+
// A radio group: nothing carries the label's `for` id; the root's `aria-labelledby` names it.
|
|
485
|
+
composite
|
|
480
486
|
>
|
|
481
487
|
{/* `key={orientation}` remounts the root on an axis flip so Ark re-measures
|
|
482
488
|
the indicator rect for the new layout (it only measures on mount + value
|
|
@@ -171,3 +171,35 @@ describe("Select — clearSectionMode", () => {
|
|
|
171
171
|
expect(screen.getByRole("button", { name: "Show options" })).toBeTruthy()
|
|
172
172
|
})
|
|
173
173
|
})
|
|
174
|
+
|
|
175
|
+
describe("Select translations", () => {
|
|
176
|
+
it("names the chevron and clear button from translations", () => {
|
|
177
|
+
render(
|
|
178
|
+
<Select
|
|
179
|
+
data={data}
|
|
180
|
+
label="Fruit"
|
|
181
|
+
clearable
|
|
182
|
+
clearSectionMode="both"
|
|
183
|
+
defaultValue="apple"
|
|
184
|
+
translations={{ triggerLabel: "Afficher les options", clearTriggerLabel: "Effacer" }}
|
|
185
|
+
/>,
|
|
186
|
+
)
|
|
187
|
+
expect(screen.getByRole("button", { name: "Afficher les options" })).toBeTruthy()
|
|
188
|
+
expect(screen.getByRole("button", { name: "Effacer" })).toBeTruthy()
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
it("keeps the English default for the key a partial override omits", () => {
|
|
192
|
+
render(
|
|
193
|
+
<Select
|
|
194
|
+
data={data}
|
|
195
|
+
label="Fruit"
|
|
196
|
+
clearable
|
|
197
|
+
clearSectionMode="both"
|
|
198
|
+
defaultValue="apple"
|
|
199
|
+
translations={{ triggerLabel: "Afficher les options" }}
|
|
200
|
+
/>,
|
|
201
|
+
)
|
|
202
|
+
expect(screen.getByRole("button", { name: "Afficher les options" })).toBeTruthy()
|
|
203
|
+
expect(screen.getByRole("button", { name: "Clear value" })).toBeTruthy()
|
|
204
|
+
})
|
|
205
|
+
})
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
type SelectValue,
|
|
29
29
|
} from "../../lib/select-data"
|
|
30
30
|
import type { WithTestId } from "../../lib/test-id"
|
|
31
|
+
import { COMBOBOX_DEFAULT_TRANSLATIONS, type ComboboxTranslations } from "../combobox/combobox"
|
|
31
32
|
import { type FieldProps, FieldShell, fieldA11yProps } from "../field/field"
|
|
32
33
|
import {
|
|
33
34
|
type InputSize,
|
|
@@ -128,8 +129,18 @@ export type SelectProps<Data extends SelectData = SelectData> = Pick<
|
|
|
128
129
|
container?: HTMLElement | null
|
|
129
130
|
className?: string
|
|
130
131
|
classNames?: SelectClassNames
|
|
132
|
+
/** Overrides the clear button's (`clearTriggerLabel`, default `"Clear value"`) and the
|
|
133
|
+
* chevron's (`triggerLabel`, default `"Show options"`) accessible names — the same keys as
|
|
134
|
+
* the rest of the combobox family. A partial override keeps the other default. */
|
|
135
|
+
translations?: SelectTranslations
|
|
131
136
|
}
|
|
132
137
|
|
|
138
|
+
/** Ark's own Select `translations` type (its `clearTriggerLabel`), derived structurally rather
|
|
139
|
+
* than imported from `@zag-js/select`, plus the combobox family's `triggerLabel` for the
|
|
140
|
+
* kit's own chevron button. */
|
|
141
|
+
export type SelectTranslations = NonNullable<Ark.RootProps<NormalizedItem>["translations"]> &
|
|
142
|
+
Pick<ComboboxTranslations, "triggerLabel">
|
|
143
|
+
|
|
133
144
|
/** Wrap a scalar value into Ark's array contract (or clear with `[]`). */
|
|
134
145
|
const toArkValue = (v: string | null | undefined): string[] | undefined =>
|
|
135
146
|
v === undefined ? undefined : v === null ? [] : [v]
|
|
@@ -198,8 +209,10 @@ export const Select = <const Data extends SelectData = SelectData>({
|
|
|
198
209
|
className,
|
|
199
210
|
classNames,
|
|
200
211
|
testId,
|
|
212
|
+
translations,
|
|
201
213
|
...selectProps
|
|
202
214
|
}: SelectProps<Data> & Omit<ComponentProps<"select">, keyof SelectProps>) => {
|
|
215
|
+
const resolvedTranslations = { ...COMBOBOX_DEFAULT_TRANSLATIONS, ...translations }
|
|
203
216
|
const portalContainer = useOverlayContainer(container)
|
|
204
217
|
const { collection, items, groups } = useMemo(() => normalizeSelectData(data), [data])
|
|
205
218
|
const controlRef = useRef<HTMLDivElement>(null)
|
|
@@ -251,6 +264,7 @@ export const Select = <const Data extends SelectData = SelectData>({
|
|
|
251
264
|
required={required}
|
|
252
265
|
name={name}
|
|
253
266
|
deselectable={clearable}
|
|
267
|
+
translations={resolvedTranslations}
|
|
254
268
|
// Ark anchors Select's positioner to the Trigger, which sits inside the
|
|
255
269
|
// padded `inputShell` Control — so `sameWidth` would inset the panel. Anchor
|
|
256
270
|
// to the full Control instead (matching Combobox), so the panel aligns with
|
|
@@ -336,7 +350,7 @@ export const Select = <const Data extends SelectData = SelectData>({
|
|
|
336
350
|
<button
|
|
337
351
|
type="button"
|
|
338
352
|
tabIndex={-1}
|
|
339
|
-
aria-label=
|
|
353
|
+
aria-label={resolvedTranslations.triggerLabel}
|
|
340
354
|
data-chevron
|
|
341
355
|
className={cn(
|
|
342
356
|
popoverChevron,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react"
|
|
2
|
+
import { describe, expect, it } from "vitest"
|
|
3
|
+
import { Spinner } from "./spinner"
|
|
4
|
+
|
|
5
|
+
describe("Spinner", () => {
|
|
6
|
+
it("is an image named by a custom label", () => {
|
|
7
|
+
render(<Spinner label="Chargement" />)
|
|
8
|
+
expect(screen.getByRole("img", { name: "Chargement" })).toBeTruthy()
|
|
9
|
+
expect(screen.queryByRole("img", { name: "Spinner" })).toBeNull()
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it("is an image named Loading by default", () => {
|
|
13
|
+
render(<Spinner />)
|
|
14
|
+
expect(screen.getByRole("img").getAttribute("aria-label")).toBe("Loading")
|
|
15
|
+
expect(screen.getByRole("img", { name: "Loading" })).toBeTruthy()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it("leaves the accessibility tree when label is null", () => {
|
|
19
|
+
render(<Spinner label={null} testId="spinner" />)
|
|
20
|
+
const svg = screen.getByTestId("spinner")
|
|
21
|
+
expect(screen.queryByRole("img")).toBeNull()
|
|
22
|
+
expect(svg.getAttribute("aria-hidden")).toBe("true")
|
|
23
|
+
expect(svg.hasAttribute("role")).toBe(false)
|
|
24
|
+
expect(svg.querySelector("title")).toBeNull()
|
|
25
|
+
})
|
|
26
|
+
})
|
|
@@ -108,6 +108,10 @@ export const Spinner = ({
|
|
|
108
108
|
stroke="currentColor"
|
|
109
109
|
strokeLinecap="round"
|
|
110
110
|
strokeLinejoin="round"
|
|
111
|
+
// Named image by default; `label={null}` drops it from the a11y tree.
|
|
112
|
+
role={decorative ? undefined : "img"}
|
|
113
|
+
aria-label={decorative ? undefined : label}
|
|
114
|
+
aria-hidden={decorative ? true : undefined}
|
|
111
115
|
data-color={isPalette ? color : undefined}
|
|
112
116
|
className={cn(
|
|
113
117
|
spinnerVariants({ size }),
|
|
@@ -118,7 +122,6 @@ export const Spinner = ({
|
|
|
118
122
|
{...props({ "data-testid": testId })}
|
|
119
123
|
{...rest}
|
|
120
124
|
>
|
|
121
|
-
<title>Spinner</title>
|
|
122
125
|
{!decorative && <title>{label}</title>}
|
|
123
126
|
{withTrack && <circle cx="12" cy="12" r="10" strokeWidth={1} className="opacity-20" />}
|
|
124
127
|
<circle
|
|
@@ -73,6 +73,18 @@ describe("Switch", () => {
|
|
|
73
73
|
expect(Array.from(root.children).map((el) => el.tagName)).toEqual(["SPAN", "SPAN", "INPUT"])
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
+
// Neutral's solid is white in dark mode, the same white as the thumb, so a
|
|
77
|
+
// checked neutral switch would be white on white. It fills green instead.
|
|
78
|
+
it('fills green for `color="neutral"`', () => {
|
|
79
|
+
render(<Switch label="Airplane mode" color="neutral" testId="airplane-mode" />)
|
|
80
|
+
expect(screen.getByTestId("airplane-mode").getAttribute("data-color")).toBe("green")
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it("keeps every other color as given", () => {
|
|
84
|
+
render(<Switch label="Airplane mode" color="red" testId="airplane-mode" />)
|
|
85
|
+
expect(screen.getByTestId("airplane-mode").getAttribute("data-color")).toBe("red")
|
|
86
|
+
})
|
|
87
|
+
|
|
76
88
|
it("renders testId as data-testid on the root label, not the hidden input", () => {
|
|
77
89
|
render(<Switch label="Airplane mode" testId="airplane-mode" />)
|
|
78
90
|
const el = screen.getByTestId("airplane-mode")
|