@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
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
DatePicker as Ark,
|
|
5
|
+
type DateValue,
|
|
6
|
+
type DatePickerDateView as DateView,
|
|
7
|
+
} from "@ark-ui/react/date-picker"
|
|
4
8
|
import { useLocaleContext } from "@ark-ui/react/locale"
|
|
5
9
|
import { type ComponentProps, type ReactNode, useRef } from "react"
|
|
6
10
|
import { cn } from "../../lib/cn"
|
|
@@ -8,8 +12,11 @@ import type { DatePredicate } from "../../lib/date-predicates"
|
|
|
8
12
|
import {
|
|
9
13
|
calendarValueToDate,
|
|
10
14
|
type DateRangeValue,
|
|
15
|
+
type DateUnit,
|
|
11
16
|
dateToArkValue,
|
|
12
17
|
fromArkValues,
|
|
18
|
+
snapBound,
|
|
19
|
+
snapToUnit,
|
|
13
20
|
toArkValues,
|
|
14
21
|
} from "../../lib/date-value"
|
|
15
22
|
import { warnRenamedProp } from "../../lib/dev-warn"
|
|
@@ -18,6 +25,7 @@ import { useTimeZone } from "../../lib/intl"
|
|
|
18
25
|
import { props } from "../../lib/props"
|
|
19
26
|
import type { Size } from "../../lib/sizes"
|
|
20
27
|
import type { WithTestId } from "../../lib/test-id"
|
|
28
|
+
import { useInheritedDisabled, useInheritedInvalid } from "../field/field"
|
|
21
29
|
import { CalendarBody, type CalendarBodyClassNames, type CalendarIcons } from "./calendar-body"
|
|
22
30
|
import { CalendarZoneSync, hashArkValues } from "./calendar-zone-sync"
|
|
23
31
|
|
|
@@ -113,14 +121,18 @@ export type CalendarProps<Range extends boolean = false> = FormControlProps<
|
|
|
113
121
|
numOfMonths?: number
|
|
114
122
|
/** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.
|
|
115
123
|
* Called with this component's own resolved `timeZone` as its second argument, so a predicate
|
|
116
|
-
* reads the candidate day in the same zone the grid renders it in.
|
|
124
|
+
* reads the candidate day in the same zone the grid renders it in. Under a month or year
|
|
125
|
+
* `minView` it is asked about each month or year cell instead, as that unit's first day, with
|
|
126
|
+
* the unit (`"month"` / `"year"`) as a third argument. */
|
|
117
127
|
isDateUnavailable?: DatePredicate
|
|
118
128
|
/** Earliest selectable day; earlier days render unavailable and navigation stops there. */
|
|
119
129
|
min?: Date
|
|
120
130
|
/** Latest selectable day; later days render unavailable and navigation stops there. */
|
|
121
131
|
max?: Date
|
|
122
|
-
/**
|
|
123
|
-
*
|
|
132
|
+
/** The lowest view the grid reaches, and so what one pick commits. `"day"` (default) picks a
|
|
133
|
+
* day; `"month"` / `"year"` make it a month or year picker (`MonthCalendar`, `YearCalendar`):
|
|
134
|
+
* the value is that month's or year's first day, `min`/`max` widen to the whole month or
|
|
135
|
+
* year they fall in, and `isDateUnavailable` is asked about each month or year cell. */
|
|
124
136
|
minView?: DateView
|
|
125
137
|
/** The widest view the header's view switch can climb to (`"day"`, `"month"` or `"year"`). */
|
|
126
138
|
maxView?: DateView
|
|
@@ -174,10 +186,10 @@ export const Calendar = <Range extends boolean = false>({
|
|
|
174
186
|
translations,
|
|
175
187
|
icons,
|
|
176
188
|
size = "md",
|
|
177
|
-
disabled,
|
|
189
|
+
disabled: disabledProp,
|
|
178
190
|
readOnly,
|
|
179
191
|
required,
|
|
180
|
-
invalid,
|
|
192
|
+
invalid: invalidProp,
|
|
181
193
|
name,
|
|
182
194
|
id,
|
|
183
195
|
ref,
|
|
@@ -186,10 +198,23 @@ export const Calendar = <Range extends boolean = false>({
|
|
|
186
198
|
testId,
|
|
187
199
|
}: CalendarProps<Range>) => {
|
|
188
200
|
const { locale: contextLocale } = useLocaleContext()
|
|
201
|
+
// Ark's machine reads only a `Field`: an unlabelled calendar in a disabled
|
|
202
|
+
// `Fieldset` would otherwise keep its day cells (plain `div`s, which the
|
|
203
|
+
// `<fieldset>` can't disable) clickable.
|
|
204
|
+
const disabled = useInheritedDisabled(disabledProp)
|
|
205
|
+
const invalid = useInheritedInvalid(invalidProp)
|
|
189
206
|
const resolvedLocale = locale ?? contextLocale
|
|
190
207
|
const resolvedTimeZone = useTimeZone(timeZone)
|
|
191
208
|
const isRange = Boolean(range)
|
|
192
209
|
const zoneReseed = useRef<string | null>(null)
|
|
210
|
+
const unit: DateUnit = minView ?? "day"
|
|
211
|
+
// A month or year grid is one grid; several side by side only make sense for days.
|
|
212
|
+
const months = unit === "day" ? numOfMonths : 1
|
|
213
|
+
// Ark already moves a picked cell onto its first day, but keeps the time of day of the value it
|
|
214
|
+
// replaces; the app gets that first day at midnight. Incoming values are left as they are (Ark
|
|
215
|
+
// matches a month cell by month and year), because snapping them would lose the day an instant
|
|
216
|
+
// falls on when the zone changes after hydration, and with it the month — see `CalendarZoneSync`.
|
|
217
|
+
const snap = (values: DateValue[]) => values.map((v) => snapToUnit(v, unit))
|
|
193
218
|
|
|
194
219
|
return (
|
|
195
220
|
<Ark.Root
|
|
@@ -211,13 +236,13 @@ export const Calendar = <Range extends boolean = false>({
|
|
|
211
236
|
// The machine's value is a plain DateValue[]; `range` is a runtime flag here, so narrow
|
|
212
237
|
// the result back to the caller's declared shape.
|
|
213
238
|
onChange?.(
|
|
214
|
-
fromArkValues(details.value, isRange, resolvedTimeZone) as Range extends true
|
|
239
|
+
fromArkValues(snap(details.value), isRange, resolvedTimeZone) as Range extends true
|
|
215
240
|
? DateRangeValue
|
|
216
241
|
: Date | null,
|
|
217
242
|
)
|
|
218
243
|
}}
|
|
219
244
|
onBlur={onBlur}
|
|
220
|
-
numOfMonths={
|
|
245
|
+
numOfMonths={months}
|
|
221
246
|
fixedWeeks={fixedWeeks}
|
|
222
247
|
// Ark's own prop — its name doesn't follow this kit's `withX` convention, so it stays
|
|
223
248
|
// `showWeekNumbers` even though our public prop is `withWeekNumbers`.
|
|
@@ -225,11 +250,15 @@ export const Calendar = <Range extends boolean = false>({
|
|
|
225
250
|
isDateUnavailable={
|
|
226
251
|
isDateUnavailable
|
|
227
252
|
? (dateValue) =>
|
|
228
|
-
isDateUnavailable(
|
|
253
|
+
isDateUnavailable(
|
|
254
|
+
calendarValueToDate(dateValue, resolvedTimeZone),
|
|
255
|
+
resolvedTimeZone,
|
|
256
|
+
unit,
|
|
257
|
+
)
|
|
229
258
|
: undefined
|
|
230
259
|
}
|
|
231
|
-
min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}
|
|
232
|
-
max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}
|
|
260
|
+
min={min ? snapBound(dateToArkValue(min, resolvedTimeZone), unit, "start") : undefined}
|
|
261
|
+
max={max ? snapBound(dateToArkValue(max, resolvedTimeZone), unit, "end") : undefined}
|
|
233
262
|
minView={minView}
|
|
234
263
|
maxView={maxView}
|
|
235
264
|
disabled={disabled}
|
|
@@ -258,7 +287,9 @@ export const Calendar = <Range extends boolean = false>({
|
|
|
258
287
|
/>
|
|
259
288
|
<Ark.Content>
|
|
260
289
|
<CalendarBody
|
|
261
|
-
numOfMonths={
|
|
290
|
+
numOfMonths={months}
|
|
291
|
+
unit={unit}
|
|
292
|
+
locale={resolvedLocale}
|
|
262
293
|
withWeekNumbers={withWeekNumbers}
|
|
263
294
|
renderDay={renderDay && ((date, day) => renderDay(date, dayState(day)))}
|
|
264
295
|
size={size}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
export type { DatePredicate } from "../../lib/date-predicates"
|
|
4
|
-
export type { DateRangeValue } from "../../lib/date-value"
|
|
4
|
+
export type { DateRangeValue, DateUnit } from "../../lib/date-value"
|
|
5
|
+
export {
|
|
6
|
+
MonthCalendar,
|
|
7
|
+
type MonthCalendarProps,
|
|
8
|
+
YearCalendar,
|
|
9
|
+
type YearCalendarProps,
|
|
10
|
+
} from "./aliases"
|
|
5
11
|
export {
|
|
6
12
|
Calendar,
|
|
7
13
|
type CalendarClassNames,
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { fireEvent, render, screen, waitFor } from "@testing-library/react"
|
|
2
|
+
import { describe, expect, it, type Mock, vi } from "vitest"
|
|
3
|
+
import { disablePast, disableWeekends } from "../../lib/date-predicates"
|
|
4
|
+
import { MonthCalendar, YearCalendar } from "./aliases"
|
|
5
|
+
|
|
6
|
+
/** The first argument of `fn`'s `call`-th call, asserting the call happened. */
|
|
7
|
+
const arg = <T,>(fn: Mock, call: number): T => {
|
|
8
|
+
const calls = fn.mock.calls[call]
|
|
9
|
+
if (!calls) throw new Error(`expected call #${call}`)
|
|
10
|
+
return calls[0] as T
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const flush = () => new Promise((resolve) => setTimeout(resolve, 0))
|
|
14
|
+
|
|
15
|
+
const TZ = "UTC"
|
|
16
|
+
const utc = (year: number, month: number, day = 1) => new Date(Date.UTC(year, month, day))
|
|
17
|
+
|
|
18
|
+
const cell = (container: HTMLElement, view: "month" | "year", value: number) =>
|
|
19
|
+
container.querySelector(
|
|
20
|
+
`[data-view="${view}"][role="button"][data-value="${value}"]`,
|
|
21
|
+
) as HTMLElement | null
|
|
22
|
+
|
|
23
|
+
describe("MonthCalendar", () => {
|
|
24
|
+
it("renders the month grid inline and commits the month's first day", async () => {
|
|
25
|
+
const onChange = vi.fn()
|
|
26
|
+
const { container } = render(
|
|
27
|
+
<MonthCalendar timeZone={TZ} defaultValue={utc(2026, 6)} onChange={onChange} />,
|
|
28
|
+
)
|
|
29
|
+
await flush()
|
|
30
|
+
expect(container.querySelector('[data-view="day"][role="button"]')).toBeNull()
|
|
31
|
+
fireEvent.click(cell(container, "month", 11) as HTMLElement)
|
|
32
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
33
|
+
expect(arg<Date>(onChange, 0).getTime()).toBe(utc(2026, 10).getTime())
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it("keeps the current month open under disablePast, and ignores day-only rules", async () => {
|
|
37
|
+
const now = new Date()
|
|
38
|
+
const { container } = render(
|
|
39
|
+
<MonthCalendar
|
|
40
|
+
timeZone={TZ}
|
|
41
|
+
defaultValue={utc(now.getUTCFullYear(), now.getUTCMonth())}
|
|
42
|
+
isDateUnavailable={disablePast()}
|
|
43
|
+
/>,
|
|
44
|
+
)
|
|
45
|
+
await flush()
|
|
46
|
+
expect(cell(container, "month", now.getUTCMonth() + 1)?.hasAttribute("data-unavailable")).toBe(
|
|
47
|
+
false,
|
|
48
|
+
)
|
|
49
|
+
const { container: weekends } = render(
|
|
50
|
+
<MonthCalendar
|
|
51
|
+
timeZone={TZ}
|
|
52
|
+
defaultValue={utc(2026, 6)}
|
|
53
|
+
isDateUnavailable={disableWeekends()}
|
|
54
|
+
/>,
|
|
55
|
+
)
|
|
56
|
+
await flush()
|
|
57
|
+
// August 1st 2026 is a Saturday: the month is still open.
|
|
58
|
+
expect(cell(weekends, "month", 8)?.hasAttribute("data-unavailable")).toBe(false)
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it("passes testId and classNames.cell", async () => {
|
|
62
|
+
const { container } = render(
|
|
63
|
+
<MonthCalendar timeZone={TZ} testId="months" classNames={{ cell: "probe-cell" }} />,
|
|
64
|
+
)
|
|
65
|
+
await flush()
|
|
66
|
+
expect(screen.getByTestId("months")).toBeTruthy()
|
|
67
|
+
expect(container.querySelectorAll(".probe-cell")).toHaveLength(12)
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
describe("YearCalendar", () => {
|
|
72
|
+
it("renders a decade inline and commits January 1st", async () => {
|
|
73
|
+
const onChange = vi.fn()
|
|
74
|
+
const { container } = render(
|
|
75
|
+
<YearCalendar timeZone={TZ} defaultValue={utc(2026, 0)} onChange={onChange} />,
|
|
76
|
+
)
|
|
77
|
+
await flush()
|
|
78
|
+
fireEvent.click(cell(container, "year", 2028) as HTMLElement)
|
|
79
|
+
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1))
|
|
80
|
+
expect(arg<Date>(onChange, 0).getTime()).toBe(utc(2028, 0).getTime())
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it("titles the decade through Intl's range format, undimmed at its top view", async () => {
|
|
84
|
+
const { container } = render(<YearCalendar timeZone={TZ} defaultValue={utc(2026, 0)} />)
|
|
85
|
+
await flush()
|
|
86
|
+
const title = container.querySelector('[data-part="view-trigger"]') as HTMLElement
|
|
87
|
+
expect(title.textContent).toMatch(/^2020\s*–\s*2029$/)
|
|
88
|
+
expect(title.className).not.toContain("opacity-50")
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it("widens min/max to their whole year", async () => {
|
|
92
|
+
const { container } = render(
|
|
93
|
+
<YearCalendar
|
|
94
|
+
timeZone={TZ}
|
|
95
|
+
defaultValue={utc(2026, 0)}
|
|
96
|
+
min={utc(2022, 8, 9)}
|
|
97
|
+
max={utc(2027, 2, 3)}
|
|
98
|
+
/>,
|
|
99
|
+
)
|
|
100
|
+
await flush()
|
|
101
|
+
expect(cell(container, "year", 2022)?.getAttribute("aria-disabled")).not.toBe("true")
|
|
102
|
+
expect(cell(container, "year", 2027)?.getAttribute("aria-disabled")).not.toBe("true")
|
|
103
|
+
expect(cell(container, "year", 2021)?.getAttribute("aria-disabled")).toBe("true")
|
|
104
|
+
expect(cell(container, "year", 2028)?.getAttribute("aria-disabled")).toBe("true")
|
|
105
|
+
})
|
|
106
|
+
})
|
|
@@ -16,6 +16,7 @@ import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
|
|
|
16
16
|
import { useIsomorphicLayoutEffect } from "../../lib/use-isomorphic-layout-effect"
|
|
17
17
|
import { isNowPending, useNow } from "../../lib/use-now"
|
|
18
18
|
import type { FirstDayOfWeek } from "../schedule/schedule-types"
|
|
19
|
+
import { ScrollArea } from "../scroll-area/scroll-area"
|
|
19
20
|
import { Tooltip } from "../tooltip"
|
|
20
21
|
import {
|
|
21
22
|
buildHeatmap,
|
|
@@ -258,8 +259,12 @@ export const CalendarHeatmap = ({
|
|
|
258
259
|
<div className="flex">
|
|
259
260
|
{/* The weekday labels sit outside the scroller, so they stay in view
|
|
260
261
|
however far back the weeks are scrolled. Fixed tracks line them up
|
|
261
|
-
with the rows
|
|
262
|
-
|
|
262
|
+
with the rows (`self-start`: the scroller's bar gutter mustn't stretch them); the
|
|
263
|
+
screen-reader row headers live in the grid. */}
|
|
264
|
+
<div
|
|
265
|
+
aria-hidden
|
|
266
|
+
className={cn(caption, TRACKS, "shrink-0 self-start grid-cols-[auto] py-1 pe-2")}
|
|
267
|
+
>
|
|
263
268
|
<span> </span>
|
|
264
269
|
{weekdays.map((weekday, row) => (
|
|
265
270
|
<span key={weekday.getTime()} className="flex items-center">
|
|
@@ -270,81 +275,91 @@ export const CalendarHeatmap = ({
|
|
|
270
275
|
</div>
|
|
271
276
|
|
|
272
277
|
<Tooltip.Root openDelay={150} closeDelay={0}>
|
|
273
|
-
{/*
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
className={cn(
|
|
282
|
-
TRACKS,
|
|
283
|
-
"w-max grid-cols-[repeat(var(--weeks),var(--cell))]",
|
|
284
|
-
classNames?.grid,
|
|
285
|
-
)}
|
|
286
|
-
>
|
|
287
|
-
{/* Each day's own name carries its date, so the month row is visual only. */}
|
|
288
|
-
<div aria-hidden className={cn(caption, "col-span-full grid grid-cols-subgrid")}>
|
|
289
|
-
<span> </span>
|
|
290
|
-
{!pending &&
|
|
291
|
-
months.map(({ column, date }) => (
|
|
292
|
-
<span
|
|
293
|
-
key={column}
|
|
294
|
-
className="row-start-1 whitespace-nowrap"
|
|
295
|
-
style={{ gridColumnStart: column + 1 }}
|
|
296
|
-
>
|
|
297
|
-
{format.month.format(date)}
|
|
298
|
-
</span>
|
|
299
|
-
))}
|
|
300
|
-
</div>
|
|
301
|
-
{weekdays.map((weekday, row) => (
|
|
302
|
-
// biome-ignore lint/a11y/useSemanticElements lint/a11y/useFocusableInteractive: ARIA grid on divs, not a <table>: the cells are laid out on CSS grid tracks (rows are subgrids), and table elements lose their implicit semantics in some engines once their display changes; only cells take focus in the grid pattern.
|
|
278
|
+
{/* The weeks scroll sideways in a ScrollArea, its bar in a gutter of its own under the
|
|
279
|
+
rows when they overflow. The viewport stays out of the tab order: the grid's
|
|
280
|
+
roving cell is the one stop, and focusing a cell scrolls it into view. The
|
|
281
|
+
content is padded so the focus ring isn't clipped by the scroll edge. */}
|
|
282
|
+
<ScrollArea.Root scrollbars="x" size="sm" offsetScrollbars="present" className="min-w-0">
|
|
283
|
+
<ScrollArea.Viewport ref={scrollerRef} tabIndex={-1}>
|
|
284
|
+
<ScrollArea.Content className="p-1">
|
|
285
|
+
{/* biome-ignore lint/a11y/useSemanticElements: ARIA grid on divs, not a <table>: the cells are laid out on CSS grid tracks (rows are subgrids), and table elements lose their implicit semantics in some engines once their display changes. */}
|
|
303
286
|
<div
|
|
304
|
-
|
|
305
|
-
role="
|
|
306
|
-
|
|
287
|
+
ref={gridRef}
|
|
288
|
+
role="grid"
|
|
289
|
+
aria-label={t.label}
|
|
290
|
+
aria-busy={pending || undefined}
|
|
291
|
+
className={cn(
|
|
292
|
+
TRACKS,
|
|
293
|
+
"w-max grid-cols-[repeat(var(--weeks),var(--cell))]",
|
|
294
|
+
classNames?.grid,
|
|
295
|
+
)}
|
|
307
296
|
>
|
|
308
|
-
{/*
|
|
309
|
-
<div
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
<Tooltip.Trigger key={day.key} asChild value={day.key}>
|
|
318
|
-
{/* biome-ignore lint/a11y/useSemanticElements: ARIA grid on divs, not a <table>: the cells are laid out on CSS grid tracks (rows are subgrids), and table elements lose their implicit semantics in some engines once their display changes. */}
|
|
319
|
-
<div
|
|
320
|
-
role="gridcell"
|
|
321
|
-
tabIndex={day.key === stop ? 0 : -1}
|
|
322
|
-
// The tooltip repeats the day's own name, so it mustn't describe it too.
|
|
323
|
-
aria-describedby={undefined}
|
|
324
|
-
data-date={day.key}
|
|
325
|
-
data-level={day.level}
|
|
326
|
-
className={cn(
|
|
327
|
-
swatch,
|
|
328
|
-
RAMP[intensity(day.level, levels)],
|
|
329
|
-
focusStyles(),
|
|
330
|
-
// Focus scrolls a cell into view: leave room for its ring.
|
|
331
|
-
"scroll-m-1",
|
|
332
|
-
onDayClick && "cursor-pointer",
|
|
333
|
-
classNames?.cell,
|
|
334
|
-
)}
|
|
335
|
-
onFocus={() => setFocused(day.key)}
|
|
336
|
-
onKeyDown={(event) => onKeyDown(event, day, column)}
|
|
337
|
-
onClick={onDayClick && (() => onDayClick(day.date, day.value))}
|
|
297
|
+
{/* Each day's own name carries its date, so the month row is visual only. */}
|
|
298
|
+
<div aria-hidden className={cn(caption, "col-span-full grid grid-cols-subgrid")}>
|
|
299
|
+
<span> </span>
|
|
300
|
+
{!pending &&
|
|
301
|
+
months.map(({ column, date }) => (
|
|
302
|
+
<span
|
|
303
|
+
key={column}
|
|
304
|
+
className="row-start-1 whitespace-nowrap"
|
|
305
|
+
style={{ gridColumnStart: column + 1 }}
|
|
338
306
|
>
|
|
339
|
-
|
|
340
|
-
</
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
307
|
+
{format.month.format(date)}
|
|
308
|
+
</span>
|
|
309
|
+
))}
|
|
310
|
+
</div>
|
|
311
|
+
{weekdays.map((weekday, row) => (
|
|
312
|
+
// biome-ignore lint/a11y/useSemanticElements lint/a11y/useFocusableInteractive: ARIA grid on divs, not a <table>: the cells are laid out on CSS grid tracks (rows are subgrids), and table elements lose their implicit semantics in some engines once their display changes; only cells take focus in the grid pattern.
|
|
313
|
+
<div
|
|
314
|
+
key={weekday.getTime()}
|
|
315
|
+
role="row"
|
|
316
|
+
className="col-span-full grid grid-cols-subgrid"
|
|
317
|
+
>
|
|
318
|
+
{/* biome-ignore lint/a11y/useSemanticElements lint/a11y/useFocusableInteractive: ARIA grid on divs, not a <table>: the cells are laid out on CSS grid tracks (rows are subgrids), and table elements lose their implicit semantics in some engines once their display changes; a header is read, not focused. */}
|
|
319
|
+
<div role="rowheader" className="sr-only">
|
|
320
|
+
{format.weekdayLong.format(weekday)}
|
|
321
|
+
</div>
|
|
322
|
+
{weeks.map((week, column) => {
|
|
323
|
+
const day = week[row]
|
|
324
|
+
// biome-ignore lint/suspicious/noArrayIndexKey lint/a11y/useSemanticElements lint/a11y/useFocusableInteractive: a padding slot has no date, so its column is its identity, and nothing to focus; ARIA grid on divs, not a <table>: the cells are laid out on CSS grid tracks (rows are subgrids), and table elements lose their implicit semantics in some engines once their display changes.
|
|
325
|
+
if (!day || pending) return <div key={column} role="gridcell" />
|
|
326
|
+
return (
|
|
327
|
+
<Tooltip.Trigger key={day.key} asChild value={day.key}>
|
|
328
|
+
{/* biome-ignore lint/a11y/useSemanticElements: ARIA grid on divs, not a <table>: the cells are laid out on CSS grid tracks (rows are subgrids), and table elements lose their implicit semantics in some engines once their display changes. */}
|
|
329
|
+
<div
|
|
330
|
+
role="gridcell"
|
|
331
|
+
tabIndex={day.key === stop ? 0 : -1}
|
|
332
|
+
// The tooltip repeats the day's own name, so it mustn't describe it too.
|
|
333
|
+
aria-describedby={undefined}
|
|
334
|
+
data-date={day.key}
|
|
335
|
+
data-level={day.level}
|
|
336
|
+
className={cn(
|
|
337
|
+
swatch,
|
|
338
|
+
RAMP[intensity(day.level, levels)],
|
|
339
|
+
focusStyles(),
|
|
340
|
+
// Focus scrolls a cell into view: leave room for its ring.
|
|
341
|
+
"scroll-m-1",
|
|
342
|
+
onDayClick && "cursor-pointer",
|
|
343
|
+
classNames?.cell,
|
|
344
|
+
)}
|
|
345
|
+
onFocus={() => setFocused(day.key)}
|
|
346
|
+
onKeyDown={(event) => onKeyDown(event, day, column)}
|
|
347
|
+
onClick={onDayClick && (() => onDayClick(day.date, day.value))}
|
|
348
|
+
>
|
|
349
|
+
<span className="sr-only">{describe(day)}</span>
|
|
350
|
+
</div>
|
|
351
|
+
</Tooltip.Trigger>
|
|
352
|
+
)
|
|
353
|
+
})}
|
|
354
|
+
</div>
|
|
355
|
+
))}
|
|
344
356
|
</div>
|
|
345
|
-
|
|
346
|
-
</
|
|
347
|
-
|
|
357
|
+
</ScrollArea.Content>
|
|
358
|
+
</ScrollArea.Viewport>
|
|
359
|
+
<ScrollArea.Scrollbar orientation="horizontal">
|
|
360
|
+
<ScrollArea.Thumb />
|
|
361
|
+
</ScrollArea.Scrollbar>
|
|
362
|
+
</ScrollArea.Root>
|
|
348
363
|
<Tooltip.Content aria-hidden className={classNames?.tooltip}>
|
|
349
364
|
<DayTooltip weeks={weeks} describe={describe} />
|
|
350
365
|
</Tooltip.Content>
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
fieldInlineStack,
|
|
17
17
|
fieldLabel,
|
|
18
18
|
requiredMark,
|
|
19
|
+
useInheritedDisabled,
|
|
20
|
+
useInheritedInvalid,
|
|
19
21
|
} from "../field/field"
|
|
20
22
|
import { CheckIcon } from "../popover/icons"
|
|
21
23
|
import { type ControlIndicatorVariant, controlIndicator } from "./control"
|
|
@@ -141,7 +143,10 @@ export const Checkbox = ({
|
|
|
141
143
|
const icons = mergeIcons(DEFAULT_ICONS, iconsProp)
|
|
142
144
|
// Red state is driven independently of the `Field` error slot so a form
|
|
143
145
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
144
|
-
const isInvalid = invalid || error != null
|
|
146
|
+
const isInvalid = useInheritedInvalid(invalid || error != null)
|
|
147
|
+
// The hidden input follows a disabled `<fieldset>` natively, but zag only
|
|
148
|
+
// styles its own `disabled` prop: read the group's here so the control dims.
|
|
149
|
+
const isDisabled = useInheritedDisabled(disabled)
|
|
145
150
|
|
|
146
151
|
// A visible label above description/error switches the root to a grid: the
|
|
147
152
|
// control centers on the label's row alone (not on the whole text stack),
|
|
@@ -168,7 +173,7 @@ export const Checkbox = ({
|
|
|
168
173
|
defaultChecked={defaultChecked}
|
|
169
174
|
onCheckedChange={onCheckedChange ? (d) => onCheckedChange(d.checked) : undefined}
|
|
170
175
|
invalid={isInvalid}
|
|
171
|
-
disabled={
|
|
176
|
+
disabled={isDisabled}
|
|
172
177
|
readOnly={readOnly}
|
|
173
178
|
required={required}
|
|
174
179
|
name={name}
|
|
@@ -21,7 +21,7 @@ import type { Size } from "../../lib/sizes"
|
|
|
21
21
|
import type { WithTestId } from "../../lib/test-id"
|
|
22
22
|
import { TEXT_COLOR_CLASSES, TYPOGRAPHY_SHADE_CLASSES } from "../../lib/typography-size"
|
|
23
23
|
import { type ControlIndicatorVariant, controlIndicator } from "../checkbox/control"
|
|
24
|
-
import { FieldShell, fieldA11yProps } from "../field/field"
|
|
24
|
+
import { FieldShell, fieldA11yProps, useInheritedInvalid } from "../field/field"
|
|
25
25
|
import { CheckIcon } from "../popover/icons"
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -403,7 +403,7 @@ export const ChoiceCardGroup = <const Data extends ChoiceCardGroupData = ChoiceC
|
|
|
403
403
|
} = groupProps
|
|
404
404
|
// Red state is driven independently of the `Field` error slot so a form
|
|
405
405
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
406
|
-
const isInvalid = invalid || error != null
|
|
406
|
+
const isInvalid = useInheritedInvalid(invalid || error != null)
|
|
407
407
|
const normalized = data.map(normalize)
|
|
408
408
|
// Ark reports plain strings; every one it can report is a card's value, so this guard
|
|
409
409
|
// narrows Ark's `string` back to `data`'s value union instead of asserting it.
|
|
@@ -136,4 +136,39 @@ describe("CircularProgress", () => {
|
|
|
136
136
|
expect(bar.getAttribute("aria-describedby")).toBe("hint")
|
|
137
137
|
expect(root(container).hasAttribute("aria-labelledby")).toBe(false)
|
|
138
138
|
})
|
|
139
|
+
|
|
140
|
+
describe("meter", () => {
|
|
141
|
+
it("is a role=meter svg with aria-value* and a formatted aria-valuetext", () => {
|
|
142
|
+
render(<CircularProgress meter value={82} aria-label="Score" testId="m" />)
|
|
143
|
+
const meter = screen.getByRole("meter", { name: "Score" })
|
|
144
|
+
expect(meter).toBe(screen.getByTestId("m"))
|
|
145
|
+
expect(meter.tagName.toLowerCase()).toBe("svg")
|
|
146
|
+
expect(meter.getAttribute("aria-valuenow")).toBe("82")
|
|
147
|
+
expect(meter.getAttribute("aria-valuemin")).toBe("0")
|
|
148
|
+
expect(meter.getAttribute("aria-valuemax")).toBe("100")
|
|
149
|
+
expect(meter.getAttribute("aria-valuetext")).toBe("82%")
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it("colours the ring by zone", () => {
|
|
153
|
+
render(<CircularProgress meter value={30} low={40} high={70} optimum={100} testId="m" />)
|
|
154
|
+
const ring = screen.getByTestId("m")
|
|
155
|
+
expect(ring.getAttribute("data-zone")).toBe("critical")
|
|
156
|
+
expect(ring.getAttribute("data-color")).toBe("red")
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
it("leaves the progressbar untouched when off", () => {
|
|
160
|
+
render(<CircularProgress value={40} />)
|
|
161
|
+
const bar = screen.getByRole("progressbar")
|
|
162
|
+
expect(bar.hasAttribute("aria-valuetext")).toBe(false)
|
|
163
|
+
expect(bar.hasAttribute("data-zone")).toBe(false)
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
it("forbids indeterminate and thresholds at the type level", () => {
|
|
167
|
+
// @ts-expect-error a meter is never indeterminate
|
|
168
|
+
;<CircularProgress meter value={null} />
|
|
169
|
+
// @ts-expect-error thresholds need `meter`
|
|
170
|
+
;<CircularProgress value={40} optimum={20} />
|
|
171
|
+
;<CircularProgress meter value={40} low={20} />
|
|
172
|
+
})
|
|
173
|
+
})
|
|
139
174
|
})
|