@42-central/ui-react 0.29.0 → 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/timeline/index.js +8 -1
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +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/timeline/timeline.test.tsx +22 -0
- package/src/components/timeline/timeline.tsx +10 -1
- 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,362 @@
|
|
|
1
|
+
import { LocaleProvider } from "@ark-ui/react/locale"
|
|
2
|
+
import { fireEvent, render, screen, waitFor } from "@testing-library/react"
|
|
3
|
+
import { describe, expect, it, type Mock, vi } from "vitest"
|
|
4
|
+
import { beforeDate } from "../../lib/date-predicates"
|
|
5
|
+
import { MonthPicker, YearPicker } from "./aliases"
|
|
6
|
+
import { DatePicker } from "./date-picker"
|
|
7
|
+
|
|
8
|
+
// Ark binds its handlers once the machine is ready; flush that macrotask (see date-picker.test.tsx).
|
|
9
|
+
/** The first argument of `fn`'s `call`-th call, asserting the call happened. */
|
|
10
|
+
const arg = <T,>(fn: Mock, call: number): T => {
|
|
11
|
+
const calls = fn.mock.calls[call]
|
|
12
|
+
if (!calls) throw new Error(`expected call #${call}`)
|
|
13
|
+
return calls[0] as T
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const flush = () => new Promise((resolve) => setTimeout(resolve, 0))
|
|
17
|
+
|
|
18
|
+
// Every fixture is written in UTC and passed `timeZone={TZ}`, so the host zone (UTC on CI,
|
|
19
|
+
// Europe/Paris on a laptop) never changes the expected instant.
|
|
20
|
+
const TZ = "UTC"
|
|
21
|
+
const utc = (year: number, month: number, day = 1) => new Date(Date.UTC(year, month, day))
|
|
22
|
+
|
|
23
|
+
const trigger = (container: HTMLElement) =>
|
|
24
|
+
container.querySelector('[data-part="trigger"]') as HTMLElement
|
|
25
|
+
|
|
26
|
+
const open = async (container: HTMLElement) => {
|
|
27
|
+
await flush()
|
|
28
|
+
fireEvent.click(trigger(container))
|
|
29
|
+
await flush()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** A month cell (1–12) or year cell, from the portaled popover. */
|
|
33
|
+
const monthCell = (month: number) =>
|
|
34
|
+
document.body.querySelector(
|
|
35
|
+
`[data-view="month"][role="button"][data-value="${month}"]`,
|
|
36
|
+
) as HTMLElement | null
|
|
37
|
+
const yearCell = (year: number) =>
|
|
38
|
+
document.body.querySelector(
|
|
39
|
+
`[data-view="year"][role="button"][data-value="${year}"]`,
|
|
40
|
+
) as HTMLElement | null
|
|
41
|
+
|
|
42
|
+
describe("MonthPicker", () => {
|
|
43
|
+
it("shows its own placeholder, and the value as a month and year", () => {
|
|
44
|
+
const { container, rerender } = render(<MonthPicker timeZone={TZ} />)
|
|
45
|
+
expect(screen.getByText("Pick a month")).toBeTruthy()
|
|
46
|
+
rerender(<MonthPicker timeZone={TZ} value={utc(2026, 6, 15)} />)
|
|
47
|
+
expect(trigger(container).textContent).toContain("July 2026")
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it("opens on the month grid and commits the month's first day", async () => {
|
|
51
|
+
const onChange = vi.fn()
|
|
52
|
+
const { container } = render(
|
|
53
|
+
<MonthPicker timeZone={TZ} defaultValue={utc(2026, 6)} onChange={onChange} />,
|
|
54
|
+
)
|
|
55
|
+
await open(container)
|
|
56
|
+
expect(document.body.querySelector('[data-view="day"][role="button"]')).toBeNull()
|
|
57
|
+
fireEvent.click(monthCell(3) as HTMLElement)
|
|
58
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
59
|
+
expect(arg<Date>(onChange, 0).getTime()).toBe(utc(2026, 2).getTime())
|
|
60
|
+
await waitFor(() => expect(trigger(container).getAttribute("aria-expanded")).toBe("false"))
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it("lands on midnight of the first day in the picker's own time zone", async () => {
|
|
64
|
+
const onChange = vi.fn()
|
|
65
|
+
const { container } = render(
|
|
66
|
+
<MonthPicker
|
|
67
|
+
timeZone="America/New_York"
|
|
68
|
+
defaultValue={new Date(Date.UTC(2026, 6, 15, 12))}
|
|
69
|
+
onChange={onChange}
|
|
70
|
+
/>,
|
|
71
|
+
)
|
|
72
|
+
await open(container)
|
|
73
|
+
fireEvent.click(monthCell(3) as HTMLElement)
|
|
74
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
75
|
+
// March 1st 2026, 00:00 EST (UTC-5).
|
|
76
|
+
expect(arg<Date>(onChange, 0).toISOString()).toBe("2026-03-01T05:00:00.000Z")
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it("selects a { start, end } range of months under range", async () => {
|
|
80
|
+
const onChange = vi.fn()
|
|
81
|
+
const { container } = render(
|
|
82
|
+
<MonthPicker
|
|
83
|
+
range
|
|
84
|
+
timeZone={TZ}
|
|
85
|
+
defaultValue={{ start: utc(2026, 0), end: utc(2026, 0) }}
|
|
86
|
+
onChange={onChange}
|
|
87
|
+
/>,
|
|
88
|
+
)
|
|
89
|
+
await open(container)
|
|
90
|
+
fireEvent.click(monthCell(3) as HTMLElement)
|
|
91
|
+
fireEvent.click(monthCell(6) as HTMLElement)
|
|
92
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(2))
|
|
93
|
+
const range = arg<{ start: Date; end: Date }>(onChange, 1)
|
|
94
|
+
expect(range.start.getTime()).toBe(utc(2026, 2).getTime())
|
|
95
|
+
expect(range.end.getTime()).toBe(utc(2026, 5).getTime())
|
|
96
|
+
expect(monthCell(4)?.hasAttribute("data-in-range")).toBe(true)
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it("widens min/max to their whole month", async () => {
|
|
100
|
+
const { container } = render(
|
|
101
|
+
<MonthPicker
|
|
102
|
+
timeZone={TZ}
|
|
103
|
+
defaultValue={utc(2026, 4)}
|
|
104
|
+
min={utc(2026, 2, 20)}
|
|
105
|
+
max={utc(2026, 7, 10)}
|
|
106
|
+
/>,
|
|
107
|
+
)
|
|
108
|
+
await open(container)
|
|
109
|
+
expect(monthCell(3)?.getAttribute("aria-disabled")).not.toBe("true")
|
|
110
|
+
expect(monthCell(8)?.getAttribute("aria-disabled")).not.toBe("true")
|
|
111
|
+
expect(monthCell(2)?.getAttribute("aria-disabled")).toBe("true")
|
|
112
|
+
expect(monthCell(9)?.getAttribute("aria-disabled")).toBe("true")
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
it("asks isDateUnavailable about each month, at unit 'month', and blocks a click", async () => {
|
|
116
|
+
const onChange = vi.fn()
|
|
117
|
+
const predicate = vi.fn(beforeDate(utc(2026, 5, 10)))
|
|
118
|
+
const { container } = render(
|
|
119
|
+
<MonthPicker
|
|
120
|
+
timeZone={TZ}
|
|
121
|
+
defaultValue={utc(2026, 6)}
|
|
122
|
+
isDateUnavailable={predicate}
|
|
123
|
+
onChange={onChange}
|
|
124
|
+
/>,
|
|
125
|
+
)
|
|
126
|
+
await open(container)
|
|
127
|
+
expect(predicate).toHaveBeenCalledWith(utc(2026, 0), TZ, "month")
|
|
128
|
+
const may = monthCell(5) as HTMLElement
|
|
129
|
+
expect(may.getAttribute("aria-disabled")).toBe("true")
|
|
130
|
+
expect(may.hasAttribute("data-unavailable")).toBe(true)
|
|
131
|
+
// June holds the boundary day, so it stays open.
|
|
132
|
+
expect(monthCell(6)?.hasAttribute("data-unavailable")).toBe(false)
|
|
133
|
+
fireEvent.click(may)
|
|
134
|
+
await flush()
|
|
135
|
+
expect(onChange).not.toHaveBeenCalled()
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
it("Enter on an unavailable focused month doesn't commit it", async () => {
|
|
139
|
+
const onChange = vi.fn()
|
|
140
|
+
const { container } = render(
|
|
141
|
+
<MonthPicker
|
|
142
|
+
timeZone={TZ}
|
|
143
|
+
defaultValue={utc(2026, 6)}
|
|
144
|
+
isDateUnavailable={(date, _zone, unit) => unit === "month" && date.getUTCMonth() === 7}
|
|
145
|
+
onChange={onChange}
|
|
146
|
+
/>,
|
|
147
|
+
)
|
|
148
|
+
await open(container)
|
|
149
|
+
const table = document.body.querySelector(
|
|
150
|
+
'[data-part="table"][data-view="month"]',
|
|
151
|
+
) as HTMLElement
|
|
152
|
+
fireEvent.keyDown(table, { key: "ArrowRight" })
|
|
153
|
+
await flush()
|
|
154
|
+
expect(monthCell(8)?.hasAttribute("data-focus")).toBe(true)
|
|
155
|
+
fireEvent.keyDown(table, { key: "Enter" })
|
|
156
|
+
await flush()
|
|
157
|
+
expect(onChange).not.toHaveBeenCalled()
|
|
158
|
+
fireEvent.keyDown(table, { key: "ArrowRight" })
|
|
159
|
+
await flush()
|
|
160
|
+
fireEvent.keyDown(table, { key: "Enter" })
|
|
161
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
162
|
+
expect(arg<Date>(onChange, 0).getTime()).toBe(utc(2026, 8).getTime())
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
it("snaps an incoming mid-month value to its first day", async () => {
|
|
166
|
+
const onChange = vi.fn()
|
|
167
|
+
const { container } = render(
|
|
168
|
+
<MonthPicker timeZone={TZ} defaultValue={utc(2026, 6, 20)} clearable onChange={onChange} />,
|
|
169
|
+
)
|
|
170
|
+
await open(container)
|
|
171
|
+
expect(monthCell(7)?.hasAttribute("data-selected")).toBe(true)
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
it("keeps an uncontrolled month when the zone changes after mount (hydration)", async () => {
|
|
175
|
+
// Midnight of July 1st in Paris is still June 30th in UTC, the zone an SSR render resolves.
|
|
176
|
+
const julyInParis = new Date(Date.UTC(2013, 5, 30, 22))
|
|
177
|
+
const { container, rerender } = render(
|
|
178
|
+
<MonthPicker timeZone="UTC" defaultValue={julyInParis} />,
|
|
179
|
+
)
|
|
180
|
+
await flush()
|
|
181
|
+
rerender(<MonthPicker timeZone="Europe/Paris" defaultValue={julyInParis} />)
|
|
182
|
+
await waitFor(() => expect(trigger(container).textContent).toContain("July 2013"))
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
it("commits midnight of the first day even when the value it replaces had a time", async () => {
|
|
186
|
+
const onChange = vi.fn()
|
|
187
|
+
const { container } = render(
|
|
188
|
+
<MonthPicker
|
|
189
|
+
timeZone={TZ}
|
|
190
|
+
defaultValue={new Date(Date.UTC(2026, 6, 15, 14, 30))}
|
|
191
|
+
onChange={onChange}
|
|
192
|
+
/>,
|
|
193
|
+
)
|
|
194
|
+
await open(container)
|
|
195
|
+
fireEvent.click(monthCell(3) as HTMLElement)
|
|
196
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
197
|
+
expect(arg<Date>(onChange, 0).toISOString()).toBe("2026-03-01T00:00:00.000Z")
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
it("serializes a named value as YYYY-MM", () => {
|
|
201
|
+
const { container } = render(
|
|
202
|
+
<MonthPicker name="month" timeZone={TZ} value={utc(2026, 6, 15)} />,
|
|
203
|
+
)
|
|
204
|
+
expect((container.querySelector('input[name="month"]') as HTMLInputElement).value).toBe(
|
|
205
|
+
"2026-07",
|
|
206
|
+
)
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
it("names the month cells and the trigger from the locale", async () => {
|
|
210
|
+
const { container } = render(<MonthPicker locale="fr-FR" timeZone={TZ} value={utc(2026, 6)} />)
|
|
211
|
+
expect(trigger(container).textContent).toContain("juillet 2026")
|
|
212
|
+
await open(container)
|
|
213
|
+
expect(monthCell(7)?.textContent).toBe("juil.")
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
it("ships this / last / next month presets, in the locale's words", async () => {
|
|
217
|
+
const onChange = vi.fn()
|
|
218
|
+
const { container } = render(<MonthPicker presets timeZone={TZ} onChange={onChange} />)
|
|
219
|
+
await open(container)
|
|
220
|
+
for (const label of ["This month", "Last month", "Next month"]) {
|
|
221
|
+
expect(screen.getByRole("button", { name: label })).toBeTruthy()
|
|
222
|
+
}
|
|
223
|
+
fireEvent.click(screen.getByRole("button", { name: "Last month" }))
|
|
224
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
225
|
+
const now = new Date()
|
|
226
|
+
expect(arg<Date>(onChange, 0).getTime()).toBe(
|
|
227
|
+
Date.UTC(now.getUTCFullYear(), now.getUTCMonth() - 1, 1),
|
|
228
|
+
)
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
it("ships this year / last year / all time as month spans under range", async () => {
|
|
232
|
+
const onChange = vi.fn()
|
|
233
|
+
const { container } = render(
|
|
234
|
+
<MonthPicker
|
|
235
|
+
range
|
|
236
|
+
presets
|
|
237
|
+
timeZone={TZ}
|
|
238
|
+
translations={{ presets: { allTime: "Always" } }}
|
|
239
|
+
onChange={onChange}
|
|
240
|
+
/>,
|
|
241
|
+
)
|
|
242
|
+
await open(container)
|
|
243
|
+
expect(screen.getByRole("button", { name: "Always" })).toBeTruthy()
|
|
244
|
+
fireEvent.click(screen.getByRole("button", { name: "This year" }))
|
|
245
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
246
|
+
const year = new Date().getUTCFullYear()
|
|
247
|
+
const range = arg<{ start: Date; end: Date }>(onChange, 0)
|
|
248
|
+
expect(range.start.getTime()).toBe(Date.UTC(year, 0, 1))
|
|
249
|
+
expect(range.end.getTime()).toBe(Date.UTC(year, 11, 1))
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
it("snaps a custom preset's date to its month", async () => {
|
|
253
|
+
const onChange = vi.fn()
|
|
254
|
+
const { container } = render(
|
|
255
|
+
<MonthPicker
|
|
256
|
+
presets={[{ label: "Kick-off", date: utc(2026, 8, 17) }]}
|
|
257
|
+
timeZone={TZ}
|
|
258
|
+
onChange={onChange}
|
|
259
|
+
/>,
|
|
260
|
+
)
|
|
261
|
+
await open(container)
|
|
262
|
+
fireEvent.click(screen.getByRole("button", { name: "Kick-off" }))
|
|
263
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
264
|
+
expect(arg<Date>(onChange, 0).getTime()).toBe(utc(2026, 8).getTime())
|
|
265
|
+
})
|
|
266
|
+
|
|
267
|
+
it("passes testId to the trigger", () => {
|
|
268
|
+
render(<MonthPicker testId="report-month" timeZone={TZ} />)
|
|
269
|
+
expect(screen.getByTestId("report-month").getAttribute("data-part")).toBe("trigger")
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
it("mirrors its arrows under an RTL locale", async () => {
|
|
273
|
+
const { container } = render(
|
|
274
|
+
<LocaleProvider locale="ar-EG">
|
|
275
|
+
<MonthPicker timeZone={TZ} defaultValue={utc(2026, 6)} />
|
|
276
|
+
</LocaleProvider>,
|
|
277
|
+
)
|
|
278
|
+
await open(container)
|
|
279
|
+
const table = document.body.querySelector(
|
|
280
|
+
'[data-part="table"][data-view="month"]',
|
|
281
|
+
) as HTMLElement
|
|
282
|
+
expect(table.getAttribute("dir")).toBe("rtl")
|
|
283
|
+
})
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
describe("YearPicker", () => {
|
|
287
|
+
it("shows its own placeholder, and the value as a year", () => {
|
|
288
|
+
const { container, rerender } = render(<YearPicker timeZone={TZ} />)
|
|
289
|
+
expect(screen.getByText("Pick a year")).toBeTruthy()
|
|
290
|
+
rerender(<YearPicker timeZone={TZ} value={utc(2026, 6, 15)} />)
|
|
291
|
+
expect(trigger(container).textContent?.trim()).toBe("2026")
|
|
292
|
+
})
|
|
293
|
+
|
|
294
|
+
it("commits January 1st of the picked year, and never climbs past the decade", async () => {
|
|
295
|
+
const onChange = vi.fn()
|
|
296
|
+
const { container } = render(
|
|
297
|
+
<YearPicker timeZone={TZ} defaultValue={utc(2026, 0)} onChange={onChange} />,
|
|
298
|
+
)
|
|
299
|
+
await open(container)
|
|
300
|
+
const viewTrigger = document.body.querySelector('[data-part="view-trigger"]') as HTMLElement
|
|
301
|
+
expect(viewTrigger.hasAttribute("disabled")).toBe(true)
|
|
302
|
+
fireEvent.click(yearCell(2024) as HTMLElement)
|
|
303
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
304
|
+
expect(arg<Date>(onChange, 0).getTime()).toBe(utc(2024, 0).getTime())
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
it("selects a range of years", async () => {
|
|
308
|
+
const onChange = vi.fn()
|
|
309
|
+
const { container } = render(
|
|
310
|
+
<YearPicker
|
|
311
|
+
range
|
|
312
|
+
timeZone={TZ}
|
|
313
|
+
defaultValue={{ start: utc(2026, 0), end: utc(2026, 0) }}
|
|
314
|
+
onChange={onChange}
|
|
315
|
+
/>,
|
|
316
|
+
)
|
|
317
|
+
await open(container)
|
|
318
|
+
fireEvent.click(yearCell(2021) as HTMLElement)
|
|
319
|
+
fireEvent.click(yearCell(2024) as HTMLElement)
|
|
320
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(2))
|
|
321
|
+
const range = arg<{ start: Date; end: Date }>(onChange, 1)
|
|
322
|
+
expect(range.start.getTime()).toBe(utc(2021, 0).getTime())
|
|
323
|
+
expect(range.end.getTime()).toBe(utc(2024, 0).getTime())
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
it("asks isDateUnavailable about each year, at unit 'year'", async () => {
|
|
327
|
+
const { container } = render(
|
|
328
|
+
<YearPicker
|
|
329
|
+
timeZone={TZ}
|
|
330
|
+
defaultValue={utc(2026, 0)}
|
|
331
|
+
isDateUnavailable={beforeDate(utc(2025, 5, 1))}
|
|
332
|
+
/>,
|
|
333
|
+
)
|
|
334
|
+
await open(container)
|
|
335
|
+
expect(yearCell(2024)?.hasAttribute("data-unavailable")).toBe(true)
|
|
336
|
+
expect(yearCell(2025)?.hasAttribute("data-unavailable")).toBe(false)
|
|
337
|
+
})
|
|
338
|
+
|
|
339
|
+
it("serializes a named value as YYYY", () => {
|
|
340
|
+
const { container } = render(<YearPicker name="cohort" timeZone={TZ} value={utc(2026, 6)} />)
|
|
341
|
+
expect((container.querySelector('input[name="cohort"]') as HTMLInputElement).value).toBe("2026")
|
|
342
|
+
})
|
|
343
|
+
|
|
344
|
+
it("ships this / last / next year presets", async () => {
|
|
345
|
+
const { container } = render(<YearPicker presets timeZone={TZ} />)
|
|
346
|
+
await open(container)
|
|
347
|
+
for (const label of ["This year", "Last year", "Next year"]) {
|
|
348
|
+
expect(screen.getByRole("button", { name: label })).toBeTruthy()
|
|
349
|
+
}
|
|
350
|
+
})
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
describe("DatePicker minView", () => {
|
|
354
|
+
it("ignores withTime and typeable once the value is a month", async () => {
|
|
355
|
+
const { container } = render(
|
|
356
|
+
<DatePicker minView="month" withTime typeable timeZone={TZ} value={utc(2026, 6)} />,
|
|
357
|
+
)
|
|
358
|
+
expect(container.querySelector('input[data-part="input"]')).toBeNull()
|
|
359
|
+
await open(container)
|
|
360
|
+
expect(document.body.querySelector('[role="group"]')).toBeNull()
|
|
361
|
+
})
|
|
362
|
+
})
|
|
@@ -285,3 +285,44 @@ describe("Drawer outside click", () => {
|
|
|
285
285
|
expect(onOpenChange).toHaveBeenLastCalledWith(false)
|
|
286
286
|
})
|
|
287
287
|
})
|
|
288
|
+
|
|
289
|
+
describe("Drawer body scrolling", () => {
|
|
290
|
+
it("scrolls the body in a ScrollArea by default, with className on the content", async () => {
|
|
291
|
+
render(
|
|
292
|
+
<Drawer defaultOpen title="Session" classNames={{ body: "gap-4" }}>
|
|
293
|
+
<p>Body text</p>
|
|
294
|
+
</Drawer>,
|
|
295
|
+
)
|
|
296
|
+
await screen.findByRole("dialog")
|
|
297
|
+
const content = screen.getByText("Body text").parentElement as HTMLElement
|
|
298
|
+
expect(content.dataset["scope"]).toBe("scroll-area")
|
|
299
|
+
expect(content.dataset["part"]).toBe("content")
|
|
300
|
+
expect(content.className).toContain("gap-4")
|
|
301
|
+
expect(content.closest("[data-part=root]")?.className).toContain("flex-1")
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
it("renders a plain, non-scrolling column with scrollable={false}", async () => {
|
|
305
|
+
render(
|
|
306
|
+
<Drawer defaultOpen title="Session" scrollable={false} classNames={{ body: "gap-4" }}>
|
|
307
|
+
<p>Body text</p>
|
|
308
|
+
</Drawer>,
|
|
309
|
+
)
|
|
310
|
+
await screen.findByRole("dialog")
|
|
311
|
+
const body = screen.getByText("Body text").parentElement as HTMLElement
|
|
312
|
+
expect(body.closest("[data-scope=scroll-area]")).toBeNull()
|
|
313
|
+
expect(body.className).toContain("flex-1")
|
|
314
|
+
expect(body.className).toContain("min-h-0")
|
|
315
|
+
expect(body.className).toContain("gap-4")
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
it("takes scrollable on the composed Drawer.Body part too", () => {
|
|
319
|
+
const { rerender } = render(<Drawer.Body testId="body">Text</Drawer.Body>)
|
|
320
|
+
expect(screen.getByTestId("body").dataset["scope"]).toBe("scroll-area")
|
|
321
|
+
rerender(
|
|
322
|
+
<Drawer.Body testId="body" scrollable={false}>
|
|
323
|
+
Text
|
|
324
|
+
</Drawer.Body>,
|
|
325
|
+
)
|
|
326
|
+
expect(screen.getByTestId("body").dataset["scope"]).toBeUndefined()
|
|
327
|
+
})
|
|
328
|
+
})
|
|
@@ -21,6 +21,7 @@ import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
|
|
|
21
21
|
import {
|
|
22
22
|
createDialogParts,
|
|
23
23
|
DIALOG_PADDING,
|
|
24
|
+
type DialogBodyProps,
|
|
24
25
|
type DialogCloseTriggerProps,
|
|
25
26
|
type DialogIconSlot,
|
|
26
27
|
type DialogIcons,
|
|
@@ -272,7 +273,7 @@ const DrawerContent = ({ className, size, radius, testId, ...rest }: DrawerConte
|
|
|
272
273
|
|
|
273
274
|
export type DrawerCloseTriggerProps = DialogCloseTriggerProps
|
|
274
275
|
export type DrawerHeaderProps = DialogSectionProps
|
|
275
|
-
export type DrawerBodyProps =
|
|
276
|
+
export type DrawerBodyProps = DialogBodyProps
|
|
276
277
|
export type DrawerFooterProps = DialogSectionProps
|
|
277
278
|
|
|
278
279
|
const {
|
|
@@ -347,6 +348,9 @@ export type DrawerProps = Omit<
|
|
|
347
348
|
"aria-labelledby"?: string
|
|
348
349
|
/** Render the default close button in the header. @default true */
|
|
349
350
|
withCloseButton?: boolean
|
|
351
|
+
/** Scroll the body (a `ScrollArea`). `false` for content that owns its own scroller; see
|
|
352
|
+
* `Drawer.Body`'s `scrollable`. @default true */
|
|
353
|
+
scrollable?: boolean
|
|
350
354
|
/** Show the drag grabber handle. @default false */
|
|
351
355
|
withGrabber?: boolean
|
|
352
356
|
/**
|
|
@@ -393,6 +397,7 @@ const DrawerComponent = ({
|
|
|
393
397
|
"aria-label": ariaLabel,
|
|
394
398
|
"aria-labelledby": ariaLabelledby,
|
|
395
399
|
withCloseButton = true,
|
|
400
|
+
scrollable = true,
|
|
396
401
|
withGrabber = false,
|
|
397
402
|
withBackdrop = true,
|
|
398
403
|
padding = "md",
|
|
@@ -473,6 +478,7 @@ const DrawerComponent = ({
|
|
|
473
478
|
</DrawerHeader>
|
|
474
479
|
)}
|
|
475
480
|
<DrawerBody
|
|
481
|
+
scrollable={scrollable}
|
|
476
482
|
className={cn(
|
|
477
483
|
!hasHeader && !withGrabber && "pt-(--drawer-px,1.25rem)",
|
|
478
484
|
"pb-(--drawer-px,1.25rem)",
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react"
|
|
2
|
+
import { describe, expect, it } from "vitest"
|
|
3
|
+
import { EmptyState } from "./empty-state"
|
|
4
|
+
|
|
5
|
+
describe("EmptyState", () => {
|
|
6
|
+
it("lays out the title, description and actions", () => {
|
|
7
|
+
render(
|
|
8
|
+
<EmptyState testId="state" title="No projects yet" description="Create one to get started.">
|
|
9
|
+
<button type="button">New project</button>
|
|
10
|
+
</EmptyState>,
|
|
11
|
+
)
|
|
12
|
+
const root = screen.getByTestId("state")
|
|
13
|
+
expect(root.textContent).toContain("No projects yet")
|
|
14
|
+
expect(root.textContent).toContain("Create one to get started.")
|
|
15
|
+
expect(screen.getByRole("button", { name: "New project" })).toBeTruthy()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it("draws the icon in a decorative ThemeIcon, and none without one", () => {
|
|
19
|
+
const { rerender } = render(
|
|
20
|
+
<EmptyState testId="state" icon={<svg data-testid="glyph" />} title="Empty" />,
|
|
21
|
+
)
|
|
22
|
+
const badge = screen.getByTestId("glyph").parentElement
|
|
23
|
+
expect(badge?.getAttribute("aria-hidden")).toBe("true")
|
|
24
|
+
expect(badge?.getAttribute("data-variant")).toBe("default")
|
|
25
|
+
|
|
26
|
+
rerender(<EmptyState testId="state" icon={null} title="Empty" />)
|
|
27
|
+
expect(screen.getByTestId("state").querySelector("[data-variant]")).toBeNull()
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it("leaves out the description and actions when not given", () => {
|
|
31
|
+
render(<EmptyState testId="state" title="Empty" />)
|
|
32
|
+
const root = screen.getByTestId("state")
|
|
33
|
+
expect(root.querySelectorAll("p")).toHaveLength(1)
|
|
34
|
+
expect(root.querySelector("button")).toBeNull()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it("tints the root and icon with `color`, the icon as a light tile", () => {
|
|
38
|
+
render(
|
|
39
|
+
<EmptyState testId="state" color="red" icon={<svg data-testid="glyph" />} title="Failed" />,
|
|
40
|
+
)
|
|
41
|
+
expect(screen.getByTestId("state")?.getAttribute("data-color")).toBe("red")
|
|
42
|
+
const badge = screen.getByTestId("glyph").parentElement
|
|
43
|
+
expect(badge?.getAttribute("data-color")).toBe("red")
|
|
44
|
+
expect(badge?.getAttribute("data-variant")).toBe("light")
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it("has no palette without `color`", () => {
|
|
48
|
+
render(<EmptyState testId="state" title="Empty" />)
|
|
49
|
+
expect(screen.getByTestId("state").hasAttribute("data-color")).toBe(false)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it("passes role, className and the part classes through", () => {
|
|
53
|
+
render(
|
|
54
|
+
<EmptyState
|
|
55
|
+
role="alert"
|
|
56
|
+
className="text-sm"
|
|
57
|
+
classNames={{ title: "font-semibold" }}
|
|
58
|
+
title="Couldn't load"
|
|
59
|
+
/>,
|
|
60
|
+
)
|
|
61
|
+
const alert = screen.getByRole("alert")
|
|
62
|
+
expect(alert.classList.contains("text-sm")).toBe(true)
|
|
63
|
+
expect(screen.getByText("Couldn't load").classList.contains("font-semibold")).toBe(true)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it("renders as its only child under asChild, with the block folded in", () => {
|
|
67
|
+
render(
|
|
68
|
+
<ul>
|
|
69
|
+
<EmptyState asChild color="red" title="Couldn't load">
|
|
70
|
+
<li data-testid="item" />
|
|
71
|
+
</EmptyState>
|
|
72
|
+
</ul>,
|
|
73
|
+
)
|
|
74
|
+
const item = screen.getByTestId("item")
|
|
75
|
+
expect(item.getAttribute("data-color")).toBe("red")
|
|
76
|
+
expect(item.textContent).toBe("Couldn't load")
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it("puts the asChild element's own content in the actions row", () => {
|
|
80
|
+
render(
|
|
81
|
+
<ul>
|
|
82
|
+
<EmptyState asChild title="Empty" classNames={{ actions: "the-actions" }}>
|
|
83
|
+
<li data-testid="item">
|
|
84
|
+
<button type="button">Add one</button>
|
|
85
|
+
</li>
|
|
86
|
+
</EmptyState>
|
|
87
|
+
</ul>,
|
|
88
|
+
)
|
|
89
|
+
const button = screen.getByRole("button", { name: "Add one" })
|
|
90
|
+
expect(button.parentElement?.classList.contains("the-actions")).toBe(true)
|
|
91
|
+
expect(button.closest("li")).toBe(screen.getByTestId("item"))
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
it("composes from its parts", () => {
|
|
95
|
+
render(
|
|
96
|
+
<EmptyState.Root testId="state" color="orange">
|
|
97
|
+
<EmptyState.Icon color="orange">
|
|
98
|
+
<svg />
|
|
99
|
+
</EmptyState.Icon>
|
|
100
|
+
<EmptyState.Title>Paused</EmptyState.Title>
|
|
101
|
+
<EmptyState.Description>Resumes on Monday.</EmptyState.Description>
|
|
102
|
+
<EmptyState.Actions>
|
|
103
|
+
<button type="button">Resume now</button>
|
|
104
|
+
</EmptyState.Actions>
|
|
105
|
+
</EmptyState.Root>,
|
|
106
|
+
)
|
|
107
|
+
expect(screen.getByTestId("state").textContent).toContain("PausedResumes on Monday.Resume now")
|
|
108
|
+
})
|
|
109
|
+
})
|