@42-central/ui-react 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-X6DESK37.js → chunk-2RRTT4AF.js} +17 -5
- package/dist/chunk-2RRTT4AF.js.map +1 -0
- package/dist/{chunk-TUP7WXQE.js → chunk-322I2RSV.js} +9 -6
- package/dist/chunk-322I2RSV.js.map +1 -0
- package/dist/{chunk-ISX3AM32.js → chunk-37SRSNLJ.js} +4 -4
- package/dist/{chunk-ISX3AM32.js.map → chunk-37SRSNLJ.js.map} +1 -1
- package/dist/{chunk-L5GH7LLD.js → chunk-3MFWUG5O.js} +4 -4
- package/dist/{chunk-L5GH7LLD.js.map → chunk-3MFWUG5O.js.map} +1 -1
- package/dist/{chunk-FQJNQW3G.js → chunk-3XQEOJCE.js} +8 -5
- package/dist/chunk-3XQEOJCE.js.map +1 -0
- package/dist/{chunk-JKFPRQB2.js → chunk-4LSZ5JWF.js} +3 -3
- package/dist/{chunk-JKFPRQB2.js.map → chunk-4LSZ5JWF.js.map} +1 -1
- package/dist/{chunk-V2QZG4IT.js → chunk-5HWFYYHW.js} +27 -9
- package/dist/chunk-5HWFYYHW.js.map +1 -0
- package/dist/{chunk-GEZYGBXY.js → chunk-6MVFCS46.js} +99 -42
- package/dist/chunk-6MVFCS46.js.map +1 -0
- package/dist/{chunk-NNPSBC7O.js → chunk-6WZSUS3U.js} +10 -9
- package/dist/chunk-6WZSUS3U.js.map +1 -0
- package/dist/chunk-6YRGP6PS.js +138 -0
- package/dist/chunk-6YRGP6PS.js.map +1 -0
- package/dist/{chunk-B5YHYI7E.js → chunk-ALANKV5Y.js} +23 -6
- package/dist/chunk-ALANKV5Y.js.map +1 -0
- package/dist/{chunk-IA6DCC3N.js → chunk-AUQPNDE5.js} +23 -13
- package/dist/chunk-AUQPNDE5.js.map +1 -0
- package/dist/{chunk-AKXALCUN.js → chunk-D7SW2E24.js} +4 -4
- package/dist/chunk-D7SW2E24.js.map +1 -0
- package/dist/{chunk-OXR7BXZA.js → chunk-DQIYYDFD.js} +4 -3
- package/dist/chunk-DQIYYDFD.js.map +1 -0
- package/dist/{chunk-HMNXNKDA.js → chunk-FCBYUN6F.js} +4 -4
- package/dist/{chunk-HMNXNKDA.js.map → chunk-FCBYUN6F.js.map} +1 -1
- package/dist/{chunk-2W7H43WL.js → chunk-FED6SJWM.js} +23 -14
- package/dist/chunk-FED6SJWM.js.map +1 -0
- package/dist/{chunk-7E7JNWOC.js → chunk-FEPIHXVI.js} +6 -5
- package/dist/chunk-FEPIHXVI.js.map +1 -0
- package/dist/{chunk-Y57NW6G7.js → chunk-G3YOSG3U.js} +4 -4
- package/dist/{chunk-Y57NW6G7.js.map → chunk-G3YOSG3U.js.map} +1 -1
- package/dist/chunk-GZN5CXMR.js +100 -0
- package/dist/chunk-GZN5CXMR.js.map +1 -0
- package/dist/{chunk-HCHGERDB.js → chunk-HCSZPBWV.js} +17 -115
- package/dist/chunk-HCSZPBWV.js.map +1 -0
- package/dist/{chunk-I4B3N3UX.js → chunk-HTVICHT4.js} +12 -7
- package/dist/chunk-HTVICHT4.js.map +1 -0
- package/dist/chunk-I7TC2C3I.js +163 -0
- package/dist/chunk-I7TC2C3I.js.map +1 -0
- package/dist/{chunk-7FPSQBWB.js → chunk-IBXYLO2J.js} +14 -13
- package/dist/chunk-IBXYLO2J.js.map +1 -0
- package/dist/{chunk-7KFUFAVP.js → chunk-IRYG6B5A.js} +9 -8
- package/dist/chunk-IRYG6B5A.js.map +1 -0
- package/dist/{chunk-2RQLPN4U.js → chunk-JCNEW4WJ.js} +8 -8
- package/dist/{chunk-2RQLPN4U.js.map → chunk-JCNEW4WJ.js.map} +1 -1
- package/dist/{chunk-SP6LCCTZ.js → chunk-KZDMVOL6.js} +35 -8
- package/dist/chunk-KZDMVOL6.js.map +1 -0
- package/dist/chunk-LR5U6TZZ.js +169 -0
- package/dist/chunk-LR5U6TZZ.js.map +1 -0
- package/dist/{chunk-MQHD3EJE.js → chunk-LZHZJWVM.js} +6 -4
- package/dist/chunk-LZHZJWVM.js.map +1 -0
- package/dist/{chunk-5EOMSWNO.js → chunk-MAM2X3MW.js} +5 -5
- package/dist/{chunk-5EOMSWNO.js.map → chunk-MAM2X3MW.js.map} +1 -1
- package/dist/{chunk-FSPS7TVD.js → chunk-MCMS4NMO.js} +5 -5
- package/dist/{chunk-FSPS7TVD.js.map → chunk-MCMS4NMO.js.map} +1 -1
- package/dist/{chunk-ZB5VMGKB.js → chunk-MV5DIE2T.js} +15 -4
- package/dist/chunk-MV5DIE2T.js.map +1 -0
- package/dist/chunk-NDI4HLQE.js +41 -0
- package/dist/chunk-NDI4HLQE.js.map +1 -0
- package/dist/{chunk-B4GNSSHU.js → chunk-NLJEQZQQ.js} +3 -3
- package/dist/{chunk-B4GNSSHU.js.map → chunk-NLJEQZQQ.js.map} +1 -1
- package/dist/{chunk-SBZJGFZ6.js → chunk-QHT4DCXE.js} +8 -7
- package/dist/chunk-QHT4DCXE.js.map +1 -0
- package/dist/{chunk-I4IJOLNA.js → chunk-RMUBCTEF.js} +5 -5
- package/dist/{chunk-I4IJOLNA.js.map → chunk-RMUBCTEF.js.map} +1 -1
- package/dist/{chunk-G3AD3NJG.js → chunk-RNTDM3RP.js} +9 -5
- package/dist/chunk-RNTDM3RP.js.map +1 -0
- package/dist/chunk-RPFN6ETQ.js +509 -0
- package/dist/chunk-RPFN6ETQ.js.map +1 -0
- package/dist/{chunk-HWBFRDX7.js → chunk-SI7C3W5M.js} +28 -9
- package/dist/chunk-SI7C3W5M.js.map +1 -0
- package/dist/chunk-TPOV3OCC.js +234 -0
- package/dist/chunk-TPOV3OCC.js.map +1 -0
- package/dist/{chunk-IANYMDKH.js → chunk-UBQ54W46.js} +4 -4
- package/dist/chunk-UBQ54W46.js.map +1 -0
- package/dist/{chunk-QVOBLRCM.js → chunk-UIKQ4X6W.js} +3 -3
- package/dist/{chunk-QVOBLRCM.js.map → chunk-UIKQ4X6W.js.map} +1 -1
- package/dist/chunk-UOWQH53N.js +70 -0
- package/dist/chunk-UOWQH53N.js.map +1 -0
- package/dist/{chunk-QRNQQIQM.js → chunk-WJUY6YWF.js} +52 -20
- package/dist/chunk-WJUY6YWF.js.map +1 -0
- package/dist/{chunk-3KARNPW4.js → chunk-WKIUMLRT.js} +3 -3
- package/dist/{chunk-3KARNPW4.js.map → chunk-WKIUMLRT.js.map} +1 -1
- package/dist/chunk-X6RB74JN.js +37 -0
- package/dist/chunk-X6RB74JN.js.map +1 -0
- package/dist/chunk-XQ6L2CM5.js +83 -0
- package/dist/chunk-XQ6L2CM5.js.map +1 -0
- package/dist/{chunk-RKCUXOU2.js → chunk-YUVKROMA.js} +44 -7
- package/dist/chunk-YUVKROMA.js.map +1 -0
- package/dist/components/action-icon/action-icon.d.ts +9 -2
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +5 -1
- package/dist/components/alert/index.js +4 -4
- package/dist/components/anchor/anchor.d.ts +45 -0
- package/dist/components/anchor/anchor.d.ts.map +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.d.ts.map +1 -0
- package/dist/components/anchor/index.js +11 -0
- package/dist/components/anchor/index.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +10 -6
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +23 -24
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +15 -9
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/button/button.d.ts +15 -2
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +5 -1
- package/dist/components/button-multi-select/index.js +6 -4
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/button-select-control.d.ts.map +1 -1
- package/dist/components/button-select/button-select.d.ts +2 -2
- package/dist/components/button-select/button-select.d.ts.map +1 -1
- package/dist/components/button-select/index.js +6 -4
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/aliases.d.ts +16 -0
- package/dist/components/calendar/aliases.d.ts.map +1 -0
- package/dist/components/calendar/calendar-body.d.ts +11 -1
- package/dist/components/calendar/calendar-body.d.ts.map +1 -1
- package/dist/components/calendar/calendar.d.ts +8 -4
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/calendar/index.d.ts.map +1 -1
- package/dist/components/calendar/index.js +15 -5
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
- package/dist/components/calendar-heatmap/index.js +85 -73
- package/dist/components/calendar-heatmap/index.js.map +1 -1
- package/dist/components/camera/index.js +16 -14
- package/dist/components/carousel/index.js +3 -3
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/choice-card-group/index.js +2 -2
- package/dist/components/choice-card-group/index.js.map +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +22 -11
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.d.ts +1 -1
- package/dist/components/circular-progress/index.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js +68 -49
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/index.js +7 -3
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code/code.d.ts +10 -0
- package/dist/components/code/code.d.ts.map +1 -1
- package/dist/components/code/index.js +1 -0
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +10 -6
- package/dist/components/code-block/index.js +10 -7
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +5 -3
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +12 -7
- package/dist/components/combobox-list/combobox-list.d.ts +1 -1
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +14 -9
- package/dist/components/compare/index.js +1 -1
- package/dist/components/data-list/data-list.d.ts +96 -0
- package/dist/components/data-list/data-list.d.ts.map +1 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.d.ts.map +1 -0
- package/dist/components/data-list/index.js +147 -0
- package/dist/components/data-list/index.js.map +1 -0
- package/dist/components/data-table/data-table-group.d.ts.map +1 -1
- package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
- package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts +5 -2
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.js +163 -168
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/aliases.d.ts +16 -0
- package/dist/components/date-picker/aliases.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +22 -8
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +34 -28
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/download-button/index.js +6 -2
- package/dist/components/drawer/drawer.d.ts +7 -4
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.js +11 -6
- package/dist/components/empty-state/empty-state.d.ts +57 -0
- package/dist/components/empty-state/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/empty-state/index.d.ts.map +1 -0
- package/dist/components/empty-state/index.js +8 -0
- package/dist/components/empty-state/index.js.map +1 -0
- package/dist/components/field/field.d.ts +20 -0
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/fieldset/fieldset.d.ts +103 -0
- package/dist/components/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/fieldset/index.d.ts.map +1 -0
- package/dist/components/fieldset/index.js +150 -0
- package/dist/components/fieldset/index.js.map +1 -0
- package/dist/components/file-item/index.js +10 -7
- package/dist/components/file-preview/file-preview.d.ts.map +1 -1
- package/dist/components/file-preview/index.js +10 -18
- package/dist/components/file-preview/index.js.map +1 -1
- package/dist/components/file-trigger/index.js +6 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +18 -14
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/gallery/index.js +3 -3
- package/dist/components/geodesic/a11y.d.ts +3 -3
- package/dist/components/geodesic/a11y.d.ts.map +1 -1
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/index.js +10 -3
- package/dist/components/hover-card/index.js.map +1 -1
- package/dist/components/image/index.js +3 -3
- package/dist/components/image-cropper/index.js +9 -6
- package/dist/components/input/index.js +2 -2
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/kbd/index.js +3 -3
- package/dist/components/kbd/kbd.d.ts +4 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/lightbox/index.js +13 -11
- package/dist/components/lightbox/index.js.map +1 -1
- package/dist/components/menu/index.js +9 -5
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/modal/index.js +11 -6
- package/dist/components/modal/modal.d.ts +10 -4
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +13 -9
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +13 -10
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +4 -4
- package/dist/components/nav-link/tanstack.js +4 -4
- package/dist/components/notification/index.js +6 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/number-input/index.js +11 -7
- package/dist/components/number-input/number-input.d.ts +1 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/dialog-parts.d.ts +10 -1
- package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
- package/dist/components/overlays/index.js +13 -8
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +362 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +147 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/password-input/index.js +6 -5
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +1 -1
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/phone-input/index.js +14 -11
- package/dist/components/phone-input/index.js.map +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/photo-capture/index.js +19 -17
- package/dist/components/photo-capture/index.js.map +1 -1
- package/dist/components/pills-input/index.js +4 -4
- package/dist/components/pills-input/pills-input.d.ts +1 -1
- package/dist/components/pills-input/pills-input.d.ts.map +1 -1
- package/dist/components/pin-input/index.js +6 -5
- package/dist/components/pin-input/index.js.map +1 -1
- package/dist/components/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/popover/index.js +7 -2
- package/dist/components/popover/popover.d.ts +41 -16
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.d.ts +1 -1
- package/dist/components/progress/index.d.ts.map +1 -1
- package/dist/components/progress/index.js +4 -1
- package/dist/components/progress/progress.d.ts +22 -14
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/prose/index.d.ts +2 -0
- package/dist/components/prose/index.d.ts.map +1 -0
- package/dist/components/prose/index.js +17 -0
- package/dist/components/prose/index.js.map +1 -0
- package/dist/components/prose/prose.d.ts +49 -0
- package/dist/components/prose/prose.d.ts.map +1 -0
- package/dist/components/prose/styles.css +593 -0
- package/dist/components/radio-group/index.js +9 -3
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/rating/index.js +3 -2
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.js +10 -8
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.d.ts.map +1 -0
- package/dist/components/scroll-area/index.js +10 -0
- package/dist/components/scroll-area/index.js.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +150 -0
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/components/segment-group/index.js +2 -2
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.js +12 -8
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/splitter/index.d.ts.map +1 -0
- package/dist/components/splitter/index.js +373 -0
- package/dist/components/splitter/index.js.map +1 -0
- package/dist/components/splitter/splitter.d.ts +159 -0
- package/dist/components/splitter/splitter.d.ts.map +1 -0
- package/dist/components/spotlight/index.js +23 -22
- package/dist/components/spotlight/index.js.map +1 -1
- package/dist/components/spotlight/spotlight.d.ts.map +1 -1
- package/dist/components/steps/index.d.ts +4 -0
- package/dist/components/steps/index.d.ts.map +1 -0
- package/dist/components/steps/index.js +478 -0
- package/dist/components/steps/index.js.map +1 -0
- package/dist/components/steps/steps-data.d.ts +78 -0
- package/dist/components/steps/steps-data.d.ts.map +1 -0
- package/dist/components/steps/steps.d.ts +183 -0
- package/dist/components/steps/steps.d.ts.map +1 -0
- package/dist/components/switch/index.js +4 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/table-of-contents/index.d.ts +2 -0
- package/dist/components/table-of-contents/index.d.ts.map +1 -0
- package/dist/components/table-of-contents/index.js +471 -0
- package/dist/components/table-of-contents/index.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
- package/dist/components/tags-input/index.js +12 -9
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +1 -1
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +8 -6
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/time-input/index.js +11 -9
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/timeline/index.js +8 -1
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +3 -8
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tour/conditions.d.ts +83 -0
- package/dist/components/tour/conditions.d.ts.map +1 -0
- package/dist/components/tour/create-tours.d.ts +49 -0
- package/dist/components/tour/create-tours.d.ts.map +1 -0
- package/dist/components/tour/index.d.ts +6 -0
- package/dist/components/tour/index.d.ts.map +1 -0
- package/dist/components/tour/index.js +1449 -0
- package/dist/components/tour/index.js.map +1 -0
- package/dist/components/tour/runtime.d.ts +57 -0
- package/dist/components/tour/runtime.d.ts.map +1 -0
- package/dist/components/tour/storage.d.ts +14 -0
- package/dist/components/tour/storage.d.ts.map +1 -0
- package/dist/components/tour/store.d.ts +62 -0
- package/dist/components/tour/store.d.ts.map +1 -0
- package/dist/components/tour/tour.d.ts +77 -0
- package/dist/components/tour/tour.d.ts.map +1 -0
- package/dist/components/tour/types.d.ts +680 -0
- package/dist/components/tour/types.d.ts.map +1 -0
- package/dist/components/tree/index.d.ts +3 -0
- package/dist/components/tree/index.d.ts.map +1 -0
- package/dist/components/tree/index.js +457 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/components/tree/tree-row.d.ts +72 -0
- package/dist/components/tree/tree-row.d.ts.map +1 -0
- package/dist/components/tree/tree.d.ts +193 -0
- package/dist/components/tree/tree.d.ts.map +1 -0
- package/dist/components/tree-multi-select/index.js +31 -54
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +30 -24
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-popover.d.ts +20 -31
- package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +1 -1
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/date-predicates.d.ts +7 -5
- package/dist/lib/date-predicates.d.ts.map +1 -1
- package/dist/lib/date-value.d.ts +20 -0
- package/dist/lib/date-value.d.ts.map +1 -1
- package/dist/lib/floating-arrow.d.ts +53 -0
- package/dist/lib/floating-arrow.d.ts.map +1 -0
- package/dist/lib/focus-return.d.ts +53 -0
- package/dist/lib/focus-return.d.ts.map +1 -0
- package/dist/lib/meter.d.ts +104 -0
- package/dist/lib/meter.d.ts.map +1 -0
- package/dist/lib/overlay-layer.d.ts +26 -8
- package/dist/lib/overlay-layer.d.ts.map +1 -1
- package/dist/lib/pressed.d.ts +92 -0
- package/dist/lib/pressed.d.ts.map +1 -0
- package/dist/lib/tree-data.d.ts +18 -2
- package/dist/lib/tree-data.d.ts.map +1 -1
- package/dist/lib/use-pagination.d.ts +102 -0
- package/dist/lib/use-pagination.d.ts.map +1 -0
- package/dist/lib/use-scroll-spy.d.ts +126 -0
- package/dist/lib/use-scroll-spy.d.ts.map +1 -0
- package/dist/theme.css +39 -3
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +283 -1
- package/src/components/action-icon/action-icon.tsx +34 -4
- package/src/components/anchor/anchor.test.tsx +232 -0
- package/src/components/anchor/anchor.tsx +187 -0
- package/src/components/anchor/index.ts +12 -0
- package/src/components/app-shell/app-shell.test.tsx +15 -7
- package/src/components/app-shell/app-shell.tsx +27 -20
- package/src/components/autocomplete/autocomplete.tsx +11 -3
- package/src/components/button/button-pressed.test.tsx +202 -0
- package/src/components/button/button.tsx +48 -6
- package/src/components/button-select/button-select-control.tsx +2 -2
- package/src/components/button-select/button-select.tsx +22 -2
- package/src/components/calendar/aliases.tsx +28 -0
- package/src/components/calendar/calendar-body.tsx +310 -210
- package/src/components/calendar/calendar.tsx +43 -12
- package/src/components/calendar/index.ts +7 -1
- package/src/components/calendar/month-year-calendar.test.tsx +106 -0
- package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
- package/src/components/checkbox/checkbox.tsx +7 -2
- package/src/components/choice-card-group/choice-card-group.tsx +2 -2
- package/src/components/circular-progress/circular-progress.test.tsx +35 -0
- package/src/components/circular-progress/circular-progress.tsx +116 -59
- package/src/components/circular-progress/index.ts +1 -0
- package/src/components/code/code.test.tsx +16 -0
- package/src/components/code/code.tsx +11 -0
- package/src/components/combobox/combobox.tsx +63 -28
- package/src/components/combobox-list/combobox-list.tsx +11 -3
- package/src/components/data-list/data-list.test.tsx +149 -0
- package/src/components/data-list/data-list.tsx +268 -0
- package/src/components/data-list/index.ts +9 -0
- package/src/components/data-table/data-table-group.test.tsx +16 -0
- package/src/components/data-table/data-table-group.tsx +15 -2
- package/src/components/data-table/data-table-placeholder.tsx +28 -36
- package/src/components/data-table/data-table-stack.tsx +33 -39
- package/src/components/data-table/data-table.test.tsx +31 -0
- package/src/components/data-table/data-table.tsx +41 -42
- package/src/components/date-picker/aliases.tsx +28 -0
- package/src/components/date-picker/date-picker.test.tsx +29 -0
- package/src/components/date-picker/date-picker.tsx +164 -45
- package/src/components/date-picker/index.ts +5 -1
- package/src/components/date-picker/month-year-picker.test.tsx +362 -0
- package/src/components/drawer/drawer.test.tsx +41 -0
- package/src/components/drawer/drawer.tsx +7 -1
- package/src/components/empty-state/empty-state.test.tsx +109 -0
- package/src/components/empty-state/empty-state.tsx +180 -0
- package/src/components/empty-state/index.ts +9 -0
- package/src/components/field/field.tsx +35 -1
- package/src/components/fieldset/fieldset.test.tsx +352 -0
- package/src/components/fieldset/fieldset.tsx +268 -0
- package/src/components/fieldset/index.ts +11 -0
- package/src/components/file-preview/file-preview.test.tsx +2 -1
- package/src/components/file-preview/file-preview.tsx +7 -13
- package/src/components/file-upload/file-upload.tsx +14 -5
- package/src/components/hover-card/hover-card.tsx +5 -1
- package/src/components/input/input.tsx +12 -5
- package/src/components/kbd/kbd.test.tsx +13 -0
- package/src/components/kbd/kbd.tsx +6 -0
- package/src/components/menu/menu.tsx +6 -2
- package/src/components/modal/modal.test.tsx +41 -0
- package/src/components/modal/modal.tsx +17 -9
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
- package/src/components/multi-select/multi-select.tsx +11 -3
- package/src/components/notification/create-notifier.tsx +1 -1
- package/src/components/number-input/number-input.tsx +12 -3
- package/src/components/overlays/dialog-parts.tsx +42 -5
- package/src/components/pagination/index.ts +19 -0
- package/src/components/pagination/pagination.test.tsx +187 -0
- package/src/components/pagination/pagination.tsx +563 -0
- package/src/components/password-input/password-input.tsx +12 -3
- package/src/components/phone-input/phone-input.tsx +12 -3
- package/src/components/pills-input/pills-input.tsx +7 -2
- package/src/components/pin-input/pin-input.tsx +13 -4
- package/src/components/popover/popover.tsx +87 -17
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/progress.test.tsx +102 -0
- package/src/components/progress/progress.tsx +116 -62
- package/src/components/prose/index.ts +1 -0
- package/src/components/prose/prose.test.tsx +90 -0
- package/src/components/prose/prose.tsx +60 -0
- package/src/components/prose/styles.css +593 -0
- package/src/components/radio-group/radio-group.tsx +8 -3
- package/src/components/rating/rating.tsx +5 -2
- package/src/components/scroll-area/index.ts +18 -0
- package/src/components/scroll-area/scroll-area.test.tsx +184 -0
- package/src/components/scroll-area/scroll-area.tsx +448 -0
- package/src/components/segment-group/segment-group.tsx +2 -2
- package/src/components/select/select.tsx +37 -18
- package/src/components/slider/slider.tsx +2 -2
- package/src/components/splitter/index.ts +15 -0
- package/src/components/splitter/splitter.test.tsx +244 -0
- package/src/components/splitter/splitter.tsx +625 -0
- package/src/components/spotlight/spotlight.test.tsx +34 -26
- package/src/components/spotlight/spotlight.tsx +7 -9
- package/src/components/steps/index.ts +21 -0
- package/src/components/steps/steps-data.tsx +179 -0
- package/src/components/steps/steps.test.tsx +235 -0
- package/src/components/steps/steps.tsx +686 -0
- package/src/components/switch/switch.tsx +7 -2
- package/src/components/table-of-contents/index.ts +17 -0
- package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
- package/src/components/table-of-contents/table-of-contents.tsx +708 -0
- package/src/components/tags-input/tags-input.tsx +12 -3
- package/src/components/textarea/textarea.tsx +15 -5
- package/src/components/timeline/timeline.test.tsx +22 -0
- package/src/components/timeline/timeline.tsx +10 -1
- package/src/components/tooltip/tooltip.tsx +8 -17
- package/src/components/tour/conditions.test.ts +527 -0
- package/src/components/tour/conditions.ts +445 -0
- package/src/components/tour/create-tours.tsx +150 -0
- package/src/components/tour/index.ts +86 -0
- package/src/components/tour/runtime.ts +187 -0
- package/src/components/tour/storage.test.ts +68 -0
- package/src/components/tour/storage.ts +44 -0
- package/src/components/tour/store.test.tsx +784 -0
- package/src/components/tour/store.ts +661 -0
- package/src/components/tour/tour.test.tsx +318 -0
- package/src/components/tour/tour.tsx +773 -0
- package/src/components/tour/tour.types.test.ts +185 -0
- package/src/components/tour/types.ts +904 -0
- package/src/components/tree/index.ts +24 -0
- package/src/components/tree/tree-row.tsx +179 -0
- package/src/components/tree/tree.test.tsx +296 -0
- package/src/components/tree/tree.tsx +796 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
- package/src/components/tree-select/tree-popover.tsx +26 -107
- package/src/components/tree-select/tree-select.tsx +24 -16
- package/src/icon-stroke.test.tsx +2 -0
- package/src/index.ts +16 -0
- package/src/lib/date-predicates.test.ts +46 -0
- package/src/lib/date-predicates.ts +44 -24
- package/src/lib/date-value.test.ts +24 -1
- package/src/lib/date-value.ts +42 -1
- package/src/lib/floating-arrow.tsx +73 -0
- package/src/lib/focus-return.test.tsx +143 -0
- package/src/lib/focus-return.ts +106 -0
- package/src/lib/meter.test.ts +40 -0
- package/src/lib/meter.ts +159 -0
- package/src/lib/overlay-layer.test.tsx +47 -1
- package/src/lib/overlay-layer.tsx +65 -8
- package/src/lib/pressed.ts +130 -0
- package/src/lib/tree-data.ts +42 -2
- package/src/lib/use-pagination.test.ts +105 -0
- package/src/lib/use-pagination.ts +179 -0
- package/src/lib/use-scroll-spy.test.tsx +238 -0
- package/src/lib/use-scroll-spy.ts +336 -0
- package/src/theme.css +39 -3
- package/src/theme.test.ts +29 -1
- package/src/visually-hidden-containment.test.tsx +9 -0
- package/dist/chunk-2W7H43WL.js.map +0 -1
- package/dist/chunk-7E7JNWOC.js.map +0 -1
- package/dist/chunk-7FPSQBWB.js.map +0 -1
- package/dist/chunk-7KFUFAVP.js.map +0 -1
- package/dist/chunk-AKXALCUN.js.map +0 -1
- package/dist/chunk-B5YHYI7E.js.map +0 -1
- package/dist/chunk-FQJNQW3G.js.map +0 -1
- package/dist/chunk-G3AD3NJG.js.map +0 -1
- package/dist/chunk-GEZYGBXY.js.map +0 -1
- package/dist/chunk-HCHGERDB.js.map +0 -1
- package/dist/chunk-HWBFRDX7.js.map +0 -1
- package/dist/chunk-I4B3N3UX.js.map +0 -1
- package/dist/chunk-IA6DCC3N.js.map +0 -1
- package/dist/chunk-IANYMDKH.js.map +0 -1
- package/dist/chunk-MQHD3EJE.js.map +0 -1
- package/dist/chunk-NNPSBC7O.js.map +0 -1
- package/dist/chunk-OXR7BXZA.js.map +0 -1
- package/dist/chunk-QKSLDQM2.js +0 -120
- package/dist/chunk-QKSLDQM2.js.map +0 -1
- package/dist/chunk-QRNQQIQM.js.map +0 -1
- package/dist/chunk-RKCUXOU2.js.map +0 -1
- package/dist/chunk-S5CQRCTF.js +0 -426
- package/dist/chunk-S5CQRCTF.js.map +0 -1
- package/dist/chunk-SBZJGFZ6.js.map +0 -1
- package/dist/chunk-SP6LCCTZ.js.map +0 -1
- package/dist/chunk-TUP7WXQE.js.map +0 -1
- package/dist/chunk-V2QZG4IT.js.map +0 -1
- package/dist/chunk-X6DESK37.js.map +0 -1
- package/dist/chunk-ZB5VMGKB.js.map +0 -1
|
@@ -16,6 +16,7 @@ import { RadioGroup } from "./components/radio-group"
|
|
|
16
16
|
import { SegmentGroup } from "./components/segment-group"
|
|
17
17
|
import { Select } from "./components/select"
|
|
18
18
|
import { Spinner } from "./components/spinner"
|
|
19
|
+
import { Steps } from "./components/steps"
|
|
19
20
|
import { Switch } from "./components/switch"
|
|
20
21
|
import { TextInput } from "./components/text-input"
|
|
21
22
|
import { TimeInput } from "./components/time-input"
|
|
@@ -113,6 +114,14 @@ const cases: [string, ReactElement][] = [
|
|
|
113
114
|
],
|
|
114
115
|
["Kbd, a hotkey's named symbol caps", <Kbd key="" hotkey="shift+mod+enter" />],
|
|
115
116
|
["Spinner, labelled", <Spinner key="" />],
|
|
117
|
+
[
|
|
118
|
+
"Steps, state words and the announcer",
|
|
119
|
+
<Steps
|
|
120
|
+
key=""
|
|
121
|
+
defaultStep={1}
|
|
122
|
+
data={[{ title: "a" }, { title: "b", error: true }, { title: "c" }]}
|
|
123
|
+
/>,
|
|
124
|
+
],
|
|
116
125
|
[
|
|
117
126
|
"Timeline, progress state text",
|
|
118
127
|
<Timeline key="" active={1}>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/tooltip/tooltip.tsx"],"names":["ArkTooltip"],"mappings":";;;;;;;;;;;;;;AAqDA,IAAM,cAAA,GAAiB,EAAA;AAAA,EACrB,oCAAA;AAAA,EACA,yCAAA;AAAA,EACA,2DAAA;AAAA,EACA,8EAAA;AAAA,EACA,yEAAA;AAAA,EACA;AACF,CAAA;AAWA,IAAM,iBAAA,GAAoB,sBAAA;AAK1B,IAAM,YAAA,GAAe,EAAA,CAAG,mBAAA,EAAqB,8BAA8B,CAAA;AAO3E,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB;AAAA,IACE,gEAAA;AAAA,IACA,wCAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,EAAA,CAAG,gDAAA,EAAkD,kBAAA,CAAmB,OAAO,CAAA;AAAA,QACrF,MAAA,EAAQ;AAAA;AACV,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ,CAAA;AAYA,IAAM,cAAA,GAAiB,aAAA,CAAmC,EAAE,YAAA,EAAc,MAAM,CAAA;AAkBhF,IAAM,OAAO,CAAC;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,MAAA;AAAA,EACA,YAAA,GAAe,IAAA;AAAA,EACf,SAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAwB;AACtB,EAAA,MAAM,EAAE,GAAA,EAAI,GAAI,gBAAA,EAAiB;AACjC,EAAA,uBACE,GAAA,CAAC,eAAe,QAAA,EAAf,EAAwB,OAAO,EAAE,YAAA,EAAc,WAAU,EAIxD,QAAA,kBAAA,GAAA;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AM,SAAA,EAAW,UAAA,EAAY,KAAA,EAAO,CAAA;AAAA,MAClD;AAAA,KAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ,CAAA;AAEO,IAAM,OAAA,GAAU,MAAA,CAAO,MAAA,CAAO,gBAAA,EAAkB;AAAA,EACrD,IAAA;AAAA,EACA,SAASA,SAAA,CAAW,OAAA;AAAA,EACpB,OAAA;AAAA,EACA;AACF,CAAC","file":"chunk-2W7H43WL.js","sourcesContent":["\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { Tooltip as ArkTooltip } from \"@ark-ui/react/tooltip\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, type ReactNode, useContext } from \"react\"\nimport { match } from \"ts-pattern\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { type LogicalPosition, resolveLogicalPlacement } from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * Tooltip — the kit's hover/focus **hint**, a styled layer over Ark UI's\n * Tooltip. It's the lightweight counterpart to `Popover` (which is a clickable,\n * focus-trapping panel): Ark's Tooltip machine opens on hover *and* keyboard\n * focus, wires `role=\"tooltip\"` + `aria-describedby` automatically, dismisses on\n * `Esc` / scroll / pointer-down, and never traps focus.\n *\n * Two ways to use it — the convenience form drops into running text or wraps any\n * element; the compound parts mirror `Popover.Root` / `Trigger` / `Content`.\n *\n * // 1. Inline — `children` become a focusable inline trigger\n * <Tooltip label=\"A project at 42.\">norm</Tooltip>\n *\n * // 2. Wrap an element — `asChild` makes the child the trigger\n * <Tooltip label=\"Delete\" asChild>\n * <ActionIcon aria-label=\"Delete\"><Trash /></ActionIcon>\n * </Tooltip>\n *\n * // 3. Compound\n * <Tooltip.Root position=\"end\">\n * <Tooltip.Trigger asChild><Button>Hover</Button></Tooltip.Trigger>\n * <Tooltip.Content>\n * <Tooltip.Arrow />\n * Rich <strong>content</strong>\n * </Tooltip.Content>\n * </Tooltip.Root>\n *\n * Visually it reuses the Popover's open/close animation but renders as a small,\n * **inverted** bubble (dark surface in light mode, light in dark) to read as an\n * ephemeral hint rather than a panel. Add `withArrow` (convenience form) or a\n * `Tooltip.Arrow` part (compound) to point the bubble at its trigger.\n */\n\n/** Inverted compact bubble — reuses the shared `popover-in/out` animation tokens\n * (which already honour reduced-motion in `theme.css`) and the placement-origin\n * trick so it grows out of the trigger's edge. */\nconst tooltipContent = cn(\n \"max-w-[16rem] rounded-xs px-2 py-1\",\n \"text-xs leading-snug focus:outline-none\",\n \"bg-brand-950 text-white dark:bg-white dark:text-brand-950\",\n \"data-[state=open]:animate-popover-in data-[state=closed]:animate-popover-out\",\n \"data-[placement^=top]:origin-bottom data-[placement^=bottom]:origin-top\",\n \"data-[placement^=left]:origin-right data-[placement^=right]:origin-left\",\n)\n\n/** The bubble's shadow lives on the *positioner* (this wrapper), not on the\n * content. A `box-shadow` on the content paints as one unit *with* its\n * background, so it lands on top of the behind-arrow (`-z-1`) and smears\n * across the protruding tip. Hosting the shadow here reorders the paint to\n * shadow → arrow → content: the positioner's shadow sits at the back of its\n * stacking context (it's the `isolate` root), the arrow paints above it, and\n * the content background paints last — so the shadow never touches the arrow,\n * the arrow never covers the label, and the bubble keeps its shadow.\n * `rounded-xs` matches the content radius so the shadow's corners line up. */\nconst tooltipPositioner = \"rounded-xs shadow-md\"\n\n/** Inverted arrow matching the bubble surface. The `!` overrides are required\n * because Ark sets the arrow background via an inline style; `-z-1` tucks the\n * square behind the bubble so only the rotated corner pokes out as the tip. */\nconst tooltipArrow = cn(\"-z-1! rounded-xxs\", \"bg-brand-950! dark:bg-white!\")\n\n/** Resets the `<button type=\"button\">` the default trigger renders down to plain\n * inline text, so a Tooltip can sit on a word inside a `<p>` (a `<button>` is\n * phrasing content) while staying a real, keyboard-focusable control rather\n * than a role-less `tabIndex` span. `cursor-help` signals the hint;\n * `[font:inherit]` and `text-start` undo the UA button's font and centring. */\nconst tooltipTrigger = cva(\n [\n \"inline cursor-help appearance-none border-0 bg-transparent p-0\",\n \"[font:inherit] text-inherit text-start\",\n focusStyles(),\n \"rounded-xs\",\n ],\n {\n variants: {\n variant: {\n text: cn(\"underline decoration-dotted underline-offset-2\", TEXT_COLOR_CLASSES.primary),\n inline: \"\",\n },\n },\n defaultVariants: {\n variant: \"inline\",\n },\n },\n)\n\ntype TooltipPlacement = NonNullable<NonNullable<ArkTooltip.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type TooltipPosition = LogicalPosition<TooltipPlacement>\n\ntype TooltipContextValue = {\n withinPortal: boolean\n container?: HTMLElement | null\n}\nconst TooltipContext = createContext<TooltipContextValue>({ withinPortal: true })\n\nexport type TooltipRootProps = Omit<ArkTooltip.RootProps, \"positioning\"> & {\n /** Bubble placement relative to the trigger. Prefer the logical `start` / `end`\n * sides (RTL-aware), or use any Ark placement (`top`, `bottom`, `top-start`, …).\n * Defaults to `\"top\"`. */\n position?: TooltipPosition\n /** Gap in px between the trigger and the bubble. */\n offset?: number\n /** Render the bubble in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Fires on close (any source) — pointer/focus leaving the trigger, Escape, or a controlled `onOpenChange`. */\n onClose?: () => void\n}\n\nconst Root = ({\n position = \"top\",\n offset,\n withinPortal = true,\n container,\n children,\n onOpenChange,\n onClose,\n ...rest\n}: TooltipRootProps) => {\n const { dir } = useLocaleContext()\n return (\n <TooltipContext.Provider value={{ withinPortal, container }}>\n {/* Mount the bubble only while shown (lazyMount + unmountOnExit): closed →\n nothing rendered, so an inline trigger never emits a positioner <div>\n into a host <p> on SSR. Both are overridable via `...rest`. */}\n <ArkTooltip.Root\n lazyMount\n unmountOnExit\n positioning={{ placement: resolveLogicalPlacement(position, dir), gutter: offset }}\n onOpenChange={(details) => {\n onOpenChange?.(details)\n if (!details.open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </ArkTooltip.Root>\n </TooltipContext.Provider>\n )\n}\n\nexport type TooltipContentProps = ArkTooltip.ContentProps & WithTestId\n\nconst Content = ({ className, children, testId, ...rest }: TooltipContentProps) => {\n const { withinPortal, container } = useContext(TooltipContext)\n const portalContainer = useOverlayContainer(container)\n const bubble = (\n <ArkTooltip.Positioner className={tooltipPositioner}>\n <ArkTooltip.Content\n className={cn(tooltipContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </ArkTooltip.Content>\n </ArkTooltip.Positioner>\n )\n if (!withinPortal) return bubble\n return <Portal container={portalContainer}>{bubble}</Portal>\n}\n\nexport type TooltipArrowProps = NoAsChild<ArkTooltip.ArrowProps> & WithTestId\n\n/** The little arrow linking the bubble to its trigger. Compose it inside a\n * `Tooltip.Content` (or let the convenience form's `withArrow` add it for you).\n * The CSS vars size the square (`--arrow-size`) and pull it back under the\n * bubble (`--arrow-offset`) so it reads as a pointer, not a detached diamond. */\nconst Arrow = ({ className, style, testId, asChild: _asChild, ...rest }: TooltipArrowProps) => (\n <ArkTooltip.Arrow\n style={{ [\"--arrow-size\" as string]: \"12px\", [\"--arrow-offset\" as string]: \"-8px\", ...style }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <ArkTooltip.ArrowTip className={cn(tooltipArrow, className)} />\n </ArkTooltip.Arrow>\n)\n\nexport type TooltipProps = TooltipRootProps &\n WithTestId & {\n /** The hint shown on hover and keyboard focus. Named `label` for parity with\n * the rest of the kit; wired as a description via Ark's `aria-describedby`. */\n label: ReactNode\n /** The trigger. By default it's wrapped in a focusable inline trigger (so it\n * drops into running text); with `asChild`, this element *is* the trigger. */\n children: ReactNode\n /** Render `children` as the trigger instead of wrapping them. */\n asChild?: boolean\n /** Add a small arrow pointing at the trigger. For the compound form, compose\n * `<Tooltip.Arrow />` inside `<Tooltip.Content>` instead. */\n withArrow?: boolean\n variant?: VariantProps<typeof tooltipTrigger>[\"variant\"]\n classNames?: { trigger?: string; content?: string; arrow?: string }\n }\n\n/** Convenience form: `Root` + `Trigger` + `Content` wired from `label`/`children`.\n * `testId` lands on `Content` (the rendered bubble) — `Root` has no DOM node\n * of its own. */\nconst TooltipComponent = ({\n label,\n children,\n asChild,\n classNames,\n withArrow,\n variant = \"inline\",\n testId,\n ...root\n}: TooltipProps) => {\n return (\n <Root {...root}>\n {match({ asChild })\n .with({ asChild: true }, () => <ArkTooltip.Trigger asChild>{children}</ArkTooltip.Trigger>)\n .otherwise(() => (\n // Ark wires `aria-describedby` to the bubble itself, while it's shown.\n <ArkTooltip.Trigger\n type=\"button\"\n className={cn(tooltipTrigger({ variant }), classNames?.trigger)}\n >\n {children}\n </ArkTooltip.Trigger>\n ))}\n <Content className={classNames?.content} testId={testId}>\n {withArrow && <Arrow className={classNames?.arrow} />}\n {label}\n </Content>\n </Root>\n )\n}\n\nexport const Tooltip = Object.assign(TooltipComponent, {\n Root,\n Trigger: ArkTooltip.Trigger,\n Content,\n Arrow,\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/checkbox/checkbox.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;AAmDO,IAAM,aAAA,GAAqD;AAAA,EAChE,KAAA,sBAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,EAClB,aAAA,kBAAe,GAAA,CAAC,KAAA,EAAA,EAAM,SAAA,EAAW,UAAA,EAAY;AAC/C,CAAA;AAyDA,IAAM,mBAAA,GAAsB,CAAC,EAAE,GAAA,EAAK,QAAO,KAA6C;AACtF,EAAA,MAAM,EAAE,mBAAmB,WA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oB,GAAA,EAAU,MAAA,EAAgB;AAAA;AAAA;AACjD;AAAA;AAAA,GACF;AAEJ","file":"chunk-7E7JNWOC.js","sourcesContent":["\"use client\"\n\nimport { Checkbox as Ark } from \"@ark-ui/react/checkbox\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Minus } from \"lucide-react\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport {\n FieldShell,\n fieldA11yProps,\n fieldInlineStack,\n fieldLabel,\n requiredMark,\n} from \"../field/field\"\nimport { CheckIcon } from \"../popover/icons\"\nimport { type ControlIndicatorVariant, controlIndicator } from \"./control\"\n\n/**\n * Checkbox — a single boolean (or tri-state) control on Ark UI's Checkbox\n * machine. The label sits inline beside the box, rendered through the\n * checkbox's own `Ark.Label` part (not `Field`'s) so it stays correctly\n * wired to the hidden input's `aria-labelledby` and — critically — carries no\n * layout footprint when it's visually hidden (e.g. `classNames.label:\n * \"sr-only\"`): an absolutely-positioned flex child isn't a flex item at all,\n * so it can't pick up the root's `gap-2`. `description` / `error` live below\n * the label via the shared `Field` scaffold, with the box centered on the\n * label line, so a `Checkbox` is accessible and complete on its own. Implements the kit's `FormControlProps` contract: the\n * `ref` and `onBlur` land on the submittable hidden `<input>`, and `name`\n * wires it into native form submission.\n *\n * - The checked state is `boolean | \"indeterminate\"`; `onCheckedChange`\n * hands you that next value directly (the indeterminate state never sets\n * itself — drive it from the parent, e.g. a \"select all\" header).\n * - `invalid` is OR'd with `error != null`, matching the rest of the family,\n * so a form library can flip the red state independently of the message.\n *\n * Two `variant`s decide the checked fill: `default` is a neutral, monochrome\n * box (palette-independent), while `filled` tints the checked fill with the\n * active palette via `data-color` + the `--c-solid` slot var. The box is\n * palette-independent at rest, and the focus ring is always the brand ring.\n */\n\nexport type CheckboxIconSlot = \"check\" | \"indeterminate\"\nexport type CheckboxIcons = IconMap<CheckboxIconSlot>\n\n/** The default marks: a check, and a dash for the indeterminate state. */\nexport const DEFAULT_ICONS: Record<CheckboxIconSlot, ReactNode> = {\n check: <CheckIcon />,\n indeterminate: <Minus className={iconStroke} />,\n}\n\nexport type CheckboxProps = WithTestId & {\n /** Controlled checked state. `\"indeterminate\"` renders the partial mark. */\n checked?: boolean | \"indeterminate\"\n /** Uncontrolled initial checked state. */\n defaultChecked?: boolean | \"indeterminate\"\n /** Fires with the next checked state (a value, not a DOM event). */\n onCheckedChange?: (checked: boolean | \"indeterminate\") => void\n /** Inline label beside the box. */\n label?: ReactNode\n /** Helper text above the control. */\n description?: ReactNode\n /** Error message below the control; its presence sets the invalid state. */\n error?: ReactNode\n /** Required flag (and, with a label, the red asterisk). */\n required?: boolean\n /** Red invalid state, OR'd with `error != null`. */\n invalid?: boolean\n /** Dims and blocks interaction. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n size?: Size\n /** Checked-fill treatment: `default` (monochrome) or `filled` (palette-colored). */\n variant?: ControlIndicatorVariant\n color?: Color\n /** Field name for native form submission. */\n name?: string\n /** Submitted value when checked (defaults to `\"on\"`). */\n value?: string\n /** Explicit id for label association. */\n id?: string\n /** Lands on the hidden `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hidden `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Replaces the marks: `check` and `indeterminate`. A missing key keeps its default. */\n icons?: CheckboxIcons\n className?: string\n classNames?: {\n root?: string\n control?: string\n label?: string\n /** The description / error field, under the label. */\n field?: string\n }\n}\n\n/**\n * The real, submittable hidden `<input>`, split out so it reads the `Field` context from *inside*\n * the wrapping `FieldShell` — `Checkbox` itself renders that shell, so calling `useFieldContext()`\n * at its own top level would run too early. Same pattern as `Switch`: `fieldA11yProps` points\n * `aria-describedby` at the error once invalid (Ark's own tracking doesn't reliably catch up) and\n * adds `aria-errormessage`. Its `aria-labelledby` is left out: this `Field` never renders a label\n * (the checkbox's own `Ark.Label` names the input), so it would point at nothing.\n */\nconst CheckboxHiddenInput = ({ ref, onBlur }: Pick<CheckboxProps, \"ref\" | \"onBlur\">) => {\n const { \"aria-labelledby\": _unrendered, ...described } = fieldA11yProps(useFieldContext())\n return <Ark.HiddenInput ref={ref} onBlur={onBlur} {...described} />\n}\n\nexport const Checkbox = ({\n checked,\n defaultChecked,\n onCheckedChange,\n label,\n description,\n error,\n required,\n invalid,\n disabled,\n readOnly,\n size = \"md\",\n variant,\n color,\n name,\n value,\n id,\n ref,\n onBlur,\n className,\n classNames,\n testId,\n icons: iconsProp,\n}: CheckboxProps) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n // Red state is driven 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\n // A visible label above description/error switches the root to a grid: the\n // control centers on the label's row alone (not on the whole text stack),\n // and the field hangs under the label in the second column. Label-only\n // (incl. sr-only) stays a plain inline row.\n const hasStack = label != null && (description != null || error != null)\n\n const labelNode = label != null && (\n <Ark.Label\n className={cn(fieldLabel({ size }), !hasStack && \"min-w-0 flex-1\", classNames?.label)}\n >\n {label}\n {required && (\n <span aria-hidden=\"true\" {...requiredMark}>\n *\n </span>\n )}\n </Ark.Label>\n )\n\n return (\n <Ark.Root\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange ? (d) => onCheckedChange(d.checked) : undefined}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n value={value}\n id={id}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n // `relative` contains the absolutely positioned hidden input, which would\n // otherwise escape any scroller this control sits in.\n className={cn(\n hasStack\n ? fieldInlineStack({ size })\n : \"relative inline-flex items-center gap-2 select-none\",\n className,\n classNames?.root,\n )}\n >\n <Ark.Control className={cn(controlIndicator({ size, variant }), classNames?.control)}>\n <Ark.Indicator>{icons.check}</Ark.Indicator>\n <Ark.Indicator indeterminate>{icons.indeterminate}</Ark.Indicator>\n </Ark.Control>\n\n {labelNode}\n <FieldShell\n description={description}\n error={error}\n size={size}\n className={cn(hasStack && \"col-start-2\", classNames?.field)}\n >\n <CheckboxHiddenInput ref={ref} onBlur={onBlur} />\n </FieldShell>\n </Ark.Root>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/modal/modal.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AA2CA,IAAM,gBAAgB,GAAA,CAAI;AAAA,EACxB,8HAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,eAAA,GAAkB,GAAA;AAAA,EACtB,gHAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,QAAA,EAAU;AAAA,QACR,MAAA,EAAQ,gBAAA;AAAA,QACR,GAAA,EAAK,wBAAA;AAAA,QACL,MAAA,EAAQ;AAAA;AACV,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,QAAA,EAAU,QAAA;AAAS;AAE1C,CAAA;AAEA,IAAM,YAAA,GAAe,GAAA;AAAA,EACnB;AAAA,IACE,+BAAA;AAAA,IACA,2BAAA;AAAA,IACA,kEAAA;AAAA,IACA,wDAAA;AAAA,IACA,oBAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,oBAAA;AAAA;AAAA,QACJ,EAAA,EAAI,oBAAA;AAAA;AAAA,QACJ,EAAA,EAAI,oBAAA;AAAA;AAAA,QACJ,EAAA,EAAI,oBAAA;AAAA;AAAA,QACJ,EAAA,EAAI,oBAAA;AAAA;AAAA,QACJ,IAAA,EAAM;AAAA,OACR;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,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ui/react/portal\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { type ComponentPropsWithoutRef, type ReactNode, useRef } from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { NestedLayer, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport {\n createDialogParts,\n DIALOG_PADDING,\n type DialogCloseTriggerProps,\n type DialogIconSlot,\n type DialogIcons,\n DialogRootProviders,\n type DialogSectionProps,\n useDialogNameCheck,\n} from \"../overlays/dialog-parts\"\n\n/**\n * Modal — centered overlay dialog on top of Ark UI's Dialog state machine.\n * Ark owns focus-trap, scroll-lock, RTL, the `Esc` / click-outside behaviour\n * and the `data-state=\"open|closed\"` attribute that drives our enter/exit\n * animations (keyframes live in `theme.css`). This wrapper provides the styled\n * parts and a flatter props API.\n *\n * - High-level form: `<Modal open title size … >children</Modal>` renders the\n * full Portal → Backdrop → Positioner → Content → Header + Body scaffold.\n * This is what the imperative overlays manager mounts.\n * - Low-level parts (`Modal.Root`, `Modal.Content`, `Modal.Title`, …) are\n * exposed for full control / trigger-based composition.\n *\n * Surface padding flows through the `--modal-px` CSS var set on the content, so\n * `Modal.Header` / `Modal.Body` / `Modal.Footer` stay in rhythm without prop\n * plumbing — and keep a sensible fallback when used standalone.\n */\n\nconst modalBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst modalPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex flex-col items-center overflow-y-auto p-4\",\n {\n variants: {\n position: {\n center: \"justify-center\",\n top: \"justify-start mt-[8vh]\",\n bottom: \"justify-end mb-[8vh]\",\n },\n },\n defaultVariants: { position: \"center\" },\n },\n)\n\nconst modalContent = cva(\n [\n \"relative flex w-full flex-col\",\n \"max-h-[calc(100dvh-2rem)]\",\n \"bg-brand-50 text-brand-950 border border-brand-900/20 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-white dark:border-white/15\",\n \"focus:outline-none\",\n \"data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out\",\n ],\n {\n variants: {\n size: {\n xs: \"max-w-(--width-xs)\", // 24rem\n sm: \"max-w-(--width-sm)\", // 30rem\n md: \"max-w-(--width-md)\", // 35rem\n lg: \"max-w-(--width-lg)\", // 40rem\n xl: \"max-w-(--width-xl)\", // 48rem\n full: \"max-w-[calc(100vw-2rem)] min-h-[calc(100dvh-2rem)]\",\n },\n radius: {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-xl\",\n xl: \"rounded-2xl\",\n },\n },\n defaultVariants: { size: \"md\", radius: \"sm\" },\n },\n)\n\n// ---------------------------------------------------------------------------\n// Low-level parts (styled Ark parts + kit conveniences)\n// ---------------------------------------------------------------------------\n\nexport type ModalIconSlot = DialogIconSlot\nexport type ModalIcons = DialogIcons\n\nexport type ModalRootProps = ComponentPropsWithoutRef<typeof Ark.Root> & {\n /** Replaces the default icons: `close`. `Modal.CloseTrigger`'s `children` win over it. */\n icons?: ModalIcons\n}\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * dialog is open, an outside click closes the picker only, not the dialog\n * under it. It is also a layer of its own while open, so a hotkey on the page\n * (or in an enclosing overlay) yields to it. See `lib/overlay-layer.tsx`. */\nconst ModalRoot = ({ onPointerDownOutside, icons, children, ...rest }: ModalRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root onPointerDownOutside={guard.onPointerDownOutside} {...rest}>\n {/* A layer itself, registered with whatever it opened from (the page,\n or an enclosing overlay), so what's under it knows it's covered. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} modal />}</Ark.Context>\n <DialogRootProviders icons={icons} layers={guard.layers}>\n {children}\n </DialogRootProviders>\n </Ark.Root>\n )\n}\nconst ModalTrigger = Ark.Trigger\nconst ModalContext = Ark.Context\n\nexport type ModalBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nconst ModalBackdrop = ({ className, testId, ...rest }: ModalBackdropProps) => (\n <Ark.Backdrop\n className={cn(modalBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ModalPosition = VariantProps<typeof modalPositioner>[\"position\"]\nexport type ModalPositionerProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Positioner>> &\n WithTestId & {\n position?: ModalPosition\n }\n\nconst ModalPositioner = ({\n className,\n position,\n testId,\n children,\n asChild: _asChild,\n ...rest\n}: ModalPositionerProps) => {\n // A ref, not state: overlays read it when they portal, so nothing has to\n // re-render once it attaches (see `lib/overlay-container.tsx`).\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner\n ref={positioner}\n className={cn(modalPositioner({ position }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nexport type ModalContentProps = ComponentPropsWithoutRef<typeof Ark.Content> &\n VariantProps<typeof modalContent> &\n WithTestId\n\nconst ModalContent = ({ className, size, radius, testId, ...rest }: ModalContentProps) => {\n const nameCheck = useDialogNameCheck(\"Modal\")\n return (\n <Ark.Content\n ref={nameCheck}\n className={cn(modalContent({ size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type ModalTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nconst ModalTitle = ({ className, testId, ...rest }: ModalTitleProps) => (\n <Ark.Title\n className={cn(\"text-xl font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ModalDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nconst ModalDescription = ({ className, testId, ...rest }: ModalDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm\", TEXT_COLOR_CLASSES.muted, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ModalCloseTriggerProps = DialogCloseTriggerProps\nexport type ModalHeaderProps = DialogSectionProps\nexport type ModalBodyProps = DialogSectionProps\nexport type ModalFooterProps = DialogSectionProps\n\nconst {\n CloseTrigger: ModalCloseTrigger,\n Header: ModalHeader,\n Body: ModalBody,\n Footer: ModalFooter,\n} = createDialogParts(\"modal\", Ark.CloseTrigger)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Modal\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type ModalSize = NonNullable<VariantProps<typeof modalContent>[\"size\"]>\nexport type ModalRadius = NonNullable<VariantProps<typeof modalContent>[\"radius\"]>\n\nexport type ModalClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"closeButton\",\n string\n >\n>\n\nexport type ModalProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"role\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Header title; renders the header when set, and names the dialog. */\n title?: ReactNode\n /** Id of an element inside the modal that names it, when there is no `title`. For a\n * plain string, use `aria-label`. */\n \"aria-labelledby\"?: string\n /** Optional subtitle under the title. */\n description?: ReactNode\n size?: ModalSize\n radius?: ModalRadius\n /** Vertically center the modal (vs. anchored near the top). */\n position?: ModalPosition\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--modal-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n closeOnInteractOutside?: boolean\n /** Use `alertdialog` semantics (confirm flows). @default \"dialog\" */\n role?: \"dialog\" | \"alertdialog\"\n /** Fires after the exit animation completes; the manager unmounts on this. */\n onExitComplete?: () => void\n /** Fires on close (any source) */\n onClose?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: ModalClassNames\n /** Overrides the default close button's accessible name (`closeTriggerLabel`, default\n * `\"Close\"`). The compound `ModalCloseTrigger` part takes a plain `aria-label` instead. */\n translations?: ModalTranslations\n /** Replaces the default icons: `close`, the header's close button. */\n icons?: ModalIcons\n }\n\n/** The ready-made modal's wording — `closeTriggerLabel` follows Ark's naming for the\n * same control. */\nexport type ModalTranslations = { closeTriggerLabel?: string }\n\nconst ModalComponent = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n title,\n description,\n \"aria-labelledby\": ariaLabelledby,\n size,\n radius,\n position,\n withCloseButton = true,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n role,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n translations,\n icons,\n ...rest\n}: ModalProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n\n return (\n <ModalRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n closeOnEscape={closeOnEscape}\n // Decoupled from `modal` on purpose: Ark's dialog derives this default\n // from `modal` (`modal && !alertdialog`), so when the overlays manager\n // draws its own shared backdrop and passes `withBackdrop={false}` —\n // forcing `modal={false}` below — outside-click would silently stop\n // dismissing. Default to Ark's intended behaviour instead: dismiss for\n // regular dialogs, keep `alertdialog`s sticky (explicit choice required).\n closeOnInteractOutside={closeOnInteractOutside ?? role !== \"alertdialog\"}\n role={role}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open. Both flow to the parts' presence via Ark's Root context.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n icons={icons}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <ModalBackdrop className={classNames?.backdrop} />}\n <ModalPositioner\n position={position}\n className={cn(\"overflow-clip\", classNames?.positioner)}\n >\n <ModalContent\n size={size}\n radius={radius}\n style={{ [\"--modal-px\" as string]: DIALOG_PADDING[padding] }}\n className={cn(className, classNames?.content)}\n testId={testId}\n aria-labelledby={ariaLabelledby}\n >\n {hasHeader && (\n <ModalHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && <ModalTitle className={classNames?.title}>{title}</ModalTitle>}\n {description != null && (\n <ModalDescription className={classNames?.description}>\n {description}\n </ModalDescription>\n )}\n </div>\n {withCloseButton && (\n <ModalCloseTrigger\n aria-label={translations?.closeTriggerLabel}\n className={classNames?.closeButton}\n />\n )}\n </ModalHeader>\n )}\n <ModalBody\n className={cn(\n !hasHeader && \"pt-(--modal-px,1.25rem)\",\n \"pb-(--modal-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </ModalBody>\n </ModalContent>\n </ModalPositioner>\n </Portal>\n </ModalRoot>\n )\n}\n\nexport const Modal = Object.assign(ModalComponent, {\n Root: ModalRoot,\n Trigger: ModalTrigger,\n Context: ModalContext,\n Backdrop: ModalBackdrop,\n Positioner: ModalPositioner,\n Content: ModalContent,\n Title: ModalTitle,\n Description: ModalDescription,\n CloseTrigger: ModalCloseTrigger,\n Header: ModalHeader,\n Body: ModalBody,\n Footer: ModalFooter,\n})\n"]}
|
|
@@ -1 +0,0 @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AAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-7KFUFAVP.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { SearchIcon } from \"lucide-react\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport {\n filterSelectData,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n useLabelSearch,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { controlIndicator } from \"../checkbox/control\"\nimport {\n COMBOBOX_DEFAULT_TRANSLATIONS,\n Combobox,\n type ComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { ComboboxSearchRow } from \"../combobox-list/combobox-search-row\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport type { InputSize, InputVariant } from \"../input/input\"\nimport { CheckIcon, CloseIcon } from \"../popover/icons\"\n\n/**\n * MultiComboboxList — a searchable, multi-value option list with no trigger of\n * its own. Same idea as [`ComboboxList`](/docs/combobox-list) but for several\n * values at once: every option shows a checkbox instead of a single check\n * mark, and picking one doesn't close the list. It renders permanently open —\n * embed it inline inside a container you already control the visibility of\n * (a `Popover`, a `Drawer`, a custom panel).\n *\n * - `data` / `value` / `onChange` match [`MultiSelect`](/docs/multi-select)\n * exactly (`SelectValue<Data>[]`) — but options render as a checkbox list\n * rather than pills in the input, which is lighter in a compact popover.\n * - Type to filter; `clearable` clears every value at once; `maxValues` caps\n * the selection; `hidePickedOptions` drops chosen options from the list.\n * - Label / description / error come from the built-in `Field`, same as the\n * rest of the family — omit them when embedding inside your own popover.\n */\n\ntype MultiComboboxListClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The search row (also targeted by `className`). */\n search?: string\n /** The search `<input>`. */\n input?: string\n /** A single option row. */\n option?: string\n /** The checkbox indicator inside an option row. */\n checkbox?: string\n /** The scrollable option list. */\n list?: string\n}\n\nexport type MultiComboboxListIconSlot = \"search\" | \"clear\" | \"check\"\nexport type MultiComboboxListIcons = IconMap<MultiComboboxListIconSlot>\n\n/** The default icons: the search row's magnifier and clear ×, and the selected option's checkbox mark. */\nexport const DEFAULT_ICONS: Record<MultiComboboxListIconSlot, ReactNode> = {\n search: <SearchIcon className={iconStroke} />,\n clear: <CloseIcon />,\n check: <CheckIcon />,\n}\n\nexport type MultiComboboxListProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled selected values. */\n value?: SelectValue<Data>[]\n /** Uncontrolled initial selection. */\n defaultValue?: SelectValue<Data>[]\n /** Fires with the full selection on every add / remove. */\n onChange?: (value: SelectValue<Data>[]) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including the\n * checkbox affordance. Omit it to render the checkbox + label.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder for the search field. */\n placeholder?: string\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n /** Show a button that clears every value at once. */\n clearable?: boolean\n /** Cap the number of selected values. */\n maxValues?: number\n /** Hide options that are already selected. */\n hidePickedOptions?: boolean\n size?: InputSize\n /**\n * Search row treatment. Defaults to `\"unstyled\"` (no border/background) since\n * this is normally embedded inside a container that already draws its own\n * chrome; pass `\"default\"` / `\"filled\"` when using it standalone.\n */\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for native form submission (one hidden input per value). */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: MultiComboboxListClassNames\n /** Overrides the clear button's accessible name (`clearTriggerLabel`, default\n * `\"Clear value\"`) — the same key as the rest of the combobox family. */\n translations?: MultiComboboxListTranslations\n /** Replaces the default icons: `search`, `clear`, `check`. A missing key keeps its\n * default; `search: null` drops the magnifier. `renderItem` draws its own rows. */\n icons?: MultiComboboxListIcons\n }\n\n/** The combobox family's `clearTriggerLabel` — the only family key this always-open list\n * renders (it has no chevron). */\nexport type MultiComboboxListTranslations = Pick<ComboboxTranslations, \"clearTriggerLabel\">\n\nexport const MultiComboboxList = <const Data extends SelectData = SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Search…\",\n empty = \"Nothing found\",\n clearable,\n maxValues,\n hidePickedOptions,\n size = \"md\",\n variant = \"unstyled\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: MultiComboboxListProps<Data>) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const clearLabel =\n translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel\n type Item = SelectValue<Data>\n\n // Red state is driven 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\n const [value, setSelected] = useUncontrolled<Item[]>({\n value: valueProp,\n defaultValue: defaultValue ?? [],\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n const setValues = (next: Item[]) => {\n // Adding past the cap is rejected; removals always pass.\n if (maxValues != null && next.length > value.length && next.length > maxValues) {\n return\n }\n setSelected(next)\n }\n\n // Normalize once per `data`; only the filter re-runs as the query/selection changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const labelSearch = useLabelSearch()\n const { collection, items, groups } = useMemo(() => {\n const picked = new Set<string>(value)\n return filterSelectData(\n normalized,\n (item) =>\n (!hidePickedOptions || !picked.has(item.value)) && labelSearch.matches(item.label, search),\n )\n }, [normalized, search, hidePickedOptions, value, labelSearch])\n\n // `canClear` reserves the clear button's box (and the shell's end-slot\n // padding) for the whole time the field is clearable, not just while it\n // has a value — otherwise the button mounting/unmounting shifts the\n // search input's width. `showClear` only toggles visibility/interactivity.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && ((value != null && value.length > 0) || search.length > 0)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={cn(\"group/item\", classNames?.option)}\n >\n {(state) =>\n renderItem ? (\n renderItem(item, state)\n ) : (\n <>\n {/* Presentational: the option row owns the selection semantics.\n It borrows Checkbox's own box, driven by `data-state` the way\n Ark drives the real one, so the two never drift apart. */}\n <span\n aria-hidden\n data-state={state.selected ? \"checked\" : \"unchecked\"}\n className={cn(controlIndicator({ size, variant: \"filled\" }), classNames?.checkbox)}\n >\n <ArkCombobox.ItemIndicator>{icons.check}</ArkCombobox.ItemIndicator>\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{item.label}</span>\n </>\n )\n }\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItemOf<Data>>\n multiple\n collection={collection}\n value={value}\n // Ark types the values as `string[]`; they always originate from `data`,\n // so narrow them back to the caller's value union.\n onValueChange={(details) => setValues(details.value as Item[])}\n inputValue={search}\n onInputValueChange={(details) => setSearch(details.inputValue)}\n selectionBehavior=\"clear\"\n // There's no trigger to open it — the caller (e.g. a `Popover`) already\n // owns whether this mounts at all, so keep the machine permanently open.\n open\n onOpenChange={() => {}}\n // The caller's own container (Popover, Drawer, …) already owns\n // dismiss-on-outside-click; without this the always-open machine\n // registers its own (functionally inert, since `onOpenChange` is a\n // no-op) listbox dismissable layer, which logs a spurious\n // \"[@zag-js/dismissable] node is `null` or `undefined`\" warning.\n disableLayer\n closeOnSelect={false}\n autoFocus\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={className}\n >\n <ComboboxSearchRow\n size={size}\n variant={variant}\n invalid={isInvalid}\n placeholder={placeholder}\n canClear={canClear}\n showClear={showClear}\n clearLabel={clearLabel}\n onClear={() => {\n setValues([])\n setSearch(\"\")\n }}\n onBlur={onBlur}\n ref={ref}\n testId={testId}\n icons={icons}\n classNames={classNames}\n />\n\n <Combobox.Panel className={classNames?.list}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Panel>\n\n {/* Hidden inputs carry the real selection so a native `<form>` submits\n the value array (the search input is unnamed). When controlled by a\n form library the value flows through `onChange` instead, and these\n are just submitted alongside it. */}\n {name != null && value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)}\n </Combobox.Root>\n )\n\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 >\n {control}\n </FieldShell>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/slider/slider.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;AA8CA,IAAM,YAAA,GAAe,CAAC,CAAA,KACpB,CAAA,KAAM,MAAA,GAAY,MAAA,GAAY,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA,GAAI,CAAA,GAAI,CAAC,CAAC,CAAA;AAEzD,IAAM,YAAA,GAAe,IAAI,EAAA,EAAI;AAAA,EAC3B,QAAA,EA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AAE,UAAU,MAAA,oBACX,GAAA;AAAA,sBAAC,MAAA;AAAA,sBAAA;AAAA,wBACC,SAAA,EAAW,EAAA;AAAA,0BACT,mDAAA;AAAA,0BACA,SAAA;AAAA,0BACA,wBAAA,CAAyB,KAAA;AAAA,0BACzB,UAAA,EAAY;AAAA,yBACd;AAAA,wBAEC,QAAA,EAAA,CAAA,CAAE;AAAA;AAAA;AACL,mBAAA;AAAA,kBAdG,CAAA,CAAE;AAAA,iBAiBV;AAAA;AAAA,aACH,EACF;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ","file":"chunk-AKXALCUN.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Slider as Ark } from \"@ark-ui/react/slider\"\nimport { cva } from \"class-variance-authority\"\nimport type { ComponentProps, ComponentPropsWithoutRef, FocusEvent, ReactNode, Ref } from \"react\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\n\n/**\n * Slider — Range input on top of Ark UI's Slider state\n * machine. Ark owns keyboard nav, RTL flipping, drag math, and ARIA wiring;\n * this wrapper provides the styled parts and a flatter API.\n *\n * - Single or range. Pass a `number` for one thumb, or `[number, number]`\n * for a two-thumb range. The value shape drives everything: the callbacks\n * echo back the same shape, and a thumb (with its own label) is rendered\n * per value. The component is generic over the shape (`V`) so single-value\n * callers keep `number` types — no `number | number[]` leaking into their\n * handlers.\n * - `marks` paints filled dots on the track and an optional label below.\n * Dots between the thumbs (or up to the thumb, for a single value) read\n * as active.\n * - `label` / `description` / `error` / `required` come from the shared `Field`, like the rest\n * of the family: every thumb (`role=\"slider\"`) is named by `label` and described by\n * `description`, or by `error` once invalid.\n * - `thumbLabel` floats above each thumb; visible on hover/focus by default. Its function\n * form also becomes each thumb's `aria-valuetext`, so a screen reader hears \"40%\", not \"40\".\n * - Track/range/thumb parts can be overridden via `classNames`.\n *\n * Palette is delivered through the kit's `data-color` + slot-var system\n * (see `components.md` -> Color system). The root writes `data-color={color}`\n * and the range/thumb reference `--c-solid` — adding a new color in\n * `colors.css` works here for free, no slider edits needed.\n */\n\ntype SliderValue = number | number[]\n\n/** Wrap a scalar into Ark's array contract; pass arrays through untouched. */\nconst toValueArray = (v: SliderValue | undefined): number[] | undefined =>\n v === undefined ? undefined : Array.isArray(v) ? v : [v]\n\nconst marksWrapper = cva(\"\", {\n variants: {\n size: {\n xs: \"px-0.5\",\n sm: \"px-0.75\",\n md: \"px-1.25\",\n lg: \"px-1.5\",\n xl: \"px-1.5\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\nconst sliderTrack = cva(\n // `overflow-x-clip overflow-y-visible` keeps the Range's rounded ends\n // clipped (so the filled bar follows the track's pill shape) while\n // letting mark labels spill below the track without being cut off.\n [\n \"relative w-full overflow-x-clip overflow-y-visible rounded-full bg-black/3 dark:bg-white/4\",\n \"cursor-pointer disabled:cursor-not-allowed data-disabled:cursor-not-allowed\",\n // Red invalid state — Ark stamps `data-invalid` on the root, so the track\n // (a descendant) reads it via `group-data-[invalid]`. Figma has no Slider error\n // variant, so it follows Field's: a `border-error-solid` outline, no red fill.\n \"group-data-[invalid]/slider:ring-1 group-data-[invalid]/slider:ring-red-500\",\n ],\n {\n variants: {\n // Padding matches half the dot width per size: the marker wrapper\n // lives inside the track as `relative`, so it occupies the track's\n // content box (padding-inset). Dot centers land at the inset edges,\n // and `-translate-x-1/2` puts the dot's outer edge flush with the\n // track's visible end. No first/last special-casing needed.\n size: {\n xs: \"h-0.5\",\n sm: \"h-1\",\n md: \"h-1.5\",\n lg: \"h-2\",\n xl: \"h-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst sliderRange = cva(\n \"h-full bg-(--c-solid) data-disabled:bg-(--c-solid-disabled) rounded-full\",\n {\n variants: {\n size: {\n xs: \"\",\n sm: \"\",\n md: \"\",\n lg: \"\",\n xl: \"\",\n },\n },\n },\n)\n\nconst sliderThumb = cva(\n [\n \"block rounded-full border-2 bg-brand-50 dark:bg-brand-950 shadow-sm z-1\",\n \"border-(--c-solid)\",\n \"transition-transform\",\n \"cursor-pointer disabled:cursor-not-allowed data-disabled:cursor-not-allowed data-disabled:border-(--c-solid-disabled)\",\n focusStyles({ ring: \"palette\" }),\n \"data-dragging:scale-110\",\n ],\n {\n variants: {\n size: {\n xs: \"size-2.5 border-2\",\n sm: \"size-3 border-2\",\n md: \"size-4 border-3\",\n lg: \"size-5 border-4\",\n xl: \"size-6 border-4\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst sliderMark = cva(\n [\n \"absolute top-1/2 -translate-y-1/2\",\n \"before:rounded-full\",\n \"before:absolute before:top-full before:-translate-y-1/2 before:-translate-x-1/2\",\n \"before:bg-brand-900/10 dark:before:bg-white/16 state-under-or-at:before:bg-(--c-solid-hover)\",\n ],\n {\n variants: {\n size: {\n xs: \"before:size-px\",\n sm: \"before:size-0.5\",\n md: \"before:size-1\",\n lg: \"before:size-1.5\",\n xl: \"before:size-2\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n// Matches `sliderThumb`'s `size-*` variants above (border-box, so border\n// width doesn't add to the rendered box). Passed to Ark as a static\n// `thumbSize` so it skips its own runtime thumb measurement — that\n// measurement is lost (permanently, `thumbSize` collapses to 0) the first\n// time the value changes, which throws off the `thumbAlignment: \"contain\"`\n// edge-inset math used to position both the thumb and every mark.\nconst THUMB_DIAMETER_PX: Record<Size, number> = {\n xs: 10,\n sm: 12,\n md: 16,\n lg: 20,\n xl: 24,\n}\n\nexport type SliderSize = Size | null | undefined\n\ntype SliderMark = {\n value: number\n label?: ReactNode\n}\n\ntype SliderClassNames = {\n field?: string\n root?: string\n control?: string\n track?: string\n range?: string\n thumb?: string\n thumbLabel?: string\n mark?: string\n markGroup?: string\n markDot?: string\n markLabel?: string\n}\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\ntype ShowThumbLabel = boolean | \"hover\" | \"always\" | \"never\"\n\n/**\n * `V` is the value shape: `number` for a single thumb (the default), or\n * `number[]` (use `[number, number]`) for a two-thumb range. Inferred from\n * `value` / `defaultValue`, so callbacks echo back the same shape.\n */\nexport type SliderProps<V extends SliderValue = number> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n ForbidAsChild &\n Omit<\n ArkRootProps,\n | \"asChild\"\n | \"value\"\n | \"defaultValue\"\n | \"onValueChange\"\n | \"onValueChangeEnd\"\n | \"onChange\"\n | \"onBlur\"\n | \"ref\"\n | \"className\"\n > &\n WithTestId & {\n /** Controlled value. `number` for one thumb, `[number, number]` for a range. */\n value?: V\n /** Uncontrolled initial value. Its shape decides single vs. range. */\n defaultValue?: V\n /** Fires on every value change (drag, keyboard, click). */\n onChange?: (value: V) => void\n /** Fires once the interaction settles (mouseup / keyup). */\n onChangeEnd?: (value: V) => void\n /** Tick marks rendered on the track. */\n marks?: SliderMark[]\n /**\n * Floating bubble above each thumb. Pass a static node, a function that\n * receives a thumb's live value, or `null` to disable. A function returning\n * a string or number also sets each thumb's `aria-valuetext`. In an RSC tree\n * the function form must live in a `\"use client\"` module so the boundary\n * serializes it as a client reference.\n */\n thumbLabel?: ReactNode | ((value: number) => ReactNode) | null\n /**\n * When the `thumbLabel` bubble shows: `hover` (the default) on hover, focus\n * or drag; `true` / `always` all the time; `false` / `never` not at all.\n */\n showThumbLabel?: ShowThumbLabel\n /** @deprecated Renamed `showThumbLabel`, to match `thumbLabel`. */\n showLabel?: ShowThumbLabel\n size?: SliderSize\n color?: Color\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Forwarded to the slider root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLElement>) => void\n /** Lands on the first thumb (the `role=\"slider\"` element) for focus-on-error. */\n ref?: Ref<HTMLDivElement>\n className?: string\n classNames?: SliderClassNames\n }\n\n/** Ark's per-thumb `aria-label` / `aria-labelledby` arrays, as a range slider takes them. */\ntype ThumbNames = Pick<ArkRootProps, \"aria-label\" | \"aria-labelledby\">\n\n/**\n * One `role=\"slider\"` thumb, split out so it reads the `Field` context from *inside*\n * `FieldShell` — `Slider` itself renders that shell. Ark's Slider never reads a Field, so its\n * thumbs point `aria-labelledby` at their own never-rendered `Slider.Label`; this names each\n * thumb by the field's `label` instead and describes it by `description` / `error`. A caller's\n * own per-thumb `aria-label` / `aria-labelledby` (the way to tell a range's two thumbs apart)\n * still wins: Ark already puts it on the thumb, so the field's label is left out.\n */\nconst SliderThumb = ({\n index,\n names,\n ...thumbProps\n}: ComponentProps<typeof Ark.Thumb> & { names: ThumbNames }) => {\n const { \"aria-labelledby\": fieldLabel, ...described } = fieldA11yProps(useFieldContext())\n const ownName = names[\"aria-label\"]?.[index] ?? names[\"aria-labelledby\"]?.[index]\n return (\n <Ark.Thumb\n index={index}\n {...described}\n aria-labelledby={ownName == null ? fieldLabel : undefined}\n {...thumbProps}\n />\n )\n}\n\n/** A function bubble's text, as `aria-valuetext`; a node with no plain text falls back to the number. */\nconst toValueText =\n (format: (value: number) => ReactNode) =>\n ({ value }: { value: number }) => {\n const text = format(value)\n return typeof text === \"string\" || typeof text === \"number\" ? String(text) : String(value)\n }\n\nexport const Slider = <V extends SliderValue = number>({\n value,\n defaultValue,\n onChange,\n onChangeEnd,\n marks,\n label,\n thumbLabel,\n size,\n showLabel,\n showThumbLabel = showLabel ?? \"hover\",\n color,\n min = 0,\n max = 100,\n step,\n disabled,\n invalid,\n onBlur,\n ref,\n description,\n error,\n required,\n className,\n classNames,\n testId,\n asChild: _asChild,\n ...rest\n}: SliderProps<V>) => {\n const withThumbLabel =\n thumbLabel != null && showThumbLabel !== \"never\" && showThumbLabel !== false\n const renderThumbLabel = (val: number): ReactNode =>\n typeof thumbLabel === \"function\" ? thumbLabel(val) : thumbLabel\n const showMarks = marks !== null && marks !== undefined && marks.length > 0\n // Red state is driven 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\n // The emitted shape mirrors the controlled/default value: arrays stay\n // arrays (range), scalars stay scalars (single thumb).\n const isRange = Array.isArray(value ?? defaultValue)\n const emit = (next: number[]): V => (isRange ? next : (next[0] ?? 0)) as V\n\n const thumbDiameter = THUMB_DIAMETER_PX[size ?? \"md\"]\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size ?? \"md\"}\n className={classNames?.field}\n // One or two thumbs: nothing carries the label's `for` id; each thumb's `aria-labelledby` names it.\n composite\n >\n <Ark.Root\n value={toValueArray(value)}\n defaultValue={toValueArray(defaultValue)}\n onValueChange={onChange ? ({ value: v }) => onChange(emit(v)) : undefined}\n onValueChangeEnd={onChangeEnd ? ({ value: v }) => onChangeEnd(emit(v)) : undefined}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n onBlur={onBlur}\n thumbSize={{ width: thumbDiameter, height: thumbDiameter }}\n getAriaValueText={typeof thumbLabel === \"function\" ? toValueText(thumbLabel) : undefined}\n data-color={color}\n {...props({ \"data-invalid\": isInvalid, \"data-testid\": testId })}\n className={cn(\n \"group/slider relative flex w-full flex-col gap-2\",\n { \"mb-4\": showMarks },\n className,\n classNames?.root,\n )}\n {...rest}\n >\n <Ark.Control\n className={cn(\n \"relative flex w-full items-center py-2\",\n marksWrapper({ size }),\n classNames?.control,\n )}\n >\n <Ark.Track className={cn(sliderTrack({ size }), classNames?.track)}>\n <Ark.Range className={cn(sliderRange({ size }), classNames?.range)} />\n </Ark.Track>\n\n <Ark.Context>\n {(api) =>\n api.value.map((val, i) => (\n <SliderThumb\n // A thumb *is* its index: keyed by value, every step\n // remounted it and dropped keyboard focus after one key press.\n // biome-ignore lint/suspicious/noArrayIndexKey: the index is the thumb's identity\n key={i}\n index={i}\n names={{\n \"aria-label\": rest[\"aria-label\"],\n \"aria-labelledby\": rest[\"aria-labelledby\"],\n }}\n // The focusable element is the thumb (role=\"slider\"), so the\n // caller's `ref` lands on the first thumb for focus-on-error.\n ref={i === 0 ? ref : undefined}\n {...props({\n \"aria-invalid\": isInvalid,\n \"data-testid\": testId && `${testId}-thumb-${i}`,\n })}\n className={cn(sliderThumb({ size }), classNames?.thumb)}\n >\n <Ark.HiddenInput />\n {withThumbLabel && (\n <span\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute -top-7 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-md px-2 py-0.5 text-xs font-medium transition-opacity\",\n \"bg-brand-950 text-white dark:bg-white dark:text-brand-950\",\n showThumbLabel === \"hover\"\n ? \"opacity-0 group-hover/slider:opacity-100 group-focus-within/slider:opacity-100 group-data-dragging:opacity-100\"\n : \"opacity-100\",\n classNames?.thumbLabel,\n )}\n >\n {renderThumbLabel(val)}\n </span>\n )}\n </SliderThumb>\n ))\n }\n </Ark.Context>\n </Ark.Control>\n\n {showMarks && (\n <div className=\"absolute inset-0 h-full w-full select-none pointer-events-none \">\n <Ark.MarkerGroup\n className={cn(\n marksWrapper({ size }),\n \"w-full h-full relative\",\n classNames?.markGroup,\n )}\n >\n {marks.map((m) => (\n <Ark.Marker\n key={m.value}\n value={m.value}\n className={cn(sliderMark({ size }), classNames?.mark)}\n >\n {m.label !== undefined && (\n <span\n className={cn(\n \"absolute top-3/4 translate-y-3/4 -translate-x-1/2\",\n \"text-xs\",\n TYPOGRAPHY_SHADE_CLASSES.muted,\n classNames?.markLabel,\n )}\n >\n {m.label}\n </span>\n )}\n </Ark.Marker>\n ))}\n </Ark.MarkerGroup>\n </div>\n )}\n </Ark.Root>\n </FieldShell>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":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AAAA;AAAA,GAEJ;AAEJ","file":"chunk-B5YHYI7E.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { MouseEvent } from \"react\"\nimport { withAsChildContent } from \"../../lib/as-child\"\nimport { buttonColorVariants } from \"../../lib/button-colors\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Spinner } from \"../spinner/spinner\"\n\n/**\n * ActionIcon — square, icon-only sibling of `Button`.\n *\n * Same (variant × color) model as `Button`:\n * - `variant` picks the shape (filled / light / outline / subtle / default)\n * - `color` picks the palette (brand / neutral / red / …)\n * - filled / light / outline / subtle share Button's colour classes\n * (`lib/button-colors.ts`, the `--btn-*` slots in `colors.css`): Figma's\n * ActionIcon is an instance of its Button set.\n *\n * What's specific to ActionIcon:\n * - Forced 1:1 aspect ratio.\n * - Own `radius` scale (incl. `full` for circular FABs / like-buttons).\n * - Wider size scale (xs..xl) than Button — toolbar density matters here.\n *\n * The accessible name MUST come from `aria-label` (or `aria-labelledby`); the\n * icon children are decoration.\n *\n * `asChild` renders the single child with ActionIcon's styling. Ark's\n * factory clones exactly one element, so `loading`'s spinner replaces\n * *that* element's own children (`withAsChildContent`, `lib/as-child.ts`)\n * rather than the element itself. The `onClick` guard (`preventWhileLoading`)\n * goes on the same clone, since `disabled` doesn't do anything on an\n * arbitrary `asChild` element (e.g. an `<a>`) — same reason the loading\n * `opacity-50` dimming and `pointer-events-none` blocking are keyed off `data-loading`\n * rather than `:disabled` (see `Button`'s note on this).\n */\nconst actionIconVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"aspect-square shrink-0 select-none\",\n \"font-medium uppercase tracking-wide\",\n \"no-underline\",\n \"rounded-action-icon border border-transparent\",\n \"transition-colors-radius\",\n focusStyles(),\n \"disabled:not-data-loading:pointer-events-none data-disabled:pointer-events-none\",\n \"not-data-loading:hover:cursor-pointer\",\n \"data-loading:cursor-progress data-loading:opacity-50\",\n // Every svg rule is `[:where(&)_svg]`: zero class specificity, so a size\n // class on the icon itself (`<Star className=\"size-5\" />`) or a nested\n // component's own svg rule wins whatever the CSS order. Lucide's `size`\n // prop is only an HTML attribute and still loses. Same fix as Input (#427).\n \"[:where(&)_svg]:shrink-0 [:where(&)_svg]:pointer-events-none\",\n ],\n {\n variants: {\n variant: {\n filled: buttonColorVariants.filled,\n light: buttonColorVariants.light,\n outline: buttonColorVariants.outline,\n subtle: buttonColorVariants.subtle,\n default: [\n \"bg-brand-950 text-white border-brand-800 not-data-loading:hover:bg-brand-800\",\n \"dark:bg-white dark:text-brand-950 dark:border-white/80 dark:not-data-loading:hover:bg-white/80\",\n // Not part of the Figma Button set, so it keeps the plain dim.\n \"disabled:opacity-50 data-disabled:opacity-50\",\n ],\n },\n size: {\n xs: \"h-7 text-xs [:where(&)_svg]:size-3\",\n sm: \"h-8 text-sm [:where(&)_svg]:size-3.5\",\n md: \"h-9 text-md [:where(&)_svg]:size-4\",\n lg: \"h-10 text-lg [:where(&)_svg]:size-5\",\n xl: \"h-12 text-xl [:where(&)_svg]:size-6\",\n },\n radius: {\n xs: \"rounded-xs\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n)\n\nexport type ActionIconVariant = NonNullable<VariantProps<typeof actionIconVariants>[\"variant\"]>\nexport type ActionIconSize = NonNullable<VariantProps<typeof actionIconVariants>[\"size\"]>\nexport type ActionIconRadius = NonNullable<VariantProps<typeof actionIconVariants>[\"radius\"]>\n\nexport type ActionIconProps = Omit<HTMLArkProps<\"button\">, \"color\"> &\n VariantProps<typeof actionIconVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /**\n * Replace the icon with a spinner, mark the element as busy, and suppress\n * pointer interactions. Mirrors `Button`'s `loading`.\n */\n loading?: boolean\n }\n\n/** Mirrors `Button`'s `preventWhileLoading` — see the note there. */\nconst preventWhileLoading = (event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n}\n\nexport const ActionIcon = ({\n className,\n variant,\n size,\n radius,\n color,\n loading = false,\n children,\n disabled,\n type,\n asChild,\n testId,\n onClick,\n ...rest\n}: ActionIconProps) => {\n const resolvedDisabled = disabled || loading\n const resolvedOnClick = loading ? preventWhileLoading : onClick\n\n return (\n <ark.button\n asChild={asChild}\n type={asChild ? type : (type ?? \"button\")}\n disabled={resolvedDisabled}\n data-color={color}\n data-variant={variant ?? \"default\"}\n className={cn(actionIconVariants({ variant, size, radius }), className)}\n onClick={resolvedOnClick}\n {...props({\n \"aria-busy\": loading,\n \"aria-disabled\": resolvedDisabled,\n \"data-loading\": loading,\n \"data-testid\": testId,\n })}\n {...rest}\n >\n {asChild && loading ? (\n withAsChildContent(children, () => <Spinner label={null} />, {\n onClick: preventWhileLoading,\n })\n ) : loading ? (\n <Spinner label={null} />\n ) : (\n children\n )}\n </ark.button>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/pills-input/pills-input.tsx"],"names":[],"mappings":";;;;;;;;;;;AAsDO,IAAM,UAAA,GAAa,GAAG,aAAa;AAMnC,IAAM,YAAA,GAAe,IAAI,2DAAA,EAA6D;AAAA,EAC3F,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,OAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI;AAAA;AACN,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AAC3B,CAAC;AAKD,IAAM,kBAAA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AE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAGK,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACtD,KAAA,EAAO;AACT,CAAC","file":"chunk-FQJNQW3G.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n Children,\n type ComponentPropsWithoutRef,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { useLocale } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useElementSize } from \"../../lib/use-element-size\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { PillGroupContext, type PillSize, pill } from \"../pill/pill\"\n\n/**\n * PillsInput — a multi-line input shell that lays out `Pill`s alongside a search\n * field. Same chrome as `Input` (border, focus ring, invalid / disabled states)\n * but it wraps as values accumulate. It's the visual `MultiSelect` and\n * `TagsInput` mount as their target.\n *\n * - It reuses `Input`'s slot layout: a `startSlot` / `endSlot` flank a\n * `pillsContent` region that holds the `Pill`s + the field and is the only\n * thing that wraps, so a trailing control (chevron, clear) pins to the edge\n * instead of wrapping inline with the pills.\n * - Host `Pill`s + a single `PillsInputField` inside it (pills first, field\n * last). The shell sets the pill `size` / `disabled` through context, so the\n * pills match with no prop drilling.\n * - `maxLines` caps the pills at N rows and collapses the rest into a static\n * \"+N\" counter (measured, since pills have variable widths).\n *\n * Presentational by design: the value state lives with the consumer.\n */\n\n/** The pills *row*: same single-line flex shell as `inputShell`, just text-cursor\n * for the click-to-focus affordance. Layout/wrap live on `pillsContent`. */\nexport const pillsShell = cn(\"cursor-text\")\n\n/** The wrapping region inside a pills shell — holds the pills + field, grows to\n * fill the row (`flex-1`), and is the only element that wraps, so the shell's\n * start/end slots stay pinned as `shrink-0` siblings. Gap tracks `inputShell`'s\n * per-size gap so pill spacing is unchanged from the flat layout. */\nexport const pillsContent = cva(\"flex min-w-0 flex-1 flex-wrap items-center py-1 gap-y-0.5\", {\n variants: {\n size: {\n xs: \"gap-1.5\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-2.5\",\n xl: \"gap-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\n// `useLayoutEffect` measures before paint (no flash); fall back to `useEffect`\n// on the server so SSR doesn't warn. Measurement is client-only anyway — the\n// server render shows every pill, which is the correct no-cap fallback.\nconst useIsoLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect\n\n/**\n * Pure row-grouping math behind `usePillOverflow` (exported for testing).\n *\n * Given each measured pill's `offsetTop` (in document order), count how many\n * fit within `maxLines` wrapped rows. A jump in `offsetTop` (beyond a sub-pixel\n * epsilon) marks a new row. When the pills overflow, reserve one slot on the\n * last visible row for the \"+N\" counter (it's narrower than a typical pill, so\n * dropping one always makes room).\n */\nexport function visiblePillCount(offsetTops: number[], maxLines: number): number {\n let rows = 0\n let lastTop = Number.NEGATIVE_INFINITY\n for (let i = 0; i < offsetTops.length; i++) {\n const top = offsetTops[i] ?? lastTop\n if (top - lastTop > 1) {\n rows += 1\n lastTop = top\n if (rows > maxLines) {\n // `i` begins the row past the cap — keep the rows before it, minus one\n // for the counter.\n return Math.max(0, i - 1)\n }\n }\n }\n return offsetTops.length\n}\n\n/**\n * Like `visiblePillCount`, but also keeps the trailing input field on the last\n * visible row (exported for testing).\n *\n * `visiblePillCount` only reasons about pills, so when the last visible row is\n * packed, the field — which is `min-w-16` and the last flex child — can't claim\n * its minimum width and wraps onto a new line. A flex item wraps exactly when\n * the space left on its row drops below its `min-width`, so we drop pills until\n * the last visible pill leaves room on its row for `gap + fieldMinWidth` (plus\n * the `+N` counter, once anything is hidden). Pills are passed as `{ top, end }`,\n * where `end` is how far the pill's inline-end edge sits from the row's\n * inline-start edge, and `rowEnd` is the row's inline length — logical, so the\n * same math holds in RTL, where the free space is on the pill's left. Removing a\n * trailing pill never reflows the ones before it, so each drop is checked\n * against real geometry.\n */\nexport function pillCountWithField(\n pills: { top: number; end: number }[],\n maxLines: number,\n rowEnd: number,\n trailing: { fieldMinWidth: number; counterWidth: number; gap: number },\n): number {\n const total = pills.length\n const { fieldMinWidth, counterWidth, gap } = trailing\n // Start from the pill-only cap (already reserves one slot for the counter on\n // overflow), then back off until the field's minimum fits on the last row.\n let visible = visiblePillCount(\n pills.map((p) => p.top),\n maxLines,\n )\n while (visible > 0) {\n const last = pills[visible - 1]\n if (last == null) break\n // Hiding any pill surfaces the \"+N\" counter, which shares the last row.\n const needsCounter = visible < total\n const trailingWidth = gap + fieldMinWidth + (needsCounter ? counterWidth + gap : 0)\n if (last.end + trailingWidth <= rowEnd) break\n visible--\n }\n return visible\n}\n\n/**\n * Measure how many pills fit within `maxLines` rows and how many overflow.\n *\n * Line caps are width-dependent (pills vary in width), so this measures the DOM.\n * Pills to be measured must carry `data-overflow-item`; the trailing field and\n * the counter must NOT (they would corrupt row detection) — instead the field\n * carries `data-overflow-field` and the counter `data-overflow-counter` so the\n * hook can locate and measure them without mistaking them for pills. The hook\n * renders the full set during a pre-paint \"measuring\" pass, groups pills into\n * rows, then settles on a `visibleCount` — reserving the last row for the \"+N\"\n * chip and, when a field is present, its `min-width` too, so the field never\n * wraps onto a new line (see `pillCountWithField`). Re-measures on width change\n * only (ignoring the height change our own slicing causes, which would loop).\n *\n * `measuring` is exposed so consumers can render the counter during the\n * measuring pass (it is otherwise hidden when nothing overflows), letting the\n * hook measure its real width for the last-row reservation.\n */\nexport function usePillOverflow({\n maxLines,\n count,\n}: {\n /** Cap the rendered pills at this many rows. Omit to render every pill. */\n maxLines?: number\n /** Total number of pills — drives re-measurement on add / remove. */\n count: number\n}): {\n containerRef: RefObject<HTMLDivElement | null>\n visibleCount: number\n hiddenCount: number\n measuring: boolean\n} {\n const containerRef = useRef<HTMLDivElement>(null)\n const [visibleCount, setVisibleCount] = useState(count)\n // While true, every pill is rendered so the DOM reflects the full set; flipped\n // off (pre-paint) once the cutoff is computed.\n const [measuring, setMeasuring] = useState(true)\n const lastWidth = useRef(0)\n\n // Any change to the inputs re-enters a full-render measuring pass.\n useIsoLayoutEffect(() => {\n setMeasuring(true)\n }, [count, maxLines])\n\n useIsoLayoutEffect(() => {\n if (!measuring) return\n const container = containerRef.current\n if (maxLines == null || container == null) {\n setVisibleCount(count)\n setMeasuring(false)\n return\n }\n const items = Array.from(container.querySelectorAll<HTMLElement>(\"[data-overflow-item]\"))\n lastWidth.current = container.clientWidth\n\n const fieldEl = container.querySelector<HTMLElement>(\"[data-overflow-field]\")\n if (fieldEl == null) {\n // No trailing field (e.g. TreeMultiSelect's read-only trigger) — pills +\n // counter only, the original behavior.\n setVisibleCount(\n visiblePillCount(\n items.map((el) => el.offsetTop),\n maxLines,\n ),\n )\n setMeasuring(false)\n return\n }\n\n // Field-aware: reserve the field's min width (and the counter slot) on the\n // last visible row. Measure in viewport coords via `getBoundingClientRect`\n // so pill edges and the row's edges share one coordinate space regardless\n // of `offsetParent` (the positioned shell, not this container), then turn\n // them into inline offsets from the row's start: under RTL the row fills\n // from the right, and a physical `right` would read every pill as already\n // touching the row's end.\n const style = getComputedStyle(container)\n const gap = Number.parseFloat(style.columnGap || style.gap) || 0\n const row = container.getBoundingClientRect()\n const rtl = style.direction === \"rtl\"\n const inlineEnd = (rect: DOMRect) => (rtl ? row.right - rect.left : rect.right - row.left)\n const fieldMinWidth = Number.parseFloat(getComputedStyle(fieldEl).minWidth) || 0\n const counterEl = container.querySelector<HTMLElement>(\"[data-overflow-counter]\")\n const counterWidth = counterEl?.getBoundingClientRect().width ?? 0\n const pills = items.map((el) => {\n const rect = el.getBoundingClientRect()\n return { top: rect.top, end: inlineEnd(rect) }\n })\n setVisibleCount(\n pillCountWithField(pills, maxLines, row.width, { fieldMinWidth, counterWidth, gap }),\n )\n setMeasuring(false)\n }, [measuring, count, maxLines])\n\n // Re-measure when the field's width changes (a wider field reveals more\n // pills again). Ignore height-only changes — our own slicing shrinks the\n // height and would otherwise feed back into an infinite measure loop.\n const width = useElementSize(containerRef, { enabled: maxLines != null })?.width\n useIsoLayoutEffect(() => {\n if (width === undefined || Math.abs(width - lastWidth.current) < 1) return\n lastWidth.current = width\n setMeasuring(true)\n }, [width])\n\n const resolved = maxLines == null || measuring ? count : Math.min(visibleCount, count)\n return {\n containerRef,\n visibleCount: resolved,\n hiddenCount: Math.max(0, count - resolved),\n measuring,\n }\n}\n\n/** The wording of the pill controls' \"+N\" counter — shared by `PillsInput`, `MultiSelect`,\n * `TagsInput` and `TreeMultiSelect`, each taking it on its own `translations`. */\nexport type PillsInputTranslations = {\n /** What a screen reader hears for the \"+N\" counter, instead of \"plus 3\". Gets the hidden\n * count (for plural rules) and that count formatted for the locale.\n * Default `(count, n) => \\`${n} more items\\`` (\"item\" for one). */\n overflowCount?: (count: number, formatted: string) => string\n}\n\nconst englishPlural = new Intl.PluralRules(\"en-US\")\n\nexport const PILLS_INPUT_DEFAULT_TRANSLATIONS = {\n overflowCount: (count, formatted) =>\n `${formatted} more ${englishPlural.select(count) === \"one\" ? \"item\" : \"items\"}`,\n} as const satisfies Required<PillsInputTranslations>\n\nexport type PillOverflowCounterProps = {\n /** How many pills are hidden. */\n count: number\n size?: PillSize\n className?: string\n /** The owning control's `translations`; only `overflowCount` is read. */\n translations?: PillsInputTranslations\n}\n\n/** Static \"+N\" chip the pill controls render at the end of the visible rows.\n * Non-interactive: the \"+N\" is drawn in the locale's digits and sign (`+٣` in\n * `ar-EG`) and hidden from screen readers, which read `overflowCount` instead.\n * The full set stays reachable via the dropdown (where one exists) or the\n * consumer's own state. */\nexport const PillOverflowCounter = ({\n count,\n size = \"md\",\n className,\n translations,\n}: PillOverflowCounterProps) => {\n const locale = useLocale()\n // The one key it reads; an owner forwarding `{ overflowCount: undefined }` keeps the default.\n const overflowCount =\n translations?.overflowCount ?? PILLS_INPUT_DEFAULT_TRANSLATIONS.overflowCount\n return (\n // `relative`: contains the absolutely positioned `sr-only` text.\n <span data-overflow-counter className={cn(pill({ size }), \"relative tabular-nums\", className)}>\n <span aria-hidden>\n {new Intl.NumberFormat(locale, { signDisplay: \"always\" }).format(count)}\n </span>\n <span className=\"sr-only\">\n {overflowCount(count, new Intl.NumberFormat(locale).format(count))}\n </span>\n </span>\n )\n}\n\ntype PillsInputClassNames = {\n root?: string\n content?: string\n startSlot?: string\n endSlot?: string\n}\n\nexport type PillsInputProps = NoAsChild<Omit<HTMLArkProps<\"div\">, \"color\">> &\n WithTestId & {\n size?: InputSize\n variant?: InputVariant\n color?: Color\n invalid?: boolean\n disabled?: boolean\n pointer?: boolean\n /** Cap the pills at N rows; the rest collapse into a static \"+N\" counter. */\n maxLines?: number\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before any trailing control. */\n endSlot?: ReactNode\n classNames?: PillsInputClassNames\n /** The \"+N\" counter's screen-reader wording — see `PillsInputTranslations`. */\n translations?: PillsInputTranslations\n }\n\n/**\n * PillsInput — the wrapping input shell for multi-value fields. Host `Pill`s\n * and a single `PillsInput.Field` inside; the shell sizes and disables them\n * through context. Presentational by design: it holds no value state.\n *\n * `testId` here lands on the shell `<div>` itself — useful when `PillsInput`\n * is used bare. `PillsInput.Field` has its own `testId`, landing on the real\n * focusable `<input>`; prefer that one when targeting the field.\n */\nconst PillsInputBase = ({\n size = \"md\",\n variant = \"default\",\n color,\n invalid,\n disabled,\n pointer,\n maxLines,\n startSlot,\n endSlot,\n className,\n classNames,\n children,\n testId,\n translations,\n asChild: _asChild,\n ...rest\n}: PillsInputProps) => {\n // Convention: pills first, the field last. Only the pills feed the line cap;\n // the field always stays visible (it is never sliced away).\n const items = Children.toArray(children)\n const field = items.length > 0 ? items[items.length - 1] : null\n const pills = items.length > 0 ? items.slice(0, -1) : []\n\n const { containerRef, visibleCount, hiddenCount, measuring } = usePillOverflow({\n maxLines,\n count: pills.length,\n })\n\n const renderedPills = (maxLines == null ? pills : pills.slice(0, visibleCount)).map((child, i) =>\n isValidElement(child)\n ? cloneElement(child as ReactElement<Record<string, unknown>>, {\n key: child.key ?? i,\n \"data-overflow-item\": true,\n })\n : child,\n )\n\n return (\n <PillGroupContext.Provider value={{ size, disabled }}>\n <ark.div\n data-color={color}\n {...props({\n \"data-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-pointer\": pointer,\n // Slot-aware padding in `inputShell` — see InputBase for the rationale.\n \"data-with-start-slot\": startSlot != null,\n \"data-with-end-slot\": endSlot != null,\n \"data-testid\": testId,\n })}\n className={cn(inputShell({ size, variant }), pillsShell, className, classNames?.root)}\n {...rest}\n >\n {startSlot != null && (\n <span className={cn(inputSlot, classNames?.startSlot)} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={cn(pillsContent({ size }), classNames?.content)}>\n {renderedPills}\n {/* Mounted during the measuring pass so the hook can size the last-row\n reservation off the real counter, but kept `invisible` then (still\n measurable) so it never paints on the SSR HTML before the first\n measure. Only mounts while measuring when a cap is configured. */}\n {(hiddenCount > 0 || (measuring && maxLines != null)) && (\n <PillOverflowCounter\n count={measuring ? pills.length : hiddenCount}\n size={size}\n className={measuring ? \"invisible\" : undefined}\n translations={translations}\n />\n )}\n {field}\n </div>\n {endSlot != null && <span className={cn(inputSlot, classNames?.endSlot)}>{endSlot}</span>}\n </ark.div>\n </PillGroupContext.Provider>\n )\n}\n\nexport type PillsInputFieldProps = ComponentPropsWithoutRef<\"input\"> &\n WithTestId & {\n /** Fired on Backspace when the field is empty — pop the last value. */\n onRemoveLast?: () => void\n }\n\nconst PillsInputField = ({\n className,\n onRemoveLast,\n onKeyDown,\n testId,\n ...rest\n}: PillsInputFieldProps) => (\n <input\n // The trailing field the overflow hook keeps on the last visible row.\n data-overflow-field\n // Grow to fill the line, but keep a clickable minimum when empty. Overrides\n // `inputControlClasses`' `w-full min-w-0` so pills can share the row.\n className={cn(inputControlClasses, \"w-auto min-w-16\", className)}\n onKeyDown={(event) => {\n if (onRemoveLast && event.key === \"Backspace\" && event.currentTarget.value === \"\") {\n onRemoveLast()\n }\n onKeyDown?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const PillsInput = Object.assign(PillsInputBase, {\n Field: PillsInputField,\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/button-select/button-select.tsx","../src/components/button-select/button-select-items.ts","../src/components/button-select/button-select-control.tsx"],"names":["Ark","props","jsx"],"mappings":";;;;;;;;;;;AAqDA,IAAM,2BAA2B,aAAA,CAAiC;AAAA,EAChE,OAAA,EAAS,OAAA;AAAA,EACT,eAAA,EAAiB,QAAA;AAAA,EACjB,IAAA,EAAM;AACR,CAAC,CAAA;AAYD,IAAM,WAAA,GACJ,yKAAA;AAyBF,IAAM,aAAa,CAAC,CAAA,EAAsB,CAAA,KACxC,CAAA,CAAE,WAAW,CAAA,CAAE,MAAA,IAAU,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,EAAG,CAAA,KAAM,CAAA,KAAM,CAAA,CAAE,CAAC,CAAC,CAAA;AAYvD,IAAM,iBAAA,GAAoB,CAAC,KAAA,KAAsC;AAC/D,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,KAAA,CAAM,aAAA,EAAe;AAC1C,EAAA,MAAM,QAAA,GAAW,MAAM,aAAA,CAAc,aAAA;AAAA,IACnC;AAAA,GACF;AACA,EAAA,IAAI,CAAC,QAAA,EAAU;AACf,EAAA,KAAA,CAAM,eAAA,EAAgB;AACtB,EAAA,QAAA,CAAS,KAAA,CAAM,EAAE,aAAA,EAAe,IAAA,EAAM,CAAA;AACxC,CAAA;AAWA,IAAM,eAAA,GAAkB,CAAC,IAAA,KAAkB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AAA,EAAa,IAAA,EAAY,OAAc,QAAA,EAAoB;AAAA;AAAA;AAAA,GAC9D;AAEJ","file":"chunk-G3AD3NJG.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { ToggleGroup as Ark, useToggleGroupContext } from \"@ark-ui/react/toggle-group\"\nimport {\n Children,\n cloneElement,\n createContext,\n type FocusEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useContext,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from \"../button/button\"\nimport { buttonGroupVariants } from \"../button-group/button-group\"\nimport { fieldA11yProps } from \"../field/field\"\n\n/**\n * ButtonSelect / ButtonMultiSelect — compound parts.\n *\n * A row (or column) of real `Button`s joined like `ButtonGroup`, on Ark UI's\n * ToggleGroup machine. Every item renders through `Button` itself and only its\n * `variant` changes with the selection: unselected items take `variant`, the\n * selected ones `selectedVariant`. So the item styling — every variant × color,\n * sizes, `startSlot`/`endSlot`, hover, focus ring — has exactly one source, and\n * the join (flattened inner corners, collapsed hairlines, the hover/focus z-lift\n * and the filled/subtle seams) comes from `buttonGroupVariants` rather than a copy.\n *\n * Unlike `SegmentGroup` there is no sliding pill: a pill can't follow several\n * selected items at once, and the same parts back both the single and the\n * multiple form. The machine provides the semantics — `radiogroup` / `radio` +\n * `aria-checked` for single, `group` + `aria-pressed` for multiple — plus roving\n * focus with arrow keys and Home/End.\n *\n * `variant`, `selectedVariant` and `size` travel through a small context set once\n * on `Root`, so they aren't repeated on every `Item` (the Tabs pattern). `color`\n * is a plain `data-color` on `Root`, so it cascades to every item as CSS custom\n * properties; an item's own `color` re-stamps it on that one button.\n */\n\ntype StyleContextValue = {\n variant: ButtonVariant\n selectedVariant: ButtonVariant\n size: ButtonSize\n}\n\nconst ButtonSelectStyleContext = createContext<StyleContextValue>({\n variant: \"light\",\n selectedVariant: \"filled\",\n size: \"md\",\n})\n\n/**\n * The invalid cue is a ring on the whole group rather than red item borders: the\n * borderless `filled` / `subtle` items have no border to recolor, and the group\n * seams out-specify a per-item border anyway. A `ring` (box-shadow) is used, not\n * an `outline`, because the machine writes `outline: none` inline on the root.\n * `w-fit` keeps that ring hugging the items: inside `Field`'s flex column the\n * root would otherwise stretch to the field's full width. Under `grow` the root\n * spans that width on purpose, so `w-full` overrides it and the ring spans the\n * row with it.\n */\nconst invalidRing =\n \"w-fit rounded-button data-invalid:ring-1 data-invalid:ring-red-500 data-invalid:ring-offset-2 data-invalid:ring-offset-brand-50 dark:data-invalid:ring-offset-brand-950\"\n\ntype BaseRootProps = Omit<\n Ark.RootProps,\n \"color\" | \"multiple\" | \"value\" | \"defaultValue\" | \"onValueChange\" | \"deselectable\" | \"onChange\"\n> &\n WithTestId & {\n /** Palette for every item, as a `data-color` on the group. */\n color?: Color\n /** Treatment of the unselected items. */\n variant?: ButtonVariant\n /** Treatment of the selected items. */\n selectedVariant?: ButtonVariant\n size?: ButtonSize\n /** Red invalid ring around the group. */\n invalid?: boolean\n /** Span the container and give every item an even share of it, like a tab\n * bar. Without it the group hugs its items. */\n grow?: boolean\n /** Lands on the group root, which forwards focus to its active item. Ark's\n * prop types carry no `ref`, so it is declared here. */\n ref?: Ref<HTMLDivElement>\n children?: ReactNode\n }\n\nconst sameValues = (a: readonly string[], b: readonly string[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * Tab entry for a single-choice group. Every item is `tabindex=-1` while focus is\n * outside, so Tab lands on the root, and zag then forwards focus to the *first*\n * item regardless of the selection. A radio group should land on the checked\n * radio instead, so in single mode the root's own focus is caught in the capture\n * phase and sent to the selected (enabled) item. `stopPropagation` there stops\n * the native event before React's bubble listener runs, which is what keeps\n * zag's `ROOT.FOCUS` (and its deferred focus-first) from firing. With nothing\n * selected, zag's own behaviour stands.\n */\nconst focusSelectedItem = (event: FocusEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return\n const selected = event.currentTarget.querySelector<HTMLElement>(\n ':scope > [data-state=\"on\"]:not([disabled])',\n )\n if (!selected) return\n event.stopPropagation()\n selected.focus({ preventScroll: true })\n}\n\n/**\n * RTL arrow keys. zag's toggle-group reads `event.key` without passing `dir` to\n * `getEventKey` (its other machines do), so in a right-to-left locale ArrowLeft\n * moves focus visually *right*. In a horizontal RTL group the two keys are\n * caught in the capture phase, before zag's handler, and focus moves to the\n * visually adjacent enabled item instead; zag then picks up the new focus\n * through the item's own `onFocus`. `dir` is read off the root, where the\n * machine writes the locale's direction.\n */\nconst mirrorRtlArrows = (loop: boolean) => (event: KeyboardEvent<HTMLDivElement>) => {\n const root = event.currentTarget\n if (root.dir !== \"rtl\" || root.getAttribute(\"data-orientation\") !== \"horizontal\") return\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n const items = Array.from(\n root.querySelectorAll<HTMLElement>(':scope > [data-part=\"item\"]:not([disabled])'),\n )\n const index = items.indexOf(event.target as HTMLElement)\n if (index === -1) return\n event.preventDefault()\n event.stopPropagation()\n // Visually left is the next item in RTL, visually right the previous one.\n const step = event.key === \"ArrowLeft\" ? 1 : -1\n const next = loop\n ? items[(index + step + items.length) % items.length]\n : items[Math.min(Math.max(index + step, 0), items.length - 1)]\n next?.focus()\n}\n\n/** The shared root behind both `ButtonSelect.Root` and `ButtonMultiSelect.Root`. */\nexport const RootBase = ({\n multiple,\n value,\n defaultValue,\n onValueChange,\n deselectable,\n orientation = \"horizontal\",\n color,\n variant = \"light\",\n selectedVariant = \"filled\",\n size = \"md\",\n invalid,\n grow,\n loopFocus = true,\n className,\n testId,\n children,\n ...rest\n}: BaseRootProps & {\n multiple: boolean\n value?: string[]\n defaultValue?: string[]\n onValueChange?: (value: string[]) => void\n deselectable?: boolean\n}) => {\n const field = useFieldContext()\n // Owned here so a change can be compared with the current value: in a\n // non-deselectable single group the machine re-emits the same value when the\n // selected item is clicked again, and that is not a change.\n const [selected, setSelected] = useUncontrolled<string[]>({\n value,\n defaultValue,\n finalValue: [],\n onChange: onValueChange,\n })\n return (\n <ButtonSelectStyleContext.Provider value={{ variant, selectedVariant, size }}>\n <Ark.Root\n multiple={multiple}\n value={selected}\n onValueChange={(details) => {\n if (!sameValues(details.value, selected)) setSelected(details.value)\n }}\n deselectable={deselectable}\n orientation={orientation}\n loopFocus={loopFocus}\n onFocusCapture={multiple ? undefined : focusSelectedItem}\n onKeyDownCapture={mirrorRtlArrows(loopFocus)}\n data-color={color}\n {...props({ \"aria-invalid\": invalid, \"data-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={cn(\n buttonGroupVariants({ orientation, grow }),\n invalidRing,\n grow && \"w-full\",\n className,\n )}\n {...rest}\n >\n {children}\n </Ark.Root>\n </ButtonSelectStyleContext.Provider>\n )\n}\n\nexport type ButtonSelectRootProps = BaseRootProps & {\n /** Controlled value. `null` clears the selection. */\n value?: string | null\n /** Uncontrolled initial value. */\n defaultValue?: string | null\n /** Fires with the newly selected value — `null` only when `deselectable`. */\n onChange?: (value: string | null) => void\n /** Clicking the selected item clears the selection. Off by default, so the\n * group behaves like a radio group. */\n deselectable?: boolean\n}\n\nconst toArray = (value: string | null | undefined) =>\n value === undefined ? undefined : value === null ? [] : [value]\n\n/** Single-choice root: one selected item at most. */\nexport const Root = ({\n value,\n defaultValue,\n onChange,\n deselectable = false,\n ...rest\n}: ButtonSelectRootProps) => (\n <RootBase\n multiple={false}\n value={toArray(value)}\n defaultValue={toArray(defaultValue)}\n onValueChange={(next) => onChange?.(next[0] ?? null)}\n deselectable={deselectable}\n {...rest}\n />\n)\n\nexport type ButtonMultiSelectRootProps = BaseRootProps & {\n /** Controlled value. */\n value?: string[]\n /** Uncontrolled initial value. */\n defaultValue?: string[]\n /** Fires with every selected value, in selection order. */\n onChange?: (value: string[]) => void\n}\n\n/** Multiple-choice root: each item toggles independently. */\nexport const MultiRoot = ({ onChange, ...rest }: ButtonMultiSelectRootProps) => (\n <RootBase multiple onValueChange={onChange} {...rest} />\n)\n\n/** The props `Item` hands a custom control under `asChild`. */\ntype SelectableControlProps = { variant?: ButtonVariant; size?: ButtonSize }\n\nexport type ButtonSelectItemProps =\n | (Omit<ButtonProps, \"value\" | \"variant\" | \"size\" | \"loading\" | \"asChild\"> & {\n /** The value this item selects. */\n value: string\n asChild?: false\n })\n | {\n /** The value this item selects. */\n value: string\n disabled?: boolean\n /**\n * Render your own variant-aware control instead of a `Button` — e.g. an\n * `ActionIcon` for an icon-only toolbar. The single child receives the\n * selection-driven `variant` and the group `size` (its own `size` wins),\n * plus the machine's item props.\n */\n asChild: true\n children: ReactElement<SelectableControlProps>\n }\n\n/**\n * One option, rendered as a `Button`. Its `variant` follows the selection (from\n * `Root`'s `variant` / `selectedVariant`); every other `Button` prop — `color`,\n * `startSlot`, `endSlot`, `aria-label` for an icon-only item, `testId` — passes\n * through. The machine's item props land on the button via Ark's `asChild`.\n *\n * With `asChild`, the single child is rendered in place of the `Button` and\n * cloned with the same `variant` / `size`, so any control speaking the kit's\n * variant × size vocabulary (`ActionIcon`, a consumer's own) can be an item.\n */\nexport const Item = (props: ButtonSelectItemProps) => {\n const { variant, selectedVariant, size } = useContext(ButtonSelectStyleContext)\n const { value, disabled } = props\n const { pressed } = useToggleGroupContext().getItemState({ value, disabled })\n const resolvedVariant = pressed ? selectedVariant : variant\n if (props.asChild) {\n const child = Children.only(props.children)\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n {cloneElement(child, { variant: resolvedVariant, size: child.props.size ?? size })}\n </Ark.Item>\n )\n }\n const { value: _value, disabled: _disabled, asChild: _asChild, ...rest } = props\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n <Button variant={resolvedVariant} size={size} {...rest} />\n </Ark.Item>\n )\n}\n\n/**\n * One hidden input per selected value, so a native `<form>` submit carries the\n * selection under `name`. Rendered *beside* the root, never inside it: the join\n * selectors target the root's children by `:first-child` / `:last-child`, which a\n * trailing input would throw off.\n */\nexport const HiddenInputs = ({\n name,\n value,\n disabled,\n}: {\n name?: string\n value: readonly string[]\n disabled?: boolean\n}) =>\n name == null\n ? null\n : value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} disabled={disabled} />)\n\nexport const Context = Ark.Context\n","import type { ReactNode } from \"react\"\nimport type { Color } from \"../../lib/colors\"\n\n/**\n * One option of a data-driven `ButtonSelect` / `ButtonMultiSelect`: a bare\n * value-as-label string, or a labelled object. `payload` is arbitrary data the\n * machine ignores; it reaches `renderItem` typed off the `data` shape — the same\n * contract as `SegmentGroup` and `Select`.\n */\nexport type ButtonSelectItem<P = unknown> =\n | string\n | {\n value: string\n label?: ReactNode\n /** Content before the label, e.g. an icon (Button's `startSlot`). */\n startSlot?: ReactNode\n /** Content after the label (Button's `endSlot`). */\n endSlot?: ReactNode\n disabled?: boolean\n /** Overrides the group palette for this item. */\n color?: Color\n /** Accessible name — required when `label` is an icon only. */\n \"aria-label\"?: string\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered button. Defaults to `` `item-${value}` ``. */\n testId?: string\n }\n\n/** The `data` array both components are generic over. */\nexport type ButtonSelectData<P = unknown> = ReadonlyArray<ButtonSelectItem<P>>\n\n/** The value-string union of a `ButtonSelectData` shape; a `const` type\n * parameter narrows it to the literal union. */\nexport type ButtonSelectValue<Data extends ButtonSelectData> = ItemValue<Data[number]>\ntype ItemValue<E> = E extends string ? E : E extends { value: infer V extends string } ? V : never\n\n/** The `payload` type carried by a `ButtonSelectData` shape. */\nexport type ButtonSelectPayload<Data extends ButtonSelectData> = PayloadOf<Data[number]>\ntype PayloadOf<T> = T extends string ? never : T extends { payload?: infer P } ? P : never\n\n/** The item handed to `renderItem`, narrowed to the data's value and payload. */\nexport type RenderableButtonSelectItem<Data extends ButtonSelectData> = {\n value: ButtonSelectValue<Data>\n label: ReactNode\n disabled: boolean\n color: Color | undefined\n payload: ButtonSelectPayload<Data> | undefined\n}\n\n/** Live item state passed alongside the item to `renderItem`. */\nexport type ButtonSelectItemState = {\n selected: boolean\n disabled: boolean\n}\n\n/**\n * Render an item's label yourself. The item keeps its button, sizing, variant\n * and selection wiring; you fill its content. In an RSC tree the function must\n * live in a `\"use client\"` module.\n */\nexport type RenderButtonSelectItem<Data extends ButtonSelectData> = (\n item: RenderableButtonSelectItem<Data>,\n state: ButtonSelectItemState,\n) => ReactNode\n\n/** A fully resolved item — every field present (`label` falls back to `value`). */\nexport type NormalizedButtonSelectItem = {\n value: string\n label: ReactNode\n startSlot: ReactNode\n endSlot: ReactNode\n disabled: boolean\n color: Color | undefined\n ariaLabel: string | undefined\n payload: unknown\n testId: string\n}\n\nexport const normalizeButtonSelectItem = (item: ButtonSelectItem): NormalizedButtonSelectItem =>\n typeof item === \"string\"\n ? {\n value: item,\n label: item,\n startSlot: undefined,\n endSlot: undefined,\n disabled: false,\n color: undefined,\n ariaLabel: undefined,\n payload: undefined,\n testId: `item-${item}`,\n }\n : {\n value: item.value,\n label: item.label ?? item.value,\n startSlot: item.startSlot,\n endSlot: item.endSlot,\n disabled: item.disabled ?? false,\n color: item.color,\n ariaLabel: item[\"aria-label\"],\n payload: item.payload,\n testId: item.testId ?? `item-${item.value}`,\n }\n","\"use client\"\n\nimport type { FocusEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport type { ButtonSize, ButtonVariant } from \"../button/button\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport { HiddenInputs, Item, RootBase } from \"./button-select\"\nimport {\n type ButtonSelectData,\n normalizeButtonSelectItem,\n type RenderButtonSelectItem,\n} from \"./button-select-items\"\n\ntype ButtonSelectClassNames = {\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it. */\n label?: string\n root?: string\n item?: string\n}\n\n/** Props shared by the data-driven `ButtonSelect` and `ButtonMultiSelect`. */\nexport type ButtonSelectBaseProps<Data extends ButtonSelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Items: bare strings (`value === label`) or `{ value, label?, startSlot?, … }`. */\n data: Data\n /** Render each item's content yourself, with its typed `payload`. */\n renderItem?: RenderButtonSelectItem<Data>\n /** Lay the items in a row (default) or a column. */\n orientation?: \"horizontal\" | \"vertical\"\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Span the container and give every item an even share of it, like a tab\n * bar. Without it the group hugs its items. */\n grow?: boolean\n /** Dims and blocks every item. */\n disabled?: boolean\n size?: ButtonSize\n /** Treatment of the unselected items. Defaults to `light`. */\n variant?: ButtonVariant\n /** Treatment of the selected items. Defaults to `filled`. */\n selectedVariant?: ButtonVariant\n color?: Color\n /** Renders a hidden input per selected value for native form submission. */\n name?: string\n /** Explicit id for the group root. */\n id?: string\n /** Lands on the group root, which forwards focus to its active item. */\n ref?: Ref<HTMLDivElement>\n /** Forwarded to the root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n className?: string\n classNames?: ButtonSelectClassNames\n }\n\n/**\n * The rendering both data forms share: the `Field` wrapper, the group root, one\n * `Item` per entry and the hidden inputs. The public components only adapt their\n * value shape (`V | null` or `V[]`) onto the machine's `string[]`.\n */\nexport const ButtonSelectControl = ({\n multiple,\n deselectable,\n value,\n onValueChange,\n data,\n renderItem,\n orientation,\n invalid,\n grow,\n disabled,\n required,\n size = \"md\",\n variant,\n selectedVariant,\n color,\n name,\n id,\n ref,\n onBlur,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: ButtonSelectBaseProps<ButtonSelectData> & {\n multiple: boolean\n deselectable?: boolean\n value: readonly string[]\n onValueChange: (value: string[]) => void\n}) => {\n // Red state is driven 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 items = data.map(normalizeButtonSelectItem)\n\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 <RootBase\n multiple={multiple}\n deselectable={deselectable}\n value={[...value]}\n onValueChange={onValueChange}\n orientation={orientation}\n disabled={disabled}\n invalid={isInvalid}\n grow={grow}\n size={size}\n variant={variant}\n selectedVariant={selectedVariant}\n color={color}\n id={id}\n ref={ref}\n onBlur={onBlur}\n testId={testId}\n className={cn(className, classNames?.root)}\n >\n {items.map((item) => (\n <Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n color={item.color}\n startSlot={item.startSlot}\n endSlot={item.endSlot}\n aria-label={item.ariaLabel}\n testId={item.testId}\n className={classNames?.item}\n >\n {renderItem\n ? renderItem(item, {\n selected: value.includes(item.value),\n disabled: Boolean(disabled) || item.disabled,\n })\n : item.label}\n </Item>\n ))}\n </RootBase>\n <HiddenInputs name={name} value={value} disabled={disabled} />\n </FieldShell>\n )\n}\n"]}
|