@gridui/grid 2.1.4 → 2.3.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 +26 -17
- package/dist/{primitives/container → container}/container.d.ts +2 -2
- package/dist/{primitives/container → container}/style.d.ts +2 -2
- package/dist/dashboard-frame/dashboard-frame.d.ts +21 -0
- package/dist/dashboard-frame/style.d.ts +12 -0
- package/dist/frame-boundary/frame-boundary.d.ts +15 -0
- package/dist/frame-boundary/style.d.ts +9 -0
- package/dist/frame-footer/frame-footer.d.ts +20 -0
- package/dist/{frame/chrome → frame-footer}/style.d.ts +1 -2
- package/dist/frame-header/frame-header.d.ts +15 -0
- package/dist/frame-rail/frame-rail.d.ts +11 -0
- package/dist/{frame/rail → frame-rail}/style.d.ts +1 -1
- package/dist/{frame/rail/rail.d.ts → frame-rail-group/frame-rail-group.d.ts} +3 -7
- package/dist/frame-region/frame-region.d.ts +12 -0
- package/dist/frame-region-row/frame-region-row.d.ts +12 -0
- package/dist/{frame/section.d.ts → frame-section/frame-section.d.ts} +7 -7
- package/dist/frame-sections/frame-sections.d.ts +9 -0
- package/dist/{frame/texture/texture.d.ts → frame-texture/frame-texture.d.ts} +3 -3
- package/dist/grid/grid.d.ts +37 -0
- package/dist/grid/responsive.d.ts +9 -0
- package/dist/{primitives/grid → grid}/style.d.ts +1 -2
- package/dist/{primitives/grid → grid}/tracks.d.ts +3 -2
- package/dist/{primitives/grid → grid-item}/grid-item.d.ts +4 -4
- package/dist/grid-item/responsive.d.ts +8 -0
- package/dist/grid-item/style.d.ts +7 -0
- package/dist/index.d.ts +44 -2
- package/dist/index.js +535 -310
- package/dist/index.js.map +4 -4
- package/dist/page-frame/page-frame.d.ts +18 -0
- package/dist/{frame/page → page-frame}/style.d.ts +2 -2
- package/dist/{primitives/row → row}/row.d.ts +2 -2
- package/dist/{primitives/row → row}/style.d.ts +1 -1
- package/dist/shared/chrome-style.d.ts +7 -0
- package/dist/shared/chrome.d.ts +16 -0
- package/dist/{frame/decoration → shared}/decoration.d.ts +3 -2
- package/dist/shared/frame-style.d.ts +11 -0
- package/dist/shared/responsive-types.d.ts +8 -0
- package/dist/shared/texture-types.d.ts +7 -0
- package/dist/{primitives → shared}/types.d.ts +1 -1
- package/dist/{primitives/split → split}/split.d.ts +4 -3
- package/dist/{primitives/stack → stack}/stack.d.ts +3 -3
- package/dist/{primitives/stack → stack}/style.d.ts +1 -1
- package/dist/styles.css +246 -79
- package/package.json +5 -10
- package/dist/frame/boundary/boundary.d.ts +0 -12
- package/dist/frame/chrome/chrome.d.ts +0 -29
- package/dist/frame/export.d.ts +0 -19
- package/dist/frame/page/page.d.ts +0 -20
- package/dist/frame/style.d.ts +0 -11
- package/dist/primitives/export.d.ts +0 -19
- package/dist/primitives/grid/grid.d.ts +0 -21
- package/dist/primitives/responsive.d.ts +0 -11
package/dist/index.js
CHANGED
|
@@ -1,72 +1,195 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/container/style.ts
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
var containerVariants = cva("gridui-container", {
|
|
4
|
+
variants: {
|
|
5
|
+
width: {
|
|
6
|
+
narrow: "gridui-container-narrow",
|
|
7
|
+
standard: "gridui-container-standard",
|
|
8
|
+
wide: "gridui-container-wide"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
defaultVariants: { width: "standard" }
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// src/container/container.tsx
|
|
2
15
|
import { cn } from "@gridui/style-utils";
|
|
3
16
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
var
|
|
5
|
-
const {
|
|
6
|
-
return
|
|
17
|
+
var Container = (props) => {
|
|
18
|
+
const { width = "standard", className, ...restProps } = props;
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
7
20
|
"div",
|
|
8
21
|
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
(boundary === "band" || boundary === "stripe") && "gridui-frame-divider",
|
|
12
|
-
boundary === "stripe" && "gridui-frame-stripe",
|
|
13
|
-
boundary === "space" && "gridui-frame-space"
|
|
14
|
-
),
|
|
15
|
-
"aria-hidden": "true"
|
|
22
|
+
...restProps,
|
|
23
|
+
className: cn(containerVariants({ width }), className)
|
|
16
24
|
}
|
|
17
25
|
);
|
|
18
26
|
};
|
|
19
27
|
|
|
20
|
-
// src/
|
|
21
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
28
|
+
// src/shared/decoration.tsx
|
|
29
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
22
30
|
var resolveFrameDecoration = (boundary, decoration) => {
|
|
23
31
|
return decoration ?? (boundary === "band" ? "nodes" : "none");
|
|
24
32
|
};
|
|
25
33
|
var FrameDecoration = (props) => {
|
|
26
|
-
const { decoration } = props;
|
|
27
|
-
|
|
34
|
+
const { decoration, side } = props;
|
|
35
|
+
if (decoration === "none") {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
if (!side) {
|
|
39
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
/* @__PURE__ */ jsx2(
|
|
41
|
+
FrameDecoration,
|
|
42
|
+
{
|
|
43
|
+
decoration,
|
|
44
|
+
side: "start"
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ jsx2(
|
|
48
|
+
FrameDecoration,
|
|
49
|
+
{
|
|
50
|
+
decoration,
|
|
51
|
+
side: "end"
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ jsx2(
|
|
28
57
|
"div",
|
|
29
58
|
{
|
|
30
59
|
className: "gridui-frame-decoration",
|
|
31
60
|
"data-decoration": decoration,
|
|
61
|
+
"data-side": side,
|
|
32
62
|
"aria-hidden": "true",
|
|
33
63
|
inert: true
|
|
34
64
|
}
|
|
35
65
|
);
|
|
36
66
|
};
|
|
37
67
|
|
|
38
|
-
// src/frame/style.ts
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
var frameToneStyles = cva("", {
|
|
68
|
+
// src/dashboard-frame/style.ts
|
|
69
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
70
|
+
var dashboardFrameVariants = cva2("gridui-dashboard-frame", {
|
|
42
71
|
variants: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
72
|
+
startSize: {
|
|
73
|
+
none: "[--gridui-dashboard-start:0px] [--gridui-dashboard-start-minimum:0px]",
|
|
74
|
+
small: "[--gridui-dashboard-start:var(--gridui-space-8)]",
|
|
75
|
+
medium: "[--gridui-dashboard-start:var(--gridui-space-16)]",
|
|
76
|
+
large: "[--gridui-dashboard-start:var(--gridui-space-24)]"
|
|
77
|
+
},
|
|
78
|
+
endSize: {
|
|
79
|
+
none: "[--gridui-dashboard-end:0px] [--gridui-dashboard-end-minimum:0px]",
|
|
80
|
+
small: "[--gridui-dashboard-end:var(--gridui-space-8)]",
|
|
81
|
+
medium: "[--gridui-dashboard-end:var(--gridui-space-16)]",
|
|
82
|
+
large: "[--gridui-dashboard-end:var(--gridui-space-24)]"
|
|
83
|
+
},
|
|
84
|
+
compactStartSize: {
|
|
85
|
+
none: "[--gridui-dashboard-compact-start:0px] [--gridui-dashboard-compact-start-minimum:0px]",
|
|
86
|
+
small: "[--gridui-dashboard-compact-start:var(--gridui-space-8)]",
|
|
87
|
+
medium: "[--gridui-dashboard-compact-start:var(--gridui-space-16)]",
|
|
88
|
+
large: "[--gridui-dashboard-compact-start:var(--gridui-space-24)]"
|
|
89
|
+
},
|
|
90
|
+
compactEndSize: {
|
|
91
|
+
none: "[--gridui-dashboard-compact-end:0px] [--gridui-dashboard-compact-end-minimum:0px]",
|
|
92
|
+
small: "[--gridui-dashboard-compact-end:var(--gridui-space-8)]",
|
|
93
|
+
medium: "[--gridui-dashboard-compact-end:var(--gridui-space-16)]",
|
|
94
|
+
large: "[--gridui-dashboard-compact-end:var(--gridui-space-24)]"
|
|
48
95
|
}
|
|
96
|
+
},
|
|
97
|
+
defaultVariants: {
|
|
98
|
+
startSize: "medium",
|
|
99
|
+
endSize: "medium",
|
|
100
|
+
compactStartSize: "small",
|
|
101
|
+
compactEndSize: "small"
|
|
49
102
|
}
|
|
50
103
|
});
|
|
51
|
-
var frameContentStyles = cva(cn2(
|
|
52
|
-
"gridui-frame-content",
|
|
53
|
-
"border-x border-solid border-border wrap-anywhere"
|
|
54
|
-
));
|
|
55
104
|
|
|
56
|
-
// src/frame/
|
|
105
|
+
// src/dashboard-frame/dashboard-frame.tsx
|
|
106
|
+
import { cn as cn2 } from "@gridui/style-utils";
|
|
107
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
108
|
+
var DashboardFrame = (props) => {
|
|
109
|
+
const {
|
|
110
|
+
startSize,
|
|
111
|
+
endSize,
|
|
112
|
+
compactStartSize,
|
|
113
|
+
compactEndSize,
|
|
114
|
+
decoration = "none",
|
|
115
|
+
startDecoration = decoration,
|
|
116
|
+
endDecoration = decoration,
|
|
117
|
+
children,
|
|
118
|
+
className,
|
|
119
|
+
...restProps
|
|
120
|
+
} = props;
|
|
121
|
+
return /* @__PURE__ */ jsx3(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
...restProps,
|
|
125
|
+
className: cn2(dashboardFrameVariants({
|
|
126
|
+
startSize,
|
|
127
|
+
endSize,
|
|
128
|
+
compactStartSize,
|
|
129
|
+
compactEndSize
|
|
130
|
+
}), className),
|
|
131
|
+
children: /* @__PURE__ */ jsxs2(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
className: "gridui-dashboard-frame-body",
|
|
135
|
+
children: [
|
|
136
|
+
children,
|
|
137
|
+
/* @__PURE__ */ jsx3(
|
|
138
|
+
FrameDecoration,
|
|
139
|
+
{
|
|
140
|
+
decoration: startDecoration,
|
|
141
|
+
side: "start"
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ jsx3(
|
|
145
|
+
FrameDecoration,
|
|
146
|
+
{
|
|
147
|
+
decoration: endDecoration,
|
|
148
|
+
side: "end"
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// src/frame-boundary/style.ts
|
|
159
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
160
|
+
var frameBoundaryStyles = cva3("gridui-frame-boundary", {
|
|
161
|
+
variants: {
|
|
162
|
+
boundary: {
|
|
163
|
+
none: "",
|
|
164
|
+
line: "",
|
|
165
|
+
band: "gridui-frame-divider",
|
|
166
|
+
stripe: "gridui-frame-divider gridui-frame-stripe",
|
|
167
|
+
space: "gridui-frame-space"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
defaultVariants: { boundary: "line" }
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// src/frame-boundary/frame-boundary.tsx
|
|
57
174
|
import { cn as cn3 } from "@gridui/style-utils";
|
|
58
|
-
import {
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
175
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
176
|
+
var FrameBoundary = (props) => {
|
|
177
|
+
const { boundary = "line", extent = "content", className, ...restProps } = props;
|
|
178
|
+
return boundary === "none" ? null : /* @__PURE__ */ jsx4(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
...restProps,
|
|
182
|
+
className: cn3(frameBoundaryStyles({ boundary }), className),
|
|
183
|
+
"data-boundary": boundary,
|
|
184
|
+
"data-boundary-extent": extent,
|
|
185
|
+
"aria-hidden": "true",
|
|
186
|
+
inert: true
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
};
|
|
65
190
|
|
|
66
|
-
// src/
|
|
67
|
-
import { cn as cn4 } from "@gridui/style-utils";
|
|
191
|
+
// src/shared/chrome.ts
|
|
68
192
|
import { resolveResponsive, spaceValue } from "@gridui/style-utils/responsive";
|
|
69
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
70
193
|
var chromeStyle = (padding) => {
|
|
71
194
|
const values = resolveResponsive(padding);
|
|
72
195
|
return {
|
|
@@ -75,60 +198,64 @@ var chromeStyle = (padding) => {
|
|
|
75
198
|
"--gridui-chrome-padding-lg": spaceValue(values.lg)
|
|
76
199
|
};
|
|
77
200
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
className: cn4(frameContentStyles(), frameChromeStyles()),
|
|
92
|
-
"data-justify": justify,
|
|
93
|
-
style: {
|
|
94
|
-
...chromeStyle(padding),
|
|
95
|
-
flexWrap: wrap ? "wrap" : "nowrap",
|
|
96
|
-
gap: spaceValue(gap)
|
|
97
|
-
},
|
|
98
|
-
children
|
|
99
|
-
}
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
);
|
|
201
|
+
|
|
202
|
+
// src/shared/chrome-style.ts
|
|
203
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
204
|
+
var frameChromeStyles = cva4("gridui-frame-chrome");
|
|
205
|
+
|
|
206
|
+
// src/shared/frame-style.ts
|
|
207
|
+
import { cn as cn4 } from "@gridui/style-utils";
|
|
208
|
+
import { paletteClass } from "@gridui/theme";
|
|
209
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
210
|
+
var frameToneStyles = (options = {}) => {
|
|
211
|
+
const { tone = "neutral" } = options;
|
|
212
|
+
return tone === "neutral" ? "" : `gridui-frame-${tone} ${paletteClass(tone)}`;
|
|
103
213
|
};
|
|
214
|
+
var frameContentStyles = cva5(cn4(
|
|
215
|
+
"gridui-frame-content",
|
|
216
|
+
"border-x border-solid border-border wrap-anywhere"
|
|
217
|
+
));
|
|
218
|
+
|
|
219
|
+
// src/frame-footer/style.ts
|
|
220
|
+
import { cn as cn5 } from "@gridui/style-utils";
|
|
221
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
222
|
+
var frameSignatureStyles = cva6(cn5(
|
|
223
|
+
"gridui-frame-signature flex min-w-0 items-center justify-center gap-gridui-24 py-gridui-32 px-gridui-24 overflow-hidden border-t border-solid border-border bg-transparent",
|
|
224
|
+
"[&>svg]:h-auto [&>svg]:opacity-30 [&>span]:font-display [&>span]:leading-none [&>span]:text-transparent"
|
|
225
|
+
));
|
|
226
|
+
var frameSignatureCroppedStyles = cva6("gridui-frame-signature-cropped block pb-0 @container [&>span]:block [&>span]:text-center [&>span]:whitespace-nowrap");
|
|
227
|
+
|
|
228
|
+
// src/frame-footer/frame-footer.tsx
|
|
229
|
+
import { cn as cn6 } from "@gridui/style-utils";
|
|
230
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
104
231
|
var FrameFooter = (props) => {
|
|
105
232
|
const { padding = {
|
|
106
233
|
base: 16,
|
|
107
234
|
md: 24
|
|
108
235
|
}, contentLayout = "flex", tone = "neutral", boundary = "line", decoration, signature, signatureAppearance = "standard", className, children, ...restProps } = props;
|
|
109
|
-
return /* @__PURE__ */
|
|
236
|
+
return /* @__PURE__ */ jsxs3(
|
|
110
237
|
"footer",
|
|
111
238
|
{
|
|
112
239
|
...restProps,
|
|
113
|
-
className:
|
|
240
|
+
className: cn6("gridui-container gridui-frame-footer", frameToneStyles({
|
|
114
241
|
tone
|
|
115
242
|
}), className),
|
|
116
243
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ jsx5(
|
|
118
245
|
FrameBoundary,
|
|
119
246
|
{
|
|
120
247
|
boundary
|
|
121
248
|
}
|
|
122
249
|
),
|
|
123
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ jsxs3(
|
|
124
251
|
"div",
|
|
125
252
|
{
|
|
126
|
-
className:
|
|
253
|
+
className: cn6(frameContentStyles(), frameChromeStyles(), "gridui-frame-surface"),
|
|
127
254
|
"data-content-layout": contentLayout,
|
|
128
255
|
style: chromeStyle(padding),
|
|
129
256
|
children: [
|
|
130
257
|
children,
|
|
131
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ jsx5(
|
|
132
259
|
FrameDecoration,
|
|
133
260
|
{
|
|
134
261
|
decoration: resolveFrameDecoration(boundary, decoration)
|
|
@@ -137,10 +264,10 @@ var FrameFooter = (props) => {
|
|
|
137
264
|
]
|
|
138
265
|
}
|
|
139
266
|
),
|
|
140
|
-
signature ? /* @__PURE__ */
|
|
267
|
+
signature ? /* @__PURE__ */ jsx5(
|
|
141
268
|
"div",
|
|
142
269
|
{
|
|
143
|
-
className:
|
|
270
|
+
className: cn6(frameContentStyles(), frameSignatureStyles(), signatureAppearance === "cropped" && frameSignatureCroppedStyles()),
|
|
144
271
|
"aria-hidden": "true",
|
|
145
272
|
inert: true,
|
|
146
273
|
children: signature
|
|
@@ -151,16 +278,46 @@ var FrameFooter = (props) => {
|
|
|
151
278
|
);
|
|
152
279
|
};
|
|
153
280
|
|
|
154
|
-
// src/frame/
|
|
155
|
-
import {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
var
|
|
281
|
+
// src/frame-header/frame-header.tsx
|
|
282
|
+
import { cn as cn7 } from "@gridui/style-utils";
|
|
283
|
+
import { spaceValue as spaceValue2 } from "@gridui/style-utils/responsive";
|
|
284
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
285
|
+
var FrameHeader = (props) => {
|
|
286
|
+
const { padding = {
|
|
287
|
+
base: 16,
|
|
288
|
+
md: 24
|
|
289
|
+
}, wrap = true, gap = 16, justify = "between", className, children, ...restProps } = props;
|
|
290
|
+
return /* @__PURE__ */ jsx6(
|
|
291
|
+
"header",
|
|
292
|
+
{
|
|
293
|
+
...restProps,
|
|
294
|
+
className: cn7("gridui-container gridui-frame-header", className),
|
|
295
|
+
children: /* @__PURE__ */ jsx6(
|
|
296
|
+
"div",
|
|
297
|
+
{
|
|
298
|
+
className: cn7(frameContentStyles(), frameChromeStyles()),
|
|
299
|
+
"data-justify": justify,
|
|
300
|
+
style: {
|
|
301
|
+
...chromeStyle(padding),
|
|
302
|
+
flexWrap: wrap ? "wrap" : "nowrap",
|
|
303
|
+
gap: spaceValue2(gap)
|
|
304
|
+
},
|
|
305
|
+
children
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
};
|
|
159
311
|
|
|
160
|
-
// src/frame
|
|
161
|
-
import {
|
|
162
|
-
|
|
163
|
-
|
|
312
|
+
// src/frame-rail/style.ts
|
|
313
|
+
import { cva as cva7 } from "class-variance-authority";
|
|
314
|
+
var frameRailStyles = cva7("gridui-frame-rail flex h-full box-border flex-col py-gridui-24 text-muted");
|
|
315
|
+
var frameRailContentStyles = cva7("gridui-frame-rail-content relative z-(--gridui-z-interaction) min-w-0 type-eyebrow bg-inherit");
|
|
316
|
+
var frameRailStickyBottomStyles = cva7("gridui-frame-rail-sticky-bottom justify-end [&>.gridui-frame-rail-content]:sticky");
|
|
317
|
+
|
|
318
|
+
// src/frame-rail/frame-rail.tsx
|
|
319
|
+
import { cn as cn8 } from "@gridui/style-utils";
|
|
320
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
164
321
|
var FrameRail = (props) => {
|
|
165
322
|
const {
|
|
166
323
|
placement = "start",
|
|
@@ -168,12 +325,12 @@ var FrameRail = (props) => {
|
|
|
168
325
|
className,
|
|
169
326
|
...restProps
|
|
170
327
|
} = props;
|
|
171
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ jsx7(
|
|
172
329
|
"div",
|
|
173
330
|
{
|
|
174
331
|
...restProps,
|
|
175
|
-
className:
|
|
176
|
-
children: /* @__PURE__ */
|
|
332
|
+
className: cn8(frameRailStyles(), placement === "sticky-bottom" && frameRailStickyBottomStyles(), className),
|
|
333
|
+
children: /* @__PURE__ */ jsx7(
|
|
177
334
|
"div",
|
|
178
335
|
{
|
|
179
336
|
className: frameRailContentStyles(),
|
|
@@ -183,6 +340,11 @@ var FrameRail = (props) => {
|
|
|
183
340
|
}
|
|
184
341
|
);
|
|
185
342
|
};
|
|
343
|
+
|
|
344
|
+
// src/frame-rail-group/frame-rail-group.tsx
|
|
345
|
+
import { cn as cn9 } from "@gridui/style-utils";
|
|
346
|
+
import { resolveResponsive as resolveResponsive2, spaceValue as spaceValue3 } from "@gridui/style-utils/responsive";
|
|
347
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
186
348
|
var FrameRailGroup = (props) => {
|
|
187
349
|
const { rail, railWidth = {
|
|
188
350
|
base: 0,
|
|
@@ -191,29 +353,29 @@ var FrameRailGroup = (props) => {
|
|
|
191
353
|
const hasRail = rail !== void 0 && rail !== null && rail !== false;
|
|
192
354
|
const width = resolveResponsive2(hasRail ? railWidth : 0);
|
|
193
355
|
const layoutStyle = {
|
|
194
|
-
"--gridui-rail-width-base":
|
|
195
|
-
"--gridui-rail-width-md":
|
|
196
|
-
"--gridui-rail-width-lg":
|
|
356
|
+
"--gridui-rail-width-base": spaceValue3(width.base),
|
|
357
|
+
"--gridui-rail-width-md": spaceValue3(width.md),
|
|
358
|
+
"--gridui-rail-width-lg": spaceValue3(width.lg),
|
|
197
359
|
"--gridui-rail-display-base": width.base === 0 ? "none" : "block",
|
|
198
360
|
"--gridui-rail-display-md": width.md === 0 ? "none" : "block",
|
|
199
361
|
"--gridui-rail-display-lg": width.lg === 0 ? "none" : "block",
|
|
200
362
|
...style
|
|
201
363
|
};
|
|
202
|
-
return /* @__PURE__ */
|
|
364
|
+
return /* @__PURE__ */ jsxs4(
|
|
203
365
|
"div",
|
|
204
366
|
{
|
|
205
367
|
...restProps,
|
|
206
|
-
className:
|
|
368
|
+
className: cn9("gridui-frame-rail-group", className),
|
|
207
369
|
style: layoutStyle,
|
|
208
370
|
children: [
|
|
209
|
-
hasRail ? /* @__PURE__ */
|
|
371
|
+
hasRail ? /* @__PURE__ */ jsx8(
|
|
210
372
|
"div",
|
|
211
373
|
{
|
|
212
374
|
className: "gridui-frame-rail-track",
|
|
213
375
|
children: rail
|
|
214
376
|
}
|
|
215
377
|
) : null,
|
|
216
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ jsx8(
|
|
217
379
|
"div",
|
|
218
380
|
{
|
|
219
381
|
className: "gridui-frame-rail-body",
|
|
@@ -225,111 +387,48 @@ var FrameRailGroup = (props) => {
|
|
|
225
387
|
);
|
|
226
388
|
};
|
|
227
389
|
|
|
228
|
-
// src/frame/
|
|
229
|
-
import {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
},
|
|
238
|
-
defaultVariants: { width: "standard" }
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
// src/frame/page/page.tsx
|
|
242
|
-
import { cn as cn6 } from "@gridui/style-utils";
|
|
243
|
-
import { spacingVariables } from "@gridui/style-utils/responsive";
|
|
244
|
-
import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
245
|
-
var FrameSections = (props) => {
|
|
246
|
-
const { className, ...restProps } = props;
|
|
247
|
-
return /* @__PURE__ */ jsx5(
|
|
248
|
-
"div",
|
|
390
|
+
// src/frame-region/frame-region.tsx
|
|
391
|
+
import { cn as cn10 } from "@gridui/style-utils";
|
|
392
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
393
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
394
|
+
var FrameRegion = (props) => {
|
|
395
|
+
const { asChild = false, edge = "none", className, ...restProps } = props;
|
|
396
|
+
const Component = asChild ? Slot : "div";
|
|
397
|
+
return /* @__PURE__ */ jsx9(
|
|
398
|
+
Component,
|
|
249
399
|
{
|
|
250
400
|
...restProps,
|
|
251
|
-
className:
|
|
401
|
+
className: cn10("gridui-frame-region", className),
|
|
402
|
+
"data-frame-edge": edge
|
|
252
403
|
}
|
|
253
404
|
);
|
|
254
405
|
};
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
className,
|
|
266
|
-
...restProps
|
|
267
|
-
} = props;
|
|
268
|
-
const railOptions = railWidth === void 0 ? {} : { railWidth };
|
|
269
|
-
const content = /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
270
|
-
/* @__PURE__ */ jsx5(FrameSections, { children }),
|
|
271
|
-
/* @__PURE__ */ jsx5(
|
|
272
|
-
"div",
|
|
273
|
-
{
|
|
274
|
-
className: "gridui-container gridui-frame-fill",
|
|
275
|
-
"aria-hidden": "true",
|
|
276
|
-
children: /* @__PURE__ */ jsx5(
|
|
277
|
-
"div",
|
|
278
|
-
{
|
|
279
|
-
className: cn6(frameContentStyles())
|
|
280
|
-
}
|
|
281
|
-
)
|
|
282
|
-
}
|
|
283
|
-
)
|
|
284
|
-
] });
|
|
285
|
-
return /* @__PURE__ */ jsxs3(
|
|
286
|
-
FrameRailGroup,
|
|
406
|
+
|
|
407
|
+
// src/frame-region-row/frame-region-row.tsx
|
|
408
|
+
import { cn as cn11 } from "@gridui/style-utils";
|
|
409
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
410
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
411
|
+
var FrameRegionRow = (props) => {
|
|
412
|
+
const { asChild = false, contentInset = 0, className, style, ...restProps } = props;
|
|
413
|
+
const Component = asChild ? Slot2 : "div";
|
|
414
|
+
return /* @__PURE__ */ jsx10(
|
|
415
|
+
Component,
|
|
287
416
|
{
|
|
288
417
|
...restProps,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
"div",
|
|
295
|
-
{
|
|
296
|
-
className: "gridui-frame-page-header",
|
|
297
|
-
children: header
|
|
298
|
-
}
|
|
299
|
-
) : null,
|
|
300
|
-
/* @__PURE__ */ jsx5(
|
|
301
|
-
"main",
|
|
302
|
-
{
|
|
303
|
-
className: "gridui-frame-main",
|
|
304
|
-
style: mainGutterStart === void 0 ? void 0 : spacingVariables("main-gutter-start", mainGutterStart),
|
|
305
|
-
children: railScope === "main" && rail !== void 0 && rail !== null && rail !== false ? /* @__PURE__ */ jsx5(
|
|
306
|
-
FrameRailGroup,
|
|
307
|
-
{
|
|
308
|
-
rail,
|
|
309
|
-
...railOptions,
|
|
310
|
-
className: "gridui-frame-main-rail-group",
|
|
311
|
-
children: content
|
|
312
|
-
}
|
|
313
|
-
) : content
|
|
314
|
-
}
|
|
315
|
-
),
|
|
316
|
-
footer ? /* @__PURE__ */ jsx5(
|
|
317
|
-
"div",
|
|
318
|
-
{
|
|
319
|
-
className: "gridui-frame-page-footer",
|
|
320
|
-
children: footer
|
|
321
|
-
}
|
|
322
|
-
) : null
|
|
323
|
-
]
|
|
418
|
+
className: cn11("gridui-frame-region-row", className),
|
|
419
|
+
style: {
|
|
420
|
+
"--gridui-frame-region-inset": typeof contentInset === "number" ? `${contentInset}px` : contentInset,
|
|
421
|
+
...style
|
|
422
|
+
}
|
|
324
423
|
}
|
|
325
424
|
);
|
|
326
425
|
};
|
|
327
426
|
|
|
328
|
-
// src/frame
|
|
329
|
-
import { jsx as
|
|
427
|
+
// src/frame-texture/frame-texture.tsx
|
|
428
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
330
429
|
var FrameTexture = (props) => {
|
|
331
430
|
const { texture } = props;
|
|
332
|
-
return texture === "none" ? null : /* @__PURE__ */
|
|
431
|
+
return texture === "none" ? null : /* @__PURE__ */ jsx11(
|
|
333
432
|
"div",
|
|
334
433
|
{
|
|
335
434
|
className: "gridui-frame-texture",
|
|
@@ -340,10 +439,10 @@ var FrameTexture = (props) => {
|
|
|
340
439
|
);
|
|
341
440
|
};
|
|
342
441
|
|
|
343
|
-
// src/frame/section.tsx
|
|
344
|
-
import { cn as
|
|
345
|
-
import { spacingVariables
|
|
346
|
-
import { jsx as
|
|
442
|
+
// src/frame-section/frame-section.tsx
|
|
443
|
+
import { cn as cn12 } from "@gridui/style-utils";
|
|
444
|
+
import { spacingVariables } from "@gridui/style-utils/responsive";
|
|
445
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
347
446
|
var FrameSection = (props) => {
|
|
348
447
|
const {
|
|
349
448
|
tone = "neutral",
|
|
@@ -357,36 +456,36 @@ var FrameSection = (props) => {
|
|
|
357
456
|
children,
|
|
358
457
|
...restProps
|
|
359
458
|
} = props;
|
|
360
|
-
return /* @__PURE__ */
|
|
459
|
+
return /* @__PURE__ */ jsxs5(
|
|
361
460
|
"section",
|
|
362
461
|
{
|
|
363
462
|
...restProps,
|
|
364
|
-
className:
|
|
463
|
+
className: cn12("gridui-container gridui-frame-section", frameToneStyles({ tone }), className),
|
|
365
464
|
"data-edges": edges,
|
|
366
465
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ jsx12(
|
|
368
467
|
FrameBoundary,
|
|
369
468
|
{
|
|
370
469
|
boundary
|
|
371
470
|
}
|
|
372
471
|
),
|
|
373
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ jsxs5(
|
|
374
473
|
"div",
|
|
375
474
|
{
|
|
376
|
-
className:
|
|
475
|
+
className: cn12(frameContentStyles(), "gridui-frame-surface", edges === "none" && "border-x-0"),
|
|
377
476
|
style: {
|
|
378
|
-
...
|
|
379
|
-
...
|
|
477
|
+
...spacingVariables("section-padding-inline", paddingInline),
|
|
478
|
+
...spacingVariables("section-padding-block", paddingBlock)
|
|
380
479
|
},
|
|
381
480
|
children: [
|
|
382
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ jsx12(
|
|
383
482
|
FrameTexture,
|
|
384
483
|
{
|
|
385
484
|
texture
|
|
386
485
|
}
|
|
387
486
|
),
|
|
388
487
|
children,
|
|
389
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ jsx12(
|
|
390
489
|
FrameDecoration,
|
|
391
490
|
{
|
|
392
491
|
decoration: resolveFrameDecoration(boundary, decoration)
|
|
@@ -400,73 +499,38 @@ var FrameSection = (props) => {
|
|
|
400
499
|
);
|
|
401
500
|
};
|
|
402
501
|
|
|
403
|
-
// src/
|
|
404
|
-
import {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
standard: "gridui-container-standard",
|
|
410
|
-
wide: "gridui-container-wide"
|
|
411
|
-
}
|
|
412
|
-
},
|
|
413
|
-
defaultVariants: { width: "standard" }
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
// src/primitives/container/container.tsx
|
|
417
|
-
import { cn as cn8 } from "@gridui/style-utils";
|
|
418
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
419
|
-
var Container = (props) => {
|
|
420
|
-
const { width = "standard", className, ...restProps } = props;
|
|
421
|
-
return /* @__PURE__ */ jsx8(
|
|
502
|
+
// src/frame-sections/frame-sections.tsx
|
|
503
|
+
import { cn as cn13 } from "@gridui/style-utils";
|
|
504
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
505
|
+
var FrameSections = (props) => {
|
|
506
|
+
const { className, ...restProps } = props;
|
|
507
|
+
return /* @__PURE__ */ jsx13(
|
|
422
508
|
"div",
|
|
423
509
|
{
|
|
424
510
|
...restProps,
|
|
425
|
-
className:
|
|
511
|
+
className: cn13("gridui-frame-sections", className)
|
|
426
512
|
}
|
|
427
513
|
);
|
|
428
514
|
};
|
|
429
515
|
|
|
430
|
-
// src/
|
|
516
|
+
// src/grid-item/responsive.ts
|
|
431
517
|
var spanValue = (value) => {
|
|
432
518
|
return value === "full" ? "1 / -1" : `span ${value} / span ${value}`;
|
|
433
519
|
};
|
|
434
520
|
|
|
435
|
-
// src/
|
|
436
|
-
import { cn as
|
|
437
|
-
import { cva as
|
|
438
|
-
var
|
|
439
|
-
"gridui-grid",
|
|
440
|
-
"grid min-w-0"
|
|
441
|
-
));
|
|
442
|
-
var gridCellsStyles = cva6(cn9(
|
|
443
|
-
"gridui-grid-cells",
|
|
444
|
-
"border-t border-solid border-border border-l border-solid border-border"
|
|
445
|
-
));
|
|
446
|
-
var gridItemStyles = cva6(cn9(
|
|
521
|
+
// src/grid-item/style.ts
|
|
522
|
+
import { cn as cn14 } from "@gridui/style-utils";
|
|
523
|
+
import { cva as cva8 } from "class-variance-authority";
|
|
524
|
+
var gridItemStyles = cva8(cn14(
|
|
447
525
|
"gridui-grid-item",
|
|
448
526
|
"min-w-0 wrap-anywhere"
|
|
449
527
|
));
|
|
450
|
-
var gridInternalStyles = cva6(cn9(
|
|
451
|
-
"gridui-grid-internal",
|
|
452
|
-
"bg-border"
|
|
453
|
-
));
|
|
454
|
-
var gridVariants = cva6(gridStyles(), {
|
|
455
|
-
variants: {
|
|
456
|
-
frame: {
|
|
457
|
-
none: "",
|
|
458
|
-
cells: gridCellsStyles(),
|
|
459
|
-
internal: gridInternalStyles()
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
defaultVariants: { frame: "none" }
|
|
463
|
-
});
|
|
464
528
|
|
|
465
|
-
// src/
|
|
466
|
-
import { cn as
|
|
467
|
-
import { resolveResponsive as resolveResponsive3, spaceValue as
|
|
468
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
469
|
-
import { jsx as
|
|
529
|
+
// src/grid-item/grid-item.tsx
|
|
530
|
+
import { cn as cn15 } from "@gridui/style-utils";
|
|
531
|
+
import { resolveResponsive as resolveResponsive3, spaceValue as spaceValue4 } from "@gridui/style-utils/responsive";
|
|
532
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
533
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
470
534
|
var GridItem = (props) => {
|
|
471
535
|
const {
|
|
472
536
|
asChild = false,
|
|
@@ -483,27 +547,53 @@ var GridItem = (props) => {
|
|
|
483
547
|
"--gridui-span": spanValue(size.base),
|
|
484
548
|
"--gridui-span-md": spanValue(size.md),
|
|
485
549
|
"--gridui-span-lg": spanValue(size.lg),
|
|
486
|
-
"--gridui-padding":
|
|
487
|
-
"--gridui-padding-md":
|
|
488
|
-
"--gridui-padding-lg":
|
|
550
|
+
"--gridui-padding": spaceValue4(inset.base),
|
|
551
|
+
"--gridui-padding-md": spaceValue4(inset.md),
|
|
552
|
+
"--gridui-padding-lg": spaceValue4(inset.lg),
|
|
489
553
|
...align ? {
|
|
490
554
|
display: "flex",
|
|
491
555
|
alignItems: align
|
|
492
556
|
} : {},
|
|
493
557
|
...style
|
|
494
558
|
};
|
|
495
|
-
const Component = asChild ?
|
|
496
|
-
return /* @__PURE__ */
|
|
559
|
+
const Component = asChild ? Slot3 : "div";
|
|
560
|
+
return /* @__PURE__ */ jsx14(
|
|
497
561
|
Component,
|
|
498
562
|
{
|
|
499
563
|
...restProps,
|
|
500
|
-
className:
|
|
564
|
+
className: cn15(gridItemStyles(), className),
|
|
501
565
|
style: layoutStyle
|
|
502
566
|
}
|
|
503
567
|
);
|
|
504
568
|
};
|
|
505
569
|
|
|
506
|
-
// src/
|
|
570
|
+
// src/grid/style.ts
|
|
571
|
+
import { cn as cn16 } from "@gridui/style-utils";
|
|
572
|
+
import { cva as cva9 } from "class-variance-authority";
|
|
573
|
+
var gridStyles = cva9(cn16(
|
|
574
|
+
"gridui-grid",
|
|
575
|
+
"grid min-w-0"
|
|
576
|
+
));
|
|
577
|
+
var gridCellsStyles = cva9(cn16(
|
|
578
|
+
"gridui-grid-cells",
|
|
579
|
+
"border-t border-solid border-border border-l border-solid border-border"
|
|
580
|
+
));
|
|
581
|
+
var gridInternalStyles = cva9(cn16(
|
|
582
|
+
"gridui-grid-internal",
|
|
583
|
+
"bg-border"
|
|
584
|
+
));
|
|
585
|
+
var gridVariants = cva9(gridStyles(), {
|
|
586
|
+
variants: {
|
|
587
|
+
frame: {
|
|
588
|
+
none: "",
|
|
589
|
+
cells: gridCellsStyles(),
|
|
590
|
+
internal: gridInternalStyles()
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
defaultVariants: { frame: "none" }
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
// src/grid/tracks.ts
|
|
507
597
|
var gridColumnCount = (columns) => {
|
|
508
598
|
return typeof columns === "number" ? columns : columns.length;
|
|
509
599
|
};
|
|
@@ -515,6 +605,13 @@ var gridTemplate = (columns) => {
|
|
|
515
605
|
return track === "1fr" ? "minmax(0, 1fr)" : track;
|
|
516
606
|
}).join(" ");
|
|
517
607
|
};
|
|
608
|
+
var adaptiveGridTemplate = (minItemWidth) => {
|
|
609
|
+
if (typeof minItemWidth === "number" && (!Number.isFinite(minItemWidth) || minItemWidth <= 0) || typeof minItemWidth === "string" && !minItemWidth.trim()) {
|
|
610
|
+
throw new RangeError("Adaptive Grid minItemWidth must be a positive number or a nonempty CSS length.");
|
|
611
|
+
}
|
|
612
|
+
const minimum = typeof minItemWidth === "number" ? `${minItemWidth}px` : minItemWidth;
|
|
613
|
+
return `repeat(auto-fit, minmax(min(100%, ${minimum}), 1fr))`;
|
|
614
|
+
};
|
|
518
615
|
var fillGridRowSpans = (columns, spans) => {
|
|
519
616
|
let occupied = 0;
|
|
520
617
|
return spans.map((span, index) => {
|
|
@@ -538,14 +635,17 @@ var fillGridRowSpans = (columns, spans) => {
|
|
|
538
635
|
});
|
|
539
636
|
};
|
|
540
637
|
|
|
541
|
-
// src/
|
|
542
|
-
import { cn as
|
|
543
|
-
import { resolveResponsive as resolveResponsive4, spaceValue as
|
|
544
|
-
import {
|
|
545
|
-
import {
|
|
638
|
+
// src/grid/grid.tsx
|
|
639
|
+
import { cn as cn17 } from "@gridui/style-utils";
|
|
640
|
+
import { resolveResponsive as resolveResponsive4, spaceValue as spaceValue5 } from "@gridui/style-utils/responsive";
|
|
641
|
+
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
642
|
+
import { Children, cloneElement, Fragment as Fragment2, isValidElement } from "react";
|
|
643
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
546
644
|
var Grid = (props) => {
|
|
547
645
|
const {
|
|
548
646
|
columns = 1,
|
|
647
|
+
minItemWidth,
|
|
648
|
+
asChild = false,
|
|
549
649
|
frame = "none",
|
|
550
650
|
gap = 16,
|
|
551
651
|
fillLastRow = false,
|
|
@@ -554,27 +654,56 @@ var Grid = (props) => {
|
|
|
554
654
|
children,
|
|
555
655
|
...restProps
|
|
556
656
|
} = props;
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}
|
|
657
|
+
if (fillLastRow && (asChild || columns === "auto")) {
|
|
658
|
+
throw new TypeError("Grid fillLastRow requires fixed columns and direct GridItem children, without asChild.");
|
|
659
|
+
}
|
|
660
|
+
if (columns === "auto" && frame !== "none") {
|
|
661
|
+
throw new TypeError("Adaptive Grid does not support framed cells.");
|
|
662
|
+
}
|
|
663
|
+
if (asChild && (!isValidElement(children) || children.type === Fragment2)) {
|
|
664
|
+
throw new TypeError("Grid asChild requires one element that forwards props and refs to its root.");
|
|
665
|
+
}
|
|
666
|
+
let geometry;
|
|
667
|
+
let count = null;
|
|
668
|
+
if (columns === "auto") {
|
|
669
|
+
if (minItemWidth === void 0) {
|
|
670
|
+
throw new TypeError("Adaptive Grid requires minItemWidth.");
|
|
671
|
+
}
|
|
672
|
+
const minimum = resolveResponsive4(minItemWidth);
|
|
673
|
+
geometry = {
|
|
674
|
+
"--gridui-grid-template": adaptiveGridTemplate(minimum.base),
|
|
675
|
+
"--gridui-grid-template-md": adaptiveGridTemplate(minimum.md),
|
|
676
|
+
"--gridui-grid-template-lg": adaptiveGridTemplate(minimum.lg)
|
|
677
|
+
};
|
|
678
|
+
} else {
|
|
679
|
+
if (minItemWidth !== void 0) {
|
|
680
|
+
throw new TypeError("Grid minItemWidth requires columns=auto.");
|
|
681
|
+
}
|
|
682
|
+
const tracks = resolveResponsive4(columns);
|
|
683
|
+
count = {
|
|
684
|
+
base: gridColumnCount(tracks.base),
|
|
685
|
+
md: gridColumnCount(tracks.md),
|
|
686
|
+
lg: gridColumnCount(tracks.lg)
|
|
687
|
+
};
|
|
688
|
+
geometry = {
|
|
689
|
+
"--gridui-columns": count.base,
|
|
690
|
+
"--gridui-columns-md": count.md,
|
|
691
|
+
"--gridui-columns-lg": count.lg,
|
|
692
|
+
"--gridui-grid-template": gridTemplate(tracks.base),
|
|
693
|
+
"--gridui-grid-template-md": gridTemplate(tracks.md),
|
|
694
|
+
"--gridui-grid-template-lg": gridTemplate(tracks.lg)
|
|
695
|
+
};
|
|
696
|
+
}
|
|
563
697
|
const spacing = resolveResponsive4(frame === "none" ? gap : 0);
|
|
564
698
|
const layoutStyle = {
|
|
565
|
-
|
|
566
|
-
"--gridui-
|
|
567
|
-
"--gridui-
|
|
568
|
-
"--gridui-
|
|
569
|
-
"--gridui-grid-template-md": gridTemplate(tracks.md),
|
|
570
|
-
"--gridui-grid-template-lg": gridTemplate(tracks.lg),
|
|
571
|
-
"--gridui-gap": frame === "internal" ? "1px" : spaceValue4(spacing.base),
|
|
572
|
-
"--gridui-gap-md": frame === "internal" ? "1px" : spaceValue4(spacing.md),
|
|
573
|
-
"--gridui-gap-lg": frame === "internal" ? "1px" : spaceValue4(spacing.lg),
|
|
699
|
+
...geometry,
|
|
700
|
+
"--gridui-gap": frame === "internal" ? "1px" : spaceValue5(spacing.base),
|
|
701
|
+
"--gridui-gap-md": frame === "internal" ? "1px" : spaceValue5(spacing.md),
|
|
702
|
+
"--gridui-gap-lg": frame === "internal" ? "1px" : spaceValue5(spacing.lg),
|
|
574
703
|
...style
|
|
575
704
|
};
|
|
576
705
|
let content = children;
|
|
577
|
-
if (fillLastRow) {
|
|
706
|
+
if (fillLastRow && count) {
|
|
578
707
|
const items = Children.toArray(children).map((child) => {
|
|
579
708
|
if (!isValidElement(child) || child.type !== GridItem) {
|
|
580
709
|
throw new TypeError("Grid fillLastRow requires direct GridItem children.");
|
|
@@ -607,29 +736,120 @@ var Grid = (props) => {
|
|
|
607
736
|
});
|
|
608
737
|
});
|
|
609
738
|
}
|
|
610
|
-
|
|
611
|
-
|
|
739
|
+
const Component = asChild ? Slot4 : "div";
|
|
740
|
+
return /* @__PURE__ */ jsx15(
|
|
741
|
+
Component,
|
|
612
742
|
{
|
|
613
743
|
...restProps,
|
|
614
|
-
className:
|
|
744
|
+
className: cn17(gridVariants({ frame }), className),
|
|
615
745
|
style: layoutStyle,
|
|
616
746
|
children: content
|
|
617
747
|
}
|
|
618
748
|
);
|
|
619
749
|
};
|
|
620
750
|
|
|
621
|
-
// src/
|
|
622
|
-
import {
|
|
623
|
-
|
|
624
|
-
|
|
751
|
+
// src/page-frame/style.ts
|
|
752
|
+
import { cva as cva10 } from "class-variance-authority";
|
|
753
|
+
var pageFrameVariants = cva10("gridui-page-frame min-h-svh", {
|
|
754
|
+
variants: {
|
|
755
|
+
width: {
|
|
756
|
+
narrow: "gridui-container-narrow",
|
|
757
|
+
standard: "gridui-container-standard",
|
|
758
|
+
wide: "gridui-container-wide"
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
defaultVariants: { width: "standard" }
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
// src/page-frame/page-frame.tsx
|
|
765
|
+
import { cn as cn18 } from "@gridui/style-utils";
|
|
766
|
+
import { spacingVariables as spacingVariables2 } from "@gridui/style-utils/responsive";
|
|
767
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
768
|
+
var PageFrame = (props) => {
|
|
769
|
+
const {
|
|
770
|
+
width = "standard",
|
|
771
|
+
header,
|
|
772
|
+
footer,
|
|
773
|
+
rail,
|
|
774
|
+
railWidth,
|
|
775
|
+
railScope = "page",
|
|
776
|
+
mainGutterStart,
|
|
777
|
+
children,
|
|
778
|
+
className,
|
|
779
|
+
...restProps
|
|
780
|
+
} = props;
|
|
781
|
+
const railOptions = railWidth === void 0 ? {} : { railWidth };
|
|
782
|
+
const content = /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
783
|
+
/* @__PURE__ */ jsx16(FrameSections, { children }),
|
|
784
|
+
/* @__PURE__ */ jsx16(
|
|
785
|
+
"div",
|
|
786
|
+
{
|
|
787
|
+
className: "gridui-container gridui-frame-fill",
|
|
788
|
+
"aria-hidden": "true",
|
|
789
|
+
children: /* @__PURE__ */ jsx16(
|
|
790
|
+
"div",
|
|
791
|
+
{
|
|
792
|
+
className: cn18(frameContentStyles())
|
|
793
|
+
}
|
|
794
|
+
)
|
|
795
|
+
}
|
|
796
|
+
)
|
|
797
|
+
] });
|
|
798
|
+
return /* @__PURE__ */ jsxs6(
|
|
799
|
+
FrameRailGroup,
|
|
800
|
+
{
|
|
801
|
+
...restProps,
|
|
802
|
+
rail: railScope === "page" ? rail : void 0,
|
|
803
|
+
...railOptions,
|
|
804
|
+
className: cn18(pageFrameVariants({ width }), className),
|
|
805
|
+
children: [
|
|
806
|
+
header ? /* @__PURE__ */ jsx16(
|
|
807
|
+
"div",
|
|
808
|
+
{
|
|
809
|
+
className: "gridui-frame-page-header",
|
|
810
|
+
children: header
|
|
811
|
+
}
|
|
812
|
+
) : null,
|
|
813
|
+
/* @__PURE__ */ jsx16(
|
|
814
|
+
"main",
|
|
815
|
+
{
|
|
816
|
+
className: "gridui-frame-main",
|
|
817
|
+
style: mainGutterStart === void 0 ? void 0 : spacingVariables2("main-gutter-start", mainGutterStart),
|
|
818
|
+
children: railScope === "main" && rail !== void 0 && rail !== null && rail !== false ? /* @__PURE__ */ jsx16(
|
|
819
|
+
FrameRailGroup,
|
|
820
|
+
{
|
|
821
|
+
rail,
|
|
822
|
+
...railOptions,
|
|
823
|
+
className: "gridui-frame-main-rail-group",
|
|
824
|
+
children: content
|
|
825
|
+
}
|
|
826
|
+
) : content
|
|
827
|
+
}
|
|
828
|
+
),
|
|
829
|
+
footer ? /* @__PURE__ */ jsx16(
|
|
830
|
+
"div",
|
|
831
|
+
{
|
|
832
|
+
className: "gridui-frame-page-footer",
|
|
833
|
+
children: footer
|
|
834
|
+
}
|
|
835
|
+
) : null
|
|
836
|
+
]
|
|
837
|
+
}
|
|
838
|
+
);
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
// src/row/style.ts
|
|
842
|
+
import { cn as cn19 } from "@gridui/style-utils";
|
|
843
|
+
import { cva as cva11 } from "class-variance-authority";
|
|
844
|
+
var rowStyles = cva11(cn19(
|
|
625
845
|
"gridui-row",
|
|
626
846
|
"min-w-0"
|
|
627
847
|
));
|
|
628
848
|
|
|
629
|
-
// src/
|
|
630
|
-
import { cn as
|
|
631
|
-
import { spaceValue as
|
|
632
|
-
import { jsx as
|
|
849
|
+
// src/row/row.tsx
|
|
850
|
+
import { cn as cn20 } from "@gridui/style-utils";
|
|
851
|
+
import { spaceValue as spaceValue6 } from "@gridui/style-utils/responsive";
|
|
852
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
633
853
|
var Row = (props) => {
|
|
634
854
|
const {
|
|
635
855
|
gap = 16,
|
|
@@ -642,37 +862,38 @@ var Row = (props) => {
|
|
|
642
862
|
style,
|
|
643
863
|
...restProps
|
|
644
864
|
} = props;
|
|
645
|
-
return /* @__PURE__ */
|
|
865
|
+
return /* @__PURE__ */ jsx17(
|
|
646
866
|
"div",
|
|
647
867
|
{
|
|
648
868
|
...restProps,
|
|
649
|
-
className:
|
|
869
|
+
className: cn20(rowStyles(), className),
|
|
650
870
|
"data-inline": inline,
|
|
651
871
|
style: {
|
|
652
872
|
display: inline ? "inline-flex" : "flex",
|
|
653
873
|
alignItems: align,
|
|
654
874
|
justifyContent: justify === "between" ? "space-between" : "flex-start",
|
|
655
875
|
flexWrap: wrap ? "wrap" : "nowrap",
|
|
656
|
-
gap: `${
|
|
876
|
+
gap: `${spaceValue6(rowGap)} ${spaceValue6(gap)}`,
|
|
657
877
|
...style
|
|
658
878
|
}
|
|
659
879
|
}
|
|
660
880
|
);
|
|
661
881
|
};
|
|
662
882
|
|
|
663
|
-
// src/
|
|
664
|
-
import { cn as
|
|
883
|
+
// src/split/split.tsx
|
|
884
|
+
import { cn as cn21 } from "@gridui/style-utils";
|
|
665
885
|
import { resolveResponsive as resolveResponsive5 } from "@gridui/style-utils/responsive";
|
|
666
|
-
import { jsx as
|
|
886
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
667
887
|
var Split = (props) => {
|
|
668
|
-
const { direction = "row", seam = "line", className, ...restProps } = props;
|
|
888
|
+
const { direction = "row", order = "logical", seam = "line", className, ...restProps } = props;
|
|
669
889
|
const directions = resolveResponsive5(direction);
|
|
670
890
|
const seams = resolveResponsive5(seam);
|
|
671
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ jsx18(
|
|
672
892
|
"div",
|
|
673
893
|
{
|
|
674
894
|
...restProps,
|
|
675
|
-
className:
|
|
895
|
+
className: cn21("gridui-split", className),
|
|
896
|
+
"data-order": order,
|
|
676
897
|
"data-direction": directions.base,
|
|
677
898
|
"data-direction-md": directions.md,
|
|
678
899
|
"data-direction-lg": directions.lg,
|
|
@@ -683,18 +904,18 @@ var Split = (props) => {
|
|
|
683
904
|
);
|
|
684
905
|
};
|
|
685
906
|
|
|
686
|
-
// src/
|
|
687
|
-
import { cn as
|
|
688
|
-
import { cva as
|
|
689
|
-
var stackStyles =
|
|
907
|
+
// src/stack/style.ts
|
|
908
|
+
import { cn as cn22 } from "@gridui/style-utils";
|
|
909
|
+
import { cva as cva12 } from "class-variance-authority";
|
|
910
|
+
var stackStyles = cva12(cn22(
|
|
690
911
|
"gridui-stack",
|
|
691
912
|
"flex min-w-0 flex-col"
|
|
692
913
|
));
|
|
693
914
|
|
|
694
|
-
// src/
|
|
695
|
-
import { cn as
|
|
696
|
-
import { resolveResponsive as resolveResponsive6, spaceValue as
|
|
697
|
-
import { jsx as
|
|
915
|
+
// src/stack/stack.tsx
|
|
916
|
+
import { cn as cn23 } from "@gridui/style-utils";
|
|
917
|
+
import { resolveResponsive as resolveResponsive6, spaceValue as spaceValue7 } from "@gridui/style-utils/responsive";
|
|
918
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
698
919
|
var Stack = (props) => {
|
|
699
920
|
const {
|
|
700
921
|
gap = 16,
|
|
@@ -707,29 +928,33 @@ var Stack = (props) => {
|
|
|
707
928
|
} = props;
|
|
708
929
|
const spacing = resolveResponsive6(gap);
|
|
709
930
|
const layoutStyle = {
|
|
710
|
-
"--gridui-gap":
|
|
711
|
-
"--gridui-gap-md":
|
|
712
|
-
"--gridui-gap-lg":
|
|
931
|
+
"--gridui-gap": spaceValue7(spacing.base),
|
|
932
|
+
"--gridui-gap-md": spaceValue7(spacing.md),
|
|
933
|
+
"--gridui-gap-lg": spaceValue7(spacing.lg),
|
|
713
934
|
width: width === "full" ? "100%" : void 0,
|
|
714
935
|
maxWidth,
|
|
715
|
-
paddingTop: paddingStart === void 0 ? void 0 :
|
|
936
|
+
paddingTop: paddingStart === void 0 ? void 0 : spaceValue7(paddingStart),
|
|
716
937
|
...style
|
|
717
938
|
};
|
|
718
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ jsx19(
|
|
719
940
|
"div",
|
|
720
941
|
{
|
|
721
942
|
...restProps,
|
|
722
|
-
className:
|
|
943
|
+
className: cn23(stackStyles(), className),
|
|
723
944
|
style: layoutStyle
|
|
724
945
|
}
|
|
725
946
|
);
|
|
726
947
|
};
|
|
727
948
|
export {
|
|
728
949
|
Container,
|
|
950
|
+
DashboardFrame,
|
|
951
|
+
FrameBoundary,
|
|
729
952
|
FrameFooter,
|
|
730
953
|
FrameHeader,
|
|
731
954
|
FrameRail,
|
|
732
955
|
FrameRailGroup,
|
|
956
|
+
FrameRegion,
|
|
957
|
+
FrameRegionRow,
|
|
733
958
|
FrameSection,
|
|
734
959
|
FrameSections,
|
|
735
960
|
FrameTexture,
|