@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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/timeline/timeline.tsx"],"names":["lineVariant"],"mappings":";;;;;;;;;AAwBA,IAAM,WAAA,GAAoC;AAAA,EACxC,EAAA,EAAI,UAAA;AAAA,EACJ,EAAA,EAAI,MAAA;AAAA,EACJ,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA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,CAAC,EAAE,SAAA,EAAW,OAAO,MAAA,EAAQ,GAAG,MAAK,qBACzD,GAAA;AAAA,EAAC,GAAA,CAAI,IAAA;AAAA,EAAJ;AAAA,IACC,WAAA,EAAU,OAAA;AAAA,IACV,YAAA,EAAY,KAAA;AAAA,IACZ,SAAA,EAAW,EAAA;AAAA,MACT,iGAAA;AAAA,MACA,QAAQ,iBAAA,GAAoB,6CAAA;AAAA,MAC5B;AAAA,KACF;AAAA,IACC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAOF,IAAM,kBAAkB,CAAC,EAAE,WAAW,MAAA,EAAQ,GAAG,MAAK,qBACpD,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IACC,WAAA,EAAU,SAAA;AAAA,IACV,SAAA,EAAW,EAAA,CAAG,aAAA,EAAe,SAAS,CAAA;AAAA,IACrC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAeF,IAAM,gBAAgB,CAAC,EAAE,WAAW,MAAA,EAAQ,GAAG,MAAK,qBAClD,GAAA;AAAA,EAAC,GAAA,CAAI,IAAA;AAAA,EAAJ;AAAA,IACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,IACtF,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAGK,IAAM,QAAA,GAAW,MAAA,CAAO,MAAA,CAAO,YAAA,EAAc;AAAA,EAClD,IAAA,EAAM,YAAA;AAAA,EACN,KAAA,EAAO,aAAA;AAAA,EACP,OAAA,EAAS,eAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAC","file":"index.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { CSSProperties, ReactElement, ReactNode } from \"react\"\nimport { Children, cloneElement, isValidElement } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport {\n buildGradientVars,\n GRADIENT_DIR_CLASS,\n type GradientDir,\n type GradientProps,\n} from \"../../lib/gradient\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Bullet diameter per `Size`, in the same steps Tailwind's `size-3.5..7`\n * utilities resolve to. Shared by the root's default (set as a CSS custom\n * property, see `timelineVariants`) and `Timeline.Item`'s own `size` override\n * (set as an inline style — see `TimelineItem`), so both ends of the default/\n * override split read from one source of truth.\n */\nconst BULLET_SIZE: Record<Size, string> = {\n xs: \"0.875rem\",\n sm: \"1rem\",\n md: \"1.25rem\",\n lg: \"1.5rem\",\n xl: \"1.75rem\",\n}\n\n/**\n * Three shared column tracks: an optional leading `label` (e.g. a date), the\n * fixed `axis` (bullet + connecting line), and the main `content`. Each\n * `Timeline.Item` re-declares these same tracks via `grid-cols-subgrid`, so\n * columns stay aligned across items even though any given item may only\n * populate one or two of the three.\n *\n * `label` and `axis` deliberately use `max-content` (not `auto`) as their max\n * sizing function: a track that no item populates collapses to exactly 0\n * instead of reserving dead space (the classic complaint with MUI's\n * `TimelineOppositeContent`, which reserves equal flex-basis whether or not\n * anything renders into it) — `max-content` sizes purely from the track's\n * actual content and never grows further. `auto` looks like the obvious\n * choice here but isn't: the grid track-sizing algorithm's \"maximize tracks\"\n * step expands *any* track whose max function is literally `auto` to absorb\n * leftover free space in the grid, even ones with zero content in every row —\n * that's the one column-sizing keyword this collapsing behavior can't use.\n * `content` gets the explicit `1fr` instead, so it's the one track that\n * intentionally absorbs whatever width `label`/`axis` don't need.\n *\n * `size` only ever touches dimensions (bullet size, line thickness, gaps,\n * spacing, text scale) via descendant selectors on stable `data-part` hooks —\n * never shape or color — so parts stay dumb and the whole tree stays a pure\n * Server Component, the same split `Table` uses for its `size` variant.\n *\n * The bullet's dimension is the one exception routed through a CSS custom\n * property (`--tl-bullet-size`, consumed by the bullet's own `size-(--tl-bullet-size)`\n * class, and by the line's `mt-(--tl-bullet-size)` — see `TimelineItem`)\n * rather than a plain `size-*` utility: a `Timeline.Item` can then override\n * just its own bullet (and keep the line in sync with it) via an inline\n * style on that same property, which always wins over the cascaded\n * class-based default regardless of selector specificity — a plain utility\n * class on the item couldn't reliably beat this descendant selector's own\n * specificity. It's declared on the root (not scoped to `[data-part=bullet]`)\n * so it cascades to the line too, not just the bullet that reads it first.\n * Each value below is a static literal (not built from `BULLET_SIZE` via\n * interpolation) because Tailwind's scanner needs the literal arbitrary-value\n * text in the source — an interpolated class name is invisible to it.\n */\nconst timelineVariants = cva(\n [\n \"m-0 grid list-none ps-0 grid-cols-[minmax(0,max-content)_max-content_minmax(0,1fr)]\",\n // The `default` bullet's own inverted fill (see `timelineBulletVariants`),\n // as a connector endpoint.\n \"[--tl-inverted:var(--color-gray-dark-900)] dark:[--tl-inverted:var(--color-gray-light-50)]\",\n // The palette an uncolored bullet draws in (the root's neutral, unless a\n // `data-color` ancestor says otherwise), captured here once. An uncolored\n // line end reads these instead of a bare `--c-*`: its inner span sits\n // inside the outer span's `data-color`, where a bare slot would resolve to\n // the *previous* item's palette, not the ambient one its bullet uses.\n \"[--tl-ambient-solid:var(--c-solid)]\",\n // Dash pattern for `lineVariant=\"dashed\"`, applied as a mask over the\n // line's gradient fill — `border-style: dashed` can't carry a gradient\n // (`border-image` paints over the dashes solid). Dash and gap scale with\n // the line's own thickness.\n \"[--tl-dashes:repeating-linear-gradient(to_bottom,#000_0_calc(var(--tl-line-width)*3),transparent_0_calc(var(--tl-line-width)*6))]\",\n ],\n {\n variants: {\n size: {\n xs: [\n \"gap-x-2 text-xs [--tl-bullet-size:0.875rem]\",\n \"[--tl-line-width:1px]\",\n \"**:data-[part=content]:pb-3\",\n ],\n sm: [\n \"gap-x-2.5 text-sm [--tl-bullet-size:1rem]\",\n \"[--tl-line-width:1px]\",\n \"**:data-[part=content]:pb-4\",\n ],\n md: [\n \"gap-x-3 text-sm [--tl-bullet-size:1.25rem]\",\n \"[--tl-line-width:2px]\",\n \"**:data-[part=content]:pb-5\",\n ],\n lg: [\n \"gap-x-3.5 text-base [--tl-bullet-size:1.5rem]\",\n \"[--tl-line-width:2px]\",\n \"**:data-[part=content]:pb-6\",\n ],\n xl: [\n \"gap-x-4 text-base [--tl-bullet-size:1.75rem]\",\n \"[--tl-line-width:4px]\",\n \"**:data-[part=content]:pb-7\",\n ],\n },\n // Sets the default via the same CSS-custom-property indirection as\n // `--tl-bullet-size` (the line reads it as `[mask-image:var(--tl-line-mask)]`,\n // see `TimelineItem`) — a `Timeline.Item` overrides just its own\n // segment with an inline style on that property (`LINE_MASK`), which\n // beats this inherited default. Kept in sync with `LINE_MASK` by hand:\n // Tailwind's scanner needs these literals.\n lineVariant: {\n solid: \"[--tl-line-mask:none]\",\n dashed: \"[--tl-line-mask:var(--tl-dashes)]\",\n },\n },\n defaultVariants: { size: \"md\", lineVariant: \"solid\" },\n },\n)\n\n/** Shape × color for the bullet — a small circle in the item's own\n * `data-color`. Mirrors Badge's (variant × color) axis (plus the same\n * `gradient` treatment) so a status dot reads consistently with the rest of\n * the kit. Dimensions are deliberately absent here (see `timelineVariants`)\n * so the same classes work at every `size`.\n *\n * `default` — the component's own default — mirrors Button's inverted\n * black/white treatment (dark surface in light mode, light surface in dark\n * mode), not a plain gray dot, so an untouched `<Timeline.Item>` reads as a\n * neutral, high-contrast marker rather than a colored status.\n *\n * `filled` and `default` ring their own fill with an *inset* box-shadow\n * ring-then-gap (`ring-inset` + `ring-offset`, page-background colored), not\n * plain outset `ring`/`ring-offset` — those grow the dot past\n * `--tl-bullet-size` and make it the one variant whose total footprint\n * doesn't match its same-`size` siblings. Inset shadows stay fully inside\n * the box no matter the color, so every variant — flat border or ringed\n * fill — renders at exactly the same diameter.\n *\n * That ring is for the *plain dot* reading, though — once a `bullet` icon\n * sits on top of it, a ring around a small icon reads as a stray outline\n * rather than a marker, so `TimelineItem` passes `ringed: !bullet` and the\n * `compoundVariants` below drop the ring/gap for a flat, fully filled disc\n * whenever there's icon content to frame. */\nconst timelineBulletVariants = cva([\"rounded-full shrink-0\"], {\n variants: {\n variant: {\n // `dark:[&_svg]:text-white` overrides the slot-var/theme text color for\n // just the icon, on the three variants whose dark-mode surface is a\n // saturated or dark fill — `default`/`gradient` invert to a *light*\n // dark-mode surface instead, so forcing white there would hide the icon.\n filled: \"bg-(--c-solid) text-(--c-on-solid) dark:[&_svg]:text-white\",\n outline: \"border-(--c-solid) border dark:[&_svg]:text-white\",\n dashed: \"border-dashed border-(--c-solid) border dark:[&_svg]:text-white\",\n default:\n \"dark:bg-gray-light-50 dark:text-gray-light-900 bg-gray-dark-900 text-gray-dark-25 border\",\n // from-*/to-* are the CSS defaults for --tw-gradient-from/to — see Badge.\n gradient: [\n \"bg-linear-to-r from-purple-300 to-pink-400 text-black\",\n \"relative\",\n \"before:absolute before:inset-px before:border-2 dark:before:border-gray-dark-900 before:border-gray-light-50 before:rounded-full\",\n ],\n },\n /** Internal only — never exposed on `TimelineItemProps` (see `Omit` on\n * its type). Derived from whether the item has a custom `bullet`. */\n ringed: { true: \"\", false: \"\" },\n /** Internal only, like `ringed`. The item's progress state, resolved by\n * `TimelineRoot` from `active` (see `stateAt`). `pending` points this\n * bullet's palette slots at their `-disabled` counterparts (shared by\n * every palette, see `colors.css`), so each variant dims by its own rules\n * — an `outline` ring, a `filled` fill and ring all switch together.\n * `default` and `gradient` read fixed tokens instead of slots, so they get\n * their own compounds below. */\n state: {\n none: \"\",\n complete: \"\",\n active: \"\",\n pending: \"[--c-solid:var(--c-solid-disabled)] [--c-on-solid:var(--c-on-solid-disabled)]\",\n },\n },\n compoundVariants: [\n {\n variant: \"filled\",\n ringed: true,\n class:\n \"border ring-2 ring-offset-2 dark:ring-offset-gray-dark-900 ring-(--c-solid) ring-inset\",\n },\n {\n variant: \"default\",\n ringed: true,\n class:\n \"ring-2 ring-offset-2 dark:ring-offset-gray-dark-900 ring-gray-light-950 dark:ring-gray-light-50 ring-inset\",\n },\n // An upcoming `default` step: just the outer ring, no center, in the\n // disabled color — `TimelineItem` also turns `ringed` off for it, which\n // drops the inset gap/center shadows. Listed after the base so `cn`'s\n // twMerge lets these colors win over both the base and `dark:` ones.\n {\n variant: \"default\",\n state: \"pending\",\n class: [\n \"bg-transparent dark:bg-transparent\",\n \"border-(--c-solid-disabled) dark:border-(--c-solid-disabled)\",\n \"text-(--c-text-disabled) dark:text-(--c-text-disabled)\",\n ],\n },\n // An upcoming gradient step: its fixed stops can't follow the slot\n // remap, so it flattens to the disabled fill. `TimelineItem` skips the\n // direction class and the custom stops for it.\n {\n variant: \"gradient\",\n state: \"pending\",\n class: \"bg-none bg-(--c-solid-disabled) text-(--c-on-solid-disabled)\",\n },\n ],\n defaultVariants: { variant: \"default\", ringed: true, state: \"none\" },\n})\n\n/** Inline override values for `--tl-line-mask` — see `timelineVariants`' `lineVariant`. */\nconst LINE_MASK: Record<TimelineLineVariant, string> = {\n solid: \"none\",\n dashed: \"var(--tl-dashes)\",\n}\n\n/** Gradient stops a `variant=\"gradient\"` item falls back to — the same\n * purple-300 → pink-400 Badge/Card use, spelled out as values (not left to\n * the bullet's `from-*`/`to-*` classes) so the line, which has no such class,\n * reads the same stops. */\nconst GRADIENT_DEFAULTS = {\n fromDefault: \"var(--color-purple-300)\",\n toDefault: \"var(--color-pink-400)\",\n}\n\n/**\n * One end of a connector: the color it shows there, plus the `data-color`\n * palette that color has to be resolved under (`--c-*` slots differ between\n * light and dark themes, so a palette color can't be written down as a plain\n * value — it only means something on an element carrying that palette).\n *\n * A connector enters an item in its *entry* color and leaves it in its *exit*\n * color. They're the same for every flat variant; a `gradient` item enters at\n * its `from` stop and leaves at its `to`, so the line reads as running through\n * the bullet's own fade.\n *\n * The remaining variants (`filled`, `outline`, `dashed`) all draw in\n * `--c-solid`. A colored end reads it under its own `data-color`. Without a\n * `color`, the bullet draws in the ambient palette, so its end reads the\n * root's `--tl-ambient-solid` copy instead — the inner span sits inside the\n * outer span's `data-color`, where a bare `--c-solid` would resolve to the\n * previous item's palette.\n *\n * A `default` item ends in its bullet's own fill (`--tl-inverted`),\n * palette-independent like the bullet, so `color` is ignored. Every pending\n * item ends in `--c-solid-disabled`, the color all pending bullets share: the\n * remapped `--c-solid`, a pending `default`'s ring, a flattened gradient.\n */\nfunction lineEnd(\n { color, variant: v, gradient, state }: TimelineNeighbour,\n end: \"entry\" | \"exit\",\n): LineEnd {\n // `??`, not a destructuring default: cva variant props also accept `null`.\n const variant = v ?? \"default\"\n if (state === \"pending\") return { value: \"var(--c-solid-disabled)\" }\n if (variant === \"gradient\") {\n return {\n value:\n end === \"entry\"\n ? (gradient?.from ?? GRADIENT_DEFAULTS.fromDefault)\n : (gradient?.to ?? GRADIENT_DEFAULTS.toDefault),\n }\n }\n if (variant === \"default\") return { value: \"var(--tl-inverted)\" }\n return color\n ? { dataColor: color, value: \"var(--c-solid)\" }\n : { value: \"var(--tl-ambient-solid)\" }\n}\n\ntype LineEnd = { dataColor?: Color; value: string }\n\n/** An item's place relative to the active step — `none` when no step is\n * active anywhere. Exposed as `data-state` on the item. */\ntype TimelineItemState = \"none\" | \"complete\" | \"active\" | \"pending\"\n\n/**\n * Each child's progress state. The active step is the first `Timeline.Item`\n * passing `active` — that overrides the root's `active` index — otherwise\n * the root's index, counted over `Timeline.Item`s only (other children are\n * skipped, and get `none`). Steps before it are `complete`, after it\n * `pending`; an index past the end leaves every step `complete`, a negative\n * one every step `pending`. With neither set, every item is `none`.\n */\nfunction stateAt(items: ReactNode[], active: number | undefined): TimelineItemState[] {\n const marked = items.filter(isTimelineItem).findIndex((item) => item.props.active === true)\n const current = marked !== -1 ? marked : active\n // Each child's position among the `Timeline.Item`s only.\n const steps = items.map((_, i) => items.slice(0, i).filter(isTimelineItem).length)\n return items.map((node, i): TimelineItemState => {\n const step = steps[i] ?? 0\n if (!isTimelineItem(node) || current === undefined) return \"none\"\n if (step < current) return \"complete\"\n return step === current ? \"active\" : \"pending\"\n })\n}\n\n/** `Timeline`'s density scale — the kit's canonical `Size` (xs–xl). */\nexport type TimelineSize = Size\nexport type TimelineLineVariant = NonNullable<VariantProps<typeof timelineVariants>[\"lineVariant\"]>\nexport type TimelineBulletVariant = NonNullable<\n VariantProps<typeof timelineBulletVariants>[\"variant\"]\n>\n\nexport type { GradientDir, GradientProps }\n\nexport type TimelineProps = HTMLArkProps<\"ol\"> &\n VariantProps<typeof timelineVariants> &\n WithTestId & {\n /**\n * Index of the current step among the `Timeline.Item` children (other\n * children aren't counted). Steps before it render as complete, steps\n * after it as pending — dimmed, and a `default` dot reduced to its outer\n * ring. A `Timeline.Item` passing its own `active` overrides this. Leave\n * both unset for a plain event list with no progress.\n */\n active?: number\n }\n\n/**\n * Timeline — a vertical, chronological list of events (activity feed, audit\n * log, changelog). Pure React Server Component: no state, no `\"use client\"`.\n *\n * Composed from `Timeline.Item` (one per event, owns the bullet + connecting\n * line), with two optional children per item: `Timeline.Label` (a leading\n * date/timestamp) and `Timeline.Content` (the body, holding an optional\n * `Timeline.Title`). Every item shares the same three column tracks, so\n * bullets stay aligned down a single axis regardless of which items use a\n * label — and the label column disappears entirely if no item uses it.\n *\n * <Timeline>\n * <Timeline.Item color=\"green\">\n * <Timeline.Label>Mar 1, 2026</Timeline.Label>\n * <Timeline.Content>\n * <Timeline.Title>Order placed</Timeline.Title>\n * </Timeline.Content>\n * </Timeline.Item>\n * <Timeline.Item variant=\"outline\">\n * <Timeline.Content>\n * <Timeline.Title>Delivered</Timeline.Title>\n * </Timeline.Content>\n * </Timeline.Item>\n * </Timeline>\n *\n * There is no `variant`×`color` axis on the root — those live per `Timeline.Item`,\n * since each event typically carries its own status. `size` and `lineVariant`\n * set the shared defaults for every item's bullet size and connecting line.\n *\n * Direct children should be `Timeline.Item` elements (as in the example\n * above, or a flat `.map()` over an array of them) — `TimelineRoot` reads\n * each item's `color`/`variant`/`gradient`/`lineVariant` off its immediate\n * siblings and hands them to it as `prevItem`/`nextItem`, so every connector\n * can blend from one item's color into the next one's (see `lineEnd`,\n * `TimelineItem`). A child that isn't a recognized `Timeline.Item` breaks\n * that chain at that point and never crashes: the connector leading into it\n * stays flat in its own item's color, as if it were the last one.\n */\nfunction isTimelineItem(node: ReactNode): node is ReactElement<TimelineItemInternalProps> {\n return isValidElement(node) && node.type === TimelineItem\n}\n\nconst TimelineRoot = ({\n className,\n size,\n lineVariant,\n active,\n children,\n testId,\n ...rest\n}: TimelineProps) => {\n const items = Children.toArray(children)\n // `asChild` morphs the root into a single element the caller passed as its\n // one child (see Ark's `withAsChild`) — it requires that child to still be\n // a bare, single valid element, not array-wrapped, so skip the transform\n // entirely rather than hand it something `Children.toArray` reshaped.\n // `Timeline.Item`s nested a level deeper inside that child are outside what\n // this prop-threading reaches anyway, same as the constraint documented\n // above.\n const states = stateAt(items, active)\n const neighbour = (i: number): TimelineNeighbour | undefined => {\n const node = items[i]\n if (!isTimelineItem(node)) return undefined\n const { color, variant, gradient, lineVariant } = node.props\n return { color, variant, gradient, lineVariant, state: states[i] }\n }\n const withNeighbours = rest.asChild\n ? children\n : items.map((child, i) =>\n isTimelineItem(child)\n ? cloneElement(child, {\n prevItem: neighbour(i - 1),\n nextItem: neighbour(i + 1),\n state: states[i],\n } satisfies Partial<TimelineItemInternalProps>)\n : child,\n )\n return (\n <ark.ol\n className={cn(timelineVariants({ size, lineVariant }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {withNeighbours}\n </ark.ol>\n )\n}\n\nexport type TimelineItemProps = Omit<HTMLArkProps<\"li\">, \"color\"> &\n Omit<VariantProps<typeof timelineBulletVariants>, \"ringed\" | \"state\"> &\n WithTestId & {\n /** Accent palette for the bullet. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /** Overrides the default dot with any node — an icon, `<Avatar>`, or a\n * `<Spinner>` for an in-progress item. */\n bullet?: ReactNode\n /** Overrides just this item's bullet diameter; defaults to `Timeline`'s\n * own `size`. Doesn't affect line thickness or spacing — only the dot. */\n size?: Size\n /** Overrides `Timeline`'s connecting-line style for just the segment\n * below this item. */\n lineVariant?: TimelineLineVariant\n /**\n * Gradient config. Only applied when `variant=\"gradient\"`.\n * Mirrors Badge's gradient prop — unset fields fall back to the CVA\n * defaults (purple-300 → pink-400, to-r).\n */\n gradient?: GradientProps\n /**\n * Nudges the bullet+line column down (a CSS length, e.g. `\"11px\"`) to\n * line the bullet up with something inside a custom `Timeline.Content` —\n * a card's title, say — that Timeline has no visibility into on its own.\n * Applied as a shared CSS custom property, not a plain padding class on\n * the bullet alone, because the connecting line is a separate sibling\n * element that also needs to shift down by the same amount to keep\n * meeting the bullet's (now lower) edge — see `TimelineItem`.\n */\n axisOffset?: string\n /**\n * Marks this item as the current step, overriding `Timeline`'s `active`\n * index — handy when mapping over data that already knows which entry is\n * current. If several items pass it, the first one wins; `false` is the\n * same as leaving it unset.\n */\n active?: boolean\n }\n\n/** See `TimelineRoot`'s `prevItem`/`nextItem` threading. */\ntype TimelineNeighbour = Pick<\n TimelineItemProps,\n \"color\" | \"variant\" | \"gradient\" | \"lineVariant\"\n> & { state?: TimelineItemState }\n\n/**\n * `prevItem`/`nextItem`/`state` are internal-only — injected by `TimelineRoot`, never\n * meant to be passed directly by a consumer — so they're kept off the\n * exported/documented `TimelineItemProps` (the same internal/public split\n * `ringed` already uses on `timelineBulletVariants`, just at the plain-prop\n * level here instead of the cva-variant level).\n */\ntype TimelineItemInternalProps = TimelineItemProps & {\n prevItem?: TimelineNeighbour\n nextItem?: TimelineNeighbour\n state?: TimelineItemState\n}\n\n/**\n * One event: a bullet + connecting line (generated automatically — no manual\n * separator/connector wiring), and up to two children, `Timeline.Label` and\n * `Timeline.Content`, which place themselves into the shared column tracks.\n * The line to the next item is suppressed automatically on the last item.\n */\nconst TimelineItem = ({\n className,\n color,\n variant,\n bullet,\n size,\n lineVariant,\n gradient,\n axisOffset,\n style,\n children,\n prevItem,\n nextItem,\n state = \"none\",\n // Read by `TimelineRoot` (see `stateAt`); kept off the `<li>`.\n active: _active,\n testId,\n asChild,\n ...rest\n}: TimelineItemInternalProps) => {\n const isGradient = variant === \"gradient\"\n const pending = state === \"pending\"\n // Only for the bullet's own style — the line reads its endpoints through\n // `lineEnd` instead. A pending gradient flattens, so it gets none.\n const gradientVars =\n isGradient && !pending ? buildGradientVars(gradient, GRADIENT_DEFAULTS) : undefined\n // `entry` also colors the axisOffset stub: it sits right where the previous\n // connector arrives, which is in this item's own entry color.\n const entry = lineEnd({ color, variant, gradient, state }, \"entry\")\n const exit = lineEnd({ color, variant, gradient, state }, \"exit\")\n // No recognized next item (the last item, or a stray non-item child next):\n // the connector has nothing to blend into, so it stays flat in its own exit.\n const target = nextItem ? lineEnd(nextItem, \"entry\") : exit\n const ownMask = lineVariant && { \"--tl-line-mask\": LINE_MASK[lineVariant] }\n const leadingMask = prevItem?.lineVariant && {\n \"--tl-line-mask\": LINE_MASK[prevItem.lineVariant],\n }\n\n return (\n <ark.li\n asChild={asChild}\n style={\n {\n ...(size ? { \"--tl-bullet-size\": BULLET_SIZE[size] } : undefined),\n ...(axisOffset ? { \"--tl-axis-offset\": axisOffset } : undefined),\n ...style,\n } as CSSProperties\n }\n className={cn(\n \"col-span-3 grid grid-cols-subgrid\",\n \"[&:first-child_[data-part=line][data-edge=start]]:hidden\",\n \"[&:last-child_[data-part=line][data-edge=end]]:hidden\",\n className,\n )}\n {...props({\n \"data-testid\": testId,\n \"data-state\": state !== \"none\" && state,\n \"aria-current\": state === \"active\" && \"step\",\n })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {/* Two line segments share `data-part=\"line\"` (so the first/last-item\n suppression selectors above match both) but differ in `data-edge`\n for layout and visibility. Both are a `--tl-line-width`-wide\n background bar rather than a border, so a gradient fill and the\n `--tl-line-mask` dash pattern can be combined.\n\n `data-edge=\"start\"` (leading) fills the gap `axisOffset` opens\n *above* this item's own (shifted-down) bullet — a plain height of\n `--tl-axis-offset` (0, i.e. invisible, when `axisOffset` isn't\n set), `self-start` so it sits flush at the row's own top edge.\n Hidden on the first item: nothing renders above the very first\n bullet to connect to. It's flat in this item's own entry color:\n the previous item's trailing segment has already blended into\n exactly that color by the time it reaches this row's top edge, so\n the two meet with no seam. Only its dash pattern comes from the\n previous item (`prevItem.lineVariant`), since it continues that\n item's segment.\n\n `data-edge=\"end\"` (trailing) is the connector to the next item: a\n grid item in the same cell as the bullet (col/row-start-2/1,\n default align-self:stretch fills the row's real height), whose\n margin-top pushes its own box down by exactly the bullet's\n diameter plus `--tl-axis-offset` — so it stops right at the\n bullet's edge instead of running behind it, and the hollow\n variants can stay genuinely transparent. Hidden on the last item.\n\n It blends from this item's exit color to the next item's entry\n color. Those are usually two *different* palettes, and a `--c-*`\n slot only resolves against the `data-color` of the element it's\n read on, so it takes two elements: the outer span carries this\n item's palette and declares `--tl-from`, the inner one carries the\n next item's and declares `--tl-to`. A custom property inherits its\n *computed* value — the `var(--c-solid)` in `--tl-from` is already\n substituted with this item's color by the time the inner span reads\n it — so the inner span sees both colors at once. The outer span stays\n the direct grid item (stretching through a nested element is\n unreliable); the inner one just fills it with `absolute inset-0`.\n\n `--tl-bullet-size`/`--tl-axis-offset` are declared on the `<li>`\n (see `timelineVariants` / this component's own `style`), not\n scoped to the bullet, so these siblings can read the same values\n as the axis div below — siblings can only stay in sync through a\n shared var. */}\n <span\n data-part=\"line\"\n data-edge=\"start\"\n data-color={entry.dataColor}\n style={{ \"--tl-from\": entry.value, ...leadingMask } as CSSProperties}\n className={cn(\n \"col-start-2 row-start-1 self-start justify-self-center w-(--tl-line-width)\",\n \"h-(--tl-axis-offset,0px) bg-(--tl-from) [mask-image:var(--tl-line-mask)]\",\n )}\n />\n <span\n data-part=\"line\"\n data-edge=\"end\"\n data-color={exit.dataColor}\n style={{ \"--tl-from\": exit.value, ...ownMask } as CSSProperties}\n className={cn(\n \"relative col-start-2 row-start-1 justify-self-center w-(--tl-line-width)\",\n \"mt-[calc(var(--tl-bullet-size)+var(--tl-axis-offset,0px))]\",\n \"[mask-image:var(--tl-line-mask)]\",\n )}\n >\n <span\n data-color={target.dataColor}\n style={{ \"--tl-to\": target.value } as CSSProperties}\n className=\"absolute inset-0 [background-image:linear-gradient(to_bottom_in_oklab,var(--tl-from),var(--tl-to))]\"\n />\n </span>\n <div\n data-part=\"axis\"\n className=\"col-start-2 row-start-1 flex justify-center self-start pt-(--tl-axis-offset)\"\n >\n <span\n data-part=\"bullet\"\n // A pending bullet drops its palette: `[data-color]` and the\n // `pending` slot remap would both set `--c-*` on this one element,\n // leaving the winner to stylesheet order. The disabled slots it\n // remaps to are shared by every palette anyway.\n data-color={!isGradient && !pending ? color : undefined}\n style={gradientVars as CSSProperties}\n className={cn(\n timelineBulletVariants({\n variant,\n // A pending `default` step is a bare outer ring: no inset gap\n // and center to draw.\n ringed: !bullet && !(pending && (variant ?? \"default\") === \"default\"),\n state,\n }),\n \"size-(--tl-bullet-size) grid place-items-center overflow-hidden\",\n \"[&_svg]:size-full [&_svg]:p-0.5\",\n isGradient && !pending && gradient?.dir && GRADIENT_DIR_CLASS[gradient.dir],\n )}\n >\n {bullet}\n </span>\n </div>\n {own}\n </>\n ))}\n </ark.li>\n )\n}\n\nexport type TimelineLabelProps = Omit<HTMLArkProps<\"span\">, \"color\"> &\n WithTestId & {\n /** Tints the label (and any icon inside it) to match the item's accent —\n * pass the same value given to the `Timeline.Item`'s `color`. Omit it to\n * keep the neutral muted default. */\n color?: Color\n }\n\n/**\n * The leading zone (typically a date/timestamp), aligned to the bullet. Lays\n * out its children in a row (`inline-flex items-center gap-1.5`) so an icon\n * before the text — e.g. `<Timeline.Label><CalendarIcon />Mar 1, 2026</Timeline.Label>` —\n * sits inline without extra markup; stack a date over a time by nesting a\n * `flex flex-col` wrapper around the text yourself.\n */\nconst TimelineLabel = ({ className, color, testId, ...rest }: TimelineLabelProps) => (\n <ark.span\n data-part=\"label\"\n data-color={color}\n className={cn(\n \"col-start-1 inline-flex items-center gap-1.5 self-start pt-px [&_svg]:size-3.5 [&_svg]:shrink-0\",\n color ? \"text-(--c-text)\" : \"text-gray-light-500 dark:text-gray-dark-400\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type TimelineContentProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** The main body zone for an item — holds an optional `Timeline.Title` and\n * any free-form description content. */\nconst TimelineContent = ({ className, testId, ...rest }: TimelineContentProps) => (\n <ark.div\n data-part=\"content\"\n className={cn(\"col-start-3\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type TimelineTitleProps = HTMLArkProps<\"span\"> & WithTestId\n\n/** A bold lead-in line for `Timeline.Content`. Deliberately a `<span>`, styled\n * `block` to sit on its own line, not a heading (a timeline can hold many\n * items, and one `<h3>` per item would spam heading landmarks — unlike\n * `Table.Title`, which labels the table once) and not a `<p>` either. A\n * `<div>` doesn't fix that second problem: `<p>`'s content model is phrasing\n * content only, so a `<div>` inside one is exactly as invalid as a nested\n * `<p>` — the tag has to be phrasing content itself for a consumer to safely\n * wrap `Timeline.Title` in their own paragraph (e.g. `<Text>`) without\n * triggering React's \"cannot be a descendant of `<p>`\" DOM-nesting warning;\n * `block` gets the same visual line without changing that category. */\nconst TimelineTitle = ({ className, testId, ...rest }: TimelineTitleProps) => (\n <ark.span\n className={cn(\"block font-medium text-gray-light-900 dark:text-gray-dark-25\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Timeline = Object.assign(TimelineRoot, {\n Item: TimelineItem,\n Label: TimelineLabel,\n Content: TimelineContent,\n Title: TimelineTitle,\n})\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/timeline/timeline.tsx"],"names":["lineVariant"],"mappings":";;;;;;;;;AAwBA,IAAM,WAAA,GAAoC;AAAA,EACxC,EAAA,EAAI,UAAA;AAAA,EACJ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js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { CSSProperties, ReactElement, ReactNode } from \"react\"\nimport { Children, cloneElement, isValidElement } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport {\n buildGradientVars,\n GRADIENT_DIR_CLASS,\n type GradientDir,\n type GradientProps,\n} from \"../../lib/gradient\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Bullet diameter per `Size`, in the same steps Tailwind's `size-3.5..7`\n * utilities resolve to. Shared by the root's default (set as a CSS custom\n * property, see `timelineVariants`) and `Timeline.Item`'s own `size` override\n * (set as an inline style — see `TimelineItem`), so both ends of the default/\n * override split read from one source of truth.\n */\nconst BULLET_SIZE: Record<Size, string> = {\n xs: \"0.875rem\",\n sm: \"1rem\",\n md: \"1.25rem\",\n lg: \"1.5rem\",\n xl: \"1.75rem\",\n}\n\n/**\n * Three shared column tracks: an optional leading `label` (e.g. a date), the\n * fixed `axis` (bullet + connecting line), and the main `content`. Each\n * `Timeline.Item` re-declares these same tracks via `grid-cols-subgrid`, so\n * columns stay aligned across items even though any given item may only\n * populate one or two of the three.\n *\n * `label` and `axis` deliberately use `max-content` (not `auto`) as their max\n * sizing function: a track that no item populates collapses to exactly 0\n * instead of reserving dead space (the classic complaint with MUI's\n * `TimelineOppositeContent`, which reserves equal flex-basis whether or not\n * anything renders into it) — `max-content` sizes purely from the track's\n * actual content and never grows further. `auto` looks like the obvious\n * choice here but isn't: the grid track-sizing algorithm's \"maximize tracks\"\n * step expands *any* track whose max function is literally `auto` to absorb\n * leftover free space in the grid, even ones with zero content in every row —\n * that's the one column-sizing keyword this collapsing behavior can't use.\n * `content` gets the explicit `1fr` instead, so it's the one track that\n * intentionally absorbs whatever width `label`/`axis` don't need.\n *\n * `size` only ever touches dimensions (bullet size, line thickness, gaps,\n * spacing, text scale) via descendant selectors on stable `data-part` hooks —\n * never shape or color — so parts stay dumb and the whole tree stays a pure\n * Server Component, the same split `Table` uses for its `size` variant.\n *\n * The bullet's dimension is the one exception routed through a CSS custom\n * property (`--tl-bullet-size`, consumed by the bullet's own `size-(--tl-bullet-size)`\n * class, and by the line's `mt-(--tl-bullet-size)` — see `TimelineItem`)\n * rather than a plain `size-*` utility: a `Timeline.Item` can then override\n * just its own bullet (and keep the line in sync with it) via an inline\n * style on that same property, which always wins over the cascaded\n * class-based default regardless of selector specificity — a plain utility\n * class on the item couldn't reliably beat this descendant selector's own\n * specificity. It's declared on the root (not scoped to `[data-part=bullet]`)\n * so it cascades to the line too, not just the bullet that reads it first.\n * Each value below is a static literal (not built from `BULLET_SIZE` via\n * interpolation) because Tailwind's scanner needs the literal arbitrary-value\n * text in the source — an interpolated class name is invisible to it.\n */\nconst timelineVariants = cva(\n [\n \"m-0 grid list-none ps-0 grid-cols-[minmax(0,max-content)_max-content_minmax(0,1fr)]\",\n // The `default` bullet's own inverted fill (see `timelineBulletVariants`),\n // as a connector endpoint.\n \"[--tl-inverted:var(--color-gray-dark-900)] dark:[--tl-inverted:var(--color-gray-light-50)]\",\n // The palette an uncolored bullet draws in (the root's neutral, unless a\n // `data-color` ancestor says otherwise), captured here once. An uncolored\n // line end reads these instead of a bare `--c-*`: its inner span sits\n // inside the outer span's `data-color`, where a bare slot would resolve to\n // the *previous* item's palette, not the ambient one its bullet uses.\n \"[--tl-ambient-solid:var(--c-solid)]\",\n // Dash pattern for `lineVariant=\"dashed\"`, applied as a mask over the\n // line's gradient fill — `border-style: dashed` can't carry a gradient\n // (`border-image` paints over the dashes solid). Dash and gap scale with\n // the line's own thickness.\n \"[--tl-dashes:repeating-linear-gradient(to_bottom,#000_0_calc(var(--tl-line-width)*3),transparent_0_calc(var(--tl-line-width)*6))]\",\n ],\n {\n variants: {\n size: {\n xs: [\n \"gap-x-2 text-xs [--tl-bullet-size:0.875rem]\",\n \"[--tl-line-width:1px]\",\n \"**:data-[part=content]:pb-3\",\n ],\n sm: [\n \"gap-x-2.5 text-sm [--tl-bullet-size:1rem]\",\n \"[--tl-line-width:1px]\",\n \"**:data-[part=content]:pb-4\",\n ],\n md: [\n \"gap-x-3 text-sm [--tl-bullet-size:1.25rem]\",\n \"[--tl-line-width:2px]\",\n \"**:data-[part=content]:pb-5\",\n ],\n lg: [\n \"gap-x-3.5 text-base [--tl-bullet-size:1.5rem]\",\n \"[--tl-line-width:2px]\",\n \"**:data-[part=content]:pb-6\",\n ],\n xl: [\n \"gap-x-4 text-base [--tl-bullet-size:1.75rem]\",\n \"[--tl-line-width:4px]\",\n \"**:data-[part=content]:pb-7\",\n ],\n },\n // Sets the default via the same CSS-custom-property indirection as\n // `--tl-bullet-size` (the line reads it as `[mask-image:var(--tl-line-mask)]`,\n // see `TimelineItem`) — a `Timeline.Item` overrides just its own\n // segment with an inline style on that property (`LINE_MASK`), which\n // beats this inherited default. Kept in sync with `LINE_MASK` by hand:\n // Tailwind's scanner needs these literals.\n lineVariant: {\n solid: \"[--tl-line-mask:none]\",\n dashed: \"[--tl-line-mask:var(--tl-dashes)]\",\n },\n },\n defaultVariants: { size: \"md\", lineVariant: \"solid\" },\n },\n)\n\n/** Shape × color for the bullet — a small circle in the item's own\n * `data-color`. Mirrors Badge's (variant × color) axis (plus the same\n * `gradient` treatment) so a status dot reads consistently with the rest of\n * the kit. Dimensions are deliberately absent here (see `timelineVariants`)\n * so the same classes work at every `size`.\n *\n * `default` — the component's own default — mirrors Button's inverted\n * black/white treatment (dark surface in light mode, light surface in dark\n * mode), not a plain gray dot, so an untouched `<Timeline.Item>` reads as a\n * neutral, high-contrast marker rather than a colored status.\n *\n * `filled` and `default` ring their own fill with an *inset* box-shadow\n * ring-then-gap (`ring-inset` + `ring-offset`, page-background colored), not\n * plain outset `ring`/`ring-offset` — those grow the dot past\n * `--tl-bullet-size` and make it the one variant whose total footprint\n * doesn't match its same-`size` siblings. Inset shadows stay fully inside\n * the box no matter the color, so every variant — flat border or ringed\n * fill — renders at exactly the same diameter.\n *\n * That ring is for the *plain dot* reading, though — once a `bullet` icon\n * sits on top of it, a ring around a small icon reads as a stray outline\n * rather than a marker, so `TimelineItem` passes `ringed: !bullet` and the\n * `compoundVariants` below drop the ring/gap for a flat, fully filled disc\n * whenever there's icon content to frame. */\nconst timelineBulletVariants = cva([\"rounded-full shrink-0\"], {\n variants: {\n variant: {\n // `dark:[&_svg]:text-white` overrides the slot-var/theme text color for\n // just the icon, on the three variants whose dark-mode surface is a\n // saturated or dark fill — `default`/`gradient` invert to a *light*\n // dark-mode surface instead, so forcing white there would hide the icon.\n filled: \"bg-(--c-solid) text-(--c-on-solid) dark:[&_svg]:text-white\",\n outline: \"border-(--c-solid) border dark:[&_svg]:text-white\",\n dashed: \"border-dashed border-(--c-solid) border dark:[&_svg]:text-white\",\n default:\n \"dark:bg-gray-light-50 dark:text-gray-light-900 bg-gray-dark-900 text-gray-dark-25 border\",\n // from-*/to-* are the CSS defaults for --tw-gradient-from/to — see Badge.\n // The inner cut-out ring (and the ring offsets in the compounds below)\n // paint the page background, `brand-50` / `brand-950`, so the gap reads\n // as a hole through to the page rather than a gray outline.\n gradient: [\n \"bg-linear-to-r from-purple-300 to-pink-400 text-black\",\n \"relative\",\n \"before:absolute before:inset-px before:border-2 before:border-brand-50 dark:before:border-brand-950 before:rounded-full\",\n ],\n },\n /** Internal only — never exposed on `TimelineItemProps` (see `Omit` on\n * its type). Derived from whether the item has a custom `bullet`. */\n ringed: { true: \"\", false: \"\" },\n /** Internal only, like `ringed`. The item's progress state, resolved by\n * `TimelineRoot` from `active` (see `stateAt`). `pending` points this\n * bullet's palette slots at their `-disabled` counterparts (shared by\n * every palette, see `colors.css`), so each variant dims by its own rules\n * — an `outline` ring, a `filled` fill and ring all switch together.\n * `default` and `gradient` read fixed tokens instead of slots, so they get\n * their own compounds below. */\n state: {\n none: \"\",\n complete: \"\",\n active: \"\",\n pending: \"[--c-solid:var(--c-solid-disabled)] [--c-on-solid:var(--c-on-solid-disabled)]\",\n },\n },\n compoundVariants: [\n {\n variant: \"filled\",\n ringed: true,\n class:\n \"border ring-2 ring-offset-2 ring-offset-brand-50 dark:ring-offset-brand-950 ring-(--c-solid) ring-inset\",\n },\n {\n variant: \"default\",\n ringed: true,\n class:\n \"ring-2 ring-offset-2 ring-offset-brand-50 dark:ring-offset-brand-950 ring-gray-light-950 dark:ring-gray-light-50 ring-inset\",\n },\n // An upcoming `default` step: just the outer ring, no center, in the\n // disabled color — `TimelineItem` also turns `ringed` off for it, which\n // drops the inset gap/center shadows. Listed after the base so `cn`'s\n // twMerge lets these colors win over both the base and `dark:` ones.\n {\n variant: \"default\",\n state: \"pending\",\n class: [\n \"bg-transparent dark:bg-transparent\",\n \"border-(--c-solid-disabled) dark:border-(--c-solid-disabled)\",\n \"text-(--c-text-disabled) dark:text-(--c-text-disabled)\",\n ],\n },\n // An upcoming gradient step: its fixed stops can't follow the slot\n // remap, so it flattens to the disabled fill. `TimelineItem` skips the\n // direction class and the custom stops for it.\n {\n variant: \"gradient\",\n state: \"pending\",\n class: \"bg-none bg-(--c-solid-disabled) text-(--c-on-solid-disabled)\",\n },\n ],\n defaultVariants: { variant: \"default\", ringed: true, state: \"none\" },\n})\n\n/** Inline override values for `--tl-line-mask` — see `timelineVariants`' `lineVariant`. */\nconst LINE_MASK: Record<TimelineLineVariant, string> = {\n solid: \"none\",\n dashed: \"var(--tl-dashes)\",\n}\n\n/** Gradient stops a `variant=\"gradient\"` item falls back to — the same\n * purple-300 → pink-400 Badge/Card use, spelled out as values (not left to\n * the bullet's `from-*`/`to-*` classes) so the line, which has no such class,\n * reads the same stops. */\nconst GRADIENT_DEFAULTS = {\n fromDefault: \"var(--color-purple-300)\",\n toDefault: \"var(--color-pink-400)\",\n}\n\n/**\n * One end of a connector: the color it shows there, plus the `data-color`\n * palette that color has to be resolved under (`--c-*` slots differ between\n * light and dark themes, so a palette color can't be written down as a plain\n * value — it only means something on an element carrying that palette).\n *\n * A connector enters an item in its *entry* color and leaves it in its *exit*\n * color. They're the same for every flat variant; a `gradient` item enters at\n * its `from` stop and leaves at its `to`, so the line reads as running through\n * the bullet's own fade.\n *\n * The remaining variants (`filled`, `outline`, `dashed`) all draw in\n * `--c-solid`. A colored end reads it under its own `data-color`. Without a\n * `color`, the bullet draws in the ambient palette, so its end reads the\n * root's `--tl-ambient-solid` copy instead — the inner span sits inside the\n * outer span's `data-color`, where a bare `--c-solid` would resolve to the\n * previous item's palette.\n *\n * A `default` item ends in its bullet's own fill (`--tl-inverted`),\n * palette-independent like the bullet, so `color` is ignored. Every pending\n * item ends in `--c-solid-disabled`, the color all pending bullets share: the\n * remapped `--c-solid`, a pending `default`'s ring, a flattened gradient.\n */\nfunction lineEnd(\n { color, variant: v, gradient, state }: TimelineNeighbour,\n end: \"entry\" | \"exit\",\n): LineEnd {\n // `??`, not a destructuring default: cva variant props also accept `null`.\n const variant = v ?? \"default\"\n if (state === \"pending\") return { value: \"var(--c-solid-disabled)\" }\n if (variant === \"gradient\") {\n return {\n value:\n end === \"entry\"\n ? (gradient?.from ?? GRADIENT_DEFAULTS.fromDefault)\n : (gradient?.to ?? GRADIENT_DEFAULTS.toDefault),\n }\n }\n if (variant === \"default\") return { value: \"var(--tl-inverted)\" }\n return color\n ? { dataColor: color, value: \"var(--c-solid)\" }\n : { value: \"var(--tl-ambient-solid)\" }\n}\n\ntype LineEnd = { dataColor?: Color; value: string }\n\n/** An item's place relative to the active step — `none` when no step is\n * active anywhere. Exposed as `data-state` on the item. */\ntype TimelineItemState = \"none\" | \"complete\" | \"active\" | \"pending\"\n\n/**\n * Each child's progress state. The active step is the first `Timeline.Item`\n * passing `active` — that overrides the root's `active` index — otherwise\n * the root's index, counted over `Timeline.Item`s only (other children are\n * skipped, and get `none`). Steps before it are `complete`, after it\n * `pending`; an index past the end leaves every step `complete`, a negative\n * one every step `pending`. With neither set, every item is `none`.\n */\nfunction stateAt(items: ReactNode[], active: number | undefined): TimelineItemState[] {\n const marked = items.filter(isTimelineItem).findIndex((item) => item.props.active === true)\n const current = marked !== -1 ? marked : active\n // Each child's position among the `Timeline.Item`s only.\n const steps = items.map((_, i) => items.slice(0, i).filter(isTimelineItem).length)\n return items.map((node, i): TimelineItemState => {\n const step = steps[i] ?? 0\n if (!isTimelineItem(node) || current === undefined) return \"none\"\n if (step < current) return \"complete\"\n return step === current ? \"active\" : \"pending\"\n })\n}\n\n/** `Timeline`'s density scale — the kit's canonical `Size` (xs–xl). */\nexport type TimelineSize = Size\nexport type TimelineLineVariant = NonNullable<VariantProps<typeof timelineVariants>[\"lineVariant\"]>\nexport type TimelineBulletVariant = NonNullable<\n VariantProps<typeof timelineBulletVariants>[\"variant\"]\n>\n\nexport type { GradientDir, GradientProps }\n\nexport type TimelineProps = HTMLArkProps<\"ol\"> &\n VariantProps<typeof timelineVariants> &\n WithTestId & {\n /**\n * Index of the current step among the `Timeline.Item` children (other\n * children aren't counted). Steps before it render as complete, steps\n * after it as pending — dimmed, and a `default` dot reduced to its outer\n * ring. A `Timeline.Item` passing its own `active` overrides this. Leave\n * both unset for a plain event list with no progress.\n */\n active?: number\n }\n\n/**\n * Timeline — a vertical, chronological list of events (activity feed, audit\n * log, changelog). Pure React Server Component: no state, no `\"use client\"`.\n *\n * Composed from `Timeline.Item` (one per event, owns the bullet + connecting\n * line), with two optional children per item: `Timeline.Label` (a leading\n * date/timestamp) and `Timeline.Content` (the body, holding an optional\n * `Timeline.Title`). Every item shares the same three column tracks, so\n * bullets stay aligned down a single axis regardless of which items use a\n * label — and the label column disappears entirely if no item uses it.\n *\n * <Timeline>\n * <Timeline.Item color=\"green\">\n * <Timeline.Label>Mar 1, 2026</Timeline.Label>\n * <Timeline.Content>\n * <Timeline.Title>Order placed</Timeline.Title>\n * </Timeline.Content>\n * </Timeline.Item>\n * <Timeline.Item variant=\"outline\">\n * <Timeline.Content>\n * <Timeline.Title>Delivered</Timeline.Title>\n * </Timeline.Content>\n * </Timeline.Item>\n * </Timeline>\n *\n * There is no `variant`×`color` axis on the root — those live per `Timeline.Item`,\n * since each event typically carries its own status. `size` and `lineVariant`\n * set the shared defaults for every item's bullet size and connecting line.\n *\n * Direct children should be `Timeline.Item` elements (as in the example\n * above, or a flat `.map()` over an array of them) — `TimelineRoot` reads\n * each item's `color`/`variant`/`gradient`/`lineVariant` off its immediate\n * siblings and hands them to it as `prevItem`/`nextItem`, so every connector\n * can blend from one item's color into the next one's (see `lineEnd`,\n * `TimelineItem`). A child that isn't a recognized `Timeline.Item` breaks\n * that chain at that point and never crashes: the connector leading into it\n * stays flat in its own item's color, as if it were the last one.\n */\nfunction isTimelineItem(node: ReactNode): node is ReactElement<TimelineItemInternalProps> {\n return isValidElement(node) && node.type === TimelineItem\n}\n\nconst TimelineRoot = ({\n className,\n size,\n lineVariant,\n active,\n children,\n testId,\n ...rest\n}: TimelineProps) => {\n const items = Children.toArray(children)\n // `asChild` morphs the root into a single element the caller passed as its\n // one child (see Ark's `withAsChild`) — it requires that child to still be\n // a bare, single valid element, not array-wrapped, so skip the transform\n // entirely rather than hand it something `Children.toArray` reshaped.\n // `Timeline.Item`s nested a level deeper inside that child are outside what\n // this prop-threading reaches anyway, same as the constraint documented\n // above.\n const states = stateAt(items, active)\n const neighbour = (i: number): TimelineNeighbour | undefined => {\n const node = items[i]\n if (!isTimelineItem(node)) return undefined\n const { color, variant, gradient, lineVariant } = node.props\n return { color, variant, gradient, lineVariant, state: states[i] }\n }\n const withNeighbours = rest.asChild\n ? children\n : items.map((child, i) =>\n isTimelineItem(child)\n ? cloneElement(child, {\n prevItem: neighbour(i - 1),\n nextItem: neighbour(i + 1),\n state: states[i],\n } satisfies Partial<TimelineItemInternalProps>)\n : child,\n )\n return (\n <ark.ol\n className={cn(timelineVariants({ size, lineVariant }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {withNeighbours}\n </ark.ol>\n )\n}\n\nexport type TimelineItemProps = Omit<HTMLArkProps<\"li\">, \"color\"> &\n Omit<VariantProps<typeof timelineBulletVariants>, \"ringed\" | \"state\"> &\n WithTestId & {\n /** Accent palette for the bullet. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /** Overrides the default dot with any node — an icon, `<Avatar>`, or a\n * `<Spinner>` for an in-progress item. */\n bullet?: ReactNode\n /** Overrides just this item's bullet diameter; defaults to `Timeline`'s\n * own `size`. Doesn't affect line thickness or spacing — only the dot. */\n size?: Size\n /** Overrides `Timeline`'s connecting-line style for just the segment\n * below this item. */\n lineVariant?: TimelineLineVariant\n /**\n * Gradient config. Only applied when `variant=\"gradient\"`.\n * Mirrors Badge's gradient prop — unset fields fall back to the CVA\n * defaults (purple-300 → pink-400, to-r).\n */\n gradient?: GradientProps\n /**\n * Nudges the bullet+line column down (a CSS length, e.g. `\"11px\"`) to\n * line the bullet up with something inside a custom `Timeline.Content` —\n * a card's title, say — that Timeline has no visibility into on its own.\n * Applied as a shared CSS custom property, not a plain padding class on\n * the bullet alone, because the connecting line is a separate sibling\n * element that also needs to shift down by the same amount to keep\n * meeting the bullet's (now lower) edge — see `TimelineItem`.\n */\n axisOffset?: string\n /**\n * Marks this item as the current step, overriding `Timeline`'s `active`\n * index — handy when mapping over data that already knows which entry is\n * current. If several items pass it, the first one wins; `false` is the\n * same as leaving it unset.\n */\n active?: boolean\n }\n\n/** See `TimelineRoot`'s `prevItem`/`nextItem` threading. */\ntype TimelineNeighbour = Pick<\n TimelineItemProps,\n \"color\" | \"variant\" | \"gradient\" | \"lineVariant\"\n> & { state?: TimelineItemState }\n\n/**\n * `prevItem`/`nextItem`/`state` are internal-only — injected by `TimelineRoot`, never\n * meant to be passed directly by a consumer — so they're kept off the\n * exported/documented `TimelineItemProps` (the same internal/public split\n * `ringed` already uses on `timelineBulletVariants`, just at the plain-prop\n * level here instead of the cva-variant level).\n */\ntype TimelineItemInternalProps = TimelineItemProps & {\n prevItem?: TimelineNeighbour\n nextItem?: TimelineNeighbour\n state?: TimelineItemState\n}\n\n/**\n * One event: a bullet + connecting line (generated automatically — no manual\n * separator/connector wiring), and up to two children, `Timeline.Label` and\n * `Timeline.Content`, which place themselves into the shared column tracks.\n * The line to the next item is suppressed automatically on the last item.\n */\nconst TimelineItem = ({\n className,\n color,\n variant,\n bullet,\n size,\n lineVariant,\n gradient,\n axisOffset,\n style,\n children,\n prevItem,\n nextItem,\n state = \"none\",\n // Read by `TimelineRoot` (see `stateAt`); kept off the `<li>`.\n active: _active,\n testId,\n asChild,\n ...rest\n}: TimelineItemInternalProps) => {\n const isGradient = variant === \"gradient\"\n const pending = state === \"pending\"\n // Only for the bullet's own style — the line reads its endpoints through\n // `lineEnd` instead. A pending gradient flattens, so it gets none.\n const gradientVars =\n isGradient && !pending ? buildGradientVars(gradient, GRADIENT_DEFAULTS) : undefined\n // `entry` also colors the axisOffset stub: it sits right where the previous\n // connector arrives, which is in this item's own entry color.\n const entry = lineEnd({ color, variant, gradient, state }, \"entry\")\n const exit = lineEnd({ color, variant, gradient, state }, \"exit\")\n // No recognized next item (the last item, or a stray non-item child next):\n // the connector has nothing to blend into, so it stays flat in its own exit.\n const target = nextItem ? lineEnd(nextItem, \"entry\") : exit\n const ownMask = lineVariant && { \"--tl-line-mask\": LINE_MASK[lineVariant] }\n const leadingMask = prevItem?.lineVariant && {\n \"--tl-line-mask\": LINE_MASK[prevItem.lineVariant],\n }\n\n return (\n <ark.li\n asChild={asChild}\n style={\n {\n ...(size ? { \"--tl-bullet-size\": BULLET_SIZE[size] } : undefined),\n ...(axisOffset ? { \"--tl-axis-offset\": axisOffset } : undefined),\n ...style,\n } as CSSProperties\n }\n className={cn(\n \"col-span-3 grid grid-cols-subgrid\",\n \"[&:first-child_[data-part=line][data-edge=start]]:hidden\",\n \"[&:last-child_[data-part=line][data-edge=end]]:hidden\",\n className,\n )}\n {...props({\n \"data-testid\": testId,\n \"data-state\": state !== \"none\" && state,\n \"aria-current\": state === \"active\" && \"step\",\n })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {/* Two line segments share `data-part=\"line\"` (so the first/last-item\n suppression selectors above match both) but differ in `data-edge`\n for layout and visibility. Both are a `--tl-line-width`-wide\n background bar rather than a border, so a gradient fill and the\n `--tl-line-mask` dash pattern can be combined.\n\n `data-edge=\"start\"` (leading) fills the gap `axisOffset` opens\n *above* this item's own (shifted-down) bullet — a plain height of\n `--tl-axis-offset` (0, i.e. invisible, when `axisOffset` isn't\n set), `self-start` so it sits flush at the row's own top edge.\n Hidden on the first item: nothing renders above the very first\n bullet to connect to. It's flat in this item's own entry color:\n the previous item's trailing segment has already blended into\n exactly that color by the time it reaches this row's top edge, so\n the two meet with no seam. Only its dash pattern comes from the\n previous item (`prevItem.lineVariant`), since it continues that\n item's segment.\n\n `data-edge=\"end\"` (trailing) is the connector to the next item: a\n grid item in the same cell as the bullet (col/row-start-2/1,\n default align-self:stretch fills the row's real height), whose\n margin-top pushes its own box down by exactly the bullet's\n diameter plus `--tl-axis-offset` — so it stops right at the\n bullet's edge instead of running behind it, and the hollow\n variants can stay genuinely transparent. Hidden on the last item.\n\n It blends from this item's exit color to the next item's entry\n color. Those are usually two *different* palettes, and a `--c-*`\n slot only resolves against the `data-color` of the element it's\n read on, so it takes two elements: the outer span carries this\n item's palette and declares `--tl-from`, the inner one carries the\n next item's and declares `--tl-to`. A custom property inherits its\n *computed* value — the `var(--c-solid)` in `--tl-from` is already\n substituted with this item's color by the time the inner span reads\n it — so the inner span sees both colors at once. The outer span stays\n the direct grid item (stretching through a nested element is\n unreliable); the inner one just fills it with `absolute inset-0`.\n\n `--tl-bullet-size`/`--tl-axis-offset` are declared on the `<li>`\n (see `timelineVariants` / this component's own `style`), not\n scoped to the bullet, so these siblings can read the same values\n as the axis div below — siblings can only stay in sync through a\n shared var. */}\n <span\n data-part=\"line\"\n data-edge=\"start\"\n data-color={entry.dataColor}\n style={{ \"--tl-from\": entry.value, ...leadingMask } as CSSProperties}\n className={cn(\n \"col-start-2 row-start-1 self-start justify-self-center w-(--tl-line-width)\",\n \"h-(--tl-axis-offset,0px) bg-(--tl-from) [mask-image:var(--tl-line-mask)]\",\n )}\n />\n <span\n data-part=\"line\"\n data-edge=\"end\"\n data-color={exit.dataColor}\n style={{ \"--tl-from\": exit.value, ...ownMask } as CSSProperties}\n className={cn(\n \"relative col-start-2 row-start-1 justify-self-center w-(--tl-line-width)\",\n \"mt-[calc(var(--tl-bullet-size)+var(--tl-axis-offset,0px))]\",\n \"[mask-image:var(--tl-line-mask)]\",\n )}\n >\n <span\n data-color={target.dataColor}\n style={{ \"--tl-to\": target.value } as CSSProperties}\n className=\"absolute inset-0 [background-image:linear-gradient(to_bottom_in_oklab,var(--tl-from),var(--tl-to))]\"\n />\n </span>\n <div\n data-part=\"axis\"\n className=\"col-start-2 row-start-1 flex justify-center self-start pt-(--tl-axis-offset)\"\n >\n <span\n data-part=\"bullet\"\n // A pending bullet drops its palette: `[data-color]` and the\n // `pending` slot remap would both set `--c-*` on this one element,\n // leaving the winner to stylesheet order. The disabled slots it\n // remaps to are shared by every palette anyway.\n data-color={!isGradient && !pending ? color : undefined}\n style={gradientVars as CSSProperties}\n className={cn(\n timelineBulletVariants({\n variant,\n // A pending `default` step is a bare outer ring: no inset gap\n // and center to draw.\n ringed: !bullet && !(pending && (variant ?? \"default\") === \"default\"),\n state,\n }),\n \"size-(--tl-bullet-size) grid place-items-center overflow-hidden\",\n \"[&_svg]:size-full [&_svg]:p-0.5\",\n isGradient && !pending && gradient?.dir && GRADIENT_DIR_CLASS[gradient.dir],\n )}\n >\n {bullet}\n </span>\n </div>\n {own}\n </>\n ))}\n </ark.li>\n )\n}\n\nexport type TimelineLabelProps = Omit<HTMLArkProps<\"span\">, \"color\"> &\n WithTestId & {\n /** Tints the label (and any icon inside it) to match the item's accent —\n * pass the same value given to the `Timeline.Item`'s `color`. Omit it to\n * keep the neutral muted default. */\n color?: Color\n }\n\n/**\n * The leading zone (typically a date/timestamp), aligned to the bullet. Lays\n * out its children in a row (`inline-flex items-center gap-1.5`) so an icon\n * before the text — e.g. `<Timeline.Label><CalendarIcon />Mar 1, 2026</Timeline.Label>` —\n * sits inline without extra markup; stack a date over a time by nesting a\n * `flex flex-col` wrapper around the text yourself.\n */\nconst TimelineLabel = ({ className, color, testId, ...rest }: TimelineLabelProps) => (\n <ark.span\n data-part=\"label\"\n data-color={color}\n className={cn(\n \"col-start-1 inline-flex items-center gap-1.5 self-start pt-px [&_svg]:size-3.5 [&_svg]:shrink-0\",\n color ? \"text-(--c-text)\" : \"text-gray-light-500 dark:text-gray-dark-400\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type TimelineContentProps = HTMLArkProps<\"div\"> & WithTestId\n\n/** The main body zone for an item — holds an optional `Timeline.Title` and\n * any free-form description content. */\nconst TimelineContent = ({ className, testId, ...rest }: TimelineContentProps) => (\n <ark.div\n data-part=\"content\"\n className={cn(\"col-start-3\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type TimelineTitleProps = HTMLArkProps<\"span\"> & WithTestId\n\n/** A bold lead-in line for `Timeline.Content`. Deliberately a `<span>`, styled\n * `block` to sit on its own line, not a heading (a timeline can hold many\n * items, and one `<h3>` per item would spam heading landmarks — unlike\n * `Table.Title`, which labels the table once) and not a `<p>` either. A\n * `<div>` doesn't fix that second problem: `<p>`'s content model is phrasing\n * content only, so a `<div>` inside one is exactly as invalid as a nested\n * `<p>` — the tag has to be phrasing content itself for a consumer to safely\n * wrap `Timeline.Title` in their own paragraph (e.g. `<Text>`) without\n * triggering React's \"cannot be a descendant of `<p>`\" DOM-nesting warning;\n * `block` gets the same visual line without changing that category. */\nconst TimelineTitle = ({ className, testId, ...rest }: TimelineTitleProps) => (\n <ark.span\n className={cn(\"block font-medium text-gray-light-900 dark:text-gray-dark-25\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Timeline = Object.assign(TimelineRoot, {\n Item: TimelineItem,\n Label: TimelineLabel,\n Content: TimelineContent,\n Title: TimelineTitle,\n})\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/components/timeline/timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAA;AAInE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAiBnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,QAAA,MAAM,gBAAgB;;;8EA4DrB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;6CAuB6C;AAC7C,QAAA,MAAM,sBAAsB;;;;
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/components/timeline/timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAA;AAInE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mB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client";
|
|
2
2
|
import '../../chunk-ZP6EBROY.js';
|
|
3
|
-
export { Tooltip } from '../../chunk-
|
|
3
|
+
export { Tooltip } from '../../chunk-2NNZHVKD.js';
|
|
4
4
|
import '../../chunk-G52U24GR.js';
|
|
5
5
|
import '../../chunk-7P32XCEU.js';
|
|
6
6
|
import '../../chunk-WYCMIIRR.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-INJUILCN.js';
|
|
8
8
|
import '../../chunk-QP4I37PA.js';
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { RenderTreeMultiSelectItem, TreeMultiSelectItemState, TreeNodeData, TreePayload, TreeSelectData, TreeValue, } from "../../lib/tree-data";
|
|
2
|
-
export { TreeMultiSelect, type TreeMultiSelectProps } from "./tree-multi-select";
|
|
2
|
+
export { TreeMultiSelect, type TreeMultiSelectProps, type TreeMultiSelectTranslations, } from "./tree-multi-select";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tree-multi-select/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,SAAS,GACV,MAAM,qBAAqB,CAAA;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tree-multi-select/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,SAAS,GACV,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,GACjC,MAAM,qBAAqB,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { buildMaps, filterTree, flattenTree, isLeaf } from '../../chunk-WZB6LPQI.js';
|
|
3
|
-
import { usePillOverflow, PillOverflowCounter, pillsContent, pillsShell } from '../../chunk-
|
|
4
|
-
import { Pill } from '../../chunk-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { usePillOverflow, PillOverflowCounter, pillsContent, pillsShell } from '../../chunk-FAOBC4IS.js';
|
|
4
|
+
import { Pill } from '../../chunk-RKYXG6X7.js';
|
|
5
|
+
import { controlIndicator } from '../../chunk-FOMR74VE.js';
|
|
6
|
+
import { inputSlot, placeholderColor, inputShell, inputControlClasses } from '../../chunk-Z6RPMRFH.js';
|
|
7
|
+
import { FieldShell, fieldA11yProps } from '../../chunk-TBTSEPGP.js';
|
|
8
|
+
import { Popover, popoverClearTrigger, popoverChevron, popoverEmpty } from '../../chunk-LM6F6DLR.js';
|
|
8
9
|
import '../../chunk-AIQG7IIT.js';
|
|
9
10
|
import '../../chunk-7P32XCEU.js';
|
|
10
11
|
import '../../chunk-BUIHQJGE.js';
|
|
@@ -12,10 +13,11 @@ import { useUncontrolled } from '../../chunk-BEL75C7N.js';
|
|
|
12
13
|
import { CloseIcon, ChevronIcon, CheckIcon, MinusIcon } from '../../chunk-IG7FBZVM.js';
|
|
13
14
|
import '../../chunk-I4SQQIP5.js';
|
|
14
15
|
import { props } from '../../chunk-WYCMIIRR.js';
|
|
15
|
-
import '../../chunk-
|
|
16
|
+
import { focusStyles } from '../../chunk-INJUILCN.js';
|
|
16
17
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
18
|
+
import { useFieldContext } from '@ark-ui/react/field';
|
|
17
19
|
import { cva } from 'class-variance-authority';
|
|
18
|
-
import { useState, useMemo, useRef, useEffect, Fragment as Fragment$1 } from 'react';
|
|
20
|
+
import { useState, useId, useMemo, useRef, useEffect, Fragment as Fragment$1 } from 'react';
|
|
19
21
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
20
22
|
|
|
21
23
|
var getLeafValues = (node, acc = []) => {
|
|
@@ -50,7 +52,10 @@ var treeRow = cva(
|
|
|
50
52
|
"hover:bg-black/5 dark:hover:bg-white/8",
|
|
51
53
|
"data-active:bg-black/5 dark:data-active:bg-white/8",
|
|
52
54
|
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
53
|
-
|
|
55
|
+
// Palette, not brand: the focused row is also the active one, and brand-500
|
|
56
|
+
// measured 2.73:1 against that light fill. `--c-text` (the popover's
|
|
57
|
+
// `data-color`, neutral by default) clears it in both themes.
|
|
58
|
+
focusStyles({ ring: "palette", offset: false, inset: true })
|
|
54
59
|
],
|
|
55
60
|
{
|
|
56
61
|
variants: {
|
|
@@ -65,28 +70,29 @@ var treeRow = cva(
|
|
|
65
70
|
defaultVariants: { size: "md" }
|
|
66
71
|
}
|
|
67
72
|
);
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
);
|
|
73
|
+
var TREE_MULTI_SELECT_DEFAULT_TRANSLATIONS = {
|
|
74
|
+
clearTriggerLabel: "Clear all",
|
|
75
|
+
searchLabel: "Search",
|
|
76
|
+
removeValue: () => "Remove"
|
|
77
|
+
};
|
|
78
|
+
var TreeMultiSelectTrigger = ({
|
|
79
|
+
open,
|
|
80
|
+
disabled,
|
|
81
|
+
...rest
|
|
82
|
+
}) => {
|
|
83
|
+
const field = useFieldContext();
|
|
84
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
role: "combobox",
|
|
88
|
+
"aria-expanded": open,
|
|
89
|
+
"aria-haspopup": "tree",
|
|
90
|
+
tabIndex: disabled ? -1 : 0,
|
|
91
|
+
...fieldA11yProps(field),
|
|
92
|
+
...rest
|
|
93
|
+
}
|
|
94
|
+
) });
|
|
95
|
+
};
|
|
90
96
|
var TreeMultiSelect = ({
|
|
91
97
|
data,
|
|
92
98
|
value: valueProp,
|
|
@@ -117,8 +123,10 @@ var TreeMultiSelect = ({
|
|
|
117
123
|
error,
|
|
118
124
|
className,
|
|
119
125
|
classNames,
|
|
120
|
-
testId
|
|
126
|
+
testId,
|
|
127
|
+
translations
|
|
121
128
|
}) => {
|
|
129
|
+
const resolvedTranslations = { ...TREE_MULTI_SELECT_DEFAULT_TRANSLATIONS, ...translations };
|
|
122
130
|
const [value, setValue] = useUncontrolled({
|
|
123
131
|
value: valueProp,
|
|
124
132
|
defaultValue: defaultValue ?? [],
|
|
@@ -126,6 +134,7 @@ var TreeMultiSelect = ({
|
|
|
126
134
|
finalValue: []
|
|
127
135
|
});
|
|
128
136
|
const [open, setOpen] = useState(false);
|
|
137
|
+
const treeId = useId();
|
|
129
138
|
const [search, setSearch] = useState("");
|
|
130
139
|
const isInvalid = invalid || error != null;
|
|
131
140
|
const { labelMap, nodeMap } = useMemo(() => buildMaps(data), [data]);
|
|
@@ -216,10 +225,18 @@ var TreeMultiSelect = ({
|
|
|
216
225
|
disabled: !!nodeDisabled,
|
|
217
226
|
depth
|
|
218
227
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
219
|
-
/* @__PURE__ */ jsxs(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
228
|
+
/* @__PURE__ */ jsxs(
|
|
229
|
+
"span",
|
|
230
|
+
{
|
|
231
|
+
"aria-hidden": true,
|
|
232
|
+
"data-state": checked ? "checked" : mixed ? "indeterminate" : "unchecked",
|
|
233
|
+
className: cn(controlIndicator({ size, variant: "filled" }), classNames?.checkbox),
|
|
234
|
+
children: [
|
|
235
|
+
checked && /* @__PURE__ */ jsx(CheckIcon, {}),
|
|
236
|
+
mixed && /* @__PURE__ */ jsx(MinusIcon, {})
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
),
|
|
223
240
|
/* @__PURE__ */ jsx("span", { className: cn("ms-1.5 min-w-0 flex-1 truncate text-start", classNames?.label), children: node.label })
|
|
224
241
|
] });
|
|
225
242
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
@@ -290,13 +307,13 @@ var TreeMultiSelect = ({
|
|
|
290
307
|
autoFocus: false,
|
|
291
308
|
width: "target",
|
|
292
309
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
|
|
310
|
+
/* @__PURE__ */ jsxs(
|
|
311
|
+
TreeMultiSelectTrigger,
|
|
295
312
|
{
|
|
296
313
|
ref,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
"aria-
|
|
314
|
+
open,
|
|
315
|
+
disabled,
|
|
316
|
+
"aria-controls": flat.length > 0 ? treeId : void 0,
|
|
300
317
|
"aria-invalid": isInvalid || void 0,
|
|
301
318
|
"data-color": color,
|
|
302
319
|
...props({
|
|
@@ -310,7 +327,6 @@ var TreeMultiSelect = ({
|
|
|
310
327
|
// inner control to route to), so `testId` lands directly on it.
|
|
311
328
|
"data-testid": testId
|
|
312
329
|
}),
|
|
313
|
-
tabIndex: disabled ? -1 : 0,
|
|
314
330
|
onBlur,
|
|
315
331
|
onKeyDown: (event) => {
|
|
316
332
|
if (disabled || readOnly) return;
|
|
@@ -336,6 +352,7 @@ var TreeMultiSelect = ({
|
|
|
336
352
|
disabled,
|
|
337
353
|
withRemoveButton: !disabled && !readOnly,
|
|
338
354
|
onRemove: () => removeValue(v),
|
|
355
|
+
removeLabel: resolvedTranslations.removeValue(labelMap.get(v) ?? v),
|
|
339
356
|
className: classNames?.pill,
|
|
340
357
|
"data-overflow-item": true,
|
|
341
358
|
children: labelMap.get(v) ?? v
|
|
@@ -349,7 +366,7 @@ var TreeMultiSelect = ({
|
|
|
349
366
|
"button",
|
|
350
367
|
{
|
|
351
368
|
type: "button",
|
|
352
|
-
"aria-label":
|
|
369
|
+
"aria-label": resolvedTranslations.clearTriggerLabel,
|
|
353
370
|
onPointerDown: (event) => {
|
|
354
371
|
event.preventDefault();
|
|
355
372
|
event.stopPropagation();
|
|
@@ -365,7 +382,7 @@ var TreeMultiSelect = ({
|
|
|
365
382
|
(clearSectionMode === "both" || !showClear) && /* @__PURE__ */ jsx("span", { "aria-hidden": true, "data-chevron": true, className: cn(popoverChevron, open && "rotate-180"), children: /* @__PURE__ */ jsx(ChevronIcon, {}) })
|
|
366
383
|
]
|
|
367
384
|
}
|
|
368
|
-
)
|
|
385
|
+
),
|
|
369
386
|
/* @__PURE__ */ jsxs(Popover.Content, { "data-color": color, className: classNames?.popover, children: [
|
|
370
387
|
searchable && /* @__PURE__ */ jsx(Popover.Header, { children: /* @__PURE__ */ jsx(
|
|
371
388
|
"input",
|
|
@@ -376,13 +393,14 @@ var TreeMultiSelect = ({
|
|
|
376
393
|
onChange: (event) => setSearch(event.target.value),
|
|
377
394
|
onKeyDown: onSearchKeyDown,
|
|
378
395
|
placeholder: searchPlaceholder,
|
|
379
|
-
"aria-label":
|
|
396
|
+
"aria-label": resolvedTranslations.searchLabel,
|
|
380
397
|
className: cn(inputControlClasses, "text-sm", classNames?.search)
|
|
381
398
|
}
|
|
382
399
|
) }),
|
|
383
400
|
/* @__PURE__ */ jsx(Popover.Body, { children: flat.length === 0 ? /* @__PURE__ */ jsx("div", { className: popoverEmpty, children: empty }) : /* @__PURE__ */ jsx(
|
|
384
401
|
"div",
|
|
385
402
|
{
|
|
403
|
+
id: treeId,
|
|
386
404
|
role: "tree",
|
|
387
405
|
"aria-multiselectable": "true",
|
|
388
406
|
"aria-orientation": "vertical",
|