@42-central/ui-react 0.29.1 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-X6DESK37.js → chunk-2RRTT4AF.js} +17 -5
- package/dist/chunk-2RRTT4AF.js.map +1 -0
- package/dist/{chunk-TUP7WXQE.js → chunk-322I2RSV.js} +9 -6
- package/dist/chunk-322I2RSV.js.map +1 -0
- package/dist/{chunk-ISX3AM32.js → chunk-37SRSNLJ.js} +4 -4
- package/dist/{chunk-ISX3AM32.js.map → chunk-37SRSNLJ.js.map} +1 -1
- package/dist/{chunk-L5GH7LLD.js → chunk-3MFWUG5O.js} +4 -4
- package/dist/{chunk-L5GH7LLD.js.map → chunk-3MFWUG5O.js.map} +1 -1
- package/dist/{chunk-FQJNQW3G.js → chunk-3XQEOJCE.js} +8 -5
- package/dist/chunk-3XQEOJCE.js.map +1 -0
- package/dist/{chunk-JKFPRQB2.js → chunk-4LSZ5JWF.js} +3 -3
- package/dist/{chunk-JKFPRQB2.js.map → chunk-4LSZ5JWF.js.map} +1 -1
- package/dist/{chunk-V2QZG4IT.js → chunk-5HWFYYHW.js} +27 -9
- package/dist/chunk-5HWFYYHW.js.map +1 -0
- package/dist/{chunk-GEZYGBXY.js → chunk-6MVFCS46.js} +99 -42
- package/dist/chunk-6MVFCS46.js.map +1 -0
- package/dist/{chunk-NNPSBC7O.js → chunk-6WZSUS3U.js} +10 -9
- package/dist/chunk-6WZSUS3U.js.map +1 -0
- package/dist/chunk-6YRGP6PS.js +138 -0
- package/dist/chunk-6YRGP6PS.js.map +1 -0
- package/dist/{chunk-B5YHYI7E.js → chunk-ALANKV5Y.js} +23 -6
- package/dist/chunk-ALANKV5Y.js.map +1 -0
- package/dist/{chunk-IA6DCC3N.js → chunk-AUQPNDE5.js} +23 -13
- package/dist/chunk-AUQPNDE5.js.map +1 -0
- package/dist/{chunk-AKXALCUN.js → chunk-D7SW2E24.js} +4 -4
- package/dist/chunk-D7SW2E24.js.map +1 -0
- package/dist/{chunk-OXR7BXZA.js → chunk-DQIYYDFD.js} +4 -3
- package/dist/chunk-DQIYYDFD.js.map +1 -0
- package/dist/{chunk-HMNXNKDA.js → chunk-FCBYUN6F.js} +4 -4
- package/dist/{chunk-HMNXNKDA.js.map → chunk-FCBYUN6F.js.map} +1 -1
- package/dist/{chunk-2W7H43WL.js → chunk-FED6SJWM.js} +23 -14
- package/dist/chunk-FED6SJWM.js.map +1 -0
- package/dist/{chunk-7E7JNWOC.js → chunk-FEPIHXVI.js} +6 -5
- package/dist/chunk-FEPIHXVI.js.map +1 -0
- package/dist/{chunk-Y57NW6G7.js → chunk-G3YOSG3U.js} +4 -4
- package/dist/{chunk-Y57NW6G7.js.map → chunk-G3YOSG3U.js.map} +1 -1
- package/dist/chunk-GZN5CXMR.js +100 -0
- package/dist/chunk-GZN5CXMR.js.map +1 -0
- package/dist/{chunk-HCHGERDB.js → chunk-HCSZPBWV.js} +17 -115
- package/dist/chunk-HCSZPBWV.js.map +1 -0
- package/dist/{chunk-I4B3N3UX.js → chunk-HTVICHT4.js} +12 -7
- package/dist/chunk-HTVICHT4.js.map +1 -0
- package/dist/chunk-I7TC2C3I.js +163 -0
- package/dist/chunk-I7TC2C3I.js.map +1 -0
- package/dist/{chunk-7FPSQBWB.js → chunk-IBXYLO2J.js} +14 -13
- package/dist/chunk-IBXYLO2J.js.map +1 -0
- package/dist/{chunk-7KFUFAVP.js → chunk-IRYG6B5A.js} +9 -8
- package/dist/chunk-IRYG6B5A.js.map +1 -0
- package/dist/{chunk-2RQLPN4U.js → chunk-JCNEW4WJ.js} +8 -8
- package/dist/{chunk-2RQLPN4U.js.map → chunk-JCNEW4WJ.js.map} +1 -1
- package/dist/{chunk-SP6LCCTZ.js → chunk-KZDMVOL6.js} +35 -8
- package/dist/chunk-KZDMVOL6.js.map +1 -0
- package/dist/chunk-LR5U6TZZ.js +169 -0
- package/dist/chunk-LR5U6TZZ.js.map +1 -0
- package/dist/{chunk-MQHD3EJE.js → chunk-LZHZJWVM.js} +6 -4
- package/dist/chunk-LZHZJWVM.js.map +1 -0
- package/dist/{chunk-5EOMSWNO.js → chunk-MAM2X3MW.js} +5 -5
- package/dist/{chunk-5EOMSWNO.js.map → chunk-MAM2X3MW.js.map} +1 -1
- package/dist/{chunk-FSPS7TVD.js → chunk-MCMS4NMO.js} +5 -5
- package/dist/{chunk-FSPS7TVD.js.map → chunk-MCMS4NMO.js.map} +1 -1
- package/dist/{chunk-ZB5VMGKB.js → chunk-MV5DIE2T.js} +15 -4
- package/dist/chunk-MV5DIE2T.js.map +1 -0
- package/dist/chunk-NDI4HLQE.js +41 -0
- package/dist/chunk-NDI4HLQE.js.map +1 -0
- package/dist/{chunk-B4GNSSHU.js → chunk-NLJEQZQQ.js} +3 -3
- package/dist/{chunk-B4GNSSHU.js.map → chunk-NLJEQZQQ.js.map} +1 -1
- package/dist/{chunk-SBZJGFZ6.js → chunk-QHT4DCXE.js} +8 -7
- package/dist/chunk-QHT4DCXE.js.map +1 -0
- package/dist/{chunk-I4IJOLNA.js → chunk-RMUBCTEF.js} +5 -5
- package/dist/{chunk-I4IJOLNA.js.map → chunk-RMUBCTEF.js.map} +1 -1
- package/dist/{chunk-G3AD3NJG.js → chunk-RNTDM3RP.js} +9 -5
- package/dist/chunk-RNTDM3RP.js.map +1 -0
- package/dist/chunk-RPFN6ETQ.js +509 -0
- package/dist/chunk-RPFN6ETQ.js.map +1 -0
- package/dist/{chunk-HWBFRDX7.js → chunk-SI7C3W5M.js} +28 -9
- package/dist/chunk-SI7C3W5M.js.map +1 -0
- package/dist/chunk-TPOV3OCC.js +234 -0
- package/dist/chunk-TPOV3OCC.js.map +1 -0
- package/dist/{chunk-IANYMDKH.js → chunk-UBQ54W46.js} +4 -4
- package/dist/chunk-UBQ54W46.js.map +1 -0
- package/dist/{chunk-QVOBLRCM.js → chunk-UIKQ4X6W.js} +3 -3
- package/dist/{chunk-QVOBLRCM.js.map → chunk-UIKQ4X6W.js.map} +1 -1
- package/dist/chunk-UOWQH53N.js +70 -0
- package/dist/chunk-UOWQH53N.js.map +1 -0
- package/dist/{chunk-QRNQQIQM.js → chunk-WJUY6YWF.js} +52 -20
- package/dist/chunk-WJUY6YWF.js.map +1 -0
- package/dist/{chunk-3KARNPW4.js → chunk-WKIUMLRT.js} +3 -3
- package/dist/{chunk-3KARNPW4.js.map → chunk-WKIUMLRT.js.map} +1 -1
- package/dist/chunk-X6RB74JN.js +37 -0
- package/dist/chunk-X6RB74JN.js.map +1 -0
- package/dist/chunk-XQ6L2CM5.js +83 -0
- package/dist/chunk-XQ6L2CM5.js.map +1 -0
- package/dist/{chunk-RKCUXOU2.js → chunk-YUVKROMA.js} +44 -7
- package/dist/chunk-YUVKROMA.js.map +1 -0
- package/dist/components/action-icon/action-icon.d.ts +9 -2
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +5 -1
- package/dist/components/alert/index.js +4 -4
- package/dist/components/anchor/anchor.d.ts +45 -0
- package/dist/components/anchor/anchor.d.ts.map +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.d.ts.map +1 -0
- package/dist/components/anchor/index.js +11 -0
- package/dist/components/anchor/index.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +10 -6
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +23 -24
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +15 -9
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +5 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +12 -0
- package/dist/components/breadcrumb/index.js.map +1 -1
- package/dist/components/button/button.d.ts +15 -2
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +5 -1
- package/dist/components/button-multi-select/index.js +6 -4
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/button-select-control.d.ts.map +1 -1
- package/dist/components/button-select/button-select.d.ts +2 -2
- package/dist/components/button-select/button-select.d.ts.map +1 -1
- package/dist/components/button-select/index.js +6 -4
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/aliases.d.ts +16 -0
- package/dist/components/calendar/aliases.d.ts.map +1 -0
- package/dist/components/calendar/calendar-body.d.ts +11 -1
- package/dist/components/calendar/calendar-body.d.ts.map +1 -1
- package/dist/components/calendar/calendar.d.ts +8 -4
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/calendar/index.d.ts.map +1 -1
- package/dist/components/calendar/index.js +15 -5
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
- package/dist/components/calendar-heatmap/index.js +85 -73
- package/dist/components/calendar-heatmap/index.js.map +1 -1
- package/dist/components/camera/index.js +16 -14
- package/dist/components/carousel/index.js +3 -3
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/choice-card-group/index.js +2 -2
- package/dist/components/choice-card-group/index.js.map +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +22 -11
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.d.ts +1 -1
- package/dist/components/circular-progress/index.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js +68 -49
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/index.js +7 -3
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code/code.d.ts +10 -0
- package/dist/components/code/code.d.ts.map +1 -1
- package/dist/components/code/index.js +1 -0
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +10 -6
- package/dist/components/code-block/index.js +10 -7
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +5 -3
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +12 -7
- package/dist/components/combobox-list/combobox-list.d.ts +1 -1
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +14 -9
- package/dist/components/compare/index.js +1 -1
- package/dist/components/data-list/data-list.d.ts +96 -0
- package/dist/components/data-list/data-list.d.ts.map +1 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.d.ts.map +1 -0
- package/dist/components/data-list/index.js +147 -0
- package/dist/components/data-list/index.js.map +1 -0
- package/dist/components/data-table/data-table-group.d.ts.map +1 -1
- package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
- package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts +5 -2
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.js +163 -168
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/aliases.d.ts +16 -0
- package/dist/components/date-picker/aliases.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +22 -8
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +34 -28
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/download-button/index.js +6 -2
- package/dist/components/drawer/drawer.d.ts +7 -4
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.js +11 -6
- package/dist/components/empty-state/empty-state.d.ts +57 -0
- package/dist/components/empty-state/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/empty-state/index.d.ts.map +1 -0
- package/dist/components/empty-state/index.js +8 -0
- package/dist/components/empty-state/index.js.map +1 -0
- package/dist/components/field/field.d.ts +20 -0
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/fieldset/fieldset.d.ts +103 -0
- package/dist/components/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/fieldset/index.d.ts.map +1 -0
- package/dist/components/fieldset/index.js +150 -0
- package/dist/components/fieldset/index.js.map +1 -0
- package/dist/components/file-item/index.js +10 -7
- package/dist/components/file-preview/file-preview.d.ts.map +1 -1
- package/dist/components/file-preview/index.js +10 -18
- package/dist/components/file-preview/index.js.map +1 -1
- package/dist/components/file-trigger/index.js +6 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +18 -14
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/gallery/index.js +3 -3
- package/dist/components/geodesic/a11y.d.ts +3 -3
- package/dist/components/geodesic/a11y.d.ts.map +1 -1
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/index.js +10 -3
- package/dist/components/hover-card/index.js.map +1 -1
- package/dist/components/image/index.js +3 -3
- package/dist/components/image-cropper/index.js +9 -6
- package/dist/components/input/index.js +2 -2
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/kbd/index.js +3 -3
- package/dist/components/kbd/kbd.d.ts +4 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/lightbox/index.js +13 -11
- package/dist/components/lightbox/index.js.map +1 -1
- package/dist/components/menu/index.js +9 -5
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/modal/index.js +11 -6
- package/dist/components/modal/modal.d.ts +10 -4
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +13 -9
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +13 -10
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +4 -4
- package/dist/components/nav-link/tanstack.js +4 -4
- package/dist/components/notification/index.js +6 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/number-input/index.js +11 -7
- package/dist/components/number-input/number-input.d.ts +1 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/dialog-parts.d.ts +10 -1
- package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
- package/dist/components/overlays/index.js +13 -8
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +362 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +147 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/password-input/index.js +6 -5
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +1 -1
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/phone-input/index.js +14 -11
- package/dist/components/phone-input/index.js.map +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/photo-capture/index.js +19 -17
- package/dist/components/photo-capture/index.js.map +1 -1
- package/dist/components/pills-input/index.js +4 -4
- package/dist/components/pills-input/pills-input.d.ts +1 -1
- package/dist/components/pills-input/pills-input.d.ts.map +1 -1
- package/dist/components/pin-input/index.js +6 -5
- package/dist/components/pin-input/index.js.map +1 -1
- package/dist/components/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/popover/index.js +7 -2
- package/dist/components/popover/popover.d.ts +41 -16
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.d.ts +1 -1
- package/dist/components/progress/index.d.ts.map +1 -1
- package/dist/components/progress/index.js +4 -1
- package/dist/components/progress/progress.d.ts +22 -14
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/prose/index.d.ts +2 -0
- package/dist/components/prose/index.d.ts.map +1 -0
- package/dist/components/prose/index.js +17 -0
- package/dist/components/prose/index.js.map +1 -0
- package/dist/components/prose/prose.d.ts +49 -0
- package/dist/components/prose/prose.d.ts.map +1 -0
- package/dist/components/prose/styles.css +593 -0
- package/dist/components/radio-group/index.js +9 -3
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/rating/index.js +3 -2
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.js +10 -8
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.d.ts.map +1 -0
- package/dist/components/scroll-area/index.js +10 -0
- package/dist/components/scroll-area/index.js.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +150 -0
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/components/segment-group/index.js +2 -2
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.js +12 -8
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/splitter/index.d.ts.map +1 -0
- package/dist/components/splitter/index.js +373 -0
- package/dist/components/splitter/index.js.map +1 -0
- package/dist/components/splitter/splitter.d.ts +159 -0
- package/dist/components/splitter/splitter.d.ts.map +1 -0
- package/dist/components/spotlight/index.js +23 -22
- package/dist/components/spotlight/index.js.map +1 -1
- package/dist/components/spotlight/spotlight.d.ts.map +1 -1
- package/dist/components/steps/index.d.ts +4 -0
- package/dist/components/steps/index.d.ts.map +1 -0
- package/dist/components/steps/index.js +478 -0
- package/dist/components/steps/index.js.map +1 -0
- package/dist/components/steps/steps-data.d.ts +78 -0
- package/dist/components/steps/steps-data.d.ts.map +1 -0
- package/dist/components/steps/steps.d.ts +183 -0
- package/dist/components/steps/steps.d.ts.map +1 -0
- package/dist/components/switch/index.js +4 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/table-of-contents/index.d.ts +2 -0
- package/dist/components/table-of-contents/index.d.ts.map +1 -0
- package/dist/components/table-of-contents/index.js +471 -0
- package/dist/components/table-of-contents/index.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
- package/dist/components/tags-input/index.js +12 -9
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +1 -1
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +8 -6
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/time-input/index.js +11 -9
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +3 -8
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tour/conditions.d.ts +83 -0
- package/dist/components/tour/conditions.d.ts.map +1 -0
- package/dist/components/tour/create-tours.d.ts +49 -0
- package/dist/components/tour/create-tours.d.ts.map +1 -0
- package/dist/components/tour/index.d.ts +6 -0
- package/dist/components/tour/index.d.ts.map +1 -0
- package/dist/components/tour/index.js +1449 -0
- package/dist/components/tour/index.js.map +1 -0
- package/dist/components/tour/runtime.d.ts +57 -0
- package/dist/components/tour/runtime.d.ts.map +1 -0
- package/dist/components/tour/storage.d.ts +14 -0
- package/dist/components/tour/storage.d.ts.map +1 -0
- package/dist/components/tour/store.d.ts +62 -0
- package/dist/components/tour/store.d.ts.map +1 -0
- package/dist/components/tour/tour.d.ts +77 -0
- package/dist/components/tour/tour.d.ts.map +1 -0
- package/dist/components/tour/types.d.ts +680 -0
- package/dist/components/tour/types.d.ts.map +1 -0
- package/dist/components/tree/index.d.ts +3 -0
- package/dist/components/tree/index.d.ts.map +1 -0
- package/dist/components/tree/index.js +457 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/components/tree/tree-row.d.ts +72 -0
- package/dist/components/tree/tree-row.d.ts.map +1 -0
- package/dist/components/tree/tree.d.ts +193 -0
- package/dist/components/tree/tree.d.ts.map +1 -0
- package/dist/components/tree-multi-select/index.js +31 -54
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +30 -24
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-popover.d.ts +20 -31
- package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +1 -1
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/date-predicates.d.ts +7 -5
- package/dist/lib/date-predicates.d.ts.map +1 -1
- package/dist/lib/date-value.d.ts +20 -0
- package/dist/lib/date-value.d.ts.map +1 -1
- package/dist/lib/floating-arrow.d.ts +53 -0
- package/dist/lib/floating-arrow.d.ts.map +1 -0
- package/dist/lib/focus-return.d.ts +53 -0
- package/dist/lib/focus-return.d.ts.map +1 -0
- package/dist/lib/meter.d.ts +104 -0
- package/dist/lib/meter.d.ts.map +1 -0
- package/dist/lib/overlay-layer.d.ts +26 -8
- package/dist/lib/overlay-layer.d.ts.map +1 -1
- package/dist/lib/pressed.d.ts +92 -0
- package/dist/lib/pressed.d.ts.map +1 -0
- package/dist/lib/tree-data.d.ts +18 -2
- package/dist/lib/tree-data.d.ts.map +1 -1
- package/dist/lib/use-pagination.d.ts +102 -0
- package/dist/lib/use-pagination.d.ts.map +1 -0
- package/dist/lib/use-scroll-spy.d.ts +126 -0
- package/dist/lib/use-scroll-spy.d.ts.map +1 -0
- package/dist/theme.css +39 -3
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +283 -1
- package/src/components/action-icon/action-icon.tsx +34 -4
- package/src/components/anchor/anchor.test.tsx +232 -0
- package/src/components/anchor/anchor.tsx +187 -0
- package/src/components/anchor/index.ts +12 -0
- package/src/components/app-shell/app-shell.test.tsx +15 -7
- package/src/components/app-shell/app-shell.tsx +27 -20
- package/src/components/autocomplete/autocomplete.tsx +11 -3
- package/src/components/breadcrumb/breadcrumb.test.tsx +24 -0
- package/src/components/breadcrumb/breadcrumb.tsx +20 -1
- package/src/components/button/button-pressed.test.tsx +202 -0
- package/src/components/button/button.tsx +48 -6
- package/src/components/button-select/button-select-control.tsx +2 -2
- package/src/components/button-select/button-select.tsx +22 -2
- package/src/components/calendar/aliases.tsx +28 -0
- package/src/components/calendar/calendar-body.tsx +310 -210
- package/src/components/calendar/calendar.tsx +43 -12
- package/src/components/calendar/index.ts +7 -1
- package/src/components/calendar/month-year-calendar.test.tsx +106 -0
- package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
- package/src/components/checkbox/checkbox.tsx +7 -2
- package/src/components/choice-card-group/choice-card-group.tsx +2 -2
- package/src/components/circular-progress/circular-progress.test.tsx +35 -0
- package/src/components/circular-progress/circular-progress.tsx +116 -59
- package/src/components/circular-progress/index.ts +1 -0
- package/src/components/code/code.test.tsx +16 -0
- package/src/components/code/code.tsx +11 -0
- package/src/components/combobox/combobox.tsx +63 -28
- package/src/components/combobox-list/combobox-list.tsx +11 -3
- package/src/components/data-list/data-list.test.tsx +149 -0
- package/src/components/data-list/data-list.tsx +268 -0
- package/src/components/data-list/index.ts +9 -0
- package/src/components/data-table/data-table-group.test.tsx +16 -0
- package/src/components/data-table/data-table-group.tsx +15 -2
- package/src/components/data-table/data-table-placeholder.tsx +28 -36
- package/src/components/data-table/data-table-stack.tsx +33 -39
- package/src/components/data-table/data-table.test.tsx +31 -0
- package/src/components/data-table/data-table.tsx +41 -42
- package/src/components/date-picker/aliases.tsx +28 -0
- package/src/components/date-picker/date-picker.test.tsx +29 -0
- package/src/components/date-picker/date-picker.tsx +164 -45
- package/src/components/date-picker/index.ts +5 -1
- package/src/components/date-picker/month-year-picker.test.tsx +362 -0
- package/src/components/drawer/drawer.test.tsx +41 -0
- package/src/components/drawer/drawer.tsx +7 -1
- package/src/components/empty-state/empty-state.test.tsx +109 -0
- package/src/components/empty-state/empty-state.tsx +180 -0
- package/src/components/empty-state/index.ts +9 -0
- package/src/components/field/field.tsx +35 -1
- package/src/components/fieldset/fieldset.test.tsx +352 -0
- package/src/components/fieldset/fieldset.tsx +268 -0
- package/src/components/fieldset/index.ts +11 -0
- package/src/components/file-preview/file-preview.test.tsx +2 -1
- package/src/components/file-preview/file-preview.tsx +7 -13
- package/src/components/file-upload/file-upload.tsx +14 -5
- package/src/components/hover-card/hover-card.tsx +5 -1
- package/src/components/input/input.tsx +12 -5
- package/src/components/kbd/kbd.test.tsx +13 -0
- package/src/components/kbd/kbd.tsx +6 -0
- package/src/components/menu/menu.tsx +6 -2
- package/src/components/modal/modal.test.tsx +41 -0
- package/src/components/modal/modal.tsx +17 -9
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
- package/src/components/multi-select/multi-select.tsx +11 -3
- package/src/components/notification/create-notifier.tsx +1 -1
- package/src/components/number-input/number-input.tsx +12 -3
- package/src/components/overlays/dialog-parts.tsx +42 -5
- package/src/components/pagination/index.ts +19 -0
- package/src/components/pagination/pagination.test.tsx +187 -0
- package/src/components/pagination/pagination.tsx +563 -0
- package/src/components/password-input/password-input.tsx +12 -3
- package/src/components/phone-input/phone-input.tsx +12 -3
- package/src/components/pills-input/pills-input.tsx +7 -2
- package/src/components/pin-input/pin-input.tsx +13 -4
- package/src/components/popover/popover.tsx +87 -17
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/progress.test.tsx +102 -0
- package/src/components/progress/progress.tsx +116 -62
- package/src/components/prose/index.ts +1 -0
- package/src/components/prose/prose.test.tsx +90 -0
- package/src/components/prose/prose.tsx +60 -0
- package/src/components/prose/styles.css +593 -0
- package/src/components/radio-group/radio-group.tsx +8 -3
- package/src/components/rating/rating.tsx +5 -2
- package/src/components/scroll-area/index.ts +18 -0
- package/src/components/scroll-area/scroll-area.test.tsx +184 -0
- package/src/components/scroll-area/scroll-area.tsx +448 -0
- package/src/components/segment-group/segment-group.tsx +2 -2
- package/src/components/select/select.tsx +37 -18
- package/src/components/slider/slider.tsx +2 -2
- package/src/components/splitter/index.ts +15 -0
- package/src/components/splitter/splitter.test.tsx +244 -0
- package/src/components/splitter/splitter.tsx +625 -0
- package/src/components/spotlight/spotlight.test.tsx +34 -26
- package/src/components/spotlight/spotlight.tsx +7 -9
- package/src/components/steps/index.ts +21 -0
- package/src/components/steps/steps-data.tsx +179 -0
- package/src/components/steps/steps.test.tsx +235 -0
- package/src/components/steps/steps.tsx +686 -0
- package/src/components/switch/switch.tsx +7 -2
- package/src/components/table-of-contents/index.ts +17 -0
- package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
- package/src/components/table-of-contents/table-of-contents.tsx +708 -0
- package/src/components/tags-input/tags-input.tsx +12 -3
- package/src/components/textarea/textarea.tsx +15 -5
- package/src/components/tooltip/tooltip.tsx +8 -17
- package/src/components/tour/conditions.test.ts +527 -0
- package/src/components/tour/conditions.ts +445 -0
- package/src/components/tour/create-tours.tsx +150 -0
- package/src/components/tour/index.ts +86 -0
- package/src/components/tour/runtime.ts +187 -0
- package/src/components/tour/storage.test.ts +68 -0
- package/src/components/tour/storage.ts +44 -0
- package/src/components/tour/store.test.tsx +784 -0
- package/src/components/tour/store.ts +661 -0
- package/src/components/tour/tour.test.tsx +318 -0
- package/src/components/tour/tour.tsx +773 -0
- package/src/components/tour/tour.types.test.ts +185 -0
- package/src/components/tour/types.ts +904 -0
- package/src/components/tree/index.ts +24 -0
- package/src/components/tree/tree-row.tsx +179 -0
- package/src/components/tree/tree.test.tsx +296 -0
- package/src/components/tree/tree.tsx +796 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
- package/src/components/tree-select/tree-popover.tsx +26 -107
- package/src/components/tree-select/tree-select.tsx +24 -16
- package/src/icon-stroke.test.tsx +2 -0
- package/src/index.ts +16 -0
- package/src/lib/date-predicates.test.ts +46 -0
- package/src/lib/date-predicates.ts +44 -24
- package/src/lib/date-value.test.ts +24 -1
- package/src/lib/date-value.ts +42 -1
- package/src/lib/floating-arrow.tsx +73 -0
- package/src/lib/focus-return.test.tsx +143 -0
- package/src/lib/focus-return.ts +106 -0
- package/src/lib/meter.test.ts +40 -0
- package/src/lib/meter.ts +159 -0
- package/src/lib/overlay-layer.test.tsx +47 -1
- package/src/lib/overlay-layer.tsx +65 -8
- package/src/lib/pressed.ts +130 -0
- package/src/lib/tree-data.ts +42 -2
- package/src/lib/use-pagination.test.ts +105 -0
- package/src/lib/use-pagination.ts +179 -0
- package/src/lib/use-scroll-spy.test.tsx +238 -0
- package/src/lib/use-scroll-spy.ts +336 -0
- package/src/theme.css +39 -3
- package/src/theme.test.ts +29 -1
- package/src/visually-hidden-containment.test.tsx +9 -0
- package/dist/chunk-2W7H43WL.js.map +0 -1
- package/dist/chunk-7E7JNWOC.js.map +0 -1
- package/dist/chunk-7FPSQBWB.js.map +0 -1
- package/dist/chunk-7KFUFAVP.js.map +0 -1
- package/dist/chunk-AKXALCUN.js.map +0 -1
- package/dist/chunk-B5YHYI7E.js.map +0 -1
- package/dist/chunk-FQJNQW3G.js.map +0 -1
- package/dist/chunk-G3AD3NJG.js.map +0 -1
- package/dist/chunk-GEZYGBXY.js.map +0 -1
- package/dist/chunk-HCHGERDB.js.map +0 -1
- package/dist/chunk-HWBFRDX7.js.map +0 -1
- package/dist/chunk-I4B3N3UX.js.map +0 -1
- package/dist/chunk-IA6DCC3N.js.map +0 -1
- package/dist/chunk-IANYMDKH.js.map +0 -1
- package/dist/chunk-MQHD3EJE.js.map +0 -1
- package/dist/chunk-NNPSBC7O.js.map +0 -1
- package/dist/chunk-OXR7BXZA.js.map +0 -1
- package/dist/chunk-QKSLDQM2.js +0 -120
- package/dist/chunk-QKSLDQM2.js.map +0 -1
- package/dist/chunk-QRNQQIQM.js.map +0 -1
- package/dist/chunk-RKCUXOU2.js.map +0 -1
- package/dist/chunk-S5CQRCTF.js +0 -426
- package/dist/chunk-S5CQRCTF.js.map +0 -1
- package/dist/chunk-SBZJGFZ6.js.map +0 -1
- package/dist/chunk-SP6LCCTZ.js.map +0 -1
- package/dist/chunk-TUP7WXQE.js.map +0 -1
- package/dist/chunk-V2QZG4IT.js.map +0 -1
- package/dist/chunk-X6DESK37.js.map +0 -1
- package/dist/chunk-ZB5VMGKB.js.map +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
export type { TreeNodeData, TreePayload, TreeSelectData, TreeValue } from "../../lib/tree-data"
|
|
4
|
+
export {
|
|
5
|
+
type RenderTreeItem,
|
|
6
|
+
TREE_DEFAULT_TRANSLATIONS,
|
|
7
|
+
Tree,
|
|
8
|
+
type TreeActionsProps,
|
|
9
|
+
type TreeCheckboxProps,
|
|
10
|
+
type TreeClassNames,
|
|
11
|
+
type TreeIconProps,
|
|
12
|
+
type TreeIconSlot,
|
|
13
|
+
type TreeIcons,
|
|
14
|
+
type TreeIndicatorProps,
|
|
15
|
+
type TreeItemState,
|
|
16
|
+
type TreeLabelProps,
|
|
17
|
+
type TreeListProps,
|
|
18
|
+
type TreeProps,
|
|
19
|
+
type TreeRootProps,
|
|
20
|
+
type TreeTextProps,
|
|
21
|
+
type TreeTranslations,
|
|
22
|
+
useTree,
|
|
23
|
+
useTreeNode,
|
|
24
|
+
} from "./tree"
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority"
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react"
|
|
3
|
+
import { cn } from "../../lib/cn"
|
|
4
|
+
import { focusStyles } from "../../lib/focus-styles"
|
|
5
|
+
import type { Size } from "../../lib/sizes"
|
|
6
|
+
import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
|
|
7
|
+
import { controlIndicator } from "../checkbox/control"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The kit's one tree row, internal: what `Tree`, `TreeSelect` and `TreeMultiSelect` all draw.
|
|
11
|
+
* The row box and its surfaces, the indent rails, where a node sits among its siblings, the
|
|
12
|
+
* label and the checkbox mark. Each component keeps only its own behaviour around it: `Tree`
|
|
13
|
+
* spreads Ark's `tree-view` props on the row and nests its children in a `Collapse`; the
|
|
14
|
+
* pickers render the tree flat, always expanded, with their own roving focus (see
|
|
15
|
+
* `tree-select/tree-popover.tsx` for why they can't run on Ark's machine).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** Indent guide / connector colour, shared by rails and the elbow. */
|
|
19
|
+
export const treeLine = "bg-brand-900/20 dark:bg-white/15"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* One tree row. `interactive` rows take focus and hover/active surfaces: neutral and
|
|
23
|
+
* transparent, a low-opacity black/white wash rather than an opaque gray, matching the
|
|
24
|
+
* popover surface's own background-dependent tint (no Figma reference for this state yet).
|
|
25
|
+
* The others are TreeSelect's branches: organizational, present for structure and levels,
|
|
26
|
+
* never focused.
|
|
27
|
+
*/
|
|
28
|
+
export const treeRow = cva(
|
|
29
|
+
["group/row relative flex w-full items-center rounded-sm ps-1.5 outline-none select-none"],
|
|
30
|
+
{
|
|
31
|
+
variants: {
|
|
32
|
+
size: {
|
|
33
|
+
xs: "min-h-7 pe-1.5 text-xs",
|
|
34
|
+
sm: "min-h-8 pe-2 text-sm",
|
|
35
|
+
md: "min-h-9 pe-2 text-md",
|
|
36
|
+
lg: "min-h-10 pe-2.5 text-lg",
|
|
37
|
+
xl: "min-h-11 pe-3 text-xl",
|
|
38
|
+
},
|
|
39
|
+
interactive: {
|
|
40
|
+
true: [
|
|
41
|
+
"cursor-pointer",
|
|
42
|
+
TEXT_COLOR_CLASSES.primary,
|
|
43
|
+
"hover:bg-black/5 dark:hover:bg-white/8",
|
|
44
|
+
"data-active:bg-black/5 dark:data-active:bg-white/8",
|
|
45
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
46
|
+
// Palette, not brand: the focused row is also the active one, and brand-500
|
|
47
|
+
// measured 2.73:1 against that light fill. `--c-text` (the popover's
|
|
48
|
+
// `data-color`, neutral by default) clears it in both themes.
|
|
49
|
+
focusStyles({ ring: "palette", offset: false, inset: true }),
|
|
50
|
+
],
|
|
51
|
+
false: ["cursor-default font-medium", TEXT_COLOR_CLASSES.secondary],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
defaultVariants: { size: "md", interactive: true },
|
|
55
|
+
},
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
/** Where a node sits in the rendered tree: what its rails and set position need. */
|
|
59
|
+
export type TreePosition = {
|
|
60
|
+
/** 0-based; the row's `aria-level` is `depth + 1`. */
|
|
61
|
+
depth: number
|
|
62
|
+
/** Per ancestor below the top level: whether it has a sibling after it (its rail continues). */
|
|
63
|
+
ancestorHasNextSibling: boolean[]
|
|
64
|
+
/** Last among its siblings: the connector stops at the elbow. */
|
|
65
|
+
isLast: boolean
|
|
66
|
+
/** 1-based index among its siblings. */
|
|
67
|
+
posinset: number
|
|
68
|
+
/** Number of siblings, itself included. */
|
|
69
|
+
setsize: number
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** The positions of `count` siblings: the top level's without a `parent`, else its children's. */
|
|
73
|
+
export const treePositions = (count: number, parent?: TreePosition): TreePosition[] => {
|
|
74
|
+
const depth = parent ? parent.depth + 1 : 0
|
|
75
|
+
// Top-level rows carry no rail, so their children's rails start empty.
|
|
76
|
+
const ancestorHasNextSibling =
|
|
77
|
+
!parent || parent.depth === 0 ? [] : [...parent.ancestorHasNextSibling, !parent.isLast]
|
|
78
|
+
return Array.from({ length: count }, (_, i) => ({
|
|
79
|
+
depth,
|
|
80
|
+
ancestorHasNextSibling,
|
|
81
|
+
isLast: i === count - 1,
|
|
82
|
+
posinset: i + 1,
|
|
83
|
+
setsize: count,
|
|
84
|
+
}))
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** The indent guides before a row's content. Top-level rows sit flush. */
|
|
88
|
+
const TreeRails = ({ depth, ancestorHasNextSibling, isLast }: TreePosition) =>
|
|
89
|
+
depth > 0 && (
|
|
90
|
+
<>
|
|
91
|
+
{/* ancestor rails: a vertical guide where that ancestor has a sibling below */}
|
|
92
|
+
{ancestorHasNextSibling.map((hasNext, i) => (
|
|
93
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Indentation is stable inside component, we would want to rerender anyway.
|
|
94
|
+
<span key={i} aria-hidden className="relative w-4 shrink-0 self-stretch">
|
|
95
|
+
{hasNext && <span className={cn("absolute inset-y-0 inset-s-1/2 w-px", treeLine)} />}
|
|
96
|
+
</span>
|
|
97
|
+
))}
|
|
98
|
+
|
|
99
|
+
{/* connector: vertical (├ continues / └ stops) + horizontal elbow */}
|
|
100
|
+
<span aria-hidden className="relative w-4 shrink-0 self-stretch">
|
|
101
|
+
<span
|
|
102
|
+
className={cn("absolute inset-s-1/2 top-0 w-px", treeLine, isLast ? "h-1/2" : "bottom-0")}
|
|
103
|
+
/>
|
|
104
|
+
<span className={cn("absolute inset-s-1/2 top-1/2 h-px w-1/2", treeLine)} />
|
|
105
|
+
</span>
|
|
106
|
+
</>
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
export type TreeRowProps = ComponentProps<"div"> & {
|
|
110
|
+
position: TreePosition
|
|
111
|
+
size: Size
|
|
112
|
+
/** See `treeRow`. Default `true`. */
|
|
113
|
+
interactive?: boolean
|
|
114
|
+
/** Draw the rails; without, each level is a blank column. Default `true`. */
|
|
115
|
+
withLines?: boolean
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** A row: the `treeRow` box, its indent, then `children` (the row's content). The caller
|
|
119
|
+
* spreads its role, ARIA, focus and handlers. */
|
|
120
|
+
export const TreeRow = ({
|
|
121
|
+
position,
|
|
122
|
+
size,
|
|
123
|
+
interactive = true,
|
|
124
|
+
withLines = true,
|
|
125
|
+
className,
|
|
126
|
+
children,
|
|
127
|
+
...rest
|
|
128
|
+
}: TreeRowProps) => (
|
|
129
|
+
<div {...rest} className={cn(treeRow({ size, interactive }), className)}>
|
|
130
|
+
{withLines ? (
|
|
131
|
+
<TreeRails {...position} />
|
|
132
|
+
) : (
|
|
133
|
+
Array.from({ length: position.depth }, (_, i) => (
|
|
134
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: one blank column per level, never reordered.
|
|
135
|
+
<span key={i} aria-hidden className="w-4 shrink-0" />
|
|
136
|
+
))
|
|
137
|
+
)}
|
|
138
|
+
{children}
|
|
139
|
+
</div>
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
/** A row's label, after the indent and any marks: fills the row and truncates. */
|
|
143
|
+
export const treeText = "ms-1.5 min-w-0 flex-1 truncate text-start"
|
|
144
|
+
|
|
145
|
+
/** A row's default label. */
|
|
146
|
+
export const TreeLabel = ({ className, children }: { className?: string; children: ReactNode }) => (
|
|
147
|
+
<span className={cn(treeText, className)}>{children}</span>
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
export type TreeCheckMarkProps = Omit<ComponentProps<"span">, "children"> & {
|
|
151
|
+
checked: boolean
|
|
152
|
+
indeterminate: boolean
|
|
153
|
+
size: Size
|
|
154
|
+
icons: { check: ReactNode; indeterminate: ReactNode }
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* A row's checkbox, presentational: the state is the row's `aria-checked`. It borrows
|
|
159
|
+
* Checkbox's own box, driven by `data-state` the way Ark drives the real one, so checked and
|
|
160
|
+
* indeterminate match `Checkbox`.
|
|
161
|
+
*/
|
|
162
|
+
export const TreeCheckMark = ({
|
|
163
|
+
checked,
|
|
164
|
+
indeterminate,
|
|
165
|
+
size,
|
|
166
|
+
icons,
|
|
167
|
+
className,
|
|
168
|
+
...rest
|
|
169
|
+
}: TreeCheckMarkProps) => (
|
|
170
|
+
<span
|
|
171
|
+
aria-hidden
|
|
172
|
+
data-state={checked ? "checked" : indeterminate ? "indeterminate" : "unchecked"}
|
|
173
|
+
{...rest}
|
|
174
|
+
className={cn(controlIndicator({ size, variant: "filled" }), className)}
|
|
175
|
+
>
|
|
176
|
+
{checked && icons.check}
|
|
177
|
+
{indeterminate && icons.indeterminate}
|
|
178
|
+
</span>
|
|
179
|
+
)
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { act, fireEvent, render, screen, waitFor } from "@testing-library/react"
|
|
2
|
+
import { describe, expect, it, vi } from "vitest"
|
|
3
|
+
import { IntlProvider } from "../../lib/intl"
|
|
4
|
+
import type { TreeNodeData } from "../../lib/tree-data"
|
|
5
|
+
import { Tree } from "./tree"
|
|
6
|
+
|
|
7
|
+
const data: TreeNodeData[] = [
|
|
8
|
+
{
|
|
9
|
+
value: "src",
|
|
10
|
+
label: "src",
|
|
11
|
+
children: [
|
|
12
|
+
{ value: "index.ts", label: "index.ts" },
|
|
13
|
+
{
|
|
14
|
+
value: "lib",
|
|
15
|
+
label: "lib",
|
|
16
|
+
children: [
|
|
17
|
+
{ value: "cn.ts", label: "cn.ts" },
|
|
18
|
+
{ value: "colors.ts", label: "colors.ts", disabled: true },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{ value: "README.md", label: "README.md" },
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
const row = (value: string) => screen.getByTestId(`item-${value}`)
|
|
27
|
+
const group = (value: string) => screen.getByTestId(`item-${value}-group`)
|
|
28
|
+
/** Ark's machine commits its state after the event; let it land. */
|
|
29
|
+
const flush = () => act(() => new Promise((resolve) => setTimeout(resolve, 0)))
|
|
30
|
+
const click = async (el: HTMLElement, init?: MouseEventInit) => {
|
|
31
|
+
fireEvent.click(el, init)
|
|
32
|
+
await flush()
|
|
33
|
+
}
|
|
34
|
+
const key = async (el: HTMLElement, k: string) => {
|
|
35
|
+
fireEvent.keyDown(el, { key: k })
|
|
36
|
+
await flush()
|
|
37
|
+
}
|
|
38
|
+
const isOpen = (value: string) => group(value).getAttribute("data-state") === "open"
|
|
39
|
+
|
|
40
|
+
describe("Tree", () => {
|
|
41
|
+
it("renders a tree of treeitems, branches collapsed", async () => {
|
|
42
|
+
render(<Tree data={data} />)
|
|
43
|
+
expect(screen.getByRole("tree").getAttribute("aria-label")).toBe("Tree")
|
|
44
|
+
expect(screen.getAllByRole("treeitem")).toHaveLength(6)
|
|
45
|
+
expect(isOpen("src")).toBe(false)
|
|
46
|
+
// A closed group is inert: out of the tab order and the accessibility tree.
|
|
47
|
+
expect(group("src").querySelector("[inert]")).not.toBeNull()
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it("expands a branch on click and collapses it again", async () => {
|
|
51
|
+
const onExpandedChange = vi.fn()
|
|
52
|
+
render(<Tree data={data} onExpandedChange={onExpandedChange} />)
|
|
53
|
+
await click(row("src"))
|
|
54
|
+
expect(isOpen("src")).toBe(true)
|
|
55
|
+
expect(onExpandedChange).toHaveBeenLastCalledWith(["src"])
|
|
56
|
+
await click(row("src"))
|
|
57
|
+
expect(isOpen("src")).toBe(false)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it("toggles from the chevron alone with expandOnClick={false}", async () => {
|
|
61
|
+
const onSelectedChange = vi.fn()
|
|
62
|
+
render(<Tree data={data} expandOnClick={false} onSelectedChange={onSelectedChange} />)
|
|
63
|
+
await click(row("src"))
|
|
64
|
+
expect(isOpen("src")).toBe(false)
|
|
65
|
+
await click(screen.getByTestId("item-src-indicator"))
|
|
66
|
+
expect(isOpen("src")).toBe(true)
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it("follows a controlled `expanded`", async () => {
|
|
70
|
+
const { rerender } = render(<Tree data={data} expanded={[]} />)
|
|
71
|
+
await click(row("src"))
|
|
72
|
+
expect(isOpen("src")).toBe(false)
|
|
73
|
+
rerender(<Tree data={data} expanded={["src", "lib"]} />)
|
|
74
|
+
expect(isOpen("src")).toBe(true)
|
|
75
|
+
expect(isOpen("lib")).toBe(true)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it("selects one node, or several with `multiple`", async () => {
|
|
79
|
+
const onSelectedChange = vi.fn()
|
|
80
|
+
const { unmount } = render(
|
|
81
|
+
<Tree data={data} defaultExpanded={["src"]} onSelectedChange={onSelectedChange} />,
|
|
82
|
+
)
|
|
83
|
+
await click(row("index.ts"))
|
|
84
|
+
await click(row("README.md"))
|
|
85
|
+
expect(onSelectedChange).toHaveBeenLastCalledWith(["README.md"])
|
|
86
|
+
expect(row("README.md").getAttribute("aria-selected")).toBe("true")
|
|
87
|
+
unmount()
|
|
88
|
+
|
|
89
|
+
render(
|
|
90
|
+
<Tree data={data} multiple defaultExpanded={["src"]} onSelectedChange={onSelectedChange} />,
|
|
91
|
+
)
|
|
92
|
+
await click(row("index.ts"))
|
|
93
|
+
await click(row("README.md"), { ctrlKey: true })
|
|
94
|
+
expect(onSelectedChange).toHaveBeenLastCalledWith(["index.ts", "README.md"])
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it("calls onNodeClick with the node, but not for a disabled one", async () => {
|
|
98
|
+
const onNodeClick = vi.fn()
|
|
99
|
+
render(<Tree data={data} defaultExpanded={["src", "lib"]} onNodeClick={onNodeClick} />)
|
|
100
|
+
await click(row("cn.ts"))
|
|
101
|
+
expect(onNodeClick).toHaveBeenCalledWith(
|
|
102
|
+
expect.objectContaining({ value: "cn.ts" }),
|
|
103
|
+
expect.anything(),
|
|
104
|
+
)
|
|
105
|
+
onNodeClick.mockClear()
|
|
106
|
+
await click(row("colors.ts"))
|
|
107
|
+
expect(onNodeClick).not.toHaveBeenCalled()
|
|
108
|
+
expect(row("colors.ts").getAttribute("aria-disabled")).toBe("true")
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
it("inherits disabled down a branch", async () => {
|
|
112
|
+
render(
|
|
113
|
+
<Tree
|
|
114
|
+
data={[{ value: "a", label: "A", disabled: true, children: [{ value: "b", label: "B" }] }]}
|
|
115
|
+
defaultExpanded={["a"]}
|
|
116
|
+
/>,
|
|
117
|
+
)
|
|
118
|
+
expect(row("b").getAttribute("data-disabled")).not.toBeNull()
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
it("moves focus and expands with the arrow keys", async () => {
|
|
122
|
+
render(<Tree data={data} />)
|
|
123
|
+
const src = row("src")
|
|
124
|
+
act(() => src.focus())
|
|
125
|
+
await key(src, "ArrowRight")
|
|
126
|
+
expect(isOpen("src")).toBe(true)
|
|
127
|
+
await key(src, "ArrowDown")
|
|
128
|
+
expect(document.activeElement).toBe(row("index.ts"))
|
|
129
|
+
await key(row("index.ts"), "ArrowLeft")
|
|
130
|
+
expect(document.activeElement).toBe(src)
|
|
131
|
+
await key(src, "ArrowLeft")
|
|
132
|
+
expect(isOpen("src")).toBe(false)
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
it("mirrors the arrow keys under rtl", async () => {
|
|
136
|
+
render(
|
|
137
|
+
<IntlProvider locale="ar">
|
|
138
|
+
<Tree data={data} />
|
|
139
|
+
</IntlProvider>,
|
|
140
|
+
)
|
|
141
|
+
const src = row("src")
|
|
142
|
+
act(() => src.focus())
|
|
143
|
+
await key(src, "ArrowLeft")
|
|
144
|
+
expect(isOpen("src")).toBe(true)
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it("cascades checkboxes like TreeMultiSelect, skipping disabled leaves", async () => {
|
|
148
|
+
const onCheckedChange = vi.fn()
|
|
149
|
+
render(
|
|
150
|
+
<Tree
|
|
151
|
+
data={data}
|
|
152
|
+
withCheckbox
|
|
153
|
+
defaultExpanded={["src", "lib"]}
|
|
154
|
+
onCheckedChange={onCheckedChange}
|
|
155
|
+
/>,
|
|
156
|
+
)
|
|
157
|
+
await click(screen.getByTestId("item-lib-checkbox"))
|
|
158
|
+
expect(onCheckedChange).toHaveBeenLastCalledWith(["cn.ts"])
|
|
159
|
+
// `lib` reads checked: its one enabled leaf is. `src` is partial.
|
|
160
|
+
expect(
|
|
161
|
+
screen
|
|
162
|
+
.getAllByRole("treeitem")
|
|
163
|
+
.find((el) => el.dataset["value"] === "lib")
|
|
164
|
+
?.getAttribute("aria-checked"),
|
|
165
|
+
).toBe("true")
|
|
166
|
+
expect(
|
|
167
|
+
screen
|
|
168
|
+
.getAllByRole("treeitem")
|
|
169
|
+
.find((el) => el.dataset["value"] === "src")
|
|
170
|
+
?.getAttribute("aria-checked"),
|
|
171
|
+
).toBe("mixed")
|
|
172
|
+
// The checkbox click didn't select the row.
|
|
173
|
+
expect(row("lib").getAttribute("data-selected")).toBeNull()
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
it("checks with Space and selects with Enter when withCheckbox", async () => {
|
|
177
|
+
const onCheckedChange = vi.fn()
|
|
178
|
+
const onSelectedChange = vi.fn()
|
|
179
|
+
render(
|
|
180
|
+
<Tree
|
|
181
|
+
data={data}
|
|
182
|
+
withCheckbox
|
|
183
|
+
onCheckedChange={onCheckedChange}
|
|
184
|
+
onSelectedChange={onSelectedChange}
|
|
185
|
+
/>,
|
|
186
|
+
)
|
|
187
|
+
const readme = row("README.md")
|
|
188
|
+
act(() => readme.focus())
|
|
189
|
+
await key(readme, " ")
|
|
190
|
+
expect(onCheckedChange).toHaveBeenLastCalledWith(["README.md"])
|
|
191
|
+
expect(onSelectedChange).not.toHaveBeenCalled()
|
|
192
|
+
await key(readme, "Enter")
|
|
193
|
+
expect(onSelectedChange).toHaveBeenLastCalledWith(["README.md"])
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
it("loads a hasChildren branch on first expand, with a spinner meanwhile", async () => {
|
|
197
|
+
let resolve: (nodes: TreeNodeData[]) => void = () => {}
|
|
198
|
+
const loadChildren = vi.fn(
|
|
199
|
+
() =>
|
|
200
|
+
new Promise<TreeNodeData[]>((r) => {
|
|
201
|
+
resolve = r
|
|
202
|
+
}),
|
|
203
|
+
)
|
|
204
|
+
render(
|
|
205
|
+
<Tree
|
|
206
|
+
data={[{ value: "remote", label: "remote", hasChildren: true }]}
|
|
207
|
+
loadChildren={loadChildren}
|
|
208
|
+
/>,
|
|
209
|
+
)
|
|
210
|
+
await click(row("remote"))
|
|
211
|
+
expect(loadChildren).toHaveBeenCalledWith(
|
|
212
|
+
expect.objectContaining({ value: "remote" }),
|
|
213
|
+
expect.objectContaining({ signal: expect.any(AbortSignal) }),
|
|
214
|
+
)
|
|
215
|
+
await waitFor(() =>
|
|
216
|
+
expect(screen.getAllByRole("treeitem")[0]?.getAttribute("aria-busy")).toBe("true"),
|
|
217
|
+
)
|
|
218
|
+
await act(async () => resolve([{ value: "remote/a", label: "a" }]))
|
|
219
|
+
await waitFor(() => expect(isOpen("remote")).toBe(true))
|
|
220
|
+
expect(row("remote/a")).toBeTruthy()
|
|
221
|
+
|
|
222
|
+
// Collapsing and expanding again doesn't reload.
|
|
223
|
+
await click(row("remote"))
|
|
224
|
+
await click(row("remote"))
|
|
225
|
+
expect(loadChildren).toHaveBeenCalledTimes(1)
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
it("reports a failed load and stays closed", async () => {
|
|
229
|
+
const onLoadError = vi.fn()
|
|
230
|
+
render(
|
|
231
|
+
<Tree
|
|
232
|
+
data={[{ value: "remote", label: "remote", hasChildren: true }]}
|
|
233
|
+
loadChildren={() => Promise.reject(new Error("offline"))}
|
|
234
|
+
onLoadError={onLoadError}
|
|
235
|
+
/>,
|
|
236
|
+
)
|
|
237
|
+
await click(row("remote"))
|
|
238
|
+
await waitFor(() => expect(onLoadError).toHaveBeenCalled())
|
|
239
|
+
expect(isOpen("remote")).toBe(false)
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
it("renders row actions that neither select nor move the row", async () => {
|
|
243
|
+
const onSelectedChange = vi.fn()
|
|
244
|
+
const onDelete = vi.fn()
|
|
245
|
+
render(
|
|
246
|
+
<Tree
|
|
247
|
+
data={data}
|
|
248
|
+
onSelectedChange={onSelectedChange}
|
|
249
|
+
actions={(node) => (
|
|
250
|
+
<button type="button" onClick={() => onDelete(node.value)}>
|
|
251
|
+
Delete
|
|
252
|
+
</button>
|
|
253
|
+
)}
|
|
254
|
+
/>,
|
|
255
|
+
)
|
|
256
|
+
await click(screen.getByTestId("item-README.md-actions").querySelector("button") as HTMLElement)
|
|
257
|
+
expect(onDelete).toHaveBeenCalledWith("README.md")
|
|
258
|
+
expect(onSelectedChange).not.toHaveBeenCalled()
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
it("draws per-node icons, defaults and overrides", async () => {
|
|
262
|
+
render(
|
|
263
|
+
<Tree
|
|
264
|
+
data={[
|
|
265
|
+
{ value: "a", label: "A", icon: <span data-own-icon /> },
|
|
266
|
+
{ value: "b", label: "B", icon: null },
|
|
267
|
+
{ value: "c", label: "C" },
|
|
268
|
+
]}
|
|
269
|
+
icons={{ file: <span data-file-icon /> }}
|
|
270
|
+
/>,
|
|
271
|
+
)
|
|
272
|
+
expect(screen.getByTestId("item-a-icon").querySelector("[data-own-icon]")).not.toBeNull()
|
|
273
|
+
expect(screen.queryByTestId("item-b-icon")).toBeNull()
|
|
274
|
+
expect(screen.getByTestId("item-c-icon").querySelector("[data-file-icon]")).not.toBeNull()
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
it("composes rows from the parts", async () => {
|
|
278
|
+
render(
|
|
279
|
+
<Tree.Root data={data} testId="files">
|
|
280
|
+
<Tree.Label>Files</Tree.Label>
|
|
281
|
+
<Tree.List>
|
|
282
|
+
{(node, state) => (
|
|
283
|
+
<>
|
|
284
|
+
<Tree.Indicator />
|
|
285
|
+
<Tree.Text>{state.leaf ? node.label : `${node.label}/`}</Tree.Text>
|
|
286
|
+
</>
|
|
287
|
+
)}
|
|
288
|
+
</Tree.List>
|
|
289
|
+
</Tree.Root>,
|
|
290
|
+
)
|
|
291
|
+
expect(screen.getByTestId("files")).toBeTruthy()
|
|
292
|
+
expect(screen.getByRole("tree", { name: "Files" })).toBeTruthy()
|
|
293
|
+
expect(screen.getByTestId("item-src-text").textContent).toBe("src/")
|
|
294
|
+
expect(screen.getByTestId("item-README.md-text").textContent).toBe("README.md")
|
|
295
|
+
})
|
|
296
|
+
})
|