@gridui/drawer 0.0.0-stage → 1.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 +7 -2
- package/dist/drawer/drawer.d.ts +10 -0
- package/dist/drawer-body/drawer-body.d.ts +9 -0
- package/dist/drawer-body/style.d.ts +7 -0
- package/dist/drawer-close/drawer-close.d.ts +8 -0
- package/dist/drawer-close-button/drawer-close-button.d.ts +10 -0
- package/dist/drawer-description/drawer-description.d.ts +10 -0
- package/dist/drawer-description/style.d.ts +7 -0
- package/dist/drawer-footer/drawer-footer.d.ts +9 -0
- package/dist/drawer-footer/style.d.ts +7 -0
- package/dist/drawer-header/drawer-header.d.ts +9 -0
- package/dist/drawer-header/style.d.ts +7 -0
- package/dist/drawer-panel/drawer-panel.d.ts +12 -0
- package/dist/drawer-panel/style.d.ts +8 -0
- package/dist/drawer-title/drawer-title.d.ts +10 -0
- package/dist/drawer-title/style.d.ts +7 -0
- package/dist/drawer-trigger/drawer-trigger.d.ts +8 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +251 -0
- package/dist/index.js.map +7 -0
- package/dist/styles.css +211 -0
- package/package.json +52 -3
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gridui/drawer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Core family. Public API: `Drawer`, `DrawerBody`, `DrawerBodyProps`, `DrawerClose`, `DrawerCloseButton`, `DrawerCloseButtonProps`, `DrawerDescription`, `DrawerDescriptionProps`, `DrawerFooter`, `DrawerFooterProps`, `DrawerHeader`, `DrawerHeaderProps`, `DrawerPanel`, `DrawerPanelProps`, `DrawerProps`, `DrawerTitle`, `DrawerTitleProps`, `DrawerTrigger`.
|
|
4
|
+
|
|
5
|
+
Import components from `@gridui/drawer` and load `@gridui/drawer/styles.css` after Theme.
|
|
6
|
+
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
|
+
|
|
8
|
+
See [component ownership](../../docs/component-ownership.md) and [release history](.changeset/history/).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace Drawer
|
|
5
|
+
* @description Drawer
|
|
6
|
+
*/
|
|
7
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type DrawerProps = ComponentPropsWithRef<typeof Dialog.Root>;
|
|
10
|
+
export declare const Drawer: FC<DrawerProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerBody
|
|
5
|
+
* @description Drawer Body
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
8
|
+
export type DrawerBodyProps = ComponentPropsWithRef<"div">;
|
|
9
|
+
export declare const DrawerBody: FC<DrawerBodyProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerClose
|
|
5
|
+
* @description Drawer Close
|
|
6
|
+
*/
|
|
7
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
8
|
+
export declare const DrawerClose: import("react").ForwardRefExoticComponent<Dialog.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerCloseButton
|
|
5
|
+
* @description Drawer Close Button
|
|
6
|
+
*/
|
|
7
|
+
import { type ButtonProps } from "@gridui/button";
|
|
8
|
+
import type { FC } from "react";
|
|
9
|
+
export type DrawerCloseButtonProps = ButtonProps;
|
|
10
|
+
export declare const DrawerCloseButton: FC<DrawerCloseButtonProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerDescription
|
|
5
|
+
* @description Drawer Description
|
|
6
|
+
*/
|
|
7
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type DrawerDescriptionProps = ComponentPropsWithRef<typeof Dialog.Description>;
|
|
10
|
+
export declare const DrawerDescription: FC<DrawerDescriptionProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerFooter
|
|
5
|
+
* @description Drawer Footer
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
8
|
+
export type DrawerFooterProps = ComponentPropsWithRef<"div">;
|
|
9
|
+
export declare const DrawerFooter: FC<DrawerFooterProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerHeader
|
|
5
|
+
* @description Drawer Header
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
8
|
+
export type DrawerHeaderProps = ComponentPropsWithRef<"div">;
|
|
9
|
+
export declare const DrawerHeader: FC<DrawerHeaderProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerPanel
|
|
5
|
+
* @description Drawer Panel
|
|
6
|
+
*/
|
|
7
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type DrawerPanelProps = ComponentPropsWithRef<typeof Dialog.Content> & {
|
|
10
|
+
readonly side?: "start" | "end";
|
|
11
|
+
};
|
|
12
|
+
export declare const DrawerPanel: FC<DrawerPanelProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerPanel
|
|
5
|
+
* @description Style
|
|
6
|
+
*/
|
|
7
|
+
export declare const drawerOverlayStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
+
export declare const drawerPanelStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerTitle
|
|
5
|
+
* @description Drawer Title
|
|
6
|
+
*/
|
|
7
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type DrawerTitleProps = ComponentPropsWithRef<typeof Dialog.Title>;
|
|
10
|
+
export declare const DrawerTitle: FC<DrawerTitleProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace DrawerTrigger
|
|
5
|
+
* @description Drawer Trigger
|
|
6
|
+
*/
|
|
7
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
8
|
+
export declare const DrawerTrigger: import("react").ForwardRefExoticComponent<Dialog.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Drawer
|
|
4
|
+
* @namespace Root
|
|
5
|
+
* @description Index
|
|
6
|
+
*/
|
|
7
|
+
export type { DrawerProps } from "./drawer/drawer";
|
|
8
|
+
export { Drawer } from "./drawer/drawer";
|
|
9
|
+
export type { DrawerBodyProps } from "./drawer-body/drawer-body";
|
|
10
|
+
export { DrawerBody } from "./drawer-body/drawer-body";
|
|
11
|
+
export { DrawerClose } from "./drawer-close/drawer-close";
|
|
12
|
+
export type { DrawerCloseButtonProps } from "./drawer-close-button/drawer-close-button";
|
|
13
|
+
export { DrawerCloseButton } from "./drawer-close-button/drawer-close-button";
|
|
14
|
+
export type { DrawerDescriptionProps } from "./drawer-description/drawer-description";
|
|
15
|
+
export { DrawerDescription } from "./drawer-description/drawer-description";
|
|
16
|
+
export type { DrawerFooterProps } from "./drawer-footer/drawer-footer";
|
|
17
|
+
export { DrawerFooter } from "./drawer-footer/drawer-footer";
|
|
18
|
+
export type { DrawerHeaderProps } from "./drawer-header/drawer-header";
|
|
19
|
+
export { DrawerHeader } from "./drawer-header/drawer-header";
|
|
20
|
+
export type { DrawerPanelProps } from "./drawer-panel/drawer-panel";
|
|
21
|
+
export { DrawerPanel } from "./drawer-panel/drawer-panel";
|
|
22
|
+
export type { DrawerTitleProps } from "./drawer-title/drawer-title";
|
|
23
|
+
export { DrawerTitle } from "./drawer-title/drawer-title";
|
|
24
|
+
export { DrawerTrigger } from "./drawer-trigger/drawer-trigger";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
// src/drawer/drawer.tsx
|
|
2
|
+
import { OverlayOpen, useOverlayState } from "@gridui/overlay";
|
|
3
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var Drawer = (props) => {
|
|
6
|
+
const state = useOverlayState(props);
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
OverlayOpen.Provider,
|
|
9
|
+
{
|
|
10
|
+
value: state.open,
|
|
11
|
+
children: /* @__PURE__ */ jsx(
|
|
12
|
+
Dialog.Root,
|
|
13
|
+
{
|
|
14
|
+
...props,
|
|
15
|
+
...state
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/drawer-body/style.ts
|
|
23
|
+
import { cn } from "@gridui/style-utils";
|
|
24
|
+
import { cva } from "class-variance-authority";
|
|
25
|
+
var drawerBodyStyles = cva(cn(
|
|
26
|
+
"gridui-drawer-body",
|
|
27
|
+
"min-h-0 flex-1 overflow-y-auto overscroll-contain p-gridui-24"
|
|
28
|
+
));
|
|
29
|
+
|
|
30
|
+
// src/drawer-body/drawer-body.tsx
|
|
31
|
+
import { cn as cn2 } from "@gridui/style-utils";
|
|
32
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
33
|
+
var DrawerBody = (props) => {
|
|
34
|
+
const { className, ...restProps } = props;
|
|
35
|
+
return /* @__PURE__ */ jsx2(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
...restProps,
|
|
39
|
+
className: cn2(drawerBodyStyles(), className)
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// src/drawer-close/drawer-close.tsx
|
|
45
|
+
import * as Dialog2 from "@radix-ui/react-dialog";
|
|
46
|
+
var DrawerClose = Dialog2.Close;
|
|
47
|
+
|
|
48
|
+
// src/drawer-close-button/drawer-close-button.tsx
|
|
49
|
+
import { Button } from "@gridui/button";
|
|
50
|
+
import * as Dialog3 from "@radix-ui/react-dialog";
|
|
51
|
+
import { X } from "lucide-react";
|
|
52
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
53
|
+
var DrawerCloseButton = (props) => {
|
|
54
|
+
const {
|
|
55
|
+
children,
|
|
56
|
+
size = "small",
|
|
57
|
+
...restProps
|
|
58
|
+
} = props;
|
|
59
|
+
const buttonProps = restProps.variant === "text" || restProps.variant === "underlined" ? {
|
|
60
|
+
...restProps,
|
|
61
|
+
layout: "standard"
|
|
62
|
+
} : {
|
|
63
|
+
...restProps,
|
|
64
|
+
variant: restProps.variant === void 0 ? "quiet" : restProps.variant,
|
|
65
|
+
layout: restProps.layout === void 0 ? "icon" : restProps.layout
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ jsx3(
|
|
68
|
+
Dialog3.Close,
|
|
69
|
+
{
|
|
70
|
+
asChild: true,
|
|
71
|
+
children: /* @__PURE__ */ jsx3(
|
|
72
|
+
Button,
|
|
73
|
+
{
|
|
74
|
+
...buttonProps,
|
|
75
|
+
size,
|
|
76
|
+
children: children ?? /* @__PURE__ */ jsx3(
|
|
77
|
+
X,
|
|
78
|
+
{
|
|
79
|
+
"aria-hidden": "true"
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/drawer-description/style.ts
|
|
89
|
+
import { cn as cn3 } from "@gridui/style-utils";
|
|
90
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
91
|
+
var drawerDescriptionStyles = cva2(cn3(
|
|
92
|
+
"gridui-drawer-description",
|
|
93
|
+
"text-muted"
|
|
94
|
+
));
|
|
95
|
+
|
|
96
|
+
// src/drawer-description/drawer-description.tsx
|
|
97
|
+
import { cn as cn4 } from "@gridui/style-utils";
|
|
98
|
+
import * as Dialog4 from "@radix-ui/react-dialog";
|
|
99
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
100
|
+
var DrawerDescription = (props) => {
|
|
101
|
+
const {
|
|
102
|
+
className,
|
|
103
|
+
...restProps
|
|
104
|
+
} = props;
|
|
105
|
+
return /* @__PURE__ */ jsx4(
|
|
106
|
+
Dialog4.Description,
|
|
107
|
+
{
|
|
108
|
+
...restProps,
|
|
109
|
+
className: cn4(drawerDescriptionStyles(), className)
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// src/drawer-footer/style.ts
|
|
115
|
+
import { cn as cn5 } from "@gridui/style-utils";
|
|
116
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
117
|
+
var drawerFooterStyles = cva3(cn5(
|
|
118
|
+
"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"
|
|
121
|
+
));
|
|
122
|
+
|
|
123
|
+
// src/drawer-footer/drawer-footer.tsx
|
|
124
|
+
import { cn as cn6 } from "@gridui/style-utils";
|
|
125
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
126
|
+
var DrawerFooter = (props) => {
|
|
127
|
+
const { className, ...restProps } = props;
|
|
128
|
+
return /* @__PURE__ */ jsx5(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
...restProps,
|
|
132
|
+
className: cn6(drawerFooterStyles(), className)
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// src/drawer-header/style.ts
|
|
138
|
+
import { cn as cn7 } from "@gridui/style-utils";
|
|
139
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
140
|
+
var drawerHeaderStyles = cva4(cn7(
|
|
141
|
+
"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"
|
|
144
|
+
));
|
|
145
|
+
|
|
146
|
+
// src/drawer-header/drawer-header.tsx
|
|
147
|
+
import { cn as cn8 } from "@gridui/style-utils";
|
|
148
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
149
|
+
var DrawerHeader = (props) => {
|
|
150
|
+
const { className, ...restProps } = props;
|
|
151
|
+
return /* @__PURE__ */ jsx6(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
...restProps,
|
|
155
|
+
className: cn8(drawerHeaderStyles(), className)
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// src/drawer-panel/style.ts
|
|
161
|
+
import { cn as cn9 } from "@gridui/style-utils";
|
|
162
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
163
|
+
var drawerOverlayStyles = cva5(cn9(
|
|
164
|
+
"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"
|
|
167
|
+
));
|
|
168
|
+
var drawerPanelStyles = cva5(cn9(
|
|
169
|
+
"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"
|
|
174
|
+
));
|
|
175
|
+
|
|
176
|
+
// src/drawer-panel/drawer-panel.tsx
|
|
177
|
+
import { RetainedLayer } from "@gridui/overlay";
|
|
178
|
+
import { cn as cn10 } from "@gridui/style-utils";
|
|
179
|
+
import * as Dialog5 from "@radix-ui/react-dialog";
|
|
180
|
+
import { Fragment, jsx as jsx7, jsxs } from "react/jsx-runtime";
|
|
181
|
+
var DrawerPanel = (props) => {
|
|
182
|
+
const { side = "end", className, forceMount, ...restProps } = props;
|
|
183
|
+
const content = /* @__PURE__ */ jsx7(
|
|
184
|
+
Dialog5.Content,
|
|
185
|
+
{
|
|
186
|
+
...restProps,
|
|
187
|
+
forceMount,
|
|
188
|
+
"aria-describedby": restProps["aria-describedby"],
|
|
189
|
+
"data-side": side,
|
|
190
|
+
className: cn10(drawerPanelStyles(), className)
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
194
|
+
/* @__PURE__ */ jsx7(Dialog5.Portal, { children: /* @__PURE__ */ jsx7(
|
|
195
|
+
Dialog5.Overlay,
|
|
196
|
+
{
|
|
197
|
+
className: cn10(drawerOverlayStyles())
|
|
198
|
+
}
|
|
199
|
+
) }),
|
|
200
|
+
/* @__PURE__ */ jsx7(
|
|
201
|
+
Dialog5.Portal,
|
|
202
|
+
{
|
|
203
|
+
forceMount,
|
|
204
|
+
children: forceMount ? /* @__PURE__ */ jsx7(RetainedLayer, { children: content }) : content
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
] });
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
// src/drawer-title/style.ts
|
|
211
|
+
import { cn as cn11 } from "@gridui/style-utils";
|
|
212
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
213
|
+
var drawerTitleStyles = cva6(cn11(
|
|
214
|
+
"gridui-drawer-title",
|
|
215
|
+
"m-0 type-subheading"
|
|
216
|
+
));
|
|
217
|
+
|
|
218
|
+
// src/drawer-title/drawer-title.tsx
|
|
219
|
+
import { cn as cn12 } from "@gridui/style-utils";
|
|
220
|
+
import * as Dialog6 from "@radix-ui/react-dialog";
|
|
221
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
222
|
+
var DrawerTitle = (props) => {
|
|
223
|
+
const {
|
|
224
|
+
className,
|
|
225
|
+
...restProps
|
|
226
|
+
} = props;
|
|
227
|
+
return /* @__PURE__ */ jsx8(
|
|
228
|
+
Dialog6.Title,
|
|
229
|
+
{
|
|
230
|
+
...restProps,
|
|
231
|
+
className: cn12(drawerTitleStyles(), className)
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// src/drawer-trigger/drawer-trigger.tsx
|
|
237
|
+
import * as Dialog7 from "@radix-ui/react-dialog";
|
|
238
|
+
var DrawerTrigger = Dialog7.Trigger;
|
|
239
|
+
export {
|
|
240
|
+
Drawer,
|
|
241
|
+
DrawerBody,
|
|
242
|
+
DrawerClose,
|
|
243
|
+
DrawerCloseButton,
|
|
244
|
+
DrawerDescription,
|
|
245
|
+
DrawerFooter,
|
|
246
|
+
DrawerHeader,
|
|
247
|
+
DrawerPanel,
|
|
248
|
+
DrawerTitle,
|
|
249
|
+
DrawerTrigger
|
|
250
|
+
};
|
|
251
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
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;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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"]
|
|
7
|
+
}
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer theme, base, components, utilities;
|
|
4
|
+
@layer utilities {
|
|
5
|
+
.fixed {
|
|
6
|
+
position: fixed;
|
|
7
|
+
}
|
|
8
|
+
.inset-0 {
|
|
9
|
+
inset: 0px;
|
|
10
|
+
}
|
|
11
|
+
.inset-y-0 {
|
|
12
|
+
inset-block: 0px;
|
|
13
|
+
}
|
|
14
|
+
.z-\(--gridui-z-drawer\) {
|
|
15
|
+
z-index: var(--gridui-z-drawer);
|
|
16
|
+
}
|
|
17
|
+
.z-\(--gridui-z-drawer-backdrop\) {
|
|
18
|
+
z-index: var(--gridui-z-drawer-backdrop);
|
|
19
|
+
}
|
|
20
|
+
.m-0 {
|
|
21
|
+
margin: 0px;
|
|
22
|
+
}
|
|
23
|
+
.box-border {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
}
|
|
26
|
+
.flex {
|
|
27
|
+
display: flex;
|
|
28
|
+
}
|
|
29
|
+
.h-dvh {
|
|
30
|
+
height: 100dvh;
|
|
31
|
+
}
|
|
32
|
+
.max-h-\[50dvh\] {
|
|
33
|
+
max-height: 50dvh;
|
|
34
|
+
}
|
|
35
|
+
.min-h-0 {
|
|
36
|
+
min-height: 0px;
|
|
37
|
+
}
|
|
38
|
+
.w-\[min\(100\%\,var\(--gridui-drawer-width\,24rem\)\)\] {
|
|
39
|
+
width: min(100%, var(--gridui-drawer-width,24rem));
|
|
40
|
+
}
|
|
41
|
+
.max-w-full {
|
|
42
|
+
max-width: 100%;
|
|
43
|
+
}
|
|
44
|
+
.flex-1 {
|
|
45
|
+
flex: 1;
|
|
46
|
+
}
|
|
47
|
+
.shrink-0 {
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
}
|
|
50
|
+
.flex-col {
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
}
|
|
53
|
+
.items-center {
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
.justify-between {
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
}
|
|
59
|
+
.gap-gridui-16 {
|
|
60
|
+
gap: var(--gridui-space-16);
|
|
61
|
+
}
|
|
62
|
+
.overflow-y-auto {
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
}
|
|
65
|
+
.overscroll-contain {
|
|
66
|
+
overscroll-behavior: contain;
|
|
67
|
+
}
|
|
68
|
+
.border {
|
|
69
|
+
border-style: var(--tw-border-style);
|
|
70
|
+
border-width: 1px;
|
|
71
|
+
}
|
|
72
|
+
.border-y-0 {
|
|
73
|
+
border-block-style: var(--tw-border-style);
|
|
74
|
+
border-block-width: 0px;
|
|
75
|
+
}
|
|
76
|
+
.border-t {
|
|
77
|
+
border-top-style: var(--tw-border-style);
|
|
78
|
+
border-top-width: 1px;
|
|
79
|
+
}
|
|
80
|
+
.border-b {
|
|
81
|
+
border-bottom-style: var(--tw-border-style);
|
|
82
|
+
border-bottom-width: 1px;
|
|
83
|
+
}
|
|
84
|
+
.border-solid {
|
|
85
|
+
--tw-border-style: solid;
|
|
86
|
+
border-style: solid;
|
|
87
|
+
}
|
|
88
|
+
.border-border {
|
|
89
|
+
border-color: var(--gridui-border);
|
|
90
|
+
}
|
|
91
|
+
.bg-\[light-dark\(rgb\(0_0_0\/25\%\)\,rgb\(0_0_0\/60\%\)\)\] {
|
|
92
|
+
background-color: light-dark(rgb(0 0 0/25%),rgb(0 0 0/60%));
|
|
93
|
+
}
|
|
94
|
+
.bg-background {
|
|
95
|
+
background-color: var(--gridui-background);
|
|
96
|
+
}
|
|
97
|
+
.p-gridui-24 {
|
|
98
|
+
padding: var(--gridui-space-24);
|
|
99
|
+
}
|
|
100
|
+
.pt-\[max\(var\(--gridui-space-24\)\,env\(safe-area-inset-top\)\)\] {
|
|
101
|
+
padding-top: max(var(--gridui-space-24), env(safe-area-inset-top));
|
|
102
|
+
}
|
|
103
|
+
.pb-\[max\(var\(--gridui-space-24\)\,env\(safe-area-inset-bottom\)\)\] {
|
|
104
|
+
padding-bottom: max(var(--gridui-space-24), env(safe-area-inset-bottom));
|
|
105
|
+
}
|
|
106
|
+
.type-subheading {
|
|
107
|
+
font: var(--gridui-type-subheading);
|
|
108
|
+
letter-spacing: normal;
|
|
109
|
+
text-wrap: balance;
|
|
110
|
+
}
|
|
111
|
+
.type-supporting {
|
|
112
|
+
font: var(--gridui-type-supporting);
|
|
113
|
+
letter-spacing: normal;
|
|
114
|
+
}
|
|
115
|
+
.text-foreground {
|
|
116
|
+
color: var(--gridui-foreground);
|
|
117
|
+
}
|
|
118
|
+
.text-muted {
|
|
119
|
+
color: var(--gridui-muted);
|
|
120
|
+
}
|
|
121
|
+
.data-\[side\=\'end\'\]\:inset-e-0[data-side='end'] {
|
|
122
|
+
inset-inline-end: 0px;
|
|
123
|
+
}
|
|
124
|
+
.data-\[side\=\'end\'\]\:\[border-inline-end\:0\][data-side='end'] {
|
|
125
|
+
border-inline-end: 0;
|
|
126
|
+
}
|
|
127
|
+
.data-\[side\=\'start\'\]\:inset-s-0[data-side='start'] {
|
|
128
|
+
inset-inline-start: 0px;
|
|
129
|
+
}
|
|
130
|
+
.data-\[side\=\'start\'\]\:\[border-inline-start\:0\][data-side='start'] {
|
|
131
|
+
border-inline-start: 0;
|
|
132
|
+
}
|
|
133
|
+
.data-\[state\=\'closed\'\]\:pointer-events-none[data-state='closed'] {
|
|
134
|
+
pointer-events: none;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
@layer components {
|
|
138
|
+
.gridui-drawer-panel {
|
|
139
|
+
--gridui-drawer-offset: 100%;
|
|
140
|
+
}
|
|
141
|
+
.gridui-drawer-panel[data-side="start"] {
|
|
142
|
+
--gridui-drawer-offset: -100%;
|
|
143
|
+
}
|
|
144
|
+
.gridui-drawer-panel[data-side="end"]:dir(rtl) {
|
|
145
|
+
--gridui-drawer-offset: -100%;
|
|
146
|
+
}
|
|
147
|
+
.gridui-drawer-panel[data-side="start"]:dir(rtl) {
|
|
148
|
+
--gridui-drawer-offset: 100%;
|
|
149
|
+
}
|
|
150
|
+
.gridui-drawer-panel[data-state="open"] {
|
|
151
|
+
animation: gridui-drawer-enter var(--gridui-motion-duration-deliberate) var(--gridui-motion-ease-out) both;
|
|
152
|
+
}
|
|
153
|
+
.gridui-drawer-panel[data-state="closed"] {
|
|
154
|
+
animation: gridui-drawer-exit var(--gridui-motion-duration-normal) var(--gridui-motion-ease-in) both;
|
|
155
|
+
}
|
|
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
|
+
@keyframes gridui-drawer-enter {
|
|
163
|
+
from {
|
|
164
|
+
transform: translateX(var(--gridui-drawer-offset));
|
|
165
|
+
}
|
|
166
|
+
to {
|
|
167
|
+
transform: translateX(0);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
@keyframes gridui-drawer-exit {
|
|
171
|
+
from {
|
|
172
|
+
transform: translateX(0);
|
|
173
|
+
}
|
|
174
|
+
to {
|
|
175
|
+
transform: translateX(var(--gridui-drawer-offset));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
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
|
+
@media (prefers-reduced-motion: reduce) {
|
|
195
|
+
.gridui-drawer-panel[data-state], .gridui-drawer-overlay[data-state] {
|
|
196
|
+
animation: none;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
@property --tw-border-style {
|
|
201
|
+
syntax: "*";
|
|
202
|
+
inherits: false;
|
|
203
|
+
initial-value: solid;
|
|
204
|
+
}
|
|
205
|
+
@layer properties {
|
|
206
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
207
|
+
*, ::before, ::after, ::backdrop {
|
|
208
|
+
--tw-border-style: solid;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/drawer",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "GridUI React drawer",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./styles.css": "./dist/styles.css"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^19.2.0",
|
|
26
|
+
"react-dom": "^19.2.0"
|
|
27
|
+
},
|
|
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",
|
|
33
|
+
"@radix-ui/react-dialog": "1.3.1",
|
|
34
|
+
"class-variance-authority": "0.7.1",
|
|
35
|
+
"lucide-react": "1.62.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@gridui-internal/configuration": "0.0.0",
|
|
39
|
+
"@jest/globals": "30.5.2",
|
|
40
|
+
"@types/jest": "30.0.0",
|
|
41
|
+
"@types/node": "26.6.5",
|
|
42
|
+
"@types/react": "19.3.0",
|
|
43
|
+
"@types/react-dom": "19.3.0",
|
|
44
|
+
"jest": "30.5.2",
|
|
45
|
+
"react": "19.3.1",
|
|
46
|
+
"react-dom": "19.3.1",
|
|
47
|
+
"typescript": "6.0.3"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "node ../../scripts/compilation/package.ts",
|
|
51
|
+
"compile": "tsc --project tsconfig.json",
|
|
52
|
+
"test": "jest",
|
|
53
|
+
"coverage": "jest --coverage"
|
|
54
|
+
}
|
|
6
55
|
}
|