baseline-kit 5.2.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
@@ -3,6 +3,7 @@ import { jsx as n, jsxs as r } from "remix/ui/jsx-runtime";
3
3
  //#region packages/core/src/config/defaults.ts
4
4
  var i = {
5
5
  base: 8,
6
+ domDiagnostics: !1,
6
7
  baseline: {
7
8
  variant: "line",
8
9
  debugging: "hidden",
@@ -49,20 +50,21 @@ var i = {
49
50
  "box",
50
51
  "padder"
51
52
  ], o = (e) => {
52
- let { parentConfig: t, base: n } = e, r = {};
53
+ let { parentConfig: t, base: n, domDiagnostics: r } = e, i = {};
53
54
  for (let n of a) {
54
- let i = e[n], a = t[n], o = {
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
@@ -250,13 +252,13 @@ function S(e, t, n) {
250
252
  }
251
253
  //#endregion
252
254
  //#region packages/core/src/validation/guide.ts
253
- var ee = /^\d*\.?\d+(?:fr|px|%|em|rem|vh|vw|vmin|vmax|pt|pc|in|cm|mm)$/, C = (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(C), w = {
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 = {
254
256
  template: "none",
255
257
  columnsCount: 0,
256
258
  calculatedGap: 0,
257
259
  isValid: !1
258
260
  };
259
- function ne(e, t, n) {
261
+ function T(e, t, n) {
260
262
  let r = t.variant ?? "line", i = t.base ?? 8, a = h(t.gap ?? 0, {
261
263
  base: i,
262
264
  context: n
@@ -318,13 +320,23 @@ function ne(e, t, n) {
318
320
  }
319
321
  }
320
322
  }
321
- var T = (e, t, n) => {
323
+ var E = (e, t, n) => {
322
324
  let r = {};
323
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;
324
326
  };
325
327
  //#endregion
326
328
  //#region packages/core/src/descriptors/guide.ts
327
- function E({ 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 }) {
328
340
  switch (e) {
329
341
  case "line": return {
330
342
  variant: "line",
@@ -357,7 +369,7 @@ function E({ variant: e, base: t, gap: n, columns: r, columnWidth: i }) {
357
369
  base: t
358
370
  };
359
371
  }
360
- var D = (e, t) => ({
372
+ var k = (e, t) => ({
361
373
  "--bkgd-w": "100%",
362
374
  "--bkgd-h": "100%",
363
375
  "--bkgd-mw": "none",
@@ -368,8 +380,8 @@ var D = (e, t) => ({
368
380
  "--bkgd-cl": t,
369
381
  "--bkgd-g": "0"
370
382
  });
371
- function O(e) {
372
- 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 = D(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 = {
373
385
  "--bkgd-cl": u ?? n.line,
374
386
  "--bkgd-cp": u ?? n.pattern,
375
387
  "--bkgd-ca": u ?? n.auto,
@@ -426,14 +438,17 @@ function O(e) {
426
438
  }
427
439
  //#endregion
428
440
  //#region packages/core/src/descriptors/baseline.ts
429
- function k(e) {
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) {
430
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 = [
431
446
  f,
432
447
  p,
433
448
  h,
434
449
  v
435
- ].map((e) => e ? `${e}px` : "0").join(" "), b = y === "0 0 0 0" ? void 0 : y, x = m({
436
- height: l > 0 ? l : g([void 0, a], [s, 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,
437
452
  top: f,
438
453
  bottom: h,
439
454
  base: t
@@ -447,7 +462,8 @@ function k(e) {
447
462
  "--bkbl-c": r === "line" ? "var(--bkbl-cl)" : "var(--bkbl-cf)",
448
463
  ...b ? { padding: b } : {}
449
464
  },
450
- rowCount: x,
465
+ rowCount: C,
466
+ contentHeight: S,
451
467
  getRowStyle: (e) => ({
452
468
  "--bkbl-rt": e === 0 ? "0px" : `${e * t}px`,
453
469
  "--bkbl-rh": r === "line" ? "1px" : `${t}px`
@@ -459,12 +475,32 @@ function k(e) {
459
475
  }
460
476
  //#endregion
461
477
  //#region packages/core/src/descriptors/box.ts
462
- function A(e) {
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) {
463
499
  let { lineColor: t, width: n, height: r, span: i, colSpan: a, rowSpan: o, isVisible: s } = e, l = {
464
500
  ...n === void 0 ? {} : { "--bkbx-w": c(n) },
465
501
  ...r === void 0 ? {} : { "--bkbx-h": c(r) },
466
502
  "--bkbx-cl": t
467
- }, u = T(i, a, o), d = ["box"];
503
+ }, u = E(i, a, o), d = ["box"];
468
504
  return s && d.push("v"), {
469
505
  boxStyle: l,
470
506
  gridSpanStyle: u,
@@ -473,7 +509,7 @@ function A(e) {
473
509
  }
474
510
  //#endregion
475
511
  //#region packages/core/src/descriptors/spacer.ts
476
- function j(e) {
512
+ function oe(e) {
477
513
  let { base: t, colors: n, width: r, height: i, color: a, variant: o, isVisible: s } = e, [l, u] = g([r, i], [0, 0], {
478
514
  base: t,
479
515
  suppressWarnings: !0
@@ -494,7 +530,7 @@ function j(e) {
494
530
  }
495
531
  //#endregion
496
532
  //#region packages/core/src/descriptors/padder.ts
497
- function re(e) {
533
+ function se(e) {
498
534
  let { base: t, color: n, width: r, height: i, padding: a, enableSpacers: o, isVisible: s } = e, l = {};
499
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) {
500
536
  let { top: e, right: t, bottom: n, left: r } = a;
@@ -508,11 +544,12 @@ function re(e) {
508
544
  }
509
545
  //#endregion
510
546
  //#region packages/remix/src/Config.ts
511
- function M(e) {
547
+ function ce(e) {
512
548
  return () => {
513
549
  let t = o({
514
- parentConfig: e.props.__baselineConfig ?? e.context.get(N) ?? i,
550
+ parentConfig: e.props.__baselineConfig ?? e.context.get(M) ?? i,
515
551
  base: e.props.base,
552
+ domDiagnostics: e.props.domDiagnostics,
516
553
  baseline: e.props.baseline,
517
554
  guide: e.props.guide,
518
555
  spacer: e.props.spacer,
@@ -522,7 +559,7 @@ function M(e) {
522
559
  return e.context.set(t), e.props.children ?? null;
523
560
  };
524
561
  }
525
- var N = M, P = (e) => {
562
+ var M = ce, N = (e) => {
526
563
  let t = null, n = null;
527
564
  return [(...r) => {
528
565
  n = r, t !== null && cancelAnimationFrame(t), t = requestAnimationFrame(() => {
@@ -534,7 +571,7 @@ var N = M, P = (e) => {
534
571
  };
535
572
  //#endregion
536
573
  //#region packages/dom/src/measure.ts
537
- function F(e, t) {
574
+ function le(e, t) {
538
575
  let n = {
539
576
  width: 0,
540
577
  height: 0
@@ -546,7 +583,7 @@ function F(e, t) {
546
583
  };
547
584
  (i.width !== n.width || i.height !== n.height) && (n = i, t(i));
548
585
  } catch {}
549
- }, [i, a] = P(r);
586
+ }, [i, a] = N(r);
550
587
  r();
551
588
  let o = new ResizeObserver(i);
552
589
  return o.observe(e), {
@@ -558,7 +595,7 @@ function F(e, t) {
558
595
  }
559
596
  //#endregion
560
597
  //#region packages/dom/src/virtual.ts
561
- function I(e, t, n) {
598
+ function ue(e, t, n) {
562
599
  let { totalItems: r, itemHeight: i, buffer: a = 0 } = t;
563
600
  if (!Number.isFinite(i) || i <= 0) throw Error("createVirtualTracker requires itemHeight to be greater than 0");
564
601
  if (!Number.isFinite(r) || r < 0) throw Error("createVirtualTracker requires totalItems to be 0 or greater");
@@ -571,7 +608,7 @@ function I(e, t, n) {
571
608
  }, s = {
572
609
  start: 0,
573
610
  end: r
574
- }, [c, l] = P(() => {
611
+ }, [c, l] = N(() => {
575
612
  let e = o();
576
613
  (e.start !== s.start || e.end !== s.end) && (s = e, n(e));
577
614
  }), u = { passive: !0 };
@@ -586,6 +623,21 @@ function I(e, t, n) {
586
623
  }
587
624
  //#endregion
588
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
+ }
589
641
  function L(...e) {
590
642
  return e.filter(Boolean).join(" ");
591
643
  }
@@ -603,7 +655,13 @@ function R(...e) {
603
655
  function z(e, t, n) {
604
656
  return e.context.get(t) ?? n;
605
657
  }
606
- function B(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) {
607
665
  let n = e ?? t;
608
666
  return {
609
667
  isShown: n === "visible",
@@ -611,46 +669,46 @@ function B(e, t) {
611
669
  debugging: n
612
670
  };
613
671
  }
614
- var V = 40, H = /* @__PURE__ */ new WeakSet(), U = [], W = !1;
615
- function G() {
616
- W = !1;
617
- let e = U.splice(0, V);
672
+ var H = 40, U = /* @__PURE__ */ new WeakSet(), W = [], G = !1;
673
+ function K() {
674
+ G = !1;
675
+ let e = W.splice(0, H);
618
676
  for (let t of e) {
619
677
  if (t.signal.aborted) {
620
- H.delete(t);
678
+ U.delete(t);
621
679
  continue;
622
680
  }
623
681
  try {
624
- t.update().catch(() => void 0).finally(() => H.delete(t));
682
+ t.update().catch(() => void 0).finally(() => U.delete(t));
625
683
  } catch {
626
- H.delete(t);
684
+ U.delete(t);
627
685
  }
628
686
  }
629
- U.length > 0 && K();
687
+ W.length > 0 && q();
630
688
  }
631
- function K() {
632
- W || (W = !0, setTimeout(typeof requestAnimationFrame == "function" ? () => requestAnimationFrame(G) : () => setTimeout(G, 0), 0));
689
+ function q() {
690
+ G || (G = !0, setTimeout(typeof requestAnimationFrame == "function" ? () => requestAnimationFrame(K) : () => setTimeout(K, 0), 0));
633
691
  }
634
- function q(e) {
635
- e.signal.aborted || H.has(e) || (H.add(e), U.push(e), K());
692
+ function J(e) {
693
+ e.signal.aborted || U.has(e) || (U.add(e), W.push(e), q());
636
694
  }
637
- function J(t, r) {
695
+ function Y(t, r) {
638
696
  let a = e(t, r);
639
697
  return ((e) => () => {
640
- let t = e.context.get(N), r = e.props.__baselineConfig ?? t ?? i;
698
+ let t = e.context.get(M), r = e.props.__baselineConfig ?? t ?? i;
641
699
  return /* @__PURE__ */ n(a, {
642
700
  ...e.props,
643
701
  __baselineConfig: r
644
702
  });
645
703
  });
646
704
  }
647
- function Y(e) {
705
+ function X(e) {
648
706
  let n = null, r, i = !1, a = 0, o = (e) => {
649
707
  e.aborted || i || a >= 10 || (a += 1, r?.refresh(), requestAnimationFrame(() => o(e)));
650
708
  };
651
709
  return {
652
710
  attach: t((t, s) => {
653
- n = t, typeof ResizeObserver < "u" && (r = F(t, (t) => {
711
+ n = t, typeof ResizeObserver < "u" && (r = le(t, (t) => {
654
712
  i = t.width > 0 || t.height > 0;
655
713
  let n = () => {
656
714
  s.aborted || e(t);
@@ -665,7 +723,7 @@ function Y(e) {
665
723
  getElement: () => n
666
724
  };
667
725
  }
668
- function ie(e, t, n, r = 160) {
726
+ function de(e, t, n, r = 160) {
669
727
  let i, a = "", o = 0, s = {
670
728
  start: 0,
671
729
  end: 0
@@ -680,7 +738,7 @@ function ie(e, t, n, r = 160) {
680
738
  d !== a && (c(), a = d, o = e, s = {
681
739
  start: 0,
682
740
  end: e
683
- }, n(s), i = I(u, {
741
+ }, n(s), i = ue(u, {
684
742
  totalItems: e,
685
743
  itemHeight: l,
686
744
  buffer: r
@@ -699,17 +757,17 @@ function ie(e, t, n, r = 160) {
699
757
  }
700
758
  //#endregion
701
759
  //#region packages/remix/src/Baseline.tsx
702
- function ae(e) {
760
+ function fe(e) {
703
761
  let t = {
704
762
  width: 0,
705
763
  height: 0
706
764
  }, r = () => {
707
- q(e);
708
- }, a = Y((e) => {
765
+ J(e);
766
+ }, a = X((e) => {
709
767
  (e.width !== t.width || e.height !== t.height) && (t = e, r());
710
- }), o = ie(e, a.getElement, r);
768
+ }), o = de(e, a.getElement, r);
711
769
  return () => {
712
- let r = e.props, s = r.__baselineConfig ?? z(e, N, i), l = r.base ?? s.base, u = r.variant ?? s.baseline.variant, d = B(r.debugging, s.baseline.debugging), f = k({
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({
713
771
  base: l,
714
772
  colors: s.baseline.colors,
715
773
  variant: u,
@@ -724,113 +782,173 @@ function ae(e) {
724
782
  inline: r.inline
725
783
  },
726
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
727
791
  });
728
792
  if (r.ssrMode) return /* @__PURE__ */ n("div", {
729
- className: L("bk-bas", "bk-h", "bk-ssr", r.className),
730
- "data-testid": "baseline",
793
+ className: L("bk-bas", "bk-h", "bk-ssr", `bk-${u}`, r.className),
794
+ "data-testid": s.domDiagnostics ? "baseline" : void 0,
731
795
  "aria-hidden": !0,
732
- style: R(f.containerStyle, {
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({
733
803
  width: c(r.width ?? "100%"),
734
804
  height: c(r.height ?? "100%")
735
- }, r.style)
805
+ }, {
806
+ width: "100%",
807
+ height: "100%"
808
+ }), r.style),
809
+ ...I(r)
736
810
  });
737
811
  d.isShown && e.queueTask(() => o.setConfig(f.rowCount, l));
738
- let p = o.getRange(f.rowCount), m = d.isShown ? Array.from({ length: Math.max(0, p.end - p.start) }, (e, t) => {
739
- let r = p.start + t;
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;
740
814
  return /* @__PURE__ */ n("div", {
741
815
  className: "bk-row",
742
- "data-row-index": r,
816
+ "data-row-index": s.domDiagnostics ? r : void 0,
743
817
  style: f.getRowStyle(r)
744
818
  }, r);
745
819
  }) : [];
746
820
  return /* @__PURE__ */ n("div", {
747
- className: L(...f.classTokens.map((e) => `bk-${e}`), r.className),
748
- "data-testid": "baseline",
821
+ className: L(...f.classTokens.map((e) => `bk-${e}`), `bk-${u}`, p && "bk-compact", r.className),
822
+ "data-testid": s.domDiagnostics ? "baseline" : void 0,
749
823
  "aria-hidden": !0,
750
- style: R(f.containerStyle, {
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({
751
835
  width: c(r.width ?? "100%"),
752
836
  height: c(r.height ?? "100%")
753
- }, r.style),
837
+ }, {
838
+ width: "100%",
839
+ height: "100%"
840
+ }), r.style),
841
+ ...I(r),
754
842
  mix: typeof window > "u" || r.ssrMode ? void 0 : a.attach,
755
- children: m
843
+ children: h
756
844
  });
757
845
  };
758
846
  }
759
- var oe = J(`${import.meta.url}#Baseline`, ae);
847
+ var pe = Y(`${import.meta.url}#Baseline`, fe);
760
848
  //#endregion
761
849
  //#region packages/remix/src/Guide.tsx
762
- function se(e) {
850
+ function me(e) {
763
851
  let t = {
764
852
  width: 0,
765
853
  height: 0
766
854
  }, a = () => {
767
- q(e);
768
- }, o = Y((e) => {
855
+ J(e);
856
+ }, o = X((e) => {
769
857
  (e.width !== t.width || e.height !== t.height) && (t = e, a());
770
858
  });
771
859
  return () => {
772
- let a = e.props, s = a.__baselineConfig ?? z(e, N, i), c = a.variant ?? s.guide.variant, l = B(a.debugging, s.guide.debugging), u = E({
773
- variant: c,
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,
774
862
  base: s.base,
775
863
  gap: a.gap ?? 0,
776
864
  columns: a.columns,
777
865
  columnWidth: a.columnWidth
778
- }), d = ne(t.width, u, {
866
+ }), f = T(t.width, d, {
779
867
  viewportWidth: typeof window > "u" ? void 0 : window.innerWidth,
780
868
  viewportHeight: typeof window > "u" ? void 0 : window.innerHeight
781
- }), f = O({
869
+ }), p = A({
782
870
  base: s.base,
783
871
  colors: s.guide.colors,
784
- variant: c,
872
+ variant: l,
785
873
  align: a.align ?? "center",
786
874
  width: a.width,
787
875
  height: a.height,
788
876
  columnWidth: a.columnWidth,
789
877
  maxWidth: a.maxWidth,
790
878
  color: a.color,
791
- template: d.template,
792
- columnsCount: d.columnsCount,
793
- calculatedGap: d.calculatedGap,
794
- isVisible: l.isShown
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
795
892
  });
796
893
  if (a.ssrMode) return /* @__PURE__ */ n("div", {
797
- className: L("bk-gde", "bk-h", "bk-ssr", a.className),
798
- "data-testid": "guide",
799
- "data-variant": c,
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,
800
897
  "aria-hidden": !0,
801
- style: R({
802
- width: a.width ?? "100%",
803
- height: a.height ?? "100%",
804
- maxWidth: a.maxWidth ?? "none"
805
- }, a.style),
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),
806
908
  children: a.children
807
909
  });
808
- let p = !f.isLineVariant && l.isShown ? Array.from({ length: f.columnsCount }, (e, t) => /* @__PURE__ */ n("div", {
809
- className: "bk-col",
810
- "data-column-index": t,
811
- "data-variant": c
812
- }, t)) : null, m = l.isShown ? /* @__PURE__ */ n("div", {
813
- className: "bk-cols",
814
- "data-variant": c,
815
- children: p
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
816
918
  }) : null;
817
919
  return /* @__PURE__ */ r("div", {
818
- className: L(...f.classTokens.map((e) => `bk-${e}`), a.className),
819
- "data-testid": "guide",
820
- "data-variant": c,
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,
821
923
  "aria-hidden": !0,
822
- style: R(f.containerStyle, a.style),
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),
823
941
  mix: typeof window > "u" || a.ssrMode ? void 0 : o.attach,
824
- children: [m, a.children]
942
+ children: [g, a.children]
825
943
  });
826
944
  };
827
945
  }
828
- var ce = J(`${import.meta.url}#Guide`, se);
946
+ var he = Y(`${import.meta.url}#Guide`, me);
829
947
  //#endregion
830
948
  //#region packages/remix/src/Spacer.tsx
831
- function le(e) {
949
+ function Z(e) {
832
950
  return () => {
833
- let t = e.props, a = t.__baselineConfig ?? z(e, N, i), o = t.base ?? a.base, s = t.variant ?? a.spacer.variant, c = B(t.debugging, a.spacer.debugging), l = j({
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({
834
952
  base: o,
835
953
  colors: a.spacer.colors,
836
954
  width: t.width,
@@ -849,30 +967,35 @@ function le(e) {
849
967
  }, "width")] : null;
850
968
  return /* @__PURE__ */ r("div", {
851
969
  className: L(...l.classTokens.map((e) => `bk-${e}`), t.className),
852
- "data-testid": "spacer",
853
- "data-variant": s,
854
- "data-height": `${l.normHeight}px`,
855
- style: R(l.style, t.style),
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),
856
982
  children: [u, t.children]
857
983
  });
858
984
  };
859
985
  }
860
- var X = J(`${import.meta.url}#Spacer`, le), ue = X, Z = { gridColumn: "1 / -1" }, Q = { gridRow: "2 / 3" }, de = {
861
- gridRow: "2 / 3",
862
- gridColumn: "2 / 3"
863
- };
864
- function fe(e) {
865
- let t = i.base, r = _({}), a = null, o = Y(({ height: n }) => {
866
- e.props.ssrMode || a || n === 0 || (a = x(n, t, r, "height"), q(e));
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));
867
990
  });
868
991
  return () => {
869
- let s = e.props, c = s.__baselineConfig ?? z(e, N, i), l = B(s.debugging, c.padder.debugging);
992
+ let s = e.props, c = B(s.__baselineConfig ?? z(e, M, i)), l = V(s.debugging, c.padder.debugging);
870
993
  t = c.base, r = _({
871
994
  padding: s.padding,
872
995
  block: s.block,
873
996
  inline: s.inline
874
997
  });
875
- let u = s.ssrMode ? r : a ?? r, d = typeof window > "u" || s.ssrMode ? void 0 : o.attach, f = re({
998
+ let u = s.ssrMode ? r : a ?? r, d = typeof window > "u" || s.ssrMode ? void 0 : o.attach, f = se({
876
999
  base: c.base,
877
1000
  color: c.padder.color,
878
1001
  width: s.width,
@@ -883,12 +1006,22 @@ function fe(e) {
883
1006
  });
884
1007
  if (l.isNone) return /* @__PURE__ */ n("div", {
885
1008
  className: L(...f.classTokens.map((e) => `bk-${e}`), s.className),
886
- "data-testid": "padder",
1009
+ "data-testid": c.domDiagnostics ? "padder" : void 0,
887
1010
  mix: d,
888
- style: R(f.containerStyle, s.style),
889
- 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
890
1023
  });
891
- let p = c.spacer.variant, m = (e, t) => /* @__PURE__ */ n(ue, {
1024
+ let p = c.spacer.variant, m = (e, t) => /* @__PURE__ */ n(ge, {
892
1025
  __baselineConfig: c,
893
1026
  width: e === "100%" ? void 0 : e,
894
1027
  height: t === "100%" ? void 0 : t,
@@ -896,89 +1029,119 @@ function fe(e) {
896
1029
  debugging: l.debugging,
897
1030
  indicatorNode: s.indicatorNode
898
1031
  }), h = [
899
- u.top >= 0 ? /* @__PURE__ */ n("div", {
900
- style: Z,
1032
+ u.top > 0 ? /* @__PURE__ */ n("div", {
1033
+ className: "bk-pad-top",
901
1034
  children: m("100%", u.top)
902
1035
  }, "top") : null,
903
- u.left >= 0 ? /* @__PURE__ */ n("div", {
904
- style: Q,
1036
+ u.left > 0 ? /* @__PURE__ */ n("div", {
1037
+ className: "bk-pad-left",
905
1038
  children: m(u.left, "100%")
906
1039
  }, "left") : null,
907
1040
  /* @__PURE__ */ n("div", {
908
1041
  className: "bk-pad-content",
909
- "data-testid": "padder-content",
910
- style: de,
1042
+ "data-testid": c.domDiagnostics ? "padder-content" : void 0,
911
1043
  children: s.children
912
1044
  }, "content"),
913
- u.right >= 0 ? /* @__PURE__ */ n("div", {
914
- style: Q,
1045
+ u.right > 0 ? /* @__PURE__ */ n("div", {
1046
+ className: "bk-pad-right",
915
1047
  children: m(u.right, "100%")
916
1048
  }, "right") : null,
917
- u.bottom >= 0 ? /* @__PURE__ */ n("div", {
918
- style: Z,
1049
+ u.bottom > 0 ? /* @__PURE__ */ n("div", {
1050
+ className: "bk-pad-bottom",
919
1051
  children: m("100%", u.bottom)
920
1052
  }, "bottom") : null
921
1053
  ];
922
1054
  return /* @__PURE__ */ n("div", {
923
1055
  className: L(...f.classTokens.map((e) => `bk-${e}`), s.className),
924
- "data-testid": "padder",
1056
+ "data-testid": c.domDiagnostics ? "padder" : void 0,
925
1057
  mix: d,
926
- style: R(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),
927
1065
  children: h
928
1066
  });
929
1067
  };
930
1068
  }
931
- var $ = J(`${import.meta.url}#Padder`, fe), pe = N;
932
- function me(e) {
933
- let t = i.base, r = "clamp", a = "bottom", o = _({}), s = null, c = () => {
934
- q(e);
935
- }, l = Y((e) => {
936
- r === "none" || s || e.height === 0 || (s = x(e.height, t, o, {
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, {
937
1075
  mode: r,
938
1076
  snapEdge: a
939
- }), c());
1077
+ }), l());
940
1078
  });
941
1079
  return () => {
942
- let c = e.props, u = c.__baselineConfig ?? z(e, N, i), d = c.snapping ?? "clamp", f = c.snapEdge ?? "bottom", p = B(c.debugging, u.box.debugging), m = _({
943
- padding: c.padding,
944
- block: c.block,
945
- inline: c.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
946
1084
  });
947
- t = u.base, r = d, a = f, o = m;
948
- let h = d === "none" ? m : s ?? m, g = A({
949
- base: u.base,
950
- lineColor: u.box.colors.line,
951
- width: c.width,
952
- height: c.height,
953
- span: c.span,
954
- colSpan: c.colSpan,
955
- rowSpan: c.rowSpan,
956
- isVisible: p.isShown
957
- }), v = /* @__PURE__ */ n($, {
958
- block: [h.top, h.bottom],
959
- inline: [h.left, h.right],
960
- width: "fit-content",
961
- height: c.height,
962
- debugging: p.debugging,
963
- ssrMode: !0,
964
- children: c.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"
965
1109
  });
966
1110
  return /* @__PURE__ */ n("div", {
967
- className: L(...g.classTokens.map((e) => `bk-${e}`), c.className),
968
- "data-testid": "box",
969
- style: R(g.boxStyle, g.gridSpanStyle, c.style),
970
- mix: typeof window > "u" || c.ssrMode || d === "none" ? void 0 : l.attach,
971
- children: /* @__PURE__ */ n(pe, {
972
- __baselineConfig: u,
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,
973
1122
  base: 1,
974
1123
  spacer: { variant: "flat" },
975
- children: v
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
+ })
976
1139
  })
977
1140
  });
978
1141
  };
979
1142
  }
980
- var he = J(`${import.meta.url}#Box`, me);
1143
+ var Se = Y(`${import.meta.url}#Box`, xe);
981
1144
  //#endregion
982
- export { oe as Baseline, he as Box, N as Config, ce as Guide, $ as Padder, X as Spacer };
1145
+ export { pe as Baseline, Se as Box, M as Config, he as Guide, ve as Padder, Q as Spacer };
983
1146
 
984
1147
  //# sourceMappingURL=remix.mjs.map