@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
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { Flex } from './flex.js';
|
|
6
|
-
import { Slot } from './slot.js';
|
|
7
6
|
|
|
8
7
|
import type { FlexProps } from './flex.js';
|
|
9
8
|
import type { MarginProps } from '../props/margin.props.js';
|
|
@@ -70,29 +69,18 @@ type NavbarLogoProps = NavbarSlotFlexProps & {
|
|
|
70
69
|
asChild?: boolean;
|
|
71
70
|
};
|
|
72
71
|
|
|
72
|
+
// With `asChild`, Flex renders the child, so the layout props become classes on it, not attributes.
|
|
73
73
|
const NavbarLogo = React.forwardRef<HTMLDivElement, NavbarLogoProps>(
|
|
74
|
-
({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<Flex
|
|
87
|
-
ref={ref}
|
|
88
|
-
gap={gap}
|
|
89
|
-
align={align}
|
|
90
|
-
justify={justify}
|
|
91
|
-
className={classNames('kui-NavbarLogo', className)}
|
|
92
|
-
{...props}
|
|
93
|
-
/>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
74
|
+
({ gap = '2', align = 'center', justify = 'start', className, ...props }, ref) => (
|
|
75
|
+
<Flex
|
|
76
|
+
ref={ref}
|
|
77
|
+
gap={gap}
|
|
78
|
+
align={align}
|
|
79
|
+
justify={justify}
|
|
80
|
+
className={classNames('kui-NavbarLogo', className)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
),
|
|
96
84
|
);
|
|
97
85
|
NavbarLogo.displayName = 'Navbar.Logo';
|
|
98
86
|
|
|
@@ -102,30 +90,19 @@ type NavbarNavigationProps = NavbarSlotFlexProps & {
|
|
|
102
90
|
};
|
|
103
91
|
|
|
104
92
|
const NavbarNavigation = React.forwardRef<HTMLDivElement, NavbarNavigationProps>(
|
|
105
|
-
({
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<Flex
|
|
119
|
-
ref={ref}
|
|
120
|
-
gap={gap}
|
|
121
|
-
align={align}
|
|
122
|
-
justify={justify}
|
|
123
|
-
className={classNames('kui-NavbarNavigation', className)}
|
|
124
|
-
role="navigation"
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
);
|
|
128
|
-
}
|
|
93
|
+
({ gap = '4', align = 'center', justify = 'center', className, ...props }, ref) => (
|
|
94
|
+
<Flex
|
|
95
|
+
ref={ref}
|
|
96
|
+
gap={gap}
|
|
97
|
+
align={align}
|
|
98
|
+
justify={justify}
|
|
99
|
+
className={classNames('kui-NavbarNavigation', className)}
|
|
100
|
+
role="navigation"
|
|
101
|
+
// A landmark needs a name to be told apart from other navigation on the page.
|
|
102
|
+
aria-label={props['aria-labelledby'] === undefined ? 'Main' : undefined}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
),
|
|
129
106
|
);
|
|
130
107
|
NavbarNavigation.displayName = 'Navbar.Navigation';
|
|
131
108
|
|
|
@@ -135,28 +112,16 @@ type NavbarActionsProps = NavbarSlotFlexProps & {
|
|
|
135
112
|
};
|
|
136
113
|
|
|
137
114
|
const NavbarActions = React.forwardRef<HTMLDivElement, NavbarActionsProps>(
|
|
138
|
-
({
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return (
|
|
150
|
-
<Flex
|
|
151
|
-
ref={ref}
|
|
152
|
-
gap={gap}
|
|
153
|
-
align={align}
|
|
154
|
-
justify={justify}
|
|
155
|
-
className={classNames('kui-NavbarActions', className)}
|
|
156
|
-
{...props}
|
|
157
|
-
/>
|
|
158
|
-
);
|
|
159
|
-
}
|
|
115
|
+
({ gap = '4', align = 'center', justify = 'end', className, ...props }, ref) => (
|
|
116
|
+
<Flex
|
|
117
|
+
ref={ref}
|
|
118
|
+
gap={gap}
|
|
119
|
+
align={align}
|
|
120
|
+
justify={justify}
|
|
121
|
+
className={classNames('kui-NavbarActions', className)}
|
|
122
|
+
{...props}
|
|
123
|
+
/>
|
|
124
|
+
),
|
|
160
125
|
);
|
|
161
126
|
NavbarActions.displayName = 'Navbar.Actions';
|
|
162
127
|
|
|
@@ -23,7 +23,7 @@ import classNames from 'classnames';
|
|
|
23
23
|
|
|
24
24
|
import { Button } from './button.js';
|
|
25
25
|
import { Text } from './text.js';
|
|
26
|
-
import { useThemeSize } from '../helpers/theme-size.js';
|
|
26
|
+
import { ThemeSizeContext, useThemeSize } from '../helpers/theme-size.js';
|
|
27
27
|
import { accentColorPropDef } from '../props/color.prop.js';
|
|
28
28
|
|
|
29
29
|
type NoticeSize = '1' | '2' | '3' | '4';
|
|
@@ -50,7 +50,10 @@ interface StripProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'
|
|
|
50
50
|
interface NoticeProps extends StripProps {
|
|
51
51
|
/** An icon before the message. It is hidden from assistive technology. */
|
|
52
52
|
icon?: React.ReactNode;
|
|
53
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* One action that fixes the condition, such as `<Button>Add credits</Button>`. A control in it
|
|
55
|
+
* that sets no `size` takes the notice's size.
|
|
56
|
+
*/
|
|
54
57
|
action?: React.ReactNode;
|
|
55
58
|
/**
|
|
56
59
|
* Called when the person presses the dismiss button, which shows only when this is set.
|
|
@@ -105,7 +108,7 @@ const Notice = React.forwardRef<HTMLDivElement, NoticeProps>(({ icon, action, on
|
|
|
105
108
|
const trailing =
|
|
106
109
|
action || onDismiss ? (
|
|
107
110
|
<span className="kui-NoticeActions">
|
|
108
|
-
{action}
|
|
111
|
+
{action ? <ThemeSizeContext.Provider value={size}>{action}</ThemeSizeContext.Provider> : null}
|
|
109
112
|
{onDismiss ? (
|
|
110
113
|
<Button iconOnly size={size} variant="ghost" color="gray" aria-label={dismissLabel} className="kui-NoticeDismiss" onClick={onDismiss}>
|
|
111
114
|
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" aria-hidden>
|
|
@@ -22,6 +22,9 @@ const Progress = React.forwardRef<ProgressElement, ProgressProps>((props, forwar
|
|
|
22
22
|
progressPropDefs
|
|
23
23
|
);
|
|
24
24
|
|
|
25
|
+
// `null` and `undefined` both mean indeterminate, as in Radix, so both keep a custom duration.
|
|
26
|
+
const isDeterminate = progressProps.value != null;
|
|
27
|
+
|
|
25
28
|
return (
|
|
26
29
|
<ProgressPrimitive.Root
|
|
27
30
|
data-accent-color={color}
|
|
@@ -30,9 +33,9 @@ const Progress = React.forwardRef<ProgressElement, ProgressProps>((props, forwar
|
|
|
30
33
|
className={classNames('kui-ProgressRoot', className)}
|
|
31
34
|
style={mergeStyles(
|
|
32
35
|
{
|
|
33
|
-
'--progress-duration':
|
|
34
|
-
'--progress-value':
|
|
35
|
-
'--progress-max':
|
|
36
|
+
'--progress-duration': isDeterminate ? undefined : duration,
|
|
37
|
+
'--progress-value': isDeterminate ? progressProps.value : undefined,
|
|
38
|
+
'--progress-max': progressProps.max ?? undefined,
|
|
36
39
|
},
|
|
37
40
|
style
|
|
38
41
|
)}
|
|
@@ -129,10 +129,9 @@
|
|
|
129
129
|
* with nothing past it fades over 0px, and the fade ramps in over the first pixels of scrolling.
|
|
130
130
|
* A floating band over an edge sets `--scroll-fade-start` or `--scroll-fade-end` to its height.
|
|
131
131
|
*
|
|
132
|
-
* Shared by ScrollArea (on its viewport) and MessageScroller (on its viewport). Scrollbars are
|
|
132
|
+
* Shared by ScrollArea (on its viewport, both axes) and MessageScroller (on its viewport, block axis only). Scrollbars are
|
|
133
133
|
* siblings of the viewport, outside the mask, so the thumb stays crisp.
|
|
134
134
|
*/
|
|
135
|
-
:where(.kui-ScrollAreaRoot[data-fade]) > .kui-ScrollAreaViewport,
|
|
136
135
|
.kui-MessageScrollerViewport:where([data-fade]) {
|
|
137
136
|
mask-image: linear-gradient(
|
|
138
137
|
to bottom,
|
|
@@ -143,6 +142,33 @@
|
|
|
143
142
|
);
|
|
144
143
|
}
|
|
145
144
|
|
|
145
|
+
/* ScrollArea scrolls both ways, so it fades on both axes: one layer each, intersected, so a corner
|
|
146
|
+
with content hidden both ways fades both ways. The inline layer runs from the inline start, so
|
|
147
|
+
right-to-left flips its direction. */
|
|
148
|
+
:where(.kui-ScrollAreaRoot[data-fade]) > .kui-ScrollAreaViewport {
|
|
149
|
+
--scroll-fade-x-direction: to right;
|
|
150
|
+
mask-image:
|
|
151
|
+
linear-gradient(
|
|
152
|
+
var(--scroll-fade-x-direction),
|
|
153
|
+
transparent 0%,
|
|
154
|
+
black min(var(--scroll-overflow-x-start, 0px), var(--scroll-fade-size)),
|
|
155
|
+
black calc(100% - min(var(--scroll-overflow-x-end, 0px), var(--scroll-fade-size))),
|
|
156
|
+
transparent 100%
|
|
157
|
+
),
|
|
158
|
+
linear-gradient(
|
|
159
|
+
to bottom,
|
|
160
|
+
transparent 0%,
|
|
161
|
+
black min(var(--scroll-overflow-start, 0px), var(--scroll-fade-start, var(--scroll-fade-size))),
|
|
162
|
+
black calc(100% - min(var(--scroll-overflow-end, 0px), var(--scroll-fade-end, var(--scroll-fade-size)))),
|
|
163
|
+
transparent 100%
|
|
164
|
+
);
|
|
165
|
+
mask-composite: intersect;
|
|
166
|
+
|
|
167
|
+
&:where(:dir(rtl)) {
|
|
168
|
+
--scroll-fade-x-direction: to left;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
146
172
|
:root,
|
|
147
173
|
.kui-theme {
|
|
148
174
|
--scroll-fade-size: var(--space-7);
|
|
@@ -7,16 +7,56 @@ import { scrollAreaPropDefs } from './scroll-area.props.js';
|
|
|
7
7
|
import { useScrollEdges } from '../hooks/use-scroll-edges.js';
|
|
8
8
|
import { useThumbSync } from '../hooks/use-thumb-sync.js';
|
|
9
9
|
import { getSubtree } from '../helpers/get-subtree.js';
|
|
10
|
+
import { extractProps } from '../helpers/extract-props.js';
|
|
11
|
+
import { widthPropDefs } from '../props/width.props.js';
|
|
12
|
+
import { heightPropDefs } from '../props/height.props.js';
|
|
10
13
|
|
|
11
14
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
12
15
|
import type { GetPropDefTypes } from '../props/prop-def.js';
|
|
16
|
+
import type { WidthProps } from '../props/width.props.js';
|
|
17
|
+
import type { HeightProps } from '../props/height.props.js';
|
|
13
18
|
|
|
14
19
|
type ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;
|
|
15
20
|
type ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;
|
|
16
21
|
interface ScrollAreaProps
|
|
17
22
|
extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,
|
|
18
23
|
ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,
|
|
19
|
-
ScrollAreaOwnProps
|
|
24
|
+
ScrollAreaOwnProps,
|
|
25
|
+
WidthProps,
|
|
26
|
+
HeightProps {}
|
|
27
|
+
|
|
28
|
+
/** Menus and listboxes move focus between their items, so a scroller inside one stays out of the tab order. */
|
|
29
|
+
const OWNS_FOCUS = '[role="menu"], [role="listbox"]';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Puts the viewport in the tab order while it has something to scroll, so a keyboard can reach it
|
|
33
|
+
* and scroll it with the arrow keys. A `tabIndex` the caller set wins.
|
|
34
|
+
*/
|
|
35
|
+
function useFocusableWhileScrollable(element: HTMLDivElement | null, enabled: boolean) {
|
|
36
|
+
React.useEffect(() => {
|
|
37
|
+
if (!enabled || !element || element.closest(OWNS_FOCUS)) return;
|
|
38
|
+
let frame = 0;
|
|
39
|
+
const update = () => {
|
|
40
|
+
frame = 0;
|
|
41
|
+
const scrollable = element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;
|
|
42
|
+
if (scrollable) element.setAttribute('tabindex', '0');
|
|
43
|
+
else element.removeAttribute('tabindex');
|
|
44
|
+
};
|
|
45
|
+
const schedule = () => {
|
|
46
|
+
if (!frame) frame = requestAnimationFrame(update);
|
|
47
|
+
};
|
|
48
|
+
update();
|
|
49
|
+
const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);
|
|
50
|
+
observer?.observe(element);
|
|
51
|
+
for (const child of Array.from(element.children)) observer?.observe(child);
|
|
52
|
+
return () => {
|
|
53
|
+
if (frame) cancelAnimationFrame(frame);
|
|
54
|
+
// The attribute stays: a caller who now sets `tabIndex` has already written it.
|
|
55
|
+
observer?.disconnect();
|
|
56
|
+
};
|
|
57
|
+
}, [element, enabled]);
|
|
58
|
+
}
|
|
59
|
+
|
|
20
60
|
const ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {
|
|
21
61
|
const {
|
|
22
62
|
asChild,
|
|
@@ -30,15 +70,20 @@ const ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props,
|
|
|
30
70
|
scrollbars = scrollAreaPropDefs.scrollbars.default,
|
|
31
71
|
fade = scrollAreaPropDefs.fade.default,
|
|
32
72
|
...viewportProps
|
|
33
|
-
} = props;
|
|
73
|
+
} = extractProps(props, widthPropDefs, heightPropDefs);
|
|
74
|
+
const [viewport, setViewport] = React.useState<HTMLDivElement | null>(null);
|
|
34
75
|
const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);
|
|
35
76
|
const setThumbViewport = useThumbSync<HTMLDivElement>();
|
|
36
|
-
const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport);
|
|
77
|
+
const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport, setViewport);
|
|
78
|
+
useFocusableWhileScrollable(viewport, viewportProps.tabIndex === undefined);
|
|
79
|
+
// A named scroller is a region, so a screen reader can find it and say what it holds.
|
|
80
|
+
const named = viewportProps['aria-label'] !== undefined || viewportProps['aria-labelledby'] !== undefined;
|
|
37
81
|
|
|
38
82
|
return (
|
|
39
83
|
<ScrollAreaPrimitive.Root
|
|
40
84
|
type={type}
|
|
41
85
|
scrollHideDelay={scrollHideDelay}
|
|
86
|
+
dir={dir}
|
|
42
87
|
className={classNames('kui-ScrollAreaRoot', className)}
|
|
43
88
|
data-fade={fade ? '' : undefined}
|
|
44
89
|
style={style}
|
|
@@ -47,6 +92,7 @@ const ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props,
|
|
|
47
92
|
{getSubtree({ asChild, children }, (children) => (
|
|
48
93
|
<>
|
|
49
94
|
<ScrollAreaPrimitive.Viewport
|
|
95
|
+
role={named ? 'region' : undefined}
|
|
50
96
|
{...viewportProps}
|
|
51
97
|
ref={viewportRef}
|
|
52
98
|
className="kui-ScrollAreaViewport"
|
|
@@ -186,6 +186,9 @@
|
|
|
186
186
|
left: 0;
|
|
187
187
|
height: 100%;
|
|
188
188
|
pointer-events: none;
|
|
189
|
+
/* Width and position come from the item count and selected index, set by the root. */
|
|
190
|
+
width: calc(100% / var(--segmented-control-count, 1));
|
|
191
|
+
transform: translateX(calc(var(--segmented-control-index, 0) * 100%));
|
|
189
192
|
|
|
190
193
|
&::before {
|
|
191
194
|
inset: var(--border-width-standard); /* 1px */
|
|
@@ -200,7 +203,8 @@
|
|
|
200
203
|
display: block;
|
|
201
204
|
}
|
|
202
205
|
|
|
203
|
-
|
|
206
|
+
/* Greyed only when the selected segment is disabled, not when any other segment is. */
|
|
207
|
+
:where(.kui-SegmentedControlItem[data-state='on'][disabled]) ~ & {
|
|
204
208
|
--segmented-control-indicator-background-color: var(--neutral-a3);
|
|
205
209
|
|
|
206
210
|
&::before {
|
|
@@ -208,139 +212,13 @@
|
|
|
208
212
|
box-shadow: none;
|
|
209
213
|
}
|
|
210
214
|
}
|
|
211
|
-
|
|
212
|
-
/* Horizontal orientation (default) - width based on number of items */
|
|
213
|
-
&:where(:nth-child(2)) {
|
|
214
|
-
width: calc(100% / 1);
|
|
215
|
-
}
|
|
216
|
-
&:where(:nth-child(3)) {
|
|
217
|
-
width: calc(100% / 2);
|
|
218
|
-
}
|
|
219
|
-
&:where(:nth-child(4)) {
|
|
220
|
-
width: calc(100% / 3);
|
|
221
|
-
}
|
|
222
|
-
&:where(:nth-child(5)) {
|
|
223
|
-
width: calc(100% / 4);
|
|
224
|
-
}
|
|
225
|
-
&:where(:nth-child(6)) {
|
|
226
|
-
width: calc(100% / 5);
|
|
227
|
-
}
|
|
228
|
-
&:where(:nth-child(7)) {
|
|
229
|
-
width: calc(100% / 6);
|
|
230
|
-
}
|
|
231
|
-
&:where(:nth-child(8)) {
|
|
232
|
-
width: calc(100% / 7);
|
|
233
|
-
}
|
|
234
|
-
&:where(:nth-child(9)) {
|
|
235
|
-
width: calc(100% / 8);
|
|
236
|
-
}
|
|
237
|
-
&:where(:nth-child(10)) {
|
|
238
|
-
width: calc(100% / 9);
|
|
239
|
-
}
|
|
240
|
-
&:where(:nth-child(11)) {
|
|
241
|
-
width: calc(100% / 10);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/* Horizontal transforms (default) */
|
|
245
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(1)) ~ & {
|
|
246
|
-
transform: translateX(0%);
|
|
247
|
-
}
|
|
248
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(2)) ~ & {
|
|
249
|
-
transform: translateX(100%);
|
|
250
|
-
}
|
|
251
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(3)) ~ & {
|
|
252
|
-
transform: translateX(200%);
|
|
253
|
-
}
|
|
254
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(4)) ~ & {
|
|
255
|
-
transform: translateX(300%);
|
|
256
|
-
}
|
|
257
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(5)) ~ & {
|
|
258
|
-
transform: translateX(400%);
|
|
259
|
-
}
|
|
260
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(6)) ~ & {
|
|
261
|
-
transform: translateX(500%);
|
|
262
|
-
}
|
|
263
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(7)) ~ & {
|
|
264
|
-
transform: translateX(600%);
|
|
265
|
-
}
|
|
266
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(8)) ~ & {
|
|
267
|
-
transform: translateX(700%);
|
|
268
|
-
}
|
|
269
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(9)) ~ & {
|
|
270
|
-
transform: translateX(800%);
|
|
271
|
-
}
|
|
272
|
-
:where(.kui-SegmentedControlItem[data-state='on']:nth-child(10)) ~ & {
|
|
273
|
-
transform: translateX(900%);
|
|
274
|
-
}
|
|
275
215
|
}
|
|
276
216
|
|
|
277
|
-
/* Vertical orientation
|
|
217
|
+
/* Vertical orientation */
|
|
278
218
|
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator {
|
|
279
219
|
width: 100%;
|
|
280
|
-
height:
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(2) {
|
|
284
|
-
height: calc(100% / 1);
|
|
285
|
-
}
|
|
286
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(3) {
|
|
287
|
-
height: calc(100% / 2);
|
|
288
|
-
}
|
|
289
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(4) {
|
|
290
|
-
height: calc(100% / 3);
|
|
291
|
-
}
|
|
292
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(5) {
|
|
293
|
-
height: calc(100% / 4);
|
|
294
|
-
}
|
|
295
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(6) {
|
|
296
|
-
height: calc(100% / 5);
|
|
297
|
-
}
|
|
298
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(7) {
|
|
299
|
-
height: calc(100% / 6);
|
|
300
|
-
}
|
|
301
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(8) {
|
|
302
|
-
height: calc(100% / 7);
|
|
303
|
-
}
|
|
304
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(9) {
|
|
305
|
-
height: calc(100% / 8);
|
|
306
|
-
}
|
|
307
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(10) {
|
|
308
|
-
height: calc(100% / 9);
|
|
309
|
-
}
|
|
310
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlIndicator:nth-child(11) {
|
|
311
|
-
height: calc(100% / 10);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/* Vertical transforms */
|
|
315
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(1) ~ .kui-SegmentedControlIndicator {
|
|
316
|
-
transform: translateY(0%);
|
|
317
|
-
}
|
|
318
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(2) ~ .kui-SegmentedControlIndicator {
|
|
319
|
-
transform: translateY(100%);
|
|
320
|
-
}
|
|
321
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(3) ~ .kui-SegmentedControlIndicator {
|
|
322
|
-
transform: translateY(200%);
|
|
323
|
-
}
|
|
324
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(4) ~ .kui-SegmentedControlIndicator {
|
|
325
|
-
transform: translateY(300%);
|
|
326
|
-
}
|
|
327
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(5) ~ .kui-SegmentedControlIndicator {
|
|
328
|
-
transform: translateY(400%);
|
|
329
|
-
}
|
|
330
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(6) ~ .kui-SegmentedControlIndicator {
|
|
331
|
-
transform: translateY(500%);
|
|
332
|
-
}
|
|
333
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(7) ~ .kui-SegmentedControlIndicator {
|
|
334
|
-
transform: translateY(600%);
|
|
335
|
-
}
|
|
336
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(8) ~ .kui-SegmentedControlIndicator {
|
|
337
|
-
transform: translateY(700%);
|
|
338
|
-
}
|
|
339
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(9) ~ .kui-SegmentedControlIndicator {
|
|
340
|
-
transform: translateY(800%);
|
|
341
|
-
}
|
|
342
|
-
:where(.kui-r-orientation-vertical) .kui-SegmentedControlItem[data-state='on']:nth-child(10) ~ .kui-SegmentedControlIndicator {
|
|
343
|
-
transform: translateY(900%);
|
|
220
|
+
height: calc(100% / var(--segmented-control-count, 1));
|
|
221
|
+
transform: translateY(calc(var(--segmented-control-index, 0) * 100%));
|
|
344
222
|
}
|
|
345
223
|
|
|
346
224
|
/* * * * * * * * * * * * * * * * * * * */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { warnDeprecated } from '../helpers/warn-deprecated.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
5
|
import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
|
|
7
|
-
import { useControllableState } from 'radix-ui/internal';
|
|
6
|
+
import { useComposedRefs, useControllableState } from 'radix-ui/internal';
|
|
8
7
|
|
|
9
8
|
import { segmentedControlRootPropDefs } from './segmented-control.props.js';
|
|
10
9
|
import { extractProps } from '../helpers/extract-props.js';
|
|
@@ -23,6 +22,8 @@ interface SegmentedControlRootProps
|
|
|
23
22
|
onValueChange?(value: string): void;
|
|
24
23
|
}
|
|
25
24
|
|
|
25
|
+
const useIsomorphicLayoutEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;
|
|
26
|
+
|
|
26
27
|
const SegmentedControlRoot = React.forwardRef<HTMLDivElement, SegmentedControlRootProps>(
|
|
27
28
|
(ownProps, forwardedRef) => {
|
|
28
29
|
const props = useThemeSizeProps(ownProps, segmentedControlRootPropDefs.size);
|
|
@@ -33,6 +34,7 @@ const SegmentedControlRoot = React.forwardRef<HTMLDivElement, SegmentedControlRo
|
|
|
33
34
|
value: valueProp,
|
|
34
35
|
defaultValue: defaultValueProp,
|
|
35
36
|
onValueChange: onValueChangeProp,
|
|
37
|
+
style,
|
|
36
38
|
...rootProps
|
|
37
39
|
} = extractProps(props, segmentedControlRootPropDefs);
|
|
38
40
|
|
|
@@ -42,11 +44,39 @@ const SegmentedControlRoot = React.forwardRef<HTMLDivElement, SegmentedControlRo
|
|
|
42
44
|
defaultProp: defaultValueProp ?? '',
|
|
43
45
|
});
|
|
44
46
|
|
|
47
|
+
// The indicator is sized and placed from the item count and the selected index, written
|
|
48
|
+
// as custom properties. They are read from the children on render, so the server markup
|
|
49
|
+
// is right, then corrected from the DOM, which also sees items inside fragments or
|
|
50
|
+
// wrapper components.
|
|
51
|
+
const rootRef = React.useRef<HTMLDivElement>(null);
|
|
52
|
+
const composedRef = useComposedRefs(forwardedRef, rootRef);
|
|
53
|
+
const items = React.Children.toArray(children).filter(React.isValidElement);
|
|
54
|
+
const renderedCount = items.length;
|
|
55
|
+
const renderedIndex = Math.max(
|
|
56
|
+
0,
|
|
57
|
+
items.findIndex((child) => (child.props as { value?: unknown }).value === value),
|
|
58
|
+
);
|
|
59
|
+
useIsomorphicLayoutEffect(() => {
|
|
60
|
+
const root = rootRef.current;
|
|
61
|
+
if (!root) return;
|
|
62
|
+
const domItems = Array.from(root.querySelectorAll(':scope > .kui-SegmentedControlItem'));
|
|
63
|
+
const index = domItems.findIndex((item) => item.getAttribute('data-state') === 'on');
|
|
64
|
+
root.style.setProperty('--segmented-control-count', String(domItems.length || 1));
|
|
65
|
+
root.style.setProperty('--segmented-control-index', String(Math.max(0, index)));
|
|
66
|
+
});
|
|
67
|
+
|
|
45
68
|
return (
|
|
46
69
|
<ToggleGroupPrimitive.Root
|
|
47
70
|
data-disabled={props.disabled || undefined}
|
|
48
71
|
data-radius={radius}
|
|
49
|
-
ref={
|
|
72
|
+
ref={composedRef}
|
|
73
|
+
style={
|
|
74
|
+
{
|
|
75
|
+
'--segmented-control-count': renderedCount || 1,
|
|
76
|
+
'--segmented-control-index': renderedIndex,
|
|
77
|
+
...style,
|
|
78
|
+
} as React.CSSProperties
|
|
79
|
+
}
|
|
50
80
|
className={classNames('kui-SegmentedControlRoot', className)}
|
|
51
81
|
onValueChange={(value) => {
|
|
52
82
|
if (value) {
|
|
@@ -70,6 +100,8 @@ SegmentedControlRoot.displayName = 'SegmentedControl.Root';
|
|
|
70
100
|
|
|
71
101
|
interface SegmentedControlItemOwnProps {
|
|
72
102
|
value: string;
|
|
103
|
+
/** When true, this segment can't be selected. */
|
|
104
|
+
disabled?: boolean;
|
|
73
105
|
/** When true, applies fixed square width for icon-only segments */
|
|
74
106
|
iconOnly?: boolean;
|
|
75
107
|
}
|
|
@@ -77,7 +109,7 @@ interface SegmentedControlItemOwnProps {
|
|
|
77
109
|
interface SegmentedControlItemProps
|
|
78
110
|
extends ComponentPropsWithout<
|
|
79
111
|
typeof ToggleGroupPrimitive.Item,
|
|
80
|
-
RemovedProps | '
|
|
112
|
+
RemovedProps | 'type' | 'value'
|
|
81
113
|
>,
|
|
82
114
|
SegmentedControlItemOwnProps {}
|
|
83
115
|
|
|
@@ -88,7 +120,6 @@ const SegmentedControlItem = React.forwardRef<HTMLButtonElement, SegmentedContro
|
|
|
88
120
|
className={classNames('kui-reset', 'kui-SegmentedControlItem', className)}
|
|
89
121
|
data-icon-only={iconOnly || undefined}
|
|
90
122
|
{...props}
|
|
91
|
-
disabled={false}
|
|
92
123
|
asChild={false}
|
|
93
124
|
>
|
|
94
125
|
<span className="kui-SegmentedControlItemSeparator" />
|