@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
|
@@ -8,6 +8,7 @@ import { buttonColorVariants } from "../../lib/button-colors"
|
|
|
8
8
|
import { cn } from "../../lib/cn"
|
|
9
9
|
import type { Color } from "../../lib/colors"
|
|
10
10
|
import { focusStyles } from "../../lib/focus-styles"
|
|
11
|
+
import { type ForbidHref, isLinkElement, type PressedProps, usePressed } from "../../lib/pressed"
|
|
11
12
|
import { props } from "../../lib/props"
|
|
12
13
|
import type { WithTestId } from "../../lib/test-id"
|
|
13
14
|
import { Spinner } from "../spinner/spinner"
|
|
@@ -38,6 +39,12 @@ import { Spinner } from "../spinner/spinner"
|
|
|
38
39
|
* arbitrary `asChild` element (e.g. an `<a>`) — same reason the loading
|
|
39
40
|
* `opacity-50` dimming and `pointer-events-none` blocking are keyed off `data-loading`
|
|
40
41
|
* rather than `:disabled` (see `Button`'s note on this).
|
|
42
|
+
*
|
|
43
|
+
* `pressed` / `defaultPressed` / `onPressedChange` make it a toggle button,
|
|
44
|
+
* exactly as on `Button` (`lib/pressed.ts`): a Bold or a mute button. A
|
|
45
|
+
* toggle's look swaps from `variant` (default `light`) to `pressedVariant`
|
|
46
|
+
* (default `filled`), the pair an `ActionIcon` gets inside a
|
|
47
|
+
* `ButtonMultiSelect`.
|
|
41
48
|
*/
|
|
42
49
|
const actionIconVariants = cva(
|
|
43
50
|
[
|
|
@@ -100,6 +107,8 @@ export type ActionIconRadius = NonNullable<VariantProps<typeof actionIconVariant
|
|
|
100
107
|
|
|
101
108
|
export type ActionIconProps = Omit<HTMLArkProps<"button">, "color"> &
|
|
102
109
|
VariantProps<typeof actionIconVariants> &
|
|
110
|
+
PressedProps<ActionIconVariant> &
|
|
111
|
+
ForbidHref &
|
|
103
112
|
WithTestId & {
|
|
104
113
|
/** Accent palette. Re-exported as `Color` from `@42/ui-react`. */
|
|
105
114
|
color?: Color
|
|
@@ -129,10 +138,29 @@ export const ActionIcon = ({
|
|
|
129
138
|
asChild,
|
|
130
139
|
testId,
|
|
131
140
|
onClick,
|
|
141
|
+
pressed: pressedProp,
|
|
142
|
+
defaultPressed,
|
|
143
|
+
onPressedChange,
|
|
144
|
+
pressedVariant,
|
|
132
145
|
...rest
|
|
133
146
|
}: ActionIconProps) => {
|
|
134
147
|
const resolvedDisabled = disabled || loading
|
|
135
|
-
const
|
|
148
|
+
const toggle = usePressed({
|
|
149
|
+
pressed: pressedProp,
|
|
150
|
+
defaultPressed,
|
|
151
|
+
onPressedChange,
|
|
152
|
+
disabled: resolvedDisabled,
|
|
153
|
+
onClick: loading ? preventWhileLoading : onClick,
|
|
154
|
+
link: Boolean(asChild) && isLinkElement(children),
|
|
155
|
+
component: "ActionIcon",
|
|
156
|
+
})
|
|
157
|
+
const pressed = toggle.pressed
|
|
158
|
+
// A toggle swaps between ButtonSelect's pair; a plain icon keeps `variant`.
|
|
159
|
+
const resolvedVariant = toggle.toggle
|
|
160
|
+
? pressed
|
|
161
|
+
? (pressedVariant ?? "filled")
|
|
162
|
+
: (variant ?? "light")
|
|
163
|
+
: variant
|
|
136
164
|
|
|
137
165
|
return (
|
|
138
166
|
<ark.button
|
|
@@ -140,13 +168,15 @@ export const ActionIcon = ({
|
|
|
140
168
|
type={asChild ? type : (type ?? "button")}
|
|
141
169
|
disabled={resolvedDisabled}
|
|
142
170
|
data-color={color}
|
|
143
|
-
data-variant={
|
|
144
|
-
className={cn(actionIconVariants({ variant, size, radius }), className)}
|
|
145
|
-
onClick={
|
|
171
|
+
data-variant={resolvedVariant ?? "default"}
|
|
172
|
+
className={cn(actionIconVariants({ variant: resolvedVariant, size, radius }), className)}
|
|
173
|
+
onClick={toggle.onClick}
|
|
174
|
+
aria-pressed={toggle.toggle ? pressed : undefined}
|
|
146
175
|
{...props({
|
|
147
176
|
"aria-busy": loading,
|
|
148
177
|
"aria-disabled": resolvedDisabled,
|
|
149
178
|
"data-loading": loading,
|
|
179
|
+
"data-pressed": pressed,
|
|
150
180
|
"data-testid": testId,
|
|
151
181
|
})}
|
|
152
182
|
{...rest}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react"
|
|
2
|
+
import { createRef, type ReactNode } from "react"
|
|
3
|
+
import { describe, expect, it } from "vitest"
|
|
4
|
+
import { LinkComponentProvider } from "../../lib/link-component"
|
|
5
|
+
import { Anchor } from "./anchor"
|
|
6
|
+
|
|
7
|
+
const StubLink = ({
|
|
8
|
+
href,
|
|
9
|
+
children,
|
|
10
|
+
...props
|
|
11
|
+
}: { href?: string; children?: ReactNode } & Record<string, unknown>) => (
|
|
12
|
+
<a data-stub-link href={href} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
</a>
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
const OtherLink = ({
|
|
18
|
+
href,
|
|
19
|
+
children,
|
|
20
|
+
...props
|
|
21
|
+
}: { href?: string; children?: ReactNode } & Record<string, unknown>) => (
|
|
22
|
+
<a data-other-link href={href} {...props}>
|
|
23
|
+
{children}
|
|
24
|
+
</a>
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
describe("Anchor", () => {
|
|
28
|
+
it("renders a plain link with its href and children", () => {
|
|
29
|
+
render(<Anchor href="/docs">Docs</Anchor>)
|
|
30
|
+
const link = screen.getByRole("link", { name: "Docs" })
|
|
31
|
+
expect(link.tagName).toBe("A")
|
|
32
|
+
expect(link.getAttribute("href")).toBe("/docs")
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it("forwards testId, native attributes and a ref", () => {
|
|
36
|
+
const ref = createRef<HTMLAnchorElement>()
|
|
37
|
+
render(
|
|
38
|
+
<Anchor ref={ref} href="/x" testId="docs-link" title="Go" lang="fr">
|
|
39
|
+
x
|
|
40
|
+
</Anchor>,
|
|
41
|
+
)
|
|
42
|
+
const link = screen.getByTestId("docs-link")
|
|
43
|
+
expect(link.getAttribute("title")).toBe("Go")
|
|
44
|
+
expect(link.getAttribute("lang")).toBe("fr")
|
|
45
|
+
expect(ref.current).toBe(link)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it("writes data-color only when a color is set", () => {
|
|
49
|
+
const { rerender } = render(<Anchor href="/x">x</Anchor>)
|
|
50
|
+
expect(screen.getByRole("link").hasAttribute("data-color")).toBe(false)
|
|
51
|
+
rerender(
|
|
52
|
+
<Anchor href="/x" color="red">
|
|
53
|
+
x
|
|
54
|
+
</Anchor>,
|
|
55
|
+
)
|
|
56
|
+
expect(screen.getByRole("link").getAttribute("data-color")).toBe("red")
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it("underlines always by default, on hover, or never", () => {
|
|
60
|
+
const { rerender } = render(<Anchor href="/x">x</Anchor>)
|
|
61
|
+
const classes = () => screen.getByRole("link").className.split(" ")
|
|
62
|
+
expect(classes()).toContain("underline")
|
|
63
|
+
rerender(
|
|
64
|
+
<Anchor href="/x" underline="hover">
|
|
65
|
+
x
|
|
66
|
+
</Anchor>,
|
|
67
|
+
)
|
|
68
|
+
expect(classes()).toEqual(expect.arrayContaining(["no-underline", "hover:underline"]))
|
|
69
|
+
rerender(
|
|
70
|
+
<Anchor href="/x" underline="never">
|
|
71
|
+
x
|
|
72
|
+
</Anchor>,
|
|
73
|
+
)
|
|
74
|
+
expect(classes()).toContain("no-underline")
|
|
75
|
+
expect(classes()).not.toContain("hover:underline")
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it("inherits the font size unless size is set", () => {
|
|
79
|
+
const { rerender } = render(<Anchor href="/x">x</Anchor>)
|
|
80
|
+
expect(screen.getByRole("link").className).not.toMatch(/\btext-(xs|sm|base|lg|xl)\b/)
|
|
81
|
+
rerender(
|
|
82
|
+
<Anchor href="/x" size="sm">
|
|
83
|
+
x
|
|
84
|
+
</Anchor>,
|
|
85
|
+
)
|
|
86
|
+
expect(screen.getByRole("link").className.split(" ")).toContain("text-sm")
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it("keeps the surrounding colour at rest when subtle", () => {
|
|
90
|
+
render(
|
|
91
|
+
<Anchor href="/x" variant="subtle">
|
|
92
|
+
x
|
|
93
|
+
</Anchor>,
|
|
94
|
+
)
|
|
95
|
+
expect(screen.getByRole("link").className.split(" ")).toContain("text-inherit")
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it("lets a caller's className win", () => {
|
|
99
|
+
render(
|
|
100
|
+
<Anchor href="/x" className="no-underline">
|
|
101
|
+
x
|
|
102
|
+
</Anchor>,
|
|
103
|
+
)
|
|
104
|
+
expect(screen.getByRole("link").className.split(" ")).not.toContain("underline")
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
describe("Anchor router link", () => {
|
|
109
|
+
it("resolves the link element from LinkComponentProvider", () => {
|
|
110
|
+
render(
|
|
111
|
+
<LinkComponentProvider component={StubLink}>
|
|
112
|
+
<Anchor href="/x" testId="a">
|
|
113
|
+
x
|
|
114
|
+
</Anchor>
|
|
115
|
+
</LinkComponentProvider>,
|
|
116
|
+
)
|
|
117
|
+
const link = screen.getByTestId("a")
|
|
118
|
+
expect(link.hasAttribute("data-stub-link")).toBe(true)
|
|
119
|
+
expect(link.getAttribute("href")).toBe("/x")
|
|
120
|
+
expect(link.className).toContain("underline")
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
it("lets linkComponent override the provider", () => {
|
|
124
|
+
render(
|
|
125
|
+
<LinkComponentProvider component={StubLink}>
|
|
126
|
+
<Anchor href="/x" linkComponent={OtherLink}>
|
|
127
|
+
x
|
|
128
|
+
</Anchor>
|
|
129
|
+
</LinkComponentProvider>,
|
|
130
|
+
)
|
|
131
|
+
expect(document.querySelector("[data-other-link]")).toBeTruthy()
|
|
132
|
+
expect(document.querySelector("[data-stub-link]")).toBeNull()
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
it("renders an external link as a plain <a>, not the router's", () => {
|
|
136
|
+
render(
|
|
137
|
+
<LinkComponentProvider component={StubLink}>
|
|
138
|
+
<Anchor href="https://42.fr" external>
|
|
139
|
+
42
|
|
140
|
+
</Anchor>
|
|
141
|
+
</LinkComponentProvider>,
|
|
142
|
+
)
|
|
143
|
+
expect(document.querySelector("[data-stub-link]")).toBeNull()
|
|
144
|
+
expect(screen.getByRole("link").getAttribute("href")).toBe("https://42.fr")
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it("lets asChild win over the provider", () => {
|
|
148
|
+
render(
|
|
149
|
+
<LinkComponentProvider component={StubLink}>
|
|
150
|
+
<Anchor asChild color="blue">
|
|
151
|
+
<a href="/own" data-own>
|
|
152
|
+
own
|
|
153
|
+
</a>
|
|
154
|
+
</Anchor>
|
|
155
|
+
</LinkComponentProvider>,
|
|
156
|
+
)
|
|
157
|
+
const link = screen.getByRole("link", { name: "own" })
|
|
158
|
+
expect(link.hasAttribute("data-own")).toBe(true)
|
|
159
|
+
expect(link.getAttribute("data-color")).toBe("blue")
|
|
160
|
+
expect(document.querySelector("[data-stub-link]")).toBeNull()
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
describe("Anchor external", () => {
|
|
165
|
+
it("opens in a new tab with a safe rel and an announced note", () => {
|
|
166
|
+
render(
|
|
167
|
+
<Anchor href="https://42.fr" external>
|
|
168
|
+
42
|
|
169
|
+
</Anchor>,
|
|
170
|
+
)
|
|
171
|
+
const link = screen.getByRole("link", { name: /^42 ?\(opens in a new tab\)$/ })
|
|
172
|
+
expect(link.getAttribute("target")).toBe("_blank")
|
|
173
|
+
expect(link.getAttribute("rel")).toBe("noopener noreferrer")
|
|
174
|
+
expect(link.hasAttribute("data-external")).toBe(true)
|
|
175
|
+
expect(link.querySelector("svg")).toBeTruthy()
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
it("merges the caller's rel tokens without duplicates", () => {
|
|
179
|
+
render(
|
|
180
|
+
<Anchor href="https://42.fr" external rel="me noopener">
|
|
181
|
+
42
|
|
182
|
+
</Anchor>,
|
|
183
|
+
)
|
|
184
|
+
expect(screen.getByRole("link").getAttribute("rel")).toBe("me noopener noreferrer")
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
it("makes any target=_blank safe, without the external affordance", () => {
|
|
188
|
+
render(
|
|
189
|
+
<Anchor href="/report.pdf" target="_blank">
|
|
190
|
+
Report
|
|
191
|
+
</Anchor>,
|
|
192
|
+
)
|
|
193
|
+
const link = screen.getByRole("link", { name: "Report" })
|
|
194
|
+
expect(link.getAttribute("rel")).toBe("noopener noreferrer")
|
|
195
|
+
expect(link.querySelector("svg")).toBeNull()
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
it("leaves rel alone on a same-tab link", () => {
|
|
199
|
+
render(
|
|
200
|
+
<Anchor href="/x" rel="next">
|
|
201
|
+
x
|
|
202
|
+
</Anchor>,
|
|
203
|
+
)
|
|
204
|
+
expect(screen.getByRole("link").getAttribute("rel")).toBe("next")
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
it("translates the note and drops the arrow with icons.external = null", () => {
|
|
208
|
+
render(
|
|
209
|
+
<Anchor
|
|
210
|
+
href="https://42.fr"
|
|
211
|
+
external
|
|
212
|
+
icons={{ external: null }}
|
|
213
|
+
translations={{ external: "(nouvel onglet)" }}
|
|
214
|
+
>
|
|
215
|
+
42
|
|
216
|
+
</Anchor>,
|
|
217
|
+
)
|
|
218
|
+
const link = screen.getByRole("link", { name: /^42 ?\(nouvel onglet\)$/ })
|
|
219
|
+
expect(link.querySelector("svg")).toBeNull()
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
it("puts the arrow and the note inside an asChild link", () => {
|
|
223
|
+
render(
|
|
224
|
+
<Anchor asChild external>
|
|
225
|
+
<a href="https://42.fr">42</a>
|
|
226
|
+
</Anchor>,
|
|
227
|
+
)
|
|
228
|
+
const link = screen.getByRole("link", { name: /^42 ?\(opens in a new tab\)$/ })
|
|
229
|
+
expect(link.getAttribute("target")).toBe("_blank")
|
|
230
|
+
expect(link.querySelector("svg")).toBeTruthy()
|
|
231
|
+
})
|
|
232
|
+
})
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { ark, type HTMLArkProps } from "@ark-ui/react"
|
|
4
|
+
import { cva } from "class-variance-authority"
|
|
5
|
+
import { ArrowUpRight } from "lucide-react"
|
|
6
|
+
import type { ElementType, ReactNode, Ref } from "react"
|
|
7
|
+
import { composeChildren } from "../../lib/as-child"
|
|
8
|
+
import { cn } from "../../lib/cn"
|
|
9
|
+
import type { Color } from "../../lib/colors"
|
|
10
|
+
import { focusStyles } from "../../lib/focus-styles"
|
|
11
|
+
import { type IconMap, iconStroke, mergeIcons } from "../../lib/icons"
|
|
12
|
+
import { useLinkComponent } from "../../lib/link-component"
|
|
13
|
+
import { props } from "../../lib/props"
|
|
14
|
+
import type { WithTestId } from "../../lib/test-id"
|
|
15
|
+
import { TYPOGRAPHY_SIZE_CLASSES, type TypographySize } from "../../lib/typography-size"
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Anchor — a themed `<a>` for links, inline in running text or standing on
|
|
19
|
+
* their own.
|
|
20
|
+
*
|
|
21
|
+
* It renders through the kit's router-link seam, like `NavLink`: the
|
|
22
|
+
* per-instance `linkComponent`, else the app-wide `<LinkComponentProvider>`,
|
|
23
|
+
* else a plain `<a>`. Reading that provider is a React context read, which is
|
|
24
|
+
* why Anchor is a client component (`Breadcrumb` stays a server component by
|
|
25
|
+
* taking only the per-instance prop, and so ignores the provider).
|
|
26
|
+
*
|
|
27
|
+
* Its colours are the Figma link's, the same `--btn-link-*` slots as
|
|
28
|
+
* `<Button variant="link">`: with no `color`, primary text that dims on hover;
|
|
29
|
+
* with a `color`, that palette's text, deepening on hover. `subtle` keeps the
|
|
30
|
+
* surrounding text colour until hover, for a table of contents or a footer.
|
|
31
|
+
*
|
|
32
|
+
* Size and weight come from the surrounding text unless `size` is set, so a
|
|
33
|
+
* link in a caption is caption-sized without anyone saying so.
|
|
34
|
+
*
|
|
35
|
+
* `external` is for a link that leaves the app: it opens in a new tab with
|
|
36
|
+
* `rel="noopener noreferrer"`, skips the router link (a router can't navigate
|
|
37
|
+
* off-site), and ends with an arrow plus a visually hidden "(opens in a new
|
|
38
|
+
* tab)", so the new tab is announced to everyone before it happens. Any
|
|
39
|
+
* `target="_blank"` gets the same safe `rel`.
|
|
40
|
+
*
|
|
41
|
+
* <Anchor href="/docs/colors">the colours page</Anchor>
|
|
42
|
+
* <Anchor href="https://42.fr" external>42.fr</Anchor>
|
|
43
|
+
* <Anchor href="#install" variant="subtle" underline="hover">Install</Anchor>
|
|
44
|
+
*/
|
|
45
|
+
const anchorVariants = cva(
|
|
46
|
+
[
|
|
47
|
+
"cursor-pointer rounded-xs transition-colors",
|
|
48
|
+
"underline-offset-2 decoration-from-font",
|
|
49
|
+
focusStyles(),
|
|
50
|
+
],
|
|
51
|
+
{
|
|
52
|
+
variants: {
|
|
53
|
+
variant: {
|
|
54
|
+
default: "text-(--btn-link-text) hover:text-(--btn-link-hover)",
|
|
55
|
+
subtle: "text-inherit hover:text-(--btn-link-text)",
|
|
56
|
+
},
|
|
57
|
+
underline: {
|
|
58
|
+
hover: "no-underline hover:underline",
|
|
59
|
+
always: "underline",
|
|
60
|
+
never: "no-underline",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
defaultVariants: { variant: "default", underline: "always" },
|
|
64
|
+
},
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
export type AnchorVariant = "default" | "subtle"
|
|
68
|
+
export type AnchorUnderline = "hover" | "always" | "never"
|
|
69
|
+
|
|
70
|
+
export type AnchorIconSlot = "external"
|
|
71
|
+
export type AnchorIcons = IconMap<AnchorIconSlot>
|
|
72
|
+
|
|
73
|
+
/** The default icons: `external`, the arrow after an external link. */
|
|
74
|
+
export const DEFAULT_ICONS: Record<AnchorIconSlot, ReactNode> = {
|
|
75
|
+
external: <ArrowUpRight aria-hidden className={cn(iconStroke, "rtl:-scale-x-100")} />,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The external link's hidden note. */
|
|
79
|
+
export type AnchorTranslations = {
|
|
80
|
+
/** Read after an `external` link's text. Default `"(opens in a new tab)"`. */
|
|
81
|
+
external?: string
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const ANCHOR_DEFAULT_TRANSLATIONS: Required<AnchorTranslations> = {
|
|
85
|
+
external: "(opens in a new tab)",
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type AnchorProps = Omit<HTMLArkProps<"a">, "color"> &
|
|
89
|
+
WithTestId & {
|
|
90
|
+
/** `default` paints the link in its palette; `subtle` keeps the
|
|
91
|
+
* surrounding text colour until hover. @default "default" */
|
|
92
|
+
variant?: AnchorVariant
|
|
93
|
+
/** The palette. Without it, the link is primary text, like Figma's
|
|
94
|
+
* link and `<Button variant="link">`. */
|
|
95
|
+
color?: Color
|
|
96
|
+
/** When the underline shows. @default "always" */
|
|
97
|
+
underline?: AnchorUnderline
|
|
98
|
+
/** Font size from the shared Text/Title scale. Inherited from the
|
|
99
|
+
* surrounding text when unset. */
|
|
100
|
+
size?: TypographySize
|
|
101
|
+
/** A link that leaves the app: opens in a new tab with a safe `rel`,
|
|
102
|
+
* skips the router link, and ends with the `external` icon and a hidden
|
|
103
|
+
* "(opens in a new tab)". */
|
|
104
|
+
external?: boolean
|
|
105
|
+
/** Overrides the `<LinkComponentProvider>` for this link only. */
|
|
106
|
+
linkComponent?: ElementType
|
|
107
|
+
/** Replaces the default icons: `external`, the arrow after an external
|
|
108
|
+
* link. `null` draws no arrow; the hidden note stays. */
|
|
109
|
+
icons?: AnchorIcons
|
|
110
|
+
/** Overrides the external link's hidden note. */
|
|
111
|
+
translations?: AnchorTranslations
|
|
112
|
+
ref?: Ref<HTMLAnchorElement>
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const SAFE_REL = ["noopener", "noreferrer"]
|
|
116
|
+
|
|
117
|
+
/** The caller's `rel` tokens plus `noopener noreferrer`, each once. */
|
|
118
|
+
const safeRel = (rel: string | undefined) =>
|
|
119
|
+
[...new Set([...(rel?.split(/\s+/).filter(Boolean) ?? []), ...SAFE_REL])].join(" ")
|
|
120
|
+
|
|
121
|
+
export const Anchor = ({
|
|
122
|
+
variant,
|
|
123
|
+
color,
|
|
124
|
+
underline,
|
|
125
|
+
size,
|
|
126
|
+
external,
|
|
127
|
+
linkComponent,
|
|
128
|
+
icons,
|
|
129
|
+
translations,
|
|
130
|
+
target,
|
|
131
|
+
rel,
|
|
132
|
+
asChild,
|
|
133
|
+
className,
|
|
134
|
+
children,
|
|
135
|
+
testId,
|
|
136
|
+
...rest
|
|
137
|
+
}: AnchorProps) => {
|
|
138
|
+
const provided = useLinkComponent(linkComponent)
|
|
139
|
+
const resolvedTarget = target ?? (external ? "_blank" : undefined)
|
|
140
|
+
const newTab = resolvedTarget === "_blank"
|
|
141
|
+
const icon = mergeIcons(DEFAULT_ICONS, icons).external
|
|
142
|
+
const note = { ...ANCHOR_DEFAULT_TRANSLATIONS, ...translations }.external
|
|
143
|
+
|
|
144
|
+
const content = (own: ReactNode) =>
|
|
145
|
+
external ? (
|
|
146
|
+
<>
|
|
147
|
+
{own}
|
|
148
|
+
{icon != null && (
|
|
149
|
+
<span
|
|
150
|
+
aria-hidden="true"
|
|
151
|
+
className="-me-[0.1em] inline-block align-[-0.075em] [&_svg]:size-[0.85em]"
|
|
152
|
+
>
|
|
153
|
+
{icon}
|
|
154
|
+
</span>
|
|
155
|
+
)}
|
|
156
|
+
<span className="sr-only"> {note}</span>
|
|
157
|
+
</>
|
|
158
|
+
) : (
|
|
159
|
+
own
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
const shared = {
|
|
163
|
+
"data-color": color,
|
|
164
|
+
target: resolvedTarget,
|
|
165
|
+
rel: newTab ? safeRel(rel) : rel,
|
|
166
|
+
className: cn(
|
|
167
|
+
anchorVariants({ variant, underline }),
|
|
168
|
+
size && TYPOGRAPHY_SIZE_CLASSES[size],
|
|
169
|
+
className,
|
|
170
|
+
),
|
|
171
|
+
...props({ "data-testid": testId, "data-external": external }),
|
|
172
|
+
...rest,
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// An off-site link stays a plain `<a>`: a router's Link can't leave the app,
|
|
176
|
+
// and some (TanStack Router's) reject an absolute URL outright. `asChild`
|
|
177
|
+
// wins over both: the child is the link.
|
|
178
|
+
if (asChild || external || !provided) {
|
|
179
|
+
return (
|
|
180
|
+
<ark.a asChild={asChild} {...shared}>
|
|
181
|
+
{composeChildren(asChild, children, content)}
|
|
182
|
+
</ark.a>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
const Link = provided
|
|
186
|
+
return <Link {...shared}>{content(children)}</Link>
|
|
187
|
+
}
|
|
@@ -144,13 +144,18 @@ describe("AppShell (mobile — container narrower than the 768 breakpoint)", ()
|
|
|
144
144
|
// (Drawer's body, which normally scrolls everything as one blob) is
|
|
145
145
|
// overridden to a non-scrolling flex column instead, with
|
|
146
146
|
// Header/Body/Footer as its three siblings — mirrors the desktop aside.
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
// "Nav" sits in SidebarBody's scroll area; Drawer's body is its plain,
|
|
148
|
+
// non-scrolling column (`scrollable={false}`), not a scroll area of its own.
|
|
149
|
+
const sidebarBody = screen
|
|
150
|
+
.getByText("Nav", { exact: false })
|
|
151
|
+
.closest("[data-scope=scroll-area][data-part=root]") as HTMLElement
|
|
152
|
+
expect(sidebarBody.className).toContain("flex-1")
|
|
149
153
|
|
|
150
154
|
const drawerBody = sidebarBody.parentElement as HTMLElement
|
|
155
|
+
expect(drawerBody.closest("[data-scope=scroll-area]")).toBeNull()
|
|
151
156
|
expect(drawerBody.className).toContain("flex-col")
|
|
157
|
+
expect(drawerBody.className).toContain("min-h-0")
|
|
152
158
|
expect(drawerBody.className).toContain("overflow-hidden")
|
|
153
|
-
expect(drawerBody.className).not.toContain("overflow-y-auto")
|
|
154
159
|
expect(Array.from(drawerBody.children)).toHaveLength(3) // Header, Body, Footer
|
|
155
160
|
})
|
|
156
161
|
|
|
@@ -415,11 +420,14 @@ describe('AppShell icon-rail sidebar (collapse="icons")', () => {
|
|
|
415
420
|
expect(column.querySelector("[data-sidebar-edge]")).toBeNull()
|
|
416
421
|
})
|
|
417
422
|
|
|
418
|
-
it("
|
|
423
|
+
it("keeps the body's scrollbar invisible on the rail only, where it would cover the icons", () => {
|
|
419
424
|
renderRail()
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
|
|
425
|
+
const root = screen
|
|
426
|
+
.getByText("Projects")
|
|
427
|
+
.closest("[data-scope=scroll-area][data-part=root]") as HTMLElement
|
|
428
|
+
const bar = root.querySelector("[data-part=scrollbar]") as HTMLElement
|
|
429
|
+
expect(bar.className).toContain("sidebar-rail:invisible")
|
|
430
|
+
expect(bar.className).not.toMatch(/(^| )invisible/)
|
|
423
431
|
})
|
|
424
432
|
|
|
425
433
|
it("keeps focus on its trigger, since the rail isn't hidden", () => {
|
|
@@ -29,6 +29,7 @@ import { useContainerQuery } from "../../lib/use-container-query"
|
|
|
29
29
|
import { useIsomorphicLayoutEffect } from "../../lib/use-isomorphic-layout-effect"
|
|
30
30
|
import { type Updater, useUncontrolled } from "../../lib/use-uncontrolled"
|
|
31
31
|
import { Drawer } from "../drawer/drawer"
|
|
32
|
+
import { ScrollArea } from "../scroll-area/scroll-area"
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* AppShell — header / sidebar / main / aside app frame, laid out with CSS
|
|
@@ -298,7 +299,9 @@ const AppShellSidebar = ({
|
|
|
298
299
|
aria-labelledby={rest["aria-labelledby"]}
|
|
299
300
|
ids={{ content: sidebarId }}
|
|
300
301
|
testId={testId}
|
|
301
|
-
|
|
302
|
+
// A non-scrolling body: Sidebar.Body is the scroller, so Header/Footer stay put.
|
|
303
|
+
scrollable={false}
|
|
304
|
+
classNames={{ body: "overflow-hidden p-0" }}
|
|
302
305
|
className={cn("w-full max-w-none", className)}
|
|
303
306
|
>
|
|
304
307
|
{children}
|
|
@@ -672,27 +675,31 @@ const AppShellSidebarHeader = ({ className, testId, ...rest }: AppShellSidebarHe
|
|
|
672
675
|
export type AppShellSidebarBodyProps = ComponentPropsWithoutRef<"div"> & WithTestId
|
|
673
676
|
|
|
674
677
|
/**
|
|
675
|
-
* The scroll region — the only part of Sidebar that scrolls.
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
*
|
|
679
|
-
*
|
|
680
|
-
*
|
|
678
|
+
* The scroll region — the only part of Sidebar that scrolls. A vertical `ScrollArea`, so the
|
|
679
|
+
* nav list shows the kit's thin overlay bars on every OS. Its edges fade (`fade`, 12px) only
|
|
680
|
+
* where there is more to scroll to, instead of a static mask that also dimmed the first and
|
|
681
|
+
* last links at rest; `overscroll-contain` stops scrolling the list from chaining into
|
|
682
|
+
* scrolling the rest of the page once it hits either end. On an icon rail the bar stays
|
|
683
|
+
* invisible (it would sit over the centred icons); the rail still scrolls by wheel, touch and
|
|
684
|
+
* focus, and the fade still shows there's more.
|
|
685
|
+
*
|
|
686
|
+
* `className` and the other props land on the scrolled content, which holds the padding and
|
|
687
|
+
* the links' layout.
|
|
681
688
|
*/
|
|
682
689
|
const AppShellSidebarBody = ({ className, testId, ...rest }: AppShellSidebarBodyProps) => (
|
|
683
|
-
<
|
|
684
|
-
className=
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
690
|
+
<ScrollArea.Root scrollbars="y" fade className="min-h-0 flex-1 [--scroll-area-fade:12px]">
|
|
691
|
+
<ScrollArea.Viewport className="overscroll-contain">
|
|
692
|
+
<ScrollArea.Content
|
|
693
|
+
className={cn("p-4", className)}
|
|
694
|
+
{...props({ "data-testid": testId })}
|
|
695
|
+
{...rest}
|
|
696
|
+
/>
|
|
697
|
+
</ScrollArea.Viewport>
|
|
698
|
+
{/* `invisible`, not `hidden`: the machine measures the track to size the thumb. */}
|
|
699
|
+
<ScrollArea.Scrollbar orientation="vertical" className="sidebar-rail:invisible">
|
|
700
|
+
<ScrollArea.Thumb />
|
|
701
|
+
</ScrollArea.Scrollbar>
|
|
702
|
+
</ScrollArea.Root>
|
|
696
703
|
)
|
|
697
704
|
|
|
698
705
|
export type AppShellSidebarFooterProps = ComponentPropsWithoutRef<"div"> & WithTestId
|
|
@@ -23,7 +23,12 @@ import {
|
|
|
23
23
|
type ComboboxTranslations,
|
|
24
24
|
resolveComboboxTranslations,
|
|
25
25
|
} from "../combobox/combobox"
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
type FieldProps,
|
|
28
|
+
FieldShell,
|
|
29
|
+
useInheritedDisabled,
|
|
30
|
+
useInheritedInvalid,
|
|
31
|
+
} from "../field/field"
|
|
27
32
|
import { type InputSize, type InputVariant, inputControlClasses, inputSlot } from "../input/input"
|
|
28
33
|
import { CloseIcon } from "../popover/icons"
|
|
29
34
|
import { popoverClearTrigger } from "../popover/popover"
|
|
@@ -118,7 +123,7 @@ export const Autocomplete = <const Data extends SelectData = SelectData>({
|
|
|
118
123
|
empty = "Nothing found",
|
|
119
124
|
size = "md",
|
|
120
125
|
variant = "default",
|
|
121
|
-
disabled,
|
|
126
|
+
disabled: disabledProp,
|
|
122
127
|
readOnly,
|
|
123
128
|
required,
|
|
124
129
|
invalid,
|
|
@@ -134,9 +139,12 @@ export const Autocomplete = <const Data extends SelectData = SelectData>({
|
|
|
134
139
|
translations,
|
|
135
140
|
}: AutocompleteProps<Data>) => {
|
|
136
141
|
const resolvedTranslations = resolveComboboxTranslations(translations)
|
|
142
|
+
// With no `label` there is no `Field` to pass a `Fieldset`'s state on, so
|
|
143
|
+
// read it here: the shell, the pills and the clear button all key off it.
|
|
144
|
+
const disabled = useInheritedDisabled(disabledProp)
|
|
137
145
|
// Red state is driven independently of the `Field` error slot so a form
|
|
138
146
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
139
|
-
const isInvalid = invalid || error != null
|
|
147
|
+
const isInvalid = useInheritedInvalid(invalid || error != null)
|
|
140
148
|
|
|
141
149
|
const [query, setQuery] = useUncontrolled({
|
|
142
150
|
value,
|