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/dist/remix.mjs CHANGED
@@ -1,8 +1,9 @@
1
- import { jsx as e } from "remix/ui/jsx-runtime";
2
- import { clientEntry as t, ref as n } from "remix/ui";
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 r = {
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
- }, i = [
46
+ }, a = [
46
47
  "baseline",
47
48
  "guide",
48
49
  "spacer",
49
50
  "box",
50
51
  "padder"
51
- ], a = (e) => {
52
- let { parentConfig: t, base: n } = e, r = {};
53
- for (let n of i) {
54
- let i = e[n], a = t[n], o = {
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
- ...i
57
+ ...r
57
58
  };
58
- i && "colors" in i && i.colors && "colors" in a && (o.colors = {
59
+ r && "colors" in r && r.colors && "colors" in a && (o.colors = {
59
60
  ...a.colors,
60
- ...i.colors
61
- }), r[n] = o;
61
+ ...r.colors
62
+ }), i[n] = o;
62
63
  }
63
64
  return {
64
65
  base: n ?? t.base,
65
- ...r
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 o(e) {
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 s(e, t) {
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 c = {
84
+ var l = {
83
85
  parentSize: 0,
84
86
  viewportWidth: 1920,
85
87
  viewportHeight: 1080,
86
88
  rootFontSize: 16,
87
89
  parentFontSize: 16
88
- }, l = {
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
- }, u = {
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 d(e, t) {
106
+ function f(e, t) {
105
107
  if (typeof e == "number") return e;
106
108
  if (typeof e != "string") return null;
107
- let n = o(e);
109
+ let n = s(e);
108
110
  if (!n) return null;
109
111
  let { value: r, unit: i } = n;
110
- if (i in l) return r * l[i];
112
+ if (i in u) return r * u[i];
111
113
  if (i === "auto") return null;
112
- let a = u[i];
114
+ let a = d[i];
113
115
  return a ? r * a({
114
- ...c,
116
+ ...l,
115
117
  ...t
116
118
  }) : null;
117
119
  }
118
120
  //#endregion
119
121
  //#region packages/core/src/utils/math.ts
120
- function f(e, t, n) {
122
+ function p(e, t, n) {
121
123
  return Math.min(Math.max(e, t), n);
122
124
  }
123
- function p(e) {
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 m(e, t = {}) {
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 = d(e, a) ?? n), o === null && (o = n), n <= 0) return 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 : f(s, i.min ?? -Infinity, i.max ?? Infinity);
137
+ return i === void 0 ? s : p(s, i.min ?? -Infinity, i.max ?? Infinity);
136
138
  }
137
- function h(e, t, n) {
138
- return !e || e[0] === void 0 && e[1] === void 0 ? t : [e[0] === void 0 ? t[0] : m(e[0], n), e[1] === void 0 ? t[1] : m(e[1], n)];
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 g(e) {
143
- if ("padding" in e && e.padding != null) return _(e.padding);
144
- let t = "block" in e && e.block != null ? v(e.block) : {
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 ? y(e.inline) : {
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 _(e) {
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 v(e) {
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 y(e) {
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 b(e, t, n, r) {
229
- let i = g({ padding: n });
230
- if (r === "none") return i;
231
- if (r === "height") {
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 && (i.bottom += t - n);
235
+ if (n !== 0) {
236
+ let e = t - n;
237
+ o === "top" ? i.top += e : i.bottom += e;
238
+ }
234
239
  }
235
- if (r === "clamp") {
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 x(e, t, n) {
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 ee = /^\d*\.?\d+(?:fr|px|%|em|rem|vh|vw|vmin|vmax|pt|pc|in|cm|mm)$/, S = (e) => typeof e == "number" ? Number.isFinite(e) && e >= 0 : typeof e == "string" ? e === "auto" || e === "100%" || ee.test(e) : !1, te = (e) => Array.isArray(e) && e.length > 0 && e.every(S), C = {
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 ne(e, t, n) {
257
- let r = t.variant ?? "line", i = t.base ?? 8, a = m(t.gap ?? 0, {
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 C;
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 C;
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") ? C : {
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 ? C : {
285
- template: `repeat(${e}, ${t.columnWidth ? s(t.columnWidth) : "1fr"})`,
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 = d(i, n) ?? 0, s = o > 0 ? Math.max(1, Math.floor((e + a) / (o + a))) : 1;
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 w = (e, t, n) => {
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 T({ variant: e, base: t, gap: n, columns: r, columnWidth: i }) {
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 E = (e, t) => ({
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 D(e) {
369
- let { base: t, colors: n, variant: r, align: i, width: a, height: o, columnWidth: c, maxWidth: l, color: u, template: d, columnsCount: f, calculatedGap: p, isVisible: m } = e, h = E(t, n.line), g = {
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": s(a ?? "100%"),
375
- "--bkgd-h": s(o ?? "100%"),
376
- ...x({
389
+ "--bkgd-w": c(a ?? "100%"),
390
+ "--bkgd-h": c(o ?? "100%"),
391
+ ...S({
377
392
  key: "--bkgd-mw",
378
- value: s(l || "none"),
393
+ value: c(l || "none"),
379
394
  defaultStyles: h
380
395
  }),
381
- ...x({
396
+ ...S({
382
397
  key: "--bkgd-cw",
383
- value: s(c || "60px"),
398
+ value: c(s || "60px"),
384
399
  defaultStyles: h
385
400
  }),
386
- ...x({
401
+ ...S({
387
402
  key: "--bkgd-n",
388
403
  value: `${f}`,
389
404
  defaultStyles: h
390
405
  }),
391
- ...x({
406
+ ...S({
392
407
  key: "--bkgd-b",
393
408
  value: "0",
394
409
  defaultStyles: h
395
410
  }),
396
- ...x({
411
+ ...S({
397
412
  key: "--bkgd-cl",
398
413
  value: u ?? n.line,
399
414
  defaultStyles: h
400
415
  }),
401
- ...x({
416
+ ...S({
402
417
  key: "--bkgd-g",
403
418
  value: `${p}px`,
404
419
  defaultStyles: h
405
420
  }),
406
- ...x({
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 O(e) {
427
- let { base: t, colors: n, variant: r, width: i, height: a, color: o, containerWidth: c, containerHeight: l, spacing: u, isVisible: d } = e, { top: f, right: m, bottom: _, left: v } = g(u), y = [
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
- m,
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 = p({
433
- height: l > 0 ? l : h([void 0, a], [c, 0])[1],
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": s(i) },
441
- ...a === void 0 ? {} : { "--bkbl-h": s(a) },
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: x,
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
- function k(e) {
460
- let { lineColor: t, width: n, height: r, span: i, colSpan: a, rowSpan: o, isVisible: c } = e, l = {
461
- ...n === void 0 ? {} : { "--bkbx-w": s(n) },
462
- ...r === void 0 ? {} : { "--bkbx-h": s(r) },
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 = w(i, a, o), d = ["box"];
465
- return c && d.push("v"), {
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 A(e) {
474
- let { base: t, colors: n, width: r, height: i, color: a, variant: o, isVisible: c } = e, [l, u] = h([r, i], [0, 0], {
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": s(u) },
479
- ...r === void 0 ? {} : { "--bksp-w": s(l) },
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 c && f.push(o), {
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 j(e) {
495
- let { base: t, color: n, width: r, height: i, padding: a, enableSpacers: o, isVisible: c } = e, l = {};
496
- if (r !== void 0 && r !== "fit-content" && (l["--bkpd-w"] = s(r)), i !== void 0 && i !== "fit-content" && (l["--bkpd-h"] = s(i)), l["--bkpd-b"] = `${t}px`, l["--bkpd-c"] = n, !o) {
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 c && o && u.push("v"), {
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 M(e) {
547
+ function ce(e) {
509
548
  return () => {
510
- let t = a({
511
- parentConfig: e.props.__baselineConfig ?? e.context.get(N) ?? r,
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 N = M, P = (e) => {
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 re(e, t) {
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] = P(r);
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 ie(e, t, n) {
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] = P(() => {
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.ts
586
- function F(...e) {
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 I(...e) {
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 L(e, t, n) {
655
+ function z(e, t, n) {
601
656
  return e.context.get(t) ?? n;
602
657
  }
603
- function R(e, t) {
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 z = 40, B = /* @__PURE__ */ new WeakSet(), V = [], H = !1;
612
- function U() {
613
- H = !1;
614
- let e = V.splice(0, z);
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
- B.delete(t);
678
+ U.delete(t);
618
679
  continue;
619
680
  }
620
681
  try {
621
- t.update().catch(() => void 0).finally(() => B.delete(t));
682
+ t.update().catch(() => void 0).finally(() => U.delete(t));
622
683
  } catch {
623
- B.delete(t);
684
+ U.delete(t);
624
685
  }
625
686
  }
626
- V.length > 0 && W();
687
+ W.length > 0 && q();
627
688
  }
628
- function W() {
629
- H || (H = !0, setTimeout(typeof requestAnimationFrame == "function" ? () => requestAnimationFrame(U) : () => setTimeout(U, 0), 0));
689
+ function q() {
690
+ G || (G = !0, setTimeout(typeof requestAnimationFrame == "function" ? () => requestAnimationFrame(K) : () => setTimeout(K, 0), 0));
630
691
  }
631
- function G(e) {
632
- e.signal.aborted || B.has(e) || (B.add(e), V.push(e), W());
692
+ function J(e) {
693
+ e.signal.aborted || U.has(e) || (U.add(e), W.push(e), q());
633
694
  }
634
- function K(n, i) {
635
- let a = t(n, i);
636
- return ((t) => () => {
637
- let n = t.context.get(N), i = t.props.__baselineConfig ?? n ?? r;
638
- return e(a, {
639
- ...t.props,
640
- __baselineConfig: i
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 q(e) {
645
- let t = null, r, i = !1, a = 0, o = (e) => {
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: n((n, s) => {
650
- t = n, typeof ResizeObserver < "u" && (r = re(n, (t) => {
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, t = null;
720
+ r?.disconnect(), r = void 0, i = !1, a = 0, n = null;
660
721
  }, { once: !0 });
661
722
  }),
662
- getElement: () => t
723
+ getElement: () => n
663
724
  };
664
725
  }
665
- function J(e, t, n, r = 160) {
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 = ie(u, {
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.ts
699
- function ae(t) {
700
- let n = {
759
+ //#region packages/remix/src/Baseline.tsx
760
+ function fe(e) {
761
+ let t = {
701
762
  width: 0,
702
763
  height: 0
703
- }, i = () => {
704
- G(t);
705
- }, a = q((e) => {
706
- (e.width !== n.width || e.height !== n.height) && (n = e, i());
707
- }), o = J(t, a.getElement, i);
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 i = t.props, c = i.__baselineConfig ?? L(t, N, r), l = i.base ?? c.base, u = i.variant ?? c.baseline.variant, d = R(i.debugging, c.baseline.debugging), f = O({
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: c.baseline.colors,
772
+ colors: s.baseline.colors,
712
773
  variant: u,
713
- width: i.width,
714
- height: i.height,
715
- color: i.color,
716
- containerWidth: n.width,
717
- containerHeight: n.height,
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: i.padding,
720
- block: i.block,
721
- inline: i.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 (i.ssrMode) return e("div", {
726
- className: F("bk-bas", "bk-h", "bk-ssr", i.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: I(f.containerStyle, {
730
- width: s(i.width ?? "100%"),
731
- height: s(i.height ?? "100%")
732
- }, i.style)
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 && t.queueTask(() => o.setConfig(f.rowCount, l));
735
- let p = o.getRange(f.rowCount), m = d.isShown ? Array.from({ length: Math.max(0, p.end - p.start) }, (t, n) => {
736
- let r = p.start + n;
737
- return e("div", {
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
- key: r,
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 e("div", {
745
- className: F(...f.classTokens.map((e) => `bk-${e}`), i.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: I(f.containerStyle, {
749
- width: s(i.width ?? "100%"),
750
- height: s(i.height ?? "100%")
751
- }, i.style),
752
- mix: typeof window > "u" || i.ssrMode ? void 0 : a.attach,
753
- children: m
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 oe = K(`${import.meta.url}#Baseline`, ae);
847
+ var pe = Y(`${import.meta.url}#Baseline`, fe);
758
848
  //#endregion
759
- //#region packages/remix/src/Guide.ts
760
- function se(t) {
761
- let n = {
849
+ //#region packages/remix/src/Guide.tsx
850
+ function me(e) {
851
+ let t = {
762
852
  width: 0,
763
853
  height: 0
764
- }, i = () => {
765
- G(t);
766
- }, a = q((e) => {
767
- (e.width !== n.width || e.height !== n.height) && (n = e, i());
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 i = t.props, o = i.__baselineConfig ?? L(t, N, r), s = i.variant ?? o.guide.variant, c = R(i.debugging, o.guide.debugging), l = T({
771
- variant: s,
772
- base: o.base,
773
- gap: i.gap ?? 0,
774
- columns: i.columns,
775
- columnWidth: i.columnWidth
776
- }), u = ne(n.width, l, {
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
- }), d = D({
780
- base: o.base,
781
- colors: o.guide.colors,
782
- variant: s,
783
- align: i.align ?? "center",
784
- width: i.width,
785
- height: i.height,
786
- columnWidth: i.columnWidth,
787
- maxWidth: i.maxWidth,
788
- color: i.color,
789
- template: u.template,
790
- columnsCount: u.columnsCount,
791
- calculatedGap: u.calculatedGap,
792
- isVisible: c.isShown
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 (i.ssrMode) return e("div", {
795
- className: F("bk-gde", "bk-h", "bk-ssr", i.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: I({
800
- width: i.width ?? "100%",
801
- height: i.height ?? "100%",
802
- maxWidth: i.maxWidth ?? "none"
803
- }, i.style),
804
- children: i.children
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 f = !d.isLineVariant && c.isShown ? Array.from({ length: d.columnsCount }, (t, n) => e("div", {
807
- key: n,
808
- className: "bk-col",
809
- "data-column-index": n,
810
- "data-variant": s
811
- })) : null, p = c.isShown ? e("div", {
812
- className: "bk-cols",
813
- "data-variant": s,
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 e("div", {
817
- className: F(...d.classTokens.map((e) => `bk-${e}`), i.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: I(d.containerStyle, i.style),
822
- mix: typeof window > "u" || i.ssrMode ? void 0 : a.attach,
823
- children: [p, i.children]
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 ce = K(`${import.meta.url}#Guide`, se);
946
+ var he = Y(`${import.meta.url}#Guide`, me);
828
947
  //#endregion
829
- //#region packages/remix/src/Spacer.ts
830
- function le(t) {
948
+ //#region packages/remix/src/Spacer.tsx
949
+ function Z(e) {
831
950
  return () => {
832
- let n = t.props, i = n.__baselineConfig ?? L(t, N, r), a = n.base ?? i.base, o = n.variant ?? i.spacer.variant, s = R(n.debugging, i.spacer.debugging), c = A({
833
- base: a,
834
- colors: i.spacer.colors,
835
- width: n.width,
836
- height: n.height,
837
- color: n.color,
838
- variant: o,
839
- isVisible: s.isShown
840
- }), l = s.isShown && n.indicatorNode ? [c.normHeight === 0 ? null : e("span", {
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: n.indicatorNode(c.normHeight, "height")
845
- }), c.normWidth === 0 ? null : e("span", {
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: n.indicatorNode(c.normWidth, "width")
850
- })] : null;
851
- return e("div", {
852
- className: F(...c.classTokens.map((e) => `bk-${e}`), n.className),
853
- "data-testid": "spacer",
854
- "data-variant": o,
855
- "data-height": `${c.normHeight}px`,
856
- style: I(c.style, n.style),
857
- children: [l, n.children]
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 Y = K(`${import.meta.url}#Spacer`, le), X = { gridColumn: "1 / -1" }, Z = { gridRow: "2 / 3" }, ue = {
862
- gridRow: "2 / 3",
863
- gridColumn: "2 / 3"
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 = t.props, c = s.__baselineConfig ?? L(t, N, r), l = R(s.debugging, c.padder.debugging);
871
- n = c.base, i = g({
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 ? i : a ?? i, d = typeof window > "u" || s.ssrMode ? void 0 : o.attach, f = j({
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 e("div", {
886
- className: F(...f.classTokens.map((e) => `bk-${e}`), s.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: I(f.containerStyle, s.style),
890
- children: s.children
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 = (t, n) => e(Y, {
1024
+ let p = c.spacer.variant, m = (e, t) => /* @__PURE__ */ n(ge, {
893
1025
  __baselineConfig: c,
894
- width: t === "100%" ? void 0 : t,
895
- height: n === "100%" ? void 0 : n,
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 >= 0 ? e("div", {
901
- key: "top",
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 >= 0 ? e("div", {
906
- key: "left",
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
- e("div", {
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 >= 0 ? e("div", {
918
- key: "right",
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 >= 0 ? e("div", {
923
- key: "bottom",
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 e("div", {
929
- className: F(...f.classTokens.map((e) => `bk-${e}`), s.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: I(f.containerStyle, s.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 $ = K(`${import.meta.url}#Padder`, Q);
938
- //#endregion
939
- //#region packages/remix/src/Box.ts
940
- function de(t) {
941
- let n = r.base, i = "clamp", a = g({}), o = null, s = () => {
942
- G(t);
943
- }, c = q((e) => {
944
- i === "none" || o || e.height === 0 || (o = b(e.height, n, a, i), s());
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 s = t.props, l = s.__baselineConfig ?? L(t, N, r), u = s.snapping ?? "clamp", d = R(s.debugging, l.box.debugging), f = g({
948
- padding: s.padding,
949
- block: s.block,
950
- inline: s.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
- n = l.base, i = u, a = f;
953
- let p = u === "none" ? f : o ?? f, m = k({
954
- base: l.base,
955
- lineColor: l.box.colors.line,
956
- width: s.width,
957
- height: s.height,
958
- span: s.span,
959
- colSpan: s.colSpan,
960
- rowSpan: s.rowSpan,
961
- isVisible: d.isShown
962
- }), h = e($, {
963
- block: [p.top, p.bottom],
964
- inline: [p.left, p.right],
965
- width: "fit-content",
966
- height: s.height,
967
- debugging: d.debugging,
968
- ssrMode: !0,
969
- children: s.children
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 e("div", {
972
- className: F(...m.classTokens.map((e) => `bk-${e}`), s.className),
973
- "data-testid": "box",
974
- style: I(m.boxStyle, m.gridSpanStyle, s.style),
975
- mix: typeof window > "u" || s.ssrMode || u === "none" ? void 0 : c.attach,
976
- children: e(N, {
977
- __baselineConfig: l,
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: h
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 fe = K(`${import.meta.url}#Box`, de);
1143
+ var Se = Y(`${import.meta.url}#Box`, xe);
986
1144
  //#endregion
987
- export { oe as Baseline, fe as Box, N as Config, ce as Guide, $ as Padder, Y as Spacer };
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