@womp/kookie-ui 0.22.1 → 0.24.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/components.css +247 -187
- package/dist/cjs/components/_internal/base-button.d.ts +11 -1
- package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
- package/dist/cjs/components/_internal/base-button.js +1 -1
- package/dist/cjs/components/_internal/base-button.js.map +4 -4
- package/dist/cjs/components/_internal/menu-context.d.ts +2 -0
- package/dist/cjs/components/_internal/menu-context.d.ts.map +1 -1
- package/dist/cjs/components/_internal/menu-context.js +1 -1
- package/dist/cjs/components/_internal/menu-context.js.map +3 -3
- package/dist/cjs/components/_internal/pane-chrome.d.ts +17 -2
- package/dist/cjs/components/_internal/pane-chrome.d.ts.map +1 -1
- package/dist/cjs/components/_internal/pane-chrome.js +1 -1
- package/dist/cjs/components/_internal/pane-chrome.js.map +4 -4
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
- package/dist/cjs/components/accordion.d.ts +2 -2
- package/dist/cjs/components/accordion.d.ts.map +1 -1
- package/dist/cjs/components/accordion.js +1 -1
- package/dist/cjs/components/accordion.js.map +4 -4
- package/dist/cjs/components/alert-dialog.d.ts.map +1 -1
- package/dist/cjs/components/alert-dialog.js +1 -1
- package/dist/cjs/components/alert-dialog.js.map +3 -3
- package/dist/cjs/components/avatar.d.ts +1 -1
- package/dist/cjs/components/avatar.d.ts.map +1 -1
- package/dist/cjs/components/avatar.js +1 -1
- package/dist/cjs/components/avatar.js.map +3 -3
- package/dist/cjs/components/avatar.props.d.ts +8 -0
- package/dist/cjs/components/avatar.props.d.ts.map +1 -1
- package/dist/cjs/components/avatar.props.js +1 -1
- package/dist/cjs/components/avatar.props.js.map +2 -2
- package/dist/cjs/components/blockquote.d.ts +1 -1
- package/dist/cjs/components/blockquote.d.ts.map +1 -1
- package/dist/cjs/components/blockquote.js +1 -1
- package/dist/cjs/components/blockquote.js.map +4 -4
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +4 -4
- package/dist/cjs/components/chatbar.d.ts.map +1 -1
- package/dist/cjs/components/chatbar.js +1 -1
- package/dist/cjs/components/chatbar.js.map +4 -4
- package/dist/cjs/components/checkbox-group.d.ts.map +1 -1
- package/dist/cjs/components/checkbox-group.js +1 -1
- package/dist/cjs/components/checkbox-group.js.map +3 -3
- package/dist/cjs/components/checkbox-group.primitive.d.ts +12 -5
- package/dist/cjs/components/checkbox-group.primitive.d.ts.map +1 -1
- package/dist/cjs/components/checkbox-group.primitive.js +1 -1
- package/dist/cjs/components/checkbox-group.primitive.js.map +3 -3
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +3 -3
- package/dist/cjs/components/chip.d.ts.map +1 -1
- package/dist/cjs/components/chip.js +1 -1
- package/dist/cjs/components/chip.js.map +3 -3
- package/dist/cjs/components/code.d.ts.map +1 -1
- package/dist/cjs/components/code.js +1 -1
- package/dist/cjs/components/code.js.map +2 -2
- package/dist/cjs/components/combobox.js +1 -1
- package/dist/cjs/components/combobox.js.map +3 -3
- package/dist/cjs/components/context-menu.d.ts.map +1 -1
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +4 -4
- package/dist/cjs/components/dialog.d.ts +1 -1
- package/dist/cjs/components/dialog.d.ts.map +1 -1
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +3 -3
- package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +4 -4
- package/dist/cjs/components/icons.d.ts +3 -1
- package/dist/cjs/components/icons.d.ts.map +1 -1
- package/dist/cjs/components/icons.js +1 -1
- package/dist/cjs/components/icons.js.map +3 -3
- package/dist/cjs/components/image.d.ts +23 -0
- package/dist/cjs/components/image.d.ts.map +1 -0
- package/dist/cjs/components/image.js +2 -0
- package/dist/cjs/components/image.js.map +7 -0
- package/dist/cjs/components/image.props.d.ts +19 -0
- package/dist/cjs/components/image.props.d.ts.map +1 -0
- package/dist/cjs/components/image.props.js +2 -0
- package/dist/cjs/components/image.props.js.map +7 -0
- package/dist/cjs/components/index.d.ts +2 -1
- package/dist/cjs/components/index.d.ts.map +1 -1
- package/dist/cjs/components/index.js +2 -10
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/components/message-scroller.d.ts.map +1 -1
- package/dist/cjs/components/message-scroller.js +1 -1
- package/dist/cjs/components/message-scroller.js.map +4 -4
- package/dist/cjs/components/navbar.d.ts.map +1 -1
- package/dist/cjs/components/navbar.js +1 -1
- package/dist/cjs/components/navbar.js.map +3 -3
- package/dist/cjs/components/notice.d.ts +4 -1
- package/dist/cjs/components/notice.d.ts.map +1 -1
- package/dist/cjs/components/notice.js +1 -1
- package/dist/cjs/components/notice.js.map +4 -4
- package/dist/cjs/components/progress.d.ts.map +1 -1
- package/dist/cjs/components/progress.js +1 -1
- package/dist/cjs/components/progress.js.map +3 -3
- package/dist/cjs/components/schemas/button.schema.d.ts +2 -2
- package/dist/cjs/components/schemas/toggle.schema.d.ts +1 -1
- package/dist/cjs/components/scroll-area.d.ts +3 -1
- package/dist/cjs/components/scroll-area.d.ts.map +1 -1
- package/dist/cjs/components/scroll-area.js +1 -1
- package/dist/cjs/components/scroll-area.js.map +4 -4
- package/dist/cjs/components/segmented-control.d.ts +3 -1
- package/dist/cjs/components/segmented-control.d.ts.map +1 -1
- package/dist/cjs/components/segmented-control.js +1 -1
- package/dist/cjs/components/segmented-control.js.map +3 -3
- package/dist/cjs/components/select.d.ts +1 -2
- package/dist/cjs/components/select.d.ts.map +1 -1
- package/dist/cjs/components/select.js +1 -1
- package/dist/cjs/components/select.js.map +3 -3
- package/dist/cjs/components/separator.d.ts.map +1 -1
- package/dist/cjs/components/separator.js +1 -1
- package/dist/cjs/components/separator.js.map +3 -3
- package/dist/cjs/components/sheet.d.ts +1 -0
- package/dist/cjs/components/sheet.d.ts.map +1 -1
- package/dist/cjs/components/sheet.js +1 -1
- package/dist/cjs/components/sheet.js.map +3 -3
- package/dist/cjs/components/shell.d.ts +12 -1
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +4 -4
- package/dist/cjs/components/sidebar.d.ts.map +1 -1
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +4 -4
- package/dist/cjs/components/slider.d.ts.map +1 -1
- package/dist/cjs/components/slider.js +1 -1
- package/dist/cjs/components/slider.js.map +3 -3
- package/dist/cjs/components/spinner.d.ts.map +1 -1
- package/dist/cjs/components/spinner.js +1 -1
- package/dist/cjs/components/spinner.js.map +3 -3
- package/dist/cjs/components/table.d.ts.map +1 -1
- package/dist/cjs/components/table.js +1 -1
- package/dist/cjs/components/table.js.map +4 -4
- package/dist/cjs/components/tabs.d.ts.map +1 -1
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/components/tabs.js.map +2 -2
- package/dist/cjs/components/text-area.js +1 -1
- package/dist/cjs/components/text-area.js.map +2 -2
- package/dist/cjs/components/text-field.js +2 -2
- package/dist/cjs/components/text-field.js.map +2 -2
- package/dist/cjs/components/toggle.d.ts +3 -2
- package/dist/cjs/components/toggle.d.ts.map +1 -1
- package/dist/cjs/components/toggle.js +1 -9
- package/dist/cjs/components/toggle.js.map +4 -4
- package/dist/cjs/components/toolbar.d.ts +80 -8
- package/dist/cjs/components/toolbar.d.ts.map +1 -1
- package/dist/cjs/components/toolbar.js +1 -1
- package/dist/cjs/components/toolbar.js.map +4 -4
- package/dist/cjs/components/virtual-menu.d.ts +3 -5
- package/dist/cjs/components/virtual-menu.d.ts.map +1 -1
- package/dist/cjs/components/virtual-menu.js +1 -1
- package/dist/cjs/components/virtual-menu.js.map +3 -3
- package/dist/cjs/helpers/extract-margin-props.d.ts +7 -7
- package/dist/cjs/hooks/use-scroll-edges.d.ts +4 -2
- package/dist/cjs/hooks/use-scroll-edges.d.ts.map +1 -1
- package/dist/cjs/hooks/use-scroll-edges.js +1 -1
- package/dist/cjs/hooks/use-scroll-edges.js.map +3 -3
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/props/index.js +1 -1
- package/dist/cjs/props/index.js.map +2 -2
- package/dist/esm/chunk-3VTS4C63.js +2 -0
- package/dist/esm/chunk-3VTS4C63.js.map +7 -0
- package/dist/esm/chunk-3WE4E2WQ.js +2 -0
- package/dist/esm/chunk-3WE4E2WQ.js.map +7 -0
- package/dist/esm/chunk-3XUY5WFA.js +2 -0
- package/dist/esm/chunk-3XUY5WFA.js.map +7 -0
- package/dist/esm/chunk-3XZOE2IQ.js +2 -0
- package/dist/esm/chunk-3XZOE2IQ.js.map +7 -0
- package/dist/esm/chunk-432YLNB3.js +2 -0
- package/dist/esm/chunk-432YLNB3.js.map +7 -0
- package/dist/esm/chunk-4QKZYCCH.js +2 -0
- package/dist/esm/chunk-4QKZYCCH.js.map +7 -0
- package/dist/esm/chunk-4R5EMVB3.js +2 -0
- package/dist/esm/chunk-4R5EMVB3.js.map +7 -0
- package/dist/esm/chunk-4ZOVV3TY.js +2 -0
- package/dist/esm/chunk-4ZOVV3TY.js.map +7 -0
- package/dist/esm/{chunk-IX5HIHVI.js → chunk-62ZGP4ET.js} +2 -2
- package/dist/esm/{chunk-IX5HIHVI.js.map → chunk-62ZGP4ET.js.map} +3 -3
- package/dist/esm/chunk-BGAJ2MDF.js +2 -0
- package/dist/esm/chunk-BGAJ2MDF.js.map +7 -0
- package/dist/esm/chunk-CHPT42BY.js +2 -0
- package/dist/esm/{chunk-Y3JYEEFB.js.map → chunk-CHPT42BY.js.map} +2 -2
- package/dist/esm/{chunk-KS4U4VPH.js → chunk-CMHUK7OG.js} +2 -2
- package/dist/esm/{chunk-KS4U4VPH.js.map → chunk-CMHUK7OG.js.map} +2 -2
- package/dist/esm/chunk-CN6F4REJ.js +2 -0
- package/dist/esm/chunk-CN6F4REJ.js.map +7 -0
- package/dist/esm/chunk-DUTZUWZP.js +2 -0
- package/dist/esm/chunk-DUTZUWZP.js.map +7 -0
- package/dist/esm/chunk-EZYXYLR2.js +2 -0
- package/dist/esm/chunk-EZYXYLR2.js.map +7 -0
- package/dist/esm/chunk-FDJV5RXX.js +2 -0
- package/dist/esm/chunk-FDJV5RXX.js.map +7 -0
- package/dist/esm/chunk-G2JD52O5.js +2 -0
- package/dist/esm/{chunk-23KT3D2Z.js.map → chunk-G2JD52O5.js.map} +3 -3
- package/dist/esm/{chunk-PNAB6KCN.js → chunk-G4ETY2NP.js} +2 -2
- package/dist/esm/{chunk-PNAB6KCN.js.map → chunk-G4ETY2NP.js.map} +1 -1
- package/dist/esm/chunk-GPOCLDBR.js +2 -0
- package/dist/esm/chunk-GPOCLDBR.js.map +7 -0
- package/dist/esm/chunk-GYP66ZK2.js +2 -0
- package/dist/esm/chunk-GYP66ZK2.js.map +7 -0
- package/dist/esm/chunk-H5BYPX6V.js +2 -0
- package/dist/esm/chunk-H5BYPX6V.js.map +7 -0
- package/dist/esm/chunk-H5G7UECV.js +2 -0
- package/dist/esm/chunk-H5G7UECV.js.map +7 -0
- package/dist/esm/chunk-I4FLQELQ.js +2 -0
- package/dist/esm/chunk-I4FLQELQ.js.map +7 -0
- package/dist/esm/chunk-JYQGCXXI.js +2 -0
- package/dist/esm/chunk-JYQGCXXI.js.map +7 -0
- package/dist/esm/chunk-KA5UE2VN.js +2 -0
- package/dist/esm/chunk-KA5UE2VN.js.map +7 -0
- package/dist/esm/{chunk-T62PRLPN.js → chunk-KEGCX5VM.js} +2 -2
- package/dist/esm/chunk-KVHKPUZ2.js +2 -0
- package/dist/esm/chunk-KVHKPUZ2.js.map +7 -0
- package/dist/esm/chunk-M7I6ISPL.js +2 -0
- package/dist/esm/chunk-M7I6ISPL.js.map +7 -0
- package/dist/esm/chunk-MYYXOFU5.js +1 -0
- package/dist/esm/{chunk-FFG32ERA.js → chunk-N3WBEQWL.js} +3 -3
- package/dist/esm/chunk-N3WBEQWL.js.map +7 -0
- package/dist/esm/{chunk-HKPXDQ2B.js → chunk-NC3CJUE3.js} +2 -2
- package/dist/esm/chunk-P2MV6HLA.js +2 -0
- package/dist/esm/{chunk-7SS4UUJH.js.map → chunk-P2MV6HLA.js.map} +3 -3
- package/dist/esm/chunk-PALE5UWK.js +2 -0
- package/dist/esm/{chunk-DSPYHO3L.js.map → chunk-PALE5UWK.js.map} +2 -2
- package/dist/esm/chunk-PDMCLVYT.js +2 -0
- package/dist/esm/chunk-PDMCLVYT.js.map +7 -0
- package/dist/esm/chunk-PM6QY3JO.js +2 -0
- package/dist/esm/{chunk-TJL47GIO.js.map → chunk-PM6QY3JO.js.map} +3 -3
- package/dist/esm/chunk-RKZVXVBN.js +2 -0
- package/dist/esm/chunk-RKZVXVBN.js.map +7 -0
- package/dist/esm/chunk-TXQZ5HLV.js +2 -0
- package/dist/esm/chunk-TXQZ5HLV.js.map +7 -0
- package/dist/esm/chunk-UKASIY6M.js +2 -0
- package/dist/esm/chunk-UKASIY6M.js.map +7 -0
- package/dist/esm/{chunk-OJQNLROL.js → chunk-UY6WJUNA.js} +2 -2
- package/dist/esm/chunk-V5O3TF57.js +2 -0
- package/dist/esm/{chunk-3KQE2PSJ.js.map → chunk-V5O3TF57.js.map} +3 -3
- package/dist/esm/chunk-VUNCI6A6.js +2 -0
- package/dist/esm/chunk-VUNCI6A6.js.map +7 -0
- package/dist/esm/{chunk-JBHRV364.js → chunk-VUPIJNG2.js} +2 -2
- package/dist/esm/chunk-W6BN5QLH.js +2 -0
- package/dist/esm/{chunk-ZNDCZM5A.js.map → chunk-W6BN5QLH.js.map} +2 -2
- package/dist/esm/chunk-WG5ORTIW.js +2 -0
- package/dist/esm/chunk-WG5ORTIW.js.map +7 -0
- package/dist/esm/chunk-WMVR2XBR.js +2 -0
- package/dist/esm/{chunk-XKSU3NLG.js.map → chunk-WMVR2XBR.js.map} +2 -2
- package/dist/esm/{chunk-NNZTSXKH.js → chunk-WX7SX5BN.js} +2 -2
- package/dist/esm/chunk-XOACTIBL.js +2 -0
- package/dist/esm/chunk-XOACTIBL.js.map +7 -0
- package/dist/esm/components/_internal/base-button.d.ts +11 -1
- package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/_internal/menu-context.d.ts +2 -0
- package/dist/esm/components/_internal/menu-context.d.ts.map +1 -1
- package/dist/esm/components/_internal/menu-context.js +1 -1
- package/dist/esm/components/_internal/pane-chrome.d.ts +17 -2
- package/dist/esm/components/_internal/pane-chrome.d.ts.map +1 -1
- package/dist/esm/components/_internal/pane-chrome.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/accordion.d.ts +2 -2
- package/dist/esm/components/accordion.d.ts.map +1 -1
- package/dist/esm/components/accordion.js +1 -1
- package/dist/esm/components/alert-dialog.d.ts.map +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/avatar.d.ts +1 -1
- package/dist/esm/components/avatar.d.ts.map +1 -1
- package/dist/esm/components/avatar.js +1 -1
- package/dist/esm/components/avatar.props.d.ts +8 -0
- package/dist/esm/components/avatar.props.d.ts.map +1 -1
- package/dist/esm/components/avatar.props.js +1 -1
- package/dist/esm/components/blockquote.d.ts +1 -1
- package/dist/esm/components/blockquote.d.ts.map +1 -1
- package/dist/esm/components/blockquote.js +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/chatbar.d.ts.map +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/checkbox-group.d.ts.map +1 -1
- package/dist/esm/components/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox-group.primitive.d.ts +12 -5
- package/dist/esm/components/checkbox-group.primitive.d.ts.map +1 -1
- package/dist/esm/components/checkbox-group.primitive.js +1 -1
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/chip.d.ts.map +1 -1
- package/dist/esm/components/chip.js +1 -1
- package/dist/esm/components/code.d.ts.map +1 -1
- package/dist/esm/components/code.js +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/context-menu.d.ts.map +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/dialog.d.ts +1 -1
- package/dist/esm/components/dialog.d.ts.map +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/icons.d.ts +3 -1
- package/dist/esm/components/icons.d.ts.map +1 -1
- package/dist/esm/components/icons.js +1 -1
- package/dist/esm/components/image.d.ts +23 -0
- package/dist/esm/components/image.d.ts.map +1 -0
- package/dist/esm/components/image.js +2 -0
- package/dist/esm/components/image.js.map +7 -0
- package/dist/esm/components/image.props.d.ts +19 -0
- package/dist/esm/components/image.props.d.ts.map +1 -0
- package/dist/esm/components/image.props.js +2 -0
- package/dist/esm/components/image.props.js.map +7 -0
- package/dist/esm/components/index.d.ts +2 -1
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/message-scroller.d.ts.map +1 -1
- package/dist/esm/components/message-scroller.js +1 -1
- package/dist/esm/components/navbar.d.ts.map +1 -1
- package/dist/esm/components/navbar.js +1 -1
- package/dist/esm/components/notice.d.ts +4 -1
- package/dist/esm/components/notice.d.ts.map +1 -1
- package/dist/esm/components/notice.js +1 -1
- package/dist/esm/components/progress.d.ts.map +1 -1
- package/dist/esm/components/progress.js +1 -1
- package/dist/esm/components/schemas/button.schema.d.ts +2 -2
- package/dist/esm/components/schemas/toggle.schema.d.ts +1 -1
- package/dist/esm/components/scroll-area.d.ts +3 -1
- package/dist/esm/components/scroll-area.d.ts.map +1 -1
- package/dist/esm/components/scroll-area.js +1 -1
- package/dist/esm/components/segmented-control.d.ts +3 -1
- package/dist/esm/components/segmented-control.d.ts.map +1 -1
- package/dist/esm/components/segmented-control.js +1 -1
- package/dist/esm/components/select.d.ts +1 -2
- package/dist/esm/components/select.d.ts.map +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/separator.d.ts.map +1 -1
- package/dist/esm/components/separator.js +1 -1
- package/dist/esm/components/sheet.d.ts +1 -0
- package/dist/esm/components/sheet.d.ts.map +1 -1
- package/dist/esm/components/sheet.js +1 -1
- package/dist/esm/components/shell.d.ts +12 -1
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/sidebar.d.ts.map +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/slider.d.ts.map +1 -1
- package/dist/esm/components/slider.js +1 -1
- package/dist/esm/components/spinner.d.ts.map +1 -1
- package/dist/esm/components/spinner.js +1 -1
- package/dist/esm/components/table.d.ts.map +1 -1
- package/dist/esm/components/table.js +1 -1
- package/dist/esm/components/tabs.d.ts.map +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/text-area.js +1 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/toggle.d.ts +3 -2
- package/dist/esm/components/toggle.d.ts.map +1 -1
- package/dist/esm/components/toggle.js +1 -1
- package/dist/esm/components/toolbar.d.ts +80 -8
- package/dist/esm/components/toolbar.d.ts.map +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/virtual-menu.d.ts +3 -5
- package/dist/esm/components/virtual-menu.d.ts.map +1 -1
- package/dist/esm/components/virtual-menu.js +1 -1
- package/dist/esm/helpers/extract-margin-props.d.ts +7 -7
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/use-scroll-edges.d.ts +4 -2
- package/dist/esm/hooks/use-scroll-edges.d.ts.map +1 -1
- package/dist/esm/hooks/use-scroll-edges.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/index.js +1 -1
- package/package.json +1 -1
- package/src/components/_internal/base-button.css +6 -0
- package/src/components/_internal/base-button.tsx +56 -17
- package/src/components/_internal/base-sidebar-menu.css +8 -0
- package/src/components/_internal/menu-context.tsx +11 -0
- package/src/components/_internal/pane-chrome.tsx +45 -8
- package/src/components/accordion.css +35 -4
- package/src/components/accordion.tsx +12 -16
- package/src/components/alert-dialog.tsx +59 -161
- package/src/components/avatar.props.tsx +6 -0
- package/src/components/avatar.tsx +57 -71
- package/src/components/blockquote.tsx +8 -9
- package/src/components/chatbar.tsx +27 -20
- package/src/components/checkbox-group.primitive.tsx +40 -51
- package/src/components/checkbox-group.tsx +1 -9
- package/src/components/chip.css +18 -20
- package/src/components/chip.tsx +3 -4
- package/src/components/code.tsx +3 -2
- package/src/components/combobox.css +13 -0
- package/src/components/context-menu.tsx +23 -5
- package/src/components/dialog.tsx +59 -160
- package/src/components/dropdown-menu.tsx +8 -5
- package/src/components/icons.tsx +11 -1
- package/src/components/image.css +33 -0
- package/src/components/image.props.ts +18 -0
- package/src/components/image.tsx +71 -0
- package/src/components/index.css +1 -0
- package/src/components/index.tsx +8 -0
- package/src/components/message-scroller.tsx +48 -26
- package/src/components/navbar.tsx +34 -69
- package/src/components/notice.tsx +6 -3
- package/src/components/progress.tsx +6 -3
- package/src/components/scroll-area.css +28 -2
- package/src/components/scroll-area.tsx +49 -3
- package/src/components/segmented-control.css +8 -130
- package/src/components/segmented-control.tsx +36 -5
- package/src/components/select.tsx +100 -32
- package/src/components/separator.tsx +13 -1
- package/src/components/sheet.css +7 -6
- package/src/components/sheet.tsx +76 -143
- package/src/components/shell.css +26 -0
- package/src/components/shell.tsx +29 -8
- package/src/components/sidebar.tsx +27 -16
- package/src/components/slider.css +1 -0
- package/src/components/slider.tsx +54 -44
- package/src/components/spinner.css +19 -1
- package/src/components/spinner.tsx +21 -11
- package/src/components/table.tsx +18 -5
- package/src/components/tabs.css +34 -0
- package/src/components/tabs.tsx +0 -2
- package/src/components/text-area.css +2 -1
- package/src/components/text-area.tsx +1 -1
- package/src/components/text-field.tsx +1 -1
- package/src/components/toggle.tsx +21 -39
- package/src/components/toolbar.css +34 -0
- package/src/components/toolbar.tsx +432 -23
- package/src/components/virtual-menu.tsx +110 -37
- package/src/hooks/use-scroll-edges.ts +11 -2
- package/src/styles/tokens/color.css +1 -22
- package/src/styles/utilities/truncate.css +10 -0
- package/styles.css +252 -208
- package/tokens/base.css +0 -21
- package/tokens.css +0 -21
- package/utilities.css +5 -0
- package/dist/esm/chunk-23KT3D2Z.js +0 -2
- package/dist/esm/chunk-3JA7SJDT.js +0 -2
- package/dist/esm/chunk-3JA7SJDT.js.map +0 -7
- package/dist/esm/chunk-3KQE2PSJ.js +0 -2
- package/dist/esm/chunk-3YWVE5GL.js +0 -2
- package/dist/esm/chunk-3YWVE5GL.js.map +0 -7
- package/dist/esm/chunk-5BWLY27A.js +0 -2
- package/dist/esm/chunk-5BWLY27A.js.map +0 -7
- package/dist/esm/chunk-6CK7UTNH.js +0 -2
- package/dist/esm/chunk-6CK7UTNH.js.map +0 -7
- package/dist/esm/chunk-6RK26HIY.js +0 -2
- package/dist/esm/chunk-6RK26HIY.js.map +0 -7
- package/dist/esm/chunk-7ESWH773.js +0 -2
- package/dist/esm/chunk-7ESWH773.js.map +0 -7
- package/dist/esm/chunk-7SS4UUJH.js +0 -2
- package/dist/esm/chunk-A3YQIJDA.js +0 -2
- package/dist/esm/chunk-A3YQIJDA.js.map +0 -7
- package/dist/esm/chunk-AB3QCCUM.js +0 -2
- package/dist/esm/chunk-AB3QCCUM.js.map +0 -7
- package/dist/esm/chunk-BEP4AH5V.js +0 -2
- package/dist/esm/chunk-BEP4AH5V.js.map +0 -7
- package/dist/esm/chunk-D3U4MWDZ.js +0 -1
- package/dist/esm/chunk-DBROSD2J.js +0 -2
- package/dist/esm/chunk-DBROSD2J.js.map +0 -7
- package/dist/esm/chunk-DSPYHO3L.js +0 -2
- package/dist/esm/chunk-E2D2VWUI.js +0 -2
- package/dist/esm/chunk-E2D2VWUI.js.map +0 -7
- package/dist/esm/chunk-EMNSA65L.js +0 -2
- package/dist/esm/chunk-EMNSA65L.js.map +0 -7
- package/dist/esm/chunk-FFG32ERA.js.map +0 -7
- package/dist/esm/chunk-FHPHEIYJ.js +0 -2
- package/dist/esm/chunk-FHPHEIYJ.js.map +0 -7
- package/dist/esm/chunk-FJFBM7HW.js +0 -2
- package/dist/esm/chunk-FJFBM7HW.js.map +0 -7
- package/dist/esm/chunk-HIKMKGPT.js +0 -2
- package/dist/esm/chunk-HIKMKGPT.js.map +0 -7
- package/dist/esm/chunk-IJRBX6EV.js +0 -2
- package/dist/esm/chunk-IJRBX6EV.js.map +0 -7
- package/dist/esm/chunk-KMDXIZAG.js +0 -2
- package/dist/esm/chunk-KMDXIZAG.js.map +0 -7
- package/dist/esm/chunk-LC5AK2ZD.js +0 -2
- package/dist/esm/chunk-LC5AK2ZD.js.map +0 -7
- package/dist/esm/chunk-LHIS3UKQ.js +0 -2
- package/dist/esm/chunk-LHIS3UKQ.js.map +0 -7
- package/dist/esm/chunk-NLXJZJNN.js +0 -2
- package/dist/esm/chunk-NLXJZJNN.js.map +0 -7
- package/dist/esm/chunk-QOHJIF25.js +0 -2
- package/dist/esm/chunk-QOHJIF25.js.map +0 -7
- package/dist/esm/chunk-R4XJNQX5.js +0 -2
- package/dist/esm/chunk-R4XJNQX5.js.map +0 -7
- package/dist/esm/chunk-TJL47GIO.js +0 -2
- package/dist/esm/chunk-V32EP3S7.js +0 -2
- package/dist/esm/chunk-V32EP3S7.js.map +0 -7
- package/dist/esm/chunk-WKSXMFFF.js +0 -2
- package/dist/esm/chunk-WKSXMFFF.js.map +0 -7
- package/dist/esm/chunk-XKSU3NLG.js +0 -2
- package/dist/esm/chunk-Y3JYEEFB.js +0 -2
- package/dist/esm/chunk-YK3ZUMRQ.js +0 -2
- package/dist/esm/chunk-YK3ZUMRQ.js.map +0 -7
- package/dist/esm/chunk-YZM54IJE.js +0 -2
- package/dist/esm/chunk-YZM54IJE.js.map +0 -7
- package/dist/esm/chunk-ZJI2IK7C.js +0 -2
- package/dist/esm/chunk-ZJI2IK7C.js.map +0 -7
- package/dist/esm/chunk-ZNDCZM5A.js +0 -2
- /package/dist/esm/{chunk-T62PRLPN.js.map → chunk-KEGCX5VM.js.map} +0 -0
- /package/dist/esm/{chunk-D3U4MWDZ.js.map → chunk-MYYXOFU5.js.map} +0 -0
- /package/dist/esm/{chunk-HKPXDQ2B.js.map → chunk-NC3CJUE3.js.map} +0 -0
- /package/dist/esm/{chunk-OJQNLROL.js.map → chunk-UY6WJUNA.js.map} +0 -0
- /package/dist/esm/{chunk-JBHRV364.js.map → chunk-VUPIJNG2.js.map} +0 -0
- /package/dist/esm/{chunk-NNZTSXKH.js.map → chunk-WX7SX5BN.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';
|
|
|
6
6
|
import { baseButtonPropDefs } from './base-button.props.js';
|
|
7
7
|
import { Flex } from '../flex.js';
|
|
8
8
|
import { Spinner } from '../spinner.js';
|
|
9
|
-
import {
|
|
9
|
+
import { TickIcon } from '../icons.js';
|
|
10
10
|
import { extractProps } from '../../helpers/extract-props.js';
|
|
11
11
|
import { useThemeSizeProps } from '../../helpers/theme-size.js';
|
|
12
12
|
|
|
@@ -25,7 +25,19 @@ type PolymorphicBaseButtonProps<C extends React.ElementType = 'button'> = {
|
|
|
25
25
|
/** Element type to render as (e.g., 'a', 'span', etc.) */
|
|
26
26
|
as?: C;
|
|
27
27
|
} & BaseButtonOwnProps &
|
|
28
|
-
|
|
28
|
+
BaseButtonDoneProps &
|
|
29
|
+
ComponentPropsWithout<C, RemovedProps | keyof BaseButtonOwnProps | 'as' | 'done'>;
|
|
30
|
+
|
|
31
|
+
interface BaseButtonDoneProps {
|
|
32
|
+
/**
|
|
33
|
+
* Shows a tick in place of the icon to say that the action finished. The tick takes the
|
|
34
|
+
* icon's box, so nothing moves, and the icon comes back as soon as `done` is false again. On
|
|
35
|
+
* an `iconOnly` button the tick replaces the content. It doesn't block the press. Screen
|
|
36
|
+
* readers don't announce the tick, so also change the label or `aria-label` (for example,
|
|
37
|
+
* `Copy` to `Copied`).
|
|
38
|
+
*/
|
|
39
|
+
done?: boolean;
|
|
40
|
+
}
|
|
29
41
|
|
|
30
42
|
/**
|
|
31
43
|
* BaseButton props interface that combines all available props
|
|
@@ -68,6 +80,7 @@ const BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProp
|
|
|
68
80
|
color,
|
|
69
81
|
radius,
|
|
70
82
|
disabled: nativeDisabled,
|
|
83
|
+
done = false,
|
|
71
84
|
...baseButtonProps
|
|
72
85
|
} = extractProps(props, baseButtonPropDefs);
|
|
73
86
|
|
|
@@ -102,13 +115,7 @@ const BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProp
|
|
|
102
115
|
const content =
|
|
103
116
|
asChild && React.isValidElement(children) ? (children.props as { children?: React.ReactNode }).children : children;
|
|
104
117
|
// Fragments are see-through: their own first and last children are the edges.
|
|
105
|
-
const
|
|
106
|
-
React.Children.toArray(nodes).flatMap((node) =>
|
|
107
|
-
React.isValidElement(node) && node.type === React.Fragment
|
|
108
|
-
? flatten((node.props as { children?: React.ReactNode }).children)
|
|
109
|
-
: [node],
|
|
110
|
-
);
|
|
111
|
-
const items = flatten(content);
|
|
118
|
+
const items = flattenFragments(content);
|
|
112
119
|
const isIcon = (node: React.ReactNode) => React.isValidElement(node) && node.type === 'svg';
|
|
113
120
|
return { iconStart: isIcon(items[0]), iconEnd: isIcon(items[items.length - 1]) };
|
|
114
121
|
}, [asChild, children]);
|
|
@@ -117,14 +124,35 @@ const BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProp
|
|
|
117
124
|
const composedRef = useComposedRefs(forwardedRef, elementRef as React.Ref<BaseButtonElement>);
|
|
118
125
|
useLayoutEffect(() => {
|
|
119
126
|
const element = elementRef.current;
|
|
120
|
-
// While loading the label sits in a wrapper
|
|
121
|
-
|
|
127
|
+
// While loading the label sits in a wrapper, and while done the tick stands at the start;
|
|
128
|
+
// keep the edges read before either.
|
|
129
|
+
if (!element || loading || done) return;
|
|
122
130
|
const iconStart = edgeIsSvg(element, 'start');
|
|
123
131
|
const iconEnd = edgeIsSvg(element, 'end');
|
|
124
132
|
setDomEdges((prev) => (prev && prev.iconStart === iconStart && prev.iconEnd === iconEnd ? prev : { iconStart, iconEnd }));
|
|
125
133
|
});
|
|
126
134
|
const { iconStart, iconEnd } = domEdges ?? childEdges;
|
|
127
135
|
|
|
136
|
+
// Done swaps the icon for a tick in the same place: the leading icon when there is one, the
|
|
137
|
+
// whole content on an icon-only button. Without a leading icon the tick goes before the label.
|
|
138
|
+
const iconOnly = Boolean((baseButtonProps as Record<string, unknown>)['data-icon-only']);
|
|
139
|
+
const content = React.useMemo(() => {
|
|
140
|
+
if (!done) return children;
|
|
141
|
+
const tick = <TickIcon key="kui-done-tick" className="kui-BaseButtonTick" aria-hidden />;
|
|
142
|
+
const swap = (nodes: React.ReactNode): React.ReactNode => {
|
|
143
|
+
if (iconOnly) return tick;
|
|
144
|
+
const items = flattenFragments(nodes);
|
|
145
|
+
const first = items.findIndex((node) => !(typeof node === 'string' && !node.trim()));
|
|
146
|
+
if (iconStart && first !== -1) return items.map((node, index) => (index === first ? tick : node));
|
|
147
|
+
return [tick, ...items];
|
|
148
|
+
};
|
|
149
|
+
if (asChild && React.isValidElement(children)) {
|
|
150
|
+
const element = children as React.ReactElement<{ children?: React.ReactNode }>;
|
|
151
|
+
return React.cloneElement(element, undefined, swap(element.props.children));
|
|
152
|
+
}
|
|
153
|
+
return swap(children);
|
|
154
|
+
}, [done, children, iconOnly, iconStart, asChild]);
|
|
155
|
+
|
|
128
156
|
// asChild takes precedence over as prop for Radix Slot integration
|
|
129
157
|
// When asChild is true, we use Slot.Root to merge props onto the child element
|
|
130
158
|
// When asChild is false, we render as the specified element (or button by default)
|
|
@@ -168,6 +196,7 @@ const BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProp
|
|
|
168
196
|
data-radius={radius}
|
|
169
197
|
data-icon-start={iconStart || undefined}
|
|
170
198
|
data-icon-end={iconEnd || undefined}
|
|
199
|
+
data-done={done || undefined}
|
|
171
200
|
{...baseButtonProps}
|
|
172
201
|
{...accessibilityProps}
|
|
173
202
|
// After the spread: `data-disabled` styles `<Button asChild disabled>`, and a wrapping
|
|
@@ -186,19 +215,20 @@ const BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProp
|
|
|
186
215
|
* The button is a flex container with a `gap`, so we use `display: contents` to ensure the correct flex layout.
|
|
187
216
|
*
|
|
188
217
|
* However, `display: contents` removes the content from the accessibility tree in some browsers,
|
|
189
|
-
* so we force remove it with `aria-hidden` and re-add it in the tree with `
|
|
218
|
+
* so we force remove it with `aria-hidden` and re-add it in the tree with a `kui-sr-only` copy.
|
|
219
|
+
* Both are classes, not style attributes, so a loading button carries no inline style.
|
|
190
220
|
*/}
|
|
191
|
-
<span
|
|
192
|
-
{
|
|
221
|
+
<span className="kui-BaseButtonContent" aria-hidden>
|
|
222
|
+
{content}
|
|
193
223
|
</span>
|
|
194
224
|
|
|
195
225
|
{/* The label stays the name; the hidden "Loading" only describes (aria-describedby reads hidden text). */}
|
|
196
|
-
<
|
|
226
|
+
<span className="kui-sr-only">
|
|
197
227
|
<span id={describedById} aria-hidden>
|
|
198
228
|
Loading
|
|
199
229
|
</span>
|
|
200
230
|
{children}
|
|
201
|
-
</
|
|
231
|
+
</span>
|
|
202
232
|
|
|
203
233
|
{/* Centered spinner overlay during loading state */}
|
|
204
234
|
<Flex asChild align="center" justify="center" position="absolute" inset="0">
|
|
@@ -208,13 +238,22 @@ const BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProp
|
|
|
208
238
|
</Flex>
|
|
209
239
|
</>
|
|
210
240
|
) : (
|
|
211
|
-
|
|
241
|
+
content
|
|
212
242
|
)}
|
|
213
243
|
</Comp>
|
|
214
244
|
);
|
|
215
245
|
});
|
|
216
246
|
BaseButton.displayName = 'BaseButton';
|
|
217
247
|
|
|
248
|
+
/** The child list with fragments opened up: a fragment's own children are the edges. */
|
|
249
|
+
function flattenFragments(nodes: React.ReactNode): React.ReactNode[] {
|
|
250
|
+
return React.Children.toArray(nodes).flatMap((node) =>
|
|
251
|
+
React.isValidElement(node) && node.type === React.Fragment
|
|
252
|
+
? flattenFragments((node.props as { children?: React.ReactNode }).children)
|
|
253
|
+
: [node],
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
218
257
|
/** Whether the first or last rendered node of `element` (blank text and comments skipped) is an svg. */
|
|
219
258
|
function edgeIsSvg(element: Element, edge: 'start' | 'end'): boolean {
|
|
220
259
|
let node = edge === 'start' ? element.firstChild : element.lastChild;
|
|
@@ -185,3 +185,11 @@
|
|
|
185
185
|
margin-top: 1px;
|
|
186
186
|
margin-bottom: 1px;
|
|
187
187
|
}
|
|
188
|
+
|
|
189
|
+
/* A sub-menu's rows are list items, so their list is a list. Zero specificity: only the UA's
|
|
190
|
+
list indent is removed. */
|
|
191
|
+
:where(.kui-SidebarMenuSubList) {
|
|
192
|
+
list-style: none;
|
|
193
|
+
margin-block: 0;
|
|
194
|
+
padding: 0;
|
|
195
|
+
}
|
|
@@ -61,3 +61,14 @@ export function MenuProvider({ children, size }: MenuProviderProps) {
|
|
|
61
61
|
export function useMenuContext() {
|
|
62
62
|
return React.useContext(MenuContext);
|
|
63
63
|
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Closes the whole menu from inside it. DropdownMenu.Root and ContextMenu.Root provide it,
|
|
67
|
+
* so a VirtualMenu row can close the menu on select the way a menu item does.
|
|
68
|
+
*/
|
|
69
|
+
const MenuCloseContext = React.createContext<(() => void) | undefined>(undefined);
|
|
70
|
+
export const MenuCloseProvider = MenuCloseContext.Provider;
|
|
71
|
+
|
|
72
|
+
export function useMenuClose() {
|
|
73
|
+
return React.useContext(MenuCloseContext);
|
|
74
|
+
}
|
|
@@ -13,6 +13,7 @@ import * as React from 'react';
|
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
|
|
15
15
|
import { ScrollArea } from '../scroll-area.js';
|
|
16
|
+
import { ShellStoreContext } from './shell-store.js';
|
|
16
17
|
|
|
17
18
|
type PaneSize = '1' | '2' | '3';
|
|
18
19
|
|
|
@@ -33,6 +34,13 @@ function useSidebarVisual() {
|
|
|
33
34
|
/** The Shell's index. `Shell.Root size` sets it; panes hand it to their chrome. */
|
|
34
35
|
const ShellSizeContext = React.createContext<PaneSize>('2');
|
|
35
36
|
|
|
37
|
+
/**
|
|
38
|
+
* True inside `Shell.Content`. `Shell.Root` sets it back to false, so a Shell nested in the
|
|
39
|
+
* content gets pane chrome in its own panes. Read by `Shell.Scroll`: in the content it holds a
|
|
40
|
+
* page, not a menu, so it takes none of the menu's padding, gap or layering.
|
|
41
|
+
*/
|
|
42
|
+
const ShellContentContext = React.createContext(false);
|
|
43
|
+
|
|
36
44
|
/**
|
|
37
45
|
* Gives a Shell pane's children the Shell's index, so Sidebar parts size themselves. In a Rail
|
|
38
46
|
* the rows are `thin`: icon tiles with a small label, sub-menus as dropdowns.
|
|
@@ -60,12 +68,11 @@ type BandSize = '1' | '2' | '3' | '4';
|
|
|
60
68
|
*/
|
|
61
69
|
const BAND_STEP = { '1': '2', '2': '3', '3': '4', '4': '4' } as const satisfies Record<BandSize, BandSize>;
|
|
62
70
|
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
71
|
+
/**
|
|
72
|
+
* Set by `Shell.PaneHeader` and `Shell.PaneFooter` to their band size, and by `Shell.Scroll` to
|
|
73
|
+
* null (a scrolling list has no band). Unset (`undefined`) everywhere else.
|
|
74
|
+
*/
|
|
75
|
+
const PaneBandSizeContext = React.createContext<BandSize | null | undefined>(undefined);
|
|
69
76
|
|
|
70
77
|
function useBandSize(): BandSize {
|
|
71
78
|
const visual = useSidebarVisual();
|
|
@@ -73,6 +80,22 @@ function useBandSize(): BandSize {
|
|
|
73
80
|
return BAND_STEP[visual?.size ?? shellSize];
|
|
74
81
|
}
|
|
75
82
|
|
|
83
|
+
/**
|
|
84
|
+
* The size a Toolbar with no `size` of its own rests at, or null for none.
|
|
85
|
+
*
|
|
86
|
+
* In a pane's header or footer it is that band's size. Anywhere else inside a Shell, such as
|
|
87
|
+
* `Shell.Content` or a pane's body, it is the same step: one above the Shell's index, so a
|
|
88
|
+
* toolbar in the content area matches the ones in the pane headers beside it (v2 sizes every
|
|
89
|
+
* toolbar this way). A pane's scrolling list, and anything outside a Shell, has none.
|
|
90
|
+
*/
|
|
91
|
+
function usePaneBandSize(): BandSize | null {
|
|
92
|
+
const band = React.useContext(PaneBandSizeContext);
|
|
93
|
+
const inShell = React.useContext(ShellStoreContext) !== null;
|
|
94
|
+
const step = useBandSize();
|
|
95
|
+
if (band !== undefined) return band;
|
|
96
|
+
return inShell ? step : null;
|
|
97
|
+
}
|
|
98
|
+
|
|
76
99
|
interface PaneHeaderProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
77
100
|
/**
|
|
78
101
|
* Floats the row over the top of `Shell.Scroll`, so the list scrolls behind it. The list
|
|
@@ -129,10 +152,24 @@ interface ScrollProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
|
129
152
|
|
|
130
153
|
/**
|
|
131
154
|
* The one region of a pane that scrolls; it takes the room the header and footer leave.
|
|
132
|
-
*
|
|
155
|
+
* In `Shell.Content` it is the page's scroller, and a `Shell.PaneHeader float` beside it pins
|
|
156
|
+
* the page's toolbar over it. It is not a landmark: for navigation, pass `role="navigation"` and an `aria-label`.
|
|
133
157
|
*/
|
|
134
158
|
const Scroll = React.forwardRef<HTMLDivElement, ScrollProps>(({ className, children, fade = false, ...props }, forwardedRef) => {
|
|
135
159
|
const chrome = useChromeClasses();
|
|
160
|
+
// A Sidebar.Root inside the content still gets a menu.
|
|
161
|
+
const contentPane = React.useContext(ShellContentContext);
|
|
162
|
+
const visual = useSidebarVisual();
|
|
163
|
+
const inContent = contentPane && visual === null;
|
|
164
|
+
if (inContent) {
|
|
165
|
+
return (
|
|
166
|
+
<ScrollArea type="hover" fade={fade} className="kui-ShellScroll">
|
|
167
|
+
<div {...props} ref={forwardedRef} className={classNames('kui-ShellScrollContent', className)}>
|
|
168
|
+
{children}
|
|
169
|
+
</div>
|
|
170
|
+
</ScrollArea>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
136
173
|
return (
|
|
137
174
|
<ScrollArea type="hover" fade={fade} className="kui-ShellScroll">
|
|
138
175
|
<div {...props} ref={forwardedRef} className={classNames('kui-BaseMenuContent', 'kui-SidebarContent', ...chrome, className)}>
|
|
@@ -146,5 +183,5 @@ const Scroll = React.forwardRef<HTMLDivElement, ScrollProps>(({ className, child
|
|
|
146
183
|
});
|
|
147
184
|
Scroll.displayName = 'Shell.Scroll';
|
|
148
185
|
|
|
149
|
-
export { SidebarVisualContext, useSidebarVisual, ShellSizeContext, PaneChromeScope, PaneHeader, PaneFooter, Scroll, BAND_STEP, usePaneBandSize };
|
|
186
|
+
export { SidebarVisualContext, useSidebarVisual, ShellSizeContext, ShellContentContext, PaneChromeScope, PaneHeader, PaneFooter, Scroll, BAND_STEP, usePaneBandSize };
|
|
150
187
|
export type { SidebarVisualContextValue, PaneSize, BandSize, PaneHeaderProps, PaneFooterProps, ScrollProps };
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
border-radius: var(--radius-surface-1);
|
|
13
13
|
}
|
|
14
14
|
&:where(.kui-r-size-2) {
|
|
15
|
-
border-radius: var(--radius-surface-
|
|
15
|
+
border-radius: var(--radius-surface-2);
|
|
16
16
|
}
|
|
17
17
|
&:where(.kui-r-size-3) {
|
|
18
|
-
border-radius: var(--radius-surface-
|
|
18
|
+
border-radius: var(--radius-surface-3);
|
|
19
19
|
}
|
|
20
20
|
&:where(.kui-r-size-4) {
|
|
21
|
-
border-radius: var(--radius-surface-
|
|
21
|
+
border-radius: var(--radius-surface-4);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -100,6 +100,38 @@
|
|
|
100
100
|
font-size: var(--font-size-4);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/* Disclosure chevron: at the far end of the trigger, turned up while the section is open */
|
|
104
|
+
.kui-AccordionChevron {
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
width: var(--icon-size-2);
|
|
107
|
+
height: var(--icon-size-2);
|
|
108
|
+
margin-inline-start: var(--space-3);
|
|
109
|
+
color: var(--neutral-a11);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:where(.kui-AccordionTrigger[data-state='open']) .kui-AccordionChevron {
|
|
113
|
+
rotate: 180deg;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:where(.kui-AccordionRoot:where(.kui-r-size-1)) .kui-AccordionChevron {
|
|
117
|
+
width: var(--icon-size-1);
|
|
118
|
+
height: var(--icon-size-1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:where(.kui-AccordionRoot:where(.kui-r-size-3)) .kui-AccordionChevron {
|
|
122
|
+
width: var(--icon-size-3);
|
|
123
|
+
height: var(--icon-size-3);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:where(.kui-AccordionRoot:where(.kui-r-size-4)) .kui-AccordionChevron {
|
|
127
|
+
width: var(--icon-size-4);
|
|
128
|
+
height: var(--icon-size-4);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:where(.kui-AccordionTrigger[data-disabled]) .kui-AccordionChevron {
|
|
132
|
+
color: inherit;
|
|
133
|
+
}
|
|
134
|
+
|
|
103
135
|
/* Trigger hover states */
|
|
104
136
|
@media (hover: hover) {
|
|
105
137
|
:where(.kui-AccordionTrigger:hover) {
|
|
@@ -186,7 +218,6 @@
|
|
|
186
218
|
color: var(--accent-ink);
|
|
187
219
|
line-height: var(--line-height-4);
|
|
188
220
|
transform-origin: top;
|
|
189
|
-
will-change: height, opacity, transform;
|
|
190
221
|
}
|
|
191
222
|
|
|
192
223
|
.kui-AccordionContentInner {
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
accordionTriggerPropDefs,
|
|
10
10
|
accordionContentPropDefs,
|
|
11
11
|
} from './accordion.props.js';
|
|
12
|
+
import { ChevronDownIcon } from './icons.js';
|
|
13
|
+
import { Slottable } from './slot.js';
|
|
12
14
|
import { extractProps } from '../helpers/extract-props.js';
|
|
13
15
|
import { useThemeSizeProps } from '../helpers/theme-size.js';
|
|
14
16
|
|
|
@@ -23,9 +25,13 @@ import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-p
|
|
|
23
25
|
|
|
24
26
|
// Root component
|
|
25
27
|
type AccordionRootElement = React.ElementRef<typeof AccordionPrimitive.Root>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
// Radix's Root props are a union of single and multiple. Omit each member on its own, so
|
|
29
|
+
// `defaultValue`, `value` and `collapsible` survive with the right type for each `type`.
|
|
30
|
+
type AccordionRootRadixProps =
|
|
31
|
+
| Omit<AccordionPrimitive.AccordionSingleProps, 'asChild' | 'color'>
|
|
32
|
+
| Omit<AccordionPrimitive.AccordionMultipleProps, 'asChild' | 'color'>;
|
|
33
|
+
|
|
34
|
+
type AccordionRootProps = AccordionRootRadixProps & AccordionRootOwnProps;
|
|
29
35
|
|
|
30
36
|
const AccordionRoot = React.forwardRef<AccordionRootElement, AccordionRootProps>(
|
|
31
37
|
(ownProps, forwardedRef) => {
|
|
@@ -133,23 +139,14 @@ const AccordionTrigger = React.forwardRef<AccordionTriggerElement, AccordionTrig
|
|
|
133
139
|
({ children, ...props }, forwardedRef) => {
|
|
134
140
|
const { className, ...triggerProps } = extractProps(props, accordionTriggerPropDefs);
|
|
135
141
|
|
|
136
|
-
// Radix UI handles focus management automatically
|
|
137
|
-
const triggerRef = React.useRef<HTMLButtonElement>(null);
|
|
138
|
-
|
|
139
142
|
return (
|
|
140
143
|
<AccordionPrimitive.Trigger
|
|
141
144
|
{...triggerProps}
|
|
142
|
-
ref={
|
|
143
|
-
triggerRef.current = node;
|
|
144
|
-
if (typeof forwardedRef === 'function') {
|
|
145
|
-
forwardedRef(node);
|
|
146
|
-
} else if (forwardedRef) {
|
|
147
|
-
forwardedRef.current = node;
|
|
148
|
-
}
|
|
149
|
-
}}
|
|
145
|
+
ref={forwardedRef}
|
|
150
146
|
className={classNames('kui-AccordionTrigger', className)}
|
|
151
147
|
>
|
|
152
|
-
{children}
|
|
148
|
+
<Slottable>{children}</Slottable>
|
|
149
|
+
<ChevronDownIcon className="kui-AccordionChevron" aria-hidden />
|
|
153
150
|
</AccordionPrimitive.Trigger>
|
|
154
151
|
);
|
|
155
152
|
},
|
|
@@ -171,7 +168,6 @@ const AccordionContent = React.forwardRef<AccordionContentElement, AccordionCont
|
|
|
171
168
|
{...contentProps}
|
|
172
169
|
ref={forwardedRef}
|
|
173
170
|
className={classNames('kui-AccordionContent', className)}
|
|
174
|
-
aria-live="polite"
|
|
175
171
|
>
|
|
176
172
|
<div className="kui-AccordionContentInner">{children}</div>
|
|
177
173
|
</AccordionPrimitive.Content>
|
|
@@ -11,172 +11,76 @@ import { useThemeSizeProps } from '../helpers/theme-size.js';
|
|
|
11
11
|
import { requireReactElement } from '../helpers/require-react-element.js';
|
|
12
12
|
|
|
13
13
|
import type { AlertDialogContentOwnProps } from './alert-dialog.props.js';
|
|
14
|
-
import type {
|
|
15
|
-
ComponentPropsWithout,
|
|
16
|
-
RemovedProps,
|
|
17
|
-
ComponentPropsAs,
|
|
18
|
-
} from '../helpers/component-props.js';
|
|
14
|
+
import type { ComponentPropsWithout, RemovedProps, ComponentPropsAs } from '../helpers/component-props.js';
|
|
19
15
|
|
|
20
|
-
interface AlertDialogRootProps
|
|
21
|
-
|
|
22
|
-
const AlertDialogRoot: React.FC<AlertDialogRootProps> = (props) => (
|
|
23
|
-
<AlertDialogPrimitive.Root {...props} />
|
|
24
|
-
);
|
|
16
|
+
interface AlertDialogRootProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root> {}
|
|
17
|
+
const AlertDialogRoot: React.FC<AlertDialogRootProps> = (props) => <AlertDialogPrimitive.Root {...props} />;
|
|
25
18
|
AlertDialogRoot.displayName = 'AlertDialog.Root';
|
|
26
19
|
|
|
27
20
|
type AlertDialogTriggerElement = React.ElementRef<typeof AlertDialogPrimitive.Trigger>;
|
|
28
|
-
interface AlertDialogTriggerProps
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</AlertDialogPrimitive.Trigger>
|
|
35
|
-
),
|
|
36
|
-
);
|
|
21
|
+
interface AlertDialogTriggerProps extends ComponentPropsWithout<typeof AlertDialogPrimitive.Trigger, RemovedProps> {}
|
|
22
|
+
const AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(({ children, ...props }, forwardedRef) => (
|
|
23
|
+
<AlertDialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>
|
|
24
|
+
{requireReactElement(children)}
|
|
25
|
+
</AlertDialogPrimitive.Trigger>
|
|
26
|
+
));
|
|
37
27
|
AlertDialogTrigger.displayName = 'AlertDialog.Trigger';
|
|
38
28
|
|
|
39
29
|
// Split once at module scope. `extractProps` memoises on the identity of the
|
|
40
30
|
// prop def objects it is handed, so rebuilding these per render would recompile
|
|
41
31
|
// them on every render.
|
|
42
|
-
const {
|
|
43
|
-
align: alignPropDef,
|
|
44
|
-
...contentPropDefs
|
|
45
|
-
} = alertDialogContentPropDefs;
|
|
32
|
+
const { align: alignPropDef, ...contentPropDefs } = alertDialogContentPropDefs;
|
|
46
33
|
const alignPropDefs = { align: alignPropDef };
|
|
47
34
|
|
|
48
35
|
type AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;
|
|
49
|
-
interface AlertDialogContentProps
|
|
50
|
-
extends ComponentPropsWithout<typeof AlertDialogPrimitive.Content, RemovedProps>,
|
|
51
|
-
AlertDialogContentOwnProps {
|
|
36
|
+
interface AlertDialogContentProps extends ComponentPropsWithout<typeof AlertDialogPrimitive.Content, RemovedProps>, AlertDialogContentOwnProps {
|
|
52
37
|
container?: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>['container'];
|
|
53
38
|
}
|
|
54
|
-
const AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
// Focus trap effect
|
|
81
|
-
React.useEffect(() => {
|
|
82
|
-
// SSR safety - only run on client
|
|
83
|
-
if (typeof window === 'undefined') return;
|
|
84
|
-
|
|
85
|
-
const content = contentRef.current;
|
|
86
|
-
if (!content) return;
|
|
87
|
-
|
|
88
|
-
const focusableElements = content.querySelectorAll(
|
|
89
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
if (focusableElements.length === 0) return;
|
|
93
|
-
|
|
94
|
-
const firstElement = focusableElements[0] as HTMLElement;
|
|
95
|
-
const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;
|
|
96
|
-
|
|
97
|
-
const handleKeyDown = (event: KeyboardEvent) => {
|
|
98
|
-
if (event.key === 'Tab') {
|
|
99
|
-
if (event.shiftKey) {
|
|
100
|
-
if (document.activeElement === firstElement) {
|
|
101
|
-
event.preventDefault();
|
|
102
|
-
lastElement.focus();
|
|
103
|
-
}
|
|
104
|
-
} else {
|
|
105
|
-
if (document.activeElement === lastElement) {
|
|
106
|
-
event.preventDefault();
|
|
107
|
-
firstElement.focus();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
content.addEventListener('keydown', handleKeyDown);
|
|
114
|
-
|
|
115
|
-
// Focus first element when dialog opens
|
|
116
|
-
firstElement.focus();
|
|
117
|
-
|
|
118
|
-
return () => {
|
|
119
|
-
content.removeEventListener('keydown', handleKeyDown);
|
|
120
|
-
};
|
|
121
|
-
}, []);
|
|
122
|
-
|
|
123
|
-
return (
|
|
124
|
-
<AlertDialogPrimitive.Portal container={container} forceMount={forceMount}>
|
|
125
|
-
<Theme asChild>
|
|
126
|
-
<AlertDialogPrimitive.Overlay className="kui-BaseDialogOverlay kui-AlertDialogOverlay">
|
|
127
|
-
<div className="kui-BaseDialogScroll kui-AlertDialogScroll">
|
|
128
|
-
<div
|
|
129
|
-
className={`kui-BaseDialogScrollPadding kui-AlertDialogScrollPadding ${alignClassName}`}
|
|
130
|
-
>
|
|
131
|
-
<AlertDialogPrimitive.Content
|
|
132
|
-
{...contentProps}
|
|
133
|
-
ref={combinedRef}
|
|
134
|
-
className={classNames('kui-BaseDialogContent', 'kui-AlertDialogContent', className)}
|
|
135
|
-
tabIndex={-1}
|
|
136
|
-
role="alertdialog"
|
|
137
|
-
aria-modal="true"
|
|
138
|
-
aria-describedby="alert-dialog-description"
|
|
139
|
-
onCloseAutoFocus={(event) => {
|
|
140
|
-
// Prevent default focus behavior
|
|
141
|
-
event.preventDefault();
|
|
142
|
-
// Restore pointer-events to body (Radix UI fix for issue #1241)
|
|
143
|
-
document.body.style.pointerEvents = '';
|
|
144
|
-
}}
|
|
145
|
-
/>
|
|
146
|
-
{/* ARIA live region for screen reader announcements */}
|
|
147
|
-
<div
|
|
148
|
-
aria-live="assertive"
|
|
149
|
-
aria-atomic="true"
|
|
150
|
-
className="kui-sr-only"
|
|
151
|
-
id="alert-dialog-announcement"
|
|
152
|
-
/>
|
|
153
|
-
</div>
|
|
39
|
+
const AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(({ align, ...ownProps }, forwardedRef) => {
|
|
40
|
+
const props = useThemeSizeProps(ownProps, contentPropDefs.size);
|
|
41
|
+
const { className: alignClassName } = extractProps({ align }, alignPropDefs);
|
|
42
|
+
|
|
43
|
+
const { className, forceMount, container, onCloseAutoFocus, ...contentProps } = extractProps(props, contentPropDefs);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<AlertDialogPrimitive.Portal container={container} forceMount={forceMount}>
|
|
47
|
+
<Theme asChild>
|
|
48
|
+
<AlertDialogPrimitive.Overlay className="kui-BaseDialogOverlay kui-AlertDialogOverlay">
|
|
49
|
+
<div className="kui-BaseDialogScroll kui-AlertDialogScroll">
|
|
50
|
+
<div className={`kui-BaseDialogScrollPadding kui-AlertDialogScrollPadding ${alignClassName}`}>
|
|
51
|
+
<AlertDialogPrimitive.Content
|
|
52
|
+
{...contentProps}
|
|
53
|
+
ref={forwardedRef}
|
|
54
|
+
className={classNames('kui-BaseDialogContent', 'kui-AlertDialogContent', className)}
|
|
55
|
+
aria-modal="true"
|
|
56
|
+
onCloseAutoFocus={(event) => {
|
|
57
|
+
// Radix returns focus to the trigger unless the caller prevents it.
|
|
58
|
+
onCloseAutoFocus?.(event);
|
|
59
|
+
// Restore pointer-events to body (Radix UI fix for issue #1241)
|
|
60
|
+
document.body.style.pointerEvents = '';
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
154
63
|
</div>
|
|
155
|
-
</
|
|
156
|
-
</
|
|
157
|
-
</
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
);
|
|
64
|
+
</div>
|
|
65
|
+
</AlertDialogPrimitive.Overlay>
|
|
66
|
+
</Theme>
|
|
67
|
+
</AlertDialogPrimitive.Portal>
|
|
68
|
+
);
|
|
69
|
+
});
|
|
161
70
|
AlertDialogContent.displayName = 'AlertDialog.Content';
|
|
162
71
|
|
|
163
72
|
type AlertDialogTitleElement = React.ElementRef<typeof Heading>;
|
|
164
73
|
type AlertDialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;
|
|
165
|
-
const AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(
|
|
166
|
-
|
|
167
|
-
<
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
),
|
|
171
|
-
);
|
|
74
|
+
const AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>((props, forwardedRef) => (
|
|
75
|
+
<AlertDialogPrimitive.Title asChild>
|
|
76
|
+
<Heading size="5" trim="start" {...props} asChild={false} ref={forwardedRef} />
|
|
77
|
+
</AlertDialogPrimitive.Title>
|
|
78
|
+
));
|
|
172
79
|
AlertDialogTitle.displayName = 'AlertDialog.Title';
|
|
173
80
|
|
|
174
81
|
type AlertDialogDescriptionElement = HTMLParagraphElement;
|
|
175
82
|
type AlertDialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;
|
|
176
|
-
const AlertDialogDescription = React.forwardRef<
|
|
177
|
-
AlertDialogDescriptionElement,
|
|
178
|
-
AlertDialogDescriptionProps
|
|
179
|
-
>((props, forwardedRef) => (
|
|
83
|
+
const AlertDialogDescription = React.forwardRef<AlertDialogDescriptionElement, AlertDialogDescriptionProps>((props, forwardedRef) => (
|
|
180
84
|
<AlertDialogPrimitive.Description asChild>
|
|
181
85
|
<Text as="p" size="3" {...props} asChild={false} ref={forwardedRef} />
|
|
182
86
|
</AlertDialogPrimitive.Description>
|
|
@@ -184,27 +88,21 @@ const AlertDialogDescription = React.forwardRef<
|
|
|
184
88
|
AlertDialogDescription.displayName = 'AlertDialog.Description';
|
|
185
89
|
|
|
186
90
|
type AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;
|
|
187
|
-
interface AlertDialogActionProps
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
</AlertDialogPrimitive.Action>
|
|
194
|
-
),
|
|
195
|
-
);
|
|
91
|
+
interface AlertDialogActionProps extends ComponentPropsWithout<typeof AlertDialogPrimitive.Action, RemovedProps> {}
|
|
92
|
+
const AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(({ children, ...props }, forwardedRef) => (
|
|
93
|
+
<AlertDialogPrimitive.Action {...props} ref={forwardedRef} asChild>
|
|
94
|
+
{requireReactElement(children)}
|
|
95
|
+
</AlertDialogPrimitive.Action>
|
|
96
|
+
));
|
|
196
97
|
AlertDialogAction.displayName = 'AlertDialog.Action';
|
|
197
98
|
|
|
198
99
|
type AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;
|
|
199
|
-
interface AlertDialogCancelProps
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
</AlertDialogPrimitive.Cancel>
|
|
206
|
-
),
|
|
207
|
-
);
|
|
100
|
+
interface AlertDialogCancelProps extends ComponentPropsWithout<typeof AlertDialogPrimitive.Cancel, RemovedProps> {}
|
|
101
|
+
const AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(({ children, ...props }, forwardedRef) => (
|
|
102
|
+
<AlertDialogPrimitive.Cancel {...props} ref={forwardedRef} asChild>
|
|
103
|
+
{requireReactElement(children)}
|
|
104
|
+
</AlertDialogPrimitive.Cancel>
|
|
105
|
+
));
|
|
208
106
|
AlertDialogCancel.displayName = 'AlertDialog.Cancel';
|
|
209
107
|
|
|
210
108
|
export {
|