baseline-kit 5.1.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +36 -6
- package/dist/baseline-kit.css +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +34 -3
- package/dist/core.mjs +2 -2
- package/dist/guide.cjs +1 -1
- package/dist/guide.cjs.map +1 -1
- package/dist/guide.css +1 -1
- package/dist/guide.d.ts +13 -2
- package/dist/guide.mjs +167 -113
- 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 +28 -15
- package/dist/index.mjs +478 -342
- package/dist/index.mjs.map +1 -1
- package/dist/remix.css +1 -1
- package/dist/remix.d.ts +33 -6
- package/dist/remix.mjs +496 -338
- package/dist/remix.mjs.map +1 -1
- package/dist/src-BczC1VWy.cjs +2 -0
- package/dist/src-BczC1VWy.cjs.map +1 -0
- package/dist/{src-C3TICsw6.js → src-CPIpvN4R.js} +64 -25
- package/dist/src-CPIpvN4R.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/src-C-1u5WNS.cjs +0 -2
- package/dist/src-C-1u5WNS.cjs.map +0 -1
- package/dist/src-C3TICsw6.js.map +0 -1
package/dist/remix.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { clientEntry as e, ref as t } from "remix/ui";
|
|
2
|
+
import { jsx as n, jsxs as r } from "remix/ui/jsx-runtime";
|
|
3
3
|
//#region packages/core/src/config/defaults.ts
|
|
4
|
-
var
|
|
4
|
+
var i = {
|
|
5
5
|
base: 8,
|
|
6
|
+
domDiagnostics: !1,
|
|
6
7
|
baseline: {
|
|
7
8
|
variant: "line",
|
|
8
9
|
debugging: "hidden",
|
|
@@ -42,57 +43,58 @@ var r = {
|
|
|
42
43
|
debugging: "hidden",
|
|
43
44
|
color: "var(--bk-padder-color-theme, hsla(270, 60%, 40%, 0.6))"
|
|
44
45
|
}
|
|
45
|
-
},
|
|
46
|
+
}, a = [
|
|
46
47
|
"baseline",
|
|
47
48
|
"guide",
|
|
48
49
|
"spacer",
|
|
49
50
|
"box",
|
|
50
51
|
"padder"
|
|
51
|
-
],
|
|
52
|
-
let { parentConfig: t, base: n } = e,
|
|
53
|
-
for (let n of
|
|
54
|
-
let
|
|
52
|
+
], o = (e) => {
|
|
53
|
+
let { parentConfig: t, base: n, domDiagnostics: r } = e, i = {};
|
|
54
|
+
for (let n of a) {
|
|
55
|
+
let r = e[n], a = t[n], o = {
|
|
55
56
|
...a,
|
|
56
|
-
...
|
|
57
|
+
...r
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
+
r && "colors" in r && r.colors && "colors" in a && (o.colors = {
|
|
59
60
|
...a.colors,
|
|
60
|
-
...
|
|
61
|
-
}),
|
|
61
|
+
...r.colors
|
|
62
|
+
}), i[n] = o;
|
|
62
63
|
}
|
|
63
64
|
return {
|
|
64
65
|
base: n ?? t.base,
|
|
65
|
-
|
|
66
|
+
domDiagnostics: r ?? t.domDiagnostics ?? !1,
|
|
67
|
+
...i
|
|
66
68
|
};
|
|
67
69
|
};
|
|
68
70
|
//#endregion
|
|
69
71
|
//#region packages/core/src/utils/parse.ts
|
|
70
|
-
function
|
|
72
|
+
function s(e) {
|
|
71
73
|
let t = e.trim().match(/^([+-]?[\d.]+)([a-zA-Z%]+)$/);
|
|
72
74
|
return t ? {
|
|
73
75
|
value: parseFloat(t[1]),
|
|
74
76
|
unit: t[2]
|
|
75
77
|
} : null;
|
|
76
78
|
}
|
|
77
|
-
function
|
|
79
|
+
function c(e, t) {
|
|
78
80
|
return e === void 0 && t !== void 0 ? `${t}px` : e === "auto" || typeof e == "string" && /^(auto|100%|0|.*(fr|vh|vw|vmin|vmax|rem))$/.test(e) ? String(e) : typeof e == "number" ? `${e}px` : e ?? "";
|
|
79
81
|
}
|
|
80
82
|
//#endregion
|
|
81
83
|
//#region packages/core/src/utils/convert.ts
|
|
82
|
-
var
|
|
84
|
+
var l = {
|
|
83
85
|
parentSize: 0,
|
|
84
86
|
viewportWidth: 1920,
|
|
85
87
|
viewportHeight: 1080,
|
|
86
88
|
rootFontSize: 16,
|
|
87
89
|
parentFontSize: 16
|
|
88
|
-
},
|
|
90
|
+
}, u = {
|
|
89
91
|
px: 1,
|
|
90
92
|
in: 96,
|
|
91
93
|
cm: 37.8,
|
|
92
94
|
mm: 3.78,
|
|
93
95
|
pt: 1.33,
|
|
94
96
|
pc: 16
|
|
95
|
-
},
|
|
97
|
+
}, d = {
|
|
96
98
|
em: (e) => e.parentFontSize,
|
|
97
99
|
rem: (e) => e.rootFontSize,
|
|
98
100
|
vh: (e) => e.viewportHeight / 100,
|
|
@@ -101,50 +103,50 @@ var c = {
|
|
|
101
103
|
vmax: (e) => Math.max(e.viewportWidth, e.viewportHeight) / 100,
|
|
102
104
|
"%": (e) => e.parentSize / 100
|
|
103
105
|
};
|
|
104
|
-
function
|
|
106
|
+
function f(e, t) {
|
|
105
107
|
if (typeof e == "number") return e;
|
|
106
108
|
if (typeof e != "string") return null;
|
|
107
|
-
let n =
|
|
109
|
+
let n = s(e);
|
|
108
110
|
if (!n) return null;
|
|
109
111
|
let { value: r, unit: i } = n;
|
|
110
|
-
if (i in
|
|
112
|
+
if (i in u) return r * u[i];
|
|
111
113
|
if (i === "auto") return null;
|
|
112
|
-
let a =
|
|
114
|
+
let a = d[i];
|
|
113
115
|
return a ? r * a({
|
|
114
|
-
...
|
|
116
|
+
...l,
|
|
115
117
|
...t
|
|
116
118
|
}) : null;
|
|
117
119
|
}
|
|
118
120
|
//#endregion
|
|
119
121
|
//#region packages/core/src/utils/math.ts
|
|
120
|
-
function
|
|
122
|
+
function p(e, t, n) {
|
|
121
123
|
return Math.min(Math.max(e, t), n);
|
|
122
124
|
}
|
|
123
|
-
function
|
|
125
|
+
function m(e) {
|
|
124
126
|
let { height: t, top: n, bottom: r, base: i } = e, a = (t ?? 0) - (n + r);
|
|
125
127
|
return Math.max(1, Math.floor(a / i));
|
|
126
128
|
}
|
|
127
129
|
//#endregion
|
|
128
130
|
//#region packages/core/src/utils/normalize.ts
|
|
129
|
-
function
|
|
131
|
+
function h(e, t = {}) {
|
|
130
132
|
let { base: n = 8, round: r = !0, clamp: i, context: a } = t;
|
|
131
133
|
if (e === "auto") return n;
|
|
132
134
|
let o = null;
|
|
133
|
-
if (typeof e == "number" ? o = e : typeof e == "string" && (o =
|
|
135
|
+
if (typeof e == "number" ? o = e : typeof e == "string" && (o = f(e, a) ?? n), o === null && (o = n), n <= 0) return o;
|
|
134
136
|
let s = r ? Math.round(o / n) * n : o;
|
|
135
|
-
return i === void 0 ? s :
|
|
137
|
+
return i === void 0 ? s : p(s, i.min ?? -Infinity, i.max ?? Infinity);
|
|
136
138
|
}
|
|
137
|
-
function
|
|
138
|
-
return !e || e[0] === void 0 && e[1] === void 0 ? t : [e[0] === void 0 ? t[0] :
|
|
139
|
+
function g(e, t, n) {
|
|
140
|
+
return !e || e[0] === void 0 && e[1] === void 0 ? t : [e[0] === void 0 ? t[0] : h(e[0], n), e[1] === void 0 ? t[1] : h(e[1], n)];
|
|
139
141
|
}
|
|
140
142
|
//#endregion
|
|
141
143
|
//#region packages/core/src/utils/padding.ts
|
|
142
|
-
function
|
|
143
|
-
if ("padding" in e && e.padding != null) return
|
|
144
|
-
let t = "block" in e && e.block != null ?
|
|
144
|
+
function _(e) {
|
|
145
|
+
if ("padding" in e && e.padding != null) return v(e.padding);
|
|
146
|
+
let t = "block" in e && e.block != null ? y(e.block) : {
|
|
145
147
|
top: 0,
|
|
146
148
|
bottom: 0
|
|
147
|
-
}, n = "inline" in e && e.inline != null ?
|
|
149
|
+
}, n = "inline" in e && e.inline != null ? b(e.inline) : {
|
|
148
150
|
left: 0,
|
|
149
151
|
right: 0
|
|
150
152
|
};
|
|
@@ -155,7 +157,7 @@ function g(e) {
|
|
|
155
157
|
left: n.left
|
|
156
158
|
};
|
|
157
159
|
}
|
|
158
|
-
function
|
|
160
|
+
function v(e) {
|
|
159
161
|
if (typeof e == "number") return {
|
|
160
162
|
top: e,
|
|
161
163
|
right: e,
|
|
@@ -183,7 +185,7 @@ function _(e) {
|
|
|
183
185
|
left: 0
|
|
184
186
|
};
|
|
185
187
|
}
|
|
186
|
-
function
|
|
188
|
+
function y(e) {
|
|
187
189
|
if (typeof e == "number") return {
|
|
188
190
|
top: e,
|
|
189
191
|
bottom: e
|
|
@@ -203,7 +205,7 @@ function v(e) {
|
|
|
203
205
|
bottom: 0
|
|
204
206
|
};
|
|
205
207
|
}
|
|
206
|
-
function
|
|
208
|
+
function b(e) {
|
|
207
209
|
if (typeof e == "number") return {
|
|
208
210
|
left: e,
|
|
209
211
|
right: e
|
|
@@ -225,14 +227,17 @@ function y(e) {
|
|
|
225
227
|
}
|
|
226
228
|
//#endregion
|
|
227
229
|
//#region packages/core/src/utils/snapping.ts
|
|
228
|
-
function
|
|
229
|
-
let i =
|
|
230
|
-
if (
|
|
231
|
-
if (
|
|
230
|
+
function x(e, t, n, r) {
|
|
231
|
+
let i = _({ padding: n }), a = typeof r == "string" ? r : r.mode, o = typeof r == "string" ? "bottom" : r.snapEdge ?? "bottom";
|
|
232
|
+
if (a === "none") return i;
|
|
233
|
+
if (a === "height") {
|
|
232
234
|
let n = e % t;
|
|
233
|
-
n !== 0
|
|
235
|
+
if (n !== 0) {
|
|
236
|
+
let e = t - n;
|
|
237
|
+
o === "top" ? i.top += e : i.bottom += e;
|
|
238
|
+
}
|
|
234
239
|
}
|
|
235
|
-
if (
|
|
240
|
+
if (a === "clamp") {
|
|
236
241
|
i.top %= t;
|
|
237
242
|
let n = e % t;
|
|
238
243
|
n !== 0 && (i.bottom += t - n), i.bottom %= t;
|
|
@@ -241,24 +246,24 @@ function b(e, t, n, r) {
|
|
|
241
246
|
}
|
|
242
247
|
//#endregion
|
|
243
248
|
//#region packages/core/src/utils/merge.ts
|
|
244
|
-
function
|
|
249
|
+
function S(e, t, n) {
|
|
245
250
|
let r = typeof e == "string" ? e : e.key, i = typeof e == "string" ? t : e.value, a = typeof e == "string" ? n : e.defaultStyles, o = typeof e == "object" ? e.skipDimensions : void 0;
|
|
246
251
|
return o && (o.fitContent?.includes(r) && i === "fit-content" || o.auto?.includes(r) && i === "auto" || o.fullSize?.includes(r) && (i === "100%" || i === "100vh" || i === "100vw")) || i === a[r] ? {} : { [r]: i };
|
|
247
252
|
}
|
|
248
253
|
//#endregion
|
|
249
254
|
//#region packages/core/src/validation/guide.ts
|
|
250
|
-
var
|
|
255
|
+
var C = /^\d*\.?\d+(?:fr|px|%|em|rem|vh|vw|vmin|vmax|pt|pc|in|cm|mm)$/, ee = (e) => typeof e == "number" ? Number.isFinite(e) && e >= 0 : typeof e == "string" ? e === "auto" || e === "100%" || C.test(e) : !1, te = (e) => Array.isArray(e) && e.length > 0 && e.every(ee), w = {
|
|
251
256
|
template: "none",
|
|
252
257
|
columnsCount: 0,
|
|
253
258
|
calculatedGap: 0,
|
|
254
259
|
isValid: !1
|
|
255
260
|
};
|
|
256
|
-
function
|
|
257
|
-
let r = t.variant ?? "line", i = t.base ?? 8, a =
|
|
261
|
+
function T(e, t, n) {
|
|
262
|
+
let r = t.variant ?? "line", i = t.base ?? 8, a = h(t.gap ?? 0, {
|
|
258
263
|
base: i,
|
|
259
264
|
context: n
|
|
260
265
|
});
|
|
261
|
-
if (!e) return
|
|
266
|
+
if (!e) return w;
|
|
262
267
|
switch (r) {
|
|
263
268
|
case "line": {
|
|
264
269
|
let t = a === 0 ? 0 : a - 1, n = t + 1, r = t === 0 ? Math.max(1, Math.floor(e) + 1) : Math.max(1, Math.floor((e + 1) / n) + 1);
|
|
@@ -270,9 +275,9 @@ function ne(e, t, n) {
|
|
|
270
275
|
};
|
|
271
276
|
}
|
|
272
277
|
case "pattern": {
|
|
273
|
-
if (!t.columns || !Array.isArray(t.columns) || !te(t.columns)) return
|
|
278
|
+
if (!t.columns || !Array.isArray(t.columns) || !te(t.columns)) return w;
|
|
274
279
|
let e = t.columns.map((e) => typeof e == "number" ? `${e}px` : e);
|
|
275
|
-
return e.some((e) => e === "0" || e === "0px") ?
|
|
280
|
+
return e.some((e) => e === "0" || e === "0px") ? w : {
|
|
276
281
|
template: e.join(" "),
|
|
277
282
|
columnsCount: e.length,
|
|
278
283
|
calculatedGap: a,
|
|
@@ -281,8 +286,8 @@ function ne(e, t, n) {
|
|
|
281
286
|
}
|
|
282
287
|
case "fixed": {
|
|
283
288
|
let e = typeof t.columns == "number" ? t.columns : 0;
|
|
284
|
-
return e < 1 ?
|
|
285
|
-
template: `repeat(${e}, ${t.columnWidth ?
|
|
289
|
+
return e < 1 ? w : {
|
|
290
|
+
template: `repeat(${e}, ${t.columnWidth ? c(t.columnWidth) : "1fr"})`,
|
|
286
291
|
columnsCount: e,
|
|
287
292
|
calculatedGap: a,
|
|
288
293
|
isValid: !0
|
|
@@ -296,7 +301,7 @@ function ne(e, t, n) {
|
|
|
296
301
|
calculatedGap: a,
|
|
297
302
|
isValid: !0
|
|
298
303
|
};
|
|
299
|
-
let i = typeof r == "number" ? `${r}px` : r.toString(), o =
|
|
304
|
+
let i = typeof r == "number" ? `${r}px` : r.toString(), o = f(i, n) ?? 0, s = o > 0 ? Math.max(1, Math.floor((e + a) / (o + a))) : 1;
|
|
300
305
|
return {
|
|
301
306
|
template: `repeat(auto-fill, ${i})`,
|
|
302
307
|
columnsCount: s,
|
|
@@ -315,13 +320,23 @@ function ne(e, t, n) {
|
|
|
315
320
|
}
|
|
316
321
|
}
|
|
317
322
|
}
|
|
318
|
-
var
|
|
323
|
+
var E = (e, t, n) => {
|
|
319
324
|
let r = {};
|
|
320
325
|
return e === void 0 ? (t !== void 0 && (r.gridColumn = `span ${t}`), n !== void 0 && (r.gridRow = `span ${n}`)) : (r.gridColumn = `span ${e}`, r.gridRow = `span ${e}`), r;
|
|
321
326
|
};
|
|
322
327
|
//#endregion
|
|
323
328
|
//#region packages/core/src/descriptors/guide.ts
|
|
324
|
-
function
|
|
329
|
+
function D(e) {
|
|
330
|
+
let t = /* @__PURE__ */ new Set([
|
|
331
|
+
"--bkgd-cl",
|
|
332
|
+
"--bkgd-cp",
|
|
333
|
+
"--bkgd-ca",
|
|
334
|
+
"--bkgd-cf",
|
|
335
|
+
"--bkgd-line-color"
|
|
336
|
+
]), n = e.style && Object.keys(e.style).some((e) => !t.has(e));
|
|
337
|
+
return !e.domDiagnostics && !e.className && !n && e.variant === "fixed" && e.columns === 4 && (e.columnWidth === void 0 || e.columnWidth === 60 || e.columnWidth === "60px") && e.gap === 0 && (e.align || "center") === "center";
|
|
338
|
+
}
|
|
339
|
+
function O({ variant: e, base: t, gap: n, columns: r, columnWidth: i }) {
|
|
325
340
|
switch (e) {
|
|
326
341
|
case "line": return {
|
|
327
342
|
variant: "line",
|
|
@@ -354,7 +369,7 @@ function T({ variant: e, base: t, gap: n, columns: r, columnWidth: i }) {
|
|
|
354
369
|
base: t
|
|
355
370
|
};
|
|
356
371
|
}
|
|
357
|
-
var
|
|
372
|
+
var k = (e, t) => ({
|
|
358
373
|
"--bkgd-w": "100%",
|
|
359
374
|
"--bkgd-h": "100%",
|
|
360
375
|
"--bkgd-mw": "none",
|
|
@@ -365,45 +380,45 @@ var E = (e, t) => ({
|
|
|
365
380
|
"--bkgd-cl": t,
|
|
366
381
|
"--bkgd-g": "0"
|
|
367
382
|
});
|
|
368
|
-
function
|
|
369
|
-
let { base: t, colors: n, variant: r, align: i, width: a, height: o, columnWidth:
|
|
383
|
+
function A(e) {
|
|
384
|
+
let { base: t, colors: n, variant: r, align: i, width: a, height: o, columnWidth: s, maxWidth: l, color: u, template: d, columnsCount: f, calculatedGap: p, isVisible: m } = e, h = k(t, n.line), g = {
|
|
370
385
|
"--bkgd-cl": u ?? n.line,
|
|
371
386
|
"--bkgd-cp": u ?? n.pattern,
|
|
372
387
|
"--bkgd-ca": u ?? n.auto,
|
|
373
388
|
"--bkgd-cf": u ?? n.fixed,
|
|
374
|
-
"--bkgd-w":
|
|
375
|
-
"--bkgd-h":
|
|
376
|
-
...
|
|
389
|
+
"--bkgd-w": c(a ?? "100%"),
|
|
390
|
+
"--bkgd-h": c(o ?? "100%"),
|
|
391
|
+
...S({
|
|
377
392
|
key: "--bkgd-mw",
|
|
378
|
-
value:
|
|
393
|
+
value: c(l || "none"),
|
|
379
394
|
defaultStyles: h
|
|
380
395
|
}),
|
|
381
|
-
...
|
|
396
|
+
...S({
|
|
382
397
|
key: "--bkgd-cw",
|
|
383
|
-
value: s
|
|
398
|
+
value: c(s || "60px"),
|
|
384
399
|
defaultStyles: h
|
|
385
400
|
}),
|
|
386
|
-
...
|
|
401
|
+
...S({
|
|
387
402
|
key: "--bkgd-n",
|
|
388
403
|
value: `${f}`,
|
|
389
404
|
defaultStyles: h
|
|
390
405
|
}),
|
|
391
|
-
...
|
|
406
|
+
...S({
|
|
392
407
|
key: "--bkgd-b",
|
|
393
408
|
value: "0",
|
|
394
409
|
defaultStyles: h
|
|
395
410
|
}),
|
|
396
|
-
...
|
|
411
|
+
...S({
|
|
397
412
|
key: "--bkgd-cl",
|
|
398
413
|
value: u ?? n.line,
|
|
399
414
|
defaultStyles: h
|
|
400
415
|
}),
|
|
401
|
-
...
|
|
416
|
+
...S({
|
|
402
417
|
key: "--bkgd-g",
|
|
403
418
|
value: `${p}px`,
|
|
404
419
|
defaultStyles: h
|
|
405
420
|
}),
|
|
406
|
-
...
|
|
421
|
+
...S({
|
|
407
422
|
key: "--bkgd-j",
|
|
408
423
|
value: i || "center",
|
|
409
424
|
defaultStyles: h
|
|
@@ -423,28 +438,32 @@ function D(e) {
|
|
|
423
438
|
}
|
|
424
439
|
//#endregion
|
|
425
440
|
//#region packages/core/src/descriptors/baseline.ts
|
|
426
|
-
function
|
|
427
|
-
|
|
441
|
+
function j(e) {
|
|
442
|
+
return e.domDiagnostics || e.base <= 1 || !Number.isInteger(e.base) || e.className || e.contentHeight >= e.base && Math.abs(e.contentHeight - Math.floor(e.contentHeight / e.base) * e.base) > .001 ? !1 : !Object.keys(e.style ?? {}).some((e) => e.startsWith("background") || e === "--bkbl-b");
|
|
443
|
+
}
|
|
444
|
+
function ne(e) {
|
|
445
|
+
let { base: t, colors: n, variant: r, width: i, height: a, color: o, containerWidth: s, containerHeight: l, spacing: u, isVisible: d } = e, { top: f, right: p, bottom: h, left: v } = _(u), y = [
|
|
428
446
|
f,
|
|
429
|
-
|
|
430
|
-
|
|
447
|
+
p,
|
|
448
|
+
h,
|
|
431
449
|
v
|
|
432
|
-
].map((e) => e ? `${e}px` : "0").join(" "), b = y === "0 0 0 0" ? void 0 : y, x =
|
|
433
|
-
height:
|
|
450
|
+
].map((e) => e ? `${e}px` : "0").join(" "), b = y === "0 0 0 0" ? void 0 : y, x = l > 0 ? l : g([void 0, a], [s, 0])[1], S = x - f - h, C = m({
|
|
451
|
+
height: x,
|
|
434
452
|
top: f,
|
|
435
|
-
bottom:
|
|
453
|
+
bottom: h,
|
|
436
454
|
base: t
|
|
437
455
|
});
|
|
438
456
|
return {
|
|
439
457
|
containerStyle: {
|
|
440
|
-
...i === void 0 ? {} : { "--bkbl-w":
|
|
441
|
-
...a === void 0 ? {} : { "--bkbl-h":
|
|
458
|
+
...i === void 0 ? {} : { "--bkbl-w": c(i) },
|
|
459
|
+
...a === void 0 ? {} : { "--bkbl-h": c(a) },
|
|
442
460
|
"--bkbl-cl": o ?? n.line,
|
|
443
461
|
"--bkbl-cf": o ?? n.flat,
|
|
444
462
|
"--bkbl-c": r === "line" ? "var(--bkbl-cl)" : "var(--bkbl-cf)",
|
|
445
463
|
...b ? { padding: b } : {}
|
|
446
464
|
},
|
|
447
|
-
rowCount:
|
|
465
|
+
rowCount: C,
|
|
466
|
+
contentHeight: S,
|
|
448
467
|
getRowStyle: (e) => ({
|
|
449
468
|
"--bkbl-rt": e === 0 ? "0px" : `${e * t}px`,
|
|
450
469
|
"--bkbl-rh": r === "line" ? "1px" : `${t}px`
|
|
@@ -456,13 +475,33 @@ function O(e) {
|
|
|
456
475
|
}
|
|
457
476
|
//#endregion
|
|
458
477
|
//#region packages/core/src/descriptors/box.ts
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
478
|
+
var re = /* @__PURE__ */ new Set([
|
|
479
|
+
"background",
|
|
480
|
+
"backgroundColor",
|
|
481
|
+
"boxShadow",
|
|
482
|
+
"color",
|
|
483
|
+
"cursor",
|
|
484
|
+
"opacity",
|
|
485
|
+
"outline",
|
|
486
|
+
"outlineColor",
|
|
487
|
+
"outlineOffset",
|
|
488
|
+
"outlineStyle",
|
|
489
|
+
"outlineWidth",
|
|
490
|
+
"pointerEvents",
|
|
491
|
+
"textDecoration",
|
|
492
|
+
"textShadow",
|
|
493
|
+
"visibility"
|
|
494
|
+
]);
|
|
495
|
+
function ie(e) {
|
|
496
|
+
return e.className || e.width !== void 0 && e.width !== "fit-content" ? !0 : e.style ? Object.keys(e.style).some((e) => !re.has(e)) : !1;
|
|
497
|
+
}
|
|
498
|
+
function ae(e) {
|
|
499
|
+
let { lineColor: t, width: n, height: r, span: i, colSpan: a, rowSpan: o, isVisible: s } = e, l = {
|
|
500
|
+
...n === void 0 ? {} : { "--bkbx-w": c(n) },
|
|
501
|
+
...r === void 0 ? {} : { "--bkbx-h": c(r) },
|
|
463
502
|
"--bkbx-cl": t
|
|
464
|
-
}, u =
|
|
465
|
-
return
|
|
503
|
+
}, u = E(i, a, o), d = ["box"];
|
|
504
|
+
return s && d.push("v"), {
|
|
466
505
|
boxStyle: l,
|
|
467
506
|
gridSpanStyle: u,
|
|
468
507
|
classTokens: d
|
|
@@ -470,19 +509,19 @@ function k(e) {
|
|
|
470
509
|
}
|
|
471
510
|
//#endregion
|
|
472
511
|
//#region packages/core/src/descriptors/spacer.ts
|
|
473
|
-
function
|
|
474
|
-
let { base: t, colors: n, width: r, height: i, color: a, variant: o, isVisible:
|
|
512
|
+
function oe(e) {
|
|
513
|
+
let { base: t, colors: n, width: r, height: i, color: a, variant: o, isVisible: s } = e, [l, u] = g([r, i], [0, 0], {
|
|
475
514
|
base: t,
|
|
476
515
|
suppressWarnings: !0
|
|
477
516
|
}), d = {
|
|
478
|
-
...i === void 0 ? {} : { "--bksp-h":
|
|
479
|
-
...r === void 0 ? {} : { "--bksp-w":
|
|
517
|
+
...i === void 0 ? {} : { "--bksp-h": c(u) },
|
|
518
|
+
...r === void 0 ? {} : { "--bksp-w": c(l) },
|
|
480
519
|
"--bksp-b": `${t}px`,
|
|
481
520
|
"--bksp-ct": a ?? n.text,
|
|
482
521
|
"--bksp-cl": a ?? n.line,
|
|
483
522
|
"--bksp-cf": a ?? n.flat
|
|
484
523
|
}, f = ["spr"];
|
|
485
|
-
return
|
|
524
|
+
return s && f.push(o), {
|
|
486
525
|
style: d,
|
|
487
526
|
normWidth: l,
|
|
488
527
|
normHeight: u,
|
|
@@ -491,25 +530,26 @@ function A(e) {
|
|
|
491
530
|
}
|
|
492
531
|
//#endregion
|
|
493
532
|
//#region packages/core/src/descriptors/padder.ts
|
|
494
|
-
function
|
|
495
|
-
let { base: t, color: n, width: r, height: i, padding: a, enableSpacers: o, isVisible:
|
|
496
|
-
if (r !== void 0 && r !== "fit-content" && (l["--bkpd-w"] =
|
|
533
|
+
function se(e) {
|
|
534
|
+
let { base: t, color: n, width: r, height: i, padding: a, enableSpacers: o, isVisible: s } = e, l = {};
|
|
535
|
+
if (r !== void 0 && r !== "fit-content" && (l["--bkpd-w"] = c(r)), i !== void 0 && i !== "fit-content" && (l["--bkpd-h"] = c(i)), l["--bkpd-b"] = `${t}px`, l["--bkpd-c"] = n, !o) {
|
|
497
536
|
let { top: e, right: t, bottom: n, left: r } = a;
|
|
498
537
|
(e > 0 || n > 0) && (l.paddingBlock = `${e}px ${n}px`), (r > 0 || t > 0) && (l.paddingInline = `${r}px ${t}px`);
|
|
499
538
|
}
|
|
500
539
|
let u = ["pad"];
|
|
501
|
-
return
|
|
540
|
+
return s && o && u.push("v"), {
|
|
502
541
|
containerStyle: l,
|
|
503
542
|
classTokens: u
|
|
504
543
|
};
|
|
505
544
|
}
|
|
506
545
|
//#endregion
|
|
507
546
|
//#region packages/remix/src/Config.ts
|
|
508
|
-
function
|
|
547
|
+
function ce(e) {
|
|
509
548
|
return () => {
|
|
510
|
-
let t =
|
|
511
|
-
parentConfig: e.props.__baselineConfig ?? e.context.get(
|
|
549
|
+
let t = o({
|
|
550
|
+
parentConfig: e.props.__baselineConfig ?? e.context.get(M) ?? i,
|
|
512
551
|
base: e.props.base,
|
|
552
|
+
domDiagnostics: e.props.domDiagnostics,
|
|
513
553
|
baseline: e.props.baseline,
|
|
514
554
|
guide: e.props.guide,
|
|
515
555
|
spacer: e.props.spacer,
|
|
@@ -519,7 +559,7 @@ function M(e) {
|
|
|
519
559
|
return e.context.set(t), e.props.children ?? null;
|
|
520
560
|
};
|
|
521
561
|
}
|
|
522
|
-
var
|
|
562
|
+
var M = ce, N = (e) => {
|
|
523
563
|
let t = null, n = null;
|
|
524
564
|
return [(...r) => {
|
|
525
565
|
n = r, t !== null && cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
@@ -531,7 +571,7 @@ var N = M, P = (e) => {
|
|
|
531
571
|
};
|
|
532
572
|
//#endregion
|
|
533
573
|
//#region packages/dom/src/measure.ts
|
|
534
|
-
function
|
|
574
|
+
function le(e, t) {
|
|
535
575
|
let n = {
|
|
536
576
|
width: 0,
|
|
537
577
|
height: 0
|
|
@@ -543,7 +583,7 @@ function re(e, t) {
|
|
|
543
583
|
};
|
|
544
584
|
(i.width !== n.width || i.height !== n.height) && (n = i, t(i));
|
|
545
585
|
} catch {}
|
|
546
|
-
}, [i, a] =
|
|
586
|
+
}, [i, a] = N(r);
|
|
547
587
|
r();
|
|
548
588
|
let o = new ResizeObserver(i);
|
|
549
589
|
return o.observe(e), {
|
|
@@ -555,7 +595,7 @@ function re(e, t) {
|
|
|
555
595
|
}
|
|
556
596
|
//#endregion
|
|
557
597
|
//#region packages/dom/src/virtual.ts
|
|
558
|
-
function
|
|
598
|
+
function ue(e, t, n) {
|
|
559
599
|
let { totalItems: r, itemHeight: i, buffer: a = 0 } = t;
|
|
560
600
|
if (!Number.isFinite(i) || i <= 0) throw Error("createVirtualTracker requires itemHeight to be greater than 0");
|
|
561
601
|
if (!Number.isFinite(r) || r < 0) throw Error("createVirtualTracker requires totalItems to be 0 or greater");
|
|
@@ -568,7 +608,7 @@ function ie(e, t, n) {
|
|
|
568
608
|
}, s = {
|
|
569
609
|
start: 0,
|
|
570
610
|
end: r
|
|
571
|
-
}, [c, l] =
|
|
611
|
+
}, [c, l] = N(() => {
|
|
572
612
|
let e = o();
|
|
573
613
|
(e.start !== s.start || e.end !== s.end) && (s = e, n(e));
|
|
574
614
|
}), u = { passive: !0 };
|
|
@@ -582,11 +622,26 @@ function ie(e, t, n) {
|
|
|
582
622
|
};
|
|
583
623
|
}
|
|
584
624
|
//#endregion
|
|
585
|
-
//#region packages/remix/src/shared.
|
|
586
|
-
function
|
|
625
|
+
//#region packages/remix/src/shared.tsx
|
|
626
|
+
function P(e, t) {
|
|
627
|
+
return Object.fromEntries(Object.entries(e).filter(([e, n]) => t[e] !== n));
|
|
628
|
+
}
|
|
629
|
+
var F = /* @__PURE__ */ new Set([
|
|
630
|
+
"id",
|
|
631
|
+
"title",
|
|
632
|
+
"role",
|
|
633
|
+
"tabIndex",
|
|
634
|
+
"lang",
|
|
635
|
+
"dir",
|
|
636
|
+
"hidden"
|
|
637
|
+
]);
|
|
638
|
+
function I(e) {
|
|
639
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWith("data-") || e.startsWith("aria-") || F.has(e)));
|
|
640
|
+
}
|
|
641
|
+
function L(...e) {
|
|
587
642
|
return e.filter(Boolean).join(" ");
|
|
588
643
|
}
|
|
589
|
-
function
|
|
644
|
+
function R(...e) {
|
|
590
645
|
let t = {};
|
|
591
646
|
for (let n of e) if (n) {
|
|
592
647
|
if (typeof n == "string") {
|
|
@@ -597,10 +652,16 @@ function I(...e) {
|
|
|
597
652
|
}
|
|
598
653
|
return t;
|
|
599
654
|
}
|
|
600
|
-
function
|
|
655
|
+
function z(e, t, n) {
|
|
601
656
|
return e.context.get(t) ?? n;
|
|
602
657
|
}
|
|
603
|
-
function
|
|
658
|
+
function B(e) {
|
|
659
|
+
return typeof e.domDiagnostics == "boolean" ? e : {
|
|
660
|
+
...e,
|
|
661
|
+
domDiagnostics: !1
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
function V(e, t) {
|
|
604
665
|
let n = e ?? t;
|
|
605
666
|
return {
|
|
606
667
|
isShown: n === "visible",
|
|
@@ -608,46 +669,46 @@ function R(e, t) {
|
|
|
608
669
|
debugging: n
|
|
609
670
|
};
|
|
610
671
|
}
|
|
611
|
-
var
|
|
612
|
-
function
|
|
613
|
-
|
|
614
|
-
let e =
|
|
672
|
+
var H = 40, U = /* @__PURE__ */ new WeakSet(), W = [], G = !1;
|
|
673
|
+
function K() {
|
|
674
|
+
G = !1;
|
|
675
|
+
let e = W.splice(0, H);
|
|
615
676
|
for (let t of e) {
|
|
616
677
|
if (t.signal.aborted) {
|
|
617
|
-
|
|
678
|
+
U.delete(t);
|
|
618
679
|
continue;
|
|
619
680
|
}
|
|
620
681
|
try {
|
|
621
|
-
t.update().catch(() => void 0).finally(() =>
|
|
682
|
+
t.update().catch(() => void 0).finally(() => U.delete(t));
|
|
622
683
|
} catch {
|
|
623
|
-
|
|
684
|
+
U.delete(t);
|
|
624
685
|
}
|
|
625
686
|
}
|
|
626
|
-
|
|
687
|
+
W.length > 0 && q();
|
|
627
688
|
}
|
|
628
|
-
function
|
|
629
|
-
|
|
689
|
+
function q() {
|
|
690
|
+
G || (G = !0, setTimeout(typeof requestAnimationFrame == "function" ? () => requestAnimationFrame(K) : () => setTimeout(K, 0), 0));
|
|
630
691
|
}
|
|
631
|
-
function
|
|
632
|
-
e.signal.aborted ||
|
|
692
|
+
function J(e) {
|
|
693
|
+
e.signal.aborted || U.has(e) || (U.add(e), W.push(e), q());
|
|
633
694
|
}
|
|
634
|
-
function
|
|
635
|
-
let a = t
|
|
636
|
-
return ((
|
|
637
|
-
let
|
|
638
|
-
return
|
|
639
|
-
...
|
|
640
|
-
__baselineConfig:
|
|
695
|
+
function Y(t, r) {
|
|
696
|
+
let a = e(t, r);
|
|
697
|
+
return ((e) => () => {
|
|
698
|
+
let t = e.context.get(M), r = e.props.__baselineConfig ?? t ?? i;
|
|
699
|
+
return /* @__PURE__ */ n(a, {
|
|
700
|
+
...e.props,
|
|
701
|
+
__baselineConfig: r
|
|
641
702
|
});
|
|
642
703
|
});
|
|
643
704
|
}
|
|
644
|
-
function
|
|
645
|
-
let
|
|
705
|
+
function X(e) {
|
|
706
|
+
let n = null, r, i = !1, a = 0, o = (e) => {
|
|
646
707
|
e.aborted || i || a >= 10 || (a += 1, r?.refresh(), requestAnimationFrame(() => o(e)));
|
|
647
708
|
};
|
|
648
709
|
return {
|
|
649
|
-
attach:
|
|
650
|
-
|
|
710
|
+
attach: t((t, s) => {
|
|
711
|
+
n = t, typeof ResizeObserver < "u" && (r = le(t, (t) => {
|
|
651
712
|
i = t.width > 0 || t.height > 0;
|
|
652
713
|
let n = () => {
|
|
653
714
|
s.aborted || e(t);
|
|
@@ -656,13 +717,13 @@ function q(e) {
|
|
|
656
717
|
}), queueMicrotask(() => {
|
|
657
718
|
s.aborted || (r?.refresh(), requestAnimationFrame(() => o(s)));
|
|
658
719
|
})), s.addEventListener("abort", () => {
|
|
659
|
-
r?.disconnect(), r = void 0, i = !1, a = 0,
|
|
720
|
+
r?.disconnect(), r = void 0, i = !1, a = 0, n = null;
|
|
660
721
|
}, { once: !0 });
|
|
661
722
|
}),
|
|
662
|
-
getElement: () =>
|
|
723
|
+
getElement: () => n
|
|
663
724
|
};
|
|
664
725
|
}
|
|
665
|
-
function
|
|
726
|
+
function de(e, t, n, r = 160) {
|
|
666
727
|
let i, a = "", o = 0, s = {
|
|
667
728
|
start: 0,
|
|
668
729
|
end: 0
|
|
@@ -677,7 +738,7 @@ function J(e, t, n, r = 160) {
|
|
|
677
738
|
d !== a && (c(), a = d, o = e, s = {
|
|
678
739
|
start: 0,
|
|
679
740
|
end: e
|
|
680
|
-
}, n(s), i =
|
|
741
|
+
}, n(s), i = ue(u, {
|
|
681
742
|
totalItems: e,
|
|
682
743
|
itemHeight: l,
|
|
683
744
|
buffer: r
|
|
@@ -695,185 +756,246 @@ function J(e, t, n, r = 160) {
|
|
|
695
756
|
};
|
|
696
757
|
}
|
|
697
758
|
//#endregion
|
|
698
|
-
//#region packages/remix/src/Baseline.
|
|
699
|
-
function
|
|
700
|
-
let
|
|
759
|
+
//#region packages/remix/src/Baseline.tsx
|
|
760
|
+
function fe(e) {
|
|
761
|
+
let t = {
|
|
701
762
|
width: 0,
|
|
702
763
|
height: 0
|
|
703
|
-
},
|
|
704
|
-
|
|
705
|
-
}, a =
|
|
706
|
-
(e.width !==
|
|
707
|
-
}), o =
|
|
764
|
+
}, r = () => {
|
|
765
|
+
J(e);
|
|
766
|
+
}, a = X((e) => {
|
|
767
|
+
(e.width !== t.width || e.height !== t.height) && (t = e, r());
|
|
768
|
+
}), o = de(e, a.getElement, r);
|
|
708
769
|
return () => {
|
|
709
|
-
let
|
|
770
|
+
let r = e.props, s = B(r.__baselineConfig ?? z(e, M, i)), l = r.base ?? s.base, u = r.variant ?? s.baseline.variant, d = V(r.debugging, s.baseline.debugging), f = ne({
|
|
710
771
|
base: l,
|
|
711
|
-
colors:
|
|
772
|
+
colors: s.baseline.colors,
|
|
712
773
|
variant: u,
|
|
713
|
-
width:
|
|
714
|
-
height:
|
|
715
|
-
color:
|
|
716
|
-
containerWidth:
|
|
717
|
-
containerHeight:
|
|
774
|
+
width: r.width,
|
|
775
|
+
height: r.height,
|
|
776
|
+
color: r.color,
|
|
777
|
+
containerWidth: t.width,
|
|
778
|
+
containerHeight: t.height,
|
|
718
779
|
spacing: {
|
|
719
|
-
padding:
|
|
720
|
-
block:
|
|
721
|
-
inline:
|
|
780
|
+
padding: r.padding,
|
|
781
|
+
block: r.block,
|
|
782
|
+
inline: r.inline
|
|
722
783
|
},
|
|
723
784
|
isVisible: d.isShown
|
|
785
|
+
}), p = j({
|
|
786
|
+
base: l,
|
|
787
|
+
contentHeight: f.contentHeight,
|
|
788
|
+
domDiagnostics: s.domDiagnostics,
|
|
789
|
+
className: r.className,
|
|
790
|
+
style: r.style
|
|
724
791
|
});
|
|
725
|
-
if (
|
|
726
|
-
className:
|
|
727
|
-
"data-testid": "baseline",
|
|
792
|
+
if (r.ssrMode) return /* @__PURE__ */ n("div", {
|
|
793
|
+
className: L("bk-bas", "bk-h", "bk-ssr", `bk-${u}`, r.className),
|
|
794
|
+
"data-testid": s.domDiagnostics ? "baseline" : void 0,
|
|
728
795
|
"aria-hidden": !0,
|
|
729
|
-
style:
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
796
|
+
style: R(P(f.containerStyle, {
|
|
797
|
+
"--bkbl-w": "100%",
|
|
798
|
+
"--bkbl-h": "100%",
|
|
799
|
+
"--bkbl-cl": i.baseline.colors.line,
|
|
800
|
+
"--bkbl-cf": i.baseline.colors.flat,
|
|
801
|
+
"--bkbl-c": u === "line" ? "var(--bkbl-cl)" : "var(--bkbl-cf)"
|
|
802
|
+
}), P({
|
|
803
|
+
width: c(r.width ?? "100%"),
|
|
804
|
+
height: c(r.height ?? "100%")
|
|
805
|
+
}, {
|
|
806
|
+
width: "100%",
|
|
807
|
+
height: "100%"
|
|
808
|
+
}), r.style),
|
|
809
|
+
...I(r)
|
|
733
810
|
});
|
|
734
|
-
d.isShown &&
|
|
735
|
-
let
|
|
736
|
-
let r =
|
|
737
|
-
return
|
|
811
|
+
d.isShown && e.queueTask(() => o.setConfig(f.rowCount, l));
|
|
812
|
+
let m = o.getRange(f.rowCount), h = d.isShown && !p ? Array.from({ length: Math.max(0, m.end - m.start) }, (e, t) => {
|
|
813
|
+
let r = m.start + t;
|
|
814
|
+
return /* @__PURE__ */ n("div", {
|
|
738
815
|
className: "bk-row",
|
|
739
|
-
|
|
740
|
-
"data-row-index": r,
|
|
816
|
+
"data-row-index": s.domDiagnostics ? r : void 0,
|
|
741
817
|
style: f.getRowStyle(r)
|
|
742
|
-
});
|
|
818
|
+
}, r);
|
|
743
819
|
}) : [];
|
|
744
|
-
return
|
|
745
|
-
className:
|
|
746
|
-
"data-testid": "baseline",
|
|
820
|
+
return /* @__PURE__ */ n("div", {
|
|
821
|
+
className: L(...f.classTokens.map((e) => `bk-${e}`), `bk-${u}`, p && "bk-compact", r.className),
|
|
822
|
+
"data-testid": s.domDiagnostics ? "baseline" : void 0,
|
|
747
823
|
"aria-hidden": !0,
|
|
748
|
-
style:
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
},
|
|
752
|
-
|
|
753
|
-
|
|
824
|
+
style: R(P({
|
|
825
|
+
...f.containerStyle,
|
|
826
|
+
...p ? { "--bkbl-b": `${l}px` } : {}
|
|
827
|
+
}, {
|
|
828
|
+
"--bkbl-w": "100%",
|
|
829
|
+
"--bkbl-h": "100%",
|
|
830
|
+
"--bkbl-b": "8px",
|
|
831
|
+
"--bkbl-cl": i.baseline.colors.line,
|
|
832
|
+
"--bkbl-cf": i.baseline.colors.flat,
|
|
833
|
+
"--bkbl-c": u === "line" ? "var(--bkbl-cl)" : "var(--bkbl-cf)"
|
|
834
|
+
}), P({
|
|
835
|
+
width: c(r.width ?? "100%"),
|
|
836
|
+
height: c(r.height ?? "100%")
|
|
837
|
+
}, {
|
|
838
|
+
width: "100%",
|
|
839
|
+
height: "100%"
|
|
840
|
+
}), r.style),
|
|
841
|
+
...I(r),
|
|
842
|
+
mix: typeof window > "u" || r.ssrMode ? void 0 : a.attach,
|
|
843
|
+
children: h
|
|
754
844
|
});
|
|
755
845
|
};
|
|
756
846
|
}
|
|
757
|
-
var
|
|
847
|
+
var pe = Y(`${import.meta.url}#Baseline`, fe);
|
|
758
848
|
//#endregion
|
|
759
|
-
//#region packages/remix/src/Guide.
|
|
760
|
-
function
|
|
761
|
-
let
|
|
849
|
+
//#region packages/remix/src/Guide.tsx
|
|
850
|
+
function me(e) {
|
|
851
|
+
let t = {
|
|
762
852
|
width: 0,
|
|
763
853
|
height: 0
|
|
764
|
-
},
|
|
765
|
-
|
|
766
|
-
},
|
|
767
|
-
(e.width !==
|
|
854
|
+
}, a = () => {
|
|
855
|
+
J(e);
|
|
856
|
+
}, o = X((e) => {
|
|
857
|
+
(e.width !== t.width || e.height !== t.height) && (t = e, a());
|
|
768
858
|
});
|
|
769
859
|
return () => {
|
|
770
|
-
let
|
|
771
|
-
variant:
|
|
772
|
-
base:
|
|
773
|
-
gap:
|
|
774
|
-
columns:
|
|
775
|
-
columnWidth:
|
|
776
|
-
}),
|
|
860
|
+
let a = e.props, s = B(a.__baselineConfig ?? z(e, M, i)), l = a.variant ?? s.guide.variant, u = V(a.debugging, s.guide.debugging), d = O({
|
|
861
|
+
variant: l,
|
|
862
|
+
base: s.base,
|
|
863
|
+
gap: a.gap ?? 0,
|
|
864
|
+
columns: a.columns,
|
|
865
|
+
columnWidth: a.columnWidth
|
|
866
|
+
}), f = T(t.width, d, {
|
|
777
867
|
viewportWidth: typeof window > "u" ? void 0 : window.innerWidth,
|
|
778
868
|
viewportHeight: typeof window > "u" ? void 0 : window.innerHeight
|
|
779
|
-
}),
|
|
780
|
-
base:
|
|
781
|
-
colors:
|
|
782
|
-
variant:
|
|
783
|
-
align:
|
|
784
|
-
width:
|
|
785
|
-
height:
|
|
786
|
-
columnWidth:
|
|
787
|
-
maxWidth:
|
|
788
|
-
color:
|
|
789
|
-
template:
|
|
790
|
-
columnsCount:
|
|
791
|
-
calculatedGap:
|
|
792
|
-
isVisible:
|
|
869
|
+
}), p = A({
|
|
870
|
+
base: s.base,
|
|
871
|
+
colors: s.guide.colors,
|
|
872
|
+
variant: l,
|
|
873
|
+
align: a.align ?? "center",
|
|
874
|
+
width: a.width,
|
|
875
|
+
height: a.height,
|
|
876
|
+
columnWidth: a.columnWidth,
|
|
877
|
+
maxWidth: a.maxWidth,
|
|
878
|
+
color: a.color,
|
|
879
|
+
template: f.template,
|
|
880
|
+
columnsCount: f.columnsCount,
|
|
881
|
+
calculatedGap: f.calculatedGap,
|
|
882
|
+
isVisible: u.isShown
|
|
883
|
+
}), m = D({
|
|
884
|
+
variant: l,
|
|
885
|
+
columns: a.columns,
|
|
886
|
+
columnWidth: a.columnWidth,
|
|
887
|
+
gap: a.gap ?? 0,
|
|
888
|
+
align: a.align ?? "center",
|
|
889
|
+
domDiagnostics: s.domDiagnostics,
|
|
890
|
+
className: a.className,
|
|
891
|
+
style: a.style && typeof a.style == "object" ? a.style : void 0
|
|
793
892
|
});
|
|
794
|
-
if (
|
|
795
|
-
className:
|
|
796
|
-
"data-testid": "guide",
|
|
797
|
-
"data-variant": s,
|
|
893
|
+
if (a.ssrMode) return /* @__PURE__ */ n("div", {
|
|
894
|
+
className: L("bk-gde", "bk-h", "bk-ssr", `bk-${l}`, a.className),
|
|
895
|
+
"data-testid": s.domDiagnostics ? "guide" : void 0,
|
|
896
|
+
"data-variant": s.domDiagnostics ? l : void 0,
|
|
798
897
|
"aria-hidden": !0,
|
|
799
|
-
style:
|
|
800
|
-
width:
|
|
801
|
-
height:
|
|
802
|
-
maxWidth:
|
|
803
|
-
},
|
|
804
|
-
|
|
898
|
+
style: R(P({
|
|
899
|
+
width: c(a.width ?? "100%"),
|
|
900
|
+
height: c(a.height ?? "100%"),
|
|
901
|
+
maxWidth: c(a.maxWidth ?? "none")
|
|
902
|
+
}, {
|
|
903
|
+
width: "100%",
|
|
904
|
+
height: "100%",
|
|
905
|
+
maxWidth: "none"
|
|
906
|
+
}), a.style),
|
|
907
|
+
...I(a),
|
|
908
|
+
children: a.children
|
|
805
909
|
});
|
|
806
|
-
let
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
"data-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
children: f
|
|
910
|
+
let h = !p.isLineVariant && u.isShown && !m ? Array.from({ length: p.columnsCount }, (e, t) => /* @__PURE__ */ n("div", {
|
|
911
|
+
className: L("bk-col", `bk-${l}`),
|
|
912
|
+
"data-column-index": s.domDiagnostics ? t : void 0,
|
|
913
|
+
"data-variant": s.domDiagnostics ? l : void 0
|
|
914
|
+
}, t)) : null, g = u.isShown ? /* @__PURE__ */ n("div", {
|
|
915
|
+
className: L("bk-cols", `bk-${l}`, m && "bk-cols-compact-fixed"),
|
|
916
|
+
"data-variant": s.domDiagnostics ? l : void 0,
|
|
917
|
+
children: h
|
|
815
918
|
}) : null;
|
|
816
|
-
return
|
|
817
|
-
className:
|
|
818
|
-
"data-testid": "guide",
|
|
819
|
-
"data-variant": s,
|
|
919
|
+
return /* @__PURE__ */ r("div", {
|
|
920
|
+
className: L(...p.classTokens.map((e) => `bk-${e}`), !p.classTokens.includes(l) && `bk-${l}`, a.className),
|
|
921
|
+
"data-testid": s.domDiagnostics ? "guide" : void 0,
|
|
922
|
+
"data-variant": s.domDiagnostics ? l : void 0,
|
|
820
923
|
"aria-hidden": !0,
|
|
821
|
-
style:
|
|
822
|
-
|
|
823
|
-
|
|
924
|
+
style: R(P(p.containerStyle, {
|
|
925
|
+
"--bkgd-w": "100%",
|
|
926
|
+
"--bkgd-h": "100%",
|
|
927
|
+
"--bkgd-mw": "none",
|
|
928
|
+
"--bkgd-cw": "60px",
|
|
929
|
+
"--bkgd-n": "12",
|
|
930
|
+
"--bkgd-b": "0",
|
|
931
|
+
"--bkgd-cl": i.guide.colors.line,
|
|
932
|
+
"--bkgd-cp": i.guide.colors.pattern,
|
|
933
|
+
"--bkgd-ca": i.guide.colors.auto,
|
|
934
|
+
"--bkgd-cf": i.guide.colors.fixed,
|
|
935
|
+
"--bkgd-g": "0px",
|
|
936
|
+
"--bkgd-j": "center",
|
|
937
|
+
"--bkgd-t": "none",
|
|
938
|
+
"--bkgd-line-color": "var(--bkgd-cl)"
|
|
939
|
+
}), a.style),
|
|
940
|
+
...I(a),
|
|
941
|
+
mix: typeof window > "u" || a.ssrMode ? void 0 : o.attach,
|
|
942
|
+
children: [g, a.children]
|
|
824
943
|
});
|
|
825
944
|
};
|
|
826
945
|
}
|
|
827
|
-
var
|
|
946
|
+
var he = Y(`${import.meta.url}#Guide`, me);
|
|
828
947
|
//#endregion
|
|
829
|
-
//#region packages/remix/src/Spacer.
|
|
830
|
-
function
|
|
948
|
+
//#region packages/remix/src/Spacer.tsx
|
|
949
|
+
function Z(e) {
|
|
831
950
|
return () => {
|
|
832
|
-
let
|
|
833
|
-
base:
|
|
834
|
-
colors:
|
|
835
|
-
width:
|
|
836
|
-
height:
|
|
837
|
-
color:
|
|
838
|
-
variant:
|
|
839
|
-
isVisible:
|
|
840
|
-
}),
|
|
841
|
-
key: "height",
|
|
951
|
+
let t = e.props, a = B(t.__baselineConfig ?? z(e, M, i)), o = t.base ?? a.base, s = t.variant ?? a.spacer.variant, c = V(t.debugging, a.spacer.debugging), l = oe({
|
|
952
|
+
base: o,
|
|
953
|
+
colors: a.spacer.colors,
|
|
954
|
+
width: t.width,
|
|
955
|
+
height: t.height,
|
|
956
|
+
color: t.color,
|
|
957
|
+
variant: s,
|
|
958
|
+
isVisible: c.isShown
|
|
959
|
+
}), u = c.isShown && t.indicatorNode ? [l.normHeight === 0 ? null : /* @__PURE__ */ n("span", {
|
|
842
960
|
className: "bk-indicator",
|
|
843
961
|
"aria-hidden": !0,
|
|
844
|
-
children:
|
|
845
|
-
}),
|
|
846
|
-
key: "width",
|
|
962
|
+
children: t.indicatorNode(l.normHeight, "height")
|
|
963
|
+
}, "height"), l.normWidth === 0 ? null : /* @__PURE__ */ n("span", {
|
|
847
964
|
className: "bk-indicator",
|
|
848
965
|
"aria-hidden": !0,
|
|
849
|
-
children:
|
|
850
|
-
})] : null;
|
|
851
|
-
return
|
|
852
|
-
className:
|
|
853
|
-
"data-testid": "spacer",
|
|
854
|
-
"data-variant":
|
|
855
|
-
"data-height": `${
|
|
856
|
-
style:
|
|
857
|
-
|
|
966
|
+
children: t.indicatorNode(l.normWidth, "width")
|
|
967
|
+
}, "width")] : null;
|
|
968
|
+
return /* @__PURE__ */ r("div", {
|
|
969
|
+
className: L(...l.classTokens.map((e) => `bk-${e}`), t.className),
|
|
970
|
+
"data-testid": a.domDiagnostics ? "spacer" : void 0,
|
|
971
|
+
"data-variant": a.domDiagnostics ? s : void 0,
|
|
972
|
+
"data-height": a.domDiagnostics ? `${l.normHeight}px` : void 0,
|
|
973
|
+
style: R(P(l.style, {
|
|
974
|
+
"--bksp-w": "var(--bk-wf, 100%)",
|
|
975
|
+
"--bksp-h": "var(--bk-hf, auto)",
|
|
976
|
+
"--bksp-b": "8px",
|
|
977
|
+
"--bksp-cl": i.spacer.colors.line,
|
|
978
|
+
"--bksp-cf": i.spacer.colors.flat,
|
|
979
|
+
"--bksp-ct": i.spacer.colors.text
|
|
980
|
+
}), t.style),
|
|
981
|
+
...I(t),
|
|
982
|
+
children: [u, t.children]
|
|
858
983
|
});
|
|
859
984
|
};
|
|
860
985
|
}
|
|
861
|
-
var
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
function Q(t) {
|
|
866
|
-
let n = r.base, i = g({}), a = null, o = q(({ height: e }) => {
|
|
867
|
-
t.props.ssrMode || a || e === 0 || (a = b(e, n, i, "height"), G(t));
|
|
986
|
+
var Q = Y(`${import.meta.url}#Spacer`, Z), ge = Q;
|
|
987
|
+
function _e(e) {
|
|
988
|
+
let t = i.base, r = _({}), a = null, o = X(({ height: n }) => {
|
|
989
|
+
e.props.ssrMode || a || n === 0 || (a = x(n, t, r, "height"), J(e));
|
|
868
990
|
});
|
|
869
991
|
return () => {
|
|
870
|
-
let s =
|
|
871
|
-
|
|
992
|
+
let s = e.props, c = B(s.__baselineConfig ?? z(e, M, i)), l = V(s.debugging, c.padder.debugging);
|
|
993
|
+
t = c.base, r = _({
|
|
872
994
|
padding: s.padding,
|
|
873
995
|
block: s.block,
|
|
874
996
|
inline: s.inline
|
|
875
997
|
});
|
|
876
|
-
let u = s.ssrMode ?
|
|
998
|
+
let u = s.ssrMode ? r : a ?? r, d = typeof window > "u" || s.ssrMode ? void 0 : o.attach, f = se({
|
|
877
999
|
base: c.base,
|
|
878
1000
|
color: c.padder.color,
|
|
879
1001
|
width: s.width,
|
|
@@ -882,108 +1004,144 @@ function Q(t) {
|
|
|
882
1004
|
enableSpacers: !l.isNone,
|
|
883
1005
|
isVisible: l.isShown
|
|
884
1006
|
});
|
|
885
|
-
if (l.isNone) return
|
|
886
|
-
className:
|
|
887
|
-
"data-testid": "padder",
|
|
1007
|
+
if (l.isNone) return /* @__PURE__ */ n("div", {
|
|
1008
|
+
className: L(...f.classTokens.map((e) => `bk-${e}`), s.className),
|
|
1009
|
+
"data-testid": c.domDiagnostics ? "padder" : void 0,
|
|
888
1010
|
mix: d,
|
|
889
|
-
style:
|
|
890
|
-
|
|
1011
|
+
style: R(P(f.containerStyle, {
|
|
1012
|
+
"--bkpd-w": "auto",
|
|
1013
|
+
"--bkpd-h": "auto",
|
|
1014
|
+
"--bkpd-b": "8px",
|
|
1015
|
+
"--bkpd-c": i.padder.color
|
|
1016
|
+
}), s.style),
|
|
1017
|
+
...I(s),
|
|
1018
|
+
children: s.preserveContentHost ? /* @__PURE__ */ n("div", {
|
|
1019
|
+
className: "bk-pad-content",
|
|
1020
|
+
"data-testid": c.domDiagnostics ? "padder-content" : void 0,
|
|
1021
|
+
children: s.children
|
|
1022
|
+
}, "content") : s.children
|
|
891
1023
|
});
|
|
892
|
-
let p = c.spacer.variant, m = (
|
|
1024
|
+
let p = c.spacer.variant, m = (e, t) => /* @__PURE__ */ n(ge, {
|
|
893
1025
|
__baselineConfig: c,
|
|
894
|
-
width:
|
|
895
|
-
height:
|
|
1026
|
+
width: e === "100%" ? void 0 : e,
|
|
1027
|
+
height: t === "100%" ? void 0 : t,
|
|
896
1028
|
variant: p,
|
|
897
1029
|
debugging: l.debugging,
|
|
898
1030
|
indicatorNode: s.indicatorNode
|
|
899
1031
|
}), h = [
|
|
900
|
-
u.top
|
|
901
|
-
|
|
902
|
-
style: X,
|
|
1032
|
+
u.top > 0 ? /* @__PURE__ */ n("div", {
|
|
1033
|
+
className: "bk-pad-top",
|
|
903
1034
|
children: m("100%", u.top)
|
|
904
|
-
}) : null,
|
|
905
|
-
u.left
|
|
906
|
-
|
|
907
|
-
style: Z,
|
|
1035
|
+
}, "top") : null,
|
|
1036
|
+
u.left > 0 ? /* @__PURE__ */ n("div", {
|
|
1037
|
+
className: "bk-pad-left",
|
|
908
1038
|
children: m(u.left, "100%")
|
|
909
|
-
}) : null,
|
|
910
|
-
|
|
911
|
-
key: "content",
|
|
1039
|
+
}, "left") : null,
|
|
1040
|
+
/* @__PURE__ */ n("div", {
|
|
912
1041
|
className: "bk-pad-content",
|
|
913
|
-
"data-testid": "padder-content",
|
|
914
|
-
style: ue,
|
|
1042
|
+
"data-testid": c.domDiagnostics ? "padder-content" : void 0,
|
|
915
1043
|
children: s.children
|
|
916
|
-
}),
|
|
917
|
-
u.right
|
|
918
|
-
|
|
919
|
-
style: Z,
|
|
1044
|
+
}, "content"),
|
|
1045
|
+
u.right > 0 ? /* @__PURE__ */ n("div", {
|
|
1046
|
+
className: "bk-pad-right",
|
|
920
1047
|
children: m(u.right, "100%")
|
|
921
|
-
}) : null,
|
|
922
|
-
u.bottom
|
|
923
|
-
|
|
924
|
-
style: X,
|
|
1048
|
+
}, "right") : null,
|
|
1049
|
+
u.bottom > 0 ? /* @__PURE__ */ n("div", {
|
|
1050
|
+
className: "bk-pad-bottom",
|
|
925
1051
|
children: m("100%", u.bottom)
|
|
926
|
-
}) : null
|
|
1052
|
+
}, "bottom") : null
|
|
927
1053
|
];
|
|
928
|
-
return
|
|
929
|
-
className:
|
|
930
|
-
"data-testid": "padder",
|
|
1054
|
+
return /* @__PURE__ */ n("div", {
|
|
1055
|
+
className: L(...f.classTokens.map((e) => `bk-${e}`), s.className),
|
|
1056
|
+
"data-testid": c.domDiagnostics ? "padder" : void 0,
|
|
931
1057
|
mix: d,
|
|
932
|
-
style:
|
|
1058
|
+
style: R(P(f.containerStyle, {
|
|
1059
|
+
"--bkpd-w": "auto",
|
|
1060
|
+
"--bkpd-h": "auto",
|
|
1061
|
+
"--bkpd-b": "8px",
|
|
1062
|
+
"--bkpd-c": i.padder.color
|
|
1063
|
+
}), s.style),
|
|
1064
|
+
...I(s),
|
|
933
1065
|
children: h
|
|
934
1066
|
});
|
|
935
1067
|
};
|
|
936
1068
|
}
|
|
937
|
-
var $ =
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1069
|
+
var $ = Y(`${import.meta.url}#Padder`, _e), ve = $, ye = $, be = M;
|
|
1070
|
+
function xe(e) {
|
|
1071
|
+
let t = i.base, r = "clamp", a = "bottom", s = _({}), c = null, l = () => {
|
|
1072
|
+
J(e);
|
|
1073
|
+
}, u = X((e) => {
|
|
1074
|
+
r === "none" || c || e.height === 0 || (c = x(e.height, t, s, {
|
|
1075
|
+
mode: r,
|
|
1076
|
+
snapEdge: a
|
|
1077
|
+
}), l());
|
|
945
1078
|
});
|
|
946
1079
|
return () => {
|
|
947
|
-
let
|
|
948
|
-
padding:
|
|
949
|
-
block:
|
|
950
|
-
inline:
|
|
1080
|
+
let l = e.props, d = B(l.__baselineConfig ?? z(e, M, i)), f = l.snapping ?? "clamp", p = l.snapEdge ?? "bottom", m = V(l.debugging, d.box.debugging), h = _({
|
|
1081
|
+
padding: l.padding,
|
|
1082
|
+
block: l.block,
|
|
1083
|
+
inline: l.inline
|
|
951
1084
|
});
|
|
952
|
-
|
|
953
|
-
let
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1085
|
+
t = d.base, r = f, a = p, s = h;
|
|
1086
|
+
let g = f === "none" ? h : c ?? h, v = o({
|
|
1087
|
+
parentConfig: d,
|
|
1088
|
+
base: 1,
|
|
1089
|
+
spacer: { variant: "flat" }
|
|
1090
|
+
}), y = ie({
|
|
1091
|
+
className: l.className,
|
|
1092
|
+
style: l.style,
|
|
1093
|
+
width: l.width
|
|
1094
|
+
}), b = ae({
|
|
1095
|
+
base: d.base,
|
|
1096
|
+
lineColor: d.box.colors.line,
|
|
1097
|
+
width: l.width,
|
|
1098
|
+
height: l.height,
|
|
1099
|
+
span: l.span,
|
|
1100
|
+
colSpan: l.colSpan,
|
|
1101
|
+
rowSpan: l.rowSpan,
|
|
1102
|
+
isVisible: m.isShown
|
|
1103
|
+
}), x = y ? void 0 : P({
|
|
1104
|
+
...g.top > 0 || g.bottom > 0 ? { gridTemplateRows: `${g.top}px 1fr ${g.bottom}px` } : {},
|
|
1105
|
+
...g.left > 0 || g.right > 0 ? { gridTemplateColumns: `${g.left}px 1fr ${g.right}px` } : {}
|
|
1106
|
+
}, {
|
|
1107
|
+
gridTemplateRows: "auto 1fr auto",
|
|
1108
|
+
gridTemplateColumns: "auto 1fr auto"
|
|
970
1109
|
});
|
|
971
|
-
return
|
|
972
|
-
className:
|
|
973
|
-
"data-testid": "box",
|
|
974
|
-
style:
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1110
|
+
return /* @__PURE__ */ n("div", {
|
|
1111
|
+
className: L(...b.classTokens.map((e) => `bk-${e}`), y && "bk-box-separate-padder", m.isShown && !y && "bk-box-pad-visible", l.className),
|
|
1112
|
+
"data-testid": d.domDiagnostics ? "box" : void 0,
|
|
1113
|
+
style: R(P(b.boxStyle, {
|
|
1114
|
+
"--bkbx-w": "fit-content",
|
|
1115
|
+
"--bkbx-h": "fit-content",
|
|
1116
|
+
"--bkbx-cl": i.box.colors.line
|
|
1117
|
+
}), y ? void 0 : R(x, m.isShown ? P({ "--bkpd-c": d.padder.color }, { "--bkpd-c": i.padder.color }) : void 0), b.gridSpanStyle, l.style),
|
|
1118
|
+
...I(l),
|
|
1119
|
+
mix: typeof window > "u" || l.ssrMode || f === "none" ? void 0 : u.attach,
|
|
1120
|
+
children: /* @__PURE__ */ n(be, {
|
|
1121
|
+
__baselineConfig: d,
|
|
978
1122
|
base: 1,
|
|
979
1123
|
spacer: { variant: "flat" },
|
|
980
|
-
children:
|
|
1124
|
+
children: y ? /* @__PURE__ */ n(ye, {
|
|
1125
|
+
__baselineConfig: v,
|
|
1126
|
+
block: [g.top, g.bottom],
|
|
1127
|
+
inline: [g.left, g.right],
|
|
1128
|
+
width: "fit-content",
|
|
1129
|
+
height: l.height,
|
|
1130
|
+
debugging: m.debugging,
|
|
1131
|
+
preserveContentHost: !0,
|
|
1132
|
+
ssrMode: !0,
|
|
1133
|
+
children: l.children
|
|
1134
|
+
}) : /* @__PURE__ */ n("div", {
|
|
1135
|
+
className: "bk-pad-content",
|
|
1136
|
+
"data-testid": d.domDiagnostics ? "padder-content" : void 0,
|
|
1137
|
+
children: l.children
|
|
1138
|
+
})
|
|
981
1139
|
})
|
|
982
1140
|
});
|
|
983
1141
|
};
|
|
984
1142
|
}
|
|
985
|
-
var
|
|
1143
|
+
var Se = Y(`${import.meta.url}#Box`, xe);
|
|
986
1144
|
//#endregion
|
|
987
|
-
export {
|
|
1145
|
+
export { pe as Baseline, Se as Box, M as Config, he as Guide, ve as Padder, Q as Spacer };
|
|
988
1146
|
|
|
989
1147
|
//# sourceMappingURL=remix.mjs.map
|