@womp/kookie-ui 0.34.1 → 0.34.2
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/README.md +1 -1
- package/components.css +15 -4
- package/dist/cjs/components/_internal/pane-chrome.d.ts +1 -2
- package/dist/cjs/components/_internal/pane-chrome.d.ts.map +1 -1
- package/dist/cjs/components/_internal/pane-chrome.js.map +2 -2
- package/dist/cjs/components/_internal/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
- package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-handles.js +1 -1
- package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
- package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-resizable.js +1 -1
- package/dist/cjs/components/_internal/shell-resizable.js.map +3 -3
- package/dist/cjs/components/_internal/shell-resize.d.ts +2 -0
- package/dist/cjs/components/_internal/shell-resize.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-resize.js.map +2 -2
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
- 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 +2 -2
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +3 -3
- 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 +3 -3
- package/dist/cjs/components/combobox.d.ts +16 -0
- package/dist/cjs/components/combobox.d.ts.map +1 -1
- package/dist/cjs/components/combobox.js +1 -1
- package/dist/cjs/components/combobox.js.map +2 -2
- package/dist/cjs/components/index.js +2 -2
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/message-scroller.js +1 -1
- package/dist/cjs/components/message-scroller.js.map +3 -3
- 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/navigator.js +1 -1
- package/dist/cjs/components/navigator.js.map +3 -3
- package/dist/cjs/components/notice.js +1 -1
- package/dist/cjs/components/notice.js.map +3 -3
- package/dist/cjs/components/schemas/base-button.schema.d.ts +7 -0
- package/dist/cjs/components/schemas/base-button.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/base-button.schema.js +1 -1
- package/dist/cjs/components/schemas/base-button.schema.js.map +2 -2
- package/dist/cjs/components/schemas/button.schema.d.ts +14 -0
- package/dist/cjs/components/schemas/button.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/button.schema.js +1 -1
- package/dist/cjs/components/schemas/button.schema.js.map +2 -2
- package/dist/cjs/components/schemas/index.js +1 -1
- package/dist/cjs/components/schemas/index.js.map +2 -2
- package/dist/cjs/components/schemas/shell.schema.d.ts +7 -6
- package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/shell.schema.js +1 -1
- package/dist/cjs/components/schemas/shell.schema.js.map +2 -2
- package/dist/cjs/components/schemas/toggle.schema.d.ts +83 -77
- package/dist/cjs/components/schemas/toggle.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/toggle.schema.js +1 -1
- package/dist/cjs/components/schemas/toggle.schema.js.map +2 -2
- 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.js +1 -1
- package/dist/cjs/components/select.js.map +2 -2
- package/dist/cjs/components/sheet.d.ts +2 -2
- package/dist/cjs/components/sheet.js.map +1 -1
- package/dist/cjs/components/shell.context.js.map +1 -1
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +3 -3
- package/dist/cjs/components/sidebar.d.ts +1 -1
- 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 +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 +3 -3
- package/dist/cjs/components/toggle.js +1 -1
- package/dist/cjs/components/toggle.js.map +3 -3
- package/dist/cjs/components/toolbar.js +1 -1
- package/dist/cjs/components/toolbar.js.map +3 -3
- 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/index.js +3 -3
- package/dist/cjs/helpers/index.js.map +2 -2
- package/dist/cjs/helpers/map-prop-values.d.ts.map +1 -1
- package/dist/cjs/helpers/map-prop-values.js +1 -1
- package/dist/cjs/helpers/map-prop-values.js.map +2 -2
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/props/index.d.ts +6 -0
- package/dist/cjs/props/index.d.ts.map +1 -1
- package/dist/cjs/props/index.js +1 -1
- package/dist/cjs/props/index.js.map +4 -4
- package/dist/esm/chunk-25FNCKUM.js +2 -0
- package/dist/esm/chunk-25FNCKUM.js.map +7 -0
- package/dist/esm/{chunk-KDJM4NQQ.js → chunk-2WFN4D52.js} +2 -2
- package/dist/esm/chunk-4OJRLS5N.js +3 -0
- package/dist/esm/chunk-4OJRLS5N.js.map +7 -0
- package/dist/esm/chunk-4TTRPCGG.js +3 -0
- package/dist/esm/{chunk-QKCNGEX4.js.map → chunk-4TTRPCGG.js.map} +3 -3
- package/dist/esm/chunk-4X64QOAR.js +3 -0
- package/dist/esm/chunk-4X64QOAR.js.map +7 -0
- package/dist/esm/{chunk-L7PRLW6A.js → chunk-5APRBJRR.js} +2 -2
- package/dist/esm/{chunk-L7PRLW6A.js.map → chunk-5APRBJRR.js.map} +2 -2
- package/dist/esm/chunk-7HD5LS3M.js +3 -0
- package/dist/esm/chunk-7HD5LS3M.js.map +7 -0
- package/dist/esm/chunk-7ZOGH5NT.js +2 -0
- package/dist/esm/chunk-7ZOGH5NT.js.map +7 -0
- package/dist/esm/chunk-BJA75XKG.js +2 -0
- package/dist/esm/chunk-BJA75XKG.js.map +7 -0
- package/dist/esm/{chunk-NO2JCJWI.js → chunk-BJVXB3PN.js} +2 -2
- package/dist/esm/{chunk-BR6Z2CAE.js → chunk-C6VGCYFQ.js} +2 -2
- package/dist/esm/chunk-EZYXYLR2.js +2 -0
- package/dist/esm/chunk-EZYXYLR2.js.map +7 -0
- package/dist/esm/chunk-FTNZWAPB.js +3 -0
- package/dist/esm/{chunk-7QBNXNEN.js.map → chunk-FTNZWAPB.js.map} +3 -3
- package/dist/esm/{chunk-ZLGOZKB3.js → chunk-FYZXC7AL.js} +2 -2
- package/dist/esm/{chunk-XD676L6S.js → chunk-HQT32HQ6.js} +2 -2
- package/dist/esm/{chunk-XKYPJTRN.js → chunk-I5TPDYJO.js} +2 -2
- package/dist/esm/chunk-I77CYEBT.js +2 -0
- package/dist/esm/chunk-I77CYEBT.js.map +7 -0
- package/dist/esm/{chunk-API4DAPY.js → chunk-J7MIXG6M.js} +1 -1
- package/dist/esm/chunk-J7MIXG6M.js.map +7 -0
- package/dist/esm/{chunk-UMQOTGJC.js → chunk-M26LLCQC.js} +2 -2
- package/dist/esm/{chunk-WN3WMFAM.js → chunk-MLHS2GWL.js} +2 -2
- package/dist/esm/chunk-MPLBIPJ6.js +3 -0
- package/dist/esm/chunk-MPLBIPJ6.js.map +7 -0
- package/dist/esm/{chunk-WEBNIUEX.js → chunk-MXEOE4LA.js} +1 -1
- package/dist/esm/chunk-MXEOE4LA.js.map +7 -0
- package/dist/esm/chunk-OGVKMDO7.js +3 -0
- package/dist/esm/chunk-OGVKMDO7.js.map +7 -0
- package/dist/esm/{chunk-ODHCDJ3Y.js → chunk-PMXIQ5B4.js} +1 -1
- package/dist/esm/chunk-PMXIQ5B4.js.map +7 -0
- package/dist/esm/{chunk-LG5DPQ46.js → chunk-R4DMVTM3.js} +2 -2
- package/dist/esm/{chunk-LG5DPQ46.js.map → chunk-R4DMVTM3.js.map} +3 -3
- package/dist/esm/chunk-S6SEWECR.js +3 -0
- package/dist/esm/{chunk-5VYQDA5S.js.map → chunk-S6SEWECR.js.map} +3 -3
- package/dist/esm/{chunk-7YXHLU4C.js → chunk-TANYRHGP.js} +2 -2
- package/dist/esm/{chunk-INGT6DB6.js → chunk-TS4QCDSI.js} +1 -1
- package/dist/esm/chunk-TS4QCDSI.js.map +7 -0
- package/dist/esm/chunk-WYLIU3Q6.js +2 -0
- package/dist/esm/chunk-WYLIU3Q6.js.map +7 -0
- package/dist/esm/chunk-X4PWBFOT.js +3 -0
- package/dist/esm/chunk-X4PWBFOT.js.map +7 -0
- package/dist/esm/chunk-XFMAA4MD.js +3 -0
- package/dist/esm/chunk-XFMAA4MD.js.map +7 -0
- package/dist/esm/chunk-XGV7KNSE.js +3 -0
- package/dist/esm/chunk-XGV7KNSE.js.map +7 -0
- package/dist/esm/chunk-XOAOSRTH.js +3 -0
- package/dist/esm/chunk-XOAOSRTH.js.map +7 -0
- package/dist/esm/{chunk-YOTTLPJ3.js → chunk-Y5ITMKC6.js} +2 -2
- package/dist/esm/chunk-YLPCYCYA.js +3 -0
- package/dist/esm/chunk-YLPCYCYA.js.map +7 -0
- package/dist/esm/components/_internal/pane-chrome.d.ts +1 -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-handles.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-handles.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-resizable.js +1 -1
- package/dist/esm/components/_internal/shell-resize.d.ts +2 -0
- package/dist/esm/components/_internal/shell-resize.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-resize.js +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/accordion.props.js +1 -1
- package/dist/esm/components/accordion.props.js.map +4 -4
- package/dist/esm/components/avatar.d.ts.map +1 -1
- package/dist/esm/components/avatar.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/combobox.d.ts +16 -0
- package/dist/esm/components/combobox.d.ts.map +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/combobox.props.js +1 -1
- package/dist/esm/components/combobox.props.js.map +4 -4
- package/dist/esm/components/image.props.js +1 -1
- package/dist/esm/components/image.props.js.map +4 -4
- package/dist/esm/components/index.js +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/navbar.props.js +1 -1
- package/dist/esm/components/navbar.props.js.map +4 -4
- package/dist/esm/components/navigator.js +1 -1
- package/dist/esm/components/notice.js +1 -1
- package/dist/esm/components/schemas/base-button.schema.d.ts +7 -0
- package/dist/esm/components/schemas/base-button.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/base-button.schema.js +1 -1
- package/dist/esm/components/schemas/button.schema.d.ts +14 -0
- package/dist/esm/components/schemas/button.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/button.schema.js +1 -1
- package/dist/esm/components/schemas/index.js +1 -1
- package/dist/esm/components/schemas/shell.schema.d.ts +7 -6
- package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/shell.schema.js +1 -1
- package/dist/esm/components/schemas/toggle.schema.d.ts +83 -77
- package/dist/esm/components/schemas/toggle.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/toggle.schema.js +1 -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.js +1 -1
- package/dist/esm/components/sheet.d.ts +2 -2
- package/dist/esm/components/sheet.js +1 -1
- package/dist/esm/components/shell.context.js +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/sidebar.d.ts +1 -1
- package/dist/esm/components/sidebar.d.ts.map +1 -1
- package/dist/esm/components/sidebar.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/toggle.js +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/toolbar.props.js +1 -1
- package/dist/esm/components/toolbar.props.js.map +4 -4
- package/dist/esm/components/virtual-menu.d.ts.map +1 -1
- package/dist/esm/components/virtual-menu.js +1 -1
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/map-prop-values.d.ts.map +1 -1
- package/dist/esm/helpers/map-prop-values.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/index.d.ts +6 -0
- package/dist/esm/props/index.d.ts.map +1 -1
- package/dist/esm/props/index.js +1 -1
- package/layout/utilities.css +810 -0
- package/layout.css +810 -0
- package/package.json +3 -4
- package/schemas/base-button.json +13 -0
- package/schemas/button.json +13 -0
- package/schemas/index.json +51 -12
- package/schemas/shell-bottom.json +2 -2
- package/schemas/shell-content.json +2 -2
- package/schemas/shell-header.json +4 -0
- package/schemas/shell-inspector.json +2 -2
- package/schemas/shell-panel.json +2 -2
- package/schemas/shell-rail.json +2 -2
- package/schemas/shell-sidebar.json +2 -2
- package/schemas/toggle.json +9 -0
- package/src/components/_internal/base-dialog.css +1 -1
- package/src/components/_internal/pane-chrome.tsx +2 -3
- package/src/components/_internal/shell-handles.tsx +3 -0
- package/src/components/_internal/shell-resizable.tsx +9 -0
- package/src/components/_internal/shell-resize.tsx +2 -0
- package/src/components/avatar.tsx +3 -1
- package/src/components/button.tsx +1 -1
- package/src/components/chatbar.tsx +2 -1
- package/src/components/combobox.tsx +2 -3
- package/src/components/navbar.tsx +3 -4
- package/src/components/navigator.css +4 -4
- package/src/components/schemas/base-button.schema.ts +7 -0
- package/src/components/schemas/shell.schema.ts +3 -2
- package/src/components/schemas/toggle.schema.ts +2 -1
- package/src/components/segmented-control.css +13 -0
- package/src/components/segmented-control.tsx +10 -2
- package/src/components/select.tsx +2 -2
- package/src/components/sheet.tsx +2 -2
- package/src/components/shell.context.tsx +1 -1
- package/src/components/sidebar.tsx +1 -1
- package/src/components/table.tsx +4 -1
- package/src/components/text-field.css +2 -2
- package/src/components/virtual-menu.tsx +8 -1
- package/src/helpers/map-prop-values.ts +0 -1
- package/src/props/index.ts +6 -0
- package/src/styles/utilities/inset.css +135 -0
- package/styles.css +825 -4
- package/utilities.css +810 -0
- package/dist/esm/chunk-3QWGSRYC.js +0 -3
- package/dist/esm/chunk-3QWGSRYC.js.map +0 -7
- package/dist/esm/chunk-5KQCG7AV.js +0 -3
- package/dist/esm/chunk-5KQCG7AV.js.map +0 -7
- package/dist/esm/chunk-5VYQDA5S.js +0 -3
- package/dist/esm/chunk-7QBNXNEN.js +0 -3
- package/dist/esm/chunk-API4DAPY.js.map +0 -7
- package/dist/esm/chunk-BQOFHLDP.js +0 -3
- package/dist/esm/chunk-BQOFHLDP.js.map +0 -7
- package/dist/esm/chunk-CZ24FOFS.js +0 -3
- package/dist/esm/chunk-CZ24FOFS.js.map +0 -7
- package/dist/esm/chunk-EERKYRYI.js +0 -3
- package/dist/esm/chunk-EERKYRYI.js.map +0 -7
- package/dist/esm/chunk-HZYE46V2.js +0 -2
- package/dist/esm/chunk-HZYE46V2.js.map +0 -7
- package/dist/esm/chunk-IN2WND4B.js +0 -3
- package/dist/esm/chunk-IN2WND4B.js.map +0 -7
- package/dist/esm/chunk-INGT6DB6.js.map +0 -7
- package/dist/esm/chunk-J6B7UCZN.js +0 -3
- package/dist/esm/chunk-J6B7UCZN.js.map +0 -7
- package/dist/esm/chunk-JQMWNI62.js +0 -3
- package/dist/esm/chunk-JQMWNI62.js.map +0 -7
- package/dist/esm/chunk-ODHCDJ3Y.js.map +0 -7
- package/dist/esm/chunk-QKCNGEX4.js +0 -3
- package/dist/esm/chunk-TMINGBSQ.js +0 -3
- package/dist/esm/chunk-TMINGBSQ.js.map +0 -7
- package/dist/esm/chunk-WEBNIUEX.js.map +0 -7
- package/dist/esm/chunk-XF6Z5NKE.js +0 -3
- package/dist/esm/chunk-XF6Z5NKE.js.map +0 -7
- /package/dist/esm/{chunk-KDJM4NQQ.js.map → chunk-2WFN4D52.js.map} +0 -0
- /package/dist/esm/{chunk-NO2JCJWI.js.map → chunk-BJVXB3PN.js.map} +0 -0
- /package/dist/esm/{chunk-BR6Z2CAE.js.map → chunk-C6VGCYFQ.js.map} +0 -0
- /package/dist/esm/{chunk-ZLGOZKB3.js.map → chunk-FYZXC7AL.js.map} +0 -0
- /package/dist/esm/{chunk-XD676L6S.js.map → chunk-HQT32HQ6.js.map} +0 -0
- /package/dist/esm/{chunk-XKYPJTRN.js.map → chunk-I5TPDYJO.js.map} +0 -0
- /package/dist/esm/{chunk-UMQOTGJC.js.map → chunk-M26LLCQC.js.map} +0 -0
- /package/dist/esm/{chunk-WN3WMFAM.js.map → chunk-MLHS2GWL.js.map} +0 -0
- /package/dist/esm/{chunk-7YXHLU4C.js.map → chunk-TANYRHGP.js.map} +0 -0
- /package/dist/esm/{chunk-YOTTLPJ3.js.map → chunk-Y5ITMKC6.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/chatbar.tsx", "../../../src/components/button.tsx", "../../../src/components/_internal/base-button.tsx", "../../../src/props/as-child.prop.ts", "../../../src/props/color.prop.ts", "../../../src/props/radius.prop.ts", "../../../src/components/_internal/base-button.props.ts", "../../../src/components/flex.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/padding.props.ts", "../../../src/props/height.props.ts", "../../../src/props/width.props.ts", "../../../src/props/layout.props.ts", "../../../src/props/margin.props.ts", "../../../src/components/slot.tsx", "../../../src/props/gap.props.ts", "../../../src/components/flex.props.tsx", "../../../src/components/spinner.tsx", "../../../src/components/spinner.props.tsx", "../../../src/components/icons.tsx", "../../../src/hooks/theme-size.ts", "../../../src/helpers/theme-size.ts", "../../../src/components/tooltip.tsx", "../../../src/components/text.tsx", "../../../src/props/emphasis.prop.ts", "../../../src/props/leading-trim.prop.ts", "../../../src/props/text-align.prop.ts", "../../../src/props/text-wrap.prop.ts", "../../../src/props/truncate.prop.ts", "../../../src/props/font-family.prop.ts", "../../../src/props/weight.prop.ts", "../../../src/components/text.props.tsx", "../../../src/components/_internal/portal-theme.tsx", "../../../src/components/theme.tsx", "../../../src/helpers/get-matching-gray-color.ts", "../../../src/hooks/use-prop-synced-state.ts", "../../../src/components/theme.props.tsx", "../../../src/components/_internal/pane-band-context.ts", "../../../src/components/_internal/page-scope.tsx", "../../../src/components/tooltip.props.tsx", "../../../src/hooks/use-tooltip-wrapper.ts", "../../../src/components/scroll-area.tsx", "../../../src/components/scroll-area.props.tsx", "../../../src/hooks/use-scroll-edges.ts", "../../../src/hooks/use-thumb-sync.ts", "../../../src/helpers/get-subtree.ts", "../../../src/components/notice.tsx", "../../../src/components/visually-hidden.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\nimport { useDropzone } from 'react-dropzone';\n\nimport { Button } from './button.js';\nimport { CloseIcon, FileTextIcon, PaperclipIcon } from './icons.js';\nimport { Flex } from './flex.js';\nimport { ScrollArea } from './scroll-area.js';\nimport { Slot } from './slot.js';\nimport { NoticeSizeContext } from './notice.js';\nimport { useThemeSize } from '../hooks/theme-size.js';\nimport { Spinner } from './spinner.js';\nimport { Text } from './text.js';\nimport { VisuallyHidden } from './visually-hidden.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { accentColors } from '../props/color.prop.js';\nimport type { radii } from '../props/radius.prop.js';\nimport type { ButtonProps, ButtonRankProps } from './button.js';\n\n/**\n * Runs `measure` with the placeholder taken out of layout, so a height read\n * reflects the value alone.\n *\n * A textarea with an empty value lays its placeholder out as real text, so\n * `scrollHeight` reports the placeholder wrapped at whatever width the field\n * has at that instant. That sizes an empty bar to the suggestion showing in it\n * rather than to `minLines`, and when the read lands before the field has its\n * final width -- a panel still animating open, a flex parent whose basis is 0\n * -- it wraps that text at a fraction of the real width and opens the bar at\n * `maxLines`. The first keystroke takes the placeholder out of layout and the\n * height snaps back, which is what made the bug look intermittent rather than\n * simply wrong.\n *\n * The reset to 'auto' and the `scrollHeight` read sit in different functions\n * here, so the whole measurement window is wrapped rather than a single read.\n * Costs one extra style recalc on a path that is already forcing a reflow.\n */\nfunction withoutPlaceholder(el: HTMLTextAreaElement, measure: () => void): void {\n const { placeholder } = el;\n if (!placeholder) {\n measure();\n return;\n }\n el.placeholder = '';\n try {\n measure();\n } finally {\n el.placeholder = placeholder;\n }\n}\n\ntype ExpandOn = 'none' | 'focus' | 'overflow' | 'both';\ntype SendMode = 'always' | 'whenDirty' | 'never';\n\n// Attachments\n/** Status flag for attachment lifecycle. */\ntype AttachmentStatus = 'idle' | 'uploading' | 'error' | 'done';\n/**\n * Attachment data model used by Chatbar.\n * - `file` exposes the original File object for uploads and processing.\n * - `url` is an object URL used for image previews. Chatbar revokes it when the\n * attachment is removed; once an attachment is handed to `onSubmit`, the\n * consumer owns the URL and is responsible for revoking it.\n */\ninterface ChatbarAttachment {\n id: string;\n name: string;\n size: number;\n type: string;\n /** Original File object for uploads and processing */\n file: File;\n url?: string;\n status?: AttachmentStatus;\n progress?: number;\n meta?: Record<string, unknown>;\n}\n\ntype ChatbarRejectReason = 'type' | 'size' | 'count';\ninterface ChatbarAttachmentRejection {\n file: File;\n reason: ChatbarRejectReason;\n}\n\ninterface ChatbarSubmitPayload {\n value: string;\n attachments: ChatbarAttachment[];\n}\n\ninterface FilePickerOptions {\n accept?: string | string[];\n multiple?: boolean;\n}\n\ninterface ChatbarContextValue {\n open: boolean;\n setOpen(next: boolean): void;\n\n setValue(next: string): void;\n\n size: '1' | '2' | '3';\n expandOn: ExpandOn;\n minLines: number;\n maxLines: number;\n sendMode: SendMode;\n disabled?: boolean;\n readOnly?: boolean;\n paste: boolean;\n clearOnSubmit: boolean;\n multiple: boolean;\n\n textareaRef: React.RefObject<HTMLTextAreaElement | null>;\n\n attachments: ChatbarAttachment[];\n removeAttachment(id: string): void;\n\n /** Validates and submits; returns false when there was nothing to submit */\n submit(clear: boolean): boolean;\n appendFiles(files: File[]): number;\n appendFilesFromPaste(files: File[]): number;\n openFilePicker(options?: FilePickerOptions): void;\n /** Guards blur-collapse between pointerdown on a picker trigger and its click */\n beginFilePickerPress(): void;\n}\n\n/** Chatbar's own range; a Theme size of 4 maps to 3. */\nconst chatbarSizePropDef = { values: ['1', '2', '3'] as const };\n\nconst ChatbarContext = React.createContext<ChatbarContextValue | null>(null);\n// Value lives in its own context so keystrokes only re-render parts that read it\nconst ChatbarValueContext = React.createContext<string>('');\n\nconst useChatbarContext = () => {\n const ctx = React.useContext(ChatbarContext);\n if (!ctx) throw new Error('Chatbar context not found. Wrap parts in <Chatbar.Root>.');\n return ctx;\n};\n\nconst toArray = (val: string | string[] | undefined) =>\n Array.isArray(val) ? val : typeof val === 'string' ? val.split(',').map((s) => s.trim()).filter(Boolean) : [];\n\nconst matchesAccept = (file: File, patterns: string[]) => {\n if (patterns.length === 0) return true;\n const mime = file.type.toLowerCase();\n const name = file.name.toLowerCase();\n for (const patRaw of patterns) {\n const pat = patRaw.toLowerCase();\n if (pat.includes('/')) {\n const [type, subtype] = pat.split('/');\n const [fmType, fmSubtype] = mime.split('/');\n if (type === '*' || (type === fmType && (subtype === '*' || subtype === fmSubtype))) return true;\n } else if (pat.startsWith('.')) {\n if (name.endsWith(pat)) return true;\n }\n }\n return false;\n};\n\nconst IMAGE_EXT_RE = /\\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i;\nconst isImageLike = (name: string, type: string) => (type || '').toLowerCase().startsWith('image/') || IMAGE_EXT_RE.test(name);\n\nconst hasText = (value: string) => value.trim().length > 0;\n\nconst plural = (n: number, word: string) => `${n} ${word}${n === 1 ? '' : 's'}`;\n\nlet attachmentCounter = 0;\nconst createAttachmentId = () => `chatbar-attachment-${Date.now()}-${++attachmentCounter}`;\n\n/**\n * Chatbar container and state provider.\n *\n * Value & Open\n * - Supports controlled/uncontrolled `value` and `open`.\n *\n * Attachments\n * - Controlled/uncontrolled attachments with client-side filtering.\n * - Filters by `accept`/`pasteAccept`, `multiple`, `maxAttachments`, and `maxFileSize`.\n * - Rejections are reported via `onAttachmentReject`.\n *\n * Submit\n * - `onSubmit({ value, attachments })` emits both message and attachments.\n * - Submitting requires text or at least one attachment.\n * - `clearOnSubmit` clears message and attachments by default.\n */\ninterface ChatbarRootBaseProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n\n /** When the chatbar expands on its own. `none` leaves open state entirely to the consumer. */\n expandOn?: ExpandOn;\n\n /** Minimum visible lines when expanded (default: 3). The compact state is always one line. */\n minLines?: number;\n /** Maximum number of lines before scrolling (default: 6) */\n maxLines?: number;\n\n /** Controls Send button visibility only. Enter-to-submit is controlled by `Textarea submitOnEnter`. */\n sendMode?: SendMode;\n\n /** Disables text input, submission and every way of adding attachments */\n disabled?: boolean;\n /** Prevents editing, submission and adding attachments */\n readOnly?: boolean;\n\n /** Combined submit payload */\n onSubmit?: (payload: ChatbarSubmitPayload) => void;\n\n size?: '1' | '2' | '3';\n variant?: 'raised' | 'surface' | 'outline' | 'ghost' | 'soft';\n /** Accent color for the control (matches TextArea) */\n color?: (typeof accentColors)[number];\n /** Optional radius override (matches TextArea) */\n radius?: (typeof radii)[number];\n\n width?: React.CSSProperties['width'];\n maxWidth?: React.CSSProperties['maxWidth'];\n\n // Attachments API\n attachments?: ChatbarAttachment[];\n defaultAttachments?: ChatbarAttachment[];\n onAttachmentsChange?: (attachments: ChatbarAttachment[]) => void;\n accept?: string | string[];\n /** Allow more than one file per pick, paste or drop */\n multiple?: boolean;\n maxAttachments?: number;\n maxFileSize?: number;\n paste?: boolean;\n /** Accepted types for pasted files. Replaces `accept` for paste when set. */\n pasteAccept?: string | string[];\n /** Clear message and attachments after submit */\n clearOnSubmit?: boolean;\n onAttachmentReject?: (rejections: ChatbarAttachmentRejection[]) => void;\n\n /**\n * Enables drag-and-drop file uploads when true.\n *\n * When enabled:\n * - Files can be dropped anywhere on the chatbar\n * - Same validation rules apply (accept, multiple, maxFileSize, maxAttachments)\n * - Visual feedback shows during drag operations\n * - Rejected files trigger onAttachmentReject\n *\n * @default true\n */\n dropzone?: boolean;\n\n /**\n * Optional API ref to control Chatbar imperatively without relying on DOM refs.\n * Provides methods to focus the textarea and open the file picker.\n */\n apiRef?: React.Ref<ChatbarApi>;\n\n /**\n * Messages that need an answer before the next message, such as `Notice` and `Confirmation`.\n * They stack in a column above the chatbar, in the order given, so put the one the next\n * message answers last, nearest the text. They sit outside the box: a button in a notice never\n * submits the message, and pressing one never collapses the chatbar.\n */\n notices?: React.ReactNode;\n /**\n * Short facts that stay true about the conversation, such as the model or the context left.\n * They sit below the chatbar, inset from its sides.\n */\n context?: React.ReactNode;\n}\n\ntype RootElement = React.ElementRef<'div'>;\n/** Imperative API for Chatbar.Root */\nexport interface ChatbarApi {\n /** Focus the textarea input */\n focusTextarea: () => void;\n /** Open the file picker dialog (respects accept/multiple). No-op when disabled or read-only. */\n openFilePicker: () => void;\n}\n/**\n * Chatbar container and state provider.\n *\n * Behavior\n * - Supports controlled and uncontrolled `value` and `open` states via props.\n * - Provides context to subcomponents like `Textarea`, `Row`, and `Send`.\n * - Exposes `data-state`, `data-disabled`, and `data-readonly` attributes for styling.\n *\n * Attachments\n * - Paste-to-attach: when `paste` is enabled, pasting files adds attachments.\n * - Additions and rejections are announced through a polite live region.\n *\n * Dropzone\n * - When `dropzone` is true, enables drag-and-drop file uploads.\n * - Visual feedback via `data-drop-active` attribute during drag operations.\n *\n * Accessibility\n * - Consumers should label the `Textarea` via `aria-label`/`aria-labelledby`.\n */\ninterface RootProps extends ComponentPropsWithout<'div', RemovedProps | 'onSubmit' | 'color'>, ChatbarRootBaseProps {}\n\nconst Root = React.forwardRef<RootElement, RootProps>((props, forwardedRef) => {\n const {\n className,\n style,\n children,\n value: valueProp,\n defaultValue = '',\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n expandOn = 'both',\n minLines = 3,\n maxLines = 6,\n sendMode = 'whenDirty',\n disabled,\n readOnly,\n onSubmit,\n size: sizeProp,\n variant,\n color,\n radius,\n width,\n maxWidth,\n attachments: attachmentsProp,\n defaultAttachments,\n onAttachmentsChange,\n accept,\n multiple = true,\n maxAttachments,\n maxFileSize,\n paste = true,\n pasteAccept,\n clearOnSubmit = true,\n onAttachmentReject,\n dropzone = true,\n apiRef,\n onBlurCapture,\n notices,\n context,\n ...divProps\n } = props;\n const size = useThemeSize(sizeProp, chatbarSizePropDef);\n\n const isValueControlled = valueProp != null;\n const [valueUncontrolled, setValueUncontrolled] = React.useState<string>(defaultValue);\n const value = isValueControlled ? valueProp : valueUncontrolled;\n\n const isOpenControlled = openProp != null;\n const [openUncontrolled, setOpenUncontrolled] = React.useState<boolean>(defaultOpen);\n const open = isOpenControlled ? openProp : openUncontrolled;\n\n // Treat `attachments` as controlled if the prop is provided, even if its value is `undefined`.\n // This avoids switching between controlled and uncontrolled when a consumer sets\n // `attachments={undefined}` to clear attachments. In that case we normalize to an empty array.\n const isAttachmentsControlled = 'attachments' in props;\n const [attachmentsUncontrolled, setAttachmentsUncontrolled] = React.useState<ChatbarAttachment[]>(() => defaultAttachments ?? []);\n const attachments = React.useMemo(\n () => (isAttachmentsControlled ? (attachmentsProp ?? []) : attachmentsUncontrolled),\n [isAttachmentsControlled, attachmentsProp, attachmentsUncontrolled],\n );\n\n // `id` changes on every announcement so identical messages still update the live region\n const [announcement, setAnnouncementState] = React.useState({ text: '', id: 0 });\n const announce = React.useCallback((text: string) => setAnnouncementState((prev) => ({ text, id: prev.id + 1 })), []);\n\n const rootRef = React.useRef<HTMLDivElement>(null);\n const composedRootRef = useComposedRefs(forwardedRef, rootRef);\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n // Blur-collapse guards: `pickerOpenRef` is true while the native dialog is open,\n // `pressGuardRef` covers the gap between pointerdown on a trigger and its click\n // (Safari blurs the textarea before the click fires).\n const pickerOpenRef = React.useRef(false);\n const pressGuardRef = React.useRef(false);\n const pressGuardTimerRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const pickerRef = React.useRef<{ patterns: string[]; multiple: boolean } | null>(null);\n\n const acceptKey = toArray(accept).join(',');\n const pasteAcceptKey = toArray(pasteAccept).join(',');\n const accepts = React.useMemo(() => toArray(acceptKey), [acceptKey]);\n const pasteAccepts = React.useMemo(() => (pasteAcceptKey ? toArray(pasteAcceptKey) : accepts), [pasteAcceptKey, accepts]);\n\n // Latest props/state for stable callbacks. Synced during render (not in an effect) so\n // child layout effects that call setOpen/setValue see this render's handlers.\n const snapshot = {\n value,\n attachments,\n accepts,\n pasteAccepts,\n multiple,\n maxAttachments,\n maxFileSize,\n disabled,\n readOnly,\n expandOn,\n isValueControlled,\n isOpenControlled,\n isAttachmentsControlled,\n onValueChange,\n onOpenChange,\n onAttachmentsChange,\n onAttachmentReject,\n onSubmit,\n };\n const latest = React.useRef(snapshot);\n // eslint-disable-next-line react-hooks/refs -- read only in callbacks/effects; see comment above\n latest.current = snapshot;\n\n // Attachments set during the current event, before Root re-renders. Cleared at the end\n // of the task so a controlled parent that rejects the change is not overridden.\n const pendingAttachmentsRef = React.useRef<ChatbarAttachment[] | null>(null);\n const getAttachments = React.useCallback(() => pendingAttachmentsRef.current ?? latest.current.attachments, []);\n\n const setOpen = React.useCallback((next: boolean) => {\n if (!latest.current.isOpenControlled) setOpenUncontrolled(next);\n latest.current.onOpenChange?.(next);\n }, []);\n\n const setValue = React.useCallback((next: string) => {\n if (!latest.current.isValueControlled) setValueUncontrolled(next);\n latest.current.onValueChange?.(next);\n }, []);\n\n const setAttachments = React.useCallback((next: ChatbarAttachment[]) => {\n // Back-to-back updates in one event must see each other\n pendingAttachmentsRef.current = next;\n queueMicrotask(() => {\n pendingAttachmentsRef.current = null;\n });\n if (!latest.current.isAttachmentsControlled) setAttachmentsUncontrolled(next);\n latest.current.onAttachmentsChange?.(next);\n }, []);\n\n // Object URLs Chatbar created and still owns\n const ownedUrlsRef = React.useRef<Set<string>>(new Set());\n\n const addFiles = React.useCallback(\n (files: File[], patterns: string[], multiple: boolean = latest.current.multiple): number => {\n const cfg = latest.current;\n if (cfg.disabled || cfg.readOnly || files.length === 0) return 0;\n\n const current = getAttachments();\n const next: ChatbarAttachment[] = [];\n const rejected: ChatbarAttachmentRejection[] = [];\n const remainingSlots = typeof cfg.maxAttachments === 'number' ? Math.max(cfg.maxAttachments - current.length, 0) : Infinity;\n const perActionLimit = multiple ? Infinity : 1;\n\n for (const file of files) {\n if (next.length >= remainingSlots || next.length >= perActionLimit) {\n rejected.push({ file, reason: 'count' });\n continue;\n }\n if (typeof cfg.maxFileSize === 'number' && file.size > cfg.maxFileSize) {\n rejected.push({ file, reason: 'size' });\n continue;\n }\n if (!matchesAccept(file, patterns)) {\n rejected.push({ file, reason: 'type' });\n continue;\n }\n const url = isImageLike(file.name, file.type) ? URL.createObjectURL(file) : undefined;\n if (url) ownedUrlsRef.current.add(url);\n next.push({ id: createAttachmentId(), name: file.name, size: file.size, type: file.type, file, url, status: 'idle' });\n }\n\n const messages: string[] = [];\n if (next.length > 0) {\n setAttachments(current.concat(next));\n if (cfg.expandOn !== 'none') setOpen(true);\n messages.push(`${plural(next.length, 'file')} attached.`);\n }\n if (rejected.length > 0) {\n cfg.onAttachmentReject?.(rejected);\n messages.push(`${plural(rejected.length, 'file')} could not be attached.`);\n }\n if (messages.length > 0) announce(messages.join(' '));\n return next.length;\n },\n [getAttachments, setAttachments, setOpen, announce],\n );\n\n const appendFiles = React.useCallback((files: File[]) => addFiles(files, latest.current.accepts), [addFiles]);\n const appendFilesFromPaste = React.useCallback((files: File[]) => addFiles(files, latest.current.pasteAccepts), [addFiles]);\n\n const removeAttachment = React.useCallback(\n (id: string) => {\n const current = getAttachments();\n const removed = current.find((a) => a.id === id);\n if (!removed) return;\n setAttachments(current.filter((a) => a.id !== id));\n announce(`Removed ${removed.name}.`);\n },\n [getAttachments, setAttachments, announce],\n );\n\n const submit = React.useCallback(\n (clear: boolean) => {\n const cfg = latest.current;\n if (cfg.disabled || cfg.readOnly) return false;\n const current = getAttachments();\n if (!hasText(cfg.value) && current.length === 0) return false;\n const payload = { value: cfg.value, attachments: current };\n // Hand preview URLs to the consumer only when they leave the chatbar; URLs still\n // rendered here stay owned so removing them later revokes them\n if (clear && cfg.onSubmit) {\n for (const att of current) if (att.url) ownedUrlsRef.current.delete(att.url);\n }\n cfg.onSubmit?.(payload);\n if (clear) {\n setValue('');\n setAttachments([]);\n }\n return true;\n },\n [getAttachments, setValue, setAttachments],\n );\n\n // Revoke owned object URLs that are no longer referenced by current attachments\n React.useEffect(() => {\n const owned = ownedUrlsRef.current;\n if (owned.size === 0) return;\n const current = new Set(attachments.map((a) => a.url));\n for (const url of Array.from(owned)) {\n if (!current.has(url)) {\n URL.revokeObjectURL(url);\n owned.delete(url);\n }\n }\n }, [attachments]);\n\n // On unmount, revoke URLs only when Chatbar owns the attachment list;\n // controlled attachments may still be rendered by the parent.\n React.useEffect(() => {\n const owned = ownedUrlsRef.current;\n return () => {\n if (latest.current.isAttachmentsControlled) return;\n for (const url of Array.from(owned)) URL.revokeObjectURL(url);\n owned.clear();\n };\n }, []);\n\n const openFilePicker = React.useCallback((options?: FilePickerOptions) => {\n const cfg = latest.current;\n const input = fileInputRef.current;\n // The picker guard takes over from the press guard\n clearTimeout(pressGuardTimerRef.current);\n pressGuardRef.current = false;\n if (!input || cfg.disabled || cfg.readOnly) return;\n const patterns = options?.accept != null ? toArray(options.accept) : cfg.accepts;\n const multiple = options?.multiple ?? cfg.multiple;\n pickerRef.current = { patterns, multiple };\n input.accept = patterns.join(',');\n input.multiple = multiple;\n pickerOpenRef.current = true;\n input.click();\n // Browsers block the dialog outside a user gesture; if the window kept focus,\n // no dialog opened and no focus/cancel/change event will clear the guard\n setTimeout(() => {\n if (document.hasFocus()) pickerOpenRef.current = false;\n }, 1000);\n }, []);\n\n const beginFilePickerPress = React.useCallback(() => {\n // On touch (notably iOS), the compatibility mousedown, blur and click arrive in later\n // tasks than pointerup, so hold the guard until the click or a timeout\n pressGuardRef.current = true;\n clearTimeout(pressGuardTimerRef.current);\n pressGuardTimerRef.current = setTimeout(() => {\n pressGuardRef.current = false;\n }, 800);\n }, []);\n\n React.useEffect(() => () => clearTimeout(pressGuardTimerRef.current), []);\n\n // Clear the picker guard when the dialog closes, whichever way it closes\n React.useEffect(() => {\n const input = fileInputRef.current;\n const reset = () => {\n pickerOpenRef.current = false;\n };\n window.addEventListener('focus', reset);\n input?.addEventListener('cancel', reset);\n return () => {\n window.removeEventListener('focus', reset);\n input?.removeEventListener('cancel', reset);\n };\n }, []);\n\n const handleFileInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const input = event.currentTarget;\n const files = Array.from(input.files ?? []);\n const picker = pickerRef.current;\n addFiles(files, picker?.patterns ?? latest.current.accepts, picker?.multiple);\n pickerOpenRef.current = false;\n pickerRef.current = null;\n // Reset so selecting the same file again still fires change\n input.value = '';\n },\n [addFiles],\n );\n\n const handleBlurCapture = React.useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n onBlurCapture?.(event);\n const cfg = latest.current;\n const rootEl = rootRef.current;\n if (!rootEl || cfg.expandOn === 'none') return;\n const nextTarget = event.relatedTarget as Node | null;\n if (nextTarget && rootEl.contains(nextTarget)) return;\n if (pickerOpenRef.current || pressGuardRef.current) return;\n if (!hasText(cfg.value) && getAttachments().length === 0) setOpen(false);\n },\n [onBlurCapture, setOpen, getAttachments],\n );\n\n const handleDrop = React.useCallback((files: File[]) => {\n appendFiles(files);\n }, [appendFiles]);\n\n // Validation happens in addFiles so drop, paste and picker share one rule set\n const { getRootProps, isDragActive } = useDropzone({\n onDrop: handleDrop,\n // Drop any earlier message so it is not re-announced when the drag hint goes away\n onDragEnter: () => announce(''),\n noClick: true,\n noKeyboard: true,\n // Textarea handles paste itself; letting the dropzone see it attaches twice\n noPaste: true,\n disabled: !dropzone || disabled || readOnly,\n });\n const dragActive = dropzone && isDragActive;\n\n React.useImperativeHandle(\n apiRef,\n () => ({\n focusTextarea: () => textareaRef.current?.focus({ preventScroll: true }),\n openFilePicker: () => openFilePicker(),\n }),\n [openFilePicker],\n );\n\n // Click-to-focus: focus textarea when clicking non-interactive areas inside the container\n const handleContainerPointerDown = React.useCallback(\n (event: React.PointerEvent) => {\n if (disabled) return;\n if (event.pointerType === 'mouse' && event.button !== 0) return;\n const target = event.target;\n if (target instanceof Element && target.closest('button, [role=\"button\"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex=\"-1\"])')) return;\n event.preventDefault();\n textareaRef.current?.focus({ preventScroll: true });\n },\n [disabled],\n );\n\n const contextValue = React.useMemo<ChatbarContextValue>(\n () => ({\n open,\n setOpen,\n setValue,\n size,\n expandOn,\n minLines,\n maxLines,\n sendMode,\n disabled,\n readOnly,\n paste,\n clearOnSubmit,\n multiple,\n textareaRef,\n attachments,\n removeAttachment,\n submit,\n appendFiles,\n appendFilesFromPaste,\n openFilePicker,\n beginFilePickerPress,\n }),\n [\n open, setOpen, setValue, size, expandOn, minLines, maxLines, sendMode, disabled, readOnly, paste,\n clearOnSubmit, multiple, attachments, removeAttachment, submit, appendFiles, appendFilesFromPaste,\n openFilePicker, beginFilePickerPress,\n ],\n );\n\n return (\n <ChatbarContext.Provider value={contextValue}>\n <ChatbarValueContext.Provider value={value}>\n <>\n <div\n {...divProps}\n ref={composedRootRef}\n className={classNames('kui-ChatbarRoot', `kui-r-size-${size}`, className)}\n style={{ position: 'relative', width, maxWidth, ...style }}\n data-state={open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n data-readonly={readOnly ? '' : undefined}\n data-drop-active={dragActive ? '' : undefined}\n data-accent-color={color}\n data-radius={radius}\n onBlurCapture={handleBlurCapture}\n >\n <input\n ref={fileInputRef}\n type=\"file\"\n tabIndex={-1}\n aria-hidden\n style={{ display: 'none' }}\n onChange={handleFileInputChange}\n />\n {notices ? (\n <div className=\"kui-ChatbarNotices\">\n <NoticeSizeContext.Provider value={size}>{notices}</NoticeSizeContext.Provider>\n </div>\n ) : null}\n <div {...(dropzone ? getRootProps() : {})} style={{ width: '100%', flex: '1 1 auto', minHeight: 0 }} onPointerDown={handleContainerPointerDown}>\n <div\n className={classNames('kui-ChatbarBox', `kui-variant-${variant ?? 'raised'}`)}\n style={{ position: 'relative' }}\n data-accent-color={color}\n data-radius={radius}\n >\n <div className=\"kui-ChatbarGrid\">\n {children}\n </div>\n {dragActive && (\n <div className=\"kui-ChatbarDropOverlay\" aria-hidden>\n <div className=\"kui-ChatbarDropContent\">\n <Text emphasis=\"medium\" size={size} weight=\"medium\">\n Drop files here to attach\n </Text>\n </div>\n </div>\n )}\n </div>\n </div>\n {context ? (\n <Text as=\"div\" size={size === '3' ? '2' : '1'} emphasis=\"medium\" className=\"kui-ChatbarContext\">\n {context}\n </Text>\n ) : null}\n <VisuallyHidden role=\"status\" aria-live=\"polite\">\n {dragActive ? 'Drop files here to attach.' : <span key={announcement.id}>{announcement.text}</span>}\n </VisuallyHidden>\n </div>\n </>\n </ChatbarValueContext.Provider>\n </ChatbarContext.Provider>\n );\n});\nRoot.displayName = 'Chatbar.Root';\n\n/**\n * Multi-line text input for Chatbar.\n * - Uses onChange to control value and avoid duplicate updates.\n * - Auto-resizes between minLines and maxLines.\n * - Expands on focus/overflow per `expandOn`.\n * - Paste-to-attach: when `paste` is enabled on Root, pasting files adds attachments.\n * - Provide `aria-label` or `aria-labelledby` for an accessible name.\n */\ninterface TextareaProps extends Omit<React.ComponentPropsWithoutRef<'textarea'>, 'size' | 'rows' | 'value' | 'defaultValue'> {\n asChild?: boolean;\n /**\n * When true, pressing Enter submits (Shift+Enter inserts a newline).\n * Works with every `sendMode`. Defaults to false.\n */\n submitOnEnter?: boolean;\n}\n\n/**\n * Chatbar multi-line text input.\n *\n * Behavior\n * - Controls the Chatbar value via React onChange.\n * - Auto-resizes between minLines and maxLines in a single layout effect, which\n * also opens the Chatbar when content overflows the compact height and\n * `expandOn` is `overflow` or `both`.\n * - Consumer handlers run first; calling `preventDefault` in `onKeyDown` or\n * `onPaste` skips the built-in submit or attach behavior.\n *\n * Accessibility\n * - Consumers should provide labeling via aria-label or aria-labelledby\n * on this component, as no implicit label is rendered.\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>((props, forwardedRef) => {\n const {\n className,\n style,\n asChild,\n onFocus,\n onChange,\n onPaste,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n submitOnEnter = false,\n ...textareaProps\n } = props;\n const ctx = useChatbarContext();\n const value = React.useContext(ChatbarValueContext);\n const { open, minLines, maxLines, expandOn, disabled, readOnly, setOpen, setValue, textareaRef, paste, appendFilesFromPaste, size, submit, clearOnSubmit } = ctx;\n const composedRef = useComposedRefs(forwardedRef, textareaRef);\n\n // Cached metrics to avoid repeated getComputedStyle calls\n const lineHeightRef = React.useRef(0);\n const paddingRef = React.useRef(0);\n const composingRef = React.useRef(false);\n\n const sizingRef = React.useRef({ open, minLines, maxLines });\n // Declared before the sizing effect so it runs first in the same commit\n useLayoutEffect(() => {\n sizingRef.current = { open, minLines, maxLines };\n }, [open, minLines, maxLines]);\n\n const recomputeMetrics = React.useCallback(() => {\n const el = textareaRef.current;\n if (!el) return;\n const computedStyle = window.getComputedStyle(el);\n lineHeightRef.current = parseFloat(computedStyle.lineHeight) || 20;\n paddingRef.current = (parseFloat(computedStyle.paddingTop) || 0) + (parseFloat(computedStyle.paddingBottom) || 0);\n }, [textareaRef]);\n\n // Sizes `el` for the given open state; caller must have set height to 'auto' first\n const applyHeight = React.useCallback((el: HTMLTextAreaElement, isOpen: boolean) => {\n const { minLines: min, maxLines: max } = sizingRef.current;\n const lineHeight = lineHeightRef.current;\n const padding = paddingRef.current;\n const minHeight = Math.ceil((isOpen ? min : 1) * lineHeight) + padding;\n const maxHeight = Math.ceil((isOpen ? max : 1) * lineHeight) + padding;\n const contentHeight = Math.max(el.scrollHeight, minHeight);\n el.style.height = `${Math.min(contentHeight, maxHeight)}px`;\n const overflowing = contentHeight > maxHeight;\n el.style.overflowY = overflowing ? 'auto' : 'hidden';\n el.style.maxHeight = overflowing ? `${maxHeight}px` : 'none';\n }, []);\n\n // Typography depends on size\n useLayoutEffect(() => {\n recomputeMetrics();\n }, [recomputeMetrics, size]);\n\n // Single place for sizing and overflow auto-open: one height reset, one scrollHeight read\n useLayoutEffect(() => {\n const el = textareaRef.current;\n if (!el) return;\n if (lineHeightRef.current === 0) recomputeMetrics();\n withoutPlaceholder(el, () => {\n el.style.height = 'auto';\n let isOpen = open;\n if (!open && (expandOn === 'overflow' || expandOn === 'both')) {\n const compactHeight = Math.ceil(lineHeightRef.current) + paddingRef.current;\n if (el.scrollHeight > compactHeight + 1) {\n isOpen = true;\n setOpen(true);\n }\n }\n applyHeight(el, isOpen);\n });\n }, [value, open, expandOn, minLines, maxLines, size, setOpen, textareaRef, recomputeMetrics, applyHeight]);\n\n // Width changes re-wrap text; re-measure only when the width actually changes\n React.useEffect(() => {\n const el = textareaRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n let prevWidth = -1;\n const ro = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width === prevWidth) return;\n const first = prevWidth === -1;\n prevWidth = width;\n if (first) return;\n recomputeMetrics();\n withoutPlaceholder(el, () => {\n el.style.height = 'auto';\n applyHeight(el, sizingRef.current.open);\n });\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, [textareaRef, recomputeMetrics, applyHeight]);\n\n // Dev-only warning if no accessible name is provided\n React.useEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n // Read the DOM, not the props: a `<label htmlFor>` or an asChild child's own label counts too.\n const el = textareaRef.current;\n const hasLabel =\n textareaProps['aria-label'] != null ||\n textareaProps['aria-labelledby'] != null ||\n Boolean(el?.getAttribute('aria-label') || el?.getAttribute('aria-labelledby') || el?.labels?.length);\n if (!hasLabel) {\n console.warn('[Chatbar.Textarea] Provide aria-label, aria-labelledby or a <label htmlFor> to ensure the control has an accessible name.');\n }\n // warn only on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleFocus = React.useCallback<React.FocusEventHandler<HTMLTextAreaElement>>(\n (event) => {\n onFocus?.(event);\n if (disabled || readOnly) return;\n if ((expandOn === 'focus' || expandOn === 'both') && !open) setOpen(true);\n },\n [disabled, readOnly, expandOn, open, setOpen, onFocus],\n );\n\n const handleChange = React.useCallback<React.ChangeEventHandler<HTMLTextAreaElement>>(\n (event) => {\n setValue(event.currentTarget.value);\n onChange?.(event);\n },\n [setValue, onChange],\n );\n\n const handlePaste = React.useCallback<React.ClipboardEventHandler<HTMLTextAreaElement>>(\n (event) => {\n onPaste?.(event);\n if (event.defaultPrevented || !paste || disabled || readOnly) return;\n const files = Array.from(event.clipboardData?.items ?? [])\n .filter((item) => item.kind === 'file')\n .map((item) => item.getAsFile())\n .filter((f): f is File => !!f);\n if (files.length === 0) return;\n // Suppress the filename/text representation only when a file was actually attached\n if (appendFilesFromPaste(files) > 0) event.preventDefault();\n },\n [paste, disabled, readOnly, onPaste, appendFilesFromPaste],\n );\n\n const handleCompositionStart = React.useCallback<React.CompositionEventHandler<HTMLTextAreaElement>>(\n (event) => {\n composingRef.current = true;\n onCompositionStart?.(event);\n },\n [onCompositionStart],\n );\n\n const handleCompositionEnd = React.useCallback<React.CompositionEventHandler<HTMLTextAreaElement>>(\n (event) => {\n composingRef.current = false;\n onCompositionEnd?.(event);\n },\n [onCompositionEnd],\n );\n\n const handleKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLTextAreaElement>>(\n (event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || !submitOnEnter) return;\n if (event.key !== 'Enter' || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;\n // Safari fires the IME-confirming Enter after compositionend with keyCode 229\n if (composingRef.current || event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;\n // Plain Enter never inserts a newline when submitOnEnter is on, even with nothing to send\n event.preventDefault();\n submit(clearOnSubmit);\n },\n [submitOnEnter, onKeyDown, submit, clearOnSubmit],\n );\n\n const Comp = asChild ? Slot : 'textarea';\n return (\n // className and style both reach the textarea, like every other textarea attribute.\n <div className=\"kui-ChatbarField kui-ChatbarTextarea\">\n <Comp\n {...textareaProps}\n ref={composedRef}\n className={classNames('kui-ChatbarInput', className)}\n value={value}\n onChange={handleChange}\n onFocus={handleFocus}\n onPaste={handlePaste}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n disabled={disabled}\n readOnly={readOnly}\n rows={open ? minLines : 1}\n spellCheck={textareaProps.spellCheck ?? true}\n autoCorrect={textareaProps.autoCorrect ?? 'on'}\n style={style}\n />\n </div>\n );\n});\nTextarea.displayName = 'Chatbar.Textarea';\n\ninterface InlineSlotProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n asChild?: boolean;\n children?: React.ReactNode;\n}\n\nconst InlineStart = React.forwardRef<HTMLDivElement, InlineSlotProps>((props, forwardedRef) => {\n const { children, asChild, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (ctx.open) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarInlineStart', className)}>\n {children}\n </Comp>\n );\n});\nInlineStart.displayName = 'Chatbar.InlineStart';\n\nconst InlineEnd = React.forwardRef<HTMLDivElement, InlineSlotProps>((props, forwardedRef) => {\n const { children, asChild, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (ctx.open) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarInlineEnd', className)}>\n {children}\n </Comp>\n );\n});\nInlineEnd.displayName = 'Chatbar.InlineEnd';\n\n/**\n * Renders a horizontally scrollable list of attachments above the inline row.\n * Hidden when empty unless `forceMount`. Override per-item with `renderAttachment`.\n * `Chatbar.Item`s passed as children follow the attachments in the same row.\n */\ninterface AttachmentsRowProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n asChild?: boolean;\n forceMount?: boolean;\n /** If provided, custom-render a tile; otherwise default tile is used */\n renderAttachment?: (attachment: ChatbarAttachment) => React.ReactNode;\n /** `Chatbar.Item`s: things the message refers to that are not files. */\n children?: React.ReactNode;\n}\n\nconst AttachmentsRow = React.forwardRef<HTMLDivElement, AttachmentsRowProps>((props, forwardedRef) => {\n const { asChild, forceMount, renderAttachment, className, children, ...divProps } = props;\n const ctx = useChatbarContext();\n const hasItems = React.Children.toArray(children).length > 0;\n if (ctx.attachments.length === 0 && !hasItems && !forceMount) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <div>\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarAttachmentsRow', className)} role=\"list\" aria-label={divProps['aria-label'] ?? 'Attachments'}>\n <ScrollArea className=\"kui-ChatbarScrollArea\" scrollbars=\"horizontal\">\n <Flex align=\"center\" gap=\"3\" minWidth=\"fit-content\">\n {ctx.attachments.map((att) => (\n <Attachment key={att.id} attachment={att} asChild={!!renderAttachment}>\n {renderAttachment?.(att)}\n </Attachment>\n ))}\n {children}\n </Flex>\n </ScrollArea>\n </Comp>\n </div>\n );\n});\nAttachmentsRow.displayName = 'Chatbar.AttachmentsRow';\n\n/**\n * Moves focus off a pill that is about to unmount, to the next pill's remove\n * button, the previous one's, or the text, so keyboard users are not dropped\n * to <body>.\n */\nfunction moveFocusOffPill(button: HTMLButtonElement, textareaRef: React.RefObject<HTMLTextAreaElement | null>) {\n const pill = button.closest('[role=\"listitem\"]');\n const pills = pill?.parentElement ? Array.from(pill.parentElement.children) : [];\n const index = pill ? pills.indexOf(pill) : -1;\n const neighbour = pills[index + 1] ?? pills[index - 1];\n const nextButton = neighbour?.querySelector<HTMLButtonElement>('.kui-ChatbarItemRemove');\n if (nextButton) nextButton.focus();\n else textareaRef.current?.focus({ preventScroll: true });\n}\n\n/** The pill an attachment and an item share: a lead tile, a label and \u00D7. */\nconst Pill: React.FC<{\n lead: React.ReactNode;\n leadKind: 'image' | 'icon';\n label: React.ReactNode;\n /** Read after the label by screen readers only, e.g. a file's size. */\n detail?: string;\n removeLabel: string;\n onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n}> = ({ lead, leadKind, label, detail, removeLabel, onRemove }) => {\n const ctx = useChatbarContext();\n return (\n <>\n <span className=\"kui-ChatbarItemLead\" data-kind={leadKind} aria-hidden>\n {lead}\n </span>\n <Text className=\"kui-ChatbarItemLabel\" size={ctx.size} truncate>\n {label}\n {detail ? <VisuallyHidden>, {detail}</VisuallyHidden> : null}\n </Text>\n {onRemove && (\n <Button iconOnly className=\"kui-ChatbarItemRemove\" aria-label={removeLabel} size=\"1\" variant=\"ghost\" color=\"gray\" onClick={onRemove}>\n <CloseIcon />\n </Button>\n )}\n </>\n );\n};\n\n/** Default tile renderer for a single attachment. */\ninterface AttachmentProps extends React.ComponentPropsWithoutRef<'div'> {\n attachment: ChatbarAttachment;\n asChild?: boolean;\n}\n\nconst STATUS_LABEL: Partial<Record<AttachmentStatus, string>> = { uploading: 'uploading', error: 'failed to upload' };\n\nconst Attachment = React.forwardRef<HTMLDivElement, AttachmentProps>((props, forwardedRef) => {\n const { attachment, asChild, className, children, ...divProps } = props;\n const ctx = useChatbarContext();\n const Comp = asChild ? Slot : 'div';\n const isImage = !!attachment.url && isImageLike(attachment.name, attachment.type);\n const sizeLabel = `${Math.ceil(attachment.size / 1024)} KB`;\n const statusLabel = attachment.status ? STATUS_LABEL[attachment.status] : undefined;\n const locked = ctx.disabled || ctx.readOnly;\n\n const handleRemove = (event: React.MouseEvent<HTMLButtonElement>) => {\n moveFocusOffPill(event.currentTarget, ctx.textareaRef);\n ctx.removeAttachment(attachment.id);\n };\n\n const lead =\n attachment.status === 'uploading' ? (\n <Spinner />\n ) : isImage ? (\n <img className=\"kui-ChatbarAttachmentImage\" src={attachment.url} alt=\"\" />\n ) : (\n <FileTextIcon />\n );\n\n return (\n <Comp\n {...divProps}\n ref={forwardedRef}\n className={classNames(children ? 'kui-ChatbarAttachment' : 'kui-ChatbarAttachment kui-ChatbarItem', className)}\n role=\"listitem\"\n data-kind={isImage ? 'image' : 'file'}\n data-status={attachment.status}\n title={attachment.name}\n >\n {children ?? (\n <Pill\n lead={lead}\n leadKind={isImage && attachment.status !== 'uploading' ? 'image' : 'icon'}\n label={attachment.name}\n detail={statusLabel ? `${sizeLabel}, ${statusLabel}` : sizeLabel}\n removeLabel={`Remove ${attachment.name}`}\n onRemove={locked ? undefined : handleRemove}\n />\n )}\n </Comp>\n );\n});\nAttachment.displayName = 'Chatbar.Attachment';\n\n/**\n * Something the message refers to that is not a file: a scene object, a\n * picked mode, a selection. The same pill as an attachment, placed in\n * `Chatbar.AttachmentsRow` as a child. The app owns the list, so removing one\n * calls `onRemove` and nothing else; leave it out for a pill that cannot be\n * removed.\n */\ninterface ItemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children' | 'color'> {\n /** The label. Also names the remove button: \"Remove {label}\". */\n children: string;\n /** Drawn in the lead tile, tinted with `color`. */\n icon?: React.ReactNode;\n /** A thumbnail for the lead tile, in place of the icon. */\n image?: string;\n /** Tint of the icon tile. Defaults to gray. */\n color?: (typeof accentColors)[number];\n onRemove?: () => void;\n /** Overrides the remove button's label. */\n removeLabel?: string;\n}\n\nconst Item = React.forwardRef<HTMLDivElement, ItemProps>((props, forwardedRef) => {\n const { children, icon, image, color, onRemove, removeLabel, className, ...divProps } = props;\n const ctx = useChatbarContext();\n const locked = ctx.disabled || ctx.readOnly;\n\n const handleRemove = onRemove\n ? (event: React.MouseEvent<HTMLButtonElement>) => {\n moveFocusOffPill(event.currentTarget, ctx.textareaRef);\n onRemove();\n }\n : undefined;\n\n return (\n <div\n {...divProps}\n ref={forwardedRef}\n className={classNames('kui-ChatbarItem', className)}\n role=\"listitem\"\n data-accent-color={image ? undefined : (color ?? 'gray')}\n title={children}\n >\n <Pill\n lead={image ? <img className=\"kui-ChatbarAttachmentImage\" src={image} alt=\"\" /> : icon}\n leadKind={image ? 'image' : 'icon'}\n label={children}\n removeLabel={removeLabel ?? `Remove ${children}`}\n onRemove={locked ? undefined : handleRemove}\n />\n </div>\n );\n});\nItem.displayName = 'Chatbar.Item';\n\ninterface AttachTriggerProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n /** Overrides Root `accept` for files chosen through this trigger */\n accept?: string | string[];\n multiple?: boolean;\n}\n\nconst AttachTrigger = React.forwardRef<HTMLButtonElement, AttachTriggerProps>((props, forwardedRef) => {\n // The HTML `color` attribute is dropped: Button reads `color` as an accent colour.\n const { asChild, accept, multiple, disabled: disabledProp, onPointerDown, onClick, children, color: _color, ...buttonProps } = props;\n const ctx = useChatbarContext();\n const disabled = disabledProp || ctx.disabled || ctx.readOnly;\n const triggerProps = {\n ...buttonProps,\n ref: forwardedRef,\n className: classNames('kui-ChatbarAttachTrigger', buttonProps.className),\n type: buttonProps.type ?? 'button',\n 'aria-label': buttonProps['aria-label'] ?? 'Add attachments',\n disabled,\n onPointerDown: (event: React.PointerEvent<HTMLButtonElement>) => {\n onPointerDown?.(event);\n if (!disabled && !event.defaultPrevented) ctx.beginFilePickerPress();\n },\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (disabled || event.defaultPrevented) return;\n ctx.openFilePicker({ accept, multiple });\n },\n } as const;\n\n if (asChild) return <Slot {...triggerProps}>{children}</Slot>;\n\n // Without asChild, the trigger is a quiet icon-only Button at the Chatbar's size.\n return (\n <Button iconOnly emphasis=\"quiet\" color=\"gray\" size={ctx.size} {...triggerProps}>\n {children ?? <PaperclipIcon aria-hidden />}\n </Button>\n );\n});\nAttachTrigger.displayName = 'Chatbar.AttachTrigger';\n\ninterface RowProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n asChild?: boolean;\n children?: React.ReactNode;\n}\n\nconst Row = React.forwardRef<HTMLDivElement, RowProps>((props, forwardedRef) => {\n const { asChild, children, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (!ctx.open) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <div>\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarRow', className)}>\n <Flex align=\"center\" justify=\"between\" width=\"100%\">\n {children}\n </Flex>\n </Comp>\n </div>\n );\n});\nRow.displayName = 'Chatbar.Row';\n\ntype RowSlotProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst RowStart = React.forwardRef<HTMLDivElement, RowSlotProps>((props, forwardedRef) => {\n const { className, ...divProps } = props;\n return <div {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarRowStart', className)} />;\n});\nRowStart.displayName = 'Chatbar.RowStart';\n\nconst RowEnd = React.forwardRef<HTMLDivElement, RowSlotProps>((props, forwardedRef) => {\n const { className, ...divProps } = props;\n return <div {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarRowEnd', className)} />;\n});\nRowEnd.displayName = 'Chatbar.RowEnd';\n\ntype SendStatus = 'ready' | 'submitted' | 'streaming' | 'error';\n\ntype SendProps = Omit<ButtonProps, 'aria-label' | 'aria-labelledby' | 'variant' | 'emphasis' | 'iconOnly' | 'fullWidth'> &\n ButtonRankProps & {\n /** Optional override for accessible name. Defaults to \"Send\". */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n asChild?: boolean;\n /** Clear message and attachments after sending. Defaults to Root `clearOnSubmit`. */\n clearOnSend?: boolean;\n /**\n * What the button means. `ready` sends. While a reply is `submitted` or `streaming` and the\n * box is empty, the button STOPS the reply (`onStop`); with a draft in the box it still sends,\n * and the app decides whether sending interrupts the reply. After an `error`, an empty box\n * makes it RETRY (`onRetry`). Default `ready`.\n */\n status?: SendStatus;\n /** Called when the button is pressed to stop a reply. */\n onStop?: () => void;\n /** Called when the button is pressed to retry after an error. */\n onRetry?: () => void;\n /** Accessible name while it stops. Default \"Stop\". */\n stopLabel?: string;\n /** Accessible name while it retries. Default \"Retry\". */\n retryLabel?: string;\n /** Glyph while it stops. Defaults to a square, or a spinner while `submitted`. */\n stopIcon?: React.ReactNode;\n /** Glyph while it retries. */\n retryIcon?: React.ReactNode;\n};\n\nconst Send = React.forwardRef<HTMLButtonElement, SendProps>((props, forwardedRef) => {\n const {\n asChild,\n clearOnSend,\n disabled,\n children,\n style,\n className,\n size: sizeProp,\n variant: variantProp, emphasis,\n tabIndex,\n onClick,\n status = 'ready',\n onStop,\n onRetry,\n stopLabel = 'Stop',\n retryLabel = 'Retry',\n stopIcon,\n retryIcon,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...buttonProps\n } = props;\n const ctx = useChatbarContext();\n const value = React.useContext(ChatbarValueContext);\n\n const hasContent = hasText(value) || ctx.attachments.length > 0;\n const running = status === 'submitted' || status === 'streaming';\n const mode: 'send' | 'stop' | 'retry' = hasContent ? 'send' : running ? 'stop' : status === 'error' ? 'retry' : 'send';\n\n if (ctx.sendMode === 'never' && mode === 'send') return null;\n\n const visible = mode !== 'send' || ctx.sendMode === 'always' || hasContent;\n const inactive = mode === 'send' ? disabled || ctx.disabled || ctx.readOnly || !hasContent : disabled || ctx.disabled;\n\n const sendName = ariaLabel ?? 'Send';\n const labelProps: { 'aria-label': string } | { 'aria-labelledby': string } =\n mode === 'stop' ? { 'aria-label': stopLabel } : mode === 'retry' ? { 'aria-label': retryLabel } : ariaLabelledby ? { 'aria-labelledby': ariaLabelledby } : { 'aria-label': sendName };\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented || inactive) return;\n if (mode === 'stop') {\n onStop?.();\n return;\n }\n if (mode === 'retry') {\n onRetry?.();\n return;\n }\n const clear = clearOnSend ?? ctx.clearOnSubmit;\n // Clearing hides and disables this button; keep keyboard focus in the composer\n if (ctx.submit(clear) && clear) ctx.textareaRef.current?.focus({ preventScroll: true });\n };\n\n const glyph =\n mode === 'stop' ? (\n stopIcon ?? (status === 'submitted' ? <Spinner /> : (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2\" />\n </svg>\n ))\n ) : mode === 'retry' ? (\n retryIcon ?? (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M3 12a9 9 0 1 0 3-6.7L3 8\" />\n <path d=\"M3 3v5h5\" />\n </svg>\n )\n ) : (\n children ?? (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n )\n );\n\n return (\n <Button\n iconOnly\n {...buttonProps}\n ref={forwardedRef}\n size={sizeProp ?? ctx.size}\n {...(emphasis ? { emphasis } : { variant: variantProp ?? (ctx.open || mode !== 'send' ? 'solid' : 'ghost') })}\n disabled={inactive}\n className={classNames('kui-ChatbarSend', className)}\n style={{ opacity: visible ? 1 : 0, pointerEvents: visible ? undefined : 'none', ...style }}\n // Hidden Send must not be reachable by keyboard or announced\n aria-hidden={visible ? undefined : true}\n tabIndex={visible ? tabIndex : -1}\n asChild={asChild}\n onClick={handleClick}\n data-status={status}\n data-mode={mode}\n {...labelProps}\n >\n {glyph}\n </Button>\n );\n});\nSend.displayName = 'Chatbar.Send';\n\nexport { Root, Textarea, InlineStart, InlineEnd, AttachmentsRow, Attachment, Item, AttachTrigger, Row, RowStart, RowEnd, Send };\nexport type {\n RootProps as ChatbarRootProps,\n TextareaProps as ChatbarTextareaProps,\n InlineSlotProps as ChatbarInlineSlotProps,\n AttachmentsRowProps as ChatbarAttachmentsRowProps,\n AttachmentProps as ChatbarAttachmentProps,\n ItemProps as ChatbarItemProps,\n AttachTriggerProps as ChatbarAttachTriggerProps,\n RowProps as ChatbarRowProps,\n RowSlotProps as ChatbarRowSlotProps,\n SendProps as ChatbarSendProps,\n ChatbarAttachment,\n ChatbarAttachmentRejection,\n ChatbarRejectReason,\n ChatbarSubmitPayload,\n AttachmentStatus as ChatbarAttachmentStatus,\n ExpandOn as ChatbarExpandOn,\n SendMode as ChatbarSendMode,\n SendStatus as ChatbarSendStatus,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\nimport { Tooltip } from './tooltip.js';\nimport { useTooltipWrapper } from '../hooks/use-tooltip-wrapper.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\ntype ButtonElement = React.ElementRef<typeof BaseButton>;\n\n/**\n * Tooltip configuration props that can be passed to Button\n * These props are forwarded to the underlying Tooltip component\n */\nexport interface ButtonTooltipProps {\n /** Content to display in the tooltip on hover/focus */\n tooltip?: React.ReactNode;\n /** Side of the button where the tooltip should appear */\n tooltipSide?: 'top' | 'right' | 'bottom' | 'left';\n /** Alignment of the tooltip relative to the button */\n tooltipAlign?: 'start' | 'center' | 'end';\n /** Delay before showing the tooltip (in milliseconds) */\n tooltipDelayDuration?: number;\n /** Whether to disable hoverable content behavior */\n tooltipDisableHoverableContent?: boolean;\n}\n\n/**\n * Core Button props excluding the 'as' prop for polymorphic behavior\n * Combines BaseButton props with tooltip functionality\n */\ntype ButtonEmphasis = 'loud' | 'medium' | 'quiet';\n\n/** `emphasis` is a button's rank: loud is `solid`, medium is `raised`, quiet is `ghost`. */\nconst EMPHASIS_VARIANT = { loud: 'solid', medium: 'raised', quiet: 'ghost' } as const;\n\n/**\n * A button states its rank with `emphasis` or its look with `variant`, never both.\n */\ntype ButtonRankProps =\n | {\n /** The button's look. `outline` and `surface` have no emphasis of their own. */\n variant?: BaseButtonProps['variant'];\n emphasis?: never;\n }\n | {\n /** The button's rank: `loud` (solid, the default), `medium` (raised) or `quiet` (ghost). */\n emphasis?: ButtonEmphasis;\n variant?: never;\n };\n\n/**\n * An icon-only button is square and holds only its icon, so it has no visible text: the type\n * requires `aria-label` or `aria-labelledby`. It never takes the full width.\n */\ntype ButtonIconOnlyProps =\n | {\n /** Makes the button square and shows only the icon in `children`. Requires `aria-label` or `aria-labelledby`. */\n iconOnly: true;\n /** The button's name for screen readers. Required with `iconOnly` unless `aria-labelledby` is set. */\n 'aria-label': string;\n fullWidth?: never;\n }\n | {\n /** Makes the button square and shows only the icon in `children`. Requires `aria-label` or `aria-labelledby`. */\n iconOnly: true;\n /** The id of an element that names this button. Use it instead of `aria-label`. */\n 'aria-labelledby': string;\n fullWidth?: never;\n }\n | { iconOnly?: false };\n\ntype ButtonOwnProps = Omit<BaseButtonProps, 'as' | 'variant'> & ButtonRankProps & ButtonTooltipProps & ButtonIconOnlyProps;\n\n/**\n * Polymorphic Button props that support rendering as different HTML elements\n * @template C - The element type to render as (defaults to 'button')\n */\ntype ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;\n\n/**\n * Button component type that supports polymorphic rendering\n * @template C - The element type to render as\n */\ntype ButtonComponent = <C extends React.ElementType = 'button'>(props: ButtonProps<C> & { ref?: React.ForwardedRef<ButtonElement> }) => React.ReactElement | null;\n\n/**\n * An icon-only button must have an accessible name. Logs an error, never throws: a name that is\n * still loading (an empty `aria-label` while a translation loads) must not crash the tree.\n */\nfunction validateIconButtonName(props: Record<string, unknown>) {\n if (props['aria-label'] || props['aria-labelledby']) return;\n const errorMessage =\n 'Button: an `iconOnly` button must have an accessible name. Pass `aria-label`, or ' +\n '`aria-labelledby` referencing a label element.';\n console.error(errorMessage);\n}\n\n/**\n * Button component for triggering actions throughout your interface\n *\n * The Button component is the primary interactive element in the Kookie User Interface.\n * It provides six visual variants, four sizes, comprehensive color options, and built-in\n * tooltip support. The component automatically handles icon sizing, supports responsive\n * layouts, and provides accessibility compliance out of the box.\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button>Click me</Button>\n *\n * // Button with variant and size\n * <Button variant=\"solid\" size=\"3\">Primary Action</Button>\n *\n * // Button with tooltip\n * <Button tooltip=\"Save your progress\">Save</Button>\n *\n * // Polymorphic button as link\n * <Button as=\"a\" href=\"/dashboard\">Go to Dashboard</Button>\n *\n * // Square, icon-only button: needs an accessible name\n * <Button iconOnly aria-label=\"Settings\"><Settings /></Button>\n * ```\n */\nconst Button = React.forwardRef(\n (\n {\n className,\n style,\n tooltip,\n tooltipSide = 'top',\n tooltipAlign = 'center',\n tooltipDelayDuration,\n tooltipDisableHoverableContent,\n iconOnly = false,\n emphasis,\n variant,\n ...props\n }: ButtonProps,\n forwardedRef: React.ForwardedRef<ButtonElement>,\n ) => {\n // Use shared tooltip wrapper hook for accessibility props\n const { tooltipId, hasTooltip, accessibilityProps: tooltipAccessibilityProps } = useTooltipWrapper(tooltip);\n\n // An icon-only button is square, so it never takes the full width.\n if (iconOnly) {\n validateIconButtonName(props as Record<string, unknown>);\n (props as { fullWidth?: boolean }).fullWidth = false;\n }\n\n // Both set the same thing. The types forbid it; an untyped spread that sets both logs and\n // `emphasis` wins, rather than crashing the tree.\n if (emphasis !== undefined && variant !== undefined && process.env.NODE_ENV !== 'production') {\n console.error('Button: pass `emphasis` or `variant`, not both. They set the same thing; `emphasis` wins.');\n }\n const resolvedVariant = emphasis !== undefined ? EMPHASIS_VARIANT[emphasis] : variant;\n\n // The tooltip's description joins the caller's aria-describedby rather than replacing it.\n const callerDescribedBy = (props as { 'aria-describedby'?: string })['aria-describedby'];\n const tooltipDescribedBy = (tooltipAccessibilityProps as { 'aria-describedby'?: string })['aria-describedby'];\n const ariaDescribedBy = [callerDescribedBy, tooltipDescribedBy].filter(Boolean).join(' ') || undefined;\n\n const button = (\n <BaseButton\n {...props}\n variant={resolvedVariant}\n aria-describedby={ariaDescribedBy}\n ref={forwardedRef}\n data-icon-only={iconOnly || undefined}\n className={classNames('kui-Button', className)}\n style={style}\n />\n );\n\n // If no tooltip is provided, return the button as-is for better performance\n if (!hasTooltip) {\n return button;\n }\n\n // Wrap with Tooltip when tooltip content is provided\n // This creates a compound component that handles both button and tooltip functionality\n return (\n <Tooltip content={tooltip} side={tooltipSide} align={tooltipAlign} delayDuration={tooltipDelayDuration} disableHoverableContent={tooltipDisableHoverableContent} id={tooltipId}>\n {button}\n </Tooltip>\n );\n },\n) as ButtonComponent & { displayName?: string };\n\nButton.displayName = 'Button';\n\nexport { Button };\nexport type { ButtonProps, ButtonEmphasis, ButtonRankProps, ButtonIconOnlyProps };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\n\nimport { baseButtonPropDefs } from './base-button.props.js';\nimport { Flex } from '../flex.js';\nimport { Spinner } from '../spinner.js';\nimport { TickIcon } from '../icons.js';\nimport { extractProps } from '../../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../../hooks/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../../props/prop-def.js';\n\ntype BaseButtonElement = React.ElementRef<'button'>;\ntype BaseButtonOwnProps = GetPropDefTypes<typeof baseButtonPropDefs>;\n\n/**\n * Polymorphic BaseButton props that support rendering as different HTML elements\n * Uses the proper ComponentPropsWithout pattern for type safety\n * @template C - The element type to render as (defaults to 'button')\n */\ntype PolymorphicBaseButtonProps<C extends React.ElementType = 'button'> = {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & BaseButtonOwnProps &\n BaseButtonDoneProps &\n ComponentPropsWithout<C, RemovedProps | keyof BaseButtonOwnProps | 'as' | 'done'>;\n\ninterface BaseButtonDoneProps {\n /**\n * Shows a tick in place of the icon to say that the action finished. The tick takes the\n * icon's box, so nothing moves, and the icon comes back as soon as `done` is false again. On\n * an `iconOnly` button the tick replaces the content. It doesn't block the press. Screen\n * readers don't announce the tick, so also change the label or `aria-label` (for example,\n * `Copy` to `Copied`).\n */\n done?: boolean;\n}\n\n/**\n * BaseButton props interface that combines all available props\n */\ninterface BaseButtonProps extends PolymorphicBaseButtonProps {}\n\n/**\n * BaseButton component that provides the core button functionality\n *\n * This is the foundational button component that handles all the complex logic\n * including loading states, accessibility, performance optimizations, and\n * polymorphic rendering. It's used by Button and Toggle to ensure consistent behavior across the design system.\n *\n * Key features:\n * - Loading state with spinner and accessibility announcements\n * - Comprehensive accessibility support\n * - Polymorphic rendering support\n *\n * @example\n * ```tsx\n * // Basic usage\n * <BaseButton>Click me</BaseButton>\n *\n * // With loading state\n * <BaseButton loading>Processing...</BaseButton>\n *\n * // Polymorphic rendering\n * <BaseButton as=\"a\" href=\"/link\">Link Button</BaseButton>\n * ```\n */\nconst BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, baseButtonPropDefs.size);\n\n // Extract button-specific props from the combined props object\n const {\n className,\n children,\n asChild,\n as,\n color,\n radius,\n disabled: nativeDisabled,\n done = false,\n ...baseButtonProps\n } = extractProps(props, baseButtonPropDefs);\n\n // Loading blocks activation but keeps the native `disabled` off, so the button keeps focus\n // and its place in the tab order (aria-disabled carries the state). An explicit `disabled`\n // stays native on form controls; on anything else (a link, an asChild child) the `disabled`\n // attribute does nothing, so aria-disabled carries the state and the click is stopped here.\n const loading = Boolean(props.loading);\n const canLoad = props.loading !== undefined;\n const disabled = Boolean(nativeDisabled) || loading;\n const { onClick, 'aria-describedby': ariaDescribedByProp } = baseButtonProps as {\n onClick?: React.MouseEventHandler<HTMLElement>;\n 'aria-describedby'?: string;\n };\n const handleClick = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n },\n [disabled, onClick],\n );\n\n // Which edges start or end with an icon. A bare edge pads wider under a full radius; an edge\n // holding an icon keeps the plain padding (the icon already stands between text and curve).\n // Rendering guesses from the children: an svg element, or a component at either end that is\n // not a known text component (`<Text>`, `<Kbd>`, `<Trans>` and the like), counts as an icon,\n // so the server output is right for icon components such as HugeIcons. After mount the\n // rendered DOM settles it: only an svg is an icon, which corrects a wrong guess.\n const childEdges = React.useMemo(() => {\n const content =\n asChild && React.isValidElement(children) ? (children.props as { children?: React.ReactNode }).children : children;\n // Fragments are see-through: their own first and last children are the edges.\n const items = flattenFragments(content);\n const isIcon = (node: React.ReactNode) =>\n React.isValidElement(node) &&\n (node.type === 'svg' ||\n (typeof node.type !== 'string' && node.type !== React.Fragment && !TEXT_COMPONENTS.has(componentName(node.type))));\n return { iconStart: isIcon(items[0]), iconEnd: isIcon(items[items.length - 1]) };\n }, [asChild, children]);\n const [domEdges, setDomEdges] = React.useState<{ iconStart: boolean; iconEnd: boolean } | null>(null);\n const elementRef = React.useRef<HTMLElement>(null);\n const composedRef = useComposedRefs(forwardedRef, elementRef as React.Ref<BaseButtonElement>);\n useLayoutEffect(() => {\n const element = elementRef.current;\n // While loading the sr-only copy and spinner follow the content, and while done the tick\n // stands at the start; keep the edges read before either.\n if (!element || loading || done) return;\n const contentRoot = element.querySelector(':scope > .kui-BaseButtonContent') ?? element;\n const iconStart = edgeIsSvg(contentRoot, 'start');\n const iconEnd = edgeIsSvg(contentRoot, 'end');\n setDomEdges((prev) => (prev && prev.iconStart === iconStart && prev.iconEnd === iconEnd ? prev : { iconStart, iconEnd }));\n });\n const { iconStart, iconEnd } = domEdges ?? childEdges;\n\n // Done swaps the icon for a tick in the same place: the leading icon when there is one, the\n // whole content on an icon-only button. Without a leading icon the tick goes before the label.\n const iconOnly = Boolean((baseButtonProps as Record<string, unknown>)['data-icon-only']);\n const content = React.useMemo(() => {\n if (!done) return children;\n const tick = <TickIcon key=\"kui-done-tick\" className=\"kui-BaseButtonTick\" aria-hidden />;\n const swap = (nodes: React.ReactNode): React.ReactNode => {\n if (iconOnly) return tick;\n const items = flattenFragments(nodes);\n const first = items.findIndex((node) => !(typeof node === 'string' && !node.trim()));\n // Before the DOM has been read (a button that mounts done), the edges are only a guess from\n // the children, and a label component can look like an icon. Replace only a real svg then,\n // so the label is never swapped out; otherwise put the tick before it.\n const firstNode = items[first];\n const replaceable =\n first !== -1 && iconStart && (domEdges !== null || (React.isValidElement(firstNode) && firstNode.type === 'svg'));\n if (replaceable) return items.map((node, index) => (index === first ? tick : node));\n return [tick, ...items];\n };\n if (asChild && React.isValidElement(children)) {\n const element = children as React.ReactElement<{ children?: React.ReactNode }>;\n return React.cloneElement(element, undefined, swap(element.props.children));\n }\n return swap(children);\n }, [done, children, iconOnly, iconStart, domEdges, asChild]);\n\n // asChild takes precedence over as prop for Radix Slot integration\n // When asChild is true, we use Slot.Root to merge props onto the child element\n // When asChild is false, we render as the specified element (or button by default)\n const Comp = asChild ? Slot.Root : (as || 'button');\n\n // Only pass disabled for elements that support it\n // This prevents invalid HTML attributes on unsupported elements. With asChild, the child's own\n // element type decides: a link child gets aria-disabled, not an invalid `disabled`.\n const formElements = ['button', 'input', 'textarea', 'select'];\n const renderedType = asChild ? (React.isValidElement(children) ? children.type : undefined) : (as || 'button');\n const shouldPassDisabled = typeof renderedType === 'string' && formElements.includes(renderedType);\n\n // With asChild, Radix Slot runs the child's own onClick before ours, so a disabled asChild\n // button stops the click in the capture phase, before any bubble handler runs.\n const { onClickCapture } = baseButtonProps as { onClickCapture?: React.MouseEventHandler<HTMLElement> };\n const handleClickCapture = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (asChild && disabled) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n onClickCapture?.(event);\n },\n [asChild, disabled, onClickCapture],\n );\n\n // Determine if we are rendering a real <button> element so we can set a safe\n // default type. Native <button> defaults to type=\"submit\" which can cause\n // accidental form submissions. We default to type=\"button\" unless the user\n // explicitly provided a type or we're using asChild (unknown underlying node).\n const isNativeButtonElement = !asChild && (!as || as === 'button');\n const hasExplicitTypeAttribute = 'type' in (baseButtonProps as Record<string, unknown>);\n\n // Generate unique ID for loading announcements\n const loadingId = React.useId();\n const describedById = loading ? `${loadingId}-loading` : undefined;\n\n // Loading keeps the caller's name (aria-label, aria-labelledby or the label text) and adds\n // aria-busy plus a description, as v2 does. A disabled element with no native `disabled`\n // announces itself through aria-disabled.\n const accessibilityProps = React.useMemo(() => {\n if (loading) {\n return {\n 'aria-busy': true,\n 'aria-disabled': true,\n 'aria-describedby': [ariaDescribedByProp, describedById].filter(Boolean).join(' '),\n };\n }\n if (nativeDisabled && (!shouldPassDisabled || asChild)) {\n return { 'aria-disabled': true };\n }\n return {};\n }, [loading, describedById, ariaDescribedByProp, nativeDisabled, shouldPassDisabled, asChild]);\n\n /**\n * The inside of the button. A button that takes `loading` (true or false) keeps its content in\n * a `kui-BaseButtonContent` wrapper, so starting or stopping `loading` keeps the children in\n * place (their state survives). A button that never loads skips it, which saves a node per\n * button. `display: contents` keeps the button's flex gap; while loading the wrapper is\n * `visibility: hidden` under the spinner.\n *\n * `display: contents` removes the content from the accessibility tree in some browsers, so\n * while loading the wrapper is `aria-hidden` and a `kui-sr-only` copy carries the name.\n */\n const renderInner = (inner: React.ReactNode, label: React.ReactNode) => {\n if (!canLoad) return inner;\n return (\n <>\n <span className=\"kui-BaseButtonContent\" aria-hidden={loading || undefined}>\n {inner}\n </span>\n {loading ? (\n <>\n {/* The label stays the name; the hidden \"Loading\" only describes (aria-describedby reads hidden text). */}\n <span className=\"kui-sr-only\">\n <span id={describedById} aria-hidden>\n Loading\n </span>\n {label}\n </span>\n\n {/* Centered spinner overlay during loading state */}\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>\n <Spinner aria-hidden=\"true\" />\n </span>\n </Flex>\n </>\n ) : null}\n </>\n );\n };\n const asChildContent =\n asChild && canLoad && React.isValidElement(content)\n ? React.cloneElement(\n content as React.ReactElement<{ children?: React.ReactNode }>,\n undefined,\n renderInner(\n (content.props as { children?: React.ReactNode }).children,\n React.isValidElement(children) ? (children.props as { children?: React.ReactNode }).children : null,\n ),\n )\n : content;\n\n return (\n <Comp\n data-accent-color={color}\n data-radius={radius}\n data-icon-start={iconStart || undefined}\n data-icon-end={iconEnd || undefined}\n data-done={done || undefined}\n {...baseButtonProps}\n {...accessibilityProps}\n // After the spread: `data-disabled` styles `<Button asChild disabled>`, and a wrapping\n // Radix Toggle (asChild) passes `data-disabled={undefined}` that must not erase it.\n data-disabled={disabled || undefined}\n onClick={handleClick}\n onClickCapture={handleClickCapture}\n ref={composedRef}\n className={classNames('kui-reset', 'kui-BaseButton', className)}\n {...(shouldPassDisabled && { disabled: nativeDisabled })}\n {...(isNativeButtonElement && !hasExplicitTypeAttribute ? { type: 'button' } : {})}\n >\n {asChild ? (\n // asChild: Slot merges onto the single child, so the wrapper, spinner and label copy go\n // inside that child, never beside it.\n asChildContent\n ) : (\n renderInner(content, children)\n )}\n </Comp>\n );\n});\nBaseButton.displayName = 'BaseButton';\n\n/** Components that render text, never an icon, so the render-time guess skips them. */\nconst TEXT_COMPONENTS = new Set(['Text', 'Kbd', 'Code', 'Link', 'Em', 'Strong', 'Quote', 'Badge', 'Trans']);\n\n/** A component's display name, looking through forwardRef and memo. */\nfunction componentName(type: unknown): string {\n if (!type || (typeof type !== 'function' && typeof type !== 'object')) return '';\n const named = type as { displayName?: string; name?: string; render?: unknown; type?: unknown };\n return named.displayName || named.name || componentName(named.render) || componentName(named.type);\n}\n\n/** The child list with fragments opened up: a fragment's own children are the edges. */\nfunction flattenFragments(nodes: React.ReactNode): React.ReactNode[] {\n return React.Children.toArray(nodes).flatMap((node) =>\n React.isValidElement(node) && node.type === React.Fragment\n ? flattenFragments((node.props as { children?: React.ReactNode }).children)\n : [node],\n );\n}\n\n/** Whether the first or last rendered node of `element` (blank text and comments skipped) is an svg. */\nfunction edgeIsSvg(element: Element, edge: 'start' | 'end'): boolean {\n let node = edge === 'start' ? element.firstChild : element.lastChild;\n while (node) {\n const blank =\n node.nodeType === Node.COMMENT_NODE || (node.nodeType === Node.TEXT_NODE && !node.textContent?.trim());\n if (!blank) break;\n node = edge === 'start' ? node.nextSibling : node.previousSibling;\n }\n return node?.nodeType === Node.ELEMENT_NODE && (node as Element).localName === 'svg';\n}\n\nexport { BaseButton };\nexport type { BaseButtonProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { accentColorPropDef } from '../../props/color.prop.js';\nimport { radiusPropDef } from '../../props/radius.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\n/**\n * Available button sizes for responsive design\n * Size 1: 28px - Compact for toolbars and dense interfaces\n * Size 2: 32px - Standard for most interface contexts\n * Size 3: 40px - Large for important actions and mobile touch targets\n * Size 4: 48px - Extra large for hero sections and maximum impact\n */\nconst sizes = ['1', '2', '3', '4'] as const;\n\n/**\n * Available button variants for different visual contexts\n * - raised: lifted off its ground, with an edge and a shadow\n * - solid: Primary actions that should be noticed first (the default)\n * - soft: Content-heavy interfaces, natural integration\n * - surface: Elevated appearance with subtle depth\n * - outline: Secondary actions that support primary actions\n * - ghost: Utility functions that don't compete for attention\n */\nconst variants = ['raised', 'solid', 'soft', 'surface', 'outline', 'ghost'] as const;\n\n/**\n * Base button prop definitions that define the component's API\n * \n * These props are used by all button variants (Button and Toggle)\n * to ensure consistent behavior and styling across the design system.\n * \n * Key features:\n * - Responsive sizing with mobile-first approach\n * - Six visual variants for different interface contexts\n * - Comprehensive color system with semantic meanings\n * - Loading states with automatic accessibility\n * - Polymorphic rendering support via asChild\n * \n * @example\n * ```tsx\n * // Basic button with default props\n * <BaseButton>Click me</BaseButton>\n * \n * // Button with custom size and variant\n * <BaseButton size=\"3\" variant=\"solid\">Primary Action</BaseButton>\n * \n * // Button with loading state\n * <BaseButton loading>Processing...</BaseButton>\n * ```\n */\nconst baseButtonPropDefs = {\n ...asChildPropDef,\n /**\n * Button size for responsive design and interface density\n * Supports responsive objects: { initial: '1', sm: '2', md: '3', lg: '4' }\n */\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n /**\n * Visual variant that determines the button's appearance and context\n */\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'solid' },\n ...accentColorPropDef,\n ...radiusPropDef,\n /**\n * Loading state that shows a spinner and disables interaction\n * Automatically sets disabled=true and provides accessibility announcements\n */\n loading: { type: 'boolean', className: 'kui-loading', default: false },\n /**\n * Full width mode that expands the button to fill its container\n * Useful for mobile layouts and form submissions\n */\n fullWidth: { type: 'boolean', className: 'kui-full-width', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n loading: PropDef<boolean>;\n fullWidth: PropDef<boolean>;\n};\n\nexport { baseButtonPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { layoutPropDefs } from '../props/layout.props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { Slot } from './slot.js';\nimport { flexPropDefs } from './flex.props.js';\n\nimport type { FlexOwnProps } from './flex.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { LayoutProps } from '../props/layout.props.js';\nimport type { MarginProps } from '../props/margin.props.js';\n\ntype FlexElement = React.ElementRef<'div'>;\ninterface CommonFlexProps extends MarginProps, LayoutProps, FlexOwnProps {}\ntype FlexDivProps = { as?: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype FlexSpanProps = { as: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype FlexProps = CommonFlexProps & (FlexSpanProps | FlexDivProps);\n\nconst Flex = React.forwardRef<FlexElement, FlexProps>((props, forwardedRef) => {\n const {\n className,\n asChild,\n as: Tag = 'div',\n ...flexProps\n } = extractProps(props, flexPropDefs, layoutPropDefs, marginPropDefs);\n const Comp = asChild ? Slot : Tag;\n return <Comp {...flexProps} ref={forwardedRef} className={classNames('kui-Flex', className)} />;\n});\nFlex.displayName = 'Flex';\n\nexport { Flex };\nexport type { FlexProps };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst paddingValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst paddingPropDefs = {\n /**\n * Sets the CSS **padding** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * p=\"4\"\n * p=\"100px\"\n * p={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding\n */\n p: {\n type: 'enum | string',\n className: 'kui-r-p',\n customProperties: ['--p'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** and **padding-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * px=\"4\"\n * px=\"100px\"\n * px={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n px: {\n type: 'enum | string',\n className: 'kui-r-px',\n customProperties: ['--pl', '--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** and **padding-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * py=\"4\"\n * py=\"100px\"\n * py={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n py: {\n type: 'enum | string',\n className: 'kui-r-py',\n customProperties: ['--pt', '--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pt=\"4\"\n * pt=\"100px\"\n * pt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n */\n pt: {\n type: 'enum | string',\n className: 'kui-r-pt',\n customProperties: ['--pt'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pr=\"4\"\n * pr=\"100px\"\n * pr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n pr: {\n type: 'enum | string',\n className: 'kui-r-pr',\n customProperties: ['--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pb=\"4\"\n * pb=\"100px\"\n * pb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n pb: {\n type: 'enum | string',\n className: 'kui-r-pb',\n customProperties: ['--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pl=\"4\"\n * pl=\"100px\"\n * pl={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n */\n pl: {\n type: 'enum | string',\n className: 'kui-r-pl',\n customProperties: ['--pl'],\n values: paddingValues,\n responsive: true,\n },\n} satisfies {\n p: PropDef<(typeof paddingValues)[number]>;\n px: PropDef<(typeof paddingValues)[number]>;\n py: PropDef<(typeof paddingValues)[number]>;\n pt: PropDef<(typeof paddingValues)[number]>;\n pr: PropDef<(typeof paddingValues)[number]>;\n pb: PropDef<(typeof paddingValues)[number]>;\n pl: PropDef<(typeof paddingValues)[number]>;\n};\n\ntype PaddingProps = GetPropDefTypes<typeof paddingPropDefs>;\n\nexport { paddingPropDefs };\nexport type { PaddingProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst heightPropDefs = {\n /**\n * Sets the CSS **height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * height=\"100px\"\n * height={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/height\n */\n height: {\n type: 'string',\n className: 'kui-r-h',\n customProperties: ['--height'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minHeight=\"100px\"\n * minHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\n */\n minHeight: {\n type: 'string',\n className: 'kui-r-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxHeight=\"100px\"\n * maxHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\n */\n maxHeight: {\n type: 'string',\n className: 'kui-r-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst widthPropDefs = {\n /**\n * Sets the CSS **width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * width=\"100px\"\n * width={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/width\n */\n width: {\n type: 'string',\n className: 'kui-r-w',\n customProperties: ['--width'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minWidth=\"100px\"\n * minWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\n */\n minWidth: {\n type: 'string',\n className: 'kui-r-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxWidth=\"100px\"\n * maxWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n */\n maxWidth: {\n type: 'string',\n className: 'kui-r-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n", "import { paddingPropDefs } from './padding.props.js';\nimport { heightPropDefs } from './height.props.js';\nimport { widthPropDefs } from './width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst overflowValues = ['visible', 'hidden', 'clip', 'scroll', 'auto'] as const;\nconst positionValues = ['static', 'relative', 'absolute', 'fixed', 'sticky'] as const;\n// prettier-ignore\nconst positionEdgeValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9'] as const;\nconst flexShrinkValues = ['0', '1'] as const;\nconst flexGrowValues = ['0', '1'] as const;\nconst alignSelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifySelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\n\nconst layoutPropDefs = {\n ...paddingPropDefs,\n ...widthPropDefs,\n ...heightPropDefs,\n /**\n * Sets the CSS **position** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * position=\"absolute\"\n * position={{ sm: 'absolute', lg: 'sticky' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/position\n */\n position: {\n type: 'enum',\n className: 'kui-r-position',\n values: positionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **inset** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * inset=\"4\"\n * inset=\"100px\"\n * inset={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/inset\n */\n inset: {\n type: 'enum | string',\n className: 'kui-r-inset',\n customProperties: ['--inset'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * top=\"4\"\n * top=\"100px\"\n * top={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/top\n */\n top: {\n type: 'enum | string',\n className: 'kui-r-top',\n customProperties: ['--top'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * right=\"4\"\n * right=\"100px\"\n * right={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/right\n */\n right: {\n type: 'enum | string',\n className: 'kui-r-right',\n customProperties: ['--right'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * bottom=\"4\"\n * bottom=\"100px\"\n * bottom={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/bottom\n */\n bottom: {\n type: 'enum | string',\n className: 'kui-r-bottom',\n customProperties: ['--bottom'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * left=\"4\"\n * left=\"100px\"\n * left={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/left\n */\n left: {\n type: 'enum | string',\n className: 'kui-r-left',\n customProperties: ['--left'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflow=\"hidden\"\n * overflow={{ sm: 'hidden', lg: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflow: {\n type: 'enum',\n className: 'kui-r-overflow',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-x** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowX=\"hidden\"\n * overflowX={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowX: {\n type: 'enum',\n className: 'kui-r-ox',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-y** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowY=\"hidden\"\n * overflowY={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowY: {\n type: 'enum',\n className: 'kui-r-oy',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-basis** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexBasis=\"0\"\n * flexBasis=\"100%\"\n * flexBasis={{ sm: '200px', lg: 'auto' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis\n */\n flexBasis: {\n type: 'string',\n className: 'kui-r-fb',\n customProperties: ['--flex-basis'],\n responsive: true,\n },\n /**\n * Sets the CSS **flex-shrink** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexShrink=\"0\"\n * flexShrink=\"1\"\n * flexShrink={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink\n */\n flexShrink: {\n type: 'enum | string',\n className: 'kui-r-fs',\n customProperties: ['--flex-shrink'],\n values: flexShrinkValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-grow** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexGrow=\"0\"\n * flexGrow=\"1\"\n * flexGrow={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow\n */\n flexGrow: {\n type: 'enum | string',\n className: 'kui-r-fg',\n customProperties: ['--flex-grow'],\n values: flexGrowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **grid-area** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridArea=\"header\"\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area\n */\n gridArea: {\n type: 'string',\n className: 'kui-r-ga',\n customProperties: ['--grid-area'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumn=\"1\"\n * gridColumn=\"1 / -1\"\n * gridColumn={{ sm: '1 / 3', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column\n */\n gridColumn: {\n type: 'string',\n className: 'kui-r-gc',\n customProperties: ['--grid-column'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnStart=\"1\"\n * gridColumnStart=\"auto\"\n * gridColumnStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start\n */\n gridColumnStart: {\n type: 'string',\n className: 'kui-r-gcs',\n customProperties: ['--grid-column-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnEnd=\"1\"\n * gridColumnEnd=\"auto\"\n * gridColumnEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end\n */\n gridColumnEnd: {\n type: 'string',\n className: 'kui-r-gce',\n customProperties: ['--grid-column-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRow=\"1\"\n * gridRow=\"auto\"\n * gridRow={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row\n */\n gridRow: {\n type: 'string',\n className: 'kui-r-gr',\n customProperties: ['--grid-row'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowStart=\"1\"\n * gridRowStart=\"auto\"\n * gridRowStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start\n */\n gridRowStart: {\n type: 'string',\n className: 'kui-r-grs',\n customProperties: ['--grid-row-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowEnd=\"1\"\n * gridRowEnd=\"auto\"\n * gridRowEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end\n */\n gridRowEnd: {\n type: 'string',\n className: 'kui-r-gre',\n customProperties: ['--grid-row-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **align-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * alignSelf=\"center\"\n * alignSelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-self\n */\n alignSelf: {\n type: 'enum',\n className: 'kui-r-as',\n values: alignSelfValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justifySelf=\"center\"\n * justifySelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self\n */\n justifySelf: {\n type: 'enum',\n className: 'kui-r-js',\n values: justifySelfValues,\n responsive: true,\n },\n} satisfies {\n position: PropDef<(typeof positionValues)[number]>;\n inset: PropDef<(typeof positionEdgeValues)[number]>;\n top: PropDef<(typeof positionEdgeValues)[number]>;\n right: PropDef<(typeof positionEdgeValues)[number]>;\n bottom: PropDef<(typeof positionEdgeValues)[number]>;\n left: PropDef<(typeof positionEdgeValues)[number]>;\n overflow: PropDef<(typeof overflowValues)[number]>;\n overflowX: PropDef<(typeof overflowValues)[number]>;\n overflowY: PropDef<(typeof overflowValues)[number]>;\n flexBasis: PropDef<string>;\n flexShrink: PropDef<(typeof flexShrinkValues)[number]>;\n flexGrow: PropDef<(typeof flexGrowValues)[number]>;\n gridColumn: PropDef<string>;\n gridColumnStart: PropDef<string>;\n gridColumnEnd: PropDef<string>;\n gridRow: PropDef<string>;\n gridRowStart: PropDef<string>;\n gridRowEnd: PropDef<string>;\n gridArea: PropDef<string>;\n alignSelf: PropDef<(typeof alignSelfValues)[number]>;\n justifySelf: PropDef<(typeof justifySelfValues)[number]>;\n};\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype LayoutProps = GetPropDefTypes<\n typeof paddingPropDefs & typeof widthPropDefs & typeof heightPropDefs & typeof layoutPropDefs\n>;\n\nexport { layoutPropDefs };\nexport type { LayoutProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12', 'bleed'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n", "import { Slot as SlotPrimitive } from 'radix-ui';\nexport const Root = SlotPrimitive.Root;\nexport const Slot = SlotPrimitive.Root;\nexport const Slottable: typeof SlotPrimitive.Slottable = SlotPrimitive.Slottable;\n", "import type { PropDef } from './prop-def.js';\n\nconst gapValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst gapPropDefs = {\n /**\n * Sets the CSS **gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gap=\"4\"\n * gap=\"20px\"\n * gap={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/gap\n */\n gap: {\n type: 'enum | string',\n className: 'kui-r-gap',\n customProperties: ['--gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **column-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapX=\"4\"\n * gapX=\"20px\"\n * gapX={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap\n */\n gapX: {\n type: 'enum | string',\n className: 'kui-r-cg',\n customProperties: ['--column-gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **row-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapY=\"4\"\n * gapY=\"20px\"\n * gapY={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap\n */\n gapY: {\n type: 'enum | string',\n className: 'kui-r-rg',\n customProperties: ['--row-gap'],\n values: gapValues,\n responsive: true,\n },\n} satisfies {\n gap: PropDef<(typeof gapValues)[number]>;\n gapX: PropDef<(typeof gapValues)[number]>;\n gapY: PropDef<(typeof gapValues)[number]>;\n};\n\nexport { gapPropDefs };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { gapPropDefs } from '../props/gap.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst as = ['div', 'span'] as const;\nconst displayValues = ['none', 'inline-flex', 'flex'] as const;\nconst directionValues = ['row', 'column', 'row-reverse', 'column-reverse'] as const;\nconst alignValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifyValues = ['start', 'center', 'end', 'between'] as const;\nconst wrapValues = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\nconst flexPropDefs = {\n /**\n * Controls whether to render **div** or **span**\n *\n * @example\n * as=\"div\"\n * as=\"span\"\n */\n as: { type: 'enum', values: as, default: 'div' },\n ...asChildPropDef,\n /**\n * Sets the CSS **display** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * display=\"inline-flex\"\n * display={{ sm: 'none', lg: 'flex' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/display\n */\n display: {\n type: 'enum',\n className: 'kui-r-display',\n values: displayValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-direction** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * direction=\"column\"\n * direction={{ sm: 'column', lg: 'row' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction\n */\n direction: {\n type: 'enum',\n className: 'kui-r-fd',\n values: directionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **align-items** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * align=\"center\"\n * align={{ sm: 'baseline', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-items\n */\n align: {\n type: 'enum',\n className: 'kui-r-ai',\n values: alignValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-content** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justify=\"between\"\n * justify={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content\n */\n justify: {\n type: 'enum',\n className: 'kui-r-jc',\n values: justifyValues,\n parseValue: parseJustifyValue,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-wrap** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * wrap=\"wrap\"\n * wrap={{ sm: 'wrap', lg: 'nowrap' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap\n */\n wrap: {\n type: 'enum',\n className: 'kui-r-fw',\n values: wrapValues,\n responsive: true,\n },\n ...gapPropDefs,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n display: PropDef<(typeof displayValues)[number]>;\n direction: PropDef<(typeof directionValues)[number]>;\n align: PropDef<(typeof alignValues)[number]>;\n justify: PropDef<(typeof justifyValues)[number]>;\n wrap: PropDef<(typeof wrapValues)[number]>;\n};\n\nfunction parseJustifyValue(value: string) {\n return value === 'between' ? 'space-between' : value;\n}\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype FlexOwnProps = GetPropDefTypes<\n typeof flexPropDefs & typeof gapPropDefs & typeof asChildPropDef\n>;\n\nexport { flexPropDefs };\nexport type { FlexOwnProps };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Flex } from './flex.js';\nimport { spinnerPropDefs } from './spinner.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SpinnerElement = React.ElementRef<'span'>;\ntype SpinnerOwnProps = GetPropDefTypes<typeof spinnerPropDefs>;\ninterface SpinnerProps\n extends ComponentPropsWithout<'span', RemovedProps>,\n SpinnerOwnProps {}\nconst Spinner = React.forwardRef<SpinnerElement, SpinnerProps>((props, forwardedRef) => {\n const { className, children, loading, ...spinnerProps } = extractProps(\n props,\n spinnerPropDefs\n );\n\n // Without children a Spinner is only the wheel, shown while loading.\n if (children === undefined && !loading) return null;\n\n // Decorative unless named: a named spinner is a status message, an unnamed one is hidden.\n const named =\n spinnerProps['aria-label'] !== undefined || spinnerProps['aria-labelledby'] !== undefined;\n\n const spinner = (\n <span\n role={named ? 'status' : undefined}\n aria-hidden={named ? undefined : true}\n {...spinnerProps}\n ref={forwardedRef} className={classNames('kui-Spinner', className)}>\n <span className=\"kui-SpinnerWheel\">\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n </span>\n {/* A live region reads its text, not its aria-label, so the name is also its content. */}\n {typeof spinnerProps['aria-label'] === 'string' ? (\n <span className=\"kui-sr-only\">{spinnerProps['aria-label']}</span>\n ) : null}\n </span>\n );\n\n if (children === undefined) return spinner;\n\n // With children, one tree whether loading or not, so starting or stopping never remounts them\n // (their state, focus and refs survive). At rest the host is `display: contents`; while loading\n // it centres the wheel over the children, which keep their space but are hidden.\n return (\n <span className=\"kui-SpinnerHost\" data-loading={loading || undefined} aria-busy={loading || undefined}>\n {/* `display: contents` removes the content from the accessibility tree in some browsers, so\n while loading it is removed with `aria-hidden` too. */}\n <span aria-hidden={loading || undefined} className={classNames('kui-SpinnerChildren', loading && 'kui-SpinnerHiddenChildren')}>\n {children}\n </span>\n {loading ? (\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>{spinner}</span>\n </Flex>\n ) : null}\n </span>\n );\n});\nSpinner.displayName = 'Spinner';\n\nexport { Spinner };\nexport type { SpinnerProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\nconst spinnerPropDefs = {\n loading: { type: 'boolean', default: true },\n} satisfies {\n loading: PropDef<boolean>;\n};\n\nexport { spinnerPropDefs };\n", "import React from 'react';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype IconElement = React.ElementRef<'svg'>;\ninterface IconProps extends ComponentPropsWithout<'svg', RemovedProps | 'children'> {}\n\nconst ThickDividerHorizontalIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n );\n});\n\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n );\n});\nThickCheckIcon.displayName = 'ThickCheckIcon';\n\nconst ChevronDownIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z\" />\n </svg>\n );\n});\nChevronDownIcon.displayName = 'ChevronDownIcon';\n\nconst ThickChevronRightIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronRightIcon.displayName = 'ThickChevronRightIcon';\n\nconst ThickChevronLeftIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronLeftIcon.displayName = 'ThickChevronLeftIcon';\n\nconst ThickDotIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <circle cx=\"4.5\" cy=\"4.5\" r=\"2\" />\n </svg>\n );\n});\nThickDotIcon.displayName = 'ThickDotIcon';\n\nexport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };\nexport type { IconProps };\n\n// Additional minimal icons\nconst CloseIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg\n {..._props}\n ref={_forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n});\nCloseIcon.displayName = 'CloseIcon';\n\nconst PaperclipIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n {...props}\n ref={forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n});\nPaperclipIcon.displayName = 'PaperclipIcon';\n\nconst FileIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n});\nFileIcon.displayName = 'FileIcon';\n\nconst FileTextIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n});\nFileTextIcon.displayName = 'FileTextIcon';\n\n/** The tick a button shows in place of its icon while `done`. Drawn on the 24 grid at the icon set's stroke. */\nconst TickIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M5 12.75L9.5 17.25L19 7.25\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n});\nTickIcon.displayName = 'TickIcon';\n\nexport { CloseIcon, PaperclipIcon, FileIcon, FileTextIcon, TickIcon };\n", "'use client';\n\nimport * as React from 'react';\n\nimport { THEME_SIZE_DEFAULT, clampSize } from '../helpers/theme-size.js';\nimport type { ThemeSize } from '../helpers/theme-size.js';\n\n/**\n * The app-wide size index, provided by `Theme` beside `ThemeContext`.\n *\n * It is its own context, holding one string, so a component that only needs\n * the size does not re-render when the accent colour or appearance changes.\n */\nconst ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);\nThemeSizeContext.displayName = 'ThemeSizeContext';\n\ninterface SizePropDef {\n values: readonly string[];\n default?: string;\n}\n\n/**\n * The size a component on the 1-4 index takes: what the caller said, else the\n * nearest Theme's size, mapped into the component's range.\n */\nfunction useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {\n const themeSize = React.useContext(ThemeSizeContext);\n if (explicit !== undefined) return explicit;\n // The clamped value is one of `propDef.values`, which is what `V` ranges over.\n return clampSize(themeSize, propDef.values) as V;\n}\n\n/**\n * Fills `size` from the nearest Theme when the caller left it unset, so the\n * result can go straight into `extractProps`. An explicit size, responsive\n * object included, wins.\n *\n * Returns the same props object when there is nothing to fill: when a size is\n * set, or when the theme size resolves to the prop def's own default (the\n * common case, a Theme with no size), so `extractProps` applies it as before.\n */\nfunction useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {\n const themeSize = React.useContext(ThemeSizeContext);\n if (props.size !== undefined) return props;\n const size = clampSize(themeSize, propDef.values);\n if (size === propDef.default) return props;\n return { ...props, size };\n}\n\nexport { ThemeSizeContext, useThemeSize, useThemeSizeProps };\n", "/**\n * The pure half of the theme size: the type, the default and the clamp. Server-safe.\n *\n * The context and the hooks that read it live in `hooks/theme-size.ts`, a client module, so there\n * is one `ThemeSizeContext` and importing `/helpers` from a server component does not call\n * `createContext`.\n */\n\ntype ThemeSize = '1' | '2' | '3' | '4';\n\n/** The rest of the 1-4 index when no Theme states a size. */\nconst THEME_SIZE_DEFAULT: ThemeSize = '2';\n\n/**\n * Maps the theme size onto a component's own range: the value itself when the\n * component has it, otherwise the nearest end of the range (`4` on a 1-3 scale\n * is `3`, on a 1-2 scale it is `2`).\n */\nfunction clampSize(size: ThemeSize, values: readonly string[]): string {\n if (values.includes(size)) return size;\n const n = Number(size);\n let nearest = values[0];\n let distance = Infinity;\n for (let i = 0; i < values.length; i++) {\n const d = Math.abs(Number(values[i]) - n);\n if (d < distance) {\n distance = d;\n nearest = values[i];\n }\n }\n return nearest;\n}\n\nexport { THEME_SIZE_DEFAULT, clampSize };\nexport type { ThemeSize };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\n\nimport { Text } from './text.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { tooltipPropDefs } from './tooltip.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\n/** The rest before a tooltip opens, in milliseconds. */\nconst TOOLTIP_DELAY = 200;\n\n/** True inside a `TooltipProvider`, so a Tooltip knows it need not bring its own. */\nconst TooltipProviderContext = React.createContext(false);\n\ninterface TooltipProviderProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider> {}\n\n/**\n * Groups the tooltips inside it: the first one waits `delayDuration` (200ms), and the next ones\n * open at once while the pointer moves between them. Put it once near the root of the app.\n * A Tooltip outside one still works, with the same delay, but each one waits on its own.\n */\nfunction TooltipProvider({ delayDuration = TOOLTIP_DELAY, children, ...props }: TooltipProviderProps) {\n return (\n <TooltipProviderContext.Provider value={true}>\n <TooltipPrimitive.Provider delayDuration={delayDuration} {...props}>\n {children}\n </TooltipPrimitive.Provider>\n </TooltipProviderContext.Provider>\n );\n}\nTooltipProvider.displayName = 'TooltipProvider';\n\ntype TooltipElement = React.ElementRef<typeof TooltipPrimitive.Content>;\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs>;\ninterface TooltipProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>,\n ComponentPropsWithout<typeof TooltipPrimitive.Content, RemovedProps | 'content'>,\n TooltipOwnProps {\n content: React.ReactNode;\n container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>['container'];\n}\nconst Tooltip = React.forwardRef<TooltipElement, TooltipProps>((props, forwardedRef) => {\n const {\n children,\n className,\n open,\n defaultOpen,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n content,\n container,\n forceMount,\n ...tooltipContentProps\n } = extractProps(props, tooltipPropDefs);\n const rootProps = { open, defaultOpen, onOpenChange, delayDuration, disableHoverableContent };\n const hasProvider = React.useContext(TooltipProviderContext);\n const tooltip = (\n <TooltipPrimitive.Root {...rootProps}>\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <TooltipPrimitive.Content\n sideOffset={4}\n collisionPadding={10}\n {...tooltipContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-TooltipContent', className)}\n >\n <Text as=\"p\" className=\"kui-TooltipText\" size=\"1\">\n {content}\n </Text>\n <TooltipPrimitive.Arrow className=\"kui-TooltipArrow\" />\n </TooltipPrimitive.Content>\n </PortalTheme>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n // Radix needs a provider above every tooltip. Outside a TooltipProvider, bring one.\n return hasProvider ? tooltip : <TooltipPrimitive.Provider delayDuration={TOOLTIP_DELAY}>{tooltip}</TooltipPrimitive.Provider>;\n});\nTooltip.displayName = 'Tooltip';\n\nexport { Tooltip, TooltipProvider };\nexport type { TooltipProps, TooltipProviderProps };\n", "import * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { textPropDefs } from './text.props.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype TextElement = React.ElementRef<'span'>;\ntype TextOwnProps = GetPropDefTypes<typeof textPropDefs>;\ninterface CommonTextProps extends TextOwnProps {}\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>;\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>;\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);\n\n// Pre-merge prop definitions at module level to avoid per-render allocation\n\nconst Text = React.memo(\n React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = 'span',\n color,\n ...textProps\n } = extractProps(props, textPropDefs);\n\n const combinedClassName = className ? `kui-Text ${className}` : 'kui-Text';\n\n if (asChild) {\n return (\n <Slot.Root\n data-accent-color={color}\n {...textProps}\n ref={forwardedRef}\n className={combinedClassName}\n >\n {children}\n </Slot.Root>\n );\n }\n\n return (\n <Tag\n data-accent-color={color}\n {...(textProps as React.HTMLAttributes<HTMLElement>)}\n ref={forwardedRef as any}\n className={combinedClassName}\n >\n {children}\n </Tag>\n );\n })\n);\nText.displayName = 'Text';\n\nexport { Text };\nexport type { TextProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst emphases = ['loud', 'medium', 'quiet'] as const;\n\n// Text-first components only (Text, Heading, Blockquote, Code).\n// No colour + emphasis reads the gray ink ladder; colour + emphasis reads the accent ink ladder.\n// Components that need a different default spread this def and override `default`.\nconst emphasisPropDef = {\n emphasis: {\n type: 'enum',\n className: 'kui-emphasis',\n values: emphases,\n default: undefined,\n },\n} satisfies {\n emphasis: PropDef<(typeof emphases)[number]>;\n};\n\nexport { emphasisPropDef, emphases };\n", "import type { PropDef } from './prop-def.js';\n\nconst leadingTrimValues = ['normal', 'start', 'end', 'both'] as const;\n\nconst leadingTrimPropDef = {\n trim: {\n type: 'enum',\n className: 'kui-r-lt',\n values: leadingTrimValues,\n responsive: true,\n },\n} satisfies {\n trim: PropDef<(typeof leadingTrimValues)[number]>;\n};\n\nexport { leadingTrimPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textAlignValues = ['left', 'center', 'right'] as const;\n\nconst textAlignPropDef = {\n align: {\n type: 'enum',\n className: 'kui-r-ta',\n values: textAlignValues,\n responsive: true,\n },\n} satisfies {\n align: PropDef<(typeof textAlignValues)[number]>;\n};\n\nexport { textAlignPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textWrapValues = ['wrap', 'nowrap', 'pretty', 'balance'] as const;\n\nconst textWrapPropDef = {\n wrap: {\n type: 'enum',\n className: 'kui-r-tw',\n values: textWrapValues,\n responsive: true,\n },\n} satisfies {\n wrap: PropDef<(typeof textWrapValues)[number]>;\n};\n\nexport { textWrapPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst truncatePropDef = {\n truncate: {\n type: 'boolean',\n className: 'kui-truncate',\n },\n} satisfies {\n truncate: PropDef<boolean>;\n};\n\nexport { truncatePropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\n\nconst fontFamilyPropDef = {\n font: {\n type: 'enum',\n className: 'kui-r-ff',\n values: fontFamilies,\n },\n} satisfies {\n font: PropDef<(typeof fontFamilies)[number]>;\n};\n\nexport { fontFamilyPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n/** v2's three weights (\u00A715). No bold: a larger size or stronger emphasis says importance. */\nconst weights = ['regular', 'medium', 'semibold'] as const;\n\nconst weightPropDef = {\n weight: {\n type: 'enum',\n className: 'kui-r-weight',\n values: weights,\n responsive: true,\n },\n} satisfies {\n weight: PropDef<(typeof weights)[number]>;\n};\n\nexport { weightPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { emphasisPropDef } from '../props/emphasis.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textAlignPropDef } from '../props/text-align.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { fontFamilyPropDef } from '../props/font-family.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst as = ['span', 'div', 'label', 'p'] as const;\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\n\nconst textPropDefs = {\n as: { type: 'enum', values: as, default: 'span' },\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n ...fontFamilyPropDef,\n ...weightPropDef,\n ...textAlignPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n ...colorPropDef,\n ...emphasisPropDef,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\nexport { textPropDefs };\n", "import * as React from 'react';\n\nimport { Theme } from '../theme.js';\nimport { PaneBandSizeContext } from './pane-band-context.js';\nimport { NoPageScope } from './page-scope.js';\n\n/**\n * The Theme at the root of a portalled surface (Popover, Dialog, Sheet, menus, Tooltip). The\n * surface renders outside any Shell pane even though context flows into it, so a Toolbar in it\n * does not take the pane's band size, and a title in it does not take over the pane's page. A\n * `Theme asChild` an app nests in a pane keeps both.\n */\nconst PortalTheme = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<typeof Theme>>((props, forwardedRef) => (\n <PaneBandSizeContext.Provider value={null}>\n <NoPageScope>\n <Theme {...props} ref={forwardedRef} />\n </NoPageScope>\n </PaneBandSizeContext.Provider>\n));\nPortalTheme.displayName = 'PortalTheme';\n\nexport { PortalTheme };\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Direction, Slot } from 'radix-ui';\n\nimport { getMatchingGrayColor } from '../helpers/get-matching-gray-color.js';\nimport { ThemeSizeContext } from '../hooks/theme-size.js';\nimport { usePropSyncedState } from '../hooks/use-prop-synced-state.js';\nimport { themePropDefs } from './theme.props.js';\n\nimport type { ThemeOwnProps } from './theme.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\nconst noop = () => {};\n\ntype ThemeAppearance = (typeof themePropDefs.appearance.values)[number];\ntype ThemeAccentColor = (typeof themePropDefs.accentColor.values)[number];\ntype ThemeGrayColor = (typeof themePropDefs.grayColor.values)[number];\ntype ThemeRadius = (typeof themePropDefs.radius.values)[number];\ntype ThemeFontFamily = (typeof themePropDefs.fontFamily.values)[number];\ntype ThemeSize = (typeof themePropDefs.size.values)[number];\n// Headings follow the body font until something sets this, so `undefined` is a\n// meaningful value here rather than a missing one.\ntype ThemeHeadingFontFamily = ThemeFontFamily | undefined;\n\ninterface ThemeChangeHandlers {\n onAppearanceChange: (appearance: ThemeAppearance) => void;\n onAccentColorChange: (accentColor: ThemeAccentColor) => void;\n onGrayColorChange: (grayColor: ThemeGrayColor) => void;\n onRadiusChange: (radius: ThemeRadius) => void;\n onFontFamilyChange: (fontFamily: ThemeFontFamily) => void;\n onHeadingFontFamilyChange: (headingFontFamily: ThemeHeadingFontFamily) => void;\n onSizeChange: (size: ThemeSize) => void;\n}\n\ninterface ThemeContextValue extends ThemeChangeHandlers {\n appearance: ThemeAppearance;\n accentColor: ThemeAccentColor;\n grayColor: ThemeGrayColor;\n resolvedGrayColor: ThemeGrayColor;\n radius: ThemeRadius;\n fontFamily: ThemeFontFamily;\n headingFontFamily: ThemeHeadingFontFamily;\n size: ThemeSize;\n}\n// Default theme values used when components render outside a Theme provider\nconst defaultThemeContext: ThemeContextValue = {\n appearance: themePropDefs.appearance.default,\n accentColor: themePropDefs.accentColor.default,\n grayColor: themePropDefs.grayColor.default,\n resolvedGrayColor: themePropDefs.grayColor.default,\n radius: themePropDefs.radius.default,\n fontFamily: themePropDefs.fontFamily.default,\n headingFontFamily: undefined,\n size: themePropDefs.size.default,\n onAppearanceChange: noop,\n onAccentColorChange: noop,\n onGrayColorChange: noop,\n onRadiusChange: noop,\n onFontFamilyChange: noop,\n onHeadingFontFamilyChange: noop,\n onSizeChange: noop,\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | undefined>(undefined);\n\nfunction useThemeContext() {\n const context = React.useContext(ThemeContext);\n // Return default context if used outside Theme provider (e.g., during SSR)\n return context ?? defaultThemeContext;\n}\n\ninterface ThemeProps extends ThemeImplPublicProps {}\nconst Theme = React.forwardRef<ThemeImplElement, ThemeProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n // Direction is inherited: a Radix DirectionProvider above the Theme (for a right-to-left app)\n // wins, and left-to-right stays the default when there is none.\n const dir = Direction.useDirection();\n const isRoot = context === undefined;\n if (isRoot) {\n return (\n <Direction.Provider dir={dir}>\n <ThemeRoot {...props} ref={forwardedRef} />\n </Direction.Provider>\n );\n }\n return <ThemeImpl {...props} ref={forwardedRef} />;\n});\nTheme.displayName = 'Theme';\n\nconst ThemeRoot = React.forwardRef<ThemeImplElement, ThemeImplPublicProps>((props, forwardedRef) => {\n const {\n appearance: appearanceProp = themePropDefs.appearance.default,\n accentColor: accentColorProp = themePropDefs.accentColor.default,\n grayColor: grayColorProp = themePropDefs.grayColor.default,\n radius: radiusProp = themePropDefs.radius.default,\n fontFamily: fontFamilyProp = themePropDefs.fontFamily.default,\n headingFontFamily: headingFontFamilyProp,\n size: sizeProp = themePropDefs.size.default,\n hasBackground = themePropDefs.hasBackground.default,\n ...rootProps\n } = props;\n\n // Each of these follows its prop but stays independently settable, so\n // the context setters can change the theme at runtime. Syncing during render\n // rather than in an effect matters here: an effect would commit the old\n // theme first and re-render every consumer of the context a second time.\n const [appearance, setAppearance] = usePropSyncedState(appearanceProp);\n const [accentColor, setAccentColor] = usePropSyncedState(accentColorProp);\n const [grayColor, setGrayColor] = usePropSyncedState(grayColorProp);\n const [radius, setRadius] = usePropSyncedState(radiusProp);\n const [fontFamily, setFontFamily] = usePropSyncedState(fontFamilyProp);\n const [headingFontFamily, setHeadingFontFamily] = usePropSyncedState(headingFontFamilyProp);\n const [size, setSize] = usePropSyncedState(sizeProp);\n\n return (\n <ThemeImpl\n {...rootProps}\n ref={forwardedRef}\n isRoot\n hasBackground={hasBackground}\n //\n appearance={appearance}\n accentColor={accentColor}\n grayColor={grayColor}\n radius={radius}\n fontFamily={fontFamily}\n headingFontFamily={headingFontFamily}\n size={size}\n //\n onAppearanceChange={setAppearance}\n onAccentColorChange={setAccentColor}\n onGrayColorChange={setGrayColor}\n onRadiusChange={setRadius}\n onFontFamilyChange={setFontFamily}\n onHeadingFontFamilyChange={setHeadingFontFamily}\n onSizeChange={setSize}\n />\n );\n});\nThemeRoot.displayName = 'ThemeRoot';\n\ntype ThemeImplElement = React.ElementRef<'div'>;\ninterface ThemeImplProps extends ThemeImplPublicProps, ThemeImplPrivateProps {}\ninterface ThemeImplPublicProps extends ComponentPropsWithout<'div', RemovedProps | 'dir'>, ThemeOwnProps {}\ninterface ThemeImplPrivateProps extends Partial<ThemeChangeHandlers> {\n isRoot?: boolean;\n}\nconst ThemeImpl = React.forwardRef<ThemeImplElement, ThemeImplProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n const {\n asChild,\n isRoot,\n hasBackground: hasBackgroundProp,\n //\n appearance = props.appearance ?? context?.appearance ?? themePropDefs.appearance.default,\n accentColor = props.accentColor ?? context?.accentColor ?? themePropDefs.accentColor.default,\n grayColor = props.grayColor ?? context?.resolvedGrayColor ?? themePropDefs.grayColor.default,\n radius = props.radius ?? context?.radius ?? themePropDefs.radius.default,\n fontFamily = props.fontFamily ?? context?.fontFamily ?? themePropDefs.fontFamily.default,\n headingFontFamily = props.headingFontFamily ?? context?.headingFontFamily,\n size = props.size ?? context?.size ?? themePropDefs.size.default,\n // A nested Theme forwards changes to the one above it, so a switcher\n // inside a portal (Dialog, Popover, menus) still reaches the root.\n onAppearanceChange = context?.onAppearanceChange ?? noop,\n onAccentColorChange = context?.onAccentColorChange ?? noop,\n onGrayColorChange = context?.onGrayColorChange ?? noop,\n onRadiusChange = context?.onRadiusChange ?? noop,\n onFontFamilyChange = context?.onFontFamilyChange ?? noop,\n onHeadingFontFamilyChange = context?.onHeadingFontFamilyChange ?? noop,\n onSizeChange = context?.onSizeChange ?? noop,\n //\n ...themeProps\n } = props;\n const Comp = asChild ? Slot.Root : 'div';\n const resolvedGrayColor = grayColor === 'auto' ? getMatchingGrayColor(accentColor) : grayColor;\n const isExplicitAppearance = props.appearance === 'light' || props.appearance === 'dark';\n const hasBackground = hasBackgroundProp === undefined ? isRoot || isExplicitAppearance : hasBackgroundProp;\n\n return (\n <ThemeContext.Provider\n value={React.useMemo(\n () => ({\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n }),\n [\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n ],\n )}\n >\n {/* Size travels on its own context as a bare string, so the components\n that read it do not re-render when another theme value changes. */}\n <ThemeSizeContext.Provider value={size}>\n <Comp\n data-is-root-theme={isRoot ? 'true' : 'false'}\n data-accent-color={accentColor}\n data-gray-color={resolvedGrayColor}\n // for nested `Theme` background\n data-has-background={hasBackground ? 'true' : 'false'}\n data-radius={radius}\n data-font-family={fontFamily}\n data-heading-font-family={headingFontFamily}\n ref={forwardedRef}\n {...themeProps}\n className={classNames(\n 'kui-theme',\n {\n light: appearance === 'light',\n dark: appearance === 'dark',\n },\n themeProps.className,\n )}\n />\n </ThemeSizeContext.Provider>\n </ThemeContext.Provider>\n );\n});\nThemeImpl.displayName = 'ThemeImpl';\n\nexport { Theme, ThemeContext, useThemeContext };\nexport type { ThemeProps, ThemeContextValue };\n", "import type { accentColors } from '../props/color.prop.js';\n\ntype ThemeAccentColor = (typeof accentColors)[number];\n\nexport function getMatchingGrayColor(accentColor: ThemeAccentColor) {\n switch (accentColor) {\n case 'tomato':\n case 'red':\n case 'ruby':\n case 'crimson':\n case 'pink':\n case 'plum':\n case 'purple':\n case 'violet':\n return 'mauve';\n case 'iris':\n case 'indigo':\n case 'blue':\n case 'sky':\n case 'cyan':\n return 'slate';\n case 'teal':\n case 'jade':\n case 'mint':\n case 'green':\n return 'sage';\n case 'grass':\n case 'lime':\n return 'olive';\n case 'yellow':\n case 'amber':\n case 'orange':\n case 'brown':\n case 'gold':\n case 'bronze':\n return 'sand';\n case 'gray':\n return 'gray';\n }\n}\n", "import * as React from 'react';\n\n/**\n * State that tracks a prop but can also be set imperatively \u2014 the shape `Theme`\n * needs, where a prop sets the value and the context setters can change it at runtime.\n *\n * Adjusts state during render rather than syncing in a `useEffect`. An effect\n * would commit one render carrying the *old* value and schedule a second one,\n * which for a provider means every consumer renders twice and the browser can\n * paint the stale value in between.\n *\n * @see https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\nexport function usePropSyncedState<T>(propValue: T) {\n const [value, setValue] = React.useState(propValue);\n const [previousPropValue, setPreviousPropValue] = React.useState(propValue);\n\n if (!Object.is(propValue, previousPropValue)) {\n setPreviousPropValue(propValue);\n setValue(propValue);\n }\n\n return [value, setValue] as const;\n}\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { accentColors, grayColors } from '../props/color.prop.js';\nimport { radii } from '../props/radius.prop.js';\n\nimport type { GetPropDefTypes, PropDef } from '../props/prop-def.js';\n\nconst appearances = ['inherit', 'light', 'dark'] as const;\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\nconst sizes = ['1', '2', '3', '4'] as const;\n\nconst themePropDefs = {\n ...asChildPropDef,\n /**\n * Whether to apply background color to the Theme element.\n *\n * Defaults to true for the root Theme and for Theme elements that\n * have an explicit light or dark appearance prop.\n */\n hasBackground: { type: 'boolean', default: true },\n /**\n * Sets the color scheme of the theme, typcially referred to as light and dark mode.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/dark-mode\n */\n appearance: { type: 'enum', values: appearances, default: 'inherit' },\n /**\n * Selects one of the accent color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n accentColor: { type: 'enum', values: accentColors, default: 'gray' },\n /**\n * Selects one of the gray color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n grayColor: { type: 'enum', values: grayColors, default: 'gray' },\n /**\n * Sets the default radius of the components.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/visual-style\n */\n radius: { type: 'enum', values: radii, default: 'full' },\n /**\n * Sets the font family used for body text in the theme.\n *\n * Headings follow this unless `headingFontFamily` (or the `--font-heading`\n * token) says otherwise.\n *\n * @default 'sans'\n */\n fontFamily: { type: 'enum', values: fontFamilies, default: 'sans' },\n /**\n * Sets the font family used for `Heading`, independently of body text.\n *\n * Deliberately has no default: when it is left unset no attribute is\n * emitted and `--font-heading` keeps following `--font-body`, so a\n * `--font-heading` override in your own CSS survives a `fontFamily` switch.\n */\n headingFontFamily: { type: 'enum', values: fontFamilies },\n /**\n * The app-wide size index. Every component on the 1-4 control and surface\n * scale that states no `size` of its own takes this one; an explicit\n * `size` always wins. Nested Themes override it for their subtree.\n *\n * @default '2'\n */\n size: { type: 'enum', values: sizes, default: '2' },\n} satisfies {\n hasBackground: PropDef<boolean>;\n appearance: PropDef<(typeof appearances)[number]>;\n accentColor: PropDef<(typeof accentColors)[number]>;\n grayColor: PropDef<(typeof grayColors)[number]>;\n radius: PropDef<(typeof radii)[number]>;\n fontFamily: PropDef<(typeof fontFamilies)[number]>;\n headingFontFamily: PropDef<(typeof fontFamilies)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\ntype ThemeOwnProps = GetPropDefTypes<typeof themePropDefs & typeof asChildPropDef>;\n\nexport { themePropDefs };\nexport type { ThemeOwnProps };\n", "import * as React from 'react';\n\ntype BandSize = '1' | '2' | '3' | '4';\n\n/**\n * Set by `Shell.PaneHeader` and `Shell.PaneFooter` to their band size, and by `Shell.Scroll` to\n * null (a scrolling list has no band). `PortalTheme`, the root of every portalled surface\n * (Popover, Dialog, Sheet, menus), sets null too, so a Toolbar in one does not take the Shell's\n * step; a `Theme asChild` an app nests in a pane leaves it alone. `Shell.Root` clears it again.\n * Unset (`undefined`) everywhere else.\n *\n * Its own module so PortalTheme can reset it without bringing the Shell.\n */\nconst PaneBandSizeContext = React.createContext<BandSize | null | undefined>(undefined);\n\nexport { PaneBandSizeContext };\nexport type { BandSize };\n", "'use client';\n\nimport * as React from 'react';\n\n/**\n * What page is in a pane, and whether its title has scrolled away (from v2, 2026-11-03).\n *\n * A page's large title lives inside the scroller and the band that shows it again lives beside\n * it, so context, which only flows down, cannot carry it from one to the other. The store sits\n * at their common ancestor, the pane. Each pane provides its own, so two panes can each hold a\n * titled page; `Shell.Header` provides none, so a `Toolbar.Title` there always speaks for itself.\n * Outside a Shell there is no scope: a `Page` still draws its heading and a `Toolbar.Title` still\n * shows its own words.\n */\ntype PageStore = {\n /** The words of the page in this pane, or null while nothing has claimed it. */\n title: string | null;\n /** Every `Toolbar.Title` mirroring this pane's page, as elements: the collapse is written onto them. */\n mirrors: Set<HTMLElement>;\n /** Whether the page's own title has scrolled up behind the band. */\n collapsed: boolean;\n listeners: Set<() => void>;\n /** What a subscriber reads: a stable value between notifications. */\n version: number;\n};\n\nconst PageScopeContext = React.createContext<PageStore | null>(null);\n\nfunction notify(store: PageStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\n/**\n * The collapse is an attribute write, not a render: only CSS reads it, and an observer sends it\n * twice per visit to a page.\n */\nfunction setPageCollapsed(store: PageStore, collapsed: boolean): void {\n if (store.collapsed === collapsed) return;\n store.collapsed = collapsed;\n for (const el of store.mirrors) {\n if (collapsed) el.setAttribute('data-collapsed', '');\n else el.removeAttribute('data-collapsed');\n }\n}\n\n/** Every pane renders one. It draws nothing. */\nfunction PageScope({ children }: { children: React.ReactNode }) {\n const store = React.useMemo<PageStore>(() => ({ title: null, mirrors: new Set(), collapsed: false, listeners: new Set(), version: 0 }), []);\n return <PageScopeContext.Provider value={store}>{children}</PageScopeContext.Provider>;\n}\n\n/** Cuts the scope off below a portal: a panel over a pane is not in it, so its title must not take the pane's band. */\nfunction NoPageScope({ children }: { children: React.ReactNode }) {\n return <PageScopeContext.Provider value={null}>{children}</PageScopeContext.Provider>;\n}\n\nfunction usePageScope(): PageStore | null {\n return React.useContext(PageScopeContext);\n}\n\n/** A `Page` claims the pane it is in, in an effect, so no subscriber's snapshot changes mid-render. */\nfunction useClaimPage(store: PageStore | null, title: string): void {\n React.useEffect(() => {\n if (!store) return;\n store.title = title;\n notify(store);\n return () => {\n if (store.title === title) {\n store.title = null;\n notify(store);\n }\n };\n }, [store, title]);\n}\n\n/** What a `Toolbar.Title` shows when it is given no words of its own. */\nfunction usePageTitle(store: PageStore | null): string | null {\n const subscribe = React.useCallback(\n (cb: () => void) => {\n if (!store) return () => {};\n store.listeners.add(cb);\n return () => {\n store.listeners.delete(cb);\n };\n },\n [store],\n );\n // The version is read so the subscription re-renders this consumer; the title itself is the value.\n React.useSyncExternalStore(\n subscribe,\n () => store?.version ?? 0,\n () => 0,\n );\n return store?.title ?? null;\n}\n\n/**\n * Registers a mirroring title's element, stamped with what the page is doing now: a title that\n * mounts after its page has scrolled arrives collapsed.\n */\nfunction usePageMirror(store: PageStore | null): React.RefCallback<HTMLElement> {\n const current = React.useRef<HTMLElement | null>(null);\n return React.useCallback(\n (el: HTMLElement | null) => {\n if (!store) return;\n if (current.current) store.mirrors.delete(current.current);\n current.current = el;\n if (!el) return;\n store.mirrors.add(el);\n if (store.collapsed) el.setAttribute('data-collapsed', '');\n else el.removeAttribute('data-collapsed');\n },\n [store],\n );\n}\n\nexport { PageScope, NoPageScope, usePageScope, useClaimPage, usePageTitle, usePageMirror, setPageCollapsed };\nexport type { PageStore };\n", "import { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst tooltipPropDefs = {\n content: { type: 'ReactNode', required: true },\n width: widthPropDefs.width,\n minWidth: widthPropDefs.minWidth,\n maxWidth: { ...widthPropDefs.maxWidth, default: '360px' },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n content: PropDef<React.ReactNode>;\n};\n\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs & typeof widthPropDefs>;\n\nexport { tooltipPropDefs };\nexport type { TooltipOwnProps };\n", "import * as React from 'react';\n\n/**\n * Hook for managing tooltip accessibility props and conditional rendering.\n * Encapsulates tooltip ID generation and aria-describedby binding.\n *\n * @param tooltip - The tooltip content (if any)\n * @returns Object containing tooltipId, hasTooltip flag, and accessibility props\n *\n * @example\n * ```tsx\n * const { tooltipId, hasTooltip, accessibilityProps } = useTooltipWrapper(tooltip);\n *\n * const button = <button {...accessibilityProps}>Click me</button>;\n *\n * if (!hasTooltip) return button;\n *\n * return <Tooltip id={tooltipId} content={tooltip}>{button}</Tooltip>;\n * ```\n */\nexport function useTooltipWrapper(tooltip: React.ReactNode) {\n const tooltipId = React.useId();\n const hasTooltip = Boolean(tooltip);\n\n const accessibilityProps = React.useMemo(() => (hasTooltip ? { 'aria-describedby': tooltipId } : {}), [hasTooltip, tooltipId]);\n\n return { tooltipId, hasTooltip, accessibilityProps };\n}\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { scrollableOverflow, useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n ScrollAreaOwnProps,\n WidthProps,\n HeightProps {}\n\n/** Menus and listboxes move focus between their items, so a scroller inside one stays out of the tab order. */\nconst OWNS_FOCUS = '[role=\"menu\"], [role=\"listbox\"]';\n\n/**\n * Puts the viewport in the tab order while it has something to scroll, so a keyboard can reach it\n * and scroll it with the arrow keys. A `tabIndex` the caller set wins.\n */\nfunction useFocusableWhileScrollable(element: HTMLDivElement | null, enabled: boolean) {\n React.useEffect(() => {\n if (!enabled || !element || element.closest(OWNS_FOCUS)) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n const overflow = scrollableOverflow(element);\n const scrollable = overflow.x > 0 || overflow.y > 0;\n if (scrollable) element.setAttribute('tabindex', '0');\n else element.removeAttribute('tabindex');\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n update();\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n return () => {\n if (frame) cancelAnimationFrame(frame);\n // The attribute stays: a caller who now sets `tabIndex` has already written it.\n observer?.disconnect();\n };\n }, [element, enabled]);\n}\n\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = extractProps(props, widthPropDefs, heightPropDefs);\n const [viewport, setViewport] = React.useState<HTMLDivElement | null>(null);\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport, setViewport);\n useFocusableWhileScrollable(viewport, viewportProps.tabIndex === undefined);\n // A named scroller is a region, so a screen reader can find it and say what it holds.\n const named = viewportProps['aria-label'] !== undefined || viewportProps['aria-labelledby'] !== undefined;\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n dir={dir}\n className={classNames('kui-ScrollAreaRoot', className)}\n data-fade={fade ? '' : undefined}\n style={style}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n role={named ? 'region' : undefined}\n {...viewportProps}\n ref={viewportRef}\n className=\"kui-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"kui-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"kui-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n /**\n * Fades the content toward the top and bottom edges while there is more content past them.\n * An edge with nothing hidden past it does not fade. A floating band over an edge can set\n * `--scroll-fade-start` or `--scroll-fade-end` to its height, so content fades as it passes\n * under the band.\n */\n fade: { type: 'boolean', default: false },\n} satisfies {\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n fade: PropDef<boolean>;\n};\n\nexport { scrollAreaPropDefs };\n", "import * as React from 'react';\n\n/**\n * How far content runs past the element on each axis, in px. An axis whose overflow is hidden\n * cannot be scrolled (a ScrollArea with `scrollbars=\"vertical\"` hides the inline axis), so it\n * counts as 0, however wide the content.\n */\nexport function scrollableOverflow(element: HTMLElement) {\n const style = getComputedStyle(element);\n return {\n x: style.overflowX === 'hidden' ? 0 : Math.max(0, element.scrollWidth - element.clientWidth),\n y: style.overflowY === 'hidden' ? 0 : Math.max(0, element.scrollHeight - element.clientHeight),\n };\n}\n\n/**\n * Publishes how much content is hidden past each edge of a scroller, as\n * `--scroll-overflow-start` and `--scroll-overflow-end` (block axis) and\n * `--scroll-overflow-x-start` and `--scroll-overflow-x-end` (inline axis, from\n * the inline start, so right-to-left reads the same) in px on the element.\n * The scroll fade reads them, so an edge fades only while content is hidden\n * there, and the fade ramps in over the first pixels of scrolling.\n *\n * Writes happen at most once per frame, on scroll and when the element or its\n * content resizes. Nothing re-renders.\n */\nexport function useScrollEdges<T extends HTMLElement>(enabled: boolean) {\n const [element, setElement] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n if (!enabled || !element) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n const overflow = scrollableOverflow(element);\n const start = Math.max(0, element.scrollTop);\n const end = Math.max(0, overflow.y - element.scrollTop);\n element.style.setProperty('--scroll-overflow-start', `${start}px`);\n element.style.setProperty('--scroll-overflow-end', `${end}px`);\n // scrollLeft runs negative in right-to-left, so its size is the distance from the inline start.\n const xStart = Math.abs(element.scrollLeft);\n const xEnd = Math.max(0, overflow.x - xStart);\n element.style.setProperty('--scroll-overflow-x-start', `${xStart}px`);\n element.style.setProperty('--scroll-overflow-x-end', `${xEnd}px`);\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n write();\n element.addEventListener('scroll', schedule, { passive: true });\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(schedule);\n mutations?.observe(element, { childList: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n element.removeEventListener('scroll', schedule);\n observer?.disconnect();\n mutations?.disconnect();\n element.style.removeProperty('--scroll-overflow-start');\n element.style.removeProperty('--scroll-overflow-end');\n element.style.removeProperty('--scroll-overflow-x-start');\n element.style.removeProperty('--scroll-overflow-x-end');\n };\n }, [enabled, element]);\n\n return setElement;\n}\n", "import * as React from 'react';\n\n/**\n * Keeps a Radix ScrollArea's thumbs on the scroll position on every scroll.\n *\n * Radix moves a thumb from a requestAnimationFrame loop it starts on the first scroll event of a\n * burst. Next's production minifier compiles that self-calling loop away, so in a production\n * build the thumb moves once, sits while the content scrolls, and jumps when the next burst\n * starts. This writes the transform Radix would, at most once per frame. Nothing re-renders.\n *\n * Pass the hook's setter as a ref on `ScrollArea.Viewport`; the scrollbars are its siblings.\n */\nexport function useThumbSync<T extends HTMLElement>() {\n const [viewport, setViewport] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n const root = viewport?.parentElement;\n if (!viewport || !root) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n for (const thumb of root.querySelectorAll<HTMLElement>(':scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb')) {\n const scrollbar = thumb.parentElement as HTMLElement;\n const style = getComputedStyle(scrollbar);\n if (scrollbar.dataset.orientation === 'horizontal') {\n const track = scrollbar.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);\n const offset = thumbOffset(viewport.scrollLeft, viewport.scrollWidth - viewport.offsetWidth, track - thumb.offsetWidth);\n thumb.style.transform = `translate3d(${offset}px, 0, 0)`;\n } else {\n const track = scrollbar.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n const offset = thumbOffset(viewport.scrollTop, viewport.scrollHeight - viewport.offsetHeight, track - thumb.offsetHeight);\n thumb.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n viewport.addEventListener('scroll', schedule, { passive: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n viewport.removeEventListener('scroll', schedule);\n };\n }, [viewport]);\n\n return setViewport;\n}\n\n/** Radix's mapping: scroll position over its range, onto the room the thumb has to travel. */\nfunction thumbOffset(position: number, range: number, travel: number) {\n if (range <= 0 || travel <= 0) return 0;\n // Right-to-left scrolls run from -range to 0; the thumb then travels from -travel to 0.\n const clamped = Math.min(Math.max(position, -range), range);\n return (clamped / range) * travel;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n", "'use client';\n\n/**\n * Notice and Confirmation \u2014 what the app tells the person while it is true.\n *\n * Two questions place every message: what is it about, and what made it appear.\n *\n * - **Notice** \u2014 a condition that is true now, which nobody just caused: a usage limit, a\n * connection lost, a goal that finished. It takes space in the layout and never floats, so it\n * cannot cover what it is about. At most one action, and that action FIXES the condition. A\n * dismiss button only ACKNOWLEDGES it, and the app owns that state (`onDismiss`), because a\n * component cannot remember a dismissal across a reload.\n * - **Confirmation** \u2014 a question that waits for an answer: a quiet no before a loud yes, and no\n * dismiss button, because closing a question does not answer it. It never takes focus, so a\n * person can answer in the composer instead.\n *\n * Placement is the caller's. In a chat, both go in `Chatbar.Root`'s `notices`.\n * A notice with no action and no dismiss button is just a sentence: use `Text`.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Button } from './button.js';\nimport { Text } from './text.js';\nimport { ThemeSizeContext, useThemeSize } from '../hooks/theme-size.js';\nimport { accentColorPropDef } from '../props/color.prop.js';\n\ntype NoticeSize = '1' | '2' | '3' | '4';\n\n/** The size a notice takes when it doesn't set one. `Chatbar.Root` provides its own size here. */\nconst NoticeSizeContext = React.createContext<NoticeSize | undefined>(undefined);\n\n/** Notice's own range, the Theme's four sizes. */\nconst noticeSizePropDef = { values: ['1', '2', '3', '4'] as const };\ntype NoticeColor = (typeof accentColorPropDef)['color']['values'][number];\n\ninterface StripProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {\n /** Padding, text and button size. Defaults to the nearest Theme's size. */\n size?: NoticeSize;\n /**\n * The category of the message, not its volume. Default `gray`. Use a colour only when it adds a\n * fact the words don't already give, such as `red` for something that stops the next step.\n */\n color?: NoticeColor;\n /** The message. */\n children: React.ReactNode;\n}\n\ninterface NoticeProps extends StripProps {\n /** An icon before the message. It is hidden from assistive technology. */\n icon?: React.ReactNode;\n /**\n * One action that fixes the condition, such as `<Button>Add credits</Button>`. A control in it\n * that sets no `size` takes the notice's size.\n */\n action?: React.ReactNode;\n /**\n * Called when the person presses the dismiss button, which shows only when this is set.\n * Dismissing hides the message; it does not fix the condition. Remove the notice and remember\n * the choice in your app.\n */\n onDismiss?: () => void;\n /** Accessible name of the dismiss button. Default \"Dismiss\". */\n dismissLabel?: string;\n}\n\ninterface ConfirmationProps extends StripProps {\n /** The yes. Name the action, such as \"Run\" or \"Allow up to $18\". */\n confirmLabel: string;\n /** The no. Default \"Not now\". */\n cancelLabel?: string;\n onConfirm: () => void;\n onCancel: () => void;\n /** The yes is running: it shows a spinner and the no is disabled. */\n busy?: boolean;\n}\n\nconst Strip = React.forwardRef<HTMLDivElement, StripProps & { kind: 'notice' | 'confirmation'; trailing: React.ReactNode; leading?: React.ReactNode }>(\n ({ kind, size = '2', color = 'gray', className, children, trailing, leading, ...props }, forwardedRef) => (\n <div\n role=\"status\"\n aria-live=\"polite\"\n {...props}\n ref={forwardedRef}\n className={classNames('kui-NoticeRoot', `kui-r-size-${size}`, className)}\n data-kind={kind}\n data-accent-color={color}\n >\n {leading ? (\n <span className=\"kui-NoticeIcon\" aria-hidden>\n {leading}\n </span>\n ) : null}\n <Text as=\"div\" size={size} className=\"kui-NoticeText\">\n {children}\n </Text>\n {trailing}\n </div>\n ),\n);\nStrip.displayName = 'Strip';\n\n/** A condition that is true now, with at most one action that fixes it. */\nconst Notice = React.forwardRef<HTMLDivElement, NoticeProps>(({ icon, action, onDismiss, dismissLabel = 'Dismiss', size: sizeProp, ...props }, forwardedRef) => {\n const contextSize = React.useContext(NoticeSizeContext);\n const size = useThemeSize(sizeProp ?? contextSize, noticeSizePropDef);\n const trailing =\n action || onDismiss ? (\n <span className=\"kui-NoticeActions\">\n {action ? <ThemeSizeContext.Provider value={size}>{action}</ThemeSizeContext.Provider> : null}\n {onDismiss ? (\n <Button iconOnly size={size} variant=\"ghost\" color=\"gray\" aria-label={dismissLabel} className=\"kui-NoticeDismiss\" onClick={onDismiss}>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\" aria-hidden>\n <path d=\"M4 4l7 7M11 4l-7 7\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n </Button>\n ) : null}\n </span>\n ) : null;\n return <Strip {...props} size={size} ref={forwardedRef} kind=\"notice\" leading={icon} trailing={trailing} />;\n});\nNotice.displayName = 'Notice';\n\n/** A question that waits for an answer: a quiet no, a loud yes, and no dismiss button. */\nconst Confirmation = React.forwardRef<HTMLDivElement, ConfirmationProps>(\n ({ confirmLabel, cancelLabel = 'Not now', onConfirm, onCancel, busy = false, size: sizeProp, color = 'gray', ...props }, forwardedRef) => {\n const contextSize = React.useContext(NoticeSizeContext);\n const size = useThemeSize(sizeProp ?? contextSize, noticeSizePropDef);\n return (\n <Strip\n {...props}\n size={size}\n color={color}\n ref={forwardedRef}\n kind=\"confirmation\"\n trailing={\n <span className=\"kui-NoticeActions\">\n <Button size={size} variant=\"ghost\" color=\"gray\" disabled={busy} onClick={onCancel}>\n {cancelLabel}\n </Button>\n <Button size={size} variant=\"solid\" color={color} loading={busy} onClick={onConfirm}>\n {confirmLabel}\n </Button>\n </span>\n }\n />\n );\n },\n);\nConfirmation.displayName = 'Confirmation';\n\nexport { Notice, Confirmation, NoticeSizeContext };\nexport type { NoticeProps, ConfirmationProps };\n", "import { VisuallyHidden as VisuallyHiddenPrimitive } from 'radix-ui';\nexport const VisuallyHidden = VisuallyHiddenPrimitive.Root;\nexport const Root = VisuallyHiddenPrimitive.Root;\nexport type VisuallyHiddenProps = VisuallyHiddenPrimitive.VisuallyHiddenProps;\n"],
|
|
5
|
-
"mappings": ";8kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,GAAA,eAAAC,GAAA,mBAAAC,GAAA,cAAAC,GAAA,gBAAAC,GAAA,SAAAC,GAAA,SAAAC,GAAA,QAAAC,GAAA,WAAAC,GAAA,aAAAC,GAAA,SAAAC,GAAA,aAAAC,KAAA,eAAAC,GAAAd,IAAA,IAAAe,EAAuB,oBACvBC,EAAuB,yBACvBC,GAAiD,6BACjDC,GAA4B,0BCH5B,IAAAC,GAAuB,oBACvBC,GAAuB,yBCDvB,IAAAC,EAAuB,oBACvBC,GAAuB,yBACvBC,GAAqB,oBACrBC,GAAiD,6BCDjD,IAAMC,GAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECPA,IAAMC,GAAe,CAAC,OAAQ,OAAQ,SAAU,QAAS,SAAU,QAAS,SAAU,SAAU,MAAO,OAAQ,UAAW,OAAQ,OAAQ,SAAU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K,OAAO,KAAK,QAAQ,YAAY,KAAK,eAAe,cAAW,IAChH,gBAAC,QAAK,EAAE,IAAI,EAAE,IAAI,MAAM,KAAK,OAAO,KAAK,GAAG,IAAI,CAClD,GAEA+B,IAAS,QACXJ,GACE,gBAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,QAAQ,cAAW,IAC3L,gBAAC,QAAK,EAAE,4BAA4B,EACpC,gBAAC,QAAK,EAAE,WAAW,CACrB,EAGF1N,GACE,gBAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,QAAQ,cAAW,IAC3L,gBAAC,QAAK,EAAE,WAAW,EACnB,gBAAC,QAAK,EAAE,gBAAgB,CAC1B,EAIN,OACE,gBAACqL,GAAA,CACC,SAAQ,GACP,GAAGoB,EACJ,IAAK5M,EACL,KAAMiB,GAAY3C,EAAI,KACrB,GAAI+O,EAAW,CAAE,SAAAA,CAAS,EAAI,CAAE,QAASD,IAAgB9O,EAAI,MAAQ2P,IAAS,OAAS,QAAU,QAAS,EAC3G,SAAUE,GACV,aAAW,EAAA9G,SAAW,kBAAmBpH,CAAS,EAClD,MAAO,CAAE,QAASiO,EAAU,EAAI,EAAG,cAAeA,EAAU,OAAY,OAAQ,GAAGhO,CAAM,EAEzF,cAAagO,EAAU,OAAY,GACnC,SAAUA,EAAUZ,EAAW,GAC/B,QAAS5F,EACT,QAAS2G,GACT,cAAad,EACb,YAAWU,EACV,GAAGG,IAEHE,EACH,CAEJ,CAAC,EACDpB,GAAK,YAAc",
|
|
6
|
-
"names": ["chatbar_exports", "__export", "AttachTrigger", "Attachment", "AttachmentsRow", "InlineEnd", "InlineStart", "Item", "Root", "Row", "RowEnd", "RowStart", "Send", "Textarea", "__toCommonJS", "React", "import_classnames", "import_internal", "import_react_dropzone", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "import_internal", "asChildPropDef", "accentColors", "grayColors", "colorPropDef", "accentColorPropDef", "radii", "radiusPropDef", "sizes", "variants", "baseButtonPropDefs", "asChildPropDef", "accentColorPropDef", "radiusPropDef", "React", "import_classnames", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "paddingValues", "paddingPropDefs", "heightPropDefs", "widthPropDefs", "overflowValues", "positionValues", "positionEdgeValues", "flexShrinkValues", "flexGrowValues", "alignSelfValues", "justifySelfValues", "layoutPropDefs", "paddingPropDefs", "widthPropDefs", "heightPropDefs", "marginValues", "marginPropDefs", "import_radix_ui", "Root", "SlotPrimitive", "Slot", "Slottable", "gapValues", "gapPropDefs", "as", "displayValues", "directionValues", "alignValues", "justifyValues", "wrapValues", "flexPropDefs", "asChildPropDef", "parseJustifyValue", "gapPropDefs", "value", "Flex", "props", "forwardedRef", "className", "asChild", "Tag", "flexProps", "extractProps", "flexPropDefs", "layoutPropDefs", "marginPropDefs", "Slot", "classNames", "React", "import_classnames", "spinnerPropDefs", "Spinner", "props", "forwardedRef", "className", "children", "loading", "spinnerProps", "extractProps", "spinnerPropDefs", "named", "spinner", "classNames", "Flex", "import_react", "ThickDividerHorizontalIcon", "React", "props", "forwardedRef", "ThickCheckIcon", "ChevronDownIcon", "ThickChevronRightIcon", "ThickChevronLeftIcon", "ThickDotIcon", "CloseIcon", "React", "_props", "_forwardedRef", "PaperclipIcon", "props", "forwardedRef", "FileIcon", "FileTextIcon", "TickIcon", "React", "clampSize", "size", "values", "n", "nearest", "distance", "i", "d", "ThemeSizeContext", "useThemeSize", "explicit", "propDef", "themeSize", "clampSize", "useThemeSizeProps", "props", "size", "BaseButton", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "baseButtonPropDefs", "className", "children", "asChild", "as", "color", "radius", "nativeDisabled", "done", "baseButtonProps", "extractProps", "loading", "canLoad", "disabled", "onClick", "ariaDescribedByProp", "handleClick", "event", "childEdges", "content", "items", "flattenFragments", "isIcon", "node", "TEXT_COMPONENTS", "componentName", "domEdges", "setDomEdges", "elementRef", "composedRef", "element", "contentRoot", "iconStart", "edgeIsSvg", "iconEnd", "prev", "iconOnly", "tick", "TickIcon", "swap", "nodes", "first", "firstNode", "index", "Comp", "formElements", "renderedType", "shouldPassDisabled", "onClickCapture", "handleClickCapture", "isNativeButtonElement", "hasExplicitTypeAttribute", "loadingId", "describedById", "accessibilityProps", "renderInner", "inner", "label", "Flex", "Spinner", "asChildContent", "classNames", "type", "named", "edge", "React", "import_classnames", "import_radix_ui", "React", "import_radix_ui", "emphases", "emphasisPropDef", "leadingTrimValues", "leadingTrimPropDef", "textAlignValues", "textAlignPropDef", "textWrapValues", "textWrapPropDef", "truncatePropDef", "fontFamilies", "fontFamilyPropDef", "weights", "weightPropDef", "as", "sizes", "textPropDefs", "asChildPropDef", "fontFamilyPropDef", "weightPropDef", "textAlignPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "colorPropDef", "emphasisPropDef", "Text", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "textProps", "extractProps", "textPropDefs", "combinedClassName", "React", "React", "import_classnames", "import_radix_ui", "getMatchingGrayColor", "accentColor", "React", "usePropSyncedState", "propValue", "value", "setValue", "previousPropValue", "setPreviousPropValue", "appearances", "fontFamilies", "sizes", "themePropDefs", "asChildPropDef", "accentColors", "grayColors", "radii", "noop", "defaultThemeContext", "themePropDefs", "ThemeContext", "Theme", "props", "forwardedRef", "context", "ThemeContext", "dir", "ThemeRoot", "ThemeImpl", "appearanceProp", "themePropDefs", "accentColorProp", "grayColorProp", "radiusProp", "fontFamilyProp", "headingFontFamilyProp", "sizeProp", "hasBackground", "rootProps", "appearance", "setAppearance", "usePropSyncedState", "accentColor", "setAccentColor", "grayColor", "setGrayColor", "radius", "setRadius", "fontFamily", "setFontFamily", "headingFontFamily", "setHeadingFontFamily", "size", "setSize", "asChild", "isRoot", "hasBackgroundProp", "onAppearanceChange", "noop", "onAccentColorChange", "onGrayColorChange", "onRadiusChange", "onFontFamilyChange", "onHeadingFontFamilyChange", "onSizeChange", "themeProps", "Comp", "resolvedGrayColor", "getMatchingGrayColor", "isExplicitAppearance", "ThemeSizeContext", "classNames", "React", "PaneBandSizeContext", "React", "PageScopeContext", "NoPageScope", "children", "PageScopeContext", "PortalTheme", "props", "forwardedRef", "PaneBandSizeContext", "NoPageScope", "Theme", "tooltipPropDefs", "widthPropDefs", "TOOLTIP_DELAY", "TooltipProviderContext", "TooltipProvider", "delayDuration", "children", "props", "TooltipPrimitive", "Tooltip", "forwardedRef", "className", "open", "defaultOpen", "onOpenChange", "disableHoverableContent", "content", "container", "forceMount", "tooltipContentProps", "extractProps", "tooltipPropDefs", "rootProps", "hasProvider", "tooltip", "PortalTheme", "classNames", "Text", "React", "useTooltipWrapper", "tooltip", "tooltipId", "hasTooltip", "accessibilityProps", "EMPHASIS_VARIANT", "validateIconButtonName", "props", "Button", "className", "style", "tooltip", "tooltipSide", "tooltipAlign", "tooltipDelayDuration", "tooltipDisableHoverableContent", "iconOnly", "emphasis", "variant", "forwardedRef", "tooltipId", "hasTooltip", "tooltipAccessibilityProps", "useTooltipWrapper", "resolvedVariant", "callerDescribedBy", "tooltipDescribedBy", "ariaDescribedBy", "button", "BaseButton", "classNames", "Tooltip", "React", "import_classnames", "import_radix_ui", "import_internal", "scrollbarsValues", "scrollAreaPropDefs", "asChildPropDef", "radiusPropDef", "React", "scrollableOverflow", "element", "style", "useScrollEdges", "enabled", "setElement", "frame", "write", "overflow", "start", "end", "xStart", "xEnd", "schedule", "observer", "child", "mutations", "React", "useThumbSync", "viewport", "setViewport", "root", "frame", "write", "thumb", "scrollbar", "style", "track", "offset", "thumbOffset", "schedule", "position", "range", "travel", "React", "getSubtree", "options", "content", "asChild", "children", "firstChild", "OWNS_FOCUS", "useFocusableWhileScrollable", "element", "enabled", "frame", "update", "overflow", "scrollableOverflow", "schedule", "observer", "child", "ScrollArea", "props", "forwardedRef", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "radius", "scrollAreaPropDefs", "scrollbars", "fade", "viewportProps", "extractProps", "widthPropDefs", "heightPropDefs", "viewport", "setViewport", "setEdgesElement", "useScrollEdges", "setThumbViewport", "useThumbSync", "viewportRef", "named", "ScrollAreaPrimitive", "classNames", "getSubtree", "React", "import_classnames", "NoticeSizeContext", "noticeSizePropDef", "Strip", "kind", "size", "color", "className", "children", "trailing", "leading", "props", "forwardedRef", "classNames", "Text", "Notice", "icon", "action", "onDismiss", "dismissLabel", "sizeProp", "contextSize", "useThemeSize", "ThemeSizeContext", "Button", "Confirmation", "confirmLabel", "cancelLabel", "onConfirm", "onCancel", "busy", "import_radix_ui", "VisuallyHidden", "VisuallyHiddenPrimitive", "Root", "withoutPlaceholder", "el", "measure", "placeholder", "chatbarSizePropDef", "ChatbarContext", "ChatbarValueContext", "useChatbarContext", "ctx", "toArray", "val", "s", "matchesAccept", "file", "patterns", "mime", "name", "patRaw", "pat", "type", "subtype", "fmType", "fmSubtype", "IMAGE_EXT_RE", "isImageLike", "hasText", "value", "plural", "n", "word", "attachmentCounter", "createAttachmentId", "Root", "props", "forwardedRef", "className", "style", "children", "valueProp", "defaultValue", "onValueChange", "openProp", "defaultOpen", "onOpenChange", "expandOn", "minLines", "maxLines", "sendMode", "disabled", "readOnly", "onSubmit", "sizeProp", "variant", "color", "radius", "width", "maxWidth", "attachmentsProp", "defaultAttachments", "onAttachmentsChange", "accept", "multiple", "maxAttachments", "maxFileSize", "paste", "pasteAccept", "clearOnSubmit", "onAttachmentReject", "dropzone", "apiRef", "onBlurCapture", "notices", "context", "divProps", "size", "useThemeSize", "isValueControlled", "valueUncontrolled", "setValueUncontrolled", "isOpenControlled", "openUncontrolled", "setOpenUncontrolled", "open", "isAttachmentsControlled", "attachmentsUncontrolled", "setAttachmentsUncontrolled", "attachments", "announcement", "setAnnouncementState", "announce", "text", "prev", "rootRef", "composedRootRef", "textareaRef", "fileInputRef", "pickerOpenRef", "pressGuardRef", "pressGuardTimerRef", "pickerRef", "acceptKey", "pasteAcceptKey", "accepts", "pasteAccepts", "snapshot", "latest", "pendingAttachmentsRef", "getAttachments", "setOpen", "next", "setValue", "setAttachments", "ownedUrlsRef", "addFiles", "files", "cfg", "current", "rejected", "remainingSlots", "perActionLimit", "url", "messages", "appendFiles", "appendFilesFromPaste", "removeAttachment", "id", "removed", "a", "submit", "clear", "payload", "att", "owned", "openFilePicker", "options", "input", "beginFilePickerPress", "reset", "handleFileInputChange", "event", "picker", "handleBlurCapture", "rootEl", "nextTarget", "handleDrop", "getRootProps", "isDragActive", "dragActive", "handleContainerPointerDown", "target", "contextValue", "classNames", "NoticeSizeContext", "Text", "VisuallyHidden", "Textarea", "asChild", "onFocus", "onChange", "onPaste", "onKeyDown", "onCompositionStart", "onCompositionEnd", "submitOnEnter", "textareaProps", "composedRef", "lineHeightRef", "paddingRef", "composingRef", "sizingRef", "recomputeMetrics", "computedStyle", "applyHeight", "isOpen", "min", "max", "lineHeight", "padding", "minHeight", "maxHeight", "contentHeight", "overflowing", "compactHeight", "prevWidth", "ro", "entries", "first", "handleFocus", "handleChange", "handlePaste", "item", "f", "handleCompositionStart", "handleCompositionEnd", "handleKeyDown", "Slot", "InlineStart", "InlineEnd", "AttachmentsRow", "forceMount", "renderAttachment", "hasItems", "ScrollArea", "Flex", "Attachment", "moveFocusOffPill", "button", "pill", "pills", "index", "nextButton", "Pill", "lead", "leadKind", "label", "detail", "removeLabel", "onRemove", "Button", "CloseIcon", "STATUS_LABEL", "attachment", "Comp", "isImage", "sizeLabel", "statusLabel", "locked", "handleRemove", "Spinner", "FileTextIcon", "Item", "icon", "image", "AttachTrigger", "disabledProp", "onPointerDown", "onClick", "_color", "buttonProps", "triggerProps", "PaperclipIcon", "Row", "RowStart", "RowEnd", "Send", "clearOnSend", "variantProp", "emphasis", "tabIndex", "status", "onStop", "onRetry", "stopLabel", "retryLabel", "stopIcon", "retryIcon", "ariaLabel", "ariaLabelledby", "hasContent", "mode", "visible", "inactive", "labelProps", "handleClick", "glyph"]
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\nimport { useDropzone } from 'react-dropzone';\n\nimport { Button } from './button.js';\nimport { CloseIcon, FileTextIcon, PaperclipIcon } from './icons.js';\nimport { Flex } from './flex.js';\nimport { ScrollArea } from './scroll-area.js';\nimport { Slot } from './slot.js';\nimport { NoticeSizeContext } from './notice.js';\nimport { useThemeSize } from '../hooks/theme-size.js';\nimport { Spinner } from './spinner.js';\nimport { Text } from './text.js';\nimport { VisuallyHidden } from './visually-hidden.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { accentColors } from '../props/color.prop.js';\nimport type { radii } from '../props/radius.prop.js';\nimport type { ButtonProps, ButtonRankProps } from './button.js';\n\n/**\n * Runs `measure` with the placeholder taken out of layout, so a height read\n * reflects the value alone.\n *\n * A textarea with an empty value lays its placeholder out as real text, so\n * `scrollHeight` reports the placeholder wrapped at whatever width the field\n * has at that instant. That sizes an empty bar to the suggestion showing in it\n * rather than to `minLines`, and when the read lands before the field has its\n * final width -- a panel still animating open, a flex parent whose basis is 0\n * -- it wraps that text at a fraction of the real width and opens the bar at\n * `maxLines`. The first keystroke takes the placeholder out of layout and the\n * height snaps back, which is what made the bug look intermittent rather than\n * simply wrong.\n *\n * The reset to 'auto' and the `scrollHeight` read sit in different functions\n * here, so the whole measurement window is wrapped rather than a single read.\n * Costs one extra style recalc on a path that is already forcing a reflow.\n */\nfunction withoutPlaceholder(el: HTMLTextAreaElement, measure: () => void): void {\n const { placeholder } = el;\n if (!placeholder) {\n measure();\n return;\n }\n el.placeholder = '';\n try {\n measure();\n } finally {\n el.placeholder = placeholder;\n }\n}\n\ntype ExpandOn = 'none' | 'focus' | 'overflow' | 'both';\ntype SendMode = 'always' | 'whenDirty' | 'never';\n\n// Attachments\n/** Status flag for attachment lifecycle. */\ntype AttachmentStatus = 'idle' | 'uploading' | 'error' | 'done';\n/**\n * Attachment data model used by Chatbar.\n * - `file` exposes the original File object for uploads and processing.\n * - `url` is an object URL used for image previews. Chatbar revokes it when the\n * attachment is removed; once an attachment is handed to `onSubmit`, the\n * consumer owns the URL and is responsible for revoking it.\n */\ninterface ChatbarAttachment {\n id: string;\n name: string;\n size: number;\n type: string;\n /** Original File object for uploads and processing */\n file: File;\n url?: string;\n status?: AttachmentStatus;\n progress?: number;\n meta?: Record<string, unknown>;\n}\n\ntype ChatbarRejectReason = 'type' | 'size' | 'count';\ninterface ChatbarAttachmentRejection {\n file: File;\n reason: ChatbarRejectReason;\n}\n\ninterface ChatbarSubmitPayload {\n value: string;\n attachments: ChatbarAttachment[];\n}\n\ninterface FilePickerOptions {\n accept?: string | string[];\n multiple?: boolean;\n}\n\ninterface ChatbarContextValue {\n open: boolean;\n setOpen(next: boolean): void;\n\n setValue(next: string): void;\n\n size: '1' | '2' | '3';\n expandOn: ExpandOn;\n minLines: number;\n maxLines: number;\n sendMode: SendMode;\n disabled?: boolean;\n readOnly?: boolean;\n paste: boolean;\n clearOnSubmit: boolean;\n multiple: boolean;\n\n textareaRef: React.RefObject<HTMLTextAreaElement | null>;\n\n attachments: ChatbarAttachment[];\n removeAttachment(id: string): void;\n\n /** Validates and submits; returns false when there was nothing to submit */\n submit(clear: boolean): boolean;\n appendFiles(files: File[]): number;\n appendFilesFromPaste(files: File[]): number;\n openFilePicker(options?: FilePickerOptions): void;\n /** Guards blur-collapse between pointerdown on a picker trigger and its click */\n beginFilePickerPress(): void;\n}\n\n/** Chatbar's own range; a Theme size of 4 maps to 3. */\nconst chatbarSizePropDef = { values: ['1', '2', '3'] as const };\n\nconst ChatbarContext = React.createContext<ChatbarContextValue | null>(null);\n// Value lives in its own context so keystrokes only re-render parts that read it\nconst ChatbarValueContext = React.createContext<string>('');\n\nconst useChatbarContext = () => {\n const ctx = React.useContext(ChatbarContext);\n if (!ctx) throw new Error('Chatbar context not found. Wrap parts in <Chatbar.Root>.');\n return ctx;\n};\n\nconst toArray = (val: string | string[] | undefined) =>\n Array.isArray(val) ? val : typeof val === 'string' ? val.split(',').map((s) => s.trim()).filter(Boolean) : [];\n\nconst matchesAccept = (file: File, patterns: string[]) => {\n if (patterns.length === 0) return true;\n const mime = file.type.toLowerCase();\n const name = file.name.toLowerCase();\n for (const patRaw of patterns) {\n const pat = patRaw.toLowerCase();\n if (pat.includes('/')) {\n const [type, subtype] = pat.split('/');\n const [fmType, fmSubtype] = mime.split('/');\n if (type === '*' || (type === fmType && (subtype === '*' || subtype === fmSubtype))) return true;\n } else if (pat.startsWith('.')) {\n if (name.endsWith(pat)) return true;\n }\n }\n return false;\n};\n\nconst IMAGE_EXT_RE = /\\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i;\nconst isImageLike = (name: string, type: string) => (type || '').toLowerCase().startsWith('image/') || IMAGE_EXT_RE.test(name);\n\nconst hasText = (value: string) => value.trim().length > 0;\n\nconst plural = (n: number, word: string) => `${n} ${word}${n === 1 ? '' : 's'}`;\n\nlet attachmentCounter = 0;\nconst createAttachmentId = () => `chatbar-attachment-${Date.now()}-${++attachmentCounter}`;\n\n/**\n * Chatbar container and state provider.\n *\n * Value & Open\n * - Supports controlled/uncontrolled `value` and `open`.\n *\n * Attachments\n * - Controlled/uncontrolled attachments with client-side filtering.\n * - Filters by `accept`/`pasteAccept`, `multiple`, `maxAttachments`, and `maxFileSize`.\n * - Rejections are reported via `onAttachmentReject`.\n *\n * Submit\n * - `onSubmit({ value, attachments })` emits both message and attachments.\n * - Submitting requires text or at least one attachment.\n * - `clearOnSubmit` clears message and attachments by default.\n */\ninterface ChatbarRootBaseProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n\n /** When the chatbar expands on its own. `none` leaves open state entirely to the consumer. */\n expandOn?: ExpandOn;\n\n /** Minimum visible lines when expanded (default: 3). The compact state is always one line. */\n minLines?: number;\n /** Maximum number of lines before scrolling (default: 6) */\n maxLines?: number;\n\n /** Controls Send button visibility only. Enter-to-submit is controlled by `Textarea submitOnEnter`. */\n sendMode?: SendMode;\n\n /** Disables text input, submission and every way of adding attachments */\n disabled?: boolean;\n /** Prevents editing, submission and adding attachments */\n readOnly?: boolean;\n\n /** Combined submit payload */\n onSubmit?: (payload: ChatbarSubmitPayload) => void;\n\n size?: '1' | '2' | '3';\n variant?: 'raised' | 'surface' | 'outline' | 'ghost' | 'soft';\n /** Accent color for the control (matches TextArea) */\n color?: (typeof accentColors)[number];\n /** Optional radius override (matches TextArea) */\n radius?: (typeof radii)[number];\n\n width?: React.CSSProperties['width'];\n maxWidth?: React.CSSProperties['maxWidth'];\n\n // Attachments API\n attachments?: ChatbarAttachment[];\n defaultAttachments?: ChatbarAttachment[];\n onAttachmentsChange?: (attachments: ChatbarAttachment[]) => void;\n accept?: string | string[];\n /** Allow more than one file per pick, paste or drop */\n multiple?: boolean;\n maxAttachments?: number;\n maxFileSize?: number;\n paste?: boolean;\n /** Accepted types for pasted files. Replaces `accept` for paste when set. */\n pasteAccept?: string | string[];\n /** Clear message and attachments after submit */\n clearOnSubmit?: boolean;\n onAttachmentReject?: (rejections: ChatbarAttachmentRejection[]) => void;\n\n /**\n * Enables drag-and-drop file uploads when true.\n *\n * When enabled:\n * - Files can be dropped anywhere on the chatbar\n * - Same validation rules apply (accept, multiple, maxFileSize, maxAttachments)\n * - Visual feedback shows during drag operations\n * - Rejected files trigger onAttachmentReject\n *\n * @default true\n */\n dropzone?: boolean;\n\n /**\n * Optional API ref to control Chatbar imperatively without relying on DOM refs.\n * Provides methods to focus the textarea and open the file picker.\n */\n apiRef?: React.Ref<ChatbarApi>;\n\n /**\n * Messages that need an answer before the next message, such as `Notice` and `Confirmation`.\n * They stack in a column above the chatbar, in the order given, so put the one the next\n * message answers last, nearest the text. They sit outside the box: a button in a notice never\n * submits the message, and pressing one never collapses the chatbar.\n */\n notices?: React.ReactNode;\n /**\n * Short facts that stay true about the conversation, such as the model or the context left.\n * They sit below the chatbar, inset from its sides.\n */\n context?: React.ReactNode;\n}\n\ntype RootElement = React.ElementRef<'div'>;\n/** Imperative API for Chatbar.Root */\nexport interface ChatbarApi {\n /** Focus the textarea input */\n focusTextarea: () => void;\n /** Open the file picker dialog (respects accept/multiple). No-op when disabled or read-only. */\n openFilePicker: () => void;\n}\n/**\n * Chatbar container and state provider.\n *\n * Behavior\n * - Supports controlled and uncontrolled `value` and `open` states via props.\n * - Provides context to subcomponents like `Textarea`, `Row`, and `Send`.\n * - Exposes `data-state`, `data-disabled`, and `data-readonly` attributes for styling.\n *\n * Attachments\n * - Paste-to-attach: when `paste` is enabled, pasting files adds attachments.\n * - Additions and rejections are announced through a polite live region.\n *\n * Dropzone\n * - When `dropzone` is true, enables drag-and-drop file uploads.\n * - Visual feedback via `data-drop-active` attribute during drag operations.\n *\n * Accessibility\n * - Consumers should label the `Textarea` via `aria-label`/`aria-labelledby`.\n */\ninterface RootProps extends ComponentPropsWithout<'div', RemovedProps | 'onSubmit' | 'color'>, ChatbarRootBaseProps {}\n\nconst Root = React.forwardRef<RootElement, RootProps>((props, forwardedRef) => {\n const {\n className,\n style,\n children,\n value: valueProp,\n defaultValue = '',\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n expandOn = 'both',\n minLines = 3,\n maxLines = 6,\n sendMode = 'whenDirty',\n disabled,\n readOnly,\n onSubmit,\n size: sizeProp,\n variant,\n color,\n radius,\n width,\n maxWidth,\n attachments: attachmentsProp,\n defaultAttachments,\n onAttachmentsChange,\n accept,\n multiple = true,\n maxAttachments,\n maxFileSize,\n paste = true,\n pasteAccept,\n clearOnSubmit = true,\n onAttachmentReject,\n dropzone = true,\n apiRef,\n onBlurCapture,\n notices,\n context,\n ...divProps\n } = props;\n const size = useThemeSize(sizeProp, chatbarSizePropDef);\n\n const isValueControlled = valueProp != null;\n const [valueUncontrolled, setValueUncontrolled] = React.useState<string>(defaultValue);\n const value = isValueControlled ? valueProp : valueUncontrolled;\n\n const isOpenControlled = openProp != null;\n const [openUncontrolled, setOpenUncontrolled] = React.useState<boolean>(defaultOpen);\n const open = isOpenControlled ? openProp : openUncontrolled;\n\n // Treat `attachments` as controlled if the prop is provided, even if its value is `undefined`.\n // This avoids switching between controlled and uncontrolled when a consumer sets\n // `attachments={undefined}` to clear attachments. In that case we normalize to an empty array.\n const isAttachmentsControlled = 'attachments' in props;\n const [attachmentsUncontrolled, setAttachmentsUncontrolled] = React.useState<ChatbarAttachment[]>(() => defaultAttachments ?? []);\n const attachments = React.useMemo(\n () => (isAttachmentsControlled ? (attachmentsProp ?? []) : attachmentsUncontrolled),\n [isAttachmentsControlled, attachmentsProp, attachmentsUncontrolled],\n );\n\n // `id` changes on every announcement so identical messages still update the live region\n const [announcement, setAnnouncementState] = React.useState({ text: '', id: 0 });\n const announce = React.useCallback((text: string) => setAnnouncementState((prev) => ({ text, id: prev.id + 1 })), []);\n\n const rootRef = React.useRef<HTMLDivElement>(null);\n const composedRootRef = useComposedRefs(forwardedRef, rootRef);\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n // Blur-collapse guards: `pickerOpenRef` is true while the native dialog is open,\n // `pressGuardRef` covers the gap between pointerdown on a trigger and its click\n // (Safari blurs the textarea before the click fires).\n const pickerOpenRef = React.useRef(false);\n const pressGuardRef = React.useRef(false);\n const pressGuardTimerRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const pickerRef = React.useRef<{ patterns: string[]; multiple: boolean } | null>(null);\n\n const acceptKey = toArray(accept).join(',');\n const pasteAcceptKey = toArray(pasteAccept).join(',');\n const accepts = React.useMemo(() => toArray(acceptKey), [acceptKey]);\n const pasteAccepts = React.useMemo(() => (pasteAcceptKey ? toArray(pasteAcceptKey) : accepts), [pasteAcceptKey, accepts]);\n\n // Latest props/state for stable callbacks. Synced during render (not in an effect) so\n // child layout effects that call setOpen/setValue see this render's handlers.\n const snapshot = {\n value,\n attachments,\n accepts,\n pasteAccepts,\n multiple,\n maxAttachments,\n maxFileSize,\n disabled,\n readOnly,\n expandOn,\n isValueControlled,\n isOpenControlled,\n isAttachmentsControlled,\n onValueChange,\n onOpenChange,\n onAttachmentsChange,\n onAttachmentReject,\n onSubmit,\n };\n const latest = React.useRef(snapshot);\n // eslint-disable-next-line react-hooks/refs -- read only in callbacks/effects; see comment above\n latest.current = snapshot;\n\n // Attachments set during the current event, before Root re-renders. Cleared at the end\n // of the task so a controlled parent that rejects the change is not overridden.\n const pendingAttachmentsRef = React.useRef<ChatbarAttachment[] | null>(null);\n const getAttachments = React.useCallback(() => pendingAttachmentsRef.current ?? latest.current.attachments, []);\n\n const setOpen = React.useCallback((next: boolean) => {\n if (!latest.current.isOpenControlled) setOpenUncontrolled(next);\n latest.current.onOpenChange?.(next);\n }, []);\n\n const setValue = React.useCallback((next: string) => {\n if (!latest.current.isValueControlled) setValueUncontrolled(next);\n latest.current.onValueChange?.(next);\n }, []);\n\n const setAttachments = React.useCallback((next: ChatbarAttachment[]) => {\n // Back-to-back updates in one event must see each other\n pendingAttachmentsRef.current = next;\n queueMicrotask(() => {\n pendingAttachmentsRef.current = null;\n });\n if (!latest.current.isAttachmentsControlled) setAttachmentsUncontrolled(next);\n latest.current.onAttachmentsChange?.(next);\n }, []);\n\n // Object URLs Chatbar created and still owns\n const ownedUrlsRef = React.useRef<Set<string>>(new Set());\n\n const addFiles = React.useCallback(\n (files: File[], patterns: string[], multiple: boolean = latest.current.multiple): number => {\n const cfg = latest.current;\n if (cfg.disabled || cfg.readOnly || files.length === 0) return 0;\n\n const current = getAttachments();\n const next: ChatbarAttachment[] = [];\n const rejected: ChatbarAttachmentRejection[] = [];\n const remainingSlots = typeof cfg.maxAttachments === 'number' ? Math.max(cfg.maxAttachments - current.length, 0) : Infinity;\n const perActionLimit = multiple ? Infinity : 1;\n\n for (const file of files) {\n if (next.length >= remainingSlots || next.length >= perActionLimit) {\n rejected.push({ file, reason: 'count' });\n continue;\n }\n if (typeof cfg.maxFileSize === 'number' && file.size > cfg.maxFileSize) {\n rejected.push({ file, reason: 'size' });\n continue;\n }\n if (!matchesAccept(file, patterns)) {\n rejected.push({ file, reason: 'type' });\n continue;\n }\n const url = isImageLike(file.name, file.type) ? URL.createObjectURL(file) : undefined;\n if (url) ownedUrlsRef.current.add(url);\n next.push({ id: createAttachmentId(), name: file.name, size: file.size, type: file.type, file, url, status: 'idle' });\n }\n\n const messages: string[] = [];\n if (next.length > 0) {\n setAttachments(current.concat(next));\n if (cfg.expandOn !== 'none') setOpen(true);\n messages.push(`${plural(next.length, 'file')} attached.`);\n }\n if (rejected.length > 0) {\n cfg.onAttachmentReject?.(rejected);\n messages.push(`${plural(rejected.length, 'file')} could not be attached.`);\n }\n if (messages.length > 0) announce(messages.join(' '));\n return next.length;\n },\n [getAttachments, setAttachments, setOpen, announce],\n );\n\n const appendFiles = React.useCallback((files: File[]) => addFiles(files, latest.current.accepts), [addFiles]);\n const appendFilesFromPaste = React.useCallback((files: File[]) => addFiles(files, latest.current.pasteAccepts), [addFiles]);\n\n const removeAttachment = React.useCallback(\n (id: string) => {\n const current = getAttachments();\n const removed = current.find((a) => a.id === id);\n if (!removed) return;\n setAttachments(current.filter((a) => a.id !== id));\n announce(`Removed ${removed.name}.`);\n },\n [getAttachments, setAttachments, announce],\n );\n\n const submit = React.useCallback(\n (clear: boolean) => {\n const cfg = latest.current;\n if (cfg.disabled || cfg.readOnly) return false;\n const current = getAttachments();\n if (!hasText(cfg.value) && current.length === 0) return false;\n const payload = { value: cfg.value, attachments: current };\n // Hand preview URLs to the consumer only when they leave the chatbar; URLs still\n // rendered here stay owned so removing them later revokes them\n if (clear && cfg.onSubmit) {\n for (const att of current) if (att.url) ownedUrlsRef.current.delete(att.url);\n }\n cfg.onSubmit?.(payload);\n if (clear) {\n setValue('');\n setAttachments([]);\n }\n return true;\n },\n [getAttachments, setValue, setAttachments],\n );\n\n // Revoke owned object URLs that are no longer referenced by current attachments\n React.useEffect(() => {\n const owned = ownedUrlsRef.current;\n if (owned.size === 0) return;\n const current = new Set(attachments.map((a) => a.url));\n for (const url of Array.from(owned)) {\n if (!current.has(url)) {\n URL.revokeObjectURL(url);\n owned.delete(url);\n }\n }\n }, [attachments]);\n\n // On unmount, revoke URLs only when Chatbar owns the attachment list;\n // controlled attachments may still be rendered by the parent.\n React.useEffect(() => {\n const owned = ownedUrlsRef.current;\n return () => {\n if (latest.current.isAttachmentsControlled) return;\n for (const url of Array.from(owned)) URL.revokeObjectURL(url);\n owned.clear();\n };\n }, []);\n\n const openFilePicker = React.useCallback((options?: FilePickerOptions) => {\n const cfg = latest.current;\n const input = fileInputRef.current;\n // The picker guard takes over from the press guard\n clearTimeout(pressGuardTimerRef.current);\n pressGuardRef.current = false;\n if (!input || cfg.disabled || cfg.readOnly) return;\n const patterns = options?.accept != null ? toArray(options.accept) : cfg.accepts;\n const multiple = options?.multiple ?? cfg.multiple;\n pickerRef.current = { patterns, multiple };\n input.accept = patterns.join(',');\n input.multiple = multiple;\n pickerOpenRef.current = true;\n input.click();\n // Browsers block the dialog outside a user gesture; if the window kept focus,\n // no dialog opened and no focus/cancel/change event will clear the guard\n setTimeout(() => {\n if (document.hasFocus()) pickerOpenRef.current = false;\n }, 1000);\n }, []);\n\n const beginFilePickerPress = React.useCallback(() => {\n // On touch (notably iOS), the compatibility mousedown, blur and click arrive in later\n // tasks than pointerup, so hold the guard until the click or a timeout\n pressGuardRef.current = true;\n clearTimeout(pressGuardTimerRef.current);\n pressGuardTimerRef.current = setTimeout(() => {\n pressGuardRef.current = false;\n }, 800);\n }, []);\n\n React.useEffect(() => () => clearTimeout(pressGuardTimerRef.current), []);\n\n // Clear the picker guard when the dialog closes, whichever way it closes\n React.useEffect(() => {\n const input = fileInputRef.current;\n const reset = () => {\n pickerOpenRef.current = false;\n };\n window.addEventListener('focus', reset);\n input?.addEventListener('cancel', reset);\n return () => {\n window.removeEventListener('focus', reset);\n input?.removeEventListener('cancel', reset);\n };\n }, []);\n\n const handleFileInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const input = event.currentTarget;\n const files = Array.from(input.files ?? []);\n const picker = pickerRef.current;\n addFiles(files, picker?.patterns ?? latest.current.accepts, picker?.multiple);\n pickerOpenRef.current = false;\n pickerRef.current = null;\n // Reset so selecting the same file again still fires change\n input.value = '';\n },\n [addFiles],\n );\n\n const handleBlurCapture = React.useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n onBlurCapture?.(event);\n const cfg = latest.current;\n const rootEl = rootRef.current;\n if (!rootEl || cfg.expandOn === 'none') return;\n const nextTarget = event.relatedTarget as Node | null;\n if (nextTarget && rootEl.contains(nextTarget)) return;\n if (pickerOpenRef.current || pressGuardRef.current) return;\n if (!hasText(cfg.value) && getAttachments().length === 0) setOpen(false);\n },\n [onBlurCapture, setOpen, getAttachments],\n );\n\n const handleDrop = React.useCallback((files: File[]) => {\n appendFiles(files);\n }, [appendFiles]);\n\n // Validation happens in addFiles so drop, paste and picker share one rule set\n const { getRootProps, isDragActive } = useDropzone({\n onDrop: handleDrop,\n // Drop any earlier message so it is not re-announced when the drag hint goes away\n onDragEnter: () => announce(''),\n noClick: true,\n noKeyboard: true,\n // Textarea handles paste itself; letting the dropzone see it attaches twice\n noPaste: true,\n disabled: !dropzone || disabled || readOnly,\n });\n const dragActive = dropzone && isDragActive;\n\n React.useImperativeHandle(\n apiRef,\n () => ({\n focusTextarea: () => textareaRef.current?.focus({ preventScroll: true }),\n openFilePicker: () => openFilePicker(),\n }),\n [openFilePicker],\n );\n\n // Click-to-focus: focus textarea when clicking non-interactive areas inside the container\n const handleContainerPointerDown = React.useCallback(\n (event: React.PointerEvent) => {\n if (disabled) return;\n if (event.pointerType === 'mouse' && event.button !== 0) return;\n const target = event.target;\n if (target instanceof Element && target.closest('button, [role=\"button\"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex=\"-1\"])')) return;\n event.preventDefault();\n textareaRef.current?.focus({ preventScroll: true });\n },\n [disabled],\n );\n\n const contextValue = React.useMemo<ChatbarContextValue>(\n () => ({\n open,\n setOpen,\n setValue,\n size,\n expandOn,\n minLines,\n maxLines,\n sendMode,\n disabled,\n readOnly,\n paste,\n clearOnSubmit,\n multiple,\n textareaRef,\n attachments,\n removeAttachment,\n submit,\n appendFiles,\n appendFilesFromPaste,\n openFilePicker,\n beginFilePickerPress,\n }),\n [\n open, setOpen, setValue, size, expandOn, minLines, maxLines, sendMode, disabled, readOnly, paste,\n clearOnSubmit, multiple, attachments, removeAttachment, submit, appendFiles, appendFilesFromPaste,\n openFilePicker, beginFilePickerPress,\n ],\n );\n\n return (\n <ChatbarContext.Provider value={contextValue}>\n <ChatbarValueContext.Provider value={value}>\n <>\n <div\n {...divProps}\n ref={composedRootRef}\n className={classNames('kui-ChatbarRoot', `kui-r-size-${size}`, className)}\n style={{ position: 'relative', width, maxWidth, ...style }}\n data-state={open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n data-readonly={readOnly ? '' : undefined}\n data-drop-active={dragActive ? '' : undefined}\n data-accent-color={color}\n data-radius={radius}\n onBlurCapture={handleBlurCapture}\n >\n <input\n ref={fileInputRef}\n type=\"file\"\n tabIndex={-1}\n aria-hidden\n style={{ display: 'none' }}\n onChange={handleFileInputChange}\n />\n {notices ? (\n <div className=\"kui-ChatbarNotices\">\n <NoticeSizeContext.Provider value={size}>{notices}</NoticeSizeContext.Provider>\n </div>\n ) : null}\n <div {...(dropzone ? getRootProps() : {})} style={{ width: '100%', flex: '1 1 auto', minHeight: 0 }} onPointerDown={handleContainerPointerDown}>\n <div\n className={classNames('kui-ChatbarBox', `kui-variant-${variant ?? 'raised'}`)}\n style={{ position: 'relative' }}\n data-accent-color={color}\n data-radius={radius}\n >\n <div className=\"kui-ChatbarGrid\">\n {children}\n </div>\n {dragActive && (\n <div className=\"kui-ChatbarDropOverlay\" aria-hidden>\n <div className=\"kui-ChatbarDropContent\">\n <Text emphasis=\"medium\" size={size} weight=\"medium\">\n Drop files here to attach\n </Text>\n </div>\n </div>\n )}\n </div>\n </div>\n {context ? (\n <Text as=\"div\" size={size === '3' ? '2' : '1'} emphasis=\"medium\" className=\"kui-ChatbarContext\">\n {context}\n </Text>\n ) : null}\n <VisuallyHidden role=\"status\" aria-live=\"polite\">\n {dragActive ? 'Drop files here to attach.' : <span key={announcement.id}>{announcement.text}</span>}\n </VisuallyHidden>\n </div>\n </>\n </ChatbarValueContext.Provider>\n </ChatbarContext.Provider>\n );\n});\nRoot.displayName = 'Chatbar.Root';\n\n/**\n * Multi-line text input for Chatbar.\n * - Uses onChange to control value and avoid duplicate updates.\n * - Auto-resizes between minLines and maxLines.\n * - Expands on focus/overflow per `expandOn`.\n * - Paste-to-attach: when `paste` is enabled on Root, pasting files adds attachments.\n * - Provide `aria-label` or `aria-labelledby` for an accessible name.\n */\ninterface TextareaProps extends Omit<React.ComponentPropsWithoutRef<'textarea'>, 'size' | 'rows' | 'value' | 'defaultValue'> {\n asChild?: boolean;\n /**\n * When true, pressing Enter submits (Shift+Enter inserts a newline).\n * Works with every `sendMode`. Defaults to false.\n */\n submitOnEnter?: boolean;\n}\n\n/**\n * Chatbar multi-line text input.\n *\n * Behavior\n * - Controls the Chatbar value via React onChange.\n * - Auto-resizes between minLines and maxLines in a single layout effect, which\n * also opens the Chatbar when content overflows the compact height and\n * `expandOn` is `overflow` or `both`.\n * - Consumer handlers run first; calling `preventDefault` in `onKeyDown` or\n * `onPaste` skips the built-in submit or attach behavior.\n *\n * Accessibility\n * - Consumers should provide labeling via aria-label or aria-labelledby\n * on this component, as no implicit label is rendered.\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>((props, forwardedRef) => {\n const {\n className,\n style,\n asChild,\n onFocus,\n onChange,\n onPaste,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n submitOnEnter = false,\n ...textareaProps\n } = props;\n const ctx = useChatbarContext();\n const value = React.useContext(ChatbarValueContext);\n const { open, minLines, maxLines, expandOn, disabled, readOnly, setOpen, setValue, textareaRef, paste, appendFilesFromPaste, size, submit, clearOnSubmit } = ctx;\n const composedRef = useComposedRefs(forwardedRef, textareaRef);\n\n // Cached metrics to avoid repeated getComputedStyle calls\n const lineHeightRef = React.useRef(0);\n const paddingRef = React.useRef(0);\n const composingRef = React.useRef(false);\n\n const sizingRef = React.useRef({ open, minLines, maxLines });\n // Declared before the sizing effect so it runs first in the same commit\n useLayoutEffect(() => {\n sizingRef.current = { open, minLines, maxLines };\n }, [open, minLines, maxLines]);\n\n const recomputeMetrics = React.useCallback(() => {\n const el = textareaRef.current;\n if (!el) return;\n const computedStyle = window.getComputedStyle(el);\n lineHeightRef.current = parseFloat(computedStyle.lineHeight) || 20;\n paddingRef.current = (parseFloat(computedStyle.paddingTop) || 0) + (parseFloat(computedStyle.paddingBottom) || 0);\n }, [textareaRef]);\n\n // Sizes `el` for the given open state; caller must have set height to 'auto' first\n const applyHeight = React.useCallback((el: HTMLTextAreaElement, isOpen: boolean) => {\n const { minLines: min, maxLines: max } = sizingRef.current;\n const lineHeight = lineHeightRef.current;\n const padding = paddingRef.current;\n const minHeight = Math.ceil((isOpen ? min : 1) * lineHeight) + padding;\n const maxHeight = Math.ceil((isOpen ? max : 1) * lineHeight) + padding;\n const contentHeight = Math.max(el.scrollHeight, minHeight);\n el.style.height = `${Math.min(contentHeight, maxHeight)}px`;\n const overflowing = contentHeight > maxHeight;\n el.style.overflowY = overflowing ? 'auto' : 'hidden';\n el.style.maxHeight = overflowing ? `${maxHeight}px` : 'none';\n }, []);\n\n // Typography depends on size\n useLayoutEffect(() => {\n recomputeMetrics();\n }, [recomputeMetrics, size]);\n\n // Single place for sizing and overflow auto-open: one height reset, one scrollHeight read\n useLayoutEffect(() => {\n const el = textareaRef.current;\n if (!el) return;\n if (lineHeightRef.current === 0) recomputeMetrics();\n withoutPlaceholder(el, () => {\n el.style.height = 'auto';\n let isOpen = open;\n if (!open && (expandOn === 'overflow' || expandOn === 'both')) {\n const compactHeight = Math.ceil(lineHeightRef.current) + paddingRef.current;\n if (el.scrollHeight > compactHeight + 1) {\n isOpen = true;\n setOpen(true);\n }\n }\n applyHeight(el, isOpen);\n });\n }, [value, open, expandOn, minLines, maxLines, size, setOpen, textareaRef, recomputeMetrics, applyHeight]);\n\n // Width changes re-wrap text; re-measure only when the width actually changes\n React.useEffect(() => {\n const el = textareaRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n let prevWidth = -1;\n const ro = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width === prevWidth) return;\n const first = prevWidth === -1;\n prevWidth = width;\n if (first) return;\n recomputeMetrics();\n withoutPlaceholder(el, () => {\n el.style.height = 'auto';\n applyHeight(el, sizingRef.current.open);\n });\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, [textareaRef, recomputeMetrics, applyHeight]);\n\n // Dev-only warning if no accessible name is provided\n React.useEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n // Read the DOM, not the props: a `<label htmlFor>` or an asChild child's own label counts too.\n const el = textareaRef.current;\n const hasLabel =\n textareaProps['aria-label'] != null ||\n textareaProps['aria-labelledby'] != null ||\n Boolean(el?.getAttribute('aria-label') || el?.getAttribute('aria-labelledby') || el?.labels?.length);\n if (!hasLabel) {\n console.warn('[Chatbar.Textarea] Provide aria-label, aria-labelledby or a <label htmlFor> to ensure the control has an accessible name.');\n }\n // warn only on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleFocus = React.useCallback<React.FocusEventHandler<HTMLTextAreaElement>>(\n (event) => {\n onFocus?.(event);\n if (disabled || readOnly) return;\n if ((expandOn === 'focus' || expandOn === 'both') && !open) setOpen(true);\n },\n [disabled, readOnly, expandOn, open, setOpen, onFocus],\n );\n\n const handleChange = React.useCallback<React.ChangeEventHandler<HTMLTextAreaElement>>(\n (event) => {\n setValue(event.currentTarget.value);\n onChange?.(event);\n },\n [setValue, onChange],\n );\n\n const handlePaste = React.useCallback<React.ClipboardEventHandler<HTMLTextAreaElement>>(\n (event) => {\n onPaste?.(event);\n if (event.defaultPrevented || !paste || disabled || readOnly) return;\n const files = Array.from(event.clipboardData?.items ?? [])\n .filter((item) => item.kind === 'file')\n .map((item) => item.getAsFile())\n .filter((f): f is File => !!f);\n if (files.length === 0) return;\n // Suppress the filename/text representation only when a file was actually attached\n if (appendFilesFromPaste(files) > 0) event.preventDefault();\n },\n [paste, disabled, readOnly, onPaste, appendFilesFromPaste],\n );\n\n const handleCompositionStart = React.useCallback<React.CompositionEventHandler<HTMLTextAreaElement>>(\n (event) => {\n composingRef.current = true;\n onCompositionStart?.(event);\n },\n [onCompositionStart],\n );\n\n const handleCompositionEnd = React.useCallback<React.CompositionEventHandler<HTMLTextAreaElement>>(\n (event) => {\n composingRef.current = false;\n onCompositionEnd?.(event);\n },\n [onCompositionEnd],\n );\n\n const handleKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLTextAreaElement>>(\n (event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || !submitOnEnter) return;\n if (event.key !== 'Enter' || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;\n // Safari fires the IME-confirming Enter after compositionend with keyCode 229\n if (composingRef.current || event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;\n // Plain Enter never inserts a newline when submitOnEnter is on, even with nothing to send\n event.preventDefault();\n submit(clearOnSubmit);\n },\n [submitOnEnter, onKeyDown, submit, clearOnSubmit],\n );\n\n const Comp = asChild ? Slot : 'textarea';\n return (\n // className and style both reach the textarea, like every other textarea attribute.\n <div className=\"kui-ChatbarField kui-ChatbarTextarea\">\n <Comp\n {...textareaProps}\n ref={composedRef}\n className={classNames('kui-ChatbarInput', className)}\n value={value}\n onChange={handleChange}\n onFocus={handleFocus}\n onPaste={handlePaste}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n disabled={disabled}\n readOnly={readOnly}\n rows={open ? minLines : 1}\n spellCheck={textareaProps.spellCheck ?? true}\n autoCorrect={textareaProps.autoCorrect ?? 'on'}\n style={style}\n />\n </div>\n );\n});\nTextarea.displayName = 'Chatbar.Textarea';\n\ninterface InlineSlotProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n asChild?: boolean;\n children?: React.ReactNode;\n}\n\nconst InlineStart = React.forwardRef<HTMLDivElement, InlineSlotProps>((props, forwardedRef) => {\n const { children, asChild, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (ctx.open) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarInlineStart', className)}>\n {children}\n </Comp>\n );\n});\nInlineStart.displayName = 'Chatbar.InlineStart';\n\nconst InlineEnd = React.forwardRef<HTMLDivElement, InlineSlotProps>((props, forwardedRef) => {\n const { children, asChild, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (ctx.open) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarInlineEnd', className)}>\n {children}\n </Comp>\n );\n});\nInlineEnd.displayName = 'Chatbar.InlineEnd';\n\n/**\n * Renders a horizontally scrollable list of attachments above the inline row.\n * Hidden when empty unless `forceMount`. Override per-item with `renderAttachment`.\n * `Chatbar.Item`s passed as children follow the attachments in the same row.\n */\ninterface AttachmentsRowProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n asChild?: boolean;\n forceMount?: boolean;\n /** If provided, custom-render a tile; otherwise default tile is used */\n renderAttachment?: (attachment: ChatbarAttachment) => React.ReactNode;\n /** `Chatbar.Item`s: things the message refers to that are not files. */\n children?: React.ReactNode;\n}\n\nconst AttachmentsRow = React.forwardRef<HTMLDivElement, AttachmentsRowProps>((props, forwardedRef) => {\n const { asChild, forceMount, renderAttachment, className, children, ...divProps } = props;\n const ctx = useChatbarContext();\n const hasItems = React.Children.toArray(children).length > 0;\n if (ctx.attachments.length === 0 && !hasItems && !forceMount) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <div>\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarAttachmentsRow', className)} role=\"list\" aria-label={divProps['aria-label'] ?? 'Attachments'}>\n <ScrollArea className=\"kui-ChatbarScrollArea\" scrollbars=\"horizontal\">\n <Flex align=\"center\" gap=\"3\" minWidth=\"fit-content\">\n {ctx.attachments.map((att) => (\n <Attachment key={att.id} attachment={att} asChild={!!renderAttachment}>\n {renderAttachment?.(att)}\n </Attachment>\n ))}\n {children}\n </Flex>\n </ScrollArea>\n </Comp>\n </div>\n );\n});\nAttachmentsRow.displayName = 'Chatbar.AttachmentsRow';\n\n/**\n * Moves focus off a pill that is about to unmount, to the next pill's remove\n * button, the previous one's, or the text, so keyboard users are not dropped\n * to <body>.\n */\nfunction moveFocusOffPill(button: HTMLButtonElement, textareaRef: React.RefObject<HTMLTextAreaElement | null>) {\n const pill = button.closest('[role=\"listitem\"]');\n const pills = pill?.parentElement ? Array.from(pill.parentElement.children) : [];\n const index = pill ? pills.indexOf(pill) : -1;\n const neighbour = pills[index + 1] ?? pills[index - 1];\n const nextButton = neighbour?.querySelector<HTMLButtonElement>('.kui-ChatbarItemRemove');\n if (nextButton) nextButton.focus();\n else textareaRef.current?.focus({ preventScroll: true });\n}\n\n/** The pill an attachment and an item share: a lead tile, a label and \u00D7. */\nconst Pill: React.FC<{\n lead: React.ReactNode;\n leadKind: 'image' | 'icon';\n label: React.ReactNode;\n /** Read after the label by screen readers only, e.g. a file's size. */\n detail?: string;\n removeLabel: string;\n onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n}> = ({ lead, leadKind, label, detail, removeLabel, onRemove }) => {\n const ctx = useChatbarContext();\n return (\n <>\n <span className=\"kui-ChatbarItemLead\" data-kind={leadKind} aria-hidden>\n {lead}\n </span>\n <Text className=\"kui-ChatbarItemLabel\" size={ctx.size} truncate>\n {label}\n {detail ? <VisuallyHidden>, {detail}</VisuallyHidden> : null}\n </Text>\n {onRemove && (\n <Button iconOnly className=\"kui-ChatbarItemRemove\" aria-label={removeLabel} size=\"1\" variant=\"ghost\" color=\"gray\" onClick={onRemove}>\n <CloseIcon />\n </Button>\n )}\n </>\n );\n};\n\n/** Default tile renderer for a single attachment. */\ninterface AttachmentProps extends React.ComponentPropsWithoutRef<'div'> {\n attachment: ChatbarAttachment;\n asChild?: boolean;\n}\n\nconst STATUS_LABEL: Partial<Record<AttachmentStatus, string>> = { uploading: 'uploading', error: 'failed to upload' };\n\nconst Attachment = React.forwardRef<HTMLDivElement, AttachmentProps>((props, forwardedRef) => {\n const { attachment, asChild, className, children, ...divProps } = props;\n const ctx = useChatbarContext();\n const Comp = asChild ? Slot : 'div';\n const isImage = !!attachment.url && isImageLike(attachment.name, attachment.type);\n const kilobytes = Math.ceil(attachment.size / 1024);\n const sizeLabel = kilobytes >= 1024 ? `${Math.round((kilobytes / 1024) * 10) / 10} MB` : `${kilobytes} KB`;\n const statusLabel = attachment.status ? STATUS_LABEL[attachment.status] : undefined;\n const locked = ctx.disabled || ctx.readOnly;\n\n const handleRemove = (event: React.MouseEvent<HTMLButtonElement>) => {\n moveFocusOffPill(event.currentTarget, ctx.textareaRef);\n ctx.removeAttachment(attachment.id);\n };\n\n const lead =\n attachment.status === 'uploading' ? (\n <Spinner />\n ) : isImage ? (\n <img className=\"kui-ChatbarAttachmentImage\" src={attachment.url} alt=\"\" />\n ) : (\n <FileTextIcon />\n );\n\n return (\n <Comp\n {...divProps}\n ref={forwardedRef}\n className={classNames(children ? 'kui-ChatbarAttachment' : 'kui-ChatbarAttachment kui-ChatbarItem', className)}\n role=\"listitem\"\n data-kind={isImage ? 'image' : 'file'}\n data-status={attachment.status}\n title={attachment.name}\n >\n {children ?? (\n <Pill\n lead={lead}\n leadKind={isImage && attachment.status !== 'uploading' ? 'image' : 'icon'}\n label={attachment.name}\n detail={statusLabel ? `${sizeLabel}, ${statusLabel}` : sizeLabel}\n removeLabel={`Remove ${attachment.name}`}\n onRemove={locked ? undefined : handleRemove}\n />\n )}\n </Comp>\n );\n});\nAttachment.displayName = 'Chatbar.Attachment';\n\n/**\n * Something the message refers to that is not a file: a scene object, a\n * picked mode, a selection. The same pill as an attachment, placed in\n * `Chatbar.AttachmentsRow` as a child. The app owns the list, so removing one\n * calls `onRemove` and nothing else; leave it out for a pill that cannot be\n * removed.\n */\ninterface ItemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children' | 'color'> {\n /** The label. Also names the remove button: \"Remove {label}\". */\n children: string;\n /** Drawn in the lead tile, tinted with `color`. */\n icon?: React.ReactNode;\n /** A thumbnail for the lead tile, in place of the icon. */\n image?: string;\n /** Tint of the icon tile. Defaults to gray. */\n color?: (typeof accentColors)[number];\n onRemove?: () => void;\n /** Overrides the remove button's label. */\n removeLabel?: string;\n}\n\nconst Item = React.forwardRef<HTMLDivElement, ItemProps>((props, forwardedRef) => {\n const { children, icon, image, color, onRemove, removeLabel, className, ...divProps } = props;\n const ctx = useChatbarContext();\n const locked = ctx.disabled || ctx.readOnly;\n\n const handleRemove = onRemove\n ? (event: React.MouseEvent<HTMLButtonElement>) => {\n moveFocusOffPill(event.currentTarget, ctx.textareaRef);\n onRemove();\n }\n : undefined;\n\n return (\n <div\n {...divProps}\n ref={forwardedRef}\n className={classNames('kui-ChatbarItem', className)}\n role=\"listitem\"\n data-accent-color={image ? undefined : (color ?? 'gray')}\n title={children}\n >\n <Pill\n lead={image ? <img className=\"kui-ChatbarAttachmentImage\" src={image} alt=\"\" /> : icon}\n leadKind={image ? 'image' : 'icon'}\n label={children}\n removeLabel={removeLabel ?? `Remove ${children}`}\n onRemove={locked ? undefined : handleRemove}\n />\n </div>\n );\n});\nItem.displayName = 'Chatbar.Item';\n\ninterface AttachTriggerProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n /** Overrides Root `accept` for files chosen through this trigger */\n accept?: string | string[];\n multiple?: boolean;\n}\n\nconst AttachTrigger = React.forwardRef<HTMLButtonElement, AttachTriggerProps>((props, forwardedRef) => {\n // The HTML `color` attribute is dropped: Button reads `color` as an accent colour.\n const { asChild, accept, multiple, disabled: disabledProp, onPointerDown, onClick, children, color: _color, ...buttonProps } = props;\n const ctx = useChatbarContext();\n const disabled = disabledProp || ctx.disabled || ctx.readOnly;\n const triggerProps = {\n ...buttonProps,\n ref: forwardedRef,\n className: classNames('kui-ChatbarAttachTrigger', buttonProps.className),\n type: buttonProps.type ?? 'button',\n 'aria-label': buttonProps['aria-label'] ?? 'Add attachments',\n disabled,\n onPointerDown: (event: React.PointerEvent<HTMLButtonElement>) => {\n onPointerDown?.(event);\n if (!disabled && !event.defaultPrevented) ctx.beginFilePickerPress();\n },\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (disabled || event.defaultPrevented) return;\n ctx.openFilePicker({ accept, multiple });\n },\n } as const;\n\n if (asChild) return <Slot {...triggerProps}>{children}</Slot>;\n\n // Without asChild, the trigger is a quiet icon-only Button at the Chatbar's size.\n return (\n <Button iconOnly emphasis=\"quiet\" color=\"gray\" size={ctx.size} {...triggerProps}>\n {children ?? <PaperclipIcon aria-hidden />}\n </Button>\n );\n});\nAttachTrigger.displayName = 'Chatbar.AttachTrigger';\n\ninterface RowProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n asChild?: boolean;\n children?: React.ReactNode;\n}\n\nconst Row = React.forwardRef<HTMLDivElement, RowProps>((props, forwardedRef) => {\n const { asChild, children, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (!ctx.open) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <div>\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarRow', className)}>\n <Flex align=\"center\" justify=\"between\" width=\"100%\">\n {children}\n </Flex>\n </Comp>\n </div>\n );\n});\nRow.displayName = 'Chatbar.Row';\n\ntype RowSlotProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst RowStart = React.forwardRef<HTMLDivElement, RowSlotProps>((props, forwardedRef) => {\n const { className, ...divProps } = props;\n return <div {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarRowStart', className)} />;\n});\nRowStart.displayName = 'Chatbar.RowStart';\n\nconst RowEnd = React.forwardRef<HTMLDivElement, RowSlotProps>((props, forwardedRef) => {\n const { className, ...divProps } = props;\n return <div {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarRowEnd', className)} />;\n});\nRowEnd.displayName = 'Chatbar.RowEnd';\n\ntype SendStatus = 'ready' | 'submitted' | 'streaming' | 'error';\n\ntype SendProps = Omit<ButtonProps, 'aria-label' | 'aria-labelledby' | 'variant' | 'emphasis' | 'iconOnly' | 'fullWidth'> &\n ButtonRankProps & {\n /** Optional override for accessible name. Defaults to \"Send\". */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n asChild?: boolean;\n /** Clear message and attachments after sending. Defaults to Root `clearOnSubmit`. */\n clearOnSend?: boolean;\n /**\n * What the button means. `ready` sends. While a reply is `submitted` or `streaming` and the\n * box is empty, the button STOPS the reply (`onStop`); with a draft in the box it still sends,\n * and the app decides whether sending interrupts the reply. After an `error`, an empty box\n * makes it RETRY (`onRetry`). Default `ready`.\n */\n status?: SendStatus;\n /** Called when the button is pressed to stop a reply. */\n onStop?: () => void;\n /** Called when the button is pressed to retry after an error. */\n onRetry?: () => void;\n /** Accessible name while it stops. Default \"Stop\". */\n stopLabel?: string;\n /** Accessible name while it retries. Default \"Retry\". */\n retryLabel?: string;\n /** Glyph while it stops. Defaults to a square, or a spinner while `submitted`. */\n stopIcon?: React.ReactNode;\n /** Glyph while it retries. */\n retryIcon?: React.ReactNode;\n};\n\nconst Send = React.forwardRef<HTMLButtonElement, SendProps>((props, forwardedRef) => {\n const {\n asChild,\n clearOnSend,\n disabled,\n children,\n style,\n className,\n size: sizeProp,\n variant: variantProp, emphasis,\n tabIndex,\n onClick,\n status = 'ready',\n onStop,\n onRetry,\n stopLabel = 'Stop',\n retryLabel = 'Retry',\n stopIcon,\n retryIcon,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...buttonProps\n } = props;\n const ctx = useChatbarContext();\n const value = React.useContext(ChatbarValueContext);\n\n const hasContent = hasText(value) || ctx.attachments.length > 0;\n const running = status === 'submitted' || status === 'streaming';\n const mode: 'send' | 'stop' | 'retry' = hasContent ? 'send' : running ? 'stop' : status === 'error' ? 'retry' : 'send';\n\n if (ctx.sendMode === 'never' && mode === 'send') return null;\n\n const visible = mode !== 'send' || ctx.sendMode === 'always' || hasContent;\n const inactive = mode === 'send' ? disabled || ctx.disabled || ctx.readOnly || !hasContent : disabled || ctx.disabled;\n\n const sendName = ariaLabel ?? 'Send';\n const labelProps: { 'aria-label': string } | { 'aria-labelledby': string } =\n mode === 'stop' ? { 'aria-label': stopLabel } : mode === 'retry' ? { 'aria-label': retryLabel } : ariaLabelledby ? { 'aria-labelledby': ariaLabelledby } : { 'aria-label': sendName };\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented || inactive) return;\n if (mode === 'stop') {\n onStop?.();\n return;\n }\n if (mode === 'retry') {\n onRetry?.();\n return;\n }\n const clear = clearOnSend ?? ctx.clearOnSubmit;\n // Clearing hides and disables this button; keep keyboard focus in the composer\n if (ctx.submit(clear) && clear) ctx.textareaRef.current?.focus({ preventScroll: true });\n };\n\n const glyph =\n mode === 'stop' ? (\n stopIcon ?? (status === 'submitted' ? <Spinner /> : (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2\" />\n </svg>\n ))\n ) : mode === 'retry' ? (\n retryIcon ?? (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M3 12a9 9 0 1 0 3-6.7L3 8\" />\n <path d=\"M3 3v5h5\" />\n </svg>\n )\n ) : (\n children ?? (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n )\n );\n\n return (\n <Button\n iconOnly\n {...buttonProps}\n ref={forwardedRef}\n size={sizeProp ?? ctx.size}\n {...(emphasis ? { emphasis } : { variant: variantProp ?? (ctx.open || mode !== 'send' ? 'solid' : 'ghost') })}\n disabled={inactive}\n className={classNames('kui-ChatbarSend', className)}\n style={{ opacity: visible ? 1 : 0, pointerEvents: visible ? undefined : 'none', ...style }}\n // Hidden Send must not be reachable by keyboard or announced\n aria-hidden={visible ? undefined : true}\n tabIndex={visible ? tabIndex : -1}\n asChild={asChild}\n onClick={handleClick}\n data-status={status}\n data-mode={mode}\n {...labelProps}\n >\n {glyph}\n </Button>\n );\n});\nSend.displayName = 'Chatbar.Send';\n\nexport { Root, Textarea, InlineStart, InlineEnd, AttachmentsRow, Attachment, Item, AttachTrigger, Row, RowStart, RowEnd, Send };\nexport type {\n RootProps as ChatbarRootProps,\n TextareaProps as ChatbarTextareaProps,\n InlineSlotProps as ChatbarInlineSlotProps,\n AttachmentsRowProps as ChatbarAttachmentsRowProps,\n AttachmentProps as ChatbarAttachmentProps,\n ItemProps as ChatbarItemProps,\n AttachTriggerProps as ChatbarAttachTriggerProps,\n RowProps as ChatbarRowProps,\n RowSlotProps as ChatbarRowSlotProps,\n SendProps as ChatbarSendProps,\n ChatbarAttachment,\n ChatbarAttachmentRejection,\n ChatbarRejectReason,\n ChatbarSubmitPayload,\n AttachmentStatus as ChatbarAttachmentStatus,\n ExpandOn as ChatbarExpandOn,\n SendMode as ChatbarSendMode,\n SendStatus as ChatbarSendStatus,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\nimport { Tooltip } from './tooltip.js';\nimport { useTooltipWrapper } from '../hooks/use-tooltip-wrapper.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\ntype ButtonElement = React.ElementRef<typeof BaseButton>;\n\n/**\n * Tooltip configuration props that can be passed to Button\n * These props are forwarded to the underlying Tooltip component\n */\nexport interface ButtonTooltipProps {\n /** Content to display in the tooltip on hover/focus */\n tooltip?: React.ReactNode;\n /** Side of the button where the tooltip should appear */\n tooltipSide?: 'top' | 'right' | 'bottom' | 'left';\n /** Alignment of the tooltip relative to the button */\n tooltipAlign?: 'start' | 'center' | 'end';\n /** Delay before showing the tooltip (in milliseconds) */\n tooltipDelayDuration?: number;\n /** Whether to disable hoverable content behavior */\n tooltipDisableHoverableContent?: boolean;\n}\n\n/**\n * Core Button props excluding the 'as' prop for polymorphic behavior\n * Combines BaseButton props with tooltip functionality\n */\ntype ButtonEmphasis = 'loud' | 'medium' | 'quiet';\n\n/** `emphasis` is a button's rank: loud is `solid`, medium is `raised`, quiet is `ghost`. */\nconst EMPHASIS_VARIANT = { loud: 'solid', medium: 'raised', quiet: 'ghost' } as const;\n\n/**\n * A button states its rank with `emphasis` or its look with `variant`, never both.\n */\ntype ButtonRankProps =\n | {\n /** The button's look. `outline` and `surface` have no emphasis of their own. */\n variant?: BaseButtonProps['variant'];\n emphasis?: never;\n }\n | {\n /** The button's rank: `loud` (solid, the default), `medium` (raised) or `quiet` (ghost). */\n emphasis?: ButtonEmphasis;\n variant?: never;\n };\n\n/**\n * An icon-only button is square and holds only its icon, so it has no visible text: the type\n * requires `aria-label` or `aria-labelledby`. It never takes the full width.\n */\ntype ButtonIconOnlyProps =\n | {\n /** Makes the button square and shows only the icon in `children`. Requires `aria-label` or `aria-labelledby`. */\n iconOnly: true;\n /** The button's name for screen readers. Required with `iconOnly` unless `aria-labelledby` is set. */\n 'aria-label': string;\n fullWidth?: never;\n }\n | {\n /** Makes the button square and shows only the icon in `children`. Requires `aria-label` or `aria-labelledby`. */\n iconOnly: true;\n /** The id of an element that names this button. Use it instead of `aria-label`. */\n 'aria-labelledby': string;\n fullWidth?: never;\n }\n | { iconOnly?: false };\n\ntype ButtonOwnProps = Omit<BaseButtonProps, 'as' | 'variant'> & ButtonRankProps & ButtonTooltipProps & ButtonIconOnlyProps;\n\n/**\n * Polymorphic Button props that support rendering as different HTML elements\n * @template C - The element type to render as (defaults to 'button')\n */\ntype ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;\n\n/**\n * Button component type that supports polymorphic rendering\n * @template C - The element type to render as\n */\ntype ButtonComponent = <C extends React.ElementType = 'button'>(props: ButtonProps<C> & { ref?: React.ForwardedRef<ButtonElement> }) => React.ReactElement | null;\n\n/**\n * An icon-only button must have an accessible name. Logs an error, never throws: a name that is\n * still loading (an empty `aria-label` while a translation loads) must not crash the tree.\n */\nfunction validateIconButtonName(props: Record<string, unknown>) {\n if (process.env.NODE_ENV === 'production' || props['aria-label'] || props['aria-labelledby']) return;\n const errorMessage =\n 'Button: an `iconOnly` button must have an accessible name. Pass `aria-label`, or ' +\n '`aria-labelledby` referencing a label element.';\n console.error(errorMessage);\n}\n\n/**\n * Button component for triggering actions throughout your interface\n *\n * The Button component is the primary interactive element in the Kookie User Interface.\n * It provides six visual variants, four sizes, comprehensive color options, and built-in\n * tooltip support. The component automatically handles icon sizing, supports responsive\n * layouts, and provides accessibility compliance out of the box.\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button>Click me</Button>\n *\n * // Button with variant and size\n * <Button variant=\"solid\" size=\"3\">Primary Action</Button>\n *\n * // Button with tooltip\n * <Button tooltip=\"Save your progress\">Save</Button>\n *\n * // Polymorphic button as link\n * <Button as=\"a\" href=\"/dashboard\">Go to Dashboard</Button>\n *\n * // Square, icon-only button: needs an accessible name\n * <Button iconOnly aria-label=\"Settings\"><Settings /></Button>\n * ```\n */\nconst Button = React.forwardRef(\n (\n {\n className,\n style,\n tooltip,\n tooltipSide = 'top',\n tooltipAlign = 'center',\n tooltipDelayDuration,\n tooltipDisableHoverableContent,\n iconOnly = false,\n emphasis,\n variant,\n ...props\n }: ButtonProps,\n forwardedRef: React.ForwardedRef<ButtonElement>,\n ) => {\n // Use shared tooltip wrapper hook for accessibility props\n const { tooltipId, hasTooltip, accessibilityProps: tooltipAccessibilityProps } = useTooltipWrapper(tooltip);\n\n // An icon-only button is square, so it never takes the full width.\n if (iconOnly) {\n validateIconButtonName(props as Record<string, unknown>);\n (props as { fullWidth?: boolean }).fullWidth = false;\n }\n\n // Both set the same thing. The types forbid it; an untyped spread that sets both logs and\n // `emphasis` wins, rather than crashing the tree.\n if (emphasis !== undefined && variant !== undefined && process.env.NODE_ENV !== 'production') {\n console.error('Button: pass `emphasis` or `variant`, not both. They set the same thing; `emphasis` wins.');\n }\n const resolvedVariant = emphasis !== undefined ? EMPHASIS_VARIANT[emphasis] : variant;\n\n // The tooltip's description joins the caller's aria-describedby rather than replacing it.\n const callerDescribedBy = (props as { 'aria-describedby'?: string })['aria-describedby'];\n const tooltipDescribedBy = (tooltipAccessibilityProps as { 'aria-describedby'?: string })['aria-describedby'];\n const ariaDescribedBy = [callerDescribedBy, tooltipDescribedBy].filter(Boolean).join(' ') || undefined;\n\n const button = (\n <BaseButton\n {...props}\n variant={resolvedVariant}\n aria-describedby={ariaDescribedBy}\n ref={forwardedRef}\n data-icon-only={iconOnly || undefined}\n className={classNames('kui-Button', className)}\n style={style}\n />\n );\n\n // If no tooltip is provided, return the button as-is for better performance\n if (!hasTooltip) {\n return button;\n }\n\n // Wrap with Tooltip when tooltip content is provided\n // This creates a compound component that handles both button and tooltip functionality\n return (\n <Tooltip content={tooltip} side={tooltipSide} align={tooltipAlign} delayDuration={tooltipDelayDuration} disableHoverableContent={tooltipDisableHoverableContent} id={tooltipId}>\n {button}\n </Tooltip>\n );\n },\n) as ButtonComponent & { displayName?: string };\n\nButton.displayName = 'Button';\n\nexport { Button };\nexport type { ButtonProps, ButtonEmphasis, ButtonRankProps, ButtonIconOnlyProps };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\n\nimport { baseButtonPropDefs } from './base-button.props.js';\nimport { Flex } from '../flex.js';\nimport { Spinner } from '../spinner.js';\nimport { TickIcon } from '../icons.js';\nimport { extractProps } from '../../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../../hooks/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../../props/prop-def.js';\n\ntype BaseButtonElement = React.ElementRef<'button'>;\ntype BaseButtonOwnProps = GetPropDefTypes<typeof baseButtonPropDefs>;\n\n/**\n * Polymorphic BaseButton props that support rendering as different HTML elements\n * Uses the proper ComponentPropsWithout pattern for type safety\n * @template C - The element type to render as (defaults to 'button')\n */\ntype PolymorphicBaseButtonProps<C extends React.ElementType = 'button'> = {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & BaseButtonOwnProps &\n BaseButtonDoneProps &\n ComponentPropsWithout<C, RemovedProps | keyof BaseButtonOwnProps | 'as' | 'done'>;\n\ninterface BaseButtonDoneProps {\n /**\n * Shows a tick in place of the icon to say that the action finished. The tick takes the\n * icon's box, so nothing moves, and the icon comes back as soon as `done` is false again. On\n * an `iconOnly` button the tick replaces the content. It doesn't block the press. Screen\n * readers don't announce the tick, so also change the label or `aria-label` (for example,\n * `Copy` to `Copied`).\n */\n done?: boolean;\n}\n\n/**\n * BaseButton props interface that combines all available props\n */\ninterface BaseButtonProps extends PolymorphicBaseButtonProps {}\n\n/**\n * BaseButton component that provides the core button functionality\n *\n * This is the foundational button component that handles all the complex logic\n * including loading states, accessibility, performance optimizations, and\n * polymorphic rendering. It's used by Button and Toggle to ensure consistent behavior across the design system.\n *\n * Key features:\n * - Loading state with spinner and accessibility announcements\n * - Comprehensive accessibility support\n * - Polymorphic rendering support\n *\n * @example\n * ```tsx\n * // Basic usage\n * <BaseButton>Click me</BaseButton>\n *\n * // With loading state\n * <BaseButton loading>Processing...</BaseButton>\n *\n * // Polymorphic rendering\n * <BaseButton as=\"a\" href=\"/link\">Link Button</BaseButton>\n * ```\n */\nconst BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, baseButtonPropDefs.size);\n\n // Extract button-specific props from the combined props object\n const {\n className,\n children,\n asChild,\n as,\n color,\n radius,\n disabled: nativeDisabled,\n done = false,\n ...baseButtonProps\n } = extractProps(props, baseButtonPropDefs);\n\n // Loading blocks activation but keeps the native `disabled` off, so the button keeps focus\n // and its place in the tab order (aria-disabled carries the state). An explicit `disabled`\n // stays native on form controls; on anything else (a link, an asChild child) the `disabled`\n // attribute does nothing, so aria-disabled carries the state and the click is stopped here.\n const loading = Boolean(props.loading);\n const canLoad = props.loading !== undefined;\n const disabled = Boolean(nativeDisabled) || loading;\n const { onClick, 'aria-describedby': ariaDescribedByProp } = baseButtonProps as {\n onClick?: React.MouseEventHandler<HTMLElement>;\n 'aria-describedby'?: string;\n };\n const handleClick = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n },\n [disabled, onClick],\n );\n\n // Which edges start or end with an icon. A bare edge pads wider under a full radius; an edge\n // holding an icon keeps the plain padding (the icon already stands between text and curve).\n // Rendering guesses from the children: an svg element, or a component at either end that is\n // not a known text component (`<Text>`, `<Kbd>`, `<Trans>` and the like), counts as an icon,\n // so the server output is right for icon components such as HugeIcons. After mount the\n // rendered DOM settles it: only an svg is an icon, which corrects a wrong guess.\n const childEdges = React.useMemo(() => {\n const content =\n asChild && React.isValidElement(children) ? (children.props as { children?: React.ReactNode }).children : children;\n // Fragments are see-through: their own first and last children are the edges.\n const items = flattenFragments(content);\n const isIcon = (node: React.ReactNode) =>\n React.isValidElement(node) &&\n (node.type === 'svg' ||\n (typeof node.type !== 'string' && node.type !== React.Fragment && !TEXT_COMPONENTS.has(componentName(node.type))));\n return { iconStart: isIcon(items[0]), iconEnd: isIcon(items[items.length - 1]) };\n }, [asChild, children]);\n const [domEdges, setDomEdges] = React.useState<{ iconStart: boolean; iconEnd: boolean } | null>(null);\n const elementRef = React.useRef<HTMLElement>(null);\n const composedRef = useComposedRefs(forwardedRef, elementRef as React.Ref<BaseButtonElement>);\n useLayoutEffect(() => {\n const element = elementRef.current;\n // While loading the sr-only copy and spinner follow the content, and while done the tick\n // stands at the start; keep the edges read before either.\n if (!element || loading || done) return;\n const contentRoot = element.querySelector(':scope > .kui-BaseButtonContent') ?? element;\n const iconStart = edgeIsSvg(contentRoot, 'start');\n const iconEnd = edgeIsSvg(contentRoot, 'end');\n setDomEdges((prev) => (prev && prev.iconStart === iconStart && prev.iconEnd === iconEnd ? prev : { iconStart, iconEnd }));\n });\n const { iconStart, iconEnd } = domEdges ?? childEdges;\n\n // Done swaps the icon for a tick in the same place: the leading icon when there is one, the\n // whole content on an icon-only button. Without a leading icon the tick goes before the label.\n const iconOnly = Boolean((baseButtonProps as Record<string, unknown>)['data-icon-only']);\n const content = React.useMemo(() => {\n if (!done) return children;\n const tick = <TickIcon key=\"kui-done-tick\" className=\"kui-BaseButtonTick\" aria-hidden />;\n const swap = (nodes: React.ReactNode): React.ReactNode => {\n if (iconOnly) return tick;\n const items = flattenFragments(nodes);\n const first = items.findIndex((node) => !(typeof node === 'string' && !node.trim()));\n // Before the DOM has been read (a button that mounts done), the edges are only a guess from\n // the children, and a label component can look like an icon. Replace only a real svg then,\n // so the label is never swapped out; otherwise put the tick before it.\n const firstNode = items[first];\n const replaceable =\n first !== -1 && iconStart && (domEdges !== null || (React.isValidElement(firstNode) && firstNode.type === 'svg'));\n if (replaceable) return items.map((node, index) => (index === first ? tick : node));\n return [tick, ...items];\n };\n if (asChild && React.isValidElement(children)) {\n const element = children as React.ReactElement<{ children?: React.ReactNode }>;\n return React.cloneElement(element, undefined, swap(element.props.children));\n }\n return swap(children);\n }, [done, children, iconOnly, iconStart, domEdges, asChild]);\n\n // asChild takes precedence over as prop for Radix Slot integration\n // When asChild is true, we use Slot.Root to merge props onto the child element\n // When asChild is false, we render as the specified element (or button by default)\n const Comp = asChild ? Slot.Root : (as || 'button');\n\n // Only pass disabled for elements that support it\n // This prevents invalid HTML attributes on unsupported elements. With asChild, the child's own\n // element type decides: a link child gets aria-disabled, not an invalid `disabled`.\n const formElements = ['button', 'input', 'textarea', 'select'];\n const renderedType = asChild ? (React.isValidElement(children) ? children.type : undefined) : (as || 'button');\n const shouldPassDisabled = typeof renderedType === 'string' && formElements.includes(renderedType);\n\n // With asChild, Radix Slot runs the child's own onClick before ours, so a disabled asChild\n // button stops the click in the capture phase, before any bubble handler runs.\n const { onClickCapture } = baseButtonProps as { onClickCapture?: React.MouseEventHandler<HTMLElement> };\n const handleClickCapture = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (asChild && disabled) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n onClickCapture?.(event);\n },\n [asChild, disabled, onClickCapture],\n );\n\n // Determine if we are rendering a real <button> element so we can set a safe\n // default type. Native <button> defaults to type=\"submit\" which can cause\n // accidental form submissions. We default to type=\"button\" unless the user\n // explicitly provided a type or we're using asChild (unknown underlying node).\n const isNativeButtonElement = !asChild && (!as || as === 'button');\n const hasExplicitTypeAttribute = 'type' in (baseButtonProps as Record<string, unknown>);\n\n // Generate unique ID for loading announcements\n const loadingId = React.useId();\n const describedById = loading ? `${loadingId}-loading` : undefined;\n\n // Loading keeps the caller's name (aria-label, aria-labelledby or the label text) and adds\n // aria-busy plus a description, as v2 does. A disabled element with no native `disabled`\n // announces itself through aria-disabled.\n const accessibilityProps = React.useMemo(() => {\n if (loading) {\n return {\n 'aria-busy': true,\n 'aria-disabled': true,\n 'aria-describedby': [ariaDescribedByProp, describedById].filter(Boolean).join(' '),\n };\n }\n if (nativeDisabled && (!shouldPassDisabled || asChild)) {\n return { 'aria-disabled': true };\n }\n return {};\n }, [loading, describedById, ariaDescribedByProp, nativeDisabled, shouldPassDisabled, asChild]);\n\n /**\n * The inside of the button. A button that takes `loading` (true or false) keeps its content in\n * a `kui-BaseButtonContent` wrapper, so starting or stopping `loading` keeps the children in\n * place (their state survives). A button that never loads skips it, which saves a node per\n * button. `display: contents` keeps the button's flex gap; while loading the wrapper is\n * `visibility: hidden` under the spinner.\n *\n * `display: contents` removes the content from the accessibility tree in some browsers, so\n * while loading the wrapper is `aria-hidden` and a `kui-sr-only` copy carries the name.\n */\n const renderInner = (inner: React.ReactNode, label: React.ReactNode) => {\n if (!canLoad) return inner;\n return (\n <>\n <span className=\"kui-BaseButtonContent\" aria-hidden={loading || undefined}>\n {inner}\n </span>\n {loading ? (\n <>\n {/* The label stays the name; the hidden \"Loading\" only describes (aria-describedby reads hidden text). */}\n <span className=\"kui-sr-only\">\n <span id={describedById} aria-hidden>\n Loading\n </span>\n {label}\n </span>\n\n {/* Centered spinner overlay during loading state */}\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>\n <Spinner aria-hidden=\"true\" />\n </span>\n </Flex>\n </>\n ) : null}\n </>\n );\n };\n const asChildContent =\n asChild && canLoad && React.isValidElement(content)\n ? React.cloneElement(\n content as React.ReactElement<{ children?: React.ReactNode }>,\n undefined,\n renderInner(\n (content.props as { children?: React.ReactNode }).children,\n React.isValidElement(children) ? (children.props as { children?: React.ReactNode }).children : null,\n ),\n )\n : content;\n\n return (\n <Comp\n data-accent-color={color}\n data-radius={radius}\n data-icon-start={iconStart || undefined}\n data-icon-end={iconEnd || undefined}\n data-done={done || undefined}\n {...baseButtonProps}\n {...accessibilityProps}\n // After the spread: `data-disabled` styles `<Button asChild disabled>`, and a wrapping\n // Radix Toggle (asChild) passes `data-disabled={undefined}` that must not erase it.\n data-disabled={disabled || undefined}\n onClick={handleClick}\n onClickCapture={handleClickCapture}\n ref={composedRef}\n className={classNames('kui-reset', 'kui-BaseButton', className)}\n {...(shouldPassDisabled && { disabled: nativeDisabled })}\n {...(isNativeButtonElement && !hasExplicitTypeAttribute ? { type: 'button' } : {})}\n >\n {asChild ? (\n // asChild: Slot merges onto the single child, so the wrapper, spinner and label copy go\n // inside that child, never beside it.\n asChildContent\n ) : (\n renderInner(content, children)\n )}\n </Comp>\n );\n});\nBaseButton.displayName = 'BaseButton';\n\n/** Components that render text, never an icon, so the render-time guess skips them. */\nconst TEXT_COMPONENTS = new Set(['Text', 'Kbd', 'Code', 'Link', 'Em', 'Strong', 'Quote', 'Badge', 'Trans']);\n\n/** A component's display name, looking through forwardRef and memo. */\nfunction componentName(type: unknown): string {\n if (!type || (typeof type !== 'function' && typeof type !== 'object')) return '';\n const named = type as { displayName?: string; name?: string; render?: unknown; type?: unknown };\n return named.displayName || named.name || componentName(named.render) || componentName(named.type);\n}\n\n/** The child list with fragments opened up: a fragment's own children are the edges. */\nfunction flattenFragments(nodes: React.ReactNode): React.ReactNode[] {\n return React.Children.toArray(nodes).flatMap((node) =>\n React.isValidElement(node) && node.type === React.Fragment\n ? flattenFragments((node.props as { children?: React.ReactNode }).children)\n : [node],\n );\n}\n\n/** Whether the first or last rendered node of `element` (blank text and comments skipped) is an svg. */\nfunction edgeIsSvg(element: Element, edge: 'start' | 'end'): boolean {\n let node = edge === 'start' ? element.firstChild : element.lastChild;\n while (node) {\n const blank =\n node.nodeType === Node.COMMENT_NODE || (node.nodeType === Node.TEXT_NODE && !node.textContent?.trim());\n if (!blank) break;\n node = edge === 'start' ? node.nextSibling : node.previousSibling;\n }\n return node?.nodeType === Node.ELEMENT_NODE && (node as Element).localName === 'svg';\n}\n\nexport { BaseButton };\nexport type { BaseButtonProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { accentColorPropDef } from '../../props/color.prop.js';\nimport { radiusPropDef } from '../../props/radius.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\n/**\n * Available button sizes for responsive design\n * Size 1: 28px - Compact for toolbars and dense interfaces\n * Size 2: 32px - Standard for most interface contexts\n * Size 3: 40px - Large for important actions and mobile touch targets\n * Size 4: 48px - Extra large for hero sections and maximum impact\n */\nconst sizes = ['1', '2', '3', '4'] as const;\n\n/**\n * Available button variants for different visual contexts\n * - raised: lifted off its ground, with an edge and a shadow\n * - solid: Primary actions that should be noticed first (the default)\n * - soft: Content-heavy interfaces, natural integration\n * - surface: Elevated appearance with subtle depth\n * - outline: Secondary actions that support primary actions\n * - ghost: Utility functions that don't compete for attention\n */\nconst variants = ['raised', 'solid', 'soft', 'surface', 'outline', 'ghost'] as const;\n\n/**\n * Base button prop definitions that define the component's API\n * \n * These props are used by all button variants (Button and Toggle)\n * to ensure consistent behavior and styling across the design system.\n * \n * Key features:\n * - Responsive sizing with mobile-first approach\n * - Six visual variants for different interface contexts\n * - Comprehensive color system with semantic meanings\n * - Loading states with automatic accessibility\n * - Polymorphic rendering support via asChild\n * \n * @example\n * ```tsx\n * // Basic button with default props\n * <BaseButton>Click me</BaseButton>\n * \n * // Button with custom size and variant\n * <BaseButton size=\"3\" variant=\"solid\">Primary Action</BaseButton>\n * \n * // Button with loading state\n * <BaseButton loading>Processing...</BaseButton>\n * ```\n */\nconst baseButtonPropDefs = {\n ...asChildPropDef,\n /**\n * Button size for responsive design and interface density\n * Supports responsive objects: { initial: '1', sm: '2', md: '3', lg: '4' }\n */\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n /**\n * Visual variant that determines the button's appearance and context\n */\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'solid' },\n ...accentColorPropDef,\n ...radiusPropDef,\n /**\n * Loading state that shows a spinner and disables interaction\n * Automatically sets disabled=true and provides accessibility announcements\n */\n loading: { type: 'boolean', className: 'kui-loading', default: false },\n /**\n * Full width mode that expands the button to fill its container\n * Useful for mobile layouts and form submissions\n */\n fullWidth: { type: 'boolean', className: 'kui-full-width', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n loading: PropDef<boolean>;\n fullWidth: PropDef<boolean>;\n};\n\nexport { baseButtonPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { layoutPropDefs } from '../props/layout.props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { Slot } from './slot.js';\nimport { flexPropDefs } from './flex.props.js';\n\nimport type { FlexOwnProps } from './flex.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { LayoutProps } from '../props/layout.props.js';\nimport type { MarginProps } from '../props/margin.props.js';\n\ntype FlexElement = React.ElementRef<'div'>;\ninterface CommonFlexProps extends MarginProps, LayoutProps, FlexOwnProps {}\ntype FlexDivProps = { as?: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype FlexSpanProps = { as: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype FlexProps = CommonFlexProps & (FlexSpanProps | FlexDivProps);\n\nconst Flex = React.forwardRef<FlexElement, FlexProps>((props, forwardedRef) => {\n const {\n className,\n asChild,\n as: Tag = 'div',\n ...flexProps\n } = extractProps(props, flexPropDefs, layoutPropDefs, marginPropDefs);\n const Comp = asChild ? Slot : Tag;\n return <Comp {...flexProps} ref={forwardedRef} className={classNames('kui-Flex', className)} />;\n});\nFlex.displayName = 'Flex';\n\nexport { Flex };\nexport type { FlexProps };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst paddingValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst paddingPropDefs = {\n /**\n * Sets the CSS **padding** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * p=\"4\"\n * p=\"100px\"\n * p={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding\n */\n p: {\n type: 'enum | string',\n className: 'kui-r-p',\n customProperties: ['--p'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** and **padding-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * px=\"4\"\n * px=\"100px\"\n * px={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n px: {\n type: 'enum | string',\n className: 'kui-r-px',\n customProperties: ['--pl', '--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** and **padding-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * py=\"4\"\n * py=\"100px\"\n * py={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n py: {\n type: 'enum | string',\n className: 'kui-r-py',\n customProperties: ['--pt', '--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pt=\"4\"\n * pt=\"100px\"\n * pt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n */\n pt: {\n type: 'enum | string',\n className: 'kui-r-pt',\n customProperties: ['--pt'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pr=\"4\"\n * pr=\"100px\"\n * pr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n pr: {\n type: 'enum | string',\n className: 'kui-r-pr',\n customProperties: ['--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pb=\"4\"\n * pb=\"100px\"\n * pb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n pb: {\n type: 'enum | string',\n className: 'kui-r-pb',\n customProperties: ['--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pl=\"4\"\n * pl=\"100px\"\n * pl={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n */\n pl: {\n type: 'enum | string',\n className: 'kui-r-pl',\n customProperties: ['--pl'],\n values: paddingValues,\n responsive: true,\n },\n} satisfies {\n p: PropDef<(typeof paddingValues)[number]>;\n px: PropDef<(typeof paddingValues)[number]>;\n py: PropDef<(typeof paddingValues)[number]>;\n pt: PropDef<(typeof paddingValues)[number]>;\n pr: PropDef<(typeof paddingValues)[number]>;\n pb: PropDef<(typeof paddingValues)[number]>;\n pl: PropDef<(typeof paddingValues)[number]>;\n};\n\ntype PaddingProps = GetPropDefTypes<typeof paddingPropDefs>;\n\nexport { paddingPropDefs };\nexport type { PaddingProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst heightPropDefs = {\n /**\n * Sets the CSS **height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * height=\"100px\"\n * height={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/height\n */\n height: {\n type: 'string',\n className: 'kui-r-h',\n customProperties: ['--height'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minHeight=\"100px\"\n * minHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\n */\n minHeight: {\n type: 'string',\n className: 'kui-r-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxHeight=\"100px\"\n * maxHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\n */\n maxHeight: {\n type: 'string',\n className: 'kui-r-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst widthPropDefs = {\n /**\n * Sets the CSS **width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * width=\"100px\"\n * width={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/width\n */\n width: {\n type: 'string',\n className: 'kui-r-w',\n customProperties: ['--width'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minWidth=\"100px\"\n * minWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\n */\n minWidth: {\n type: 'string',\n className: 'kui-r-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxWidth=\"100px\"\n * maxWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n */\n maxWidth: {\n type: 'string',\n className: 'kui-r-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n", "import { paddingPropDefs } from './padding.props.js';\nimport { heightPropDefs } from './height.props.js';\nimport { widthPropDefs } from './width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst overflowValues = ['visible', 'hidden', 'clip', 'scroll', 'auto'] as const;\nconst positionValues = ['static', 'relative', 'absolute', 'fixed', 'sticky'] as const;\n// prettier-ignore\nconst positionEdgeValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9'] as const;\nconst flexShrinkValues = ['0', '1'] as const;\nconst flexGrowValues = ['0', '1'] as const;\nconst alignSelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifySelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\n\nconst layoutPropDefs = {\n ...paddingPropDefs,\n ...widthPropDefs,\n ...heightPropDefs,\n /**\n * Sets the CSS **position** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * position=\"absolute\"\n * position={{ sm: 'absolute', lg: 'sticky' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/position\n */\n position: {\n type: 'enum',\n className: 'kui-r-position',\n values: positionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **inset** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * inset=\"4\"\n * inset=\"100px\"\n * inset={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/inset\n */\n inset: {\n type: 'enum | string',\n className: 'kui-r-inset',\n customProperties: ['--inset'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * top=\"4\"\n * top=\"100px\"\n * top={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/top\n */\n top: {\n type: 'enum | string',\n className: 'kui-r-top',\n customProperties: ['--top'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * right=\"4\"\n * right=\"100px\"\n * right={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/right\n */\n right: {\n type: 'enum | string',\n className: 'kui-r-right',\n customProperties: ['--right'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * bottom=\"4\"\n * bottom=\"100px\"\n * bottom={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/bottom\n */\n bottom: {\n type: 'enum | string',\n className: 'kui-r-bottom',\n customProperties: ['--bottom'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * left=\"4\"\n * left=\"100px\"\n * left={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/left\n */\n left: {\n type: 'enum | string',\n className: 'kui-r-left',\n customProperties: ['--left'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflow=\"hidden\"\n * overflow={{ sm: 'hidden', lg: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflow: {\n type: 'enum',\n className: 'kui-r-overflow',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-x** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowX=\"hidden\"\n * overflowX={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowX: {\n type: 'enum',\n className: 'kui-r-ox',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-y** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowY=\"hidden\"\n * overflowY={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowY: {\n type: 'enum',\n className: 'kui-r-oy',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-basis** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexBasis=\"0\"\n * flexBasis=\"100%\"\n * flexBasis={{ sm: '200px', lg: 'auto' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis\n */\n flexBasis: {\n type: 'string',\n className: 'kui-r-fb',\n customProperties: ['--flex-basis'],\n responsive: true,\n },\n /**\n * Sets the CSS **flex-shrink** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexShrink=\"0\"\n * flexShrink=\"1\"\n * flexShrink={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink\n */\n flexShrink: {\n type: 'enum | string',\n className: 'kui-r-fs',\n customProperties: ['--flex-shrink'],\n values: flexShrinkValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-grow** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexGrow=\"0\"\n * flexGrow=\"1\"\n * flexGrow={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow\n */\n flexGrow: {\n type: 'enum | string',\n className: 'kui-r-fg',\n customProperties: ['--flex-grow'],\n values: flexGrowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **grid-area** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridArea=\"header\"\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area\n */\n gridArea: {\n type: 'string',\n className: 'kui-r-ga',\n customProperties: ['--grid-area'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumn=\"1\"\n * gridColumn=\"1 / -1\"\n * gridColumn={{ sm: '1 / 3', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column\n */\n gridColumn: {\n type: 'string',\n className: 'kui-r-gc',\n customProperties: ['--grid-column'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnStart=\"1\"\n * gridColumnStart=\"auto\"\n * gridColumnStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start\n */\n gridColumnStart: {\n type: 'string',\n className: 'kui-r-gcs',\n customProperties: ['--grid-column-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnEnd=\"1\"\n * gridColumnEnd=\"auto\"\n * gridColumnEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end\n */\n gridColumnEnd: {\n type: 'string',\n className: 'kui-r-gce',\n customProperties: ['--grid-column-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRow=\"1\"\n * gridRow=\"auto\"\n * gridRow={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row\n */\n gridRow: {\n type: 'string',\n className: 'kui-r-gr',\n customProperties: ['--grid-row'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowStart=\"1\"\n * gridRowStart=\"auto\"\n * gridRowStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start\n */\n gridRowStart: {\n type: 'string',\n className: 'kui-r-grs',\n customProperties: ['--grid-row-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowEnd=\"1\"\n * gridRowEnd=\"auto\"\n * gridRowEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end\n */\n gridRowEnd: {\n type: 'string',\n className: 'kui-r-gre',\n customProperties: ['--grid-row-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **align-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * alignSelf=\"center\"\n * alignSelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-self\n */\n alignSelf: {\n type: 'enum',\n className: 'kui-r-as',\n values: alignSelfValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justifySelf=\"center\"\n * justifySelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self\n */\n justifySelf: {\n type: 'enum',\n className: 'kui-r-js',\n values: justifySelfValues,\n responsive: true,\n },\n} satisfies {\n position: PropDef<(typeof positionValues)[number]>;\n inset: PropDef<(typeof positionEdgeValues)[number]>;\n top: PropDef<(typeof positionEdgeValues)[number]>;\n right: PropDef<(typeof positionEdgeValues)[number]>;\n bottom: PropDef<(typeof positionEdgeValues)[number]>;\n left: PropDef<(typeof positionEdgeValues)[number]>;\n overflow: PropDef<(typeof overflowValues)[number]>;\n overflowX: PropDef<(typeof overflowValues)[number]>;\n overflowY: PropDef<(typeof overflowValues)[number]>;\n flexBasis: PropDef<string>;\n flexShrink: PropDef<(typeof flexShrinkValues)[number]>;\n flexGrow: PropDef<(typeof flexGrowValues)[number]>;\n gridColumn: PropDef<string>;\n gridColumnStart: PropDef<string>;\n gridColumnEnd: PropDef<string>;\n gridRow: PropDef<string>;\n gridRowStart: PropDef<string>;\n gridRowEnd: PropDef<string>;\n gridArea: PropDef<string>;\n alignSelf: PropDef<(typeof alignSelfValues)[number]>;\n justifySelf: PropDef<(typeof justifySelfValues)[number]>;\n};\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype LayoutProps = GetPropDefTypes<\n typeof paddingPropDefs & typeof widthPropDefs & typeof heightPropDefs & typeof layoutPropDefs\n>;\n\nexport { layoutPropDefs };\nexport type { LayoutProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12', 'bleed'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n", "import { Slot as SlotPrimitive } from 'radix-ui';\nexport const Root = SlotPrimitive.Root;\nexport const Slot = SlotPrimitive.Root;\nexport const Slottable: typeof SlotPrimitive.Slottable = SlotPrimitive.Slottable;\n", "import type { PropDef } from './prop-def.js';\n\nconst gapValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst gapPropDefs = {\n /**\n * Sets the CSS **gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gap=\"4\"\n * gap=\"20px\"\n * gap={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/gap\n */\n gap: {\n type: 'enum | string',\n className: 'kui-r-gap',\n customProperties: ['--gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **column-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapX=\"4\"\n * gapX=\"20px\"\n * gapX={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap\n */\n gapX: {\n type: 'enum | string',\n className: 'kui-r-cg',\n customProperties: ['--column-gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **row-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapY=\"4\"\n * gapY=\"20px\"\n * gapY={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap\n */\n gapY: {\n type: 'enum | string',\n className: 'kui-r-rg',\n customProperties: ['--row-gap'],\n values: gapValues,\n responsive: true,\n },\n} satisfies {\n gap: PropDef<(typeof gapValues)[number]>;\n gapX: PropDef<(typeof gapValues)[number]>;\n gapY: PropDef<(typeof gapValues)[number]>;\n};\n\nexport { gapPropDefs };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { gapPropDefs } from '../props/gap.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst as = ['div', 'span'] as const;\nconst displayValues = ['none', 'inline-flex', 'flex'] as const;\nconst directionValues = ['row', 'column', 'row-reverse', 'column-reverse'] as const;\nconst alignValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifyValues = ['start', 'center', 'end', 'between'] as const;\nconst wrapValues = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\nconst flexPropDefs = {\n /**\n * Controls whether to render **div** or **span**\n *\n * @example\n * as=\"div\"\n * as=\"span\"\n */\n as: { type: 'enum', values: as, default: 'div' },\n ...asChildPropDef,\n /**\n * Sets the CSS **display** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * display=\"inline-flex\"\n * display={{ sm: 'none', lg: 'flex' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/display\n */\n display: {\n type: 'enum',\n className: 'kui-r-display',\n values: displayValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-direction** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * direction=\"column\"\n * direction={{ sm: 'column', lg: 'row' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction\n */\n direction: {\n type: 'enum',\n className: 'kui-r-fd',\n values: directionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **align-items** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * align=\"center\"\n * align={{ sm: 'baseline', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-items\n */\n align: {\n type: 'enum',\n className: 'kui-r-ai',\n values: alignValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-content** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justify=\"between\"\n * justify={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content\n */\n justify: {\n type: 'enum',\n className: 'kui-r-jc',\n values: justifyValues,\n parseValue: parseJustifyValue,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-wrap** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * wrap=\"wrap\"\n * wrap={{ sm: 'wrap', lg: 'nowrap' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap\n */\n wrap: {\n type: 'enum',\n className: 'kui-r-fw',\n values: wrapValues,\n responsive: true,\n },\n ...gapPropDefs,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n display: PropDef<(typeof displayValues)[number]>;\n direction: PropDef<(typeof directionValues)[number]>;\n align: PropDef<(typeof alignValues)[number]>;\n justify: PropDef<(typeof justifyValues)[number]>;\n wrap: PropDef<(typeof wrapValues)[number]>;\n};\n\nfunction parseJustifyValue(value: string) {\n return value === 'between' ? 'space-between' : value;\n}\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype FlexOwnProps = GetPropDefTypes<\n typeof flexPropDefs & typeof gapPropDefs & typeof asChildPropDef\n>;\n\nexport { flexPropDefs };\nexport type { FlexOwnProps };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Flex } from './flex.js';\nimport { spinnerPropDefs } from './spinner.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SpinnerElement = React.ElementRef<'span'>;\ntype SpinnerOwnProps = GetPropDefTypes<typeof spinnerPropDefs>;\ninterface SpinnerProps\n extends ComponentPropsWithout<'span', RemovedProps>,\n SpinnerOwnProps {}\nconst Spinner = React.forwardRef<SpinnerElement, SpinnerProps>((props, forwardedRef) => {\n const { className, children, loading, ...spinnerProps } = extractProps(\n props,\n spinnerPropDefs\n );\n\n // Without children a Spinner is only the wheel, shown while loading.\n if (children === undefined && !loading) return null;\n\n // Decorative unless named: a named spinner is a status message, an unnamed one is hidden.\n const named =\n spinnerProps['aria-label'] !== undefined || spinnerProps['aria-labelledby'] !== undefined;\n\n const spinner = (\n <span\n role={named ? 'status' : undefined}\n aria-hidden={named ? undefined : true}\n {...spinnerProps}\n ref={forwardedRef} className={classNames('kui-Spinner', className)}>\n <span className=\"kui-SpinnerWheel\">\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n </span>\n {/* A live region reads its text, not its aria-label, so the name is also its content. */}\n {typeof spinnerProps['aria-label'] === 'string' ? (\n <span className=\"kui-sr-only\">{spinnerProps['aria-label']}</span>\n ) : null}\n </span>\n );\n\n if (children === undefined) return spinner;\n\n // With children, one tree whether loading or not, so starting or stopping never remounts them\n // (their state, focus and refs survive). At rest the host is `display: contents`; while loading\n // it centres the wheel over the children, which keep their space but are hidden.\n return (\n <span className=\"kui-SpinnerHost\" data-loading={loading || undefined} aria-busy={loading || undefined}>\n {/* `display: contents` removes the content from the accessibility tree in some browsers, so\n while loading it is removed with `aria-hidden` too. */}\n <span aria-hidden={loading || undefined} className={classNames('kui-SpinnerChildren', loading && 'kui-SpinnerHiddenChildren')}>\n {children}\n </span>\n {loading ? (\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>{spinner}</span>\n </Flex>\n ) : null}\n </span>\n );\n});\nSpinner.displayName = 'Spinner';\n\nexport { Spinner };\nexport type { SpinnerProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\nconst spinnerPropDefs = {\n loading: { type: 'boolean', default: true },\n} satisfies {\n loading: PropDef<boolean>;\n};\n\nexport { spinnerPropDefs };\n", "import React from 'react';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype IconElement = React.ElementRef<'svg'>;\ninterface IconProps extends ComponentPropsWithout<'svg', RemovedProps | 'children'> {}\n\nconst ThickDividerHorizontalIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n );\n});\n\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n );\n});\nThickCheckIcon.displayName = 'ThickCheckIcon';\n\nconst ChevronDownIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z\" />\n </svg>\n );\n});\nChevronDownIcon.displayName = 'ChevronDownIcon';\n\nconst ThickChevronRightIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronRightIcon.displayName = 'ThickChevronRightIcon';\n\nconst ThickChevronLeftIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronLeftIcon.displayName = 'ThickChevronLeftIcon';\n\nconst ThickDotIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <circle cx=\"4.5\" cy=\"4.5\" r=\"2\" />\n </svg>\n );\n});\nThickDotIcon.displayName = 'ThickDotIcon';\n\nexport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };\nexport type { IconProps };\n\n// Additional minimal icons\nconst CloseIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg\n {..._props}\n ref={_forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n});\nCloseIcon.displayName = 'CloseIcon';\n\nconst PaperclipIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n {...props}\n ref={forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n});\nPaperclipIcon.displayName = 'PaperclipIcon';\n\nconst FileIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n});\nFileIcon.displayName = 'FileIcon';\n\nconst FileTextIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n});\nFileTextIcon.displayName = 'FileTextIcon';\n\n/** The tick a button shows in place of its icon while `done`. Drawn on the 24 grid at the icon set's stroke. */\nconst TickIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M5 12.75L9.5 17.25L19 7.25\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n});\nTickIcon.displayName = 'TickIcon';\n\nexport { CloseIcon, PaperclipIcon, FileIcon, FileTextIcon, TickIcon };\n", "'use client';\n\nimport * as React from 'react';\n\nimport { THEME_SIZE_DEFAULT, clampSize } from '../helpers/theme-size.js';\nimport type { ThemeSize } from '../helpers/theme-size.js';\n\n/**\n * The app-wide size index, provided by `Theme` beside `ThemeContext`.\n *\n * It is its own context, holding one string, so a component that only needs\n * the size does not re-render when the accent colour or appearance changes.\n */\nconst ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);\nThemeSizeContext.displayName = 'ThemeSizeContext';\n\ninterface SizePropDef {\n values: readonly string[];\n default?: string;\n}\n\n/**\n * The size a component on the 1-4 index takes: what the caller said, else the\n * nearest Theme's size, mapped into the component's range.\n */\nfunction useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {\n const themeSize = React.useContext(ThemeSizeContext);\n if (explicit !== undefined) return explicit;\n // The clamped value is one of `propDef.values`, which is what `V` ranges over.\n return clampSize(themeSize, propDef.values) as V;\n}\n\n/**\n * Fills `size` from the nearest Theme when the caller left it unset, so the\n * result can go straight into `extractProps`. An explicit size, responsive\n * object included, wins.\n *\n * Returns the same props object when there is nothing to fill: when a size is\n * set, or when the theme size resolves to the prop def's own default (the\n * common case, a Theme with no size), so `extractProps` applies it as before.\n */\nfunction useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {\n const themeSize = React.useContext(ThemeSizeContext);\n if (props.size !== undefined) return props;\n const size = clampSize(themeSize, propDef.values);\n if (size === propDef.default) return props;\n return { ...props, size };\n}\n\nexport { ThemeSizeContext, useThemeSize, useThemeSizeProps };\n", "/**\n * The pure half of the theme size: the type, the default and the clamp. Server-safe.\n *\n * The context and the hooks that read it live in `hooks/theme-size.ts`, a client module, so there\n * is one `ThemeSizeContext` and importing `/helpers` from a server component does not call\n * `createContext`.\n */\n\ntype ThemeSize = '1' | '2' | '3' | '4';\n\n/** The rest of the 1-4 index when no Theme states a size. */\nconst THEME_SIZE_DEFAULT: ThemeSize = '2';\n\n/**\n * Maps the theme size onto a component's own range: the value itself when the\n * component has it, otherwise the nearest end of the range (`4` on a 1-3 scale\n * is `3`, on a 1-2 scale it is `2`).\n */\nfunction clampSize(size: ThemeSize, values: readonly string[]): string {\n if (values.includes(size)) return size;\n const n = Number(size);\n let nearest = values[0];\n let distance = Infinity;\n for (let i = 0; i < values.length; i++) {\n const d = Math.abs(Number(values[i]) - n);\n if (d < distance) {\n distance = d;\n nearest = values[i];\n }\n }\n return nearest;\n}\n\nexport { THEME_SIZE_DEFAULT, clampSize };\nexport type { ThemeSize };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\n\nimport { Text } from './text.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { tooltipPropDefs } from './tooltip.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\n/** The rest before a tooltip opens, in milliseconds. */\nconst TOOLTIP_DELAY = 200;\n\n/** True inside a `TooltipProvider`, so a Tooltip knows it need not bring its own. */\nconst TooltipProviderContext = React.createContext(false);\n\ninterface TooltipProviderProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider> {}\n\n/**\n * Groups the tooltips inside it: the first one waits `delayDuration` (200ms), and the next ones\n * open at once while the pointer moves between them. Put it once near the root of the app.\n * A Tooltip outside one still works, with the same delay, but each one waits on its own.\n */\nfunction TooltipProvider({ delayDuration = TOOLTIP_DELAY, children, ...props }: TooltipProviderProps) {\n return (\n <TooltipProviderContext.Provider value={true}>\n <TooltipPrimitive.Provider delayDuration={delayDuration} {...props}>\n {children}\n </TooltipPrimitive.Provider>\n </TooltipProviderContext.Provider>\n );\n}\nTooltipProvider.displayName = 'TooltipProvider';\n\ntype TooltipElement = React.ElementRef<typeof TooltipPrimitive.Content>;\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs>;\ninterface TooltipProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>,\n ComponentPropsWithout<typeof TooltipPrimitive.Content, RemovedProps | 'content'>,\n TooltipOwnProps {\n content: React.ReactNode;\n container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>['container'];\n}\nconst Tooltip = React.forwardRef<TooltipElement, TooltipProps>((props, forwardedRef) => {\n const {\n children,\n className,\n open,\n defaultOpen,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n content,\n container,\n forceMount,\n ...tooltipContentProps\n } = extractProps(props, tooltipPropDefs);\n const rootProps = { open, defaultOpen, onOpenChange, delayDuration, disableHoverableContent };\n const hasProvider = React.useContext(TooltipProviderContext);\n const tooltip = (\n <TooltipPrimitive.Root {...rootProps}>\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <TooltipPrimitive.Content\n sideOffset={4}\n collisionPadding={10}\n {...tooltipContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-TooltipContent', className)}\n >\n <Text as=\"p\" className=\"kui-TooltipText\" size=\"1\">\n {content}\n </Text>\n <TooltipPrimitive.Arrow className=\"kui-TooltipArrow\" />\n </TooltipPrimitive.Content>\n </PortalTheme>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n // Radix needs a provider above every tooltip. Outside a TooltipProvider, bring one.\n return hasProvider ? tooltip : <TooltipPrimitive.Provider delayDuration={TOOLTIP_DELAY}>{tooltip}</TooltipPrimitive.Provider>;\n});\nTooltip.displayName = 'Tooltip';\n\nexport { Tooltip, TooltipProvider };\nexport type { TooltipProps, TooltipProviderProps };\n", "import * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { textPropDefs } from './text.props.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype TextElement = React.ElementRef<'span'>;\ntype TextOwnProps = GetPropDefTypes<typeof textPropDefs>;\ninterface CommonTextProps extends TextOwnProps {}\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>;\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>;\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);\n\n// Pre-merge prop definitions at module level to avoid per-render allocation\n\nconst Text = React.memo(\n React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = 'span',\n color,\n ...textProps\n } = extractProps(props, textPropDefs);\n\n const combinedClassName = className ? `kui-Text ${className}` : 'kui-Text';\n\n if (asChild) {\n return (\n <Slot.Root\n data-accent-color={color}\n {...textProps}\n ref={forwardedRef}\n className={combinedClassName}\n >\n {children}\n </Slot.Root>\n );\n }\n\n return (\n <Tag\n data-accent-color={color}\n {...(textProps as React.HTMLAttributes<HTMLElement>)}\n ref={forwardedRef as any}\n className={combinedClassName}\n >\n {children}\n </Tag>\n );\n })\n);\nText.displayName = 'Text';\n\nexport { Text };\nexport type { TextProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst emphases = ['loud', 'medium', 'quiet'] as const;\n\n// Text-first components only (Text, Heading, Blockquote, Code).\n// No colour + emphasis reads the gray ink ladder; colour + emphasis reads the accent ink ladder.\n// Components that need a different default spread this def and override `default`.\nconst emphasisPropDef = {\n emphasis: {\n type: 'enum',\n className: 'kui-emphasis',\n values: emphases,\n default: undefined,\n },\n} satisfies {\n emphasis: PropDef<(typeof emphases)[number]>;\n};\n\nexport { emphasisPropDef, emphases };\n", "import type { PropDef } from './prop-def.js';\n\nconst leadingTrimValues = ['normal', 'start', 'end', 'both'] as const;\n\nconst leadingTrimPropDef = {\n trim: {\n type: 'enum',\n className: 'kui-r-lt',\n values: leadingTrimValues,\n responsive: true,\n },\n} satisfies {\n trim: PropDef<(typeof leadingTrimValues)[number]>;\n};\n\nexport { leadingTrimPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textAlignValues = ['left', 'center', 'right'] as const;\n\nconst textAlignPropDef = {\n align: {\n type: 'enum',\n className: 'kui-r-ta',\n values: textAlignValues,\n responsive: true,\n },\n} satisfies {\n align: PropDef<(typeof textAlignValues)[number]>;\n};\n\nexport { textAlignPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textWrapValues = ['wrap', 'nowrap', 'pretty', 'balance'] as const;\n\nconst textWrapPropDef = {\n wrap: {\n type: 'enum',\n className: 'kui-r-tw',\n values: textWrapValues,\n responsive: true,\n },\n} satisfies {\n wrap: PropDef<(typeof textWrapValues)[number]>;\n};\n\nexport { textWrapPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst truncatePropDef = {\n truncate: {\n type: 'boolean',\n className: 'kui-truncate',\n },\n} satisfies {\n truncate: PropDef<boolean>;\n};\n\nexport { truncatePropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\n\nconst fontFamilyPropDef = {\n font: {\n type: 'enum',\n className: 'kui-r-ff',\n values: fontFamilies,\n },\n} satisfies {\n font: PropDef<(typeof fontFamilies)[number]>;\n};\n\nexport { fontFamilyPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n/** v2's three weights (\u00A715). No bold: a larger size or stronger emphasis says importance. */\nconst weights = ['regular', 'medium', 'semibold'] as const;\n\nconst weightPropDef = {\n weight: {\n type: 'enum',\n className: 'kui-r-weight',\n values: weights,\n responsive: true,\n },\n} satisfies {\n weight: PropDef<(typeof weights)[number]>;\n};\n\nexport { weightPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { emphasisPropDef } from '../props/emphasis.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textAlignPropDef } from '../props/text-align.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { fontFamilyPropDef } from '../props/font-family.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst as = ['span', 'div', 'label', 'p'] as const;\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\n\nconst textPropDefs = {\n as: { type: 'enum', values: as, default: 'span' },\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n ...fontFamilyPropDef,\n ...weightPropDef,\n ...textAlignPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n ...colorPropDef,\n ...emphasisPropDef,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\nexport { textPropDefs };\n", "import * as React from 'react';\n\nimport { Theme } from '../theme.js';\nimport { PaneBandSizeContext } from './pane-band-context.js';\nimport { NoPageScope } from './page-scope.js';\n\n/**\n * The Theme at the root of a portalled surface (Popover, Dialog, Sheet, menus, Tooltip). The\n * surface renders outside any Shell pane even though context flows into it, so a Toolbar in it\n * does not take the pane's band size, and a title in it does not take over the pane's page. A\n * `Theme asChild` an app nests in a pane keeps both.\n */\nconst PortalTheme = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<typeof Theme>>((props, forwardedRef) => (\n <PaneBandSizeContext.Provider value={null}>\n <NoPageScope>\n <Theme {...props} ref={forwardedRef} />\n </NoPageScope>\n </PaneBandSizeContext.Provider>\n));\nPortalTheme.displayName = 'PortalTheme';\n\nexport { PortalTheme };\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Direction, Slot } from 'radix-ui';\n\nimport { getMatchingGrayColor } from '../helpers/get-matching-gray-color.js';\nimport { ThemeSizeContext } from '../hooks/theme-size.js';\nimport { usePropSyncedState } from '../hooks/use-prop-synced-state.js';\nimport { themePropDefs } from './theme.props.js';\n\nimport type { ThemeOwnProps } from './theme.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\nconst noop = () => {};\n\ntype ThemeAppearance = (typeof themePropDefs.appearance.values)[number];\ntype ThemeAccentColor = (typeof themePropDefs.accentColor.values)[number];\ntype ThemeGrayColor = (typeof themePropDefs.grayColor.values)[number];\ntype ThemeRadius = (typeof themePropDefs.radius.values)[number];\ntype ThemeFontFamily = (typeof themePropDefs.fontFamily.values)[number];\ntype ThemeSize = (typeof themePropDefs.size.values)[number];\n// Headings follow the body font until something sets this, so `undefined` is a\n// meaningful value here rather than a missing one.\ntype ThemeHeadingFontFamily = ThemeFontFamily | undefined;\n\ninterface ThemeChangeHandlers {\n onAppearanceChange: (appearance: ThemeAppearance) => void;\n onAccentColorChange: (accentColor: ThemeAccentColor) => void;\n onGrayColorChange: (grayColor: ThemeGrayColor) => void;\n onRadiusChange: (radius: ThemeRadius) => void;\n onFontFamilyChange: (fontFamily: ThemeFontFamily) => void;\n onHeadingFontFamilyChange: (headingFontFamily: ThemeHeadingFontFamily) => void;\n onSizeChange: (size: ThemeSize) => void;\n}\n\ninterface ThemeContextValue extends ThemeChangeHandlers {\n appearance: ThemeAppearance;\n accentColor: ThemeAccentColor;\n grayColor: ThemeGrayColor;\n resolvedGrayColor: ThemeGrayColor;\n radius: ThemeRadius;\n fontFamily: ThemeFontFamily;\n headingFontFamily: ThemeHeadingFontFamily;\n size: ThemeSize;\n}\n// Default theme values used when components render outside a Theme provider\nconst defaultThemeContext: ThemeContextValue = {\n appearance: themePropDefs.appearance.default,\n accentColor: themePropDefs.accentColor.default,\n grayColor: themePropDefs.grayColor.default,\n resolvedGrayColor: themePropDefs.grayColor.default,\n radius: themePropDefs.radius.default,\n fontFamily: themePropDefs.fontFamily.default,\n headingFontFamily: undefined,\n size: themePropDefs.size.default,\n onAppearanceChange: noop,\n onAccentColorChange: noop,\n onGrayColorChange: noop,\n onRadiusChange: noop,\n onFontFamilyChange: noop,\n onHeadingFontFamilyChange: noop,\n onSizeChange: noop,\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | undefined>(undefined);\n\nfunction useThemeContext() {\n const context = React.useContext(ThemeContext);\n // Return default context if used outside Theme provider (e.g., during SSR)\n return context ?? defaultThemeContext;\n}\n\ninterface ThemeProps extends ThemeImplPublicProps {}\nconst Theme = React.forwardRef<ThemeImplElement, ThemeProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n // Direction is inherited: a Radix DirectionProvider above the Theme (for a right-to-left app)\n // wins, and left-to-right stays the default when there is none.\n const dir = Direction.useDirection();\n const isRoot = context === undefined;\n if (isRoot) {\n return (\n <Direction.Provider dir={dir}>\n <ThemeRoot {...props} ref={forwardedRef} />\n </Direction.Provider>\n );\n }\n return <ThemeImpl {...props} ref={forwardedRef} />;\n});\nTheme.displayName = 'Theme';\n\nconst ThemeRoot = React.forwardRef<ThemeImplElement, ThemeImplPublicProps>((props, forwardedRef) => {\n const {\n appearance: appearanceProp = themePropDefs.appearance.default,\n accentColor: accentColorProp = themePropDefs.accentColor.default,\n grayColor: grayColorProp = themePropDefs.grayColor.default,\n radius: radiusProp = themePropDefs.radius.default,\n fontFamily: fontFamilyProp = themePropDefs.fontFamily.default,\n headingFontFamily: headingFontFamilyProp,\n size: sizeProp = themePropDefs.size.default,\n hasBackground = themePropDefs.hasBackground.default,\n ...rootProps\n } = props;\n\n // Each of these follows its prop but stays independently settable, so\n // the context setters can change the theme at runtime. Syncing during render\n // rather than in an effect matters here: an effect would commit the old\n // theme first and re-render every consumer of the context a second time.\n const [appearance, setAppearance] = usePropSyncedState(appearanceProp);\n const [accentColor, setAccentColor] = usePropSyncedState(accentColorProp);\n const [grayColor, setGrayColor] = usePropSyncedState(grayColorProp);\n const [radius, setRadius] = usePropSyncedState(radiusProp);\n const [fontFamily, setFontFamily] = usePropSyncedState(fontFamilyProp);\n const [headingFontFamily, setHeadingFontFamily] = usePropSyncedState(headingFontFamilyProp);\n const [size, setSize] = usePropSyncedState(sizeProp);\n\n return (\n <ThemeImpl\n {...rootProps}\n ref={forwardedRef}\n isRoot\n hasBackground={hasBackground}\n //\n appearance={appearance}\n accentColor={accentColor}\n grayColor={grayColor}\n radius={radius}\n fontFamily={fontFamily}\n headingFontFamily={headingFontFamily}\n size={size}\n //\n onAppearanceChange={setAppearance}\n onAccentColorChange={setAccentColor}\n onGrayColorChange={setGrayColor}\n onRadiusChange={setRadius}\n onFontFamilyChange={setFontFamily}\n onHeadingFontFamilyChange={setHeadingFontFamily}\n onSizeChange={setSize}\n />\n );\n});\nThemeRoot.displayName = 'ThemeRoot';\n\ntype ThemeImplElement = React.ElementRef<'div'>;\ninterface ThemeImplProps extends ThemeImplPublicProps, ThemeImplPrivateProps {}\ninterface ThemeImplPublicProps extends ComponentPropsWithout<'div', RemovedProps | 'dir'>, ThemeOwnProps {}\ninterface ThemeImplPrivateProps extends Partial<ThemeChangeHandlers> {\n isRoot?: boolean;\n}\nconst ThemeImpl = React.forwardRef<ThemeImplElement, ThemeImplProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n const {\n asChild,\n isRoot,\n hasBackground: hasBackgroundProp,\n //\n appearance = props.appearance ?? context?.appearance ?? themePropDefs.appearance.default,\n accentColor = props.accentColor ?? context?.accentColor ?? themePropDefs.accentColor.default,\n grayColor = props.grayColor ?? context?.resolvedGrayColor ?? themePropDefs.grayColor.default,\n radius = props.radius ?? context?.radius ?? themePropDefs.radius.default,\n fontFamily = props.fontFamily ?? context?.fontFamily ?? themePropDefs.fontFamily.default,\n headingFontFamily = props.headingFontFamily ?? context?.headingFontFamily,\n size = props.size ?? context?.size ?? themePropDefs.size.default,\n // A nested Theme forwards changes to the one above it, so a switcher\n // inside a portal (Dialog, Popover, menus) still reaches the root.\n onAppearanceChange = context?.onAppearanceChange ?? noop,\n onAccentColorChange = context?.onAccentColorChange ?? noop,\n onGrayColorChange = context?.onGrayColorChange ?? noop,\n onRadiusChange = context?.onRadiusChange ?? noop,\n onFontFamilyChange = context?.onFontFamilyChange ?? noop,\n onHeadingFontFamilyChange = context?.onHeadingFontFamilyChange ?? noop,\n onSizeChange = context?.onSizeChange ?? noop,\n //\n ...themeProps\n } = props;\n const Comp = asChild ? Slot.Root : 'div';\n const resolvedGrayColor = grayColor === 'auto' ? getMatchingGrayColor(accentColor) : grayColor;\n const isExplicitAppearance = props.appearance === 'light' || props.appearance === 'dark';\n const hasBackground = hasBackgroundProp === undefined ? isRoot || isExplicitAppearance : hasBackgroundProp;\n\n return (\n <ThemeContext.Provider\n value={React.useMemo(\n () => ({\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n }),\n [\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n ],\n )}\n >\n {/* Size travels on its own context as a bare string, so the components\n that read it do not re-render when another theme value changes. */}\n <ThemeSizeContext.Provider value={size}>\n <Comp\n data-is-root-theme={isRoot ? 'true' : 'false'}\n data-accent-color={accentColor}\n data-gray-color={resolvedGrayColor}\n // for nested `Theme` background\n data-has-background={hasBackground ? 'true' : 'false'}\n data-radius={radius}\n data-font-family={fontFamily}\n data-heading-font-family={headingFontFamily}\n ref={forwardedRef}\n {...themeProps}\n className={classNames(\n 'kui-theme',\n {\n light: appearance === 'light',\n dark: appearance === 'dark',\n },\n themeProps.className,\n )}\n />\n </ThemeSizeContext.Provider>\n </ThemeContext.Provider>\n );\n});\nThemeImpl.displayName = 'ThemeImpl';\n\nexport { Theme, ThemeContext, useThemeContext };\nexport type { ThemeProps, ThemeContextValue };\n", "import type { accentColors } from '../props/color.prop.js';\n\ntype ThemeAccentColor = (typeof accentColors)[number];\n\nexport function getMatchingGrayColor(accentColor: ThemeAccentColor) {\n switch (accentColor) {\n case 'tomato':\n case 'red':\n case 'ruby':\n case 'crimson':\n case 'pink':\n case 'plum':\n case 'purple':\n case 'violet':\n return 'mauve';\n case 'iris':\n case 'indigo':\n case 'blue':\n case 'sky':\n case 'cyan':\n return 'slate';\n case 'teal':\n case 'jade':\n case 'mint':\n case 'green':\n return 'sage';\n case 'grass':\n case 'lime':\n return 'olive';\n case 'yellow':\n case 'amber':\n case 'orange':\n case 'brown':\n case 'gold':\n case 'bronze':\n return 'sand';\n case 'gray':\n return 'gray';\n }\n}\n", "import * as React from 'react';\n\n/**\n * State that tracks a prop but can also be set imperatively \u2014 the shape `Theme`\n * needs, where a prop sets the value and the context setters can change it at runtime.\n *\n * Adjusts state during render rather than syncing in a `useEffect`. An effect\n * would commit one render carrying the *old* value and schedule a second one,\n * which for a provider means every consumer renders twice and the browser can\n * paint the stale value in between.\n *\n * @see https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\nexport function usePropSyncedState<T>(propValue: T) {\n const [value, setValue] = React.useState(propValue);\n const [previousPropValue, setPreviousPropValue] = React.useState(propValue);\n\n if (!Object.is(propValue, previousPropValue)) {\n setPreviousPropValue(propValue);\n setValue(propValue);\n }\n\n return [value, setValue] as const;\n}\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { accentColors, grayColors } from '../props/color.prop.js';\nimport { radii } from '../props/radius.prop.js';\n\nimport type { GetPropDefTypes, PropDef } from '../props/prop-def.js';\n\nconst appearances = ['inherit', 'light', 'dark'] as const;\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\nconst sizes = ['1', '2', '3', '4'] as const;\n\nconst themePropDefs = {\n ...asChildPropDef,\n /**\n * Whether to apply background color to the Theme element.\n *\n * Defaults to true for the root Theme and for Theme elements that\n * have an explicit light or dark appearance prop.\n */\n hasBackground: { type: 'boolean', default: true },\n /**\n * Sets the color scheme of the theme, typcially referred to as light and dark mode.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/dark-mode\n */\n appearance: { type: 'enum', values: appearances, default: 'inherit' },\n /**\n * Selects one of the accent color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n accentColor: { type: 'enum', values: accentColors, default: 'gray' },\n /**\n * Selects one of the gray color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n grayColor: { type: 'enum', values: grayColors, default: 'gray' },\n /**\n * Sets the default radius of the components.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/visual-style\n */\n radius: { type: 'enum', values: radii, default: 'full' },\n /**\n * Sets the font family used for body text in the theme.\n *\n * Headings follow this unless `headingFontFamily` (or the `--font-heading`\n * token) says otherwise.\n *\n * @default 'sans'\n */\n fontFamily: { type: 'enum', values: fontFamilies, default: 'sans' },\n /**\n * Sets the font family used for `Heading`, independently of body text.\n *\n * Deliberately has no default: when it is left unset no attribute is\n * emitted and `--font-heading` keeps following `--font-body`, so a\n * `--font-heading` override in your own CSS survives a `fontFamily` switch.\n */\n headingFontFamily: { type: 'enum', values: fontFamilies },\n /**\n * The app-wide size index. Every component on the 1-4 control and surface\n * scale that states no `size` of its own takes this one; an explicit\n * `size` always wins. Nested Themes override it for their subtree.\n *\n * @default '2'\n */\n size: { type: 'enum', values: sizes, default: '2' },\n} satisfies {\n hasBackground: PropDef<boolean>;\n appearance: PropDef<(typeof appearances)[number]>;\n accentColor: PropDef<(typeof accentColors)[number]>;\n grayColor: PropDef<(typeof grayColors)[number]>;\n radius: PropDef<(typeof radii)[number]>;\n fontFamily: PropDef<(typeof fontFamilies)[number]>;\n headingFontFamily: PropDef<(typeof fontFamilies)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\ntype ThemeOwnProps = GetPropDefTypes<typeof themePropDefs & typeof asChildPropDef>;\n\nexport { themePropDefs };\nexport type { ThemeOwnProps };\n", "import * as React from 'react';\n\ntype BandSize = '1' | '2' | '3' | '4';\n\n/**\n * Set by `Shell.PaneHeader` and `Shell.PaneFooter` to their band size, and by `Shell.Scroll` to\n * null (a scrolling list has no band). `PortalTheme`, the root of every portalled surface\n * (Popover, Dialog, Sheet, menus), sets null too, so a Toolbar in one does not take the Shell's\n * step; a `Theme asChild` an app nests in a pane leaves it alone. `Shell.Root` clears it again.\n * Unset (`undefined`) everywhere else.\n *\n * Its own module so PortalTheme can reset it without bringing the Shell.\n */\nconst PaneBandSizeContext = React.createContext<BandSize | null | undefined>(undefined);\n\nexport { PaneBandSizeContext };\nexport type { BandSize };\n", "'use client';\n\nimport * as React from 'react';\n\n/**\n * What page is in a pane, and whether its title has scrolled away (from v2, 2026-11-03).\n *\n * A page's large title lives inside the scroller and the band that shows it again lives beside\n * it, so context, which only flows down, cannot carry it from one to the other. The store sits\n * at their common ancestor, the pane. Each pane provides its own, so two panes can each hold a\n * titled page; `Shell.Header` provides none, so a `Toolbar.Title` there always speaks for itself.\n * Outside a Shell there is no scope: a `Page` still draws its heading and a `Toolbar.Title` still\n * shows its own words.\n */\ntype PageStore = {\n /** The words of the page in this pane, or null while nothing has claimed it. */\n title: string | null;\n /** Every `Toolbar.Title` mirroring this pane's page, as elements: the collapse is written onto them. */\n mirrors: Set<HTMLElement>;\n /** Whether the page's own title has scrolled up behind the band. */\n collapsed: boolean;\n listeners: Set<() => void>;\n /** What a subscriber reads: a stable value between notifications. */\n version: number;\n};\n\nconst PageScopeContext = React.createContext<PageStore | null>(null);\n\nfunction notify(store: PageStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\n/**\n * The collapse is an attribute write, not a render: only CSS reads it, and an observer sends it\n * twice per visit to a page.\n */\nfunction setPageCollapsed(store: PageStore, collapsed: boolean): void {\n if (store.collapsed === collapsed) return;\n store.collapsed = collapsed;\n for (const el of store.mirrors) {\n if (collapsed) el.setAttribute('data-collapsed', '');\n else el.removeAttribute('data-collapsed');\n }\n}\n\n/** Every pane renders one. It draws nothing. */\nfunction PageScope({ children }: { children: React.ReactNode }) {\n const store = React.useMemo<PageStore>(() => ({ title: null, mirrors: new Set(), collapsed: false, listeners: new Set(), version: 0 }), []);\n return <PageScopeContext.Provider value={store}>{children}</PageScopeContext.Provider>;\n}\n\n/** Cuts the scope off below a portal: a panel over a pane is not in it, so its title must not take the pane's band. */\nfunction NoPageScope({ children }: { children: React.ReactNode }) {\n return <PageScopeContext.Provider value={null}>{children}</PageScopeContext.Provider>;\n}\n\nfunction usePageScope(): PageStore | null {\n return React.useContext(PageScopeContext);\n}\n\n/** A `Page` claims the pane it is in, in an effect, so no subscriber's snapshot changes mid-render. */\nfunction useClaimPage(store: PageStore | null, title: string): void {\n React.useEffect(() => {\n if (!store) return;\n store.title = title;\n notify(store);\n return () => {\n if (store.title === title) {\n store.title = null;\n notify(store);\n }\n };\n }, [store, title]);\n}\n\n/** What a `Toolbar.Title` shows when it is given no words of its own. */\nfunction usePageTitle(store: PageStore | null): string | null {\n const subscribe = React.useCallback(\n (cb: () => void) => {\n if (!store) return () => {};\n store.listeners.add(cb);\n return () => {\n store.listeners.delete(cb);\n };\n },\n [store],\n );\n // The version is read so the subscription re-renders this consumer; the title itself is the value.\n React.useSyncExternalStore(\n subscribe,\n () => store?.version ?? 0,\n () => 0,\n );\n return store?.title ?? null;\n}\n\n/**\n * Registers a mirroring title's element, stamped with what the page is doing now: a title that\n * mounts after its page has scrolled arrives collapsed.\n */\nfunction usePageMirror(store: PageStore | null): React.RefCallback<HTMLElement> {\n const current = React.useRef<HTMLElement | null>(null);\n return React.useCallback(\n (el: HTMLElement | null) => {\n if (!store) return;\n if (current.current) store.mirrors.delete(current.current);\n current.current = el;\n if (!el) return;\n store.mirrors.add(el);\n if (store.collapsed) el.setAttribute('data-collapsed', '');\n else el.removeAttribute('data-collapsed');\n },\n [store],\n );\n}\n\nexport { PageScope, NoPageScope, usePageScope, useClaimPage, usePageTitle, usePageMirror, setPageCollapsed };\nexport type { PageStore };\n", "import { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst tooltipPropDefs = {\n content: { type: 'ReactNode', required: true },\n width: widthPropDefs.width,\n minWidth: widthPropDefs.minWidth,\n maxWidth: { ...widthPropDefs.maxWidth, default: '360px' },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n content: PropDef<React.ReactNode>;\n};\n\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs & typeof widthPropDefs>;\n\nexport { tooltipPropDefs };\nexport type { TooltipOwnProps };\n", "import * as React from 'react';\n\n/**\n * Hook for managing tooltip accessibility props and conditional rendering.\n * Encapsulates tooltip ID generation and aria-describedby binding.\n *\n * @param tooltip - The tooltip content (if any)\n * @returns Object containing tooltipId, hasTooltip flag, and accessibility props\n *\n * @example\n * ```tsx\n * const { tooltipId, hasTooltip, accessibilityProps } = useTooltipWrapper(tooltip);\n *\n * const button = <button {...accessibilityProps}>Click me</button>;\n *\n * if (!hasTooltip) return button;\n *\n * return <Tooltip id={tooltipId} content={tooltip}>{button}</Tooltip>;\n * ```\n */\nexport function useTooltipWrapper(tooltip: React.ReactNode) {\n const tooltipId = React.useId();\n const hasTooltip = Boolean(tooltip);\n\n const accessibilityProps = React.useMemo(() => (hasTooltip ? { 'aria-describedby': tooltipId } : {}), [hasTooltip, tooltipId]);\n\n return { tooltipId, hasTooltip, accessibilityProps };\n}\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { scrollableOverflow, useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n ScrollAreaOwnProps,\n WidthProps,\n HeightProps {}\n\n/** Menus and listboxes move focus between their items, so a scroller inside one stays out of the tab order. */\nconst OWNS_FOCUS = '[role=\"menu\"], [role=\"listbox\"]';\n\n/**\n * Puts the viewport in the tab order while it has something to scroll, so a keyboard can reach it\n * and scroll it with the arrow keys. A `tabIndex` the caller set wins.\n */\nfunction useFocusableWhileScrollable(element: HTMLDivElement | null, enabled: boolean) {\n React.useEffect(() => {\n if (!enabled || !element || element.closest(OWNS_FOCUS)) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n const overflow = scrollableOverflow(element);\n const scrollable = overflow.x > 0 || overflow.y > 0;\n if (scrollable) element.setAttribute('tabindex', '0');\n else element.removeAttribute('tabindex');\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n update();\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n return () => {\n if (frame) cancelAnimationFrame(frame);\n // The attribute stays: a caller who now sets `tabIndex` has already written it.\n observer?.disconnect();\n };\n }, [element, enabled]);\n}\n\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = extractProps(props, widthPropDefs, heightPropDefs);\n const [viewport, setViewport] = React.useState<HTMLDivElement | null>(null);\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport, setViewport);\n useFocusableWhileScrollable(viewport, viewportProps.tabIndex === undefined);\n // A named scroller is a region, so a screen reader can find it and say what it holds.\n const named = viewportProps['aria-label'] !== undefined || viewportProps['aria-labelledby'] !== undefined;\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n dir={dir}\n className={classNames('kui-ScrollAreaRoot', className)}\n data-fade={fade ? '' : undefined}\n style={style}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n role={named ? 'region' : undefined}\n {...viewportProps}\n ref={viewportRef}\n className=\"kui-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"kui-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"kui-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n /**\n * Fades the content toward the top and bottom edges while there is more content past them.\n * An edge with nothing hidden past it does not fade. A floating band over an edge can set\n * `--scroll-fade-start` or `--scroll-fade-end` to its height, so content fades as it passes\n * under the band.\n */\n fade: { type: 'boolean', default: false },\n} satisfies {\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n fade: PropDef<boolean>;\n};\n\nexport { scrollAreaPropDefs };\n", "import * as React from 'react';\n\n/**\n * How far content runs past the element on each axis, in px. An axis whose overflow is hidden\n * cannot be scrolled (a ScrollArea with `scrollbars=\"vertical\"` hides the inline axis), so it\n * counts as 0, however wide the content.\n */\nexport function scrollableOverflow(element: HTMLElement) {\n const style = getComputedStyle(element);\n return {\n x: style.overflowX === 'hidden' ? 0 : Math.max(0, element.scrollWidth - element.clientWidth),\n y: style.overflowY === 'hidden' ? 0 : Math.max(0, element.scrollHeight - element.clientHeight),\n };\n}\n\n/**\n * Publishes how much content is hidden past each edge of a scroller, as\n * `--scroll-overflow-start` and `--scroll-overflow-end` (block axis) and\n * `--scroll-overflow-x-start` and `--scroll-overflow-x-end` (inline axis, from\n * the inline start, so right-to-left reads the same) in px on the element.\n * The scroll fade reads them, so an edge fades only while content is hidden\n * there, and the fade ramps in over the first pixels of scrolling.\n *\n * Writes happen at most once per frame, on scroll and when the element or its\n * content resizes. Nothing re-renders.\n */\nexport function useScrollEdges<T extends HTMLElement>(enabled: boolean) {\n const [element, setElement] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n if (!enabled || !element) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n const overflow = scrollableOverflow(element);\n const start = Math.max(0, element.scrollTop);\n const end = Math.max(0, overflow.y - element.scrollTop);\n element.style.setProperty('--scroll-overflow-start', `${start}px`);\n element.style.setProperty('--scroll-overflow-end', `${end}px`);\n // scrollLeft runs negative in right-to-left, so its size is the distance from the inline start.\n const xStart = Math.abs(element.scrollLeft);\n const xEnd = Math.max(0, overflow.x - xStart);\n element.style.setProperty('--scroll-overflow-x-start', `${xStart}px`);\n element.style.setProperty('--scroll-overflow-x-end', `${xEnd}px`);\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n write();\n element.addEventListener('scroll', schedule, { passive: true });\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(schedule);\n mutations?.observe(element, { childList: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n element.removeEventListener('scroll', schedule);\n observer?.disconnect();\n mutations?.disconnect();\n element.style.removeProperty('--scroll-overflow-start');\n element.style.removeProperty('--scroll-overflow-end');\n element.style.removeProperty('--scroll-overflow-x-start');\n element.style.removeProperty('--scroll-overflow-x-end');\n };\n }, [enabled, element]);\n\n return setElement;\n}\n", "import * as React from 'react';\n\n/**\n * Keeps a Radix ScrollArea's thumbs on the scroll position on every scroll.\n *\n * Radix moves a thumb from a requestAnimationFrame loop it starts on the first scroll event of a\n * burst. Next's production minifier compiles that self-calling loop away, so in a production\n * build the thumb moves once, sits while the content scrolls, and jumps when the next burst\n * starts. This writes the transform Radix would, at most once per frame. Nothing re-renders.\n *\n * Pass the hook's setter as a ref on `ScrollArea.Viewport`; the scrollbars are its siblings.\n */\nexport function useThumbSync<T extends HTMLElement>() {\n const [viewport, setViewport] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n const root = viewport?.parentElement;\n if (!viewport || !root) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n for (const thumb of root.querySelectorAll<HTMLElement>(':scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb')) {\n const scrollbar = thumb.parentElement as HTMLElement;\n const style = getComputedStyle(scrollbar);\n if (scrollbar.dataset.orientation === 'horizontal') {\n const track = scrollbar.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);\n const offset = thumbOffset(viewport.scrollLeft, viewport.scrollWidth - viewport.offsetWidth, track - thumb.offsetWidth);\n thumb.style.transform = `translate3d(${offset}px, 0, 0)`;\n } else {\n const track = scrollbar.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n const offset = thumbOffset(viewport.scrollTop, viewport.scrollHeight - viewport.offsetHeight, track - thumb.offsetHeight);\n thumb.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n viewport.addEventListener('scroll', schedule, { passive: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n viewport.removeEventListener('scroll', schedule);\n };\n }, [viewport]);\n\n return setViewport;\n}\n\n/** Radix's mapping: scroll position over its range, onto the room the thumb has to travel. */\nfunction thumbOffset(position: number, range: number, travel: number) {\n if (range <= 0 || travel <= 0) return 0;\n // Right-to-left scrolls run from -range to 0; the thumb then travels from -travel to 0.\n const clamped = Math.min(Math.max(position, -range), range);\n return (clamped / range) * travel;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n", "'use client';\n\n/**\n * Notice and Confirmation \u2014 what the app tells the person while it is true.\n *\n * Two questions place every message: what is it about, and what made it appear.\n *\n * - **Notice** \u2014 a condition that is true now, which nobody just caused: a usage limit, a\n * connection lost, a goal that finished. It takes space in the layout and never floats, so it\n * cannot cover what it is about. At most one action, and that action FIXES the condition. A\n * dismiss button only ACKNOWLEDGES it, and the app owns that state (`onDismiss`), because a\n * component cannot remember a dismissal across a reload.\n * - **Confirmation** \u2014 a question that waits for an answer: a quiet no before a loud yes, and no\n * dismiss button, because closing a question does not answer it. It never takes focus, so a\n * person can answer in the composer instead.\n *\n * Placement is the caller's. In a chat, both go in `Chatbar.Root`'s `notices`.\n * A notice with no action and no dismiss button is just a sentence: use `Text`.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Button } from './button.js';\nimport { Text } from './text.js';\nimport { ThemeSizeContext, useThemeSize } from '../hooks/theme-size.js';\nimport { accentColorPropDef } from '../props/color.prop.js';\n\ntype NoticeSize = '1' | '2' | '3' | '4';\n\n/** The size a notice takes when it doesn't set one. `Chatbar.Root` provides its own size here. */\nconst NoticeSizeContext = React.createContext<NoticeSize | undefined>(undefined);\n\n/** Notice's own range, the Theme's four sizes. */\nconst noticeSizePropDef = { values: ['1', '2', '3', '4'] as const };\ntype NoticeColor = (typeof accentColorPropDef)['color']['values'][number];\n\ninterface StripProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {\n /** Padding, text and button size. Defaults to the nearest Theme's size. */\n size?: NoticeSize;\n /**\n * The category of the message, not its volume. Default `gray`. Use a colour only when it adds a\n * fact the words don't already give, such as `red` for something that stops the next step.\n */\n color?: NoticeColor;\n /** The message. */\n children: React.ReactNode;\n}\n\ninterface NoticeProps extends StripProps {\n /** An icon before the message. It is hidden from assistive technology. */\n icon?: React.ReactNode;\n /**\n * One action that fixes the condition, such as `<Button>Add credits</Button>`. A control in it\n * that sets no `size` takes the notice's size.\n */\n action?: React.ReactNode;\n /**\n * Called when the person presses the dismiss button, which shows only when this is set.\n * Dismissing hides the message; it does not fix the condition. Remove the notice and remember\n * the choice in your app.\n */\n onDismiss?: () => void;\n /** Accessible name of the dismiss button. Default \"Dismiss\". */\n dismissLabel?: string;\n}\n\ninterface ConfirmationProps extends StripProps {\n /** The yes. Name the action, such as \"Run\" or \"Allow up to $18\". */\n confirmLabel: string;\n /** The no. Default \"Not now\". */\n cancelLabel?: string;\n onConfirm: () => void;\n onCancel: () => void;\n /** The yes is running: it shows a spinner and the no is disabled. */\n busy?: boolean;\n}\n\nconst Strip = React.forwardRef<HTMLDivElement, StripProps & { kind: 'notice' | 'confirmation'; trailing: React.ReactNode; leading?: React.ReactNode }>(\n ({ kind, size = '2', color = 'gray', className, children, trailing, leading, ...props }, forwardedRef) => (\n <div\n role=\"status\"\n aria-live=\"polite\"\n {...props}\n ref={forwardedRef}\n className={classNames('kui-NoticeRoot', `kui-r-size-${size}`, className)}\n data-kind={kind}\n data-accent-color={color}\n >\n {leading ? (\n <span className=\"kui-NoticeIcon\" aria-hidden>\n {leading}\n </span>\n ) : null}\n <Text as=\"div\" size={size} className=\"kui-NoticeText\">\n {children}\n </Text>\n {trailing}\n </div>\n ),\n);\nStrip.displayName = 'Strip';\n\n/** A condition that is true now, with at most one action that fixes it. */\nconst Notice = React.forwardRef<HTMLDivElement, NoticeProps>(({ icon, action, onDismiss, dismissLabel = 'Dismiss', size: sizeProp, ...props }, forwardedRef) => {\n const contextSize = React.useContext(NoticeSizeContext);\n const size = useThemeSize(sizeProp ?? contextSize, noticeSizePropDef);\n const trailing =\n action || onDismiss ? (\n <span className=\"kui-NoticeActions\">\n {action ? <ThemeSizeContext.Provider value={size}>{action}</ThemeSizeContext.Provider> : null}\n {onDismiss ? (\n <Button iconOnly size={size} variant=\"ghost\" color=\"gray\" aria-label={dismissLabel} className=\"kui-NoticeDismiss\" onClick={onDismiss}>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\" aria-hidden>\n <path d=\"M4 4l7 7M11 4l-7 7\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n </Button>\n ) : null}\n </span>\n ) : null;\n return <Strip {...props} size={size} ref={forwardedRef} kind=\"notice\" leading={icon} trailing={trailing} />;\n});\nNotice.displayName = 'Notice';\n\n/** A question that waits for an answer: a quiet no, a loud yes, and no dismiss button. */\nconst Confirmation = React.forwardRef<HTMLDivElement, ConfirmationProps>(\n ({ confirmLabel, cancelLabel = 'Not now', onConfirm, onCancel, busy = false, size: sizeProp, color = 'gray', ...props }, forwardedRef) => {\n const contextSize = React.useContext(NoticeSizeContext);\n const size = useThemeSize(sizeProp ?? contextSize, noticeSizePropDef);\n return (\n <Strip\n {...props}\n size={size}\n color={color}\n ref={forwardedRef}\n kind=\"confirmation\"\n trailing={\n <span className=\"kui-NoticeActions\">\n <Button size={size} variant=\"ghost\" color=\"gray\" disabled={busy} onClick={onCancel}>\n {cancelLabel}\n </Button>\n <Button size={size} variant=\"solid\" color={color} loading={busy} onClick={onConfirm}>\n {confirmLabel}\n </Button>\n </span>\n }\n />\n );\n },\n);\nConfirmation.displayName = 'Confirmation';\n\nexport { Notice, Confirmation, NoticeSizeContext };\nexport type { NoticeProps, ConfirmationProps };\n", "import { VisuallyHidden as VisuallyHiddenPrimitive } from 'radix-ui';\nexport const VisuallyHidden = VisuallyHiddenPrimitive.Root;\nexport const Root = VisuallyHiddenPrimitive.Root;\nexport type VisuallyHiddenProps = VisuallyHiddenPrimitive.VisuallyHiddenProps;\n"],
|
|
5
|
+
"mappings": ";8kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,GAAA,eAAAC,GAAA,mBAAAC,GAAA,cAAAC,GAAA,gBAAAC,GAAA,SAAAC,GAAA,SAAAC,GAAA,QAAAC,GAAA,WAAAC,GAAA,aAAAC,GAAA,SAAAC,GAAA,aAAAC,KAAA,eAAAC,GAAAd,IAAA,IAAAe,EAAuB,oBACvBC,EAAuB,yBACvBC,GAAiD,6BACjDC,GAA4B,0BCH5B,IAAAC,GAAuB,oBACvBC,GAAuB,yBCDvB,IAAAC,EAAuB,oBACvBC,GAAuB,yBACvBC,GAAqB,oBACrBC,GAAiD,6BCDjD,IAAMC,GAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECPA,IAAMC,GAAe,CAAC,OAAQ,OAAQ,SAAU,QAAS,SAAU,QAAS,SAAU,SAAU,MAAO,OAAQ,UAAW,OAAQ,OAAQ,SAAU,SAAU,OAAQ,SAAU,OAAQ,OAAQ,OAAQ,OAAQ,QAAS,QAAS,OAAQ,OAAQ,KAAK,EAEjPC,GAAa,CAAC,OAAQ,OAAQ,QAAS,QAAS,OAAQ,QAAS,MAAM,EAEvEC,GAAe,CACnB,MAAO,CACL,KAAM,OACN,OAAQF,GACR,QAAS,MACX,CACF,EAMM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Q,cAAW,IAC3L,gBAAC,QAAK,EAAE,4BAA4B,EACpC,gBAAC,QAAK,EAAE,WAAW,CACrB,EAGF3N,GACE,gBAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,QAAQ,cAAW,IAC3L,gBAAC,QAAK,EAAE,WAAW,EACnB,gBAAC,QAAK,EAAE,gBAAgB,CAC1B,EAIN,OACE,gBAACqL,GAAA,CACC,SAAQ,GACP,GAAGqB,EACJ,IAAK7M,EACL,KAAMiB,GAAY3C,EAAI,KACrB,GAAIgP,EAAW,CAAE,SAAAA,CAAS,EAAI,CAAE,QAASD,IAAgB/O,EAAI,MAAQ4P,IAAS,OAAS,QAAU,QAAS,EAC3G,SAAUE,GACV,aAAW,EAAA/G,SAAW,kBAAmBpH,CAAS,EAClD,MAAO,CAAE,QAASkO,EAAU,EAAI,EAAG,cAAeA,EAAU,OAAY,OAAQ,GAAGjO,CAAM,EAEzF,cAAaiO,EAAU,OAAY,GACnC,SAAUA,EAAUZ,EAAW,GAC/B,QAAS7F,EACT,QAAS4G,GACT,cAAad,EACb,YAAWU,EACV,GAAGG,IAEHE,EACH,CAEJ,CAAC,EACDpB,GAAK,YAAc",
|
|
6
|
+
"names": ["chatbar_exports", "__export", "AttachTrigger", "Attachment", "AttachmentsRow", "InlineEnd", "InlineStart", "Item", "Root", "Row", "RowEnd", "RowStart", "Send", "Textarea", "__toCommonJS", "React", "import_classnames", "import_internal", "import_react_dropzone", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "import_internal", "asChildPropDef", "accentColors", "grayColors", "colorPropDef", "accentColorPropDef", "radii", "radiusPropDef", "sizes", "variants", "baseButtonPropDefs", "asChildPropDef", "accentColorPropDef", "radiusPropDef", "React", "import_classnames", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "paddingValues", "paddingPropDefs", "heightPropDefs", "widthPropDefs", "overflowValues", "positionValues", "positionEdgeValues", "flexShrinkValues", "flexGrowValues", "alignSelfValues", "justifySelfValues", "layoutPropDefs", "paddingPropDefs", "widthPropDefs", "heightPropDefs", "marginValues", "marginPropDefs", "import_radix_ui", "Root", "SlotPrimitive", "Slot", "Slottable", "gapValues", "gapPropDefs", "as", "displayValues", "directionValues", "alignValues", "justifyValues", "wrapValues", "flexPropDefs", "asChildPropDef", "parseJustifyValue", "gapPropDefs", "value", "Flex", "props", "forwardedRef", "className", "asChild", "Tag", "flexProps", "extractProps", "flexPropDefs", "layoutPropDefs", "marginPropDefs", "Slot", "classNames", "React", "import_classnames", "spinnerPropDefs", "Spinner", "props", "forwardedRef", "className", "children", "loading", "spinnerProps", "extractProps", "spinnerPropDefs", "named", "spinner", "classNames", "Flex", "import_react", "ThickDividerHorizontalIcon", "React", "props", "forwardedRef", "ThickCheckIcon", "ChevronDownIcon", "ThickChevronRightIcon", "ThickChevronLeftIcon", "ThickDotIcon", "CloseIcon", "React", "_props", "_forwardedRef", "PaperclipIcon", "props", "forwardedRef", "FileIcon", "FileTextIcon", "TickIcon", "React", "clampSize", "size", "values", "n", "nearest", "distance", "i", "d", "ThemeSizeContext", "useThemeSize", "explicit", "propDef", "themeSize", "clampSize", "useThemeSizeProps", "props", "size", "BaseButton", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "baseButtonPropDefs", "className", "children", "asChild", "as", "color", "radius", "nativeDisabled", "done", "baseButtonProps", "extractProps", "loading", "canLoad", "disabled", "onClick", "ariaDescribedByProp", "handleClick", "event", "childEdges", "content", "items", "flattenFragments", "isIcon", "node", "TEXT_COMPONENTS", "componentName", "domEdges", "setDomEdges", "elementRef", "composedRef", "element", "contentRoot", "iconStart", "edgeIsSvg", "iconEnd", "prev", "iconOnly", "tick", "TickIcon", "swap", "nodes", "first", "firstNode", "index", "Comp", "formElements", "renderedType", "shouldPassDisabled", "onClickCapture", "handleClickCapture", "isNativeButtonElement", "hasExplicitTypeAttribute", "loadingId", "describedById", "accessibilityProps", "renderInner", "inner", "label", "Flex", "Spinner", "asChildContent", "classNames", "type", "named", "edge", "React", "import_classnames", "import_radix_ui", "React", "import_radix_ui", "emphases", "emphasisPropDef", "leadingTrimValues", "leadingTrimPropDef", "textAlignValues", "textAlignPropDef", "textWrapValues", "textWrapPropDef", "truncatePropDef", "fontFamilies", "fontFamilyPropDef", "weights", "weightPropDef", "as", "sizes", "textPropDefs", "asChildPropDef", "fontFamilyPropDef", "weightPropDef", "textAlignPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "colorPropDef", "emphasisPropDef", "Text", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "textProps", "extractProps", "textPropDefs", "combinedClassName", "React", "React", "import_classnames", "import_radix_ui", "getMatchingGrayColor", "accentColor", "React", "usePropSyncedState", "propValue", "value", "setValue", "previousPropValue", "setPreviousPropValue", "appearances", "fontFamilies", "sizes", "themePropDefs", "asChildPropDef", "accentColors", "grayColors", "radii", "noop", "defaultThemeContext", "themePropDefs", "ThemeContext", "Theme", "props", "forwardedRef", "context", "ThemeContext", "dir", "ThemeRoot", "ThemeImpl", "appearanceProp", "themePropDefs", "accentColorProp", "grayColorProp", "radiusProp", "fontFamilyProp", "headingFontFamilyProp", "sizeProp", "hasBackground", "rootProps", "appearance", "setAppearance", "usePropSyncedState", "accentColor", "setAccentColor", "grayColor", "setGrayColor", "radius", "setRadius", "fontFamily", "setFontFamily", "headingFontFamily", "setHeadingFontFamily", "size", "setSize", "asChild", "isRoot", "hasBackgroundProp", "onAppearanceChange", "noop", "onAccentColorChange", "onGrayColorChange", "onRadiusChange", "onFontFamilyChange", "onHeadingFontFamilyChange", "onSizeChange", "themeProps", "Comp", "resolvedGrayColor", "getMatchingGrayColor", "isExplicitAppearance", "ThemeSizeContext", "classNames", "React", "PaneBandSizeContext", "React", "PageScopeContext", "NoPageScope", "children", "PageScopeContext", "PortalTheme", "props", "forwardedRef", "PaneBandSizeContext", "NoPageScope", "Theme", "tooltipPropDefs", "widthPropDefs", "TOOLTIP_DELAY", "TooltipProviderContext", "TooltipProvider", "delayDuration", "children", "props", "TooltipPrimitive", "Tooltip", "forwardedRef", "className", "open", "defaultOpen", "onOpenChange", "disableHoverableContent", "content", "container", "forceMount", "tooltipContentProps", "extractProps", "tooltipPropDefs", "rootProps", "hasProvider", "tooltip", "PortalTheme", "classNames", "Text", "React", "useTooltipWrapper", "tooltip", "tooltipId", "hasTooltip", "accessibilityProps", "EMPHASIS_VARIANT", "Button", "className", "style", "tooltip", "tooltipSide", "tooltipAlign", "tooltipDelayDuration", "tooltipDisableHoverableContent", "iconOnly", "emphasis", "variant", "props", "forwardedRef", "tooltipId", "hasTooltip", "tooltipAccessibilityProps", "useTooltipWrapper", "resolvedVariant", "EMPHASIS_VARIANT", "callerDescribedBy", "tooltipDescribedBy", "ariaDescribedBy", "button", "BaseButton", "classNames", "Tooltip", "React", "import_classnames", "import_radix_ui", "import_internal", "scrollbarsValues", "scrollAreaPropDefs", "asChildPropDef", "radiusPropDef", "React", "scrollableOverflow", "element", "style", "useScrollEdges", "enabled", "setElement", "frame", "write", "overflow", "start", "end", "xStart", "xEnd", "schedule", "observer", "child", "mutations", "React", "useThumbSync", "viewport", "setViewport", "root", "frame", "write", "thumb", "scrollbar", "style", "track", "offset", "thumbOffset", "schedule", "position", "range", "travel", "React", "getSubtree", "options", "content", "asChild", "children", "firstChild", "OWNS_FOCUS", "useFocusableWhileScrollable", "element", "enabled", "frame", "update", "overflow", "scrollableOverflow", "schedule", "observer", "child", "ScrollArea", "props", "forwardedRef", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "radius", "scrollAreaPropDefs", "scrollbars", "fade", "viewportProps", "extractProps", "widthPropDefs", "heightPropDefs", "viewport", "setViewport", "setEdgesElement", "useScrollEdges", "setThumbViewport", "useThumbSync", "viewportRef", "named", "ScrollAreaPrimitive", "classNames", "getSubtree", "React", "import_classnames", "NoticeSizeContext", "noticeSizePropDef", "Strip", "kind", "size", "color", "className", "children", "trailing", "leading", "props", "forwardedRef", "classNames", "Text", "Notice", "icon", "action", "onDismiss", "dismissLabel", "sizeProp", "contextSize", "useThemeSize", "ThemeSizeContext", "Button", "Confirmation", "confirmLabel", "cancelLabel", "onConfirm", "onCancel", "busy", "import_radix_ui", "VisuallyHidden", "VisuallyHiddenPrimitive", "Root", "withoutPlaceholder", "el", "measure", "placeholder", "chatbarSizePropDef", "ChatbarContext", "ChatbarValueContext", "useChatbarContext", "ctx", "toArray", "val", "s", "matchesAccept", "file", "patterns", "mime", "name", "patRaw", "pat", "type", "subtype", "fmType", "fmSubtype", "IMAGE_EXT_RE", "isImageLike", "hasText", "value", "plural", "n", "word", "attachmentCounter", "createAttachmentId", "Root", "props", "forwardedRef", "className", "style", "children", "valueProp", "defaultValue", "onValueChange", "openProp", "defaultOpen", "onOpenChange", "expandOn", "minLines", "maxLines", "sendMode", "disabled", "readOnly", "onSubmit", "sizeProp", "variant", "color", "radius", "width", "maxWidth", "attachmentsProp", "defaultAttachments", "onAttachmentsChange", "accept", "multiple", "maxAttachments", "maxFileSize", "paste", "pasteAccept", "clearOnSubmit", "onAttachmentReject", "dropzone", "apiRef", "onBlurCapture", "notices", "context", "divProps", "size", "useThemeSize", "isValueControlled", "valueUncontrolled", "setValueUncontrolled", "isOpenControlled", "openUncontrolled", "setOpenUncontrolled", "open", "isAttachmentsControlled", "attachmentsUncontrolled", "setAttachmentsUncontrolled", "attachments", "announcement", "setAnnouncementState", "announce", "text", "prev", "rootRef", "composedRootRef", "textareaRef", "fileInputRef", "pickerOpenRef", "pressGuardRef", "pressGuardTimerRef", "pickerRef", "acceptKey", "pasteAcceptKey", "accepts", "pasteAccepts", "snapshot", "latest", "pendingAttachmentsRef", "getAttachments", "setOpen", "next", "setValue", "setAttachments", "ownedUrlsRef", "addFiles", "files", "cfg", "current", "rejected", "remainingSlots", "perActionLimit", "url", "messages", "appendFiles", "appendFilesFromPaste", "removeAttachment", "id", "removed", "a", "submit", "clear", "payload", "att", "owned", "openFilePicker", "options", "input", "beginFilePickerPress", "reset", "handleFileInputChange", "event", "picker", "handleBlurCapture", "rootEl", "nextTarget", "handleDrop", "getRootProps", "isDragActive", "dragActive", "handleContainerPointerDown", "target", "contextValue", "classNames", "NoticeSizeContext", "Text", "VisuallyHidden", "Textarea", "asChild", "onFocus", "onChange", "onPaste", "onKeyDown", "onCompositionStart", "onCompositionEnd", "submitOnEnter", "textareaProps", "composedRef", "lineHeightRef", "paddingRef", "composingRef", "sizingRef", "recomputeMetrics", "computedStyle", "applyHeight", "isOpen", "min", "max", "lineHeight", "padding", "minHeight", "maxHeight", "contentHeight", "overflowing", "compactHeight", "prevWidth", "ro", "entries", "first", "handleFocus", "handleChange", "handlePaste", "item", "f", "handleCompositionStart", "handleCompositionEnd", "handleKeyDown", "Slot", "InlineStart", "InlineEnd", "AttachmentsRow", "forceMount", "renderAttachment", "hasItems", "ScrollArea", "Flex", "Attachment", "moveFocusOffPill", "button", "pill", "pills", "index", "nextButton", "Pill", "lead", "leadKind", "label", "detail", "removeLabel", "onRemove", "Button", "CloseIcon", "STATUS_LABEL", "attachment", "Comp", "isImage", "kilobytes", "sizeLabel", "statusLabel", "locked", "handleRemove", "Spinner", "FileTextIcon", "Item", "icon", "image", "AttachTrigger", "disabledProp", "onPointerDown", "onClick", "_color", "buttonProps", "triggerProps", "PaperclipIcon", "Row", "RowStart", "RowEnd", "Send", "clearOnSend", "variantProp", "emphasis", "tabIndex", "status", "onStop", "onRetry", "stopLabel", "retryLabel", "stopIcon", "retryIcon", "ariaLabel", "ariaLabelledby", "hasContent", "mode", "visible", "inactive", "labelProps", "handleClick", "glyph"]
|
|
7
7
|
}
|