@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,7 +8,13 @@ import { cn } from "../../lib/cn"
|
|
|
8
8
|
import type { Color } from "../../lib/colors"
|
|
9
9
|
import { props } from "../../lib/props"
|
|
10
10
|
import type { WithTestId } from "../../lib/test-id"
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
type FieldProps,
|
|
13
|
+
FieldShell,
|
|
14
|
+
fieldA11yProps,
|
|
15
|
+
useInheritedDisabled,
|
|
16
|
+
useInheritedInvalid,
|
|
17
|
+
} from "../field/field"
|
|
12
18
|
import { type InputSize, shellChrome, shellVariants } from "../input/input"
|
|
13
19
|
|
|
14
20
|
/**
|
|
@@ -182,9 +188,12 @@ export const PinInput = ({
|
|
|
182
188
|
classNames,
|
|
183
189
|
testId,
|
|
184
190
|
}: PinInputProps) => {
|
|
191
|
+
// Ark's machine reads only a `Field`, so an unlabelled `PinInput` (no shell
|
|
192
|
+
// of its own) takes an enclosing `Fieldset`'s state here.
|
|
193
|
+
const isDisabled = useInheritedDisabled(disabled)
|
|
185
194
|
// Drive the red state independently of the `Field` error slot so a form
|
|
186
195
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
187
|
-
const isInvalid = invalid || error != null
|
|
196
|
+
const isInvalid = useInheritedInvalid(invalid || error != null)
|
|
188
197
|
|
|
189
198
|
return (
|
|
190
199
|
<FieldShell
|
|
@@ -192,7 +201,7 @@ export const PinInput = ({
|
|
|
192
201
|
description={description}
|
|
193
202
|
error={error}
|
|
194
203
|
required={required}
|
|
195
|
-
disabled={
|
|
204
|
+
disabled={isDisabled}
|
|
196
205
|
size={size}
|
|
197
206
|
className={classNames?.field}
|
|
198
207
|
// A row of cells: nothing carries the label's `for` id; the row's `aria-labelledby` names it.
|
|
@@ -212,7 +221,7 @@ export const PinInput = ({
|
|
|
212
221
|
placeholder={placeholder}
|
|
213
222
|
name={name}
|
|
214
223
|
translations={translations}
|
|
215
|
-
{...props({ invalid: isInvalid, disabled, readOnly, required })}
|
|
224
|
+
{...props({ invalid: isInvalid, disabled: isDisabled, readOnly, required })}
|
|
216
225
|
ids={id ? { root: id } : undefined}
|
|
217
226
|
data-color={color}
|
|
218
227
|
// `relative` contains the absolutely positioned hidden input, which would
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
createContext,
|
|
10
10
|
type MouseEvent,
|
|
11
11
|
type PointerEvent,
|
|
12
|
+
type ReactNode,
|
|
13
|
+
type Ref,
|
|
12
14
|
type RefObject,
|
|
13
15
|
useContext,
|
|
14
16
|
useEffect,
|
|
@@ -18,12 +20,14 @@ import {
|
|
|
18
20
|
import type { NoAsChild } from "../../lib/as-child"
|
|
19
21
|
import type { UnavailableProps } from "../../lib/available-if"
|
|
20
22
|
import { cn } from "../../lib/cn"
|
|
23
|
+
import { focusStyles } from "../../lib/focus-styles"
|
|
21
24
|
import { useOverlayContainer } from "../../lib/overlay-container"
|
|
22
25
|
import {
|
|
23
26
|
OverlayLayerProvider,
|
|
24
27
|
type OverlayLayers,
|
|
25
28
|
useLayerGuard,
|
|
26
29
|
useNestedLayer,
|
|
30
|
+
useTourRaised,
|
|
27
31
|
} from "../../lib/overlay-layer"
|
|
28
32
|
import {
|
|
29
33
|
type LogicalPosition,
|
|
@@ -41,6 +45,7 @@ import {
|
|
|
41
45
|
import type { WithTestId } from "../../lib/test-id"
|
|
42
46
|
import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
|
|
43
47
|
import { useUncontrolled } from "../../lib/use-uncontrolled"
|
|
48
|
+
import { ScrollArea } from "../scroll-area/scroll-area"
|
|
44
49
|
|
|
45
50
|
/*
|
|
46
51
|
* Shared popover presentation. Co-located with the Popover component and reused
|
|
@@ -73,22 +78,20 @@ export const popoverChrome = cn(
|
|
|
73
78
|
/** Outer chrome for the machine-driven listboxes (Combobox / Select / Autocomplete
|
|
74
79
|
* / MultiSelect): border, surface, shadow, and the open/close animation. It's a
|
|
75
80
|
* rounded **clipping** wrapper (`overflow-hidden`), NOT the scroller — the inner
|
|
76
|
-
* `
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
81
|
+
* `ListboxScrollArea` scrolls, and this clip rounds its corners. Border + clip on
|
|
82
|
+
* one element (like `popoverPanel`) keep the border whole, and `data-state` rides
|
|
83
|
+
* here so the whole box animates in/out and unmounts cleanly — no eaten corner,
|
|
84
|
+
* no floating frame on close. */
|
|
80
85
|
export const popoverContent = cn(popoverChrome, "flex w-full flex-col overflow-hidden")
|
|
81
86
|
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* scrolling is routed here via `scrollHighlightedIntoView` (the root's
|
|
87
|
-
* `scrollToIndexFn`). */
|
|
87
|
+
/** The scroller of the machine-driven listboxes: `ListboxScrollArea`'s viewport,
|
|
88
|
+
* capped at 16rem via `--available-height`. It carries the list's padding, so
|
|
89
|
+
* the scroll padding matches the edges, and has no border/radius of its own:
|
|
90
|
+
* `popoverContent`'s clip rounds it. */
|
|
88
91
|
export const popoverList = cva(
|
|
89
92
|
[
|
|
90
93
|
"flex w-full flex-col ps-1 pe-1 pb-1",
|
|
91
|
-
"
|
|
94
|
+
"overscroll-contain",
|
|
92
95
|
"max-h-[min(16rem,var(--available-height,16rem))]",
|
|
93
96
|
],
|
|
94
97
|
{
|
|
@@ -100,11 +103,74 @@ export const popoverList = cva(
|
|
|
100
103
|
},
|
|
101
104
|
)
|
|
102
105
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
export type ListboxScrollAreaProps = {
|
|
107
|
+
/** Classes for the scroller (the viewport), merged over `popoverList`. */
|
|
108
|
+
className?: string
|
|
109
|
+
/** Pads the top edge too; off when something sits flush above the list. */
|
|
110
|
+
withPaddingTop?: boolean
|
|
111
|
+
/** The scroller, for a host that watches or drives its scroll position. */
|
|
112
|
+
viewportRef?: Ref<HTMLDivElement>
|
|
113
|
+
children?: ReactNode
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The scroll frame of the machine-driven listboxes: a `ScrollArea` whose viewport
|
|
118
|
+
* is the scroller, so a long list shows the kit's bars rather than the OS's.
|
|
119
|
+
*
|
|
120
|
+
* - The viewport stays out of the tab order (`tabIndex={-1}`): the input or
|
|
121
|
+
* trigger that owns focus scrolls it, by moving the highlight.
|
|
122
|
+
* - Scrolling the highlight into view goes through `scrollHighlightedIntoView`
|
|
123
|
+
* (the root's `scrollToIndexFn`): a native `scrollIntoView` walks up to the
|
|
124
|
+
* nearest scroller, which is this viewport.
|
|
125
|
+
* - A focused list (Select's) is ringed on the frame, not on itself: inside the
|
|
126
|
+
* viewport, its own ring would scroll away and be clipped.
|
|
127
|
+
* - A press on the bar is kept from moving focus (`preventDefault` in the capture
|
|
128
|
+
* phase, before the machine's track handler stops the event), as a native
|
|
129
|
+
* scrollbar never takes it: otherwise the input would blur and the list close.
|
|
130
|
+
*/
|
|
131
|
+
export const ListboxScrollArea = ({
|
|
132
|
+
className,
|
|
133
|
+
withPaddingTop = true,
|
|
134
|
+
viewportRef,
|
|
135
|
+
children,
|
|
136
|
+
}: ListboxScrollAreaProps) => (
|
|
137
|
+
<ScrollArea.Root
|
|
138
|
+
scrollbars="y"
|
|
139
|
+
size="sm"
|
|
140
|
+
onPointerDownCapture={keepFocus}
|
|
141
|
+
// Select focuses its list, which scrolls inside the viewport: ring the frame instead,
|
|
142
|
+
// as an inset outline over the content, so neither the scroll nor the clip cuts it.
|
|
143
|
+
className={focusStyles({ source: "has-focus-visible", outline: true, inset: true })}
|
|
144
|
+
>
|
|
145
|
+
<ScrollArea.Viewport
|
|
146
|
+
ref={viewportRef}
|
|
147
|
+
tabIndex={-1}
|
|
148
|
+
className={cn(popoverList({ withPaddingTop }), className)}
|
|
149
|
+
>
|
|
150
|
+
{/* Fills a viewport given a fixed height, so the list can too (Spotlight's held height). */}
|
|
151
|
+
<ScrollArea.Content className="flex min-h-full flex-col">{children}</ScrollArea.Content>
|
|
152
|
+
</ScrollArea.Viewport>
|
|
153
|
+
<ScrollArea.Scrollbar orientation="vertical">
|
|
154
|
+
<ScrollArea.Thumb />
|
|
155
|
+
</ScrollArea.Scrollbar>
|
|
156
|
+
</ScrollArea.Root>
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
/** The listbox inside `ListboxScrollArea`: a column of options. */
|
|
160
|
+
export const listboxList = "flex grow flex-col focus-visible:outline-none"
|
|
161
|
+
|
|
162
|
+
/** Keeps focus where it is when the listbox's scrollbar is pressed. */
|
|
163
|
+
const keepFocus = (event: PointerEvent<HTMLElement>) => {
|
|
164
|
+
if ((event.target as Element).closest("[data-scope=scroll-area][data-part=scrollbar]")) {
|
|
165
|
+
event.preventDefault()
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Scroll the highlighted option into view from inside the `ListboxScrollArea`
|
|
170
|
+
* viewport. Wired as the combobox/select root's `scrollToIndexFn` so the machine
|
|
171
|
+
* routes scrolling through here instead of its native path — which early-returns
|
|
172
|
+
* unless the (`overflow-hidden`) Content is itself scrollable. Native
|
|
173
|
+
* `scrollIntoView` walks to the nearest scrollable ancestor, i.e. the viewport. */
|
|
108
174
|
export const scrollHighlightedIntoView = ({
|
|
109
175
|
getElement,
|
|
110
176
|
}: {
|
|
@@ -667,13 +733,17 @@ const Content = ({
|
|
|
667
733
|
const portalContainer = useOverlayContainer(container)
|
|
668
734
|
// A child of the enclosing Modal/Drawer/Popover (read above this popover's
|
|
669
735
|
// own provider), and the parent of whatever opens from its body.
|
|
670
|
-
|
|
736
|
+
const open = usePopoverContext().open
|
|
737
|
+
useNestedLayer(open)
|
|
738
|
+
// Lifted above a running tour; see `useTourRaised`.
|
|
739
|
+
const raised = useTourRaised(open)
|
|
671
740
|
const panel = (
|
|
672
741
|
<ArkPopover.Positioner style={sliding ? slideStyle : undefined}>
|
|
673
742
|
<ArkPopover.Content
|
|
674
743
|
tabIndex={-1}
|
|
675
744
|
// target → fill the sameWidth positioner; auto → size to content (max-content).
|
|
676
745
|
className={cn(popoverPanel, width === "target" ? "w-full" : "w-max", className)}
|
|
746
|
+
data-raised={raised || undefined}
|
|
677
747
|
{...props({ "data-testid": testId })}
|
|
678
748
|
// In `mode="hover"`: reaching the panel keeps a preview open, and
|
|
679
749
|
// pressing or focusing anything in it (a click, or Tab through
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { render, screen } from "@testing-library/react"
|
|
2
2
|
import { describe, expect, it } from "vitest"
|
|
3
|
+
import { IntlProvider } from "../../lib/intl"
|
|
3
4
|
import { Progress } from "./progress"
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -121,4 +122,105 @@ describe("Progress", () => {
|
|
|
121
122
|
expect(node).not.toBeNull()
|
|
122
123
|
expect((node as unknown as HTMLElement).getAttribute("data-part")).toBe("track")
|
|
123
124
|
})
|
|
125
|
+
|
|
126
|
+
describe("meter", () => {
|
|
127
|
+
it("is a role=meter with aria-value* and a locale-formatted aria-valuetext", () => {
|
|
128
|
+
render(<Progress meter value={40} aria-label="Disk usage" />)
|
|
129
|
+
const meter = screen.getByRole("meter", { name: "Disk usage" })
|
|
130
|
+
expect(screen.queryByRole("progressbar")).toBeNull()
|
|
131
|
+
expect(meter.getAttribute("aria-valuenow")).toBe("40")
|
|
132
|
+
expect(meter.getAttribute("aria-valuemin")).toBe("0")
|
|
133
|
+
expect(meter.getAttribute("aria-valuemax")).toBe("100")
|
|
134
|
+
expect(meter.getAttribute("aria-valuetext")).toBe("40%")
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it("formats the value text in the given locale and format", () => {
|
|
138
|
+
render(
|
|
139
|
+
<Progress
|
|
140
|
+
meter
|
|
141
|
+
value={1234.5}
|
|
142
|
+
max={2000}
|
|
143
|
+
locale="fr-FR"
|
|
144
|
+
formatOptions={{ style: "unit", unit: "gigabyte" }}
|
|
145
|
+
/>,
|
|
146
|
+
)
|
|
147
|
+
// fr-FR groups with a narrow no-break space and uses a decimal comma.
|
|
148
|
+
expect(screen.getByRole("meter").getAttribute("aria-valuetext")).toBe(
|
|
149
|
+
new Intl.NumberFormat("fr-FR", { style: "unit", unit: "gigabyte" }).format(1234.5),
|
|
150
|
+
)
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it("reads the IntlProvider's locale and direction (RTL)", () => {
|
|
154
|
+
const { container } = render(
|
|
155
|
+
<IntlProvider locale="ar-EG">
|
|
156
|
+
<Progress meter value={40} />
|
|
157
|
+
</IntlProvider>,
|
|
158
|
+
)
|
|
159
|
+
const meter = screen.getByRole("meter")
|
|
160
|
+
expect(meter.getAttribute("dir")).toBe("rtl")
|
|
161
|
+
expect(part(container, "range").getAttribute("dir")).toBe("rtl")
|
|
162
|
+
expect(meter.getAttribute("aria-valuetext")).toBe(
|
|
163
|
+
new Intl.NumberFormat("ar-EG", { style: "percent" }).format(0.4),
|
|
164
|
+
)
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
it("takes a translations.value override, and an explicit aria-valuetext over both", () => {
|
|
168
|
+
const { rerender } = render(
|
|
169
|
+
<Progress meter value={40} translations={{ value: ({ value }) => `Level ${value}` }} />,
|
|
170
|
+
)
|
|
171
|
+
expect(screen.getByRole("meter").getAttribute("aria-valuetext")).toBe("Level 40")
|
|
172
|
+
rerender(<Progress meter value={40} aria-valuetext="Almost level 8" />)
|
|
173
|
+
expect(screen.getByRole("meter").getAttribute("aria-valuetext")).toBe("Almost level 8")
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
it("colours the track by zone through the palettes, over `color`", () => {
|
|
177
|
+
const { rerender } = render(
|
|
178
|
+
<Progress meter value={90} color="blue" low={60} high={85} optimum={0} testId="m" />,
|
|
179
|
+
)
|
|
180
|
+
const track = screen.getByTestId("m")
|
|
181
|
+
expect(track.getAttribute("data-zone")).toBe("critical")
|
|
182
|
+
expect(track.getAttribute("data-color")).toBe("red")
|
|
183
|
+
rerender(<Progress meter value={70} color="blue" low={60} high={85} optimum={0} testId="m" />)
|
|
184
|
+
expect(track.getAttribute("data-color")).toBe("orange")
|
|
185
|
+
rerender(<Progress meter value={10} color="blue" low={60} high={85} optimum={0} testId="m" />)
|
|
186
|
+
expect(track.getAttribute("data-color")).toBe("green")
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
it("zones an uncontrolled meter from its default value", () => {
|
|
190
|
+
render(<Progress meter defaultValue={20} low={30} high={70} testId="m" />)
|
|
191
|
+
expect(screen.getByTestId("m").getAttribute("data-zone")).toBe("warning")
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
it("keeps `color` and writes no zone without thresholds", () => {
|
|
195
|
+
const { container } = render(<Progress meter value={40} color="purple" testId="m" />)
|
|
196
|
+
expect(screen.getByTestId("m").hasAttribute("data-zone")).toBe(false)
|
|
197
|
+
expect(part(container, "root").getAttribute("data-color")).toBe("purple")
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
it("reads a stray null as min instead of going indeterminate", () => {
|
|
201
|
+
const value = null as unknown as number
|
|
202
|
+
const { container } = render(<Progress meter value={value} />)
|
|
203
|
+
expect(part(container, "root").getAttribute("data-state")).not.toBe("indeterminate")
|
|
204
|
+
expect(screen.getByRole("meter").getAttribute("aria-valuenow")).toBe("0")
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
it("leaves the progressbar untouched when off: no valuetext, no zone", () => {
|
|
208
|
+
render(<Progress value={40} testId="p" />)
|
|
209
|
+
const bar = screen.getByRole("progressbar")
|
|
210
|
+
expect(bar.hasAttribute("aria-valuetext")).toBe(false)
|
|
211
|
+
expect(bar.hasAttribute("data-zone")).toBe(false)
|
|
212
|
+
expect(bar.hasAttribute("data-color")).toBe(false)
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
it("forbids indeterminate and thresholds at the type level", () => {
|
|
216
|
+
// @ts-expect-error a meter is never indeterminate
|
|
217
|
+
;<Progress meter value={null} />
|
|
218
|
+
// @ts-expect-error a meter is never indeterminate
|
|
219
|
+
;<Progress meter defaultValue={null} />
|
|
220
|
+
// @ts-expect-error thresholds need `meter`
|
|
221
|
+
;<Progress value={40} low={20} />
|
|
222
|
+
;<Progress meter value={40} low={20} high={80} optimum={100} />
|
|
223
|
+
;<Progress value={null} />
|
|
224
|
+
})
|
|
225
|
+
})
|
|
124
226
|
})
|
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
type GradientDir,
|
|
13
13
|
type GradientProps,
|
|
14
14
|
} from "../../lib/gradient"
|
|
15
|
+
import { useLocale } from "../../lib/intl"
|
|
16
|
+
import { arkValue, METER_ZONE_COLORS, type MeterProps, meterZone } from "../../lib/meter"
|
|
15
17
|
import { props } from "../../lib/props"
|
|
16
18
|
import type { Size } from "../../lib/sizes"
|
|
17
19
|
import type { WithTestId } from "../../lib/test-id"
|
|
@@ -29,6 +31,14 @@ import type { WithTestId } from "../../lib/test-id"
|
|
|
29
31
|
* - Two fill `variant`s: `filled` (solid accent, the default) and
|
|
30
32
|
* `gradient` (a Tailwind linear gradient on the Range, mirroring `Badge`).
|
|
31
33
|
*
|
|
34
|
+
* Pass `meter` for a measurement rather than a task (an XP level, disk usage,
|
|
35
|
+
* a quota): the Track becomes `role="meter"` with a locale-formatted
|
|
36
|
+
* `aria-valuetext`, can't be indeterminate, and optional `low` / `high` /
|
|
37
|
+
* `optimum` thresholds colour it by zone, like HTML `<meter>` (see
|
|
38
|
+
* `lib/meter.ts`).
|
|
39
|
+
*
|
|
40
|
+
* <Progress meter value={72} aria-label="Disk usage" high={80} optimum={0} />
|
|
41
|
+
*
|
|
32
42
|
* Palette is delivered through the kit's `data-color` + slot-var system
|
|
33
43
|
* (see `colors.ts` / `colors.css`). The root writes `data-color={color}` and
|
|
34
44
|
* the Range references `--c-solid`, so adding a color in
|
|
@@ -77,6 +87,7 @@ const progressRange = cva("h-full rounded-full", {
|
|
|
77
87
|
export type ProgressVariant = NonNullable<VariantProps<typeof progressRange>["variant"]>
|
|
78
88
|
export type ProgressSize = Size
|
|
79
89
|
|
|
90
|
+
export type { MeterZone } from "../../lib/meter"
|
|
80
91
|
export type { GradientDir, GradientProps }
|
|
81
92
|
|
|
82
93
|
type ProgressClassNames = {
|
|
@@ -87,24 +98,40 @@ type ProgressClassNames = {
|
|
|
87
98
|
|
|
88
99
|
type ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>
|
|
89
100
|
|
|
90
|
-
|
|
101
|
+
/**
|
|
102
|
+
* `M` is `meter`'s literal type, inferred at the call site (see `MeterProps`).
|
|
103
|
+
* Left out, it is `boolean`: every prop available, `value` plain `number | null`,
|
|
104
|
+
* which is what a generic wrapper or an `Omit<ProgressProps, …>` should see.
|
|
105
|
+
*/
|
|
106
|
+
export type ProgressProps<M extends boolean = boolean> = Omit<
|
|
91
107
|
ArkRootProps,
|
|
92
|
-
|
|
108
|
+
| "value"
|
|
109
|
+
| "defaultValue"
|
|
110
|
+
| "onValueChange"
|
|
111
|
+
// The kit's own `onChange` reports the value; a div's change event never fires here.
|
|
112
|
+
| "onChange"
|
|
113
|
+
| "ref"
|
|
114
|
+
| "className"
|
|
115
|
+
| "asChild"
|
|
116
|
+
| "locale"
|
|
117
|
+
| "formatOptions"
|
|
118
|
+
| "translations"
|
|
93
119
|
> &
|
|
94
120
|
ForbidAsChild &
|
|
95
121
|
VariantProps<typeof progressRange> &
|
|
96
|
-
WithTestId &
|
|
97
|
-
|
|
98
|
-
* Controlled value in `min..max`. Pass `null` for the indeterminate state.
|
|
99
|
-
* Leave unset (with no `defaultValue`) for an uncontrolled bar.
|
|
100
|
-
*/
|
|
101
|
-
value?: number | null
|
|
102
|
-
/** Uncontrolled initial value. Pass `null` to start indeterminate. */
|
|
103
|
-
defaultValue?: number | null
|
|
104
|
-
/** Fires on every value change. */
|
|
105
|
-
onChange?: (value: number | null) => void
|
|
122
|
+
WithTestId &
|
|
123
|
+
MeterProps<M> & {
|
|
106
124
|
size?: ProgressSize
|
|
107
|
-
/**
|
|
125
|
+
/** Locale the value text is formatted in: a BCP-47 tag, or `"auto"` for the
|
|
126
|
+
* visitor's. Defaults to the `IntlProvider`'s, then `en-US`. */
|
|
127
|
+
locale?: "auto" | (string & {})
|
|
128
|
+
/** `Intl.NumberFormat` options for the value text. Defaults to a percentage;
|
|
129
|
+
* `{ style: "unit", unit: "gigabyte" }` reads the raw value instead. */
|
|
130
|
+
formatOptions?: ArkRootProps["formatOptions"]
|
|
131
|
+
/** Overrides the value text. `value` receives `{ value, min, max, percent,
|
|
132
|
+
* formatter }` and returns what a screen reader says: "Level 7, 40% to 8". */
|
|
133
|
+
translations?: ArkRootProps["translations"]
|
|
134
|
+
/** Accent palette. Ignored when `variant="gradient"`, and by a meter's zones. */
|
|
108
135
|
color?: Color
|
|
109
136
|
/**
|
|
110
137
|
* Gradient config; only applied when `variant="gradient"`. Mirrors Badge:
|
|
@@ -113,7 +140,7 @@ export type ProgressProps = Omit<
|
|
|
113
140
|
* (purple-300 → pink-400, to-r).
|
|
114
141
|
*/
|
|
115
142
|
gradient?: GradientProps
|
|
116
|
-
/** Lands on the Track — the `role="progressbar"` element. */
|
|
143
|
+
/** Lands on the Track — the `role="progressbar"` (or `"meter"`) element. */
|
|
117
144
|
ref?: Ref<HTMLDivElement>
|
|
118
145
|
/** Names the bar. Lands on the Track, the `role="progressbar"` element, like the other
|
|
119
146
|
* `aria-*` naming props below; without one, Ark names it by its value ("40"). */
|
|
@@ -121,17 +148,24 @@ export type ProgressProps = Omit<
|
|
|
121
148
|
/** Names the bar after a visible caption, by id. Wins over `aria-label`. */
|
|
122
149
|
"aria-labelledby"?: string
|
|
123
150
|
"aria-describedby"?: string
|
|
124
|
-
/** Read instead of the number: "Processing", "3 of 8 files".
|
|
151
|
+
/** Read instead of the number: "Processing", "3 of 8 files". A meter
|
|
152
|
+
* writes its formatted value here when unset. */
|
|
125
153
|
"aria-valuetext"?: string
|
|
126
154
|
className?: string
|
|
127
155
|
classNames?: ProgressClassNames
|
|
128
156
|
style?: CSSProperties
|
|
129
157
|
}
|
|
130
158
|
|
|
131
|
-
|
|
159
|
+
// `M` defaults to `false`, not `boolean`, so a bar with no `meter` rejects thresholds.
|
|
160
|
+
export const Progress = <M extends boolean = false>({
|
|
132
161
|
value,
|
|
133
162
|
defaultValue,
|
|
134
163
|
onChange,
|
|
164
|
+
meter,
|
|
165
|
+
low,
|
|
166
|
+
high,
|
|
167
|
+
optimum,
|
|
168
|
+
locale,
|
|
135
169
|
variant,
|
|
136
170
|
size,
|
|
137
171
|
color,
|
|
@@ -150,66 +184,86 @@ export const Progress = ({
|
|
|
150
184
|
"aria-describedby": describedBy,
|
|
151
185
|
"aria-valuetext": valueText,
|
|
152
186
|
...rest
|
|
153
|
-
}: ProgressProps) => {
|
|
187
|
+
}: ProgressProps<M>) => {
|
|
154
188
|
const isGradient = variant === "gradient"
|
|
189
|
+
const resolvedLocale = useLocale(locale)
|
|
155
190
|
|
|
156
191
|
return (
|
|
157
192
|
<Ark.Root
|
|
158
193
|
// `undefined` → uncontrolled (Ark's own default). `null` → indeterminate.
|
|
159
194
|
// The two must NOT be coalesced, so each is forwarded verbatim.
|
|
160
|
-
value={value}
|
|
161
|
-
defaultValue={defaultValue}
|
|
162
|
-
|
|
195
|
+
value={arkValue("Progress", meter, value, min)}
|
|
196
|
+
defaultValue={arkValue("Progress", meter, defaultValue, min)}
|
|
197
|
+
// A meter's value is never null, so its narrower `onChange` takes Ark's value as is.
|
|
198
|
+
onValueChange={
|
|
199
|
+
onChange ? ({ value: v }) => (onChange as (v: number | null) => void)(v) : undefined
|
|
200
|
+
}
|
|
163
201
|
min={min}
|
|
164
202
|
max={max}
|
|
203
|
+
locale={resolvedLocale}
|
|
165
204
|
data-color={!isGradient ? color : undefined}
|
|
166
205
|
className={cn("group/progress w-full", className, classNames?.root)}
|
|
167
206
|
style={style}
|
|
168
207
|
{...rest}
|
|
169
208
|
>
|
|
170
|
-
<Ark.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
209
|
+
<Ark.Context>
|
|
210
|
+
{(api) => {
|
|
211
|
+
// Meter zones read the machine's own value, so an uncontrolled meter is coloured too.
|
|
212
|
+
const zone = meter ? meterZone(api.value, { min, max, low, high, optimum }) : undefined
|
|
213
|
+
return (
|
|
214
|
+
<Ark.Track
|
|
215
|
+
ref={ref}
|
|
216
|
+
className={cn(progressTrack({ size }), classNames?.track)}
|
|
217
|
+
// Ark stamps `role="progressbar"` here; a meter overrides it (local props win).
|
|
218
|
+
{...(meter ? { role: "meter" } : null)}
|
|
219
|
+
{...props({
|
|
220
|
+
"data-testid": testId,
|
|
221
|
+
// The zone's palette lands on the Track, which the Range inherits from.
|
|
222
|
+
"data-color": zone && !isGradient ? METER_ZONE_COLORS[zone] : undefined,
|
|
223
|
+
"data-zone": zone,
|
|
224
|
+
"aria-label": label,
|
|
225
|
+
"aria-labelledby": labelledBy,
|
|
226
|
+
"aria-describedby": describedBy,
|
|
227
|
+
// A meter always says its value: Ark's locale-aware `valueAsString`, which
|
|
228
|
+
// `formatOptions` / `translations.value` shape, unless the caller wrote one.
|
|
229
|
+
"aria-valuetext": valueText ?? (meter ? api.valueAsString : undefined),
|
|
230
|
+
})}
|
|
231
|
+
>
|
|
232
|
+
<Ark.Range
|
|
233
|
+
// Gradient styling lives on the Range (where the gradient renders),
|
|
234
|
+
// not the root — Ark also sets `style.width` here, but the keys don't
|
|
235
|
+
// overlap and Ark merges the two via mergeProps.
|
|
236
|
+
// - backgroundSize stretches the gradient to the full track width:
|
|
237
|
+
// the Range is `percent%` of the track, so `10000% / percent` of
|
|
238
|
+
// the Range equals the track width (Ark exposes `--percent` on the
|
|
239
|
+
// root; it cascades here). Pinned to the start by `bg-left`, the
|
|
240
|
+
// Range reveals only its left slice — the full from→to shows at
|
|
241
|
+
// 100%. Falls back to 100% when indeterminate (`--percent` unset).
|
|
242
|
+
// - buildGradientVars sets the --tw-gradient-* vars from `gradient`.
|
|
243
|
+
style={
|
|
244
|
+
isGradient
|
|
245
|
+
? {
|
|
246
|
+
backgroundSize: "calc(10000% / var(--percent, 100)) 100%",
|
|
247
|
+
...(gradient ? buildGradientVars(gradient) : null),
|
|
248
|
+
}
|
|
249
|
+
: undefined
|
|
197
250
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
251
|
+
className={cn(
|
|
252
|
+
progressRange({ variant }),
|
|
253
|
+
isGradient && gradient?.dir && GRADIENT_DIR_CLASS[gradient.dir],
|
|
254
|
+
// Indeterminate: Ark omits the inline width, so the Range would
|
|
255
|
+
// otherwise fill the track. Pin it to a fraction and animate a
|
|
256
|
+
// clipped sweep. `group-data-[state=…]` reads the state Ark stamps
|
|
257
|
+
// on the root.
|
|
258
|
+
"group-data-[state=indeterminate]/progress:w-2/5",
|
|
259
|
+
"group-data-[state=indeterminate]/progress:animate-progress-indeterminate",
|
|
260
|
+
classNames?.range,
|
|
261
|
+
)}
|
|
262
|
+
/>
|
|
263
|
+
</Ark.Track>
|
|
264
|
+
)
|
|
265
|
+
}}
|
|
266
|
+
</Ark.Context>
|
|
213
267
|
</Ark.Root>
|
|
214
268
|
)
|
|
215
269
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Prose, type ProseProps, type ProseSize } from "./prose"
|