@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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Breakpoint, Responsive } from '../../props/prop-def.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a responsive value for the given breakpoint, falling back through
|
|
5
|
+
* the smaller breakpoints when the current one is not set.
|
|
6
|
+
*/
|
|
7
|
+
declare function resolveResponsiveValue<T>(value: T | Partial<Record<Breakpoint, T>> | undefined, currentBreakpoint: Breakpoint, defaultValue: T): T;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a possibly responsive value against the current viewport. Only a
|
|
10
|
+
* responsive object subscribes to breakpoint changes; a plain value costs
|
|
11
|
+
* nothing.
|
|
12
|
+
*/
|
|
13
|
+
declare function useResolvedResponsiveValue<T>(value: Responsive<T> | undefined, defaultValue: T): T;
|
|
14
|
+
type MenuMaterial = 'solid' | 'translucent';
|
|
15
|
+
/**
|
|
16
|
+
* The menu surface material. The component props win, then the nearest
|
|
17
|
+
* Theme's `material`. Theme keeps `panelBackground` in sync with `material` at
|
|
18
|
+
* the root, but a nested `<Theme material="solid">` only updates `material`,
|
|
19
|
+
* so reading the deprecated `panelBackground` from the theme gave the wrong
|
|
20
|
+
* surface there.
|
|
21
|
+
*/
|
|
22
|
+
declare function resolveMenuMaterial(material: MenuMaterial | undefined, panelBackground: MenuMaterial | undefined, theme: {
|
|
23
|
+
material: MenuMaterial;
|
|
24
|
+
panelBackground: MenuMaterial;
|
|
25
|
+
}): MenuMaterial;
|
|
26
|
+
/**
|
|
27
|
+
* Offset that lines the first item of a menu up with its anchor: the pointer
|
|
28
|
+
* for a context menu, or the sub trigger for a submenu. It cancels the content
|
|
29
|
+
* padding, which scales with the theme.
|
|
30
|
+
*/
|
|
31
|
+
declare function getMenuAlignOffset(size: string, scaling: string | undefined): number;
|
|
32
|
+
/**
|
|
33
|
+
* Converts a display shortcut such as "⌘ ⇧ P" or "Ctrl+S" into the
|
|
34
|
+
* `aria-keyshortcuts` format ("Meta+Shift+P", "Control+S").
|
|
35
|
+
*/
|
|
36
|
+
declare function toAriaKeyShortcuts(shortcut: string): string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The keyboard shortcut hint at the end of a menu item. It is hidden from
|
|
39
|
+
* assistive technology because the item exposes it through
|
|
40
|
+
* `aria-keyshortcuts` instead of reading it as part of the item name.
|
|
41
|
+
*/
|
|
42
|
+
declare function MenuShortcut({ shortcut, className }: {
|
|
43
|
+
shortcut: string;
|
|
44
|
+
className?: string;
|
|
45
|
+
}): React.JSX.Element;
|
|
46
|
+
export { resolveResponsiveValue, useResolvedResponsiveValue, resolveMenuMaterial, getMenuAlignOffset, toAriaKeyShortcuts, MenuShortcut, };
|
|
47
|
+
export type { MenuMaterial };
|
|
48
|
+
//# sourceMappingURL=base-menu.utils.d.ts.map
|
|
@@ -0,0 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EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,GACb,CAAC;AACF,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";"use client";var Z=Object.create;var R=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var se=(t,e)=>{for(var n in e)R(t,n,{get:e[n],enumerable:!0})},E=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of te(e))!re.call(t,o)&&o!==n&&R(t,o,{get:()=>e[o],enumerable:!(i=ee(e,o))||i.enumerable});return t};var y=(t,e,n)=>(n=t!=null?Z(ne(t)):{},E(e||!t||!t.__esModule?R(n,"default",{value:t,enumerable:!0}):n,t)),oe=t=>E(R({},"__esModule",{value:!0}),t);var ke={};se(ke,{MenuShortcut:()=>Ne,getMenuAlignOffset:()=>xe,resolveMenuMaterial:()=>he,resolveResponsiveValue:()=>X,toAriaKeyShortcuts:()=>Te,useResolvedResponsiveValue:()=>Se});module.exports=oe(ke);var w=y(require("react")),J=y(require("classnames"));var b=y(require("react")),I=y(require("classnames")),U=require("radix-ui");var O={asChild:{type:"boolean"}};var ie=["1","2","3","4","5","6","7","8","9"],pe=["classic","soft"],K={...O,size:{type:"enum",className:"rt-r-size",values:ie,responsive:!0},variant:{type:"enum",className:"rt-variant",values:pe,default:"classic"}};var L=y(require("classnames"));var ae=[],le=new Set;function ue(t){let e=Object.assign({},...t),n=[],i=[],o=new Set;for(let s in e){let p=e[s],l=p.values??ae,a={key:s,type:p.type,default:p.default,hasDefault:p.default!==void 0,responsive:"responsive"in p,className:p.className,customProperties:p.customProperties,parseValue:p.parseValue,values:l,valueSet:l.length>0?new Set(l):le,enumValueSet:p.type==="enum"?new Set([p.default,...l]):void 0};p.className?(n.push(a),o.add(s)):(a.hasDefault||p.type==="enum")&&i.push(a)}return{styling:n,passthrough:i,stylingKeys:o}}var fe={children:new WeakMap};function j(t){let e=fe;for(let n=0;n<t.length;n++){let i=t[n],o=e.children.get(i);o===void 0&&(o={children:new WeakMap},e.children.set(i,o)),e=o}return e.compiled??(e.compiled=ue(t))}var de=["initial","xs","sm","md","lg","xl"],S=new Set(de);function h(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var me=new Set(["initial","xs","sm","md","lg","xl"]);function d(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(me.has(e))return!0;return!1}function v(t,e,n){return e!==void 0?e.has(n):t.includes(n)}function A({className:t,customProperties:e,...n}){let i=x({allowArbitraryValues:!0,className:t,...n}),o=ce({customProperties:e,...n});return[i,o]}function x({allowArbitraryValues:t,value:e,className:n,propValues:i,propValueSet:o,parseValue:s=p=>p}){if(e){if(typeof e=="string")return v(i,o,e)?z(n,e,s):t?n:void 0;if(d(e)){let p=e,l=[];for(let a in p){if(!h(p,a)||!S.has(a))continue;let r=p[a];if(r!==void 0){if(v(i,o,r)){let u=z(n,r,s),f=a==="initial"?u:`${a}:${u}`;l.push(f)}else if(t){let u=a==="initial"?n:`${a}:${n}`;l.push(u)}}}return l.length>0?l.join(" "):""}if(t)return n}}function z(t,e,n){let i=t?"-":"",o=n(e),s=o?.startsWith("-"),p=s?"-":"",l=s?o?.substring(1):o;return`${p}${t}${i}${l}`}function ce({customProperties:t,value:e,propValues:n,propValueSet:i,parseValue:o=s=>s}){if(!e||typeof e=="string"&&v(n,i,e))return;let s;if(typeof e=="string"){let p=o(e);s={};for(let l of t)s[l]=p;return s}if(d(e)){let p=e;for(let l in p){if(!h(p,l)||!S.has(l))continue;let a=p[l];if(a===void 0||v(n,i,a))continue;let r=o(a);s??(s={});for(let u of t){let f=l==="initial"?u:`${u}-${l}`;s[f]=r}}}return s??{}}function T(...t){let e;for(let n of t)n&&(e===void 0&&(e={}),Object.assign(e,n));return e}function ye(t,e){let n=t.initial,i=!1;return e.hasDefault&&n===void 0&&(n=e.default,i=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(n)&&(n=e.default,i=!0),i?{...t,initial:n}:t}function G(t,...e){let{styling:n,passthrough:i,stylingKeys:o}=j(e),s={};for(let a in t)o.has(a)||(s[a]=t[a]);for(let a=0;a<i.length;a++){let r=i[a],u=s[r.key];if(u===void 0){r.hasDefault&&(s[r.key]=r.default);continue}r.enumValueSet!==void 0&&!r.enumValueSet.has(u)&&!d(u)&&(s[r.key]=r.default)}let p,l=[];for(let a=0;a<n.length;a++){let r=n[a],u=t[r.key];if(u===void 0&&r.hasDefault&&(u=r.default),r.enumValueSet!==void 0&&!r.enumValueSet.has(u)&&!d(u)&&(u=r.default),!!u){if(d(u)){if(!r.responsive)continue;u=ye(u,r)}if(r.type==="enum"){let f=x({allowArbitraryValues:!1,value:u,className:r.className,propValues:r.values,propValueSet:r.valueSet,parseValue:r.parseValue});f&&l.push(f);continue}if(r.type==="string"||r.type==="enum | string"){let[f,B]=A({className:r.className,customProperties:r.customProperties,propValues:r.type==="string"?[]:r.values,propValueSet:r.type==="string"?void 0:r.valueSet,parseValue:r.parseValue,value:u});B&&(p=T(p,B)),f&&l.push(f);continue}if(r.type==="boolean"){l.push(r.className);continue}}}return s.className=(0,L.default)(l.length>0?l.join(" "):void 0,t.className),s.style=T(p,t.style),s}var m=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9","-10","-11","-12"],$={m:{type:"enum | string",values:m,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:m,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:m,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:m,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:m,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:m,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:m,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}};var N=b.forwardRef((t,e)=>{let{asChild:n,className:i,...o}=G(t,K,$),s=n?U.Slot.Root:"kbd";return b.createElement(s,{...o,ref:e,className:(0,I.default)("rt-reset","rt-Kbd",i)})});N.displayName="Kbd";var P=y(require("react"));var W={xs:"(min-width: 520px)",sm:"(min-width: 768px)",md:"(min-width: 1024px)",lg:"(min-width: 1280px)",xl:"(min-width: 1640px)"};var ge=Object.entries(W),k=null,g=new Set,c=null;function C(){return k??(k=ge.map(([t,e])=>[t,window.matchMedia(e)])),k}function V(){let t="initial";for(let[e,n]of C())n.matches&&(t=e);return t}function D(){let t=V();t!==c&&(c=t,g.forEach(e=>e()))}function _(t){if(typeof window>"u")return()=>{};if(g.size===0){c=V();for(let[,e]of C())typeof e.addEventListener=="function"?e.addEventListener("change",D):e.addListener?.(D)}return g.add(t),()=>{if(g.delete(t),!(g.size>0)){for(let[,e]of C())try{typeof e.removeEventListener=="function"?e.removeEventListener("change",D):e.removeListener?.(D)}catch{}c=null}}}function Pe(){return typeof window>"u"?"initial":(c??(c=V()),c)}function Re(){return"initial"}var ve=()=>!0,be=()=>!1,q=()=>()=>{},De=()=>"initial";function Q(t=!0){let e=P.useSyncExternalStore(t?_:q,t?Pe:De,Re),n=P.useSyncExternalStore(t?_:q,ve,be);return P.useMemo(()=>({breakpoint:e,ready:n}),[e,n])}var M=["xl","lg","md","sm","xs","initial"];function X(t,e,n){if(t==null)return n;if(typeof t!="object")return t;let i=t;for(let o=M.indexOf(e);o<M.length;o++){let s=i[M[o]];if(s!==void 0)return s}return n}function Se(t,e){let n=typeof t=="object"&&t!==null,{breakpoint:i}=Q(n);return X(t,i,e)}function he(t,e,n){return t??e??n.material??n.panelBackground}var Y={1:8,2:12,3:12};function xe(t,e){let n=e?parseFloat(e)/100:1,i=Y[t]??Y[2];return-Math.round(i*(Number.isFinite(n)?n:1))}var F={"\u2318":"Meta",cmd:"Meta",command:"Meta",meta:"Meta","\u2325":"Alt",option:"Alt",opt:"Alt",alt:"Alt","\u21E7":"Shift",shift:"Shift","\u2303":"Control",ctrl:"Control",control:"Control","\u232B":"Backspace","\u2326":"Delete","\u23CE":"Enter","\u21B5":"Enter","\u238B":"Escape",esc:"Escape","\u21E5":"Tab","\u2191":"ArrowUp","\u2193":"ArrowDown","\u2190":"ArrowLeft","\u2192":"ArrowRight"},H=new Map;function Te(t){let e=H.get(t);if(e!==void 0)return e||void 0;let o=(t.match(/[⌘⌥⇧⌃]|[^\s+⌘⌥⇧⌃]+/gu)??[]).map(s=>F[s]??F[s.toLowerCase()]??(s.length===1?s.toUpperCase():s)).join("+");return H.set(t,o),o||void 0}function Ne({shortcut:t,className:e}){return w.createElement("div",{"aria-hidden":!0,className:(0,J.default)("rt-BaseMenuShortcut",e)},w.createElement(N,{size:"1"},t))}
|
|
2
|
+
//# sourceMappingURL=base-menu.utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/_internal/base-menu.utils.tsx", "../../../../src/components/kbd.tsx", "../../../../src/props/as-child.prop.ts", "../../../../src/components/kbd.props.tsx", "../../../../src/helpers/extract-props.ts", "../../../../src/helpers/compile-prop-defs.ts", "../../../../src/props/prop-def.ts", "../../../../src/helpers/has-own-property.ts", "../../../../src/helpers/is-responsive-object.ts", "../../../../src/helpers/get-responsive-styles.ts", "../../../../src/helpers/merge-styles.ts", "../../../../src/props/margin.props.ts", "../../../../src/hooks/use-breakpoint.ts", "../../../../src/components/shell.types.ts"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Kbd } from '../kbd.js';\nimport { useBreakpoint } from '../../hooks/use-breakpoint.js';\n\nimport type { Breakpoint, Responsive } from '../../props/prop-def.js';\n\nconst BREAKPOINTS_DESCENDING: Breakpoint[] = ['xl', 'lg', 'md', 'sm', 'xs', 'initial'];\n\n/**\n * Resolves a responsive value for the given breakpoint, falling back through\n * the smaller breakpoints when the current one is not set.\n */\nfunction resolveResponsiveValue<T>(\n value: T | Partial<Record<Breakpoint, T>> | undefined,\n currentBreakpoint: Breakpoint,\n defaultValue: T,\n): T {\n if (value === undefined || value === null) return defaultValue;\n if (typeof value !== 'object') return value;\n\n const map = value as Partial<Record<Breakpoint, T>>;\n for (let i = BREAKPOINTS_DESCENDING.indexOf(currentBreakpoint); i < BREAKPOINTS_DESCENDING.length; i++) {\n const resolved = map[BREAKPOINTS_DESCENDING[i]];\n if (resolved !== undefined) return resolved;\n }\n return defaultValue;\n}\n\n/**\n * Resolves a possibly responsive value against the current viewport. Only a\n * responsive object subscribes to breakpoint changes; a plain value costs\n * nothing.\n */\nfunction useResolvedResponsiveValue<T>(value: Responsive<T> | undefined, defaultValue: T): T {\n const isResponsive = typeof value === 'object' && value !== null;\n const { breakpoint } = useBreakpoint(isResponsive);\n return resolveResponsiveValue(value as T | Partial<Record<Breakpoint, T>> | undefined, breakpoint, defaultValue);\n}\n\ntype MenuMaterial = 'solid' | 'translucent';\n\n/**\n * The menu surface material. The component props win, then the nearest\n * Theme's `material`. Theme keeps `panelBackground` in sync with `material` at\n * the root, but a nested `<Theme material=\"solid\">` only updates `material`,\n * so reading the deprecated `panelBackground` from the theme gave the wrong\n * surface there.\n */\nfunction resolveMenuMaterial(\n material: MenuMaterial | undefined,\n panelBackground: MenuMaterial | undefined,\n theme: { material: MenuMaterial; panelBackground: MenuMaterial },\n): MenuMaterial {\n return material ?? panelBackground ?? theme.material ?? theme.panelBackground;\n}\n\n/** Content padding per menu size, in px at 100% scaling (see base-menu.css). */\nconst CONTENT_PADDING: Record<string, number> = { '1': 8, '2': 12, '3': 12 };\n\n/**\n * Offset that lines the first item of a menu up with its anchor: the pointer\n * for a context menu, or the sub trigger for a submenu. It cancels the content\n * padding, which scales with the theme.\n */\nfunction getMenuAlignOffset(size: string, scaling: string | undefined): number {\n const scale = scaling ? parseFloat(scaling) / 100 : 1;\n const padding = CONTENT_PADDING[size] ?? CONTENT_PADDING['2'];\n return -Math.round(padding * (Number.isFinite(scale) ? scale : 1));\n}\n\nconst KEY_SYMBOLS: Record<string, string> = {\n '\u2318': 'Meta',\n cmd: 'Meta',\n command: 'Meta',\n meta: 'Meta',\n '\u2325': 'Alt',\n option: 'Alt',\n opt: 'Alt',\n alt: 'Alt',\n '\u21E7': 'Shift',\n shift: 'Shift',\n '\u2303': 'Control',\n ctrl: 'Control',\n control: 'Control',\n '\u232B': 'Backspace',\n '\u2326': 'Delete',\n '\u23CE': 'Enter',\n '\u21B5': 'Enter',\n '\u238B': 'Escape',\n esc: 'Escape',\n '\u21E5': 'Tab',\n '\u2191': 'ArrowUp',\n '\u2193': 'ArrowDown',\n '\u2190': 'ArrowLeft',\n '\u2192': 'ArrowRight',\n};\n\nconst ariaKeyShortcutsCache = new Map<string, string>();\n\n/**\n * Converts a display shortcut such as \"\u2318 \u21E7 P\" or \"Ctrl+S\" into the\n * `aria-keyshortcuts` format (\"Meta+Shift+P\", \"Control+S\").\n */\nfunction toAriaKeyShortcuts(shortcut: string): string | undefined {\n const cached = ariaKeyShortcutsCache.get(shortcut);\n if (cached !== undefined) return cached || undefined;\n\n // Modifier symbols are tokens of their own (\"\u2318\u21E7P\"); otherwise split on \"+\" and spaces.\n const tokens = shortcut.match(/[\u2318\u2325\u21E7\u2303]|[^\\s+\u2318\u2325\u21E7\u2303]+/gu) ?? [];\n const keys = tokens.map((token) => {\n const mapped = KEY_SYMBOLS[token] ?? KEY_SYMBOLS[token.toLowerCase()];\n return mapped ?? (token.length === 1 ? token.toUpperCase() : token);\n });\n const result = keys.join('+');\n ariaKeyShortcutsCache.set(shortcut, result);\n return result || undefined;\n}\n\n/**\n * The keyboard shortcut hint at the end of a menu item. It is hidden from\n * assistive technology because the item exposes it through\n * `aria-keyshortcuts` instead of reading it as part of the item name.\n */\nfunction MenuShortcut({ shortcut, className }: { shortcut: string; className?: string }) {\n return (\n <div aria-hidden className={classNames('rt-BaseMenuShortcut', className)}>\n <Kbd size=\"1\">{shortcut}</Kbd>\n </div>\n );\n}\n\nexport {\n resolveResponsiveValue,\n useResolvedResponsiveValue,\n resolveMenuMaterial,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n MenuShortcut,\n};\nexport type { MenuMaterial };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { kbdPropDefs } from './kbd.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype KbdElement = React.ElementRef<'kbd'>;\ntype KbdOwnProps = GetPropDefTypes<typeof kbdPropDefs>;\ninterface KbdProps extends ComponentPropsWithout<'kbd', RemovedProps>, MarginProps, KbdOwnProps {}\nconst Kbd = React.forwardRef<KbdElement, KbdProps>((props, forwardedRef) => {\n const { asChild, className, ...kbdProps } = extractProps(props, kbdPropDefs, marginPropDefs);\n const Comp = asChild ? Slot.Root : 'kbd';\n return (\n <Comp\n {...kbdProps}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-Kbd', className)}\n />\n );\n});\nKbd.displayName = 'Kbd';\n\nexport { Kbd };\nexport type { KbdProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\nconst variants = ['classic', 'soft'] as const;\n\nconst kbdPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'rt-r-size',\n values: sizes,\n responsive: true,\n },\n variant: {\n type: 'enum',\n className: 'rt-variant',\n values: variants,\n default: 'classic',\n },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n};\n\nexport { kbdPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n", "'use client';\n\nimport * as React from 'react';\nimport { _BREAKPOINTS, type Breakpoint } from '../components/shell.types.js';\n\nconst QUERIES = Object.entries(_BREAKPOINTS) as Array<[Breakpoint, string]>;\n\ntype Listener = () => void;\n\n/**\n * One set of `MediaQueryList`s and one set of listeners for the whole\n * application. Every component that asks for the breakpoint used to create and\n * subscribe to its own copy of all five queries.\n */\nlet mediaQueryLists: Array<[Breakpoint, MediaQueryList]> | null = null;\nconst listeners = new Set<Listener>();\nlet cachedBreakpoint: Breakpoint | null = null;\n\nfunction getMediaQueryLists() {\n mediaQueryLists ??= QUERIES.map(([name, query]) => [name, window.matchMedia(query)] as [Breakpoint, MediaQueryList]);\n return mediaQueryLists;\n}\n\nfunction computeBreakpoint(): Breakpoint {\n // The largest matching query wins; `_BREAKPOINTS` is ordered smallest first.\n let matched: Breakpoint = 'initial';\n for (const [name, mql] of getMediaQueryLists()) {\n if (mql.matches) matched = name;\n }\n return matched;\n}\n\nfunction handleChange() {\n const next = computeBreakpoint();\n if (next === cachedBreakpoint) return;\n cachedBreakpoint = next;\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: Listener) {\n if (typeof window === 'undefined') return () => {};\n\n if (listeners.size === 0) {\n cachedBreakpoint = computeBreakpoint();\n for (const [, mql] of getMediaQueryLists()) {\n // Safari below 14 only has the deprecated listener API.\n if (typeof mql.addEventListener === 'function') mql.addEventListener('change', handleChange);\n else mql.addListener?.(handleChange);\n }\n }\n\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n\n for (const [, mql] of getMediaQueryLists()) {\n try {\n if (typeof mql.removeEventListener === 'function') mql.removeEventListener('change', handleChange);\n else mql.removeListener?.(handleChange);\n } catch (error) {\n // Removal can throw in edge cases, e.g. the list was already torn down.\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[useBreakpoint] MediaQueryList cleanup warning:', error);\n }\n }\n }\n cachedBreakpoint = null;\n };\n}\n\n/**\n * `getSnapshot` must return a referentially stable value between changes, so it\n * reads the cache that `handleChange` maintains rather than recomputing.\n */\nfunction getSnapshot(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n cachedBreakpoint ??= computeBreakpoint();\n return cachedBreakpoint;\n}\n\nfunction getServerSnapshot(): Breakpoint {\n return 'initial';\n}\n\nconst getReadySnapshot = () => true;\nconst getReadyServerSnapshot = () => false;\n\nconst noopSubscribe = () => () => {};\nconst getInitialSnapshot = (): Breakpoint => 'initial';\n\n/**\n * The current breakpoint, and whether it has been resolved against a real\n * viewport yet (`false` on the server and during hydration).\n *\n * Reads through `useSyncExternalStore` rather than settling into state from an\n * effect. On a client render the very first pass already has the real\n * breakpoint, instead of rendering the whole shell at `initial` and correcting\n * it after the browser has painted.\n *\n * Pass `enabled = false` to skip the subscription (the breakpoint then reads as\n * `initial`).\n */\nexport function useBreakpoint(enabled = true): { breakpoint: Breakpoint; ready: boolean } {\n // Callers with a non-responsive value pass `enabled = false` so they neither\n // subscribe to the media queries nor re-render when the viewport crosses one.\n const breakpoint = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n enabled ? getSnapshot : getInitialSnapshot,\n getServerSnapshot,\n );\n const ready = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n getReadySnapshot,\n getReadyServerSnapshot,\n );\n\n return React.useMemo(() => ({ breakpoint, ready }), [breakpoint, ready]);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'thin' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n height?: string | number;\n resizable?: boolean;\n collapsible?: boolean;\n onExpand?: () => void;\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n resizer?: React.ReactNode;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n snapPoints?: number[];\n snapTolerance?: number;\n collapseThreshold?: number;\n paneId?: string;\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n"],
|
|
5
|
+
"mappings": "ilBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,kBAAAE,GAAA,uBAAAC,GAAA,wBAAAC,GAAA,2BAAAC,EAAA,uBAAAC,GAAA,+BAAAC,KAAA,eAAAC,GAAAR,IAEA,IAAAS,EAAuB,oBACvBC,EAAuB,yBCHvB,IAAAC,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAqB,oBCArB,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECNA,IAAMC,GAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,GAAG,EACpDC,GAAW,CAAC,UAAW,MAAM,EAE7BC,EAAc,CAClB,GAAGC,EACH,KAAM,C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AC,SAAW,sBAAuBD,CAAS,GACrE,gBAACE,EAAA,CAAI,KAAK,KAAKP,CAAS,CAC1B,CAEJ",
|
|
6
|
+
"names": ["base_menu_utils_exports", "__export", "MenuShortcut", "getMenuAlignOffset", "resolveMenuMaterial", "resolveResponsiveValue", "toAriaKeyShortcuts", "useResolvedResponsiveValue", "__toCommonJS", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "asChildPropDef", "sizes", "variants", "kbdPropDefs", "asChildPropDef", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "marginValues", "marginPropDefs", "Kbd", "props", "forwardedRef", "asChild", "className", "kbdProps", "extractProps", "kbdPropDefs", "marginPropDefs", "Comp", "classNames", "React", "_BREAKPOINTS", "QUERIES", "_BREAKPOINTS", "mediaQueryLists", "listeners", "cachedBreakpoint", "getMediaQueryLists", "name", "query", "computeBreakpoint", "matched", "mql", "handleChange", "next", "listener", "subscribe", "getSnapshot", "getServerSnapshot", "getReadySnapshot", "getReadyServerSnapshot", "noopSubscribe", "getInitialSnapshot", "useBreakpoint", "enabled", "breakpoint", "ready", "BREAKPOINTS_DESCENDING", "resolveResponsiveValue", "value", "currentBreakpoint", "defaultValue", "map", "i", "resolved", "useResolvedResponsiveValue", "isResponsive", "breakpoint", "useBreakpoint", "resolveMenuMaterial", "material", "panelBackground", "theme", "CONTENT_PADDING", "getMenuAlignOffset", "size", "scaling", "scale", "padding", "KEY_SYMBOLS", "ariaKeyShortcutsCache", "toAriaKeyShortcuts", "shortcut", "cached", "result", "token", "MenuShortcut", "className", "classNames", "Kbd"]
|
|
7
|
+
}
|
|
@@ -1,73 +1,91 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Breakpoint, Responsive } from '../../props/prop-def.js';
|
|
3
2
|
import type { submenuBehaviors } from './base-menu.props.js';
|
|
4
|
-
import { useBreakpoint } from '../../hooks/use-breakpoint.js';
|
|
5
3
|
type SubmenuBehavior = (typeof submenuBehaviors)[number];
|
|
6
|
-
/**
|
|
7
|
-
* Resolves a responsive value to its current value based on the breakpoint.
|
|
8
|
-
* Falls back through smaller breakpoints if the current one isn't defined.
|
|
9
|
-
*/
|
|
10
|
-
declare function resolveResponsiveValue<T>(value: T | Partial<Record<Breakpoint, T>> | undefined, currentBreakpoint: Breakpoint, defaultValue: T): T;
|
|
11
4
|
type AnimationDirection = 'forward' | 'backward' | null;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
type Modality = 'keyboard' | 'pointer';
|
|
6
|
+
interface StackEntry {
|
|
7
|
+
id: string;
|
|
8
|
+
/** Accessible name of the submenu, taken from its trigger text */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Scroll position of the parent level when this entry was pushed */
|
|
11
|
+
scrollTop: number;
|
|
12
|
+
}
|
|
13
|
+
type LastChange = {
|
|
14
|
+
type: 'push';
|
|
15
|
+
id: string;
|
|
16
|
+
modality: Modality | null;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'pop';
|
|
19
|
+
id: string;
|
|
20
|
+
modality: Modality | null;
|
|
21
|
+
scrollTop: number;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'reset';
|
|
24
|
+
};
|
|
25
|
+
interface DrillDownState {
|
|
26
|
+
stack: StackEntry[];
|
|
27
|
+
direction: AnimationDirection;
|
|
28
|
+
lastChange: LastChange | null;
|
|
29
|
+
}
|
|
30
|
+
declare class DrillDownStore {
|
|
31
|
+
private state;
|
|
32
|
+
private listeners;
|
|
33
|
+
private modality;
|
|
34
|
+
/** The drill-down root element, set by the provider */
|
|
35
|
+
rootElement: HTMLElement | null;
|
|
36
|
+
setRootElement: (element: HTMLElement | null) => void;
|
|
37
|
+
getState: () => DrillDownState;
|
|
38
|
+
subscribe: (listener: () => void) => () => void;
|
|
39
|
+
private setState;
|
|
40
|
+
/** Records how the user is interacting, so focus can follow the same model as Radix. */
|
|
41
|
+
setModality: (modality: Modality) => void;
|
|
42
|
+
getModality: () => Modality;
|
|
43
|
+
getDepth: () => number;
|
|
44
|
+
isOpen: (id: string) => boolean;
|
|
45
|
+
private getScrollContainer;
|
|
46
|
+
private getTrigger;
|
|
47
|
+
/**
|
|
48
|
+
* Opens a submenu. `modality` decides where focus goes: the first item for
|
|
49
|
+
* keyboard, the menu for pointer, and nowhere for a programmatic open
|
|
50
|
+
* (`null`) unless focus was lost.
|
|
51
|
+
*/
|
|
52
|
+
push: (id: string, modality?: Modality | null) => void;
|
|
53
|
+
pop: (modality?: Modality) => void;
|
|
54
|
+
/** Closes a submenu and everything opened from it, without moving focus to its trigger. */
|
|
55
|
+
close: (id: string) => void;
|
|
23
56
|
reset: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Moves focus and scroll after a navigation step has been committed. Runs in
|
|
59
|
+
* a layout effect, so the new level is already in the DOM and nothing paints
|
|
60
|
+
* with focus on `<body>` or at the old scroll position.
|
|
61
|
+
*/
|
|
62
|
+
applyLastChange(): void;
|
|
24
63
|
}
|
|
25
64
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
65
|
+
* Whether the items of the current level are on screen. The root level and
|
|
66
|
+
* every panel provide it; menu parts render nothing when it is false.
|
|
28
67
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
68
|
+
declare const DrillDownLevelContext: React.Context<boolean>;
|
|
69
|
+
declare function useDrillDownStore(): DrillDownStore | null;
|
|
70
|
+
declare function useCreateDrillDownStore(): DrillDownStore;
|
|
71
|
+
interface DrillDownRootProps {
|
|
72
|
+
store: DrillDownStore;
|
|
31
73
|
behavior: SubmenuBehavior;
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
/** Stack of active submenu IDs. Empty means root menu is shown. */
|
|
35
|
-
stack: string[];
|
|
36
|
-
/** Check if a specific submenu is the currently active one */
|
|
37
|
-
isActive: (id: string) => boolean;
|
|
38
|
-
/** Check if we're at root level (no submenus open) */
|
|
39
|
-
isRoot: boolean;
|
|
40
|
-
/** The currently active submenu ID (or null if at root) */
|
|
41
|
-
currentId: string | null;
|
|
42
|
-
/** Current animation direction for transitions */
|
|
43
|
-
animationDirection: AnimationDirection;
|
|
44
|
-
}
|
|
45
|
-
declare const DrillDownActionsContext: React.Context<DrillDownActionsContextValue | null>;
|
|
46
|
-
declare const DrillDownStateContext: React.Context<DrillDownStateContextValue | null>;
|
|
47
|
-
interface DrillDownProviderProps {
|
|
74
|
+
/** Open state of the menu; the stack resets every time the menu opens */
|
|
75
|
+
open: boolean;
|
|
48
76
|
children: React.ReactNode;
|
|
49
|
-
submenuBehavior: Responsive<SubmenuBehavior> | undefined;
|
|
50
77
|
}
|
|
51
|
-
declare function DrillDownProvider({ children, submenuBehavior }: DrillDownProviderProps): React.JSX.Element;
|
|
52
|
-
/**
|
|
53
|
-
* Hook to access only the stable action callbacks (push, pop, reset).
|
|
54
|
-
* Use this in components that only need to trigger navigation,
|
|
55
|
-
* not react to state changes. Prevents unnecessary re-renders.
|
|
56
|
-
*/
|
|
57
|
-
declare function useDrillDownActions(): DrillDownActionsContextValue;
|
|
58
|
-
/**
|
|
59
|
-
* Hook to access drill-down state (behavior, stack, isActive, etc.).
|
|
60
|
-
* Components using this will re-render when navigation state changes.
|
|
61
|
-
*/
|
|
62
|
-
declare function useDrillDownState(): DrillDownStateContextValue;
|
|
63
|
-
/**
|
|
64
|
-
* Optional version of useDrillDownActions for components that may be outside Content.
|
|
65
|
-
*/
|
|
66
|
-
declare function useDrillDownActionsOptional(): DrillDownActionsContextValue | null;
|
|
67
78
|
/**
|
|
68
|
-
*
|
|
79
|
+
* Provides the drill-down store and renders the root level. The wrapper is
|
|
80
|
+
* the same element in both behaviors, so crossing a breakpoint that switches
|
|
81
|
+
* between cascade and drill-down does not remount the items.
|
|
69
82
|
*/
|
|
70
|
-
declare function
|
|
83
|
+
declare function DrillDownRoot({ store, behavior, open, children }: DrillDownRootProps): React.JSX.Element;
|
|
84
|
+
/** Where a submenu sits in the stack: not open, open under another level, or on top. */
|
|
85
|
+
type PanelPosition = 'closed' | 'open' | 'top';
|
|
86
|
+
declare function usePanelPosition(store: DrillDownStore | null, id: string): PanelPosition;
|
|
87
|
+
declare function useStackEntry(store: DrillDownStore | null, id: string): StackEntry | undefined;
|
|
88
|
+
declare function useDrillDownDirection(store: DrillDownStore | null): AnimationDirection;
|
|
71
89
|
interface SubContextValue {
|
|
72
90
|
/** Unique ID for this submenu */
|
|
73
91
|
id: string;
|
|
@@ -76,6 +94,6 @@ interface SubContextValue {
|
|
|
76
94
|
}
|
|
77
95
|
declare const SubContext: React.Context<SubContextValue | null>;
|
|
78
96
|
declare function useSubContext(): SubContextValue | null;
|
|
79
|
-
export {
|
|
80
|
-
export type { SubmenuBehavior,
|
|
97
|
+
export { DrillDownRoot, DrillDownLevelContext, SubContext, useCreateDrillDownStore, useDrillDownStore, useDrillDownDirection, usePanelPosition, useStackEntry, useSubContext, };
|
|
98
|
+
export type { SubmenuBehavior, DrillDownStore, PanelPosition, SubContextValue, AnimationDirection };
|
|
81
99
|
//# sourceMappingURL=dropdown-menu-drill-down.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu-drill-down.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/dropdown-menu-drill-down.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"dropdown-menu-drill-down.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/dropdown-menu-drill-down.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,KAAK,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAgBzD,KAAK,kBAAkB,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC;AACxD,KAAK,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvC,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,UAAU,GACX;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACzE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB,UAAU,cAAc;IACtB,KAAK,EAAE,UAAU,EAAE,C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FAAwF;AACxF,KAAK,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAE/C,iBAAS,gBAAgB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,CAQjF;AAED,iBAAS,aAAa,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAMvF;AAED,iBAAS,qBAAqB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,GAAG,kBAAkB,CAG/E;AAUD,UAAU,eAAe;IACvB,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,QAAA,MAAM,UAAU,uCAAoD,CAAC;AAErE,iBAAS,aAAa,2BAErB;AAED,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,aAAa,GACd,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var R=Object.create;var u=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var x=(e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var L=(e,t)=>{for(var n in t)u(e,n,{get:t[n],enumerable:!0})},m=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of v(t))!M.call(e,l)&&l!==n&&u(e,l,{get:()=>t[l],enumerable:!(i=k(t,l))||i.enumerable});return e};var P=(e,t,n)=>(n=e!=null?R(T(e)):{},m(t||!e||!e.__esModule?u(n,"default",{value:e,enumerable:!0}):n,e)),A=e=>m(u({},"__esModule",{value:!0}),e);var r=(e,t,n)=>x(e,typeof t!="symbol"?t+"":t,n);var J={};L(J,{DrillDownLevelContext:()=>y,DrillDownRoot:()=>O,SubContext:()=>f,useCreateDrillDownStore:()=>V,useDrillDownDirection:()=>U,useDrillDownStore:()=>N,usePanelPosition:()=>$,useStackEntry:()=>j,useSubContext:()=>G});module.exports=A(J);var o=P(require("react"));var H={stack:[],direction:null,lastChange:null},B='[role^="menuitem"]:not([data-disabled])',I="rt-DropdownMenuDrillDownBackItem";function S(e){return e.replace(/["\\]/g,"\\$&")}var p=class{constructor(){r(this,"state",H);r(this,"listeners",new Set);r(this,"modality","keyboard");r(this,"rootElement",null);r(this,"setRootElement",t=>{this.rootElement=t});r(this,"getState",()=>this.state);r(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));r(this,"setModality",t=>{this.modality=t});r(this,"getModality",()=>this.modality);r(this,"getDepth",()=>this.state.stack.length);r(this,"isOpen",t=>this.state.stack.some(n=>n.id===t));r(this,"push",(t,n=this.modality)=>{let{stack:i}=this.state;if(i.some(c=>c.id===t))return;let l=this.getTrigger(t),s=(l?.dataset.drillDownName??l?.textContent??"").trim(),a=this.getScrollContainer()?.scrollTop??0;this.setState({stack:[...i,{id:t,name:s,scrollTop:a}],direction:"forward",lastChange:{type:"push",id:t,modality:n}})});r(this,"pop",(t=this.modality)=>{let{stack:n}=this.state,i=n[n.length-1];i&&this.setState({stack:n.slice(0,-1),direction:"backward",lastChange:{type:"pop",id:i.id,modality:t,scrollTop:i.scrollTop}})});r(this,"close",t=>{let{stack:n}=this.state,i=n.findIndex(l=>l.id===t);i!==-1&&this.setState({stack:n.slice(0,i),direction:"backward",lastChange:{type:"pop",id:t,modality:null,scrollTop:n[i].scrollTop}})});r(this,"reset",()=>{this.state.stack.length===0&&this.state.direction===null||this.setState({stack:[],direction:null,lastChange:{type:"reset"}})})}setState(t){this.state=t,this.listeners.forEach(n=>n())}getScrollContainer(){let t=this.rootElement;return t?t.closest(".rt-ScrollAreaViewport")??t.closest(".rt-BaseMenuViewport"):null}getTrigger(t){return this.rootElement?.querySelector(`[data-drill-down-trigger="${S(t)}"]`)}applyLastChange(){let t=this.state.lastChange,n=this.rootElement;if(!t||!n)return;this.state={...this.state,lastChange:null};let i=n.closest('[role="menu"]'),l=this.getScrollContainer(),s=a=>a?.focus({preventScroll:!0});if(t.type==="push"){l&&(l.scrollTop=0);let a=n.querySelector(`[data-drill-down-panel="${S(t.id)}"]`);if(t.modality==="keyboard"){let c=a?Array.from(a.querySelectorAll(B)):[];s(c.find(d=>!d.classList.contains(I))??c[0]??i)}else(t.modality==="pointer"||!n.contains(document.activeElement))&&s(i);return}if(t.type==="pop"){l&&(l.scrollTop=t.scrollTop);let a=this.getTrigger(t.id);t.modality==="keyboard"?s(a??i):(t.modality==="pointer"||!n.contains(document.activeElement))&&s(i);return}l&&(l.scrollTop=0)}},g=o.createContext(null),y=o.createContext(!0);function N(){return o.useContext(g)}function V(){let[e]=o.useState(()=>new p);return e}var _=e=>e.stack.length,q=e=>e.direction,K=()=>0,D=()=>null;function O({store:e,behavior:t,open:n,children:i}){let l=t==="drill-down",s=o.useSyncExternalStore(e.subscribe,()=>_(e.getState()),K),a=o.useSyncExternalStore(e.subscribe,()=>q(e.getState()),D),c=!l||s===0;o.useLayoutEffect(()=>{l||e.reset()},[l,e]);let d=o.useRef(n);o.useLayoutEffect(()=>{n&&!d.current&&e.reset(),d.current=n},[n,e]),o.useLayoutEffect(()=>{e.applyLastChange()},[s,e]);let b=o.useCallback(E=>e.setRootElement(E),[e]),C=o.useCallback(()=>e.setModality("keyboard"),[e]),w=o.useCallback(()=>e.setModality("pointer"),[e]);return o.createElement(g.Provider,{value:l?e:null},o.createElement("div",{ref:b,className:"rt-DropdownMenuDrillDownRoot","data-submenu-behavior":t,"data-drill-down-active":c?void 0:!0,"data-animation-direction":l?a??void 0:void 0,onKeyDownCapture:l?C:void 0,onPointerDownCapture:l?w:void 0},o.createElement(y.Provider,{value:c},i)))}function $(e,t){let n=o.useCallback(()=>{if(!e)return"closed";let{stack:i}=e.getState();return i.length>0&&i[i.length-1].id===t?"top":i.some(l=>l.id===t)?"open":"closed"},[e,t]);return o.useSyncExternalStore(e?.subscribe??h,n,z)}function j(e,t){let n=o.useCallback(()=>e?.getState().stack.find(i=>i.id===t),[e,t]);return o.useSyncExternalStore(e?.subscribe??h,n,F)}function U(e){let t=o.useCallback(()=>e?.getState().direction??null,[e]);return o.useSyncExternalStore(e?.subscribe??h,t,D)}var h=()=>()=>{},z=()=>"closed",F=()=>{},f=o.createContext(null);function G(){return o.useContext(f)}
|
|
2
2
|
//# sourceMappingURL=dropdown-menu-drill-down.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/_internal/dropdown-menu-drill-down.tsx"
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport type { Breakpoint, Responsive } from '../../props/prop-def.js';\nimport type { submenuBehaviors } from './base-menu.props.js';\nimport { useBreakpoint } from '../../hooks/use-breakpoint.js';\n\ntype SubmenuBehavior = (typeof submenuBehaviors)[number];\n\n/**\n * Resolves a responsive value to its current value based on the breakpoint.\n * Falls back through smaller breakpoints if the current one isn't defined.\n */\nfunction resolveResponsiveValue<T>(\n value: T | Partial<Record<Breakpoint, T>> | undefined,\n currentBreakpoint: Breakpoint,\n defaultValue: T\n): T {\n if (value === undefined || value === null) {\n return defaultValue;\n }\n\n // Non-object values are returned directly\n if (typeof value !== 'object') {\n return value;\n }\n\n const map = value as Partial<Record<Breakpoint, T>>;\n\n // Check if current breakpoint has a value\n if (map[currentBreakpoint] !== undefined) {\n return map[currentBreakpoint] as T;\n }\n\n // Fall back through smaller breakpoints\n const bpOrder: Breakpoint[] = ['xl', 'lg', 'md', 'sm', 'xs', 'initial'];\n const startIdx = bpOrder.indexOf(currentBreakpoint);\n\n for (let i = startIdx + 1; i < bpOrder.length; i++) {\n const bp = bpOrder[i];\n if (map[bp] !== undefined) {\n return map[bp] as T;\n }\n }\n\n return defaultValue;\n}\n\n// ============================================================================\n// DrillDown Context\n// ============================================================================\n\ntype AnimationDirection = 'forward' | 'backward' | null;\n\n/**\n * Stable actions context - callbacks that don't change identity.\n * Separated from state to prevent unnecessary re-renders of components\n * that only need to call push/pop/reset.\n */\ninterface DrillDownActionsContextValue {\n /** Navigate into a submenu */\n push: (id: string) => void;\n /** Navigate back to parent menu */\n pop: () => void;\n /** Reset to root menu */\n reset: () => void;\n}\n\n/**\n * Mutable state context - values that change when navigation occurs.\n * Subscribers to this context will re-render on stack changes.\n */\ninterface DrillDownStateContextValue {\n /** Current submenu behavior mode */\n behavior: SubmenuBehavior;\n /** Whether the breakpoint has been resolved (client-side only) */\n ready: boolean;\n /** Stack of active submenu IDs. Empty means root menu is shown. */\n stack: string[];\n /** Check if a specific submenu is the currently active one */\n isActive: (id: string) => boolean;\n /** Check if we're at root level (no submenus open) */\n isRoot: boolean;\n /** The currently active submenu ID (or null if at root) */\n currentId: string | null;\n /** Current animation direction for transitions */\n animationDirection: AnimationDirection;\n}\n\nconst DrillDownActionsContext = React.createContext<DrillDownActionsContextValue | null>(null);\nconst DrillDownStateContext = React.createContext<DrillDownStateContextValue | null>(null);\n\ninterface DrillDownProviderProps {\n children: React.ReactNode;\n submenuBehavior: Responsive<SubmenuBehavior> | undefined;\n}\n\nfunction DrillDownProvider({ children, submenuBehavior }: DrillDownProviderProps) {\n const { breakpoint, ready } = useBreakpoint();\n const [stack, setStack] = React.useState<string[]>([]);\n const [animationDirection, setAnimationDirection] = React.useState<AnimationDirection>(null);\n\n // Resolve the current behavior based on breakpoint\n const behavior = React.useMemo(\n () => resolveResponsiveValue(submenuBehavior, breakpoint, 'cascade'),\n [submenuBehavior, breakpoint]\n );\n\n // Reset stack when behavior changes from drill-down to cascade\n const prevBehaviorRef = React.useRef(behavior);\n React.useEffect(() => {\n if (prevBehaviorRef.current === 'drill-down' && behavior === 'cascade') {\n setStack([]);\n setAnimationDirection(null);\n }\n prevBehaviorRef.current = behavior;\n }, [behavior]);\n\n // Stable action callbacks - these never change identity\n const push = React.useCallback((id: string) => {\n setAnimationDirection('forward');\n setStack((prev) => [...prev, id]);\n }, []);\n\n const pop = React.useCallback(() => {\n setAnimationDirection('backward');\n setStack((prev) => prev.slice(0, -1));\n }, []);\n\n const reset = React.useCallback(() => {\n setStack([]);\n setAnimationDirection(null);\n }, []);\n\n // Memoize actions context value - completely stable, never changes\n const actionsValue = React.useMemo(\n (): DrillDownActionsContextValue => ({ push, pop, reset }),\n [push, pop, reset]\n );\n\n // isActive depends on stack - this is expected to change\n const isActive = React.useCallback(\n (id: string) => {\n if (stack.length === 0) return false;\n return stack[stack.length - 1] === id;\n },\n [stack]\n );\n\n // Memoize state context value - changes when stack/behavior changes\n const stateValue = React.useMemo(\n (): DrillDownStateContextValue => ({\n behavior,\n ready,\n stack,\n isActive,\n isRoot: stack.length === 0,\n currentId: stack.length > 0 ? stack[stack.length - 1] : null,\n animationDirection,\n }),\n [behavior, ready, stack, isActive, animationDirection]\n );\n\n return (\n <DrillDownActionsContext.Provider value={actionsValue}>\n <DrillDownStateContext.Provider value={stateValue}>\n {children}\n </DrillDownStateContext.Provider>\n </DrillDownActionsContext.Provider>\n );\n}\n\n/**\n * Hook to access only the stable action callbacks (push, pop, reset).\n * Use this in components that only need to trigger navigation,\n * not react to state changes. Prevents unnecessary re-renders.\n */\nfunction useDrillDownActions() {\n const ctx = React.useContext(DrillDownActionsContext);\n if (!ctx) {\n throw new Error('useDrillDownActions must be used within a DropdownMenu.Content');\n }\n return ctx;\n}\n\n/**\n * Hook to access drill-down state (behavior, stack, isActive, etc.).\n * Components using this will re-render when navigation state changes.\n */\nfunction useDrillDownState() {\n const ctx = React.useContext(DrillDownStateContext);\n if (!ctx) {\n throw new Error('useDrillDownState must be used within a DropdownMenu.Content');\n }\n return ctx;\n}\n\n/**\n * Optional version of useDrillDownActions for components that may be outside Content.\n */\nfunction useDrillDownActionsOptional() {\n return React.useContext(DrillDownActionsContext);\n}\n\n/**\n * Optional version of useDrillDownState for components that may be outside Content.\n */\nfunction useDrillDownStateOptional() {\n return React.useContext(DrillDownStateContext);\n}\n\n// ============================================================================\n// Sub Context (for individual submenu instances)\n// ============================================================================\n\ninterface SubContextValue {\n /** Unique ID for this submenu */\n id: string;\n /** Label for the back button */\n label: React.ReactNode;\n}\n\nconst SubContext = React.createContext<SubContextValue | null>(null);\n\nfunction useSubContext() {\n return React.useContext(SubContext);\n}\n\nexport {\n DrillDownProvider,\n DrillDownActionsContext,\n DrillDownStateContext,\n SubContext,\n useDrillDownActions,\n useDrillDownActionsOptional,\n useDrillDownState,\n useDrillDownStateOptional,\n useSubContext,\n useBreakpoint,\n resolveResponsiveValue,\n};\n\nexport type {\n SubmenuBehavior,\n DrillDownActionsContextValue,\n DrillDownStateContextValue,\n SubContextValue,\n AnimationDirection,\n};\n", "'use client';\n\nimport * as React from 'react';\nimport { _BREAKPOINTS, type Breakpoint } from '../components/shell.types.js';\n\nconst QUERIES = Object.entries(_BREAKPOINTS) as Array<[Breakpoint, string]>;\n\ntype Listener = () => void;\n\n/**\n * One set of `MediaQueryList`s and one set of listeners for the whole\n * application. Every component that asks for the breakpoint used to create and\n * subscribe to its own copy of all five queries.\n */\nlet mediaQueryLists: Array<[Breakpoint, MediaQueryList]> | null = null;\nconst listeners = new Set<Listener>();\nlet cachedBreakpoint: Breakpoint | null = null;\n\nfunction getMediaQueryLists() {\n mediaQueryLists ??= QUERIES.map(([name, query]) => [name, window.matchMedia(query)] as [Breakpoint, MediaQueryList]);\n return mediaQueryLists;\n}\n\nfunction computeBreakpoint(): Breakpoint {\n // The largest matching query wins; `_BREAKPOINTS` is ordered smallest first.\n let matched: Breakpoint = 'initial';\n for (const [name, mql] of getMediaQueryLists()) {\n if (mql.matches) matched = name;\n }\n return matched;\n}\n\nfunction handleChange() {\n const next = computeBreakpoint();\n if (next === cachedBreakpoint) return;\n cachedBreakpoint = next;\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: Listener) {\n if (typeof window === 'undefined') return () => {};\n\n if (listeners.size === 0) {\n cachedBreakpoint = computeBreakpoint();\n for (const [, mql] of getMediaQueryLists()) {\n // Safari below 14 only has the deprecated listener API.\n if (typeof mql.addEventListener === 'function') mql.addEventListener('change', handleChange);\n else mql.addListener?.(handleChange);\n }\n }\n\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n\n for (const [, mql] of getMediaQueryLists()) {\n try {\n if (typeof mql.removeEventListener === 'function') mql.removeEventListener('change', handleChange);\n else mql.removeListener?.(handleChange);\n } catch (error) {\n // Removal can throw in edge cases, e.g. the list was already torn down.\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[useBreakpoint] MediaQueryList cleanup warning:', error);\n }\n }\n }\n cachedBreakpoint = null;\n };\n}\n\n/**\n * `getSnapshot` must return a referentially stable value between changes, so it\n * reads the cache that `handleChange` maintains rather than recomputing.\n */\nfunction getSnapshot(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n cachedBreakpoint ??= computeBreakpoint();\n return cachedBreakpoint;\n}\n\nfunction getServerSnapshot(): Breakpoint {\n return 'initial';\n}\n\nconst getReadySnapshot = () => true;\nconst getReadyServerSnapshot = () => false;\n\n/**\n * The current breakpoint, and whether it has been resolved against a real\n * viewport yet (`false` on the server and during hydration).\n *\n * Reads through `useSyncExternalStore` rather than settling into state from an\n * effect. On a client render the very first pass already has the real\n * breakpoint, instead of rendering the whole shell at `initial` and correcting\n * it after the browser has painted.\n */\nexport function useBreakpoint(): { breakpoint: Breakpoint; ready: boolean } {\n const breakpoint = React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n const ready = React.useSyncExternalStore(subscribe, getReadySnapshot, getReadyServerSnapshot);\n\n return React.useMemo(() => ({ breakpoint, ready }), [breakpoint, ready]);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'thin' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n height?: string | number;\n resizable?: boolean;\n collapsible?: boolean;\n onExpand?: () => void;\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n resizer?: React.ReactNode;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n snapPoints?: number[];\n snapTolerance?: number;\n collapseThreshold?: number;\n paneId?: string;\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["dropdown_menu_drill_down_exports", "__export", "
|
|
3
|
+
"sources": ["../../../../src/components/_internal/dropdown-menu-drill-down.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\n\nimport type { submenuBehaviors } from './base-menu.props.js';\n\ntype SubmenuBehavior = (typeof submenuBehaviors)[number];\n\n/*\n * Drill-down navigation for DropdownMenu.\n *\n * The stack of open submenus lives in a small external store rather than in\n * React state, so each part subscribes only to the slice it renders from:\n * a panel re-renders when it enters or leaves the stack, a Sub when its own\n * open state changes, and nothing else on the path re-renders on navigation.\n *\n * Only the levels on the stack mount their children, and only the top level\n * mounts its items (see `DrillDownLevelContext`). That keeps the Radix item\n * collection limited to what is on screen, so roving focus and typeahead\n * never land on a hidden item.\n */\n\ntype AnimationDirection = 'forward' | 'backward' | null;\ntype Modality = 'keyboard' | 'pointer';\n\ninterface StackEntry {\n id: string;\n /** Accessible name of the submenu, taken from its trigger text */\n name: string;\n /** Scroll position of the parent level when this entry was pushed */\n scrollTop: number;\n}\n\ntype LastChange =\n | { type: 'push'; id: string; modality: Modality | null }\n | { type: 'pop'; id: string; modality: Modality | null; scrollTop: number }\n | { type: 'reset' };\n\ninterface DrillDownState {\n stack: StackEntry[];\n direction: AnimationDirection;\n lastChange: LastChange | null;\n}\n\nconst INITIAL_STATE: DrillDownState = { stack: [], direction: null, lastChange: null };\n\nconst PANEL_ITEM_SELECTOR = '[role^=\"menuitem\"]:not([data-disabled])';\nconst BACK_ITEM_CLASS = 'rt-DropdownMenuDrillDownBackItem';\n\nfunction escapeAttributeValue(value: string) {\n return value.replace(/[\"\\\\]/g, '\\\\$&');\n}\n\nclass DrillDownStore {\n private state = INITIAL_STATE;\n private listeners = new Set<() => void>();\n private modality: Modality = 'keyboard';\n /** The drill-down root element, set by the provider */\n rootElement: HTMLElement | null = null;\n\n setRootElement = (element: HTMLElement | null) => {\n this.rootElement = element;\n };\n\n getState = () => this.state;\n\n subscribe = (listener: () => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n private setState(next: DrillDownState) {\n this.state = next;\n this.listeners.forEach((listener) => listener());\n }\n\n /** Records how the user is interacting, so focus can follow the same model as Radix. */\n setModality = (modality: Modality) => {\n this.modality = modality;\n };\n\n getModality = () => this.modality;\n\n getDepth = () => this.state.stack.length;\n\n isOpen = (id: string) => this.state.stack.some((entry) => entry.id === id);\n\n private getScrollContainer() {\n const root = this.rootElement;\n if (!root) return null;\n return (\n root.closest<HTMLElement>('.rt-ScrollAreaViewport') ??\n root.closest<HTMLElement>('.rt-BaseMenuViewport')\n );\n }\n\n private getTrigger(id: string) {\n return this.rootElement?.querySelector<HTMLElement>(\n `[data-drill-down-trigger=\"${escapeAttributeValue(id)}\"]`,\n );\n }\n\n /**\n * Opens a submenu. `modality` decides where focus goes: the first item for\n * keyboard, the menu for pointer, and nowhere for a programmatic open\n * (`null`) unless focus was lost.\n */\n push = (id: string, modality: Modality | null = this.modality) => {\n const { stack } = this.state;\n if (stack.some((entry) => entry.id === id)) return;\n const trigger = this.getTrigger(id);\n const name = (trigger?.dataset.drillDownName ?? trigger?.textContent ?? '').trim();\n const scrollTop = this.getScrollContainer()?.scrollTop ?? 0;\n this.setState({\n stack: [...stack, { id, name, scrollTop }],\n direction: 'forward',\n lastChange: { type: 'push', id, modality },\n });\n };\n\n pop = (modality: Modality = this.modality) => {\n const { stack } = this.state;\n const top = stack[stack.length - 1];\n if (!top) return;\n this.setState({\n stack: stack.slice(0, -1),\n direction: 'backward',\n lastChange: { type: 'pop', id: top.id, modality, scrollTop: top.scrollTop },\n });\n };\n\n /** Closes a submenu and everything opened from it, without moving focus to its trigger. */\n close = (id: string) => {\n const { stack } = this.state;\n const index = stack.findIndex((entry) => entry.id === id);\n if (index === -1) return;\n this.setState({\n stack: stack.slice(0, index),\n direction: 'backward',\n lastChange: { type: 'pop', id, modality: null, scrollTop: stack[index].scrollTop },\n });\n };\n\n reset = () => {\n if (this.state.stack.length === 0 && this.state.direction === null) return;\n this.setState({ stack: [], direction: null, lastChange: { type: 'reset' } });\n };\n\n /**\n * Moves focus and scroll after a navigation step has been committed. Runs in\n * a layout effect, so the new level is already in the DOM and nothing paints\n * with focus on `<body>` or at the old scroll position.\n */\n applyLastChange() {\n const change = this.state.lastChange;\n const root = this.rootElement;\n if (!change || !root) return;\n this.state = { ...this.state, lastChange: null };\n\n const content = root.closest<HTMLElement>('[role=\"menu\"]');\n const scroller = this.getScrollContainer();\n const focus = (element: HTMLElement | null | undefined) => element?.focus({ preventScroll: true });\n\n if (change.type === 'push') {\n if (scroller) scroller.scrollTop = 0;\n const panel = root.querySelector<HTMLElement>(\n `[data-drill-down-panel=\"${escapeAttributeValue(change.id)}\"]`,\n );\n if (change.modality === 'keyboard') {\n // Land on the first real option; the back row stays one ArrowUp away.\n const items = panel ? Array.from(panel.querySelectorAll<HTMLElement>(PANEL_ITEM_SELECTOR)) : [];\n focus(items.find((item) => !item.classList.contains(BACK_ITEM_CLASS)) ?? items[0] ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n // Match Radix: pointer users get focus on the menu, not a highlighted item.\n focus(content);\n }\n return;\n }\n\n if (change.type === 'pop') {\n if (scroller) scroller.scrollTop = change.scrollTop;\n const trigger = this.getTrigger(change.id);\n if (change.modality === 'keyboard') {\n focus(trigger ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n focus(content);\n }\n return;\n }\n\n if (scroller) scroller.scrollTop = 0;\n }\n}\n\nconst DrillDownStoreContext = React.createContext<DrillDownStore | null>(null);\n\n/**\n * Whether the items of the current level are on screen. The root level and\n * every panel provide it; menu parts render nothing when it is false.\n */\nconst DrillDownLevelContext = React.createContext(true);\n\nfunction useDrillDownStore() {\n return React.useContext(DrillDownStoreContext);\n}\n\nfunction useCreateDrillDownStore() {\n const [store] = React.useState(() => new DrillDownStore());\n return store;\n}\n\nconst selectDepth = (state: DrillDownState) => state.stack.length;\nconst selectDirection = (state: DrillDownState) => state.direction;\nconst getServerDepth = () => 0;\nconst getServerDirection = (): AnimationDirection => null;\n\ninterface DrillDownRootProps {\n store: DrillDownStore;\n behavior: SubmenuBehavior;\n /** Open state of the menu; the stack resets every time the menu opens */\n open: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Provides the drill-down store and renders the root level. The wrapper is\n * the same element in both behaviors, so crossing a breakpoint that switches\n * between cascade and drill-down does not remount the items.\n */\nfunction DrillDownRoot({ store, behavior, open, children }: DrillDownRootProps) {\n const isDrillDown = behavior === 'drill-down';\n const depth = React.useSyncExternalStore(\n store.subscribe,\n () => selectDepth(store.getState()),\n getServerDepth,\n );\n const direction = React.useSyncExternalStore(\n store.subscribe,\n () => selectDirection(store.getState()),\n getServerDirection,\n );\n const isRoot = !isDrillDown || depth === 0;\n\n // Cascade mode has no stack. A reset while switching modes keeps the next\n // switch back to drill-down from resuming a stale level.\n React.useLayoutEffect(() => {\n if (!isDrillDown) store.reset();\n }, [isDrillDown, store]);\n\n // Start every opening at the root. Content usually remounts on open anyway;\n // this covers `forceMount`. Resetting on open rather than on close keeps the\n // closing animation on the level the user was looking at.\n const wasOpenRef = React.useRef(open);\n React.useLayoutEffect(() => {\n if (open && !wasOpenRef.current) store.reset();\n wasOpenRef.current = open;\n }, [open, store]);\n\n // Focus and scroll follow each navigation step once it is in the DOM.\n React.useLayoutEffect(() => {\n store.applyLastChange();\n }, [depth, store]);\n\n const rootRef = React.useCallback((element: HTMLDivElement | null) => store.setRootElement(element), [store]);\n const handleKeyDownCapture = React.useCallback(() => store.setModality('keyboard'), [store]);\n const handlePointerDownCapture = React.useCallback(() => store.setModality('pointer'), [store]);\n\n return (\n <DrillDownStoreContext.Provider value={isDrillDown ? store : null}>\n {/* Event capture only records the input modality; it does not handle interaction. */}\n <div\n ref={rootRef}\n className=\"rt-DropdownMenuDrillDownRoot\"\n data-submenu-behavior={behavior}\n data-drill-down-active={isRoot ? undefined : true}\n data-animation-direction={isDrillDown ? (direction ?? undefined) : undefined}\n onKeyDownCapture={isDrillDown ? handleKeyDownCapture : undefined}\n onPointerDownCapture={isDrillDown ? handlePointerDownCapture : undefined}\n >\n <DrillDownLevelContext.Provider value={isRoot}>{children}</DrillDownLevelContext.Provider>\n </div>\n </DrillDownStoreContext.Provider>\n );\n}\n\n/** Where a submenu sits in the stack: not open, open under another level, or on top. */\ntype PanelPosition = 'closed' | 'open' | 'top';\n\nfunction usePanelPosition(store: DrillDownStore | null, id: string): PanelPosition {\n const getSnapshot = React.useCallback((): PanelPosition => {\n if (!store) return 'closed';\n const { stack } = store.getState();\n if (stack.length > 0 && stack[stack.length - 1].id === id) return 'top';\n return stack.some((entry) => entry.id === id) ? 'open' : 'closed';\n }, [store, id]);\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getClosed);\n}\n\nfunction useStackEntry(store: DrillDownStore | null, id: string): StackEntry | undefined {\n const getSnapshot = React.useCallback(\n () => store?.getState().stack.find((entry) => entry.id === id),\n [store, id],\n );\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getUndefined);\n}\n\nfunction useDrillDownDirection(store: DrillDownStore | null): AnimationDirection {\n const getSnapshot = React.useCallback(() => store?.getState().direction ?? null, [store]);\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getServerDirection);\n}\n\nconst noopSubscribe = () => () => {};\nconst getClosed = (): PanelPosition => 'closed';\nconst getUndefined = () => undefined;\n\n// ============================================================================\n// Sub Context (for individual submenu instances)\n// ============================================================================\n\ninterface SubContextValue {\n /** Unique ID for this submenu */\n id: string;\n /** Label for the back button */\n label: React.ReactNode;\n}\n\nconst SubContext = React.createContext<SubContextValue | null>(null);\n\nfunction useSubContext() {\n return React.useContext(SubContext);\n}\n\nexport {\n DrillDownRoot,\n DrillDownLevelContext,\n SubContext,\n useCreateDrillDownStore,\n useDrillDownStore,\n useDrillDownDirection,\n usePanelPosition,\n useStackEntry,\n useSubContext,\n};\n\nexport type { SubmenuBehavior, DrillDownStore, PanelPosition, SubContextValue, AnimationDirection };\n"],
|
|
5
|
+
"mappings": "+sBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,EAAA,kBAAAC,EAAA,eAAAC,EAAA,4BAAAC,EAAA,0BAAAC,EAAA,sBAAAC,EAAA,qBAAAC,EAAA,kBAAAC,EAAA,kBAAAC,IAAA,eAAAC,EAAAX,GAEA,IAAAY,EAAuB,oBA0CvB,IAAMC,EAAgC,CAAE,MAAO,CAAC,EAAG,UAAW,KAAM,WAAY,IAAK,EAE/EC,EAAsB,0CACtBC,EAAkB,mCAExB,SAASC,EAAqBC,EAAe,CAC3C,OAAOA,EAAM,QAAQ,SAAU,MAAM,CACvC,CAEA,IAAMC,EAAN,KAAqB,CAArB,cACEC,EAAA,KAAQ,QAAQN,GAChBM,EAAA,KAAQ,YAAY,IAAI,KACxBA,EAAA,KAAQ,WAAqB,YAE7BA,EAAA,mBAAkC,MAElCA,EAAA,sBAAkBC,GAAgC,CAChD,KAAK,YAAcA,CACrB,GAEAD,EAAA,gBAAW,IAAM,KAAK,OAEtBA,EAAA,iBAAaE,IACX,KAAK,UAAU,IAAIA,CAAQ,EACpB,IAAM,CACX,KAAK,UAAU,OAAOA,CAAQ,CAChC,IASFF,EAAA,mBAAeG,GAAuB,CACpC,KAAK,SAAWA,CAClB,GAEAH,EAAA,mBAAc,IAAM,KAAK,UAEzBA,EAAA,gBAAW,IAAM,KAAK,MAAM,MAAM,QAElCA,EAAA,cAAUI,GAAe,KAAK,MAAM,MAAM,KAAMC,GAAUA,EAAM,KAAOD,CAAE,GAsBzEJ,EAAA,YAAO,CAACI,EAAYD,EAA4B,KAAK,WAAa,CAChE,GAAM,CAAE,MAAAG,CAAM,EAAI,KAAK,MACvB,GAAIA,EAAM,KAAMD,GAAUA,EAAM,KAAO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6
|
+
"names": ["dropdown_menu_drill_down_exports", "__export", "DrillDownLevelContext", "DrillDownRoot", "SubContext", "useCreateDrillDownStore", "useDrillDownDirection", "useDrillDownStore", "usePanelPosition", "useStackEntry", "useSubContext", "__toCommonJS", "React", "INITIAL_STATE", "PANEL_ITEM_SELECTOR", "BACK_ITEM_CLASS", "escapeAttributeValue", "value", "DrillDownStore", "__publicField", "element", "listener", "modality", "id", "entry", "stack", "trigger", "name", "scrollTop", "top", "index", "next", "root", "change", "content", "scroller", "focus", "panel", "items", "item", "DrillDownStoreContext", "DrillDownLevelContext", "useDrillDownStore", "useCreateDrillDownStore", "store", "selectDepth", "state", "selectDirection", "getServerDepth", "getServerDirection", "DrillDownRoot", "behavior", "open", "children", "isDrillDown", "depth", "direction", "isRoot", "wasOpenRef", "rootRef", "handleKeyDownCapture", "handlePointerDownCapture", "usePanelPosition", "getSnapshot", "noopSubscribe", "getClosed", "useStackEntry", "getUndefined", "useDrillDownDirection", "SubContext", "useSubContext"]
|
|
7
7
|
}
|