@womp/kookie-ui 0.23.0 → 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 +190 -185
- 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/index.d.ts +1 -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.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-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-6DDOR73D.js → chunk-G4ETY2NP.js} +2 -2
- 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-QGCXTULQ.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-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-ZEX2DECM.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/index.d.ts +1 -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.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/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.tsx +51 -12
- 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 -3
- 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/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/index.tsx +7 -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 +23 -3
- 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 +14 -0
- package/src/components/shell.tsx +29 -8
- package/src/components/sidebar.tsx +27 -16
- package/src/components/slider.tsx +51 -32
- package/src/components/spinner.tsx +10 -2
- 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/utilities/truncate.css +10 -0
- package/styles.css +195 -185
- 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-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-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-BOL3VVSN.js +0 -2
- package/dist/esm/chunk-BOL3VVSN.js.map +0 -7
- 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-FYT7TYGS.js +0 -2
- package/dist/esm/chunk-FYT7TYGS.js.map +0 -7
- package/dist/esm/chunk-GLV7VGBH.js +0 -2
- package/dist/esm/chunk-GLV7VGBH.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-L2R62BOB.js +0 -2
- package/dist/esm/chunk-L2R62BOB.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-NQDMTOGB.js +0 -2
- package/dist/esm/chunk-NQDMTOGB.js.map +0 -7
- package/dist/esm/chunk-Q6MFPATL.js +0 -2
- package/dist/esm/chunk-Q6MFPATL.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-UE3HATOA.js +0 -2
- package/dist/esm/chunk-UE3HATOA.js.map +0 -7
- package/dist/esm/chunk-V32EP3S7.js +0 -2
- package/dist/esm/chunk-V32EP3S7.js.map +0 -7
- package/dist/esm/chunk-XKSU3NLG.js +0 -2
- package/dist/esm/chunk-XRCMPBAY.js +0 -2
- package/dist/esm/chunk-XRCMPBAY.js.map +0 -7
- package/dist/esm/chunk-Y3JYEEFB.js +0 -2
- package/dist/esm/chunk-YZM54IJE.js +0 -2
- package/dist/esm/chunk-YZM54IJE.js.map +0 -7
- package/dist/esm/chunk-ZEX2DECM.js +0 -2
- 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-6DDOR73D.js.map → chunk-G4ETY2NP.js.map} +0 -0
- /package/dist/esm/{chunk-QGCXTULQ.js.map → chunk-KEGCX5VM.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
|
@@ -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 {
|
|
@@ -20,6 +20,11 @@ const avatarPropDefs = {
|
|
|
20
20
|
* Cannot be used together with `badge`.
|
|
21
21
|
*/
|
|
22
22
|
status: { type: 'enum', values: accentColors, default: undefined },
|
|
23
|
+
/**
|
|
24
|
+
* The words the status dot stands for, such as "Online". A screen reader reads them with the
|
|
25
|
+
* avatar. Without it the dot is hidden from screen readers.
|
|
26
|
+
*/
|
|
27
|
+
statusLabel: { type: 'string', default: undefined },
|
|
23
28
|
/**
|
|
24
29
|
* Custom badge content. Renders at the bottom-right corner.
|
|
25
30
|
* Cannot be used together with `status`.
|
|
@@ -36,6 +41,7 @@ const avatarPropDefs = {
|
|
|
36
41
|
variant: PropDef<(typeof variants)[number]>;
|
|
37
42
|
fallback: PropDef<React.ReactNode>;
|
|
38
43
|
status: PropDef<(typeof accentColors)[number] | undefined>;
|
|
44
|
+
statusLabel: PropDef<string | undefined>;
|
|
39
45
|
badge: PropDef<React.ReactNode>;
|
|
40
46
|
fit: PropDef<(typeof objectFitValues)[number]>;
|
|
41
47
|
};
|
|
@@ -13,43 +13,38 @@ import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-p
|
|
|
13
13
|
import type { GetPropDefTypes } from '../props/prop-def.js';
|
|
14
14
|
|
|
15
15
|
interface AvatarProps extends AvatarImplProps {}
|
|
16
|
-
const Avatar = React.forwardRef<
|
|
16
|
+
const Avatar = React.forwardRef<AvatarElement, AvatarProps>((ownProps, forwardedRef) => {
|
|
17
17
|
// An unset size follows the Theme, like a control. Sizes above 4 are only explicit.
|
|
18
18
|
const props = useThemeSizeProps(ownProps, avatarPropDefs.size);
|
|
19
|
-
const {
|
|
20
|
-
asChild,
|
|
21
|
-
children,
|
|
22
|
-
className,
|
|
23
|
-
style,
|
|
24
|
-
color,
|
|
25
|
-
radius,
|
|
26
|
-
status,
|
|
27
|
-
badge,
|
|
28
|
-
...imageProps
|
|
29
|
-
} = extractProps(props, avatarPropDefs);
|
|
19
|
+
const { asChild, children, className, style, color, radius, status, statusLabel, badge, ...imageProps } = extractProps(props, avatarPropDefs);
|
|
30
20
|
|
|
31
21
|
if (process.env.NODE_ENV !== 'production') {
|
|
32
22
|
if (status !== undefined && badge !== undefined) {
|
|
33
|
-
console.warn(
|
|
34
|
-
'Avatar: Cannot use both `status` and `badge` props together. ' +
|
|
35
|
-
'The `badge` prop will be used and `status` will be ignored.'
|
|
36
|
-
);
|
|
23
|
+
console.warn('Avatar: Cannot use both `status` and `badge` props together. ' + 'The `badge` prop will be used and `status` will be ignored.');
|
|
37
24
|
}
|
|
38
25
|
}
|
|
39
26
|
|
|
40
27
|
// Cheap boolean checks — no memoization needed
|
|
41
|
-
const isDisabled =
|
|
42
|
-
asChild &&
|
|
43
|
-
children != null &&
|
|
44
|
-
React.isValidElement(children) &&
|
|
45
|
-
((children.props as any).disabled === true ||
|
|
46
|
-
(children.props as any)['data-disabled'] === true);
|
|
28
|
+
const isDisabled = asChild && children != null && React.isValidElement(children) && ((children.props as any).disabled === true || (children.props as any)['data-disabled'] === true);
|
|
47
29
|
|
|
48
30
|
const hasIndicator = badge !== undefined || status !== undefined;
|
|
49
31
|
|
|
32
|
+
const indicator =
|
|
33
|
+
badge !== undefined ? (
|
|
34
|
+
<span className="kui-AvatarBadge">{badge}</span>
|
|
35
|
+
) : status !== undefined ? (
|
|
36
|
+
<span
|
|
37
|
+
className="kui-AvatarStatus"
|
|
38
|
+
data-accent-color={status}
|
|
39
|
+
role={statusLabel ? 'img' : undefined}
|
|
40
|
+
aria-label={statusLabel || undefined}
|
|
41
|
+
aria-hidden={statusLabel ? undefined : true}
|
|
42
|
+
/>
|
|
43
|
+
) : null;
|
|
44
|
+
|
|
50
45
|
return (
|
|
51
|
-
// TODO as a rule, should we rather spread the props on root?
|
|
52
46
|
<AvatarPrimitive.Root
|
|
47
|
+
ref={forwardedRef}
|
|
53
48
|
data-accent-color={color}
|
|
54
49
|
data-radius={radius}
|
|
55
50
|
data-disabled={isDisabled || undefined}
|
|
@@ -58,67 +53,58 @@ const Avatar = React.forwardRef<AvatarImplElement, AvatarProps>((ownProps, forwa
|
|
|
58
53
|
style={style}
|
|
59
54
|
asChild={asChild}
|
|
60
55
|
>
|
|
61
|
-
{
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
{/* With asChild, Slot takes exactly one child, so the indicator goes inside it. */}
|
|
57
|
+
{getSubtree(
|
|
58
|
+
{ asChild, children },
|
|
59
|
+
<>
|
|
60
|
+
<AvatarImpl {...imageProps} />
|
|
61
|
+
{indicator}
|
|
62
|
+
</>,
|
|
63
|
+
)}
|
|
67
64
|
</AvatarPrimitive.Root>
|
|
68
65
|
);
|
|
69
66
|
});
|
|
70
67
|
Avatar.displayName = 'Avatar';
|
|
71
68
|
|
|
72
|
-
type
|
|
69
|
+
type AvatarElement = React.ElementRef<typeof AvatarPrimitive.Root>;
|
|
73
70
|
type AvatarOwnProps = GetPropDefTypes<typeof avatarPropDefs>;
|
|
74
71
|
|
|
75
|
-
interface AvatarImplProps
|
|
76
|
-
extends ComponentPropsWithout<typeof AvatarPrimitive.Image, RemovedProps>,
|
|
77
|
-
AvatarOwnProps {
|
|
72
|
+
interface AvatarImplProps extends ComponentPropsWithout<typeof AvatarPrimitive.Image, RemovedProps>, AvatarOwnProps {
|
|
78
73
|
// TODO: See if we can automate making prop defs with `required: true` non nullable
|
|
79
74
|
fallback: NonNullable<AvatarOwnProps['fallback']>;
|
|
80
75
|
}
|
|
81
76
|
|
|
82
|
-
const AvatarImpl = React.memo(
|
|
83
|
-
React.
|
|
84
|
-
({ fallback, onLoadingStatusChange, ...imageProps }, forwardedRef) => {
|
|
85
|
-
const [status, setStatus] = React.useState<'idle' | 'loading' | 'loaded' | 'error'>('idle');
|
|
77
|
+
const AvatarImpl = React.memo(({ fallback, onLoadingStatusChange, ...imageProps }: AvatarImplProps) => {
|
|
78
|
+
const [status, setStatus] = React.useState<'idle' | 'loading' | 'loaded' | 'error'>('idle');
|
|
86
79
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
[onLoadingStatusChange],
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<>
|
|
97
|
-
{status === 'idle' || status === 'loading' ? <span className="kui-AvatarFallback" /> : null}
|
|
98
|
-
|
|
99
|
-
{status === 'error' ? (
|
|
100
|
-
<AvatarPrimitive.Fallback
|
|
101
|
-
className={classNames('kui-AvatarFallback', {
|
|
102
|
-
'kui-one-letter': typeof fallback === 'string' && fallback.length === 1,
|
|
103
|
-
'kui-two-letters': typeof fallback === 'string' && fallback.length === 2,
|
|
104
|
-
})}
|
|
105
|
-
delayMs={0}
|
|
106
|
-
>
|
|
107
|
-
{fallback}
|
|
108
|
-
</AvatarPrimitive.Fallback>
|
|
109
|
-
) : null}
|
|
110
|
-
|
|
111
|
-
<AvatarPrimitive.Image
|
|
112
|
-
ref={forwardedRef}
|
|
113
|
-
className="kui-AvatarImage"
|
|
114
|
-
{...imageProps}
|
|
115
|
-
onLoadingStatusChange={handleLoadingStatusChange}
|
|
116
|
-
/>
|
|
117
|
-
</>
|
|
118
|
-
);
|
|
80
|
+
const handleLoadingStatusChange = React.useCallback(
|
|
81
|
+
(newStatus: 'idle' | 'loading' | 'loaded' | 'error') => {
|
|
82
|
+
onLoadingStatusChange?.(newStatus);
|
|
83
|
+
setStatus(newStatus);
|
|
119
84
|
},
|
|
120
|
-
|
|
121
|
-
);
|
|
85
|
+
[onLoadingStatusChange],
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<>
|
|
90
|
+
{status === 'idle' || status === 'loading' ? <span className="kui-AvatarFallback" /> : null}
|
|
91
|
+
|
|
92
|
+
{status === 'error' ? (
|
|
93
|
+
<AvatarPrimitive.Fallback
|
|
94
|
+
className={classNames('kui-AvatarFallback', {
|
|
95
|
+
'kui-one-letter': typeof fallback === 'string' && fallback.length === 1,
|
|
96
|
+
'kui-two-letters': typeof fallback === 'string' && fallback.length === 2,
|
|
97
|
+
})}
|
|
98
|
+
delayMs={0}
|
|
99
|
+
>
|
|
100
|
+
{fallback}
|
|
101
|
+
</AvatarPrimitive.Fallback>
|
|
102
|
+
) : null}
|
|
103
|
+
|
|
104
|
+
<AvatarPrimitive.Image className="kui-AvatarImage" {...imageProps} onLoadingStatusChange={handleLoadingStatusChange} />
|
|
105
|
+
</>
|
|
106
|
+
);
|
|
107
|
+
});
|
|
122
108
|
|
|
123
109
|
AvatarImpl.displayName = 'AvatarImpl';
|
|
124
110
|
|
|
@@ -2,9 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { Slot } from 'radix-ui';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { blockquotePropDefs } from './blockquote.props.js';
|
|
6
|
+
import { extractProps } from '../helpers/extract-props.js';
|
|
6
7
|
|
|
7
|
-
import type { blockquotePropDefs } from './blockquote.props.js';
|
|
8
8
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
9
9
|
import type { GetPropDefTypes } from '../props/prop-def.js';
|
|
10
10
|
|
|
@@ -14,17 +14,16 @@ interface BlockquoteProps
|
|
|
14
14
|
extends ComponentPropsWithout<'blockquote', RemovedProps>,
|
|
15
15
|
BlockQuoteOwnProps {}
|
|
16
16
|
const Blockquote = React.forwardRef<BlockquoteElement, BlockquoteProps>((props, forwardedRef) => {
|
|
17
|
-
|
|
17
|
+
// Only Blockquote's own props style it. It wears Text's classes, so it reads like Text.
|
|
18
|
+
const { asChild, className, color, ...blockquoteProps } = extractProps(props, blockquotePropDefs);
|
|
18
19
|
const Comp = asChild ? Slot.Root : 'blockquote';
|
|
19
20
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
21
|
+
<Comp
|
|
22
|
+
data-accent-color={color}
|
|
22
23
|
{...blockquoteProps}
|
|
23
24
|
ref={forwardedRef}
|
|
24
|
-
className={classNames('kui-Blockquote', className)}
|
|
25
|
-
|
|
26
|
-
<Comp>{children}</Comp>
|
|
27
|
-
</Text>
|
|
25
|
+
className={classNames('kui-Text', 'kui-Blockquote', className)}
|
|
26
|
+
/>
|
|
28
27
|
);
|
|
29
28
|
});
|
|
30
29
|
Blockquote.displayName = 'Blockquote';
|
|
@@ -4,7 +4,7 @@ import { useComposedRefs } from 'radix-ui/internal';
|
|
|
4
4
|
import { useDropzone } from 'react-dropzone';
|
|
5
5
|
|
|
6
6
|
import { Button } from './button.js';
|
|
7
|
-
import { CloseIcon, FileTextIcon } from './icons.js';
|
|
7
|
+
import { CloseIcon, FileTextIcon, PaperclipIcon } from './icons.js';
|
|
8
8
|
import { Flex } from './flex.js';
|
|
9
9
|
import { ScrollArea } from './scroll-area.js';
|
|
10
10
|
import { Slot } from './slot.js';
|
|
@@ -1216,28 +1216,35 @@ interface AttachTriggerProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
|
|
1218
1218
|
const AttachTrigger = React.forwardRef<HTMLButtonElement, AttachTriggerProps>((props, forwardedRef) => {
|
|
1219
|
-
|
|
1219
|
+
// The HTML `color` attribute is dropped: Button reads `color` as an accent colour.
|
|
1220
|
+
const { asChild, accept, multiple, disabled: disabledProp, onPointerDown, onClick, children, color: _color, ...buttonProps } = props;
|
|
1220
1221
|
const ctx = useChatbarContext();
|
|
1221
1222
|
const disabled = disabledProp || ctx.disabled || ctx.readOnly;
|
|
1222
|
-
const
|
|
1223
|
+
const triggerProps = {
|
|
1224
|
+
...buttonProps,
|
|
1225
|
+
ref: forwardedRef,
|
|
1226
|
+
className: classNames('kui-ChatbarAttachTrigger', buttonProps.className),
|
|
1227
|
+
type: buttonProps.type ?? 'button',
|
|
1228
|
+
'aria-label': buttonProps['aria-label'] ?? 'Add attachments',
|
|
1229
|
+
disabled,
|
|
1230
|
+
onPointerDown: (event: React.PointerEvent<HTMLButtonElement>) => {
|
|
1231
|
+
onPointerDown?.(event);
|
|
1232
|
+
if (!disabled && !event.defaultPrevented) ctx.beginFilePickerPress();
|
|
1233
|
+
},
|
|
1234
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
1235
|
+
onClick?.(event);
|
|
1236
|
+
if (disabled || event.defaultPrevented) return;
|
|
1237
|
+
ctx.openFilePicker({ accept, multiple });
|
|
1238
|
+
},
|
|
1239
|
+
} as const;
|
|
1240
|
+
|
|
1241
|
+
if (asChild) return <Slot {...triggerProps}>{children}</Slot>;
|
|
1242
|
+
|
|
1243
|
+
// Without asChild, the trigger is a quiet icon-only Button at the Chatbar's size.
|
|
1223
1244
|
return (
|
|
1224
|
-
<
|
|
1225
|
-
{
|
|
1226
|
-
|
|
1227
|
-
className={classNames('kui-ChatbarAttachTrigger', buttonProps.className)}
|
|
1228
|
-
type={buttonProps.type ?? 'button'}
|
|
1229
|
-
aria-label={buttonProps['aria-label'] ?? 'Add attachments'}
|
|
1230
|
-
disabled={disabled}
|
|
1231
|
-
onPointerDown={(event: React.PointerEvent<HTMLButtonElement>) => {
|
|
1232
|
-
onPointerDown?.(event);
|
|
1233
|
-
if (!disabled && !event.defaultPrevented) ctx.beginFilePickerPress();
|
|
1234
|
-
}}
|
|
1235
|
-
onClick={(event: React.MouseEvent<HTMLButtonElement>) => {
|
|
1236
|
-
onClick?.(event);
|
|
1237
|
-
if (disabled || event.defaultPrevented) return;
|
|
1238
|
-
ctx.openFilePicker({ accept, multiple });
|
|
1239
|
-
}}
|
|
1240
|
-
/>
|
|
1245
|
+
<Button iconOnly emphasis="quiet" color="gray" size={ctx.size} {...triggerProps}>
|
|
1246
|
+
{children ?? <PaperclipIcon aria-hidden />}
|
|
1247
|
+
</Button>
|
|
1241
1248
|
);
|
|
1242
1249
|
});
|
|
1243
1250
|
AttachTrigger.displayName = 'Chatbar.AttachTrigger';
|