@womp/kookie-ui 0.5.0 → 0.6.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/components.css +306 -508
- package/dist/cjs/components/_internal/base-menu.utils.d.ts +48 -0
- package/dist/cjs/components/_internal/base-menu.utils.d.ts.map +1 -0
- package/dist/cjs/components/_internal/base-menu.utils.js +2 -0
- package/dist/cjs/components/_internal/base-menu.utils.js.map +7 -0
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.d.ts +77 -59
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.d.ts.map +1 -1
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.js +1 -1
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.js.map +4 -4
- package/dist/cjs/components/_internal/menu-context.d.ts +7 -3
- package/dist/cjs/components/_internal/menu-context.d.ts.map +1 -1
- package/dist/cjs/components/_internal/menu-context.js +1 -1
- package/dist/cjs/components/_internal/menu-context.js.map +4 -4
- package/dist/cjs/components/_internal/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +2 -2
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +2 -2
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +2 -2
- package/dist/cjs/components/accordion.js +1 -1
- package/dist/cjs/components/alert-dialog.js +1 -1
- package/dist/cjs/components/alert-dialog.js.map +2 -2
- package/dist/cjs/components/badge.js +1 -1
- package/dist/cjs/components/badge.js.map +2 -2
- package/dist/cjs/components/blockquote.js +1 -1
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/callout.js +1 -1
- package/dist/cjs/components/callout.js.map +2 -2
- package/dist/cjs/components/card.js +1 -1
- package/dist/cjs/components/card.js.map +2 -2
- package/dist/cjs/components/chatbar.d.ts +46 -44
- package/dist/cjs/components/chatbar.d.ts.map +1 -1
- package/dist/cjs/components/chatbar.js +2 -2
- package/dist/cjs/components/chatbar.js.map +3 -3
- package/dist/cjs/components/checkbox-cards.js +1 -1
- package/dist/cjs/components/checkbox-cards.js.map +2 -2
- package/dist/cjs/components/checkbox-group.js +1 -1
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/combobox.d.ts +28 -15
- 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 +4 -4
- package/dist/cjs/components/combobox.props.d.ts +48 -0
- package/dist/cjs/components/combobox.props.d.ts.map +1 -1
- package/dist/cjs/components/combobox.props.js +1 -1
- package/dist/cjs/components/combobox.props.js.map +4 -4
- package/dist/cjs/components/context-menu.d.ts +18 -5
- package/dist/cjs/components/context-menu.d.ts.map +1 -1
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +4 -4
- package/dist/cjs/components/context-menu.props.d.ts +1 -1
- package/dist/cjs/components/context-menu.props.d.ts.map +1 -1
- package/dist/cjs/components/context-menu.props.js +1 -1
- package/dist/cjs/components/context-menu.props.js.map +3 -3
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +2 -2
- package/dist/cjs/components/dropdown-menu.d.ts +11 -18
- package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +4 -4
- package/dist/cjs/components/heading.js +1 -1
- package/dist/cjs/components/hover-card.js +1 -1
- package/dist/cjs/components/hover-card.js.map +2 -2
- package/dist/cjs/components/icon-button.js +1 -1
- package/dist/cjs/components/icon-button.js.map +2 -2
- package/dist/cjs/components/index.js +5 -5
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/components/popover.js +1 -1
- package/dist/cjs/components/popover.js.map +2 -2
- package/dist/cjs/components/radio-cards.js +1 -1
- package/dist/cjs/components/radio-cards.js.map +2 -2
- package/dist/cjs/components/radio.js +1 -1
- package/dist/cjs/components/radio.js.map +2 -2
- package/dist/cjs/components/schemas/base-button.schema.d.ts +111 -256
- package/dist/cjs/components/schemas/base-button.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/button.schema.d.ts +136 -557
- package/dist/cjs/components/schemas/button.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/icon-button.schema.d.ts +123 -240
- package/dist/cjs/components/schemas/icon-button.schema.d.ts.map +1 -1
- 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 +592 -851
- 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-button.schema.d.ts +138 -1026
- package/dist/cjs/components/schemas/toggle-button.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/toggle-icon-button.schema.d.ts +124 -465
- package/dist/cjs/components/schemas/toggle-icon-button.schema.d.ts.map +1 -1
- package/dist/cjs/components/scroll-area.js +1 -1
- package/dist/cjs/components/segmented-control.js +1 -1
- package/dist/cjs/components/select.js +1 -1
- package/dist/cjs/components/select.js.map +2 -2
- package/dist/cjs/components/sheet.js +1 -1
- package/dist/cjs/components/sheet.js.map +2 -2
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +3 -3
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +4 -4
- package/dist/cjs/components/slider.js +1 -1
- package/dist/cjs/components/slot.d.ts +6 -2
- package/dist/cjs/components/slot.d.ts.map +1 -1
- package/dist/cjs/components/switch.js +1 -1
- package/dist/cjs/components/tab-nav.js +1 -1
- package/dist/cjs/components/text-field.js +2 -2
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/components/theme-panel.js +3 -3
- package/dist/cjs/components/theme-panel.js.map +2 -2
- package/dist/cjs/components/theme.js +1 -1
- package/dist/cjs/components/theme.js.map +2 -2
- package/dist/cjs/components/theme.props.d.ts +1 -1
- package/dist/cjs/components/theme.props.js +1 -1
- package/dist/cjs/components/theme.props.js.map +2 -2
- package/dist/cjs/components/toggle-button.js +1 -1
- package/dist/cjs/components/toggle-button.js.map +2 -2
- package/dist/cjs/components/toggle-icon-button.js +1 -1
- package/dist/cjs/components/toggle-icon-button.js.map +2 -2
- package/dist/cjs/components/tooltip.js +1 -1
- package/dist/cjs/components/tooltip.js.map +2 -2
- package/dist/cjs/components/user-card.js +1 -1
- package/dist/cjs/components/user-card.js.map +2 -2
- 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 +4 -4
- package/dist/cjs/helpers/extract-props.js +1 -1
- package/dist/cjs/helpers/extract-props.js.map +2 -2
- package/dist/cjs/helpers/get-margin-styles.js +1 -1
- package/dist/cjs/helpers/get-margin-styles.js.map +2 -2
- package/dist/cjs/hooks/use-breakpoint.d.ts +4 -1
- package/dist/cjs/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/cjs/hooks/use-breakpoint.js +1 -1
- package/dist/cjs/hooks/use-breakpoint.js.map +3 -3
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/props/index.js +1 -1
- package/dist/cjs/props/index.js.map +3 -3
- package/dist/esm/{chunk-P7HYVJSU.js → chunk-2TIADHPD.js} +2 -2
- package/dist/esm/chunk-37OGSEQR.js +2 -0
- package/dist/esm/chunk-37OGSEQR.js.map +7 -0
- package/dist/esm/{chunk-RMKXWYOV.js → chunk-3OBXZUFJ.js} +2 -2
- package/dist/esm/{chunk-S2HA3W3V.js → chunk-3R7XMRV5.js} +2 -2
- package/dist/esm/chunk-4SMJ7D4S.js +2 -0
- package/dist/esm/chunk-4SMJ7D4S.js.map +7 -0
- package/dist/esm/{chunk-S56YSRHP.js → chunk-56TS6OKQ.js} +2 -2
- package/dist/esm/{chunk-2FYJTSOP.js → chunk-5BYHEYO6.js} +2 -2
- package/dist/esm/{chunk-B24BDVG2.js → chunk-5MNBQROW.js} +2 -2
- package/dist/esm/{chunk-W7N7V5YD.js → chunk-7ESHXHHO.js} +2 -2
- package/dist/esm/{chunk-CRWYCLTE.js → chunk-ABSKRHVM.js} +2 -2
- package/dist/esm/chunk-ADBLURLJ.js +2 -0
- package/dist/esm/chunk-ADBLURLJ.js.map +7 -0
- package/dist/esm/{chunk-3MWWP4MW.js → chunk-BBJUB52V.js} +2 -2
- package/dist/esm/{chunk-PTLFMWCN.js → chunk-CQNPBTM5.js} +2 -2
- package/dist/esm/{chunk-GJSGKE7B.js → chunk-CTA5ODAO.js} +2 -2
- package/dist/esm/{chunk-GWXVETMF.js → chunk-DCAZPMOB.js} +2 -2
- package/dist/esm/{chunk-PLWXTEVE.js → chunk-DMJJM5IS.js} +2 -2
- package/dist/esm/{chunk-A2RZGGMY.js → chunk-DQAUX5ZL.js} +2 -2
- package/dist/esm/{chunk-6XGZPIUT.js → chunk-DX5JJYMZ.js} +2 -2
- package/dist/esm/{chunk-6XGZPIUT.js.map → chunk-DX5JJYMZ.js.map} +2 -2
- package/dist/esm/{chunk-YUP6EICB.js → chunk-DXL6V2A5.js} +2 -2
- package/dist/esm/{chunk-XMRIRFM7.js → chunk-FG7XM7KJ.js} +2 -2
- package/dist/esm/{chunk-IKSN4RNB.js → chunk-FIB3XATL.js} +3 -3
- package/dist/esm/chunk-FMBECDL4.js +2 -0
- package/dist/esm/{chunk-4XJY6FIK.js.map → chunk-FMBECDL4.js.map} +3 -3
- package/dist/esm/{chunk-374ZYJUP.js → chunk-HBR42MIX.js} +2 -2
- package/dist/esm/{chunk-2UPAYDKR.js → chunk-HIKVMKYQ.js} +2 -2
- package/dist/esm/{chunk-VX6ARMWP.js → chunk-HSAG7C53.js} +2 -2
- package/dist/esm/{chunk-OSRJRBKP.js → chunk-HW324FK3.js} +2 -2
- package/dist/esm/{chunk-DNHUQLXO.js → chunk-JBO5YOUM.js} +2 -2
- package/dist/esm/{chunk-HF5WY5YE.js → chunk-JGLAE5G7.js} +2 -2
- package/dist/esm/{chunk-4YFJWXL2.js → chunk-JJKQ7CGI.js} +2 -2
- package/dist/esm/chunk-JSW6J6RS.js +2 -0
- package/dist/esm/chunk-JSW6J6RS.js.map +7 -0
- package/dist/esm/chunk-KRDP5SQ7.js +2 -0
- package/dist/esm/chunk-KRDP5SQ7.js.map +7 -0
- package/dist/esm/{chunk-CWRNW44F.js → chunk-L6PVH3RM.js} +2 -2
- package/dist/esm/{chunk-MK2R6DAU.js → chunk-LAOMR7SE.js} +2 -2
- package/dist/esm/{chunk-FHOCUZDR.js → chunk-NIQT45PJ.js} +2 -2
- package/dist/esm/chunk-NKEJTTIL.js +2 -0
- package/dist/esm/chunk-NKEJTTIL.js.map +7 -0
- package/dist/esm/chunk-NVDXXGVW.js +2 -0
- package/dist/esm/chunk-NVDXXGVW.js.map +7 -0
- package/dist/esm/chunk-OS3FCYZY.js +2 -0
- package/dist/esm/{chunk-7QDTSBJF.js → chunk-OYF6YXH7.js} +2 -2
- package/dist/esm/{chunk-WFMYNZXZ.js → chunk-P5OSU4NX.js} +2 -2
- package/dist/esm/{chunk-QEOAXJLN.js → chunk-PTS6QYQW.js} +2 -2
- package/dist/esm/{chunk-CVWCKOHO.js → chunk-RLPKKCBL.js} +2 -2
- package/dist/esm/{chunk-LKAK5GXF.js → chunk-SPIU5JYC.js} +2 -2
- package/dist/esm/chunk-SZTZ2XLI.js +2 -0
- package/dist/esm/chunk-SZTZ2XLI.js.map +7 -0
- package/dist/esm/chunk-T2FZN7G3.js +2 -0
- package/dist/esm/chunk-T2FZN7G3.js.map +7 -0
- package/dist/esm/{chunk-4AQTUBVP.js → chunk-T4UHUQFJ.js} +2 -2
- package/dist/esm/{chunk-K6QZMNCD.js → chunk-TS623UPD.js} +2 -2
- package/dist/esm/{chunk-YV2KYHGR.js → chunk-UBOOUDS4.js} +2 -2
- package/dist/esm/{chunk-D6B7IMZU.js → chunk-UFI53QUC.js} +2 -2
- package/dist/esm/{chunk-AU3D6F42.js → chunk-UIRSGVJG.js} +2 -2
- package/dist/esm/{chunk-FXUUI6Z2.js → chunk-UUUZXUIP.js} +2 -2
- package/dist/esm/{chunk-25WZA7ZU.js → chunk-VA4CTVQL.js} +2 -2
- package/dist/esm/{chunk-TOLLPRMM.js → chunk-VNPNEJI6.js} +2 -2
- package/dist/esm/{chunk-6IGTK4JE.js → chunk-YMUGKYGW.js} +2 -2
- package/dist/esm/chunk-ZWYYPFZW.js +2 -0
- package/dist/esm/chunk-ZWYYPFZW.js.map +7 -0
- package/dist/esm/{chunk-M24UXMOQ.js → chunk-ZXZOH63L.js} +2 -2
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/_internal/base-button.props.js +1 -1
- package/dist/esm/components/_internal/base-checkbox.props.js +1 -1
- package/dist/esm/components/_internal/base-menu.props.js +1 -1
- package/dist/esm/components/_internal/base-menu.utils.d.ts +48 -0
- package/dist/esm/components/_internal/base-menu.utils.d.ts.map +1 -0
- package/dist/esm/components/_internal/base-menu.utils.js +2 -0
- package/dist/esm/components/_internal/base-menu.utils.js.map +7 -0
- package/dist/esm/components/_internal/base-radio.props.js +1 -1
- package/dist/esm/components/_internal/base-tab-list.props.js +1 -1
- package/dist/esm/components/_internal/dropdown-menu-drill-down.d.ts +77 -59
- package/dist/esm/components/_internal/dropdown-menu-drill-down.d.ts.map +1 -1
- package/dist/esm/components/_internal/dropdown-menu-drill-down.js +1 -1
- package/dist/esm/components/_internal/menu-context.d.ts +7 -3
- package/dist/esm/components/_internal/menu-context.d.ts.map +1 -1
- package/dist/esm/components/_internal/menu-context.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.js +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-prop-helpers.js +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/accessible-icon.js +1 -1
- package/dist/esm/components/accordion.js +1 -1
- package/dist/esm/components/accordion.props.js +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/alert-dialog.props.js +1 -1
- package/dist/esm/components/aspect-ratio.js +1 -1
- package/dist/esm/components/avatar.js +1 -1
- package/dist/esm/components/avatar.props.js +1 -1
- package/dist/esm/components/badge.js +1 -1
- package/dist/esm/components/badge.props.js +1 -1
- package/dist/esm/components/blockquote.js +1 -1
- package/dist/esm/components/blockquote.props.js +1 -1
- package/dist/esm/components/box.js +1 -1
- package/dist/esm/components/box.props.js +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.props.js +1 -1
- package/dist/esm/components/callout.js +1 -1
- package/dist/esm/components/callout.props.js +1 -1
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/card.props.js +1 -1
- package/dist/esm/components/chatbar.d.ts +46 -44
- package/dist/esm/components/chatbar.d.ts.map +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/checkbox-cards.js +1 -1
- package/dist/esm/components/checkbox-cards.props.js +1 -1
- package/dist/esm/components/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox-group.primitive.js +1 -1
- package/dist/esm/components/checkbox-group.props.js +1 -1
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.props.js +1 -1
- package/dist/esm/components/code.js +1 -1
- package/dist/esm/components/code.props.js +1 -1
- package/dist/esm/components/combobox.d.ts +28 -15
- package/dist/esm/components/combobox.d.ts.map +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/combobox.props.d.ts +48 -0
- package/dist/esm/components/combobox.props.d.ts.map +1 -1
- package/dist/esm/components/combobox.props.js +1 -1
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/container.props.js +1 -1
- package/dist/esm/components/context-menu.d.ts +18 -5
- package/dist/esm/components/context-menu.d.ts.map +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/context-menu.props.d.ts +1 -1
- package/dist/esm/components/context-menu.props.d.ts.map +1 -1
- package/dist/esm/components/context-menu.props.js +1 -1
- package/dist/esm/components/data-list.js +1 -1
- package/dist/esm/components/data-list.props.js +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.props.js +1 -1
- package/dist/esm/components/dropdown-menu.d.ts +11 -18
- package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/dropdown-menu.props.js +1 -1
- package/dist/esm/components/em.js +1 -1
- package/dist/esm/components/em.props.js +1 -1
- package/dist/esm/components/flex.js +1 -1
- package/dist/esm/components/flex.props.js +1 -1
- package/dist/esm/components/grid.js +1 -1
- package/dist/esm/components/grid.props.js +1 -1
- package/dist/esm/components/heading.js +1 -1
- package/dist/esm/components/heading.props.js +1 -1
- package/dist/esm/components/hover-card.js +1 -1
- package/dist/esm/components/hover-card.props.js +1 -1
- package/dist/esm/components/icon-button.js +1 -1
- package/dist/esm/components/icon-button.props.js +1 -1
- package/dist/esm/components/icons.js +1 -1
- package/dist/esm/components/image.js +1 -1
- package/dist/esm/components/image.props.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/inset.js +1 -1
- package/dist/esm/components/inset.props.js +1 -1
- package/dist/esm/components/kbd.js +1 -1
- package/dist/esm/components/kbd.props.js +1 -1
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/components/link.props.js +1 -1
- package/dist/esm/components/navbar.js +1 -1
- package/dist/esm/components/navbar.props.js +1 -1
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/popover.props.js +1 -1
- package/dist/esm/components/portal.js +1 -1
- package/dist/esm/components/progress.js +1 -1
- package/dist/esm/components/progress.props.js +1 -1
- package/dist/esm/components/quote.js +1 -1
- package/dist/esm/components/quote.props.js +1 -1
- package/dist/esm/components/radio-cards.js +1 -1
- package/dist/esm/components/radio-cards.props.js +1 -1
- package/dist/esm/components/radio-group.js +1 -1
- package/dist/esm/components/radio-group.props.js +1 -1
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/radio.props.js +1 -1
- package/dist/esm/components/reset.js +1 -1
- package/dist/esm/components/schemas/base-button.schema.d.ts +111 -256
- 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 +136 -557
- 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/icon-button.schema.d.ts +123 -240
- package/dist/esm/components/schemas/icon-button.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/icon-button.schema.js +1 -1
- package/dist/esm/components/schemas/index.js +1 -1
- package/dist/esm/components/schemas/shell.schema.d.ts +592 -851
- 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-button.schema.d.ts +138 -1026
- package/dist/esm/components/schemas/toggle-button.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/toggle-button.schema.js +1 -1
- package/dist/esm/components/schemas/toggle-icon-button.schema.d.ts +124 -465
- package/dist/esm/components/schemas/toggle-icon-button.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/toggle-icon-button.schema.js +1 -1
- package/dist/esm/components/scroll-area.js +1 -1
- package/dist/esm/components/scroll-area.props.js +1 -1
- package/dist/esm/components/section.js +1 -1
- package/dist/esm/components/section.props.js +1 -1
- package/dist/esm/components/segmented-control.js +1 -1
- package/dist/esm/components/segmented-control.props.js +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/select.props.js +1 -1
- package/dist/esm/components/separator.js +1 -1
- package/dist/esm/components/separator.props.js +1 -1
- package/dist/esm/components/sheet.js +1 -1
- package/dist/esm/components/shell.context.js +1 -1
- package/dist/esm/components/shell.hooks.js +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/shell.types.js +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/sidebar.props.js +1 -1
- package/dist/esm/components/skeleton.js +1 -1
- package/dist/esm/components/skeleton.props.js +1 -1
- package/dist/esm/components/slider.js +1 -1
- package/dist/esm/components/slider.props.js +1 -1
- package/dist/esm/components/slot.d.ts +6 -2
- package/dist/esm/components/slot.d.ts.map +1 -1
- package/dist/esm/components/slot.js +1 -1
- package/dist/esm/components/spinner.js +1 -1
- package/dist/esm/components/spinner.props.js +1 -1
- package/dist/esm/components/strong.js +1 -1
- package/dist/esm/components/strong.props.js +1 -1
- package/dist/esm/components/switch.js +1 -1
- package/dist/esm/components/switch.props.js +1 -1
- package/dist/esm/components/tab-nav.js +1 -1
- package/dist/esm/components/tab-nav.props.js +1 -1
- package/dist/esm/components/table.js +1 -1
- package/dist/esm/components/table.props.js +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/tabs.props.js +1 -1
- package/dist/esm/components/text-area.js +1 -1
- package/dist/esm/components/text-area.props.js +1 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text-field.props.js +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.props.js +1 -1
- package/dist/esm/components/theme-panel.js +1 -1
- package/dist/esm/components/theme.js +1 -1
- package/dist/esm/components/theme.props.d.ts +1 -1
- package/dist/esm/components/theme.props.js +1 -1
- package/dist/esm/components/toggle-button.js +1 -1
- package/dist/esm/components/toggle-icon-button.js +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/tooltip.props.js +1 -1
- package/dist/esm/components/user-card.js +1 -1
- package/dist/esm/components/user-card.props.js +1 -1
- package/dist/esm/components/virtual-menu.d.ts.map +1 -1
- package/dist/esm/components/virtual-menu.js +1 -1
- package/dist/esm/components/visually-hidden.js +1 -1
- package/dist/esm/helpers/compile-prop-defs.js +1 -1
- package/dist/esm/helpers/extract-margin-props.js +1 -1
- package/dist/esm/helpers/extract-props.js +1 -1
- package/dist/esm/helpers/font-config.js +1 -1
- package/dist/esm/helpers/get-margin-styles.js +1 -1
- package/dist/esm/helpers/get-matching-gray-color.js +1 -1
- package/dist/esm/helpers/get-responsive-styles.js +1 -1
- package/dist/esm/helpers/get-subtree.js +1 -1
- package/dist/esm/helpers/has-own-property.js +1 -1
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/inert.js +1 -1
- package/dist/esm/helpers/is-responsive-object.js +1 -1
- package/dist/esm/helpers/map-prop-values.js +1 -1
- package/dist/esm/helpers/merge-styles.js +1 -1
- package/dist/esm/helpers/normalize-to-px.js +1 -1
- package/dist/esm/helpers/require-react-element.js +1 -1
- package/dist/esm/helpers/use-deprecation-warning.js +1 -1
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/use-body-pointer-events-cleanup.js +1 -1
- package/dist/esm/hooks/use-breakpoint.d.ts +4 -1
- package/dist/esm/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/esm/hooks/use-breakpoint.js +1 -1
- package/dist/esm/hooks/use-live-announcer.js +1 -1
- package/dist/esm/hooks/use-prop-synced-state.js +1 -1
- package/dist/esm/hooks/use-toggle-state.js +1 -1
- package/dist/esm/hooks/use-tooltip-wrapper.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/as-child.prop.js +1 -1
- package/dist/esm/props/color.prop.js +1 -1
- package/dist/esm/props/font-family.prop.js +1 -1
- package/dist/esm/props/gap.props.js +1 -1
- package/dist/esm/props/height.props.js +1 -1
- package/dist/esm/props/high-contrast.prop.js +1 -1
- package/dist/esm/props/index.js +1 -1
- package/dist/esm/props/layout.props.js +1 -1
- package/dist/esm/props/leading-trim.prop.js +1 -1
- package/dist/esm/props/margin.props.js +1 -1
- package/dist/esm/props/padding.props.js +1 -1
- package/dist/esm/props/prop-def.js +1 -1
- package/dist/esm/props/radius.prop.js +1 -1
- package/dist/esm/props/shadow.props.js +1 -1
- package/dist/esm/props/text-align.prop.js +1 -1
- package/dist/esm/props/text-wrap.prop.js +1 -1
- package/dist/esm/props/truncate.prop.js +1 -1
- package/dist/esm/props/weight.prop.js +1 -1
- package/dist/esm/props/width.props.js +1 -1
- package/fonts.css +2 -0
- package/package.json +36 -36
- package/schemas/base-button.json +66 -60
- package/schemas/button.json +80 -74
- package/schemas/icon-button.json +78 -72
- package/schemas/index.json +390 -360
- package/schemas/toggle-button.json +84 -78
- package/schemas/toggle-icon-button.json +82 -76
- package/src/components/_internal/base-menu.css +65 -140
- package/src/components/_internal/base-menu.utils.tsx +144 -0
- package/src/components/_internal/dropdown-menu-drill-down.tsx +281 -183
- package/src/components/_internal/menu-context.tsx +24 -15
- package/src/components/chatbar.css +94 -26
- package/src/components/chatbar.tsx +739 -735
- package/src/components/combobox.css +62 -115
- package/src/components/combobox.props.tsx +14 -0
- package/src/components/combobox.tsx +440 -212
- package/src/components/context-menu.props.tsx +4 -1
- package/src/components/context-menu.tsx +108 -62
- package/src/components/dropdown-menu.css +41 -121
- package/src/components/dropdown-menu.tsx +430 -275
- package/src/components/schemas/shell.schema.ts +11 -18
- package/src/components/scroll-area.css +2 -3
- package/src/components/theme.props.tsx +1 -1
- package/src/components/virtual-menu.tsx +12 -8
- package/src/hooks/use-breakpoint.ts +19 -3
- package/src/styles/fonts.css +6 -1
- package/src/styles/tokens/font-family.css +13 -5
- package/styles.css +307 -509
- package/tokens/base.css +1 -1
- package/tokens.css +1 -1
- package/dist/esm/chunk-3XT5P2HO.js +0 -2
- package/dist/esm/chunk-4XJY6FIK.js +0 -2
- package/dist/esm/chunk-4Z33XHOK.js +0 -2
- package/dist/esm/chunk-4Z33XHOK.js.map +0 -7
- package/dist/esm/chunk-E2Z5IA2P.js +0 -2
- package/dist/esm/chunk-E2Z5IA2P.js.map +0 -7
- package/dist/esm/chunk-HVWEPVBH.js +0 -2
- package/dist/esm/chunk-HVWEPVBH.js.map +0 -7
- package/dist/esm/chunk-KKBP2CRH.js +0 -2
- package/dist/esm/chunk-KKBP2CRH.js.map +0 -7
- package/dist/esm/chunk-MOR3NSXQ.js +0 -2
- package/dist/esm/chunk-MOR3NSXQ.js.map +0 -7
- package/dist/esm/chunk-QCNUTT4R.js +0 -2
- package/dist/esm/chunk-QCNUTT4R.js.map +0 -7
- package/dist/esm/chunk-UGD7Z3L4.js +0 -2
- package/dist/esm/chunk-UGD7Z3L4.js.map +0 -7
- package/dist/esm/chunk-YEB3H7QN.js +0 -2
- package/dist/esm/chunk-YEB3H7QN.js.map +0 -7
- package/dist/esm/chunk-ZY6SQWHT.js +0 -2
- package/dist/esm/chunk-ZY6SQWHT.js.map +0 -7
- /package/dist/esm/{chunk-P7HYVJSU.js.map → chunk-2TIADHPD.js.map} +0 -0
- /package/dist/esm/{chunk-RMKXWYOV.js.map → chunk-3OBXZUFJ.js.map} +0 -0
- /package/dist/esm/{chunk-S2HA3W3V.js.map → chunk-3R7XMRV5.js.map} +0 -0
- /package/dist/esm/{chunk-S56YSRHP.js.map → chunk-56TS6OKQ.js.map} +0 -0
- /package/dist/esm/{chunk-2FYJTSOP.js.map → chunk-5BYHEYO6.js.map} +0 -0
- /package/dist/esm/{chunk-B24BDVG2.js.map → chunk-5MNBQROW.js.map} +0 -0
- /package/dist/esm/{chunk-W7N7V5YD.js.map → chunk-7ESHXHHO.js.map} +0 -0
- /package/dist/esm/{chunk-CRWYCLTE.js.map → chunk-ABSKRHVM.js.map} +0 -0
- /package/dist/esm/{chunk-3MWWP4MW.js.map → chunk-BBJUB52V.js.map} +0 -0
- /package/dist/esm/{chunk-PTLFMWCN.js.map → chunk-CQNPBTM5.js.map} +0 -0
- /package/dist/esm/{chunk-GJSGKE7B.js.map → chunk-CTA5ODAO.js.map} +0 -0
- /package/dist/esm/{chunk-GWXVETMF.js.map → chunk-DCAZPMOB.js.map} +0 -0
- /package/dist/esm/{chunk-PLWXTEVE.js.map → chunk-DMJJM5IS.js.map} +0 -0
- /package/dist/esm/{chunk-A2RZGGMY.js.map → chunk-DQAUX5ZL.js.map} +0 -0
- /package/dist/esm/{chunk-YUP6EICB.js.map → chunk-DXL6V2A5.js.map} +0 -0
- /package/dist/esm/{chunk-XMRIRFM7.js.map → chunk-FG7XM7KJ.js.map} +0 -0
- /package/dist/esm/{chunk-IKSN4RNB.js.map → chunk-FIB3XATL.js.map} +0 -0
- /package/dist/esm/{chunk-374ZYJUP.js.map → chunk-HBR42MIX.js.map} +0 -0
- /package/dist/esm/{chunk-2UPAYDKR.js.map → chunk-HIKVMKYQ.js.map} +0 -0
- /package/dist/esm/{chunk-VX6ARMWP.js.map → chunk-HSAG7C53.js.map} +0 -0
- /package/dist/esm/{chunk-OSRJRBKP.js.map → chunk-HW324FK3.js.map} +0 -0
- /package/dist/esm/{chunk-DNHUQLXO.js.map → chunk-JBO5YOUM.js.map} +0 -0
- /package/dist/esm/{chunk-HF5WY5YE.js.map → chunk-JGLAE5G7.js.map} +0 -0
- /package/dist/esm/{chunk-4YFJWXL2.js.map → chunk-JJKQ7CGI.js.map} +0 -0
- /package/dist/esm/{chunk-CWRNW44F.js.map → chunk-L6PVH3RM.js.map} +0 -0
- /package/dist/esm/{chunk-MK2R6DAU.js.map → chunk-LAOMR7SE.js.map} +0 -0
- /package/dist/esm/{chunk-FHOCUZDR.js.map → chunk-NIQT45PJ.js.map} +0 -0
- /package/dist/esm/{chunk-3XT5P2HO.js.map → chunk-OS3FCYZY.js.map} +0 -0
- /package/dist/esm/{chunk-7QDTSBJF.js.map → chunk-OYF6YXH7.js.map} +0 -0
- /package/dist/esm/{chunk-WFMYNZXZ.js.map → chunk-P5OSU4NX.js.map} +0 -0
- /package/dist/esm/{chunk-QEOAXJLN.js.map → chunk-PTS6QYQW.js.map} +0 -0
- /package/dist/esm/{chunk-CVWCKOHO.js.map → chunk-RLPKKCBL.js.map} +0 -0
- /package/dist/esm/{chunk-LKAK5GXF.js.map → chunk-SPIU5JYC.js.map} +0 -0
- /package/dist/esm/{chunk-4AQTUBVP.js.map → chunk-T4UHUQFJ.js.map} +0 -0
- /package/dist/esm/{chunk-K6QZMNCD.js.map → chunk-TS623UPD.js.map} +0 -0
- /package/dist/esm/{chunk-YV2KYHGR.js.map → chunk-UBOOUDS4.js.map} +0 -0
- /package/dist/esm/{chunk-D6B7IMZU.js.map → chunk-UFI53QUC.js.map} +0 -0
- /package/dist/esm/{chunk-AU3D6F42.js.map → chunk-UIRSGVJG.js.map} +0 -0
- /package/dist/esm/{chunk-FXUUI6Z2.js.map → chunk-UUUZXUIP.js.map} +0 -0
- /package/dist/esm/{chunk-25WZA7ZU.js.map → chunk-VA4CTVQL.js.map} +0 -0
- /package/dist/esm/{chunk-TOLLPRMM.js.map → chunk-VNPNEJI6.js.map} +0 -0
- /package/dist/esm/{chunk-6IGTK4JE.js.map → chunk-YMUGKYGW.js.map} +0 -0
- /package/dist/esm/{chunk-M24UXMOQ.js.map → chunk-ZXZOH63L.js.map} +0 -0
package/tokens/base.css
CHANGED
|
@@ -1201,7 +1201,7 @@
|
|
|
1201
1201
|
--transition-spring-gpu: transform var(--motion-duration-small) var(--motion-spring-snappy), opacity var(--motion-duration-small) var(--motion-spring-snappy);
|
|
1202
1202
|
--transition-spring-gpu-fast: transform var(--motion-duration-micro) var(--motion-spring-snappy), opacity var(--motion-duration-micro) var(--motion-spring-snappy);
|
|
1203
1203
|
--font-body: var(--font-sans);
|
|
1204
|
-
--font-heading: var(--font-body);
|
|
1204
|
+
--font-heading: var(--font-display, var(--font-body));
|
|
1205
1205
|
--font-code: var(--font-mono);
|
|
1206
1206
|
--font-strong: var(--font-body);
|
|
1207
1207
|
--font-em: var(--font-serif);
|
package/tokens.css
CHANGED
|
@@ -4586,7 +4586,7 @@
|
|
|
4586
4586
|
--transition-spring-gpu: transform var(--motion-duration-small) var(--motion-spring-snappy), opacity var(--motion-duration-small) var(--motion-spring-snappy);
|
|
4587
4587
|
--transition-spring-gpu-fast: transform var(--motion-duration-micro) var(--motion-spring-snappy), opacity var(--motion-duration-micro) var(--motion-spring-snappy);
|
|
4588
4588
|
--font-body: var(--font-sans);
|
|
4589
|
-
--font-heading: var(--font-body);
|
|
4589
|
+
--font-heading: var(--font-display, var(--font-body));
|
|
4590
4590
|
--font-code: var(--font-mono);
|
|
4591
4591
|
--font-strong: var(--font-body);
|
|
4592
4592
|
--font-em: var(--font-serif);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-KFA53SVQ.js";import*as i from"react";var d=Object.entries(u),f=null,r=new Set,n=null;function a(){return f??(f=d.map(([t,e])=>[t,window.matchMedia(e)])),f}function s(){let t="initial";for(let[e,c]of a())c.matches&&(t=e);return t}function o(){let t=s();t!==n&&(n=t,r.forEach(e=>e()))}function p(t){if(typeof window>"u")return()=>{};if(r.size===0){n=s();for(let[,e]of a())typeof e.addEventListener=="function"?e.addEventListener("change",o):e.addListener?.(o)}return r.add(t),()=>{if(r.delete(t),!(r.size>0)){for(let[,e]of a())try{typeof e.removeEventListener=="function"?e.removeEventListener("change",o):e.removeListener?.(o)}catch{}n=null}}}function l(){return typeof window>"u"?"initial":(n??(n=s()),n)}function y(){return"initial"}var m=()=>!0,k=()=>!1;function h(){let t=i.useSyncExternalStore(p,l,y),e=i.useSyncExternalStore(p,m,k);return i.useMemo(()=>({breakpoint:t,ready:e}),[t,e])}export{h as a};
|
|
2
|
-
//# sourceMappingURL=chunk-4XJY6FIK.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-ERGJN7FJ.js";import{b as r}from"./chunk-KRJTW535.js";import{a as o}from"./chunk-HOHUDTTL.js";import{c as e}from"./chunk-66ZLZAAJ.js";var s=["1","2","3"],c={size:{type:"enum",className:"rt-r-size",values:s,default:"2",responsive:!0},...o},a=["classic","surface","soft","outline","ghost"],u={variant:{type:"enum",className:"rt-variant",values:a,default:"surface"},panelBackground:{type:"enum",className:"rt-panel-background",values:["solid","translucent"]},material:{type:"enum",values:["solid","translucent"]},error:{type:"boolean"},loading:{type:"boolean"},disabled:{type:"boolean"},readOnly:{type:"boolean"},...e,...r,width:t.width,placeholder:{type:"string"}},n=["solid","soft"],m={size:{type:"enum",className:"rt-r-size",values:s,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:n,default:"solid"},...e,...o};export{c as a,u as b,m as c};
|
|
2
|
-
//# sourceMappingURL=chunk-4Z33XHOK.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/combobox.props.tsx"],
|
|
4
|
-
"sourcesContent": ["import { colorPropDef } from '../props/color.prop.js';\nimport { highContrastPropDef } from '../props/high-contrast.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\nimport { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3'] as const;\n\n/**\n * Shared responsive sizing + high contrast support inherited by Combobox.Root.\n */\nconst comboboxRootPropDefs = {\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n ...highContrastPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n highContrast: PropDef<boolean>;\n};\n\nconst triggerVariants = ['classic', 'surface', 'soft', 'outline', 'ghost'] as const;\n\n/**\n * Token-aware props specific to Combobox.Trigger.\n */\nconst comboboxTriggerPropDefs = {\n variant: { type: 'enum', className: 'rt-variant', values: triggerVariants, default: 'surface' },\n panelBackground: {\n type: 'enum',\n className: 'rt-panel-background',\n values: ['solid', 'translucent'],\n },\n material: { type: 'enum', values: ['solid', 'translucent'] },\n error: { type: 'boolean' },\n loading: { type: 'boolean' },\n disabled: { type: 'boolean' },\n readOnly: { type: 'boolean' },\n ...colorPropDef,\n ...radiusPropDef,\n width: widthPropDefs.width,\n placeholder: { type: 'string' },\n} satisfies {\n variant: PropDef<(typeof triggerVariants)[number]>;\n panelBackground: PropDef<'solid' | 'translucent'>;\n material: PropDef<'solid' | 'translucent'>;\n error: PropDef<boolean>;\n loading: PropDef<boolean>;\n disabled: PropDef<boolean>;\n readOnly: PropDef<boolean>;\n width: PropDef<string>;\n placeholder: PropDef<string>;\n};\n\nconst contentVariants = ['solid', 'soft'] as const;\n\n/**\n * Styling props for the dropdown surface rendered by Combobox.Content.\n */\nconst comboboxContentPropDefs = {\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: contentVariants, default: 'solid' },\n ...colorPropDef,\n ...highContrastPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof contentVariants)[number]>;\n};\n\nexport { comboboxRootPropDefs, comboboxTriggerPropDefs, comboboxContentPropDefs };\n"],
|
|
5
|
-
"mappings": "gKAOA,IAAMA,EAAQ,CAAC,IAAK,IAAK,GAAG,EAKtBC,EAAuB,CAC3B,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQD,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,GAAGE,CACL,EAKMC,EAAkB,CAAC,UAAW,UAAW,OAAQ,UAAW,OAAO,EAKnEC,EAA0B,CAC9B,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQD,EAAiB,QAAS,SAAU,EAC9F,gBAAiB,CACf,KAAM,OACN,UAAW,sBACX,OAAQ,CAAC,QAAS,aAAa,CACjC,EACA,SAAU,CAAE,KAAM,OAAQ,OAAQ,CAAC,QAAS,aAAa,CAAE,EAC3D,MAAO,CAAE,KAAM,SAAU,EACzB,QAAS,CAAE,KAAM,SAAU,EAC3B,SAAU,CAAE,KAAM,SAAU,EAC5B,SAAU,CAAE,KAAM,SAAU,EAC5B,GAAGE,EACH,GAAGC,EACH,MAAOC,EAAc,MACrB,YAAa,CAAE,KAAM,QAAS,CAChC,EAYMC,EAAkB,CAAC,QAAS,MAAM,EAKlCC,EAA0B,CAC9B,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQT,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQQ,EAAiB,QAAS,OAAQ,EAC5F,GAAGH,EACH,GAAGH,CACL",
|
|
6
|
-
"names": ["sizes", "comboboxRootPropDefs", "highContrastPropDef", "triggerVariants", "comboboxTriggerPropDefs", "colorPropDef", "radiusPropDef", "widthPropDefs", "contentVariants", "comboboxContentPropDefs"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as C,c as z}from"./chunk-QCNUTT4R.js";import*as e from"react";import T from"classnames";import{useVirtualizer as _}from"@tanstack/react-virtual";var F=e.memo(function({label:r,isHighlighted:o,id:l,style:y,tabIndex:p,"data-highlighted":m,"data-index":x,onMouseEnter:f,onMouseLeave:v,onClick:h,onKeyDown:g}){return e.createElement("div",{id:l,role:"menuitem",className:T("rt-reset","rt-BaseMenuItem","rt-VirtualMenuItem"),style:y,tabIndex:p,"data-highlighted":m,"data-index":x,onMouseEnter:f,onMouseLeave:v,onClick:h,onKeyDown:g},r)},(n,r)=>!(n.label!==r.label||n["data-highlighted"]!==r["data-highlighted"]||n.style.height!==r.style.height||n.style.transform!==r.style.transform||n.tabIndex!==r.tabIndex||n.id!==r.id));function D({items:n,itemLabel:r,renderItem:o,size:l,estimatedItemSize:y,overscan:p=5,onSelect:m,className:x,style:f,"aria-label":v}){let h=e.useId(),g=e.useRef(null),[S,u]=e.useState(-1),{isInsideMenu:L,size:w}=C(),I=y??z[l??w??"2"];if(!r&&!o)throw new Error("VirtualMenu requires either itemLabel or renderItem prop");let K=e.useMemo(()=>r?typeof r=="function"?r:t=>t[r]:null,[r]),c=e.useMemo(()=>n.length===0||S<0?-1:Math.min(S,n.length-1),[S,n.length]),P=e.useMemo(()=>typeof I=="function"?I:()=>I,[I]),R=_({count:n.length,getScrollElement:()=>g.current,estimateSize:P,overscan:p}),$=R.getVirtualItems(),M=e.useRef(n),b=e.useRef(m);M.current=n,b.current=m;let d=e.useRef(R.scrollToIndex);d.current=R.scrollToIndex;let E=e.useRef(c);E.current=c;let A=e.useCallback(t=>{let s=t.currentTarget.dataset.index;s!=null&&u(Number(s))},[]),B=e.useCallback(t=>{let s=t.currentTarget.dataset.index;if(s!=null){let a=Number(s),i=M.current;a>=0&&a<i.length&&b.current?.(i[a],a)}},[]),j=e.useCallback(()=>{},[]),q=e.useCallback(t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();let s=t.currentTarget.dataset.index;if(s!=null){let a=Number(s),i=M.current;a>=0&&a<i.length&&b.current?.(i[a],a)}}},[]),O=e.useCallback(t=>{let s=M.current,a=E.current;switch(t.key){case"ArrowDown":{t.preventDefault();let i=a<s.length-1?a+1:0;u(i),d.current(i,{align:"auto"});break}case"ArrowUp":{t.preventDefault();let i=a>0?a-1:s.length-1;u(i),d.current(i,{align:"auto"});break}case"Home":{t.preventDefault(),u(0),d.current(0,{align:"start"});break}case"End":{t.preventDefault();let i=s.length-1;u(i),d.current(i,{align:"end"});break}case"Enter":case" ":{t.preventDefault(),a>=0&&a<s.length&&b.current?.(s[a],a);break}case"Tab":{t.preventDefault();break}case"Escape":{t.currentTarget.blur();break}}},[]),k=e.useCallback(t=>`${h}-item-${t}`,[h]),U=e.useMemo(()=>({overflow:"auto",position:"relative",...f}),[f]),V=R.getTotalSize(),W=e.useMemo(()=>({height:`${V}px`,width:"100%",position:"relative"}),[V]);return e.createElement("div",{ref:g,role:L?"group":"menu","aria-label":v,"aria-activedescendant":c>=0?k(c):void 0,tabIndex:0,onKeyDown:O,className:T("rt-VirtualMenuRoot",x),style:U},e.createElement("div",{className:"rt-VirtualMenuViewport",style:W},$.map(t=>{let s=n[t.index],a=t.index,i=c===a,Y={height:t.size,transform:`translateY(${t.start}px)`},H={id:k(a),isHighlighted:i,style:Y,tabIndex:i?0:-1,"data-highlighted":i?!0:void 0,"data-index":a,onMouseEnter:A,onMouseLeave:j,onClick:B,onKeyDown:q};return o?e.createElement(o,{key:t.key,item:s,index:a,...H}):e.createElement(F,{key:t.key,label:K(s),...H})})))}D.displayName="VirtualMenu";var N=e.forwardRef(({className:n,children:r,...o},l)=>e.createElement("div",{ref:l,role:"menuitem",className:T("rt-reset","rt-BaseMenuItem","rt-VirtualMenuItem",n),...o},r));N.displayName="VirtualMenu.Item";var G=e.memo(N,(n,r)=>{let o=n.style,l=r.style;return!(o?.height!==l?.height||o?.transform!==l?.transform||n["data-highlighted"]!==r["data-highlighted"]||n.tabIndex!==r.tabIndex||n.id!==r.id||n.className!==r.className||n.children!==r.children)}),ee=Object.assign(D,{Item:G});export{ee as a};
|
|
2
|
-
//# sourceMappingURL=chunk-E2Z5IA2P.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/virtual-menu.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport { useMenuContext, menuSizeToItemHeight } from './_internal/menu-context.js';\n\n/**\n * VirtualMenu - A virtualized menu component for rendering large lists efficiently.\n *\n * Uses TanStack Virtual to render only visible items.\n * Works inside any container (DropdownMenu.Content, Popover.Content, etc.)\n *\n * @example\n * // Simple usage with itemLabel\n * <VirtualMenu\n * items={items}\n * itemLabel={(item) => item.name}\n * onSelect={handleSelect}\n * />\n *\n * @example\n * // Custom rendering with renderItem\n * const UserItem = React.memo(({ item, ...props }) => (\n * <VirtualMenu.Item {...props}>\n * <Avatar src={item.avatar} />\n * {item.name}\n * </VirtualMenu.Item>\n * ));\n *\n * <VirtualMenu items={users} renderItem={UserItem} onSelect={handleSelect} />\n */\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/** Props passed to custom renderItem components */\ninterface VirtualMenuRenderItemProps<T> {\n /** The item data */\n item: T;\n /** Index in the items array */\n index: number;\n /** Whether this item is currently highlighted */\n isHighlighted: boolean;\n /** Unique ID for accessibility */\n id: string;\n /** Positioning styles - must be applied */\n style: React.CSSProperties;\n /** Tab index for focus management */\n tabIndex: number;\n /** Data attribute for CSS styling */\n 'data-highlighted': true | undefined;\n /** Data attribute for event delegation */\n 'data-index': number;\n /** Mouse enter handler */\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => void;\n /** Mouse leave handler */\n onMouseLeave: () => void;\n /** Click handler */\n onClick: (e: React.MouseEvent<HTMLElement>) => void;\n /** Keyboard handler for Enter/Space activation */\n onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;\n}\n\ninterface VirtualMenuProps<T> {\n /** Array of items to render */\n items: T[];\n /**\n * Simple label accessor for basic text items.\n * Can be a property key or a function.\n * @example\n * itemLabel=\"name\"\n * itemLabel={(item) => item.name}\n */\n itemLabel?: keyof T | ((item: T) => React.ReactNode);\n /**\n * Custom component for rendering items.\n * Must be memoized (React.memo) for optimal performance.\n * @example\n * const MyItem = React.memo(({ item, ...props }) => (\n * <VirtualMenu.Item {...props}>{item.name}</VirtualMenu.Item>\n * ));\n * <VirtualMenu items={items} renderItem={MyItem} />\n */\n renderItem?: React.ComponentType<VirtualMenuRenderItemProps<T>>;\n /**\n * Menu size - controls item height.\n * Automatically inherited from parent DropdownMenu.Content/ContextMenu.Content.\n * Only set manually when using VirtualMenu outside of a menu context.\n * @default '2' (or inherited from context)\n */\n size?: '1' | '2';\n /**\n * Estimated height of each item in pixels.\n * Can be a number (same for all) or a function (per-item).\n * Usually not needed - height is automatically derived from size prop/context.\n * Use this only for custom item heights (e.g., variable height items).\n */\n estimatedItemSize?: number | ((index: number) => number);\n /** Number of items to render outside visible area */\n overscan?: number;\n /** Callback when an item is selected */\n onSelect?: (item: T, index: number) => void;\n /** Additional class name */\n className?: string;\n /** Additional styles */\n style?: React.CSSProperties;\n /** Accessible label for the menu */\n 'aria-label'?: string;\n}\n\n// ============================================================================\n// Internal Memoized Item Component\n// ============================================================================\n\ninterface SimpleItemProps {\n label: React.ReactNode;\n isHighlighted: boolean;\n id: string;\n style: React.CSSProperties;\n tabIndex: number;\n 'data-highlighted': true | undefined;\n 'data-index': number;\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => void;\n onMouseLeave: () => void;\n onClick: (e: React.MouseEvent<HTMLElement>) => void;\n onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;\n}\n\nconst SimpleItem = React.memo(\n function SimpleItem({\n label,\n isHighlighted: _isHighlighted,\n id,\n style,\n tabIndex,\n 'data-highlighted': dataHighlighted,\n 'data-index': dataIndex,\n onMouseEnter,\n onMouseLeave,\n onClick,\n onKeyDown,\n }: SimpleItemProps) {\n return (\n <div\n id={id}\n role=\"menuitem\"\n className={classNames('rt-reset', 'rt-BaseMenuItem', 'rt-VirtualMenuItem')}\n style={style}\n tabIndex={tabIndex}\n data-highlighted={dataHighlighted}\n data-index={dataIndex}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onClick={onClick}\n onKeyDown={onKeyDown}\n >\n {label}\n </div>\n );\n },\n (prev, next) => {\n // Custom comparison - only re-render if these change\n if (prev.label !== next.label) return false;\n if (prev['data-highlighted'] !== next['data-highlighted']) return false;\n if (prev.style.height !== next.style.height) return false;\n if (prev.style.transform !== next.style.transform) return false;\n if (prev.tabIndex !== next.tabIndex) return false;\n if (prev.id !== next.id) return false;\n // Event handlers are stable, skip comparison\n return true;\n },\n);\n\n// ============================================================================\n// VirtualMenu Component\n// ============================================================================\n\nfunction VirtualMenuRoot<T>({\n items,\n itemLabel,\n renderItem: RenderItem,\n size: sizeProp,\n estimatedItemSize: estimatedItemSizeProp,\n overscan = 5,\n onSelect,\n className,\n style,\n 'aria-label': ariaLabel,\n}: VirtualMenuProps<T>) {\n const menuId = React.useId();\n const parentRef = React.useRef<HTMLDivElement>(null);\n const [highlightedIndex, setHighlightedIndex] = React.useState<number>(-1);\n const { isInsideMenu, size: contextSize } = useMenuContext();\n\n // Resolve size: prop > context > default '2'\n const resolvedSize = sizeProp ?? contextSize ?? '2';\n \n // Resolve item height: explicit prop > derived from size\n const estimatedItemSize = estimatedItemSizeProp ?? menuSizeToItemHeight[resolvedSize];\n\n // Validate props\n if (!itemLabel && !RenderItem) {\n throw new Error('VirtualMenu requires either itemLabel or renderItem prop');\n }\n\n // Normalize itemLabel to a function\n const getLabel = React.useMemo(() => {\n if (!itemLabel) return null;\n if (typeof itemLabel === 'function') return itemLabel;\n return (item: T) => item[itemLabel] as React.ReactNode;\n }, [itemLabel]);\n\n // Derive safe highlighted index\n const safeHighlightedIndex = React.useMemo(() => {\n if (items.length === 0) return -1;\n if (highlightedIndex < 0) return -1;\n return Math.min(highlightedIndex, items.length - 1);\n }, [highlightedIndex, items.length]);\n\n // Normalize estimatedItemSize to a function\n const getItemSize = React.useMemo(\n () =>\n typeof estimatedItemSize === 'function'\n ? estimatedItemSize\n : () => estimatedItemSize,\n [estimatedItemSize],\n );\n\n const virtualizer = useVirtualizer({\n count: items.length,\n getScrollElement: () => parentRef.current,\n estimateSize: getItemSize,\n overscan,\n });\n\n const virtualItems = virtualizer.getVirtualItems();\n\n // Refs for stable handler references\n const itemsRef = React.useRef(items);\n const onSelectRef = React.useRef(onSelect);\n itemsRef.current = items;\n onSelectRef.current = onSelect;\n\n const scrollToIndexRef = React.useRef(virtualizer.scrollToIndex);\n scrollToIndexRef.current = virtualizer.scrollToIndex;\n\n const highlightedIndexRef = React.useRef(safeHighlightedIndex);\n highlightedIndexRef.current = safeHighlightedIndex;\n\n // Stable event handlers\n const handleItemMouseEnter = React.useCallback((e: React.MouseEvent<HTMLElement>) => {\n const index = e.currentTarget.dataset.index;\n if (index != null) {\n setHighlightedIndex(Number(index));\n }\n }, []);\n\n const handleItemClick = React.useCallback((e: React.MouseEvent<HTMLElement>) => {\n const index = e.currentTarget.dataset.index;\n if (index != null) {\n const idx = Number(index);\n const currentItems = itemsRef.current;\n if (idx >= 0 && idx < currentItems.length) {\n onSelectRef.current?.(currentItems[idx], idx);\n }\n }\n }, []);\n\n const noop = React.useCallback(() => {}, []);\n\n // Item-level keyboard handler for Enter/Space activation (satisfies a11y lint rule)\n const handleItemKeyDown = React.useCallback((e: React.KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n const index = e.currentTarget.dataset.index;\n if (index != null) {\n const idx = Number(index);\n const currentItems = itemsRef.current;\n if (idx >= 0 && idx < currentItems.length) {\n onSelectRef.current?.(currentItems[idx], idx);\n }\n }\n }\n }, []);\n\n // Keyboard navigation\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent) => {\n const currentItems = itemsRef.current;\n const currentHighlightedIndex = highlightedIndexRef.current;\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault();\n const nextIndex =\n currentHighlightedIndex < currentItems.length - 1 ? currentHighlightedIndex + 1 : 0;\n setHighlightedIndex(nextIndex);\n scrollToIndexRef.current(nextIndex, { align: 'auto' });\n break;\n }\n case 'ArrowUp': {\n e.preventDefault();\n const prevIndex =\n currentHighlightedIndex > 0 ? currentHighlightedIndex - 1 : currentItems.length - 1;\n setHighlightedIndex(prevIndex);\n scrollToIndexRef.current(prevIndex, { align: 'auto' });\n break;\n }\n case 'Home': {\n e.preventDefault();\n setHighlightedIndex(0);\n scrollToIndexRef.current(0, { align: 'start' });\n break;\n }\n case 'End': {\n e.preventDefault();\n const lastIndex = currentItems.length - 1;\n setHighlightedIndex(lastIndex);\n scrollToIndexRef.current(lastIndex, { align: 'end' });\n break;\n }\n case 'Enter':\n case ' ': {\n e.preventDefault();\n if (currentHighlightedIndex >= 0 && currentHighlightedIndex < currentItems.length) {\n onSelectRef.current?.(currentItems[currentHighlightedIndex], currentHighlightedIndex);\n }\n break;\n }\n case 'Tab': {\n e.preventDefault();\n break;\n }\n case 'Escape': {\n (e.currentTarget as HTMLElement).blur();\n break;\n }\n }\n }, []);\n\n // Item ID generator\n const getItemId = React.useCallback(\n (index: number) => `${menuId}-item-${index}`,\n [menuId],\n );\n\n // Memoize styles\n const rootStyle = React.useMemo(\n () => ({\n overflow: 'auto' as const,\n position: 'relative' as const,\n ...style,\n }),\n [style],\n );\n\n const totalSize = virtualizer.getTotalSize();\n const viewportStyle = React.useMemo(\n () => ({\n height: `${totalSize}px`,\n width: '100%' as const,\n position: 'relative' as const,\n }),\n [totalSize],\n );\n\n return (\n <div\n ref={parentRef}\n role={isInsideMenu ? 'group' : 'menu'}\n aria-label={ariaLabel}\n aria-activedescendant={safeHighlightedIndex >= 0 ? getItemId(safeHighlightedIndex) : undefined}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n className={classNames('rt-VirtualMenuRoot', className)}\n style={rootStyle}\n >\n <div className=\"rt-VirtualMenuViewport\" style={viewportStyle}>\n {virtualItems.map((virtualRow) => {\n const item = items[virtualRow.index];\n const index = virtualRow.index;\n const isHighlighted = safeHighlightedIndex === index;\n\n const itemStyle: React.CSSProperties = {\n height: virtualRow.size,\n transform: `translateY(${virtualRow.start}px)`,\n };\n\n const commonProps = {\n id: getItemId(index),\n isHighlighted,\n style: itemStyle,\n tabIndex: isHighlighted ? 0 : -1,\n 'data-highlighted': isHighlighted ? true as const : undefined,\n 'data-index': index,\n onMouseEnter: handleItemMouseEnter,\n onMouseLeave: noop,\n onClick: handleItemClick,\n onKeyDown: handleItemKeyDown,\n };\n\n // Use renderItem if provided, otherwise use SimpleItem with itemLabel\n if (RenderItem) {\n return (\n <RenderItem\n key={virtualRow.key}\n item={item}\n index={index}\n {...commonProps}\n />\n );\n }\n\n return (\n <SimpleItem\n key={virtualRow.key}\n label={getLabel!(item)}\n {...commonProps}\n />\n );\n })}\n </div>\n </div>\n );\n}\n\nVirtualMenuRoot.displayName = 'VirtualMenu';\n\n// ============================================================================\n// VirtualMenu.Item Component (for custom renderItem usage)\n// ============================================================================\n\ninterface VirtualMenuItemProps extends React.ComponentPropsWithoutRef<'div'> {\n children: React.ReactNode;\n /** Data attribute for highlight styling */\n 'data-highlighted'?: true | undefined;\n /** Data attribute for event delegation */\n 'data-index'?: number;\n}\n\nconst VirtualMenuItemInner = React.forwardRef<HTMLDivElement, VirtualMenuItemProps>(\n ({ className, children, ...props }, forwardedRef) => {\n return (\n <div\n ref={forwardedRef}\n role=\"menuitem\"\n className={classNames('rt-reset', 'rt-BaseMenuItem', 'rt-VirtualMenuItem', className)}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nVirtualMenuItemInner.displayName = 'VirtualMenu.Item';\n\n// Memoized with custom comparison\nconst VirtualMenuItem = React.memo(VirtualMenuItemInner, (prevProps, nextProps) => {\n const prevStyle = prevProps.style as React.CSSProperties | undefined;\n const nextStyle = nextProps.style as React.CSSProperties | undefined;\n if (prevStyle?.height !== nextStyle?.height) return false;\n if (prevStyle?.transform !== nextStyle?.transform) return false;\n if (prevProps['data-highlighted'] !== nextProps['data-highlighted']) return false;\n if (prevProps.tabIndex !== nextProps.tabIndex) return false;\n if (prevProps.id !== nextProps.id) return false;\n if (prevProps.className !== nextProps.className) return false;\n if (prevProps.children !== nextProps.children) return false;\n return true;\n});\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst VirtualMenu = Object.assign(VirtualMenuRoot, {\n Item: VirtualMenuItem,\n});\n\nexport { VirtualMenu };\nexport type { VirtualMenuProps, VirtualMenuItemProps, VirtualMenuRenderItemProps };\n"],
|
|
5
|
-
"mappings": "+CAEA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,kBAAAC,MAAsB,0BA8H/B,IAAMC,EAAmB,OACvB,SAAoB,CAClB,MAAAC,EACA,cAAeC,EACf,GAAAC,EACA,MAAAC,EACA,SAAAC,EACA,mBAAoBC,EACpB,aAAcC,EACd,aAAAC,EACA,aAAAC,EACA,QAAAC,EACA,UAAAC,CACF,EAAoB,CAClB,OACE,gBAAC,OACC,GAAIR,EACJ,KAAK,WACL,UAAWS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AAcC,GAAW,WACpCH,EAAU,kBAAkB,IAAMC,EAAU,kBAAkB,GAC9DD,EAAU,WAAaC,EAAU,UACjCD,EAAU,KAAOC,EAAU,IAC3BD,EAAU,YAAcC,EAAU,WAClCD,EAAU,WAAaC,EAAU,SAEvC,CAAC,EAMKG,GAAc,OAAO,OAAO5D,EAAiB,CACjD,KAAMuD,CACR,CAAC",
|
|
6
|
-
"names": ["React", "classNames", "useVirtualizer", "SimpleItem", "label", "_isHighlighted", "id", "style", "tabIndex", "dataHighlighted", "dataIndex", "onMouseEnter", "onMouseLeave", "onClick", "onKeyDown", "classNames", "prev", "next", "VirtualMenuRoot", "items", "itemLabel", "RenderItem", "sizeProp", "estimatedItemSizeProp", "overscan", "onSelect", "className", "ariaLabel", "menuId", "parentRef", "highlightedIndex", "setHighlightedIndex", "isInsideMenu", "contextSize", "useMenuContext", "estimatedItemSize", "menuSizeToItemHeight", "getLabel", "item", "safeHighlightedIndex", "getItemSize", "virtualizer", "useVirtualizer", "virtualItems", "itemsRef", "onSelectRef", "scrollToIndexRef", "highlightedIndexRef", "handleItemMouseEnter", "e", "index", "handleItemClick", "idx", "currentItems", "noop", "handleItemKeyDown", "handleKeyDown", "currentHighlightedIndex", "nextIndex", "prevIndex", "lastIndex", "getItemId", "rootStyle", "totalSize", "viewportStyle", "virtualRow", "isHighlighted", "itemStyle", "commonProps", "VirtualMenuItemInner", "children", "props", "forwardedRef", "VirtualMenuItem", "prevProps", "nextProps", "prevStyle", "nextStyle", "VirtualMenu"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{z as e}from"zod";var o=e.enum(["expanded","collapsed"]).describe("Pane state mode"),t=e.enum(["collapsed","thin","expanded"]).describe("Sidebar state mode"),r=e.enum(["fixed","overlay","stacked"]).describe("Presentation mode"),u=e.enum(["initial","xs","sm","md","lg","xl"]).describe("Responsive breakpoint"),s=e.enum(["left","rail","panel","sidebar","inspector","bottom"]).describe("Pane target"),p=e.enum(["toggle","expand","collapse"]).describe("Trigger action"),a=e.union([o,e.object({initial:o.optional(),xs:o.optional(),sm:o.optional(),md:o.optional(),lg:o.optional(),xl:o.optional()})]).describe("Responsive pane mode configuration"),c=e.union([t,e.object({initial:t.optional(),xs:t.optional(),sm:t.optional(),md:t.optional(),lg:t.optional(),xl:t.optional()})]).describe("Responsive sidebar mode configuration"),i=e.union([r,e.object({initial:r.optional(),xs:r.optional(),sm:r.optional(),md:r.optional(),lg:r.optional(),xl:r.optional()})]).describe("Responsive presentation configuration"),d=e.object({load:e.function().returns(e.union([e.number(),e.promise(e.number()),e.undefined()])).optional(),save:e.function().args(e.number()).returns(e.union([e.void(),e.promise(e.void())])).optional()}).describe("Size persistence adapter"),l=e.object({presentation:i.optional(),mode:o.optional(),defaultMode:a.optional(),onModeChange:e.function().args(o).returns(e.void()).optional(),expandedSize:e.number().optional(),minSize:e.number().optional(),maxSize:e.number().optional(),resizable:e.boolean().optional(),collapsible:e.boolean().optional(),onExpand:e.function().returns(e.void()).optional(),onCollapse:e.function().returns(e.void()).optional(),onResize:e.function().args(e.number()).returns(e.void()).optional(),resizer:e.any().optional(),onResizeStart:e.function().args(e.number()).returns(e.void()).optional(),onResizeEnd:e.function().args(e.number()).returns(e.void()).optional(),snapPoints:e.array(e.number()).optional(),snapTolerance:e.number().optional(),collapseThreshold:e.number().optional(),paneId:e.string().optional(),persistence:d.optional(),className:e.string().optional(),style:e.record(e.string(),e.union([e.string(),e.number()])).optional(),children:e.any().optional()}).strict(),m=e.object({height:e.union([e.literal("full"),e.literal("auto"),e.string(),e.number()]).default("full").describe("Height of the shell container"),className:e.string().optional().describe("Additional CSS class name"),style:e.record(e.string(),e.union([e.string(),e.number()])).optional().describe("Inline styles"),children:e.any().optional().describe("Shell components")}).strict(),b=e.object({height:e.union([e.string(),e.number()]).default(64).describe("Height of the header"),className:e.string().optional().describe("Additional CSS class name"),style:e.record(e.string(),e.union([e.string(),e.number()])).optional().describe("Inline styles"),children:e.any().optional().describe("Header content")}).strict(),S=e.object({presentation:i.optional(),mode:o.optional(),defaultMode:a.optional(),onModeChange:e.function().args(o).returns(e.void()).optional(),expandedSize:e.number().default(64).describe("Default width in pixels"),collapsible:e.boolean().optional(),onExpand:e.function().returns(e.void()).optional(),onCollapse:e.function().returns(e.void()).optional(),className:e.string().optional().describe("Additional CSS class name"),style:e.record(e.string(),e.union([e.string(),e.number()])).optional().describe("Inline styles"),children:e.any().optional().describe("Rail content")}).strict(),f=l.extend({expandedSize:e.number().default(288).describe("Default width in pixels"),minSize:e.number().default(200).describe("Minimum width when resizing"),maxSize:e.number().default(800).describe("Maximum width when resizing"),resizable:e.boolean().default(!1).describe("Whether the panel can be resized"),collapsible:e.boolean().default(!0).describe("Whether the panel can be collapsed via resize handle")}).strict(),g=l.extend({mode:t.optional(),defaultMode:c.default("expanded").describe("Initial sidebar mode"),expandedSize:e.number().default(288).describe("Default width in pixels"),minSize:e.number().default(200).describe("Minimum width when resizing"),maxSize:e.number().default(400).describe("Maximum width when resizing"),thinSize:e.number().default(64).describe("Width in thin mode"),toggleModes:e.enum(["both","single"]).optional().describe("Available modes in toggle sequence"),resizable:e.boolean().default(!1).describe("Whether the sidebar can be resized"),collapsible:e.boolean().default(!0).describe("Whether the sidebar can be collapsed via resize handle")}).strict(),x=e.object({className:e.string().optional().describe("Additional CSS class name"),style:e.record(e.string(),e.union([e.string(),e.number()])).optional().describe("Inline styles"),children:e.any().optional().describe("Main content")}).strict(),P=l.extend({presentation:i.default({initial:"overlay",lg:"fixed"}).describe("Presentation mode"),expandedSize:e.number().default(320).describe("Default width in pixels"),minSize:e.number().default(200).describe("Minimum width when resizing"),maxSize:e.number().default(500).describe("Maximum width when resizing"),resizable:e.boolean().default(!1).describe("Whether the inspector can be resized"),collapsible:e.boolean().default(!0).describe("Whether the inspector can be collapsed via resize handle")}).strict(),y=l.extend({presentation:i.default("fixed").describe("Presentation mode"),expandedSize:e.number().default(200).describe("Default height in pixels"),minSize:e.number().default(100).describe("Minimum height when resizing"),maxSize:e.number().default(400).describe("Maximum height when resizing"),resizable:e.boolean().default(!1).describe("Whether the bottom panel can be resized"),collapsible:e.boolean().default(!0).describe("Whether the bottom panel can be collapsed via resize handle")}).strict(),z=e.object({target:s.describe("Which pane to control"),action:p.default("toggle").describe("Action to perform"),peekOnHover:e.boolean().default(!1).describe("Whether to show peek preview on hover when collapsed"),className:e.string().optional().describe("Additional CSS class name"),style:e.record(e.string(),e.union([e.string(),e.number()])).optional().describe("Inline styles"),children:e.any().optional().describe("Trigger content"),onClick:e.function().optional().describe("Click handler"),onMouseEnter:e.function().optional().describe("Mouse enter handler"),onMouseLeave:e.function().optional().describe("Mouse leave handler"),"aria-label":e.string().optional().describe("ARIA label for accessibility"),"aria-labelledby":e.string().optional().describe("ARIA labelled by reference"),"aria-describedby":e.string().optional().describe("ARIA described by reference")}).strict(),v=e.object({className:e.string().optional().describe("Additional CSS class name"),style:e.record(e.string(),e.union([e.string(),e.number()])).optional().describe("Inline styles"),children:e.any().optional().describe("Handle content")}).strict();function R(n){return n}function w(n){return n}function M(n){return n}function N(n){return n}function E(n){return n}function k(n){return n}function C(n){return n}function H(n){return n}function I(n){return n}function A(n){return n}export{m as a,b,S as c,f as d,g as e,x as f,P as g,y as h,z as i,v as j,R as k,w as l,M as m,N as n,E as o,k as p,C as q,H as r,I as s,A as t};
|
|
2
|
-
//# sourceMappingURL=chunk-HVWEPVBH.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/schemas/shell.schema.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod';\n\n/**\n * Shell Zod schema - Single source of truth for Shell component props\n *\n * The Shell component is a layout engine that provides structural patterns for building\n * application interfaces. It manages layout state, composition rules, and responsive\n * behavior across seven core slots.\n *\n * @example\n * ```tsx\n * // Basic shell validation\n * const props = ShellRootSchema.parse({ height: 'full' });\n *\n * // Shell with responsive sidebar\n * const sidebarProps = ShellSidebarSchema.parse({\n * defaultMode: { initial: 'collapsed', md: 'expanded' },\n * presentation: { initial: 'overlay', lg: 'fixed' }\n * });\n * ```\n */\n\n// Common types\nconst PaneModeSchema = z.enum(['expanded', 'collapsed']).describe('Pane state mode');\nconst SidebarModeSchema = z.enum(['collapsed', 'thin', 'expanded']).describe('Sidebar state mode');\nconst PresentationValueSchema = z.enum(['fixed', 'overlay', 'stacked']).describe('Presentation mode');\nconst _BreakpointSchema = z.enum(['initial', 'xs', 'sm', 'md', 'lg', 'xl']).describe('Responsive breakpoint');\nconst PaneTargetSchema = z.enum(['left', 'rail', 'panel', 'sidebar', 'inspector', 'bottom']).describe('Pane target');\nconst TriggerActionSchema = z.enum(['toggle', 'expand', 'collapse']).describe('Trigger action');\n\n// Responsive schemas\nconst ResponsiveModeSchema = z\n .union([\n PaneModeSchema,\n z.object({\n initial: PaneModeSchema.optional(),\n xs: PaneModeSchema.optional(),\n sm: PaneModeSchema.optional(),\n md: PaneModeSchema.optional(),\n lg: PaneModeSchema.optional(),\n xl: PaneModeSchema.optional(),\n }),\n ])\n .describe('Responsive pane mode configuration');\n\nconst ResponsiveSidebarModeSchema = z\n .union([\n SidebarModeSchema,\n z.object({\n initial: SidebarModeSchema.optional(),\n xs: SidebarModeSchema.optional(),\n sm: SidebarModeSchema.optional(),\n md: SidebarModeSchema.optional(),\n lg: SidebarModeSchema.optional(),\n xl: SidebarModeSchema.optional(),\n }),\n ])\n .describe('Responsive sidebar mode configuration');\n\nconst ResponsivePresentationSchema = z\n .union([\n PresentationValueSchema,\n z.object({\n initial: PresentationValueSchema.optional(),\n xs: PresentationValueSchema.optional(),\n sm: PresentationValueSchema.optional(),\n md: PresentationValueSchema.optional(),\n lg: PresentationValueSchema.optional(),\n xl: PresentationValueSchema.optional(),\n }),\n ])\n .describe('Responsive presentation configuration');\n\n// Size persistence adapter\nconst PaneSizePersistenceSchema = z\n .object({\n load: z\n .function()\n .returns(z.union([z.number(), z.promise(z.number()), z.undefined()]))\n .optional(),\n save: z\n .function()\n .args(z.number())\n .returns(z.union([z.void(), z.promise(z.void())]))\n .optional(),\n })\n .describe('Size persistence adapter');\n\n// Common pane props\nconst PanePropsSchema = z\n .object({\n presentation: ResponsivePresentationSchema.optional(),\n mode: PaneModeSchema.optional(),\n defaultMode: ResponsiveModeSchema.optional(),\n onModeChange: z.function().args(PaneModeSchema).returns(z.void()).optional(),\n expandedSize: z.number().optional(),\n minSize: z.number().optional(),\n maxSize: z.number().optional(),\n resizable: z.boolean().optional(),\n collapsible: z.boolean().optional(),\n onExpand: z.function().returns(z.void()).optional(),\n onCollapse: z.function().returns(z.void()).optional(),\n onResize: z.function().args(z.number()).returns(z.void()).optional(),\n resizer: z.any().optional(),\n onResizeStart: z.function().args(z.number()).returns(z.void()).optional(),\n onResizeEnd: z.function().args(z.number()).returns(z.void()).optional(),\n snapPoints: z.array(z.number()).optional(),\n snapTolerance: z.number().optional(),\n collapseThreshold: z.number().optional(),\n paneId: z.string().optional(),\n persistence: PaneSizePersistenceSchema.optional(),\n className: z.string().optional(),\n style: z.record(z.string(), z.union([z.string(), z.number()])).optional(),\n children: z.any().optional(),\n })\n .strict();\n\n/**\n * Shell.Root component schema\n */\nexport const ShellRootSchema = z\n .object({\n height: z\n .union([z.literal('full'), z.literal('auto'), z.string(), z.number()])\n .default('full')\n .describe('Height of the shell container'),\n className: z.string().optional().describe('Additional CSS class name'),\n style: z\n .record(z.string(), z.union([z.string(), z.number()]))\n .optional()\n .describe('Inline styles'),\n children: z.any().optional().describe('Shell components'),\n })\n .strict();\n\n/**\n * Shell.Header component schema\n */\nexport const ShellHeaderSchema = z\n .object({\n height: z.union([z.string(), z.number()]).default(64).describe('Height of the header'),\n className: z.string().optional().describe('Additional CSS class name'),\n style: z\n .record(z.string(), z.union([z.string(), z.number()]))\n .optional()\n .describe('Inline styles'),\n children: z.any().optional().describe('Header content'),\n })\n .strict();\n\n/**\n * Shell.Rail component schema\n */\nexport const ShellRailSchema = z\n .object({\n presentation: ResponsivePresentationSchema.optional(),\n mode: PaneModeSchema.optional(),\n defaultMode: ResponsiveModeSchema.optional(),\n onModeChange: z.function().args(PaneModeSchema).returns(z.void()).optional(),\n expandedSize: z.number().default(64).describe('Default width in pixels'),\n collapsible: z.boolean().optional(),\n onExpand: z.function().returns(z.void()).optional(),\n onCollapse: z.function().returns(z.void()).optional(),\n className: z.string().optional().describe('Additional CSS class name'),\n style: z\n .record(z.string(), z.union([z.string(), z.number()]))\n .optional()\n .describe('Inline styles'),\n children: z.any().optional().describe('Rail content'),\n })\n .strict();\n\n/**\n * Shell.Panel component schema\n */\nexport const ShellPanelSchema = PanePropsSchema.extend({\n expandedSize: z.number().default(288).describe('Default width in pixels'),\n minSize: z.number().default(200).describe('Minimum width when resizing'),\n maxSize: z.number().default(800).describe('Maximum width when resizing'),\n resizable: z.boolean().default(false).describe('Whether the panel can be resized'),\n collapsible: z.boolean().default(true).describe('Whether the panel can be collapsed via resize handle'),\n}).strict();\n\n/**\n * Shell.Sidebar component schema\n */\nexport const ShellSidebarSchema = PanePropsSchema.extend({\n mode: SidebarModeSchema.optional(),\n defaultMode: ResponsiveSidebarModeSchema.default('expanded').describe('Initial sidebar mode'),\n expandedSize: z.number().default(288).describe('Default width in pixels'),\n minSize: z.number().default(200).describe('Minimum width when resizing'),\n maxSize: z.number().default(400).describe('Maximum width when resizing'),\n thinSize: z.number().default(64).describe('Width in thin mode'),\n toggleModes: z.enum(['both', 'single']).optional().describe('Available modes in toggle sequence'),\n resizable: z.boolean().default(false).describe('Whether the sidebar can be resized'),\n collapsible: z.boolean().default(true).describe('Whether the sidebar can be collapsed via resize handle'),\n}).strict();\n\n/**\n * Shell.Content component schema\n */\nexport const ShellContentSchema = z\n .object({\n className: z.string().optional().describe('Additional CSS class name'),\n style: z\n .record(z.string(), z.union([z.string(), z.number()]))\n .optional()\n .describe('Inline styles'),\n children: z.any().optional().describe('Main content'),\n })\n .strict();\n\n/**\n * Shell.Inspector component schema\n */\nexport const ShellInspectorSchema = PanePropsSchema.extend({\n presentation: ResponsivePresentationSchema.default({ initial: 'overlay', lg: 'fixed' }).describe('Presentation mode'),\n expandedSize: z.number().default(320).describe('Default width in pixels'),\n minSize: z.number().default(200).describe('Minimum width when resizing'),\n maxSize: z.number().default(500).describe('Maximum width when resizing'),\n resizable: z.boolean().default(false).describe('Whether the inspector can be resized'),\n collapsible: z.boolean().default(true).describe('Whether the inspector can be collapsed via resize handle'),\n}).strict();\n\n/**\n * Shell.Bottom component schema\n */\nexport const ShellBottomSchema = PanePropsSchema.extend({\n presentation: ResponsivePresentationSchema.default('fixed').describe('Presentation mode'),\n expandedSize: z.number().default(200).describe('Default height in pixels'),\n minSize: z.number().default(100).describe('Minimum height when resizing'),\n maxSize: z.number().default(400).describe('Maximum height when resizing'),\n resizable: z.boolean().default(false).describe('Whether the bottom panel can be resized'),\n collapsible: z.boolean().default(true).describe('Whether the bottom panel can be collapsed via resize handle'),\n}).strict();\n\n/**\n * Shell.Trigger component schema\n */\nexport const ShellTriggerSchema = z\n .object({\n target: PaneTargetSchema.describe('Which pane to control'),\n action: TriggerActionSchema.default('toggle').describe('Action to perform'),\n peekOnHover: z.boolean().default(false).describe('Whether to show peek preview on hover when collapsed'),\n className: z.string().optional().describe('Additional CSS class name'),\n style: z\n .record(z.string(), z.union([z.string(), z.number()]))\n .optional()\n .describe('Inline styles'),\n children: z.any().optional().describe('Trigger content'),\n onClick: z.function().optional().describe('Click handler'),\n onMouseEnter: z.function().optional().describe('Mouse enter handler'),\n onMouseLeave: z.function().optional().describe('Mouse leave handler'),\n 'aria-label': z.string().optional().describe('ARIA label for accessibility'),\n 'aria-labelledby': z.string().optional().describe('ARIA labelled by reference'),\n 'aria-describedby': z.string().optional().describe('ARIA described by reference'),\n })\n .strict();\n\n/**\n * Shell.Handle component schema (for resize handles)\n */\nexport const ShellHandleSchema = z\n .object({\n className: z.string().optional().describe('Additional CSS class name'),\n style: z\n .record(z.string(), z.union([z.string(), z.number()]))\n .optional()\n .describe('Inline styles'),\n children: z.any().optional().describe('Handle content'),\n })\n .strict();\n\n// Type exports\nexport type ShellRootProps = z.infer<typeof ShellRootSchema>;\nexport type ShellHeaderProps = z.infer<typeof ShellHeaderSchema>;\nexport type ShellRailProps = z.infer<typeof ShellRailSchema>;\nexport type ShellPanelProps = z.infer<typeof ShellPanelSchema>;\nexport type ShellSidebarProps = z.infer<typeof ShellSidebarSchema>;\nexport type ShellContentProps = z.infer<typeof ShellContentSchema>;\nexport type ShellInspectorProps = z.infer<typeof ShellInspectorSchema>;\nexport type ShellBottomProps = z.infer<typeof ShellBottomSchema>;\nexport type ShellTriggerProps = z.infer<typeof ShellTriggerSchema>;\nexport type ShellHandleProps = z.infer<typeof ShellHandleSchema>;\n\n// Common type exports\nexport type PaneMode = z.infer<typeof PaneModeSchema>;\nexport type SidebarMode = z.infer<typeof SidebarModeSchema>;\nexport type PresentationValue = z.infer<typeof PresentationValueSchema>;\nexport type Breakpoint = z.infer<typeof _BreakpointSchema>;\nexport type PaneTarget = z.infer<typeof PaneTargetSchema>;\nexport type TriggerAction = z.infer<typeof TriggerActionSchema>;\nexport type ResponsiveMode = z.infer<typeof ResponsiveModeSchema>;\nexport type ResponsiveSidebarMode = z.infer<typeof ResponsiveSidebarModeSchema>;\nexport type ResponsivePresentation = z.infer<typeof ResponsivePresentationSchema>;\nexport type PaneSizePersistence = z.infer<typeof PaneSizePersistenceSchema>;\n\n/**\n * Development-only helper to validate and normalize Shell props\n * This function should only be used in development mode\n *\n * @param props - Props to validate and normalize\n * @returns Validated and normalized props\n *\n * @example\n * ```tsx\n * // In development, this will validate props and show helpful errors\n * const validatedProps = parseShellRootProps({ height: 'invalid' });\n * // Throws validation errors for invalid values\n * ```\n */\nexport function parseShellRootProps(props: unknown): ShellRootProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellRootSchema.parse(props);\n }\n return props as ShellRootProps;\n}\n\nexport function parseShellHeaderProps(props: unknown): ShellHeaderProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellHeaderSchema.parse(props);\n }\n return props as ShellHeaderProps;\n}\n\nexport function parseShellRailProps(props: unknown): ShellRailProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellRailSchema.parse(props);\n }\n return props as ShellRailProps;\n}\n\nexport function parseShellPanelProps(props: unknown): ShellPanelProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellPanelSchema.parse(props);\n }\n return props as ShellPanelProps;\n}\n\nexport function parseShellSidebarProps(props: unknown): ShellSidebarProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellSidebarSchema.parse(props);\n }\n return props as ShellSidebarProps;\n}\n\nexport function parseShellContentProps(props: unknown): ShellContentProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellContentSchema.parse(props);\n }\n return props as ShellContentProps;\n}\n\nexport function parseShellInspectorProps(props: unknown): ShellInspectorProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellInspectorSchema.parse(props);\n }\n return props as ShellInspectorProps;\n}\n\nexport function parseShellBottomProps(props: unknown): ShellBottomProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellBottomSchema.parse(props);\n }\n return props as ShellBottomProps;\n}\n\nexport function parseShellTriggerProps(props: unknown): ShellTriggerProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellTriggerSchema.parse(props);\n }\n return props as ShellTriggerProps;\n}\n\nexport function parseShellHandleProps(props: unknown): ShellHandleProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellHandleSchema.parse(props);\n }\n return props as ShellHandleProps;\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,KAAAA,MAAS,MAuBlB,IAAMC,EAAiBD,EAAE,KAAK,CAAC,WAAY,WAAW,CAAC,EAAE,SAAS,iBAAiB,EAC7EE,EAAoBF,EAAE,KAAK,CAAC,YAAa,OAAQ,UAAU,CAAC,EAAE,SAAS,oBAAoB,EAC3FG,EAA0BH,EAAE,KAAK,CAAC,QAAS,UAAW,SAAS,CAAC,EAAE,SAAS,mBAAmB,EAC9FI,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S,EAAE,SAAS,2BAA2B,EACrE,MAAOA,EACJ,OAAOA,EAAE,OAAO,EAAGA,EAAE,MAAM,CAACA,EAAE,OAAO,EAAGA,EAAE,OAAO,CAAC,CAAC,CAAC,EACpD,SAAS,EACT,SAAS,eAAe,EAC3B,SAAUA,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,gBAAgB,CACxD,CAAC,EACA,OAAO,EAwCH,SAASsB,EAAoBC,EAAgC,CAIlE,OAAOA,CACT,CAEO,SAASC,EAAsBD,EAAkC,CAItE,OAAOA,CACT,CAEO,SAASE,EAAoBF,EAAgC,CAIlE,OAAOA,CACT,CAEO,SAASG,EAAqBH,EAAiC,CAIpE,OAAOA,CACT,CAEO,SAASI,EAAuBJ,EAAmC,CAIxE,OAAOA,CACT,CAEO,SAASK,EAAuBL,EAAmC,CAIxE,OAAOA,CACT,CAEO,SAASM,EAAyBN,EAAqC,CAI5E,OAAOA,CACT,CAEO,SAASO,EAAsBP,EAAkC,CAItE,OAAOA,CACT,CAEO,SAASQ,EAAuBR,EAAmC,CAIxE,OAAOA,CACT,CAEO,SAASS,EAAsBT,EAAkC,CAItE,OAAOA,CACT",
|
|
6
|
-
"names": ["z", "PaneModeSchema", "SidebarModeSchema", "PresentationValueSchema", "_BreakpointSchema", "PaneTargetSchema", "TriggerActionSchema", "ResponsiveModeSchema", "ResponsiveSidebarModeSchema", "ResponsivePresentationSchema", "PaneSizePersistenceSchema", "PanePropsSchema", "ShellRootSchema", "ShellHeaderSchema", "ShellRailSchema", "ShellPanelSchema", "ShellSidebarSchema", "ShellContentSchema", "ShellInspectorSchema", "ShellBottomSchema", "ShellTriggerSchema", "ShellHandleSchema", "parseShellRootProps", "props", "parseShellHeaderProps", "parseShellRailProps", "parseShellPanelProps", "parseShellSidebarProps", "parseShellContentProps", "parseShellInspectorProps", "parseShellBottomProps", "parseShellTriggerProps", "parseShellHandleProps"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as T}from"./chunk-E67CIG6A.js";import{a as y}from"./chunk-GJSGKE7B.js";import{b as K,c as A,d as S,e as j,f as F}from"./chunk-IX5HIHVI.js";import{a as H}from"./chunk-MJJ7XDIP.js";import{b as V,c as h}from"./chunk-YUP6EICB.js";import{a as B}from"./chunk-5TXQLK4G.js";import{a as C}from"./chunk-6FLLFCBU.js";import{b as M,c as G,d as L,e as W,f as O}from"./chunk-HUKPWYG2.js";import{d as _,g as b,h as f,i as I,j as g}from"./chunk-ZY6SQWHT.js";import{a as z}from"./chunk-QCNUTT4R.js";import{a as pe}from"./chunk-3XT5P2HO.js";var me={};pe(me,{CheckboxItem:()=>oe,Content:()=>U,Group:()=>Z,Item:()=>Y,Label:()=>X,RadioGroup:()=>$,RadioItem:()=>ee,Root:()=>q,Separator:()=>x,Sub:()=>ne,SubContent:()=>te,SubTrigger:()=>re,Trigger:()=>J,TriggerIcon:()=>ae});import*as e from"react";import d from"classnames";import{DropdownMenu as u,Slot as ue}from"radix-ui";var q=n=>e.createElement(u.Root,{...n});q.displayName="DropdownMenu.Root";var J=e.forwardRef(({children:n,...o},r)=>e.createElement(u.Trigger,{...o,ref:r,asChild:!0},H(n)));J.displayName="DropdownMenu.Trigger";function de({children:n}){let o=f();return!o||o.behavior==="cascade"?e.createElement(e.Fragment,null,n):e.createElement("div",{className:"rt-DropdownMenuDrillDownRoot","data-drill-down-active":o.isRoot?void 0:!0,"data-animation-direction":o.animationDirection??void 0},n)}var Q=e.createContext({}),U=e.forwardRef((n,o)=>{let r=V();B(n.panelBackground);let a=n.material??n.panelBackground??r.panelBackground,t=e.useMemo(()=>({material:a,accentColor:r.accentColor}),[a,r.accentColor]),{size:s=M.size.default,variant:p=M.variant.default,highContrast:m=M.highContrast.default,material:i=t.material,submenuBehavior:l,virtualized:D=!1}=n,{className:w,children:c,color:P,container:N,forceMount:R,material:E,panelBackground:le,submenuBehavior:De,virtualized:we,...ie}=C(n,M),v=e.useMemo(()=>P||t.accentColor,[P,t.accentColor]),k=e.createElement(z,{size:s},e.createElement(Q.Provider,{value:e.useMemo(()=>({size:s,variant:p,color:v,highContrast:m,material:i}),[s,p,v,m,i])},e.createElement(_,{submenuBehavior:l},e.createElement(de,null,c))));return e.createElement(u.Portal,{container:N,forceMount:R},e.createElement(h,{asChild:!0},e.createElement(u.Content,{"data-accent-color":v,"data-material":i,"data-panel-background":i,align:"start",sideOffset:4,collisionPadding:10,...ie,asChild:!1,ref:o,className:d("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",w)},D?e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport","rt-virtualized")},k):e.createElement(y,{type:"auto"},e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport")},k)))))});U.displayName="DropdownMenu.Content";var X=e.forwardRef(({className:n,...o},r)=>e.createElement(u.Label,{...o,asChild:!1,ref:r,className:d("rt-BaseMenuLabel","rt-DropdownMenuLabel",n)}));X.displayName="DropdownMenu.Label";var Y=e.forwardRef((n,o)=>{let{className:r,children:a,color:t=L.color.default,shortcut:s,...p}=n;return e.createElement(u.Item,{"data-accent-color":t,...p,ref:o,className:d("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",r)},e.createElement(ue.Slottable,null,a),s&&e.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},e.createElement(T,{size:"1"},s)))});Y.displayName="DropdownMenu.Item";var Z=e.forwardRef(({className:n,...o},r)=>e.createElement(u.Group,{...o,asChild:!1,ref:r,className:d("rt-BaseMenuGroup","rt-DropdownMenuGroup",n)}));Z.displayName="DropdownMenu.Group";var $=e.forwardRef(({className:n,...o},r)=>e.createElement(u.RadioGroup,{...o,asChild:!1,ref:r,className:d("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",n)}));$.displayName="DropdownMenu.RadioGroup";var ee=e.forwardRef((n,o)=>{let{children:r,className:a,color:t=O.color.default,...s}=n;return e.createElement(u.RadioItem,{...s,asChild:!1,ref:o,"data-accent-color":t,className:d("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",a)},r,e.createElement(u.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},e.createElement(F,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});ee.displayName="DropdownMenu.RadioItem";var oe=e.forwardRef((n,o)=>{let{children:r,className:a,shortcut:t,color:s=W.color.default,...p}=n;return e.createElement(u.CheckboxItem,{...p,asChild:!1,ref:o,"data-accent-color":s,className:d("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",a)},r,e.createElement(u.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},e.createElement(K,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),t&&e.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},e.createElement(T,{size:"1"},t)))});oe.displayName="DropdownMenu.CheckboxItem";function se(){return e.useId()}var ne=({label:n="Back",...o})=>{let r=f(),a=se(),t=e.useMemo(()=>({id:a,label:n}),[a,n]);return r?.behavior==="drill-down"?e.createElement(I.Provider,{value:t},o.children):e.createElement(I.Provider,{value:t},e.createElement(u.Sub,{...o}))};ne.displayName="DropdownMenu.Sub";var re=e.forwardRef((n,o)=>{let{className:r,children:a,onClick:t,...s}=n,p=b(),m=f(),i=g(),l=e.useRef(t);l.current=t;let D=e.useCallback(c=>{c.preventDefault(),i&&p&&p.push(i.id),l.current?.(c)},[i,p]),w=e.useCallback(c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),i&&p&&p.push(i.id))},[i,p]);return m?.behavior==="drill-down"&&i?e.createElement("div",{role:"menuitem",tabIndex:0,ref:o,onClick:D,onKeyDown:w,className:d("rt-reset","rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger","rt-DropdownMenuDrillDownSubTrigger",r)},a,e.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},e.createElement(S,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"}))):e.createElement(u.SubTrigger,{...s,onClick:t,asChild:!1,ref:o,className:d("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",r)},a,e.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},e.createElement(S,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});re.displayName="DropdownMenu.SubTrigger";var x=e.forwardRef(({className:n,...o},r)=>e.createElement(u.Separator,{...o,asChild:!1,ref:r,className:d("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",n)}));x.displayName="DropdownMenu.Separator";function ce({label:n}){let{pop:o}=b()??{},r=e.useCallback(t=>{t.preventDefault(),o?.()},[o]),a=e.useCallback(t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o?.())},[o]);return e.createElement("div",{role:"menuitem",tabIndex:0,onClick:r,onKeyDown:a,className:d("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem","rt-DropdownMenuDrillDownBackItem")},e.createElement(j,{className:"rt-DropdownMenuDrillDownBackIcon"}),e.createElement("span",{className:"rt-DropdownMenuDrillDownBackLabel"},n))}var te=e.forwardRef((n,o)=>{let{size:r,variant:a,color:t,highContrast:s,material:p}=e.useContext(Q),m=f(),i=g(),{className:l,children:D,container:w,forceMount:c,material:P,panelBackground:N,...R}=C({size:r,variant:a,color:t,highContrast:s,material:p,...n},G);if(m?.behavior==="drill-down"&&i){let E=m.isActive(i.id);return e.createElement("div",{ref:o,role:"menu","aria-label":typeof i.label=="string"?i.label:void 0,"data-drill-down-active":E?!0:void 0,"data-animation-direction":m.animationDirection??void 0,className:d("rt-DropdownMenuDrillDownPanel",l)},e.createElement(ce,{label:i.label}),e.createElement(x,null),D)}return e.createElement(u.Portal,{container:w,forceMount:c},e.createElement(h,{asChild:!0},e.createElement(u.SubContent,{"data-accent-color":t,"data-material":p,"data-panel-background":p,alignOffset:-Number(r)*4,sideOffset:1,collisionPadding:10,...R,asChild:!1,ref:o,className:d("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",l)},e.createElement(y,{type:"auto"},e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport")},D)))))});te.displayName="DropdownMenu.SubContent";var ae=e.forwardRef((n,o)=>e.createElement(A,{...n,ref:o,className:"rt-DropdownMenuTriggerIcon"}));ae.displayName="DropdownMenu.TriggerIcon";export{q as a,J as b,U as c,X as d,Y as e,Z as f,$ as g,ee as h,oe as i,ne as j,re as k,x as l,te as m,ae as n,me as o};
|
|
2
|
-
//# sourceMappingURL=chunk-KKBP2CRH.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/dropdown-menu.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { DropdownMenu as DropdownMenuPrimitive, Slot } from 'radix-ui';\n\nimport { ScrollArea } from './scroll-area.js';\nimport {\n dropdownMenuContentPropDefs,\n dropdownMenuSubContentPropDefs,\n dropdownMenuItemPropDefs,\n dropdownMenuCheckboxItemPropDefs,\n dropdownMenuRadioItemPropDefs,\n} from './dropdown-menu.props.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDotIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport {\n DrillDownProvider,\n SubContext,\n useDrillDownActionsOptional,\n useDrillDownStateOptional,\n useSubContext,\n} from './_internal/dropdown-menu-drill-down.js';\nimport { MenuProvider } from './_internal/menu-context.js';\nimport type { SubmenuBehavior } from './_internal/dropdown-menu-drill-down.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { Kbd } from './kbd.js';\n\nimport type { IconProps } from './icons.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes, Responsive } from '../props/prop-def.js';\nimport { useDeprecatedPanelBackgroundWarning } from '../helpers/use-deprecation-warning.js';\n\ninterface DropdownMenuRootProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {}\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (props) => (\n <DropdownMenuPrimitive.Root {...props} />\n);\nDropdownMenuRoot.displayName = 'DropdownMenu.Root';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.Trigger>;\ninterface DropdownMenuTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Trigger, RemovedProps> {}\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DropdownMenuPrimitive.Trigger>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';\n\n/**\n * Internal component that wraps root menu items and handles visibility in drill-down mode.\n * In drill-down mode, this hides when a submenu is active.\n * Uses state-only hook to subscribe only to state changes, not action changes.\n */\nfunction DrillDownRoot({ children }: { children: React.ReactNode }) {\n const drillDownState = useDrillDownStateOptional();\n\n // In cascade mode or when no drill-down context, always show\n if (!drillDownState || drillDownState.behavior === 'cascade') {\n return <>{children}</>;\n }\n\n // In drill-down mode, hide root when a submenu is active\n return (\n <div\n className=\"rt-DropdownMenuDrillDownRoot\"\n data-drill-down-active={drillDownState.isRoot ? undefined : true}\n data-animation-direction={drillDownState.animationDirection ?? undefined}\n >\n {children}\n </div>\n );\n}\n\ntype DropdownMenuContentOwnProps = GetPropDefTypes<typeof dropdownMenuContentPropDefs> & {\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior?: Responsive<SubmenuBehavior>;\n /**\n * When true, skips the ScrollArea wrapper to allow VirtualMenu to handle its own scrolling.\n * Use this when rendering virtualized lists inside the dropdown.\n */\n virtualized?: boolean;\n};\ntype DropdownMenuContentContextValue = Omit<DropdownMenuContentOwnProps, 'submenuBehavior'>;\nconst DropdownMenuContentContext = React.createContext<DropdownMenuContentContextValue>({});\ntype DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;\ninterface DropdownMenuContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Content, RemovedProps>,\n DropdownMenuContentContextValue {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior?: Responsive<SubmenuBehavior>;\n /**\n * When true, skips the ScrollArea wrapper to allow VirtualMenu to handle its own scrolling.\n * Use this when rendering virtualized lists inside the dropdown.\n */\n virtualized?: boolean;\n}\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (props, forwardedRef) => {\n const themeContext = useThemeContext();\n\n useDeprecatedPanelBackgroundWarning(props.panelBackground);\n\n // Material takes precedence over panelBackground\n const effectiveMaterial =\n props.material ?? props.panelBackground ?? themeContext.panelBackground;\n\n // Memoize theme context values to prevent unnecessary re-renders\n const memoizedThemeContext = React.useMemo(\n () => ({\n material: effectiveMaterial,\n accentColor: themeContext.accentColor,\n }),\n [effectiveMaterial, themeContext.accentColor],\n );\n\n const {\n size = dropdownMenuContentPropDefs.size.default,\n variant = dropdownMenuContentPropDefs.variant.default,\n highContrast = dropdownMenuContentPropDefs.highContrast.default,\n material = memoizedThemeContext.material,\n submenuBehavior,\n virtualized = false,\n } = props;\n const {\n className,\n children,\n color,\n container,\n forceMount,\n material: _,\n panelBackground: __,\n submenuBehavior: ___,\n virtualized: ____,\n ...contentProps\n } = extractProps(props, dropdownMenuContentPropDefs);\n\n // Memoize color resolution to prevent unnecessary re-renders\n const resolvedColor = React.useMemo(\n () => color || memoizedThemeContext.accentColor,\n [color, memoizedThemeContext.accentColor],\n );\n const contentBody = (\n <MenuProvider size={size}>\n <DropdownMenuContentContext.Provider\n value={React.useMemo(\n () => ({ size, variant, color: resolvedColor, highContrast, material }),\n [size, variant, resolvedColor, highContrast, material],\n )}\n >\n <DrillDownProvider submenuBehavior={submenuBehavior}>\n <DrillDownRoot>{children}</DrillDownRoot>\n </DrillDownProvider>\n </DropdownMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.Content\n data-accent-color={resolvedColor}\n data-material={material}\n data-panel-background={material}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n {...contentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'rt-PopperContent',\n 'rt-BaseMenuContent',\n 'rt-DropdownMenuContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('rt-BaseMenuViewport', 'rt-DropdownMenuViewport', 'rt-virtualized')}>\n {contentBody}\n </div>\n ) : (\n <ScrollArea type=\"auto\">\n <div className={classNames('rt-BaseMenuViewport', 'rt-DropdownMenuViewport')}>\n {contentBody}\n </div>\n </ScrollArea>\n )}\n </DropdownMenuPrimitive.Content>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nDropdownMenuContent.displayName = 'DropdownMenu.Content';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;\ninterface DropdownMenuLabelProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Label, RemovedProps> {}\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n ({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Label\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuLabel', 'rt-DropdownMenuLabel', className)}\n />\n ),\n);\nDropdownMenuLabel.displayName = 'DropdownMenu.Label';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;\ntype DropdownMenuItemOwnProps = GetPropDefTypes<typeof dropdownMenuItemPropDefs>;\ninterface DropdownMenuItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Item, RemovedProps>,\n DropdownMenuItemOwnProps {}\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props, forwardedRef) => {\n const {\n className,\n children,\n color = dropdownMenuItemPropDefs.color.default,\n shortcut,\n ...itemProps\n } = props;\n return (\n <DropdownMenuPrimitive.Item\n data-accent-color={color}\n {...itemProps}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-BaseMenuItem', 'rt-DropdownMenuItem', className)}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n {shortcut && (\n <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">\n <Kbd size=\"1\">{shortcut}</Kbd>\n </div>\n )}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = 'DropdownMenu.Item';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.Group>;\ninterface DropdownMenuGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Group, RemovedProps> {}\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Group\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuGroup', 'rt-DropdownMenuGroup', className)}\n />\n ),\n);\nDropdownMenuGroup.displayName = 'DropdownMenu.Group';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioGroup, RemovedProps> {}\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>(({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.RadioGroup\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuRadioGroup', 'rt-DropdownMenuRadioGroup', className)}\n />\n));\nDropdownMenuRadioGroup.displayName = 'DropdownMenu.RadioGroup';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemOwnProps = GetPropDefTypes<typeof dropdownMenuRadioItemPropDefs>;\ninterface DropdownMenuRadioItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioItem, RemovedProps>,\n DropdownMenuRadioItemOwnProps {}\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n color = dropdownMenuRadioItemPropDefs.color.default,\n ...itemProps\n } = props;\n return (\n <DropdownMenuPrimitive.RadioItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'rt-BaseMenuItem',\n 'rt-BaseMenuRadioItem',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuRadioItem',\n className,\n )}\n >\n {children}\n <DropdownMenuPrimitive.ItemIndicator className=\"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator\">\n <ThickDotIcon className=\"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;\ntype DropdownMenuCheckboxItemOwnProps = GetPropDefTypes<typeof dropdownMenuCheckboxItemPropDefs>;\ninterface DropdownMenuCheckboxItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.CheckboxItem, RemovedProps>,\n DropdownMenuCheckboxItemOwnProps {}\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n shortcut,\n color = dropdownMenuCheckboxItemPropDefs.color.default,\n ...itemProps\n } = props;\n return (\n <DropdownMenuPrimitive.CheckboxItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'rt-BaseMenuItem',\n 'rt-BaseMenuCheckboxItem',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuCheckboxItem',\n className,\n )}\n >\n {children}\n <DropdownMenuPrimitive.ItemIndicator className=\"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator\">\n <ThickCheckIcon className=\"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n {shortcut && (\n <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">\n <Kbd size=\"1\">{shortcut}</Kbd>\n </div>\n )}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = 'DropdownMenu.CheckboxItem';\n\n// Generate unique submenu IDs using React 18's useId for SSR safety\nfunction useSubId() {\n return React.useId();\n}\n\ninterface DropdownMenuSubProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub> {\n /**\n * Label displayed in the back button when using drill-down mode.\n * If not provided, defaults to \"Back\".\n */\n label?: React.ReactNode;\n}\nconst DropdownMenuSub: React.FC<DropdownMenuSubProps> = ({ label = 'Back', ...props }) => {\n // Use state-only hook since we only need behavior check\n const drillDownState = useDrillDownStateOptional();\n const subId = useSubId();\n\n // Create context value for SubContent and SubTrigger\n const subContextValue = React.useMemo(\n () => ({ id: subId, label }),\n [subId, label]\n );\n\n // In drill-down mode, we don't use Radix's Sub component\n // We just provide the SubContext and render children\n if (drillDownState?.behavior === 'drill-down') {\n return (\n <SubContext.Provider value={subContextValue}>\n {props.children}\n </SubContext.Provider>\n );\n }\n\n // In cascade mode, use Radix's Sub component normally\n return (\n <SubContext.Provider value={subContextValue}>\n <DropdownMenuPrimitive.Sub {...props} />\n </SubContext.Provider>\n );\n};\nDropdownMenuSub.displayName = 'DropdownMenu.Sub';\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;\ninterface DropdownMenuSubTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubTrigger, RemovedProps> {}\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props, forwardedRef) => {\n const { className, children, onClick, ...subTriggerProps } = props;\n // Use split hooks: actions for stable push callback, state only for behavior check\n const drillDownActions = useDrillDownActionsOptional();\n const drillDownState = useDrillDownStateOptional();\n const subContext = useSubContext();\n\n // Store onClick in ref to avoid recreating handlers when onClick changes\n const onClickRef = React.useRef(onClick);\n onClickRef.current = onClick;\n\n // Stable click handler - only depends on stable refs\n const handleClick = React.useCallback((e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n if (subContext && drillDownActions) {\n drillDownActions.push(subContext.id);\n }\n (onClickRef.current as React.MouseEventHandler<HTMLDivElement> | undefined)?.(e);\n }, [subContext, drillDownActions]);\n\n // Stable keydown handler\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (subContext && drillDownActions) {\n drillDownActions.push(subContext.id);\n }\n }\n }, [subContext, drillDownActions]);\n\n // In drill-down mode, render a button that navigates to the submenu\n if (drillDownState?.behavior === 'drill-down' && subContext) {\n return (\n <div\n role=\"menuitem\"\n tabIndex={0}\n ref={forwardedRef as React.Ref<HTMLDivElement>}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n className={classNames(\n 'rt-reset',\n 'rt-BaseMenuItem',\n 'rt-BaseMenuSubTrigger',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuSubTrigger',\n 'rt-DropdownMenuDrillDownSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon\" />\n </div>\n </div>\n );\n }\n\n // In cascade mode, use Radix's SubTrigger\n return (\n <DropdownMenuPrimitive.SubTrigger\n {...subTriggerProps}\n onClick={onClick as React.MouseEventHandler<HTMLDivElement> | undefined}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'rt-BaseMenuItem',\n 'rt-BaseMenuSubTrigger',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\nDropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';\n\n// Separator is defined here (before SubContent) because it's used in drill-down mode\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Separator, RemovedProps> {}\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuSeparator', 'rt-DropdownMenuSeparator', className)}\n />\n));\nDropdownMenuSeparator.displayName = 'DropdownMenu.Separator';\n\n/**\n * Internal component for the drill-down back button.\n * Uses actions-only hook since it only needs to call pop(), never reads state.\n * This prevents re-renders when drill-down state changes.\n */\nfunction DrillDownBackItem({ label }: { label: React.ReactNode }) {\n // Use actions-only hook for stable pop callback - prevents re-renders on stack changes\n const { pop } = useDrillDownActionsOptional() ?? {};\n\n // Stable click handler\n const handleClick = React.useCallback((e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n pop?.();\n }, [pop]);\n\n // Stable keydown handler\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n pop?.();\n }\n }, [pop]);\n\n return (\n <div\n role=\"menuitem\"\n tabIndex={0}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n className={classNames(\n 'rt-reset',\n 'rt-BaseMenuItem',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuDrillDownBackItem',\n )}\n >\n <ThickChevronLeftIcon className=\"rt-DropdownMenuDrillDownBackIcon\" />\n <span className=\"rt-DropdownMenuDrillDownBackLabel\">{label}</span>\n </div>\n );\n}\n\ntype DropdownMenuSubContentElement = React.ElementRef<typeof DropdownMenuPrimitive.SubContent>;\ninterface DropdownMenuSubContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubContent, RemovedProps>,\n DropdownMenuContentContextValue {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n}\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props, forwardedRef) => {\n // Get context values directly - memoization at provider level handles stability\n const { size, variant, color, highContrast, material } = React.useContext(\n DropdownMenuContentContext,\n );\n // Use state-only hook since we only need behavior and isActive (no actions)\n const drillDownState = useDrillDownStateOptional();\n const subContext = useSubContext();\n\n const {\n className,\n children,\n container,\n forceMount,\n material: _,\n panelBackground: __,\n ...subContentProps\n } = extractProps(\n { size, variant, color, highContrast, material, ...props },\n dropdownMenuSubContentPropDefs,\n );\n\n // In drill-down mode, render inline instead of in a portal\n if (drillDownState?.behavior === 'drill-down' && subContext) {\n const isActive = drillDownState.isActive(subContext.id);\n\n return (\n <div\n ref={forwardedRef as React.Ref<HTMLDivElement>}\n role=\"menu\"\n aria-label={typeof subContext.label === 'string' ? subContext.label : undefined}\n data-drill-down-active={isActive ? true : undefined}\n data-animation-direction={drillDownState.animationDirection ?? undefined}\n className={classNames(\n 'rt-DropdownMenuDrillDownPanel',\n className,\n )}\n >\n <DrillDownBackItem label={subContext.label} />\n <DropdownMenuSeparator />\n {children}\n </div>\n );\n }\n\n // In cascade mode, use Portal and Radix's SubContent\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.SubContent\n data-accent-color={color}\n data-material={material}\n data-panel-background={material}\n alignOffset={-Number(size) * 4}\n // Side offset accounts for the outer solid box-shadow\n sideOffset={1}\n collisionPadding={10}\n {...subContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'rt-PopperContent',\n 'rt-BaseMenuContent',\n 'rt-BaseMenuSubContent',\n 'rt-DropdownMenuContent',\n 'rt-DropdownMenuSubContent',\n className,\n )}\n >\n <ScrollArea type=\"auto\">\n <div className={classNames('rt-BaseMenuViewport', 'rt-DropdownMenuViewport')}>\n {children}\n </div>\n </ScrollArea>\n </DropdownMenuPrimitive.SubContent>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n});\nDropdownMenuSubContent.displayName = 'DropdownMenu.SubContent';\n\ntype DropdownMenuTriggerIconElement = React.ElementRef<'svg'>;\ninterface DropdownMenuTriggerIconProps extends IconProps {}\nconst DropdownMenuTriggerIcon = React.forwardRef<\n DropdownMenuTriggerIconElement,\n DropdownMenuTriggerIconProps\n>((props, forwardedRef) => (\n <ChevronDownIcon {...props} ref={forwardedRef} className=\"rt-DropdownMenuTriggerIcon\" />\n));\nDropdownMenuTriggerIcon.displayName = 'DropdownMenu.TriggerIcon';\n\nexport {\n DropdownMenuRoot as Root,\n DropdownMenuTrigger as Trigger,\n DropdownMenuTriggerIcon as TriggerIcon,\n DropdownMenuContent as Content,\n DropdownMenuLabel as Label,\n DropdownMenuItem as Item,\n DropdownMenuGroup as Group,\n DropdownMenuRadioGroup as RadioGroup,\n DropdownMenuRadioItem as RadioItem,\n DropdownMenuCheckboxItem as CheckboxItem,\n DropdownMenuSub as Sub,\n DropdownMenuSubTrigger as SubTrigger,\n DropdownMenuSubContent as SubContent,\n DropdownMenuSeparator as Separator,\n};\n\nexport type {\n DropdownMenuRootProps as RootProps,\n DropdownMenuTriggerProps as TriggerProps,\n DropdownMenuTriggerIconProps as TriggerIconProps,\n DropdownMenuContentProps as ContentProps,\n DropdownMenuLabelProps as LabelProps,\n DropdownMenuItemProps as ItemProps,\n DropdownMenuGroupProps as GroupProps,\n DropdownMenuRadioGroupProps as RadioGroupProps,\n DropdownMenuRadioItemProps as RadioItemProps,\n DropdownMenuCheckboxItemProps as CheckboxItemProps,\n DropdownMenuSubProps as SubProps,\n DropdownMenuSubTriggerProps as SubTriggerProps,\n DropdownMenuSubContentProps as SubContentProps,\n DropdownMenuSeparatorProps as SeparatorProps,\n SubmenuBehavior,\n};\n"],
|
|
5
|
-
"mappings": "ohBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,kBAAAE,GAAA,YAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,eAAAC,EAAA,cAAAC,GAAA,SAAAC,EAAA,cAAAC,EAAA,QAAAC,GAAA,eAAAC,GAAA,eAAAC,GAAA,YAAAC,EAAA,gBAAAC,KAEA,UAAYC,MAA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AA6B,UAAWwB,EAAW,WAAYC,GAC9D,gBAACW,EAAA,CAAM,QAAO,IACZ,gBAACpC,EAAsB,WAAtB,CACC,oBAAmBuB,EACnB,gBAAeJ,EACf,wBAAuBA,EACvB,YAAa,CAAC,OAAOJ,CAAI,EAAI,EAE7B,WAAY,EACZ,iBAAkB,GACjB,GAAG8D,EACJ,QAAS,GACT,IAAK1E,EACL,UAAWkC,EACT,mBACA,qBACA,wBACA,yBACA,4BACAf,CACF,GAEA,gBAACgB,EAAA,CAAW,KAAK,QACf,gBAAC,OAAI,UAAWD,EAAW,sBAAuB,yBAAyB,GACxEnC,CACH,CACF,CACF,CACF,CACF,CAEJ,CAAC,EACD0E,GAAuB,YAAc,0BAIrC,IAAMI,GAAgC,aAGpC,CAACjF,EAAOI,IACR,gBAAC8E,EAAA,CAAiB,GAAGlF,EAAO,IAAKI,EAAc,UAAU,6BAA6B,CACvF,EACD6E,GAAwB,YAAc",
|
|
6
|
-
"names": ["dropdown_menu_exports", "__export", "DropdownMenuCheckboxItem", "DropdownMenuContent", "DropdownMenuGroup", "DropdownMenuItem", "DropdownMenuLabel", "DropdownMenuRadioGroup", "DropdownMenuRadioItem", "DropdownMenuRoot", "DropdownMenuSeparator", "DropdownMenuSub", "DropdownMenuSubContent", "DropdownMenuSubTrigger", "DropdownMenuTrigger", "DropdownMenuTriggerIcon", "React", "classNames", "DropdownMenuPrimitive", "Slot", "DropdownMenuRoot", "props", "DropdownMenuPrimitive", "DropdownMenuTrigger", "children", "forwardedRef", "requireReactElement", "DrillDownRoot", "drillDownState", "useDrillDownStateOptional", "DropdownMenuContentContext", "DropdownMenuContent", "themeContext", "useThemeContext", "useDeprecatedPanelBackgroundWarning", "effectiveMaterial", "memoizedThemeContext", "size", "baseMenuContentPropDefs", "variant", "highContrast", "material", "submenuBehavior", "virtualized", "className", "color", "container", "forceMount", "_", "__", "___", "____", "contentProps", "extractProps", "resolvedColor", "contentBody", "MenuProvider", "DrillDownProvider", "Theme", "classNames", "ScrollArea", "DropdownMenuLabel", "DropdownMenuItem", "baseMenuItemPropDefs", "shortcut", "itemProps", "Slot", "Kbd", "DropdownMenuGroup", "DropdownMenuRadioGroup", "DropdownMenuRadioItem", "baseMenuRadioItemPropDefs", "ThickDotIcon", "DropdownMenuCheckboxItem", "baseMenuCheckboxItemPropDefs", "ThickCheckIcon", "useSubId", "DropdownMenuSub", "label", "subId", "subContextValue", "SubContext", "DropdownMenuSubTrigger", "onClick", "subTriggerProps", "drillDownActions", "useDrillDownActionsOptional", "subContext", "useSubContext", "onClickRef", "handleClick", "e", "handleKeyDown", "ThickChevronRightIcon", "DropdownMenuSeparator", "DrillDownBackItem", "pop", "ThickChevronLeftIcon", "DropdownMenuSubContent", "subContentProps", "baseMenuSubContentPropDefs", "isActive", "DropdownMenuTriggerIcon", "ChevronDownIcon"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Me}from"./chunk-PLWXTEVE.js";import{a as Ge}from"./chunk-GJSGKE7B.js";import{g as qe,j as Ye}from"./chunk-IX5HIHVI.js";import{a as Re}from"./chunk-H7ST535H.js";import{a as ce}from"./chunk-FHOCUZDR.js";import{b as U}from"./chunk-FWB47YCH.js";import{a as dt}from"./chunk-3XT5P2HO.js";var ft={};dt(ft,{AttachTrigger:()=>tt,Attachment:()=>Le,AttachmentsRow:()=>et,InlineEnd:()=>Ze,InlineStart:()=>Xe,Root:()=>Je,Row:()=>at,RowEnd:()=>ot,RowStart:()=>nt,Send:()=>rt,Textarea:()=>Qe});import*as e from"react";import M from"classnames";import{LazyMotion as mt,domAnimation as pt,m as ue}from"motion/react";import{useDropzone as ht}from"react-dropzone";var Oe=typeof window<"u"?e.useLayoutEffect:e.useEffect,_e=e.createContext(null),_=()=>{let l=e.useContext(_e);if(!l)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return l},Je=e.forwardRef((l,i)=>{let{className:r,style:h,children:d,value:g,defaultValue:y="",onValueChange:m,open:s,defaultOpen:v=!1,onOpenChange:f,expandOn:x="both",minLines:P=3,maxLines:n=6,sendMode:C="whenDirty",disabled:S,readOnly:z,onSubmit:w,size:T="2",variant:J,color:k,radius:Q,panelBackground:O,material:K,width:de,maxWidth:ne,asChild:me,attachments:oe,defaultAttachments:ge=[],onAttachmentsChange:I,accept:X,multiple:j=!0,maxAttachments:A,maxFileSize:p,paste:pe=!0,pasteAccept:Z,clearOnSubmit:he=!0,onAttachmentReject:$,dropzone:W=!0,apiRef:a,...c}=l,b=K||O,R=g!=null,[F,Ce]=e.useState(y),ee=R?g:F,L=s!=null,[re,te]=e.useState(v),ae=L?s:re,ye=e.useRef(null),fe=e.useRef(null),ve=e.useRef(!1),q="attachments"in l,[De,Fe]=e.useState(ge),Y=e.useMemo(()=>q?oe??[]:De,[q,oe,De]),be=e.useRef(new Set),xe=t=>Array.isArray(t)?t:typeof t=="string"?t.split(",").map(o=>o.trim()):[],se=xe(X),He=xe(Z).length>0?xe(Z):se,Ne=(t,o)=>{if(o.length===0)return!0;let D=t.type.toLowerCase(),B=t.name.toLowerCase();for(let H of o){let E=H.toLowerCase();if(E.includes("/")){let[N,V]=E.split("/"),[u,le]=D.split("/");if(N==="*"||N===u&&(V==="*"||V===le))return!0}else if(E.startsWith(".")&&B.endsWith(E))return!0}return!1},Ae=e.useRef(Y);Ae.current=Y;let we=e.useRef(se);we.current=se;let ze=e.useRef(He);ze.current=He;let Pe=e.useRef(A);Pe.current=A;let Ee=e.useRef(p);Ee.current=p;let Se=e.useRef($);Se.current=$;let ke=e.useRef(I);ke.current=I;let Ie=e.useRef(f);Ie.current=f;let ie=e.useCallback(t=>{let o=Ae.current,D=we.current,B=Pe.current,H=Ee.current,E=[],N=[],V=typeof B=="number"?Math.max(B-o.length,0):1/0;for(let u of t){if(E.length>=V){N.push({file:u,reason:"count"});continue}if(typeof H=="number"&&u.size>H){N.push({file:u,reason:"size"});continue}if(!Ne(u,D)){N.push({file:u,reason:"type"});continue}let le=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,G=/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(u.name),Te=(u.type||"").toLowerCase().startsWith("image/")||G?URL.createObjectURL(u):void 0;Te&&be.current.add(Te),E.push({id:le,name:u.name,size:u.size,type:u.type,file:u,url:Te,status:"idle"})}if(E.length>0){let u=o.concat(E);q||Fe(u),ke.current?.(u),L||te(!0),Ie.current?.(!0)}N.length>0&&Se.current?.(N)},[q,L]),je=e.useCallback(t=>{let o=we.current,D=ze.current,B=Pe.current,H=Ee.current,E=Ae.current,N=D.length>0?D:o,V=[],u=[],le=typeof B=="number"?Math.max(B-E.length,0):1/0;for(let G of t){if(V.length>=le){u.push({file:G,reason:"count"});continue}if(typeof H=="number"&&G.size>H){u.push({file:G,reason:"size"});continue}if(!Ne(G,N)){u.push({file:G,reason:"type"});continue}V.push(G)}V.length>0&&ie(V),u.length>0&&Se.current?.(u)},[ie]);e.useEffect(()=>{let t=new Set(Y.map(o=>o.url).filter(Boolean));for(let o of Array.from(be.current))t.has(o)||(URL.revokeObjectURL(o),be.current.delete(o))},[Y]),e.useEffect(()=>{let t=be.current;return()=>{for(let o of Array.from(t))URL.revokeObjectURL(o);t.clear()}},[]);let st=me?U:"div",We=e.useCallback(t=>{L||te(t),f?.(t)},[L,f]),Be=e.useCallback(t=>{R||Ce(t),m?.(t)},[R,m]),Ve=e.useCallback(t=>{q||Fe(t),I?.(t)},[q,I]),it=e.useCallback(t=>{let o=t.relatedTarget,D=ye.current;D&&(o&&D.contains(o)||ve.current||(ee?.trim?.()??"").length===0&&Y.length===0&&(L||te(!1),f?.(!1)))},[L,f,ee,Y]),{getRootProps:lt,getInputProps:ct,isDragActive:Ue,open:Ke}=ht({onDrop:(t,o)=>{if(t.length>0&&ie(t),o.length>0&&$){let D=o.map(({file:B,errors:H})=>{let E=H[0]?.code==="file-too-large"?"size":H[0]?.code==="file-invalid-type"?"type":"count";return{file:B,reason:E}});$(D)}},accept:se.length>0?se.reduce((t,o)=>(o.includes("/")?t[o]=[]:o.startsWith(".")&&(t[o]=[]),t),{}):void 0,multiple:j,maxSize:p,noClick:!0,noKeyboard:!0,disabled:!W||S});e.useImperativeHandle(a,()=>({focusTextarea:()=>fe.current?.focus({preventScroll:!0}),openFilePicker:()=>{ve.current=!0,Ke()}}),[Ke]);let $e=e.useCallback(t=>{if(!(t instanceof Element))return!1;let o=t;return o.closest(".rt-ChatbarDropOverlay")?!0:!!o.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')},[]),ut=e.useCallback(t=>{S||$e(t.target)||t.pointerType==="mouse"&&t.button!==0||(t.preventDefault(),fe.current?.focus({preventScroll:!0}))},[S,$e,fe]);return e.createElement(_e.Provider,{value:e.useMemo(()=>({open:ae,setOpen:We,isOpenControlled:L,value:ee,setValue:Be,isValueControlled:R,size:T,expandOn:x,minLines:P,maxLines:n,sendMode:C,disabled:S,readOnly:z,onSubmit:w,rootRef:ye,textareaRef:fe,attachments:Y,setAttachments:Ve,isAttachmentsControlled:q,accept:X,multiple:j,maxAttachments:A,maxFileSize:p,paste:pe,pasteAccept:Z,clearOnSubmit:he,onAttachmentReject:$,dropzone:W,appendFiles:ie,appendFilesFromPaste:je,fileDialogOpenRef:ve}),[ae,We,L,ee,Be,R,T,x,P,n,C,S,z,w,Y,Ve,q,X,j,A,p,pe,Z,he,$,W,ie,je])},e.createElement(mt,{features:pt},e.createElement(st,{...c,ref:t=>{typeof i=="function"?i(t):i&&(i.current=t),ye.current=t},className:M("rt-ChatbarRoot",`rt-r-size-${T}`,r),style:{position:"relative",width:de,maxWidth:ne,...h},"data-state":ae?"open":"closed","data-disabled":S?"":void 0,"data-readonly":z?"":void 0,"data-drop-active":W&&Ue?"":void 0,"data-accent-color":k,"data-radius":Q,"data-panel-background":b,"data-material":b,"aria-expanded":ae,onBlurCapture:it},W&&e.createElement("input",{...ct()}),e.createElement("div",{...W?lt():{},style:{width:"100%",height:"100%"},onPointerDown:ut},e.createElement(ue.div,{className:M("rt-ChatbarBox",`rt-variant-${J??"surface"}`),style:{position:"relative"},"data-accent-color":k,"data-radius":Q,"data-panel-background":b,"data-material":b,layout:!0,transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},e.createElement(ue.div,{className:"rt-ChatbarGrid",layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},d),W&&Ue&&e.createElement("div",{className:"rt-ChatbarDropOverlay"},e.createElement("div",{className:"rt-ChatbarDropContent"},e.createElement(Re,{color:"gray",size:T,weight:"medium"},"Drop files here to attach"))))))))});Je.displayName="Chatbar.Root";var Qe=e.forwardRef((l,i)=>{let{className:r,style:h,asChild:d,onFocus:g,onInput:y,onChange:m,onPaste:s,onKeyDown:v,submitOnEnter:f=!1,rows:x,...P}=l,n=_(),{open:C,minLines:S,maxLines:z,expandOn:w,disabled:T,readOnly:J,setOpen:k,setValue:Q,textareaRef:O,value:K,isValueControlled:de,sendMode:ne,paste:me,appendFilesFromPaste:oe,size:ge}=n,I=e.useRef(0),X=e.useRef(0),j=e.useRef(0),A=e.useCallback(()=>{let a=O.current;if(!a)return;let c=window.getComputedStyle(a),b=parseFloat(c.lineHeight)||20,R=parseFloat(c.paddingTop)||0,F=parseFloat(c.paddingBottom)||0;I.current=b,X.current=R+F,j.current=Math.ceil(1*b)+R+F},[O]),p=e.useCallback(a=>{let c=O.current;if(!c)return;c.style.height="auto",I.current===0&&A();let b=I.current,R=X.current,F=a??C,Ce=F?S:1,ee=F?z:1,L=Math.ceil(Ce*b)+R,re=Math.ceil(ee*b)+R,te=Math.max(c.scrollHeight,L),ae=Math.min(te,re);c.style.height=`${ae}px`,te>re?(c.style.overflowY="auto",c.style.maxHeight=`${re}px`):(c.style.overflowY="hidden",c.style.maxHeight="none")},[C,S,z,O,A]);Oe(()=>{p()},[p,K,C]),Oe(()=>{if(!(w==="overflow"||w==="both")||C)return;let a=O.current;if(!a)return;a.style.height="auto",j.current===0&&A(),a.scrollHeight>j.current+1&&(k(!0),p(!0),requestAnimationFrame(()=>p(!0)))},[K,w,C,k,O,A,p]),Oe(()=>{A(),p()},[A,p,ge]),e.useEffect(()=>{let a=O.current;if(!a||typeof ResizeObserver>"u")return;let c=I.current,b=new ResizeObserver(()=>{let R=window.getComputedStyle(a),F=parseFloat(R.lineHeight)||20;F!==c&&(c=F,A(),requestAnimationFrame(()=>p()))});return b.observe(a),()=>b.disconnect()},[O,A,p]),e.useEffect(()=>{},[]);let pe=e.useCallback(a=>{T||J||((w==="focus"||w==="both")&&!C&&k(!0),g?.(a))},[T,J,w,C,k,g]),Z=e.useCallback(a=>{let c=a.currentTarget,b=c.value;Q(b),(w==="overflow"||w==="both")&&!C&&(c.style.height="auto",j.current===0&&A(),c.scrollHeight>j.current+1&&(k(!0),p(!0),requestAnimationFrame(()=>p(!0)))),requestAnimationFrame(()=>p()),m?.(a)},[w,C,k,Q,m,p,A]),he=e.useCallback(a=>{if(me){let b=Array.from(a.clipboardData?.items??[]).filter(R=>R.kind==="file").map(R=>R.getAsFile()).filter(R=>!!R);b.length>0&&(a.preventDefault(),oe(b))}setTimeout(()=>{C?p():p(!0)},0),s?.(a)},[me,C,p,s,oe]),$=e.useCallback(a=>{if(!f){v?.(a);return}if(a.key==="Enter"&&!a.shiftKey&&!a.altKey&&!a.ctrlKey&&!a.metaKey&&!a.nativeEvent.isComposing){if(T||J){v?.(a);return}if(ne==="never"){v?.(a);return}let b=K.trim().length>0||n.attachments.length>0;if(ne==="whenDirty"&&!b){v?.(a);return}a.preventDefault(),n.onSubmit?.({value:K,attachments:n.attachments}),n.clearOnSubmit&&(de||Q(""),n.setAttachments([]))}v?.(a)},[f,T,J,ne,K,de,Q,n,v]),W=d?U:"textarea";return e.createElement(ue.div,{className:M("rt-ChatbarField","rt-ChatbarTextarea",r),layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},e.createElement(W,{...P,ref:a=>{typeof i=="function"?i(a):i&&(i.current=a),O.current=a},className:"rt-ChatbarInput",value:K,onInput:y,onChange:Z,onFocus:pe,onPaste:he,onKeyDown:$,disabled:T,readOnly:J,rows:C?S:1,spellCheck:P.spellCheck??!0,autoCorrect:P.autoCorrect??"on",style:h}))});Qe.displayName="Chatbar.Textarea";var Xe=e.forwardRef((l,i)=>{let{children:r,asChild:h,style:d,className:g,...y}=l;return _().open?null:e.createElement(h?U:"div",{...y,ref:i,className:M("rt-ChatbarInlineStart",g),style:d},r)});Xe.displayName="Chatbar.InlineStart";var Ze=e.forwardRef((l,i)=>{let{children:r,asChild:h,style:d,className:g,...y}=l;return _().open?null:e.createElement(h?U:"div",{...y,ref:i,className:M("rt-ChatbarInlineEnd",g),style:d},r)});Ze.displayName="Chatbar.InlineEnd";var et=e.forwardRef((l,i)=>{let{asChild:r,forceMount:h,renderAttachment:d,className:g,style:y,...m}=l,s=_();if(!(s.attachments.length>0)&&!h)return null;let f=r?U:"div";return e.createElement(ue.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},e.createElement(f,{...m,ref:i,className:M("rt-ChatbarAttachmentsRow",g),style:y,role:"list","aria-label":m["aria-label"]??"Attachments"},e.createElement(Ge,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},e.createElement(ce,{align:"center",gap:"2",style:{minWidth:"fit-content"}},s.attachments.map(x=>e.createElement(Le,{key:x.id,attachment:x,asChild:!!d},d?.(x)))))))});et.displayName="Chatbar.AttachmentsRow";var Le=e.forwardRef((l,i)=>{let{attachment:r,asChild:h,className:d,style:g,children:y,...m}=l,s=_(),v=h?U:"div",f=!!r.url&&r.type.startsWith("image/");return e.createElement(v,{...m,ref:i,className:M("rt-ChatbarAttachment",d),style:g,role:"listitem","data-kind":f?"image":"file",title:r.name},y??e.createElement(ce,{align:"center",gap:"2",pr:f?void 0:"6"},e.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},f?e.createElement("img",{className:"rt-ChatbarAttachmentImage",src:r.url,alt:""}):e.createElement(Ye,null)),!f&&e.createElement(ce,{direction:"column",gap:"0",style:{minWidth:0}},e.createElement(Re,{size:s.size,weight:"medium",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},r.name),e.createElement(Re,{size:"1",color:"gray"},Math.ceil(r.size/1024)," KB")),e.createElement(Me,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${r.name}`,size:"1",variant:"classic",highContrast:!0,color:"gray",onClick:()=>s.setAttachments(s.attachments.filter(x=>x.id!==r.id))},e.createElement(qe,null))))});Le.displayName="Chatbar.Attachment";var tt=e.forwardRef((l,i)=>{let{asChild:r,accept:h,multiple:d,className:g,style:y,...m}=l,s=_(),v=e.useRef(null),f=r?U:"button",x=h??s.accept,P=(Array.isArray(x)?x:x?.split(",")??[]).join(",");return e.useEffect(()=>{let n=()=>{s.fileDialogOpenRef.current=!1};return window.addEventListener("focus",n),()=>window.removeEventListener("focus",n)},[s.fileDialogOpenRef]),e.createElement(e.Fragment,null,e.createElement(f,{...m,ref:i,className:M("rt-ChatbarAttachTrigger",g),style:y,type:m.type??"button","aria-label":m["aria-label"]??"Add attachments",onPointerDown:n=>{s.fileDialogOpenRef.current=!0,m.onPointerDown?.(n)},onMouseDown:n=>{s.fileDialogOpenRef.current=!0,m.onMouseDown?.(n)},onClick:n=>{s.fileDialogOpenRef.current=!0,v.current&&v.current.click(),m.onClick?.(n)}}),e.createElement("input",{ref:v,type:"file",accept:P,multiple:d??s.multiple,tabIndex:-1,style:{display:"none"},onChange:n=>{let C=Array.from(n.currentTarget.files??[]);C.length>0&&s.appendFiles(C),s.fileDialogOpenRef.current=!1,n.currentTarget.value=""}}))});tt.displayName="Chatbar.AttachTrigger";var at=e.forwardRef((l,i)=>{let{asChild:r,children:h,className:d,style:g,...y}=l;if(!_().open)return null;let s=r?U:"div";return e.createElement(ue.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},e.createElement(s,{...y,ref:i,className:M("rt-ChatbarRow",d),style:g},e.createElement(ce,{align:"center",justify:"between",width:"100%"},h)))});at.displayName="Chatbar.Row";var nt=e.forwardRef((l,i)=>{let{className:r,style:h,...d}=l;return e.createElement("div",{...d,ref:i,className:M("rt-ChatbarRowStart",r),style:h})});nt.displayName="Chatbar.RowStart";var ot=e.forwardRef((l,i)=>{let{className:r,style:h,...d}=l;return e.createElement("div",{...d,ref:i,className:M("rt-ChatbarRowEnd",r),style:h})});ot.displayName="Chatbar.RowEnd";var rt=e.forwardRef((l,i)=>{let{asChild:r,clearOnSend:h=!0,disabled:d,children:g,className:y,style:m,size:s,variant:v,"aria-label":f,"aria-labelledby":x,...P}=l,n=_(),S=n.value.trim().length>0||n.attachments.length>0,z=n.sendMode==="always"||n.sendMode==="whenDirty"&&S;if(n.sendMode==="never")return null;let w=T=>{n.disabled||n.readOnly||(n.onSubmit?.({value:n.value,attachments:n.attachments}),h&&(n.isValueControlled||n.setValue(""),n.clearOnSubmit&&n.setAttachments([])),P.onClick?.(T))};return e.createElement(Me,{...P,ref:i,size:s??n.size,variant:v??(n.open?"solid":"ghost"),disabled:d||n.disabled||n.readOnly,className:M("rt-ChatbarSend",y),style:{opacity:z?1:0,pointerEvents:z?"auto":"none",...m},asChild:r,onClick:w,"aria-label":f??(x?void 0:"Send"),"aria-labelledby":x},g??e.createElement("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",className:"lucide lucide-arrow-right-icon lucide-arrow-right"},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"})))});rt.displayName="Chatbar.Send";export{Je as a,Qe as b,Xe as c,Ze as d,et as e,Le as f,tt as g,at as h,nt as i,ot as j,rt as k,ft as l};
|
|
2
|
-
//# sourceMappingURL=chunk-MOR3NSXQ.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/chatbar.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { LazyMotion, domAnimation, m } from 'motion/react';\n\nimport { IconButton, type IconButtonProps } from './icon-button.js';\nimport { CloseIcon, FileTextIcon } from './icons.js';\nimport { Flex } from './flex.js';\n\nimport { ScrollArea } from './scroll-area.js';\nimport { Slot } from './slot.js';\nimport { Text } from './text.js';\nimport { useDropzone } from 'react-dropzone';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\n// Avoid SSR warnings by using an isomorphic layout effect\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\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 and is revoked on removal.\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\ninterface ChatbarContextValue {\n open: boolean;\n setOpen(next: boolean): void;\n isOpenControlled: boolean;\n\n value: string;\n setValue(next: string): void;\n isValueControlled: boolean;\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\n // Submit returns both message and attachments\n onSubmit?: (payload: { value: string; attachments: ChatbarAttachment[] }) => void;\n\n rootRef: React.RefObject<HTMLDivElement | null>;\n textareaRef: React.RefObject<HTMLTextAreaElement | null>;\n\n // Attachments state\n attachments: ChatbarAttachment[];\n setAttachments(next: ChatbarAttachment[]): void;\n isAttachmentsControlled: boolean;\n\n // Config\n accept?: string | string[];\n multiple: boolean;\n maxAttachments?: number;\n maxFileSize?: number;\n paste: boolean;\n pasteAccept?: string | string[];\n clearOnSubmit: boolean;\n\n // Dropzone\n dropzone: boolean;\n\n // Events\n onAttachmentReject?: (rejections: { file: File; reason: 'type' | 'size' | 'count' }[]) => void;\n\n // Helpers\n appendFiles(files: File[]): void;\n appendFilesFromPaste(files: File[]): void;\n\n // Guards\n fileDialogOpenRef: React.MutableRefObject<boolean>;\n}\n\nconst ChatbarContext = React.createContext<ChatbarContextValue | null>(null);\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\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`, `maxAttachments`, and `maxFileSize`.\n * - Rejections are reported via `onAttachmentReject`.\n *\n * Submit\n * - `onSubmit({ value, attachments })` emits both message and attachments.\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 expandOn?: ExpandOn;\n\n /** Minimum number of lines in compact state (default: 1) */\n minLines?: number;\n /** Maximum number of lines before scrolling (default: 6) */\n maxLines?: number;\n\n sendMode?: SendMode;\n\n disabled?: boolean;\n readOnly?: boolean;\n\n /** Combined submit payload */\n onSubmit?: (payload: { value: string; attachments: ChatbarAttachment[] }) => void;\n\n size?: '1' | '2' | '3';\n variant?: 'surface' | 'outline' | 'classic' | 'ghost' | 'soft';\n /** Accent color for the control (matches TextArea) */\n color?: string;\n /** Optional radius override (matches TextArea) */\n radius?: string | number;\n /** Panel/material translucency flags (matches TextArea) */\n panelBackground?: 'solid' | 'translucent';\n material?: 'solid' | 'translucent';\n\n width?: React.CSSProperties['width'];\n maxWidth?: React.CSSProperties['maxWidth'];\n asChild?: boolean;\n\n // Attachments API\n attachments?: ChatbarAttachment[];\n defaultAttachments?: ChatbarAttachment[];\n onAttachmentsChange?: (attachments: ChatbarAttachment[]) => void;\n accept?: string | string[];\n multiple?: boolean;\n maxAttachments?: number;\n maxFileSize?: number;\n paste?: boolean;\n pasteAccept?: string | string[];\n clearOnSubmit?: boolean;\n onAttachmentReject?: (rejections: { file: File; reason: 'type' | 'size' | 'count' }[]) => 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, 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\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) */\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 * - Sets `aria-expanded` to reflect open/closed state for assistive technologies.\n *\n * Attachments\n * - Controlled/uncontrolled attachments with client-side filtering.\n * - Filters by `accept`/`pasteAccept`, `maxAttachments`, and `maxFileSize`.\n * - Rejections are reported via `onAttachmentReject`.\n * - Paste-to-attach: when `paste` is enabled, pasting files adds attachments.\n *\n * Dropzone\n * - When `dropzone` is true, enables drag-and-drop file uploads.\n * - Files are validated using the same rules as paste and file picker.\n * - Visual feedback via `data-drop-active` attribute during drag operations.\n * - Rejected files trigger `onAttachmentReject` with appropriate reasons.\n *\n * Submit\n * - `onSubmit` receives both message text and attachments array.\n * - `clearOnSubmit` controls whether attachments are cleared after submission.\n *\n * Accessibility\n * - Consumers should label the `Textarea` via `aria-label`/`aria-labelledby`.\n * - `aria-expanded` on the root reflects the disclosure state of the input area.\n * - Dropzone provides proper ARIA attributes for drag and drop operations.\n */\ninterface RootProps extends ComponentPropsWithout<'div', RemovedProps | 'onSubmit'>, 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: onValueChangeProp,\n open: openProp,\n defaultOpen = false,\n onOpenChange: onOpenChangeProp,\n expandOn = 'both',\n minLines = 3,\n maxLines = 6,\n sendMode = 'whenDirty',\n disabled,\n readOnly,\n onSubmit,\n size = '2',\n variant,\n color,\n radius,\n panelBackground,\n material,\n width,\n maxWidth,\n asChild,\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 ...divProps\n } = props;\n const effectiveMaterial = material || panelBackground;\n\n const isValueControlled = valueProp != null;\n const [valueUncontrolled, setValueUncontrolled] = React.useState<string>(defaultValue);\n const value = isValueControlled ? (valueProp as string) : valueUncontrolled;\n\n const isOpenControlled = openProp != null;\n const [openUncontrolled, setOpenUncontrolled] = React.useState<boolean>(defaultOpen);\n const open = isOpenControlled ? (openProp as boolean) : openUncontrolled;\n\n const rootRef = React.useRef<HTMLDivElement>(null);\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n const fileDialogOpenRef = React.useRef<boolean>(false);\n\n // Attachments state\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 ?? []) as ChatbarAttachment[]) : attachmentsUncontrolled),\n [isAttachmentsControlled, attachmentsProp, attachmentsUncontrolled],\n );\n\n // Track generated object URLs for cleanup\n const generatedUrlSetRef = React.useRef<Set<string>>(new Set());\n\n const toArray = (val: string | string[] | undefined) => (Array.isArray(val) ? val : typeof val === 'string' ? val.split(',').map((s) => s.trim()) : []);\n\n const accepts = toArray(accept);\n const pasteAccepts = toArray(pasteAccept).length > 0 ? toArray(pasteAccept) : accepts;\n\n const 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\n // Refs for values that change frequently, read inside stable callbacks\n const attachmentsRef = React.useRef(attachments);\n attachmentsRef.current = attachments;\n const acceptsRef = React.useRef(accepts);\n acceptsRef.current = accepts;\n const pasteAcceptsRef = React.useRef(pasteAccepts);\n pasteAcceptsRef.current = pasteAccepts;\n const maxAttachmentsRef = React.useRef(maxAttachments);\n maxAttachmentsRef.current = maxAttachments;\n const maxFileSizeRef = React.useRef(maxFileSize);\n maxFileSizeRef.current = maxFileSize;\n const onAttachmentRejectRef = React.useRef(onAttachmentReject);\n onAttachmentRejectRef.current = onAttachmentReject;\n const onAttachmentsChangeRef = React.useRef(onAttachmentsChange);\n onAttachmentsChangeRef.current = onAttachmentsChange;\n const onOpenChangePropRef = React.useRef(onOpenChangeProp);\n onOpenChangePropRef.current = onOpenChangeProp;\n\n const appendFiles = React.useCallback((files: File[]) => {\n const currentAttachments = attachmentsRef.current;\n const currentAccepts = acceptsRef.current;\n const currentMaxAttachments = maxAttachmentsRef.current;\n const currentMaxFileSize = maxFileSizeRef.current;\n\n const next: ChatbarAttachment[] = [];\n const rejected: { file: File; reason: 'type' | 'size' | 'count' }[] = [];\n const remainingSlots = typeof currentMaxAttachments === 'number' ? Math.max(currentMaxAttachments - currentAttachments.length, 0) : Infinity;\n\n for (const file of files) {\n if (next.length >= remainingSlots) {\n rejected.push({ file, reason: 'count' });\n continue;\n }\n if (typeof currentMaxFileSize === 'number' && file.size > currentMaxFileSize) {\n rejected.push({ file, reason: 'size' });\n continue;\n }\n if (!matchesAccept(file, currentAccepts)) {\n rejected.push({ file, reason: 'type' });\n continue;\n }\n const id = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;\n const looksLikeImageByExt = /\\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(file.name);\n const isImageType = (file.type || '').toLowerCase().startsWith('image/');\n const url = isImageType || looksLikeImageByExt ? URL.createObjectURL(file) : undefined;\n if (url) generatedUrlSetRef.current.add(url);\n next.push({ id, name: file.name, size: file.size, type: file.type, file, url, status: 'idle' });\n }\n\n if (next.length > 0) {\n const merged = currentAttachments.concat(next);\n if (!isAttachmentsControlled) setAttachmentsUncontrolled(merged);\n onAttachmentsChangeRef.current?.(merged);\n if (!isOpenControlled) setOpenUncontrolled(true);\n onOpenChangePropRef.current?.(true);\n }\n if (rejected.length > 0) onAttachmentRejectRef.current?.(rejected);\n }, [isAttachmentsControlled, isOpenControlled]);\n\n const appendFilesFromPaste = React.useCallback((files: File[]) => {\n const currentAccepts = acceptsRef.current;\n const currentPasteAccepts = pasteAcceptsRef.current;\n const currentMaxAttachments = maxAttachmentsRef.current;\n const currentMaxFileSize = maxFileSizeRef.current;\n const currentAttachments = attachmentsRef.current;\n\n const patterns = currentPasteAccepts.length > 0 ? currentPasteAccepts : currentAccepts;\n const acceptedFiles: File[] = [];\n const rejected: { file: File; reason: 'type' | 'size' | 'count' }[] = [];\n const remainingSlots = typeof currentMaxAttachments === 'number' ? Math.max(currentMaxAttachments - currentAttachments.length, 0) : Infinity;\n\n for (const file of files) {\n if (acceptedFiles.length >= remainingSlots) {\n rejected.push({ file, reason: 'count' });\n continue;\n }\n if (typeof currentMaxFileSize === 'number' && file.size > currentMaxFileSize) {\n rejected.push({ file, reason: 'size' });\n continue;\n }\n if (!matchesAccept(file, patterns)) {\n rejected.push({ file, reason: 'type' });\n continue;\n }\n acceptedFiles.push(file);\n }\n if (acceptedFiles.length > 0) appendFiles(acceptedFiles);\n if (rejected.length > 0) onAttachmentRejectRef.current?.(rejected);\n }, [appendFiles]);\n\n // Revoke object URLs that are no longer referenced by current attachments\n React.useEffect(() => {\n const currentUrls = new Set(attachments.map((a) => a.url).filter(Boolean) as string[]);\n for (const url of Array.from(generatedUrlSetRef.current)) {\n if (!currentUrls.has(url)) {\n URL.revokeObjectURL(url);\n generatedUrlSetRef.current.delete(url);\n }\n }\n }, [attachments]);\n\n // Revoke any remaining generated URLs on unmount\n React.useEffect(() => {\n const urlSet = generatedUrlSetRef.current;\n return () => {\n for (const url of Array.from(urlSet)) {\n URL.revokeObjectURL(url);\n }\n urlSet.clear();\n };\n }, []);\n\n const Comp = asChild ? Slot : ('div' as any);\n\n // Stable context setters \u2014 avoids new function references on every render\n const handleSetOpen = React.useCallback(\n (next: boolean) => {\n if (!isOpenControlled) setOpenUncontrolled(next);\n onOpenChangeProp?.(next);\n },\n [isOpenControlled, onOpenChangeProp],\n );\n const handleSetValue = React.useCallback(\n (next: string) => {\n if (!isValueControlled) setValueUncontrolled(next);\n onValueChangeProp?.(next);\n },\n [isValueControlled, onValueChangeProp],\n );\n const handleSetAttachments = React.useCallback(\n (next: ChatbarAttachment[]) => {\n if (!isAttachmentsControlled) setAttachmentsUncontrolled(next);\n onAttachmentsChange?.(next);\n },\n [isAttachmentsControlled, onAttachmentsChange],\n );\n\n const handleBlurCapture = React.useCallback(\n (event: React.FocusEvent) => {\n const nextTarget = event.relatedTarget as Node | null;\n const rootEl = rootRef.current;\n if (!rootEl) return;\n // If focus remains within root, ignore\n if (nextTarget && rootEl.contains(nextTarget)) return;\n // If native file dialog is open, avoid collapsing on blur\n if (fileDialogOpenRef.current) return;\n // Collapse when leaving the root if the value is empty\n // Only collapse when both message and attachments are empty\n if ((value?.trim?.() ?? '').length === 0 && attachments.length === 0) {\n if (!isOpenControlled) setOpenUncontrolled(false);\n onOpenChangeProp?.(false);\n }\n },\n [isOpenControlled, onOpenChangeProp, value, attachments],\n );\n\n // Dropzone functionality\n const {\n getRootProps,\n getInputProps,\n isDragActive,\n open: openFileDialog,\n } = useDropzone({\n onDrop: (acceptedFiles, rejectedFiles) => {\n if (acceptedFiles.length > 0) {\n appendFiles(acceptedFiles);\n }\n if (rejectedFiles.length > 0 && onAttachmentReject) {\n const rejections = rejectedFiles.map(({ file, errors }) => {\n const reason = errors[0]?.code === 'file-too-large' ? 'size' : errors[0]?.code === 'file-invalid-type' ? 'type' : 'count';\n return { file, reason: reason as 'type' | 'size' | 'count' };\n });\n onAttachmentReject(rejections);\n }\n },\n accept:\n accepts.length > 0\n ? accepts.reduce(\n (acc, pattern) => {\n if (pattern.includes('/')) {\n // MIME type pattern\n acc[pattern] = [];\n } else if (pattern.startsWith('.')) {\n // File extension pattern\n acc[pattern] = [];\n }\n return acc;\n },\n {} as Record<string, string[]>,\n )\n : undefined,\n multiple,\n maxSize: maxFileSize,\n noClick: true,\n noKeyboard: true,\n disabled: !dropzone || disabled,\n });\n\n // Expose imperative API via apiRef (non-breaking; forwardedRef still receives the DOM node)\n React.useImperativeHandle(\n apiRef,\n () => ({\n focusTextarea: () => textareaRef.current?.focus({ preventScroll: true }),\n openFilePicker: () => {\n // Guard against blur-collapse while native dialog is open\n fileDialogOpenRef.current = true;\n openFileDialog();\n },\n }),\n [openFileDialog],\n );\n\n // Click-to-focus: focus textarea when clicking non-interactive areas inside the container\n const isInteractiveTarget = React.useCallback((target: EventTarget | null) => {\n if (!(target instanceof Element)) return false;\n const el = target as Element;\n if (el.closest('.rt-ChatbarDropOverlay')) return true;\n return !!el.closest('button, [role=\"button\"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex=\"-1\"])');\n }, []);\n\n const handleContainerPointerDown = React.useCallback(\n (event: React.PointerEvent) => {\n if (disabled) return;\n if (isInteractiveTarget(event.target)) return;\n if (event.pointerType === 'mouse' && event.button !== 0) return;\n event.preventDefault();\n textareaRef.current?.focus({ preventScroll: true });\n },\n [disabled, isInteractiveTarget, textareaRef],\n );\n\n // Clicking the label-wrapped Card will naturally focus the nested textarea.\n\n return (\n <ChatbarContext.Provider\n value={React.useMemo<ChatbarContextValue>(\n () => ({\n open,\n setOpen: handleSetOpen,\n isOpenControlled,\n value,\n setValue: handleSetValue,\n isValueControlled,\n size,\n expandOn,\n minLines,\n maxLines,\n sendMode,\n disabled,\n readOnly,\n onSubmit,\n rootRef,\n textareaRef,\n attachments,\n setAttachments: handleSetAttachments,\n isAttachmentsControlled,\n accept,\n multiple,\n maxAttachments,\n maxFileSize,\n paste,\n pasteAccept,\n clearOnSubmit,\n onAttachmentReject,\n dropzone,\n appendFiles,\n appendFilesFromPaste,\n fileDialogOpenRef,\n }),\n [\n open, handleSetOpen, isOpenControlled,\n value, handleSetValue, isValueControlled,\n size, expandOn, minLines, maxLines, sendMode,\n disabled, readOnly, onSubmit,\n attachments, handleSetAttachments, isAttachmentsControlled,\n accept, multiple, maxAttachments, maxFileSize,\n paste, pasteAccept, clearOnSubmit, onAttachmentReject,\n dropzone, appendFiles, appendFilesFromPaste,\n ],\n )}\n >\n <LazyMotion features={domAnimation}>\n <Comp\n {...divProps}\n ref={(node: HTMLDivElement) => {\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) (forwardedRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n (rootRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }}\n className={classNames('rt-ChatbarRoot', `rt-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={dropzone && isDragActive ? '' : undefined}\n data-accent-color={color}\n data-radius={radius as any}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n aria-expanded={open}\n onBlurCapture={handleBlurCapture}\n >\n {dropzone && <input {...getInputProps()} />}\n <div {...(dropzone ? getRootProps() : {})} style={{ width: '100%', height: '100%' }} onPointerDown={handleContainerPointerDown}>\n <m.div\n className={classNames('rt-ChatbarBox', `rt-variant-${variant ?? 'surface'}`)}\n style={{ position: 'relative' }}\n data-accent-color={color}\n data-radius={radius as any}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n layout\n transition={{\n layout: {\n type: 'spring',\n visualDuration: 0.15,\n bounce: 0.1,\n },\n }}\n >\n <m.div\n className=\"rt-ChatbarGrid\"\n layout=\"position\"\n transition={{\n layout: {\n type: 'spring',\n visualDuration: 0.15,\n bounce: 0.1,\n },\n }}\n >\n {children}\n </m.div>\n {dropzone && isDragActive && (\n <div className=\"rt-ChatbarDropOverlay\">\n <div className=\"rt-ChatbarDropContent\">\n <Text color=\"gray\" size={size} weight=\"medium\">\n Drop files here to attach\n </Text>\n </div>\n </div>\n )}\n </m.div>\n </div>\n </Comp>\n </LazyMotion>\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'> {\n asChild?: boolean;\n /**\n * Handler for paste events. This is forwarded to the underlying <textarea>.\n */\n onPaste?: React.ClipboardEventHandler<HTMLTextAreaElement>;\n /**\n * When true, pressing Enter submits via onSend (Shift+Enter inserts newline).\n * 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. We intentionally do not\n * update state in onInput to avoid duplicate updates per keystroke.\n * - Auto-resizes between minLines and maxLines using layout measurements.\n * - When expandOn is `overflow` or `both`, the Chatbar opens as soon as the\n * content exceeds the compact height.\n * - Height recalculations occur on change, paste, and whenever `value` or `open`\n * changes via an isomorphic layout effect to avoid SSR warnings.\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 { className, style, asChild, onFocus, onInput, onChange, onPaste, onKeyDown, submitOnEnter = false, rows, ...textareaProps } = props;\n const ctx = useChatbarContext();\n const { open, minLines, maxLines, expandOn, disabled, readOnly, setOpen, setValue, textareaRef, value, isValueControlled, sendMode, paste, appendFilesFromPaste, size } = ctx;\n\n // Cached metrics to avoid repeated getComputedStyle calls\n const lineHeightRef = React.useRef<number>(0);\n const paddingRef = React.useRef<number>(0);\n const compactHeightRef = React.useRef<number>(0);\n\n const recomputeMetrics = React.useCallback(() => {\n const el = textareaRef.current;\n if (!el) return;\n const computedStyle = window.getComputedStyle(el);\n const lineHeight = parseFloat(computedStyle.lineHeight) || 20;\n const paddingTop = parseFloat(computedStyle.paddingTop) || 0;\n const paddingBottom = parseFloat(computedStyle.paddingBottom) || 0;\n lineHeightRef.current = lineHeight;\n paddingRef.current = paddingTop + paddingBottom;\n compactHeightRef.current = Math.ceil(1 * lineHeight) + paddingTop + paddingBottom;\n }, [textareaRef]);\n\n // Auto-resize logic - optimized for fixed widths\n const updateHeight = React.useCallback(\n (forceOpen?: boolean) => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n\n textarea.style.height = 'auto';\n\n if (lineHeightRef.current === 0) {\n recomputeMetrics();\n }\n const lineHeight = lineHeightRef.current;\n const padding = paddingRef.current;\n\n const isOpen = forceOpen ?? open;\n const effectiveMinLines = isOpen ? minLines : 1;\n const effectiveMaxLines = isOpen ? maxLines : 1;\n\n const minHeight = Math.ceil(effectiveMinLines * lineHeight) + padding;\n const maxHeight = Math.ceil(effectiveMaxLines * lineHeight) + padding;\n\n const contentHeight = Math.max(textarea.scrollHeight, minHeight);\n const finalHeight = Math.min(contentHeight, maxHeight);\n\n textarea.style.height = `${finalHeight}px`;\n\n if (contentHeight > maxHeight) {\n textarea.style.overflowY = 'auto';\n textarea.style.maxHeight = `${maxHeight}px`;\n } else {\n textarea.style.overflowY = 'hidden';\n textarea.style.maxHeight = 'none';\n }\n },\n [open, minLines, maxLines, textareaRef, recomputeMetrics],\n );\n\n // Update height when value or open state changes\n useIsomorphicLayoutEffect(() => {\n updateHeight();\n }, [updateHeight, value, open]);\n\n // Auto-open on external value changes when content overflows one line\n useIsomorphicLayoutEffect(() => {\n if (!(expandOn === 'overflow' || expandOn === 'both')) return;\n if (open) return;\n const el = textareaRef.current;\n if (!el) return;\n // Measure overflow against compact (1-line) height\n el.style.height = 'auto';\n if (compactHeightRef.current === 0) {\n recomputeMetrics();\n }\n const shouldExpand = el.scrollHeight > compactHeightRef.current + 1;\n if (shouldExpand) {\n setOpen(true);\n // Immediately size for open state\n updateHeight(true);\n requestAnimationFrame(() => updateHeight(true));\n }\n }, [value, expandOn, open, setOpen, textareaRef, recomputeMetrics, updateHeight]);\n\n // Recompute metrics on mount and when size changes may affect typography\n useIsomorphicLayoutEffect(() => {\n recomputeMetrics();\n updateHeight();\n }, [recomputeMetrics, updateHeight, size]);\n\n // Observe responsive changes that alter line-height\n React.useEffect(() => {\n const el = textareaRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n let prevLineHeight = lineHeightRef.current;\n const ro = new ResizeObserver(() => {\n const computedStyle = window.getComputedStyle(el);\n const lh = parseFloat(computedStyle.lineHeight) || 20;\n if (lh !== prevLineHeight) {\n prevLineHeight = lh;\n recomputeMetrics();\n requestAnimationFrame(() => updateHeight());\n }\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, [textareaRef, recomputeMetrics, updateHeight]);\n\n // Dev-only warning if no accessible name is provided\n React.useEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n const hasLabel = textareaProps['aria-label'] != null || textareaProps['aria-labelledby'] != null;\n if (!hasLabel) {\n console.warn('[Chatbar.Textarea] Provide aria-label or aria-labelledby 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 // Note: No MutationObserver is used because <textarea> value changes are not\n // reflected in DOM text nodes. Height updates are handled by effects and events.\n\n const handleFocus = React.useCallback<React.FocusEventHandler<HTMLTextAreaElement>>(\n (event) => {\n if (disabled || readOnly) return;\n if ((expandOn === 'focus' || expandOn === 'both') && !open) setOpen(true);\n onFocus?.(event);\n },\n [disabled, readOnly, expandOn, open, setOpen, onFocus],\n );\n\n const handleChange = React.useCallback<React.ChangeEventHandler<HTMLTextAreaElement>>(\n (event) => {\n const el = event.currentTarget;\n const nextValue = el.value;\n setValue(nextValue);\n\n if ((expandOn === 'overflow' || expandOn === 'both') && !open) {\n el.style.height = 'auto';\n\n if (compactHeightRef.current === 0) {\n recomputeMetrics();\n }\n const shouldExpand = el.scrollHeight > compactHeightRef.current + 1;\n if (shouldExpand) {\n setOpen(true);\n // Immediately size for open state to avoid 1-line + scrollbar flash\n updateHeight(true);\n requestAnimationFrame(() => updateHeight(true));\n }\n }\n\n // Always recalc after any input\n requestAnimationFrame(() => updateHeight());\n onChange?.(event);\n },\n [expandOn, open, setOpen, setValue, onChange, updateHeight, recomputeMetrics],\n );\n\n const handlePaste = React.useCallback<React.ClipboardEventHandler<HTMLTextAreaElement>>(\n (event) => {\n // Attach files from clipboard if enabled\n if (paste) {\n const items = Array.from(event.clipboardData?.items ?? []);\n const files = items\n .filter((i) => i.kind === 'file')\n .map((i) => i.getAsFile())\n .filter((f): f is File => !!f);\n if (files.length > 0) {\n // Prevent pasting the file name or any text representation when files are present\n event.preventDefault();\n appendFilesFromPaste(files);\n }\n }\n setTimeout(() => {\n // If pasting in compact mode, force sizing as open if content overflowed\n if (!open) {\n updateHeight(true);\n } else {\n updateHeight();\n }\n }, 0);\n onPaste?.(event);\n },\n [paste, open, updateHeight, onPaste, appendFilesFromPaste],\n );\n\n const handleKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLTextAreaElement>>(\n (event) => {\n if (!submitOnEnter) {\n onKeyDown?.(event);\n return;\n }\n if (event.key === 'Enter' && !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey && !event.nativeEvent.isComposing) {\n if (disabled || readOnly) {\n onKeyDown?.(event);\n return;\n }\n if (sendMode === 'never') {\n onKeyDown?.(event);\n return;\n }\n const trimmed = value.trim();\n const hasContent = trimmed.length > 0 || ctx.attachments.length > 0;\n if (sendMode === 'whenDirty' && !hasContent) {\n onKeyDown?.(event);\n return;\n }\n event.preventDefault();\n ctx.onSubmit?.({ value, attachments: ctx.attachments });\n if (ctx.clearOnSubmit) {\n if (!isValueControlled) setValue('');\n ctx.setAttachments([]);\n }\n }\n onKeyDown?.(event);\n },\n [submitOnEnter, disabled, readOnly, sendMode, value, isValueControlled, setValue, ctx, onKeyDown],\n );\n\n const Comp = asChild ? Slot : ('textarea' as any);\n return (\n <m.div \n className={classNames('rt-ChatbarField', 'rt-ChatbarTextarea', className)}\n layout=\"position\"\n transition={{\n layout: {\n type: 'spring',\n visualDuration: 0.15,\n bounce: 0.1,\n },\n }}\n >\n <Comp\n {...textareaProps}\n ref={(node: HTMLTextAreaElement) => {\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) (forwardedRef as React.MutableRefObject<HTMLTextAreaElement | null>).current = node;\n (textareaRef as React.MutableRefObject<HTMLTextAreaElement | null>).current = node;\n }}\n className=\"rt-ChatbarInput\"\n value={value}\n onInput={onInput}\n onChange={handleChange}\n onFocus={handleFocus}\n onPaste={handlePaste}\n onKeyDown={handleKeyDown}\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 </m.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, style, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (ctx.open) return null;\n const Comp = asChild ? Slot : ('div' as any);\n return (\n <Comp {...divProps} ref={forwardedRef} className={classNames('rt-ChatbarInlineStart', className)} style={style}>\n {children}\n </Comp>\n );\n});\nInlineStart.displayName = 'Chatbar.InlineStart';\n\nconst InlineEnd = React.forwardRef<HTMLDivElement, InlineSlotProps>((props, forwardedRef) => {\n const { children, asChild, style, className, ...divProps } = props;\n const ctx = useChatbarContext();\n // Use CSS to hide when open instead of unmounting to avoid layout animation scale\n if (ctx.open) return null;\n const Comp = asChild ? Slot : ('div' as any);\n return (\n <Comp {...divProps} ref={forwardedRef} className={classNames('rt-ChatbarInlineEnd', className)} style={style}>\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 */\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}\n\nconst AttachmentsRow = React.forwardRef<HTMLDivElement, AttachmentsRowProps>((props, forwardedRef) => {\n const { asChild, forceMount, renderAttachment, className, style, ...divProps } = props;\n const ctx = useChatbarContext();\n const hasItems = ctx.attachments.length > 0;\n if (!hasItems && !forceMount) return null;\n const Comp = asChild ? Slot : ('div' as any);\n return (\n <m.div\n layout=\"position\"\n transition={{\n layout: {\n type: 'spring',\n visualDuration: 0.15,\n bounce: 0.1,\n },\n }}\n >\n <Comp {...divProps} ref={forwardedRef} className={classNames('rt-ChatbarAttachmentsRow', className)} style={style} role=\"list\" aria-label={divProps['aria-label'] ?? 'Attachments'}>\n <ScrollArea className=\"rt-ChatbarScrollArea\" scrollbars=\"horizontal\" size=\"1\">\n <Flex align=\"center\" gap=\"2\" style={{ minWidth: 'fit-content' }}>\n {ctx.attachments.map((att) => (\n <Attachment key={att.id} attachment={att} asChild={!!renderAttachment}>\n {renderAttachment?.(att)}\n </Attachment>\n ))}\n </Flex>\n </ScrollArea>\n </Comp>\n </m.div>\n );\n});\nAttachmentsRow.displayName = 'Chatbar.AttachmentsRow';\n\n/** Default tile renderer for a single attachment. */\ninterface AttachmentProps extends React.ComponentPropsWithoutRef<'div'> {\n attachment: ChatbarAttachment;\n asChild?: boolean;\n}\n\nconst Attachment = React.forwardRef<HTMLDivElement, AttachmentProps>((props, forwardedRef) => {\n const { attachment, asChild, className, style, children, ...divProps } = props;\n const ctx = useChatbarContext();\n const Comp = asChild ? Slot : ('div' as any);\n const isImage = !!attachment.url && attachment.type.startsWith('image/');\n return (\n <Comp {...divProps} ref={forwardedRef} className={classNames('rt-ChatbarAttachment', className)} style={style} role=\"listitem\" data-kind={isImage ? 'image' : 'file'} title={attachment.name}>\n {children ?? (\n // <Card size={ctx.size} variant=\"surface\">\n <Flex align=\"center\" gap=\"2\" pr={!isImage ? '6' : undefined}>\n <div className=\"rt-ChatbarAttachmentPreview\" aria-hidden>\n {isImage ? <img className=\"rt-ChatbarAttachmentImage\" src={attachment.url} alt=\"\" /> : <FileTextIcon />}\n </div>\n {!isImage && (\n <Flex direction=\"column\" gap=\"0\" style={{ minWidth: 0 }}>\n <Text size={ctx.size} weight=\"medium\" style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>\n {attachment.name}\n </Text>\n <Text size=\"1\" color=\"gray\">\n {Math.ceil(attachment.size / 1024)} KB\n </Text>\n </Flex>\n )}\n <IconButton\n className=\"rt-ChatbarAttachmentRemove\"\n aria-label={`Remove ${attachment.name}`}\n size=\"1\"\n // size={ctx.size}\n variant=\"classic\"\n highContrast\n color=\"gray\"\n onClick={() => ctx.setAttachments(ctx.attachments.filter((a) => a.id !== attachment.id))}\n >\n <CloseIcon />\n </IconButton>\n </Flex>\n // </Card>\n )}\n </Comp>\n );\n});\nAttachment.displayName = 'Chatbar.Attachment';\n\ninterface AttachTriggerProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n accept?: string | string[];\n multiple?: boolean;\n}\n\nconst AttachTrigger = React.forwardRef<HTMLButtonElement, AttachTriggerProps>((props, forwardedRef) => {\n const { asChild, accept, multiple, className, style, ...buttonProps } = props;\n const ctx = useChatbarContext();\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n const Comp = asChild ? Slot : ('button' as any);\n // Prefer Chatbar.Root's accept when a local accept is not provided\n const mergedAccept = accept ?? ctx.accept;\n const actualAccept = (Array.isArray(mergedAccept) ? mergedAccept : (mergedAccept?.split(',') ?? [])).join(',');\n React.useEffect(() => {\n const handleWindowFocus = () => {\n // Reset guard when window regains focus after file dialog closes\n ctx.fileDialogOpenRef.current = false;\n };\n window.addEventListener('focus', handleWindowFocus);\n return () => window.removeEventListener('focus', handleWindowFocus);\n }, [ctx.fileDialogOpenRef]);\n return (\n <>\n <Comp\n {...(buttonProps as any)}\n ref={forwardedRef as any}\n className={classNames('rt-ChatbarAttachTrigger', className)}\n style={style}\n type={buttonProps.type ?? 'button'}\n aria-label={buttonProps['aria-label'] ?? 'Add attachments'}\n onPointerDown={(e: any) => {\n // Set guard before blur occurs (Safari fires blur before click)\n ctx.fileDialogOpenRef.current = true;\n buttonProps.onPointerDown?.(e);\n }}\n onMouseDown={(e: any) => {\n // Fallback for environments without Pointer Events\n ctx.fileDialogOpenRef.current = true;\n buttonProps.onMouseDown?.(e);\n }}\n onClick={(e: any) => {\n // Ensure file input opens reliably by clicking it first\n ctx.fileDialogOpenRef.current = true;\n if (inputRef.current) {\n inputRef.current.click();\n }\n // Then call user's onClick if provided\n buttonProps.onClick?.(e);\n }}\n />\n <input\n ref={inputRef}\n type=\"file\"\n accept={actualAccept}\n multiple={multiple ?? ctx.multiple}\n tabIndex={-1}\n style={{ display: 'none' }}\n onChange={(e) => {\n const files = Array.from(e.currentTarget.files ?? []);\n if (files.length > 0) {\n ctx.appendFiles(files);\n }\n // File dialog closed; allow normal blur handling\n ctx.fileDialogOpenRef.current = false;\n // Reset input value to allow selecting the same file again\n e.currentTarget.value = '';\n }}\n />\n </>\n );\n});\nAttachTrigger.displayName = 'Chatbar.AttachTrigger';\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, style, ...divProps } = props;\n const ctx = useChatbarContext();\n if (!ctx.open) return null;\n const Comp = asChild ? Slot : ('div' as any);\n return (\n <m.div\n layout=\"position\"\n transition={{\n layout: {\n type: 'spring',\n visualDuration: 0.15,\n bounce: 0.1,\n },\n }}\n >\n <Comp {...divProps} ref={forwardedRef} className={classNames('rt-ChatbarRow', className)} style={style}>\n <Flex align=\"center\" justify=\"between\" width=\"100%\">\n {children}\n </Flex>\n </Comp>\n </m.div>\n );\n});\nRow.displayName = 'Chatbar.Row';\n\nconst RowStart = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, forwardedRef) => {\n const { className, style, ...divProps } = props;\n return <div {...divProps} ref={forwardedRef} className={classNames('rt-ChatbarRowStart', className)} style={style} />;\n});\nRowStart.displayName = 'Chatbar.RowStart';\n\nconst RowEnd = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, forwardedRef) => {\n const { className, style, ...divProps } = props;\n return <div {...divProps} ref={forwardedRef} className={classNames('rt-ChatbarRowEnd', className)} style={style} />;\n});\nRowEnd.displayName = 'Chatbar.RowEnd';\n\ntype SendProps = Omit<IconButtonProps, 'aria-label' | 'aria-labelledby'> & {\n /** Optional override for accessible name. Defaults to \"Send\". */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n asChild?: boolean;\n clearOnSend?: boolean;\n};\n\nconst Send = React.forwardRef<HTMLButtonElement, SendProps>((props, forwardedRef) => {\n const { asChild, clearOnSend = true, disabled, children, className, style, size: sizeProp, variant: variantProp, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, ...buttonProps } = props;\n const ctx = useChatbarContext();\n\n const trimmed = ctx.value.trim();\n const hasContent = trimmed.length > 0 || ctx.attachments.length > 0;\n const visible = ctx.sendMode === 'always' || (ctx.sendMode === 'whenDirty' && hasContent);\n if (ctx.sendMode === 'never') return null;\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (ctx.disabled || ctx.readOnly) return;\n ctx.onSubmit?.({ value: ctx.value, attachments: ctx.attachments });\n if (clearOnSend) {\n if (!ctx.isValueControlled) ctx.setValue('');\n if (ctx.clearOnSubmit) ctx.setAttachments([]);\n }\n buttonProps.onClick?.(event);\n };\n\n return (\n <IconButton\n {...(buttonProps as any)}\n ref={forwardedRef as any}\n size={sizeProp ?? ctx.size}\n variant={variantProp ?? (ctx.open ? 'solid' : 'ghost')}\n disabled={disabled || ctx.disabled || ctx.readOnly}\n className={classNames('rt-ChatbarSend', className)}\n style={{\n opacity: visible ? 1 : 0,\n pointerEvents: visible ? 'auto' : 'none',\n ...style,\n }}\n asChild={asChild}\n onClick={handleClick}\n aria-label={ariaLabel ?? (ariaLabelledby ? undefined : 'Send')}\n aria-labelledby={ariaLabelledby}\n >\n {children ?? (\n <svg\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 className=\"lucide lucide-arrow-right-icon lucide-arrow-right\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n )}\n </IconButton>\n );\n});\nSend.displayName = 'Chatbar.Send';\n\nexport { Root, Textarea, InlineStart, InlineEnd, AttachmentsRow, Attachment, AttachTrigger, Row, RowStart, RowEnd, Send };\nexport type { RootProps as ChatbarRootProps, TextareaProps as ChatbarTextareaProps, RowProps as ChatbarRowProps, SendProps as ChatbarSendProps, ChatbarAttachment };\n"],
|
|
5
|
-
"mappings": "sSAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,GAAA,eAAAC,GAAA,mBAAAC,GAAA,cAAAC,GAAA,gBAAAC,GAAA,SAAAC,GAAA,QAAAC,GAAA,WAAAC,GAAA,aAAAC,GAAA,SAAAC,GAAA,aAAAC,KAAA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,cAAAC,GAAY,gBAAAC,GAAc,KAAAC,OAAS,eAS5C,OAAS,eAAAC,OAAmB,iBAI5B,IAAMC,GAA4B,OAAO,OAAW,IAAoB,kBAAwB,YA6E1FC,GAAuB,gBAA0C,IAAI,EACrEC,EAAoB,IAAM,CAC9B,IAAMC,EAAY,aAAWF,EAAc,EAC3C,GAAI,CAACE,EAAK,MAAM,IAAI,MAAM,0DAA0D,EACpF,OAAOA,CACT,EAgIMC,GAAa,aAAmC,CAACC,EAAOC,IAAiB,CAC7E,GAAM,CACJ,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,MAAOC,EACP,aAAAC,EAAe,GACf,cAAeC,EACf,KAAMC,EACN,YAAAC,EAAc,GACd,aAAcC,EACd,SAAAC,EAAW,OACX,SAAAC,EAAW,EACX,SAAAC,EAAW,EACX,SAAAC,EAAW,YACX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AK,EACJ,OAAS,GAAKA,EAAI,YAAY,OAAS,EAC5D2M,EAAU3M,EAAI,WAAa,UAAaA,EAAI,WAAa,aAAe4K,EAC9E,GAAI5K,EAAI,WAAa,QAAS,OAAO,KAErC,IAAM4M,EAAe/F,GAA+C,CAC9D7G,EAAI,UAAYA,EAAI,WACxBA,EAAI,WAAW,CAAE,MAAOA,EAAI,MAAO,YAAaA,EAAI,WAAY,CAAC,EAC7DsM,IACGtM,EAAI,mBAAmBA,EAAI,SAAS,EAAE,EACvCA,EAAI,eAAeA,EAAI,eAAe,CAAC,CAAC,GAE9C4L,EAAY,UAAU/E,CAAK,EAC7B,EAEA,OACE,gBAAC4E,GAAA,CACE,GAAIG,EACL,IAAKzL,EACL,KAAMoM,GAAYvM,EAAI,KACtB,QAASwM,IAAgBxM,EAAI,KAAO,QAAU,SAC9C,SAAUiB,GAAYjB,EAAI,UAAYA,EAAI,SAC1C,UAAWiI,EAAW,iBAAkB7H,CAAS,EACjD,MAAO,CACL,QAASuM,EAAU,EAAI,EACvB,cAAeA,EAAU,OAAS,OAClC,GAAGtM,CACL,EACA,QAASuB,EACT,QAASgL,EACT,aAAYH,IAAcC,EAAiB,OAAY,QACvD,kBAAiBA,GAEhBpM,GACC,gBAAC,OACC,MAAM,6BACN,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,OAAO,eACP,YAAY,IACZ,cAAc,QACd,eAAe,QACf,UAAU,qDAEV,gBAAC,QAAK,EAAE,WAAW,EACnB,gBAAC,QAAK,EAAE,gBAAgB,CAC1B,CAEJ,CAEJ,CAAC,EACD+L,GAAK,YAAc",
|
|
6
|
-
"names": ["chatbar_exports", "__export", "AttachTrigger", "Attachment", "AttachmentsRow", "InlineEnd", "InlineStart", "Root", "Row", "RowEnd", "RowStart", "Send", "Textarea", "React", "classNames", "LazyMotion", "domAnimation", "m", "useDropzone", "useIsomorphicLayoutEffect", "ChatbarContext", "useChatbarContext", "ctx", "Root", "props", "forwardedRef", "className", "style", "children", "valueProp", "defaultValue", "onValueChangeProp", "openProp", "defaultOpen", "onOpenChangeProp", "expandOn", "minLines", "maxLines", "sendMode", "disabled", "readOnly", "onSubmit", "size", "variant", "color", "radius", "panelBackground", "material", "width", "maxWidth", "asChild", "attachmentsProp", "defaultAttachments", "onAttachmentsChange", "accept", "multiple", "maxAttachments", "maxFileSize", "paste", "pasteAccept", "clearOnSubmit", "onAttachmentReject", "dropzone", "apiRef", "divProps", "effectiveMaterial", "isValueControlled", "valueUncontrolled", "setValueUncontrolled", "value", "isOpenControlled", "openUncontrolled", "setOpenUncontrolled", "open", "rootRef", "textareaRef", "fileDialogOpenRef", "isAttachmentsControlled", "attachmentsUncontrolled", "setAttachmentsUncontrolled", "attachments", "generatedUrlSetRef", "toArray", "val", "s", "accepts", "pasteAccepts", "matchesAccept", "file", "patterns", "mime", "name", "patRaw", "pat", "type", "subtype", "fmType", "fmSubtype", "attachmentsRef", "acceptsRef", "pasteAcceptsRef", "maxAttachmentsRef", "maxFileSizeRef", "onAttachmentRejectRef", "onAttachmentsChangeRef", "onOpenChangePropRef", "appendFiles", "files", "currentAttachments", "currentAccepts", "currentMaxAttachments", "currentMaxFileSize", "next", "rejected", "remainingSlots", "id", "looksLikeImageByExt", "url", "merged", "appendFilesFromPaste", "currentPasteAccepts", "acceptedFiles", "currentUrls", "a", "urlSet", "Comp", "Slot", "handleSetOpen", "handleSetValue", "handleSetAttachments", "handleBlurCapture", "event", "nextTarget", "rootEl", "getRootProps", "getInputProps", "isDragActive", "openFileDialog", "rejectedFiles", "rejections", "errors", "reason", "acc", "pattern", "isInteractiveTarget", "target", "el", "handleContainerPointerDown", "LazyMotion", "domAnimation", "node", "classNames", "m", "Text", "Textarea", "onFocus", "onInput", "onChange", "onPaste", "onKeyDown", "submitOnEnter", "rows", "textareaProps", "setOpen", "setValue", "lineHeightRef", "paddingRef", "compactHeightRef", "recomputeMetrics", "computedStyle", "lineHeight", "paddingTop", "paddingBottom", "updateHeight", "forceOpen", "textarea", "padding", "isOpen", "effectiveMinLines", "effectiveMaxLines", "minHeight", "maxHeight", "contentHeight", "finalHeight", "prevLineHeight", "ro", "lh", "handleFocus", "handleChange", "nextValue", "handlePaste", "i", "f", "handleKeyDown", "hasContent", "InlineStart", "InlineEnd", "AttachmentsRow", "forceMount", "renderAttachment", "ScrollArea", "Flex", "att", "Attachment", "attachment", "isImage", "FileTextIcon", "IconButton", "CloseIcon", "AttachTrigger", "buttonProps", "inputRef", "mergedAccept", "actualAccept", "handleWindowFocus", "e", "Row", "RowStart", "RowEnd", "Send", "clearOnSend", "sizeProp", "variantProp", "ariaLabel", "ariaLabelledby", "visible", "handleClick"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import*as e from"react";var o=e.createContext({isInsideMenu:!1});function u(n){if(n)return typeof n=="string"?n:n.initial}function s({children:n,size:i}){let t=u(i),r=e.useMemo(()=>({isInsideMenu:!0,size:t}),[t]);return e.createElement(o.Provider,{value:r},n)}function c(){return e.useContext(o)}var d={1:24,2:32};export{s as a,c as b,d as c};
|
|
2
|
-
//# sourceMappingURL=chunk-QCNUTT4R.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/_internal/menu-context.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport type { Responsive } from '../../props/prop-def.js';\n\n/**\n * Context to detect if a component is rendered inside a menu (DropdownMenu, ContextMenu, etc.)\n * Used by VirtualMenu to adjust its behavior:\n * - Skip role=\"menu\" when inside a parent menu (parent owns the role)\n * - Delegate certain keyboard handling to parent\n * - Use the correct item height based on menu size\n */\n\nexport type MenuSize = '1' | '2';\n\ninterface MenuContextValue {\n /** Whether we're inside a menu that owns the menu role */\n isInsideMenu: boolean;\n /** Menu size for calculating item heights (resolved to non-responsive value) */\n size?: MenuSize;\n}\n\nconst MenuContext = React.createContext<MenuContextValue>({ isInsideMenu: false });\n\ninterface MenuProviderProps {\n children: React.ReactNode;\n /** Menu size passed from parent (DropdownMenu.Content, ContextMenu.Content, etc.) */\n size?: Responsive<MenuSize>;\n}\n\n/** Extract the base size from a potentially responsive value */\nfunction resolveSize(size: Responsive<MenuSize> | undefined): MenuSize | undefined {\n if (!size) return undefined;\n if (typeof size === 'string') return size;\n // For responsive objects, use the 'initial' value\n return size.initial;\n}\n\nexport function MenuProvider({ children, size }: MenuProviderProps) {\n const resolvedSize = resolveSize(size);\n const value = React.useMemo(() => ({ isInsideMenu: true, size: resolvedSize }), [resolvedSize]);\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>;\n}\n\nexport function useMenuContext() {\n return React.useContext(MenuContext);\n}\n\n/** Map menu size to item height in pixels */\nexport const menuSizeToItemHeight: Record<MenuSize, number> = {\n '1': 24, // --space-5\n '2': 32, // --space-6\n};\n"],
|
|
5
|
-
"mappings": "AAEA,UAAYA,MAAW,QAoBvB,IAAMC,EAAoB,gBAAgC,CAAE,aAAc,EAAM,CAAC,EASjF,SAASC,EAAYC,EAA8D,CACjF,GAAKA,EACL,OAAI,OAAOA,GAAS,SAAiBA,EAE9BA,EAAK,OACd,CAEO,SAASC,EAAa,CAAE,SAAAC,EAAU,KAAAF,CAAK,EAAsB,CAClE,IAAMG,EAAeJ,EAAYC,CAAI,EAC/BI,EAAc,UAAQ,KAAO,CAAE,aAAc,GAAM,KAAMD,CAAa,GAAI,CAACA,CAAY,CAAC,EAC9F,OAAO,gBAACL,EAAY,SAAZ,CAAqB,MAAOM,GAAQF,CAAS,CACvD,CAEO,SAASG,GAAiB,CAC/B,OAAa,aAAWP,CAAW,CACrC,CAGO,IAAMQ,EAAiD,CAC5D,EAAK,GACL,EAAK,EACP",
|
|
6
|
-
"names": ["React", "MenuContext", "resolveSize", "size", "MenuProvider", "children", "resolvedSize", "value", "useMenuContext", "menuSizeToItemHeight"]
|
|
7
|
-
}
|