@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
|
@@ -10,7 +10,14 @@ import {
|
|
|
10
10
|
import { useFieldContext } from "@ark-ui/react/field"
|
|
11
11
|
import { useLocaleContext } from "@ark-ui/react/locale"
|
|
12
12
|
import { Portal } from "@ark-ui/react/portal"
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
DateFormatter,
|
|
15
|
+
endOfYear,
|
|
16
|
+
startOfMonth,
|
|
17
|
+
startOfYear,
|
|
18
|
+
toCalendarDateTime,
|
|
19
|
+
today,
|
|
20
|
+
} from "@internationalized/date"
|
|
14
21
|
import { type FocusEvent, type ReactNode, type Ref, useId, useRef, useState } from "react"
|
|
15
22
|
import { cn } from "../../lib/cn"
|
|
16
23
|
import { controlOpenProps } from "../../lib/control-open"
|
|
@@ -18,8 +25,11 @@ import type { DatePredicate } from "../../lib/date-predicates"
|
|
|
18
25
|
import {
|
|
19
26
|
calendarValueToDate,
|
|
20
27
|
type DateRangeValue,
|
|
28
|
+
type DateUnit,
|
|
21
29
|
dateToArkValue,
|
|
22
30
|
fromArkValues,
|
|
31
|
+
snapBound,
|
|
32
|
+
snapToUnit,
|
|
23
33
|
toArkValues,
|
|
24
34
|
} from "../../lib/date-value"
|
|
25
35
|
import { focusStyles } from "../../lib/focus-styles"
|
|
@@ -28,7 +38,7 @@ import { capitalize } from "../../lib/graphemes"
|
|
|
28
38
|
import { useLocale, useTimeZone } from "../../lib/intl"
|
|
29
39
|
import { useMergedRefs } from "../../lib/merge-refs"
|
|
30
40
|
import { useOverlayContainer } from "../../lib/overlay-container"
|
|
31
|
-
import { NestedLayer } from "../../lib/overlay-layer"
|
|
41
|
+
import { NestedLayer, useTourRaised } from "../../lib/overlay-layer"
|
|
32
42
|
import { props } from "../../lib/props"
|
|
33
43
|
import type { Size } from "../../lib/sizes"
|
|
34
44
|
import type { WithTestId } from "../../lib/test-id"
|
|
@@ -43,7 +53,13 @@ import {
|
|
|
43
53
|
calendarGridWidth,
|
|
44
54
|
} from "../calendar/calendar-body"
|
|
45
55
|
import { CalendarZoneSync, hashArkValues } from "../calendar/calendar-zone-sync"
|
|
46
|
-
import {
|
|
56
|
+
import {
|
|
57
|
+
type FieldProps,
|
|
58
|
+
FieldShell,
|
|
59
|
+
fieldA11yProps,
|
|
60
|
+
useInheritedDisabled,
|
|
61
|
+
useInheritedInvalid,
|
|
62
|
+
} from "../field/field"
|
|
47
63
|
import {
|
|
48
64
|
type InputVariant,
|
|
49
65
|
inputControlClasses,
|
|
@@ -141,7 +157,15 @@ const pad = (n: number) => String(n).padStart(2, "0")
|
|
|
141
157
|
* is driven by the picker's own `withTime` flag, not by whether the value happens to carry an
|
|
142
158
|
* `hour` field — a `CalendarDateTime` always has one (even at local midnight), so that structural
|
|
143
159
|
* check can't tell "date-only" from "with time" apart. */
|
|
144
|
-
export const serializeDateValue = (
|
|
160
|
+
export const serializeDateValue = (
|
|
161
|
+
value: DateValue,
|
|
162
|
+
withTime: boolean,
|
|
163
|
+
/** A month or year picker's value serializes as `YYYY-MM` (the `<input type="month">` format)
|
|
164
|
+
* or `YYYY`, never as its placeholder first day. */
|
|
165
|
+
unit: DateUnit = "day",
|
|
166
|
+
): string => {
|
|
167
|
+
if (unit === "year") return String(value.year).padStart(4, "0")
|
|
168
|
+
if (unit === "month") return `${String(value.year).padStart(4, "0")}-${pad(value.month)}`
|
|
145
169
|
const date = `${value.year}-${pad(value.month)}-${pad(value.day)}`
|
|
146
170
|
if (!withTime) return date
|
|
147
171
|
const time = "hour" in value ? value : { hour: 0, minute: 0, second: 0 }
|
|
@@ -168,7 +192,8 @@ export type DatePreset =
|
|
|
168
192
|
| { label: string; date: Date | null }
|
|
169
193
|
|
|
170
194
|
/** Identifies each entry `getDefaultPresets` builds for `presets={true}`, so a `translations`
|
|
171
|
-
* override can target one label without redefining the whole set.
|
|
195
|
+
* override can target one label without redefining the whole set. `nextMonth`, `lastYear` and
|
|
196
|
+
* `nextYear` are the month and year pickers' own. */
|
|
172
197
|
export type DatePickerPresetId =
|
|
173
198
|
| "today"
|
|
174
199
|
| "yesterday"
|
|
@@ -178,7 +203,10 @@ export type DatePickerPresetId =
|
|
|
178
203
|
| "lastWeek"
|
|
179
204
|
| "thisMonth"
|
|
180
205
|
| "lastMonth"
|
|
206
|
+
| "nextMonth"
|
|
181
207
|
| "thisYear"
|
|
208
|
+
| "lastYear"
|
|
209
|
+
| "nextYear"
|
|
182
210
|
| "allTime"
|
|
183
211
|
|
|
184
212
|
/** One unified `translations` prop rather than one per string source — Ark's own accessible
|
|
@@ -234,7 +262,9 @@ export type DatePickerProps<Range extends boolean = false> = FormControlProps<
|
|
|
234
262
|
clearable?: boolean
|
|
235
263
|
/** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.
|
|
236
264
|
* Called with this component's own resolved `timeZone` as its second argument, so a predicate
|
|
237
|
-
* reads the candidate day in the same zone the grid renders it in.
|
|
265
|
+
* reads the candidate day in the same zone the grid renders it in. Under a month or year
|
|
266
|
+
* `minView` it is asked about each month or year cell instead, as that unit's first day, with
|
|
267
|
+
* the unit (`"month"` / `"year"`) as a third argument. */
|
|
238
268
|
isDateUnavailable?: DatePredicate
|
|
239
269
|
/** Renders a text input (typing, blur-to-parse, `Enter`-to-commit) alongside the
|
|
240
270
|
* calendar-icon trigger, instead of the plain button-only trigger. Opt-in — default `false`
|
|
@@ -248,7 +278,11 @@ export type DatePickerProps<Range extends boolean = false> = FormControlProps<
|
|
|
248
278
|
typeable?: boolean
|
|
249
279
|
min?: Date
|
|
250
280
|
max?: Date
|
|
251
|
-
/**
|
|
281
|
+
/** The lowest view the popover reaches, and so what one pick commits. `"day"` (default)
|
|
282
|
+
* picks a day; `"month"` / `"year"` make it a month or year picker (`MonthPicker`,
|
|
283
|
+
* `YearPicker`): the value is that month's or year's first day, the trigger shows the month
|
|
284
|
+
* or year, `min`/`max` widen to the whole month or year they fall in, `isDateUnavailable` is
|
|
285
|
+
* asked about each cell, and `withTime` / `typeable` / `numOfMonths` don't apply. */
|
|
252
286
|
minView?: DateView
|
|
253
287
|
maxView?: DateView
|
|
254
288
|
/** Overrides the active locale context. Drives month/day names, first-day-of-week, and the
|
|
@@ -276,7 +310,8 @@ export type DatePickerProps<Range extends boolean = false> = FormControlProps<
|
|
|
276
310
|
/** Replaces the calendar's default icons: `prev`, `next`, passed through to its grid like
|
|
277
311
|
* `translations`. The kit's chevrons mirror under RTL; an icon passed here is drawn as given. */
|
|
278
312
|
icons?: DatePickerIcons
|
|
279
|
-
/** Placeholder shown while
|
|
313
|
+
/** Placeholder shown while nothing is selected. Default `"Pick a date"` (`"Pick a month"` /
|
|
314
|
+
* `"Pick a year"` under `minView`). */
|
|
280
315
|
placeholder?: string
|
|
281
316
|
/** Inline-start adornment. Defaults to a calendar icon. */
|
|
282
317
|
startSlot?: ReactNode
|
|
@@ -295,6 +330,20 @@ export type DatePickerProps<Range extends boolean = false> = FormControlProps<
|
|
|
295
330
|
/** `DatePicker`'s own English wording, merged once per render (`presets` one level deeper, in
|
|
296
331
|
* `presetLabels`). "All time" is the one non-derivable preset label; every other
|
|
297
332
|
* `presets={true}` label comes from `Intl.RelativeTimeFormat`. */
|
|
333
|
+
/** The trigger's empty-state text per value unit; `placeholder` overrides it. */
|
|
334
|
+
const DATE_PICKER_PLACEHOLDERS: Record<DateUnit, string> = {
|
|
335
|
+
day: "Pick a date",
|
|
336
|
+
month: "Pick a month",
|
|
337
|
+
year: "Pick a year",
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** The trigger text for a month or year value, from `Intl` in the picker's locale and zone:
|
|
341
|
+
* "March 2026" / "mars 2026", "2026". */
|
|
342
|
+
const UNIT_FORMAT: Record<"month" | "year", Intl.DateTimeFormatOptions> = {
|
|
343
|
+
month: { month: "long", year: "numeric" },
|
|
344
|
+
year: { year: "numeric" },
|
|
345
|
+
}
|
|
346
|
+
|
|
298
347
|
const DATE_PICKER_DEFAULT_TRANSLATIONS = {
|
|
299
348
|
cancel: "Cancel",
|
|
300
349
|
apply: "Apply",
|
|
@@ -323,7 +372,10 @@ const presetLabels = (
|
|
|
323
372
|
lastWeek: say(-1, "week"),
|
|
324
373
|
thisMonth: say(0, "month"),
|
|
325
374
|
lastMonth: say(-1, "month"),
|
|
375
|
+
nextMonth: say(1, "month"),
|
|
326
376
|
thisYear: say(0, "year"),
|
|
377
|
+
lastYear: say(-1, "year"),
|
|
378
|
+
nextYear: say(1, "year"),
|
|
327
379
|
...DATE_PICKER_DEFAULT_TRANSLATIONS.presets,
|
|
328
380
|
...overrides,
|
|
329
381
|
}
|
|
@@ -339,10 +391,12 @@ const getDefaultPresets = (
|
|
|
339
391
|
timeZone: string,
|
|
340
392
|
locale: string,
|
|
341
393
|
overrides?: Partial<Record<DatePickerPresetId, string>>,
|
|
394
|
+
unit: DateUnit = "day",
|
|
342
395
|
): DatePreset[] => {
|
|
343
396
|
const now = today(timeZone)
|
|
344
397
|
const toDate = (value: typeof now) => calendarValueToDate(value, timeZone)
|
|
345
398
|
const label = presetLabels(locale, overrides)
|
|
399
|
+
if (unit !== "day") return getUnitPresets(range, unit, now, toDate, label)
|
|
346
400
|
if (!range) {
|
|
347
401
|
return [
|
|
348
402
|
{ label: label.today, date: toDate(now) },
|
|
@@ -364,6 +418,43 @@ const getDefaultPresets = (
|
|
|
364
418
|
]
|
|
365
419
|
}
|
|
366
420
|
|
|
421
|
+
/** The month and year pickers' `presets={true}` sets — each value a month's or year's first day.
|
|
422
|
+
* Single: this, last and next month (or year). Range: this year and last year as month (or year)
|
|
423
|
+
* spans, then "All time". Ark's own string presets are day spans, so none is used here. */
|
|
424
|
+
const getUnitPresets = (
|
|
425
|
+
range: boolean,
|
|
426
|
+
unit: "month" | "year",
|
|
427
|
+
now: ReturnType<typeof today>,
|
|
428
|
+
toDate: (value: ReturnType<typeof today>) => Date,
|
|
429
|
+
label: Record<DatePickerPresetId, string>,
|
|
430
|
+
): DatePreset[] => {
|
|
431
|
+
const shift = (amount: number) =>
|
|
432
|
+
unit === "month"
|
|
433
|
+
? startOfMonth(now).add({ months: amount })
|
|
434
|
+
: startOfYear(now).add({ years: amount })
|
|
435
|
+
if (!range) {
|
|
436
|
+
const [current, previous, following] =
|
|
437
|
+
unit === "month"
|
|
438
|
+
? [label.thisMonth, label.lastMonth, label.nextMonth]
|
|
439
|
+
: [label.thisYear, label.lastYear, label.nextYear]
|
|
440
|
+
return [
|
|
441
|
+
{ label: current, date: toDate(shift(0)) },
|
|
442
|
+
{ label: previous, date: toDate(shift(-1)) },
|
|
443
|
+
{ label: following, date: toDate(shift(1)) },
|
|
444
|
+
]
|
|
445
|
+
}
|
|
446
|
+
// A whole calendar year, as its first and last month (or as that one year).
|
|
447
|
+
const year = (amount: number) => {
|
|
448
|
+
const start = startOfYear(now).add({ years: amount })
|
|
449
|
+
return { start: toDate(start), end: toDate(snapToUnit(endOfYear(start), unit) as typeof now) }
|
|
450
|
+
}
|
|
451
|
+
return [
|
|
452
|
+
{ label: label.thisYear, range: year(0) },
|
|
453
|
+
{ label: label.lastYear, range: year(-1) },
|
|
454
|
+
{ label: label.allTime, range: null },
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
|
|
367
458
|
const PresetsRail = ({
|
|
368
459
|
presets,
|
|
369
460
|
range,
|
|
@@ -371,6 +462,7 @@ const PresetsRail = ({
|
|
|
371
462
|
locale,
|
|
372
463
|
withConfirm,
|
|
373
464
|
translations,
|
|
465
|
+
unit = "day",
|
|
374
466
|
className,
|
|
375
467
|
}: {
|
|
376
468
|
presets: DatePreset[] | boolean
|
|
@@ -383,12 +475,15 @@ const PresetsRail = ({
|
|
|
383
475
|
/** Overrides individual `presets={true}` default-set labels, keyed by id. No effect on a
|
|
384
476
|
* custom `DatePreset[]`. */
|
|
385
477
|
translations?: Partial<Record<DatePickerPresetId, string>>
|
|
478
|
+
/** The picker's value unit (its `minView`). Picks the `presets === true` set, and snaps every
|
|
479
|
+
* preset's dates to the first day of their month or year, like a picked cell. */
|
|
480
|
+
unit?: DateUnit
|
|
386
481
|
className?: string
|
|
387
482
|
}) => {
|
|
388
483
|
const resolvedLocale = useLocale(locale)
|
|
389
484
|
const resolved =
|
|
390
485
|
presets === true
|
|
391
|
-
? getDefaultPresets(Boolean(range), timeZone, resolvedLocale, translations)
|
|
486
|
+
? getDefaultPresets(Boolean(range), timeZone, resolvedLocale, translations, unit)
|
|
392
487
|
: presets === false
|
|
393
488
|
? []
|
|
394
489
|
: presets
|
|
@@ -413,7 +508,7 @@ const PresetsRail = ({
|
|
|
413
508
|
: "range" in preset
|
|
414
509
|
? (toArkValues(preset.range, timeZone) ?? [])
|
|
415
510
|
: (toArkValues(preset.date, timeZone) ?? [])
|
|
416
|
-
api.setValue(values)
|
|
511
|
+
api.setValue(values.map((value) => snapToUnit(value, unit)))
|
|
417
512
|
if (!withConfirm) api.setOpen(false)
|
|
418
513
|
}}
|
|
419
514
|
aria-label={preset.label}
|
|
@@ -664,11 +759,11 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
664
759
|
timePlaceholder,
|
|
665
760
|
translations,
|
|
666
761
|
icons,
|
|
667
|
-
placeholder
|
|
762
|
+
placeholder,
|
|
668
763
|
startSlot,
|
|
669
764
|
size = "md",
|
|
670
765
|
variant = "default",
|
|
671
|
-
disabled,
|
|
766
|
+
disabled: disabledProp,
|
|
672
767
|
readOnly,
|
|
673
768
|
required,
|
|
674
769
|
invalid,
|
|
@@ -682,18 +777,31 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
682
777
|
classNames,
|
|
683
778
|
testId,
|
|
684
779
|
}: DatePickerProps<Range>) => {
|
|
780
|
+
// An enclosing `Field` or `Fieldset` disables it too: the shell only dims on
|
|
781
|
+
// the `disabled` handed to it here.
|
|
782
|
+
const disabled = useInheritedDisabled(disabledProp)
|
|
685
783
|
const portalContainer = useOverlayContainer(container)
|
|
784
|
+
// Lifted above a running tour while open; see `useTourRaised`. The
|
|
785
|
+
// calendar's `open` only exists inside `Ark.Context`; a closed one ignores it.
|
|
786
|
+
const raised = useTourRaised(true)
|
|
686
787
|
const { locale: contextLocale } = useLocaleContext()
|
|
687
788
|
const resolvedLocale = locale ?? contextLocale
|
|
688
789
|
const resolvedTimeZone = useTimeZone(timeZone)
|
|
689
790
|
const resolvedHourCycle = resolveHourCycle({ locale: resolvedLocale, format, hourCycle })
|
|
690
791
|
const t = { ...DATE_PICKER_DEFAULT_TRANSLATIONS, ...translations }
|
|
691
|
-
const isInvalid = invalid || error != null
|
|
792
|
+
const isInvalid = useInheritedInvalid(invalid || error != null)
|
|
692
793
|
const isRange = Boolean(range)
|
|
794
|
+
const unit: DateUnit = minView ?? "day"
|
|
795
|
+
// A month or year is picked from one grid, with no time of day and no typed day.
|
|
796
|
+
const timed = Boolean(withTime) && unit === "day"
|
|
797
|
+
const months = unit === "day" ? numOfMonths : 1
|
|
798
|
+
// Outgoing only: see `Calendar` for why incoming values aren't snapped.
|
|
799
|
+
const snap = (values: DateValue[]) => values.map((v) => snapToUnit(v, unit))
|
|
800
|
+
const resolvedPlaceholder = placeholder ?? DATE_PICKER_PLACEHOLDERS[unit]
|
|
693
801
|
// See `typeable`'s own doc comment: single dates only — `range` silently falls back to the
|
|
694
802
|
// button trigger rather than erroring, so `typeable` composes safely with every other prop.
|
|
695
803
|
// Under `withTime` the input is `DateTimeTextInput` instead of Ark's own date-only `Input`.
|
|
696
|
-
const showTypeableInput = Boolean(typeable) && !isRange
|
|
804
|
+
const showTypeableInput = Boolean(typeable) && !isRange && unit === "day"
|
|
697
805
|
const dateTimeText = { locale: resolvedLocale, hourCycle: resolvedHourCycle, withSeconds }
|
|
698
806
|
const controlRef = useRef<HTMLDivElement>(null)
|
|
699
807
|
const triggerRef = useRef<HTMLButtonElement>(null)
|
|
@@ -733,7 +841,7 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
733
841
|
// the picker must stay open for review until Apply/Cancel, and under `withTime` the day
|
|
734
842
|
// is only half the value: closing on pick would hide the time row it still needs.
|
|
735
843
|
// Otherwise leave Ark's default (single closes on pick, range on the second click).
|
|
736
|
-
closeOnSelect={withConfirm ||
|
|
844
|
+
closeOnSelect={withConfirm || timed ? false : undefined}
|
|
737
845
|
// Ark's own default (`false`) requires the calendar-icon trigger to open the popover —
|
|
738
846
|
// under `typeable` a click into the text field itself should open it too, matching the
|
|
739
847
|
// combined type-or-pick affordance `typeable` is meant to offer. No-op when the Input
|
|
@@ -742,7 +850,7 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
742
850
|
locale={resolvedLocale}
|
|
743
851
|
timeZone={resolvedTimeZone}
|
|
744
852
|
translations={resolveCalendarTranslations(translations)}
|
|
745
|
-
numOfMonths={
|
|
853
|
+
numOfMonths={months}
|
|
746
854
|
fixedWeeks={fixedWeeks}
|
|
747
855
|
minView={minView}
|
|
748
856
|
maxView={maxView}
|
|
@@ -754,7 +862,7 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
754
862
|
zoneReseed.current = null
|
|
755
863
|
return
|
|
756
864
|
}
|
|
757
|
-
const next = fromArkValues(details.value, isRange, resolvedTimeZone) as Value
|
|
865
|
+
const next = fromArkValues(snap(details.value), isRange, resolvedTimeZone) as Value
|
|
758
866
|
if (withConfirm) setStaged(next)
|
|
759
867
|
else onChange?.(next)
|
|
760
868
|
}}
|
|
@@ -767,21 +875,32 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
767
875
|
isDateUnavailable(
|
|
768
876
|
calendarValueToDate(dateValue, resolvedTimeZone),
|
|
769
877
|
resolvedTimeZone,
|
|
878
|
+
unit,
|
|
770
879
|
)
|
|
771
880
|
: undefined
|
|
772
881
|
}
|
|
773
|
-
min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}
|
|
774
|
-
max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}
|
|
882
|
+
min={min ? snapBound(dateToArkValue(min, resolvedTimeZone), unit, "start") : undefined}
|
|
883
|
+
max={max ? snapBound(dateToArkValue(max, resolvedTimeZone), unit, "end") : undefined}
|
|
775
884
|
// The typed date+time input shows (and Ark syncs into it) the same numeric text it parses.
|
|
776
885
|
format={
|
|
777
|
-
|
|
778
|
-
? (date
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
886
|
+
unit !== "day"
|
|
887
|
+
? (date, { locale: fmtLocale }) =>
|
|
888
|
+
new DateFormatter(fmtLocale, {
|
|
889
|
+
...UNIT_FORMAT[unit],
|
|
890
|
+
timeZone: resolvedTimeZone,
|
|
891
|
+
}).format(calendarValueToDate(date, resolvedTimeZone))
|
|
892
|
+
: withTime && showTypeableInput
|
|
893
|
+
? (date) => formatDateTimeText(date, dateTimeText, resolvedTimeZone)
|
|
894
|
+
: withTime
|
|
895
|
+
? (date, { locale: fmtLocale }) =>
|
|
896
|
+
// `timeZone`, or the text reads the instant on the browser's clock while the
|
|
897
|
+
// calendar and time row read it in `resolvedTimeZone` (#470).
|
|
898
|
+
new DateFormatter(fmtLocale, {
|
|
899
|
+
dateStyle: "medium",
|
|
900
|
+
timeStyle: "short",
|
|
901
|
+
timeZone: resolvedTimeZone,
|
|
902
|
+
}).format(calendarValueToDate(date, resolvedTimeZone))
|
|
903
|
+
: undefined
|
|
785
904
|
}
|
|
786
905
|
// Anchor to the Control (not `sameWidth`, unlike Select) — the popover hosts a full
|
|
787
906
|
// calendar grid + presets rail, which needs its own intrinsic width, not the trigger's.
|
|
@@ -829,14 +948,14 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
829
948
|
<Ark.Trigger className={datePickerIconTrigger}>
|
|
830
949
|
{startSlot ?? <CalendarIcon />}
|
|
831
950
|
</Ark.Trigger>
|
|
832
|
-
{
|
|
951
|
+
{timed ? (
|
|
833
952
|
<DateTimeTextInput
|
|
834
953
|
api={api}
|
|
835
954
|
options={dateTimeText}
|
|
836
955
|
timeZone={resolvedTimeZone}
|
|
837
956
|
ref={inputMergedRef}
|
|
838
957
|
onBlur={onBlur}
|
|
839
|
-
placeholder={
|
|
958
|
+
placeholder={resolvedPlaceholder}
|
|
840
959
|
disabled={disabled}
|
|
841
960
|
readOnly={readOnly}
|
|
842
961
|
invalid={isInvalid}
|
|
@@ -846,7 +965,7 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
846
965
|
<Ark.Input
|
|
847
966
|
ref={inputMergedRef}
|
|
848
967
|
onBlur={onBlur}
|
|
849
|
-
placeholder={
|
|
968
|
+
placeholder={resolvedPlaceholder}
|
|
850
969
|
{...props({ "data-testid": testId })}
|
|
851
970
|
className={inputControlClasses}
|
|
852
971
|
/>
|
|
@@ -868,7 +987,7 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
868
987
|
<span className="min-w-0 flex-1 truncate text-start">
|
|
869
988
|
{isRange ? (
|
|
870
989
|
api.value.length === 0 ? (
|
|
871
|
-
<span className={placeholderColor}>{
|
|
990
|
+
<span className={placeholderColor}>{resolvedPlaceholder}</span>
|
|
872
991
|
) : (
|
|
873
992
|
// Not `Ark.RangeText`: despite the name, it renders the calendar's
|
|
874
993
|
// *visible* month/year viewport (the same text the header's ViewTrigger
|
|
@@ -878,7 +997,7 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
878
997
|
api.valueAsString.join(" – ")
|
|
879
998
|
)
|
|
880
999
|
) : (
|
|
881
|
-
<Ark.ValueText placeholder={
|
|
1000
|
+
<Ark.ValueText placeholder={resolvedPlaceholder} />
|
|
882
1001
|
)}
|
|
883
1002
|
</span>
|
|
884
1003
|
</Ark.Trigger>
|
|
@@ -896,6 +1015,7 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
896
1015
|
<Portal disabled={!withinPortal} container={portalContainer}>
|
|
897
1016
|
<Ark.Positioner>
|
|
898
1017
|
<Ark.Content
|
|
1018
|
+
data-raised={raised || undefined}
|
|
899
1019
|
// `max-content` sizing (no `sameWidth`, see the positioning comment above)
|
|
900
1020
|
// means "as if nothing below ever wraps" — a `flex-wrap` time-row footer
|
|
901
1021
|
// wider than the calendar (two side-by-side "Start time"/"End time" rows
|
|
@@ -917,6 +1037,7 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
917
1037
|
locale={resolvedLocale}
|
|
918
1038
|
withConfirm={withConfirm}
|
|
919
1039
|
translations={translations?.presets}
|
|
1040
|
+
unit={unit}
|
|
920
1041
|
className={classNames?.presets}
|
|
921
1042
|
/>
|
|
922
1043
|
)}
|
|
@@ -925,23 +1046,25 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
925
1046
|
style={{
|
|
926
1047
|
width:
|
|
927
1048
|
Math.max(
|
|
928
|
-
calendarGridWidth(size,
|
|
929
|
-
|
|
1049
|
+
calendarGridWidth(size, months),
|
|
1050
|
+
timed ? timeRowMinWidth(size, resolvedHourCycle, withSeconds) : 0,
|
|
930
1051
|
) + 16, // Take the x padding into account
|
|
931
1052
|
}}
|
|
932
1053
|
>
|
|
933
1054
|
<Popover.Body
|
|
934
|
-
className={cn("p-2",
|
|
1055
|
+
className={cn("p-2", timed || withConfirm ? "border-b" : undefined)}
|
|
935
1056
|
>
|
|
936
1057
|
<CalendarBody
|
|
937
|
-
numOfMonths={
|
|
1058
|
+
numOfMonths={months}
|
|
1059
|
+
unit={unit}
|
|
1060
|
+
locale={resolvedLocale}
|
|
938
1061
|
size={size}
|
|
939
1062
|
timeZone={resolvedTimeZone}
|
|
940
1063
|
classNames={classNames?.calendar}
|
|
941
1064
|
icons={icons}
|
|
942
1065
|
/>
|
|
943
1066
|
</Popover.Body>
|
|
944
|
-
{
|
|
1067
|
+
{timed && (
|
|
945
1068
|
<Popover.Footer
|
|
946
1069
|
className={cn(
|
|
947
1070
|
"flex gap-x-2 gap-y-2 pb-2",
|
|
@@ -949,7 +1072,7 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
949
1072
|
// room multiple months already provide; with a single month, sitting
|
|
950
1073
|
// two time rows side by side would force the popover wider than the
|
|
951
1074
|
// calendar above them for no reason.
|
|
952
|
-
|
|
1075
|
+
months > 1 ? "flex-row flex-wrap" : "flex-col",
|
|
953
1076
|
classNames?.footer,
|
|
954
1077
|
)}
|
|
955
1078
|
>
|
|
@@ -1021,23 +1144,19 @@ const DatePickerImpl = <Range extends boolean = false>({
|
|
|
1021
1144
|
<input
|
|
1022
1145
|
type="hidden"
|
|
1023
1146
|
name={`${name}Start`}
|
|
1024
|
-
value={
|
|
1025
|
-
api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : ""
|
|
1026
|
-
}
|
|
1147
|
+
value={api.value[0] ? serializeDateValue(api.value[0], timed, unit) : ""}
|
|
1027
1148
|
/>
|
|
1028
1149
|
<input
|
|
1029
1150
|
type="hidden"
|
|
1030
1151
|
name={`${name}End`}
|
|
1031
|
-
value={
|
|
1032
|
-
api.value[1] ? serializeDateValue(api.value[1], Boolean(withTime)) : ""
|
|
1033
|
-
}
|
|
1152
|
+
value={api.value[1] ? serializeDateValue(api.value[1], timed, unit) : ""}
|
|
1034
1153
|
/>
|
|
1035
1154
|
</>
|
|
1036
1155
|
) : (
|
|
1037
1156
|
<input
|
|
1038
1157
|
type="hidden"
|
|
1039
1158
|
name={name}
|
|
1040
|
-
value={api.value[0] ? serializeDateValue(api.value[0],
|
|
1159
|
+
value={api.value[0] ? serializeDateValue(api.value[0], timed, unit) : ""}
|
|
1041
1160
|
/>
|
|
1042
1161
|
))}
|
|
1043
1162
|
</>
|
|
@@ -13,7 +13,7 @@ export {
|
|
|
13
13
|
disablePast,
|
|
14
14
|
disableWeekends,
|
|
15
15
|
} from "../../lib/date-predicates"
|
|
16
|
-
export type { DateRangeValue } from "../../lib/date-value"
|
|
16
|
+
export type { DateRangeValue, DateUnit } from "../../lib/date-value"
|
|
17
17
|
export {
|
|
18
18
|
DateRangePicker,
|
|
19
19
|
type DateRangePickerProps,
|
|
@@ -21,6 +21,10 @@ export {
|
|
|
21
21
|
type DateTimePickerProps,
|
|
22
22
|
DateTimeRangePicker,
|
|
23
23
|
type DateTimeRangePickerProps,
|
|
24
|
+
MonthPicker,
|
|
25
|
+
type MonthPickerProps,
|
|
26
|
+
YearPicker,
|
|
27
|
+
type YearPickerProps,
|
|
24
28
|
} from "./aliases"
|
|
25
29
|
export {
|
|
26
30
|
DatePicker,
|