baseline-kit 5.0.0 → 5.2.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/CHANGELOG.md +243 -0
- package/README.md +227 -353
- package/dist/baseline-kit.css +5 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +25 -9
- package/dist/core.mjs +1 -1
- package/dist/guide.cjs +1 -1
- package/dist/guide.cjs.map +1 -1
- package/dist/guide.css +1 -1
- package/dist/guide.d.ts +16 -16
- package/dist/guide.mjs +147 -150
- package/dist/guide.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -12
- package/dist/index.mjs +169 -158
- package/dist/index.mjs.map +1 -1
- package/dist/remix-server.d.ts +8 -0
- package/dist/remix-server.mjs +15 -0
- package/dist/remix-server.mjs.map +1 -0
- package/dist/remix.css +2 -0
- package/dist/remix.d.ts +191 -0
- package/dist/remix.mjs +984 -0
- package/dist/remix.mjs.map +1 -0
- package/dist/{src-QHaSfgVe.js → src-D0nL1BwZ.js} +96 -165
- package/dist/src-D0nL1BwZ.js.map +1 -0
- package/dist/src-R5usYJol.cjs +2 -0
- package/dist/src-R5usYJol.cjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/default.css +0 -1
- package/dist/theme/tokens.css +0 -1
- package/dist/theme.css +4 -1
- package/package.json +86 -37
- package/dist/README.md +0 -468
- package/dist/core/src/config/defaults.d.ts +0 -2
- package/dist/core/src/config/index.d.ts +0 -3
- package/dist/core/src/config/merge.d.ts +0 -21
- package/dist/core/src/config/schema.d.ts +0 -33
- package/dist/core/src/descriptors/baseline.d.ts +0 -26
- package/dist/core/src/descriptors/box.d.ts +0 -20
- package/dist/core/src/descriptors/guide.d.ts +0 -44
- package/dist/core/src/descriptors/index.d.ts +0 -5
- package/dist/core/src/descriptors/padder.d.ts +0 -19
- package/dist/core/src/descriptors/spacer.d.ts +0 -24
- package/dist/core/src/index.d.ts +0 -10
- package/dist/core/src/types.d.ts +0 -62
- package/dist/core/src/utils/convert.d.ts +0 -10
- package/dist/core/src/utils/grid.d.ts +0 -18
- package/dist/core/src/utils/index.d.ts +0 -8
- package/dist/core/src/utils/math.d.ts +0 -9
- package/dist/core/src/utils/merge.d.ts +0 -28
- package/dist/core/src/utils/normalize.d.ts +0 -13
- package/dist/core/src/utils/padding.d.ts +0 -2
- package/dist/core/src/utils/parse.d.ts +0 -5
- package/dist/core/src/utils/snapping.d.ts +0 -2
- package/dist/core/src/validation/guide.d.ts +0 -3
- package/dist/core/src/validation/index.d.ts +0 -1
- package/dist/dom/src/index.d.ts +0 -11
- package/dist/dom/src/measure.d.ts +0 -18
- package/dist/dom/src/observers.d.ts +0 -5
- package/dist/dom/src/ssr.d.ts +0 -20
- package/dist/dom/src/timing.d.ts +0 -2
- package/dist/dom/src/viewport.d.ts +0 -7
- package/dist/dom/src/virtual.d.ts +0 -23
- package/dist/react/src/components/Baseline/Baseline.d.ts +0 -13
- package/dist/react/src/components/Baseline/index.d.ts +0 -1
- package/dist/react/src/components/Box/Box.d.ts +0 -26
- package/dist/react/src/components/Box/index.d.ts +0 -1
- package/dist/react/src/components/Config/Config.d.ts +0 -20
- package/dist/react/src/components/Config/index.d.ts +0 -2
- package/dist/react/src/components/Guide/Guide.d.ts +0 -16
- package/dist/react/src/components/Guide/index.d.ts +0 -1
- package/dist/react/src/components/Padder/Padder.d.ts +0 -20
- package/dist/react/src/components/Padder/index.d.ts +0 -1
- package/dist/react/src/components/Spacer/Spacer.d.ts +0 -14
- package/dist/react/src/components/Spacer/index.d.ts +0 -1
- package/dist/react/src/components/index.d.ts +0 -12
- package/dist/react/src/components/types.d.ts +0 -29
- package/dist/react/src/guide.d.ts +0 -10
- package/dist/react/src/hooks/index.d.ts +0 -10
- package/dist/react/src/hooks/useBaseline.d.ts +0 -26
- package/dist/react/src/hooks/useConfig.d.ts +0 -9
- package/dist/react/src/hooks/useDebug.d.ts +0 -6
- package/dist/react/src/hooks/useGuide.d.ts +0 -7
- package/dist/react/src/hooks/useIsClient.d.ts +0 -4
- package/dist/react/src/hooks/useMeasure.d.ts +0 -10
- package/dist/react/src/hooks/useVirtual.d.ts +0 -14
- package/dist/react/src/index.d.ts +0 -21
- package/dist/react/src/utils/index.d.ts +0 -9
- package/dist/react/src/utils/merge.d.ts +0 -10
- package/dist/react/src/utils/ssr.d.ts +0 -1
- package/dist/src-CMjyHjX5.cjs +0 -2
- package/dist/src-CMjyHjX5.cjs.map +0 -1
- package/dist/src-QHaSfgVe.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { O as e, a as t, f as n, h as r, i, k as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f } from "./src-
|
|
1
|
+
import { O as e, a as t, f as n, h as r, i, k as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f } from "./src-D0nL1BwZ.js";
|
|
2
2
|
import * as p from "react";
|
|
3
3
|
import { useCallback as m, useEffect as h, useLayoutEffect as g, useMemo as _, useState as v } from "react";
|
|
4
4
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
5
5
|
//#region packages/react/src/components/Config/Config.tsx
|
|
6
|
-
var S = p.createContext(a);
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let c =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
6
|
+
var S = "__baseline_kit_config_context__", C = globalThis, w = C[S] ?? (C[S] = p.createContext(a));
|
|
7
|
+
w.displayName = "ConfigContext";
|
|
8
|
+
var T = () => p.use(w);
|
|
9
|
+
function E({ children: t, base: n, baseline: r, guide: i, spacer: a, box: o, padder: s }) {
|
|
10
|
+
let c = T(), l = p.useMemo(() => e({
|
|
11
|
+
parentConfig: c,
|
|
12
|
+
base: n,
|
|
13
|
+
baseline: r,
|
|
14
|
+
guide: i,
|
|
15
|
+
spacer: a,
|
|
16
|
+
box: o,
|
|
17
|
+
padder: s
|
|
18
|
+
}), [
|
|
19
|
+
c,
|
|
20
|
+
n,
|
|
21
|
+
r,
|
|
22
|
+
i,
|
|
23
|
+
a,
|
|
24
|
+
o,
|
|
25
|
+
s
|
|
26
|
+
]);
|
|
27
|
+
return /* @__PURE__ */ b(w, {
|
|
28
|
+
value: l,
|
|
29
29
|
children: t
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region packages/dom/src/timing.ts
|
|
34
|
-
var
|
|
34
|
+
var D = (e) => {
|
|
35
35
|
let t = null, n = null;
|
|
36
36
|
return [(...r) => {
|
|
37
37
|
n = r, t !== null && cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
@@ -43,7 +43,7 @@ var T = (e) => {
|
|
|
43
43
|
};
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region packages/dom/src/measure.ts
|
|
46
|
-
function
|
|
46
|
+
function O(e, t) {
|
|
47
47
|
let n = {
|
|
48
48
|
width: 0,
|
|
49
49
|
height: 0
|
|
@@ -55,7 +55,7 @@ function E(e, t) {
|
|
|
55
55
|
};
|
|
56
56
|
(i.width !== n.width || i.height !== n.height) && (n = i, t(i));
|
|
57
57
|
} catch {}
|
|
58
|
-
}, [i, a] =
|
|
58
|
+
}, [i, a] = D(r);
|
|
59
59
|
r();
|
|
60
60
|
let o = new ResizeObserver(i);
|
|
61
61
|
return o.observe(e), {
|
|
@@ -67,15 +67,15 @@ function E(e, t) {
|
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region packages/react/src/hooks/useMeasure.ts
|
|
70
|
-
var
|
|
70
|
+
var k = {
|
|
71
71
|
width: 0,
|
|
72
72
|
height: 0
|
|
73
73
|
};
|
|
74
|
-
function
|
|
75
|
-
let [t, n] = p.useState(
|
|
74
|
+
function A(e) {
|
|
75
|
+
let [t, n] = p.useState(k), r = p.useRef(null);
|
|
76
76
|
p.useLayoutEffect(() => {
|
|
77
77
|
if (typeof window > "u" || !e.current) return;
|
|
78
|
-
let t =
|
|
78
|
+
let t = O(e.current, (e) => {
|
|
79
79
|
n((t) => t.width === e.width && t.height === e.height ? t : e);
|
|
80
80
|
});
|
|
81
81
|
return r.current = t, () => {
|
|
@@ -92,7 +92,7 @@ function O(e) {
|
|
|
92
92
|
}
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region packages/dom/src/virtual.ts
|
|
95
|
-
function
|
|
95
|
+
function j(e, t, n) {
|
|
96
96
|
let { totalItems: r, itemHeight: i, buffer: a = 0 } = t;
|
|
97
97
|
if (!Number.isFinite(i) || i <= 0) throw Error("createVirtualTracker requires itemHeight to be greater than 0");
|
|
98
98
|
if (!Number.isFinite(r) || r < 0) throw Error("createVirtualTracker requires totalItems to be 0 or greater");
|
|
@@ -105,7 +105,7 @@ function k(e, t, n) {
|
|
|
105
105
|
}, s = {
|
|
106
106
|
start: 0,
|
|
107
107
|
end: r
|
|
108
|
-
}, [c, l] =
|
|
108
|
+
}, [c, l] = D(() => {
|
|
109
109
|
let e = o();
|
|
110
110
|
(e.start !== s.start || e.end !== s.end) && (s = e, n(e));
|
|
111
111
|
}), u = { passive: !0 };
|
|
@@ -120,7 +120,7 @@ function k(e, t, n) {
|
|
|
120
120
|
}
|
|
121
121
|
//#endregion
|
|
122
122
|
//#region packages/react/src/hooks/useVirtual.ts
|
|
123
|
-
function
|
|
123
|
+
function M({ totalLines: e, lineHeight: t, containerRef: n, buffer: r = 0 }) {
|
|
124
124
|
let i = typeof r == "number" ? r : parseInt(r, 10) || 0, [a, o] = v({
|
|
125
125
|
start: 0,
|
|
126
126
|
end: e
|
|
@@ -129,7 +129,11 @@ function A({ totalLines: e, lineHeight: t, containerRef: n, buffer: r = 0 }) {
|
|
|
129
129
|
}, []);
|
|
130
130
|
return g(() => {
|
|
131
131
|
if (!n.current) return;
|
|
132
|
-
|
|
132
|
+
o((t) => t.start === 0 && t.end === e ? t : {
|
|
133
|
+
start: 0,
|
|
134
|
+
end: e
|
|
135
|
+
});
|
|
136
|
+
let r = j(n.current, {
|
|
133
137
|
totalItems: e,
|
|
134
138
|
itemHeight: t,
|
|
135
139
|
buffer: i
|
|
@@ -145,42 +149,46 @@ function A({ totalLines: e, lineHeight: t, containerRef: n, buffer: r = 0 }) {
|
|
|
145
149
|
}
|
|
146
150
|
//#endregion
|
|
147
151
|
//#region packages/react/src/hooks/useBaseline.ts
|
|
148
|
-
function
|
|
152
|
+
function N(e, { base: t = 8, snapping: n = "none", snapEdge: i = "bottom", spacing: a = {} } = {}) {
|
|
149
153
|
if (t < 1) throw Error("Base must be >= 1 for baseline alignment.");
|
|
150
|
-
let { height:
|
|
154
|
+
let { height: s } = A(e), c = p.useRef(null);
|
|
151
155
|
return p.useMemo(() => {
|
|
152
|
-
let e = r({ padding:
|
|
156
|
+
let e = r({ padding: a }), l = s % t === 0;
|
|
153
157
|
if (n === "none") return {
|
|
154
158
|
padding: e,
|
|
155
|
-
isAligned:
|
|
156
|
-
height:
|
|
159
|
+
isAligned: l,
|
|
160
|
+
height: s
|
|
157
161
|
};
|
|
158
|
-
if (
|
|
159
|
-
padding:
|
|
160
|
-
isAligned:
|
|
161
|
-
height:
|
|
162
|
+
if (c.current) return {
|
|
163
|
+
padding: c.current,
|
|
164
|
+
isAligned: l,
|
|
165
|
+
height: s
|
|
162
166
|
};
|
|
163
|
-
if (
|
|
167
|
+
if (s === 0) return {
|
|
164
168
|
padding: e,
|
|
165
|
-
isAligned:
|
|
166
|
-
height:
|
|
169
|
+
isAligned: l,
|
|
170
|
+
height: s
|
|
167
171
|
};
|
|
168
|
-
let
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
let u = o(s, t, e, {
|
|
173
|
+
mode: n,
|
|
174
|
+
snapEdge: i
|
|
175
|
+
});
|
|
176
|
+
return c.current = u, {
|
|
177
|
+
padding: u,
|
|
178
|
+
isAligned: l,
|
|
179
|
+
height: s
|
|
173
180
|
};
|
|
174
181
|
}, [
|
|
175
182
|
t,
|
|
176
183
|
n,
|
|
177
184
|
i,
|
|
178
|
-
a
|
|
185
|
+
a,
|
|
186
|
+
s
|
|
179
187
|
]);
|
|
180
188
|
}
|
|
181
189
|
//#endregion
|
|
182
190
|
//#region packages/dom/src/viewport.ts
|
|
183
|
-
function
|
|
191
|
+
function P() {
|
|
184
192
|
return typeof window > "u" ? {} : {
|
|
185
193
|
viewportWidth: window.innerWidth,
|
|
186
194
|
viewportHeight: window.innerHeight
|
|
@@ -188,24 +196,24 @@ function M() {
|
|
|
188
196
|
}
|
|
189
197
|
//#endregion
|
|
190
198
|
//#region packages/react/src/hooks/useGuide.ts
|
|
191
|
-
function
|
|
192
|
-
let { width: n } =
|
|
193
|
-
return p.useMemo(() => d(n, t,
|
|
199
|
+
function F(e, t) {
|
|
200
|
+
let { width: n } = A(e);
|
|
201
|
+
return p.useMemo(() => d(n, t, P()), [t, n]);
|
|
194
202
|
}
|
|
195
203
|
//#endregion
|
|
196
204
|
//#region packages/react/src/hooks/useConfig.ts
|
|
197
|
-
function
|
|
198
|
-
let t =
|
|
205
|
+
function I(e) {
|
|
206
|
+
let t = T();
|
|
199
207
|
return _(() => Object.assign({ base: t.base }, t[e]), [t, e]);
|
|
200
208
|
}
|
|
201
209
|
//#endregion
|
|
202
210
|
//#region packages/react/src/hooks/useDebug.ts
|
|
203
|
-
function
|
|
211
|
+
function L(e, t) {
|
|
204
212
|
return _(() => l(e, t), [e, t]);
|
|
205
213
|
}
|
|
206
214
|
//#endregion
|
|
207
215
|
//#region packages/react/src/hooks/useIsClient.ts
|
|
208
|
-
function
|
|
216
|
+
function R() {
|
|
209
217
|
let [e, t] = v(!1);
|
|
210
218
|
return h(() => {
|
|
211
219
|
t(!0);
|
|
@@ -213,29 +221,29 @@ function I() {
|
|
|
213
221
|
}
|
|
214
222
|
//#endregion
|
|
215
223
|
//#region packages/react/src/utils/ssr.tsx
|
|
216
|
-
function
|
|
217
|
-
return
|
|
224
|
+
function z({ children: e, fallback: t = null }) {
|
|
225
|
+
return R() ? /* @__PURE__ */ b(y, { children: e }) : /* @__PURE__ */ b(y, { children: t });
|
|
218
226
|
}
|
|
219
227
|
//#endregion
|
|
220
228
|
//#region packages/react/src/utils/merge.ts
|
|
221
|
-
function
|
|
229
|
+
function B(...e) {
|
|
222
230
|
return Object.assign({}, ...e.filter(Boolean));
|
|
223
231
|
}
|
|
224
|
-
function
|
|
232
|
+
function V(...e) {
|
|
225
233
|
return (t) => {
|
|
226
234
|
e.forEach((e) => {
|
|
227
235
|
e && (typeof e == "function" ? e(t) : Object.assign(e, { current: t }));
|
|
228
236
|
});
|
|
229
237
|
};
|
|
230
238
|
}
|
|
231
|
-
var
|
|
239
|
+
var H = {
|
|
232
240
|
bas: "bas_4Emvv",
|
|
233
241
|
v: "v_lNfeX",
|
|
234
242
|
h: "h_PbNDU",
|
|
235
243
|
row: "row_J1Wva",
|
|
236
244
|
ssr: "ssr_PQAP-"
|
|
237
|
-
},
|
|
238
|
-
let d =
|
|
245
|
+
}, U = p.memo(function({ className: e, debugging: t, style: r, variant: a, height: o, width: s, base: c, color: l, ...u }) {
|
|
246
|
+
let d = I("baseline"), { isShown: f } = L(t, d.debugging), m = p.useRef(null), { width: h, height: g } = A(m), _ = c || d.base, v = p.useMemo(() => i({
|
|
239
247
|
base: _,
|
|
240
248
|
colors: d.colors,
|
|
241
249
|
variant: a ?? d.variant,
|
|
@@ -258,39 +266,39 @@ var B = {
|
|
|
258
266
|
g,
|
|
259
267
|
u,
|
|
260
268
|
f
|
|
261
|
-
]), { start: y, end: x } =
|
|
269
|
+
]), { start: y, end: x } = M({
|
|
262
270
|
totalLines: v.rowCount,
|
|
263
271
|
lineHeight: _,
|
|
264
272
|
containerRef: m,
|
|
265
273
|
buffer: 160
|
|
266
|
-
}), S = p.useMemo(() =>
|
|
274
|
+
}), S = p.useMemo(() => B(v.containerStyle, r), [v.containerStyle, r]);
|
|
267
275
|
return /* @__PURE__ */ b("div", {
|
|
268
276
|
ref: m,
|
|
269
277
|
"data-testid": "baseline",
|
|
270
278
|
"aria-hidden": "true",
|
|
271
|
-
className: n(...v.classTokens.map((e) =>
|
|
279
|
+
className: n(...v.classTokens.map((e) => H[e]), e),
|
|
272
280
|
style: S,
|
|
273
281
|
...u,
|
|
274
282
|
children: f && Array.from({ length: x - y }, (e, t) => {
|
|
275
283
|
let n = t + y;
|
|
276
284
|
return /* @__PURE__ */ b("div", {
|
|
277
|
-
className:
|
|
285
|
+
className: H.row,
|
|
278
286
|
"data-row-index": n,
|
|
279
287
|
style: v.getRowStyle(n)
|
|
280
288
|
}, n);
|
|
281
289
|
})
|
|
282
290
|
});
|
|
283
|
-
}),
|
|
284
|
-
let d =
|
|
291
|
+
}), W = p.memo(function({ className: e, debugging: t, style: r, variant: i, height: a, width: o, base: s, color: c, ssrMode: l = !1, ...u }) {
|
|
292
|
+
let d = I("baseline"), f = i ?? d.variant, p = s ?? d.base, { isShown: m } = L(t, d.debugging);
|
|
285
293
|
if (!m) return /* @__PURE__ */ b("div", {
|
|
286
|
-
className: n(
|
|
294
|
+
className: n(H.bas, H.h, e),
|
|
287
295
|
style: r,
|
|
288
296
|
"data-testid": "baseline",
|
|
289
297
|
"aria-hidden": "true",
|
|
290
298
|
...u
|
|
291
299
|
});
|
|
292
300
|
let h = /* @__PURE__ */ b("div", {
|
|
293
|
-
className: n(
|
|
301
|
+
className: n(H.bas, H.h, H.ssr, e),
|
|
294
302
|
style: {
|
|
295
303
|
width: o ?? "100%",
|
|
296
304
|
height: a ?? "100%",
|
|
@@ -299,9 +307,9 @@ var B = {
|
|
|
299
307
|
"data-testid": "baseline",
|
|
300
308
|
"aria-hidden": "true"
|
|
301
309
|
});
|
|
302
|
-
return l ? h : /* @__PURE__ */ b(
|
|
310
|
+
return l ? h : /* @__PURE__ */ b(z, {
|
|
303
311
|
fallback: h,
|
|
304
|
-
children: /* @__PURE__ */ b(
|
|
312
|
+
children: /* @__PURE__ */ b(U, {
|
|
305
313
|
className: e,
|
|
306
314
|
debugging: t,
|
|
307
315
|
style: r,
|
|
@@ -313,7 +321,7 @@ var B = {
|
|
|
313
321
|
...u
|
|
314
322
|
})
|
|
315
323
|
});
|
|
316
|
-
}),
|
|
324
|
+
}), G = {
|
|
317
325
|
gde: "gde_4PKz3",
|
|
318
326
|
v: "v_yAvN0",
|
|
319
327
|
h: "h_XcWcy",
|
|
@@ -321,10 +329,10 @@ var B = {
|
|
|
321
329
|
cols: "cols_ibtT4",
|
|
322
330
|
col: "col_QPSDI",
|
|
323
331
|
ssr: "ssr_4UN4k"
|
|
324
|
-
},
|
|
325
|
-
let g =
|
|
332
|
+
}, ee = p.memo(function({ className: e, debugging: t, style: r, variant: i, align: a = "center", gap: o, height: s, width: c, columns: l, columnWidth: u, maxWidth: d, color: f, children: p, ssrMode: m = !1, ...h }) {
|
|
333
|
+
let g = I("guide"), _ = i ?? g.variant, v = typeof o == "number" ? o : 0, { isShown: y } = L(t, g.debugging);
|
|
326
334
|
if (!y) return /* @__PURE__ */ b("div", {
|
|
327
|
-
className: n(
|
|
335
|
+
className: n(G.gde, G.h, e),
|
|
328
336
|
style: r,
|
|
329
337
|
"data-testid": "guide",
|
|
330
338
|
"data-variant": _,
|
|
@@ -333,7 +341,7 @@ var B = {
|
|
|
333
341
|
children: p
|
|
334
342
|
});
|
|
335
343
|
let x = /* @__PURE__ */ b("div", {
|
|
336
|
-
className: n(
|
|
344
|
+
className: n(G.gde, G.h, G.ssr, e),
|
|
337
345
|
style: {
|
|
338
346
|
width: c ?? "100%",
|
|
339
347
|
height: s ?? "100%",
|
|
@@ -345,9 +353,9 @@ var B = {
|
|
|
345
353
|
"aria-hidden": "true",
|
|
346
354
|
children: p
|
|
347
355
|
});
|
|
348
|
-
return m ? x : /* @__PURE__ */ b(
|
|
356
|
+
return m ? x : /* @__PURE__ */ b(z, {
|
|
349
357
|
fallback: x,
|
|
350
|
-
children: /* @__PURE__ */ b(
|
|
358
|
+
children: /* @__PURE__ */ b(te, {
|
|
351
359
|
className: e,
|
|
352
360
|
debugging: t,
|
|
353
361
|
style: r,
|
|
@@ -364,10 +372,10 @@ var B = {
|
|
|
364
372
|
children: p
|
|
365
373
|
})
|
|
366
374
|
});
|
|
367
|
-
}),
|
|
368
|
-
let v =
|
|
369
|
-
|
|
370
|
-
let C = a ?? v.variant, w = typeof s == "number" ? s : 0, { template: T, columnsCount: E, calculatedGap: D } =
|
|
375
|
+
}), te = p.memo(function({ className: e, debugging: r, style: i, variant: a, align: o = "center", gap: s, height: l, width: u, columns: d, columnWidth: f, maxWidth: m, color: h, children: g, ..._ }) {
|
|
376
|
+
let v = I("guide"), { isShown: y } = L(r, v.debugging), S = p.useRef(null);
|
|
377
|
+
A(S);
|
|
378
|
+
let C = a ?? v.variant, w = typeof s == "number" ? s : 0, { template: T, columnsCount: E, calculatedGap: D } = F(S, p.useMemo(() => t({
|
|
371
379
|
variant: C,
|
|
372
380
|
base: v.base,
|
|
373
381
|
gap: w,
|
|
@@ -379,7 +387,7 @@ var B = {
|
|
|
379
387
|
w,
|
|
380
388
|
d,
|
|
381
389
|
f
|
|
382
|
-
])),
|
|
390
|
+
])), O = p.useMemo(() => c({
|
|
383
391
|
base: v.base,
|
|
384
392
|
colors: v.colors,
|
|
385
393
|
variant: C,
|
|
@@ -407,28 +415,27 @@ var B = {
|
|
|
407
415
|
E,
|
|
408
416
|
D,
|
|
409
417
|
y
|
|
410
|
-
]),
|
|
418
|
+
]), k = p.useMemo(() => B(O.containerStyle, i), [O.containerStyle, i]);
|
|
411
419
|
return /* @__PURE__ */ x("div", {
|
|
412
420
|
ref: S,
|
|
413
421
|
"data-testid": "guide",
|
|
414
422
|
"aria-hidden": "true",
|
|
415
|
-
className: n(...
|
|
423
|
+
className: n(...O.classTokens.map((e) => G[e]), e),
|
|
416
424
|
"data-variant": a,
|
|
417
|
-
style:
|
|
425
|
+
style: k,
|
|
418
426
|
..._,
|
|
419
427
|
children: [y && /* @__PURE__ */ b("div", {
|
|
420
|
-
className:
|
|
428
|
+
className: G.cols,
|
|
421
429
|
"data-variant": a,
|
|
422
|
-
children: !
|
|
423
|
-
className:
|
|
430
|
+
children: !O.isLineVariant && Array.from({ length: O.columnsCount }, (e, t) => /* @__PURE__ */ b("div", {
|
|
431
|
+
className: G.col,
|
|
424
432
|
"data-column-index": t,
|
|
425
|
-
"data-variant": a
|
|
426
|
-
style: { backgroundColor: k.columnColor }
|
|
433
|
+
"data-variant": a
|
|
427
434
|
}, t))
|
|
428
435
|
}), g]
|
|
429
436
|
});
|
|
430
437
|
}), K = typeof window > "u";
|
|
431
|
-
function
|
|
438
|
+
function ne(e, t) {
|
|
432
439
|
if (K) return t;
|
|
433
440
|
try {
|
|
434
441
|
return e();
|
|
@@ -436,15 +443,16 @@ function q(e, t) {
|
|
|
436
443
|
return t;
|
|
437
444
|
}
|
|
438
445
|
}
|
|
439
|
-
function
|
|
446
|
+
function q(e, t, n) {
|
|
440
447
|
return !e || K ? t : n;
|
|
441
448
|
}
|
|
442
|
-
var
|
|
449
|
+
var J = {
|
|
443
450
|
spr: "spr_syfhf",
|
|
444
451
|
line: "line_nzGsp",
|
|
445
|
-
flat: "flat_XJWHt"
|
|
452
|
+
flat: "flat_XJWHt",
|
|
453
|
+
indicator: "indicator_inw1x"
|
|
446
454
|
}, Y = p.memo(function({ height: e, width: t, indicatorNode: r, debugging: i, variant: a, base: o, color: c, className: l, style: u, children: d, ssrMode: f = !1, ...m }) {
|
|
447
|
-
let h = p.useRef(null), g =
|
|
455
|
+
let h = p.useRef(null), g = I("spacer"), { isShown: _ } = L(i, g.debugging), v = a ?? g.variant, S = o ?? g.base, C = R(), w = p.useMemo(() => s({
|
|
448
456
|
base: S,
|
|
449
457
|
colors: g.colors,
|
|
450
458
|
width: t,
|
|
@@ -460,13 +468,15 @@ var ee = {
|
|
|
460
468
|
c,
|
|
461
469
|
v,
|
|
462
470
|
_
|
|
463
|
-
]), T =
|
|
471
|
+
]), T = q(C && !f, !1, _ && r !== void 0), E = p.useMemo(() => {
|
|
464
472
|
if (!T) return null;
|
|
465
473
|
let e = w.normWidth, t = w.normHeight;
|
|
466
474
|
return /* @__PURE__ */ x(y, { children: [t !== 0 && /* @__PURE__ */ b("span", {
|
|
475
|
+
className: J.indicator,
|
|
467
476
|
"aria-hidden": "true",
|
|
468
477
|
children: r(t, "height")
|
|
469
478
|
}, "height"), e !== 0 && /* @__PURE__ */ b("span", {
|
|
479
|
+
className: J.indicator,
|
|
470
480
|
"aria-hidden": "true",
|
|
471
481
|
children: r(e, "width")
|
|
472
482
|
}, "width")] });
|
|
@@ -475,11 +485,11 @@ var ee = {
|
|
|
475
485
|
r,
|
|
476
486
|
w.normWidth,
|
|
477
487
|
w.normHeight
|
|
478
|
-
]), D = p.useMemo(() =>
|
|
488
|
+
]), D = p.useMemo(() => B(w.style, u), [w.style, u]);
|
|
479
489
|
return /* @__PURE__ */ x("div", {
|
|
480
490
|
ref: h,
|
|
481
491
|
"data-testid": "spacer",
|
|
482
|
-
className: n(...w.classTokens.map((e) =>
|
|
492
|
+
className: n(...w.classTokens.map((e) => J[e]), l),
|
|
483
493
|
"data-variant": v,
|
|
484
494
|
"data-height": typeof w.normHeight == "number" ? `${w.normHeight}px` : w.normHeight,
|
|
485
495
|
style: D,
|
|
@@ -488,11 +498,9 @@ var ee = {
|
|
|
488
498
|
});
|
|
489
499
|
}), X = {
|
|
490
500
|
pad: "pad_NizuS",
|
|
491
|
-
|
|
492
|
-
line: "line_7S7iI",
|
|
493
|
-
stk: "stk_X79YA",
|
|
501
|
+
content: "content_xFX0U",
|
|
494
502
|
v: "v_dowAz"
|
|
495
|
-
},
|
|
503
|
+
}, re = (e, t, n) => {
|
|
496
504
|
let r = e || "line", i = t || "none", a = (e, t) => /* @__PURE__ */ b(Y, {
|
|
497
505
|
variant: r,
|
|
498
506
|
debugging: t === 0 || e === 0 ? "none" : i,
|
|
@@ -501,11 +509,11 @@ var ee = {
|
|
|
501
509
|
width: e === "100%" ? void 0 : e
|
|
502
510
|
});
|
|
503
511
|
return a.displayName = "PadderSpacer", a;
|
|
504
|
-
}, Z = { gridColumn: "1 / -1" }, Q = { gridRow: "2 / 3" },
|
|
512
|
+
}, Z = { gridColumn: "1 / -1" }, Q = { gridRow: "2 / 3" }, ie = {
|
|
505
513
|
gridRow: "2 / 3",
|
|
506
514
|
gridColumn: "2 / 3"
|
|
507
515
|
}, $ = p.memo(p.forwardRef(function({ children: e, className: t, debugging: i, height: a, indicatorNode: o, style: s, width: c, ssrMode: l = !1, ...u }, d) {
|
|
508
|
-
let m =
|
|
516
|
+
let m = I("padder"), { variant: h } = I("spacer"), g = p.useMemo(() => r(u), [u]), { isShown: _, isNone: v, debugging: S } = L(i, m.debugging), C = !v, w = R(), T = p.useRef(null), E = N(T, {
|
|
509
517
|
base: m.base,
|
|
510
518
|
snapping: "height",
|
|
511
519
|
spacing: g
|
|
@@ -514,7 +522,7 @@ var ee = {
|
|
|
514
522
|
right: g.right || 0,
|
|
515
523
|
bottom: g.bottom || 0,
|
|
516
524
|
left: g.left || 0
|
|
517
|
-
} }, { padding: O } =
|
|
525
|
+
} }, { padding: O } = q(w && !l, D, E), k = V(d, T), A = p.useMemo(() => f({
|
|
518
526
|
base: m.base,
|
|
519
527
|
color: m.color,
|
|
520
528
|
width: c,
|
|
@@ -530,7 +538,7 @@ var ee = {
|
|
|
530
538
|
O,
|
|
531
539
|
C,
|
|
532
540
|
_
|
|
533
|
-
]),
|
|
541
|
+
]), j = p.useMemo(() => B(A.containerStyle, s), [A.containerStyle, s]), M = p.useMemo(() => re(h, S, o), [
|
|
534
542
|
h,
|
|
535
543
|
S,
|
|
536
544
|
o
|
|
@@ -539,92 +547,95 @@ var ee = {
|
|
|
539
547
|
ref: k,
|
|
540
548
|
"data-testid": "padder",
|
|
541
549
|
className: n(...A.classTokens.map((e) => X[e]), t),
|
|
542
|
-
style:
|
|
550
|
+
style: j,
|
|
543
551
|
children: [
|
|
544
552
|
/* @__PURE__ */ x(y, { children: [O.top >= 0 && /* @__PURE__ */ b("div", {
|
|
545
553
|
style: Z,
|
|
546
|
-
children:
|
|
554
|
+
children: M("100%", O.top)
|
|
547
555
|
}), O.left >= 0 && /* @__PURE__ */ b("div", {
|
|
548
556
|
style: Q,
|
|
549
|
-
children:
|
|
557
|
+
children: M(O.left, "100%")
|
|
550
558
|
})] }),
|
|
551
559
|
/* @__PURE__ */ b("div", {
|
|
552
|
-
|
|
560
|
+
"data-testid": "padder-content",
|
|
561
|
+
className: X.content,
|
|
562
|
+
style: ie,
|
|
553
563
|
children: e
|
|
554
564
|
}),
|
|
555
565
|
/* @__PURE__ */ x(y, { children: [O.right >= 0 && /* @__PURE__ */ b("div", {
|
|
556
566
|
style: Q,
|
|
557
|
-
children:
|
|
567
|
+
children: M(O.right, "100%")
|
|
558
568
|
}), O.bottom >= 0 && /* @__PURE__ */ b("div", {
|
|
559
569
|
style: Z,
|
|
560
|
-
children:
|
|
570
|
+
children: M("100%", O.bottom)
|
|
561
571
|
})] })
|
|
562
572
|
]
|
|
563
573
|
}) : /* @__PURE__ */ b("div", {
|
|
564
574
|
ref: k,
|
|
565
575
|
"data-testid": "padder",
|
|
566
576
|
className: n(...A.classTokens.map((e) => X[e]), t),
|
|
567
|
-
style:
|
|
577
|
+
style: j,
|
|
568
578
|
children: e
|
|
569
579
|
});
|
|
570
|
-
})),
|
|
580
|
+
})), ae = {
|
|
571
581
|
box: "box_sPqFs",
|
|
572
582
|
v: "v_ZrZ5j"
|
|
573
|
-
},
|
|
574
|
-
let
|
|
575
|
-
base:
|
|
583
|
+
}, oe = p.memo(p.forwardRef(function({ children: e, snapping: t = "clamp", snapEdge: i = "bottom", debugging: a, className: o, colSpan: s, rowSpan: c, span: l, width: d, height: f, style: m, ssrMode: h = !1, ...g }, _) {
|
|
584
|
+
let v = I("box"), { isShown: y, debugging: x } = L(a, v.debugging), S = R(), C = p.useRef(null), { top: w, bottom: T, left: D, right: O } = r(g), k = N(C, {
|
|
585
|
+
base: v.base,
|
|
576
586
|
snapping: t,
|
|
587
|
+
snapEdge: i,
|
|
577
588
|
spacing: {
|
|
578
|
-
top:
|
|
589
|
+
top: w,
|
|
579
590
|
bottom: T,
|
|
580
|
-
left:
|
|
581
|
-
right:
|
|
591
|
+
left: D,
|
|
592
|
+
right: O
|
|
582
593
|
}
|
|
583
|
-
}), { padding:
|
|
584
|
-
top:
|
|
585
|
-
right:
|
|
594
|
+
}), { padding: A } = q(S && !h, { padding: {
|
|
595
|
+
top: w || 0,
|
|
596
|
+
right: O || 0,
|
|
586
597
|
bottom: T || 0,
|
|
587
|
-
left:
|
|
588
|
-
} },
|
|
589
|
-
base:
|
|
590
|
-
lineColor:
|
|
591
|
-
width:
|
|
592
|
-
height:
|
|
593
|
-
span:
|
|
594
|
-
colSpan:
|
|
595
|
-
rowSpan:
|
|
596
|
-
isVisible:
|
|
598
|
+
left: D || 0
|
|
599
|
+
} }, k), j = p.useMemo(() => u({
|
|
600
|
+
base: v.base,
|
|
601
|
+
lineColor: v.colors.line,
|
|
602
|
+
width: d,
|
|
603
|
+
height: f,
|
|
604
|
+
span: l,
|
|
605
|
+
colSpan: s,
|
|
606
|
+
rowSpan: c,
|
|
607
|
+
isVisible: y
|
|
597
608
|
}), [
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
l,
|
|
609
|
+
v.base,
|
|
610
|
+
v.colors.line,
|
|
601
611
|
d,
|
|
602
|
-
|
|
603
|
-
|
|
612
|
+
f,
|
|
613
|
+
l,
|
|
604
614
|
s,
|
|
605
|
-
|
|
606
|
-
|
|
615
|
+
c,
|
|
616
|
+
y
|
|
617
|
+
]), M = p.useMemo(() => B(j.boxStyle, m), [j.boxStyle, m]);
|
|
607
618
|
return /* @__PURE__ */ b("div", {
|
|
608
|
-
ref:
|
|
619
|
+
ref: V(_, C),
|
|
609
620
|
"data-testid": "box",
|
|
610
|
-
className: n(...
|
|
611
|
-
style:
|
|
612
|
-
children: /* @__PURE__ */ b(
|
|
621
|
+
className: n(...j.classTokens.map((e) => ae[e]), o),
|
|
622
|
+
style: B(M, j.gridSpanStyle),
|
|
623
|
+
children: /* @__PURE__ */ b(E, {
|
|
613
624
|
base: 1,
|
|
614
625
|
spacer: { variant: "flat" },
|
|
615
626
|
children: /* @__PURE__ */ b($, {
|
|
616
|
-
block: [
|
|
617
|
-
inline: [
|
|
627
|
+
block: [A.top, A.bottom],
|
|
628
|
+
inline: [A.left, A.right],
|
|
618
629
|
width: "fit-content",
|
|
619
|
-
height:
|
|
620
|
-
debugging:
|
|
621
|
-
ssrMode:
|
|
630
|
+
height: f,
|
|
631
|
+
debugging: x,
|
|
632
|
+
ssrMode: !0,
|
|
622
633
|
children: e
|
|
623
634
|
})
|
|
624
635
|
})
|
|
625
636
|
});
|
|
626
637
|
}));
|
|
627
638
|
//#endregion
|
|
628
|
-
export {
|
|
639
|
+
export { W as Baseline, oe as Box, E as Config, ee as Guide, $ as Padder, Y as Spacer, K as isSSR, ne as safeClientValue };
|
|
629
640
|
|
|
630
641
|
//# sourceMappingURL=index.mjs.map
|