@gridui/drawer 1.0.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,48 @@
1
1
  # @gridui/drawer
2
2
 
3
- Core family. Public API: `Drawer`, `DrawerBody`, `DrawerBodyProps`, `DrawerClose`, `DrawerCloseButton`, `DrawerCloseButtonProps`, `DrawerDescription`, `DrawerDescriptionProps`, `DrawerFooter`, `DrawerFooterProps`, `DrawerHeader`, `DrawerHeaderProps`, `DrawerPanel`, `DrawerPanelProps`, `DrawerProps`, `DrawerTitle`, `DrawerTitleProps`, `DrawerTrigger`.
3
+ Core 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
  Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
7
7
 
8
- See [component ownership](../../docs/component-ownership.md) and [release history](.changeset/history/).
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-core/drawer/.changeset/history).
9
+
10
+ `DrawerPanel` portals its backdrop and surface to the document by default.
11
+ Set `portal={false}` to keep an ordinary modal panel in its owner's DOM scope.
12
+ `side="start" | "end"` follows writing direction; `"left" | "right"` fixes the
13
+ physical placement and entry direction, including in RTL.
14
+
15
+ ## Stable inline surfaces
16
+
17
+ Use `DrawerSurface` inside `Drawer` when the same content must stay mounted
18
+ while changing from inline content to a modal drawer. Closed content stays
19
+ visible inline; its owner may hide its containing region when appropriate.
20
+ Opening adds the panel presentation, backdrop, Radix focus trap and dismissal
21
+ lifecycle to the same DOM element. Closing removes that presentation without
22
+ remounting children, restarting their effects, or taking scroll snapshots.
23
+ Use `data-drawer-presentation="inline" | "overlay"` for presentation styles.
24
+
25
+ `DrawerSurface` accepts `DrawerPanel` props except `portal` and `forceMount`.
26
+ `asChild` preserves an owned semantic surface; native handlers, styles and refs
27
+ compose through Radix Slot. Supply `DrawerTitle`, or an accessible name with
28
+ `aria-label` and `aria-labelledby={undefined}`. Focus-restoration policy can be
29
+ customized through `onCloseAutoFocus`, as on `DrawerPanel`.
30
+
31
+ ```tsx
32
+ <Drawer open={open} onOpenChange={setOpen}>
33
+ <DrawerTrigger>Open navigation</DrawerTrigger>
34
+ <DrawerSurface side="left">
35
+ <DrawerTitle>Workspace</DrawerTitle>
36
+ <input aria-label="Navigation draft" defaultValue="Keep this draft" />
37
+ <DrawerClose>Close navigation</DrawerClose>
38
+ </DrawerSurface>
39
+ </Drawer>
40
+ ```
41
+
42
+ Radix changes its content implementation when modal presentation changes.
43
+ Drawer's private binding attaches the temporary modal lifecycle to the retained
44
+ surface; Sidebar does not implement that mechanism. The owner must keep this
45
+ inline surface outside transformed or clipping ancestors and provide an adequate
46
+ stacking context. Use a normal portalled `DrawerPanel` for independent overlays.
47
+
48
+ Surface motion uses `@gridui/overlay`; load `@gridui/overlay/styles.css` after Theme and before this family.
@@ -5,4 +5,6 @@
5
5
  * @description Drawer Close
6
6
  */
7
7
  import * as Dialog from "@radix-ui/react-dialog";
8
- export declare const DrawerClose: import("react").ForwardRefExoticComponent<Dialog.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
8
+ import type { ComponentPropsWithRef, FC } from "react";
9
+ export type DrawerCloseProps = ComponentPropsWithRef<typeof Dialog.Close>;
10
+ export declare const DrawerClose: FC<DrawerCloseProps>;
@@ -7,6 +7,7 @@
7
7
  import * as Dialog from "@radix-ui/react-dialog";
8
8
  import type { ComponentPropsWithRef, FC } from "react";
9
9
  export type DrawerPanelProps = ComponentPropsWithRef<typeof Dialog.Content> & {
10
- readonly side?: "start" | "end";
10
+ readonly side?: "start" | "end" | "left" | "right";
11
+ readonly portal?: boolean;
11
12
  };
12
13
  export declare const DrawerPanel: FC<DrawerPanelProps>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Drawer
4
+ * @namespace DrawerSurface
5
+ * @description Drawer Surface
6
+ */
7
+ import { type DrawerPanelProps } from "../drawer-panel/drawer-panel";
8
+ import { type FC } from "react";
9
+ export type DrawerSurfaceProps = Omit<DrawerPanelProps, "portal" | "forceMount">;
10
+ export declare const DrawerSurface: FC<DrawerSurfaceProps>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Drawer
4
+ * @namespace DrawerSurface
5
+ * @description Surface Binding
6
+ */
7
+ import { Slot } from "@radix-ui/react-slot";
8
+ import { type ComponentPropsWithRef, type FC, type Ref, type RefObject } from "react";
9
+ export type SurfaceProps = ComponentPropsWithRef<typeof Slot>;
10
+ export type SurfaceHandle = {
11
+ readonly element: HTMLElement | null;
12
+ readonly bind: (props: SurfaceProps | null) => void;
13
+ };
14
+ export type SurfaceViewProps = SurfaceProps & {
15
+ readonly handle: Ref<SurfaceHandle>;
16
+ };
17
+ export declare const SurfaceView: FC<SurfaceViewProps>;
18
+ export type SurfaceBindingProps = SurfaceProps & {
19
+ readonly handle: RefObject<SurfaceHandle | null>;
20
+ };
21
+ export declare const SurfaceBinding: FC<SurfaceBindingProps>;
@@ -5,4 +5,6 @@
5
5
  * @description Drawer Trigger
6
6
  */
7
7
  import * as Dialog from "@radix-ui/react-dialog";
8
- export declare const DrawerTrigger: import("react").ForwardRefExoticComponent<Dialog.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
8
+ import type { ComponentPropsWithRef, FC } from "react";
9
+ export type DrawerTriggerProps = ComponentPropsWithRef<typeof Dialog.Trigger>;
10
+ export declare const DrawerTrigger: FC<DrawerTriggerProps>;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export type { DrawerProps } from "./drawer/drawer";
8
8
  export { Drawer } from "./drawer/drawer";
9
9
  export type { DrawerBodyProps } from "./drawer-body/drawer-body";
10
10
  export { DrawerBody } from "./drawer-body/drawer-body";
11
+ export type { DrawerCloseProps } from "./drawer-close/drawer-close";
11
12
  export { DrawerClose } from "./drawer-close/drawer-close";
12
13
  export type { DrawerCloseButtonProps } from "./drawer-close-button/drawer-close-button";
13
14
  export { DrawerCloseButton } from "./drawer-close-button/drawer-close-button";
@@ -19,6 +20,9 @@ export type { DrawerHeaderProps } from "./drawer-header/drawer-header";
19
20
  export { DrawerHeader } from "./drawer-header/drawer-header";
20
21
  export type { DrawerPanelProps } from "./drawer-panel/drawer-panel";
21
22
  export { DrawerPanel } from "./drawer-panel/drawer-panel";
23
+ export type { DrawerSurfaceProps } from "./drawer-surface/drawer-surface";
24
+ export { DrawerSurface } from "./drawer-surface/drawer-surface";
22
25
  export type { DrawerTitleProps } from "./drawer-title/drawer-title";
23
26
  export { DrawerTitle } from "./drawer-title/drawer-title";
27
+ export type { DrawerTriggerProps } from "./drawer-trigger/drawer-trigger";
24
28
  export { DrawerTrigger } from "./drawer-trigger/drawer-trigger";
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import { cn } from "@gridui/style-utils";
24
24
  import { cva } from "class-variance-authority";
25
25
  var drawerBodyStyles = cva(cn(
26
26
  "gridui-drawer-body",
27
- "min-h-0 flex-1 overflow-y-auto overscroll-contain p-gridui-24"
27
+ "gridui-u-min-h-0 gridui-u-flex-1 gridui-u-overflow-y-auto gridui-u-overscroll-contain gridui-u-p-gridui-24"
28
28
  ));
29
29
 
30
30
  // src/drawer-body/drawer-body.tsx
@@ -43,13 +43,21 @@ var DrawerBody = (props) => {
43
43
 
44
44
  // src/drawer-close/drawer-close.tsx
45
45
  import * as Dialog2 from "@radix-ui/react-dialog";
46
- var DrawerClose = Dialog2.Close;
46
+ import { jsx as jsx3 } from "react/jsx-runtime";
47
+ var DrawerClose = (props) => {
48
+ return /* @__PURE__ */ jsx3(
49
+ Dialog2.Close,
50
+ {
51
+ ...props
52
+ }
53
+ );
54
+ };
47
55
 
48
56
  // src/drawer-close-button/drawer-close-button.tsx
49
57
  import { Button } from "@gridui/button";
50
58
  import * as Dialog3 from "@radix-ui/react-dialog";
51
59
  import { X } from "lucide-react";
52
- import { jsx as jsx3 } from "react/jsx-runtime";
60
+ import { jsx as jsx4 } from "react/jsx-runtime";
53
61
  var DrawerCloseButton = (props) => {
54
62
  const {
55
63
  children,
@@ -64,16 +72,16 @@ var DrawerCloseButton = (props) => {
64
72
  variant: restProps.variant === void 0 ? "quiet" : restProps.variant,
65
73
  layout: restProps.layout === void 0 ? "icon" : restProps.layout
66
74
  };
67
- return /* @__PURE__ */ jsx3(
75
+ return /* @__PURE__ */ jsx4(
68
76
  Dialog3.Close,
69
77
  {
70
78
  asChild: true,
71
- children: /* @__PURE__ */ jsx3(
79
+ children: /* @__PURE__ */ jsx4(
72
80
  Button,
73
81
  {
74
82
  ...buttonProps,
75
83
  size,
76
- children: children ?? /* @__PURE__ */ jsx3(
84
+ children: children ?? /* @__PURE__ */ jsx4(
77
85
  X,
78
86
  {
79
87
  "aria-hidden": "true"
@@ -90,19 +98,19 @@ import { cn as cn3 } from "@gridui/style-utils";
90
98
  import { cva as cva2 } from "class-variance-authority";
91
99
  var drawerDescriptionStyles = cva2(cn3(
92
100
  "gridui-drawer-description",
93
- "text-muted"
101
+ "gridui-u-text-muted"
94
102
  ));
95
103
 
96
104
  // src/drawer-description/drawer-description.tsx
97
105
  import { cn as cn4 } from "@gridui/style-utils";
98
106
  import * as Dialog4 from "@radix-ui/react-dialog";
99
- import { jsx as jsx4 } from "react/jsx-runtime";
107
+ import { jsx as jsx5 } from "react/jsx-runtime";
100
108
  var DrawerDescription = (props) => {
101
109
  const {
102
110
  className,
103
111
  ...restProps
104
112
  } = props;
105
- return /* @__PURE__ */ jsx4(
113
+ return /* @__PURE__ */ jsx5(
106
114
  Dialog4.Description,
107
115
  {
108
116
  ...restProps,
@@ -116,16 +124,16 @@ import { cn as cn5 } from "@gridui/style-utils";
116
124
  import { cva as cva3 } from "class-variance-authority";
117
125
  var drawerFooterStyles = cva3(cn5(
118
126
  "gridui-drawer-footer",
119
- "shrink-0 p-gridui-24",
120
- "max-h-[50dvh] overflow-y-auto pb-[max(var(--gridui-space-24),env(safe-area-inset-bottom))] border-t border-solid border-border"
127
+ "gridui-u-shrink-0 gridui-u-p-gridui-24",
128
+ "gridui-u-max-h-[50dvh] gridui-u-overflow-y-auto gridui-u-pb-[max(var(--gridui-space-24),env(safe-area-inset-bottom))] gridui-u-border-t gridui-u-border-solid gridui-u-border-border"
121
129
  ));
122
130
 
123
131
  // src/drawer-footer/drawer-footer.tsx
124
132
  import { cn as cn6 } from "@gridui/style-utils";
125
- import { jsx as jsx5 } from "react/jsx-runtime";
133
+ import { jsx as jsx6 } from "react/jsx-runtime";
126
134
  var DrawerFooter = (props) => {
127
135
  const { className, ...restProps } = props;
128
- return /* @__PURE__ */ jsx5(
136
+ return /* @__PURE__ */ jsx6(
129
137
  "div",
130
138
  {
131
139
  ...restProps,
@@ -139,16 +147,16 @@ import { cn as cn7 } from "@gridui/style-utils";
139
147
  import { cva as cva4 } from "class-variance-authority";
140
148
  var drawerHeaderStyles = cva4(cn7(
141
149
  "gridui-drawer-header",
142
- "shrink-0 p-gridui-24",
143
- "flex items-center justify-between gap-gridui-16 pt-[max(var(--gridui-space-24),env(safe-area-inset-top))] border-b border-solid border-border"
150
+ "gridui-u-shrink-0 gridui-u-p-gridui-24",
151
+ "gridui-u-flex gridui-u-items-center gridui-u-justify-between gridui-u-gap-gridui-16 gridui-u-pt-[max(var(--gridui-space-24),env(safe-area-inset-top))] gridui-u-border-b gridui-u-border-solid gridui-u-border-border"
144
152
  ));
145
153
 
146
154
  // src/drawer-header/drawer-header.tsx
147
155
  import { cn as cn8 } from "@gridui/style-utils";
148
- import { jsx as jsx6 } from "react/jsx-runtime";
156
+ import { jsx as jsx7 } from "react/jsx-runtime";
149
157
  var DrawerHeader = (props) => {
150
158
  const { className, ...restProps } = props;
151
- return /* @__PURE__ */ jsx6(
159
+ return /* @__PURE__ */ jsx7(
152
160
  "div",
153
161
  {
154
162
  ...restProps,
@@ -158,29 +166,33 @@ var DrawerHeader = (props) => {
158
166
  };
159
167
 
160
168
  // src/drawer-panel/style.ts
169
+ import { overlayBackdropStyles } from "@gridui/overlay";
161
170
  import { cn as cn9 } from "@gridui/style-utils";
162
171
  import { cva as cva5 } from "class-variance-authority";
163
172
  var drawerOverlayStyles = cva5(cn9(
173
+ overlayBackdropStyles({ pace: "deliberate" }),
164
174
  "gridui-drawer-overlay",
165
- "fixed z-(--gridui-z-drawer-backdrop) inset-0 bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]",
166
- "data-[state='closed']:pointer-events-none"
175
+ "gridui-u-fixed gridui-u-z-(--gridui-z-drawer-backdrop) gridui-u-inset-0 gridui-u-bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]",
176
+ "gridui-u-data-[state='closed']:pointer-events-none"
167
177
  ));
168
178
  var drawerPanelStyles = cva5(cn9(
169
179
  "gridui-drawer-panel",
170
- "fixed z-(--gridui-z-drawer) inset-y-0 flex w-[min(100%,var(--gridui-drawer-width,24rem))] max-w-full h-dvh min-h-0 flex-col box-border border border-solid border-border border-y-0 text-foreground bg-background type-supporting",
171
- "data-[side='end']:inset-e-0 data-[side='end']:[border-inline-end:0]",
172
- "data-[side='start']:inset-s-0 data-[side='start']:[border-inline-start:0]",
173
- "data-[state='closed']:pointer-events-none"
180
+ "gridui-u-fixed gridui-u-z-(--gridui-z-drawer) gridui-u-inset-y-0 gridui-u-flex gridui-u-w-[min(100%,var(--gridui-drawer-width,24rem))] gridui-u-max-w-full gridui-u-h-dvh gridui-u-min-h-0 gridui-u-flex-col gridui-u-box-border gridui-u-border gridui-u-border-solid gridui-u-border-border gridui-u-border-y-0 gridui-u-text-foreground gridui-u-bg-background gridui-u-type-supporting",
181
+ "gridui-u-data-[side='end']:inset-e-0 gridui-u-data-[side='end']:[border-inline-end:0]",
182
+ "gridui-u-data-[side='start']:inset-s-0 gridui-u-data-[side='start']:[border-inline-start:0]",
183
+ "gridui-u-data-[side='left']:left-0 gridui-u-data-[side='left']:border-l-0",
184
+ "gridui-u-data-[side='right']:right-0 gridui-u-data-[side='right']:border-r-0",
185
+ "gridui-u-data-[state='closed']:pointer-events-none"
174
186
  ));
175
187
 
176
188
  // src/drawer-panel/drawer-panel.tsx
177
189
  import { RetainedLayer } from "@gridui/overlay";
178
190
  import { cn as cn10 } from "@gridui/style-utils";
179
191
  import * as Dialog5 from "@radix-ui/react-dialog";
180
- import { Fragment, jsx as jsx7, jsxs } from "react/jsx-runtime";
192
+ import { Fragment, jsx as jsx8, jsxs } from "react/jsx-runtime";
181
193
  var DrawerPanel = (props) => {
182
- const { side = "end", className, forceMount, ...restProps } = props;
183
- const content = /* @__PURE__ */ jsx7(
194
+ const { side = "end", portal = true, className, forceMount, ...restProps } = props;
195
+ const content = /* @__PURE__ */ jsx8(
184
196
  Dialog5.Content,
185
197
  {
186
198
  ...restProps,
@@ -190,18 +202,136 @@ var DrawerPanel = (props) => {
190
202
  className: cn10(drawerPanelStyles(), className)
191
203
  }
192
204
  );
205
+ const mountedContent = forceMount ? /* @__PURE__ */ jsx8(RetainedLayer, { children: content }) : content;
206
+ if (!portal) {
207
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
208
+ /* @__PURE__ */ jsx8(
209
+ Dialog5.Overlay,
210
+ {
211
+ className: cn10(drawerOverlayStyles())
212
+ }
213
+ ),
214
+ mountedContent
215
+ ] });
216
+ }
193
217
  return /* @__PURE__ */ jsxs(Fragment, { children: [
194
- /* @__PURE__ */ jsx7(Dialog5.Portal, { children: /* @__PURE__ */ jsx7(
218
+ /* @__PURE__ */ jsx8(Dialog5.Portal, { children: /* @__PURE__ */ jsx8(
195
219
  Dialog5.Overlay,
196
220
  {
197
221
  className: cn10(drawerOverlayStyles())
198
222
  }
199
223
  ) }),
200
- /* @__PURE__ */ jsx7(
224
+ /* @__PURE__ */ jsx8(
201
225
  Dialog5.Portal,
202
226
  {
203
227
  forceMount,
204
- children: forceMount ? /* @__PURE__ */ jsx7(RetainedLayer, { children: content }) : content
228
+ children: mountedContent
229
+ }
230
+ )
231
+ ] });
232
+ };
233
+
234
+ // src/drawer-surface/surface-binding.tsx
235
+ import { Slot } from "@radix-ui/react-slot";
236
+ import { useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
237
+ import { jsx as jsx9 } from "react/jsx-runtime";
238
+ var SurfaceView = (props) => {
239
+ const { handle, ...surfaceProps } = props;
240
+ const element = useRef(null);
241
+ const [
242
+ modalProps,
243
+ setModalProps
244
+ ] = useState(null);
245
+ useImperativeHandle(handle, () => {
246
+ return {
247
+ get element() {
248
+ return element.current;
249
+ },
250
+ bind: setModalProps
251
+ };
252
+ }, []);
253
+ return /* @__PURE__ */ jsx9(
254
+ Slot,
255
+ {
256
+ ...modalProps,
257
+ ref: element,
258
+ "data-drawer-presentation": modalProps ? "overlay" : "inline",
259
+ children: /* @__PURE__ */ jsx9(
260
+ Slot,
261
+ {
262
+ ...surfaceProps
263
+ }
264
+ )
265
+ }
266
+ );
267
+ };
268
+ var SurfaceBinding = (props) => {
269
+ const { handle, ref, ...modalProps } = props;
270
+ useLayoutEffect(() => {
271
+ handle.current?.bind(modalProps);
272
+ });
273
+ useLayoutEffect(() => {
274
+ const surface = handle.current;
275
+ return () => {
276
+ surface?.bind(null);
277
+ };
278
+ }, [handle]);
279
+ useImperativeHandle(ref, () => {
280
+ const element = handle.current?.element;
281
+ if (!element) {
282
+ throw new Error("DrawerSurface must mount before its modal lifecycle.");
283
+ }
284
+ return element;
285
+ }, [handle]);
286
+ return null;
287
+ };
288
+
289
+ // src/drawer-surface/drawer-surface.tsx
290
+ import { OverlayOpen as OverlayOpen2 } from "@gridui/overlay";
291
+ import { useContext, useRef as useRef2 } from "react";
292
+ import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
293
+ var DrawerSurface = (props) => {
294
+ const {
295
+ asChild = false,
296
+ side = "end",
297
+ children,
298
+ onOpenAutoFocus,
299
+ onCloseAutoFocus,
300
+ onEscapeKeyDown,
301
+ onPointerDownOutside,
302
+ onFocusOutside,
303
+ onInteractOutside,
304
+ ...surfaceProps
305
+ } = props;
306
+ const open = useContext(OverlayOpen2);
307
+ const handle = useRef2(null);
308
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
309
+ /* @__PURE__ */ jsx10(
310
+ SurfaceView,
311
+ {
312
+ ...surfaceProps,
313
+ handle,
314
+ children: asChild ? children : /* @__PURE__ */ jsx10("div", { children })
315
+ }
316
+ ),
317
+ open && /* @__PURE__ */ jsx10(
318
+ DrawerPanel,
319
+ {
320
+ asChild: true,
321
+ portal: false,
322
+ side,
323
+ onOpenAutoFocus,
324
+ onCloseAutoFocus,
325
+ onEscapeKeyDown,
326
+ onPointerDownOutside,
327
+ onFocusOutside,
328
+ onInteractOutside,
329
+ children: /* @__PURE__ */ jsx10(
330
+ SurfaceBinding,
331
+ {
332
+ handle
333
+ }
334
+ )
205
335
  }
206
336
  )
207
337
  ] });
@@ -212,19 +342,19 @@ import { cn as cn11 } from "@gridui/style-utils";
212
342
  import { cva as cva6 } from "class-variance-authority";
213
343
  var drawerTitleStyles = cva6(cn11(
214
344
  "gridui-drawer-title",
215
- "m-0 type-subheading"
345
+ "gridui-u-m-0 gridui-u-type-subheading"
216
346
  ));
217
347
 
218
348
  // src/drawer-title/drawer-title.tsx
219
349
  import { cn as cn12 } from "@gridui/style-utils";
220
350
  import * as Dialog6 from "@radix-ui/react-dialog";
221
- import { jsx as jsx8 } from "react/jsx-runtime";
351
+ import { jsx as jsx11 } from "react/jsx-runtime";
222
352
  var DrawerTitle = (props) => {
223
353
  const {
224
354
  className,
225
355
  ...restProps
226
356
  } = props;
227
- return /* @__PURE__ */ jsx8(
357
+ return /* @__PURE__ */ jsx11(
228
358
  Dialog6.Title,
229
359
  {
230
360
  ...restProps,
@@ -235,7 +365,15 @@ var DrawerTitle = (props) => {
235
365
 
236
366
  // src/drawer-trigger/drawer-trigger.tsx
237
367
  import * as Dialog7 from "@radix-ui/react-dialog";
238
- var DrawerTrigger = Dialog7.Trigger;
368
+ import { jsx as jsx12 } from "react/jsx-runtime";
369
+ var DrawerTrigger = (props) => {
370
+ return /* @__PURE__ */ jsx12(
371
+ Dialog7.Trigger,
372
+ {
373
+ ...props
374
+ }
375
+ );
376
+ };
239
377
  export {
240
378
  Drawer,
241
379
  DrawerBody,
@@ -245,6 +383,7 @@ export {
245
383
  DrawerFooter,
246
384
  DrawerHeader,
247
385
  DrawerPanel,
386
+ DrawerSurface,
248
387
  DrawerTitle,
249
388
  DrawerTrigger
250
389
  };
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 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-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 \"min-h-0 flex-1 overflow-y-auto overscroll-contain 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 { 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 { className, ...restProps } = props;\n return (<div\n {...restProps}\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\";\n\nexport const DrawerClose = Dialog.Close;\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 \"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 \"shrink-0 p-gridui-24\",\n \"max-h-[50dvh] overflow-y-auto pb-[max(var(--gridui-space-24),env(safe-area-inset-bottom))] border-t border-solid border-border\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerFooter\n * @description Drawer Footer\n */\n\nimport { drawerFooterStyles } from \"./style\";\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 { className, ...restProps } = props;\n return (<div\n {...restProps}\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 \"shrink-0 p-gridui-24\",\n \"flex items-center justify-between gap-gridui-16 pt-[max(var(--gridui-space-24),env(safe-area-inset-top))] border-b border-solid 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 { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const drawerOverlayStyles = cva(cn(\n \"gridui-drawer-overlay\",\n \"fixed z-(--gridui-z-drawer-backdrop) inset-0 bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]\",\n \"data-[state='closed']:pointer-events-none\",\n));\n\nexport const drawerPanelStyles = cva(cn(\n \"gridui-drawer-panel\",\n \"fixed z-(--gridui-z-drawer) inset-y-0 flex w-[min(100%,var(--gridui-drawer-width,24rem))] max-w-full h-dvh min-h-0 flex-col box-border border border-solid border-border border-y-0 text-foreground bg-background type-supporting\",\n \"data-[side='end']:inset-e-0 data-[side='end']:[border-inline-end:0]\",\n \"data-[side='start']:inset-s-0 data-[side='start']:[border-inline-start:0]\",\n \"data-[state='closed']:pointer-events-none\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerPanel\n * @description Drawer Panel\n */\n\nimport { drawerOverlayStyles, drawerPanelStyles } from \"./style\";\nimport { RetainedLayer } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerPanelProps = ComponentPropsWithRef<typeof Dialog.Content> & {\n readonly side?: \"start\" | \"end\";\n};\n\nexport const DrawerPanel: FC<DrawerPanelProps> = (props: DrawerPanelProps) => {\n const { side = \"end\", className, forceMount, ...restProps } = props;\n const content = (<Dialog.Content\n {...restProps}\n forceMount={forceMount}\n aria-describedby={restProps[\"aria-describedby\"]}\n data-side={side}\n className={cn(drawerPanelStyles(), className)}\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 {forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content}\n </Dialog.Portal>\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 \"m-0 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\";\n\nexport const DrawerTrigger = Dialog.Trigger;\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,MAAAA,WAAU;AAOP,gBAAAC,YAAA;AAFL,IAAM,aAAkC,CAAC,UAA2B;AACvE,QAAM,EAAE,WAAW,GAAG,UAAU,IAAI;AACpC,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWD,IAAG,iBAAiB,GAAG,SAAS;AAAA;AAAA,EAC/C;AACJ;;;ACZA,YAAYE,aAAY;AAEjB,IAAM,cAAqB;;;ACFlC,SAAS,cAAgC;AACzC,YAAYC,aAAY;AACxB,SAAS,SAAS;AA0BQ,gBAAAC,YAAA;AArBnB,IAAM,oBAAgD,CAAC,UAAkC;AAC5F,QAAM;AAAA,IACF;AAAA,IACA,OAAO;AAAA,IACP,GAAG;AAAA,EACP,IAAI;AACJ,QAAM,cAA4B,UAAU,YAAY,UAAU,UAAU,YAAY,eAAgB;AAAA,IACpG,GAAG;AAAA,IACH,QAAQ;AAAA,EACZ,IAAI;AAAA,IACA,GAAG;AAAA,IACH,SAAS,UAAU,YAAY,SAAY,UAAU,UA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oBA,KAAID;AAAA,EACjC;AAAA,EACA;AACJ,CAAC;;;ACLD,SAAS,MAAAE,YAAU;AACnB,YAAYC,aAAY;AAUZ,gBAAAC,YAAA;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;AAEjB,IAAM,gBAAuB;",
6
- "names": ["cn", "jsx", "Dialog", "Dialog", "jsx", "cn", "cva", "cn", "Dialog", "jsx", "cn", "cva", "cn", "jsx", "cn", "cva", "cn", "jsx", "cn", "cva", "cn", "Dialog", "jsx", "cn", "cva", "cn", "Dialog", "jsx", "Dialog"]
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-min-h-0 gridui-u-flex-1 gridui-u-overflow-y-auto gridui-u-overscroll-contain gridui-u-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 { 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 { className, ...restProps } = props;\n return (<div\n {...restProps}\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-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-shrink-0 gridui-u-p-gridui-24\",\n \"gridui-u-max-h-[50dvh] gridui-u-overflow-y-auto gridui-u-pb-[max(var(--gridui-space-24),env(safe-area-inset-bottom))] gridui-u-border-t gridui-u-border-solid gridui-u-border-border\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerFooter\n * @description Drawer Footer\n */\n\nimport { drawerFooterStyles } from \"./style\";\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 { className, ...restProps } = props;\n return (<div\n {...restProps}\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-shrink-0 gridui-u-p-gridui-24\",\n \"gridui-u-flex gridui-u-items-center gridui-u-justify-between gridui-u-gap-gridui-16 gridui-u-pt-[max(var(--gridui-space-24),env(safe-area-inset-top))] gridui-u-border-b gridui-u-border-solid gridui-u-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-fixed gridui-u-z-(--gridui-z-drawer-backdrop) gridui-u-inset-0 gridui-u-bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]\",\n \"gridui-u-data-[state='closed']:pointer-events-none\",\n));\n\nexport const drawerPanelStyles = cva(cn(\n \"gridui-drawer-panel\",\n \"gridui-u-fixed gridui-u-z-(--gridui-z-drawer) gridui-u-inset-y-0 gridui-u-flex gridui-u-w-[min(100%,var(--gridui-drawer-width,24rem))] gridui-u-max-w-full gridui-u-h-dvh gridui-u-min-h-0 gridui-u-flex-col gridui-u-box-border gridui-u-border gridui-u-border-solid gridui-u-border-border gridui-u-border-y-0 gridui-u-text-foreground gridui-u-bg-background gridui-u-type-supporting\",\n \"gridui-u-data-[side='end']:inset-e-0 gridui-u-data-[side='end']:[border-inline-end:0]\",\n \"gridui-u-data-[side='start']:inset-s-0 gridui-u-data-[side='start']:[border-inline-start:0]\",\n \"gridui-u-data-[side='left']:left-0 gridui-u-data-[side='left']:border-l-0\",\n \"gridui-u-data-[side='right']:right-0 gridui-u-data-[side='right']:border-r-0\",\n \"gridui-u-data-[state='closed']:pointer-events-none\",\n));\n", "/**\n * @author WMXPY\n * @package Drawer\n * @namespace DrawerPanel\n * @description Drawer Panel\n */\n\nimport { drawerOverlayStyles, drawerPanelStyles } from \"./style\";\nimport { RetainedLayer } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DrawerPanelProps = ComponentPropsWithRef<typeof Dialog.Content> & {\n readonly side?: \"start\" | \"end\" | \"left\" | \"right\";\n readonly portal?: boolean;\n};\n\nexport const DrawerPanel: FC<DrawerPanelProps> = (props: DrawerPanelProps) => {\n const { side = \"end\", portal = true, className, forceMount, ...restProps } = props;\n const content = (<Dialog.Content\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, type DrawerPanelProps } from \"../drawer-panel/drawer-panel\";\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<DrawerPanelProps, \"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-m-0 gridui-u-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,MAAAA,WAAU;AAOP,gBAAAC,YAAA;AAFL,IAAM,aAAkC,CAAC,UAA2B;AACvE,QAAM,EAAE,WAAW,GAAG,UAAU,IAAI;AACpC,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWD,IAAG,iBAAiB,GAAG,SAAS;AAAA;AAAA,EAC/C;AACJ;;;ACZA,YAAYE,aAAY;AAM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ACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEA,0BAAAA;AAAA,UAAC;AAAA;AAAA,YACG;AAAA;AAAA,QACJ;AAAA;AAAA,IACJ;AAAA,KACJ;AACJ;;;ACzCA,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
+ "names": ["cn", "jsx", "Dialog", "jsx", "Dialog", "jsx", "cn", "cva", "cn", "Dialog", "jsx", "cn", "cva", "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
@@ -2,135 +2,149 @@
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
4
  @layer utilities {
5
- .fixed {
5
+ .gridui-u-fixed {
6
6
  position: fixed;
7
7
  }
8
- .inset-0 {
8
+ .gridui-u-inset-0 {
9
9
  inset: 0px;
10
10
  }
11
- .inset-y-0 {
11
+ .gridui-u-inset-y-0 {
12
12
  inset-block: 0px;
13
13
  }
14
- .z-\(--gridui-z-drawer\) {
14
+ .gridui-u-z-\(--gridui-z-drawer\) {
15
15
  z-index: var(--gridui-z-drawer);
16
16
  }
17
- .z-\(--gridui-z-drawer-backdrop\) {
17
+ .gridui-u-z-\(--gridui-z-drawer-backdrop\) {
18
18
  z-index: var(--gridui-z-drawer-backdrop);
19
19
  }
20
- .m-0 {
20
+ .gridui-u-m-0 {
21
21
  margin: 0px;
22
22
  }
23
- .box-border {
23
+ .gridui-u-box-border {
24
24
  box-sizing: border-box;
25
25
  }
26
- .flex {
26
+ .gridui-u-flex {
27
27
  display: flex;
28
28
  }
29
- .h-dvh {
29
+ .gridui-u-h-dvh {
30
30
  height: 100dvh;
31
31
  }
32
- .max-h-\[50dvh\] {
32
+ .gridui-u-max-h-\[50dvh\] {
33
33
  max-height: 50dvh;
34
34
  }
35
- .min-h-0 {
35
+ .gridui-u-min-h-0 {
36
36
  min-height: 0px;
37
37
  }
38
- .w-\[min\(100\%\,var\(--gridui-drawer-width\,24rem\)\)\] {
38
+ .gridui-u-w-\[min\(100\%\,var\(--gridui-drawer-width\,24rem\)\)\] {
39
39
  width: min(100%, var(--gridui-drawer-width,24rem));
40
40
  }
41
- .max-w-full {
41
+ .gridui-u-max-w-full {
42
42
  max-width: 100%;
43
43
  }
44
- .flex-1 {
44
+ .gridui-u-flex-1 {
45
45
  flex: 1;
46
46
  }
47
- .shrink-0 {
47
+ .gridui-u-shrink-0 {
48
48
  flex-shrink: 0;
49
49
  }
50
- .flex-col {
50
+ .gridui-u-flex-col {
51
51
  flex-direction: column;
52
52
  }
53
- .items-center {
53
+ .gridui-u-items-center {
54
54
  align-items: center;
55
55
  }
56
- .justify-between {
56
+ .gridui-u-justify-between {
57
57
  justify-content: space-between;
58
58
  }
59
- .gap-gridui-16 {
59
+ .gridui-u-gap-gridui-16 {
60
60
  gap: var(--gridui-space-16);
61
61
  }
62
- .overflow-y-auto {
62
+ .gridui-u-overflow-y-auto {
63
63
  overflow-y: auto;
64
64
  }
65
- .overscroll-contain {
65
+ .gridui-u-overscroll-contain {
66
66
  overscroll-behavior: contain;
67
67
  }
68
- .border {
68
+ .gridui-u-border {
69
69
  border-style: var(--tw-border-style);
70
70
  border-width: 1px;
71
71
  }
72
- .border-y-0 {
72
+ .gridui-u-border-y-0 {
73
73
  border-block-style: var(--tw-border-style);
74
74
  border-block-width: 0px;
75
75
  }
76
- .border-t {
76
+ .gridui-u-border-t {
77
77
  border-top-style: var(--tw-border-style);
78
78
  border-top-width: 1px;
79
79
  }
80
- .border-b {
80
+ .gridui-u-border-b {
81
81
  border-bottom-style: var(--tw-border-style);
82
82
  border-bottom-width: 1px;
83
83
  }
84
- .border-solid {
84
+ .gridui-u-border-solid {
85
85
  --tw-border-style: solid;
86
86
  border-style: solid;
87
87
  }
88
- .border-border {
88
+ .gridui-u-border-border {
89
89
  border-color: var(--gridui-border);
90
90
  }
91
- .bg-\[light-dark\(rgb\(0_0_0\/25\%\)\,rgb\(0_0_0\/60\%\)\)\] {
91
+ .gridui-u-bg-\[light-dark\(rgb\(0_0_0\/25\%\)\,rgb\(0_0_0\/60\%\)\)\] {
92
92
  background-color: light-dark(rgb(0 0 0/25%),rgb(0 0 0/60%));
93
93
  }
94
- .bg-background {
94
+ .gridui-u-bg-background {
95
95
  background-color: var(--gridui-background);
96
96
  }
97
- .p-gridui-24 {
97
+ .gridui-u-p-gridui-24 {
98
98
  padding: var(--gridui-space-24);
99
99
  }
100
- .pt-\[max\(var\(--gridui-space-24\)\,env\(safe-area-inset-top\)\)\] {
100
+ .gridui-u-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
- .pb-\[max\(var\(--gridui-space-24\)\,env\(safe-area-inset-bottom\)\)\] {
103
+ .gridui-u-pb-\[max\(var\(--gridui-space-24\)\,env\(safe-area-inset-bottom\)\)\] {
104
104
  padding-bottom: max(var(--gridui-space-24), env(safe-area-inset-bottom));
105
105
  }
106
- .type-subheading {
106
+ .gridui-u-type-subheading {
107
107
  font: var(--gridui-type-subheading);
108
108
  letter-spacing: normal;
109
109
  text-wrap: balance;
110
110
  }
111
- .type-supporting {
111
+ .gridui-u-type-supporting {
112
112
  font: var(--gridui-type-supporting);
113
113
  letter-spacing: normal;
114
114
  }
115
- .text-foreground {
115
+ .gridui-u-text-foreground {
116
116
  color: var(--gridui-foreground);
117
117
  }
118
- .text-muted {
118
+ .gridui-u-text-muted {
119
119
  color: var(--gridui-muted);
120
120
  }
121
- .data-\[side\=\'end\'\]\:inset-e-0[data-side='end'] {
121
+ .gridui-u-data-\[side\=\'end\'\]\:inset-e-0[data-side='end'] {
122
122
  inset-inline-end: 0px;
123
123
  }
124
- .data-\[side\=\'end\'\]\:\[border-inline-end\:0\][data-side='end'] {
124
+ .gridui-u-data-\[side\=\'end\'\]\:\[border-inline-end\:0\][data-side='end'] {
125
125
  border-inline-end: 0;
126
126
  }
127
- .data-\[side\=\'start\'\]\:inset-s-0[data-side='start'] {
127
+ .gridui-u-data-\[side\=\'left\'\]\:left-0[data-side='left'] {
128
+ left: 0px;
129
+ }
130
+ .gridui-u-data-\[side\=\'left\'\]\:border-l-0[data-side='left'] {
131
+ border-left-style: var(--tw-border-style);
132
+ border-left-width: 0px;
133
+ }
134
+ .gridui-u-data-\[side\=\'right\'\]\:right-0[data-side='right'] {
135
+ right: 0px;
136
+ }
137
+ .gridui-u-data-\[side\=\'right\'\]\:border-r-0[data-side='right'] {
138
+ border-right-style: var(--tw-border-style);
139
+ border-right-width: 0px;
140
+ }
141
+ .gridui-u-data-\[side\=\'start\'\]\:inset-s-0[data-side='start'] {
128
142
  inset-inline-start: 0px;
129
143
  }
130
- .data-\[side\=\'start\'\]\:\[border-inline-start\:0\][data-side='start'] {
144
+ .gridui-u-data-\[side\=\'start\'\]\:\[border-inline-start\:0\][data-side='start'] {
131
145
  border-inline-start: 0;
132
146
  }
133
- .data-\[state\=\'closed\'\]\:pointer-events-none[data-state='closed'] {
147
+ .gridui-u-data-\[state\=\'closed\'\]\:pointer-events-none[data-state='closed'] {
134
148
  pointer-events: none;
135
149
  }
136
150
  }
@@ -138,7 +152,7 @@
138
152
  .gridui-drawer-panel {
139
153
  --gridui-drawer-offset: 100%;
140
154
  }
141
- .gridui-drawer-panel[data-side="start"] {
155
+ .gridui-drawer-panel[data-side="left"], .gridui-drawer-panel[data-side="start"] {
142
156
  --gridui-drawer-offset: -100%;
143
157
  }
144
158
  .gridui-drawer-panel[data-side="end"]:dir(rtl) {
@@ -153,12 +167,6 @@
153
167
  .gridui-drawer-panel[data-state="closed"] {
154
168
  animation: gridui-drawer-exit var(--gridui-motion-duration-normal) var(--gridui-motion-ease-in) both;
155
169
  }
156
- .gridui-drawer-overlay[data-state="open"] {
157
- animation: gridui-drawer-overlay-enter var(--gridui-motion-duration-deliberate) var(--gridui-motion-ease-out) both;
158
- }
159
- .gridui-drawer-overlay[data-state="closed"] {
160
- animation: gridui-drawer-overlay-exit var(--gridui-motion-duration-normal) var(--gridui-motion-ease-in) both;
161
- }
162
170
  @keyframes gridui-drawer-enter {
163
171
  from {
164
172
  transform: translateX(var(--gridui-drawer-offset));
@@ -175,24 +183,8 @@
175
183
  transform: translateX(var(--gridui-drawer-offset));
176
184
  }
177
185
  }
178
- @keyframes gridui-drawer-overlay-enter {
179
- from {
180
- opacity: 0;
181
- }
182
- to {
183
- opacity: 1;
184
- }
185
- }
186
- @keyframes gridui-drawer-overlay-exit {
187
- from {
188
- opacity: 1;
189
- }
190
- to {
191
- opacity: 0;
192
- }
193
- }
194
186
  @media (prefers-reduced-motion: reduce) {
195
- .gridui-drawer-panel[data-state], .gridui-drawer-overlay[data-state] {
187
+ .gridui-drawer-panel[data-state] {
196
188
  animation: none;
197
189
  }
198
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/drawer",
3
- "version": "1.0.0",
3
+ "version": "1.1.2",
4
4
  "description": "GridUI React drawer",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -26,19 +26,21 @@
26
26
  "react-dom": "^19.2.0"
27
27
  },
28
28
  "dependencies": {
29
- "@gridui/button": "^2.1.1",
30
- "@gridui/overlay": "^1.0.0",
31
- "@gridui/style-utils": "^2.1.2",
32
- "@gridui/theme": "^2.1.2",
29
+ "@gridui/button": "^2.2.0",
30
+ "@gridui/overlay": "^1.1.2",
31
+ "@gridui/style-utils": "^2.1.4",
32
+ "@gridui/theme": "^2.3.2",
33
33
  "@radix-ui/react-dialog": "1.3.1",
34
+ "@radix-ui/react-slot": "1.5.0",
34
35
  "class-variance-authority": "0.7.1",
35
- "lucide-react": "1.62.0"
36
+ "lucide-react": "1.65.0"
36
37
  },
37
38
  "devDependencies": {
38
- "@gridui-internal/configuration": "0.0.0",
39
+ "@gridui-internal/configuration": "0.0.0-internal",
39
40
  "@jest/globals": "30.5.2",
41
+ "@storybook/react-vite": "10.6.5",
40
42
  "@types/jest": "30.0.0",
41
- "@types/node": "26.6.5",
43
+ "@types/node": "26.6.6",
42
44
  "@types/react": "19.3.0",
43
45
  "@types/react-dom": "19.3.0",
44
46
  "jest": "30.5.2",