@42-central/ui-react 0.17.1 → 0.18.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-FD6P6PLQ.js → chunk-5JHDSVEZ.js} +3 -3
- package/dist/{chunk-FD6P6PLQ.js.map → chunk-5JHDSVEZ.js.map} +1 -1
- package/dist/{chunk-QMW7D5GU.js → chunk-5OQLFX47.js} +4 -3
- package/dist/chunk-5OQLFX47.js.map +1 -0
- package/dist/{chunk-VZ2TPU4B.js → chunk-6GDMSENK.js} +3 -2
- package/dist/chunk-6GDMSENK.js.map +1 -0
- package/dist/{chunk-TNNH3FVQ.js → chunk-6OLTJYSX.js} +24 -8
- package/dist/chunk-6OLTJYSX.js.map +1 -0
- package/dist/{chunk-POKDSVQT.js → chunk-AE7QTLJ5.js} +5 -4
- package/dist/chunk-AE7QTLJ5.js.map +1 -0
- package/dist/{chunk-44OV3PNH.js → chunk-B2YJKRNQ.js} +3 -3
- package/dist/{chunk-44OV3PNH.js.map → chunk-B2YJKRNQ.js.map} +1 -1
- package/dist/{chunk-YIQI2CF3.js → chunk-CTSO6V72.js} +3 -2
- package/dist/chunk-CTSO6V72.js.map +1 -0
- package/dist/{chunk-EVVMHTCL.js → chunk-EBREIC3L.js} +4 -3
- package/dist/chunk-EBREIC3L.js.map +1 -0
- package/dist/{chunk-UNSAA7YG.js → chunk-FHG54IT5.js} +3 -2
- package/dist/chunk-FHG54IT5.js.map +1 -0
- package/dist/{chunk-3GYOIQW7.js → chunk-FZIHZT5R.js} +5 -5
- package/dist/{chunk-3GYOIQW7.js.map → chunk-FZIHZT5R.js.map} +1 -1
- package/dist/{chunk-2H46IXW4.js → chunk-HAQJQFE6.js} +28 -8
- package/dist/chunk-HAQJQFE6.js.map +1 -0
- package/dist/{chunk-IHYFYMHJ.js → chunk-HT5JAHR3.js} +6 -6
- package/dist/{chunk-IHYFYMHJ.js.map → chunk-HT5JAHR3.js.map} +1 -1
- package/dist/chunk-I4SQQIP5.js +12 -0
- package/dist/chunk-I4SQQIP5.js.map +1 -0
- package/dist/{chunk-J3PELDH3.js → chunk-JITF6I7N.js} +22 -6
- package/dist/chunk-JITF6I7N.js.map +1 -0
- package/dist/{chunk-IFWCCAQV.js → chunk-KHMFNH3X.js} +3 -2
- package/dist/chunk-KHMFNH3X.js.map +1 -0
- package/dist/{chunk-SIG4DMNZ.js → chunk-MI2WZRK3.js} +4 -4
- package/dist/{chunk-SIG4DMNZ.js.map → chunk-MI2WZRK3.js.map} +1 -1
- package/dist/{chunk-YON5Y336.js → chunk-O23Y5ML4.js} +8 -8
- package/dist/{chunk-YON5Y336.js.map → chunk-O23Y5ML4.js.map} +1 -1
- package/dist/{chunk-P7A3BCAC.js → chunk-OWG4BCQR.js} +3 -3
- package/dist/{chunk-P7A3BCAC.js.map → chunk-OWG4BCQR.js.map} +1 -1
- package/dist/{chunk-FUWSTUDM.js → chunk-PH354ECN.js} +4 -4
- package/dist/{chunk-FUWSTUDM.js.map → chunk-PH354ECN.js.map} +1 -1
- package/dist/{chunk-U5GW5EBR.js → chunk-RAUOFTUH.js} +12 -20
- package/dist/chunk-RAUOFTUH.js.map +1 -0
- package/dist/{chunk-2762HZYX.js → chunk-S2HWWR2H.js} +47 -25
- package/dist/chunk-S2HWWR2H.js.map +1 -0
- package/dist/{chunk-VLUKI3HL.js → chunk-S7N4LGLZ.js} +6 -13
- package/dist/chunk-S7N4LGLZ.js.map +1 -0
- package/dist/{chunk-NSOA3GMZ.js → chunk-UHNRAI6V.js} +3 -3
- package/dist/{chunk-NSOA3GMZ.js.map → chunk-UHNRAI6V.js.map} +1 -1
- package/dist/{chunk-3NZXWCGF.js → chunk-WHKKN3ZK.js} +6 -6
- package/dist/{chunk-3NZXWCGF.js.map → chunk-WHKKN3ZK.js.map} +1 -1
- package/dist/{chunk-MOI7B3KH.js → chunk-WQN64ZHG.js} +5 -5
- package/dist/{chunk-MOI7B3KH.js.map → chunk-WQN64ZHG.js.map} +1 -1
- package/dist/chunk-WSIVRDRB.js +34 -0
- package/dist/chunk-WSIVRDRB.js.map +1 -0
- package/dist/{chunk-6SWK4XG5.js → chunk-YXE4B6X3.js} +2 -2
- package/dist/chunk-YXE4B6X3.js.map +1 -0
- package/dist/{chunk-NGAQITWP.js → chunk-Z2Z5EXVT.js} +10 -7
- package/dist/chunk-Z2Z5EXVT.js.map +1 -0
- package/dist/{chunk-IXKELBJA.js → chunk-ZDXQ64A7.js} +63 -44
- package/dist/chunk-ZDXQ64A7.js.map +1 -0
- package/dist/components/accordion/accordion-data.d.ts +3 -2
- package/dist/components/accordion/accordion-data.d.ts.map +1 -1
- package/dist/components/accordion/accordion.d.ts +2 -2
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/index.js +20 -8
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/action-icon/action-icon.d.ts +3 -4
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +2 -1
- package/dist/components/alert/alert.d.ts +1 -1
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +16 -4
- package/dist/components/alert/index.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +3 -2
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +4 -2
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/index.js +5 -4
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +3 -2
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +11 -5
- package/dist/components/breadcrumb/index.js.map +1 -1
- package/dist/components/button/button.d.ts +4 -4
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +2 -1
- package/dist/components/button-multi-select/index.js +4 -3
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/index.js +4 -3
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/index.js +3 -2
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/choice-card-group/index.js +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +3 -2
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js +1 -0
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/clipboard.d.ts +1 -1
- package/dist/components/clipboard/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/index.js +9 -5
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code-block/chrome.d.ts +4 -1
- package/dist/components/code-block/chrome.d.ts.map +1 -1
- package/dist/components/code-block/chrome.js +5 -4
- package/dist/components/code-block/code-block.d.ts +7 -1
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/index.d.ts +1 -1
- package/dist/components/code-block/index.js +12 -10
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/code-block/notation.d.ts +5 -2
- package/dist/components/code-block/notation.d.ts.map +1 -1
- package/dist/components/code-block/static.d.ts +4 -1
- package/dist/components/code-block/static.d.ts.map +1 -1
- package/dist/components/code-block/static.js +5 -4
- package/dist/components/code-block/static.js.map +1 -1
- package/dist/components/collapse/collapse.d.ts +7 -3
- package/dist/components/collapse/collapse.d.ts.map +1 -1
- package/dist/components/collapse/index.js +2 -1
- package/dist/components/combobox/combobox.d.ts +11 -10
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +5 -4
- package/dist/components/combobox-list/index.js +6 -5
- package/dist/components/data-table/index.js +20 -19
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/index.js +12 -11
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/divider/divider.d.ts +3 -2
- package/dist/components/divider/divider.d.ts.map +1 -1
- package/dist/components/divider/index.js +1 -1
- package/dist/components/drawer/drawer.d.ts +6 -5
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.js +3 -2
- package/dist/components/field/field.d.ts +7 -4
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/file-upload/index.js +3 -2
- 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/input/input.d.ts +3 -2
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/menu/index.js +3 -2
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/menu-data.d.ts +6 -1
- package/dist/components/menu/menu-data.d.ts.map +1 -1
- package/dist/components/menu/menu.d.ts +5 -5
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/modal/index.js +3 -2
- package/dist/components/modal/modal.d.ts +4 -3
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +6 -5
- package/dist/components/multi-select/index.js +7 -6
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/nav-link/index.js +3 -2
- package/dist/components/nav-link/tanstack.js +3 -2
- package/dist/components/nav-link/tanstack.js.map +1 -1
- package/dist/components/notification/index.js +4 -3
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +3 -2
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/number-input/index.js +4 -4
- package/dist/components/overlays/index.js +5 -4
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/password-input/index.js +2 -2
- package/dist/components/pill/index.js +2 -1
- package/dist/components/pill/pill.d.ts +4 -2
- package/dist/components/pill/pill.d.ts.map +1 -1
- package/dist/components/pills-input/index.js +5 -4
- package/dist/components/pills-input/pills-input.d.ts +3 -2
- package/dist/components/pills-input/pills-input.d.ts.map +1 -1
- package/dist/components/pin-input/index.js +2 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.d.ts +3 -2
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.js +1 -0
- package/dist/components/progress/index.js.map +1 -1
- package/dist/components/progress/progress.d.ts +3 -2
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/rating/index.js +2 -1
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts +3 -2
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.d.ts +2 -2
- package/dist/components/schedule/index.js +50 -23
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/schedule/schedule-agenda-list.d.ts +6 -7
- package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -1
- package/dist/components/schedule/schedule-agenda-view.d.ts +19 -16
- package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
- package/dist/components/schedule/schedule-days-view.d.ts +3 -2
- package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-month-view.d.ts +3 -2
- package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-next-up.d.ts +4 -3
- package/dist/components/schedule/schedule-next-up.d.ts.map +1 -1
- package/dist/components/schedule/schedule-toolbar.d.ts +1 -1
- package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
- package/dist/components/schedule/schedule-types.d.ts +5 -3
- package/dist/components/schedule/schedule-types.d.ts.map +1 -1
- package/dist/components/schedule/schedule-views.d.ts +2 -2
- package/dist/components/schedule/schedule-views.d.ts.map +1 -1
- package/dist/components/schedule/schedule-year-view.d.ts +3 -2
- package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule.d.ts +9 -6
- package/dist/components/schedule/schedule.d.ts.map +1 -1
- package/dist/components/segment-group/index.js +2 -2
- package/dist/components/select/index.js +4 -4
- package/dist/components/slider/index.js +2 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/slider.d.ts +3 -2
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/tabs-data.d.ts +3 -2
- package/dist/components/tabs/tabs-data.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +6 -5
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/time-input/index.js +6 -6
- package/dist/components/timeline/index.js +8 -5
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +2 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.js +6 -5
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-select/index.js +3 -3
- package/dist/lib/as-child.d.ts +104 -0
- package/dist/lib/as-child.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +809 -0
- package/src/components/accordion/accordion-data.tsx +8 -5
- package/src/components/accordion/accordion.test.tsx +40 -0
- package/src/components/accordion/accordion.tsx +23 -6
- package/src/components/action-icon/action-icon.tsx +9 -24
- package/src/components/alert/alert.test.tsx +17 -0
- package/src/components/alert/alert.tsx +21 -2
- package/src/components/app-shell/app-shell.tsx +3 -1
- package/src/components/breadcrumb/breadcrumb.test.tsx +30 -0
- package/src/components/breadcrumb/breadcrumb.tsx +21 -12
- package/src/components/button/button.tsx +21 -50
- package/src/components/circular-progress/circular-progress.tsx +4 -1
- package/src/components/clipboard/clipboard.test.tsx +18 -0
- package/src/components/clipboard/clipboard.tsx +8 -2
- package/src/components/code-block/chrome.tsx +60 -36
- package/src/components/code-block/code-block.test.tsx +27 -0
- package/src/components/code-block/code-block.tsx +13 -3
- package/src/components/code-block/notation.test.ts +8 -0
- package/src/components/code-block/notation.ts +6 -3
- package/src/components/code-block/static.tsx +8 -2
- package/src/components/collapse/collapse.tsx +33 -15
- package/src/components/combobox/combobox.test.tsx +38 -0
- package/src/components/combobox/combobox.tsx +24 -10
- package/src/components/divider/divider.tsx +3 -1
- package/src/components/drawer/drawer.tsx +37 -16
- package/src/components/field/field.tsx +7 -3
- package/src/components/input/input.tsx +3 -1
- package/src/components/menu/menu-data.tsx +8 -1
- package/src/components/menu/menu.test.tsx +52 -0
- package/src/components/menu/menu.tsx +83 -35
- package/src/components/modal/close-trigger.test.tsx +38 -0
- package/src/components/modal/modal.tsx +29 -13
- package/src/components/notification/notification.tsx +4 -1
- package/src/components/pill/pill.tsx +29 -20
- package/src/components/pills-input/pills-input.tsx +3 -1
- package/src/components/popover/popover.tsx +3 -1
- package/src/components/progress/progress.tsx +4 -1
- package/src/components/rating/rating.tsx +27 -23
- package/src/components/schedule/index.ts +1 -1
- package/src/components/schedule/schedule-agenda-list.tsx +6 -7
- package/src/components/schedule/schedule-agenda-view.test.tsx +105 -28
- package/src/components/schedule/schedule-agenda-view.tsx +41 -28
- package/src/components/schedule/schedule-dates.test.ts +37 -52
- package/src/components/schedule/schedule-dates.ts +22 -25
- package/src/components/schedule/schedule-days-view.tsx +3 -1
- package/src/components/schedule/schedule-month-view.tsx +3 -1
- package/src/components/schedule/schedule-next-up.tsx +6 -2
- package/src/components/schedule/schedule-toolbar.test.tsx +26 -0
- package/src/components/schedule/schedule-toolbar.tsx +13 -1
- package/src/components/schedule/schedule-types.ts +5 -3
- package/src/components/schedule/schedule-views.ts +4 -5
- package/src/components/schedule/schedule-year-view.tsx +3 -1
- package/src/components/schedule/schedule.test.tsx +66 -22
- package/src/components/schedule/schedule.tsx +22 -13
- package/src/components/slider/slider.tsx +4 -0
- package/src/components/tabs/tabs-data.tsx +17 -14
- package/src/components/timeline/timeline.tsx +102 -95
- package/src/components/tooltip/tooltip.tsx +2 -1
- package/src/lib/as-child.test.tsx +70 -0
- package/src/lib/as-child.ts +119 -0
- package/dist/chunk-2762HZYX.js.map +0 -1
- package/dist/chunk-2H46IXW4.js.map +0 -1
- package/dist/chunk-6SWK4XG5.js.map +0 -1
- package/dist/chunk-EVVMHTCL.js.map +0 -1
- package/dist/chunk-HWNPXAEN.js +0 -31
- package/dist/chunk-HWNPXAEN.js.map +0 -1
- package/dist/chunk-IFWCCAQV.js.map +0 -1
- package/dist/chunk-IXKELBJA.js.map +0 -1
- package/dist/chunk-J3PELDH3.js.map +0 -1
- package/dist/chunk-NGAQITWP.js.map +0 -1
- package/dist/chunk-POKDSVQT.js.map +0 -1
- package/dist/chunk-QMW7D5GU.js.map +0 -1
- package/dist/chunk-TNNH3FVQ.js.map +0 -1
- package/dist/chunk-U5GW5EBR.js.map +0 -1
- package/dist/chunk-UNSAA7YG.js.map +0 -1
- package/dist/chunk-VLUKI3HL.js.map +0 -1
- package/dist/chunk-VZ2TPU4B.js.map +0 -1
- package/dist/chunk-YIQI2CF3.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/timeline/timeline.tsx"],"names":["lineVariant"],"mappings":";;;;;;;;AAuBA,IAAM,WAAA,GAAoC;AAAA,EACxC,EAAA,EAAI,UAAA;AAAA,EACJ,EAAA,EAAI,MAAA;AAAA,EACJ,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI,QAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAyCA,IAAM,gBAAA,GAAmB,GAAA;AAAA,EACvB;AAAA,IACE,qFAAA;AAAA;AAAA;AAAA,IAGA,4FAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,qCAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI;AAAA,UACF,6CAAA;AAAA,UACA,uBAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,EAAA,EAAI;AAAA,UACF,2CAAA;AAAA,UACA,uBAAA;A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,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 { 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 ...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 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 {/* 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 {children}\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,EAAA,EAAI,MAAA;AAAA,EACJ,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI,QAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAyCA,IAAM,gBAAA,GAAmB,GAAA;AAAA,EACvB;AAAA,IACE,qFAAA;AAAA;AAAA;AAAA,IAGA,4FAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,qCAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI;AAAA,UACF,6CAAA;AAAA,UACA,uBAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,EAAA,EAAI;AAAA,UACF,2CAAA;AAAA,UACA,uBAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,EAAA,EAAI;AAAA,UACF,4CAAA;AAAA,UACA,uBAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,EAAA,EAAI;AAAA,UACF,+CAAA;AAAA,UACA,uBAAA;AA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AG,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"]}
|
|
@@ -154,7 +154,7 @@ type TimelineItemInternalProps = TimelineItemProps & {
|
|
|
154
154
|
* `Timeline.Content`, which place themselves into the shared column tracks.
|
|
155
155
|
* The line to the next item is suppressed automatically on the last item.
|
|
156
156
|
*/
|
|
157
|
-
declare const TimelineItem: ({ className, color, variant, bullet, size, lineVariant, gradient, axisOffset, style, children, prevItem, nextItem, state, active: _active, testId, ...rest }: TimelineItemInternalProps) => import("react").JSX.Element;
|
|
157
|
+
declare const TimelineItem: ({ className, color, variant, bullet, size, lineVariant, gradient, axisOffset, style, children, prevItem, nextItem, state, active: _active, testId, asChild, ...rest }: TimelineItemInternalProps) => import("react").JSX.Element;
|
|
158
158
|
export type TimelineLabelProps = Omit<HTMLArkProps<"span">, "color"> & WithTestId & {
|
|
159
159
|
/** Tints the label (and any icon inside it) to match the item's accent —
|
|
160
160
|
* pass the same value given to the `Timeline.Item`'s `color`. Omit it to
|
|
@@ -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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IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,GAClE,UAAU,GAAG;IACX;;yCAEqC;IACrC,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAEH;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,0CAA2C,kBAAkB,gCAY/E,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,UAAU,CAAA;AAEnE;wCACwC;AACxC,QAAA,MAAM,eAAe,mCAAoC,oBAAoB,gCAO5E,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,UAAU,CAAA;AAElE;;;;;;;;;uEASuE;AACvE,QAAA,MAAM,aAAa,mCAAoC,kBAAkB,gCAMxE,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;CAKnB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Tooltip as ArkTooltip } from "@ark-ui/react/tooltip";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
import { type ReactNode } from "react";
|
|
4
|
+
import type { NoAsChild } from "../../lib/as-child";
|
|
4
5
|
import { type LogicalPosition } from "../../lib/placement";
|
|
5
6
|
import type { WithTestId } from "../../lib/test-id";
|
|
6
7
|
/** Resets the `<button>` Ark renders for the default trigger down to plain inline
|
|
@@ -31,7 +32,7 @@ export type TooltipRootProps = Omit<ArkTooltip.RootProps, "positioning"> & {
|
|
|
31
32
|
declare const Root: ({ position, offset, withinPortal, container, children, onOpenChange, onClose, ...rest }: TooltipRootProps) => import("react").JSX.Element;
|
|
32
33
|
export type TooltipContentProps = ArkTooltip.ContentProps & WithTestId;
|
|
33
34
|
declare const Content: ({ className, children, testId, ...rest }: TooltipContentProps) => import("react").JSX.Element;
|
|
34
|
-
export type TooltipArrowProps = ArkTooltip.ArrowProps & WithTestId;
|
|
35
|
+
export type TooltipArrowProps = NoAsChild<ArkTooltip.ArrowProps> & WithTestId;
|
|
35
36
|
/** The little arrow linking the bubble to its trigger. Compose it inside a
|
|
36
37
|
* `Tooltip.Content` (or let the convenience form's `withArrow` add it for you).
|
|
37
38
|
* The CSS vars size the square (`--arrow-size`) and pull it back under the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAiB,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAiB,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAA;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAInD,OAAO,EAAE,KAAK,eAAe,EAA2B,MAAM,qBAAqB,CAAA;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AA+DnD;;qFAEqF;AACrF,QAAA,MAAM,cAAc;;8EAkBnB,CAAA;AAED,KAAK,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAA;AAElG;oFACoF;AACpF,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAA;AAQ/D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,aAAa,CAAC,GAAG;IACzE;;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16 @@
|
|
|
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 { inputSlot, placeholderColor, inputShell, inputControlClasses } from '../../chunk-
|
|
6
|
-
import { FieldShell } from '../../chunk-
|
|
7
|
-
import { Popover, popoverClearTrigger, popoverChevron, popoverEmpty } from '../../chunk-
|
|
3
|
+
import { usePillOverflow, PillOverflowCounter, pillsContent, pillsShell } from '../../chunk-AE7QTLJ5.js';
|
|
4
|
+
import { Pill } from '../../chunk-Z2Z5EXVT.js';
|
|
5
|
+
import { inputSlot, placeholderColor, inputShell, inputControlClasses } from '../../chunk-5OQLFX47.js';
|
|
6
|
+
import { FieldShell } from '../../chunk-FHG54IT5.js';
|
|
7
|
+
import { Popover, popoverClearTrigger, popoverChevron, popoverEmpty } from '../../chunk-6GDMSENK.js';
|
|
8
8
|
import '../../chunk-AIQG7IIT.js';
|
|
9
9
|
import '../../chunk-7P32XCEU.js';
|
|
10
10
|
import '../../chunk-BUIHQJGE.js';
|
|
11
11
|
import { useUncontrolled } from '../../chunk-BEL75C7N.js';
|
|
12
12
|
import { CloseIcon, ChevronIcon, CheckIcon, MinusIcon } from '../../chunk-IG7FBZVM.js';
|
|
13
|
+
import '../../chunk-I4SQQIP5.js';
|
|
13
14
|
import { props } from '../../chunk-WYCMIIRR.js';
|
|
14
15
|
import '../../chunk-B2LCHXUB.js';
|
|
15
16
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tree-multi-select/tree-multi-select.tsx"],"names":["value","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;AAoEA,IAAM,aAAA,GAAgB,CAAC,IAAA,EAAoB,GAAA,GAAgB,EAAC,KAAgB;AAC1E,EAAA,IA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A,YAAA;AAAA,cACC,IAAA,EAAK,MAAA;AAAA,cACL,sBAAA,EAAqB,MAAA;AAAA,cACrB,kBAAA,EAAiB,UAAA;AAAA,cACjB,SAAA,EAAW,aAAA;AAAA,cACX,SAAA,EAAU,eAAA;AAAA,cAET,QAAA,EAAA,YAAA,CAAa,GAAA;AAAA,gBAAI,CAAC,MAAM,CAAA,KACvB,UAAA;AAAA;AAAA;AAAA,kBAGE,IAAA;AAAA,kBACA,CAAA;AAAA,kBACA,EAAC;AAAA,kBACD,CAAA,KAAM,aAAa,MAAA,GAAS;AAAA;AAC9B;AACF;AAAA,WACF,EAEJ;AAAA,SAAA,EACF,CAAA;AAAA,QAIC,IAAA,IAAQ,IAAA,IAAQ,KAAA,CAAM,GAAA,CAAI,CAAC,CAAA,qBAAM,GAAA,CAAC,OAAA,EAAA,EAAc,IAAA,EAAK,QAAA,EAAS,IAAA,EAAY,KAAA,EAAO,CAAA,EAAA,EAApC,CAAuC,CAAE;AAAA;AAAA;AAAA,GACzF;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { cva } from \"class-variance-authority\"\nimport {\n type FocusEvent,\n Fragment,\n type ReactNode,\n type Ref,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { ClearSectionMode } from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport {\n buildMaps,\n filterTree,\n flattenTree,\n isLeaf,\n type RenderTreeMultiSelectItem,\n type TreeNodeData,\n type TreePayload,\n type TreeSelectData,\n type TreeValue,\n} from \"../../lib/tree-data\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n} from \"../input/input\"\nimport { Pill } from \"../pill/pill\"\nimport {\n PillOverflowCounter,\n pillsContent,\n pillsShell,\n usePillOverflow,\n} from \"../pills-input/pills-input\"\nimport { CheckIcon, ChevronIcon, CloseIcon, MinusIcon } from \"../popover/icons\"\nimport { Popover, popoverChevron, popoverClearTrigger, popoverEmpty } from \"../popover/popover\"\n\n/**\n * TreeMultiSelect — pick several values from hierarchical data, shown as a fully\n * expanded checkbox tree inside a Popover. There is no expand/collapse: every\n * node is always visible. Top-level rows sit flush; their descendants are\n * connected by indent guide lines. Each row carries a checkbox; checking a\n * branch cascades to all its leaves, and a branch with a partial selection\n * reads as indeterminate. A search field at the top of the popover filters the\n * tree without competing with the trigger's pills.\n *\n * - `data` is a tree of `{ value, label, disabled?, children? }`.\n * - `value` is the selected **leaf** values (`string[]`); branch state is\n * derived. The trigger renders them as removable pills, like MultiSelect.\n * - Label / description / error come from the built-in `Field`.\n * - For a single-value tree picker, use `TreeSelect`.\n */\n\ntype NodeState = \"checked\" | \"indeterminate\" | \"unchecked\"\n\n/** Every *enabled* leaf value under `node` (the node itself when it's a leaf). */\nconst getLeafValues = (node: TreeNodeData, acc: string[] = []): string[] => {\n if (isLeaf(node)) {\n if (!node.disabled) acc.push(node.value)\n return acc\n }\n if (node.children) for (const child of node.children) getLeafValues(child, acc)\n return acc\n}\n\n/** Tri-state of a node, derived from the set of selected leaf values. */\nconst getNodeState = (node: TreeNodeData, selected: Set<string>): NodeState => {\n const leaves = getLeafValues(node)\n if (leaves.length === 0) return \"unchecked\"\n let on = 0\n for (const v of leaves) if (selected.has(v)) on++\n if (on === 0) return \"unchecked\"\n return on === leaves.length ? \"checked\" : \"indeterminate\"\n}\n\n/** Toggle a node: fully-checked clears its leaves, otherwise selects them all. */\nconst toggleNode = (node: TreeNodeData, current: string[]): string[] => {\n const leaves = getLeafValues(node)\n if (leaves.length === 0) return current\n const set = new Set(current)\n const fullyChecked = leaves.every((v) => set.has(v))\n for (const v of leaves) fullyChecked ? set.delete(v) : set.add(v)\n return [...set]\n}\n\n/** Indent guide / connector colour, shared by rails and the elbow. */\nconst treeLine = \"bg-brand-900/20 dark:bg-white/15\"\n\n// Hover/active are neutral and transparent — a low-opacity black/white wash,\n// not an opaque gray — matching the popover surface's own background-\n// dependent tint (no Figma reference for this state yet).\nconst treeRow = cva(\n [\n \"group/row relative flex w-full items-center rounded-sm ps-1.5 outline-none select-none cursor-pointer\",\n \"text-gray-light-900 dark:text-gray-dark-100\",\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n \"data-active:bg-black/5 dark:data-active:bg-white/8\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-brand-500/40\",\n ],\n {\n variants: {\n size: {\n xs: \"min-h-7 pe-1.5 text-xs\",\n sm: \"min-h-8 pe-2 text-sm\",\n md: \"min-h-9 pe-2 text-md\",\n lg: \"min-h-10 pe-2.5 text-lg\",\n xl: \"min-h-11 pe-3 text-xl\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst treeCheckbox = cva(\n [\n \"inline-flex shrink-0 items-center justify-center rounded-xs border transition-colors\",\n \"border-gray-light-300 dark:border-gray-dark-700\",\n \"bg-gray-light-25 dark:bg-gray-dark-900\",\n \"text-(--c-on-solid)\",\n \"group-data-checked/row:border-(--c-solid) group-data-checked/row:bg-(--c-solid)\",\n \"group-data-mixed/row:border-(--c-solid) group-data-mixed/row:bg-(--c-solid)\",\n ],\n {\n variants: {\n size: {\n xs: \"size-3.5 [&_svg]:size-2.5\",\n sm: \"size-4 [&_svg]:size-3\",\n md: \"size-4 [&_svg]:size-3\",\n lg: \"size-4.5 [&_svg]:size-3.5\",\n xl: \"size-5 [&_svg]:size-4\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\ntype TreeMultiSelectClassNames = {\n field?: string\n trigger?: string\n popover?: string\n search?: string\n node?: string\n label?: string\n checkbox?: string\n pill?: string\n}\n\nexport type TreeMultiSelectProps<Data extends TreeSelectData = TreeNodeData[]> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Hierarchical options. */\n data: Data\n /** Controlled selection — the selected leaf values. */\n value?: TreeValue<Data>[]\n /** Uncontrolled initial selection. */\n defaultValue?: TreeValue<Data>[]\n /** Fires with the full leaf selection on every toggle / removal. */\n onChange?: (value: TreeValue<Data>[]) => void\n /**\n * Render each node's content yourself. Receives the node and its live\n * `{ checked, indeterminate, leaf, disabled, depth }` state; the component keeps\n * the row (treeitem role, indent rails, roving focus, click), the callback fills\n * the content after the rails — including any checkbox. Omit it for the default\n * checkbox + label.\n */\n renderItem?: RenderTreeMultiSelectItem<TreePayload<Data>>\n /** Show a button that clears the whole selection. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Show a search field that filters the tree. Default `true`. */\n searchable?: boolean\n /** Placeholder for the search field. */\n searchPlaceholder?: string\n /** Message shown when the search matches nothing. */\n empty?: ReactNode\n /** Placeholder shown while nothing is selected. */\n placeholder?: string\n /** Cap the pills at N rows; the rest collapse into a static \"+N\" counter. */\n maxLines?: number\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the clear button / chevron. */\n endSlot?: ReactNode\n size?: InputSize\n variant?: InputVariant\n color?: Color\n disabled?: boolean\n /** Keeps full contrast but blocks opening and toggling. */\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Wires hidden inputs into native form submission. */\n name?: string\n /** Forwarded to the trigger; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n /** Lands on the trigger `<div role=\"combobox\">` for focus-on-error. */\n ref?: Ref<HTMLDivElement>\n className?: string\n classNames?: TreeMultiSelectClassNames\n }\n\nexport const TreeMultiSelect = <const Data extends TreeSelectData = TreeNodeData[]>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n clearable = false,\n clearSectionMode = \"replace\",\n searchable = false,\n searchPlaceholder = \"Search…\",\n empty = \"Nothing found\",\n placeholder = \"Pick values\",\n maxLines,\n startSlot,\n endSlot,\n size = \"md\",\n variant = \"default\",\n color,\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: TreeMultiSelectProps<Data>) => {\n const [value, setValue] = useUncontrolled<TreeValue<Data>[]>({\n value: valueProp,\n defaultValue: defaultValue ?? [],\n onChange,\n finalValue: [],\n })\n const [open, setOpen] = useState(false)\n const [search, setSearch] = useState(\"\")\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const { labelMap, nodeMap } = useMemo(() => buildMaps(data), [data])\n const selectedSet = useMemo(() => new Set(value), [value])\n const filteredData = useMemo(\n () => (searchable ? filterTree(data, search) : data),\n [data, search, searchable],\n )\n const flat = useMemo(() => flattenTree(filteredData, !!disabled), [filteredData, disabled])\n const enabledValues = useMemo(() => flat.filter((f) => !f.disabled).map((f) => f.value), [flat])\n\n const [activeValueState, setActiveValue] = useState<string | null>(null)\n const activeValue =\n activeValueState != null && enabledValues.includes(activeValueState)\n ? activeValueState\n : (enabledValues[0] ?? null)\n\n const searchRef = useRef<HTMLInputElement>(null)\n const rowRefs = useRef(new Map<string, HTMLDivElement>())\n const registerRow = (value: string, el: HTMLDivElement | null) => {\n if (el) rowRefs.current.set(value, el)\n else rowRefs.current.delete(value)\n }\n const focusRow = (next: string | null) => {\n if (next == null) return\n setActiveValue(next)\n rowRefs.current.get(next)?.focus()\n }\n\n // On open, focus the search field (or the active row). Initial focus only.\n // biome-ignore lint/correctness/useExhaustiveDependencies: re-running on activeValue would steal focus while navigating the tree.\n useEffect(() => {\n if (!open) return\n const id = requestAnimationFrame(() => {\n // preventScroll: the content is portaled, so focusing it before the\n // positioner places it would otherwise warp the page to the top.\n if (searchable) searchRef.current?.focus({ preventScroll: true })\n else if (activeValue) rowRefs.current.get(activeValue)?.focus({ preventScroll: true })\n })\n return () => cancelAnimationFrame(id)\n }, [open, searchable])\n\n const toggle = (node: TreeNodeData) => setValue(toggleNode(node, value) as TreeValue<Data>[])\n const removeValue = (v: string) => setValue(value.filter((x) => x !== v))\n\n const { containerRef, visibleCount, hiddenCount } = usePillOverflow({\n maxLines,\n count: value.length,\n })\n\n const moveActive = (dir: 1 | -1) => {\n if (enabledValues.length === 0) return\n const idx = activeValue ? enabledValues.indexOf(activeValue) : -1\n const next =\n idx === -1\n ? dir === 1\n ? 0\n : enabledValues.length - 1\n : Math.min(Math.max(idx + dir, 0), enabledValues.length - 1)\n focusRow(enabledValues[next] ?? null)\n }\n\n const onTreeKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault()\n moveActive(1)\n break\n case \"ArrowUp\":\n event.preventDefault()\n moveActive(-1)\n break\n case \"Home\":\n event.preventDefault()\n focusRow(enabledValues[0] ?? null)\n break\n case \"End\":\n event.preventDefault()\n focusRow(enabledValues[enabledValues.length - 1] ?? null)\n break\n case \" \":\n case \"Enter\": {\n event.preventDefault()\n const node = activeValue ? nodeMap.get(activeValue) : undefined\n if (node && !(disabled || readOnly || node.disabled)) toggle(node)\n break\n }\n }\n }\n\n const onSearchKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault()\n focusRow(enabledValues[0] ?? null)\n }\n }\n\n const renderNode = (\n node: TreeNodeData<TreePayload<Data>>,\n depth: number,\n ancestorHasNextSibling: boolean[],\n isLast: boolean,\n ): ReactNode => {\n // Render structure comes from the (possibly filtered) node, but cascade\n // state is derived from the original node so hidden leaves still count.\n const source = nodeMap.get(node.value) ?? node\n const state = getNodeState(source, selectedSet)\n const checked = state === \"checked\"\n const mixed = state === \"indeterminate\"\n const nodeDisabled = disabled || node.disabled\n const rowTestId = node.testId ?? `item-${node.value}`\n\n // Content after the indent rails. A custom `renderItem` owns the whole slot\n // (incl. the checkbox); otherwise render the presentational checkbox + label.\n const content = renderItem ? (\n renderItem(node, {\n checked,\n indeterminate: mixed,\n leaf: isLeaf(source),\n disabled: !!nodeDisabled,\n depth,\n })\n ) : (\n <>\n {/* presentational checkbox — state lives on the row's aria-checked */}\n <span aria-hidden className={cn(treeCheckbox({ size }), classNames?.checkbox)}>\n {checked && <CheckIcon />}\n {mixed && <MinusIcon />}\n </span>\n\n <span className={cn(\"ms-1.5 min-w-0 flex-1 truncate text-start\", classNames?.label)}>\n {node.label}\n </span>\n </>\n )\n\n return (\n <Fragment key={node.value}>\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: row activation (Enter/Space) is handled centrally by the tree container's onKeyDown via roving focus, not co-located per row. */}\n <div\n role=\"treeitem\"\n aria-level={depth + 1}\n aria-checked={mixed ? \"mixed\" : checked}\n aria-disabled={nodeDisabled || undefined}\n data-checked={checked || undefined}\n data-mixed={mixed || undefined}\n data-active={node.value === activeValue || undefined}\n data-disabled={nodeDisabled || undefined}\n data-testid={rowTestId}\n tabIndex={node.value === activeValue ? 0 : -1}\n ref={(el) => registerRow(node.value, el)}\n onClick={() => {\n if (nodeDisabled || readOnly) return\n setActiveValue(node.value)\n toggle(source)\n }}\n className={cn(treeRow({ size }), classNames?.node)}\n >\n {/* Top-level rows sit flush; only descendants carry guide lines. */}\n {depth > 0 && (\n <>\n {/* ancestor rails: a vertical guide where that ancestor has a sibling below */}\n {ancestorHasNextSibling.map((hasNext, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: Indentation is stable inside component, we would want to rerender anyway.\n <span key={i} aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n {hasNext && (\n <span className={cn(\"absolute inset-y-0 inset-s-1/2 w-px\", treeLine)} />\n )}\n </span>\n ))}\n\n {/* connector: vertical (├ continues / └ stops) + horizontal elbow */}\n <span aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n <span\n className={cn(\n \"absolute inset-s-1/2 top-0 w-px\",\n treeLine,\n isLast ? \"h-1/2\" : \"bottom-0\",\n )}\n />\n <span className={cn(\"absolute inset-s-1/2 top-1/2 h-px w-1/2\", treeLine)} />\n </span>\n </>\n )}\n\n {content}\n </div>\n\n {node.children?.map((child, i) =>\n renderNode(\n child,\n depth + 1,\n depth === 0 ? [] : [...ancestorHasNextSibling, !isLast],\n i === (node.children?.length ?? 0) - 1,\n ),\n )}\n </Fragment>\n )\n }\n\n const showClear = clearable && value.length > 0 && !disabled && !readOnly\n const control = (\n <Popover.Root\n open={open}\n onOpenChange={(details) => {\n if (disabled || readOnly) return\n setOpen(details.open)\n if (!details.open) setSearch(\"\")\n }}\n // We move focus into the search field / active row ourselves (with\n // preventScroll); Ark's autofocus would scroll the page to the top.\n autoFocus={false}\n width=\"target\"\n >\n <Popover.Trigger asChild>\n <div\n ref={ref}\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n aria-invalid={isInvalid || undefined}\n data-color={color}\n {...props({\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": startSlot != null,\n // The trigger always ends in a chevron (and optional clear).\n \"data-with-end-slot\": true,\n // The shell IS the tabbable/focusable element here (no separate\n // inner control to route to), so `testId` lands directly on it.\n \"data-testid\": testId,\n })}\n tabIndex={disabled ? -1 : 0}\n onBlur={onBlur}\n onKeyDown={(event) => {\n if (disabled || readOnly) return\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"ArrowDown\") {\n event.preventDefault()\n setOpen(true)\n }\n }}\n className={cn(\n inputShell({ size, variant }),\n pillsShell,\n \"cursor-pointer\",\n className,\n classNames?.trigger,\n )}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={pillsContent({ size })}>\n {value.length === 0 ? (\n <span className={cn(\"min-w-0 flex-1 truncate\", placeholderColor)}>{placeholder}</span>\n ) : (\n <>\n {value.slice(0, visibleCount).map((v) => (\n <Pill\n key={v}\n size={size}\n disabled={disabled}\n withRemoveButton={!disabled && !readOnly}\n onRemove={() => removeValue(v)}\n className={classNames?.pill}\n data-overflow-item\n >\n {labelMap.get(v) ?? v}\n </Pill>\n ))}\n {hiddenCount > 0 && <PillOverflowCounter count={hiddenCount} size={size} />}\n </>\n )}\n </div>\n\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {showClear && (\n <button\n type=\"button\"\n aria-label=\"Clear all\"\n onPointerDown={(event) => {\n event.preventDefault()\n event.stopPropagation()\n }}\n onClick={(event) => {\n event.stopPropagation()\n setValue([])\n }}\n className={popoverClearTrigger}\n >\n <CloseIcon />\n </button>\n )}\n {(clearSectionMode === \"both\" || !showClear) && (\n <span aria-hidden data-chevron className={cn(popoverChevron, open && \"rotate-180\")}>\n <ChevronIcon />\n </span>\n )}\n </div>\n </Popover.Trigger>\n\n <Popover.Content data-color={color} className={classNames?.popover}>\n {searchable && (\n <Popover.Header>\n <input\n ref={searchRef}\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n onKeyDown={onSearchKeyDown}\n placeholder={searchPlaceholder}\n aria-label=\"Search\"\n className={cn(inputControlClasses, \"text-sm\", classNames?.search)}\n />\n </Popover.Header>\n )}\n\n <Popover.Body>\n {flat.length === 0 ? (\n <div className={popoverEmpty}>{empty}</div>\n ) : (\n <div\n role=\"tree\"\n aria-multiselectable=\"true\"\n aria-orientation=\"vertical\"\n onKeyDown={onTreeKeyDown}\n className=\"flex flex-col\"\n >\n {filteredData.map((node, i) =>\n renderNode(\n // `filterTree` only removes non-matching nodes — it can't change\n // their payload shape, so this is the same shape as `data`'s.\n node as TreeNodeData<TreePayload<Data>>,\n 0,\n [],\n i === filteredData.length - 1,\n ),\n )}\n </div>\n )}\n </Popover.Body>\n </Popover.Content>\n\n {/* Hidden inputs (one per value) for native `<form>` submission; form\n libraries instead read the value via `onChange`. */}\n {name != null && value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)}\n </Popover.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree-multi-select/tree-multi-select.tsx"],"names":["value","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;AAoEA,IAAM,aAAA,GAAgB,CAAC,IAAA,EAAoB,GAAA,GAAgB,EAAC,KAAgB;AAC1E,EAAA,IAAI,MAAA,CAAO,IAAI,CAAA,EAAG;AAChB,IAAA,IAAI,CAAC,IAAA,CAAK,QAAA,EAAU,GAAA,CAAI,IAAA,CAAK,KAAK,KAAK,CAAA;AACvC,IAAA,OAAO,GAAA;AAAA,EACT;AACA,EAAA,IAAI,IAAA,CAAK,UAAU,KAAA,MAAW,KAAA,IAAS,KAAK,QAAA,EAAU,aAAA,CAAc,OAAO,GAAG,CAAA;AAC9E,EAAA,OAAO,GAAA;AACT,CAAA;AAGA,IAAM,YAAA,GAAe,CAAC,IAAA,EAAoB,QAAA,KAAqC;AAC7E,EAAA,MAAM,MAAA,GAAS,cAAc,IAAI,CAAA;AACjC,EAAA,IAAI,MAAA,CAAO,MAAA,KAAW,CAAA,EAAG,OAAO,WAAA;AAChC,EAAA,IAAI,EAAA,GAAK,CAAA;AACT,EAAA,KAAA,MAAW,KAAK,MAAA,EAAQ,IAAI,QAAA,CAAS,GAAA,CAAI,CAAC,CAAA,EAAG,EAAA,EAAA;AAC7C,EAAA,IAAI,EAAA,KAAO,GAAG,OAAO,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A,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { cva } from \"class-variance-authority\"\nimport {\n type FocusEvent,\n Fragment,\n type ReactNode,\n type Ref,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { ClearSectionMode } from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport {\n buildMaps,\n filterTree,\n flattenTree,\n isLeaf,\n type RenderTreeMultiSelectItem,\n type TreeNodeData,\n type TreePayload,\n type TreeSelectData,\n type TreeValue,\n} from \"../../lib/tree-data\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n} from \"../input/input\"\nimport { Pill } from \"../pill/pill\"\nimport {\n PillOverflowCounter,\n pillsContent,\n pillsShell,\n usePillOverflow,\n} from \"../pills-input/pills-input\"\nimport { CheckIcon, ChevronIcon, CloseIcon, MinusIcon } from \"../popover/icons\"\nimport { Popover, popoverChevron, popoverClearTrigger, popoverEmpty } from \"../popover/popover\"\n\n/**\n * TreeMultiSelect — pick several values from hierarchical data, shown as a fully\n * expanded checkbox tree inside a Popover. There is no expand/collapse: every\n * node is always visible. Top-level rows sit flush; their descendants are\n * connected by indent guide lines. Each row carries a checkbox; checking a\n * branch cascades to all its leaves, and a branch with a partial selection\n * reads as indeterminate. A search field at the top of the popover filters the\n * tree without competing with the trigger's pills.\n *\n * - `data` is a tree of `{ value, label, disabled?, children? }`.\n * - `value` is the selected **leaf** values (`string[]`); branch state is\n * derived. The trigger renders them as removable pills, like MultiSelect.\n * - Label / description / error come from the built-in `Field`.\n * - For a single-value tree picker, use `TreeSelect`.\n */\n\ntype NodeState = \"checked\" | \"indeterminate\" | \"unchecked\"\n\n/** Every *enabled* leaf value under `node` (the node itself when it's a leaf). */\nconst getLeafValues = (node: TreeNodeData, acc: string[] = []): string[] => {\n if (isLeaf(node)) {\n if (!node.disabled) acc.push(node.value)\n return acc\n }\n if (node.children) for (const child of node.children) getLeafValues(child, acc)\n return acc\n}\n\n/** Tri-state of a node, derived from the set of selected leaf values. */\nconst getNodeState = (node: TreeNodeData, selected: Set<string>): NodeState => {\n const leaves = getLeafValues(node)\n if (leaves.length === 0) return \"unchecked\"\n let on = 0\n for (const v of leaves) if (selected.has(v)) on++\n if (on === 0) return \"unchecked\"\n return on === leaves.length ? \"checked\" : \"indeterminate\"\n}\n\n/** Toggle a node: fully-checked clears its leaves, otherwise selects them all. */\nconst toggleNode = (node: TreeNodeData, current: string[]): string[] => {\n const leaves = getLeafValues(node)\n if (leaves.length === 0) return current\n const set = new Set(current)\n const fullyChecked = leaves.every((v) => set.has(v))\n for (const v of leaves) fullyChecked ? set.delete(v) : set.add(v)\n return [...set]\n}\n\n/** Indent guide / connector colour, shared by rails and the elbow. */\nconst treeLine = \"bg-brand-900/20 dark:bg-white/15\"\n\n// Hover/active are neutral and transparent — a low-opacity black/white wash,\n// not an opaque gray — matching the popover surface's own background-\n// dependent tint (no Figma reference for this state yet).\nconst treeRow = cva(\n [\n \"group/row relative flex w-full items-center rounded-sm ps-1.5 outline-none select-none cursor-pointer\",\n \"text-gray-light-900 dark:text-gray-dark-100\",\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n \"data-active:bg-black/5 dark:data-active:bg-white/8\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-brand-500/40\",\n ],\n {\n variants: {\n size: {\n xs: \"min-h-7 pe-1.5 text-xs\",\n sm: \"min-h-8 pe-2 text-sm\",\n md: \"min-h-9 pe-2 text-md\",\n lg: \"min-h-10 pe-2.5 text-lg\",\n xl: \"min-h-11 pe-3 text-xl\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst treeCheckbox = cva(\n [\n \"inline-flex shrink-0 items-center justify-center rounded-xs border transition-colors\",\n \"border-gray-light-300 dark:border-gray-dark-700\",\n \"bg-gray-light-25 dark:bg-gray-dark-900\",\n \"text-(--c-on-solid)\",\n \"group-data-checked/row:border-(--c-solid) group-data-checked/row:bg-(--c-solid)\",\n \"group-data-mixed/row:border-(--c-solid) group-data-mixed/row:bg-(--c-solid)\",\n ],\n {\n variants: {\n size: {\n xs: \"size-3.5 [&_svg]:size-2.5\",\n sm: \"size-4 [&_svg]:size-3\",\n md: \"size-4 [&_svg]:size-3\",\n lg: \"size-4.5 [&_svg]:size-3.5\",\n xl: \"size-5 [&_svg]:size-4\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\ntype TreeMultiSelectClassNames = {\n field?: string\n trigger?: string\n popover?: string\n search?: string\n node?: string\n label?: string\n checkbox?: string\n pill?: string\n}\n\nexport type TreeMultiSelectProps<Data extends TreeSelectData = TreeNodeData[]> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Hierarchical options. */\n data: Data\n /** Controlled selection — the selected leaf values. */\n value?: TreeValue<Data>[]\n /** Uncontrolled initial selection. */\n defaultValue?: TreeValue<Data>[]\n /** Fires with the full leaf selection on every toggle / removal. */\n onChange?: (value: TreeValue<Data>[]) => void\n /**\n * Render each node's content yourself. Receives the node and its live\n * `{ checked, indeterminate, leaf, disabled, depth }` state; the component keeps\n * the row (treeitem role, indent rails, roving focus, click), the callback fills\n * the content after the rails — including any checkbox. Omit it for the default\n * checkbox + label.\n */\n renderItem?: RenderTreeMultiSelectItem<TreePayload<Data>>\n /** Show a button that clears the whole selection. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Show a search field that filters the tree. Default `true`. */\n searchable?: boolean\n /** Placeholder for the search field. */\n searchPlaceholder?: string\n /** Message shown when the search matches nothing. */\n empty?: ReactNode\n /** Placeholder shown while nothing is selected. */\n placeholder?: string\n /** Cap the pills at N rows; the rest collapse into a static \"+N\" counter. */\n maxLines?: number\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the clear button / chevron. */\n endSlot?: ReactNode\n size?: InputSize\n variant?: InputVariant\n color?: Color\n disabled?: boolean\n /** Keeps full contrast but blocks opening and toggling. */\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Wires hidden inputs into native form submission. */\n name?: string\n /** Forwarded to the trigger; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n /** Lands on the trigger `<div role=\"combobox\">` for focus-on-error. */\n ref?: Ref<HTMLDivElement>\n className?: string\n classNames?: TreeMultiSelectClassNames\n }\n\nexport const TreeMultiSelect = <const Data extends TreeSelectData = TreeNodeData[]>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n clearable = false,\n clearSectionMode = \"replace\",\n searchable = false,\n searchPlaceholder = \"Search…\",\n empty = \"Nothing found\",\n placeholder = \"Pick values\",\n maxLines,\n startSlot,\n endSlot,\n size = \"md\",\n variant = \"default\",\n color,\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: TreeMultiSelectProps<Data>) => {\n const [value, setValue] = useUncontrolled<TreeValue<Data>[]>({\n value: valueProp,\n defaultValue: defaultValue ?? [],\n onChange,\n finalValue: [],\n })\n const [open, setOpen] = useState(false)\n const [search, setSearch] = useState(\"\")\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const { labelMap, nodeMap } = useMemo(() => buildMaps(data), [data])\n const selectedSet = useMemo(() => new Set(value), [value])\n const filteredData = useMemo(\n () => (searchable ? filterTree(data, search) : data),\n [data, search, searchable],\n )\n const flat = useMemo(() => flattenTree(filteredData, !!disabled), [filteredData, disabled])\n const enabledValues = useMemo(() => flat.filter((f) => !f.disabled).map((f) => f.value), [flat])\n\n const [activeValueState, setActiveValue] = useState<string | null>(null)\n const activeValue =\n activeValueState != null && enabledValues.includes(activeValueState)\n ? activeValueState\n : (enabledValues[0] ?? null)\n\n const searchRef = useRef<HTMLInputElement>(null)\n const rowRefs = useRef(new Map<string, HTMLDivElement>())\n const registerRow = (value: string, el: HTMLDivElement | null) => {\n if (el) rowRefs.current.set(value, el)\n else rowRefs.current.delete(value)\n }\n const focusRow = (next: string | null) => {\n if (next == null) return\n setActiveValue(next)\n rowRefs.current.get(next)?.focus()\n }\n\n // On open, focus the search field (or the active row). Initial focus only.\n // biome-ignore lint/correctness/useExhaustiveDependencies: re-running on activeValue would steal focus while navigating the tree.\n useEffect(() => {\n if (!open) return\n const id = requestAnimationFrame(() => {\n // preventScroll: the content is portaled, so focusing it before the\n // positioner places it would otherwise warp the page to the top.\n if (searchable) searchRef.current?.focus({ preventScroll: true })\n else if (activeValue) rowRefs.current.get(activeValue)?.focus({ preventScroll: true })\n })\n return () => cancelAnimationFrame(id)\n }, [open, searchable])\n\n const toggle = (node: TreeNodeData) => setValue(toggleNode(node, value) as TreeValue<Data>[])\n const removeValue = (v: string) => setValue(value.filter((x) => x !== v))\n\n const { containerRef, visibleCount, hiddenCount } = usePillOverflow({\n maxLines,\n count: value.length,\n })\n\n const moveActive = (dir: 1 | -1) => {\n if (enabledValues.length === 0) return\n const idx = activeValue ? enabledValues.indexOf(activeValue) : -1\n const next =\n idx === -1\n ? dir === 1\n ? 0\n : enabledValues.length - 1\n : Math.min(Math.max(idx + dir, 0), enabledValues.length - 1)\n focusRow(enabledValues[next] ?? null)\n }\n\n const onTreeKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault()\n moveActive(1)\n break\n case \"ArrowUp\":\n event.preventDefault()\n moveActive(-1)\n break\n case \"Home\":\n event.preventDefault()\n focusRow(enabledValues[0] ?? null)\n break\n case \"End\":\n event.preventDefault()\n focusRow(enabledValues[enabledValues.length - 1] ?? null)\n break\n case \" \":\n case \"Enter\": {\n event.preventDefault()\n const node = activeValue ? nodeMap.get(activeValue) : undefined\n if (node && !(disabled || readOnly || node.disabled)) toggle(node)\n break\n }\n }\n }\n\n const onSearchKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault()\n focusRow(enabledValues[0] ?? null)\n }\n }\n\n const renderNode = (\n node: TreeNodeData<TreePayload<Data>>,\n depth: number,\n ancestorHasNextSibling: boolean[],\n isLast: boolean,\n ): ReactNode => {\n // Render structure comes from the (possibly filtered) node, but cascade\n // state is derived from the original node so hidden leaves still count.\n const source = nodeMap.get(node.value) ?? node\n const state = getNodeState(source, selectedSet)\n const checked = state === \"checked\"\n const mixed = state === \"indeterminate\"\n const nodeDisabled = disabled || node.disabled\n const rowTestId = node.testId ?? `item-${node.value}`\n\n // Content after the indent rails. A custom `renderItem` owns the whole slot\n // (incl. the checkbox); otherwise render the presentational checkbox + label.\n const content = renderItem ? (\n renderItem(node, {\n checked,\n indeterminate: mixed,\n leaf: isLeaf(source),\n disabled: !!nodeDisabled,\n depth,\n })\n ) : (\n <>\n {/* presentational checkbox — state lives on the row's aria-checked */}\n <span aria-hidden className={cn(treeCheckbox({ size }), classNames?.checkbox)}>\n {checked && <CheckIcon />}\n {mixed && <MinusIcon />}\n </span>\n\n <span className={cn(\"ms-1.5 min-w-0 flex-1 truncate text-start\", classNames?.label)}>\n {node.label}\n </span>\n </>\n )\n\n return (\n <Fragment key={node.value}>\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: row activation (Enter/Space) is handled centrally by the tree container's onKeyDown via roving focus, not co-located per row. */}\n <div\n role=\"treeitem\"\n aria-level={depth + 1}\n aria-checked={mixed ? \"mixed\" : checked}\n aria-disabled={nodeDisabled || undefined}\n data-checked={checked || undefined}\n data-mixed={mixed || undefined}\n data-active={node.value === activeValue || undefined}\n data-disabled={nodeDisabled || undefined}\n data-testid={rowTestId}\n tabIndex={node.value === activeValue ? 0 : -1}\n ref={(el) => registerRow(node.value, el)}\n onClick={() => {\n if (nodeDisabled || readOnly) return\n setActiveValue(node.value)\n toggle(source)\n }}\n className={cn(treeRow({ size }), classNames?.node)}\n >\n {/* Top-level rows sit flush; only descendants carry guide lines. */}\n {depth > 0 && (\n <>\n {/* ancestor rails: a vertical guide where that ancestor has a sibling below */}\n {ancestorHasNextSibling.map((hasNext, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: Indentation is stable inside component, we would want to rerender anyway.\n <span key={i} aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n {hasNext && (\n <span className={cn(\"absolute inset-y-0 inset-s-1/2 w-px\", treeLine)} />\n )}\n </span>\n ))}\n\n {/* connector: vertical (├ continues / └ stops) + horizontal elbow */}\n <span aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n <span\n className={cn(\n \"absolute inset-s-1/2 top-0 w-px\",\n treeLine,\n isLast ? \"h-1/2\" : \"bottom-0\",\n )}\n />\n <span className={cn(\"absolute inset-s-1/2 top-1/2 h-px w-1/2\", treeLine)} />\n </span>\n </>\n )}\n\n {content}\n </div>\n\n {node.children?.map((child, i) =>\n renderNode(\n child,\n depth + 1,\n depth === 0 ? [] : [...ancestorHasNextSibling, !isLast],\n i === (node.children?.length ?? 0) - 1,\n ),\n )}\n </Fragment>\n )\n }\n\n const showClear = clearable && value.length > 0 && !disabled && !readOnly\n const control = (\n <Popover.Root\n open={open}\n onOpenChange={(details) => {\n if (disabled || readOnly) return\n setOpen(details.open)\n if (!details.open) setSearch(\"\")\n }}\n // We move focus into the search field / active row ourselves (with\n // preventScroll); Ark's autofocus would scroll the page to the top.\n autoFocus={false}\n width=\"target\"\n >\n <Popover.Trigger asChild>\n <div\n ref={ref}\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n aria-invalid={isInvalid || undefined}\n data-color={color}\n {...props({\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": startSlot != null,\n // The trigger always ends in a chevron (and optional clear).\n \"data-with-end-slot\": true,\n // The shell IS the tabbable/focusable element here (no separate\n // inner control to route to), so `testId` lands directly on it.\n \"data-testid\": testId,\n })}\n tabIndex={disabled ? -1 : 0}\n onBlur={onBlur}\n onKeyDown={(event) => {\n if (disabled || readOnly) return\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"ArrowDown\") {\n event.preventDefault()\n setOpen(true)\n }\n }}\n className={cn(\n inputShell({ size, variant }),\n pillsShell,\n \"cursor-pointer\",\n className,\n classNames?.trigger,\n )}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={pillsContent({ size })}>\n {value.length === 0 ? (\n <span className={cn(\"min-w-0 flex-1 truncate\", placeholderColor)}>{placeholder}</span>\n ) : (\n <>\n {value.slice(0, visibleCount).map((v) => (\n <Pill\n key={v}\n size={size}\n disabled={disabled}\n withRemoveButton={!disabled && !readOnly}\n onRemove={() => removeValue(v)}\n className={classNames?.pill}\n data-overflow-item\n >\n {labelMap.get(v) ?? v}\n </Pill>\n ))}\n {hiddenCount > 0 && <PillOverflowCounter count={hiddenCount} size={size} />}\n </>\n )}\n </div>\n\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {showClear && (\n <button\n type=\"button\"\n aria-label=\"Clear all\"\n onPointerDown={(event) => {\n event.preventDefault()\n event.stopPropagation()\n }}\n onClick={(event) => {\n event.stopPropagation()\n setValue([])\n }}\n className={popoverClearTrigger}\n >\n <CloseIcon />\n </button>\n )}\n {(clearSectionMode === \"both\" || !showClear) && (\n <span aria-hidden data-chevron className={cn(popoverChevron, open && \"rotate-180\")}>\n <ChevronIcon />\n </span>\n )}\n </div>\n </Popover.Trigger>\n\n <Popover.Content data-color={color} className={classNames?.popover}>\n {searchable && (\n <Popover.Header>\n <input\n ref={searchRef}\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n onKeyDown={onSearchKeyDown}\n placeholder={searchPlaceholder}\n aria-label=\"Search\"\n className={cn(inputControlClasses, \"text-sm\", classNames?.search)}\n />\n </Popover.Header>\n )}\n\n <Popover.Body>\n {flat.length === 0 ? (\n <div className={popoverEmpty}>{empty}</div>\n ) : (\n <div\n role=\"tree\"\n aria-multiselectable=\"true\"\n aria-orientation=\"vertical\"\n onKeyDown={onTreeKeyDown}\n className=\"flex flex-col\"\n >\n {filteredData.map((node, i) =>\n renderNode(\n // `filterTree` only removes non-matching nodes — it can't change\n // their payload shape, so this is the same shape as `data`'s.\n node as TreeNodeData<TreePayload<Data>>,\n 0,\n [],\n i === filteredData.length - 1,\n ),\n )}\n </div>\n )}\n </Popover.Body>\n </Popover.Content>\n\n {/* Hidden inputs (one per value) for native `<form>` submission; form\n libraries instead read the value via `onChange`. */}\n {name != null && value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)}\n </Popover.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { buildMaps, filterTree, flattenTree, isLeaf } from '../../chunk-WZB6LPQI.js';
|
|
3
|
-
import { inputSlot, placeholderColor, inputShell, inputControlClasses } from '../../chunk-
|
|
4
|
-
import { FieldShell } from '../../chunk-
|
|
5
|
-
import { Popover, popoverClearTrigger, popoverChevron, popoverEmpty, popoverIndicator } from '../../chunk-
|
|
3
|
+
import { inputSlot, placeholderColor, inputShell, inputControlClasses } from '../../chunk-5OQLFX47.js';
|
|
4
|
+
import { FieldShell } from '../../chunk-FHG54IT5.js';
|
|
5
|
+
import { Popover, popoverClearTrigger, popoverChevron, popoverEmpty, popoverIndicator } from '../../chunk-6GDMSENK.js';
|
|
6
6
|
import '../../chunk-AIQG7IIT.js';
|
|
7
7
|
import '../../chunk-7P32XCEU.js';
|
|
8
8
|
import '../../chunk-BUIHQJGE.js';
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { UnavailableProps } from "./available-if";
|
|
3
|
+
/**
|
|
4
|
+
* The two sanctioned ways for a kit part to meet Ark's `asChild`.
|
|
5
|
+
*
|
|
6
|
+
* Ark's factory clones **exactly one** valid element under `asChild` and
|
|
7
|
+
* renders `null` otherwise (`isValidElement(children) ? clone : null`). So a
|
|
8
|
+
* part that renders anything besides a bare `{children}` — an icon, a
|
|
9
|
+
* section, an indicator, a default fallback — breaks in one of two ways:
|
|
10
|
+
*
|
|
11
|
+
* - **It renders nothing.** Two or more JSX child expressions become an
|
|
12
|
+
* array, even when some of them evaluate to `false`
|
|
13
|
+
* (`{start && <Start/>}{children}{end && <End/>}`), and an array is not an
|
|
14
|
+
* element.
|
|
15
|
+
* - **Its own content is lost or misplaced.** Under `asChild`, `children`
|
|
16
|
+
* *is* the consumer's element, so `children ?? <DefaultIcon/>` never
|
|
17
|
+
* reaches the fallback, and a wrapper (`<Provider>{children}</Provider>`)
|
|
18
|
+
* is what gets cloned instead of the consumer's element.
|
|
19
|
+
*
|
|
20
|
+
* Every such part must pick one of these:
|
|
21
|
+
*
|
|
22
|
+
* - **`withAsChildContent`** — the part can sensibly *become* the consumer's
|
|
23
|
+
* element (a menu item rendered as a router `<Link>`, a crumb, an alert
|
|
24
|
+
* that links somewhere). The kit's content is folded into the child's own
|
|
25
|
+
* children, so Ark still receives a single element.
|
|
26
|
+
* - **`NoAsChild`** — the part renders structure that cannot live inside an
|
|
27
|
+
* arbitrary element (a slider's track and thumbs, a scheduler grid). The
|
|
28
|
+
* prop becomes a compile error that says why.
|
|
29
|
+
*
|
|
30
|
+
* `as-child.contract.test.tsx` enforces the choice: it derives every public
|
|
31
|
+
* part that accepts `asChild` from the component entries, renders each one
|
|
32
|
+
* with an `<a>` child, and fails the typecheck when a part is in neither its
|
|
33
|
+
* render table nor `NoAsChild`.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Rebuilds the single `asChild` child's own children through `render`, so
|
|
37
|
+
* kit content (sections, icons, spinners) lands *inside* the element Ark
|
|
38
|
+
* clones instead of beside it. `extra` is merged onto the child too, for the
|
|
39
|
+
* odd prop the kit has to own (a click guard while loading).
|
|
40
|
+
*
|
|
41
|
+
* A child that isn't a single element falls through unchanged, leaving
|
|
42
|
+
* Ark's own handling of the misuse as it is.
|
|
43
|
+
*
|
|
44
|
+
* ```tsx
|
|
45
|
+
* <ArkMenu.Item asChild {...rest}>
|
|
46
|
+
* {withAsChildContent(children, (own) => (
|
|
47
|
+
* <>
|
|
48
|
+
* <StartSection>{startSection}</StartSection>
|
|
49
|
+
* {own}
|
|
50
|
+
* </>
|
|
51
|
+
* ))}
|
|
52
|
+
* </ArkMenu.Item>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const withAsChildContent: (child: ReactNode, render: (own: ReactNode) => ReactNode, extra?: Record<string, unknown>) => ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* The usual call site: `render` wraps the part's `children` with its own
|
|
58
|
+
* content either way, around `children` normally and inside the consumer's
|
|
59
|
+
* element under `asChild`. One `render` serves both branches, so the two
|
|
60
|
+
* can't drift apart.
|
|
61
|
+
*
|
|
62
|
+
* ```tsx
|
|
63
|
+
* <ArkMenu.Item asChild={asChild} {...rest}>
|
|
64
|
+
* {composeChildren(asChild, children, (own) => <>{icon}{own}</>)}
|
|
65
|
+
* </ArkMenu.Item>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare const composeChildren: (asChild: boolean | undefined, children: ReactNode, render: (own: ReactNode) => ReactNode) => ReactNode;
|
|
69
|
+
/** The sentence a caller reads when passing `asChild` to a `NoAsChild` part. */
|
|
70
|
+
export type NoAsChildReason = "renders its own structure around its children, so asChild is not supported";
|
|
71
|
+
/**
|
|
72
|
+
* The forbid shape on its own: `asChild` typed as a branded `Unavailable`.
|
|
73
|
+
* Intersect it beside a props type (`Omit<RootProps, "children"> &
|
|
74
|
+
* ForbidAsChild & { data }`); `NoAsChild<P>` is the same thing as a wrapper.
|
|
75
|
+
*
|
|
76
|
+
* Uses the brand rather than omitting the key, because omission is silent
|
|
77
|
+
* on a JSX spread (`<Slider {...props} />`), which is exactly how prop bags
|
|
78
|
+
* get forwarded. Either way the error names the reason:
|
|
79
|
+
*
|
|
80
|
+
* Type 'boolean' is not assignable to type 'Unavailable<"renders its own
|
|
81
|
+
* structure around its children, so asChild is not supported">'
|
|
82
|
+
*/
|
|
83
|
+
export type ForbidAsChild = UnavailableProps<{
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
}, NoAsChildReason>;
|
|
86
|
+
/**
|
|
87
|
+
* `P` with `asChild` forbidden: `P & ForbidAsChild`, so `asChild` resolves
|
|
88
|
+
* to `(boolean & Unavailable<…>) | undefined`, which nothing but `undefined`
|
|
89
|
+
* satisfies.
|
|
90
|
+
*
|
|
91
|
+
* An intersection, not `Omit<P, "asChild"> & …`. `Omit` re-maps every key of
|
|
92
|
+
* a large HTML/Ark props type, and measured on the forbidden parts that cost
|
|
93
|
+
* each importing file about 38k extra type instantiations (+8.6%); the
|
|
94
|
+
* intersection costs nothing measurable. It also leaves a union in `P` (a
|
|
95
|
+
* discriminated `type` / `color` pair, a slot-size union) and any generic
|
|
96
|
+
* untouched, where `Omit` would flatten the one and hide the other from
|
|
97
|
+
* inference.
|
|
98
|
+
*
|
|
99
|
+
* The component destructures `asChild` out before spreading the rest onto
|
|
100
|
+
* its Ark part (`({ asChild: _asChild, ...rest })`), so a JS caller that
|
|
101
|
+
* passes it anyway gets the normal render rather than Ark's `null`.
|
|
102
|
+
*/
|
|
103
|
+
export type NoAsChild<P> = P & ForbidAsChild;
|
|
104
|
+
//# sourceMappingURL=as-child.d.ts.map
|