@womp/kookie-ui 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components.css +539 -494
- package/dist/cjs/components/_internal/base-menu.utils.js +1 -1
- package/dist/cjs/components/_internal/base-menu.utils.js.map +3 -3
- package/dist/cjs/components/_internal/menu-context.js +1 -1
- package/dist/cjs/components/_internal/menu-context.js.map +3 -3
- package/dist/cjs/components/_internal/shell-bottom.d.ts +6 -7
- package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +4 -4
- package/dist/cjs/components/_internal/shell-handles.d.ts +9 -0
- package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-handles.js +1 -1
- package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
- package/dist/cjs/components/_internal/shell-inspector.d.ts +4 -6
- package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +4 -4
- package/dist/cjs/components/_internal/shell-pane.d.ts +70 -0
- package/dist/cjs/components/_internal/shell-pane.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-pane.js +2 -0
- package/dist/cjs/components/_internal/shell-pane.js.map +7 -0
- package/dist/cjs/components/_internal/shell-resizable.d.ts +48 -0
- package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-resizable.js +2 -0
- package/dist/cjs/components/_internal/shell-resizable.js.map +7 -0
- package/dist/cjs/components/_internal/shell-resize.d.ts +11 -3
- package/dist/cjs/components/_internal/shell-resize.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-resize.js +1 -1
- package/dist/cjs/components/_internal/shell-resize.js.map +2 -2
- package/dist/cjs/components/_internal/shell-rest.d.ts +27 -0
- package/dist/cjs/components/_internal/shell-rest.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-rest.js +2 -0
- package/dist/cjs/components/_internal/shell-rest.js.map +7 -0
- package/dist/cjs/components/_internal/shell-sidebar.d.ts +7 -12
- package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
- package/dist/cjs/components/_internal/shell-store.d.ts +99 -0
- package/dist/cjs/components/_internal/shell-store.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-store.js +2 -0
- package/dist/cjs/components/_internal/shell-store.js.map +7 -0
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +3 -3
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +3 -3
- package/dist/cjs/components/index.js +5 -5
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/components/schemas/index.js +1 -1
- package/dist/cjs/components/schemas/index.js.map +3 -3
- package/dist/cjs/components/schemas/shell.schema.d.ts +277 -229
- 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 +3 -3
- package/dist/cjs/components/shell.context.d.ts +25 -114
- package/dist/cjs/components/shell.context.d.ts.map +1 -1
- package/dist/cjs/components/shell.context.js +1 -1
- package/dist/cjs/components/shell.context.js.map +4 -4
- package/dist/cjs/components/shell.d.ts +42 -21
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.hooks.d.ts +7 -23
- package/dist/cjs/components/shell.hooks.d.ts.map +1 -1
- package/dist/cjs/components/shell.hooks.js +1 -1
- package/dist/cjs/components/shell.hooks.js.map +4 -4
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +4 -4
- package/dist/cjs/components/shell.types.d.ts +19 -2
- package/dist/cjs/components/shell.types.d.ts.map +1 -1
- package/dist/cjs/components/shell.types.js +1 -1
- package/dist/cjs/components/shell.types.js.map +3 -3
- package/dist/cjs/components/sidebar.d.ts.map +1 -1
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +3 -3
- package/dist/cjs/hooks/use-breakpoint.d.ts +5 -0
- 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/esm/{chunk-HJU4I34X.js → chunk-25X75TI7.js} +2 -2
- package/dist/esm/{chunk-4XKK32M4.js → chunk-26I257HE.js} +2 -2
- package/dist/esm/chunk-2EQWBT2S.js +2 -0
- package/dist/esm/chunk-2EQWBT2S.js.map +7 -0
- package/dist/esm/{chunk-GLERJXVS.js → chunk-2Q7BJ7YG.js} +2 -2
- package/dist/esm/chunk-3J6AUDID.js +2 -0
- package/dist/esm/chunk-3J6AUDID.js.map +7 -0
- package/dist/esm/{chunk-7EWFBWBS.js → chunk-3PTSRBVY.js} +2 -2
- package/dist/esm/chunk-3XSB7YIM.js +2 -0
- package/dist/esm/{chunk-FMBECDL4.js.map → chunk-3XSB7YIM.js.map} +3 -3
- package/dist/esm/{chunk-O2U6RJTB.js → chunk-44JZYS7A.js} +2 -2
- package/dist/esm/{chunk-CTA5ODAO.js → chunk-4WU2WKUJ.js} +2 -2
- package/dist/esm/{chunk-KZWNGWIM.js → chunk-5M7STAH3.js} +2 -2
- package/dist/esm/{chunk-5WRCK4R7.js → chunk-5TAHT6VC.js} +2 -2
- package/dist/esm/{chunk-RNTCHVFI.js → chunk-6J6YX2VX.js} +2 -2
- package/dist/esm/{chunk-AGSSWWFI.js → chunk-7FKKGUHK.js} +2 -2
- package/dist/esm/{chunk-WHFJ4JUN.js → chunk-7NYODT3Z.js} +2 -2
- package/dist/esm/{chunk-NVDXXGVW.js → chunk-7PMMYHZV.js} +2 -2
- package/dist/esm/chunk-A2XVR7GL.js +2 -0
- package/dist/esm/chunk-A2XVR7GL.js.map +7 -0
- package/dist/esm/chunk-ADXZNG4F.js +2 -0
- package/dist/esm/chunk-ADXZNG4F.js.map +7 -0
- package/dist/esm/chunk-AGNIFHOE.js +2 -0
- package/dist/esm/chunk-AGNIFHOE.js.map +7 -0
- package/dist/esm/{chunk-KJUDZCYK.js → chunk-AIHQ3MVK.js} +2 -2
- package/dist/esm/{chunk-UBOOUDS4.js → chunk-AO32NT75.js} +2 -2
- package/dist/esm/chunk-BZZXXZ3O.js +2 -0
- package/dist/esm/chunk-BZZXXZ3O.js.map +7 -0
- package/dist/esm/{chunk-JDGJSNWT.js → chunk-C5RVO3C3.js} +2 -2
- package/dist/esm/{chunk-IHK3H2OM.js → chunk-CBNTPHYK.js} +2 -2
- package/dist/esm/{chunk-BBJUB52V.js → chunk-CRBOJ7N7.js} +2 -2
- package/dist/esm/{chunk-VHECAEUP.js → chunk-DCIQHXAR.js} +2 -2
- package/dist/esm/{chunk-43A5GUSI.js → chunk-EHBAK3LQ.js} +2 -2
- package/dist/esm/{chunk-K3UAS7RW.js → chunk-F3AXE27Q.js} +2 -2
- package/dist/esm/{chunk-KFR3CK24.js → chunk-FB3PD4Z3.js} +2 -2
- package/dist/esm/{chunk-MCPRXVKZ.js → chunk-FEAOFF77.js} +2 -2
- package/dist/esm/{chunk-VZSQATP6.js → chunk-G4YKBAZT.js} +2 -2
- package/dist/esm/{chunk-ECXGQQJB.js → chunk-GDAKJS64.js} +2 -2
- package/dist/esm/{chunk-VR7ZAFYN.js → chunk-GGSJXOKR.js} +2 -2
- package/dist/esm/chunk-GM7KMQDI.js +2 -0
- package/dist/esm/chunk-GMHA5CFH.js +2 -0
- package/dist/esm/chunk-GMHA5CFH.js.map +7 -0
- package/dist/esm/{chunk-CESYMTJQ.js → chunk-H4GR4262.js} +2 -2
- package/dist/esm/{chunk-WXQIIKWV.js → chunk-HBIF43PT.js} +2 -2
- package/dist/esm/chunk-HCNO7PX6.js +2 -0
- package/dist/esm/chunk-HCNO7PX6.js.map +7 -0
- package/dist/esm/{chunk-2264DHUW.js → chunk-HMSSFU6I.js} +2 -2
- package/dist/esm/chunk-HWQ3NTJP.js +2 -0
- package/dist/esm/chunk-HWQ3NTJP.js.map +7 -0
- package/dist/esm/{chunk-S5C5YRBS.js → chunk-IDUVJJYG.js} +2 -2
- package/dist/esm/{chunk-CIYF56YS.js → chunk-IK3MQHA5.js} +2 -2
- package/dist/esm/{chunk-CKMMUHKE.js → chunk-JDEBKA56.js} +2 -2
- package/dist/esm/{chunk-E67CIG6A.js → chunk-JDWCQ2XP.js} +2 -2
- package/dist/esm/{chunk-L3BWTV7I.js → chunk-JQSZF3E2.js} +2 -2
- package/dist/esm/{chunk-MEO7MJMQ.js → chunk-JQW4XYBS.js} +2 -2
- package/dist/esm/{chunk-KMPE7TJ6.js → chunk-JRFZ535T.js} +2 -2
- package/dist/esm/{chunk-CDG5WH4U.js → chunk-KEEPKI2X.js} +2 -2
- package/dist/esm/{chunk-GAV3NHYL.js → chunk-KV4SZP3F.js} +2 -2
- package/dist/esm/{chunk-FG7XM7KJ.js → chunk-LJCUPAOI.js} +2 -2
- package/dist/esm/{chunk-N4GTDLRD.js → chunk-MBCQA7UZ.js} +2 -2
- package/dist/esm/chunk-MM5IHQFM.js +2 -0
- package/dist/esm/{chunk-Y5RCH23Z.js → chunk-NQXRWBQM.js} +2 -2
- package/dist/esm/{chunk-CSKZZOI2.js → chunk-NTNMJX5M.js} +2 -2
- package/dist/esm/{chunk-V27ZAN3E.js → chunk-NV3P2CKH.js} +2 -2
- package/dist/esm/{chunk-4ME6O27S.js → chunk-O4CSXNST.js} +2 -2
- package/dist/esm/chunk-ODCVOXEV.js +2 -0
- package/dist/esm/{chunk-W2FOBR5Q.js → chunk-OEEF6KJG.js} +2 -2
- package/dist/esm/{chunk-ABSKRHVM.js → chunk-OJSOX3AX.js} +2 -2
- package/dist/esm/{chunk-JGLAE5G7.js → chunk-OQU2SKLN.js} +2 -2
- package/dist/esm/{chunk-PZ7OYATT.js → chunk-OTKQN2KY.js} +2 -2
- package/dist/esm/{chunk-QWVU2TW4.js → chunk-P27KV2LS.js} +2 -2
- package/dist/esm/{chunk-JUY7CBSL.js → chunk-PBFSBHBS.js} +2 -2
- package/dist/esm/{chunk-DSJY5RI3.js → chunk-PDUHBDFC.js} +2 -2
- package/dist/esm/{chunk-MTOLKA6S.js → chunk-POG3YABW.js} +2 -2
- package/dist/esm/chunk-PYHEBG5I.js +2 -0
- package/dist/esm/chunk-PYHEBG5I.js.map +7 -0
- package/dist/esm/{chunk-GO7OHBHW.js → chunk-PYXMGEO7.js} +2 -2
- package/dist/esm/{chunk-VNH7BJOA.js → chunk-QEGEUD4D.js} +2 -2
- package/dist/esm/chunk-QEL55MLF.js +2 -0
- package/dist/esm/{chunk-MS5J4MF6.js → chunk-QJVAS7AK.js} +2 -2
- package/dist/esm/chunk-ROSWI2CL.js +2 -0
- package/dist/esm/chunk-ROSWI2CL.js.map +7 -0
- package/dist/esm/{chunk-KCWESYMR.js → chunk-RY67WG3O.js} +2 -2
- package/dist/esm/{chunk-IFM4EMZB.js → chunk-TLGXIWAS.js} +2 -2
- package/dist/esm/{chunk-6FLLFCBU.js → chunk-UBSLEGQZ.js} +2 -2
- package/dist/esm/{chunk-VBI3AWPT.js → chunk-UNWPH3SO.js} +2 -2
- package/dist/esm/chunk-V5ZSDDVZ.js +2 -0
- package/dist/esm/chunk-V5ZSDDVZ.js.map +7 -0
- package/dist/esm/{chunk-X7V3V3W4.js → chunk-VTIL55SR.js} +2 -2
- package/dist/esm/chunk-VUNNS3ZU.js +2 -0
- package/dist/esm/chunk-VUNNS3ZU.js.map +7 -0
- package/dist/esm/{chunk-ALWNS44Q.js → chunk-W2LD2YE6.js} +2 -2
- package/dist/esm/{chunk-2I7QRVJ5.js → chunk-WGWUEU4K.js} +2 -2
- package/dist/esm/{chunk-EPTYNVCU.js → chunk-WIDJYVZF.js} +2 -2
- package/dist/esm/{chunk-OLAWVEAI.js → chunk-WJBOOAIO.js} +2 -2
- package/dist/esm/{chunk-7FC7HF76.js → chunk-WQCB7KSH.js} +2 -2
- package/dist/esm/{chunk-YBSRX63K.js → chunk-WZFVTC7P.js} +2 -2
- package/dist/esm/chunk-XDDKT4NF.js +2 -0
- package/dist/esm/{chunk-KFA53SVQ.js → chunk-YA5DF67M.js} +2 -2
- package/dist/esm/chunk-YA5DF67M.js.map +7 -0
- package/dist/esm/chunk-YAQBIO2B.js +2 -0
- package/dist/esm/chunk-YAQBIO2B.js.map +7 -0
- package/dist/esm/{chunk-OFUNVHZ5.js → chunk-YG66IRW4.js} +2 -2
- package/dist/esm/{chunk-WGYUWEQV.js → chunk-YVSM2LGS.js} +2 -2
- package/dist/esm/{chunk-4NTGF22C.js → chunk-Z7AZNMNX.js} +2 -2
- package/dist/esm/chunk-ZJ33QP5N.js +2 -0
- package/dist/esm/{chunk-OGXZHAQL.js → chunk-ZW26J2SA.js} +2 -2
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/_internal/base-menu.utils.js +1 -1
- package/dist/esm/components/_internal/menu-context.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.d.ts +6 -7
- package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-handles.d.ts +9 -0
- package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-handles.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.d.ts +4 -6
- package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-pane.d.ts +70 -0
- package/dist/esm/components/_internal/shell-pane.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-pane.js +2 -0
- package/dist/esm/components/_internal/shell-resizable.d.ts +48 -0
- package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-resizable.js +2 -0
- package/dist/esm/components/_internal/shell-resizable.js.map +7 -0
- package/dist/esm/components/_internal/shell-resize.d.ts +11 -3
- package/dist/esm/components/_internal/shell-resize.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-resize.js +1 -1
- package/dist/esm/components/_internal/shell-rest.d.ts +27 -0
- package/dist/esm/components/_internal/shell-rest.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-rest.js +2 -0
- package/dist/esm/components/_internal/shell-rest.js.map +7 -0
- package/dist/esm/components/_internal/shell-sidebar.d.ts +7 -12
- package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/_internal/shell-store.d.ts +99 -0
- package/dist/esm/components/_internal/shell-store.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-store.js +2 -0
- package/dist/esm/components/_internal/shell-store.js.map +7 -0
- package/dist/esm/components/accordion.js +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/avatar.js +1 -1
- package/dist/esm/components/badge.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/button.js +1 -1
- package/dist/esm/components/callout.js +1 -1
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/checkbox-cards.js +1 -1
- package/dist/esm/components/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox.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.js +1 -1
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/data-list.js +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dropdown-menu.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/grid.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/icon-button.js +1 -1
- package/dist/esm/components/image.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/inset.js +1 -1
- package/dist/esm/components/kbd.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/popover.js +1 -1
- package/dist/esm/components/progress.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-group.js +1 -1
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/schemas/index.js +1 -1
- package/dist/esm/components/schemas/shell.schema.d.ts +277 -229
- 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/scroll-area.js +1 -1
- package/dist/esm/components/section.js +1 -1
- package/dist/esm/components/segmented-control.js +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/separator.js +1 -1
- package/dist/esm/components/sheet.js +1 -1
- package/dist/esm/components/shell.context.d.ts +25 -114
- package/dist/esm/components/shell.context.d.ts.map +1 -1
- package/dist/esm/components/shell.context.js +1 -1
- package/dist/esm/components/shell.d.ts +42 -21
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.hooks.d.ts +7 -23
- package/dist/esm/components/shell.hooks.d.ts.map +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.d.ts +19 -2
- package/dist/esm/components/shell.types.d.ts.map +1 -1
- package/dist/esm/components/shell.types.js +1 -1
- package/dist/esm/components/sidebar.d.ts.map +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/skeleton.js +1 -1
- package/dist/esm/components/slider.js +1 -1
- package/dist/esm/components/spinner.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/tab-nav.js +1 -1
- package/dist/esm/components/table.js +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/text-area.js +1 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/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/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/user-card.js +1 -1
- package/dist/esm/components/virtual-menu.js +1 -1
- package/dist/esm/helpers/extract-props.js +1 -1
- package/dist/esm/helpers/get-margin-styles.js +1 -1
- package/dist/esm/helpers/get-responsive-styles.js +1 -1
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/use-breakpoint.d.ts +5 -0
- package/dist/esm/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/esm/hooks/use-breakpoint.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/index.js +1 -1
- package/package.json +7 -2
- package/schemas/index.json +1655 -0
- package/schemas/shell-bottom.d.ts +2 -0
- package/schemas/shell-bottom.json +180 -76
- package/schemas/shell-content.d.ts +2 -0
- package/schemas/shell-content.json +11 -5
- package/schemas/shell-handle.d.ts +2 -0
- package/schemas/shell-handle.json +7 -5
- package/schemas/shell-header.d.ts +2 -0
- package/schemas/shell-header.json +9 -10
- package/schemas/shell-inspector.d.ts +2 -0
- package/schemas/shell-inspector.json +183 -79
- package/schemas/shell-panel.d.ts +2 -0
- package/schemas/shell-panel.json +180 -76
- package/schemas/shell-rail.d.ts +2 -0
- package/schemas/shell-rail.json +137 -64
- package/schemas/shell-root.d.ts +2 -0
- package/schemas/shell-root.json +11 -9
- package/schemas/shell-sidebar.d.ts +2 -0
- package/schemas/shell-sidebar.json +274 -85
- package/schemas/shell-trigger.d.ts +2 -0
- package/schemas/shell-trigger.json +29 -17
- package/src/components/_internal/base-sidebar-menu.css +2 -1
- package/src/components/_internal/shell-bottom.tsx +92 -361
- package/src/components/_internal/shell-handles.tsx +193 -108
- package/src/components/_internal/shell-inspector.tsx +93 -360
- package/src/components/_internal/shell-pane.tsx +283 -0
- package/src/components/_internal/shell-resizable.tsx +263 -0
- package/src/components/_internal/shell-resize.tsx +11 -3
- package/src/components/_internal/shell-rest.ts +45 -0
- package/src/components/_internal/shell-sidebar.tsx +130 -441
- package/src/components/_internal/shell-store.tsx +204 -0
- package/src/components/schemas/shell.schema.ts +162 -153
- package/src/components/shell.context.tsx +112 -124
- package/src/components/shell.css +637 -496
- package/src/components/shell.hooks.ts +12 -170
- package/src/components/shell.tsx +566 -1497
- package/src/components/shell.types.ts +22 -2
- package/src/components/sidebar.tsx +17 -28
- package/src/hooks/use-breakpoint.ts +9 -0
- package/styles.css +539 -494
- package/dist/cjs/components/_internal/shell-prop-helpers.d.ts +0 -7
- package/dist/cjs/components/_internal/shell-prop-helpers.d.ts.map +0 -1
- package/dist/cjs/components/_internal/shell-prop-helpers.js +0 -2
- package/dist/cjs/components/_internal/shell-prop-helpers.js.map +0 -7
- package/dist/esm/chunk-2SZZ75RJ.js +0 -2
- package/dist/esm/chunk-2SZZ75RJ.js.map +0 -7
- package/dist/esm/chunk-4JQZUQY7.js +0 -2
- package/dist/esm/chunk-5LXFJMFB.js +0 -2
- package/dist/esm/chunk-5LXFJMFB.js.map +0 -7
- package/dist/esm/chunk-CECQNGUL.js +0 -2
- package/dist/esm/chunk-CECQNGUL.js.map +0 -7
- package/dist/esm/chunk-CEIK5U6C.js +0 -2
- package/dist/esm/chunk-CEIK5U6C.js.map +0 -7
- package/dist/esm/chunk-CJ27XP5Z.js +0 -2
- package/dist/esm/chunk-CJ27XP5Z.js.map +0 -7
- package/dist/esm/chunk-EE2IH2GL.js +0 -2
- package/dist/esm/chunk-EE2IH2GL.js.map +0 -7
- package/dist/esm/chunk-FMBECDL4.js +0 -2
- package/dist/esm/chunk-HSAG7C53.js +0 -2
- package/dist/esm/chunk-JJKQ7CGI.js +0 -2
- package/dist/esm/chunk-KFA53SVQ.js.map +0 -7
- package/dist/esm/chunk-KRDP5SQ7.js +0 -2
- package/dist/esm/chunk-KRDP5SQ7.js.map +0 -7
- package/dist/esm/chunk-M6DJRFJZ.js +0 -2
- package/dist/esm/chunk-M6DJRFJZ.js.map +0 -7
- package/dist/esm/chunk-MCQCG6AS.js +0 -2
- package/dist/esm/chunk-NIQT45PJ.js +0 -2
- package/dist/esm/chunk-NNO7M466.js +0 -2
- package/dist/esm/chunk-NNO7M466.js.map +0 -7
- package/dist/esm/chunk-SNHEJU2S.js +0 -2
- package/dist/esm/chunk-SNHEJU2S.js.map +0 -7
- package/dist/esm/chunk-TLWTUKKL.js +0 -2
- package/dist/esm/chunk-TLWTUKKL.js.map +0 -7
- package/dist/esm/chunk-XI5YXUCK.js +0 -2
- package/dist/esm/components/_internal/shell-prop-helpers.d.ts +0 -7
- package/dist/esm/components/_internal/shell-prop-helpers.d.ts.map +0 -1
- package/dist/esm/components/_internal/shell-prop-helpers.js +0 -2
- package/src/components/_internal/shell-prop-helpers.ts +0 -54
- /package/dist/esm/{chunk-HJU4I34X.js.map → chunk-25X75TI7.js.map} +0 -0
- /package/dist/esm/{chunk-4XKK32M4.js.map → chunk-26I257HE.js.map} +0 -0
- /package/dist/esm/{chunk-GLERJXVS.js.map → chunk-2Q7BJ7YG.js.map} +0 -0
- /package/dist/esm/{chunk-7EWFBWBS.js.map → chunk-3PTSRBVY.js.map} +0 -0
- /package/dist/esm/{chunk-O2U6RJTB.js.map → chunk-44JZYS7A.js.map} +0 -0
- /package/dist/esm/{chunk-CTA5ODAO.js.map → chunk-4WU2WKUJ.js.map} +0 -0
- /package/dist/esm/{chunk-KZWNGWIM.js.map → chunk-5M7STAH3.js.map} +0 -0
- /package/dist/esm/{chunk-5WRCK4R7.js.map → chunk-5TAHT6VC.js.map} +0 -0
- /package/dist/esm/{chunk-RNTCHVFI.js.map → chunk-6J6YX2VX.js.map} +0 -0
- /package/dist/esm/{chunk-AGSSWWFI.js.map → chunk-7FKKGUHK.js.map} +0 -0
- /package/dist/esm/{chunk-WHFJ4JUN.js.map → chunk-7NYODT3Z.js.map} +0 -0
- /package/dist/esm/{chunk-NVDXXGVW.js.map → chunk-7PMMYHZV.js.map} +0 -0
- /package/dist/esm/{chunk-KJUDZCYK.js.map → chunk-AIHQ3MVK.js.map} +0 -0
- /package/dist/esm/{chunk-UBOOUDS4.js.map → chunk-AO32NT75.js.map} +0 -0
- /package/dist/esm/{chunk-JDGJSNWT.js.map → chunk-C5RVO3C3.js.map} +0 -0
- /package/dist/esm/{chunk-IHK3H2OM.js.map → chunk-CBNTPHYK.js.map} +0 -0
- /package/dist/esm/{chunk-BBJUB52V.js.map → chunk-CRBOJ7N7.js.map} +0 -0
- /package/dist/esm/{chunk-VHECAEUP.js.map → chunk-DCIQHXAR.js.map} +0 -0
- /package/dist/esm/{chunk-43A5GUSI.js.map → chunk-EHBAK3LQ.js.map} +0 -0
- /package/dist/esm/{chunk-K3UAS7RW.js.map → chunk-F3AXE27Q.js.map} +0 -0
- /package/dist/esm/{chunk-KFR3CK24.js.map → chunk-FB3PD4Z3.js.map} +0 -0
- /package/dist/esm/{chunk-MCPRXVKZ.js.map → chunk-FEAOFF77.js.map} +0 -0
- /package/dist/esm/{chunk-VZSQATP6.js.map → chunk-G4YKBAZT.js.map} +0 -0
- /package/dist/esm/{chunk-ECXGQQJB.js.map → chunk-GDAKJS64.js.map} +0 -0
- /package/dist/esm/{chunk-VR7ZAFYN.js.map → chunk-GGSJXOKR.js.map} +0 -0
- /package/dist/esm/{chunk-4JQZUQY7.js.map → chunk-GM7KMQDI.js.map} +0 -0
- /package/dist/esm/{chunk-CESYMTJQ.js.map → chunk-H4GR4262.js.map} +0 -0
- /package/dist/esm/{chunk-WXQIIKWV.js.map → chunk-HBIF43PT.js.map} +0 -0
- /package/dist/esm/{chunk-2264DHUW.js.map → chunk-HMSSFU6I.js.map} +0 -0
- /package/dist/esm/{chunk-S5C5YRBS.js.map → chunk-IDUVJJYG.js.map} +0 -0
- /package/dist/esm/{chunk-CIYF56YS.js.map → chunk-IK3MQHA5.js.map} +0 -0
- /package/dist/esm/{chunk-CKMMUHKE.js.map → chunk-JDEBKA56.js.map} +0 -0
- /package/dist/esm/{chunk-E67CIG6A.js.map → chunk-JDWCQ2XP.js.map} +0 -0
- /package/dist/esm/{chunk-L3BWTV7I.js.map → chunk-JQSZF3E2.js.map} +0 -0
- /package/dist/esm/{chunk-MEO7MJMQ.js.map → chunk-JQW4XYBS.js.map} +0 -0
- /package/dist/esm/{chunk-KMPE7TJ6.js.map → chunk-JRFZ535T.js.map} +0 -0
- /package/dist/esm/{chunk-CDG5WH4U.js.map → chunk-KEEPKI2X.js.map} +0 -0
- /package/dist/esm/{chunk-GAV3NHYL.js.map → chunk-KV4SZP3F.js.map} +0 -0
- /package/dist/esm/{chunk-FG7XM7KJ.js.map → chunk-LJCUPAOI.js.map} +0 -0
- /package/dist/esm/{chunk-N4GTDLRD.js.map → chunk-MBCQA7UZ.js.map} +0 -0
- /package/dist/esm/{chunk-JJKQ7CGI.js.map → chunk-MM5IHQFM.js.map} +0 -0
- /package/dist/esm/{chunk-Y5RCH23Z.js.map → chunk-NQXRWBQM.js.map} +0 -0
- /package/dist/esm/{chunk-CSKZZOI2.js.map → chunk-NTNMJX5M.js.map} +0 -0
- /package/dist/esm/{chunk-V27ZAN3E.js.map → chunk-NV3P2CKH.js.map} +0 -0
- /package/dist/esm/{chunk-4ME6O27S.js.map → chunk-O4CSXNST.js.map} +0 -0
- /package/dist/esm/{chunk-HSAG7C53.js.map → chunk-ODCVOXEV.js.map} +0 -0
- /package/dist/esm/{chunk-W2FOBR5Q.js.map → chunk-OEEF6KJG.js.map} +0 -0
- /package/dist/esm/{chunk-ABSKRHVM.js.map → chunk-OJSOX3AX.js.map} +0 -0
- /package/dist/esm/{chunk-JGLAE5G7.js.map → chunk-OQU2SKLN.js.map} +0 -0
- /package/dist/esm/{chunk-PZ7OYATT.js.map → chunk-OTKQN2KY.js.map} +0 -0
- /package/dist/esm/{chunk-QWVU2TW4.js.map → chunk-P27KV2LS.js.map} +0 -0
- /package/dist/esm/{chunk-JUY7CBSL.js.map → chunk-PBFSBHBS.js.map} +0 -0
- /package/dist/esm/{chunk-DSJY5RI3.js.map → chunk-PDUHBDFC.js.map} +0 -0
- /package/dist/esm/{chunk-MTOLKA6S.js.map → chunk-POG3YABW.js.map} +0 -0
- /package/dist/esm/{chunk-GO7OHBHW.js.map → chunk-PYXMGEO7.js.map} +0 -0
- /package/dist/esm/{chunk-VNH7BJOA.js.map → chunk-QEGEUD4D.js.map} +0 -0
- /package/dist/esm/{chunk-MCQCG6AS.js.map → chunk-QEL55MLF.js.map} +0 -0
- /package/dist/esm/{chunk-MS5J4MF6.js.map → chunk-QJVAS7AK.js.map} +0 -0
- /package/dist/esm/{chunk-KCWESYMR.js.map → chunk-RY67WG3O.js.map} +0 -0
- /package/dist/esm/{chunk-IFM4EMZB.js.map → chunk-TLGXIWAS.js.map} +0 -0
- /package/dist/esm/{chunk-6FLLFCBU.js.map → chunk-UBSLEGQZ.js.map} +0 -0
- /package/dist/esm/{chunk-VBI3AWPT.js.map → chunk-UNWPH3SO.js.map} +0 -0
- /package/dist/esm/{chunk-X7V3V3W4.js.map → chunk-VTIL55SR.js.map} +0 -0
- /package/dist/esm/{chunk-ALWNS44Q.js.map → chunk-W2LD2YE6.js.map} +0 -0
- /package/dist/esm/{chunk-2I7QRVJ5.js.map → chunk-WGWUEU4K.js.map} +0 -0
- /package/dist/esm/{chunk-EPTYNVCU.js.map → chunk-WIDJYVZF.js.map} +0 -0
- /package/dist/esm/{chunk-OLAWVEAI.js.map → chunk-WJBOOAIO.js.map} +0 -0
- /package/dist/esm/{chunk-7FC7HF76.js.map → chunk-WQCB7KSH.js.map} +0 -0
- /package/dist/esm/{chunk-YBSRX63K.js.map → chunk-WZFVTC7P.js.map} +0 -0
- /package/dist/esm/{chunk-XI5YXUCK.js.map → chunk-XDDKT4NF.js.map} +0 -0
- /package/dist/esm/{chunk-OFUNVHZ5.js.map → chunk-YG66IRW4.js.map} +0 -0
- /package/dist/esm/{chunk-WGYUWEQV.js.map → chunk-YVSM2LGS.js.map} +0 -0
- /package/dist/esm/{chunk-4NTGF22C.js.map → chunk-Z7AZNMNX.js.map} +0 -0
- /package/dist/esm/{chunk-NIQT45PJ.js.map → chunk-ZJ33QP5N.js.map} +0 -0
- /package/dist/esm/{chunk-OGXZHAQL.js.map → chunk-ZW26J2SA.js.map} +0 -0
- /package/dist/esm/components/_internal/{shell-prop-helpers.js.map → shell-pane.js.map} +0 -0
|
@@ -1,50 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
4
|
-
import { VisuallyHidden } from '../visually-hidden.js';
|
|
5
|
-
import { useBottomMode, usePresentation, usePeek, useShellActions, useInset } from '../shell.context.js';
|
|
6
|
-
import { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';
|
|
5
|
+
import { useComposedRefs } from 'radix-ui/internal';
|
|
7
6
|
import { PaneResizeContext } from './shell-resize.js';
|
|
8
7
|
import { BottomHandle, PaneHandle } from './shell-handles.js';
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
type
|
|
8
|
+
import { usePane, paneAttributes, usePresentationTable } from './shell-pane.js';
|
|
9
|
+
import { splitHandles, useResizablePane, type SizeChangeMeta } from './shell-resizable.js';
|
|
10
|
+
import { useInsetRegistration, warnOnce } from './shell-store.js';
|
|
11
|
+
import { bottomAnchoredGrowth, detailRest, toPaneValue, withoutRemovedPaneProps } from './shell-rest.js';
|
|
12
|
+
import { readBreakpoint } from '../../hooks/use-breakpoint.js';
|
|
13
|
+
import type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps } from '../shell.types.js';
|
|
14
|
+
|
|
15
|
+
type BottomOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'dismiss' };
|
|
15
16
|
type BottomControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; defaultOpen?: never };
|
|
16
|
-
|
|
17
|
+
/** Since 0.8.0 `defaultOpen` takes a responsive object here too, as the docs already said it did. */
|
|
18
|
+
type BottomUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; open?: never };
|
|
17
19
|
type BottomSizeControlledProps = { size: number | string; defaultSize?: never };
|
|
18
20
|
type BottomSizeUncontrolledProps = { defaultSize?: number | string; size?: never };
|
|
19
|
-
type BottomSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };
|
|
20
21
|
type BottomPublicProps = PaneBaseProps &
|
|
21
22
|
(BottomControlledProps | BottomUncontrolledProps) &
|
|
22
23
|
(BottomSizeControlledProps | BottomSizeUncontrolledProps) & {
|
|
23
|
-
onSizeChange?: (size: number, meta:
|
|
24
|
+
onSizeChange?: (size: number, meta: SizeChangeMeta) => void;
|
|
24
25
|
sizeUpdate?: 'throttle' | 'debounce';
|
|
25
26
|
sizeUpdateMs?: number;
|
|
26
|
-
/** When true, adds margin and triggers gray backdrop on Shell. */
|
|
27
|
+
/** When true, adds margin and triggers the gray backdrop on the Shell. */
|
|
27
28
|
inset?: boolean;
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
type BottomComponent = React.ForwardRefExoticComponent<BottomPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof BottomHandle };
|
|
31
32
|
|
|
32
|
-
const
|
|
33
|
-
'className',
|
|
34
|
-
'children',
|
|
35
|
-
'defaultOpen',
|
|
36
|
-
'open',
|
|
37
|
-
'onOpenChange',
|
|
38
|
-
'size',
|
|
39
|
-
'defaultSize',
|
|
40
|
-
'onSizeChange',
|
|
41
|
-
'sizeUpdate',
|
|
42
|
-
'sizeUpdateMs',
|
|
43
|
-
'style',
|
|
44
|
-
'inset',
|
|
45
|
-
] as const satisfies readonly (keyof BottomPublicProps)[];
|
|
33
|
+
const BOTTOM_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };
|
|
46
34
|
|
|
47
|
-
export const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((
|
|
35
|
+
export const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((props, ref) => {
|
|
48
36
|
const {
|
|
49
37
|
className,
|
|
50
38
|
presentation = 'fixed',
|
|
@@ -74,351 +62,94 @@ export const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((initi
|
|
|
74
62
|
sizeUpdate,
|
|
75
63
|
sizeUpdateMs = 50,
|
|
76
64
|
inset,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const localRef = React.useRef<HTMLDivElement | null>(null);
|
|
96
|
-
const setRef = React.useCallback(
|
|
97
|
-
(node: HTMLDivElement | null) => {
|
|
98
|
-
localRef.current = node;
|
|
99
|
-
if (typeof ref === 'function') ref(node);
|
|
100
|
-
else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;
|
|
101
|
-
},
|
|
102
|
-
[ref],
|
|
103
|
-
);
|
|
104
|
-
const childArray = React.Children.toArray(children) as React.ReactElement[];
|
|
105
|
-
const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === BottomHandle);
|
|
106
|
-
const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === BottomHandle));
|
|
107
|
-
|
|
108
|
-
// Stable ref for onOpenChange to avoid effect dep churn
|
|
109
|
-
const onOpenChangeRef = React.useRef(onOpenChange);
|
|
110
|
-
const openRef = React.useRef(open);
|
|
111
|
-
React.useLayoutEffect(() => {
|
|
112
|
-
onOpenChangeRef.current = onOpenChange;
|
|
113
|
-
openRef.current = open;
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const normalizedControlledOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(open), [open]);
|
|
117
|
-
const normalizedDefaultOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(defaultOpen), [defaultOpen]);
|
|
118
|
-
const openIsResponsive = typeof open === 'object' && open !== null;
|
|
119
|
-
const { resolvedControlled: resolvedBottomControlled } = useResponsiveInitialState<PaneMode>({
|
|
120
|
-
controlledValue: normalizedControlledOpen,
|
|
121
|
-
defaultValue: normalizedDefaultOpen,
|
|
122
|
-
currentValue: bottomMode,
|
|
123
|
-
setValue: setBottomMode,
|
|
124
|
-
breakpointReady: currentBreakpointReady,
|
|
125
|
-
controlledIsResponsive: openIsResponsive,
|
|
126
|
-
onResponsiveChange: (next) => onOpenChangeRef.current?.(next === 'expanded', { reason: 'responsive' }),
|
|
127
|
-
onInit: (initial) => {
|
|
128
|
-
if (typeof openRef.current === 'undefined') {
|
|
129
|
-
onOpenChangeRef.current?.(initial === 'expanded', { reason: 'init' });
|
|
130
|
-
}
|
|
131
|
-
},
|
|
65
|
+
id,
|
|
66
|
+
...domProps
|
|
67
|
+
} = props;
|
|
68
|
+
|
|
69
|
+
const { table, attributes } = usePresentationTable(presentation, 'fixed');
|
|
70
|
+
const pane = usePane({
|
|
71
|
+
name: 'bottom',
|
|
72
|
+
label: 'Bottom',
|
|
73
|
+
propNames: BOTTOM_PROP_NAMES,
|
|
74
|
+
id,
|
|
75
|
+
controlled: toPaneValue(open),
|
|
76
|
+
defaultValue: toPaneValue(defaultOpen),
|
|
77
|
+
presentationTable: table,
|
|
78
|
+
builtIn: detailRest,
|
|
79
|
+
onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),
|
|
80
|
+
onExpand,
|
|
81
|
+
onCollapse,
|
|
82
|
+
size: expandedSize,
|
|
132
83
|
});
|
|
84
|
+
useInsetRegistration('bottom', inset);
|
|
133
85
|
|
|
134
|
-
// Ref for debounce cleanup
|
|
135
|
-
const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
136
|
-
// Cleanup debounce timeout on unmount or when dependencies change
|
|
137
86
|
React.useEffect(() => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
clearTimeout(debounceTimeoutRef.current);
|
|
141
|
-
debounceTimeoutRef.current = null;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
}, [onSizeChange, sizeUpdate, sizeUpdateMs]);
|
|
145
|
-
// Throttled/debounced emitter for onSizeChange
|
|
146
|
-
const emitSizeChange = React.useMemo(() => {
|
|
147
|
-
const cb = onSizeChange as undefined | ((s: number, meta: BottomSizeChangeMeta) => void);
|
|
148
|
-
const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';
|
|
149
|
-
const ms = sizeUpdateMs ?? 50;
|
|
150
|
-
if (!cb) return () => {};
|
|
151
|
-
if (strategy === 'debounce') {
|
|
152
|
-
return (s: number, meta: BottomSizeChangeMeta) => {
|
|
153
|
-
if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);
|
|
154
|
-
debounceTimeoutRef.current = setTimeout(() => {
|
|
155
|
-
cb(s, meta);
|
|
156
|
-
debounceTimeoutRef.current = null;
|
|
157
|
-
}, ms);
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
if (strategy === 'throttle') {
|
|
161
|
-
let last = 0;
|
|
162
|
-
return (s: number, meta: BottomSizeChangeMeta) => {
|
|
163
|
-
const now = Date.now();
|
|
164
|
-
if (now - last >= ms) {
|
|
165
|
-
last = now;
|
|
166
|
-
cb(s, meta);
|
|
167
|
-
}
|
|
168
|
-
};
|
|
87
|
+
if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {
|
|
88
|
+
warnOnce('Shell.Bottom: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');
|
|
169
89
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const nextOpen = bottomMode === 'expanded';
|
|
206
|
-
const isControlled = typeof openRef.current !== 'undefined';
|
|
207
|
-
const controlledTarget = resolvedBottomControlled === undefined ? undefined : resolvedBottomControlled === 'expanded';
|
|
208
|
-
|
|
209
|
-
if (!isControlled || (!controlledChanged && nextOpen !== controlledTarget)) {
|
|
210
|
-
onOpenChangeRef.current?.(nextOpen, { reason: 'toggle' });
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
lastBottomModeRef.current = bottomMode;
|
|
215
|
-
lastResolvedBottomControlledRef.current = resolvedBottomControlled;
|
|
216
|
-
}, [bottomMode, resolvedBottomControlled]);
|
|
217
|
-
|
|
218
|
-
// Track previous mode to only fire callbacks on actual user-initiated state transitions.
|
|
219
|
-
// We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState
|
|
220
|
-
// is complete before enabling callbacks. This avoids spurious callbacks during initialization.
|
|
221
|
-
// Use callback refs to avoid re-running effect when inline callbacks change.
|
|
222
|
-
const onExpandRef = React.useRef(onExpand);
|
|
223
|
-
const onCollapseRef = React.useRef(onCollapse);
|
|
224
|
-
React.useLayoutEffect(() => {
|
|
225
|
-
onExpandRef.current = onExpand;
|
|
226
|
-
onCollapseRef.current = onCollapse;
|
|
90
|
+
}, [snapPoints, collapseThreshold, paneId, persistence]);
|
|
91
|
+
|
|
92
|
+
const elementRef = React.useRef<HTMLElement | null>(null);
|
|
93
|
+
const composedRef = useComposedRefs(ref, pane.setElement, elementRef);
|
|
94
|
+
|
|
95
|
+
const resize = useResizablePane({
|
|
96
|
+
name: 'bottom',
|
|
97
|
+
elementId: pane.id,
|
|
98
|
+
elementRef,
|
|
99
|
+
cssVarName: '--bottom-size',
|
|
100
|
+
orientation: 'horizontal',
|
|
101
|
+
edge: 'start',
|
|
102
|
+
growth: bottomAnchoredGrowth,
|
|
103
|
+
expandedSize,
|
|
104
|
+
minSize,
|
|
105
|
+
maxSize,
|
|
106
|
+
resizable,
|
|
107
|
+
collapsible,
|
|
108
|
+
size,
|
|
109
|
+
defaultSize,
|
|
110
|
+
onSizeChange,
|
|
111
|
+
sizeUpdate,
|
|
112
|
+
sizeUpdateMs,
|
|
113
|
+
onResize,
|
|
114
|
+
onResizeStart,
|
|
115
|
+
onResizeEnd,
|
|
116
|
+
snapPoints,
|
|
117
|
+
snapTolerance,
|
|
118
|
+
collapseThreshold,
|
|
119
|
+
paneId,
|
|
120
|
+
persistence,
|
|
121
|
+
overlaying: pane.overlaying,
|
|
122
|
+
overlayingNow: () => table[readBreakpoint()] === 'overlay',
|
|
123
|
+
requestCollapse: () => pane.setValue('closed', 'toggle'),
|
|
124
|
+
requestToggle: () => pane.toggle('toggle'),
|
|
227
125
|
});
|
|
228
126
|
|
|
229
|
-
const
|
|
230
|
-
const
|
|
231
|
-
React.useEffect(() => {
|
|
232
|
-
const currentMode = bottomMode;
|
|
233
|
-
|
|
234
|
-
// Wait for breakpoint to be ready before enabling callbacks
|
|
235
|
-
if (!currentBreakpointReady) {
|
|
236
|
-
prevBottomModeRef.current = currentMode;
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// Skip the first run after breakpoint is ready - this captures the post-sync state
|
|
241
|
-
if (!hasInitializedRef.current) {
|
|
242
|
-
hasInitializedRef.current = true;
|
|
243
|
-
prevBottomModeRef.current = currentMode;
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
const prevMode = prevBottomModeRef.current;
|
|
248
|
-
|
|
249
|
-
// Only fire on actual state transitions
|
|
250
|
-
if (prevMode !== null && prevMode !== currentMode) {
|
|
251
|
-
if (currentMode === 'expanded') {
|
|
252
|
-
onExpandRef.current?.();
|
|
253
|
-
} else if (currentMode === 'collapsed') {
|
|
254
|
-
onCollapseRef.current?.();
|
|
255
|
-
}
|
|
256
|
-
prevBottomModeRef.current = currentMode;
|
|
257
|
-
}
|
|
258
|
-
}, [bottomMode, currentBreakpointReady]);
|
|
259
|
-
|
|
260
|
-
const isExpanded = bottomMode === 'expanded';
|
|
261
|
-
|
|
262
|
-
const persistenceAdapter = React.useMemo(() => {
|
|
263
|
-
if (!paneId || persistence) return persistence;
|
|
264
|
-
const key = `kookie-ui:shell:bottom:${paneId}`;
|
|
265
|
-
const adapter: PaneSizePersistence = {
|
|
266
|
-
load: () => {
|
|
267
|
-
if (typeof window === 'undefined') return undefined;
|
|
268
|
-
try {
|
|
269
|
-
const v = window.localStorage.getItem(key);
|
|
270
|
-
return v ? Number(v) : undefined;
|
|
271
|
-
} catch (err) {
|
|
272
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
273
|
-
console.warn('Shell.Bottom: failed to load persisted size', err);
|
|
274
|
-
}
|
|
275
|
-
return undefined;
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
save: (size: number) => {
|
|
279
|
-
if (typeof window === 'undefined') return;
|
|
280
|
-
try {
|
|
281
|
-
window.localStorage.setItem(key, String(size));
|
|
282
|
-
} catch (err) {
|
|
283
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
284
|
-
console.warn('Shell.Bottom: failed to save persisted size', err);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
};
|
|
289
|
-
return adapter;
|
|
290
|
-
}, [paneId, persistence]);
|
|
291
|
-
|
|
292
|
-
React.useEffect(() => {
|
|
293
|
-
let mounted = true;
|
|
294
|
-
if (!resizable || !persistenceAdapter?.load || isOverlay) return undefined;
|
|
295
|
-
const loaded = persistenceAdapter.load();
|
|
296
|
-
const applyLoaded = (value?: number) => {
|
|
297
|
-
if (!mounted || typeof value !== 'number' || !localRef.current) return;
|
|
298
|
-
localRef.current.style.setProperty('--bottom-size', `${value}px`);
|
|
299
|
-
onResize?.(value);
|
|
300
|
-
};
|
|
301
|
-
if (loaded instanceof Promise) {
|
|
302
|
-
loaded.then(applyLoaded).catch((err) => {
|
|
303
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
304
|
-
console.warn('Shell.Bottom: failed to load persisted size', err);
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
} else {
|
|
308
|
-
applyLoaded(loaded);
|
|
309
|
-
}
|
|
310
|
-
return () => {
|
|
311
|
-
mounted = false;
|
|
312
|
-
};
|
|
313
|
-
}, [resizable, persistenceAdapter, onResize, isOverlay]);
|
|
314
|
-
|
|
315
|
-
const handleEl =
|
|
316
|
-
resizable && !isOverlay && isExpanded ? (
|
|
317
|
-
<PaneResizeContext.Provider
|
|
318
|
-
value={{
|
|
319
|
-
containerRef: localRef,
|
|
320
|
-
cssVarName: '--bottom-size',
|
|
321
|
-
minSize,
|
|
322
|
-
maxSize,
|
|
323
|
-
defaultSize: expandedSize,
|
|
324
|
-
orientation: 'horizontal',
|
|
325
|
-
edge: 'start',
|
|
326
|
-
computeNext: (client, startClient, startSize) => {
|
|
327
|
-
const delta = client - startClient;
|
|
328
|
-
return startSize - delta;
|
|
329
|
-
},
|
|
330
|
-
onResize,
|
|
331
|
-
onResizeStart,
|
|
332
|
-
onResizeEnd: (size) => {
|
|
333
|
-
onResizeEnd?.(size);
|
|
334
|
-
emitSizeChange(size, { reason: 'resize' });
|
|
335
|
-
persistenceAdapter?.save?.(size);
|
|
336
|
-
},
|
|
337
|
-
target: 'bottom',
|
|
338
|
-
collapsible,
|
|
339
|
-
snapPoints,
|
|
340
|
-
snapTolerance: snapTolerance ?? 8,
|
|
341
|
-
collapseThreshold,
|
|
342
|
-
requestCollapse: () => setBottomMode('collapsed'),
|
|
343
|
-
requestToggle: () => togglePane('bottom'),
|
|
344
|
-
}}
|
|
345
|
-
>
|
|
346
|
-
{handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}
|
|
347
|
-
</PaneResizeContext.Provider>
|
|
348
|
-
) : null;
|
|
349
|
-
|
|
350
|
-
// Strip control/size props from DOM spread (moved above overlay return to keep hook order consistent)
|
|
351
|
-
// Normalize CSS lengths to px helper
|
|
352
|
-
const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'vertical'), []);
|
|
353
|
-
|
|
354
|
-
// Apply defaultSize on mount when uncontrolled (moved above overlay return)
|
|
355
|
-
React.useEffect(() => {
|
|
356
|
-
if (!localRef.current) return;
|
|
357
|
-
if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {
|
|
358
|
-
const px = normalizeSizeToPx(defaultSize);
|
|
359
|
-
if (typeof px === 'number' && Number.isFinite(px)) {
|
|
360
|
-
const minPx = typeof minSize === 'number' ? minSize : undefined;
|
|
361
|
-
const maxPx = typeof maxSize === 'number' ? maxSize : undefined;
|
|
362
|
-
const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));
|
|
363
|
-
localRef.current.style.setProperty('--bottom-size', `${clamped}px`);
|
|
364
|
-
emitSizeChange(clamped, { reason: 'init' });
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
368
|
-
}, []);
|
|
369
|
-
|
|
370
|
-
// Controlled size sync (moved above overlay return)
|
|
371
|
-
const controlledSize = size;
|
|
372
|
-
React.useEffect(() => {
|
|
373
|
-
if (!localRef.current) return;
|
|
374
|
-
if (typeof controlledSize === 'undefined') return;
|
|
375
|
-
const px = normalizeSizeToPx(controlledSize);
|
|
376
|
-
if (typeof px === 'number' && Number.isFinite(px)) {
|
|
377
|
-
const minPx = typeof minSize === 'number' ? minSize : undefined;
|
|
378
|
-
const maxPx = typeof maxSize === 'number' ? maxSize : undefined;
|
|
379
|
-
const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));
|
|
380
|
-
localRef.current.style.setProperty('--bottom-size', `${clamped}px`);
|
|
381
|
-
emitSizeChange(clamped, { reason: 'controlled' });
|
|
382
|
-
}
|
|
383
|
-
}, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);
|
|
384
|
-
|
|
385
|
-
if (isOverlay) {
|
|
386
|
-
const open = bottomMode === 'expanded';
|
|
387
|
-
return (
|
|
388
|
-
<Sheet.Root open={open} onOpenChange={(o) => setBottomMode(o ? 'expanded' : 'collapsed')}>
|
|
389
|
-
<Sheet.Content side="bottom" style={{ padding: 0 }} aria-label="Bottom panel" aria-describedby={undefined} height={{ initial: `${expandedSize}px` }}>
|
|
390
|
-
<VisuallyHidden>
|
|
391
|
-
<Sheet.Title>Bottom panel</Sheet.Title>
|
|
392
|
-
</VisuallyHidden>
|
|
393
|
-
{contentChildren}
|
|
394
|
-
</Sheet.Content>
|
|
395
|
-
</Sheet.Root>
|
|
396
|
-
);
|
|
397
|
-
}
|
|
127
|
+
const { handles, content } = splitHandles(children, BottomHandle);
|
|
128
|
+
const handle = resizable && pane.shown !== false && !pane.overlaying ? <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider> : null;
|
|
398
129
|
|
|
399
130
|
return (
|
|
400
131
|
<div
|
|
401
|
-
{...
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
data-presentation={currentBreakpointReady ? resolvedPresentation : undefined}
|
|
407
|
-
data-open={(currentBreakpointReady && isStacked && isExpanded) || undefined}
|
|
132
|
+
{...withoutRemovedPaneProps(domProps)}
|
|
133
|
+
id={pane.id}
|
|
134
|
+
ref={composedRef}
|
|
135
|
+
className={classNames('rt-ShellPane', 'rt-ShellBottom', className)}
|
|
136
|
+
{...paneAttributes(pane, attributes)}
|
|
408
137
|
data-inset={inset || undefined}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
138
|
+
tabIndex={pane.overlaying ? -1 : domProps.tabIndex}
|
|
139
|
+
style={
|
|
140
|
+
{
|
|
141
|
+
...style,
|
|
142
|
+
'--bottom-expanded-size': `${expandedSize}px`,
|
|
143
|
+
'--bottom-min-size': `${minSize}px`,
|
|
144
|
+
'--bottom-max-size': `${maxSize}px`,
|
|
145
|
+
} as CSSPropertiesWithVars
|
|
146
|
+
}
|
|
415
147
|
>
|
|
416
|
-
<div className="rt-ShellBottomContent"
|
|
417
|
-
|
|
418
|
-
</div>
|
|
419
|
-
{handleEl}
|
|
148
|
+
<div className="rt-ShellBottomContent">{content}</div>
|
|
149
|
+
{handle}
|
|
420
150
|
</div>
|
|
421
151
|
);
|
|
422
152
|
}) as BottomComponent;
|
|
153
|
+
|
|
423
154
|
Bottom.displayName = 'Shell.Bottom';
|
|
424
155
|
Bottom.Handle = BottomHandle;
|