@gridui/drawer 1.1.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,3 +46,20 @@ inline surface outside transformed or clipping ancestors and provide an adequate
46
46
  stacking context. Use a normal portalled `DrawerPanel` for independent overlays.
47
47
 
48
48
  Surface motion uses `@gridui/overlay`; load `@gridui/overlay/styles.css` after Theme and before this family.
49
+
50
+ [Component reference](docs/reference/README.md) contains focused API pages for each public component.
51
+
52
+ ## Footer actions
53
+
54
+ DrawerFooter owns the body separator, scrolling limit, and bottom safe-area inset.
55
+ It has no general content padding. Use ButtonGroup from `@gridui/button` with
56
+ `layout="cells"` for edge-aligned footer actions; ordinary footer content supplies
57
+ its own padding. Load Button styles before Drawer styles.
58
+
59
+ ```tsx
60
+ <DrawerFooter>
61
+ <ButtonGroup layout="cells">
62
+ <DrawerClose asChild><Button variant="secondary">Done</Button></DrawerClose>
63
+ </ButtonGroup>
64
+ </DrawerFooter>
65
+ ```
package/dist/index.js CHANGED
@@ -128,8 +128,8 @@ import { cn as cn5 } from "@gridui/style-utils";
128
128
  import { cva as cva3 } from "class-variance-authority";
129
129
  var drawerFooterStyles = cva3(cn5(
130
130
  "gridui-drawer-footer",
131
- "gridui-u-drawer--shrink-0 gridui-u-drawer--p-gridui-24",
132
- "gridui-u-drawer--max-h-[50dvh] gridui-u-drawer--overflow-y-auto gridui-u-drawer--pb-[max(var(--gridui-space-24),env(safe-area-inset-bottom))] gridui-u-drawer--border-t gridui-u-drawer--border-solid gridui-u-drawer--border-border"
131
+ "gridui-u-drawer--shrink-0",
132
+ "gridui-u-drawer--max-h-[50dvh] gridui-u-drawer--overflow-y-auto gridui-u-drawer--pb-[env(safe-area-inset-bottom)] gridui-u-drawer--border-t gridui-u-drawer--border-solid gridui-u-drawer--border-border"
133
133
  ));
134
134
 
135
135
  // src/drawer-footer/drawer-footer.tsx
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/drawer/drawer.tsx", "../src/drawer-body/style.ts", "../src/drawer-body/drawer-body.tsx", "../src/drawer-close/drawer-close.tsx", "../src/drawer-close-button/drawer-close-button.tsx", "../src/drawer-description/style.ts", "../src/drawer-description/drawer-description.tsx", "../src/drawer-footer/style.ts", "../src/drawer-footer/drawer-footer.tsx", "../src/drawer-header/style.ts", "../src/drawer-header/drawer-header.tsx", "../src/drawer-panel/style.ts", "../src/drawer-panel/drawer-panel.tsx", "../src/drawer-surface/surface-binding.tsx", "../src/drawer-surface/drawer-surface.tsx", "../src/drawer-title/style.ts", "../src/drawer-title/drawer-title.tsx", "../src/drawer-trigger/drawer-trigger.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Drawer\n * @namespace Drawer\n * @description Drawer\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerProps = ComponentPropsWithRef<typeof Dialog.Root>;\n\nexport const Drawer: FC<DrawerProps> = (props: DrawerProps) => {\n const state = useOverlayState(props);\n return (<OverlayOpen.Provider\n value={state.open}\n >\n <Dialog.Root\n {...props}\n {...state}\n />\n </OverlayOpen.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerBody\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerBodyStyles = cva(cn(\n \"gridui-drawer-body\",\n \"gridui-u-drawer--min-h-0 gridui-u-drawer--flex-1 gridui-u-drawer--overflow-y-auto gridui-u-drawer--overscroll-contain gridui-u-drawer--p-gridui-24\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerBody\n * @description Drawer Body\n */\n\nimport { drawerBodyStyles } from \"./style\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerBodyProps = ComponentPropsWithRef<\"div\">;\n\nexport const DrawerBody: FC<DrawerBodyProps> = (props: DrawerBodyProps) => {\n const { ref: forwardedRef, className, ...restProps } = props;\n const scrollbarRef = useScrollbars({ ref: forwardedRef });\n const ref = useInteractionOutline({ ref: scrollbarRef });\n return (<div\n {...restProps}\n ref={ref}\n className={cn(drawerBodyStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerClose\n * @description Drawer Close\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerCloseProps = ComponentPropsWithRef<typeof Dialog.Close>;\n\nexport const DrawerClose: FC<DrawerCloseProps> = (props: DrawerCloseProps) => {\n return (<Dialog.Close\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerCloseButton\n * @description Drawer Close Button\n */\n\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type DrawerCloseButtonProps = ButtonProps;\n\nexport const DrawerCloseButton: FC<DrawerCloseButtonProps> = (props: DrawerCloseButtonProps) => {\n const {\n children,\n size = \"small\",\n ...restProps\n } = props;\n const buttonProps: ButtonProps = (restProps.variant === \"text\" || restProps.variant === \"underlined\") ? {\n ...restProps,\n layout: \"standard\",\n } : {\n ...restProps,\n variant: restProps.variant === undefined ? \"quiet\" : restProps.variant,\n layout: restProps.layout === undefined ? \"icon\" : restProps.layout,\n };\n return (<Dialog.Close\n asChild\n >\n <Button\n {...buttonProps}\n size={size}\n >\n {children ?? (<X\n aria-hidden=\"true\"\n />)}\n </Button>\n </Dialog.Close>);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerDescription\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerDescriptionStyles = cva(cn(\n \"gridui-drawer-description\",\n \"gridui-u-drawer--text-muted\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerDescription\n * @description Drawer Description\n */\n\nimport { drawerDescriptionStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerDescriptionProps = ComponentPropsWithRef<typeof Dialog.Description>;\n\nexport const DrawerDescription: FC<DrawerDescriptionProps> = (props: DrawerDescriptionProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Dialog.Description\n {...restProps}\n className={cn(drawerDescriptionStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerFooter\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerFooterStyles = cva(cn(\n \"gridui-drawer-footer\",\n \"gridui-u-drawer--shrink-0 gridui-u-drawer--p-gridui-24\",\n \"gridui-u-drawer--max-h-[50dvh] gridui-u-drawer--overflow-y-auto gridui-u-drawer--pb-[max(var(--gridui-space-24),env(safe-area-inset-bottom))] gridui-u-drawer--border-t gridui-u-drawer--border-solid gridui-u-drawer--border-border\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerFooter\n * @description Drawer Footer\n */\n\nimport { drawerFooterStyles } from \"./style\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerFooterProps = ComponentPropsWithRef<\"div\">;\n\nexport const DrawerFooter: FC<DrawerFooterProps> = (props: DrawerFooterProps) => {\n const { ref: forwardedRef, className, ...restProps } = props;\n const scrollbarRef = useScrollbars({ ref: forwardedRef });\n const ref = useInteractionOutline({ ref: scrollbarRef });\n return (<div\n {...restProps}\n ref={ref}\n className={cn(drawerFooterStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerHeader\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerHeaderStyles = cva(cn(\n \"gridui-drawer-header\",\n \"gridui-u-drawer--shrink-0 gridui-u-drawer--p-gridui-24\",\n \"gridui-u-drawer--flex gridui-u-drawer--items-center gridui-u-drawer--justify-between gridui-u-drawer--gap-gridui-16 gridui-u-drawer--pt-[max(var(--gridui-space-24),env(safe-area-inset-top))] gridui-u-drawer--border-b gridui-u-drawer--border-solid gridui-u-drawer--border-border\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerHeader\n * @description Drawer Header\n */\n\nimport { drawerHeaderStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerHeaderProps = ComponentPropsWithRef<\"div\">;\n\nexport const DrawerHeader: FC<DrawerHeaderProps> = (props: DrawerHeaderProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(drawerHeaderStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerPanel\n * @description Style\n */\n\nimport { overlayBackdropStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerOverlayStyles = cva(cn(\n overlayBackdropStyles({ pace: \"deliberate\" }),\n \"gridui-drawer-overlay\",\n \"gridui-u-drawer--fixed gridui-u-drawer--z-(--gridui-z-drawer-backdrop) gridui-u-drawer--inset-0 gridui-u-drawer--bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]\",\n \"gridui-u-drawer--data-[state='closed']:pointer-events-none\",\n));\n\nexport const drawerPanelStyles = cva(cn(\n \"gridui-drawer-panel\",\n \"gridui-u-drawer--fixed gridui-u-drawer--z-(--gridui-z-drawer) gridui-u-drawer--inset-y-0 gridui-u-drawer--flex gridui-u-drawer--w-[min(100%,var(--gridui-drawer-width,24rem))] gridui-u-drawer--max-w-full gridui-u-drawer--h-dvh gridui-u-drawer--min-h-0 gridui-u-drawer--flex-col gridui-u-drawer--box-border gridui-u-drawer--border gridui-u-drawer--border-solid gridui-u-drawer--border-border gridui-u-drawer--border-y-0 gridui-u-drawer--text-foreground gridui-u-drawer--bg-background gridui-u-drawer--type-supporting\",\n \"gridui-u-drawer--data-[side='end']:inset-e-0 gridui-u-drawer--data-[side='end']:[border-inline-end:0]\",\n \"gridui-u-drawer--data-[side='start']:inset-s-0 gridui-u-drawer--data-[side='start']:[border-inline-start:0]\",\n \"gridui-u-drawer--data-[side='left']:left-0 gridui-u-drawer--data-[side='left']:border-l-0\",\n \"gridui-u-drawer--data-[side='right']:right-0 gridui-u-drawer--data-[side='right']:border-r-0\",\n \"gridui-u-drawer--data-[state='closed']:pointer-events-none\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerPanel\n * @description Drawer Panel\n */\n\nimport type { DrawerPanelOptions } from \"../shared/drawer-panel-options\";\nimport { drawerOverlayStyles, drawerPanelStyles } from \"./style\";\nimport { interactionLayerProps, RetainedLayer } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { FC } from \"react\";\n\nexport type DrawerPanelProps = DrawerPanelOptions;\n\nexport const DrawerPanel: FC<DrawerPanelProps> = (props: DrawerPanelProps) => {\n const { side = \"end\", portal = true, className, forceMount, ...restProps } = props;\n const content = (<Dialog.Content\n {...interactionLayerProps}\n {...restProps}\n forceMount={forceMount}\n aria-describedby={restProps[\"aria-describedby\"]}\n data-side={side}\n className={cn(drawerPanelStyles(), className)}\n />);\n const mountedContent = forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content;\n if (!portal) {\n return (<>\n <Dialog.Overlay\n className={cn(drawerOverlayStyles())}\n />\n {mountedContent}\n </>);\n }\n return (<>\n <Dialog.Portal>\n <Dialog.Overlay\n className={cn(drawerOverlayStyles())}\n />\n </Dialog.Portal>\n <Dialog.Portal\n forceMount={forceMount}\n >\n {mountedContent}\n </Dialog.Portal>\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerSurface\n * @description Surface Binding\n */\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { type ComponentPropsWithRef, type FC, type Ref, type RefObject, useImperativeHandle, useLayoutEffect, useRef, useState } from \"react\";\n\nexport type SurfaceProps = ComponentPropsWithRef<typeof Slot>;\nexport type SurfaceHandle = {\n readonly element: HTMLElement | null;\n readonly bind: (props: SurfaceProps | null) => void;\n};\nexport type SurfaceViewProps = SurfaceProps & {\n readonly handle: Ref<SurfaceHandle>;\n};\n\nexport const SurfaceView: FC<SurfaceViewProps> = (props: SurfaceViewProps) => {\n const { handle, ...surfaceProps } = props;\n const element = useRef<HTMLElement>(null);\n const [\n modalProps,\n setModalProps,\n ] = useState<SurfaceProps | null>(null);\n useImperativeHandle(handle, () => {\n return {\n get element() { return element.current; },\n bind: setModalProps,\n };\n }, []);\n return (<Slot\n {...modalProps}\n ref={element}\n data-drawer-presentation={modalProps ? \"overlay\" : \"inline\"}\n >\n <Slot\n {...surfaceProps}\n />\n </Slot>);\n};\n\nexport type SurfaceBindingProps = SurfaceProps & {\n readonly handle: RefObject<SurfaceHandle | null>;\n};\n\n// Radix owns the temporary modal lifecycle. Slot merges its handlers and refs\n// onto the stable surface without moving or remounting the caller's content.\nexport const SurfaceBinding: FC<SurfaceBindingProps> = (props: SurfaceBindingProps) => {\n const { handle, ref, ...modalProps } = props;\n useLayoutEffect(() => {\n handle.current?.bind(modalProps);\n });\n useLayoutEffect(() => {\n const surface = handle.current;\n return () => {\n surface?.bind(null);\n };\n }, [handle]);\n useImperativeHandle(ref, () => {\n const element = handle.current?.element;\n if (!element) {\n throw new Error(\"DrawerSurface must mount before its modal lifecycle.\");\n }\n return element;\n }, [handle]);\n return null;\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerSurface\n * @description Drawer Surface\n */\n\nimport { DrawerPanel } from \"../drawer-panel/drawer-panel\";\nimport type { DrawerPanelOptions } from \"../shared/drawer-panel-options\";\nimport { SurfaceBinding, type SurfaceHandle, SurfaceView } from \"./surface-binding\";\nimport { OverlayOpen } from \"@gridui/overlay\";\nimport { type FC, useContext, useRef } from \"react\";\n\nexport type DrawerSurfaceProps = Omit<DrawerPanelOptions, \"portal\" | \"forceMount\">;\n\nexport const DrawerSurface: FC<DrawerSurfaceProps> = (props: DrawerSurfaceProps) => {\n const {\n asChild = false, side = \"end\", children,\n onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown,\n onPointerDownOutside, onFocusOutside, onInteractOutside,\n ...surfaceProps\n } = props;\n const open = useContext(OverlayOpen);\n const handle = useRef<SurfaceHandle>(null);\n return (<>\n <SurfaceView\n {...surfaceProps}\n handle={handle}\n >\n {asChild ? children : (<div>\n {children}\n </div>)}\n </SurfaceView>\n {open && (<DrawerPanel\n asChild\n portal={false}\n side={side}\n onOpenAutoFocus={onOpenAutoFocus}\n onCloseAutoFocus={onCloseAutoFocus}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={onFocusOutside}\n onInteractOutside={onInteractOutside}\n >\n <SurfaceBinding\n handle={handle}\n />\n </DrawerPanel>)}\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerTitle\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerTitleStyles = cva(cn(\n \"gridui-drawer-title\",\n \"gridui-u-drawer--m-0 gridui-u-drawer--type-subheading\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerTitle\n * @description Drawer Title\n */\n\nimport { drawerTitleStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerTitleProps = ComponentPropsWithRef<typeof Dialog.Title>;\n\nexport const DrawerTitle: FC<DrawerTitleProps> = (props: DrawerTitleProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Dialog.Title\n {...restProps}\n className={cn(drawerTitleStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerTrigger\n * @description Drawer Trigger\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerTriggerProps = ComponentPropsWithRef<typeof Dialog.Trigger>;\n\nexport const DrawerTrigger: FC<DrawerTriggerProps> = (props: DrawerTriggerProps) => {\n return (<Dialog.Trigger\n {...props}\n />);\n};\n"],
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Drawer\n * @namespace Drawer\n * @description Drawer\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerProps = ComponentPropsWithRef<typeof Dialog.Root>;\n\nexport const Drawer: FC<DrawerProps> = (props: DrawerProps) => {\n const state = useOverlayState(props);\n return (<OverlayOpen.Provider\n value={state.open}\n >\n <Dialog.Root\n {...props}\n {...state}\n />\n </OverlayOpen.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerBody\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerBodyStyles = cva(cn(\n \"gridui-drawer-body\",\n \"gridui-u-drawer--min-h-0 gridui-u-drawer--flex-1 gridui-u-drawer--overflow-y-auto gridui-u-drawer--overscroll-contain gridui-u-drawer--p-gridui-24\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerBody\n * @description Drawer Body\n */\n\nimport { drawerBodyStyles } from \"./style\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerBodyProps = ComponentPropsWithRef<\"div\">;\n\nexport const DrawerBody: FC<DrawerBodyProps> = (props: DrawerBodyProps) => {\n const { ref: forwardedRef, className, ...restProps } = props;\n const scrollbarRef = useScrollbars({ ref: forwardedRef });\n const ref = useInteractionOutline({ ref: scrollbarRef });\n return (<div\n {...restProps}\n ref={ref}\n className={cn(drawerBodyStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerClose\n * @description Drawer Close\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerCloseProps = ComponentPropsWithRef<typeof Dialog.Close>;\n\nexport const DrawerClose: FC<DrawerCloseProps> = (props: DrawerCloseProps) => {\n return (<Dialog.Close\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerCloseButton\n * @description Drawer Close Button\n */\n\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type DrawerCloseButtonProps = ButtonProps;\n\nexport const DrawerCloseButton: FC<DrawerCloseButtonProps> = (props: DrawerCloseButtonProps) => {\n const {\n children,\n size = \"small\",\n ...restProps\n } = props;\n const buttonProps: ButtonProps = (restProps.variant === \"text\" || restProps.variant === \"underlined\") ? {\n ...restProps,\n layout: \"standard\",\n } : {\n ...restProps,\n variant: restProps.variant === undefined ? \"quiet\" : restProps.variant,\n layout: restProps.layout === undefined ? \"icon\" : restProps.layout,\n };\n return (<Dialog.Close\n asChild\n >\n <Button\n {...buttonProps}\n size={size}\n >\n {children ?? (<X\n aria-hidden=\"true\"\n />)}\n </Button>\n </Dialog.Close>);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerDescription\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerDescriptionStyles = cva(cn(\n \"gridui-drawer-description\",\n \"gridui-u-drawer--text-muted\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerDescription\n * @description Drawer Description\n */\n\nimport { drawerDescriptionStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerDescriptionProps = ComponentPropsWithRef<typeof Dialog.Description>;\n\nexport const DrawerDescription: FC<DrawerDescriptionProps> = (props: DrawerDescriptionProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Dialog.Description\n {...restProps}\n className={cn(drawerDescriptionStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerFooter\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerFooterStyles = cva(cn(\n \"gridui-drawer-footer\",\n \"gridui-u-drawer--shrink-0\",\n \"gridui-u-drawer--max-h-[50dvh] gridui-u-drawer--overflow-y-auto gridui-u-drawer--pb-[env(safe-area-inset-bottom)] gridui-u-drawer--border-t gridui-u-drawer--border-solid gridui-u-drawer--border-border\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerFooter\n * @description Drawer Footer\n */\n\nimport { drawerFooterStyles } from \"./style\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerFooterProps = ComponentPropsWithRef<\"div\">;\n\nexport const DrawerFooter: FC<DrawerFooterProps> = (props: DrawerFooterProps) => {\n const { ref: forwardedRef, className, ...restProps } = props;\n const scrollbarRef = useScrollbars({ ref: forwardedRef });\n const ref = useInteractionOutline({ ref: scrollbarRef });\n return (<div\n {...restProps}\n ref={ref}\n className={cn(drawerFooterStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerHeader\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerHeaderStyles = cva(cn(\n \"gridui-drawer-header\",\n \"gridui-u-drawer--shrink-0 gridui-u-drawer--p-gridui-24\",\n \"gridui-u-drawer--flex gridui-u-drawer--items-center gridui-u-drawer--justify-between gridui-u-drawer--gap-gridui-16 gridui-u-drawer--pt-[max(var(--gridui-space-24),env(safe-area-inset-top))] gridui-u-drawer--border-b gridui-u-drawer--border-solid gridui-u-drawer--border-border\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerHeader\n * @description Drawer Header\n */\n\nimport { drawerHeaderStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerHeaderProps = ComponentPropsWithRef<\"div\">;\n\nexport const DrawerHeader: FC<DrawerHeaderProps> = (props: DrawerHeaderProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(drawerHeaderStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerPanel\n * @description Style\n */\n\nimport { overlayBackdropStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerOverlayStyles = cva(cn(\n overlayBackdropStyles({ pace: \"deliberate\" }),\n \"gridui-drawer-overlay\",\n \"gridui-u-drawer--fixed gridui-u-drawer--z-(--gridui-z-drawer-backdrop) gridui-u-drawer--inset-0 gridui-u-drawer--bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]\",\n \"gridui-u-drawer--data-[state='closed']:pointer-events-none\",\n));\n\nexport const drawerPanelStyles = cva(cn(\n \"gridui-drawer-panel\",\n \"gridui-u-drawer--fixed gridui-u-drawer--z-(--gridui-z-drawer) gridui-u-drawer--inset-y-0 gridui-u-drawer--flex gridui-u-drawer--w-[min(100%,var(--gridui-drawer-width,24rem))] gridui-u-drawer--max-w-full gridui-u-drawer--h-dvh gridui-u-drawer--min-h-0 gridui-u-drawer--flex-col gridui-u-drawer--box-border gridui-u-drawer--border gridui-u-drawer--border-solid gridui-u-drawer--border-border gridui-u-drawer--border-y-0 gridui-u-drawer--text-foreground gridui-u-drawer--bg-background gridui-u-drawer--type-supporting\",\n \"gridui-u-drawer--data-[side='end']:inset-e-0 gridui-u-drawer--data-[side='end']:[border-inline-end:0]\",\n \"gridui-u-drawer--data-[side='start']:inset-s-0 gridui-u-drawer--data-[side='start']:[border-inline-start:0]\",\n \"gridui-u-drawer--data-[side='left']:left-0 gridui-u-drawer--data-[side='left']:border-l-0\",\n \"gridui-u-drawer--data-[side='right']:right-0 gridui-u-drawer--data-[side='right']:border-r-0\",\n \"gridui-u-drawer--data-[state='closed']:pointer-events-none\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerPanel\n * @description Drawer Panel\n */\n\nimport type { DrawerPanelOptions } from \"../shared/drawer-panel-options\";\nimport { drawerOverlayStyles, drawerPanelStyles } from \"./style\";\nimport { interactionLayerProps, RetainedLayer } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { FC } from \"react\";\n\nexport type DrawerPanelProps = DrawerPanelOptions;\n\nexport const DrawerPanel: FC<DrawerPanelProps> = (props: DrawerPanelProps) => {\n const { side = \"end\", portal = true, className, forceMount, ...restProps } = props;\n const content = (<Dialog.Content\n {...interactionLayerProps}\n {...restProps}\n forceMount={forceMount}\n aria-describedby={restProps[\"aria-describedby\"]}\n data-side={side}\n className={cn(drawerPanelStyles(), className)}\n />);\n const mountedContent = forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content;\n if (!portal) {\n return (<>\n <Dialog.Overlay\n className={cn(drawerOverlayStyles())}\n />\n {mountedContent}\n </>);\n }\n return (<>\n <Dialog.Portal>\n <Dialog.Overlay\n className={cn(drawerOverlayStyles())}\n />\n </Dialog.Portal>\n <Dialog.Portal\n forceMount={forceMount}\n >\n {mountedContent}\n </Dialog.Portal>\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerSurface\n * @description Surface Binding\n */\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { type ComponentPropsWithRef, type FC, type Ref, type RefObject, useImperativeHandle, useLayoutEffect, useRef, useState } from \"react\";\n\nexport type SurfaceProps = ComponentPropsWithRef<typeof Slot>;\nexport type SurfaceHandle = {\n readonly element: HTMLElement | null;\n readonly bind: (props: SurfaceProps | null) => void;\n};\nexport type SurfaceViewProps = SurfaceProps & {\n readonly handle: Ref<SurfaceHandle>;\n};\n\nexport const SurfaceView: FC<SurfaceViewProps> = (props: SurfaceViewProps) => {\n const { handle, ...surfaceProps } = props;\n const element = useRef<HTMLElement>(null);\n const [\n modalProps,\n setModalProps,\n ] = useState<SurfaceProps | null>(null);\n useImperativeHandle(handle, () => {\n return {\n get element() { return element.current; },\n bind: setModalProps,\n };\n }, []);\n return (<Slot\n {...modalProps}\n ref={element}\n data-drawer-presentation={modalProps ? \"overlay\" : \"inline\"}\n >\n <Slot\n {...surfaceProps}\n />\n </Slot>);\n};\n\nexport type SurfaceBindingProps = SurfaceProps & {\n readonly handle: RefObject<SurfaceHandle | null>;\n};\n\n// Radix owns the temporary modal lifecycle. Slot merges its handlers and refs\n// onto the stable surface without moving or remounting the caller's content.\nexport const SurfaceBinding: FC<SurfaceBindingProps> = (props: SurfaceBindingProps) => {\n const { handle, ref, ...modalProps } = props;\n useLayoutEffect(() => {\n handle.current?.bind(modalProps);\n });\n useLayoutEffect(() => {\n const surface = handle.current;\n return () => {\n surface?.bind(null);\n };\n }, [handle]);\n useImperativeHandle(ref, () => {\n const element = handle.current?.element;\n if (!element) {\n throw new Error(\"DrawerSurface must mount before its modal lifecycle.\");\n }\n return element;\n }, [handle]);\n return null;\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerSurface\n * @description Drawer Surface\n */\n\nimport { DrawerPanel } from \"../drawer-panel/drawer-panel\";\nimport type { DrawerPanelOptions } from \"../shared/drawer-panel-options\";\nimport { SurfaceBinding, type SurfaceHandle, SurfaceView } from \"./surface-binding\";\nimport { OverlayOpen } from \"@gridui/overlay\";\nimport { type FC, useContext, useRef } from \"react\";\n\nexport type DrawerSurfaceProps = Omit<DrawerPanelOptions, \"portal\" | \"forceMount\">;\n\nexport const DrawerSurface: FC<DrawerSurfaceProps> = (props: DrawerSurfaceProps) => {\n const {\n asChild = false, side = \"end\", children,\n onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown,\n onPointerDownOutside, onFocusOutside, onInteractOutside,\n ...surfaceProps\n } = props;\n const open = useContext(OverlayOpen);\n const handle = useRef<SurfaceHandle>(null);\n return (<>\n <SurfaceView\n {...surfaceProps}\n handle={handle}\n >\n {asChild ? children : (<div>\n {children}\n </div>)}\n </SurfaceView>\n {open && (<DrawerPanel\n asChild\n portal={false}\n side={side}\n onOpenAutoFocus={onOpenAutoFocus}\n onCloseAutoFocus={onCloseAutoFocus}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={onFocusOutside}\n onInteractOutside={onInteractOutside}\n >\n <SurfaceBinding\n handle={handle}\n />\n </DrawerPanel>)}\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerTitle\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerTitleStyles = cva(cn(\n \"gridui-drawer-title\",\n \"gridui-u-drawer--m-0 gridui-u-drawer--type-subheading\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerTitle\n * @description Drawer Title\n */\n\nimport { drawerTitleStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerTitleProps = ComponentPropsWithRef<typeof Dialog.Title>;\n\nexport const DrawerTitle: FC<DrawerTitleProps> = (props: DrawerTitleProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Dialog.Title\n {...restProps}\n className={cn(drawerTitleStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerTrigger\n * @description Drawer Trigger\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerTriggerProps = ComponentPropsWithRef<typeof Dialog.Trigger>;\n\nexport const DrawerTrigger: FC<DrawerTriggerProps> = (props: DrawerTriggerProps) => {\n return (<Dialog.Trigger\n {...props}\n />);\n};\n"],
5
5
  "mappings": ";AAOA,SAAS,aAAa,uBAAuB;AAC7C,YAAY,YAAY;AAUhB;AALD,IAAM,SAA0B,CAAC,UAAuB;AAC3D,QAAM,QAAQ,gBAAgB,KAAK;AACnC,SAAQ;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACL,OAAO,MAAM;AAAA,MAEb;AAAA,QAAQ;AAAA,QAAP;AAAA,UACI,GAAG;AAAA,UACH,GAAG;AAAA;AAAA,MACR;AAAA;AAAA,EACJ;AACJ;;;AChBA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,mBAAmB,IAAI;AAAA,EAChC;AAAA,EACA;AACJ,CAAC;;;ACLD,SAAS,uBAAuB,qBAAqB;AACrD,SAAS,MAAAA,WAAU;AASP,gBAAAC,YAAA;AAJL,IAAM,aAAkC,CAAC,UAA2B;AACvE,QAAM,EAAE,KAAK,cAAc,WAAW,GAAG,UAAU,IAAI;AACvD,QAAM,eAAe,cAAc,EA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dialog", "jsx", "cn", "cva", "useInteractionOutline", "useScrollbars", "cn", "jsx", "cn", "cva", "cn", "jsx", "cn", "cva", "cn", "Dialog", "jsx", "jsx", "OverlayOpen", "useRef", "Fragment", "jsx", "jsxs", "cn", "cva", "cn", "Dialog", "jsx", "Dialog", "jsx"]
7
7
  }
package/dist/styles.css CHANGED
@@ -100,8 +100,8 @@
100
100
  .gridui-u-drawer--pt-\[max\(var\(--gridui-space-24\)\,env\(safe-area-inset-top\)\)\] {
101
101
  padding-top: max(var(--gridui-space-24), env(safe-area-inset-top));
102
102
  }
103
- .gridui-u-drawer--pb-\[max\(var\(--gridui-space-24\)\,env\(safe-area-inset-bottom\)\)\] {
104
- padding-bottom: max(var(--gridui-space-24), env(safe-area-inset-bottom));
103
+ .gridui-u-drawer--pb-\[env\(safe-area-inset-bottom\)\] {
104
+ padding-bottom: env(safe-area-inset-bottom);
105
105
  }
106
106
  .gridui-u-drawer--type-subheading {
107
107
  font: var(--gridui-type-subheading);
package/docs/catalog.json CHANGED
@@ -1,12 +1,24 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/drawer",
4
- "version": "1.1.7",
4
+ "version": "2.0.0",
5
5
  "category": "core",
6
6
  "description": "GridUI React drawer",
7
7
  "usage": "`DrawerPanel` portals its backdrop and surface to the document by default. Set `portal={false}` to keep an ordinary modal panel in its owner's DOM scope. `side=\"start\" | \"end\"` follows writing direction; `\"left\" | \"right\"` fixes the physical placement and entry direction, including in RTL.",
8
8
  "documentation": [
9
- "README.md"
9
+ "README.md",
10
+ "docs/reference/README.md",
11
+ "docs/reference/drawer-body.md",
12
+ "docs/reference/drawer-close-button.md",
13
+ "docs/reference/drawer-close.md",
14
+ "docs/reference/drawer-description.md",
15
+ "docs/reference/drawer-footer.md",
16
+ "docs/reference/drawer-header.md",
17
+ "docs/reference/drawer-panel.md",
18
+ "docs/reference/drawer-surface.md",
19
+ "docs/reference/drawer-title.md",
20
+ "docs/reference/drawer-trigger.md",
21
+ "docs/reference/drawer.md"
10
22
  ],
11
23
  "exports": [
12
24
  {
@@ -127,6 +139,9 @@
127
139
  "@gridui/drawer/styles.css"
128
140
  ],
129
141
  "examples": [
142
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/getting-started.mdx",
143
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/inline-modal.mdx",
144
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/side-panels.mdx",
130
145
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx"
131
146
  ]
132
147
  }
@@ -0,0 +1,14 @@
1
+ <!-- Generated by pnpm docs:storybook. -->
2
+ # Component reference
3
+
4
+ - [Drawer](drawer.md)
5
+ - [DrawerBody](drawer-body.md)
6
+ - [DrawerClose](drawer-close.md)
7
+ - [DrawerCloseButton](drawer-close-button.md)
8
+ - [DrawerDescription](drawer-description.md)
9
+ - [DrawerFooter](drawer-footer.md)
10
+ - [DrawerHeader](drawer-header.md)
11
+ - [DrawerPanel](drawer-panel.md)
12
+ - [DrawerSurface](drawer-surface.md)
13
+ - [DrawerTitle](drawer-title.md)
14
+ - [DrawerTrigger](drawer-trigger.md)
@@ -0,0 +1,57 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerBody
3
+
4
+ Compose DrawerBody with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerBody } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
@@ -0,0 +1,101 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerCloseButton
3
+
4
+ Compose DrawerCloseButton with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerCloseButton } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLButtonElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### size
59
+
60
+ ``"small" | "standard" | "large" | "extra-large" | null | undefined`` · Optional
61
+
62
+ Default: ``"small"``
63
+
64
+ Component size preset.
65
+
66
+ ### iconMotion
67
+
68
+ ``"none" | "outward" | null | undefined`` · Optional
69
+
70
+ ### variant
71
+
72
+ ``"text" | "primary" | "secondary" | "quiet" | "highlight" | "underlined" | null | undefined`` · Optional
73
+
74
+ Visual variant.
75
+
76
+ ### layout
77
+
78
+ ``"cell" | "standard" | "icon" | "entry" | "rail" | "divided" | null | undefined`` · Optional
79
+
80
+ Layout within the containing region.
81
+
82
+ ### startIcon
83
+
84
+ ``ReactNode`` · Optional
85
+
86
+ ### startIconLayout
87
+
88
+ ``"divided" | "inline" | undefined`` · Optional
89
+
90
+ ### startIconSize
91
+
92
+ ``"standard" | "large" | "extra-large" | undefined`` · Optional
93
+
94
+ ### endIcon
95
+
96
+ ``ReactNode`` · Optional
97
+
98
+ ### loading
99
+
100
+ ``boolean | undefined`` · Optional
101
+
@@ -0,0 +1,61 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerClose
3
+
4
+ Compose DrawerClose with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerClose } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLButtonElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### asChild
59
+
60
+ ``boolean | undefined`` · Optional
61
+
@@ -0,0 +1,61 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerDescription
3
+
4
+ Compose DrawerDescription with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerDescription } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLParagraphElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLParagraphElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLParagraphElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLParagraphElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLParagraphElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### asChild
59
+
60
+ ``boolean | undefined`` · Optional
61
+
@@ -0,0 +1,57 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerFooter
3
+
4
+ Compose DrawerFooter with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerFooter } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
@@ -0,0 +1,57 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerHeader
3
+
4
+ Compose DrawerHeader with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerHeader } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
@@ -0,0 +1,131 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerPanel
3
+
4
+ Compose DrawerPanel with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerPanel } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### forceMount
23
+
24
+ ``true | undefined`` · Optional
25
+
26
+ Used to force mounting when more control is needed. Useful when
27
+ controlling animation with React animation libraries.
28
+
29
+ ### children
30
+
31
+ ``ReactNode`` · Optional
32
+
33
+ Content rendered inside the component.
34
+
35
+ ### onFocus
36
+
37
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
38
+
39
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
40
+
41
+ ### onBlur
42
+
43
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
44
+
45
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
46
+
47
+ ### onChange
48
+
49
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
50
+
51
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
52
+
53
+ ### onSubmit
54
+
55
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
56
+
57
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
58
+
59
+ ### onClick
60
+
61
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
62
+
63
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
64
+
65
+ ### asChild
66
+
67
+ ``boolean | undefined`` · Optional
68
+
69
+ ### deferPointerDownOutside
70
+
71
+ ``boolean | undefined`` · Optional
72
+
73
+ When `true`, a `'pointerdown'` event outside of the layered element will
74
+ wait for the interaction's click event before dispatching, allowing
75
+ third-party code to stop propagation of later events and cancel dismissal.
76
+
77
+ ### onEscapeKeyDown
78
+
79
+ ``(event: KeyboardEvent): void`` · Optional
80
+
81
+ Event handler called when the escape key is down.
82
+ Can be prevented.
83
+
84
+ ### onPointerDownOutside
85
+
86
+ ``(event: CustomEvent<{ originalEvent: PointerEvent; }>): void`` · Optional
87
+
88
+ Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.
89
+ Can be prevented.
90
+
91
+ ### onFocusOutside
92
+
93
+ ``(event: CustomEvent<{ originalEvent: FocusEvent; }>): void`` · Optional
94
+
95
+ Event handler called when the focus moves outside of the `DismissableLayer`.
96
+ Can be prevented.
97
+
98
+ ### onInteractOutside
99
+
100
+ ``(event: CustomEvent<{ originalEvent: PointerEvent; }> | CustomEvent<{ originalEvent: FocusEvent; }>): void`` · Optional
101
+
102
+ Event handler called when an interaction happens outside the `DismissableLayer`.
103
+ Specifically, when a `pointerdown` event happens outside or focus moves outside of it.
104
+ Can be prevented.
105
+
106
+ ### onOpenAutoFocus
107
+
108
+ ``(event: Event): void`` · Optional
109
+
110
+ Event handler called when auto-focusing on open.
111
+ Can be prevented.
112
+
113
+ ### onCloseAutoFocus
114
+
115
+ ``(event: Event): void`` · Optional
116
+
117
+ Event handler called when auto-focusing on close.
118
+ Can be prevented.
119
+
120
+ ### side
121
+
122
+ ``"right" | "left" | "end" | "start" | undefined`` · Optional
123
+
124
+ Default: ``"end"``
125
+
126
+ ### portal
127
+
128
+ ``boolean | undefined`` · Optional
129
+
130
+ Default: ``true``
131
+
@@ -0,0 +1,120 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerSurface
3
+
4
+ Compose DrawerSurface with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerSurface } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### asChild
59
+
60
+ ``boolean | undefined`` · Optional
61
+
62
+ Default: ``false``
63
+
64
+ ### deferPointerDownOutside
65
+
66
+ ``boolean | undefined`` · Optional
67
+
68
+ When `true`, a `'pointerdown'` event outside of the layered element will
69
+ wait for the interaction's click event before dispatching, allowing
70
+ third-party code to stop propagation of later events and cancel dismissal.
71
+
72
+ ### onEscapeKeyDown
73
+
74
+ ``(event: KeyboardEvent): void`` · Optional
75
+
76
+ Event handler called when the escape key is down.
77
+ Can be prevented.
78
+
79
+ ### onPointerDownOutside
80
+
81
+ ``(event: CustomEvent<{ originalEvent: PointerEvent; }>): void`` · Optional
82
+
83
+ Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.
84
+ Can be prevented.
85
+
86
+ ### onFocusOutside
87
+
88
+ ``(event: CustomEvent<{ originalEvent: FocusEvent; }>): void`` · Optional
89
+
90
+ Event handler called when the focus moves outside of the `DismissableLayer`.
91
+ Can be prevented.
92
+
93
+ ### onInteractOutside
94
+
95
+ ``(event: CustomEvent<{ originalEvent: PointerEvent; }> | CustomEvent<{ originalEvent: FocusEvent; }>): void`` · Optional
96
+
97
+ Event handler called when an interaction happens outside the `DismissableLayer`.
98
+ Specifically, when a `pointerdown` event happens outside or focus moves outside of it.
99
+ Can be prevented.
100
+
101
+ ### onOpenAutoFocus
102
+
103
+ ``(event: Event): void`` · Optional
104
+
105
+ Event handler called when auto-focusing on open.
106
+ Can be prevented.
107
+
108
+ ### onCloseAutoFocus
109
+
110
+ ``(event: Event): void`` · Optional
111
+
112
+ Event handler called when auto-focusing on close.
113
+ Can be prevented.
114
+
115
+ ### side
116
+
117
+ ``"right" | "left" | "end" | "start" | undefined`` · Optional
118
+
119
+ Default: ``"end"``
120
+
@@ -0,0 +1,61 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerTitle
3
+
4
+ Compose DrawerTitle with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerTitle } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLHeadingElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLHeadingElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLHeadingElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLHeadingElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLHeadingElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### asChild
59
+
60
+ ``boolean | undefined`` · Optional
61
+
@@ -0,0 +1,61 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # DrawerTrigger
3
+
4
+ Compose DrawerTrigger with Drawer inside the same @gridui/drawer component family.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { DrawerTrigger } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLButtonElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### asChild
59
+
60
+ ``boolean | undefined`` · Optional
61
+
@@ -0,0 +1,49 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # Drawer
3
+
4
+ Presents a modal panel from the start or end edge of the viewport. Use it for navigation or focused tasks that benefit from a side panel.
5
+
6
+ Import from ``@gridui/drawer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { Drawer } from "@gridui/drawer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/drawer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/drawer/stories/drawer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### open
29
+
30
+ ``boolean | undefined`` · Optional
31
+
32
+ Controlled visibility. Pair with onOpenChange.
33
+
34
+ ### defaultOpen
35
+
36
+ ``boolean | undefined`` · Optional
37
+
38
+ Initial uncontrolled visibility. Reset the story after changing it.
39
+
40
+ ### onOpenChange
41
+
42
+ ``(open: boolean): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### modal
47
+
48
+ ``boolean | undefined`` · Optional
49
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/drawer",
3
- "version": "1.1.7",
3
+ "version": "2.0.0",
4
4
  "description": "GridUI React drawer",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -27,10 +27,10 @@
27
27
  "react-dom": "^19.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "@gridui/button": "^4.0.0",
31
- "@gridui/overlay": "^2.0.0",
32
- "@gridui/style-utils": "^3.0.0",
33
- "@gridui/theme": "^2.5.3",
30
+ "@gridui/button": "^5.0.0",
31
+ "@gridui/overlay": "^2.1.0",
32
+ "@gridui/style-utils": "^4.0.0",
33
+ "@gridui/theme": "^2.5.4",
34
34
  "@radix-ui/react-dialog": "1.3.1",
35
35
  "@radix-ui/react-slot": "1.5.0",
36
36
  "class-variance-authority": "0.7.1",