@gridui/drawer 2.1.0 → 3.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 +29 -6
- package/dist/drawer-panel/drawer-panel.d.ts +6 -0
- package/dist/drawer-surface/drawer-surface.d.ts +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +2 -2
- package/dist/shared/drawer-panel-options.d.ts +3 -0
- package/dist/styled.js +4 -0
- package/dist/styles.css +584 -3
- package/dist/styles.local.css +202 -0
- package/docs/catalog.json +7 -6
- package/docs/reference/drawer-body.md +2 -2
- package/docs/reference/drawer-close-button.md +8 -10
- package/docs/reference/drawer-close.md +2 -2
- package/docs/reference/drawer-description.md +2 -2
- package/docs/reference/drawer-footer.md +2 -2
- package/docs/reference/drawer-header.md +2 -2
- package/docs/reference/drawer-panel.md +10 -2
- package/docs/reference/drawer-surface.md +6 -2
- package/docs/reference/drawer-title.md +2 -2
- package/docs/reference/drawer-trigger.md +2 -2
- package/docs/reference/drawer.md +2 -2
- package/package.json +14 -9
package/README.md
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
# @gridui/drawer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Overlays family. Public API: `Drawer`, `DrawerBody`, `DrawerBodyProps`, `DrawerClose`, `DrawerCloseProps`, `DrawerCloseButton`, `DrawerCloseButtonProps`, `DrawerDescription`, `DrawerDescriptionProps`, `DrawerFooter`, `DrawerFooterProps`, `DrawerHeader`, `DrawerHeaderProps`, `DrawerPanel`, `DrawerPanelProps`, `DrawerProps`, `DrawerSurface`, `DrawerSurfaceProps`, `DrawerTitle`, `DrawerTitleProps`, `DrawerTrigger`, `DrawerTriggerProps`.
|
|
4
4
|
|
|
5
5
|
Import components from `@gridui/drawer` and load `@gridui/drawer/styles.css` after Theme.
|
|
6
|
-
|
|
6
|
+
Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
|
-
See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-
|
|
8
|
+
See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-overlays/drawer/.changeset/history).
|
|
9
9
|
|
|
10
10
|
`DrawerPanel` portals its backdrop and surface to the document by default.
|
|
11
11
|
Set `portal={false}` to keep an ordinary modal panel in its owner's DOM scope.
|
|
12
12
|
`side="start" | "end"` follows writing direction; `"left" | "right"` fixes the
|
|
13
13
|
physical placement and entry direction, including in RTL.
|
|
14
14
|
|
|
15
|
+
## Styles
|
|
16
|
+
|
|
17
|
+
Load Theme once. Use `@gridui/drawer/styled` for automatic component CSS in
|
|
18
|
+
CSS-aware bundlers, or keep the CSS-free root import and load `@gridui/drawer/styles.css`.
|
|
19
|
+
Both entries expose the same root API. The standalone stylesheet includes component
|
|
20
|
+
dependency styles; Theme/reset remain separate. See the
|
|
21
|
+
[integration guide](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/integration.md)
|
|
22
|
+
for static HTML loading, SSR limits, and avoiding duplicate CSS.
|
|
23
|
+
|
|
24
|
+
|
|
15
25
|
## Stable inline surfaces
|
|
16
26
|
|
|
17
27
|
Use `DrawerSurface` inside `Drawer` when the same content must stay mounted
|
|
@@ -45,7 +55,7 @@ surface; Sidebar does not implement that mechanism. The owner must keep this
|
|
|
45
55
|
inline surface outside transformed or clipping ancestors and provide an adequate
|
|
46
56
|
stacking context. Use a normal portalled `DrawerPanel` for independent overlays.
|
|
47
57
|
|
|
48
|
-
Surface motion uses `@gridui/overlay`;
|
|
58
|
+
Surface motion uses `@gridui/overlay`; its styles are included.
|
|
49
59
|
|
|
50
60
|
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
51
61
|
|
|
@@ -54,7 +64,7 @@ Surface motion uses `@gridui/overlay`; load `@gridui/overlay/styles.css` after T
|
|
|
54
64
|
DrawerFooter owns the body separator, scrolling limit, and bottom safe-area inset.
|
|
55
65
|
It has no general content padding. Use ButtonGroup from `@gridui/button` with
|
|
56
66
|
`layout="cells"` for edge-aligned footer actions; ordinary footer content supplies
|
|
57
|
-
its own padding.
|
|
67
|
+
its own padding. Button styles are included in the Drawer stylesheet.
|
|
58
68
|
|
|
59
69
|
```tsx
|
|
60
70
|
<DrawerFooter>
|
|
@@ -66,5 +76,18 @@ its own padding. Load Button styles before Drawer styles.
|
|
|
66
76
|
|
|
67
77
|
Shared animation policy and tempo come from `MotionConfig` in `@gridui/motion`.
|
|
68
78
|
Disabled or reduced-motion policy settles decoration without disabling interaction.
|
|
69
|
-
See the [motion guide](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-
|
|
79
|
+
See the [motion guide](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-foundation/motion)
|
|
70
80
|
for CSS scopes, portal behavior, and specialized timing contracts.
|
|
81
|
+
|
|
82
|
+
## Local color scopes
|
|
83
|
+
|
|
84
|
+
Pass `container` to the portaled panel/content to mount it in a local
|
|
85
|
+
`data-gridui-color-variant` region. Dialog panels use that host for their backdrop too.
|
|
86
|
+
The default remains `document.body`; React ancestry does not determine CSS inheritance.
|
|
87
|
+
|
|
88
|
+
## Sizing and density
|
|
89
|
+
|
|
90
|
+
DrawerPanel and DrawerSurface accept CSS width with viewport constraints. DrawerCloseButton uses the normal medium Button default and supports explicit Button sizes. Body/footer spacing and supplied action groups remain independent.
|
|
91
|
+
|
|
92
|
+
See the [shared sizing contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/sizing.md)
|
|
93
|
+
for native attributes, scope precedence, tokens and target behavior.
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { DrawerPanelOptions } from "../shared/drawer-panel-options";
|
|
8
8
|
import { type FC } from "react";
|
|
9
|
-
export type DrawerSurfaceProps = Omit<DrawerPanelOptions, "portal" | "forceMount">;
|
|
9
|
+
export type DrawerSurfaceProps = Omit<DrawerPanelOptions, "portal" | "forceMount" | "container">;
|
|
10
10
|
export declare const DrawerSurface: FC<DrawerSurfaceProps>;
|
package/dist/index.js
CHANGED
|
@@ -65,7 +65,6 @@ import { jsx as jsx4 } from "react/jsx-runtime";
|
|
|
65
65
|
var DrawerCloseButton = (props) => {
|
|
66
66
|
const {
|
|
67
67
|
children,
|
|
68
|
-
size = "small",
|
|
69
68
|
...restProps
|
|
70
69
|
} = props;
|
|
71
70
|
const buttonProps = restProps.variant === "text" || restProps.variant === "underlined" ? {
|
|
@@ -84,7 +83,6 @@ var DrawerCloseButton = (props) => {
|
|
|
84
83
|
Button,
|
|
85
84
|
{
|
|
86
85
|
...buttonProps,
|
|
87
|
-
size,
|
|
88
86
|
children: children ?? /* @__PURE__ */ jsx4(
|
|
89
87
|
X,
|
|
90
88
|
{
|
|
@@ -183,7 +181,7 @@ import { cva as cva5 } from "class-variance-authority";
|
|
|
183
181
|
var drawerOverlayStyles = cva5(cn9(
|
|
184
182
|
overlayBackdropStyles({ pace: "deliberate" }),
|
|
185
183
|
"gridui-drawer-overlay",
|
|
186
|
-
"gridui-u-drawer--fixed gridui-u-drawer--z-(--gridui-z-drawer-backdrop) gridui-u-drawer--inset-0
|
|
184
|
+
"gridui-u-drawer--fixed gridui-u-drawer--z-(--gridui-z-drawer-backdrop) gridui-u-drawer--inset-0",
|
|
187
185
|
"gridui-u-drawer--data-[state='closed']:pointer-events-none"
|
|
188
186
|
));
|
|
189
187
|
var drawerPanelStyles = cva5(cn9(
|
|
@@ -203,7 +201,7 @@ import * as Dialog5 from "@radix-ui/react-dialog";
|
|
|
203
201
|
import { Fragment, jsx as jsx8, jsxs } from "react/jsx-runtime";
|
|
204
202
|
var DrawerPanel = (props) => {
|
|
205
203
|
const motionStyle = useMotionStyle();
|
|
206
|
-
const { side = "end", portal = true, className, forceMount, ...restProps } = props;
|
|
204
|
+
const { side = "end", portal = true, container, width, className, forceMount, ...restProps } = props;
|
|
207
205
|
const content = /* @__PURE__ */ jsx8(
|
|
208
206
|
Dialog5.Content,
|
|
209
207
|
{
|
|
@@ -213,7 +211,7 @@ var DrawerPanel = (props) => {
|
|
|
213
211
|
"aria-describedby": restProps["aria-describedby"],
|
|
214
212
|
"data-side": side,
|
|
215
213
|
className: cn10(drawerPanelStyles(), className),
|
|
216
|
-
style: { ...restProps.style, ...motionStyle }
|
|
214
|
+
style: { width, ...restProps.style, ...motionStyle }
|
|
217
215
|
}
|
|
218
216
|
);
|
|
219
217
|
const mountedContent = forceMount ? /* @__PURE__ */ jsx8(RetainedLayer, { children: content }) : content;
|
|
@@ -230,7 +228,7 @@ var DrawerPanel = (props) => {
|
|
|
230
228
|
] });
|
|
231
229
|
}
|
|
232
230
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
233
|
-
/* @__PURE__ */ jsx8(Dialog5.Portal, { children: /* @__PURE__ */ jsx8(
|
|
231
|
+
/* @__PURE__ */ jsx8(Dialog5.Portal, { container, children: /* @__PURE__ */ jsx8(
|
|
234
232
|
Dialog5.Overlay,
|
|
235
233
|
{
|
|
236
234
|
className: cn10(drawerOverlayStyles()),
|
|
@@ -240,6 +238,7 @@ var DrawerPanel = (props) => {
|
|
|
240
238
|
/* @__PURE__ */ jsx8(
|
|
241
239
|
Dialog5.Portal,
|
|
242
240
|
{
|
|
241
|
+
container,
|
|
243
242
|
forceMount,
|
|
244
243
|
children: mountedContent
|
|
245
244
|
}
|
|
@@ -311,6 +310,8 @@ var DrawerSurface = (props) => {
|
|
|
311
310
|
asChild = false,
|
|
312
311
|
side = "end",
|
|
313
312
|
children,
|
|
313
|
+
width,
|
|
314
|
+
style,
|
|
314
315
|
onOpenAutoFocus,
|
|
315
316
|
onCloseAutoFocus,
|
|
316
317
|
onEscapeKeyDown,
|
|
@@ -327,6 +328,7 @@ var DrawerSurface = (props) => {
|
|
|
327
328
|
{
|
|
328
329
|
...surfaceProps,
|
|
329
330
|
handle,
|
|
331
|
+
style: { width, ...style },
|
|
330
332
|
children: asChild ? children : /* @__PURE__ */ jsx10("div", { children })
|
|
331
333
|
}
|
|
332
334
|
),
|
|
@@ -336,6 +338,7 @@ var DrawerSurface = (props) => {
|
|
|
336
338
|
asChild: true,
|
|
337
339
|
portal: false,
|
|
338
340
|
side,
|
|
341
|
+
width,
|
|
339
342
|
onOpenAutoFocus,
|
|
340
343
|
onCloseAutoFocus,
|
|
341
344
|
onEscapeKeyDown,
|
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/drawer-panel.tsx", "../src/drawer-panel/style.ts", "../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\",\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", "import { useMotionStyle } from \"@gridui/motion/policy\";\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 motionStyle = useMotionStyle();\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 style={{ ...(restProps.style), ...motionStyle }}\n />);\n const mountedContent = forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content;\n if (!portal) {\n return (<>\n <Dialog.Overlay\n className={cn(drawerOverlayStyles())}\n style={motionStyle}\n />\n {mountedContent}\n </>);\n }\n return (<>\n <Dialog.Portal>\n <Dialog.Overlay\n className={cn(drawerOverlayStyles())}\n style={motionStyle}\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 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 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
|
-
"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,EAAE,KAAK,aAAa,CAAC;AACxD,QAAM,MAAM,sBAAsB,EAAE,KAAK,aAAa,CAAC;AACvD,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ;AAAA,MACA,WAAWD,IAAG,iBAAiB,GAAG,SAAS;AAAA;AAAA,EAC/C;AACJ;;;AChBA,YAAYE,aAAY;AAMZ,gBAAAC,YAAA;AADL,IAAM,cAAoC,CAAC,UAA4B;AAC1E,SAAQ,gBAAAA;AAAA,IAAQ;AAAA,IAAP;AAAA,MACJ,GAAG;AAAA;AAAA,EACR;AACJ;;;ACTA,SAAS,cAAgC;AACzC,YAAYC,aAAY;AACxB,SAAS,SAAS;
|
|
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 ...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 >\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 Drawer Panel\n */\n\nimport { useMotionStyle } from \"@gridui/motion/policy\";\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 motionStyle = useMotionStyle();\n const { side = \"end\", portal = true, container, width, 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 style={{ width, ...(restProps.style), ...motionStyle }}\n />);\n const mountedContent = forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content;\n if (!portal) {\n return (<>\n <Dialog.Overlay\n className={cn(drawerOverlayStyles())}\n style={motionStyle}\n />\n {mountedContent}\n </>);\n }\n return (<>\n <Dialog.Portal container={container}>\n <Dialog.Overlay\n className={cn(drawerOverlayStyles())}\n style={motionStyle}\n />\n </Dialog.Portal>\n <Dialog.Portal\n container={container}\n forceMount={forceMount}\n >\n {mountedContent}\n </Dialog.Portal>\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\",\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 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\" | \"container\">;\n\nexport const DrawerSurface: FC<DrawerSurfaceProps> = (props: DrawerSurfaceProps) => {\n const {\n asChild = false, side = \"end\", children, width, style,\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 style={{ width, ...style }}\n >\n {asChild ? children : (<div>\n {children}\n </div>)}\n </SurfaceView>\n {open && (<DrawerPanel\n asChild\n portal={false}\n side={side}\n width={width}\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
|
+
"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,M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AC5CA,SAAS,MAAAE,YAAU;AACnB,SAAS,OAAAC,YAAW;AAEb,IAAM,oBAAoBA,KAAID;AAAA,EACjC;AAAA,EACA;AACJ,CAAC;;;ACLD,SAAS,MAAAE,YAAU;AACnB,YAAYC,aAAY;AAUZ,gBAAAC,aAAA;AALL,IAAM,cAAoC,CAAC,UAA4B;AAC1E,QAAM;AAAA,IACF;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,SAAQ,gBAAAA;AAAA,IAAQ;AAAA,IAAP;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWF,KAAG,kBAAkB,GAAG,SAAS;AAAA;AAAA,EAChD;AACJ;;;AChBA,YAAYG,aAAY;AAMZ,gBAAAC,aAAA;AADL,IAAM,gBAAwC,CAAC,UAA8B;AAChF,SAAQ,gBAAAA;AAAA,IAAQ;AAAA,IAAP;AAAA,MACJ,GAAG;AAAA;AAAA,EACR;AACJ;",
|
|
6
6
|
"names": ["cn", "jsx", "Dialog", "jsx", "Dialog", "jsx", "cn", "cva", "cn", "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
|
}
|
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
* @namespace Shared
|
|
5
5
|
* @description Drawer Panel Options
|
|
6
6
|
*/
|
|
7
|
+
import type { CSSProperties } from "react";
|
|
7
8
|
import type * as Dialog from "@radix-ui/react-dialog";
|
|
8
9
|
import type { ComponentPropsWithRef } from "react";
|
|
9
10
|
export type DrawerPanelOptions = ComponentPropsWithRef<typeof Dialog.Content> & {
|
|
11
|
+
readonly width?: CSSProperties["width"];
|
|
10
12
|
readonly side?: "start" | "end" | "left" | "right";
|
|
11
13
|
readonly portal?: boolean;
|
|
14
|
+
readonly container?: ComponentPropsWithRef<typeof Dialog.Portal>["container"];
|
|
12
15
|
};
|
package/dist/styled.js
ADDED