@42-central/ui-react 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-X6DESK37.js → chunk-2RRTT4AF.js} +17 -5
- package/dist/chunk-2RRTT4AF.js.map +1 -0
- package/dist/{chunk-TUP7WXQE.js → chunk-322I2RSV.js} +9 -6
- package/dist/chunk-322I2RSV.js.map +1 -0
- package/dist/{chunk-ISX3AM32.js → chunk-37SRSNLJ.js} +4 -4
- package/dist/{chunk-ISX3AM32.js.map → chunk-37SRSNLJ.js.map} +1 -1
- package/dist/{chunk-L5GH7LLD.js → chunk-3MFWUG5O.js} +4 -4
- package/dist/{chunk-L5GH7LLD.js.map → chunk-3MFWUG5O.js.map} +1 -1
- package/dist/{chunk-FQJNQW3G.js → chunk-3XQEOJCE.js} +8 -5
- package/dist/chunk-3XQEOJCE.js.map +1 -0
- package/dist/{chunk-JKFPRQB2.js → chunk-4LSZ5JWF.js} +3 -3
- package/dist/{chunk-JKFPRQB2.js.map → chunk-4LSZ5JWF.js.map} +1 -1
- package/dist/{chunk-V2QZG4IT.js → chunk-5HWFYYHW.js} +27 -9
- package/dist/chunk-5HWFYYHW.js.map +1 -0
- package/dist/{chunk-GEZYGBXY.js → chunk-6MVFCS46.js} +99 -42
- package/dist/chunk-6MVFCS46.js.map +1 -0
- package/dist/{chunk-NNPSBC7O.js → chunk-6WZSUS3U.js} +10 -9
- package/dist/chunk-6WZSUS3U.js.map +1 -0
- package/dist/chunk-6YRGP6PS.js +138 -0
- package/dist/chunk-6YRGP6PS.js.map +1 -0
- package/dist/{chunk-B5YHYI7E.js → chunk-ALANKV5Y.js} +23 -6
- package/dist/chunk-ALANKV5Y.js.map +1 -0
- package/dist/{chunk-IA6DCC3N.js → chunk-AUQPNDE5.js} +23 -13
- package/dist/chunk-AUQPNDE5.js.map +1 -0
- package/dist/{chunk-AKXALCUN.js → chunk-D7SW2E24.js} +4 -4
- package/dist/chunk-D7SW2E24.js.map +1 -0
- package/dist/{chunk-OXR7BXZA.js → chunk-DQIYYDFD.js} +4 -3
- package/dist/chunk-DQIYYDFD.js.map +1 -0
- package/dist/{chunk-HMNXNKDA.js → chunk-FCBYUN6F.js} +4 -4
- package/dist/{chunk-HMNXNKDA.js.map → chunk-FCBYUN6F.js.map} +1 -1
- package/dist/{chunk-2W7H43WL.js → chunk-FED6SJWM.js} +23 -14
- package/dist/chunk-FED6SJWM.js.map +1 -0
- package/dist/{chunk-7E7JNWOC.js → chunk-FEPIHXVI.js} +6 -5
- package/dist/chunk-FEPIHXVI.js.map +1 -0
- package/dist/{chunk-Y57NW6G7.js → chunk-G3YOSG3U.js} +4 -4
- package/dist/{chunk-Y57NW6G7.js.map → chunk-G3YOSG3U.js.map} +1 -1
- package/dist/chunk-GZN5CXMR.js +100 -0
- package/dist/chunk-GZN5CXMR.js.map +1 -0
- package/dist/{chunk-HCHGERDB.js → chunk-HCSZPBWV.js} +17 -115
- package/dist/chunk-HCSZPBWV.js.map +1 -0
- package/dist/{chunk-I4B3N3UX.js → chunk-HTVICHT4.js} +12 -7
- package/dist/chunk-HTVICHT4.js.map +1 -0
- package/dist/chunk-I7TC2C3I.js +163 -0
- package/dist/chunk-I7TC2C3I.js.map +1 -0
- package/dist/{chunk-7FPSQBWB.js → chunk-IBXYLO2J.js} +14 -13
- package/dist/chunk-IBXYLO2J.js.map +1 -0
- package/dist/{chunk-7KFUFAVP.js → chunk-IRYG6B5A.js} +9 -8
- package/dist/chunk-IRYG6B5A.js.map +1 -0
- package/dist/{chunk-2RQLPN4U.js → chunk-JCNEW4WJ.js} +8 -8
- package/dist/{chunk-2RQLPN4U.js.map → chunk-JCNEW4WJ.js.map} +1 -1
- package/dist/{chunk-SP6LCCTZ.js → chunk-KZDMVOL6.js} +35 -8
- package/dist/chunk-KZDMVOL6.js.map +1 -0
- package/dist/chunk-LR5U6TZZ.js +169 -0
- package/dist/chunk-LR5U6TZZ.js.map +1 -0
- package/dist/{chunk-MQHD3EJE.js → chunk-LZHZJWVM.js} +6 -4
- package/dist/chunk-LZHZJWVM.js.map +1 -0
- package/dist/{chunk-5EOMSWNO.js → chunk-MAM2X3MW.js} +5 -5
- package/dist/{chunk-5EOMSWNO.js.map → chunk-MAM2X3MW.js.map} +1 -1
- package/dist/{chunk-FSPS7TVD.js → chunk-MCMS4NMO.js} +5 -5
- package/dist/{chunk-FSPS7TVD.js.map → chunk-MCMS4NMO.js.map} +1 -1
- package/dist/{chunk-ZB5VMGKB.js → chunk-MV5DIE2T.js} +15 -4
- package/dist/chunk-MV5DIE2T.js.map +1 -0
- package/dist/chunk-NDI4HLQE.js +41 -0
- package/dist/chunk-NDI4HLQE.js.map +1 -0
- package/dist/{chunk-B4GNSSHU.js → chunk-NLJEQZQQ.js} +3 -3
- package/dist/{chunk-B4GNSSHU.js.map → chunk-NLJEQZQQ.js.map} +1 -1
- package/dist/{chunk-SBZJGFZ6.js → chunk-QHT4DCXE.js} +8 -7
- package/dist/chunk-QHT4DCXE.js.map +1 -0
- package/dist/{chunk-I4IJOLNA.js → chunk-RMUBCTEF.js} +5 -5
- package/dist/{chunk-I4IJOLNA.js.map → chunk-RMUBCTEF.js.map} +1 -1
- package/dist/{chunk-G3AD3NJG.js → chunk-RNTDM3RP.js} +9 -5
- package/dist/chunk-RNTDM3RP.js.map +1 -0
- package/dist/chunk-RPFN6ETQ.js +509 -0
- package/dist/chunk-RPFN6ETQ.js.map +1 -0
- package/dist/{chunk-HWBFRDX7.js → chunk-SI7C3W5M.js} +28 -9
- package/dist/chunk-SI7C3W5M.js.map +1 -0
- package/dist/chunk-TPOV3OCC.js +234 -0
- package/dist/chunk-TPOV3OCC.js.map +1 -0
- package/dist/{chunk-IANYMDKH.js → chunk-UBQ54W46.js} +4 -4
- package/dist/chunk-UBQ54W46.js.map +1 -0
- package/dist/{chunk-QVOBLRCM.js → chunk-UIKQ4X6W.js} +3 -3
- package/dist/{chunk-QVOBLRCM.js.map → chunk-UIKQ4X6W.js.map} +1 -1
- package/dist/chunk-UOWQH53N.js +70 -0
- package/dist/chunk-UOWQH53N.js.map +1 -0
- package/dist/{chunk-QRNQQIQM.js → chunk-WJUY6YWF.js} +52 -20
- package/dist/chunk-WJUY6YWF.js.map +1 -0
- package/dist/{chunk-3KARNPW4.js → chunk-WKIUMLRT.js} +3 -3
- package/dist/{chunk-3KARNPW4.js.map → chunk-WKIUMLRT.js.map} +1 -1
- package/dist/chunk-X6RB74JN.js +37 -0
- package/dist/chunk-X6RB74JN.js.map +1 -0
- package/dist/chunk-XQ6L2CM5.js +83 -0
- package/dist/chunk-XQ6L2CM5.js.map +1 -0
- package/dist/{chunk-RKCUXOU2.js → chunk-YUVKROMA.js} +44 -7
- package/dist/chunk-YUVKROMA.js.map +1 -0
- package/dist/components/action-icon/action-icon.d.ts +9 -2
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +5 -1
- package/dist/components/alert/index.js +4 -4
- package/dist/components/anchor/anchor.d.ts +45 -0
- package/dist/components/anchor/anchor.d.ts.map +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.d.ts.map +1 -0
- package/dist/components/anchor/index.js +11 -0
- package/dist/components/anchor/index.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +10 -6
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +23 -24
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +15 -9
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/button/button.d.ts +15 -2
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +5 -1
- package/dist/components/button-multi-select/index.js +6 -4
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/button-select-control.d.ts.map +1 -1
- package/dist/components/button-select/button-select.d.ts +2 -2
- package/dist/components/button-select/button-select.d.ts.map +1 -1
- package/dist/components/button-select/index.js +6 -4
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/aliases.d.ts +16 -0
- package/dist/components/calendar/aliases.d.ts.map +1 -0
- package/dist/components/calendar/calendar-body.d.ts +11 -1
- package/dist/components/calendar/calendar-body.d.ts.map +1 -1
- package/dist/components/calendar/calendar.d.ts +8 -4
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/calendar/index.d.ts.map +1 -1
- package/dist/components/calendar/index.js +15 -5
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
- package/dist/components/calendar-heatmap/index.js +85 -73
- package/dist/components/calendar-heatmap/index.js.map +1 -1
- package/dist/components/camera/index.js +16 -14
- package/dist/components/carousel/index.js +3 -3
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/choice-card-group/index.js +2 -2
- package/dist/components/choice-card-group/index.js.map +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +22 -11
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.d.ts +1 -1
- package/dist/components/circular-progress/index.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js +68 -49
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/index.js +7 -3
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code/code.d.ts +10 -0
- package/dist/components/code/code.d.ts.map +1 -1
- package/dist/components/code/index.js +1 -0
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +10 -6
- package/dist/components/code-block/index.js +10 -7
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +5 -3
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +12 -7
- package/dist/components/combobox-list/combobox-list.d.ts +1 -1
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +14 -9
- package/dist/components/compare/index.js +1 -1
- package/dist/components/data-list/data-list.d.ts +96 -0
- package/dist/components/data-list/data-list.d.ts.map +1 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.d.ts.map +1 -0
- package/dist/components/data-list/index.js +147 -0
- package/dist/components/data-list/index.js.map +1 -0
- package/dist/components/data-table/data-table-group.d.ts.map +1 -1
- package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
- package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts +5 -2
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.js +163 -168
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/aliases.d.ts +16 -0
- package/dist/components/date-picker/aliases.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +22 -8
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +34 -28
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/download-button/index.js +6 -2
- package/dist/components/drawer/drawer.d.ts +7 -4
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.js +11 -6
- package/dist/components/empty-state/empty-state.d.ts +57 -0
- package/dist/components/empty-state/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/empty-state/index.d.ts.map +1 -0
- package/dist/components/empty-state/index.js +8 -0
- package/dist/components/empty-state/index.js.map +1 -0
- package/dist/components/field/field.d.ts +20 -0
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/fieldset/fieldset.d.ts +103 -0
- package/dist/components/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/fieldset/index.d.ts.map +1 -0
- package/dist/components/fieldset/index.js +150 -0
- package/dist/components/fieldset/index.js.map +1 -0
- package/dist/components/file-item/index.js +10 -7
- package/dist/components/file-preview/file-preview.d.ts.map +1 -1
- package/dist/components/file-preview/index.js +10 -18
- package/dist/components/file-preview/index.js.map +1 -1
- package/dist/components/file-trigger/index.js +6 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +18 -14
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/gallery/index.js +3 -3
- package/dist/components/geodesic/a11y.d.ts +3 -3
- package/dist/components/geodesic/a11y.d.ts.map +1 -1
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/index.js +10 -3
- package/dist/components/hover-card/index.js.map +1 -1
- package/dist/components/image/index.js +3 -3
- package/dist/components/image-cropper/index.js +9 -6
- package/dist/components/input/index.js +2 -2
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/kbd/index.js +3 -3
- package/dist/components/kbd/kbd.d.ts +4 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/lightbox/index.js +13 -11
- package/dist/components/lightbox/index.js.map +1 -1
- package/dist/components/menu/index.js +9 -5
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/modal/index.js +11 -6
- package/dist/components/modal/modal.d.ts +10 -4
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +13 -9
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +13 -10
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +4 -4
- package/dist/components/nav-link/tanstack.js +4 -4
- package/dist/components/notification/index.js +6 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/number-input/index.js +11 -7
- package/dist/components/number-input/number-input.d.ts +1 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/dialog-parts.d.ts +10 -1
- package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
- package/dist/components/overlays/index.js +13 -8
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +362 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +147 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/password-input/index.js +6 -5
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +1 -1
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/phone-input/index.js +14 -11
- package/dist/components/phone-input/index.js.map +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/photo-capture/index.js +19 -17
- package/dist/components/photo-capture/index.js.map +1 -1
- package/dist/components/pills-input/index.js +4 -4
- package/dist/components/pills-input/pills-input.d.ts +1 -1
- package/dist/components/pills-input/pills-input.d.ts.map +1 -1
- package/dist/components/pin-input/index.js +6 -5
- package/dist/components/pin-input/index.js.map +1 -1
- package/dist/components/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/popover/index.js +7 -2
- package/dist/components/popover/popover.d.ts +41 -16
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.d.ts +1 -1
- package/dist/components/progress/index.d.ts.map +1 -1
- package/dist/components/progress/index.js +4 -1
- package/dist/components/progress/progress.d.ts +22 -14
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/prose/index.d.ts +2 -0
- package/dist/components/prose/index.d.ts.map +1 -0
- package/dist/components/prose/index.js +17 -0
- package/dist/components/prose/index.js.map +1 -0
- package/dist/components/prose/prose.d.ts +49 -0
- package/dist/components/prose/prose.d.ts.map +1 -0
- package/dist/components/prose/styles.css +593 -0
- package/dist/components/radio-group/index.js +9 -3
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/rating/index.js +3 -2
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.js +10 -8
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.d.ts.map +1 -0
- package/dist/components/scroll-area/index.js +10 -0
- package/dist/components/scroll-area/index.js.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +150 -0
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/components/segment-group/index.js +2 -2
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.js +12 -8
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/splitter/index.d.ts.map +1 -0
- package/dist/components/splitter/index.js +373 -0
- package/dist/components/splitter/index.js.map +1 -0
- package/dist/components/splitter/splitter.d.ts +159 -0
- package/dist/components/splitter/splitter.d.ts.map +1 -0
- package/dist/components/spotlight/index.js +23 -22
- package/dist/components/spotlight/index.js.map +1 -1
- package/dist/components/spotlight/spotlight.d.ts.map +1 -1
- package/dist/components/steps/index.d.ts +4 -0
- package/dist/components/steps/index.d.ts.map +1 -0
- package/dist/components/steps/index.js +478 -0
- package/dist/components/steps/index.js.map +1 -0
- package/dist/components/steps/steps-data.d.ts +78 -0
- package/dist/components/steps/steps-data.d.ts.map +1 -0
- package/dist/components/steps/steps.d.ts +183 -0
- package/dist/components/steps/steps.d.ts.map +1 -0
- package/dist/components/switch/index.js +4 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/table-of-contents/index.d.ts +2 -0
- package/dist/components/table-of-contents/index.d.ts.map +1 -0
- package/dist/components/table-of-contents/index.js +471 -0
- package/dist/components/table-of-contents/index.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
- package/dist/components/tags-input/index.js +12 -9
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +1 -1
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +8 -6
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/time-input/index.js +11 -9
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/timeline/index.js +8 -1
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +3 -8
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tour/conditions.d.ts +83 -0
- package/dist/components/tour/conditions.d.ts.map +1 -0
- package/dist/components/tour/create-tours.d.ts +49 -0
- package/dist/components/tour/create-tours.d.ts.map +1 -0
- package/dist/components/tour/index.d.ts +6 -0
- package/dist/components/tour/index.d.ts.map +1 -0
- package/dist/components/tour/index.js +1449 -0
- package/dist/components/tour/index.js.map +1 -0
- package/dist/components/tour/runtime.d.ts +57 -0
- package/dist/components/tour/runtime.d.ts.map +1 -0
- package/dist/components/tour/storage.d.ts +14 -0
- package/dist/components/tour/storage.d.ts.map +1 -0
- package/dist/components/tour/store.d.ts +62 -0
- package/dist/components/tour/store.d.ts.map +1 -0
- package/dist/components/tour/tour.d.ts +77 -0
- package/dist/components/tour/tour.d.ts.map +1 -0
- package/dist/components/tour/types.d.ts +680 -0
- package/dist/components/tour/types.d.ts.map +1 -0
- package/dist/components/tree/index.d.ts +3 -0
- package/dist/components/tree/index.d.ts.map +1 -0
- package/dist/components/tree/index.js +457 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/components/tree/tree-row.d.ts +72 -0
- package/dist/components/tree/tree-row.d.ts.map +1 -0
- package/dist/components/tree/tree.d.ts +193 -0
- package/dist/components/tree/tree.d.ts.map +1 -0
- package/dist/components/tree-multi-select/index.js +31 -54
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +30 -24
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-popover.d.ts +20 -31
- package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +1 -1
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/date-predicates.d.ts +7 -5
- package/dist/lib/date-predicates.d.ts.map +1 -1
- package/dist/lib/date-value.d.ts +20 -0
- package/dist/lib/date-value.d.ts.map +1 -1
- package/dist/lib/floating-arrow.d.ts +53 -0
- package/dist/lib/floating-arrow.d.ts.map +1 -0
- package/dist/lib/focus-return.d.ts +53 -0
- package/dist/lib/focus-return.d.ts.map +1 -0
- package/dist/lib/meter.d.ts +104 -0
- package/dist/lib/meter.d.ts.map +1 -0
- package/dist/lib/overlay-layer.d.ts +26 -8
- package/dist/lib/overlay-layer.d.ts.map +1 -1
- package/dist/lib/pressed.d.ts +92 -0
- package/dist/lib/pressed.d.ts.map +1 -0
- package/dist/lib/tree-data.d.ts +18 -2
- package/dist/lib/tree-data.d.ts.map +1 -1
- package/dist/lib/use-pagination.d.ts +102 -0
- package/dist/lib/use-pagination.d.ts.map +1 -0
- package/dist/lib/use-scroll-spy.d.ts +126 -0
- package/dist/lib/use-scroll-spy.d.ts.map +1 -0
- package/dist/theme.css +39 -3
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +283 -1
- package/src/components/action-icon/action-icon.tsx +34 -4
- package/src/components/anchor/anchor.test.tsx +232 -0
- package/src/components/anchor/anchor.tsx +187 -0
- package/src/components/anchor/index.ts +12 -0
- package/src/components/app-shell/app-shell.test.tsx +15 -7
- package/src/components/app-shell/app-shell.tsx +27 -20
- package/src/components/autocomplete/autocomplete.tsx +11 -3
- package/src/components/button/button-pressed.test.tsx +202 -0
- package/src/components/button/button.tsx +48 -6
- package/src/components/button-select/button-select-control.tsx +2 -2
- package/src/components/button-select/button-select.tsx +22 -2
- package/src/components/calendar/aliases.tsx +28 -0
- package/src/components/calendar/calendar-body.tsx +310 -210
- package/src/components/calendar/calendar.tsx +43 -12
- package/src/components/calendar/index.ts +7 -1
- package/src/components/calendar/month-year-calendar.test.tsx +106 -0
- package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
- package/src/components/checkbox/checkbox.tsx +7 -2
- package/src/components/choice-card-group/choice-card-group.tsx +2 -2
- package/src/components/circular-progress/circular-progress.test.tsx +35 -0
- package/src/components/circular-progress/circular-progress.tsx +116 -59
- package/src/components/circular-progress/index.ts +1 -0
- package/src/components/code/code.test.tsx +16 -0
- package/src/components/code/code.tsx +11 -0
- package/src/components/combobox/combobox.tsx +63 -28
- package/src/components/combobox-list/combobox-list.tsx +11 -3
- package/src/components/data-list/data-list.test.tsx +149 -0
- package/src/components/data-list/data-list.tsx +268 -0
- package/src/components/data-list/index.ts +9 -0
- package/src/components/data-table/data-table-group.test.tsx +16 -0
- package/src/components/data-table/data-table-group.tsx +15 -2
- package/src/components/data-table/data-table-placeholder.tsx +28 -36
- package/src/components/data-table/data-table-stack.tsx +33 -39
- package/src/components/data-table/data-table.test.tsx +31 -0
- package/src/components/data-table/data-table.tsx +41 -42
- package/src/components/date-picker/aliases.tsx +28 -0
- package/src/components/date-picker/date-picker.test.tsx +29 -0
- package/src/components/date-picker/date-picker.tsx +164 -45
- package/src/components/date-picker/index.ts +5 -1
- package/src/components/date-picker/month-year-picker.test.tsx +362 -0
- package/src/components/drawer/drawer.test.tsx +41 -0
- package/src/components/drawer/drawer.tsx +7 -1
- package/src/components/empty-state/empty-state.test.tsx +109 -0
- package/src/components/empty-state/empty-state.tsx +180 -0
- package/src/components/empty-state/index.ts +9 -0
- package/src/components/field/field.tsx +35 -1
- package/src/components/fieldset/fieldset.test.tsx +352 -0
- package/src/components/fieldset/fieldset.tsx +268 -0
- package/src/components/fieldset/index.ts +11 -0
- package/src/components/file-preview/file-preview.test.tsx +2 -1
- package/src/components/file-preview/file-preview.tsx +7 -13
- package/src/components/file-upload/file-upload.tsx +14 -5
- package/src/components/hover-card/hover-card.tsx +5 -1
- package/src/components/input/input.tsx +12 -5
- package/src/components/kbd/kbd.test.tsx +13 -0
- package/src/components/kbd/kbd.tsx +6 -0
- package/src/components/menu/menu.tsx +6 -2
- package/src/components/modal/modal.test.tsx +41 -0
- package/src/components/modal/modal.tsx +17 -9
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
- package/src/components/multi-select/multi-select.tsx +11 -3
- package/src/components/notification/create-notifier.tsx +1 -1
- package/src/components/number-input/number-input.tsx +12 -3
- package/src/components/overlays/dialog-parts.tsx +42 -5
- package/src/components/pagination/index.ts +19 -0
- package/src/components/pagination/pagination.test.tsx +187 -0
- package/src/components/pagination/pagination.tsx +563 -0
- package/src/components/password-input/password-input.tsx +12 -3
- package/src/components/phone-input/phone-input.tsx +12 -3
- package/src/components/pills-input/pills-input.tsx +7 -2
- package/src/components/pin-input/pin-input.tsx +13 -4
- package/src/components/popover/popover.tsx +87 -17
- package/src/components/progress/index.ts +1 -0
- package/src/components/progress/progress.test.tsx +102 -0
- package/src/components/progress/progress.tsx +116 -62
- package/src/components/prose/index.ts +1 -0
- package/src/components/prose/prose.test.tsx +90 -0
- package/src/components/prose/prose.tsx +60 -0
- package/src/components/prose/styles.css +593 -0
- package/src/components/radio-group/radio-group.tsx +8 -3
- package/src/components/rating/rating.tsx +5 -2
- package/src/components/scroll-area/index.ts +18 -0
- package/src/components/scroll-area/scroll-area.test.tsx +184 -0
- package/src/components/scroll-area/scroll-area.tsx +448 -0
- package/src/components/segment-group/segment-group.tsx +2 -2
- package/src/components/select/select.tsx +37 -18
- package/src/components/slider/slider.tsx +2 -2
- package/src/components/splitter/index.ts +15 -0
- package/src/components/splitter/splitter.test.tsx +244 -0
- package/src/components/splitter/splitter.tsx +625 -0
- package/src/components/spotlight/spotlight.test.tsx +34 -26
- package/src/components/spotlight/spotlight.tsx +7 -9
- package/src/components/steps/index.ts +21 -0
- package/src/components/steps/steps-data.tsx +179 -0
- package/src/components/steps/steps.test.tsx +235 -0
- package/src/components/steps/steps.tsx +686 -0
- package/src/components/switch/switch.tsx +7 -2
- package/src/components/table-of-contents/index.ts +17 -0
- package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
- package/src/components/table-of-contents/table-of-contents.tsx +708 -0
- package/src/components/tags-input/tags-input.tsx +12 -3
- package/src/components/textarea/textarea.tsx +15 -5
- package/src/components/timeline/timeline.test.tsx +22 -0
- package/src/components/timeline/timeline.tsx +10 -1
- package/src/components/tooltip/tooltip.tsx +8 -17
- package/src/components/tour/conditions.test.ts +527 -0
- package/src/components/tour/conditions.ts +445 -0
- package/src/components/tour/create-tours.tsx +150 -0
- package/src/components/tour/index.ts +86 -0
- package/src/components/tour/runtime.ts +187 -0
- package/src/components/tour/storage.test.ts +68 -0
- package/src/components/tour/storage.ts +44 -0
- package/src/components/tour/store.test.tsx +784 -0
- package/src/components/tour/store.ts +661 -0
- package/src/components/tour/tour.test.tsx +318 -0
- package/src/components/tour/tour.tsx +773 -0
- package/src/components/tour/tour.types.test.ts +185 -0
- package/src/components/tour/types.ts +904 -0
- package/src/components/tree/index.ts +24 -0
- package/src/components/tree/tree-row.tsx +179 -0
- package/src/components/tree/tree.test.tsx +296 -0
- package/src/components/tree/tree.tsx +796 -0
- package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
- package/src/components/tree-select/tree-popover.tsx +26 -107
- package/src/components/tree-select/tree-select.tsx +24 -16
- package/src/icon-stroke.test.tsx +2 -0
- package/src/index.ts +16 -0
- package/src/lib/date-predicates.test.ts +46 -0
- package/src/lib/date-predicates.ts +44 -24
- package/src/lib/date-value.test.ts +24 -1
- package/src/lib/date-value.ts +42 -1
- package/src/lib/floating-arrow.tsx +73 -0
- package/src/lib/focus-return.test.tsx +143 -0
- package/src/lib/focus-return.ts +106 -0
- package/src/lib/meter.test.ts +40 -0
- package/src/lib/meter.ts +159 -0
- package/src/lib/overlay-layer.test.tsx +47 -1
- package/src/lib/overlay-layer.tsx +65 -8
- package/src/lib/pressed.ts +130 -0
- package/src/lib/tree-data.ts +42 -2
- package/src/lib/use-pagination.test.ts +105 -0
- package/src/lib/use-pagination.ts +179 -0
- package/src/lib/use-scroll-spy.test.tsx +238 -0
- package/src/lib/use-scroll-spy.ts +336 -0
- package/src/theme.css +39 -3
- package/src/theme.test.ts +29 -1
- package/src/visually-hidden-containment.test.tsx +9 -0
- package/dist/chunk-2W7H43WL.js.map +0 -1
- package/dist/chunk-7E7JNWOC.js.map +0 -1
- package/dist/chunk-7FPSQBWB.js.map +0 -1
- package/dist/chunk-7KFUFAVP.js.map +0 -1
- package/dist/chunk-AKXALCUN.js.map +0 -1
- package/dist/chunk-B5YHYI7E.js.map +0 -1
- package/dist/chunk-FQJNQW3G.js.map +0 -1
- package/dist/chunk-G3AD3NJG.js.map +0 -1
- package/dist/chunk-GEZYGBXY.js.map +0 -1
- package/dist/chunk-HCHGERDB.js.map +0 -1
- package/dist/chunk-HWBFRDX7.js.map +0 -1
- package/dist/chunk-I4B3N3UX.js.map +0 -1
- package/dist/chunk-IA6DCC3N.js.map +0 -1
- package/dist/chunk-IANYMDKH.js.map +0 -1
- package/dist/chunk-MQHD3EJE.js.map +0 -1
- package/dist/chunk-NNPSBC7O.js.map +0 -1
- package/dist/chunk-OXR7BXZA.js.map +0 -1
- package/dist/chunk-QKSLDQM2.js +0 -120
- package/dist/chunk-QKSLDQM2.js.map +0 -1
- package/dist/chunk-QRNQQIQM.js.map +0 -1
- package/dist/chunk-RKCUXOU2.js.map +0 -1
- package/dist/chunk-S5CQRCTF.js +0 -426
- package/dist/chunk-S5CQRCTF.js.map +0 -1
- package/dist/chunk-SBZJGFZ6.js.map +0 -1
- package/dist/chunk-SP6LCCTZ.js.map +0 -1
- package/dist/chunk-TUP7WXQE.js.map +0 -1
- package/dist/chunk-V2QZG4IT.js.map +0 -1
- package/dist/chunk-X6DESK37.js.map +0 -1
- package/dist/chunk-ZB5VMGKB.js.map +0 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { ark, type HTMLArkProps } from "@ark-ui/react"
|
|
2
|
+
import { cva } from "class-variance-authority"
|
|
3
|
+
import type { CSSProperties, ReactNode } from "react"
|
|
4
|
+
import { composeChildren } from "../../lib/as-child"
|
|
5
|
+
import { cn } from "../../lib/cn"
|
|
6
|
+
import { props } from "../../lib/props"
|
|
7
|
+
import type { Size } from "../../lib/sizes"
|
|
8
|
+
import type { WithTestId } from "../../lib/test-id"
|
|
9
|
+
import { TEXT_COLOR_CLASSES, TYPOGRAPHY_SIZE_CLASSES } from "../../lib/typography-size"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Every part is styled from the root through `data-part` hooks
|
|
13
|
+
* (`*:data-[part=item]`, `**:data-[part=label]`), the split `Timeline` and
|
|
14
|
+
* `Table` use, so the parts stay dumb, need no React context, and the whole
|
|
15
|
+
* tree is a Server Component. The selectors are spelled out in full in each
|
|
16
|
+
* class: Tailwind's scanner only sees literal class names, never ones built
|
|
17
|
+
* by interpolation.
|
|
18
|
+
*
|
|
19
|
+
* An item is either a row or a stack:
|
|
20
|
+
*
|
|
21
|
+
* - A **row** re-uses the root's two tracks through `subgrid`, so every label
|
|
22
|
+
* lines up with every other whatever its own width. Label and value share a
|
|
23
|
+
* first baseline, which keeps a one-line label level with a Badge, a Copy
|
|
24
|
+
* button or the first line of a long value.
|
|
25
|
+
* - A **stack** puts the label above the value. It still spans the root's
|
|
26
|
+
* grid (`col-span-full`), so the root keeps its two tracks either way and
|
|
27
|
+
* only the items change shape. Its gap is `row-gap` alone, so a stack
|
|
28
|
+
* that turns back into a row keeps inheriting the root's column gap. That is what lets `responsive` switch on a
|
|
29
|
+
* container query on the root: a query can only style its container's
|
|
30
|
+
* descendants, never the container itself.
|
|
31
|
+
*/
|
|
32
|
+
const ROW =
|
|
33
|
+
"*:data-[part=item]:col-span-full *:data-[part=item]:grid *:data-[part=item]:grid-cols-subgrid *:data-[part=item]:items-baseline"
|
|
34
|
+
const STACK =
|
|
35
|
+
"*:data-[part=item]:col-span-full *:data-[part=item]:flex *:data-[part=item]:flex-col *:data-[part=item]:gap-y-(--dl-stack)"
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The label shades, as the root writes them onto every label. They are
|
|
39
|
+
* `TEXT_COLOR_CLASSES.secondary` (Figma's `text-secondary`, the labels tier)
|
|
40
|
+
* and `TYPOGRAPHY_SHADE_CLASSES.muted` behind a label selector, spelled out
|
|
41
|
+
* for the scanner; `data-list.test.tsx` checks they still match those helpers.
|
|
42
|
+
*/
|
|
43
|
+
export const LABEL_SHADE_CLASSES = {
|
|
44
|
+
secondary: "**:data-[part=label]:text-brand-900/70 dark:**:data-[part=label]:text-white/80",
|
|
45
|
+
muted: "**:data-[part=label]:text-black/60 dark:**:data-[part=label]:text-white/60",
|
|
46
|
+
} as const
|
|
47
|
+
|
|
48
|
+
const dataListVariants = cva(
|
|
49
|
+
[
|
|
50
|
+
"m-0 grid min-w-0 p-0",
|
|
51
|
+
"grid-cols-[var(--dl-label)_minmax(0,1fr)]",
|
|
52
|
+
// The label track's default: as wide as the widest label, but never more
|
|
53
|
+
// than 40% of the list, so a long label wraps instead of squeezing the
|
|
54
|
+
// values. `labelWidth` replaces it through the same property, set inline
|
|
55
|
+
// so it beats this class whatever the selector order.
|
|
56
|
+
"[--dl-label:fit-content(40%)]",
|
|
57
|
+
],
|
|
58
|
+
{
|
|
59
|
+
variants: {
|
|
60
|
+
orientation: {
|
|
61
|
+
horizontal: ROW,
|
|
62
|
+
vertical: STACK,
|
|
63
|
+
// `@container` gives the root `container-type: inline-size`, so its
|
|
64
|
+
// own width can no longer come from its content: it fills its parent,
|
|
65
|
+
// like any block. The query reads the root's content box, which the
|
|
66
|
+
// query's own classes (all on the items) never change, so the switch
|
|
67
|
+
// can't feed back into what it measures. 24rem is Tailwind's `@sm`
|
|
68
|
+
// container step; a `var()` can't appear in a query, so it's a literal.
|
|
69
|
+
responsive: [
|
|
70
|
+
"@container/data-list",
|
|
71
|
+
STACK,
|
|
72
|
+
"@sm/data-list:*:data-[part=item]:grid @sm/data-list:*:data-[part=item]:grid-cols-subgrid",
|
|
73
|
+
// The stack's gap is `gap-y` only, so a subgrid row keeps its
|
|
74
|
+
// `column-gap: normal`, which is the root's column gap. A plain
|
|
75
|
+
// `gap-*` here would reset it and glue each label to its value.
|
|
76
|
+
"@sm/data-list:*:data-[part=item]:items-baseline",
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
// Font size from the kit's typography scale (so `size="lg"` reads as
|
|
80
|
+
// `Text size="lg"`), plus the gaps that grow with it. `--dl-stack` is the
|
|
81
|
+
// label-to-value gap of a stacked item, `--dl-row` the space between
|
|
82
|
+
// items (spent as padding instead when there are dividers).
|
|
83
|
+
size: {
|
|
84
|
+
xs: [TYPOGRAPHY_SIZE_CLASSES.xs, "gap-x-3 [--dl-stack:0rem] [--dl-row:0.375rem]"],
|
|
85
|
+
sm: [TYPOGRAPHY_SIZE_CLASSES.sm, "gap-x-4 [--dl-stack:0rem] [--dl-row:0.5rem]"],
|
|
86
|
+
md: [TYPOGRAPHY_SIZE_CLASSES.md, "gap-x-6 [--dl-stack:0.125rem] [--dl-row:0.75rem]"],
|
|
87
|
+
lg: [TYPOGRAPHY_SIZE_CLASSES.lg, "gap-x-6 [--dl-stack:0.125rem] [--dl-row:1rem]"],
|
|
88
|
+
xl: [TYPOGRAPHY_SIZE_CLASSES.xl, "gap-x-8 [--dl-stack:0.25rem] [--dl-row:1.25rem]"],
|
|
89
|
+
},
|
|
90
|
+
// Dividers are the kit's content hairline (the one `Card`'s header and
|
|
91
|
+
// footer draw), between items only. The row spacing moves into each
|
|
92
|
+
// item's padding so the line sits midway between two items, and the
|
|
93
|
+
// first and last item stay flush with the list's edges.
|
|
94
|
+
withDivider: {
|
|
95
|
+
true: [
|
|
96
|
+
"gap-y-0",
|
|
97
|
+
"*:data-[part=item]:py-(--dl-row) *:data-[part=item]:first:pt-0 *:data-[part=item]:last:pb-0",
|
|
98
|
+
"*:data-[part=item]:not-last:border-b *:data-[part=item]:border-brand-900/20 dark:*:data-[part=item]:border-white/8",
|
|
99
|
+
],
|
|
100
|
+
false: "gap-y-(--dl-row)",
|
|
101
|
+
},
|
|
102
|
+
// Labels: the secondary text colour at medium weight by default, a step
|
|
103
|
+
// below the primary-coloured values; `muted` steps them further back,
|
|
104
|
+
// to the typography muted shade at normal weight.
|
|
105
|
+
muted: {
|
|
106
|
+
true: ["**:data-[part=label]:font-normal", LABEL_SHADE_CLASSES.muted],
|
|
107
|
+
false: ["**:data-[part=label]:font-medium", LABEL_SHADE_CLASSES.secondary],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
defaultVariants: {
|
|
111
|
+
orientation: "horizontal",
|
|
112
|
+
size: "md",
|
|
113
|
+
withDivider: false,
|
|
114
|
+
muted: false,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
/** How labels sit against their values. */
|
|
120
|
+
export type DataListOrientation = "horizontal" | "vertical" | "responsive"
|
|
121
|
+
|
|
122
|
+
/** One row of the data-driven form. */
|
|
123
|
+
export type DataListEntry = {
|
|
124
|
+
/** The term: what the value is ("Login", "Campus"). Rendered in a `<dt>`. */
|
|
125
|
+
label: ReactNode
|
|
126
|
+
/** The description: any node, from plain text to a Badge, an Avatar or a Copy button. Rendered in a `<dd>`. */
|
|
127
|
+
value: ReactNode
|
|
128
|
+
/** React key for the row. Defaults to the label when it is a string, else the row's index. */
|
|
129
|
+
id?: string
|
|
130
|
+
/** `data-testid` on the item; its label and value get `-label` and `-value` suffixes. */
|
|
131
|
+
testId?: string
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export type DataListProps = HTMLArkProps<"dl"> &
|
|
135
|
+
WithTestId & {
|
|
136
|
+
/** Rows to render, before any `children`. Each entry becomes a `DataList.Item` with its label and value. */
|
|
137
|
+
data?: readonly DataListEntry[]
|
|
138
|
+
/**
|
|
139
|
+
* `horizontal` (default) puts each label in a column beside its value. `vertical` stacks the
|
|
140
|
+
* label above the value. `responsive` stacks below a 24rem-wide list and goes horizontal from
|
|
141
|
+
* there, measured on the list itself (a container query), not the viewport.
|
|
142
|
+
*/
|
|
143
|
+
orientation?: DataListOrientation
|
|
144
|
+
/**
|
|
145
|
+
* The label column's track, for `horizontal` and the wide side of `responsive`: a number in
|
|
146
|
+
* pixels, or any grid track size (`"10rem"`, `"30%"`, `"max-content"`, `"minmax(8rem, 1fr)"`).
|
|
147
|
+
* Default `fit-content(40%)`: the widest label's width, up to 40% of the list.
|
|
148
|
+
*/
|
|
149
|
+
labelWidth?: number | string
|
|
150
|
+
/** Font size (the `Text` scale) and the spacing that goes with it. Default `md`. */
|
|
151
|
+
size?: Size
|
|
152
|
+
/** Draws a hairline between items. */
|
|
153
|
+
withDivider?: boolean
|
|
154
|
+
/** Labels in the muted text shade at normal weight, instead of the secondary shade at medium weight. */
|
|
155
|
+
muted?: boolean
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export type DataListItemProps = HTMLArkProps<"div"> & WithTestId
|
|
159
|
+
export type DataListLabelProps = HTMLArkProps<"dt"> & WithTestId
|
|
160
|
+
export type DataListValueProps = HTMLArkProps<"dd"> & WithTestId
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* DataList.Item — one label/value pair. A `<div>` grouping a `<dt>` and its
|
|
164
|
+
* `<dd>` (valid inside a `<dl>`), which lets the pair carry a divider, a
|
|
165
|
+
* `testId` or a click target.
|
|
166
|
+
*/
|
|
167
|
+
const DataListItem = ({ testId, ...rest }: DataListItemProps) => (
|
|
168
|
+
<ark.div {...props({ "data-testid": testId })} data-part="item" {...rest} />
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
/** DataList.Label — the term, a `<dt>`. Its colour and weight come from the root's `muted`. */
|
|
172
|
+
const DataListLabel = ({ className, testId, ...rest }: DataListLabelProps) => (
|
|
173
|
+
<ark.dt
|
|
174
|
+
{...props({ "data-testid": testId })}
|
|
175
|
+
data-part="label"
|
|
176
|
+
className={cn("m-0 min-w-0 wrap-break-word", className)}
|
|
177
|
+
{...rest}
|
|
178
|
+
/>
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
/** DataList.Value — the description, a `<dd>` in the primary text colour. Holds any node; long text wraps inside its column. */
|
|
182
|
+
const DataListValue = ({ className, testId, ...rest }: DataListValueProps) => (
|
|
183
|
+
<ark.dd
|
|
184
|
+
{...props({ "data-testid": testId })}
|
|
185
|
+
data-part="value"
|
|
186
|
+
className={cn("m-0 min-w-0 wrap-break-word", TEXT_COLOR_CLASSES.primary, className)}
|
|
187
|
+
{...rest}
|
|
188
|
+
/>
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
/** The React key of a data row: its `id`, else a string label, else its index. */
|
|
192
|
+
const entryKey = (entry: DataListEntry, index: number): string =>
|
|
193
|
+
entry.id ?? (typeof entry.label === "string" ? entry.label : String(index))
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* DataList — a key/value description list on a semantic `<dl>`, for profile
|
|
197
|
+
* and detail pages ("Login: jdoe", "Campus: Paris", "Status: <Badge>").
|
|
198
|
+
*
|
|
199
|
+
* Pure React Server Component. Pass rows as `data`, or compose
|
|
200
|
+
* `DataList.Item` / `.Label` / `.Value` for a row the data form can't
|
|
201
|
+
* describe; the two mix, `data` first.
|
|
202
|
+
*
|
|
203
|
+
* <DataList
|
|
204
|
+
* withDivider
|
|
205
|
+
* data={[
|
|
206
|
+
* { label: "Login", value: "jdoe" },
|
|
207
|
+
* { label: "Campus", value: "Paris" },
|
|
208
|
+
* ]}
|
|
209
|
+
* >
|
|
210
|
+
* <DataList.Item>
|
|
211
|
+
* <DataList.Label>Status</DataList.Label>
|
|
212
|
+
* <DataList.Value><Badge color="green">Active</Badge></DataList.Value>
|
|
213
|
+
* </DataList.Item>
|
|
214
|
+
* </DataList>
|
|
215
|
+
*
|
|
216
|
+
* In `horizontal`, items are subgrid rows of the root's two columns, so labels
|
|
217
|
+
* line up down the list. `responsive` is a container query on the list
|
|
218
|
+
* itself, which therefore always fills its parent's width (it can't
|
|
219
|
+
* shrink-wrap its content in a flex row: give it a width there).
|
|
220
|
+
*/
|
|
221
|
+
const DataListComponent = ({
|
|
222
|
+
className,
|
|
223
|
+
style,
|
|
224
|
+
data,
|
|
225
|
+
orientation,
|
|
226
|
+
labelWidth,
|
|
227
|
+
size,
|
|
228
|
+
withDivider,
|
|
229
|
+
muted,
|
|
230
|
+
asChild,
|
|
231
|
+
children,
|
|
232
|
+
testId,
|
|
233
|
+
...rest
|
|
234
|
+
}: DataListProps) => {
|
|
235
|
+
const labelTrack = typeof labelWidth === "number" ? `${labelWidth}px` : labelWidth
|
|
236
|
+
return (
|
|
237
|
+
<ark.dl
|
|
238
|
+
{...props({ "data-testid": testId })}
|
|
239
|
+
data-orientation={orientation ?? "horizontal"}
|
|
240
|
+
{...rest}
|
|
241
|
+
asChild={asChild}
|
|
242
|
+
style={labelTrack ? ({ ...style, "--dl-label": labelTrack } as CSSProperties) : style}
|
|
243
|
+
className={cn(dataListVariants({ orientation, size, withDivider, muted }), className)}
|
|
244
|
+
>
|
|
245
|
+
{composeChildren(asChild, children, (own) => (
|
|
246
|
+
<>
|
|
247
|
+
{data?.map((entry, index) => (
|
|
248
|
+
<DataListItem key={entryKey(entry, index)} testId={entry.testId}>
|
|
249
|
+
<DataListLabel testId={entry.testId && `${entry.testId}-label`}>
|
|
250
|
+
{entry.label}
|
|
251
|
+
</DataListLabel>
|
|
252
|
+
<DataListValue testId={entry.testId && `${entry.testId}-value`}>
|
|
253
|
+
{entry.value}
|
|
254
|
+
</DataListValue>
|
|
255
|
+
</DataListItem>
|
|
256
|
+
))}
|
|
257
|
+
{own}
|
|
258
|
+
</>
|
|
259
|
+
))}
|
|
260
|
+
</ark.dl>
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export const DataList = Object.assign(DataListComponent, {
|
|
265
|
+
Item: DataListItem,
|
|
266
|
+
Label: DataListLabel,
|
|
267
|
+
Value: DataListValue,
|
|
268
|
+
})
|
|
@@ -1005,3 +1005,19 @@ describe("DataTable grouping", () => {
|
|
|
1005
1005
|
})
|
|
1006
1006
|
})
|
|
1007
1007
|
})
|
|
1008
|
+
|
|
1009
|
+
describe("the group header's checkbox", () => {
|
|
1010
|
+
// jsdom lays nothing out: the offset the pinned content sticks at is read from its class,
|
|
1011
|
+
// and must be the cells' own inline padding, or the checkbox leaves the select column.
|
|
1012
|
+
it.each([
|
|
1013
|
+
["xs", "start-2"],
|
|
1014
|
+
["sm", "start-2.5"],
|
|
1015
|
+
["md", "start-3"],
|
|
1016
|
+
["lg", "start-4"],
|
|
1017
|
+
] as const)("stays in the select column at size %s (%s)", (size, start) => {
|
|
1018
|
+
const { container } = renderTable({ ...byStatus, size, enableRowSelection: true })
|
|
1019
|
+
const pinned = container.querySelector("tr[data-group] th > div")
|
|
1020
|
+
expect(pinned?.className).toContain(start)
|
|
1021
|
+
expect(container.querySelector("tr[data-group] [data-scope=checkbox]")).not.toBeNull()
|
|
1022
|
+
})
|
|
1023
|
+
})
|
|
@@ -286,6 +286,17 @@ export function DataTableGroupShowMore<TEntity extends RowData>({
|
|
|
286
286
|
)
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
+
/** Where a group's content stays pinned while the table scrolls sideways: the cells' own
|
|
290
|
+
* inline padding per density (`Table`'s `[&_td]:px-*`), so the group's checkbox stands
|
|
291
|
+
* in the select column with the rows' own whatever the size. */
|
|
292
|
+
const STICKY_START: Record<TableSize, string> = {
|
|
293
|
+
xs: "start-2",
|
|
294
|
+
sm: "start-2.5",
|
|
295
|
+
md: "start-3",
|
|
296
|
+
lg: "start-4",
|
|
297
|
+
xl: "start-4",
|
|
298
|
+
}
|
|
299
|
+
|
|
289
300
|
/** The group header cell's wash and hairlines. The `<tr>` carries
|
|
290
301
|
* `data-placeholder`, so `Table`'s row hover leaves it alone. */
|
|
291
302
|
const groupHeaderCell = cn(
|
|
@@ -357,7 +368,9 @@ export function DataTableGroupedBody<TEntity extends RowData>({
|
|
|
357
368
|
>
|
|
358
369
|
{/* Pinned to the inline start, so the group stays named while the table
|
|
359
370
|
scrolls sideways. */}
|
|
360
|
-
<div
|
|
371
|
+
<div
|
|
372
|
+
className={cn("sticky flex w-max max-w-full items-center gap-2", STICKY_START[size])}
|
|
373
|
+
>
|
|
361
374
|
{selectable && selectableRows.length > 0 && (
|
|
362
375
|
<Checkbox
|
|
363
376
|
size={size}
|
|
@@ -413,7 +426,7 @@ export function DataTableGroupedBody<TEntity extends RowData>({
|
|
|
413
426
|
grouping.nextCount(node) > 0 && (
|
|
414
427
|
<Table.Row key={`${node.id}-more`} testId={`group-${node.id}-more`} data-placeholder>
|
|
415
428
|
<Table.Cell colSpan={colSpan}>
|
|
416
|
-
<div className={cn("sticky
|
|
429
|
+
<div className={cn("sticky w-max", STICKY_START[size], node.depth > 0 && "ps-6")}>
|
|
417
430
|
<DataTableGroupShowMore node={node} grouping={grouping} translations={translations} />
|
|
418
431
|
</div>
|
|
419
432
|
</Table.Cell>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from "react"
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { Color } from "../../lib/colors"
|
|
3
|
+
import { EmptyState, type EmptyStateRootProps } from "../empty-state"
|
|
4
4
|
|
|
5
5
|
type Placeholder = {
|
|
6
6
|
title: ReactNode
|
|
7
7
|
description?: ReactNode
|
|
8
8
|
actions?: ReactNode
|
|
9
|
+
/** Overrides the view's palette: the error view is `red` by default, the
|
|
10
|
+
* empty view neutral. */
|
|
11
|
+
color?: Color
|
|
9
12
|
}
|
|
10
13
|
export type DataTablePlaceholder = ReactNode | Placeholder
|
|
11
14
|
|
|
@@ -15,47 +18,36 @@ export type DataTablePlaceholder = ReactNode | Placeholder
|
|
|
15
18
|
* never disagree on which state is showing. */
|
|
16
19
|
export type DataTableView = "error" | "loading" | "empty" | "items"
|
|
17
20
|
|
|
21
|
+
const isPlaceholder = (node: DataTablePlaceholder): node is Placeholder =>
|
|
22
|
+
!!(node && typeof node === "object" && "title" in node)
|
|
23
|
+
|
|
24
|
+
/** Draws an `empty` / `error` prop as an `EmptyState`: a bare node is its
|
|
25
|
+
* title, an object spells out every part. The view supplies the icon, its
|
|
26
|
+
* default actions (clear filters, retry) and its default palette; the
|
|
27
|
+
* object's own `actions` and `color` win over them. */
|
|
18
28
|
export function RenderPlaceholder({
|
|
19
29
|
node,
|
|
30
|
+
icon,
|
|
20
31
|
defaultActions,
|
|
21
|
-
|
|
32
|
+
defaultColor,
|
|
33
|
+
...rest
|
|
34
|
+
}: Omit<EmptyStateRootProps, "title" | "color"> & {
|
|
22
35
|
node: DataTablePlaceholder
|
|
36
|
+
icon?: ReactNode
|
|
23
37
|
defaultActions?: ReactNode
|
|
38
|
+
defaultColor?: Color
|
|
24
39
|
}) {
|
|
40
|
+
const placeholder: Placeholder = isPlaceholder(node) ? node : { title: node }
|
|
41
|
+
const { title, description, actions, color } = placeholder
|
|
25
42
|
return (
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
<EmptyState
|
|
44
|
+
icon={icon}
|
|
45
|
+
title={title}
|
|
46
|
+
description={description}
|
|
47
|
+
color={color ?? defaultColor}
|
|
48
|
+
{...rest}
|
|
31
49
|
>
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
(n): n is Placeholder => !!(n && typeof n === "object" && "title" in n),
|
|
35
|
-
({ title, description, actions }) => (
|
|
36
|
-
<>
|
|
37
|
-
<div className="flex flex-col">
|
|
38
|
-
<span data-title>{title}</span>
|
|
39
|
-
{description && <span data-desc>{description}</span>}
|
|
40
|
-
</div>
|
|
41
|
-
{(actions || defaultActions) && (
|
|
42
|
-
<div className="flex flex-row gap-1 justify-center items-center">
|
|
43
|
-
{actions ?? defaultActions}
|
|
44
|
-
</div>
|
|
45
|
-
)}
|
|
46
|
-
</>
|
|
47
|
-
),
|
|
48
|
-
)
|
|
49
|
-
.otherwise((n) => (
|
|
50
|
-
<>
|
|
51
|
-
<span data-title>{n}</span>
|
|
52
|
-
{defaultActions && (
|
|
53
|
-
<div className="flex flex-row gap-1 justify-center items-center">
|
|
54
|
-
{defaultActions}
|
|
55
|
-
</div>
|
|
56
|
-
)}
|
|
57
|
-
</>
|
|
58
|
-
))}
|
|
59
|
-
</div>
|
|
50
|
+
{actions ?? (defaultActions || undefined)}
|
|
51
|
+
</EmptyState>
|
|
60
52
|
)
|
|
61
53
|
}
|
|
@@ -19,7 +19,6 @@ import { Pill } from "../pill"
|
|
|
19
19
|
import { Select } from "../select/select"
|
|
20
20
|
import { Skeleton } from "../skeleton"
|
|
21
21
|
import { Text } from "../text/text"
|
|
22
|
-
import { ThemeIcon } from "../theme-icon"
|
|
23
22
|
import type { DataTableFeatures, Row } from "./data-table-features"
|
|
24
23
|
import { DataTableFilterControl, hasActiveFilterValue } from "./data-table-filter"
|
|
25
24
|
import {
|
|
@@ -90,28 +89,25 @@ export function DataTableStackedRows<TEntity extends RowData>({
|
|
|
90
89
|
<div className={cn("flex flex-1 min-h-0 flex-col gap-2 overflow-y-auto p-3", className)}>
|
|
91
90
|
{match(view)
|
|
92
91
|
.with("error", () => (
|
|
93
|
-
<
|
|
92
|
+
<RenderPlaceholder
|
|
94
93
|
role="alert"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
/>
|
|
114
|
-
</div>
|
|
94
|
+
node={error}
|
|
95
|
+
icon={icons.error}
|
|
96
|
+
defaultColor="red"
|
|
97
|
+
defaultActions={
|
|
98
|
+
onRetry && (
|
|
99
|
+
<Button
|
|
100
|
+
variant="light"
|
|
101
|
+
color="neutral"
|
|
102
|
+
size="sm"
|
|
103
|
+
startSlot={icons.retry}
|
|
104
|
+
onClick={onRetry}
|
|
105
|
+
>
|
|
106
|
+
{translations.retry}
|
|
107
|
+
</Button>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
/>
|
|
115
111
|
))
|
|
116
112
|
.with("loading", () =>
|
|
117
113
|
Array.from({ length: skeletonRowCount }).map((_, cardIndex) => (
|
|
@@ -133,23 +129,21 @@ export function DataTableStackedRows<TEntity extends RowData>({
|
|
|
133
129
|
)),
|
|
134
130
|
)
|
|
135
131
|
.with("empty", () => (
|
|
136
|
-
<
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
/>
|
|
152
|
-
</div>
|
|
132
|
+
<RenderPlaceholder
|
|
133
|
+
node={empty}
|
|
134
|
+
icon={icons.empty}
|
|
135
|
+
defaultActions={
|
|
136
|
+
<Button
|
|
137
|
+
variant="light"
|
|
138
|
+
color="neutral"
|
|
139
|
+
size="sm"
|
|
140
|
+
startSlot={icons.clear}
|
|
141
|
+
onClick={() => table.resetColumnFilters()}
|
|
142
|
+
>
|
|
143
|
+
{translations.clearFilters}
|
|
144
|
+
</Button>
|
|
145
|
+
}
|
|
146
|
+
/>
|
|
153
147
|
))
|
|
154
148
|
.with("items", () => {
|
|
155
149
|
// Same rendered header content as `DataTableHeaderCell` shows in
|
|
@@ -62,6 +62,37 @@ describe("DataTable", () => {
|
|
|
62
62
|
expect(within(cell).getByRole("alert").textContent).toBe("Failed to load")
|
|
63
63
|
})
|
|
64
64
|
|
|
65
|
+
it("draws the error view red and the empty view neutral, in both renderings", () => {
|
|
66
|
+
const failed = render(
|
|
67
|
+
<DataTable columns={columns} data={USERS} responsive="stack" error="Failed to load" />,
|
|
68
|
+
)
|
|
69
|
+
// The table cell's alert and the stacked card's.
|
|
70
|
+
const alerts = [...failed.container.querySelectorAll('[role="alert"]')]
|
|
71
|
+
expect(alerts.map((alert) => alert.getAttribute("data-color"))).toEqual(["red", "red"])
|
|
72
|
+
failed.unmount()
|
|
73
|
+
|
|
74
|
+
render(<DataTable columns={columns} data={[]} responsive="stack" />)
|
|
75
|
+
// Title → text column → the EmptyState root.
|
|
76
|
+
const blocks = screen
|
|
77
|
+
.getAllByText(DATA_TABLE_DEFAULT_EMPTY)
|
|
78
|
+
.map((title) => title.parentElement?.parentElement)
|
|
79
|
+
expect(blocks).toHaveLength(2)
|
|
80
|
+
expect(blocks.every((block) => block?.hasAttribute("data-color") === false)).toBe(true)
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it("lets an error or empty object override the view's palette", () => {
|
|
84
|
+
render(
|
|
85
|
+
<DataTable
|
|
86
|
+
columns={columns}
|
|
87
|
+
data={USERS}
|
|
88
|
+
error={{ title: "Paused", description: "Back on Monday.", color: "neutral" }}
|
|
89
|
+
/>,
|
|
90
|
+
)
|
|
91
|
+
const alert = screen.getByRole("alert")
|
|
92
|
+
expect(alert.getAttribute("data-color")).toBe("neutral")
|
|
93
|
+
expect(alert.textContent).toContain("Back on Monday.")
|
|
94
|
+
})
|
|
95
|
+
|
|
65
96
|
it("keeps a height floor for the placeholder views only", () => {
|
|
66
97
|
const floor = (container: HTMLElement) => container.querySelector(".min-h-64")
|
|
67
98
|
|