@42-central/ui-react 0.29.1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-X6DESK37.js → chunk-2RRTT4AF.js} +17 -5
- package/dist/chunk-2RRTT4AF.js.map +1 -0
- package/dist/{chunk-TUP7WXQE.js → chunk-322I2RSV.js} +9 -6
- package/dist/chunk-322I2RSV.js.map +1 -0
- package/dist/{chunk-ISX3AM32.js → chunk-37SRSNLJ.js} +4 -4
- package/dist/{chunk-ISX3AM32.js.map → chunk-37SRSNLJ.js.map} +1 -1
- package/dist/{chunk-L5GH7LLD.js → chunk-3MFWUG5O.js} +4 -4
- package/dist/{chunk-L5GH7LLD.js.map → chunk-3MFWUG5O.js.map} +1 -1
- package/dist/{chunk-FQJNQW3G.js → chunk-3XQEOJCE.js} +8 -5
- package/dist/chunk-3XQEOJCE.js.map +1 -0
- package/dist/{chunk-JKFPRQB2.js → chunk-4LSZ5JWF.js} +3 -3
- package/dist/{chunk-JKFPRQB2.js.map → chunk-4LSZ5JWF.js.map} +1 -1
- package/dist/{chunk-V2QZG4IT.js → chunk-5HWFYYHW.js} +27 -9
- package/dist/chunk-5HWFYYHW.js.map +1 -0
- package/dist/{chunk-GEZYGBXY.js → chunk-6MVFCS46.js} +99 -42
- package/dist/chunk-6MVFCS46.js.map +1 -0
- package/dist/{chunk-NNPSBC7O.js → chunk-6WZSUS3U.js} +10 -9
- package/dist/chunk-6WZSUS3U.js.map +1 -0
- package/dist/chunk-6YRGP6PS.js +138 -0
- package/dist/chunk-6YRGP6PS.js.map +1 -0
- package/dist/{chunk-B5YHYI7E.js → chunk-ALANKV5Y.js} +23 -6
- package/dist/chunk-ALANKV5Y.js.map +1 -0
- package/dist/{chunk-IA6DCC3N.js → chunk-AUQPNDE5.js} +23 -13
- package/dist/chunk-AUQPNDE5.js.map +1 -0
- package/dist/{chunk-AKXALCUN.js → chunk-D7SW2E24.js} +4 -4
- package/dist/chunk-D7SW2E24.js.map +1 -0
- package/dist/{chunk-OXR7BXZA.js → chunk-DQIYYDFD.js} +4 -3
- package/dist/chunk-DQIYYDFD.js.map +1 -0
- package/dist/{chunk-HMNXNKDA.js → chunk-FCBYUN6F.js} +4 -4
- package/dist/{chunk-HMNXNKDA.js.map → chunk-FCBYUN6F.js.map} +1 -1
- package/dist/{chunk-2W7H43WL.js → chunk-FED6SJWM.js} +23 -14
- package/dist/chunk-FED6SJWM.js.map +1 -0
- package/dist/{chunk-7E7JNWOC.js → chunk-FEPIHXVI.js} +6 -5
- package/dist/chunk-FEPIHXVI.js.map +1 -0
- package/dist/{chunk-Y57NW6G7.js → chunk-G3YOSG3U.js} +4 -4
- package/dist/{chunk-Y57NW6G7.js.map → chunk-G3YOSG3U.js.map} +1 -1
- package/dist/chunk-GZN5CXMR.js +100 -0
- package/dist/chunk-GZN5CXMR.js.map +1 -0
- package/dist/{chunk-HCHGERDB.js → chunk-HCSZPBWV.js} +17 -115
- package/dist/chunk-HCSZPBWV.js.map +1 -0
- package/dist/{chunk-I4B3N3UX.js → chunk-HTVICHT4.js} +12 -7
- package/dist/chunk-HTVICHT4.js.map +1 -0
- package/dist/chunk-I7TC2C3I.js +163 -0
- package/dist/chunk-I7TC2C3I.js.map +1 -0
- package/dist/{chunk-7FPSQBWB.js → chunk-IBXYLO2J.js} +14 -13
- package/dist/chunk-IBXYLO2J.js.map +1 -0
- package/dist/{chunk-7KFUFAVP.js → chunk-IRYG6B5A.js} +9 -8
- package/dist/chunk-IRYG6B5A.js.map +1 -0
- package/dist/{chunk-2RQLPN4U.js → chunk-JCNEW4WJ.js} +8 -8
- package/dist/{chunk-2RQLPN4U.js.map → chunk-JCNEW4WJ.js.map} +1 -1
- package/dist/{chunk-SP6LCCTZ.js → chunk-KZDMVOL6.js} +35 -8
- package/dist/chunk-KZDMVOL6.js.map +1 -0
- package/dist/chunk-LR5U6TZZ.js +169 -0
- package/dist/chunk-LR5U6TZZ.js.map +1 -0
- package/dist/{chunk-MQHD3EJE.js → chunk-LZHZJWVM.js} +6 -4
- package/dist/chunk-LZHZJWVM.js.map +1 -0
- package/dist/{chunk-5EOMSWNO.js → chunk-MAM2X3MW.js} +5 -5
- package/dist/{chunk-5EOMSWNO.js.map → chunk-MAM2X3MW.js.map} +1 -1
- package/dist/{chunk-FSPS7TVD.js → chunk-MCMS4NMO.js} +5 -5
- package/dist/{chunk-FSPS7TVD.js.map → chunk-MCMS4NMO.js.map} +1 -1
- package/dist/{chunk-ZB5VMGKB.js → chunk-MV5DIE2T.js} +15 -4
- package/dist/chunk-MV5DIE2T.js.map +1 -0
- package/dist/chunk-NDI4HLQE.js +41 -0
- package/dist/chunk-NDI4HLQE.js.map +1 -0
- package/dist/{chunk-B4GNSSHU.js → chunk-NLJEQZQQ.js} +3 -3
- package/dist/{chunk-B4GNSSHU.js.map → chunk-NLJEQZQQ.js.map} +1 -1
- package/dist/{chunk-SBZJGFZ6.js → chunk-QHT4DCXE.js} +8 -7
- package/dist/chunk-QHT4DCXE.js.map +1 -0
- package/dist/{chunk-I4IJOLNA.js → chunk-RMUBCTEF.js} +5 -5
- package/dist/{chunk-I4IJOLNA.js.map → chunk-RMUBCTEF.js.map} +1 -1
- package/dist/{chunk-G3AD3NJG.js → chunk-RNTDM3RP.js} +9 -5
- package/dist/chunk-RNTDM3RP.js.map +1 -0
- package/dist/chunk-RPFN6ETQ.js +509 -0
- package/dist/chunk-RPFN6ETQ.js.map +1 -0
- package/dist/{chunk-HWBFRDX7.js → chunk-SI7C3W5M.js} +28 -9
- package/dist/chunk-SI7C3W5M.js.map +1 -0
- package/dist/chunk-TPOV3OCC.js +234 -0
- package/dist/chunk-TPOV3OCC.js.map +1 -0
- package/dist/{chunk-IANYMDKH.js → chunk-UBQ54W46.js} +4 -4
- package/dist/chunk-UBQ54W46.js.map +1 -0
- package/dist/{chunk-QVOBLRCM.js → chunk-UIKQ4X6W.js} +3 -3
- package/dist/{chunk-QVOBLRCM.js.map → chunk-UIKQ4X6W.js.map} +1 -1
- package/dist/chunk-UOWQH53N.js +70 -0
- package/dist/chunk-UOWQH53N.js.map +1 -0
- package/dist/{chunk-QRNQQIQM.js → chunk-WJUY6YWF.js} +52 -20
- package/dist/chunk-WJUY6YWF.js.map +1 -0
- package/dist/{chunk-3KARNPW4.js → chunk-WKIUMLRT.js} +3 -3
- package/dist/{chunk-3KARNPW4.js.map → chunk-WKIUMLRT.js.map} +1 -1
- package/dist/chunk-X6RB74JN.js +37 -0
- package/dist/chunk-X6RB74JN.js.map +1 -0
- package/dist/chunk-XQ6L2CM5.js +83 -0
- package/dist/chunk-XQ6L2CM5.js.map +1 -0
- package/dist/{chunk-RKCUXOU2.js → chunk-YUVKROMA.js} +44 -7
- package/dist/chunk-YUVKROMA.js.map +1 -0
- package/dist/components/action-icon/action-icon.d.ts +9 -2
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +5 -1
- package/dist/components/alert/index.js +4 -4
- package/dist/components/anchor/anchor.d.ts +45 -0
- package/dist/components/anchor/anchor.d.ts.map +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.d.ts.map +1 -0
- package/dist/components/anchor/index.js +11 -0
- package/dist/components/anchor/index.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +10 -6
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +23 -24
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +15 -9
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/button/button.d.ts +15 -2
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +5 -1
- package/dist/components/button-multi-select/index.js +6 -4
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/button-select-control.d.ts.map +1 -1
- package/dist/components/button-select/button-select.d.ts +2 -2
- package/dist/components/button-select/button-select.d.ts.map +1 -1
- package/dist/components/button-select/index.js +6 -4
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/aliases.d.ts +16 -0
- package/dist/components/calendar/aliases.d.ts.map +1 -0
- package/dist/components/calendar/calendar-body.d.ts +11 -1
- package/dist/components/calendar/calendar-body.d.ts.map +1 -1
- package/dist/components/calendar/calendar.d.ts +8 -4
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/calendar/index.d.ts.map +1 -1
- package/dist/components/calendar/index.js +15 -5
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
- package/dist/components/calendar-heatmap/index.js +85 -73
- package/dist/components/calendar-heatmap/index.js.map +1 -1
- package/dist/components/camera/index.js +16 -14
- package/dist/components/carousel/index.js +3 -3
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/choice-card-group/index.js +2 -2
- package/dist/components/choice-card-group/index.js.map +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +22 -11
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.d.ts +1 -1
- package/dist/components/circular-progress/index.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js +68 -49
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/index.js +7 -3
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code/code.d.ts +10 -0
- package/dist/components/code/code.d.ts.map +1 -1
- package/dist/components/code/index.js +1 -0
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +10 -6
- package/dist/components/code-block/index.js +10 -7
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +5 -3
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +12 -7
- package/dist/components/combobox-list/combobox-list.d.ts +1 -1
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +14 -9
- package/dist/components/compare/index.js +1 -1
- package/dist/components/data-list/data-list.d.ts +96 -0
- package/dist/components/data-list/data-list.d.ts.map +1 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.d.ts.map +1 -0
- package/dist/components/data-list/index.js +147 -0
- package/dist/components/data-list/index.js.map +1 -0
- package/dist/components/data-table/data-table-group.d.ts.map +1 -1
- package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
- package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts +5 -2
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.js +163 -168
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/aliases.d.ts +16 -0
- package/dist/components/date-picker/aliases.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +22 -8
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +34 -28
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/download-button/index.js +6 -2
- package/dist/components/drawer/drawer.d.ts +7 -4
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.js +11 -6
- package/dist/components/empty-state/empty-state.d.ts +57 -0
- package/dist/components/empty-state/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/empty-state/index.d.ts.map +1 -0
- package/dist/components/empty-state/index.js +8 -0
- package/dist/components/empty-state/index.js.map +1 -0
- package/dist/components/field/field.d.ts +20 -0
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/fieldset/fieldset.d.ts +103 -0
- package/dist/components/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/fieldset/index.d.ts.map +1 -0
- package/dist/components/fieldset/index.js +150 -0
- package/dist/components/fieldset/index.js.map +1 -0
- package/dist/components/file-item/index.js +10 -7
- package/dist/components/file-preview/file-preview.d.ts.map +1 -1
- package/dist/components/file-preview/index.js +10 -18
- package/dist/components/file-preview/index.js.map +1 -1
- package/dist/components/file-trigger/index.js +6 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +18 -14
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/gallery/index.js +3 -3
- package/dist/components/geodesic/a11y.d.ts +3 -3
- package/dist/components/geodesic/a11y.d.ts.map +1 -1
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/index.js +10 -3
- package/dist/components/hover-card/index.js.map +1 -1
- package/dist/components/image/index.js +3 -3
- package/dist/components/image-cropper/index.js +9 -6
- package/dist/components/input/index.js +2 -2
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/kbd/index.js +3 -3
- package/dist/components/kbd/kbd.d.ts +4 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/lightbox/index.js +13 -11
- package/dist/components/lightbox/index.js.map +1 -1
- package/dist/components/menu/index.js +9 -5
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/modal/index.js +11 -6
- package/dist/components/modal/modal.d.ts +10 -4
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +13 -9
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +13 -10
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +4 -4
- package/dist/components/nav-link/tanstack.js +4 -4
- package/dist/components/notification/index.js +6 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/number-input/index.js +11 -7
- package/dist/components/number-input/number-input.d.ts +1 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/dialog-parts.d.ts +10 -1
- package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
- package/dist/components/overlays/index.js +13 -8
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +362 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +147 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/password-input/index.js +6 -5
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +1 -1
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/phone-input/index.js +14 -11
- package/dist/components/phone-input/index.js.map +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/photo-capture/index.js +19 -17
- package/dist/components/photo-capture/index.js.map +1 -1
- package/dist/components/pills-input/index.js +4 -4
- package/dist/components/pills-input/pills-input.d.ts +1 -1
- package/dist/components/pills-input/pills-input.d.ts.map +1 -1
- package/dist/components/pin-input/index.js +6 -5
- package/dist/components/pin-input/index.js.map +1 -1
- package/dist/components/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/popover/index.js +7 -2
- package/dist/components/popover/popover.d.ts +41 -16
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.d.ts +1 -1
- package/dist/components/progress/index.d.ts.map +1 -1
- package/dist/components/progress/index.js +4 -1
- package/dist/components/progress/progress.d.ts +22 -14
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/prose/index.d.ts +2 -0
- package/dist/components/prose/index.d.ts.map +1 -0
- package/dist/components/prose/index.js +17 -0
- package/dist/components/prose/index.js.map +1 -0
- package/dist/components/prose/prose.d.ts +49 -0
- package/dist/components/prose/prose.d.ts.map +1 -0
- package/dist/components/prose/styles.css +593 -0
- package/dist/components/radio-group/index.js +9 -3
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/rating/index.js +3 -2
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.js +10 -8
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.d.ts.map +1 -0
- package/dist/components/scroll-area/index.js +10 -0
- package/dist/components/scroll-area/index.js.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +150 -0
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/components/segment-group/index.js +2 -2
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.js +12 -8
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/splitter/index.d.ts.map +1 -0
- package/dist/components/splitter/index.js +373 -0
- package/dist/components/splitter/index.js.map +1 -0
- package/dist/components/splitter/splitter.d.ts +159 -0
- package/dist/components/splitter/splitter.d.ts.map +1 -0
- package/dist/components/spotlight/index.js +23 -22
- package/dist/components/spotlight/index.js.map +1 -1
- package/dist/components/spotlight/spotlight.d.ts.map +1 -1
- package/dist/components/steps/index.d.ts +4 -0
- package/dist/components/steps/index.d.ts.map +1 -0
- package/dist/components/steps/index.js +478 -0
- package/dist/components/steps/index.js.map +1 -0
- package/dist/components/steps/steps-data.d.ts +78 -0
- package/dist/components/steps/steps-data.d.ts.map +1 -0
- package/dist/components/steps/steps.d.ts +183 -0
- package/dist/components/steps/steps.d.ts.map +1 -0
- package/dist/components/switch/index.js +4 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/table-of-contents/index.d.ts +2 -0
- package/dist/components/table-of-contents/index.d.ts.map +1 -0
- package/dist/components/table-of-contents/index.js +471 -0
- package/dist/components/table-of-contents/index.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
- package/dist/components/tags-input/index.js +12 -9
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +1 -1
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +8 -6
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/time-input/index.js +11 -9
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +3 -8
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tour/conditions.d.ts +83 -0
- package/dist/components/tour/conditions.d.ts.map +1 -0
- package/dist/components/tour/create-tours.d.ts +49 -0
- package/dist/components/tour/create-tours.d.ts.map +1 -0
- package/dist/components/tour/index.d.ts +6 -0
- package/dist/components/tour/index.d.ts.map +1 -0
- package/dist/components/tour/index.js +1449 -0
- package/dist/components/tour/index.js.map +1 -0
- package/dist/components/tour/runtime.d.ts +57 -0
- package/dist/components/tour/runtime.d.ts.map +1 -0
- package/dist/components/tour/storage.d.ts +14 -0
- package/dist/components/tour/storage.d.ts.map +1 -0
- package/dist/components/tour/store.d.ts +62 -0
- package/dist/components/tour/store.d.ts.map +1 -0
- package/dist/components/tour/tour.d.ts +77 -0
- package/dist/components/tour/tour.d.ts.map +1 -0
- package/dist/components/tour/types.d.ts +680 -0
- package/dist/components/tour/types.d.ts.map +1 -0
- package/dist/components/tree/index.d.ts +3 -0
- package/dist/components/tree/index.d.ts.map +1 -0
- package/dist/components/tree/index.js +457 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/components/tree/tree-row.d.ts +72 -0
- package/dist/components/tree/tree-row.d.ts.map +1 -0
- package/dist/components/tree/tree.d.ts +193 -0
- package/dist/components/tree/tree.d.ts.map +1 -0
- package/dist/components/tree-multi-select/index.js +31 -54
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +30 -24
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-popover.d.ts +20 -31
- package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +1 -1
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/date-predicates.d.ts +7 -5
- package/dist/lib/date-predicates.d.ts.map +1 -1
- package/dist/lib/date-value.d.ts +20 -0
- package/dist/lib/date-value.d.ts.map +1 -1
- package/dist/lib/floating-arrow.d.ts +53 -0
- package/dist/lib/floating-arrow.d.ts.map +1 -0
- package/dist/lib/focus-return.d.ts +53 -0
- package/dist/lib/focus-return.d.ts.map +1 -0
- package/dist/lib/meter.d.ts +104 -0
- package/dist/lib/meter.d.ts.map +1 -0
- package/dist/lib/overlay-layer.d.ts +26 -8
- package/dist/lib/overlay-layer.d.ts.map +1 -1
- package/dist/lib/pressed.d.ts +92 -0
- package/dist/lib/pressed.d.ts.map +1 -0
- package/dist/lib/tree-data.d.ts +18 -2
- package/dist/lib/tree-data.d.ts.map +1 -1
- package/dist/lib/use-pagination.d.ts +102 -0
- package/dist/lib/use-pagination.d.ts.map +1 -0
- package/dist/lib/use-scroll-spy.d.ts +126 -0
- package/dist/lib/use-scroll-spy.d.ts.map +1 -0
- package/dist/theme.css +39 -3
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +283 -1
- package/src/components/action-icon/action-icon.tsx +34 -4
- package/src/components/anchor/anchor.test.tsx +232 -0
- package/src/components/anchor/anchor.tsx +187 -0
- package/src/components/anchor/index.ts +12 -0
- package/src/components/app-shell/app-shell.test.tsx +15 -7
- package/src/components/app-shell/app-shell.tsx +27 -20
- package/src/components/autocomplete/autocomplete.tsx +11 -3
- package/src/components/button/button-pressed.test.tsx +202 -0
- package/src/components/button/button.tsx +48 -6
- package/src/components/button-select/button-select-control.tsx +2 -2
- package/src/components/button-select/button-select.tsx +22 -2
- package/src/components/calendar/aliases.tsx +28 -0
- package/src/components/calendar/calendar-body.tsx +310 -210
- package/src/components/calendar/calendar.tsx +43 -12
- package/src/components/calendar/index.ts +7 -1
- package/src/components/calendar/month-year-calendar.test.tsx +106 -0
- package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
- package/src/components/checkbox/checkbox.tsx +7 -2
- package/src/components/choice-card-group/choice-card-group.tsx +2 -2
- package/src/components/circular-progress/circular-progress.test.tsx +35 -0
- package/src/components/circular-progress/circular-progress.tsx +116 -59
- package/src/components/circular-progress/index.ts +1 -0
- package/src/components/code/code.test.tsx +16 -0
- package/src/components/code/code.tsx +11 -0
- package/src/components/combobox/combobox.tsx +63 -28
- package/src/components/combobox-list/combobox-list.tsx +11 -3
- package/src/components/data-list/data-list.test.tsx +149 -0
- package/src/components/data-list/data-list.tsx +268 -0
- package/src/components/data-list/index.ts +9 -0
- package/src/components/data-table/data-table-group.test.tsx +16 -0
- package/src/components/data-table/data-table-group.tsx +15 -2
- package/src/components/data-table/data-table-placeholder.tsx +28 -36
- package/src/components/data-table/data-table-stack.tsx +33 -39
- package/src/components/data-table/data-table.test.tsx +31 -0
- package/src/components/data-table/data-table.tsx +41 -42
- package/src/components/date-picker/aliases.tsx +28 -0
- package/src/components/date-picker/date-picker.test.tsx +29 -0
- package/src/components/date-picker/date-picker.tsx +164 -45
- package/src/components/date-picker/index.ts +5 -1
- package/src/components/date-picker/month-year-picker.test.tsx +362 -0
- package/src/components/drawer/drawer.test.tsx +41 -0
- package/src/components/drawer/drawer.tsx +7 -1
- package/src/components/empty-state/empty-state.test.tsx +109 -0
- package/src/components/empty-state/empty-state.tsx +180 -0
- package/src/components/empty-state/index.ts +9 -0
- package/src/components/field/field.tsx +35 -1
- package/src/components/fieldset/fieldset.test.tsx +352 -0
- package/src/components/fieldset/fieldset.tsx +268 -0
- package/src/components/fieldset/index.ts +11 -0
- package/src/components/file-preview/file-preview.test.tsx +2 -1
- package/src/components/file-preview/file-preview.tsx +7 -13
- package/src/components/file-upload/file-upload.tsx +14 -5
- package/src/components/hover-card/hover-card.tsx +5 -1
- package/src/components/input/input.tsx +12 -5
- package/src/components/kbd/kbd.test.tsx +13 -0
- package/src/components/kbd/kbd.tsx +6 -0
- package/src/components/menu/menu.tsx +6 -2
- package/src/components/modal/modal.test.tsx +41 -0
- package/src/components/modal/modal.tsx +17 -9
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
- package/src/components/multi-select/multi-select.tsx +11 -3
- package/src/components/notification/create-notifier.tsx +1 -1
- package/src/components/number-input/number-input.tsx +12 -3
- package/src/components/overlays/dialog-parts.tsx +42 -5
- package/src/components/pagination/index.ts +19 -0
- package/src/components/pagination/pagination.test.tsx +187 -0
- package/src/components/pagination/pagination.tsx +563 -0
- package/src/components/password-input/password-input.tsx +12 -3
- package/src/components/phone-input/phone-input.tsx +12 -3
- package/src/components/pills-input/pills-input.tsx +7 -2
- package/src/components/pin-input/pin-input.tsx +13 -4
- package/src/components/popover/popover.tsx +87 -17
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/progress.test.tsx +102 -0
- package/src/components/progress/progress.tsx +116 -62
- package/src/components/prose/index.ts +1 -0
- package/src/components/prose/prose.test.tsx +90 -0
- package/src/components/prose/prose.tsx +60 -0
- package/src/components/prose/styles.css +593 -0
- package/src/components/radio-group/radio-group.tsx +8 -3
- package/src/components/rating/rating.tsx +5 -2
- package/src/components/scroll-area/index.ts +18 -0
- package/src/components/scroll-area/scroll-area.test.tsx +184 -0
- package/src/components/scroll-area/scroll-area.tsx +448 -0
- package/src/components/segment-group/segment-group.tsx +2 -2
- package/src/components/select/select.tsx +37 -18
- package/src/components/slider/slider.tsx +2 -2
- package/src/components/splitter/index.ts +15 -0
- package/src/components/splitter/splitter.test.tsx +244 -0
- package/src/components/splitter/splitter.tsx +625 -0
- package/src/components/spotlight/spotlight.test.tsx +34 -26
- package/src/components/spotlight/spotlight.tsx +7 -9
- package/src/components/steps/index.ts +21 -0
- package/src/components/steps/steps-data.tsx +179 -0
- package/src/components/steps/steps.test.tsx +235 -0
- package/src/components/steps/steps.tsx +686 -0
- package/src/components/switch/switch.tsx +7 -2
- package/src/components/table-of-contents/index.ts +17 -0
- package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
- package/src/components/table-of-contents/table-of-contents.tsx +708 -0
- package/src/components/tags-input/tags-input.tsx +12 -3
- package/src/components/textarea/textarea.tsx +15 -5
- package/src/components/tooltip/tooltip.tsx +8 -17
- package/src/components/tour/conditions.test.ts +527 -0
- package/src/components/tour/conditions.ts +445 -0
- package/src/components/tour/create-tours.tsx +150 -0
- package/src/components/tour/index.ts +86 -0
- package/src/components/tour/runtime.ts +187 -0
- package/src/components/tour/storage.test.ts +68 -0
- package/src/components/tour/storage.ts +44 -0
- package/src/components/tour/store.test.tsx +784 -0
- package/src/components/tour/store.ts +661 -0
- package/src/components/tour/tour.test.tsx +318 -0
- package/src/components/tour/tour.tsx +773 -0
- package/src/components/tour/tour.types.test.ts +185 -0
- package/src/components/tour/types.ts +904 -0
- package/src/components/tree/index.ts +24 -0
- package/src/components/tree/tree-row.tsx +179 -0
- package/src/components/tree/tree.test.tsx +296 -0
- package/src/components/tree/tree.tsx +796 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
- package/src/components/tree-select/tree-popover.tsx +26 -107
- package/src/components/tree-select/tree-select.tsx +24 -16
- package/src/icon-stroke.test.tsx +2 -0
- package/src/index.ts +16 -0
- package/src/lib/date-predicates.test.ts +46 -0
- package/src/lib/date-predicates.ts +44 -24
- package/src/lib/date-value.test.ts +24 -1
- package/src/lib/date-value.ts +42 -1
- package/src/lib/floating-arrow.tsx +73 -0
- package/src/lib/focus-return.test.tsx +143 -0
- package/src/lib/focus-return.ts +106 -0
- package/src/lib/meter.test.ts +40 -0
- package/src/lib/meter.ts +159 -0
- package/src/lib/overlay-layer.test.tsx +47 -1
- package/src/lib/overlay-layer.tsx +65 -8
- package/src/lib/pressed.ts +130 -0
- package/src/lib/tree-data.ts +42 -2
- package/src/lib/use-pagination.test.ts +105 -0
- package/src/lib/use-pagination.ts +179 -0
- package/src/lib/use-scroll-spy.test.tsx +238 -0
- package/src/lib/use-scroll-spy.ts +336 -0
- package/src/theme.css +39 -3
- package/src/theme.test.ts +29 -1
- package/src/visually-hidden-containment.test.tsx +9 -0
- package/dist/chunk-2W7H43WL.js.map +0 -1
- package/dist/chunk-7E7JNWOC.js.map +0 -1
- package/dist/chunk-7FPSQBWB.js.map +0 -1
- package/dist/chunk-7KFUFAVP.js.map +0 -1
- package/dist/chunk-AKXALCUN.js.map +0 -1
- package/dist/chunk-B5YHYI7E.js.map +0 -1
- package/dist/chunk-FQJNQW3G.js.map +0 -1
- package/dist/chunk-G3AD3NJG.js.map +0 -1
- package/dist/chunk-GEZYGBXY.js.map +0 -1
- package/dist/chunk-HCHGERDB.js.map +0 -1
- package/dist/chunk-HWBFRDX7.js.map +0 -1
- package/dist/chunk-I4B3N3UX.js.map +0 -1
- package/dist/chunk-IA6DCC3N.js.map +0 -1
- package/dist/chunk-IANYMDKH.js.map +0 -1
- package/dist/chunk-MQHD3EJE.js.map +0 -1
- package/dist/chunk-NNPSBC7O.js.map +0 -1
- package/dist/chunk-OXR7BXZA.js.map +0 -1
- package/dist/chunk-QKSLDQM2.js +0 -120
- package/dist/chunk-QKSLDQM2.js.map +0 -1
- package/dist/chunk-QRNQQIQM.js.map +0 -1
- package/dist/chunk-RKCUXOU2.js.map +0 -1
- package/dist/chunk-S5CQRCTF.js +0 -426
- package/dist/chunk-S5CQRCTF.js.map +0 -1
- package/dist/chunk-SBZJGFZ6.js.map +0 -1
- package/dist/chunk-SP6LCCTZ.js.map +0 -1
- package/dist/chunk-TUP7WXQE.js.map +0 -1
- package/dist/chunk-V2QZG4IT.js.map +0 -1
- package/dist/chunk-X6DESK37.js.map +0 -1
- package/dist/chunk-ZB5VMGKB.js.map +0 -1
package/dist/chunk-S5CQRCTF.js
DELETED
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
import { calendarValueToDate, dateToArkValue, fromArkValues, toArkValues } from './chunk-ZB5VMGKB.js';
|
|
2
|
-
import { useTimeZone } from './chunk-OBSZ4NE2.js';
|
|
3
|
-
import { ActionIcon } from './chunk-B5YHYI7E.js';
|
|
4
|
-
import { warnRenamedProp } from './chunk-PQZSTI3R.js';
|
|
5
|
-
import { useIsomorphicLayoutEffect } from './chunk-BUIHQJGE.js';
|
|
6
|
-
import { ChevronRightIcon, ChevronLeftIcon } from './chunk-6YNLRQ25.js';
|
|
7
|
-
import { mergeIcons } from './chunk-XXOR34T4.js';
|
|
8
|
-
import { props } from './chunk-WYCMIIRR.js';
|
|
9
|
-
import { focusStyles } from './chunk-C6NVU4F7.js';
|
|
10
|
-
import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
|
|
11
|
-
import { cn } from './chunk-4ASNIDV7.js';
|
|
12
|
-
import { DatePicker, useDatePickerContext } from '@ark-ui/react/date-picker';
|
|
13
|
-
import { useLocaleContext } from '@ark-ui/react/locale';
|
|
14
|
-
import { useRef } from 'react';
|
|
15
|
-
import { cva } from 'class-variance-authority';
|
|
16
|
-
import { match } from 'ts-pattern';
|
|
17
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
18
|
-
import { today, isSameDay } from '@internationalized/date';
|
|
19
|
-
|
|
20
|
-
var DEFAULT_ICONS = {
|
|
21
|
-
prev: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rtl:-scale-x-100" }),
|
|
22
|
-
next: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rtl:-scale-x-100" })
|
|
23
|
-
};
|
|
24
|
-
var dayCellTrigger = cva(
|
|
25
|
-
[
|
|
26
|
-
"relative flex size-full items-center justify-center rounded-xs",
|
|
27
|
-
"cursor-pointer select-none tabular-nums transition-colors-radius",
|
|
28
|
-
"hover:bg-brand-950/20 dark:hover:bg-white/20",
|
|
29
|
-
"focus-visible:z-10",
|
|
30
|
-
focusStyles({ offset: false }),
|
|
31
|
-
"data-today:font-semibold data-today:text-brand-500",
|
|
32
|
-
// `!` (important) on bg/text: a day can be `data-today` *and* `data-selected` at once (e.g.
|
|
33
|
-
// the default `new Date()` value), or a range endpoint is simultaneously `data-selected` *and*
|
|
34
|
-
// `data-in-range` (the closed interval includes its own ends) — without `!`, these rules fight
|
|
35
|
-
// over the same `background-color`/`color` and Tailwind's variant ordering (not this class
|
|
36
|
-
// list's order) can win the wrong one, e.g. leaving the selected cell's text the same color
|
|
37
|
-
// as its own solid-fill background, invisible. `data-selected` — the solid highlight — always
|
|
38
|
-
// wins over both.
|
|
39
|
-
"data-selected:bg-brand-950! dark:data-selected:bg-white! data-selected:text-(--c-on-solid)! data-selected:font-semibold data-selected:hover:bg-brand-800! dark:data-selected:hover:bg-white/80!",
|
|
40
|
-
"data-in-range:rounded-none data-in-range:bg-brand-950/10 dark:data-in-range:bg-white/10",
|
|
41
|
-
// Pill-cap rounding, split into two independently-true conditions rather than reacting to
|
|
42
|
-
// `data-range-start`/`data-range-end` alone: a lone click (before any second day exists)
|
|
43
|
-
// still carries `data-range-start`, and capping on that alone made the first pick look like
|
|
44
|
-
// an already-established range extending rightward.
|
|
45
|
-
//
|
|
46
|
-
// 1. A genuinely *committed* range exists — `data-range-committed` is set from
|
|
47
|
-
// `api.value.length === 2` in JS, not from the DOM. An earlier version checked whether the
|
|
48
|
-
// *other* endpoint's `data-range-start`/`data-range-end` was present anywhere among the
|
|
49
|
-
// visible months instead — that broke as soon as only one endpoint's month was in view
|
|
50
|
-
// (e.g. the range was set, then the calendar paged away from one end): the other endpoint
|
|
51
|
-
// was never rendered at all, so its attribute could never be found, and the cap silently
|
|
52
|
-
// stopped applying to the *visible* endpoint too, even though the range was still fully
|
|
53
|
-
// committed. `api.value` reflects the committed selection regardless of what's currently
|
|
54
|
-
// paged into view, so this doesn't have that failure mode.
|
|
55
|
-
// 2. A genuine *live hover preview* toward a different day — self-contained on this cell's
|
|
56
|
-
// own attributes, no group lookup needed: `hoveredRangeValue` is `[start, hoveredValue]`
|
|
57
|
-
// sorted chronologically, so the anchor cell gets exactly one of `data-hover-range-start` /
|
|
58
|
-
// `data-hover-range-end` when truly hovering elsewhere (direction decides which), but
|
|
59
|
-
// *both* simultaneously when the pointer is merely resting on the same cell it just
|
|
60
|
-
// clicked (a zero-width hover range) — requiring the other one be *absent* rules out that
|
|
61
|
-
// degenerate, "changes before you've moved anywhere" case.
|
|
62
|
-
"data-range-start:data-range-committed:rounded-s-xs",
|
|
63
|
-
"data-range-end:data-range-committed:rounded-e-xs",
|
|
64
|
-
"data-hover-range-start:not-data-hover-range-end:rounded-s-xs",
|
|
65
|
-
"data-hover-range-end:not-data-hover-range-start:rounded-e-xs",
|
|
66
|
-
// The degenerate case above (pointer resting on the just-clicked day, `data-hover-range-start`
|
|
67
|
-
// and `data-hover-range-end` both present on this same cell) still falls into `data-in-range`
|
|
68
|
-
// (a zero-width range trivially contains itself), which would otherwise render it
|
|
69
|
-
// `rounded-none` — sharp corners, reading as broken rather than "just this one day, nothing
|
|
70
|
-
// decided yet." Round it fully instead, `!` to beat that `data-in-range:rounded-none`
|
|
71
|
-
// regardless of Tailwind's variant ordering.
|
|
72
|
-
"data-hover-range-start:data-hover-range-end:rounded-xs!",
|
|
73
|
-
"data-outside-range:text-brand-900/40 dark:data-outside-range:text-white/35",
|
|
74
|
-
"data-in-range:data-outside-range:text-brand-900/70 dark:data-in-range:data-outside-range:text-white/50",
|
|
75
|
-
"data-unavailable:pointer-events-none data-unavailable:text-brand-900/20 data-unavailable:line-through dark:data-unavailable:text-white/16",
|
|
76
|
-
"data-disabled:pointer-events-none data-disabled:opacity-40"
|
|
77
|
-
],
|
|
78
|
-
{
|
|
79
|
-
variants: {
|
|
80
|
-
size: {
|
|
81
|
-
xs: "size-7 text-xs",
|
|
82
|
-
sm: "size-8 text-xs",
|
|
83
|
-
md: "size-9 text-sm",
|
|
84
|
-
lg: "size-10 text-base",
|
|
85
|
-
xl: "size-11 text-base"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
defaultVariants: { size: "md" }
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
var DAY_CELL_SIZE = { xs: 28, sm: 32, md: 36, lg: 40, xl: 44 };
|
|
92
|
-
var MONTH_GAP = 24;
|
|
93
|
-
var calendarGridWidth = (size, numOfMonths) => DAY_CELL_SIZE[size] * 7 * numOfMonths + MONTH_GAP * (numOfMonths - 1);
|
|
94
|
-
var gridCellTrigger = cva(
|
|
95
|
-
[
|
|
96
|
-
"flex w-full items-center justify-center truncate rounded-sm px-2 py-2.5",
|
|
97
|
-
"cursor-pointer transition-colors",
|
|
98
|
-
"hover:bg-brand-900/6 dark:hover:bg-white/8",
|
|
99
|
-
focusStyles({ offset: false }),
|
|
100
|
-
"data-selected:bg-(--c-solid) data-selected:text-(--c-on-solid) data-selected:hover:bg-(--c-solid-hover)",
|
|
101
|
-
"data-disabled:pointer-events-none data-disabled:opacity-40"
|
|
102
|
-
],
|
|
103
|
-
{
|
|
104
|
-
variants: {
|
|
105
|
-
size: { xs: "text-xs", sm: "text-xs", md: "text-sm", lg: "text-base", xl: "text-base" }
|
|
106
|
-
},
|
|
107
|
-
defaultVariants: { size: "md" }
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
var weekdayHeader = cn("pb-1 text-center text-xs font-medium", TEXT_COLOR_CLASSES.muted);
|
|
111
|
-
var weekNumberCell = cn(
|
|
112
|
-
"p-1 align-top text-center text-xs font-medium h-full",
|
|
113
|
-
TEXT_COLOR_CLASSES.muted
|
|
114
|
-
);
|
|
115
|
-
var navIcon = (icon, size, className) => /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "neutral", size, className, children: icon });
|
|
116
|
-
var NAV_ICON_SIZE = { xs: 28, sm: 32, md: 36, lg: 40, xl: 48 };
|
|
117
|
-
var CalendarBody = ({
|
|
118
|
-
numOfMonths = 1,
|
|
119
|
-
withWeekNumbers,
|
|
120
|
-
renderDay,
|
|
121
|
-
size = "md",
|
|
122
|
-
timeZone,
|
|
123
|
-
classNames,
|
|
124
|
-
icons
|
|
125
|
-
}) => /* @__PURE__ */ jsx(DatePicker.Context, { children: (api) => {
|
|
126
|
-
const { prev, next } = mergeIcons(DEFAULT_ICONS, icons);
|
|
127
|
-
const nav = /* @__PURE__ */ jsxs(
|
|
128
|
-
DatePicker.ViewControl,
|
|
129
|
-
{
|
|
130
|
-
className: cn("mb-2 flex items-stretch justify-between gap-1", classNames?.header),
|
|
131
|
-
children: [
|
|
132
|
-
/* @__PURE__ */ jsx(DatePicker.PrevTrigger, { asChild: true, children: navIcon(prev, size) }),
|
|
133
|
-
/* @__PURE__ */ jsx(
|
|
134
|
-
DatePicker.ViewTrigger,
|
|
135
|
-
{
|
|
136
|
-
className: cn(
|
|
137
|
-
"transition-colors",
|
|
138
|
-
"min-w-0 flex-1 cursor-pointer truncate rounded-sm px-2 py-1 text-center text-sm font-medium",
|
|
139
|
-
"hover:bg-brand-900/6 dark:hover:bg-white/8",
|
|
140
|
-
focusStyles({ offset: false }),
|
|
141
|
-
"disabled:pointer-events-none disabled:opacity-50"
|
|
142
|
-
),
|
|
143
|
-
children: api.visibleRange.end.month === api.visibleRange.start.month ? api.visibleRangeText.start : api.visibleRangeText.formatted
|
|
144
|
-
}
|
|
145
|
-
),
|
|
146
|
-
/* @__PURE__ */ jsx(DatePicker.NextTrigger, { asChild: true, children: navIcon(next, size) })
|
|
147
|
-
]
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
const isCommittedRange = api.value.length === 2;
|
|
151
|
-
return match(api.view).with("day", () => /* @__PURE__ */ jsx(DatePicker.View, { view: "day", children: /* @__PURE__ */ jsxs(
|
|
152
|
-
"div",
|
|
153
|
-
{
|
|
154
|
-
className: "grid items-center justify-center",
|
|
155
|
-
style: {
|
|
156
|
-
gridTemplateColumns: `repeat(${numOfMonths}, auto)`,
|
|
157
|
-
columnGap: MONTH_GAP,
|
|
158
|
-
rowGap: 8
|
|
159
|
-
},
|
|
160
|
-
children: [
|
|
161
|
-
/* @__PURE__ */ jsxs(
|
|
162
|
-
"div",
|
|
163
|
-
{
|
|
164
|
-
className: cn("relative", classNames?.header),
|
|
165
|
-
style: {
|
|
166
|
-
gridColumn: `1 / span ${numOfMonths}`,
|
|
167
|
-
gridRow: 1,
|
|
168
|
-
height: NAV_ICON_SIZE[size]
|
|
169
|
-
},
|
|
170
|
-
children: [
|
|
171
|
-
/* @__PURE__ */ jsx(DatePicker.PrevTrigger, { asChild: true, children: navIcon(prev, size, "absolute start-0 top-1/2 z-10 -translate-y-1/2") }),
|
|
172
|
-
/* @__PURE__ */ jsxs(
|
|
173
|
-
DatePicker.ViewTrigger,
|
|
174
|
-
{
|
|
175
|
-
className: cn(
|
|
176
|
-
"group relative grid size-full cursor-pointer items-center rounded-sm text-sm font-medium transition-colors",
|
|
177
|
-
focusStyles({ offset: false }),
|
|
178
|
-
"disabled:pointer-events-none disabled:opacity-50"
|
|
179
|
-
),
|
|
180
|
-
style: {
|
|
181
|
-
gridTemplateColumns: `repeat(${numOfMonths}, 1fr)`,
|
|
182
|
-
columnGap: MONTH_GAP
|
|
183
|
-
},
|
|
184
|
-
children: [
|
|
185
|
-
/* @__PURE__ */ jsx(
|
|
186
|
-
"span",
|
|
187
|
-
{
|
|
188
|
-
"aria-hidden": true,
|
|
189
|
-
className: "pointer-events-none absolute inset-y-0 rounded-sm transition-colors group-hover:bg-brand-900/6 dark:group-hover:bg-white/8",
|
|
190
|
-
style: {
|
|
191
|
-
insetInlineStart: NAV_ICON_SIZE[size],
|
|
192
|
-
insetInlineEnd: NAV_ICON_SIZE[size]
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
),
|
|
196
|
-
Array.from({ length: numOfMonths }, (_, monthIndex) => (
|
|
197
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.
|
|
198
|
-
/* @__PURE__ */ jsx("span", { className: "relative min-w-0 truncate text-center", children: api.getOffset({ months: monthIndex }).visibleRangeText.start }, monthIndex)
|
|
199
|
-
))
|
|
200
|
-
]
|
|
201
|
-
}
|
|
202
|
-
),
|
|
203
|
-
/* @__PURE__ */ jsx(DatePicker.NextTrigger, { asChild: true, children: navIcon(next, size, "absolute end-0 top-1/2 z-10 -translate-y-1/2") })
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
),
|
|
207
|
-
Array.from({ length: numOfMonths }, (_, monthIndex) => {
|
|
208
|
-
const offset = api.getOffset({ months: monthIndex });
|
|
209
|
-
return /* @__PURE__ */ jsxs(
|
|
210
|
-
DatePicker.Table,
|
|
211
|
-
{
|
|
212
|
-
style: { gridColumn: monthIndex + 1, gridRow: 2 },
|
|
213
|
-
className: cn("border-separate border-spacing-0", classNames?.table),
|
|
214
|
-
children: [
|
|
215
|
-
/* @__PURE__ */ jsx(DatePicker.TableHead, { children: /* @__PURE__ */ jsxs(DatePicker.TableRow, { children: [
|
|
216
|
-
withWeekNumbers && /* @__PURE__ */ jsx(DatePicker.WeekNumberHeaderCell, { className: weekdayHeader }),
|
|
217
|
-
api.weekDays.map((weekDay) => /* @__PURE__ */ jsx(DatePicker.TableHeader, { className: weekdayHeader, children: weekDay.narrow }, weekDay.long))
|
|
218
|
-
] }) }),
|
|
219
|
-
/* @__PURE__ */ jsx(DatePicker.TableBody, { children: offset.weeks.map((week, weekIndex) => (
|
|
220
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of consecutive weeks, never reordered.
|
|
221
|
-
/* @__PURE__ */ jsxs(DatePicker.TableRow, { children: [
|
|
222
|
-
withWeekNumbers && /* @__PURE__ */ jsx(DatePicker.WeekNumberCell, { weekIndex, week, children: /* @__PURE__ */ jsx("span", { className: weekNumberCell, children: api.getWeekNumber(week) }) }),
|
|
223
|
-
week.map((value) => {
|
|
224
|
-
const cellState = renderDay ? api.getDayTableCellState({
|
|
225
|
-
value,
|
|
226
|
-
visibleRange: offset.visibleRange
|
|
227
|
-
}) : void 0;
|
|
228
|
-
return /* @__PURE__ */ jsx(
|
|
229
|
-
DatePicker.TableCell,
|
|
230
|
-
{
|
|
231
|
-
value,
|
|
232
|
-
visibleRange: offset.visibleRange,
|
|
233
|
-
children: /* @__PURE__ */ jsxs(
|
|
234
|
-
DatePicker.TableCellTrigger,
|
|
235
|
-
{
|
|
236
|
-
...props({ "data-range-committed": isCommittedRange }),
|
|
237
|
-
className: cn(dayCellTrigger({ size }), classNames?.day),
|
|
238
|
-
children: [
|
|
239
|
-
value.day,
|
|
240
|
-
cellState && renderDay?.(calendarValueToDate(value, timeZone), {
|
|
241
|
-
isUnavailable: cellState.unavailable,
|
|
242
|
-
isSelected: cellState.selected
|
|
243
|
-
})
|
|
244
|
-
]
|
|
245
|
-
}
|
|
246
|
-
)
|
|
247
|
-
},
|
|
248
|
-
value.toString()
|
|
249
|
-
);
|
|
250
|
-
})
|
|
251
|
-
] }, weekIndex)
|
|
252
|
-
)) })
|
|
253
|
-
]
|
|
254
|
-
},
|
|
255
|
-
monthIndex
|
|
256
|
-
);
|
|
257
|
-
})
|
|
258
|
-
]
|
|
259
|
-
}
|
|
260
|
-
) })).with("month", () => /* @__PURE__ */ jsxs(DatePicker.View, { view: "month", children: [
|
|
261
|
-
nav,
|
|
262
|
-
/* @__PURE__ */ jsx(
|
|
263
|
-
DatePicker.Table,
|
|
264
|
-
{
|
|
265
|
-
className: cn("mx-auto table-fixed", classNames?.table),
|
|
266
|
-
style: { width: calendarGridWidth(size, numOfMonths) },
|
|
267
|
-
children: /* @__PURE__ */ jsx(DatePicker.TableBody, { children: api.getMonthsGrid({ columns: 4, format: "short" }).map((row, rowIndex) => (
|
|
268
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.
|
|
269
|
-
/* @__PURE__ */ jsx(DatePicker.TableRow, { children: row.map((month) => /* @__PURE__ */ jsx(DatePicker.TableCell, { value: month.value, children: /* @__PURE__ */ jsx(DatePicker.TableCellTrigger, { className: gridCellTrigger({ size }), children: month.label }) }, month.value)) }, rowIndex)
|
|
270
|
-
)) })
|
|
271
|
-
}
|
|
272
|
-
)
|
|
273
|
-
] })).with("year", () => /* @__PURE__ */ jsxs(DatePicker.View, { view: "year", children: [
|
|
274
|
-
nav,
|
|
275
|
-
/* @__PURE__ */ jsx(
|
|
276
|
-
DatePicker.Table,
|
|
277
|
-
{
|
|
278
|
-
columns: 5,
|
|
279
|
-
className: cn("mx-auto table-fixed", classNames?.table),
|
|
280
|
-
style: { width: calendarGridWidth(size, numOfMonths) },
|
|
281
|
-
children: /* @__PURE__ */ jsx(DatePicker.TableBody, { children: api.getYearsGrid({ columns: 5 }).map((row, rowIndex) => (
|
|
282
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.
|
|
283
|
-
/* @__PURE__ */ jsx(DatePicker.TableRow, { children: row.map((year) => /* @__PURE__ */ jsx(DatePicker.TableCell, { value: year.value, children: /* @__PURE__ */ jsx(DatePicker.TableCellTrigger, { className: gridCellTrigger({ size }), children: year.label }) }, year.value)) }, rowIndex)
|
|
284
|
-
)) })
|
|
285
|
-
}
|
|
286
|
-
)
|
|
287
|
-
] })).exhaustive();
|
|
288
|
-
} });
|
|
289
|
-
var hashArkValues = (values) => values.map(String).join(",");
|
|
290
|
-
var CalendarZoneSync = ({
|
|
291
|
-
timeZone,
|
|
292
|
-
controlled,
|
|
293
|
-
pendingRef
|
|
294
|
-
}) => {
|
|
295
|
-
const api = useDatePickerContext();
|
|
296
|
-
const previous = useRef({ timeZone, value: api.value });
|
|
297
|
-
useIsomorphicLayoutEffect(() => {
|
|
298
|
-
const { timeZone: from, value: before } = previous.current;
|
|
299
|
-
previous.current = { timeZone, value: api.value };
|
|
300
|
-
if (from === timeZone) return;
|
|
301
|
-
const after = controlled ? api.value : before.map((value) => dateToArkValue(calendarValueToDate(value, from), timeZone));
|
|
302
|
-
if (!controlled && after.length > 0) {
|
|
303
|
-
pendingRef.current = hashArkValues(after);
|
|
304
|
-
api.setValue(after);
|
|
305
|
-
}
|
|
306
|
-
const anchorBefore = before[0] ?? today(from);
|
|
307
|
-
const focused = api.focusedValue;
|
|
308
|
-
api.setFocusedValue(isSameDay(focused, anchorBefore) ? after[0] ?? today(timeZone) : focused);
|
|
309
|
-
});
|
|
310
|
-
return null;
|
|
311
|
-
};
|
|
312
|
-
var resolveCalendarTranslations = (overrides) => overrides;
|
|
313
|
-
var dayState = (day) => ({
|
|
314
|
-
unavailable: day.isUnavailable,
|
|
315
|
-
selected: day.isSelected,
|
|
316
|
-
get isUnavailable() {
|
|
317
|
-
warnRenamedProp("Calendar renderDay", "isUnavailable", "unavailable");
|
|
318
|
-
return day.isUnavailable;
|
|
319
|
-
},
|
|
320
|
-
get isSelected() {
|
|
321
|
-
warnRenamedProp("Calendar renderDay", "isSelected", "selected");
|
|
322
|
-
return day.isSelected;
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
var Calendar = ({
|
|
326
|
-
range,
|
|
327
|
-
value,
|
|
328
|
-
defaultValue,
|
|
329
|
-
onChange,
|
|
330
|
-
onBlur,
|
|
331
|
-
numOfMonths = 1,
|
|
332
|
-
isDateUnavailable,
|
|
333
|
-
min,
|
|
334
|
-
max,
|
|
335
|
-
minView,
|
|
336
|
-
maxView,
|
|
337
|
-
renderDay,
|
|
338
|
-
fixedWeeks,
|
|
339
|
-
withWeekNumbers,
|
|
340
|
-
locale,
|
|
341
|
-
timeZone,
|
|
342
|
-
translations,
|
|
343
|
-
icons,
|
|
344
|
-
size = "md",
|
|
345
|
-
disabled,
|
|
346
|
-
readOnly,
|
|
347
|
-
required,
|
|
348
|
-
invalid,
|
|
349
|
-
name,
|
|
350
|
-
id,
|
|
351
|
-
ref,
|
|
352
|
-
className,
|
|
353
|
-
classNames,
|
|
354
|
-
testId
|
|
355
|
-
}) => {
|
|
356
|
-
const { locale: contextLocale } = useLocaleContext();
|
|
357
|
-
const resolvedLocale = locale ?? contextLocale;
|
|
358
|
-
const resolvedTimeZone = useTimeZone(timeZone);
|
|
359
|
-
const isRange = Boolean(range);
|
|
360
|
-
const zoneReseed = useRef(null);
|
|
361
|
-
return /* @__PURE__ */ jsxs(
|
|
362
|
-
DatePicker.Root,
|
|
363
|
-
{
|
|
364
|
-
inline: true,
|
|
365
|
-
ref,
|
|
366
|
-
id,
|
|
367
|
-
selectionMode: isRange ? "range" : "single",
|
|
368
|
-
locale: resolvedLocale,
|
|
369
|
-
timeZone: resolvedTimeZone,
|
|
370
|
-
translations: resolveCalendarTranslations(translations),
|
|
371
|
-
value: toArkValues(value, resolvedTimeZone),
|
|
372
|
-
defaultValue: toArkValues(defaultValue, resolvedTimeZone),
|
|
373
|
-
onValueChange: (details) => {
|
|
374
|
-
if (zoneReseed.current === hashArkValues(details.value)) {
|
|
375
|
-
zoneReseed.current = null;
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
onChange?.(
|
|
379
|
-
fromArkValues(details.value, isRange, resolvedTimeZone)
|
|
380
|
-
);
|
|
381
|
-
},
|
|
382
|
-
onBlur,
|
|
383
|
-
numOfMonths,
|
|
384
|
-
fixedWeeks,
|
|
385
|
-
showWeekNumbers: withWeekNumbers,
|
|
386
|
-
isDateUnavailable: isDateUnavailable ? (dateValue) => isDateUnavailable(calendarValueToDate(dateValue, resolvedTimeZone), resolvedTimeZone) : void 0,
|
|
387
|
-
min: min ? dateToArkValue(min, resolvedTimeZone) : void 0,
|
|
388
|
-
max: max ? dateToArkValue(max, resolvedTimeZone) : void 0,
|
|
389
|
-
minView,
|
|
390
|
-
maxView,
|
|
391
|
-
disabled,
|
|
392
|
-
readOnly,
|
|
393
|
-
required,
|
|
394
|
-
invalid,
|
|
395
|
-
name,
|
|
396
|
-
className: cn("inline-flex flex-col", className, classNames?.root),
|
|
397
|
-
...props({ "data-testid": testId }),
|
|
398
|
-
children: [
|
|
399
|
-
/* @__PURE__ */ jsx(
|
|
400
|
-
CalendarZoneSync,
|
|
401
|
-
{
|
|
402
|
-
timeZone: resolvedTimeZone,
|
|
403
|
-
controlled: value !== void 0,
|
|
404
|
-
pendingRef: zoneReseed
|
|
405
|
-
}
|
|
406
|
-
),
|
|
407
|
-
/* @__PURE__ */ jsx(DatePicker.Content, { children: /* @__PURE__ */ jsx(
|
|
408
|
-
CalendarBody,
|
|
409
|
-
{
|
|
410
|
-
numOfMonths,
|
|
411
|
-
withWeekNumbers,
|
|
412
|
-
renderDay: renderDay && ((date, day) => renderDay(date, dayState(day))),
|
|
413
|
-
size,
|
|
414
|
-
timeZone: resolvedTimeZone,
|
|
415
|
-
classNames,
|
|
416
|
-
icons
|
|
417
|
-
}
|
|
418
|
-
) })
|
|
419
|
-
]
|
|
420
|
-
}
|
|
421
|
-
);
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
export { Calendar, CalendarBody, CalendarZoneSync, calendarGridWidth, hashArkValues, resolveCalendarTranslations };
|
|
425
|
-
//# sourceMappingURL=chunk-S5CQRCTF.js.map
|
|
426
|
-
//# sourceMappingURL=chunk-S5CQRCTF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/calendar/calendar-body.tsx","../src/components/calendar/calendar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AK,gBAAgB,CAAA,GAAI,MAAA;AAAA,MACnD,OAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,sBAAA,EAAwB,SAAA,EAAW,YAAY,IAAI,CAAA;AAAA,MAChE,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAanC,QAAA,EAAA;AAAA,wBAAAG,GAAAA;AAAA,UAAC,gBAAA;AAAA,UAAA;AAAA,YACC,QAAA,EAAU,gBAAA;AAAA,YACV,YAAY,KAAA,KAAU,MAAA;AAAA,YACtB,UAAA,EAAY;AAAA;AAAA,SACd;AAAA,wBACAA,GAAAA,CAACH,UAAAA,CAAI,OAAA,EAAJ,EACC,QAAA,kBAAAG,GAAAA;AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YACC,WAAA;AAAA,YACA,eAAA;AAAA,YACA,SAAA,EAAW,cAAc,CAAC,IAAA,EAAM,QAAQ,SAAA,CAAU,IAAA,EAAM,QAAA,CAAS,GAAG,CAAC,CAAA,CAAA;AAAA,YACrE,IAAA;AAAA,YACA,QAAA,EAAU,gBAAA;AAAA,YACV,UAAA;AAAA,YACA;AAAA;AAAA,SACF,EACF;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-S5CQRCTF.js","sourcesContent":["import { DatePicker as Ark } from \"@ark-ui/react/date-picker\"\nimport { cva } from \"class-variance-authority\"\nimport type { ReactNode } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { cn } from \"../../lib/cn\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { ActionIcon } from \"../action-icon/action-icon\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../popover/icons\"\n\n/**\n * CalendarBody — the shared grid module behind both `Calendar` (inline) and, later,\n * `DatePicker` (popover): the RFC §3 \"one implementation, not two\" module. It renders only the\n * grid anatomy (`View` / `ViewControl` / nav triggers / `Table*` / `MonthSelect` / `YearSelect`)\n * — deliberately **not** `Control` / `Content` / `Positioner` / `Trigger` / `ClearTrigger`, the\n * popover-only chrome that belongs to `DatePicker`, not here.\n *\n * Every part below self-connects to the nearest ancestor `Ark.Root` via Ark's own React\n * context, so this module needs no `api` prop threaded in — both `Calendar` and `DatePicker`\n * just mount it as a plain child inside their own differently-configured `Ark.Root`.\n *\n * Not barrel-exported (no export from `calendar/index.ts`) — `DatePicker` reaches it directly\n * via `import { CalendarBody } from \"../calendar/calendar-body\"`, the established cross-folder\n * pattern for a shared internal part (`multi-select.tsx` → `../combobox/combobox`,\n * `drawer.tsx` → `../action-icon/action-icon`).\n */\n\nexport type CalendarBodyClassNames = {\n /** The prev/label/next navigation row. */\n header?: string\n /** Each rendered `<table>` (one per visible month in the day view). */\n table?: string\n /** Each day cell's clickable trigger. */\n day?: string\n}\n\nexport type CalendarIconSlot = \"prev\" | \"next\"\nexport type CalendarIcons = IconMap<CalendarIconSlot>\n\n/** The default icons. The glyphs are physical; prev sits on the inline-start\n * edge, which is the right one under RTL, so both chevrons mirror there to\n * keep pointing outward. A consumer's icon is drawn as given. */\nexport const DEFAULT_ICONS: Record<CalendarIconSlot, ReactNode> = {\n prev: <ChevronLeftIcon className=\"rtl:-scale-x-100\" />,\n next: <ChevronRightIcon className=\"rtl:-scale-x-100\" />,\n}\n\nexport type CalendarBodyProps = {\n /** Months shown side by side in the day view. */\n numOfMonths?: number\n withWeekNumbers?: boolean\n /** Per-day decoration slot (RFC §9's \"event dot\"). Receives a native `Date` — converted from\n * Ark's `DateValue` at the point of the call, via the same `timeZone` the root was configured\n * with — and the day's live selection state. */\n renderDay?: (date: Date, ctx: { isUnavailable: boolean; isSelected: boolean }) => ReactNode\n size?: Size\n /** The time zone the nearest `Ark.Root` was configured with. Required (not read from Ark's\n * own api, which exposes no public `timeZone` getter) so `renderDay`'s Date conversion uses\n * the exact same boundary `Calendar`/`DatePicker` used to build the root's own value —\n * see `lib/date-value.ts`'s module doc on why this one conversion point matters. */\n timeZone: string\n classNames?: CalendarBodyClassNames\n /** Replaces the prev/next icons. Drawn as given, never restroked or mirrored. */\n icons?: CalendarIcons\n}\n\nconst dayCellTrigger = cva(\n [\n \"relative flex size-full items-center justify-center rounded-xs\",\n \"cursor-pointer select-none tabular-nums transition-colors-radius\",\n \"hover:bg-brand-950/20 dark:hover:bg-white/20\",\n \"focus-visible:z-10\",\n focusStyles({ offset: false }),\n \"data-today:font-semibold data-today:text-brand-500\",\n // `!` (important) on bg/text: a day can be `data-today` *and* `data-selected` at once (e.g.\n // the default `new Date()` value), or a range endpoint is simultaneously `data-selected` *and*\n // `data-in-range` (the closed interval includes its own ends) — without `!`, these rules fight\n // over the same `background-color`/`color` and Tailwind's variant ordering (not this class\n // list's order) can win the wrong one, e.g. leaving the selected cell's text the same color\n // as its own solid-fill background, invisible. `data-selected` — the solid highlight — always\n // wins over both.\n \"data-selected:bg-brand-950! dark:data-selected:bg-white! data-selected:text-(--c-on-solid)! data-selected:font-semibold data-selected:hover:bg-brand-800! dark:data-selected:hover:bg-white/80!\",\n \"data-in-range:rounded-none data-in-range:bg-brand-950/10 dark:data-in-range:bg-white/10\",\n // Pill-cap rounding, split into two independently-true conditions rather than reacting to\n // `data-range-start`/`data-range-end` alone: a lone click (before any second day exists)\n // still carries `data-range-start`, and capping on that alone made the first pick look like\n // an already-established range extending rightward.\n //\n // 1. A genuinely *committed* range exists — `data-range-committed` is set from\n // `api.value.length === 2` in JS, not from the DOM. An earlier version checked whether the\n // *other* endpoint's `data-range-start`/`data-range-end` was present anywhere among the\n // visible months instead — that broke as soon as only one endpoint's month was in view\n // (e.g. the range was set, then the calendar paged away from one end): the other endpoint\n // was never rendered at all, so its attribute could never be found, and the cap silently\n // stopped applying to the *visible* endpoint too, even though the range was still fully\n // committed. `api.value` reflects the committed selection regardless of what's currently\n // paged into view, so this doesn't have that failure mode.\n // 2. A genuine *live hover preview* toward a different day — self-contained on this cell's\n // own attributes, no group lookup needed: `hoveredRangeValue` is `[start, hoveredValue]`\n // sorted chronologically, so the anchor cell gets exactly one of `data-hover-range-start` /\n // `data-hover-range-end` when truly hovering elsewhere (direction decides which), but\n // *both* simultaneously when the pointer is merely resting on the same cell it just\n // clicked (a zero-width hover range) — requiring the other one be *absent* rules out that\n // degenerate, \"changes before you've moved anywhere\" case.\n \"data-range-start:data-range-committed:rounded-s-xs\",\n \"data-range-end:data-range-committed:rounded-e-xs\",\n \"data-hover-range-start:not-data-hover-range-end:rounded-s-xs\",\n \"data-hover-range-end:not-data-hover-range-start:rounded-e-xs\",\n // The degenerate case above (pointer resting on the just-clicked day, `data-hover-range-start`\n // and `data-hover-range-end` both present on this same cell) still falls into `data-in-range`\n // (a zero-width range trivially contains itself), which would otherwise render it\n // `rounded-none` — sharp corners, reading as broken rather than \"just this one day, nothing\n // decided yet.\" Round it fully instead, `!` to beat that `data-in-range:rounded-none`\n // regardless of Tailwind's variant ordering.\n \"data-hover-range-start:data-hover-range-end:rounded-xs!\",\n \"data-outside-range:text-brand-900/40 dark:data-outside-range:text-white/35\",\n \"data-in-range:data-outside-range:text-brand-900/70 dark:data-in-range:data-outside-range:text-white/50\",\n \"data-unavailable:pointer-events-none data-unavailable:text-brand-900/20 data-unavailable:line-through dark:data-unavailable:text-white/16\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: {\n xs: \"size-7 text-xs\",\n sm: \"size-8 text-xs\",\n md: \"size-9 text-sm\",\n lg: \"size-10 text-base\",\n xl: \"size-11 text-base\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** Day-cell pixel size per `size`, matching `dayCellTrigger`'s `size-*` variants (`size-7`..\n * `size-11`) — the day view's own total width. The month/year grids below are plain `<table>`s\n * that would otherwise size to their own (longer) text content instead, so at `numOfMonths ===\n * 1` a month grid comes out *wider* than the day view (overflowing a fixed-width ancestor, e.g.\n * `DatePicker`'s popover column, which is sized off this same geometry via `calendarGridWidth`)\n * and a year grid comes out *narrower* (leaving unfilled space instead of stretching to match).\n * Pinning both to this exact width — `table-fixed` divides it evenly across columns — keeps\n * every view the same footprint. */\nconst DAY_CELL_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 44 }\n/** Gap between adjacent months in the day view (`gap-6`). */\nconst MONTH_GAP = 24\n\nexport const calendarGridWidth = (size: Size, numOfMonths: number): number =>\n DAY_CELL_SIZE[size] * 7 * numOfMonths + MONTH_GAP * (numOfMonths - 1)\n\nconst gridCellTrigger = cva(\n [\n \"flex w-full items-center justify-center truncate rounded-sm px-2 py-2.5\",\n \"cursor-pointer transition-colors\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"data-selected:bg-(--c-solid) data-selected:text-(--c-on-solid) data-selected:hover:bg-(--c-solid-hover)\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: { xs: \"text-xs\", sm: \"text-xs\", md: \"text-sm\", lg: \"text-base\", xl: \"text-base\" },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst weekdayHeader = cn(\"pb-1 text-center text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\n\nconst weekNumberCell = cn(\n \"p-1 align-top text-center text-xs font-medium h-full\",\n TEXT_COLOR_CLASSES.muted,\n)\n\n/** A prev/next trigger, as the single element Ark's trigger clones under\n * `asChild`. It sizes the icon (through `ActionIcon`) but never strokes or\n * mirrors it. */\nconst navIcon = (icon: ReactNode, size: Size | undefined, className?: string) => (\n <ActionIcon variant=\"subtle\" color=\"neutral\" size={size} className={className}>\n {icon}\n </ActionIcon>\n)\n\n/** `ActionIcon`'s own rendered height per `size` (its `h-7`..`h-12` variants) — the day view's\n * nav row is pinned to this so the prev/next icons and the view-trigger control are the same\n * height, instead of the icons (overlaid on the control, see below) poking out top and bottom of\n * a shorter, text-sized row. */\nconst NAV_ICON_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 48 }\n\nexport const CalendarBody = ({\n numOfMonths = 1,\n withWeekNumbers,\n renderDay,\n size = \"md\",\n timeZone,\n classNames,\n icons,\n}: CalendarBodyProps) => (\n <Ark.Context>\n {(api) => {\n const { prev, next } = mergeIcons(DEFAULT_ICONS, icons)\n const nav = (\n <Ark.ViewControl\n className={cn(\"mb-2 flex items-stretch justify-between gap-1\", classNames?.header)}\n >\n <Ark.PrevTrigger asChild>{navIcon(prev, size)}</Ark.PrevTrigger>\n <Ark.ViewTrigger\n className={cn(\n \"transition-colors\",\n \"min-w-0 flex-1 cursor-pointer truncate rounded-sm px-2 py-1 text-center text-sm font-medium\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n >\n {api.visibleRange.end.month === api.visibleRange.start.month\n ? api.visibleRangeText.start\n : api.visibleRangeText.formatted}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>{navIcon(next, size)}</Ark.NextTrigger>\n </Ark.ViewControl>\n )\n\n // A real, two-endpoint committed range — read off the machine's own value, not the DOM, so\n // it stays true regardless of whether either endpoint's month is currently paged into view\n // (see the pill-cap rounding comment in `dayCellTrigger` above).\n const isCommittedRange = api.value.length === 2\n\n return match(api.view)\n .with(\"day\", () => (\n <Ark.View view=\"day\">\n <div\n className=\"grid items-center justify-center\"\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, auto)`,\n columnGap: MONTH_GAP,\n rowGap: 8,\n }}\n >\n {/* The prev/next icons are overlaid on the control (`absolute`), not given their\n * own grid columns — this row's total width must stay exactly the width of the\n * day tables below (the columns this grid actually has), because `DatePicker`\n * sizes its popover to that exact figure (`calendarGridWidth`, `date-picker.tsx`).\n * Extra icon columns would push this row wider than that budget and force the\n * popover to scroll. */}\n <div\n className={cn(\"relative\", classNames?.header)}\n style={{\n gridColumn: `1 / span ${numOfMonths}`,\n gridRow: 1,\n height: NAV_ICON_SIZE[size],\n }}\n >\n <Ark.PrevTrigger asChild>\n {navIcon(prev, size, \"absolute start-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.PrevTrigger>\n {/* One button, not one per month — Ark's month/year view is a single shared grid\n * (confirmed below), so every month's label leads to the exact same destination;\n * splitting it into N `Ark.ViewTrigger`s would only duplicate the same generated\n * `id`/`aria-label` across them. Its own `repeat(numOfMonths, 1fr)` columns land\n * on the exact same boundaries as the day-table columns below (both divide the\n * same total width, with the same gap, into the same number of equal shares —\n * true because every month always renders at the same cell size) — so no width\n * formula is duplicated between this row and the tables, and it degenerates to\n * the `numOfMonths === 1` case for free.\n *\n * The button itself stays full width (so its grid tracks — and hence its click\n * target — line up with the tables below), but its *visible* hover pill is a\n * separate, inset layer (`group-hover`) that stops short of the prev/next icons\n * instead of running the full width underneath them. */}\n <Ark.ViewTrigger\n className={cn(\n \"group relative grid size-full cursor-pointer items-center rounded-sm text-sm font-medium transition-colors\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, 1fr)`,\n columnGap: MONTH_GAP,\n }}\n >\n <span\n aria-hidden\n className=\"pointer-events-none absolute inset-y-0 rounded-sm transition-colors group-hover:bg-brand-900/6 dark:group-hover:bg-white/8\"\n style={{\n insetInlineStart: NAV_ICON_SIZE[size],\n insetInlineEnd: NAV_ICON_SIZE[size],\n }}\n />\n {Array.from({ length: numOfMonths }, (_, monthIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n <span key={monthIndex} className=\"relative min-w-0 truncate text-center\">\n {api.getOffset({ months: monthIndex }).visibleRangeText.start}\n </span>\n ))}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>\n {navIcon(next, size, \"absolute end-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.NextTrigger>\n </div>\n\n {Array.from({ length: numOfMonths }, (_, monthIndex) => {\n const offset = api.getOffset({ months: monthIndex })\n return (\n <Ark.Table\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n key={monthIndex}\n style={{ gridColumn: monthIndex + 1, gridRow: 2 }}\n className={cn(\"border-separate border-spacing-0\", classNames?.table)}\n >\n <Ark.TableHead>\n <Ark.TableRow>\n {withWeekNumbers && <Ark.WeekNumberHeaderCell className={weekdayHeader} />}\n {api.weekDays.map((weekDay) => (\n <Ark.TableHeader key={weekDay.long} className={weekdayHeader}>\n {weekDay.narrow}\n </Ark.TableHeader>\n ))}\n </Ark.TableRow>\n </Ark.TableHead>\n <Ark.TableBody>\n {offset.weeks.map((week, weekIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of consecutive weeks, never reordered.\n <Ark.TableRow key={weekIndex}>\n {withWeekNumbers && (\n <Ark.WeekNumberCell weekIndex={weekIndex} week={week}>\n <span className={weekNumberCell}>{api.getWeekNumber(week)}</span>\n </Ark.WeekNumberCell>\n )}\n {week.map((value) => {\n const cellState = renderDay\n ? api.getDayTableCellState({\n value,\n visibleRange: offset.visibleRange,\n })\n : undefined\n return (\n <Ark.TableCell\n key={value.toString()}\n value={value}\n visibleRange={offset.visibleRange}\n >\n <Ark.TableCellTrigger\n {...props({ \"data-range-committed\": isCommittedRange })}\n className={cn(dayCellTrigger({ size }), classNames?.day)}\n >\n {value.day}\n {cellState &&\n renderDay?.(calendarValueToDate(value, timeZone), {\n isUnavailable: cellState.unavailable,\n isSelected: cellState.selected,\n })}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n )\n })}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n )\n })}\n </div>\n </Ark.View>\n ))\n .with(\"month\", () => (\n <Ark.View view=\"month\">\n {nav}\n <Ark.Table\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {/* \"short\" (e.g. \"Jan\"), not the default \"long\" (\"January\") — the grid's width is\n * pinned to the day view's (see `calendarGridWidth` above), which at a single\n * narrow month can be too tight for full month names across 4 columns. */}\n {api.getMonthsGrid({ columns: 4, format: \"short\" }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((month) => (\n <Ark.TableCell key={month.value} value={month.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {month.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .with(\"year\", () => (\n <Ark.View view=\"year\">\n {nav}\n <Ark.Table\n columns={5}\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {api.getYearsGrid({ columns: 5 }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((year) => (\n <Ark.TableCell key={year.value} value={year.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {year.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .exhaustive()\n }}\n </Ark.Context>\n)\n","\"use client\"\n\nimport { type DateValue, useDatePickerContext } from \"@ark-ui/react/date-picker\"\nimport { isSameDay, today } from \"@internationalized/date\"\nimport { type RefObject, useRef } from \"react\"\nimport { calendarValueToDate, dateToArkValue } from \"../../lib/date-value\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\n\n/** A stable fingerprint of Ark's value array, to recognise one specific `setValue` echo. */\nexport const hashArkValues = (values: DateValue[]): string => values.map(String).join(\",\")\n\n/**\n * The value Ark is about to report back from a zone re-seed, or `null`. The root's\n * `onValueChange` swallows the one change whose hash matches it, because re-expressing the\n * selection in a new zone is not a change the user made.\n */\nexport type ZoneReseedRef = RefObject<string | null>\n\n/**\n * Keeps an Ark `date-picker` machine's selection on the same **instant** when its `timeZone`\n * changes, without remounting it. Renders nothing; mount it inside `Ark.Root`.\n *\n * Ark reads `defaultValue` once, at mount, and from then on holds the selection as a wall-calendar\n * `DateValue`. A grid pick is a plain `CalendarDate` with no zone at all, so on its own a zone\n * change would keep the *day* and silently move the instant the app was handed by `onChange`. The\n * one zone change every SSR app sees is `timeZone=\"auto\"` going from the UTC hydration snapshot\n * to the host zone, and there the uncontrolled `defaultValue` would stay on the UTC day.\n *\n * So, in a layout effect after the render that changed the zone:\n *\n * - **Uncontrolled**: each value is read back as an instant in the *old* zone (what `onChange`\n * reported) and handed to Ark again in the new one, through `api.setValue`. That may land on\n * another calendar day near midnight, which is the point. `pendingRef` marks the echo so the\n * root doesn't report it through `onChange`.\n * - **Controlled**: nothing to do. The root re-derives Ark's `value` from the app's `Date`s in\n * the new zone on every render, which is already the same instant.\n * - **Focus**: the machine's focused day (the keyboard's roving cell, and the month on show)\n * follows its anchor, the selection or else today, when it sat on that anchor before the\n * change. A month the user navigated to stays put. `setFocusedValue` never moves DOM focus.\n *\n * A remount would do all of this too, but it also resets everything the user did since mount: a\n * pick goes back to `defaultValue`, typed text is cleared, and DOM focus drops to `<body>`.\n */\nexport const CalendarZoneSync = ({\n timeZone,\n controlled,\n pendingRef,\n}: {\n timeZone: string\n controlled: boolean\n pendingRef: ZoneReseedRef\n}) => {\n const api = useDatePickerContext()\n const previous = useRef({ timeZone, value: api.value })\n\n // No dependency list on purpose: the previous value has to be the one from the last render,\n // which under a controlled `value` is already the new zone's by the time the zone changes.\n useIsomorphicLayoutEffect(() => {\n const { timeZone: from, value: before } = previous.current\n previous.current = { timeZone, value: api.value }\n if (from === timeZone) return\n\n const after = controlled\n ? api.value\n : before.map((value) => dateToArkValue(calendarValueToDate(value, from), timeZone))\n if (!controlled && after.length > 0) {\n pendingRef.current = hashArkValues(after)\n api.setValue(after)\n }\n\n // `setValue` also moves the focused day onto the new value, so this runs either way: it\n // either confirms that move or puts back a month the user had navigated to.\n const anchorBefore = before[0] ?? today(from)\n const focused = api.focusedValue\n api.setFocusedValue(isSameDay(focused, anchorBefore) ? (after[0] ?? today(timeZone)) : focused)\n })\n\n return null\n}\n","\"use client\"\n\nimport { DatePicker as Ark, type DatePickerDateView as DateView } from \"@ark-ui/react/date-picker\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { type ComponentProps, type ReactNode, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { DatePredicate } from \"../../lib/date-predicates\"\nimport {\n calendarValueToDate,\n type DateRangeValue,\n dateToArkValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { useTimeZone } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { CalendarBody, type CalendarBodyClassNames, type CalendarIcons } from \"./calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"./calendar-zone-sync\"\n\n/**\n * Calendar — the inline month grid (RFC §9, `docs/rfcs/date-picker.md`): Ark's `date-picker`\n * machine rendered `inline` (no trigger/popover), wrapping the shared `CalendarBody` grid that\n * `DatePicker` will later reuse verbatim inside its own popover.\n *\n * - Value is a native `Date | null` (or `{ start, end }` under `range`) — the machine's\n * `DateValue` array contract never leaks out; `lib/date-value.ts` is the one conversion\n * boundary both directions go through.\n * - Controlled/uncontrolled `value` / `defaultValue` / `onChange` go straight to Ark's own\n * machine, which supports both natively — no `useUncontrolled` needed here.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s and are adapted to Ark's\n * `DateValue`-based signature at this boundary; pair with the `lib/date-predicates.ts`\n * helpers (`disablePast()`, `disableWeekends()`, …).\n * - No `label` / `description` / `error` / `FieldShell` wrap — `Calendar` is a bare widget\n * (like `Table`), not a form field. A `DatePicker` popover is where a field wrapper belongs.\n *\n * <Calendar value={date} onChange={setDate} isDateUnavailable={disableWeekends()} />\n */\n\nexport type CalendarClassNames = CalendarBodyClassNames & {\n /** The outermost `Ark.Root` element. */\n root?: string\n}\n\n/** Ark's own `translations` prop type, derived structurally rather than imported by name —\n * `IntlTranslations` lives in `@zag-js/date-picker`, a transitive dependency of the\n * `@ark-ui/react` peer dep, not one this package declares itself. */\ntype ArkTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\n/** The subset `CalendarBody`'s rendered anatomy actually exercises — `trigger`/`clearTrigger`\n * only apply when composed under `DatePicker` (a bare `Calendar` never renders a trigger/clear\n * button; harmless no-op keys there). Unset keys fall back to Ark's own English text. */\nexport type CalendarTranslations = Pick<\n ArkTranslations,\n | \"dayCell\"\n | \"trigger\"\n | \"viewTrigger\"\n | \"prevTrigger\"\n | \"nextTrigger\"\n | \"clearTrigger\"\n | \"content\"\n | \"weekColumnHeader\"\n | \"weekNumberCell\"\n>\n\n/** Passes a partial override straight through to `Ark.Root`. Ark's `translations` prop is\n * itself all-optional (since @ark-ui/react 5.38.2), so unset keys fall back to Ark's own\n * English defaults and this kit no longer keeps a copy of them to merge over. That copy was\n * load-bearing when the prop demanded every key at once; keeping it now would only let a\n * stale duplicate override Ark's upstream fixes — which is exactly what happened to\n * `viewTrigger`, whose day-view label named the wrong target view until Ark corrected it. */\nexport const resolveCalendarTranslations = (\n overrides?: Partial<CalendarTranslations>,\n): ArkTranslations | undefined => overrides\n\n/** What `renderDay` is told about the day it decorates. */\nexport type CalendarDayState = {\n /** The day can't be picked: `isDateUnavailable`, or outside `min`/`max`. */\n unavailable: boolean\n /** The day is selected, or is one end of the selected range. */\n selected: boolean\n /** @deprecated Renamed `unavailable`. Removed in the next minor. */\n isUnavailable: boolean\n /** @deprecated Renamed `selected`. Removed in the next minor. */\n isSelected: boolean\n}\n\n/** Builds `renderDay`'s state; reading a deprecated `is*` key warns once in development. */\nconst dayState = (day: { isUnavailable: boolean; isSelected: boolean }): CalendarDayState => ({\n unavailable: day.isUnavailable,\n selected: day.isSelected,\n get isUnavailable() {\n warnRenamedProp(\"Calendar renderDay\", \"isUnavailable\", \"unavailable\")\n return day.isUnavailable\n },\n get isSelected() {\n warnRenamedProp(\"Calendar renderDay\", \"isSelected\", \"selected\")\n return day.isSelected\n },\n})\n\nexport type CalendarProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n HTMLDivElement\n> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Months shown side by side. Default 1. */\n numOfMonths?: number\n /** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.\n * Called with this component's own resolved `timeZone` as its second argument, so a predicate\n * reads the candidate day in the same zone the grid renders it in. */\n isDateUnavailable?: DatePredicate\n /** Earliest selectable day; earlier days render unavailable and navigation stops there. */\n min?: Date\n /** Latest selectable day; later days render unavailable and navigation stops there. */\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"` for a month-only\n * picker that never drills into individual days). */\n minView?: DateView\n /** The widest view the header's view switch can climb to (`\"day\"`, `\"month\"` or `\"year\"`). */\n maxView?: DateView\n /** Per-day decoration slot — the \"event dot\" (RFC §9). `ctx` says whether the day is\n * `unavailable` or `selected`. */\n renderDay?: (date: Date, ctx: CalendarDayState) => ReactNode\n /** Always render 6 week rows (padding with adjacent-month days) instead of however many the\n * visible month(s) actually span (4–6) — keeps the grid's height constant while navigating\n * between months. */\n fixedWeeks?: boolean\n /** Adds a leading column with each row's week number. */\n withWeekNumbers?: boolean\n /** Overrides the active locale context. Drives month/day names and first-day-of-week. */\n locale?: string\n /** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Schedule` — **not** Ark's\n * own machine default (`\"UTC\"`), which is why the resolved zone is forwarded to `Ark.Root`\n * explicitly rather than only used in this component's own conversions (see\n * `lib/date-value.ts`'s module doc). Accepts `\"auto\"` to follow the host zone. */\n timeZone?: string\n /** Overrides Ark's own built-in aria-label/accessible-name strings (day cells, prev/next, the\n * view-cycling header, week numbers) — English by default. Unlike `locale`, nothing here\n * auto-derives; supply your own translated strings. Partial — unset keys keep Ark's default. */\n translations?: Partial<CalendarTranslations>\n /** Replaces the default icons: `prev`, `next`. The kit's chevrons mirror under RTL; an\n * icon passed here is drawn as given. */\n icons?: CalendarIcons\n /** Cell and text size, off the kit's `xs`–`xl` scale. Default `\"md\"`. */\n size?: Size\n className?: string\n classNames?: CalendarClassNames\n }\n\nexport const Calendar = <Range extends boolean = false>({\n range,\n value,\n defaultValue,\n onChange,\n onBlur,\n numOfMonths = 1,\n isDateUnavailable,\n min,\n max,\n minView,\n maxView,\n renderDay,\n fixedWeeks,\n withWeekNumbers,\n locale,\n timeZone,\n translations,\n icons,\n size = \"md\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n className,\n classNames,\n testId,\n}: CalendarProps<Range>) => {\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = useTimeZone(timeZone)\n const isRange = Boolean(range)\n const zoneReseed = useRef<string | null>(null)\n\n return (\n <Ark.Root\n inline\n ref={ref}\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n value={toArkValues(value, resolvedTimeZone)}\n defaultValue={toArkValues(defaultValue, resolvedTimeZone)}\n onValueChange={(details) => {\n // A zone change re-expresses the selection in the new zone; that echo is not a change.\n if (zoneReseed.current === hashArkValues(details.value)) {\n zoneReseed.current = null\n return\n }\n // The machine's value is a plain DateValue[]; `range` is a runtime flag here, so narrow\n // the result back to the caller's declared shape.\n onChange?.(\n fromArkValues(details.value, isRange, resolvedTimeZone) as Range extends true\n ? DateRangeValue\n : Date | null,\n )\n }}\n onBlur={onBlur}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n // Ark's own prop — its name doesn't follow this kit's `withX` convention, so it stays\n // `showWeekNumbers` even though our public prop is `withWeekNumbers`.\n showWeekNumbers={withWeekNumbers}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(calendarValueToDate(dateValue, resolvedTimeZone), resolvedTimeZone)\n : undefined\n }\n min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}\n minView={minView}\n maxView={maxView}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={invalid}\n name={name}\n className={cn(\"inline-flex flex-col\", className, classNames?.root)}\n {...props({ \"data-testid\": testId })}\n >\n {/* The machine looks up the currently-focused cell by querying inside the `Content` part\n * (`getFocusedCell` scopes its DOM query to `getContentEl`) to call `.focus()` on it after\n * every arrow-key/Home/End/PageUp/PageDown press — even though `inline` never opens a real\n * popover, that lookup still runs, and with no `Content` element in the DOM at all it\n * always finds nothing, so keyboard navigation updates the machine's internal focus state\n * (visible via `data-focus`) but never moves real DOM focus. `inline` implies `open` (the\n * machine treats it as permanently open), so `Content`'s `hidden={!open}` never hides this. */}\n {/* Ark reads `defaultValue` once, at mount, so a zone change (`timeZone=\"auto\"` going from\n * the UTC hydration snapshot to the host zone, or the app's provider changing) would leave\n * the selection on the old zone's day. This re-seeds it on the same instant in place;\n * see `calendar-zone-sync.tsx` for why it isn't a remount. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={value !== undefined}\n pendingRef={zoneReseed}\n />\n <Ark.Content>\n <CalendarBody\n numOfMonths={numOfMonths}\n withWeekNumbers={withWeekNumbers}\n renderDay={renderDay && ((date, day) => renderDay(date, dayState(day)))}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames}\n icons={icons}\n />\n </Ark.Content>\n </Ark.Root>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/number-input/number-input.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;AAuCO,IAAM,iCAAA,GAAoC;AAAA,EAC/C,cAAA,EAAgB,WAAA;AAAA,EAChB,cAAA,EAAgB,WAAA;AAAA,EAChB,iBAAA,EAAmB;AACrB;AAMO,IAAM,aAAA,GAAwD;AAAA,EACnE,SAAA,kBAAW,GAAA,CAAC,SAAA,EAAA,EAAU,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAC7C,SAAA,kBAAW,GAAA,CAAC,WAAA,EAAA,EAAY,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAC/C,KAAA,sBAAQ,SAAA,EAAA,EAAU;AACpB,CAAA;AAkHA,IAAM,cAAA,GAAiB,EAAA;AAAA,EACrB,yGAAA;AAAA,EACA,8FAAA;AAAA,EACA;AACF,CAAA;AAIA,IAAM,UAAA,GAAa,CAAC,KAAA,KAClB,KAAA,KAAU,MAAA,GAAY,SAAY,KAAA,KAAU,IAAA,GAAO,EAAA,GAAK,MAAA,CAAO,KAAK,CAAA;AAGtE,IAAM,SAAA,GAAY,CAAC,GAAA,EAAa,GAAA,EAAa,GAAA,KAAwB;AACnE,EAAA,MAAM,IAAA,GAAO,MAAM,GAAA,GAAM,CAAA;AACzB,EAAA,OAAA,CAAA,CAAW,GAAA,GAAM,GAAA,IAAO,IAAA,GAAQ,IAAA,IAAQ,IAAA,GAAQ,GAAA;AAClD,CAAA;AAQA,IAAM,gBAAA,GAAmB,CAAC,KAAA,EAAwC,GAAA,KAAgB;AAChF,EAAA,IAAI,CAAC,MAAA,CAAO,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA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AAa,CAAC,SAAA;AAAA,sBACd,QAAA,EAAU,YAAY,CAAA,GAAI,EAAA;AAAA,sBAC1B,aAAA,EAAe,CAAC,KAAA,KAAU,KAAA,CAAM,cAAA,EAAe;AAAA,sBAC/C,OAAA,EAAS,MAAM,GAAA,CAAI,UAAA,EAAW;AAAA,sBAC9B,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,CAAC,aAAa,WAAW,CAAA;AAAA,sBAE3D,QAAA,EAAA,KAAA,CAAM;AAAA;AAAA,mBACT;AAAA,kBAED,CAAC,YAAA,oBACA,IAAA,CAACA,aAAA,CAAI,OAAA,EAAJ,EAAY,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,UAAA,EAAY,OAAO,CAAA,EAGnE,QAAA,EAAA;AAAA,oCAAA,GAAA,CAACA,cAAI,gBAAA,EAAJ,EAAqB,SAAA,EAAW,cAAA,EAC9B,gBAAM,SAAA,EACT,CAAA;AAAA,wCACCA,aAAA,CAAI,gBAAA,EAAJ,EAAqB,SAAA,EAAW,cAAA,EAC9B,gBAAM,SAAA,EACT;AAAA,mBAAA,EACF;AAAA;AAAA;AAAA,aAEJ;AAAA,UAEJ,CAAA,EACF;AAAA;AAAA;AACF;AAAA,GACF;AAEJ","file":"chunk-SBZJGFZ6.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { NumberInput as Ark, useNumberInputContext } from \"@ark-ui/react/number-input\"\nimport { ChevronDown, ChevronUp } from \"lucide-react\"\nimport {\n type ComponentProps,\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n useRef,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n InputBase,\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputSlot,\n} from \"../input/input\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { popoverClearTrigger } from \"../popover/popover\"\n\n/** Ark's own NumberInput `translations` type (`incrementLabel`, `decrementLabel`, and\n * `valueText` for `aria-valuetext`), derived structurally rather than imported from\n * `@zag-js/number-input`, plus the combobox family's `clearTriggerLabel` for the kit's own\n * clear button. */\nexport type NumberInputTranslations = NonNullable<\n ComponentProps<typeof Ark.Root>[\"translations\"]\n> & {\n clearTriggerLabel?: string\n}\n\nexport const NUMBER_INPUT_DEFAULT_TRANSLATIONS = {\n incrementLabel: \"Increment\",\n decrementLabel: \"Decrement\",\n clearTriggerLabel: \"Clear value\",\n} as const satisfies NumberInputTranslations\n\nexport type NumberInputIconSlot = \"increment\" | \"decrement\" | \"clear\"\nexport type NumberInputIcons = IconMap<NumberInputIconSlot>\n\n/** The default icons: the steppers' chevrons and the clear button's ×. */\nexport const DEFAULT_ICONS: Record<NumberInputIconSlot, ReactNode> = {\n increment: <ChevronUp className={iconStroke} />,\n decrement: <ChevronDown className={iconStroke} />,\n clear: <CloseIcon />,\n}\n\n/**\n * NumberInput — a numeric `<input>` with increment / decrement steppers on Ark\n * UI's NumberInput machine. It lives on the same shell as [`Input`](/docs/input)\n * (border, focus ring, slots, invalid / disabled states) and adds spin buttons,\n * clamping, locale-aware formatting, and the full keyboard / wheel model.\n *\n * - Value is a real `number` here (or `null` for empty): the machine speaks\n * strings internally, but `value` / `defaultValue` take a `number | null`\n * and `onChange` hands one back — `null` whenever the field has no valid\n * number (empty, or mid-edit on a partial token).\n * - Like the rest of the family it carries its own `label` / `description` /\n * `error` / `required` via [`Field`](/docs/field); `error` flips the red\n * state, or set `invalid` directly.\n * - `hideControls` drops the steppers for a plain numeric field.\n * - `clearable` adds a clear (×) button once there's a value, resetting to\n * `null` — the numeric analogue of `Select`'s `clearable`.\n *\n * Palette rides on `data-color`, matching the family — but the shell's focus\n * halo is a fixed `brand-500`, so nothing here actually tints today.\n */\n\ntype NumberInputClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it (pair with `suffix` for a unit hint in its place). */\n label?: string\n /** The shell `<div>` (also targeted by `className`). */\n root?: string\n /** The inner `<input>` element. */\n input?: string\n /** The stepper column wrapping the increment / decrement triggers. */\n control?: string\n}\n\nexport type NumberInputProps = Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Controlled value; `null` for empty. */\n value?: number | null\n /** Uncontrolled initial value; `null` for empty. */\n defaultValue?: number | null\n /** Fires with the next numeric value, or `null` when the field has no valid number. */\n onChange?: (value: number | null) => void\n /** Minimum value. */\n min?: number\n /** Maximum value. */\n max?: number\n /** Increment / decrement step. */\n step?: number\n /** Placeholder shown while the field is empty. */\n placeholder?: string\n /** Options forwarded to `Intl.NumberFormat` for display (currency, percent, …). */\n formatOptions?: Intl.NumberFormatOptions\n /** Allow the mouse wheel to change the value while focused. */\n allowMouseWheel?: boolean\n /** Clamp the value into `[min, max]` when the input blurs. */\n clampValueOnBlur?: boolean\n /** Wrap past `min` / `max` instead of clamping (23 → 0, 0 → 59, …) — for\n * cyclical fields like hours/minutes. Requires both `min` and `max`, and\n * the field to be used controlled: the wrapped value round-trips back in\n * as `value` on the next render to correct the display.\n *\n * Only *stepping* wraps (arrow keys, steppers, wheel). Typing behaves like\n * a clock segment instead: a digit that would overflow `max` (or its digit\n * count) replaces the whole field rather than being inserted, so `10` + a\n * `2` typed at the start reads `2`, not `210`. A typed value still out of\n * range (a partial `0` in a 1–12 field, a paste) isn't reported until it\n * is either completed or clamped into range on blur. */\n wrap?: boolean\n /** Hide the increment / decrement steppers for a plain numeric field. */\n hideControls?: boolean\n /** Show a clear button once there's a value, resetting to `null`. */\n clearable?: boolean\n /** Field name for native form submission. */\n name?: string\n /** Red invalid state; OR'd with `error`. */\n invalid?: boolean\n /** Dims the shell and disables the input. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n variant?: InputVariant\n size?: InputSize\n /** Inline-start adornment (icon, prefix). */\n startSlot?: ReactNode\n /** Non-interactive unit hint (e.g. `\"h\"`, `\"%\"`) rendered right after the\n * value, before the clear button / steppers — `aria-hidden` and\n * non-selectable, never part of the editable value. Distinct from a\n * generic end adornment: `InputBase`'s `endSlot` renders after *all*\n * content (i.e. after the steppers here), which would sit away from the\n * digits instead of glued to them. */\n suffix?: ReactNode\n /** Explicit id for label association. */\n id?: string\n /** Lands on the `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n className?: string\n classNames?: NumberInputClassNames\n /** Overrides the steppers' (`incrementLabel`, `decrementLabel`, default `\"Increment\"` /\n * `\"Decrement\"`) and the clear button's (`clearTriggerLabel`, default `\"Clear value\"`)\n * accessible names, and sets `valueText` (the input's `aria-valuetext`). A partial override\n * keeps the other defaults. */\n translations?: NumberInputTranslations\n /** Replaces the default icons: `increment`, `decrement`, `clear`. A missing key keeps its\n * default. */\n icons?: NumberInputIcons\n }\n\n/** The increment / decrement steppers — one class list for both, so they share one disabled\n * treatment. */\nconst stepperTrigger = cn(\n \"inline-flex h-1/2 w-6 shrink-0 cursor-pointer items-center justify-center rounded-xxs transition-colors\",\n \"[&:hover:not([data-disabled])]:bg-brand-900/6 dark:[&:hover:not([data-disabled])]:bg-white/8\",\n \"data-disabled:cursor-not-allowed data-disabled:text-brand-900/40 dark:data-disabled:text-white/35\",\n)\n\n/** Bridge the kit's `number | null` value to the machine's string contract:\n * `undefined` stays uncontrolled, `null` is a controlled empty field. */\nconst toArkValue = (value: number | null | undefined): string | undefined =>\n value === undefined ? undefined : value === null ? \"\" : String(value)\n\n/** Wrap `raw` into `[min, max]` (inclusive), e.g. `wrapValue(24, 0, 23) === 0`. */\nconst wrapValue = (raw: number, min: number, max: number): number => {\n const span = max - min + 1\n return ((((raw - min) % span) + span) % span) + min\n}\n\n/** `wrap`'s bounds. */\ntype WrapCycle = { min: number; max: number }\n\n/** Under `wrap`, select the whole field before a digit lands if inserting it at\n * the caret would overflow `max` (by value or digit count) — the browser's own\n * insertion then replaces the field with that digit, like a clock segment. */\nconst selectOnOverflow = (event: KeyboardEvent<HTMLInputElement>, max: number) => {\n if (!/^\\d$/.test(event.key) || event.ctrlKey || event.metaKey || event.altKey) return\n const input = event.currentTarget\n const { value } = input\n const start = input.selectionStart ?? value.length\n const end = input.selectionEnd ?? value.length\n const next = value.slice(0, start) + event.key + value.slice(end)\n if (next.length > String(max).length || Number(next) > max) input.select()\n}\n\n/**\n * The real `<input>`, split out so it reads the `Field` context from *inside*\n * the wrapping `FieldShell` — `NumberInput` itself renders that shell, so\n * calling `useFieldContext()` at its own top level would run too early.\n */\nconst NumberInputField = ({\n ref,\n placeholder,\n onBlur,\n testId,\n className,\n cycle,\n}: {\n ref?: Ref<HTMLInputElement>\n placeholder?: string\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n testId?: string\n className?: string\n cycle?: WrapCycle\n}) => {\n const field = useFieldContext()\n const api = useNumberInputContext()\n if (!cycle) {\n return (\n <Ark.Input\n ref={ref}\n placeholder={placeholder}\n onBlur={onBlur}\n data-testid={testId}\n {...fieldA11yProps(field)}\n className={className}\n />\n )\n }\n return (\n <Ark.Input\n ref={ref}\n placeholder={placeholder}\n onKeyDown={(event) => selectOnOverflow(event, cycle.max)}\n // Home/End jump to Ark's own `min`/`max`, which it never sees under `wrap` — it would land\n // on ±`MAX_SAFE_INTEGER` and wrap to an arbitrary value. Capture runs before Ark's own\n // handler; stopping propagation is what skips it (Ark's `defaultPrevented` bail-out reads\n // the synthetic event's creation-time snapshot, so `preventDefault` alone doesn't).\n onKeyDownCapture={(event) => {\n if (event.key !== \"Home\" && event.key !== \"End\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n event.preventDefault()\n event.stopPropagation()\n api.setValue(event.key === \"Home\" ? cycle.min : cycle.max)\n }}\n onBlur={(event) => {\n // A typed value never wraps, so one left out of range is clamped here instead —\n // Ark's own clamp-on-blur is off under `wrap` (it never sees `min`/`max`).\n const raw = api.valueAsNumber\n if (!Number.isNaN(raw) && (raw < cycle.min || raw > cycle.max)) {\n api.setValue(Math.min(Math.max(raw, cycle.min), cycle.max))\n }\n onBlur?.(event)\n }}\n // Ark only sees `min`/`max` outside `wrap`, so restore the real range here.\n aria-valuemin={cycle.min}\n aria-valuemax={cycle.max}\n data-testid={testId}\n {...fieldA11yProps(field)}\n className={className}\n />\n )\n}\n\nexport const NumberInput = ({\n value,\n defaultValue,\n onChange,\n min,\n max,\n step,\n placeholder,\n formatOptions,\n allowMouseWheel,\n clampValueOnBlur,\n wrap,\n hideControls,\n clearable,\n name,\n invalid,\n disabled,\n readOnly,\n required,\n label,\n description,\n error,\n variant = \"default\",\n size = \"md\",\n startSlot,\n suffix,\n id,\n ref,\n onBlur,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: NumberInputProps) => {\n const resolvedTranslations = { ...NUMBER_INPUT_DEFAULT_TRANSLATIONS, ...translations }\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n // Drive the red state independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n const inputRef = useRef<HTMLInputElement>(null)\n const cycle: WrapCycle | undefined =\n wrap && min !== undefined && max !== undefined ? { min, max } : undefined\n\n const fieldRef = useMergedRefs(inputRef, ref)\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n classNames={{ label: classNames?.label }}\n >\n <Ark.Root\n value={toArkValue(value)}\n defaultValue={toArkValue(defaultValue)}\n onValueChange={\n onChange\n ? (details) => {\n const raw = details.valueAsNumber\n if (Number.isNaN(raw)) {\n onChange(null)\n } else if (cycle) {\n // Only stepping wraps. A typed change is already in the `<input>` when it is\n // reported, while a stepped one (arrows, steppers, wheel) is only written to\n // the DOM on Ark's next frame — so a match means the user typed it. Typed\n // values are reported as-is when in range; an out-of-range one is held until\n // it is completed or clamped on blur (see `NumberInputField`).\n const typed = details.value === inputRef.current?.value\n if (!typed) onChange(wrapValue(raw, cycle.min, cycle.max))\n else if (raw >= cycle.min && raw <= cycle.max) onChange(raw)\n } else {\n onChange(raw)\n }\n }\n : undefined\n }\n // Wrapping fields disable Ark's own clamp so it always reports the true\n // out-of-range stepped value — `wrapValue` above normalizes it instead.\n min={wrap ? undefined : min}\n max={wrap ? undefined : max}\n step={step}\n formatOptions={formatOptions}\n allowMouseWheel={allowMouseWheel}\n clampValueOnBlur={clampValueOnBlur}\n name={name}\n {...props({ invalid: isInvalid, disabled, readOnly, required })}\n ids={id ? { input: id } : undefined}\n translations={resolvedTranslations}\n className={cn(\"w-full\", className)}\n >\n <Ark.Context>\n {(api) => {\n // `canClear` reserves the clear button's layout box (and the\n // shell's end-slot padding) for the whole time the field is\n // clearable, not just while it has a value — otherwise the\n // button mounting/unmounting shifts the input's width. `showClear`\n // only toggles its visibility/interactivity via `invisible`.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && !api.empty\n return (\n <InputBase\n variant={variant}\n size={size}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n startSlot={startSlot}\n // The steppers (and the clear button) are interactive — they must\n // not sit inside the `aria-hidden` end-slot span. Render them as\n // direct children instead, and flag the shell's end padding\n // manually so the layout matches an `endSlot`.\n classNames={{ root: classNames?.root }}\n className=\"pe-0! overflow-clip\"\n {...props({ \"data-with-end-slot\": !hideControls || canClear || suffix != null })}\n >\n {/* The shell's own `gap-*` (`shellGap`) is meant for *slots* — spacing the\n * control away from icons/steppers/clear button — not for the suffix, which is\n * documented (and used, e.g. `TimeRow`'s \"23h\") to sit glued right against the\n * value. Wrapping the two together in their own `gap`-less flex row keeps that\n * glued pairing regardless of `size`, while the shell's real gap still applies\n * between this pair and the next sibling (clear button / steppers). */}\n <div className=\"flex min-w-0 flex-1 items-center\">\n <NumberInputField\n ref={fieldRef}\n placeholder={placeholder}\n onBlur={onBlur}\n testId={testId}\n cycle={cycle}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {suffix != null && (\n <span aria-hidden className={cn(inputSlot, \"select-none\")}>\n {suffix}\n </span>\n )}\n </div>\n {canClear && (\n <button\n type=\"button\"\n aria-label={resolvedTranslations.clearTriggerLabel}\n aria-hidden={!showClear}\n tabIndex={showClear ? 0 : -1}\n onPointerDown={(event) => event.preventDefault()}\n onClick={() => api.clearValue()}\n className={cn(popoverClearTrigger, !showClear && \"invisible\")}\n >\n {icons.clear}\n </button>\n )}\n {!hideControls && (\n <Ark.Control className={cn(\"-my-1 flex flex-col\", classNames?.control)}>\n {/* Ark disables each stepper at its own bound (it only sees `min`/`max`\n * outside `wrap`, so wrapping fields keep both enabled) — controlled or not. */}\n <Ark.IncrementTrigger className={stepperTrigger}>\n {icons.increment}\n </Ark.IncrementTrigger>\n <Ark.DecrementTrigger className={stepperTrigger}>\n {icons.decrement}\n </Ark.DecrementTrigger>\n </Ark.Control>\n )}\n </InputBase>\n )\n }}\n </Ark.Context>\n </Ark.Root>\n </FieldShell>\n )\n}\n"]}
|