@42-central/ui-react 0.29.1 → 0.30.1
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/breadcrumb/breadcrumb.d.ts +5 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +12 -0
- package/dist/components/breadcrumb/index.js.map +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/breadcrumb/breadcrumb.test.tsx +24 -0
- package/src/components/breadcrumb/breadcrumb.tsx +20 -1
- package/src/components/button/button-pressed.test.tsx +202 -0
- package/src/components/button/button.tsx +48 -6
- package/src/components/button-select/button-select-control.tsx +2 -2
- package/src/components/button-select/button-select.tsx +22 -2
- package/src/components/calendar/aliases.tsx +28 -0
- package/src/components/calendar/calendar-body.tsx +310 -210
- package/src/components/calendar/calendar.tsx +43 -12
- package/src/components/calendar/index.ts +7 -1
- package/src/components/calendar/month-year-calendar.test.tsx +106 -0
- package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
- package/src/components/checkbox/checkbox.tsx +7 -2
- package/src/components/choice-card-group/choice-card-group.tsx +2 -2
- package/src/components/circular-progress/circular-progress.test.tsx +35 -0
- package/src/components/circular-progress/circular-progress.tsx +116 -59
- package/src/components/circular-progress/index.ts +1 -0
- package/src/components/code/code.test.tsx +16 -0
- package/src/components/code/code.tsx +11 -0
- package/src/components/combobox/combobox.tsx +63 -28
- package/src/components/combobox-list/combobox-list.tsx +11 -3
- package/src/components/data-list/data-list.test.tsx +149 -0
- package/src/components/data-list/data-list.tsx +268 -0
- package/src/components/data-list/index.ts +9 -0
- package/src/components/data-table/data-table-group.test.tsx +16 -0
- package/src/components/data-table/data-table-group.tsx +15 -2
- package/src/components/data-table/data-table-placeholder.tsx +28 -36
- package/src/components/data-table/data-table-stack.tsx +33 -39
- package/src/components/data-table/data-table.test.tsx +31 -0
- package/src/components/data-table/data-table.tsx +41 -42
- package/src/components/date-picker/aliases.tsx +28 -0
- package/src/components/date-picker/date-picker.test.tsx +29 -0
- package/src/components/date-picker/date-picker.tsx +164 -45
- package/src/components/date-picker/index.ts +5 -1
- package/src/components/date-picker/month-year-picker.test.tsx +362 -0
- package/src/components/drawer/drawer.test.tsx +41 -0
- package/src/components/drawer/drawer.tsx +7 -1
- package/src/components/empty-state/empty-state.test.tsx +109 -0
- package/src/components/empty-state/empty-state.tsx +180 -0
- package/src/components/empty-state/index.ts +9 -0
- package/src/components/field/field.tsx +35 -1
- package/src/components/fieldset/fieldset.test.tsx +352 -0
- package/src/components/fieldset/fieldset.tsx +268 -0
- package/src/components/fieldset/index.ts +11 -0
- package/src/components/file-preview/file-preview.test.tsx +2 -1
- package/src/components/file-preview/file-preview.tsx +7 -13
- package/src/components/file-upload/file-upload.tsx +14 -5
- package/src/components/hover-card/hover-card.tsx +5 -1
- package/src/components/input/input.tsx +12 -5
- package/src/components/kbd/kbd.test.tsx +13 -0
- package/src/components/kbd/kbd.tsx +6 -0
- package/src/components/menu/menu.tsx +6 -2
- package/src/components/modal/modal.test.tsx +41 -0
- package/src/components/modal/modal.tsx +17 -9
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
- package/src/components/multi-select/multi-select.tsx +11 -3
- package/src/components/notification/create-notifier.tsx +1 -1
- package/src/components/number-input/number-input.tsx +12 -3
- package/src/components/overlays/dialog-parts.tsx +42 -5
- package/src/components/pagination/index.ts +19 -0
- package/src/components/pagination/pagination.test.tsx +187 -0
- package/src/components/pagination/pagination.tsx +563 -0
- package/src/components/password-input/password-input.tsx +12 -3
- package/src/components/phone-input/phone-input.tsx +12 -3
- package/src/components/pills-input/pills-input.tsx +7 -2
- package/src/components/pin-input/pin-input.tsx +13 -4
- package/src/components/popover/popover.tsx +87 -17
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/progress.test.tsx +102 -0
- package/src/components/progress/progress.tsx +116 -62
- package/src/components/prose/index.ts +1 -0
- package/src/components/prose/prose.test.tsx +90 -0
- package/src/components/prose/prose.tsx +60 -0
- package/src/components/prose/styles.css +593 -0
- package/src/components/radio-group/radio-group.tsx +8 -3
- package/src/components/rating/rating.tsx +5 -2
- package/src/components/scroll-area/index.ts +18 -0
- package/src/components/scroll-area/scroll-area.test.tsx +184 -0
- package/src/components/scroll-area/scroll-area.tsx +448 -0
- package/src/components/segment-group/segment-group.tsx +2 -2
- package/src/components/select/select.tsx +37 -18
- package/src/components/slider/slider.tsx +2 -2
- package/src/components/splitter/index.ts +15 -0
- package/src/components/splitter/splitter.test.tsx +244 -0
- package/src/components/splitter/splitter.tsx +625 -0
- package/src/components/spotlight/spotlight.test.tsx +34 -26
- package/src/components/spotlight/spotlight.tsx +7 -9
- package/src/components/steps/index.ts +21 -0
- package/src/components/steps/steps-data.tsx +179 -0
- package/src/components/steps/steps.test.tsx +235 -0
- package/src/components/steps/steps.tsx +686 -0
- package/src/components/switch/switch.tsx +7 -2
- package/src/components/table-of-contents/index.ts +17 -0
- package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
- package/src/components/table-of-contents/table-of-contents.tsx +708 -0
- package/src/components/tags-input/tags-input.tsx +12 -3
- package/src/components/textarea/textarea.tsx +15 -5
- package/src/components/tooltip/tooltip.tsx +8 -17
- package/src/components/tour/conditions.test.ts +527 -0
- package/src/components/tour/conditions.ts +445 -0
- package/src/components/tour/create-tours.tsx +150 -0
- package/src/components/tour/index.ts +86 -0
- package/src/components/tour/runtime.ts +187 -0
- package/src/components/tour/storage.test.ts +68 -0
- package/src/components/tour/storage.ts +44 -0
- package/src/components/tour/store.test.tsx +784 -0
- package/src/components/tour/store.ts +661 -0
- package/src/components/tour/tour.test.tsx +318 -0
- package/src/components/tour/tour.tsx +773 -0
- package/src/components/tour/tour.types.test.ts +185 -0
- package/src/components/tour/types.ts +904 -0
- package/src/components/tree/index.ts +24 -0
- package/src/components/tree/tree-row.tsx +179 -0
- package/src/components/tree/tree.test.tsx +296 -0
- package/src/components/tree/tree.tsx +796 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
- package/src/components/tree-select/tree-popover.tsx +26 -107
- package/src/components/tree-select/tree-select.tsx +24 -16
- package/src/icon-stroke.test.tsx +2 -0
- package/src/index.ts +16 -0
- package/src/lib/date-predicates.test.ts +46 -0
- package/src/lib/date-predicates.ts +44 -24
- package/src/lib/date-value.test.ts +24 -1
- package/src/lib/date-value.ts +42 -1
- package/src/lib/floating-arrow.tsx +73 -0
- package/src/lib/focus-return.test.tsx +143 -0
- package/src/lib/focus-return.ts +106 -0
- package/src/lib/meter.test.ts +40 -0
- package/src/lib/meter.ts +159 -0
- package/src/lib/overlay-layer.test.tsx +47 -1
- package/src/lib/overlay-layer.tsx +65 -8
- package/src/lib/pressed.ts +130 -0
- package/src/lib/tree-data.ts +42 -2
- package/src/lib/use-pagination.test.ts +105 -0
- package/src/lib/use-pagination.ts +179 -0
- package/src/lib/use-scroll-spy.test.tsx +238 -0
- package/src/lib/use-scroll-spy.ts +336 -0
- package/src/theme.css +39 -3
- package/src/theme.test.ts +29 -1
- package/src/visually-hidden-containment.test.tsx +9 -0
- package/dist/chunk-2W7H43WL.js.map +0 -1
- package/dist/chunk-7E7JNWOC.js.map +0 -1
- package/dist/chunk-7FPSQBWB.js.map +0 -1
- package/dist/chunk-7KFUFAVP.js.map +0 -1
- package/dist/chunk-AKXALCUN.js.map +0 -1
- package/dist/chunk-B5YHYI7E.js.map +0 -1
- package/dist/chunk-FQJNQW3G.js.map +0 -1
- package/dist/chunk-G3AD3NJG.js.map +0 -1
- package/dist/chunk-GEZYGBXY.js.map +0 -1
- package/dist/chunk-HCHGERDB.js.map +0 -1
- package/dist/chunk-HWBFRDX7.js.map +0 -1
- package/dist/chunk-I4B3N3UX.js.map +0 -1
- package/dist/chunk-IA6DCC3N.js.map +0 -1
- package/dist/chunk-IANYMDKH.js.map +0 -1
- package/dist/chunk-MQHD3EJE.js.map +0 -1
- package/dist/chunk-NNPSBC7O.js.map +0 -1
- package/dist/chunk-OXR7BXZA.js.map +0 -1
- package/dist/chunk-QKSLDQM2.js +0 -120
- package/dist/chunk-QKSLDQM2.js.map +0 -1
- package/dist/chunk-QRNQQIQM.js.map +0 -1
- package/dist/chunk-RKCUXOU2.js.map +0 -1
- package/dist/chunk-S5CQRCTF.js +0 -426
- package/dist/chunk-S5CQRCTF.js.map +0 -1
- package/dist/chunk-SBZJGFZ6.js.map +0 -1
- package/dist/chunk-SP6LCCTZ.js.map +0 -1
- package/dist/chunk-TUP7WXQE.js.map +0 -1
- package/dist/chunk-V2QZG4IT.js.map +0 -1
- package/dist/chunk-X6DESK37.js.map +0 -1
- package/dist/chunk-ZB5VMGKB.js.map +0 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Fieldset as Ark } from "@ark-ui/react/fieldset"
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
|
+
import { type ComponentPropsWithoutRef, createContext, type ReactNode, useContext } from "react"
|
|
6
|
+
import type { NoAsChild } from "../../lib/as-child"
|
|
7
|
+
import { cn } from "../../lib/cn"
|
|
8
|
+
import { props } from "../../lib/props"
|
|
9
|
+
import type { WithTestId } from "../../lib/test-id"
|
|
10
|
+
import { TEXT_COLOR_CLASSES, TYPOGRAPHY_SHADE_CLASSES } from "../../lib/typography-size"
|
|
11
|
+
import type { FieldSize } from "../field/field"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Fieldset — groups related form controls under a legend, on Ark UI's
|
|
15
|
+
* `Fieldset`. It renders a real `<fieldset>`, so the browser's own rules apply
|
|
16
|
+
* to everything inside: `disabled` turns off every native `<input>`,
|
|
17
|
+
* `<button>`, `<select>` and `<textarea>` in the group, and the legend names
|
|
18
|
+
* the group for assistive tech.
|
|
19
|
+
*
|
|
20
|
+
* - `legend` names the group; `description` sits under it; `error` sits at
|
|
21
|
+
* the bottom and flips the group to `invalid`, like `Field`'s `error`.
|
|
22
|
+
* - `disabled` cascades to every kit control inside. A control in a `Field`
|
|
23
|
+
* (any control given a `label`) also takes the dimmed look, since Ark's
|
|
24
|
+
* `Field` reads the fieldset's state.
|
|
25
|
+
* - `invalid` (or `error`) cascades to every `Field` inside, so a labelled
|
|
26
|
+
* control turns red with the group. A group-level message ("pick at least
|
|
27
|
+
* one") belongs in the fieldset's `error`, not in one control's.
|
|
28
|
+
* - `variant` picks the frame: `default` (the kit's hairline), `filled`
|
|
29
|
+
* (hairline over a quiet wash) or `unstyled` (no frame, no padding).
|
|
30
|
+
*
|
|
31
|
+
* A `Field` inside composes as usual: the fieldset never touches its label,
|
|
32
|
+
* description or error, only its disabled and invalid state.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <Fieldset legend="Personal information" description="Shown on your profile." disabled={saving}>
|
|
37
|
+
* <TextInput label="Name" />
|
|
38
|
+
* <TextInput label="Email" type="email" />
|
|
39
|
+
* </Fieldset>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
const fieldsetRoot = cva(
|
|
44
|
+
// `min-w-0` undoes the UA's `min-inline-size: min-content`, which would let
|
|
45
|
+
// a wide child (a table, a long select value) stretch the group past its
|
|
46
|
+
// container instead of shrinking with it.
|
|
47
|
+
["group/fieldset relative flex min-w-0 flex-col", TEXT_COLOR_CLASSES.primary],
|
|
48
|
+
{
|
|
49
|
+
variants: {
|
|
50
|
+
variant: {
|
|
51
|
+
// The kit's form hairline alone: the group takes the background it
|
|
52
|
+
// sits on, and its controls keep their own quiet surface inside.
|
|
53
|
+
default: "rounded-card border border-brand-900/20 dark:border-white/15",
|
|
54
|
+
// The hairline over a wash that shows in both themes: `bg-white/4`
|
|
55
|
+
// alone vanishes on a light page, so light mode takes the table
|
|
56
|
+
// stripe's `black/3`.
|
|
57
|
+
filled:
|
|
58
|
+
"rounded-card border border-brand-900/20 bg-black/3 dark:border-white/15 dark:bg-white/4",
|
|
59
|
+
unstyled: "border-0 p-0",
|
|
60
|
+
},
|
|
61
|
+
size: {
|
|
62
|
+
xs: "gap-2",
|
|
63
|
+
sm: "gap-3",
|
|
64
|
+
md: "gap-4",
|
|
65
|
+
lg: "gap-5",
|
|
66
|
+
xl: "gap-6",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
compoundVariants: [
|
|
70
|
+
// The legend sits on the border (the browser's own notch), so the top
|
|
71
|
+
// padding only has to clear the description, not the legend.
|
|
72
|
+
{ variant: ["default", "filled"], size: "xs", className: "px-3 pt-1 pb-3" },
|
|
73
|
+
{ variant: ["default", "filled"], size: "sm", className: "px-3 pt-1.5 pb-3" },
|
|
74
|
+
{ variant: ["default", "filled"], size: "md", className: "px-4 pt-2 pb-4" },
|
|
75
|
+
{ variant: ["default", "filled"], size: "lg", className: "px-5 pt-2.5 pb-5" },
|
|
76
|
+
{ variant: ["default", "filled"], size: "xl", className: "px-6 pt-3 pb-6" },
|
|
77
|
+
],
|
|
78
|
+
defaultVariants: { variant: "default", size: "md" },
|
|
79
|
+
},
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
const fieldsetLegend = cva(
|
|
83
|
+
["font-semibold text-trim", TEXT_COLOR_CLASSES.primary, "data-disabled:opacity-60"],
|
|
84
|
+
{
|
|
85
|
+
variants: {
|
|
86
|
+
// Framed, the legend is cut into the border: inline padding keeps the
|
|
87
|
+
// hairline off its first and last letter. Unstyled, it is a heading.
|
|
88
|
+
variant: { default: "px-1.5 -mx-1.5", filled: "px-1.5 -mx-1.5", unstyled: "p-0" },
|
|
89
|
+
size: { xs: "text-xs", sm: "text-sm", md: "text-md", lg: "text-lg", xl: "text-xl" },
|
|
90
|
+
},
|
|
91
|
+
compoundVariants: [
|
|
92
|
+
// An unstyled legend has no notch to sit in: it takes the row gap's
|
|
93
|
+
// place above the description, as a `Field` label does.
|
|
94
|
+
{ variant: "unstyled", size: ["xs", "sm"], className: "mb-2" },
|
|
95
|
+
{ variant: "unstyled", size: ["md", "lg"], className: "mb-3" },
|
|
96
|
+
{ variant: "unstyled", size: "xl", className: "mb-4" },
|
|
97
|
+
],
|
|
98
|
+
defaultVariants: { variant: "default", size: "md" },
|
|
99
|
+
},
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
const textSize = { xs: "text-xs", sm: "text-xs", md: "text-sm", lg: "text-sm", xl: "text-md" }
|
|
103
|
+
|
|
104
|
+
const fieldsetDescription = cva(
|
|
105
|
+
[TYPOGRAPHY_SHADE_CLASSES.muted, "group-data-disabled/fieldset:opacity-60"],
|
|
106
|
+
{ variants: { size: textSize }, defaultVariants: { size: "md" } },
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
/** Figma's `Text/text-error-primary`, the pair `Field`'s error uses. */
|
|
110
|
+
const fieldsetError = cva(TEXT_COLOR_CLASSES.error, {
|
|
111
|
+
variants: { size: textSize },
|
|
112
|
+
defaultVariants: { size: "md" },
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
export type FieldsetVariant = NonNullable<VariantProps<typeof fieldsetRoot>["variant"]>
|
|
116
|
+
|
|
117
|
+
type Style = { variant: FieldsetVariant; size: FieldSize }
|
|
118
|
+
|
|
119
|
+
/** The root's `variant` and `size`, so composed parts match without being told. */
|
|
120
|
+
const FieldsetStyleContext = createContext<Style>({ variant: "default", size: "md" })
|
|
121
|
+
|
|
122
|
+
export type FieldsetRootProps = NoAsChild<
|
|
123
|
+
Omit<ComponentPropsWithoutRef<typeof Ark.Root>, "className">
|
|
124
|
+
> &
|
|
125
|
+
WithTestId & {
|
|
126
|
+
/** The frame: the kit's hairline, a hairline over a quiet wash, or none. */
|
|
127
|
+
variant?: FieldsetVariant
|
|
128
|
+
/** Scales the legend, the helper and error text, the padding and the gap between controls. */
|
|
129
|
+
size?: FieldSize
|
|
130
|
+
/** Turns off every control inside: native ones through the `<fieldset>`, kit ones through Ark. */
|
|
131
|
+
disabled?: boolean
|
|
132
|
+
/** Marks the group invalid: shows `Fieldset.Error` and turns every `Field` inside red. */
|
|
133
|
+
invalid?: boolean
|
|
134
|
+
/** Styles the `<fieldset>`. */
|
|
135
|
+
className?: string
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The `<fieldset>` itself. `asChild` is a compile error: the cascade of
|
|
140
|
+
* `disabled` is the browser's, and only a real `<fieldset>` has it.
|
|
141
|
+
*/
|
|
142
|
+
const Root = ({
|
|
143
|
+
variant = "default",
|
|
144
|
+
size = "md",
|
|
145
|
+
className,
|
|
146
|
+
testId,
|
|
147
|
+
asChild: _asChild,
|
|
148
|
+
...rest
|
|
149
|
+
}: FieldsetRootProps) => (
|
|
150
|
+
<FieldsetStyleContext.Provider value={{ variant, size }}>
|
|
151
|
+
<Ark.Root
|
|
152
|
+
className={cn(fieldsetRoot({ variant, size }), className)}
|
|
153
|
+
{...props({ "data-variant": variant, "data-testid": testId })}
|
|
154
|
+
{...rest}
|
|
155
|
+
/>
|
|
156
|
+
</FieldsetStyleContext.Provider>
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
export type FieldsetLegendProps = ComponentPropsWithoutRef<typeof Ark.Legend> & WithTestId
|
|
160
|
+
|
|
161
|
+
/** The group's name: the first child of the `<fieldset>`, which the browser cuts into the border. */
|
|
162
|
+
const Legend = ({ className, testId, ...rest }: FieldsetLegendProps) => {
|
|
163
|
+
const style = useContext(FieldsetStyleContext)
|
|
164
|
+
return (
|
|
165
|
+
<Ark.Legend
|
|
166
|
+
className={cn(fieldsetLegend(style), className)}
|
|
167
|
+
{...props({ "data-testid": testId })}
|
|
168
|
+
{...rest}
|
|
169
|
+
/>
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type FieldsetDescriptionProps = ComponentPropsWithoutRef<typeof Ark.HelperText> & WithTestId
|
|
174
|
+
|
|
175
|
+
/** Helper text for the whole group, under the legend. The `<fieldset>` is described by it. */
|
|
176
|
+
const Description = ({ className, testId, ...rest }: FieldsetDescriptionProps) => {
|
|
177
|
+
const { size } = useContext(FieldsetStyleContext)
|
|
178
|
+
return (
|
|
179
|
+
<Ark.HelperText
|
|
180
|
+
className={cn(fieldsetDescription({ size }), className)}
|
|
181
|
+
{...props({ "data-testid": testId })}
|
|
182
|
+
{...rest}
|
|
183
|
+
/>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export type FieldsetErrorProps = ComponentPropsWithoutRef<typeof Ark.ErrorText> & WithTestId
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The group's error message. Renders only while the root is `invalid`, and is
|
|
191
|
+
* announced politely (`aria-live`) when it appears.
|
|
192
|
+
*/
|
|
193
|
+
const ErrorText = ({ className, testId, ...rest }: FieldsetErrorProps) => {
|
|
194
|
+
const { size } = useContext(FieldsetStyleContext)
|
|
195
|
+
return (
|
|
196
|
+
<Ark.ErrorText
|
|
197
|
+
className={cn(fieldsetError({ size }), className)}
|
|
198
|
+
{...props({ "data-testid": testId })}
|
|
199
|
+
{...rest}
|
|
200
|
+
/>
|
|
201
|
+
)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
type FieldsetClassNames = {
|
|
205
|
+
legend?: string
|
|
206
|
+
description?: string
|
|
207
|
+
error?: string
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export type FieldsetProps = FieldsetRootProps & {
|
|
211
|
+
/** The group's name, cut into the border (`unstyled`: a heading above the controls). */
|
|
212
|
+
legend?: ReactNode
|
|
213
|
+
/** Helper text for the whole group, under the legend. */
|
|
214
|
+
description?: ReactNode
|
|
215
|
+
/** An error for the whole group, under the controls. Its presence sets `invalid`. */
|
|
216
|
+
error?: ReactNode
|
|
217
|
+
/** A class per part, on top of the kit's; `className` styles the `<fieldset>`. */
|
|
218
|
+
classNames?: FieldsetClassNames
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The ready-made **`Fieldset`**: a legend, a description, the controls and an
|
|
223
|
+
* error, each skipped when not given. `testId` lands on the `<fieldset>`, and
|
|
224
|
+
* its parts take it suffixed (`-legend`, `-description`, `-error`). For a
|
|
225
|
+
* bespoke layout, compose `Fieldset.Root`, `.Legend`, `.Description` and `.Error`.
|
|
226
|
+
*/
|
|
227
|
+
function FieldsetComponent({
|
|
228
|
+
legend,
|
|
229
|
+
description,
|
|
230
|
+
error,
|
|
231
|
+
invalid,
|
|
232
|
+
classNames,
|
|
233
|
+
testId,
|
|
234
|
+
children,
|
|
235
|
+
...rest
|
|
236
|
+
}: FieldsetProps) {
|
|
237
|
+
return (
|
|
238
|
+
<Root invalid={invalid ?? error != null} testId={testId} {...rest}>
|
|
239
|
+
{legend != null && (
|
|
240
|
+
<Legend className={classNames?.legend} testId={testId && `${testId}-legend`}>
|
|
241
|
+
{legend}
|
|
242
|
+
</Legend>
|
|
243
|
+
)}
|
|
244
|
+
{description != null && (
|
|
245
|
+
<Description className={classNames?.description} testId={testId && `${testId}-description`}>
|
|
246
|
+
{description}
|
|
247
|
+
</Description>
|
|
248
|
+
)}
|
|
249
|
+
{children}
|
|
250
|
+
{error != null && (
|
|
251
|
+
<ErrorText className={classNames?.error} testId={testId && `${testId}-error`}>
|
|
252
|
+
{error}
|
|
253
|
+
</ErrorText>
|
|
254
|
+
)}
|
|
255
|
+
</Root>
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* `Fieldset` — the ready-made group, with its parts attached for bespoke
|
|
261
|
+
* composition (`Fieldset.Root`, `.Legend`, `.Description`, `.Error`).
|
|
262
|
+
*/
|
|
263
|
+
export const Fieldset = Object.assign(FieldsetComponent, {
|
|
264
|
+
Root,
|
|
265
|
+
Legend,
|
|
266
|
+
Description,
|
|
267
|
+
Error: ErrorText,
|
|
268
|
+
})
|
|
@@ -131,8 +131,9 @@ describe("FilePreview: the kind → renderer mapping", () => {
|
|
|
131
131
|
const { container } = render(<FilePreview file={file(content, name, type)} />)
|
|
132
132
|
expect(view(container)).toBe("text")
|
|
133
133
|
const region = await screen.findByRole("region", { name: `Preview of ${name}` })
|
|
134
|
+
// The scroll area's viewport: focusable while it overflows, ringed by its own overlay.
|
|
134
135
|
expect(region.tabIndex).toBe(0)
|
|
135
|
-
expect(region.
|
|
136
|
+
expect(region.dataset["scope"]).toBe("scroll-area")
|
|
136
137
|
expect(region.querySelector("pre")?.textContent).toBe(content)
|
|
137
138
|
})
|
|
138
139
|
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
type DownloadLoader,
|
|
40
40
|
} from "../download-button/download-button"
|
|
41
41
|
import { Image } from "../image/image"
|
|
42
|
+
import { ScrollArea } from "../scroll-area/scroll-area"
|
|
42
43
|
import { Spinner } from "../spinner/spinner"
|
|
43
44
|
|
|
44
45
|
/**
|
|
@@ -799,8 +800,8 @@ const useText = (blob: Blob | undefined, limit: number) => {
|
|
|
799
800
|
return read?.blob === blob ? read : undefined
|
|
800
801
|
}
|
|
801
802
|
|
|
802
|
-
/** Text through a text node, never markup: a `<pre>` in a region that scrolls
|
|
803
|
-
* keyboard focus. */
|
|
803
|
+
/** Text through a text node, never markup: a `<pre>` in a `ScrollArea` region that scrolls
|
|
804
|
+
* on both axes and takes keyboard focus. */
|
|
804
805
|
const Text = () => {
|
|
805
806
|
const { name, value, size, limit, locale, t } = useShared()
|
|
806
807
|
const blob = value instanceof Blob ? value : undefined
|
|
@@ -822,20 +823,13 @@ const Text = () => {
|
|
|
822
823
|
{t.truncated(formatFileSize(limit, locale), formatFileSize(total, locale))}
|
|
823
824
|
</p>
|
|
824
825
|
)}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
tabIndex={0}
|
|
829
|
-
aria-label={t.label(name)}
|
|
830
|
-
className={cn(
|
|
831
|
-
"min-h-0 flex-1 overflow-auto bg-black/3 dark:bg-white/4",
|
|
832
|
-
focusStyles({ inset: true, offset: false }),
|
|
833
|
-
)}
|
|
834
|
-
>
|
|
826
|
+
{/* Named, the scroll area's viewport is a region; it joins the tab order whenever it
|
|
827
|
+
overflows, so arrow keys scroll it, and draws its own inset focus ring. */}
|
|
828
|
+
<ScrollArea aria-label={t.label(name)} className="min-h-0 flex-1 bg-black/3 dark:bg-white/4">
|
|
835
829
|
<pre dir="auto" className="w-max min-w-full p-3 font-mono text-xs leading-relaxed">
|
|
836
830
|
{read.text}
|
|
837
831
|
</pre>
|
|
838
|
-
</
|
|
832
|
+
</ScrollArea>
|
|
839
833
|
</>
|
|
840
834
|
)
|
|
841
835
|
}
|
|
@@ -17,7 +17,13 @@ import type { WithTestId } from "../../lib/test-id"
|
|
|
17
17
|
import { TYPOGRAPHY_SHADE_CLASSES } from "../../lib/typography-size"
|
|
18
18
|
import type { FileQueue } from "../../lib/use-file-queue"
|
|
19
19
|
import { Button } from "../button/button"
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
Field,
|
|
22
|
+
type FieldProps,
|
|
23
|
+
fieldA11yProps,
|
|
24
|
+
useInheritedDisabled,
|
|
25
|
+
useInheritedInvalid,
|
|
26
|
+
} from "../field/field"
|
|
21
27
|
import {
|
|
22
28
|
FileItem,
|
|
23
29
|
type FileItemIcons,
|
|
@@ -332,6 +338,9 @@ export const FileUpload = ({
|
|
|
332
338
|
icons,
|
|
333
339
|
}: FileUploadProps) => {
|
|
334
340
|
const locale = useLocale()
|
|
341
|
+
// zag's file upload reads an enclosing `Field` but not a `<fieldset>`: without
|
|
342
|
+
// this, a disabled group's dropzone still takes a drop.
|
|
343
|
+
const isDisabled = useInheritedDisabled(disabled)
|
|
335
344
|
const {
|
|
336
345
|
browseFiles,
|
|
337
346
|
hint: dropHint,
|
|
@@ -363,7 +372,7 @@ export const FileUpload = ({
|
|
|
363
372
|
)
|
|
364
373
|
// Red state is driven independently of the `Field` error slot so a form
|
|
365
374
|
// library can flip it from `fieldState.invalid` (see FormControlProps).
|
|
366
|
-
const isInvalid = invalid || shownError != null
|
|
375
|
+
const isInvalid = useInheritedInvalid(invalid || shownError != null)
|
|
367
376
|
|
|
368
377
|
return (
|
|
369
378
|
<Ark.Root
|
|
@@ -379,7 +388,7 @@ export const FileUpload = ({
|
|
|
379
388
|
locale={locale}
|
|
380
389
|
capture={capture}
|
|
381
390
|
directory={directory}
|
|
382
|
-
disabled={
|
|
391
|
+
disabled={isDisabled}
|
|
383
392
|
required={required}
|
|
384
393
|
invalid={isInvalid}
|
|
385
394
|
name={name}
|
|
@@ -410,7 +419,7 @@ export const FileUpload = ({
|
|
|
410
419
|
description={description}
|
|
411
420
|
error={shownError}
|
|
412
421
|
required={required}
|
|
413
|
-
disabled={
|
|
422
|
+
disabled={isDisabled}
|
|
414
423
|
size={size}
|
|
415
424
|
className={classNames?.field}
|
|
416
425
|
>
|
|
@@ -446,7 +455,7 @@ export const FileUpload = ({
|
|
|
446
455
|
color={isInvalid ? "red" : undefined}
|
|
447
456
|
size={size}
|
|
448
457
|
type="button"
|
|
449
|
-
disabled={
|
|
458
|
+
disabled={isDisabled}
|
|
450
459
|
>
|
|
451
460
|
{browseFiles}
|
|
452
461
|
</Button>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { HoverCard as Ark } from "@ark-ui/react/hover-card"
|
|
3
|
+
import { HoverCard as Ark, useHoverCardContext } from "@ark-ui/react/hover-card"
|
|
4
4
|
import { useLocaleContext } from "@ark-ui/react/locale"
|
|
5
5
|
import { Portal } from "@ark-ui/react/portal"
|
|
6
6
|
import { createContext, type ReactNode, useContext } from "react"
|
|
7
7
|
import { cn } from "../../lib/cn"
|
|
8
8
|
import { useOverlayContainer } from "../../lib/overlay-container"
|
|
9
|
+
import { useTourRaised } from "../../lib/overlay-layer"
|
|
9
10
|
import {
|
|
10
11
|
type LogicalPosition,
|
|
11
12
|
type Placement,
|
|
@@ -157,11 +158,14 @@ const Content = ({
|
|
|
157
158
|
}: HoverCardContentProps) => {
|
|
158
159
|
const { width, withinPortal, container, sliding } = useContext(HoverCardContext)
|
|
159
160
|
const portalContainer = useOverlayContainer(container)
|
|
161
|
+
// Lifted above a running tour; see `useTourRaised`.
|
|
162
|
+
const raised = useTourRaised(useHoverCardContext().open)
|
|
160
163
|
const panel = (
|
|
161
164
|
<Ark.Positioner style={sliding ? slideStyle : undefined}>
|
|
162
165
|
<Ark.Content
|
|
163
166
|
tabIndex={-1}
|
|
164
167
|
className={cn(popoverChrome, width === "target" ? "w-full" : "w-max", className)}
|
|
168
|
+
data-raised={raised || undefined}
|
|
165
169
|
{...props({ "data-testid": testId })}
|
|
166
170
|
{...rest}
|
|
167
171
|
>
|
|
@@ -9,7 +9,7 @@ import { cn } from "../../lib/cn"
|
|
|
9
9
|
import { props } from "../../lib/props"
|
|
10
10
|
import type { WithTestId } from "../../lib/test-id"
|
|
11
11
|
import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
|
|
12
|
-
import { fieldA11yProps } from "../field/field"
|
|
12
|
+
import { fieldA11yProps, useInheritedDisabled, useInheritedInvalid } from "../field/field"
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Input / InputBase — the styled input *shell* the whole form family renders
|
|
@@ -234,6 +234,9 @@ export const InputBase = ({
|
|
|
234
234
|
// inline padding when an adornment sits there (`data-with-*-slot:`).
|
|
235
235
|
"data-with-start-slot": startSlot != null,
|
|
236
236
|
"data-with-end-slot": endSlot != null,
|
|
237
|
+
// The visible box of the control. A tour step that targets the inner
|
|
238
|
+
// input spotlights this instead (`spotlightTarget` in `tour/runtime.ts`).
|
|
239
|
+
"data-frame": true,
|
|
237
240
|
// Only meaningful when `InputBase` is used bare (no `Input`-style inner
|
|
238
241
|
// control routing its own `testId`) — a `testId` given to a control that
|
|
239
242
|
// wraps `InputBase` itself (Input, NumberInput, Select, …) always lands
|
|
@@ -289,6 +292,10 @@ export const Input = ({
|
|
|
289
292
|
// label, description, and error wire up — exactly how Ark's own `Field.Input`
|
|
290
293
|
// behaves. `useFieldContext` is null outside a Field, so this is a no-op then.
|
|
291
294
|
const field = useFieldContext()
|
|
295
|
+
// A `Fieldset` reaches the control even with no `Field` (and so no label)
|
|
296
|
+
// between them: the `<fieldset>` disables the element, this dims the shell.
|
|
297
|
+
const isDisabled = useInheritedDisabled(disabled)
|
|
298
|
+
const isInvalid = useInheritedInvalid(invalid)
|
|
292
299
|
const fieldInputProps = field?.getInputProps()
|
|
293
300
|
|
|
294
301
|
return (
|
|
@@ -305,8 +312,8 @@ export const Input = ({
|
|
|
305
312
|
endSlot: classNames?.endSlot,
|
|
306
313
|
}}
|
|
307
314
|
{...props({
|
|
308
|
-
disabled:
|
|
309
|
-
invalid:
|
|
315
|
+
disabled: isDisabled,
|
|
316
|
+
invalid: isInvalid,
|
|
310
317
|
readOnly: readOnly || field?.readOnly,
|
|
311
318
|
})}
|
|
312
319
|
>
|
|
@@ -314,8 +321,8 @@ export const Input = ({
|
|
|
314
321
|
{...fieldInputProps}
|
|
315
322
|
{...fieldA11yProps(field)}
|
|
316
323
|
{...props({
|
|
317
|
-
disabled:
|
|
318
|
-
"aria-invalid":
|
|
324
|
+
disabled: isDisabled,
|
|
325
|
+
"aria-invalid": isInvalid,
|
|
319
326
|
readOnly: readOnly || field?.readOnly,
|
|
320
327
|
"data-testid": testId,
|
|
321
328
|
})}
|
|
@@ -9,6 +9,19 @@ describe("Kbd", () => {
|
|
|
9
9
|
expect(screen.getByText("⌘K").tagName).toBe("KBD")
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
+
// Under an RTL ancestor, `⌘K` read `K⌘`: the leading neutral ⌘ took the
|
|
13
|
+
// page's direction. `dir="ltr"` sets the key's direction and isolates it.
|
|
14
|
+
it("reads left to right inside an RTL page, unless the caller overrides dir", () => {
|
|
15
|
+
render(
|
|
16
|
+
<div dir="rtl">
|
|
17
|
+
<Kbd>⌘K</Kbd>
|
|
18
|
+
<Kbd dir="auto">Esc</Kbd>
|
|
19
|
+
</div>,
|
|
20
|
+
)
|
|
21
|
+
expect(screen.getByText("⌘K").getAttribute("dir")).toBe("ltr")
|
|
22
|
+
expect(screen.getByText("Esc").getAttribute("dir")).toBe("auto")
|
|
23
|
+
})
|
|
24
|
+
|
|
12
25
|
it("keeps the kit's focus ring when composed onto a real control", () => {
|
|
13
26
|
render(
|
|
14
27
|
<Kbd asChild>
|
|
@@ -28,6 +28,10 @@ import { hotkeyCaps, type KbdTranslations, useApplePlatform } from "../../lib/us
|
|
|
28
28
|
* reads as a physical key regardless of `color` (pairing `default` with a color
|
|
29
29
|
* is a no-op, mirroring Button/Badge).
|
|
30
30
|
*
|
|
31
|
+
* A key reads left to right as typed on an RTL page too (`⌘K`, not `K⌘`):
|
|
32
|
+
* the cap carries `dir="ltr"`, which sets its direction and isolates it from
|
|
33
|
+
* the surrounding bidi flow (see `Code`). A caller can override it with `dir`.
|
|
34
|
+
*
|
|
31
35
|
* Sizing keeps single-character keys square via a per-size `min-w` equal to the
|
|
32
36
|
* height, while wider labels (`Enter`, `Esc`, `⌘N`) grow horizontally. Padding
|
|
33
37
|
* is symmetric, so a key reads the same in RTL.
|
|
@@ -229,6 +233,8 @@ export const Kbd = (allProps: KbdProps) => {
|
|
|
229
233
|
} = allProps
|
|
230
234
|
return (
|
|
231
235
|
<ark.kbd
|
|
236
|
+
// Like a combination, a single key reads left to right in either direction.
|
|
237
|
+
dir="ltr"
|
|
232
238
|
data-color={color}
|
|
233
239
|
{...props({ "data-testid": testId })}
|
|
234
240
|
{...rest}
|
|
@@ -22,7 +22,7 @@ import type { Color } from "../../lib/colors"
|
|
|
22
22
|
import { warnRenamedProp } from "../../lib/dev-warn"
|
|
23
23
|
import { type IconMap, mergeIcons } from "../../lib/icons"
|
|
24
24
|
import { useOverlayContainer } from "../../lib/overlay-container"
|
|
25
|
-
import { useNestedLayer } from "../../lib/overlay-layer"
|
|
25
|
+
import { useNestedLayer, useTourRaised } from "../../lib/overlay-layer"
|
|
26
26
|
import { type LogicalPosition, resolveLogicalPlacement } from "../../lib/placement"
|
|
27
27
|
import { props } from "../../lib/props"
|
|
28
28
|
import type { WithTestId } from "../../lib/test-id"
|
|
@@ -208,11 +208,15 @@ const Content = ({ className, children, testId, ...rest }: MenuContentProps) =>
|
|
|
208
208
|
const { withinPortal, container } = useContext(MenuContext)
|
|
209
209
|
const portalContainer = useOverlayContainer(container)
|
|
210
210
|
// Holds an enclosing Modal/Drawer/Popover open while the menu is; see `lib/overlay-layer.tsx`.
|
|
211
|
-
|
|
211
|
+
const open = useMenuContext().open
|
|
212
|
+
useNestedLayer(open)
|
|
213
|
+
// Lifted above a running tour; see `useTourRaised`.
|
|
214
|
+
const raised = useTourRaised(open)
|
|
212
215
|
const panel = (
|
|
213
216
|
<ArkMenu.Positioner>
|
|
214
217
|
<ArkMenu.Content
|
|
215
218
|
className={cn(menuContent, className)}
|
|
219
|
+
data-raised={raised || undefined}
|
|
216
220
|
{...props({ "data-testid": testId })}
|
|
217
221
|
{...rest}
|
|
218
222
|
>
|
|
@@ -99,3 +99,44 @@ describe("Modal accessible-name warning", () => {
|
|
|
99
99
|
await waitFor(() => expect(nameWarnings()).toHaveLength(1))
|
|
100
100
|
})
|
|
101
101
|
})
|
|
102
|
+
|
|
103
|
+
describe("Modal body scrolling", () => {
|
|
104
|
+
it("scrolls the body in a ScrollArea by default, with className on the content", async () => {
|
|
105
|
+
render(
|
|
106
|
+
<Modal defaultOpen title="Session" classNames={{ body: "gap-4" }}>
|
|
107
|
+
<p>Body text</p>
|
|
108
|
+
</Modal>,
|
|
109
|
+
)
|
|
110
|
+
await screen.findByRole("dialog")
|
|
111
|
+
const content = screen.getByText("Body text").parentElement as HTMLElement
|
|
112
|
+
expect(content.dataset["scope"]).toBe("scroll-area")
|
|
113
|
+
expect(content.dataset["part"]).toBe("content")
|
|
114
|
+
expect(content.className).toContain("gap-4")
|
|
115
|
+
expect(content.closest("[data-part=root]")?.className).toContain("flex-1")
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
it("renders a plain, non-scrolling column with scrollable={false}", async () => {
|
|
119
|
+
render(
|
|
120
|
+
<Modal defaultOpen title="Session" scrollable={false} classNames={{ body: "gap-4" }}>
|
|
121
|
+
<p>Body text</p>
|
|
122
|
+
</Modal>,
|
|
123
|
+
)
|
|
124
|
+
await screen.findByRole("dialog")
|
|
125
|
+
const body = screen.getByText("Body text").parentElement as HTMLElement
|
|
126
|
+
expect(body.closest("[data-scope=scroll-area]")).toBeNull()
|
|
127
|
+
expect(body.className).toContain("flex-1")
|
|
128
|
+
expect(body.className).toContain("min-h-0")
|
|
129
|
+
expect(body.className).toContain("gap-4")
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it("takes scrollable on the composed Modal.Body part too", () => {
|
|
133
|
+
const { rerender } = render(<Modal.Body testId="body">Text</Modal.Body>)
|
|
134
|
+
expect(screen.getByTestId("body").dataset["scope"]).toBe("scroll-area")
|
|
135
|
+
rerender(
|
|
136
|
+
<Modal.Body testId="body" scrollable={false}>
|
|
137
|
+
Text
|
|
138
|
+
</Modal.Body>,
|
|
139
|
+
)
|
|
140
|
+
expect(screen.getByTestId("body").dataset["scope"]).toBeUndefined()
|
|
141
|
+
})
|
|
142
|
+
})
|
|
@@ -15,6 +15,7 @@ import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
|
|
|
15
15
|
import {
|
|
16
16
|
createDialogParts,
|
|
17
17
|
DIALOG_PADDING,
|
|
18
|
+
type DialogBodyProps,
|
|
18
19
|
type DialogCloseTriggerProps,
|
|
19
20
|
type DialogIconSlot,
|
|
20
21
|
type DialogIcons,
|
|
@@ -60,15 +61,17 @@ const modalPositioner = cva(
|
|
|
60
61
|
},
|
|
61
62
|
)
|
|
62
63
|
|
|
64
|
+
/** The dialog surface: opaque brand fill, hairline border, shadow and the
|
|
65
|
+
* open/close animation. Shared with the Tour's dialog steps. */
|
|
66
|
+
export const modalSurface = cn(
|
|
67
|
+
"bg-brand-50 text-brand-950 border border-brand-900/20 shadow-2xl",
|
|
68
|
+
"dark:bg-brand-950 dark:text-white dark:border-white/15",
|
|
69
|
+
"focus:outline-none",
|
|
70
|
+
"data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out",
|
|
71
|
+
)
|
|
72
|
+
|
|
63
73
|
const modalContent = cva(
|
|
64
|
-
[
|
|
65
|
-
"relative flex w-full flex-col",
|
|
66
|
-
"max-h-[calc(100dvh-2rem)]",
|
|
67
|
-
"bg-brand-50 text-brand-950 border border-brand-900/20 shadow-2xl",
|
|
68
|
-
"dark:bg-brand-950 dark:text-white dark:border-white/15",
|
|
69
|
-
"focus:outline-none",
|
|
70
|
-
"data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out",
|
|
71
|
-
],
|
|
74
|
+
["relative flex w-full flex-col", "max-h-[calc(100dvh-2rem)]", modalSurface],
|
|
72
75
|
{
|
|
73
76
|
variants: {
|
|
74
77
|
size: {
|
|
@@ -200,7 +203,7 @@ const ModalDescription = ({ className, testId, ...rest }: ModalDescriptionProps)
|
|
|
200
203
|
|
|
201
204
|
export type ModalCloseTriggerProps = DialogCloseTriggerProps
|
|
202
205
|
export type ModalHeaderProps = DialogSectionProps
|
|
203
|
-
export type ModalBodyProps =
|
|
206
|
+
export type ModalBodyProps = DialogBodyProps
|
|
204
207
|
export type ModalFooterProps = DialogSectionProps
|
|
205
208
|
|
|
206
209
|
const {
|
|
@@ -257,6 +260,9 @@ export type ModalProps = Omit<
|
|
|
257
260
|
position?: ModalPosition
|
|
258
261
|
/** Render the default close button in the header. @default true */
|
|
259
262
|
withCloseButton?: boolean
|
|
263
|
+
/** Scroll the body (a `ScrollArea`). `false` for content that owns its own scroller; see
|
|
264
|
+
* `Modal.Body`'s `scrollable`. @default true */
|
|
265
|
+
scrollable?: boolean
|
|
260
266
|
/**
|
|
261
267
|
* Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals
|
|
262
268
|
* manager) draws a single shared backdrop for the whole overlay stack.
|
|
@@ -301,6 +307,7 @@ const ModalComponent = ({
|
|
|
301
307
|
radius,
|
|
302
308
|
position,
|
|
303
309
|
withCloseButton = true,
|
|
310
|
+
scrollable = true,
|
|
304
311
|
withBackdrop = true,
|
|
305
312
|
padding = "md",
|
|
306
313
|
closeOnEscape,
|
|
@@ -379,6 +386,7 @@ const ModalComponent = ({
|
|
|
379
386
|
</ModalHeader>
|
|
380
387
|
)}
|
|
381
388
|
<ModalBody
|
|
389
|
+
scrollable={scrollable}
|
|
382
390
|
className={cn(
|
|
383
391
|
!hasHeader && "pt-(--modal-px,1.25rem)",
|
|
384
392
|
"pb-(--modal-px,1.25rem)",
|