@gridui/modal 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 +5 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +49 -33
- package/dist/index.js.map +3 -3
- package/dist/modal-close/modal-close.d.ts +3 -1
- package/dist/modal-trigger/modal-trigger.d.ts +3 -1
- package/dist/styles.css +53 -80
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# @gridui/modal
|
|
2
2
|
|
|
3
|
-
Core family. Public API: `Modal`, `ModalAction`, `ModalActionProps`, `ModalActions`, `ModalActionsProps`, `ModalBody`, `ModalBodyProps`, `ModalClose`, `ModalDescription`, `ModalDescriptionProps`, `ModalFooter`, `ModalFooterNote`, `ModalFooterNoteProps`, `ModalFooterProps`, `ModalHeader`, `ModalHeaderProps`, `ModalPanel`, `ModalPanelProps`, `ModalProps`, `ModalSectionProps`, `ModalSpace`, `ModalSpacing`, `ModalTitle`, `ModalTitleProps`, `ModalTrigger`.
|
|
3
|
+
Core family. Public API: `Modal`, `ModalAction`, `ModalActionProps`, `ModalActions`, `ModalActionsProps`, `ModalBody`, `ModalBodyProps`, `ModalClose`, `ModalCloseProps`, `ModalDescription`, `ModalDescriptionProps`, `ModalFooter`, `ModalFooterNote`, `ModalFooterNoteProps`, `ModalFooterProps`, `ModalHeader`, `ModalHeaderProps`, `ModalPanel`, `ModalPanelProps`, `ModalProps`, `ModalSectionProps`, `ModalSpace`, `ModalSpacing`, `ModalTitle`, `ModalTitleProps`, `ModalTrigger`, `ModalTriggerProps`.
|
|
4
4
|
|
|
5
5
|
Import components from `@gridui/modal` and load `@gridui/modal/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](
|
|
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/modal/.changeset/history).
|
|
9
9
|
|
|
10
10
|
## Modal
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ Drawer. Its header owns a title cell and a full-height close cell; its footer
|
|
|
14
14
|
owns an optional note and edge-aligned action cells. Header and footer accept
|
|
15
15
|
independent responsive `paddingBlock` values. The body owns content scrolling;
|
|
16
16
|
small viewports stack footer actions below the note. See the
|
|
17
|
-
[composition example and API](
|
|
17
|
+
[composition example and API](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md).
|
|
18
18
|
|
|
19
19
|
Modal headers allow visible overflow so the full-cell close button's external
|
|
20
20
|
hover and keyboard-focus outlines remain visible. Only the title/description
|
|
@@ -76,3 +76,5 @@ consumers decide when an asynchronous primary action has succeeded.
|
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
|
|
79
|
+
|
|
80
|
+
Surface motion uses `@gridui/overlay`; load `@gridui/overlay/styles.css` after Theme and before this family.
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export type { ModalActionsProps } from "./modal-actions/modal-actions";
|
|
|
13
13
|
export { ModalActions } from "./modal-actions/modal-actions";
|
|
14
14
|
export type { ModalBodyProps } from "./modal-body/modal-body";
|
|
15
15
|
export { ModalBody } from "./modal-body/modal-body";
|
|
16
|
+
export type { ModalCloseProps } from "./modal-close/modal-close";
|
|
16
17
|
export { ModalClose } from "./modal-close/modal-close";
|
|
17
18
|
export type { ModalDescriptionProps } from "./modal-description/modal-description";
|
|
18
19
|
export { ModalDescription } from "./modal-description/modal-description";
|
|
@@ -26,6 +27,7 @@ export type { ModalPanelProps } from "./modal-panel/modal-panel";
|
|
|
26
27
|
export { ModalPanel } from "./modal-panel/modal-panel";
|
|
27
28
|
export type { ModalTitleProps } from "./modal-title/modal-title";
|
|
28
29
|
export { ModalTitle } from "./modal-title/modal-title";
|
|
30
|
+
export type { ModalTriggerProps } from "./modal-trigger/modal-trigger";
|
|
29
31
|
export { ModalTrigger } from "./modal-trigger/modal-trigger";
|
|
30
32
|
export type { ModalSectionProps } from "./shared/types";
|
|
31
33
|
export type { ModalSpacing } from "./shared/types";
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var ModalAction = (props) => {
|
|
|
30
30
|
Button,
|
|
31
31
|
{
|
|
32
32
|
...restProps,
|
|
33
|
-
className: cn("flex-1 w-auto rounded-none border-0 border-s border-solid border-border first:border-s-0 px-gridui-24 py-(--gridui-modal-padding) min-h-11", className)
|
|
33
|
+
className: cn("gridui-u-flex-1 gridui-u-w-auto gridui-u-rounded-none gridui-u-border-0 gridui-u-border-s gridui-u-border-solid gridui-u-border-border gridui-u-first:border-s-0 gridui-u-px-gridui-24 gridui-u-py-(--gridui-modal-padding) gridui-u-min-h-11", className)
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
36
|
};
|
|
@@ -44,7 +44,7 @@ var ModalActions = (props) => {
|
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
...restProps,
|
|
47
|
-
className: cn2("gridui-modal-actions flex min-w-0", className)
|
|
47
|
+
className: cn2("gridui-modal-actions gridui-u-flex gridui-u-min-w-0", className)
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
};
|
|
@@ -58,29 +58,37 @@ var ModalBody = (props) => {
|
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
60
|
...restProps,
|
|
61
|
-
className: cn3("min-h-0 min-w-0 overflow-auto overscroll-contain p-gridui-24 wrap-anywhere", className)
|
|
61
|
+
className: cn3("gridui-u-min-h-0 gridui-u-min-w-0 gridui-u-overflow-auto gridui-u-overscroll-contain gridui-u-p-gridui-24 gridui-u-wrap-anywhere", className)
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
// src/modal-close/modal-close.tsx
|
|
67
67
|
import * as Dialog2 from "@radix-ui/react-dialog";
|
|
68
|
-
|
|
68
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
69
|
+
var ModalClose = (props) => {
|
|
70
|
+
return /* @__PURE__ */ jsx5(
|
|
71
|
+
Dialog2.Close,
|
|
72
|
+
{
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
};
|
|
69
77
|
|
|
70
78
|
// src/modal-description/modal-description.tsx
|
|
71
79
|
import { cn as cn4 } from "@gridui/style-utils";
|
|
72
80
|
import * as Dialog3 from "@radix-ui/react-dialog";
|
|
73
|
-
import { jsx as
|
|
81
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
74
82
|
var ModalDescription = (props) => {
|
|
75
83
|
const {
|
|
76
84
|
className,
|
|
77
85
|
...restProps
|
|
78
86
|
} = props;
|
|
79
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ jsx6(
|
|
80
88
|
Dialog3.Description,
|
|
81
89
|
{
|
|
82
90
|
...restProps,
|
|
83
|
-
className: cn4("mt-gridui-8 mb-0 type-supporting text-muted", className)
|
|
91
|
+
className: cn4("gridui-u-mt-gridui-8 gridui-u-mb-0 gridui-u-type-supporting gridui-u-text-muted", className)
|
|
84
92
|
}
|
|
85
93
|
);
|
|
86
94
|
};
|
|
@@ -88,7 +96,7 @@ var ModalDescription = (props) => {
|
|
|
88
96
|
// src/modal-footer/modal-footer.tsx
|
|
89
97
|
import { cn as cn5 } from "@gridui/style-utils";
|
|
90
98
|
import { spacingVariables } from "@gridui/style-utils/responsive";
|
|
91
|
-
import { jsx as
|
|
99
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
92
100
|
var ModalFooter = (props) => {
|
|
93
101
|
const {
|
|
94
102
|
paddingBlock = 24,
|
|
@@ -96,7 +104,7 @@ var ModalFooter = (props) => {
|
|
|
96
104
|
className,
|
|
97
105
|
...restProps
|
|
98
106
|
} = props;
|
|
99
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ jsx7(
|
|
100
108
|
"div",
|
|
101
109
|
{
|
|
102
110
|
...restProps,
|
|
@@ -104,21 +112,21 @@ var ModalFooter = (props) => {
|
|
|
104
112
|
...spacingVariables("modal-space", paddingBlock),
|
|
105
113
|
...style
|
|
106
114
|
},
|
|
107
|
-
className: cn5("gridui-modal-section gridui-modal-footer max-h-[40dvh] overflow-y-auto shrink-0 border-t border-solid border-border", className)
|
|
115
|
+
className: cn5("gridui-modal-section gridui-modal-footer gridui-u-max-h-[40dvh] gridui-u-overflow-y-auto gridui-u-shrink-0 gridui-u-border-t gridui-u-border-solid gridui-u-border-border", className)
|
|
108
116
|
}
|
|
109
117
|
);
|
|
110
118
|
};
|
|
111
119
|
|
|
112
120
|
// src/modal-footer-note/modal-footer-note.tsx
|
|
113
121
|
import { cn as cn6 } from "@gridui/style-utils";
|
|
114
|
-
import { jsx as
|
|
122
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
115
123
|
var ModalFooterNote = (props) => {
|
|
116
124
|
const { className, ...restProps } = props;
|
|
117
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ jsx8(
|
|
118
126
|
"div",
|
|
119
127
|
{
|
|
120
128
|
...restProps,
|
|
121
|
-
className: cn6("min-w-0 px-gridui-24 py-(--gridui-modal-padding) type-supporting text-muted wrap-anywhere", className)
|
|
129
|
+
className: cn6("gridui-u-min-w-0 gridui-u-px-gridui-24 gridui-u-py-(--gridui-modal-padding) gridui-u-type-supporting gridui-u-text-muted gridui-u-wrap-anywhere", className)
|
|
122
130
|
}
|
|
123
131
|
);
|
|
124
132
|
};
|
|
@@ -129,7 +137,7 @@ import { cn as cn7 } from "@gridui/style-utils";
|
|
|
129
137
|
import { spacingVariables as spacingVariables2 } from "@gridui/style-utils/responsive";
|
|
130
138
|
import * as Dialog4 from "@radix-ui/react-dialog";
|
|
131
139
|
import { X } from "lucide-react";
|
|
132
|
-
import { jsx as
|
|
140
|
+
import { jsx as jsx9, jsxs } from "react/jsx-runtime";
|
|
133
141
|
var ModalHeader = (props) => {
|
|
134
142
|
const {
|
|
135
143
|
closeLabel,
|
|
@@ -147,26 +155,26 @@ var ModalHeader = (props) => {
|
|
|
147
155
|
...spacingVariables2("modal-space", paddingBlock),
|
|
148
156
|
...style
|
|
149
157
|
},
|
|
150
|
-
className: cn7("gridui-modal-section gridui-modal-header relative z-(--gridui-z-content) overflow-visible shrink-0 grid grid-cols-[minmax(0,1fr)_auto] border-b border-solid border-border", className),
|
|
158
|
+
className: cn7("gridui-modal-section gridui-modal-header gridui-u-relative gridui-u-z-(--gridui-z-content) gridui-u-overflow-visible gridui-u-shrink-0 gridui-u-grid gridui-u-grid-cols-[minmax(0,1fr)_auto] gridui-u-border-b gridui-u-border-solid gridui-u-border-border", className),
|
|
151
159
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ jsx9(
|
|
153
161
|
"div",
|
|
154
162
|
{
|
|
155
|
-
className: "max-h-[40dvh] min-w-0 overflow-y-auto px-gridui-24 py-(--gridui-modal-padding) wrap-anywhere",
|
|
163
|
+
className: "gridui-u-max-h-[40dvh] gridui-u-min-w-0 gridui-u-overflow-y-auto gridui-u-px-gridui-24 gridui-u-py-(--gridui-modal-padding) gridui-u-wrap-anywhere",
|
|
156
164
|
children
|
|
157
165
|
}
|
|
158
166
|
),
|
|
159
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ jsx9(
|
|
160
168
|
Dialog4.Close,
|
|
161
169
|
{
|
|
162
170
|
asChild: true,
|
|
163
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ jsx9(
|
|
164
172
|
Button2,
|
|
165
173
|
{
|
|
166
174
|
"aria-label": closeLabel,
|
|
167
175
|
variant: "quiet",
|
|
168
|
-
className: "self-stretch w-gridui-64 min-h-11 rounded-none border-0 border-s border-solid border-border [&:hover:not(:disabled)]:border-border p-0",
|
|
169
|
-
children: /* @__PURE__ */
|
|
176
|
+
className: "gridui-u-self-stretch gridui-u-w-gridui-64 gridui-u-min-h-11 gridui-u-rounded-none gridui-u-border-0 gridui-u-border-s gridui-u-border-solid gridui-u-border-border gridui-u-[&:hover:not(:disabled)]:border-border gridui-u-p-0",
|
|
177
|
+
children: /* @__PURE__ */ jsx9(
|
|
170
178
|
X,
|
|
171
179
|
{
|
|
172
180
|
"aria-hidden": "true"
|
|
@@ -182,36 +190,36 @@ var ModalHeader = (props) => {
|
|
|
182
190
|
};
|
|
183
191
|
|
|
184
192
|
// src/modal-panel/modal-panel.tsx
|
|
185
|
-
import { RetainedLayer } from "@gridui/overlay";
|
|
193
|
+
import { overlayBackdropStyles, overlaySurfaceStyles, RetainedLayer } from "@gridui/overlay";
|
|
186
194
|
import { cn as cn8 } from "@gridui/style-utils";
|
|
187
195
|
import * as Dialog5 from "@radix-ui/react-dialog";
|
|
188
|
-
import { Fragment, jsx as
|
|
196
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
189
197
|
var ModalPanel = (props) => {
|
|
190
198
|
const {
|
|
191
199
|
className,
|
|
192
200
|
forceMount,
|
|
193
201
|
...restProps
|
|
194
202
|
} = props;
|
|
195
|
-
const content = /* @__PURE__ */
|
|
203
|
+
const content = /* @__PURE__ */ jsx10(
|
|
196
204
|
Dialog5.Content,
|
|
197
205
|
{
|
|
198
206
|
...restProps,
|
|
199
207
|
forceMount,
|
|
200
|
-
className: cn8("gridui-modal-panel fixed z-(--gridui-z-dialog) left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col w-[min(calc(100%-32px),var(--gridui-modal-width,37rem))] max-h-[calc(100dvh-32px)] min-w-0
|
|
208
|
+
className: cn8(overlaySurfaceStyles({ kind: "dialog" }), "gridui-modal-panel gridui-u-fixed gridui-u-z-(--gridui-z-dialog) gridui-u-left-1/2 gridui-u-top-1/2 gridui-u--translate-x-1/2 gridui-u--translate-y-1/2 gridui-u-flex gridui-u-flex-col gridui-u-w-[min(calc(100%-32px),var(--gridui-modal-width,37rem))] gridui-u-max-h-[calc(100dvh-32px)] gridui-u-min-w-0 gridui-u-type-body", className)
|
|
201
209
|
}
|
|
202
210
|
);
|
|
203
211
|
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
204
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ jsx10(Dialog5.Portal, { children: /* @__PURE__ */ jsx10(
|
|
205
213
|
Dialog5.Overlay,
|
|
206
214
|
{
|
|
207
|
-
className: "gridui-modal-overlay fixed inset-0 z-(--gridui-z-dialog-backdrop) bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]"
|
|
215
|
+
className: cn8(overlayBackdropStyles(), "gridui-modal-overlay gridui-u-fixed gridui-u-inset-0 gridui-u-z-(--gridui-z-dialog-backdrop) gridui-u-bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]")
|
|
208
216
|
}
|
|
209
217
|
) }),
|
|
210
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ jsx10(
|
|
211
219
|
Dialog5.Portal,
|
|
212
220
|
{
|
|
213
221
|
forceMount,
|
|
214
|
-
children: forceMount ? /* @__PURE__ */
|
|
222
|
+
children: forceMount ? /* @__PURE__ */ jsx10(RetainedLayer, { children: content }) : content
|
|
215
223
|
}
|
|
216
224
|
)
|
|
217
225
|
] });
|
|
@@ -220,21 +228,29 @@ var ModalPanel = (props) => {
|
|
|
220
228
|
// src/modal-title/modal-title.tsx
|
|
221
229
|
import { cn as cn9 } from "@gridui/style-utils";
|
|
222
230
|
import * as Dialog6 from "@radix-ui/react-dialog";
|
|
223
|
-
import { jsx as
|
|
231
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
224
232
|
var ModalTitle = (props) => {
|
|
225
233
|
const { className, ...restProps } = props;
|
|
226
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ jsx11(
|
|
227
235
|
Dialog6.Title,
|
|
228
236
|
{
|
|
229
237
|
...restProps,
|
|
230
|
-
className: cn9("m-0 type-heading", className)
|
|
238
|
+
className: cn9("gridui-u-m-0 gridui-u-type-heading", className)
|
|
231
239
|
}
|
|
232
240
|
);
|
|
233
241
|
};
|
|
234
242
|
|
|
235
243
|
// src/modal-trigger/modal-trigger.tsx
|
|
236
244
|
import * as Dialog7 from "@radix-ui/react-dialog";
|
|
237
|
-
|
|
245
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
246
|
+
var ModalTrigger = (props) => {
|
|
247
|
+
return /* @__PURE__ */ jsx12(
|
|
248
|
+
Dialog7.Trigger,
|
|
249
|
+
{
|
|
250
|
+
...props
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
};
|
|
238
254
|
export {
|
|
239
255
|
Modal,
|
|
240
256
|
ModalAction,
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/modal/modal.tsx", "../src/modal-action/modal-action.tsx", "../src/modal-actions/modal-actions.tsx", "../src/modal-body/modal-body.tsx", "../src/modal-close/modal-close.tsx", "../src/modal-description/modal-description.tsx", "../src/modal-footer/modal-footer.tsx", "../src/modal-footer-note/modal-footer-note.tsx", "../src/modal-header/modal-header.tsx", "../src/modal-panel/modal-panel.tsx", "../src/modal-title/modal-title.tsx", "../src/modal-trigger/modal-trigger.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Modal\n * @namespace Modal\n * @description Modal\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport { type Space } from \"@gridui/style-utils/responsive\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalSpace = Space;\n\nexport type ModalProps = ComponentPropsWithRef<typeof Dialog.Root>;\n\nexport const Modal: FC<ModalProps> = (props: ModalProps) => {\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 Modal\n * @namespace ModalAction\n * @description Modal Action\n */\n\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type ModalActionProps = ButtonProps;\n\nexport const ModalAction: FC<ModalActionProps> = (props: ModalActionProps) => {\n const { className, ...restProps } = props;\n return (<Button\n {...restProps}\n className={cn(\"flex-1 w-auto rounded-none border-0 border-s border-solid border-border first:border-s-0 px-gridui-24 py-(--gridui-modal-padding) min-h-11\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalActions\n * @description Modal Actions\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalActionsProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalActions: FC<ModalActionsProps> = (props: ModalActionsProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"gridui-modal-actions flex min-w-0\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalBody\n * @description Modal Body\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalBodyProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalBody: FC<ModalBodyProps> = (props: ModalBodyProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"min-h-0 min-w-0 overflow-auto overscroll-contain p-gridui-24 wrap-anywhere\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalClose\n * @description Modal Close\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\n\nexport const ModalClose = Dialog.Close;\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalDescription\n * @description Modal Description\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalDescriptionProps = ComponentPropsWithRef<typeof Dialog.Description>;\n\nexport const ModalDescription: FC<ModalDescriptionProps> = (props: ModalDescriptionProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Dialog.Description\n {...restProps}\n className={cn(\"mt-gridui-8 mb-0 type-supporting text-muted\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalFooter\n * @description Modal Footer\n */\n\nimport type { ModalSectionProps } from \"../shared/types\";\nimport { cn } from \"@gridui/style-utils\";\nimport { spacingVariables } from \"@gridui/style-utils/responsive\";\nimport type { FC } from \"react\";\n\nexport type ModalFooterProps = ModalSectionProps;\n\nexport const ModalFooter: FC<ModalFooterProps> = (props: ModalFooterProps) => {\n const {\n paddingBlock = 24,\n style,\n className,\n ...restProps\n } = props;\n return (<div\n {...restProps}\n style={{\n ...spacingVariables(\"modal-space\", paddingBlock),\n ...style,\n }}\n className={cn(\"gridui-modal-section gridui-modal-footer max-h-[40dvh] overflow-y-auto shrink-0 border-t border-solid border-border\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalFooterNote\n * @description Modal Footer Note\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalFooterNoteProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalFooterNote: FC<ModalFooterNoteProps> = (props: ModalFooterNoteProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"min-w-0 px-gridui-24 py-(--gridui-modal-padding) type-supporting text-muted wrap-anywhere\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalHeader\n * @description Modal Header\n */\n\nimport type { ModalSectionProps } from \"../shared/types\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { spacingVariables } from \"@gridui/style-utils/responsive\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type ModalHeaderProps = ModalSectionProps & {\n readonly closeLabel: string;\n};\n\nexport const ModalHeader: FC<ModalHeaderProps> = (props: ModalHeaderProps) => {\n const {\n closeLabel,\n children,\n paddingBlock = 24,\n style,\n className,\n ...restProps\n } = props;\n return (<div\n {...restProps}\n style={{\n ...spacingVariables(\"modal-space\", paddingBlock),\n ...style,\n }}\n className={cn(\"gridui-modal-section gridui-modal-header relative z-(--gridui-z-content) overflow-visible shrink-0 grid grid-cols-[minmax(0,1fr)_auto] border-b border-solid border-border\", className)}\n >\n <div\n className=\"max-h-[40dvh] min-w-0 overflow-y-auto px-gridui-24 py-(--gridui-modal-padding) wrap-anywhere\"\n >\n {children}\n </div>\n <Dialog.Close\n asChild\n >\n <Button\n aria-label={closeLabel}\n variant=\"quiet\"\n className=\"self-stretch w-gridui-64 min-h-11 rounded-none border-0 border-s border-solid border-border [&:hover:not(:disabled)]:border-border p-0\"\n >\n <X\n aria-hidden=\"true\"\n />\n </Button>\n </Dialog.Close>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalPanel\n * @description Modal Panel\n */\n\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 ModalPanelProps = ComponentPropsWithRef<typeof Dialog.Content>;\n\nexport const ModalPanel: FC<ModalPanelProps> = (props: ModalPanelProps) => {\n const {\n className,\n forceMount,\n ...restProps\n } = props;\n const content = (<Dialog.Content\n {...restProps}\n forceMount={forceMount}\n className={cn(\"gridui-modal-panel fixed z-(--gridui-z-dialog) left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col w-[min(calc(100%-32px),var(--gridui-modal-width,37rem))] max-h-[calc(100dvh-32px)] min-w-0 border border-solid border-border bg-background text-foreground type-body\", className)}\n />);\n return (<>\n <Dialog.Portal>\n <Dialog.Overlay\n className=\"gridui-modal-overlay fixed inset-0 z-(--gridui-z-dialog-backdrop) bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]\"\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 Modal\n * @namespace ModalTitle\n * @description Modal Title\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalTitleProps = ComponentPropsWithRef<typeof Dialog.Title>;\n\nexport const ModalTitle: FC<ModalTitleProps> = (props: ModalTitleProps) => {\n const { className, ...restProps } = props;\n return (<Dialog.Title\n {...restProps}\n className={cn(\"m-0 type-heading\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalTrigger\n * @description Modal Trigger\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\n\nexport const ModalTrigger = Dialog.Trigger;\n"],
|
|
5
|
-
"mappings": ";AAOA,SAAS,aAAa,uBAAuB;AAC7C,OAA2B;AAC3B,YAAY,YAAY;AAYhB;AALD,IAAM,QAAwB,CAAC,UAAsB;AACxD,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;;;ACnBA,SAAS,cAAgC;AACzC,SAAS,UAAU;AAOP,gBAAAA,YAAA;AAFL,IAAM,cAAoC,CAAC,UAA4B;AAC1E,QAAM,EAAE,WAAW,GAAG,UAAU,IAAI;AACpC,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAW,GAAG,
|
|
6
|
-
"names": ["jsx", "cn", "jsx", "cn", "jsx", "Dialog", "cn", "Dialog", "jsx", "cn", "jsx", "cn", "jsx", "Button", "cn", "spacingVariables", "Dialog", "jsx", "cn", "Dialog", "jsx", "jsxs", "cn", "Dialog", "jsx", "Dialog"]
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Modal\n * @namespace Modal\n * @description Modal\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport { type Space } from \"@gridui/style-utils/responsive\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalSpace = Space;\n\nexport type ModalProps = ComponentPropsWithRef<typeof Dialog.Root>;\n\nexport const Modal: FC<ModalProps> = (props: ModalProps) => {\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 Modal\n * @namespace ModalAction\n * @description Modal Action\n */\n\nimport { Button, type ButtonProps } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type ModalActionProps = ButtonProps;\n\nexport const ModalAction: FC<ModalActionProps> = (props: ModalActionProps) => {\n const { className, ...restProps } = props;\n return (<Button\n {...restProps}\n className={cn(\"gridui-u-flex-1 gridui-u-w-auto gridui-u-rounded-none gridui-u-border-0 gridui-u-border-s gridui-u-border-solid gridui-u-border-border gridui-u-first:border-s-0 gridui-u-px-gridui-24 gridui-u-py-(--gridui-modal-padding) gridui-u-min-h-11\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalActions\n * @description Modal Actions\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalActionsProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalActions: FC<ModalActionsProps> = (props: ModalActionsProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"gridui-modal-actions gridui-u-flex gridui-u-min-w-0\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalBody\n * @description Modal Body\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalBodyProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalBody: FC<ModalBodyProps> = (props: ModalBodyProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"gridui-u-min-h-0 gridui-u-min-w-0 gridui-u-overflow-auto gridui-u-overscroll-contain gridui-u-p-gridui-24 gridui-u-wrap-anywhere\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalClose\n * @description Modal Close\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalCloseProps = ComponentPropsWithRef<typeof Dialog.Close>;\n\nexport const ModalClose: FC<ModalCloseProps> = (props: ModalCloseProps) => {\n return (<Dialog.Close\n {...props}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalDescription\n * @description Modal Description\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalDescriptionProps = ComponentPropsWithRef<typeof Dialog.Description>;\n\nexport const ModalDescription: FC<ModalDescriptionProps> = (props: ModalDescriptionProps) => {\n const {\n className,\n ...restProps\n } = props;\n return (<Dialog.Description\n {...restProps}\n className={cn(\"gridui-u-mt-gridui-8 gridui-u-mb-0 gridui-u-type-supporting gridui-u-text-muted\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalFooter\n * @description Modal Footer\n */\n\nimport type { ModalSectionProps } from \"../shared/types\";\nimport { cn } from \"@gridui/style-utils\";\nimport { spacingVariables } from \"@gridui/style-utils/responsive\";\nimport type { FC } from \"react\";\n\nexport type ModalFooterProps = ModalSectionProps;\n\nexport const ModalFooter: FC<ModalFooterProps> = (props: ModalFooterProps) => {\n const {\n paddingBlock = 24,\n style,\n className,\n ...restProps\n } = props;\n return (<div\n {...restProps}\n style={{\n ...spacingVariables(\"modal-space\", paddingBlock),\n ...style,\n }}\n className={cn(\"gridui-modal-section gridui-modal-footer gridui-u-max-h-[40dvh] gridui-u-overflow-y-auto gridui-u-shrink-0 gridui-u-border-t gridui-u-border-solid gridui-u-border-border\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalFooterNote\n * @description Modal Footer Note\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalFooterNoteProps = ComponentPropsWithRef<\"div\">;\n\nexport const ModalFooterNote: FC<ModalFooterNoteProps> = (props: ModalFooterNoteProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(\"gridui-u-min-w-0 gridui-u-px-gridui-24 gridui-u-py-(--gridui-modal-padding) gridui-u-type-supporting gridui-u-text-muted gridui-u-wrap-anywhere\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalHeader\n * @description Modal Header\n */\n\nimport type { ModalSectionProps } from \"../shared/types\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { spacingVariables } from \"@gridui/style-utils/responsive\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type ModalHeaderProps = ModalSectionProps & {\n readonly closeLabel: string;\n};\n\nexport const ModalHeader: FC<ModalHeaderProps> = (props: ModalHeaderProps) => {\n const {\n closeLabel,\n children,\n paddingBlock = 24,\n style,\n className,\n ...restProps\n } = props;\n return (<div\n {...restProps}\n style={{\n ...spacingVariables(\"modal-space\", paddingBlock),\n ...style,\n }}\n className={cn(\"gridui-modal-section gridui-modal-header gridui-u-relative gridui-u-z-(--gridui-z-content) gridui-u-overflow-visible gridui-u-shrink-0 gridui-u-grid gridui-u-grid-cols-[minmax(0,1fr)_auto] gridui-u-border-b gridui-u-border-solid gridui-u-border-border\", className)}\n >\n <div\n className=\"gridui-u-max-h-[40dvh] gridui-u-min-w-0 gridui-u-overflow-y-auto gridui-u-px-gridui-24 gridui-u-py-(--gridui-modal-padding) gridui-u-wrap-anywhere\"\n >\n {children}\n </div>\n <Dialog.Close\n asChild\n >\n <Button\n aria-label={closeLabel}\n variant=\"quiet\"\n className=\"gridui-u-self-stretch gridui-u-w-gridui-64 gridui-u-min-h-11 gridui-u-rounded-none gridui-u-border-0 gridui-u-border-s gridui-u-border-solid gridui-u-border-border gridui-u-[&:hover:not(:disabled)]:border-border gridui-u-p-0\"\n >\n <X\n aria-hidden=\"true\"\n />\n </Button>\n </Dialog.Close>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalPanel\n * @description Modal Panel\n */\n\nimport { overlayBackdropStyles, overlaySurfaceStyles, 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 ModalPanelProps = ComponentPropsWithRef<typeof Dialog.Content>;\n\nexport const ModalPanel: FC<ModalPanelProps> = (props: ModalPanelProps) => {\n const {\n className,\n forceMount,\n ...restProps\n } = props;\n const content = (<Dialog.Content\n {...restProps}\n forceMount={forceMount}\n className={cn(overlaySurfaceStyles({ kind: \"dialog\" }), \"gridui-modal-panel gridui-u-fixed gridui-u-z-(--gridui-z-dialog) gridui-u-left-1/2 gridui-u-top-1/2 gridui-u--translate-x-1/2 gridui-u--translate-y-1/2 gridui-u-flex gridui-u-flex-col gridui-u-w-[min(calc(100%-32px),var(--gridui-modal-width,37rem))] gridui-u-max-h-[calc(100dvh-32px)] gridui-u-min-w-0 gridui-u-type-body\", className)}\n />);\n return (<>\n <Dialog.Portal>\n <Dialog.Overlay\n className={cn(overlayBackdropStyles(), \"gridui-modal-overlay gridui-u-fixed gridui-u-inset-0 gridui-u-z-(--gridui-z-dialog-backdrop) gridui-u-bg-[light-dark(rgb(0_0_0/25%),rgb(0_0_0/60%))]\")}\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 Modal\n * @namespace ModalTitle\n * @description Modal Title\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalTitleProps = ComponentPropsWithRef<typeof Dialog.Title>;\n\nexport const ModalTitle: FC<ModalTitleProps> = (props: ModalTitleProps) => {\n const { className, ...restProps } = props;\n return (<Dialog.Title\n {...restProps}\n className={cn(\"gridui-u-m-0 gridui-u-type-heading\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Modal\n * @namespace ModalTrigger\n * @description Modal Trigger\n */\n\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ModalTriggerProps = ComponentPropsWithRef<typeof Dialog.Trigger>;\n\nexport const ModalTrigger: FC<ModalTriggerProps> = (props: ModalTriggerProps) => {\n return (<Dialog.Trigger\n {...props}\n />);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,aAAa,uBAAuB;AAC7C,OAA2B;AAC3B,YAAY,YAAY;AAYhB;AALD,IAAM,QAAwB,CAAC,UAAsB;AACxD,QAAM,QAAQ,gBAAgB,KAAK;AACnC,SAAQ;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACL,OAAO,MAAM;AAAA,MAEb;AAAA,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IAAP;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWF,IAAG,sCAAsC,SAAS;AAAA;AAAA,EACjE;AACJ;;;ACZA,YAAYG,aAAY;AAMZ,gBAAAC,aAAA;AADL,IAAM,eAAsC,CAAC,UAA6B;AAC7E,SAAQ,gBAAAA;AAAA,IAAQ;AAAA,IAAP;AAAA,MACJ,GAAG;AAAA;AAAA,EACR;AACJ;",
|
|
6
|
+
"names": ["jsx", "cn", "jsx", "cn", "jsx", "Dialog", "jsx", "cn", "Dialog", "jsx", "cn", "jsx", "cn", "jsx", "Button", "cn", "spacingVariables", "Dialog", "jsx", "cn", "Dialog", "jsx", "jsxs", "cn", "Dialog", "jsx", "Dialog", "jsx"]
|
|
7
7
|
}
|
|
@@ -5,4 +5,6 @@
|
|
|
5
5
|
* @description Modal Close
|
|
6
6
|
*/
|
|
7
7
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
8
|
-
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type ModalCloseProps = ComponentPropsWithRef<typeof Dialog.Close>;
|
|
10
|
+
export declare const ModalClose: FC<ModalCloseProps>;
|
|
@@ -5,4 +5,6 @@
|
|
|
5
5
|
* @description Modal Trigger
|
|
6
6
|
*/
|
|
7
7
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
8
|
-
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type ModalTriggerProps = ComponentPropsWithRef<typeof Dialog.Trigger>;
|
|
10
|
+
export declare const ModalTrigger: FC<ModalTriggerProps>;
|
package/dist/styles.css
CHANGED
|
@@ -7,200 +7,173 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
@layer utilities {
|
|
10
|
-
.fixed {
|
|
10
|
+
.gridui-u-fixed {
|
|
11
11
|
position: fixed;
|
|
12
12
|
}
|
|
13
|
-
.relative {
|
|
13
|
+
.gridui-u-relative {
|
|
14
14
|
position: relative;
|
|
15
15
|
}
|
|
16
|
-
.inset-0 {
|
|
16
|
+
.gridui-u-inset-0 {
|
|
17
17
|
inset: 0px;
|
|
18
18
|
}
|
|
19
|
-
.top-1\/2 {
|
|
19
|
+
.gridui-u-top-1\/2 {
|
|
20
20
|
top: calc(1 / 2 * 100%);
|
|
21
21
|
}
|
|
22
|
-
.left-1\/2 {
|
|
22
|
+
.gridui-u-left-1\/2 {
|
|
23
23
|
left: calc(1 / 2 * 100%);
|
|
24
24
|
}
|
|
25
|
-
.z-\(--gridui-z-content\) {
|
|
25
|
+
.gridui-u-z-\(--gridui-z-content\) {
|
|
26
26
|
z-index: var(--gridui-z-content);
|
|
27
27
|
}
|
|
28
|
-
.z-\(--gridui-z-dialog\) {
|
|
28
|
+
.gridui-u-z-\(--gridui-z-dialog\) {
|
|
29
29
|
z-index: var(--gridui-z-dialog);
|
|
30
30
|
}
|
|
31
|
-
.z-\(--gridui-z-dialog-backdrop\) {
|
|
31
|
+
.gridui-u-z-\(--gridui-z-dialog-backdrop\) {
|
|
32
32
|
z-index: var(--gridui-z-dialog-backdrop);
|
|
33
33
|
}
|
|
34
|
-
.m-0 {
|
|
34
|
+
.gridui-u-m-0 {
|
|
35
35
|
margin: 0px;
|
|
36
36
|
}
|
|
37
|
-
.mt-gridui-8 {
|
|
37
|
+
.gridui-u-mt-gridui-8 {
|
|
38
38
|
margin-top: var(--gridui-space-8);
|
|
39
39
|
}
|
|
40
|
-
.mb-0 {
|
|
40
|
+
.gridui-u-mb-0 {
|
|
41
41
|
margin-bottom: 0px;
|
|
42
42
|
}
|
|
43
|
-
.flex {
|
|
43
|
+
.gridui-u-flex {
|
|
44
44
|
display: flex;
|
|
45
45
|
}
|
|
46
|
-
.grid {
|
|
46
|
+
.gridui-u-grid {
|
|
47
47
|
display: grid;
|
|
48
48
|
}
|
|
49
|
-
.max-h-\[40dvh\] {
|
|
49
|
+
.gridui-u-max-h-\[40dvh\] {
|
|
50
50
|
max-height: 40dvh;
|
|
51
51
|
}
|
|
52
|
-
.max-h-\[calc\(100dvh-32px\)\] {
|
|
52
|
+
.gridui-u-max-h-\[calc\(100dvh-32px\)\] {
|
|
53
53
|
max-height: calc(100dvh - 32px);
|
|
54
54
|
}
|
|
55
|
-
.min-h-0 {
|
|
55
|
+
.gridui-u-min-h-0 {
|
|
56
56
|
min-height: 0px;
|
|
57
57
|
}
|
|
58
|
-
.min-h-11 {
|
|
58
|
+
.gridui-u-min-h-11 {
|
|
59
59
|
min-height: calc(var(--spacing) * 11);
|
|
60
60
|
}
|
|
61
|
-
.w-\[min\(calc\(100\%-32px\)\,var\(--gridui-modal-width\,37rem\)\)\] {
|
|
61
|
+
.gridui-u-w-\[min\(calc\(100\%-32px\)\,var\(--gridui-modal-width\,37rem\)\)\] {
|
|
62
62
|
width: min(calc(100% - 32px), var(--gridui-modal-width,37rem));
|
|
63
63
|
}
|
|
64
|
-
.w-auto {
|
|
64
|
+
.gridui-u-w-auto {
|
|
65
65
|
width: auto;
|
|
66
66
|
}
|
|
67
|
-
.w-gridui-64 {
|
|
67
|
+
.gridui-u-w-gridui-64 {
|
|
68
68
|
width: var(--gridui-space-64);
|
|
69
69
|
}
|
|
70
|
-
.min-w-0 {
|
|
70
|
+
.gridui-u-min-w-0 {
|
|
71
71
|
min-width: 0px;
|
|
72
72
|
}
|
|
73
|
-
.flex-1 {
|
|
73
|
+
.gridui-u-flex-1 {
|
|
74
74
|
flex: 1;
|
|
75
75
|
}
|
|
76
|
-
.shrink-0 {
|
|
76
|
+
.gridui-u-shrink-0 {
|
|
77
77
|
flex-shrink: 0;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
.gridui-u--translate-x-1\/2 {
|
|
80
80
|
--tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
|
|
81
81
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
.gridui-u--translate-y-1\/2 {
|
|
84
84
|
--tw-translate-y: calc(calc(1 / 2 * 100%) * -1);
|
|
85
85
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
86
86
|
}
|
|
87
|
-
.grid-cols-\[minmax\(0\,1fr\)_auto\] {
|
|
87
|
+
.gridui-u-grid-cols-\[minmax\(0\,1fr\)_auto\] {
|
|
88
88
|
grid-template-columns: minmax(0,1fr) auto;
|
|
89
89
|
}
|
|
90
|
-
.flex-col {
|
|
90
|
+
.gridui-u-flex-col {
|
|
91
91
|
flex-direction: column;
|
|
92
92
|
}
|
|
93
|
-
.self-stretch {
|
|
93
|
+
.gridui-u-self-stretch {
|
|
94
94
|
align-self: stretch;
|
|
95
95
|
}
|
|
96
|
-
.overflow-auto {
|
|
96
|
+
.gridui-u-overflow-auto {
|
|
97
97
|
overflow: auto;
|
|
98
98
|
}
|
|
99
|
-
.overflow-visible {
|
|
99
|
+
.gridui-u-overflow-visible {
|
|
100
100
|
overflow: visible;
|
|
101
101
|
}
|
|
102
|
-
.overflow-y-auto {
|
|
102
|
+
.gridui-u-overflow-y-auto {
|
|
103
103
|
overflow-y: auto;
|
|
104
104
|
}
|
|
105
|
-
.overscroll-contain {
|
|
105
|
+
.gridui-u-overscroll-contain {
|
|
106
106
|
overscroll-behavior: contain;
|
|
107
107
|
}
|
|
108
|
-
.rounded-none {
|
|
108
|
+
.gridui-u-rounded-none {
|
|
109
109
|
border-radius: 0;
|
|
110
110
|
}
|
|
111
|
-
.border {
|
|
112
|
-
border-style: var(--tw-border-style);
|
|
113
|
-
border-width: 1px;
|
|
114
|
-
}
|
|
115
|
-
.border-0 {
|
|
111
|
+
.gridui-u-border-0 {
|
|
116
112
|
border-style: var(--tw-border-style);
|
|
117
113
|
border-width: 0px;
|
|
118
114
|
}
|
|
119
|
-
.border-s {
|
|
115
|
+
.gridui-u-border-s {
|
|
120
116
|
border-inline-start-style: var(--tw-border-style);
|
|
121
117
|
border-inline-start-width: 1px;
|
|
122
118
|
}
|
|
123
|
-
.border-t {
|
|
119
|
+
.gridui-u-border-t {
|
|
124
120
|
border-top-style: var(--tw-border-style);
|
|
125
121
|
border-top-width: 1px;
|
|
126
122
|
}
|
|
127
|
-
.border-b {
|
|
123
|
+
.gridui-u-border-b {
|
|
128
124
|
border-bottom-style: var(--tw-border-style);
|
|
129
125
|
border-bottom-width: 1px;
|
|
130
126
|
}
|
|
131
|
-
.border-solid {
|
|
127
|
+
.gridui-u-border-solid {
|
|
132
128
|
--tw-border-style: solid;
|
|
133
129
|
border-style: solid;
|
|
134
130
|
}
|
|
135
|
-
.border-border {
|
|
131
|
+
.gridui-u-border-border {
|
|
136
132
|
border-color: var(--gridui-border);
|
|
137
133
|
}
|
|
138
|
-
.bg-\[light-dark\(rgb\(0_0_0\/25\%\)\,rgb\(0_0_0\/60\%\)\)\] {
|
|
134
|
+
.gridui-u-bg-\[light-dark\(rgb\(0_0_0\/25\%\)\,rgb\(0_0_0\/60\%\)\)\] {
|
|
139
135
|
background-color: light-dark(rgb(0 0 0/25%),rgb(0 0 0/60%));
|
|
140
136
|
}
|
|
141
|
-
.
|
|
142
|
-
background-color: var(--gridui-background);
|
|
143
|
-
}
|
|
144
|
-
.p-0 {
|
|
137
|
+
.gridui-u-p-0 {
|
|
145
138
|
padding: 0px;
|
|
146
139
|
}
|
|
147
|
-
.p-gridui-24 {
|
|
140
|
+
.gridui-u-p-gridui-24 {
|
|
148
141
|
padding: var(--gridui-space-24);
|
|
149
142
|
}
|
|
150
|
-
.px-gridui-24 {
|
|
143
|
+
.gridui-u-px-gridui-24 {
|
|
151
144
|
padding-inline: var(--gridui-space-24);
|
|
152
145
|
}
|
|
153
|
-
.py-\(--gridui-modal-padding\) {
|
|
146
|
+
.gridui-u-py-\(--gridui-modal-padding\) {
|
|
154
147
|
padding-block: var(--gridui-modal-padding);
|
|
155
148
|
}
|
|
156
|
-
.type-heading {
|
|
149
|
+
.gridui-u-type-heading {
|
|
157
150
|
font: var(--gridui-type-heading);
|
|
158
151
|
letter-spacing: normal;
|
|
159
152
|
text-wrap: balance;
|
|
160
153
|
}
|
|
161
|
-
.type-body {
|
|
154
|
+
.gridui-u-type-body {
|
|
162
155
|
font: var(--gridui-type-body);
|
|
163
156
|
letter-spacing: normal;
|
|
164
157
|
}
|
|
165
|
-
.type-supporting {
|
|
158
|
+
.gridui-u-type-supporting {
|
|
166
159
|
font: var(--gridui-type-supporting);
|
|
167
160
|
letter-spacing: normal;
|
|
168
161
|
}
|
|
169
|
-
.wrap-anywhere {
|
|
162
|
+
.gridui-u-wrap-anywhere {
|
|
170
163
|
overflow-wrap: anywhere;
|
|
171
164
|
}
|
|
172
|
-
.text-
|
|
173
|
-
color: var(--gridui-foreground);
|
|
174
|
-
}
|
|
175
|
-
.text-muted {
|
|
165
|
+
.gridui-u-text-muted {
|
|
176
166
|
color: var(--gridui-muted);
|
|
177
167
|
}
|
|
178
|
-
.first\:border-s-0:first-child {
|
|
168
|
+
.gridui-u-first\:border-s-0:first-child {
|
|
179
169
|
border-inline-start-style: var(--tw-border-style);
|
|
180
170
|
border-inline-start-width: 0px;
|
|
181
171
|
}
|
|
182
|
-
|
|
172
|
+
.gridui-u-\[\&\:hover\:not\(\:disabled\)\]\:border-border:hover:not(:disabled) {
|
|
183
173
|
border-color: var(--gridui-border);
|
|
184
174
|
}
|
|
185
175
|
}
|
|
186
176
|
@layer components {
|
|
187
|
-
.gridui-modal-panel[data-state="open"] {
|
|
188
|
-
animation: gridui-surface-enter var(--gridui-motion-duration-normal) var(--gridui-motion-ease-out);
|
|
189
|
-
}
|
|
190
|
-
.gridui-modal-panel[data-state="closed"] {
|
|
191
|
-
animation: gridui-surface-exit var(--gridui-motion-duration-quick) var(--gridui-motion-ease-in);
|
|
192
|
-
}
|
|
193
|
-
.gridui-modal-overlay[data-state="open"] {
|
|
194
|
-
animation: gridui-fade-enter var(--gridui-motion-duration-normal) var(--gridui-motion-ease-out);
|
|
195
|
-
}
|
|
196
|
-
.gridui-modal-overlay[data-state="closed"] {
|
|
197
|
-
animation: gridui-fade-exit var(--gridui-motion-duration-quick) var(--gridui-motion-ease-in);
|
|
198
|
-
}
|
|
199
|
-
@media (prefers-reduced-motion: reduce) {
|
|
200
|
-
.gridui-modal-panel[data-state], .gridui-modal-overlay[data-state] {
|
|
201
|
-
animation: none;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
177
|
.gridui-modal-section {
|
|
205
178
|
--gridui-modal-padding: var(--gridui-modal-space);
|
|
206
179
|
}
|
|
@@ -228,13 +201,13 @@
|
|
|
228
201
|
flex: 0 1 auto;
|
|
229
202
|
}
|
|
230
203
|
.gridui-modal-footer > :not(.gridui-modal-actions) + .gridui-modal-actions {
|
|
231
|
-
border-inline-start: 1px solid var(--
|
|
204
|
+
border-inline-start: 1px solid var(--gridui-border);
|
|
232
205
|
}
|
|
233
206
|
}
|
|
234
207
|
@media (max-width: 39.999rem) {
|
|
235
208
|
.gridui-modal-footer > :not(.gridui-modal-actions) + .gridui-modal-actions {
|
|
236
209
|
flex-basis: 100%;
|
|
237
|
-
border-top: 1px solid var(--
|
|
210
|
+
border-top: 1px solid var(--gridui-border);
|
|
238
211
|
}
|
|
239
212
|
}
|
|
240
213
|
@media (min-width: 64rem) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/modal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "GridUI React modal",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -26,18 +26,19 @@
|
|
|
26
26
|
"react-dom": "^19.2.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@gridui/button": "^2.
|
|
30
|
-
"@gridui/overlay": "^1.
|
|
31
|
-
"@gridui/style-utils": "^2.1.
|
|
32
|
-
"@gridui/theme": "^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
|
-
"lucide-react": "1.
|
|
34
|
+
"lucide-react": "1.65.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@gridui-internal/configuration": "0.0.0",
|
|
37
|
+
"@gridui-internal/configuration": "0.0.0-internal",
|
|
38
38
|
"@jest/globals": "30.5.2",
|
|
39
|
+
"@storybook/react-vite": "10.6.5",
|
|
39
40
|
"@types/jest": "30.0.0",
|
|
40
|
-
"@types/node": "26.6.
|
|
41
|
+
"@types/node": "26.6.6",
|
|
41
42
|
"@types/react": "19.3.0",
|
|
42
43
|
"@types/react-dom": "19.3.0",
|
|
43
44
|
"jest": "30.5.2",
|