@42-central/ui-react 0.29.1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-X6DESK37.js → chunk-2RRTT4AF.js} +17 -5
- package/dist/chunk-2RRTT4AF.js.map +1 -0
- package/dist/{chunk-TUP7WXQE.js → chunk-322I2RSV.js} +9 -6
- package/dist/chunk-322I2RSV.js.map +1 -0
- package/dist/{chunk-ISX3AM32.js → chunk-37SRSNLJ.js} +4 -4
- package/dist/{chunk-ISX3AM32.js.map → chunk-37SRSNLJ.js.map} +1 -1
- package/dist/{chunk-L5GH7LLD.js → chunk-3MFWUG5O.js} +4 -4
- package/dist/{chunk-L5GH7LLD.js.map → chunk-3MFWUG5O.js.map} +1 -1
- package/dist/{chunk-FQJNQW3G.js → chunk-3XQEOJCE.js} +8 -5
- package/dist/chunk-3XQEOJCE.js.map +1 -0
- package/dist/{chunk-JKFPRQB2.js → chunk-4LSZ5JWF.js} +3 -3
- package/dist/{chunk-JKFPRQB2.js.map → chunk-4LSZ5JWF.js.map} +1 -1
- package/dist/{chunk-V2QZG4IT.js → chunk-5HWFYYHW.js} +27 -9
- package/dist/chunk-5HWFYYHW.js.map +1 -0
- package/dist/{chunk-GEZYGBXY.js → chunk-6MVFCS46.js} +99 -42
- package/dist/chunk-6MVFCS46.js.map +1 -0
- package/dist/{chunk-NNPSBC7O.js → chunk-6WZSUS3U.js} +10 -9
- package/dist/chunk-6WZSUS3U.js.map +1 -0
- package/dist/chunk-6YRGP6PS.js +138 -0
- package/dist/chunk-6YRGP6PS.js.map +1 -0
- package/dist/{chunk-B5YHYI7E.js → chunk-ALANKV5Y.js} +23 -6
- package/dist/chunk-ALANKV5Y.js.map +1 -0
- package/dist/{chunk-IA6DCC3N.js → chunk-AUQPNDE5.js} +23 -13
- package/dist/chunk-AUQPNDE5.js.map +1 -0
- package/dist/{chunk-AKXALCUN.js → chunk-D7SW2E24.js} +4 -4
- package/dist/chunk-D7SW2E24.js.map +1 -0
- package/dist/{chunk-OXR7BXZA.js → chunk-DQIYYDFD.js} +4 -3
- package/dist/chunk-DQIYYDFD.js.map +1 -0
- package/dist/{chunk-HMNXNKDA.js → chunk-FCBYUN6F.js} +4 -4
- package/dist/{chunk-HMNXNKDA.js.map → chunk-FCBYUN6F.js.map} +1 -1
- package/dist/{chunk-2W7H43WL.js → chunk-FED6SJWM.js} +23 -14
- package/dist/chunk-FED6SJWM.js.map +1 -0
- package/dist/{chunk-7E7JNWOC.js → chunk-FEPIHXVI.js} +6 -5
- package/dist/chunk-FEPIHXVI.js.map +1 -0
- package/dist/{chunk-Y57NW6G7.js → chunk-G3YOSG3U.js} +4 -4
- package/dist/{chunk-Y57NW6G7.js.map → chunk-G3YOSG3U.js.map} +1 -1
- package/dist/chunk-GZN5CXMR.js +100 -0
- package/dist/chunk-GZN5CXMR.js.map +1 -0
- package/dist/{chunk-HCHGERDB.js → chunk-HCSZPBWV.js} +17 -115
- package/dist/chunk-HCSZPBWV.js.map +1 -0
- package/dist/{chunk-I4B3N3UX.js → chunk-HTVICHT4.js} +12 -7
- package/dist/chunk-HTVICHT4.js.map +1 -0
- package/dist/chunk-I7TC2C3I.js +163 -0
- package/dist/chunk-I7TC2C3I.js.map +1 -0
- package/dist/{chunk-7FPSQBWB.js → chunk-IBXYLO2J.js} +14 -13
- package/dist/chunk-IBXYLO2J.js.map +1 -0
- package/dist/{chunk-7KFUFAVP.js → chunk-IRYG6B5A.js} +9 -8
- package/dist/chunk-IRYG6B5A.js.map +1 -0
- package/dist/{chunk-2RQLPN4U.js → chunk-JCNEW4WJ.js} +8 -8
- package/dist/{chunk-2RQLPN4U.js.map → chunk-JCNEW4WJ.js.map} +1 -1
- package/dist/{chunk-SP6LCCTZ.js → chunk-KZDMVOL6.js} +35 -8
- package/dist/chunk-KZDMVOL6.js.map +1 -0
- package/dist/chunk-LR5U6TZZ.js +169 -0
- package/dist/chunk-LR5U6TZZ.js.map +1 -0
- package/dist/{chunk-MQHD3EJE.js → chunk-LZHZJWVM.js} +6 -4
- package/dist/chunk-LZHZJWVM.js.map +1 -0
- package/dist/{chunk-5EOMSWNO.js → chunk-MAM2X3MW.js} +5 -5
- package/dist/{chunk-5EOMSWNO.js.map → chunk-MAM2X3MW.js.map} +1 -1
- package/dist/{chunk-FSPS7TVD.js → chunk-MCMS4NMO.js} +5 -5
- package/dist/{chunk-FSPS7TVD.js.map → chunk-MCMS4NMO.js.map} +1 -1
- package/dist/{chunk-ZB5VMGKB.js → chunk-MV5DIE2T.js} +15 -4
- package/dist/chunk-MV5DIE2T.js.map +1 -0
- package/dist/chunk-NDI4HLQE.js +41 -0
- package/dist/chunk-NDI4HLQE.js.map +1 -0
- package/dist/{chunk-B4GNSSHU.js → chunk-NLJEQZQQ.js} +3 -3
- package/dist/{chunk-B4GNSSHU.js.map → chunk-NLJEQZQQ.js.map} +1 -1
- package/dist/{chunk-SBZJGFZ6.js → chunk-QHT4DCXE.js} +8 -7
- package/dist/chunk-QHT4DCXE.js.map +1 -0
- package/dist/{chunk-I4IJOLNA.js → chunk-RMUBCTEF.js} +5 -5
- package/dist/{chunk-I4IJOLNA.js.map → chunk-RMUBCTEF.js.map} +1 -1
- package/dist/{chunk-G3AD3NJG.js → chunk-RNTDM3RP.js} +9 -5
- package/dist/chunk-RNTDM3RP.js.map +1 -0
- package/dist/chunk-RPFN6ETQ.js +509 -0
- package/dist/chunk-RPFN6ETQ.js.map +1 -0
- package/dist/{chunk-HWBFRDX7.js → chunk-SI7C3W5M.js} +28 -9
- package/dist/chunk-SI7C3W5M.js.map +1 -0
- package/dist/chunk-TPOV3OCC.js +234 -0
- package/dist/chunk-TPOV3OCC.js.map +1 -0
- package/dist/{chunk-IANYMDKH.js → chunk-UBQ54W46.js} +4 -4
- package/dist/chunk-UBQ54W46.js.map +1 -0
- package/dist/{chunk-QVOBLRCM.js → chunk-UIKQ4X6W.js} +3 -3
- package/dist/{chunk-QVOBLRCM.js.map → chunk-UIKQ4X6W.js.map} +1 -1
- package/dist/chunk-UOWQH53N.js +70 -0
- package/dist/chunk-UOWQH53N.js.map +1 -0
- package/dist/{chunk-QRNQQIQM.js → chunk-WJUY6YWF.js} +52 -20
- package/dist/chunk-WJUY6YWF.js.map +1 -0
- package/dist/{chunk-3KARNPW4.js → chunk-WKIUMLRT.js} +3 -3
- package/dist/{chunk-3KARNPW4.js.map → chunk-WKIUMLRT.js.map} +1 -1
- package/dist/chunk-X6RB74JN.js +37 -0
- package/dist/chunk-X6RB74JN.js.map +1 -0
- package/dist/chunk-XQ6L2CM5.js +83 -0
- package/dist/chunk-XQ6L2CM5.js.map +1 -0
- package/dist/{chunk-RKCUXOU2.js → chunk-YUVKROMA.js} +44 -7
- package/dist/chunk-YUVKROMA.js.map +1 -0
- package/dist/components/action-icon/action-icon.d.ts +9 -2
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +5 -1
- package/dist/components/alert/index.js +4 -4
- package/dist/components/anchor/anchor.d.ts +45 -0
- package/dist/components/anchor/anchor.d.ts.map +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.d.ts.map +1 -0
- package/dist/components/anchor/index.js +11 -0
- package/dist/components/anchor/index.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +10 -6
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +23 -24
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +15 -9
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/button/button.d.ts +15 -2
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +5 -1
- package/dist/components/button-multi-select/index.js +6 -4
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/button-select-control.d.ts.map +1 -1
- package/dist/components/button-select/button-select.d.ts +2 -2
- package/dist/components/button-select/button-select.d.ts.map +1 -1
- package/dist/components/button-select/index.js +6 -4
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/aliases.d.ts +16 -0
- package/dist/components/calendar/aliases.d.ts.map +1 -0
- package/dist/components/calendar/calendar-body.d.ts +11 -1
- package/dist/components/calendar/calendar-body.d.ts.map +1 -1
- package/dist/components/calendar/calendar.d.ts +8 -4
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/calendar/index.d.ts.map +1 -1
- package/dist/components/calendar/index.js +15 -5
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
- package/dist/components/calendar-heatmap/index.js +85 -73
- package/dist/components/calendar-heatmap/index.js.map +1 -1
- package/dist/components/camera/index.js +16 -14
- package/dist/components/carousel/index.js +3 -3
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/choice-card-group/index.js +2 -2
- package/dist/components/choice-card-group/index.js.map +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +22 -11
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.d.ts +1 -1
- package/dist/components/circular-progress/index.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js +68 -49
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/index.js +7 -3
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code/code.d.ts +10 -0
- package/dist/components/code/code.d.ts.map +1 -1
- package/dist/components/code/index.js +1 -0
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +10 -6
- package/dist/components/code-block/index.js +10 -7
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +5 -3
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +12 -7
- package/dist/components/combobox-list/combobox-list.d.ts +1 -1
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +14 -9
- package/dist/components/compare/index.js +1 -1
- package/dist/components/data-list/data-list.d.ts +96 -0
- package/dist/components/data-list/data-list.d.ts.map +1 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.d.ts.map +1 -0
- package/dist/components/data-list/index.js +147 -0
- package/dist/components/data-list/index.js.map +1 -0
- package/dist/components/data-table/data-table-group.d.ts.map +1 -1
- package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
- package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts +5 -2
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.js +163 -168
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/aliases.d.ts +16 -0
- package/dist/components/date-picker/aliases.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +22 -8
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +34 -28
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/download-button/index.js +6 -2
- package/dist/components/drawer/drawer.d.ts +7 -4
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.js +11 -6
- package/dist/components/empty-state/empty-state.d.ts +57 -0
- package/dist/components/empty-state/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/empty-state/index.d.ts.map +1 -0
- package/dist/components/empty-state/index.js +8 -0
- package/dist/components/empty-state/index.js.map +1 -0
- package/dist/components/field/field.d.ts +20 -0
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/fieldset/fieldset.d.ts +103 -0
- package/dist/components/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/fieldset/index.d.ts.map +1 -0
- package/dist/components/fieldset/index.js +150 -0
- package/dist/components/fieldset/index.js.map +1 -0
- package/dist/components/file-item/index.js +10 -7
- package/dist/components/file-preview/file-preview.d.ts.map +1 -1
- package/dist/components/file-preview/index.js +10 -18
- package/dist/components/file-preview/index.js.map +1 -1
- package/dist/components/file-trigger/index.js +6 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +18 -14
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/gallery/index.js +3 -3
- package/dist/components/geodesic/a11y.d.ts +3 -3
- package/dist/components/geodesic/a11y.d.ts.map +1 -1
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/index.js +10 -3
- package/dist/components/hover-card/index.js.map +1 -1
- package/dist/components/image/index.js +3 -3
- package/dist/components/image-cropper/index.js +9 -6
- package/dist/components/input/index.js +2 -2
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/kbd/index.js +3 -3
- package/dist/components/kbd/kbd.d.ts +4 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/lightbox/index.js +13 -11
- package/dist/components/lightbox/index.js.map +1 -1
- package/dist/components/menu/index.js +9 -5
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/modal/index.js +11 -6
- package/dist/components/modal/modal.d.ts +10 -4
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +13 -9
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +13 -10
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +4 -4
- package/dist/components/nav-link/tanstack.js +4 -4
- package/dist/components/notification/index.js +6 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/number-input/index.js +11 -7
- package/dist/components/number-input/number-input.d.ts +1 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/dialog-parts.d.ts +10 -1
- package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
- package/dist/components/overlays/index.js +13 -8
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +362 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +147 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/password-input/index.js +6 -5
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +1 -1
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/phone-input/index.js +14 -11
- package/dist/components/phone-input/index.js.map +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/photo-capture/index.js +19 -17
- package/dist/components/photo-capture/index.js.map +1 -1
- package/dist/components/pills-input/index.js +4 -4
- package/dist/components/pills-input/pills-input.d.ts +1 -1
- package/dist/components/pills-input/pills-input.d.ts.map +1 -1
- package/dist/components/pin-input/index.js +6 -5
- package/dist/components/pin-input/index.js.map +1 -1
- package/dist/components/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/popover/index.js +7 -2
- package/dist/components/popover/popover.d.ts +41 -16
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.d.ts +1 -1
- package/dist/components/progress/index.d.ts.map +1 -1
- package/dist/components/progress/index.js +4 -1
- package/dist/components/progress/progress.d.ts +22 -14
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/prose/index.d.ts +2 -0
- package/dist/components/prose/index.d.ts.map +1 -0
- package/dist/components/prose/index.js +17 -0
- package/dist/components/prose/index.js.map +1 -0
- package/dist/components/prose/prose.d.ts +49 -0
- package/dist/components/prose/prose.d.ts.map +1 -0
- package/dist/components/prose/styles.css +593 -0
- package/dist/components/radio-group/index.js +9 -3
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/rating/index.js +3 -2
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.js +10 -8
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.d.ts.map +1 -0
- package/dist/components/scroll-area/index.js +10 -0
- package/dist/components/scroll-area/index.js.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +150 -0
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/components/segment-group/index.js +2 -2
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.js +12 -8
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/splitter/index.d.ts.map +1 -0
- package/dist/components/splitter/index.js +373 -0
- package/dist/components/splitter/index.js.map +1 -0
- package/dist/components/splitter/splitter.d.ts +159 -0
- package/dist/components/splitter/splitter.d.ts.map +1 -0
- package/dist/components/spotlight/index.js +23 -22
- package/dist/components/spotlight/index.js.map +1 -1
- package/dist/components/spotlight/spotlight.d.ts.map +1 -1
- package/dist/components/steps/index.d.ts +4 -0
- package/dist/components/steps/index.d.ts.map +1 -0
- package/dist/components/steps/index.js +478 -0
- package/dist/components/steps/index.js.map +1 -0
- package/dist/components/steps/steps-data.d.ts +78 -0
- package/dist/components/steps/steps-data.d.ts.map +1 -0
- package/dist/components/steps/steps.d.ts +183 -0
- package/dist/components/steps/steps.d.ts.map +1 -0
- package/dist/components/switch/index.js +4 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/table-of-contents/index.d.ts +2 -0
- package/dist/components/table-of-contents/index.d.ts.map +1 -0
- package/dist/components/table-of-contents/index.js +471 -0
- package/dist/components/table-of-contents/index.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
- package/dist/components/tags-input/index.js +12 -9
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +1 -1
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +8 -6
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/time-input/index.js +11 -9
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +3 -8
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tour/conditions.d.ts +83 -0
- package/dist/components/tour/conditions.d.ts.map +1 -0
- package/dist/components/tour/create-tours.d.ts +49 -0
- package/dist/components/tour/create-tours.d.ts.map +1 -0
- package/dist/components/tour/index.d.ts +6 -0
- package/dist/components/tour/index.d.ts.map +1 -0
- package/dist/components/tour/index.js +1449 -0
- package/dist/components/tour/index.js.map +1 -0
- package/dist/components/tour/runtime.d.ts +57 -0
- package/dist/components/tour/runtime.d.ts.map +1 -0
- package/dist/components/tour/storage.d.ts +14 -0
- package/dist/components/tour/storage.d.ts.map +1 -0
- package/dist/components/tour/store.d.ts +62 -0
- package/dist/components/tour/store.d.ts.map +1 -0
- package/dist/components/tour/tour.d.ts +77 -0
- package/dist/components/tour/tour.d.ts.map +1 -0
- package/dist/components/tour/types.d.ts +680 -0
- package/dist/components/tour/types.d.ts.map +1 -0
- package/dist/components/tree/index.d.ts +3 -0
- package/dist/components/tree/index.d.ts.map +1 -0
- package/dist/components/tree/index.js +457 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/components/tree/tree-row.d.ts +72 -0
- package/dist/components/tree/tree-row.d.ts.map +1 -0
- package/dist/components/tree/tree.d.ts +193 -0
- package/dist/components/tree/tree.d.ts.map +1 -0
- package/dist/components/tree-multi-select/index.js +31 -54
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +30 -24
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-popover.d.ts +20 -31
- package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +1 -1
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/date-predicates.d.ts +7 -5
- package/dist/lib/date-predicates.d.ts.map +1 -1
- package/dist/lib/date-value.d.ts +20 -0
- package/dist/lib/date-value.d.ts.map +1 -1
- package/dist/lib/floating-arrow.d.ts +53 -0
- package/dist/lib/floating-arrow.d.ts.map +1 -0
- package/dist/lib/focus-return.d.ts +53 -0
- package/dist/lib/focus-return.d.ts.map +1 -0
- package/dist/lib/meter.d.ts +104 -0
- package/dist/lib/meter.d.ts.map +1 -0
- package/dist/lib/overlay-layer.d.ts +26 -8
- package/dist/lib/overlay-layer.d.ts.map +1 -1
- package/dist/lib/pressed.d.ts +92 -0
- package/dist/lib/pressed.d.ts.map +1 -0
- package/dist/lib/tree-data.d.ts +18 -2
- package/dist/lib/tree-data.d.ts.map +1 -1
- package/dist/lib/use-pagination.d.ts +102 -0
- package/dist/lib/use-pagination.d.ts.map +1 -0
- package/dist/lib/use-scroll-spy.d.ts +126 -0
- package/dist/lib/use-scroll-spy.d.ts.map +1 -0
- package/dist/theme.css +39 -3
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +283 -1
- package/src/components/action-icon/action-icon.tsx +34 -4
- package/src/components/anchor/anchor.test.tsx +232 -0
- package/src/components/anchor/anchor.tsx +187 -0
- package/src/components/anchor/index.ts +12 -0
- package/src/components/app-shell/app-shell.test.tsx +15 -7
- package/src/components/app-shell/app-shell.tsx +27 -20
- package/src/components/autocomplete/autocomplete.tsx +11 -3
- package/src/components/button/button-pressed.test.tsx +202 -0
- package/src/components/button/button.tsx +48 -6
- package/src/components/button-select/button-select-control.tsx +2 -2
- package/src/components/button-select/button-select.tsx +22 -2
- package/src/components/calendar/aliases.tsx +28 -0
- package/src/components/calendar/calendar-body.tsx +310 -210
- package/src/components/calendar/calendar.tsx +43 -12
- package/src/components/calendar/index.ts +7 -1
- package/src/components/calendar/month-year-calendar.test.tsx +106 -0
- package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
- package/src/components/checkbox/checkbox.tsx +7 -2
- package/src/components/choice-card-group/choice-card-group.tsx +2 -2
- package/src/components/circular-progress/circular-progress.test.tsx +35 -0
- package/src/components/circular-progress/circular-progress.tsx +116 -59
- package/src/components/circular-progress/index.ts +1 -0
- package/src/components/code/code.test.tsx +16 -0
- package/src/components/code/code.tsx +11 -0
- package/src/components/combobox/combobox.tsx +63 -28
- package/src/components/combobox-list/combobox-list.tsx +11 -3
- package/src/components/data-list/data-list.test.tsx +149 -0
- package/src/components/data-list/data-list.tsx +268 -0
- package/src/components/data-list/index.ts +9 -0
- package/src/components/data-table/data-table-group.test.tsx +16 -0
- package/src/components/data-table/data-table-group.tsx +15 -2
- package/src/components/data-table/data-table-placeholder.tsx +28 -36
- package/src/components/data-table/data-table-stack.tsx +33 -39
- package/src/components/data-table/data-table.test.tsx +31 -0
- package/src/components/data-table/data-table.tsx +41 -42
- package/src/components/date-picker/aliases.tsx +28 -0
- package/src/components/date-picker/date-picker.test.tsx +29 -0
- package/src/components/date-picker/date-picker.tsx +164 -45
- package/src/components/date-picker/index.ts +5 -1
- package/src/components/date-picker/month-year-picker.test.tsx +362 -0
- package/src/components/drawer/drawer.test.tsx +41 -0
- package/src/components/drawer/drawer.tsx +7 -1
- package/src/components/empty-state/empty-state.test.tsx +109 -0
- package/src/components/empty-state/empty-state.tsx +180 -0
- package/src/components/empty-state/index.ts +9 -0
- package/src/components/field/field.tsx +35 -1
- package/src/components/fieldset/fieldset.test.tsx +352 -0
- package/src/components/fieldset/fieldset.tsx +268 -0
- package/src/components/fieldset/index.ts +11 -0
- package/src/components/file-preview/file-preview.test.tsx +2 -1
- package/src/components/file-preview/file-preview.tsx +7 -13
- package/src/components/file-upload/file-upload.tsx +14 -5
- package/src/components/hover-card/hover-card.tsx +5 -1
- package/src/components/input/input.tsx +12 -5
- package/src/components/kbd/kbd.test.tsx +13 -0
- package/src/components/kbd/kbd.tsx +6 -0
- package/src/components/menu/menu.tsx +6 -2
- package/src/components/modal/modal.test.tsx +41 -0
- package/src/components/modal/modal.tsx +17 -9
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
- package/src/components/multi-select/multi-select.tsx +11 -3
- package/src/components/notification/create-notifier.tsx +1 -1
- package/src/components/number-input/number-input.tsx +12 -3
- package/src/components/overlays/dialog-parts.tsx +42 -5
- package/src/components/pagination/index.ts +19 -0
- package/src/components/pagination/pagination.test.tsx +187 -0
- package/src/components/pagination/pagination.tsx +563 -0
- package/src/components/password-input/password-input.tsx +12 -3
- package/src/components/phone-input/phone-input.tsx +12 -3
- package/src/components/pills-input/pills-input.tsx +7 -2
- package/src/components/pin-input/pin-input.tsx +13 -4
- package/src/components/popover/popover.tsx +87 -17
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/progress.test.tsx +102 -0
- package/src/components/progress/progress.tsx +116 -62
- package/src/components/prose/index.ts +1 -0
- package/src/components/prose/prose.test.tsx +90 -0
- package/src/components/prose/prose.tsx +60 -0
- package/src/components/prose/styles.css +593 -0
- package/src/components/radio-group/radio-group.tsx +8 -3
- package/src/components/rating/rating.tsx +5 -2
- package/src/components/scroll-area/index.ts +18 -0
- package/src/components/scroll-area/scroll-area.test.tsx +184 -0
- package/src/components/scroll-area/scroll-area.tsx +448 -0
- package/src/components/segment-group/segment-group.tsx +2 -2
- package/src/components/select/select.tsx +37 -18
- package/src/components/slider/slider.tsx +2 -2
- package/src/components/splitter/index.ts +15 -0
- package/src/components/splitter/splitter.test.tsx +244 -0
- package/src/components/splitter/splitter.tsx +625 -0
- package/src/components/spotlight/spotlight.test.tsx +34 -26
- package/src/components/spotlight/spotlight.tsx +7 -9
- package/src/components/steps/index.ts +21 -0
- package/src/components/steps/steps-data.tsx +179 -0
- package/src/components/steps/steps.test.tsx +235 -0
- package/src/components/steps/steps.tsx +686 -0
- package/src/components/switch/switch.tsx +7 -2
- package/src/components/table-of-contents/index.ts +17 -0
- package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
- package/src/components/table-of-contents/table-of-contents.tsx +708 -0
- package/src/components/tags-input/tags-input.tsx +12 -3
- package/src/components/textarea/textarea.tsx +15 -5
- package/src/components/tooltip/tooltip.tsx +8 -17
- package/src/components/tour/conditions.test.ts +527 -0
- package/src/components/tour/conditions.ts +445 -0
- package/src/components/tour/create-tours.tsx +150 -0
- package/src/components/tour/index.ts +86 -0
- package/src/components/tour/runtime.ts +187 -0
- package/src/components/tour/storage.test.ts +68 -0
- package/src/components/tour/storage.ts +44 -0
- package/src/components/tour/store.test.tsx +784 -0
- package/src/components/tour/store.ts +661 -0
- package/src/components/tour/tour.test.tsx +318 -0
- package/src/components/tour/tour.tsx +773 -0
- package/src/components/tour/tour.types.test.ts +185 -0
- package/src/components/tour/types.ts +904 -0
- package/src/components/tree/index.ts +24 -0
- package/src/components/tree/tree-row.tsx +179 -0
- package/src/components/tree/tree.test.tsx +296 -0
- package/src/components/tree/tree.tsx +796 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
- package/src/components/tree-select/tree-popover.tsx +26 -107
- package/src/components/tree-select/tree-select.tsx +24 -16
- package/src/icon-stroke.test.tsx +2 -0
- package/src/index.ts +16 -0
- package/src/lib/date-predicates.test.ts +46 -0
- package/src/lib/date-predicates.ts +44 -24
- package/src/lib/date-value.test.ts +24 -1
- package/src/lib/date-value.ts +42 -1
- package/src/lib/floating-arrow.tsx +73 -0
- package/src/lib/focus-return.test.tsx +143 -0
- package/src/lib/focus-return.ts +106 -0
- package/src/lib/meter.test.ts +40 -0
- package/src/lib/meter.ts +159 -0
- package/src/lib/overlay-layer.test.tsx +47 -1
- package/src/lib/overlay-layer.tsx +65 -8
- package/src/lib/pressed.ts +130 -0
- package/src/lib/tree-data.ts +42 -2
- package/src/lib/use-pagination.test.ts +105 -0
- package/src/lib/use-pagination.ts +179 -0
- package/src/lib/use-scroll-spy.test.tsx +238 -0
- package/src/lib/use-scroll-spy.ts +336 -0
- package/src/theme.css +39 -3
- package/src/theme.test.ts +29 -1
- package/src/visually-hidden-containment.test.tsx +9 -0
- package/dist/chunk-2W7H43WL.js.map +0 -1
- package/dist/chunk-7E7JNWOC.js.map +0 -1
- package/dist/chunk-7FPSQBWB.js.map +0 -1
- package/dist/chunk-7KFUFAVP.js.map +0 -1
- package/dist/chunk-AKXALCUN.js.map +0 -1
- package/dist/chunk-B5YHYI7E.js.map +0 -1
- package/dist/chunk-FQJNQW3G.js.map +0 -1
- package/dist/chunk-G3AD3NJG.js.map +0 -1
- package/dist/chunk-GEZYGBXY.js.map +0 -1
- package/dist/chunk-HCHGERDB.js.map +0 -1
- package/dist/chunk-HWBFRDX7.js.map +0 -1
- package/dist/chunk-I4B3N3UX.js.map +0 -1
- package/dist/chunk-IA6DCC3N.js.map +0 -1
- package/dist/chunk-IANYMDKH.js.map +0 -1
- package/dist/chunk-MQHD3EJE.js.map +0 -1
- package/dist/chunk-NNPSBC7O.js.map +0 -1
- package/dist/chunk-OXR7BXZA.js.map +0 -1
- package/dist/chunk-QKSLDQM2.js +0 -120
- package/dist/chunk-QKSLDQM2.js.map +0 -1
- package/dist/chunk-QRNQQIQM.js.map +0 -1
- package/dist/chunk-RKCUXOU2.js.map +0 -1
- package/dist/chunk-S5CQRCTF.js +0 -426
- package/dist/chunk-S5CQRCTF.js.map +0 -1
- package/dist/chunk-SBZJGFZ6.js.map +0 -1
- package/dist/chunk-SP6LCCTZ.js.map +0 -1
- package/dist/chunk-TUP7WXQE.js.map +0 -1
- package/dist/chunk-V2QZG4IT.js.map +0 -1
- package/dist/chunk-X6DESK37.js.map +0 -1
- package/dist/chunk-ZB5VMGKB.js.map +0 -1
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { ark, type HTMLArkProps } from "@ark-ui/react"
|
|
4
|
+
import {
|
|
5
|
+
Pagination as ArkPagination,
|
|
6
|
+
usePagination as useArkPagination,
|
|
7
|
+
} from "@ark-ui/react/pagination"
|
|
8
|
+
import { cva } from "class-variance-authority"
|
|
9
|
+
import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, Ellipsis } from "lucide-react"
|
|
10
|
+
import { type ComponentPropsWithoutRef, createContext, type ReactNode, useContext } from "react"
|
|
11
|
+
import { match } from "ts-pattern"
|
|
12
|
+
import { composeChildren, type NoAsChild } from "../../lib/as-child"
|
|
13
|
+
import { buttonColorVariants } from "../../lib/button-colors"
|
|
14
|
+
import { cn } from "../../lib/cn"
|
|
15
|
+
import type { Color } from "../../lib/colors"
|
|
16
|
+
import { focusStyles } from "../../lib/focus-styles"
|
|
17
|
+
import { type IconMap, iconStroke, mergeIcons } from "../../lib/icons"
|
|
18
|
+
import { useLocale } from "../../lib/intl"
|
|
19
|
+
import { useLinkComponent } from "../../lib/link-component"
|
|
20
|
+
import { props } from "../../lib/props"
|
|
21
|
+
import type { Size } from "../../lib/sizes"
|
|
22
|
+
import type { WithTestId } from "../../lib/test-id"
|
|
23
|
+
import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
|
|
24
|
+
import {
|
|
25
|
+
type UsePaginationOptions,
|
|
26
|
+
type UsePaginationReturnValue,
|
|
27
|
+
usePagination,
|
|
28
|
+
} from "../../lib/use-pagination"
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Pagination — a row of page buttons (or links) with previous/next controls,
|
|
32
|
+
* for moving through a list that is split into pages.
|
|
33
|
+
*
|
|
34
|
+
* Built on Ark's `pagination` machine, which owns the parts' ARIA and the
|
|
35
|
+
* link hrefs, and on the kit's `usePagination` hook, which owns the page
|
|
36
|
+
* state and the ellipsis math. The current page is drawn in `variant` ×
|
|
37
|
+
* `color`, the same model as `Button` and `ActionIcon`; the other pages and
|
|
38
|
+
* the controls stay neutral.
|
|
39
|
+
*
|
|
40
|
+
* <Pagination count={95} pageSize={10} />
|
|
41
|
+
* <Pagination pages={12} page={page} onPageChange={setPage} withEdges />
|
|
42
|
+
* <Pagination pages={12} getPageUrl={(page) => `/blog?page=${page}`} />
|
|
43
|
+
* <Pagination pages={12} display="compact" />
|
|
44
|
+
*
|
|
45
|
+
* Compose `Pagination.Root` with `.First`, `.Prev`, `.Items`, `.Label`,
|
|
46
|
+
* `.Next` and `.Last` for a layout the props don't cover.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
const itemVariants = cva(
|
|
50
|
+
[
|
|
51
|
+
"inline-flex shrink-0 select-none items-center justify-center",
|
|
52
|
+
"rounded-md border border-transparent font-medium tabular-nums no-underline",
|
|
53
|
+
"transition-colors-radius",
|
|
54
|
+
focusStyles(),
|
|
55
|
+
"[:where(&)_svg]:shrink-0 [:where(&)_svg]:pointer-events-none",
|
|
56
|
+
],
|
|
57
|
+
{
|
|
58
|
+
variants: {
|
|
59
|
+
size: {
|
|
60
|
+
xs: "h-7 min-w-7 px-1 text-xs [:where(&)_svg]:size-3",
|
|
61
|
+
sm: "h-8 min-w-8 px-1.5 text-sm [:where(&)_svg]:size-3.5",
|
|
62
|
+
md: "h-9 min-w-9 px-2 text-md [:where(&)_svg]:size-4",
|
|
63
|
+
lg: "h-10 min-w-10 px-2.5 text-lg [:where(&)_svg]:size-5",
|
|
64
|
+
xl: "h-12 min-w-12 px-3 text-xl [:where(&)_svg]:size-6",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
defaultVariants: { size: "md" },
|
|
68
|
+
},
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
/** The pages you aren't on, and the controls: palette-independent, like a
|
|
72
|
+
* `subtle` button with no color. Figma's `Background/bg-hover` on hover,
|
|
73
|
+
* `Text/text-disabled` once a control has nowhere to go. */
|
|
74
|
+
const restClasses = cn(
|
|
75
|
+
TEXT_COLOR_CLASSES.primary,
|
|
76
|
+
"hover:cursor-pointer hover:bg-brand-900/6 dark:hover:bg-white/8",
|
|
77
|
+
"disabled:pointer-events-none disabled:text-brand-900/20 dark:disabled:text-white/16",
|
|
78
|
+
"data-disabled:pointer-events-none data-disabled:text-brand-900/20 dark:data-disabled:text-white/16",
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
/** The current page: `Button`'s colour classes, so `variant` × `color` reads
|
|
82
|
+
* the same here as on a button. `default` is `ActionIcon`'s inverse fill. */
|
|
83
|
+
const SELECTED_CLASSES = {
|
|
84
|
+
filled: buttonColorVariants.filled,
|
|
85
|
+
light: buttonColorVariants.light,
|
|
86
|
+
outline: buttonColorVariants.outline,
|
|
87
|
+
subtle: [buttonColorVariants.subtle, "bg-(--btn-subtle-hover-bg)"],
|
|
88
|
+
default: [
|
|
89
|
+
"bg-brand-950 text-white border-brand-800 hover:bg-brand-800",
|
|
90
|
+
"dark:bg-white dark:text-brand-950 dark:border-white/80 dark:hover:bg-white/80",
|
|
91
|
+
],
|
|
92
|
+
} as const
|
|
93
|
+
|
|
94
|
+
/** Shape of the current page, from `Button`'s variants. */
|
|
95
|
+
export type PaginationVariant = keyof typeof SELECTED_CLASSES
|
|
96
|
+
|
|
97
|
+
export type PaginationIconSlot = "first" | "prev" | "next" | "last" | "ellipsis"
|
|
98
|
+
export type PaginationIcons = IconMap<PaginationIconSlot>
|
|
99
|
+
|
|
100
|
+
/** The default icons. The arrows flip under RTL; an icon passed through
|
|
101
|
+
* `icons` is drawn as given, so add `rtl:-scale-x-100` to a directional one. */
|
|
102
|
+
export const DEFAULT_ICONS: Record<PaginationIconSlot, ReactNode> = {
|
|
103
|
+
first: <ChevronsLeft aria-hidden className={cn(iconStroke, "rtl:-scale-x-100")} />,
|
|
104
|
+
prev: <ChevronLeft aria-hidden className={cn(iconStroke, "rtl:-scale-x-100")} />,
|
|
105
|
+
next: <ChevronRight aria-hidden className={cn(iconStroke, "rtl:-scale-x-100")} />,
|
|
106
|
+
last: <ChevronsRight aria-hidden className={cn(iconStroke, "rtl:-scale-x-100")} />,
|
|
107
|
+
ellipsis: <Ellipsis aria-hidden className={iconStroke} />,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** The page numbers a label prints, raw (for plural rules) and formatted for
|
|
111
|
+
* the locale (`1 234`, `١٢`), which are the ones to show. */
|
|
112
|
+
export type PaginationLabelDetails = {
|
|
113
|
+
page: number
|
|
114
|
+
total: number
|
|
115
|
+
formatted: { page: string; total: string }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type PaginationTranslations = {
|
|
119
|
+
/** The `<nav>` landmark's accessible name. Default `"Pagination"`. */
|
|
120
|
+
navigation?: string
|
|
121
|
+
/** Accessible name of the first-page control. Default `"First page"`. */
|
|
122
|
+
firstPage?: string
|
|
123
|
+
/** Accessible name of the previous-page control. Default `"Previous page"`. */
|
|
124
|
+
previousPage?: string
|
|
125
|
+
/** Accessible name of the next-page control. Default `"Next page"`. */
|
|
126
|
+
nextPage?: string
|
|
127
|
+
/** Accessible name of the last-page control. Default `"Last page"`. */
|
|
128
|
+
lastPage?: string
|
|
129
|
+
/** Accessible name of each page item. Default `"Page 3"`. */
|
|
130
|
+
page?: (details: PaginationLabelDetails) => string
|
|
131
|
+
/** The compact display's text, `Pagination.Label`. Default `"Page 3 of 12"`. */
|
|
132
|
+
label?: (details: PaginationLabelDetails) => ReactNode
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export const PAGINATION_DEFAULT_TRANSLATIONS = {
|
|
136
|
+
navigation: "Pagination",
|
|
137
|
+
firstPage: "First page",
|
|
138
|
+
previousPage: "Previous page",
|
|
139
|
+
nextPage: "Next page",
|
|
140
|
+
lastPage: "Last page",
|
|
141
|
+
page: ({ formatted }) => `Page ${formatted.page}`,
|
|
142
|
+
label: ({ formatted }) => `Page ${formatted.page} of ${formatted.total}`,
|
|
143
|
+
} as const satisfies Required<PaginationTranslations>
|
|
144
|
+
|
|
145
|
+
type PaginationContextValue = {
|
|
146
|
+
pagination: UsePaginationReturnValue
|
|
147
|
+
size: Size
|
|
148
|
+
variant: PaginationVariant
|
|
149
|
+
disabled: boolean
|
|
150
|
+
link: boolean
|
|
151
|
+
icons: Record<PaginationIconSlot, ReactNode>
|
|
152
|
+
translations: Required<PaginationTranslations>
|
|
153
|
+
details: (page: number) => PaginationLabelDetails
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const PaginationContext = createContext<PaginationContextValue | null>(null)
|
|
157
|
+
|
|
158
|
+
const usePaginationContext = (part: string) => {
|
|
159
|
+
const context = useContext(PaginationContext)
|
|
160
|
+
if (!context) throw new Error(`Pagination.${part} must be rendered inside Pagination.Root`)
|
|
161
|
+
return context
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
type PaginationRootOwnProps = Omit<HTMLArkProps<"nav">, "color" | "defaultValue"> &
|
|
165
|
+
WithTestId & {
|
|
166
|
+
/** Height of every item and control. @default "md" */
|
|
167
|
+
size?: Size
|
|
168
|
+
/** Shape of the current page, as on `Button`. `default` is `ActionIcon`'s inverse fill. @default "filled" */
|
|
169
|
+
variant?: PaginationVariant
|
|
170
|
+
/** Palette of the current page. Re-exported as `Color` from `@42/ui-react`. */
|
|
171
|
+
color?: Color
|
|
172
|
+
/** Dims every item and control and ignores presses. */
|
|
173
|
+
disabled?: boolean
|
|
174
|
+
/** Makes every page a link to this URL, for pages a crawler should follow.
|
|
175
|
+
* Rendered through `LinkComponentProvider`'s component when one is set,
|
|
176
|
+
* else a plain `<a>`. */
|
|
177
|
+
getPageUrl?: (page: number) => string
|
|
178
|
+
/** Overrides the built-in strings; English defaults ship in the kit. */
|
|
179
|
+
translations?: PaginationTranslations
|
|
180
|
+
/** Replaces the default icons: `first`, `prev`, `next`, `last`, `ellipsis`.
|
|
181
|
+
* A part's own `children` win over them. */
|
|
182
|
+
icons?: PaginationIcons
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export type PaginationRootProps = PaginationRootOwnProps & UsePaginationOptions
|
|
186
|
+
|
|
187
|
+
/** The `<nav>` that holds the parts and the state they share. */
|
|
188
|
+
const PaginationRoot = ({
|
|
189
|
+
count,
|
|
190
|
+
pageSize,
|
|
191
|
+
pages,
|
|
192
|
+
page: pageProp,
|
|
193
|
+
defaultPage,
|
|
194
|
+
onPageChange,
|
|
195
|
+
siblings,
|
|
196
|
+
boundaries,
|
|
197
|
+
size = "md",
|
|
198
|
+
variant = "filled",
|
|
199
|
+
color,
|
|
200
|
+
disabled = false,
|
|
201
|
+
getPageUrl,
|
|
202
|
+
translations: translationsProp,
|
|
203
|
+
icons,
|
|
204
|
+
className,
|
|
205
|
+
testId,
|
|
206
|
+
children,
|
|
207
|
+
...rest
|
|
208
|
+
}: PaginationRootProps) => {
|
|
209
|
+
const total: UsePaginationOptions =
|
|
210
|
+
count === undefined ? { pages: pages ?? 0 } : { count, pageSize }
|
|
211
|
+
const pagination = usePagination({
|
|
212
|
+
...total,
|
|
213
|
+
page: pageProp,
|
|
214
|
+
defaultPage,
|
|
215
|
+
onPageChange,
|
|
216
|
+
siblings,
|
|
217
|
+
boundaries,
|
|
218
|
+
})
|
|
219
|
+
const translations = { ...PAGINATION_DEFAULT_TRANSLATIONS, ...translationsProp }
|
|
220
|
+
const format = new Intl.NumberFormat(useLocale()).format
|
|
221
|
+
const details = (page: number): PaginationLabelDetails => ({
|
|
222
|
+
page,
|
|
223
|
+
total: pagination.totalPages,
|
|
224
|
+
formatted: { page: format(page), total: format(pagination.totalPages) },
|
|
225
|
+
})
|
|
226
|
+
const link = getPageUrl !== undefined
|
|
227
|
+
|
|
228
|
+
// Ark's machine is driven by the hook: one page per "item", so its page
|
|
229
|
+
// count is ours, and its page is controlled. It contributes the parts'
|
|
230
|
+
// ARIA, ids and hrefs; a press it reports goes through the hook's clamp.
|
|
231
|
+
const ark = useArkPagination({
|
|
232
|
+
count: pagination.totalPages,
|
|
233
|
+
pageSize: 1,
|
|
234
|
+
page: pagination.page,
|
|
235
|
+
onPageChange: (details) => {
|
|
236
|
+
if (!disabled) pagination.setPage(details.page)
|
|
237
|
+
},
|
|
238
|
+
type: link ? "link" : "button",
|
|
239
|
+
// Disabled links lose their href, so nothing is left to follow.
|
|
240
|
+
getPageUrl: link && !disabled ? ({ page }) => getPageUrl(page) : undefined,
|
|
241
|
+
translations: {
|
|
242
|
+
rootLabel: translations.navigation,
|
|
243
|
+
firstTriggerLabel: translations.firstPage,
|
|
244
|
+
prevTriggerLabel: translations.previousPage,
|
|
245
|
+
nextTriggerLabel: translations.nextPage,
|
|
246
|
+
lastTriggerLabel: translations.lastPage,
|
|
247
|
+
itemLabel: ({ page }) => translations.page(details(page)),
|
|
248
|
+
},
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
return (
|
|
252
|
+
<PaginationContext.Provider
|
|
253
|
+
value={{
|
|
254
|
+
pagination,
|
|
255
|
+
size,
|
|
256
|
+
variant,
|
|
257
|
+
disabled,
|
|
258
|
+
link,
|
|
259
|
+
icons: mergeIcons(DEFAULT_ICONS, icons),
|
|
260
|
+
translations,
|
|
261
|
+
details,
|
|
262
|
+
}}
|
|
263
|
+
>
|
|
264
|
+
<ArkPagination.RootProvider
|
|
265
|
+
value={ark}
|
|
266
|
+
data-color={color}
|
|
267
|
+
data-variant={variant}
|
|
268
|
+
className={cn("flex flex-wrap items-center gap-1", className)}
|
|
269
|
+
{...props({ "data-disabled": disabled, "data-testid": testId })}
|
|
270
|
+
{...rest}
|
|
271
|
+
>
|
|
272
|
+
{children}
|
|
273
|
+
</ArkPagination.RootProvider>
|
|
274
|
+
</PaginationContext.Provider>
|
|
275
|
+
)
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** Renders a part's Ark element, or the router link it becomes in link mode. */
|
|
279
|
+
const LinkOrSelf = ({
|
|
280
|
+
enabled,
|
|
281
|
+
href,
|
|
282
|
+
...rest
|
|
283
|
+
}: { enabled: boolean } & ComponentPropsWithoutRef<"a">) => {
|
|
284
|
+
const Link = useLinkComponent() ?? "a"
|
|
285
|
+
// A link with nowhere to go is an `<a>` without an href, marked disabled
|
|
286
|
+
// the way ARIA spells it. Never the router's component: most of them
|
|
287
|
+
// require an href.
|
|
288
|
+
return enabled && href !== undefined ? (
|
|
289
|
+
<Link href={href} {...rest} />
|
|
290
|
+
) : (
|
|
291
|
+
<a role="link" aria-disabled="true" {...rest} />
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export type PaginationItemProps = Omit<HTMLArkProps<"button">, "type" | "value"> &
|
|
296
|
+
WithTestId & {
|
|
297
|
+
/** The page this item goes to, 1-based. */
|
|
298
|
+
value: number
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** One page. Its content is the page number, formatted for the locale. */
|
|
302
|
+
const PaginationItem = ({
|
|
303
|
+
value,
|
|
304
|
+
asChild,
|
|
305
|
+
className,
|
|
306
|
+
children,
|
|
307
|
+
testId,
|
|
308
|
+
...rest
|
|
309
|
+
}: PaginationItemProps) => {
|
|
310
|
+
const { pagination, size, variant, disabled, link, details } = usePaginationContext("Item")
|
|
311
|
+
const selected = value === pagination.page
|
|
312
|
+
const own = (content: ReactNode) => content ?? details(value).formatted.page
|
|
313
|
+
const classes = cn(
|
|
314
|
+
itemVariants({ size }),
|
|
315
|
+
selected ? SELECTED_CLASSES[variant] : restClasses,
|
|
316
|
+
disabled && "pointer-events-none opacity-50",
|
|
317
|
+
className,
|
|
318
|
+
)
|
|
319
|
+
const attributes = {
|
|
320
|
+
className: classes,
|
|
321
|
+
...props({ "data-testid": testId, "data-disabled": disabled }),
|
|
322
|
+
...rest,
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (link && !asChild) {
|
|
326
|
+
return (
|
|
327
|
+
<ArkPagination.Item type="page" value={value} asChild {...attributes}>
|
|
328
|
+
<LinkOrSelf enabled={!disabled}>{own(children)}</LinkOrSelf>
|
|
329
|
+
</ArkPagination.Item>
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
return (
|
|
333
|
+
<ArkPagination.Item
|
|
334
|
+
type="page"
|
|
335
|
+
value={value}
|
|
336
|
+
asChild={asChild}
|
|
337
|
+
disabled={link ? undefined : disabled}
|
|
338
|
+
{...attributes}
|
|
339
|
+
>
|
|
340
|
+
{composeChildren(asChild, children, own)}
|
|
341
|
+
</ArkPagination.Item>
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export type PaginationEllipsisProps = HTMLArkProps<"div"> &
|
|
346
|
+
WithTestId & {
|
|
347
|
+
/** Its position among the items: `usePagination`'s `index`. */
|
|
348
|
+
index: number
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/** A run of hidden pages. Decorative: the pages around it are the content. */
|
|
352
|
+
const PaginationEllipsis = ({
|
|
353
|
+
index,
|
|
354
|
+
asChild,
|
|
355
|
+
className,
|
|
356
|
+
children,
|
|
357
|
+
testId,
|
|
358
|
+
...rest
|
|
359
|
+
}: PaginationEllipsisProps) => {
|
|
360
|
+
const { size, icons, disabled } = usePaginationContext("Ellipsis")
|
|
361
|
+
return (
|
|
362
|
+
<ArkPagination.Ellipsis
|
|
363
|
+
index={index}
|
|
364
|
+
asChild={asChild}
|
|
365
|
+
aria-hidden
|
|
366
|
+
className={cn(
|
|
367
|
+
itemVariants({ size }),
|
|
368
|
+
TEXT_COLOR_CLASSES.muted,
|
|
369
|
+
disabled && "opacity-50",
|
|
370
|
+
className,
|
|
371
|
+
)}
|
|
372
|
+
{...props({ "data-testid": testId })}
|
|
373
|
+
{...rest}
|
|
374
|
+
>
|
|
375
|
+
{composeChildren(asChild, children, (own) => own ?? icons.ellipsis)}
|
|
376
|
+
</ArkPagination.Ellipsis>
|
|
377
|
+
)
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export type PaginationItemsProps = NoAsChild<Omit<HTMLArkProps<"div">, "children">> &
|
|
381
|
+
WithTestId & {
|
|
382
|
+
/** A class for every page item and every ellipsis. */
|
|
383
|
+
classNames?: { item?: string; ellipsis?: string }
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** Every page item, with an ellipsis wherever pages are hidden. */
|
|
387
|
+
const PaginationItems = ({
|
|
388
|
+
asChild: _asChild,
|
|
389
|
+
classNames,
|
|
390
|
+
className,
|
|
391
|
+
testId,
|
|
392
|
+
...rest
|
|
393
|
+
}: PaginationItemsProps) => {
|
|
394
|
+
const { pagination } = usePaginationContext("Items")
|
|
395
|
+
return (
|
|
396
|
+
<div className={cn("contents", className)} {...props({ "data-testid": testId })} {...rest}>
|
|
397
|
+
{pagination.items.map((item) =>
|
|
398
|
+
item.type === "page" ? (
|
|
399
|
+
<PaginationItem
|
|
400
|
+
key={`page-${item.value}`}
|
|
401
|
+
value={item.value}
|
|
402
|
+
className={classNames?.item}
|
|
403
|
+
{...props({ testId: testId && `${testId}-page-${item.value}` })}
|
|
404
|
+
/>
|
|
405
|
+
) : (
|
|
406
|
+
<PaginationEllipsis
|
|
407
|
+
key={`ellipsis-${item.index}`}
|
|
408
|
+
index={item.index}
|
|
409
|
+
className={classNames?.ellipsis}
|
|
410
|
+
/>
|
|
411
|
+
),
|
|
412
|
+
)}
|
|
413
|
+
</div>
|
|
414
|
+
)
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
type TriggerKind = "first" | "prev" | "next" | "last"
|
|
418
|
+
|
|
419
|
+
export type PaginationTriggerProps = HTMLArkProps<"button"> & WithTestId
|
|
420
|
+
|
|
421
|
+
const Trigger = ({
|
|
422
|
+
kind,
|
|
423
|
+
asChild,
|
|
424
|
+
className,
|
|
425
|
+
children,
|
|
426
|
+
testId,
|
|
427
|
+
...rest
|
|
428
|
+
}: PaginationTriggerProps & { kind: TriggerKind }) => {
|
|
429
|
+
const { pagination, size, disabled, link, icons } = usePaginationContext("Trigger")
|
|
430
|
+
const Part = match(kind)
|
|
431
|
+
.with("first", () => ArkPagination.FirstTrigger)
|
|
432
|
+
.with("prev", () => ArkPagination.PrevTrigger)
|
|
433
|
+
.with("next", () => ArkPagination.NextTrigger)
|
|
434
|
+
.with("last", () => ArkPagination.LastTrigger)
|
|
435
|
+
.exhaustive()
|
|
436
|
+
const backward = kind === "first" || kind === "prev"
|
|
437
|
+
const enabled = !disabled && (backward ? pagination.canPrevious : pagination.canNext)
|
|
438
|
+
const own = (content: ReactNode) => content ?? icons[kind]
|
|
439
|
+
const attributes = {
|
|
440
|
+
className: cn(itemVariants({ size }), restClasses, className),
|
|
441
|
+
...props({ "data-testid": testId, "data-disabled": !enabled }),
|
|
442
|
+
...rest,
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (link && !asChild) {
|
|
446
|
+
return (
|
|
447
|
+
<Part asChild {...attributes}>
|
|
448
|
+
<LinkOrSelf enabled={enabled}>{own(children)}</LinkOrSelf>
|
|
449
|
+
</Part>
|
|
450
|
+
)
|
|
451
|
+
}
|
|
452
|
+
return (
|
|
453
|
+
<Part asChild={asChild} disabled={link ? undefined : !enabled} {...attributes}>
|
|
454
|
+
{composeChildren(asChild, children, own)}
|
|
455
|
+
</Part>
|
|
456
|
+
)
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/** Goes to the first page. Its icon (or `children`) is its content. */
|
|
460
|
+
const PaginationFirst = (props: PaginationTriggerProps) => <Trigger kind="first" {...props} />
|
|
461
|
+
/** Goes to the previous page. */
|
|
462
|
+
const PaginationPrev = (props: PaginationTriggerProps) => <Trigger kind="prev" {...props} />
|
|
463
|
+
/** Goes to the next page. */
|
|
464
|
+
const PaginationNext = (props: PaginationTriggerProps) => <Trigger kind="next" {...props} />
|
|
465
|
+
/** Goes to the last page. */
|
|
466
|
+
const PaginationLast = (props: PaginationTriggerProps) => <Trigger kind="last" {...props} />
|
|
467
|
+
|
|
468
|
+
export type PaginationLabelProps = HTMLArkProps<"span"> & WithTestId
|
|
469
|
+
|
|
470
|
+
/** "Page 3 of 12": the compact display, in place of the items. A polite live
|
|
471
|
+
* region, so a page turn is announced while focus stays on Next. */
|
|
472
|
+
const PaginationLabel = ({
|
|
473
|
+
asChild,
|
|
474
|
+
className,
|
|
475
|
+
children,
|
|
476
|
+
testId,
|
|
477
|
+
...rest
|
|
478
|
+
}: PaginationLabelProps) => {
|
|
479
|
+
const { pagination, size, translations, details, disabled } = usePaginationContext("Label")
|
|
480
|
+
return (
|
|
481
|
+
<ark.span
|
|
482
|
+
asChild={asChild}
|
|
483
|
+
role="status"
|
|
484
|
+
className={cn(
|
|
485
|
+
itemVariants({ size }),
|
|
486
|
+
"cursor-default px-2 font-normal whitespace-nowrap",
|
|
487
|
+
TEXT_COLOR_CLASSES.secondary,
|
|
488
|
+
disabled && "opacity-50",
|
|
489
|
+
className,
|
|
490
|
+
)}
|
|
491
|
+
{...props({ "data-testid": testId })}
|
|
492
|
+
{...rest}
|
|
493
|
+
>
|
|
494
|
+
{composeChildren(
|
|
495
|
+
asChild,
|
|
496
|
+
children,
|
|
497
|
+
(own) => own ?? translations.label(details(pagination.page)),
|
|
498
|
+
)}
|
|
499
|
+
</ark.span>
|
|
500
|
+
)
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/** How the bare `Pagination` lays out its middle. */
|
|
504
|
+
export type PaginationDisplay = "pages" | "compact"
|
|
505
|
+
|
|
506
|
+
export type PaginationProps = NoAsChild<Omit<PaginationRootOwnProps, "children">> &
|
|
507
|
+
UsePaginationOptions & {
|
|
508
|
+
/** `"pages"` draws a button per page, with ellipses; `"compact"` draws
|
|
509
|
+
* "Page 3 of 12" between the controls, for narrow spaces. @default "pages" */
|
|
510
|
+
display?: PaginationDisplay
|
|
511
|
+
/** Draws the previous/next controls. @default true */
|
|
512
|
+
withControls?: boolean
|
|
513
|
+
/** Draws the first/last controls. @default false */
|
|
514
|
+
withEdges?: boolean
|
|
515
|
+
/** A class per part, on top of the kit's. */
|
|
516
|
+
classNames?: {
|
|
517
|
+
item?: string
|
|
518
|
+
control?: string
|
|
519
|
+
ellipsis?: string
|
|
520
|
+
label?: string
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const PaginationComponent = ({
|
|
525
|
+
asChild: _asChild,
|
|
526
|
+
display = "pages",
|
|
527
|
+
withControls = true,
|
|
528
|
+
withEdges = false,
|
|
529
|
+
classNames,
|
|
530
|
+
testId,
|
|
531
|
+
...rest
|
|
532
|
+
}: PaginationProps) => {
|
|
533
|
+
const control = classNames?.control
|
|
534
|
+
const part = (name: string) => props({ testId: testId && `${testId}-${name}` })
|
|
535
|
+
return (
|
|
536
|
+
<PaginationRoot testId={testId} {...rest}>
|
|
537
|
+
{withEdges && <PaginationFirst className={control} {...part("first")} />}
|
|
538
|
+
{withControls && <PaginationPrev className={control} {...part("prev")} />}
|
|
539
|
+
{display === "compact" ? (
|
|
540
|
+
<PaginationLabel className={classNames?.label} {...part("label")} />
|
|
541
|
+
) : (
|
|
542
|
+
<PaginationItems
|
|
543
|
+
classNames={{ item: classNames?.item, ellipsis: classNames?.ellipsis }}
|
|
544
|
+
{...part("items")}
|
|
545
|
+
/>
|
|
546
|
+
)}
|
|
547
|
+
{withControls && <PaginationNext className={control} {...part("next")} />}
|
|
548
|
+
{withEdges && <PaginationLast className={control} {...part("last")} />}
|
|
549
|
+
</PaginationRoot>
|
|
550
|
+
)
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export const Pagination = Object.assign(PaginationComponent, {
|
|
554
|
+
Root: PaginationRoot,
|
|
555
|
+
Items: PaginationItems,
|
|
556
|
+
Item: PaginationItem,
|
|
557
|
+
Ellipsis: PaginationEllipsis,
|
|
558
|
+
First: PaginationFirst,
|
|
559
|
+
Prev: PaginationPrev,
|
|
560
|
+
Next: PaginationNext,
|
|
561
|
+
Last: PaginationLast,
|
|
562
|
+
Label: PaginationLabel,
|
|
563
|
+
})
|
|
@@ -18,7 +18,13 @@ import { focusStyles } from "../../lib/focus-styles"
|
|
|
18
18
|
import { type IconMap, iconStroke, mergeIcons } from "../../lib/icons"
|
|
19
19
|
import { props } from "../../lib/props"
|
|
20
20
|
import type { WithTestId } from "../../lib/test-id"
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
type FieldProps,
|
|
23
|
+
FieldShell,
|
|
24
|
+
fieldA11yProps,
|
|
25
|
+
useInheritedDisabled,
|
|
26
|
+
useInheritedInvalid,
|
|
27
|
+
} from "../field/field"
|
|
22
28
|
import {
|
|
23
29
|
InputBase,
|
|
24
30
|
type InputSize,
|
|
@@ -252,7 +258,7 @@ export const PasswordInput = ({
|
|
|
252
258
|
variant,
|
|
253
259
|
size,
|
|
254
260
|
invalid,
|
|
255
|
-
disabled,
|
|
261
|
+
disabled: disabledProp,
|
|
256
262
|
readOnly,
|
|
257
263
|
required,
|
|
258
264
|
label,
|
|
@@ -274,9 +280,12 @@ export const PasswordInput = ({
|
|
|
274
280
|
classNames,
|
|
275
281
|
testId,
|
|
276
282
|
}: PasswordInputProps) => {
|
|
283
|
+
// An enclosing `Field` or `Fieldset` disables it too: the shell only dims on
|
|
284
|
+
// the `disabled` handed to it here.
|
|
285
|
+
const disabled = useInheritedDisabled(disabledProp)
|
|
277
286
|
// Drive the red state independently of the `Field` error slot so a form
|
|
278
287
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
279
|
-
const isInvalid = invalid || error != null
|
|
288
|
+
const isInvalid = useInheritedInvalid(invalid || error != null)
|
|
280
289
|
const icons = mergeIcons(DEFAULT_ICONS, iconsProp)
|
|
281
290
|
|
|
282
291
|
return (
|
|
@@ -24,7 +24,13 @@ import type { WithTestId } from "../../lib/test-id"
|
|
|
24
24
|
import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
|
|
25
25
|
import { useIsomorphicLayoutEffect } from "../../lib/use-isomorphic-layout-effect"
|
|
26
26
|
import { ComboboxList } from "../combobox-list/combobox-list"
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
type FieldProps,
|
|
29
|
+
FieldShell,
|
|
30
|
+
fieldA11yProps,
|
|
31
|
+
useInheritedDisabled,
|
|
32
|
+
useInheritedInvalid,
|
|
33
|
+
} from "../field/field"
|
|
28
34
|
import { InputBase, type InputSize, type InputVariant, inputControlClasses } from "../input/input"
|
|
29
35
|
import { CheckIcon, ChevronIcon } from "../popover/icons"
|
|
30
36
|
import { Popover, popoverChevron, popoverIndicator } from "../popover/popover"
|
|
@@ -243,7 +249,7 @@ export const PhoneInput = ({
|
|
|
243
249
|
placeholder,
|
|
244
250
|
name,
|
|
245
251
|
invalid,
|
|
246
|
-
disabled,
|
|
252
|
+
disabled: disabledProp,
|
|
247
253
|
readOnly,
|
|
248
254
|
required,
|
|
249
255
|
label,
|
|
@@ -259,10 +265,13 @@ export const PhoneInput = ({
|
|
|
259
265
|
translations,
|
|
260
266
|
icons: iconsProp,
|
|
261
267
|
}: PhoneInputProps) => {
|
|
268
|
+
// An enclosing `Field` or `Fieldset` disables it too: the shell only dims on
|
|
269
|
+
// the `disabled` handed to it here.
|
|
270
|
+
const disabled = useInheritedDisabled(disabledProp)
|
|
262
271
|
const locale = useLocale(localeProp)
|
|
263
272
|
const t = { ...PHONE_INPUT_DEFAULT_TRANSLATIONS, ...translations }
|
|
264
273
|
const icons = mergeIcons(DEFAULT_ICONS, iconsProp)
|
|
265
|
-
const isInvalid = invalid || error != null
|
|
274
|
+
const isInvalid = useInheritedInvalid(invalid || error != null)
|
|
266
275
|
const allowed = countries ?? PHONE_COUNTRIES
|
|
267
276
|
|
|
268
277
|
const [initial] = useState<PhoneState>(() => {
|
|
@@ -22,6 +22,7 @@ import { useLocale } from "../../lib/intl"
|
|
|
22
22
|
import { props } from "../../lib/props"
|
|
23
23
|
import type { WithTestId } from "../../lib/test-id"
|
|
24
24
|
import { useElementSize } from "../../lib/use-element-size"
|
|
25
|
+
import { useInheritedDisabled, useInheritedInvalid } from "../field/field"
|
|
25
26
|
import {
|
|
26
27
|
type InputSize,
|
|
27
28
|
type InputVariant,
|
|
@@ -350,8 +351,8 @@ const PillsInputBase = ({
|
|
|
350
351
|
size = "md",
|
|
351
352
|
variant = "default",
|
|
352
353
|
color,
|
|
353
|
-
invalid,
|
|
354
|
-
disabled,
|
|
354
|
+
invalid: invalidProp,
|
|
355
|
+
disabled: disabledProp,
|
|
355
356
|
pointer,
|
|
356
357
|
maxLines,
|
|
357
358
|
startSlot,
|
|
@@ -364,6 +365,10 @@ const PillsInputBase = ({
|
|
|
364
365
|
asChild: _asChild,
|
|
365
366
|
...rest
|
|
366
367
|
}: PillsInputProps) => {
|
|
368
|
+
// Like `Input`, the shell dims and turns red with an enclosing `Field` or
|
|
369
|
+
// `Fieldset`, so a hand-built multi-value field follows its group too.
|
|
370
|
+
const disabled = useInheritedDisabled(disabledProp)
|
|
371
|
+
const invalid = useInheritedInvalid(invalidProp)
|
|
367
372
|
// Convention: pills first, the field last. Only the pills feed the line cap;
|
|
368
373
|
// the field always stays visible (it is never sliced away).
|
|
369
374
|
const items = Children.toArray(children)
|