@42-central/ui-react 0.29.1 → 0.30.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-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/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/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
|
@@ -16,7 +16,7 @@ import type { Color } from "../../lib/colors"
|
|
|
16
16
|
import { controlOpenProps } from "../../lib/control-open"
|
|
17
17
|
import { useMergedRefs } from "../../lib/merge-refs"
|
|
18
18
|
import { useOverlayContainer } from "../../lib/overlay-container"
|
|
19
|
-
import { NestedLayer } from "../../lib/overlay-layer"
|
|
19
|
+
import { NestedLayer, useTourRaised } from "../../lib/overlay-layer"
|
|
20
20
|
import { props } from "../../lib/props"
|
|
21
21
|
import {
|
|
22
22
|
type ClearSectionMode,
|
|
@@ -29,7 +29,13 @@ import {
|
|
|
29
29
|
} from "../../lib/select-data"
|
|
30
30
|
import type { WithTestId } from "../../lib/test-id"
|
|
31
31
|
import { COMBOBOX_DEFAULT_TRANSLATIONS, type ComboboxTranslations } from "../combobox/combobox"
|
|
32
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
type FieldProps,
|
|
34
|
+
FieldShell,
|
|
35
|
+
fieldA11yProps,
|
|
36
|
+
useInheritedDisabled,
|
|
37
|
+
useInheritedInvalid,
|
|
38
|
+
} from "../field/field"
|
|
33
39
|
import {
|
|
34
40
|
type InputSize,
|
|
35
41
|
type InputVariant,
|
|
@@ -40,12 +46,13 @@ import {
|
|
|
40
46
|
} from "../input/input"
|
|
41
47
|
import { CheckIcon, ChevronIcon, CloseIcon } from "../popover/icons"
|
|
42
48
|
import {
|
|
49
|
+
ListboxScrollArea,
|
|
50
|
+
listboxList,
|
|
43
51
|
popoverChevron,
|
|
44
52
|
popoverClearTrigger,
|
|
45
53
|
popoverContent,
|
|
46
54
|
popoverGroupLabel,
|
|
47
55
|
popoverIndicator,
|
|
48
|
-
popoverList,
|
|
49
56
|
popoverOption,
|
|
50
57
|
scrollHighlightedIntoView,
|
|
51
58
|
} from "../popover/popover"
|
|
@@ -195,7 +202,7 @@ export const Select = <const Data extends SelectData = SelectData>({
|
|
|
195
202
|
size = "md",
|
|
196
203
|
variant = "default",
|
|
197
204
|
color,
|
|
198
|
-
disabled,
|
|
205
|
+
disabled: disabledProp,
|
|
199
206
|
readOnly,
|
|
200
207
|
required,
|
|
201
208
|
invalid,
|
|
@@ -213,13 +220,19 @@ export const Select = <const Data extends SelectData = SelectData>({
|
|
|
213
220
|
}: SelectProps<Data> & Omit<ComponentProps<"select">, keyof SelectProps>) => {
|
|
214
221
|
const resolvedTranslations = { ...COMBOBOX_DEFAULT_TRANSLATIONS, ...translations }
|
|
215
222
|
const portalContainer = useOverlayContainer(container)
|
|
223
|
+
// Lifted above a running tour while open; see `useTourRaised`. The list's
|
|
224
|
+
// `open` only exists inside `Ark.Context`, and a closed list ignores it.
|
|
225
|
+
const raised = useTourRaised(true)
|
|
216
226
|
const { collection, items, groups } = useMemo(() => normalizeSelectData(data), [data])
|
|
217
227
|
const controlRef = useRef<HTMLDivElement>(null)
|
|
218
228
|
const triggerRef = useRef<HTMLButtonElement>(null)
|
|
219
229
|
const mergedTriggerRef = useMergedRefs(triggerRef, ref)
|
|
230
|
+
// With no `label` there is no `Field` to pass a `Fieldset`'s state on, so
|
|
231
|
+
// read it here: the shell, the pills and the clear button all key off it.
|
|
232
|
+
const disabled = useInheritedDisabled(disabledProp)
|
|
220
233
|
// Red state is driven independently of the `Field` error slot so a form
|
|
221
234
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
222
|
-
const isInvalid = invalid || error != null
|
|
235
|
+
const isInvalid = useInheritedInvalid(invalid || error != null)
|
|
223
236
|
const selected = items.find(({ value: iv }) => value === iv)
|
|
224
237
|
|
|
225
238
|
const renderOption = (item: NormalizedItemOf<Data>) => (
|
|
@@ -381,19 +394,25 @@ export const Select = <const Data extends SelectData = SelectData>({
|
|
|
381
394
|
<Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>
|
|
382
395
|
<Portal disabled={!withinPortal} container={portalContainer}>
|
|
383
396
|
<Ark.Positioner>
|
|
384
|
-
<Ark.Content
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
+
<Ark.Content
|
|
398
|
+
data-color={color}
|
|
399
|
+
data-raised={raised || undefined}
|
|
400
|
+
className={cn(popoverContent, classNames?.popover)}
|
|
401
|
+
>
|
|
402
|
+
<ListboxScrollArea>
|
|
403
|
+
<Ark.List className={listboxList}>
|
|
404
|
+
{groups
|
|
405
|
+
? groups.map((group) => (
|
|
406
|
+
<Ark.ItemGroup key={group.group}>
|
|
407
|
+
<Ark.ItemGroupLabel className={popoverGroupLabel}>
|
|
408
|
+
{group.group}
|
|
409
|
+
</Ark.ItemGroupLabel>
|
|
410
|
+
{group.items.map(renderOption)}
|
|
411
|
+
</Ark.ItemGroup>
|
|
412
|
+
))
|
|
413
|
+
: items.map(renderOption)}
|
|
414
|
+
</Ark.List>
|
|
415
|
+
</ListboxScrollArea>
|
|
397
416
|
</Ark.Content>
|
|
398
417
|
</Ark.Positioner>
|
|
399
418
|
</Portal>
|
|
@@ -12,7 +12,7 @@ import { props } from "../../lib/props"
|
|
|
12
12
|
import type { Size } from "../../lib/sizes"
|
|
13
13
|
import type { WithTestId } from "../../lib/test-id"
|
|
14
14
|
import { TYPOGRAPHY_SHADE_CLASSES } from "../../lib/typography-size"
|
|
15
|
-
import { type FieldProps, FieldShell, fieldA11yProps } from "../field/field"
|
|
15
|
+
import { type FieldProps, FieldShell, fieldA11yProps, useInheritedInvalid } from "../field/field"
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Slider — Range input on top of Ark UI's Slider state
|
|
@@ -320,7 +320,7 @@ export const Slider = <V extends SliderValue = number>({
|
|
|
320
320
|
const showMarks = marks !== null && marks !== undefined && marks.length > 0
|
|
321
321
|
// Red state is driven independently of the `Field` error slot so a form
|
|
322
322
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
323
|
-
const isInvalid = invalid || error != null
|
|
323
|
+
const isInvalid = useInheritedInvalid(invalid || error != null)
|
|
324
324
|
|
|
325
325
|
// The emitted shape mirrors the controlled/default value: arrays stay
|
|
326
326
|
// arrays (range), scalars stay scalars (single thumb).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
SPLITTER_DEFAULT_TRANSLATIONS,
|
|
5
|
+
Splitter,
|
|
6
|
+
type SplitterApi,
|
|
7
|
+
type SplitterHandleProps,
|
|
8
|
+
type SplitterOrientation,
|
|
9
|
+
type SplitterPanelProps,
|
|
10
|
+
type SplitterProps,
|
|
11
|
+
type SplitterSize,
|
|
12
|
+
type SplitterToggleProps,
|
|
13
|
+
type SplitterTranslations,
|
|
14
|
+
useSplitterContext,
|
|
15
|
+
} from "./splitter"
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { act, fireEvent, render, screen } from "@testing-library/react"
|
|
2
|
+
import { type ReactElement, useState } from "react"
|
|
3
|
+
import { describe, expect, it, vi } from "vitest"
|
|
4
|
+
import { IntlProvider } from "../../lib/intl"
|
|
5
|
+
import { Splitter, type SplitterProps, useSplitterContext } from "./splitter"
|
|
6
|
+
|
|
7
|
+
/** Lets the machine's queued updates and callbacks run. */
|
|
8
|
+
const flush = () => act(() => new Promise((resolve) => setTimeout(resolve)))
|
|
9
|
+
|
|
10
|
+
/** Renders, then lets the machine measure the root and settle its sizes. */
|
|
11
|
+
const mount = async (ui: ReactElement) => {
|
|
12
|
+
const result = render(ui)
|
|
13
|
+
await flush()
|
|
14
|
+
return result
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const TwoPanels = (props: Partial<SplitterProps>) => (
|
|
18
|
+
<Splitter testId="root" {...props}>
|
|
19
|
+
<Splitter.Panel id="list" testId="list" defaultSize={30} min={20} collapsible>
|
|
20
|
+
List
|
|
21
|
+
<Splitter.Toggle panel="list" testId="toggle" />
|
|
22
|
+
<button type="button">Inside list</button>
|
|
23
|
+
</Splitter.Panel>
|
|
24
|
+
<Splitter.Panel id="detail" testId="detail">
|
|
25
|
+
Detail
|
|
26
|
+
</Splitter.Panel>
|
|
27
|
+
</Splitter>
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
/** Focuses a handle and lets the machine see it: a key press in the same tick finds it idle. */
|
|
31
|
+
const focus = async (element: HTMLElement) => {
|
|
32
|
+
element.focus()
|
|
33
|
+
await flush()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const handles = () => screen.getAllByRole("separator")
|
|
37
|
+
const handle = () => handles()[0] as HTMLElement
|
|
38
|
+
|
|
39
|
+
describe("Splitter", () => {
|
|
40
|
+
it("puts a named, focusable handle between every two panels", async () => {
|
|
41
|
+
await mount(
|
|
42
|
+
<Splitter>
|
|
43
|
+
<Splitter.Panel>a</Splitter.Panel>
|
|
44
|
+
<Splitter.Panel>b</Splitter.Panel>
|
|
45
|
+
<Splitter.Panel>c</Splitter.Panel>
|
|
46
|
+
</Splitter>,
|
|
47
|
+
)
|
|
48
|
+
expect(handles()).toHaveLength(2)
|
|
49
|
+
for (const h of handles()) {
|
|
50
|
+
expect(h.getAttribute("aria-label")).toBe("Resize")
|
|
51
|
+
expect(h.tabIndex).toBe(0)
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it("uses a handle placed by hand instead of adding one", async () => {
|
|
56
|
+
await mount(
|
|
57
|
+
<Splitter>
|
|
58
|
+
<Splitter.Panel>a</Splitter.Panel>
|
|
59
|
+
<Splitter.Handle testId="mine" disabled />
|
|
60
|
+
<Splitter.Panel>b</Splitter.Panel>
|
|
61
|
+
</Splitter>,
|
|
62
|
+
)
|
|
63
|
+
expect(handles()).toHaveLength(1)
|
|
64
|
+
expect(handle()).toBe(screen.getByTestId("mine"))
|
|
65
|
+
expect(handle().hasAttribute("data-disabled")).toBe(true)
|
|
66
|
+
expect(handle().tabIndex).toBe(-1)
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it("starts at each panel's defaultSize, the rest shared", async () => {
|
|
70
|
+
await mount(<TwoPanels />)
|
|
71
|
+
expect(handle().getAttribute("aria-valuenow")).toBe("30")
|
|
72
|
+
expect(handle().getAttribute("aria-valuemin")).toBe("20")
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it("lets the panes shrink below their content and scroll it", async () => {
|
|
76
|
+
await mount(<TwoPanels />)
|
|
77
|
+
const panel = screen.getByTestId("list")
|
|
78
|
+
expect(panel.className).toContain("min-w-0")
|
|
79
|
+
expect(panel.className).toContain("min-h-0")
|
|
80
|
+
expect(panel.className).toContain("overflow-auto")
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it("moves by `step` with the arrow keys and reports the end", async () => {
|
|
84
|
+
const onResize = vi.fn()
|
|
85
|
+
const onResizeEnd = vi.fn()
|
|
86
|
+
await mount(<TwoPanels step={5} onResize={onResize} onResizeEnd={onResizeEnd} />)
|
|
87
|
+
await focus(handle())
|
|
88
|
+
fireEvent.keyDown(handle(), { key: "ArrowRight" })
|
|
89
|
+
await flush()
|
|
90
|
+
expect(onResize).toHaveBeenLastCalledWith([35, 65])
|
|
91
|
+
expect(onResizeEnd).toHaveBeenLastCalledWith([35, 65])
|
|
92
|
+
// Past its `min`, a collapsible panel snaps shut.
|
|
93
|
+
fireEvent.keyDown(handle(), { key: "Home" })
|
|
94
|
+
await flush()
|
|
95
|
+
expect(onResize).toHaveBeenLastCalledWith([0, 100])
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it("mirrors the arrow keys under RTL", async () => {
|
|
99
|
+
const onResize = vi.fn()
|
|
100
|
+
await mount(
|
|
101
|
+
<IntlProvider locale="ar-EG">
|
|
102
|
+
<TwoPanels step={5} onResize={onResize} />
|
|
103
|
+
</IntlProvider>,
|
|
104
|
+
)
|
|
105
|
+
await focus(handle())
|
|
106
|
+
fireEvent.keyDown(handle(), { key: "ArrowLeft" })
|
|
107
|
+
await flush()
|
|
108
|
+
expect(onResize).toHaveBeenLastCalledWith([35, 65])
|
|
109
|
+
expect(screen.getByTestId("root").getAttribute("dir")).toBe("rtl")
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it("mirrors a horizontal drag under RTL", async () => {
|
|
113
|
+
const onResize = vi.fn()
|
|
114
|
+
const onResizeEnd = vi.fn()
|
|
115
|
+
await mount(
|
|
116
|
+
<IntlProvider locale="ar-EG">
|
|
117
|
+
<TwoPanels onResize={onResize} onResizeEnd={onResizeEnd} />
|
|
118
|
+
</IntlProvider>,
|
|
119
|
+
)
|
|
120
|
+
const root = screen.getByTestId("root")
|
|
121
|
+
vi.spyOn(root, "getBoundingClientRect").mockReturnValue(new DOMRect(0, 0, 200, 100))
|
|
122
|
+
fireEvent.pointerDown(handle(), { button: 0, clientX: 100, pointerId: 1 })
|
|
123
|
+
expect(handle().hasAttribute("data-dragging")).toBe(true)
|
|
124
|
+
// 20px toward the left is 10% of 200px: the panel before (on the right) grows.
|
|
125
|
+
fireEvent.pointerMove(handle(), { clientX: 80, pointerId: 1 })
|
|
126
|
+
await flush()
|
|
127
|
+
expect(onResize).toHaveBeenLastCalledWith([40, 60])
|
|
128
|
+
fireEvent.pointerUp(handle(), { pointerId: 1 })
|
|
129
|
+
await flush()
|
|
130
|
+
expect(handle().hasAttribute("data-dragging")).toBe(false)
|
|
131
|
+
expect(onResizeEnd).toHaveBeenLastCalledWith([40, 60])
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it("collapses and expands from the toggle, and takes the collapsed panel out of reach", async () => {
|
|
135
|
+
const onCollapse = vi.fn()
|
|
136
|
+
const onExpand = vi.fn()
|
|
137
|
+
await mount(<TwoPanels onCollapse={onCollapse} onExpand={onExpand} />)
|
|
138
|
+
const toggle = screen.getByTestId("toggle")
|
|
139
|
+
expect(toggle.getAttribute("aria-expanded")).toBe("true")
|
|
140
|
+
expect(toggle.getAttribute("aria-label")).toBe("Collapse panel")
|
|
141
|
+
expect(toggle.getAttribute("aria-controls")).toBe(screen.getByTestId("list").id)
|
|
142
|
+
|
|
143
|
+
fireEvent.click(toggle)
|
|
144
|
+
|
|
145
|
+
await flush()
|
|
146
|
+
expect(onCollapse).toHaveBeenCalledWith("list")
|
|
147
|
+
expect(toggle.getAttribute("aria-expanded")).toBe("false")
|
|
148
|
+
expect(toggle.getAttribute("aria-label")).toBe("Expand panel")
|
|
149
|
+
expect(screen.getByTestId("list").hasAttribute("data-collapsed")).toBe(true)
|
|
150
|
+
expect(screen.getByTestId("list").hasAttribute("inert")).toBe(true)
|
|
151
|
+
|
|
152
|
+
// A collapsed panel is inert, so expand it the way a keyboard user would: Enter on the handle.
|
|
153
|
+
await focus(handle())
|
|
154
|
+
fireEvent.keyDown(handle(), { key: "Enter" })
|
|
155
|
+
await flush()
|
|
156
|
+
expect(onExpand).toHaveBeenCalledWith("list")
|
|
157
|
+
expect(screen.getByTestId("list").hasAttribute("inert")).toBe(false)
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
it("resets to the default sizes on double-click", async () => {
|
|
161
|
+
const onResizeEnd = vi.fn()
|
|
162
|
+
await mount(<TwoPanels step={10} onResizeEnd={onResizeEnd} />)
|
|
163
|
+
await focus(handle())
|
|
164
|
+
fireEvent.keyDown(handle(), { key: "ArrowRight" })
|
|
165
|
+
await flush()
|
|
166
|
+
expect(handle().getAttribute("aria-valuenow")).toBe("40")
|
|
167
|
+
fireEvent.doubleClick(handle())
|
|
168
|
+
await flush()
|
|
169
|
+
expect(handle().getAttribute("aria-valuenow")).toBe("30")
|
|
170
|
+
expect(onResizeEnd).toHaveBeenLastCalledWith([30, 70])
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
it("resets a controlled splitter too", async () => {
|
|
174
|
+
const Controlled = () => {
|
|
175
|
+
const [size, setSize] = useState([50, 50])
|
|
176
|
+
return (
|
|
177
|
+
<>
|
|
178
|
+
<TwoPanels size={size} onResize={setSize} />
|
|
179
|
+
<output data-testid="size">{size.join(",")}</output>
|
|
180
|
+
</>
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
await mount(<Controlled />)
|
|
184
|
+
expect(handle().getAttribute("aria-valuenow")).toBe("50")
|
|
185
|
+
await focus(handle())
|
|
186
|
+
fireEvent.keyDown(handle(), { key: "ArrowRight" })
|
|
187
|
+
await flush()
|
|
188
|
+
expect(screen.getByTestId("size").textContent).toBe("51,49")
|
|
189
|
+
fireEvent.doubleClick(handle())
|
|
190
|
+
await flush()
|
|
191
|
+
expect(screen.getByTestId("size").textContent).toBe("30,70")
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
it("leaves a disabled handle alone", async () => {
|
|
195
|
+
const onResize = vi.fn()
|
|
196
|
+
await mount(
|
|
197
|
+
<Splitter onResize={onResize}>
|
|
198
|
+
<Splitter.Panel defaultSize={40}>a</Splitter.Panel>
|
|
199
|
+
<Splitter.Handle disabled />
|
|
200
|
+
<Splitter.Panel>b</Splitter.Panel>
|
|
201
|
+
</Splitter>,
|
|
202
|
+
)
|
|
203
|
+
fireEvent.keyDown(handle(), { key: "ArrowRight" })
|
|
204
|
+
await flush()
|
|
205
|
+
fireEvent.doubleClick(handle())
|
|
206
|
+
expect(onResize).not.toHaveBeenCalled()
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
it("hands the nearest splitter to useSplitterContext, nested ones included", async () => {
|
|
210
|
+
const Reset = () => {
|
|
211
|
+
const splitter = useSplitterContext()
|
|
212
|
+
return (
|
|
213
|
+
<button type="button" onClick={() => splitter.collapse("top")}>
|
|
214
|
+
collapse top {splitter.size.join(",")}
|
|
215
|
+
</button>
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
await mount(
|
|
219
|
+
<Splitter>
|
|
220
|
+
<Splitter.Panel id="side">side</Splitter.Panel>
|
|
221
|
+
<Splitter.Panel id="main">
|
|
222
|
+
<Splitter orientation="vertical">
|
|
223
|
+
<Splitter.Panel id="top" collapsible defaultSize={40}>
|
|
224
|
+
<Reset />
|
|
225
|
+
</Splitter.Panel>
|
|
226
|
+
<Splitter.Panel id="bottom">bottom</Splitter.Panel>
|
|
227
|
+
</Splitter>
|
|
228
|
+
</Splitter.Panel>
|
|
229
|
+
</Splitter>,
|
|
230
|
+
)
|
|
231
|
+
const button = screen.getByRole("button", { name: /collapse top/ })
|
|
232
|
+
expect(button.textContent).toBe("collapse top 40,60")
|
|
233
|
+
fireEvent.click(button)
|
|
234
|
+
await flush()
|
|
235
|
+
expect(handles()[1]?.getAttribute("aria-valuenow")).toBe("0")
|
|
236
|
+
expect(handles()[1]?.getAttribute("aria-orientation")).toBe("vertical")
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
it("translates its names", async () => {
|
|
240
|
+
await mount(<TwoPanels translations={{ handle: "Redimensionner", collapse: "Replier" }} />)
|
|
241
|
+
expect(handle().getAttribute("aria-label")).toBe("Redimensionner")
|
|
242
|
+
expect(screen.getByTestId("toggle").getAttribute("aria-label")).toBe("Replier")
|
|
243
|
+
})
|
|
244
|
+
})
|