baseline-kit 5.0.0 → 5.1.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 +235 -0
- package/README.md +223 -353
- package/dist/baseline-kit.css +5 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +18 -8
- 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 +18 -11
- package/dist/index.mjs +126 -120
- 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 +177 -0
- package/dist/remix.mjs +989 -0
- package/dist/remix.mjs.map +1 -0
- package/dist/src-C-1u5WNS.cjs +2 -0
- package/dist/src-C-1u5WNS.cjs.map +1 -0
- package/dist/{src-QHaSfgVe.js → src-C3TICsw6.js} +88 -160
- package/dist/src-C3TICsw6.js.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.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -85,19 +84,27 @@ type ConfigSchema = {
|
|
|
85
84
|
};
|
|
86
85
|
};
|
|
87
86
|
|
|
88
|
-
type
|
|
89
|
-
|
|
87
|
+
type PartialColors<T> = T extends {
|
|
88
|
+
colors: infer Colors;
|
|
89
|
+
} ? Omit<Partial<T>, 'colors'> & {
|
|
90
|
+
colors?: Partial<Colors>;
|
|
91
|
+
} : Partial<T>;
|
|
92
|
+
type ConfigOverrides = {
|
|
90
93
|
base?: number;
|
|
91
|
-
baseline?:
|
|
92
|
-
guide?:
|
|
93
|
-
spacer?:
|
|
94
|
-
box?:
|
|
94
|
+
baseline?: PartialColors<ConfigSchema['baseline']>;
|
|
95
|
+
guide?: PartialColors<ConfigSchema['guide']>;
|
|
96
|
+
spacer?: PartialColors<ConfigSchema['spacer']>;
|
|
97
|
+
box?: PartialColors<ConfigSchema['box']>;
|
|
95
98
|
padder?: Partial<ConfigSchema['padder']>;
|
|
96
99
|
};
|
|
100
|
+
|
|
101
|
+
type ConfigProps = ConfigOverrides & {
|
|
102
|
+
children: React.ReactNode;
|
|
103
|
+
};
|
|
97
104
|
/**
|
|
98
105
|
* Configuration provider for baseline-kit components.
|
|
99
106
|
*/
|
|
100
|
-
declare function Config({ children, base, baseline, guide, spacer, box, padder, }: ConfigProps):
|
|
107
|
+
declare function Config({ children, base, baseline, guide, spacer, box, padder, }: ConfigProps): React.JSX.Element;
|
|
101
108
|
|
|
102
109
|
/**
|
|
103
110
|
* Common props shared across library components.
|
|
@@ -118,7 +125,7 @@ type BaselineProps = {
|
|
|
118
125
|
color?: string;
|
|
119
126
|
ssrMode?: boolean;
|
|
120
127
|
} & ComponentsProps;
|
|
121
|
-
declare const Baseline: React.
|
|
128
|
+
declare const Baseline: React.MemoExoticComponent<({ className, debugging, style, variant: variantProp, height: heightProp, width: widthProp, base: baseProp, color: colorProp, ssrMode, ...spacingProps }: BaselineProps) => React.JSX.Element>;
|
|
122
129
|
|
|
123
130
|
type GuideProps = {
|
|
124
131
|
align?: React.CSSProperties['justifyContent'];
|
|
@@ -131,7 +138,7 @@ type GuideProps = {
|
|
|
131
138
|
gap?: number;
|
|
132
139
|
ssrMode?: boolean;
|
|
133
140
|
} & ComponentsProps & Omit<GuideConfig, 'columns' | 'columnWidth' | 'gap'>;
|
|
134
|
-
declare const Guide: React.
|
|
141
|
+
declare const Guide: React.MemoExoticComponent<({ className, debugging, style, variant: variantProp, align, gap: gapProp, height, width, columns, columnWidth, maxWidth, color, children, ssrMode, ...props }: GuideProps) => React.JSX.Element>;
|
|
135
142
|
|
|
136
143
|
type BoxProps = {
|
|
137
144
|
colSpan?: number;
|
|
@@ -167,7 +174,7 @@ type SpacerProps = {
|
|
|
167
174
|
indicatorNode?: IndicatorNode;
|
|
168
175
|
ssrMode?: boolean;
|
|
169
176
|
} & ComponentsProps;
|
|
170
|
-
declare const Spacer: React.
|
|
177
|
+
declare const Spacer: React.MemoExoticComponent<({ height: heightProp, width: widthProp, indicatorNode, debugging: debuggingProp, variant: variantProp, base: baseProp, color: colorProp, className, style, children, ssrMode, ...props }: SpacerProps) => React.JSX.Element>;
|
|
171
178
|
|
|
172
179
|
type PadderProps = {
|
|
173
180
|
indicatorNode?: IndicatorNode;
|
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-C3TICsw6.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,9 +149,9 @@ 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", spacing: i = {} } = {}) {
|
|
149
153
|
if (t < 1) throw Error("Base must be >= 1 for baseline alignment.");
|
|
150
|
-
let { height: a } =
|
|
154
|
+
let { height: a } = A(e), s = p.useRef(null);
|
|
151
155
|
return p.useMemo(() => {
|
|
152
156
|
let e = r({ padding: i }), c = a % t === 0;
|
|
153
157
|
if (n === "none") return {
|
|
@@ -180,7 +184,7 @@ function j(e, { base: t = 8, snapping: n = "none", spacing: i = {} } = {}) {
|
|
|
180
184
|
}
|
|
181
185
|
//#endregion
|
|
182
186
|
//#region packages/dom/src/viewport.ts
|
|
183
|
-
function
|
|
187
|
+
function P() {
|
|
184
188
|
return typeof window > "u" ? {} : {
|
|
185
189
|
viewportWidth: window.innerWidth,
|
|
186
190
|
viewportHeight: window.innerHeight
|
|
@@ -188,24 +192,24 @@ function M() {
|
|
|
188
192
|
}
|
|
189
193
|
//#endregion
|
|
190
194
|
//#region packages/react/src/hooks/useGuide.ts
|
|
191
|
-
function
|
|
192
|
-
let { width: n } =
|
|
193
|
-
return p.useMemo(() => d(n, t,
|
|
195
|
+
function F(e, t) {
|
|
196
|
+
let { width: n } = A(e);
|
|
197
|
+
return p.useMemo(() => d(n, t, P()), [t, n]);
|
|
194
198
|
}
|
|
195
199
|
//#endregion
|
|
196
200
|
//#region packages/react/src/hooks/useConfig.ts
|
|
197
|
-
function
|
|
198
|
-
let t =
|
|
201
|
+
function I(e) {
|
|
202
|
+
let t = T();
|
|
199
203
|
return _(() => Object.assign({ base: t.base }, t[e]), [t, e]);
|
|
200
204
|
}
|
|
201
205
|
//#endregion
|
|
202
206
|
//#region packages/react/src/hooks/useDebug.ts
|
|
203
|
-
function
|
|
207
|
+
function L(e, t) {
|
|
204
208
|
return _(() => l(e, t), [e, t]);
|
|
205
209
|
}
|
|
206
210
|
//#endregion
|
|
207
211
|
//#region packages/react/src/hooks/useIsClient.ts
|
|
208
|
-
function
|
|
212
|
+
function R() {
|
|
209
213
|
let [e, t] = v(!1);
|
|
210
214
|
return h(() => {
|
|
211
215
|
t(!0);
|
|
@@ -213,29 +217,29 @@ function I() {
|
|
|
213
217
|
}
|
|
214
218
|
//#endregion
|
|
215
219
|
//#region packages/react/src/utils/ssr.tsx
|
|
216
|
-
function
|
|
217
|
-
return
|
|
220
|
+
function z({ children: e, fallback: t = null }) {
|
|
221
|
+
return R() ? /* @__PURE__ */ b(y, { children: e }) : /* @__PURE__ */ b(y, { children: t });
|
|
218
222
|
}
|
|
219
223
|
//#endregion
|
|
220
224
|
//#region packages/react/src/utils/merge.ts
|
|
221
|
-
function
|
|
225
|
+
function B(...e) {
|
|
222
226
|
return Object.assign({}, ...e.filter(Boolean));
|
|
223
227
|
}
|
|
224
|
-
function
|
|
228
|
+
function V(...e) {
|
|
225
229
|
return (t) => {
|
|
226
230
|
e.forEach((e) => {
|
|
227
231
|
e && (typeof e == "function" ? e(t) : Object.assign(e, { current: t }));
|
|
228
232
|
});
|
|
229
233
|
};
|
|
230
234
|
}
|
|
231
|
-
var
|
|
235
|
+
var H = {
|
|
232
236
|
bas: "bas_4Emvv",
|
|
233
237
|
v: "v_lNfeX",
|
|
234
238
|
h: "h_PbNDU",
|
|
235
239
|
row: "row_J1Wva",
|
|
236
240
|
ssr: "ssr_PQAP-"
|
|
237
|
-
},
|
|
238
|
-
let d =
|
|
241
|
+
}, U = p.memo(function({ className: e, debugging: t, style: r, variant: a, height: o, width: s, base: c, color: l, ...u }) {
|
|
242
|
+
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
243
|
base: _,
|
|
240
244
|
colors: d.colors,
|
|
241
245
|
variant: a ?? d.variant,
|
|
@@ -258,39 +262,39 @@ var B = {
|
|
|
258
262
|
g,
|
|
259
263
|
u,
|
|
260
264
|
f
|
|
261
|
-
]), { start: y, end: x } =
|
|
265
|
+
]), { start: y, end: x } = M({
|
|
262
266
|
totalLines: v.rowCount,
|
|
263
267
|
lineHeight: _,
|
|
264
268
|
containerRef: m,
|
|
265
269
|
buffer: 160
|
|
266
|
-
}), S = p.useMemo(() =>
|
|
270
|
+
}), S = p.useMemo(() => B(v.containerStyle, r), [v.containerStyle, r]);
|
|
267
271
|
return /* @__PURE__ */ b("div", {
|
|
268
272
|
ref: m,
|
|
269
273
|
"data-testid": "baseline",
|
|
270
274
|
"aria-hidden": "true",
|
|
271
|
-
className: n(...v.classTokens.map((e) =>
|
|
275
|
+
className: n(...v.classTokens.map((e) => H[e]), e),
|
|
272
276
|
style: S,
|
|
273
277
|
...u,
|
|
274
278
|
children: f && Array.from({ length: x - y }, (e, t) => {
|
|
275
279
|
let n = t + y;
|
|
276
280
|
return /* @__PURE__ */ b("div", {
|
|
277
|
-
className:
|
|
281
|
+
className: H.row,
|
|
278
282
|
"data-row-index": n,
|
|
279
283
|
style: v.getRowStyle(n)
|
|
280
284
|
}, n);
|
|
281
285
|
})
|
|
282
286
|
});
|
|
283
|
-
}),
|
|
284
|
-
let d =
|
|
287
|
+
}), W = p.memo(function({ className: e, debugging: t, style: r, variant: i, height: a, width: o, base: s, color: c, ssrMode: l = !1, ...u }) {
|
|
288
|
+
let d = I("baseline"), f = i ?? d.variant, p = s ?? d.base, { isShown: m } = L(t, d.debugging);
|
|
285
289
|
if (!m) return /* @__PURE__ */ b("div", {
|
|
286
|
-
className: n(
|
|
290
|
+
className: n(H.bas, H.h, e),
|
|
287
291
|
style: r,
|
|
288
292
|
"data-testid": "baseline",
|
|
289
293
|
"aria-hidden": "true",
|
|
290
294
|
...u
|
|
291
295
|
});
|
|
292
296
|
let h = /* @__PURE__ */ b("div", {
|
|
293
|
-
className: n(
|
|
297
|
+
className: n(H.bas, H.h, H.ssr, e),
|
|
294
298
|
style: {
|
|
295
299
|
width: o ?? "100%",
|
|
296
300
|
height: a ?? "100%",
|
|
@@ -299,9 +303,9 @@ var B = {
|
|
|
299
303
|
"data-testid": "baseline",
|
|
300
304
|
"aria-hidden": "true"
|
|
301
305
|
});
|
|
302
|
-
return l ? h : /* @__PURE__ */ b(
|
|
306
|
+
return l ? h : /* @__PURE__ */ b(z, {
|
|
303
307
|
fallback: h,
|
|
304
|
-
children: /* @__PURE__ */ b(
|
|
308
|
+
children: /* @__PURE__ */ b(U, {
|
|
305
309
|
className: e,
|
|
306
310
|
debugging: t,
|
|
307
311
|
style: r,
|
|
@@ -313,7 +317,7 @@ var B = {
|
|
|
313
317
|
...u
|
|
314
318
|
})
|
|
315
319
|
});
|
|
316
|
-
}),
|
|
320
|
+
}), G = {
|
|
317
321
|
gde: "gde_4PKz3",
|
|
318
322
|
v: "v_yAvN0",
|
|
319
323
|
h: "h_XcWcy",
|
|
@@ -321,10 +325,10 @@ var B = {
|
|
|
321
325
|
cols: "cols_ibtT4",
|
|
322
326
|
col: "col_QPSDI",
|
|
323
327
|
ssr: "ssr_4UN4k"
|
|
324
|
-
},
|
|
325
|
-
let g =
|
|
328
|
+
}, 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 }) {
|
|
329
|
+
let g = I("guide"), _ = i ?? g.variant, v = typeof o == "number" ? o : 0, { isShown: y } = L(t, g.debugging);
|
|
326
330
|
if (!y) return /* @__PURE__ */ b("div", {
|
|
327
|
-
className: n(
|
|
331
|
+
className: n(G.gde, G.h, e),
|
|
328
332
|
style: r,
|
|
329
333
|
"data-testid": "guide",
|
|
330
334
|
"data-variant": _,
|
|
@@ -333,7 +337,7 @@ var B = {
|
|
|
333
337
|
children: p
|
|
334
338
|
});
|
|
335
339
|
let x = /* @__PURE__ */ b("div", {
|
|
336
|
-
className: n(
|
|
340
|
+
className: n(G.gde, G.h, G.ssr, e),
|
|
337
341
|
style: {
|
|
338
342
|
width: c ?? "100%",
|
|
339
343
|
height: s ?? "100%",
|
|
@@ -345,9 +349,9 @@ var B = {
|
|
|
345
349
|
"aria-hidden": "true",
|
|
346
350
|
children: p
|
|
347
351
|
});
|
|
348
|
-
return m ? x : /* @__PURE__ */ b(
|
|
352
|
+
return m ? x : /* @__PURE__ */ b(z, {
|
|
349
353
|
fallback: x,
|
|
350
|
-
children: /* @__PURE__ */ b(
|
|
354
|
+
children: /* @__PURE__ */ b(te, {
|
|
351
355
|
className: e,
|
|
352
356
|
debugging: t,
|
|
353
357
|
style: r,
|
|
@@ -364,10 +368,10 @@ var B = {
|
|
|
364
368
|
children: p
|
|
365
369
|
})
|
|
366
370
|
});
|
|
367
|
-
}),
|
|
368
|
-
let v =
|
|
369
|
-
|
|
370
|
-
let C = a ?? v.variant, w = typeof s == "number" ? s : 0, { template: T, columnsCount: E, calculatedGap: D } =
|
|
371
|
+
}), 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, ..._ }) {
|
|
372
|
+
let v = I("guide"), { isShown: y } = L(r, v.debugging), S = p.useRef(null);
|
|
373
|
+
A(S);
|
|
374
|
+
let C = a ?? v.variant, w = typeof s == "number" ? s : 0, { template: T, columnsCount: E, calculatedGap: D } = F(S, p.useMemo(() => t({
|
|
371
375
|
variant: C,
|
|
372
376
|
base: v.base,
|
|
373
377
|
gap: w,
|
|
@@ -379,7 +383,7 @@ var B = {
|
|
|
379
383
|
w,
|
|
380
384
|
d,
|
|
381
385
|
f
|
|
382
|
-
])),
|
|
386
|
+
])), O = p.useMemo(() => c({
|
|
383
387
|
base: v.base,
|
|
384
388
|
colors: v.colors,
|
|
385
389
|
variant: C,
|
|
@@ -407,28 +411,27 @@ var B = {
|
|
|
407
411
|
E,
|
|
408
412
|
D,
|
|
409
413
|
y
|
|
410
|
-
]),
|
|
414
|
+
]), k = p.useMemo(() => B(O.containerStyle, i), [O.containerStyle, i]);
|
|
411
415
|
return /* @__PURE__ */ x("div", {
|
|
412
416
|
ref: S,
|
|
413
417
|
"data-testid": "guide",
|
|
414
418
|
"aria-hidden": "true",
|
|
415
|
-
className: n(...
|
|
419
|
+
className: n(...O.classTokens.map((e) => G[e]), e),
|
|
416
420
|
"data-variant": a,
|
|
417
|
-
style:
|
|
421
|
+
style: k,
|
|
418
422
|
..._,
|
|
419
423
|
children: [y && /* @__PURE__ */ b("div", {
|
|
420
|
-
className:
|
|
424
|
+
className: G.cols,
|
|
421
425
|
"data-variant": a,
|
|
422
|
-
children: !
|
|
423
|
-
className:
|
|
426
|
+
children: !O.isLineVariant && Array.from({ length: O.columnsCount }, (e, t) => /* @__PURE__ */ b("div", {
|
|
427
|
+
className: G.col,
|
|
424
428
|
"data-column-index": t,
|
|
425
|
-
"data-variant": a
|
|
426
|
-
style: { backgroundColor: k.columnColor }
|
|
429
|
+
"data-variant": a
|
|
427
430
|
}, t))
|
|
428
431
|
}), g]
|
|
429
432
|
});
|
|
430
433
|
}), K = typeof window > "u";
|
|
431
|
-
function
|
|
434
|
+
function ne(e, t) {
|
|
432
435
|
if (K) return t;
|
|
433
436
|
try {
|
|
434
437
|
return e();
|
|
@@ -436,15 +439,16 @@ function q(e, t) {
|
|
|
436
439
|
return t;
|
|
437
440
|
}
|
|
438
441
|
}
|
|
439
|
-
function
|
|
442
|
+
function q(e, t, n) {
|
|
440
443
|
return !e || K ? t : n;
|
|
441
444
|
}
|
|
442
|
-
var
|
|
445
|
+
var J = {
|
|
443
446
|
spr: "spr_syfhf",
|
|
444
447
|
line: "line_nzGsp",
|
|
445
|
-
flat: "flat_XJWHt"
|
|
448
|
+
flat: "flat_XJWHt",
|
|
449
|
+
indicator: "indicator_inw1x"
|
|
446
450
|
}, 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 =
|
|
451
|
+
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
452
|
base: S,
|
|
449
453
|
colors: g.colors,
|
|
450
454
|
width: t,
|
|
@@ -460,13 +464,15 @@ var ee = {
|
|
|
460
464
|
c,
|
|
461
465
|
v,
|
|
462
466
|
_
|
|
463
|
-
]), T =
|
|
467
|
+
]), T = q(C && !f, !1, _ && r !== void 0), E = p.useMemo(() => {
|
|
464
468
|
if (!T) return null;
|
|
465
469
|
let e = w.normWidth, t = w.normHeight;
|
|
466
470
|
return /* @__PURE__ */ x(y, { children: [t !== 0 && /* @__PURE__ */ b("span", {
|
|
471
|
+
className: J.indicator,
|
|
467
472
|
"aria-hidden": "true",
|
|
468
473
|
children: r(t, "height")
|
|
469
474
|
}, "height"), e !== 0 && /* @__PURE__ */ b("span", {
|
|
475
|
+
className: J.indicator,
|
|
470
476
|
"aria-hidden": "true",
|
|
471
477
|
children: r(e, "width")
|
|
472
478
|
}, "width")] });
|
|
@@ -475,11 +481,11 @@ var ee = {
|
|
|
475
481
|
r,
|
|
476
482
|
w.normWidth,
|
|
477
483
|
w.normHeight
|
|
478
|
-
]), D = p.useMemo(() =>
|
|
484
|
+
]), D = p.useMemo(() => B(w.style, u), [w.style, u]);
|
|
479
485
|
return /* @__PURE__ */ x("div", {
|
|
480
486
|
ref: h,
|
|
481
487
|
"data-testid": "spacer",
|
|
482
|
-
className: n(...w.classTokens.map((e) =>
|
|
488
|
+
className: n(...w.classTokens.map((e) => J[e]), l),
|
|
483
489
|
"data-variant": v,
|
|
484
490
|
"data-height": typeof w.normHeight == "number" ? `${w.normHeight}px` : w.normHeight,
|
|
485
491
|
style: D,
|
|
@@ -488,11 +494,9 @@ var ee = {
|
|
|
488
494
|
});
|
|
489
495
|
}), X = {
|
|
490
496
|
pad: "pad_NizuS",
|
|
491
|
-
|
|
492
|
-
line: "line_7S7iI",
|
|
493
|
-
stk: "stk_X79YA",
|
|
497
|
+
content: "content_xFX0U",
|
|
494
498
|
v: "v_dowAz"
|
|
495
|
-
},
|
|
499
|
+
}, re = (e, t, n) => {
|
|
496
500
|
let r = e || "line", i = t || "none", a = (e, t) => /* @__PURE__ */ b(Y, {
|
|
497
501
|
variant: r,
|
|
498
502
|
debugging: t === 0 || e === 0 ? "none" : i,
|
|
@@ -501,11 +505,11 @@ var ee = {
|
|
|
501
505
|
width: e === "100%" ? void 0 : e
|
|
502
506
|
});
|
|
503
507
|
return a.displayName = "PadderSpacer", a;
|
|
504
|
-
}, Z = { gridColumn: "1 / -1" }, Q = { gridRow: "2 / 3" },
|
|
508
|
+
}, Z = { gridColumn: "1 / -1" }, Q = { gridRow: "2 / 3" }, ie = {
|
|
505
509
|
gridRow: "2 / 3",
|
|
506
510
|
gridColumn: "2 / 3"
|
|
507
511
|
}, $ = 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 =
|
|
512
|
+
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
513
|
base: m.base,
|
|
510
514
|
snapping: "height",
|
|
511
515
|
spacing: g
|
|
@@ -514,7 +518,7 @@ var ee = {
|
|
|
514
518
|
right: g.right || 0,
|
|
515
519
|
bottom: g.bottom || 0,
|
|
516
520
|
left: g.left || 0
|
|
517
|
-
} }, { padding: O } =
|
|
521
|
+
} }, { padding: O } = q(w && !l, D, E), k = V(d, T), A = p.useMemo(() => f({
|
|
518
522
|
base: m.base,
|
|
519
523
|
color: m.color,
|
|
520
524
|
width: c,
|
|
@@ -530,7 +534,7 @@ var ee = {
|
|
|
530
534
|
O,
|
|
531
535
|
C,
|
|
532
536
|
_
|
|
533
|
-
]),
|
|
537
|
+
]), j = p.useMemo(() => B(A.containerStyle, s), [A.containerStyle, s]), M = p.useMemo(() => re(h, S, o), [
|
|
534
538
|
h,
|
|
535
539
|
S,
|
|
536
540
|
o
|
|
@@ -539,52 +543,54 @@ var ee = {
|
|
|
539
543
|
ref: k,
|
|
540
544
|
"data-testid": "padder",
|
|
541
545
|
className: n(...A.classTokens.map((e) => X[e]), t),
|
|
542
|
-
style:
|
|
546
|
+
style: j,
|
|
543
547
|
children: [
|
|
544
548
|
/* @__PURE__ */ x(y, { children: [O.top >= 0 && /* @__PURE__ */ b("div", {
|
|
545
549
|
style: Z,
|
|
546
|
-
children:
|
|
550
|
+
children: M("100%", O.top)
|
|
547
551
|
}), O.left >= 0 && /* @__PURE__ */ b("div", {
|
|
548
552
|
style: Q,
|
|
549
|
-
children:
|
|
553
|
+
children: M(O.left, "100%")
|
|
550
554
|
})] }),
|
|
551
555
|
/* @__PURE__ */ b("div", {
|
|
552
|
-
|
|
556
|
+
"data-testid": "padder-content",
|
|
557
|
+
className: X.content,
|
|
558
|
+
style: ie,
|
|
553
559
|
children: e
|
|
554
560
|
}),
|
|
555
561
|
/* @__PURE__ */ x(y, { children: [O.right >= 0 && /* @__PURE__ */ b("div", {
|
|
556
562
|
style: Q,
|
|
557
|
-
children:
|
|
563
|
+
children: M(O.right, "100%")
|
|
558
564
|
}), O.bottom >= 0 && /* @__PURE__ */ b("div", {
|
|
559
565
|
style: Z,
|
|
560
|
-
children:
|
|
566
|
+
children: M("100%", O.bottom)
|
|
561
567
|
})] })
|
|
562
568
|
]
|
|
563
569
|
}) : /* @__PURE__ */ b("div", {
|
|
564
570
|
ref: k,
|
|
565
571
|
"data-testid": "padder",
|
|
566
572
|
className: n(...A.classTokens.map((e) => X[e]), t),
|
|
567
|
-
style:
|
|
573
|
+
style: j,
|
|
568
574
|
children: e
|
|
569
575
|
});
|
|
570
|
-
})),
|
|
576
|
+
})), ae = {
|
|
571
577
|
box: "box_sPqFs",
|
|
572
578
|
v: "v_ZrZ5j"
|
|
573
|
-
},
|
|
574
|
-
let _ =
|
|
579
|
+
}, oe = p.memo(p.forwardRef(function({ children: e, snapping: t = "clamp", debugging: i, className: a, colSpan: o, rowSpan: s, span: c, width: l, height: d, style: f, ssrMode: m = !1, ...h }, g) {
|
|
580
|
+
let _ = I("box"), { isShown: v, debugging: y } = L(i, _.debugging), x = R(), S = p.useRef(null), { top: C, bottom: w, left: T, right: D } = r(h), O = N(S, {
|
|
575
581
|
base: _.base,
|
|
576
582
|
snapping: t,
|
|
577
583
|
spacing: {
|
|
578
584
|
top: C,
|
|
579
|
-
bottom:
|
|
580
|
-
left:
|
|
585
|
+
bottom: w,
|
|
586
|
+
left: T,
|
|
581
587
|
right: D
|
|
582
588
|
}
|
|
583
|
-
}), { padding: k } =
|
|
589
|
+
}), { padding: k } = q(x && !m, { padding: {
|
|
584
590
|
top: C || 0,
|
|
585
591
|
right: D || 0,
|
|
586
|
-
bottom:
|
|
587
|
-
left:
|
|
592
|
+
bottom: w || 0,
|
|
593
|
+
left: T || 0
|
|
588
594
|
} }, O), A = p.useMemo(() => u({
|
|
589
595
|
base: _.base,
|
|
590
596
|
lineColor: _.colors.line,
|
|
@@ -603,13 +609,13 @@ var ee = {
|
|
|
603
609
|
o,
|
|
604
610
|
s,
|
|
605
611
|
v
|
|
606
|
-
]),
|
|
612
|
+
]), j = p.useMemo(() => B(A.boxStyle, f), [A.boxStyle, f]);
|
|
607
613
|
return /* @__PURE__ */ b("div", {
|
|
608
|
-
ref:
|
|
614
|
+
ref: V(g, S),
|
|
609
615
|
"data-testid": "box",
|
|
610
|
-
className: n(...A.classTokens.map((e) =>
|
|
611
|
-
style:
|
|
612
|
-
children: /* @__PURE__ */ b(
|
|
616
|
+
className: n(...A.classTokens.map((e) => ae[e]), a),
|
|
617
|
+
style: B(j, A.gridSpanStyle),
|
|
618
|
+
children: /* @__PURE__ */ b(E, {
|
|
613
619
|
base: 1,
|
|
614
620
|
spacer: { variant: "flat" },
|
|
615
621
|
children: /* @__PURE__ */ b($, {
|
|
@@ -618,13 +624,13 @@ var ee = {
|
|
|
618
624
|
width: "fit-content",
|
|
619
625
|
height: d,
|
|
620
626
|
debugging: y,
|
|
621
|
-
ssrMode:
|
|
627
|
+
ssrMode: !0,
|
|
622
628
|
children: e
|
|
623
629
|
})
|
|
624
630
|
})
|
|
625
631
|
});
|
|
626
632
|
}));
|
|
627
633
|
//#endregion
|
|
628
|
-
export {
|
|
634
|
+
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
635
|
|
|
630
636
|
//# sourceMappingURL=index.mjs.map
|