baseline-kit 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/remix.mjs CHANGED
@@ -1,7 +1,7 @@
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
6
  baseline: {
7
7
  variant: "line",
@@ -42,15 +42,15 @@ var r = {
42
42
  debugging: "hidden",
43
43
  color: "var(--bk-padder-color-theme, hsla(270, 60%, 40%, 0.6))"
44
44
  }
45
- }, i = [
45
+ }, a = [
46
46
  "baseline",
47
47
  "guide",
48
48
  "spacer",
49
49
  "box",
50
50
  "padder"
51
- ], a = (e) => {
51
+ ], o = (e) => {
52
52
  let { parentConfig: t, base: n } = e, r = {};
53
- for (let n of i) {
53
+ for (let n of a) {
54
54
  let i = e[n], a = t[n], o = {
55
55
  ...a,
56
56
  ...i
@@ -67,32 +67,32 @@ var r = {
67
67
  };
68
68
  //#endregion
69
69
  //#region packages/core/src/utils/parse.ts
70
- function o(e) {
70
+ function s(e) {
71
71
  let t = e.trim().match(/^([+-]?[\d.]+)([a-zA-Z%]+)$/);
72
72
  return t ? {
73
73
  value: parseFloat(t[1]),
74
74
  unit: t[2]
75
75
  } : null;
76
76
  }
77
- function s(e, t) {
77
+ function c(e, t) {
78
78
  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
79
  }
80
80
  //#endregion
81
81
  //#region packages/core/src/utils/convert.ts
82
- var c = {
82
+ var l = {
83
83
  parentSize: 0,
84
84
  viewportWidth: 1920,
85
85
  viewportHeight: 1080,
86
86
  rootFontSize: 16,
87
87
  parentFontSize: 16
88
- }, l = {
88
+ }, u = {
89
89
  px: 1,
90
90
  in: 96,
91
91
  cm: 37.8,
92
92
  mm: 3.78,
93
93
  pt: 1.33,
94
94
  pc: 16
95
- }, u = {
95
+ }, d = {
96
96
  em: (e) => e.parentFontSize,
97
97
  rem: (e) => e.rootFontSize,
98
98
  vh: (e) => e.viewportHeight / 100,
@@ -101,50 +101,50 @@ var c = {
101
101
  vmax: (e) => Math.max(e.viewportWidth, e.viewportHeight) / 100,
102
102
  "%": (e) => e.parentSize / 100
103
103
  };
104
- function d(e, t) {
104
+ function f(e, t) {
105
105
  if (typeof e == "number") return e;
106
106
  if (typeof e != "string") return null;
107
- let n = o(e);
107
+ let n = s(e);
108
108
  if (!n) return null;
109
109
  let { value: r, unit: i } = n;
110
- if (i in l) return r * l[i];
110
+ if (i in u) return r * u[i];
111
111
  if (i === "auto") return null;
112
- let a = u[i];
112
+ let a = d[i];
113
113
  return a ? r * a({
114
- ...c,
114
+ ...l,
115
115
  ...t
116
116
  }) : null;
117
117
  }
118
118
  //#endregion
119
119
  //#region packages/core/src/utils/math.ts
120
- function f(e, t, n) {
120
+ function p(e, t, n) {
121
121
  return Math.min(Math.max(e, t), n);
122
122
  }
123
- function p(e) {
123
+ function m(e) {
124
124
  let { height: t, top: n, bottom: r, base: i } = e, a = (t ?? 0) - (n + r);
125
125
  return Math.max(1, Math.floor(a / i));
126
126
  }
127
127
  //#endregion
128
128
  //#region packages/core/src/utils/normalize.ts
129
- function m(e, t = {}) {
129
+ function h(e, t = {}) {
130
130
  let { base: n = 8, round: r = !0, clamp: i, context: a } = t;
131
131
  if (e === "auto") return n;
132
132
  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;
133
+ if (typeof e == "number" ? o = e : typeof e == "string" && (o = f(e, a) ?? n), o === null && (o = n), n <= 0) return o;
134
134
  let s = r ? Math.round(o / n) * n : o;
135
- return i === void 0 ? s : f(s, i.min ?? -Infinity, i.max ?? Infinity);
135
+ return i === void 0 ? s : p(s, i.min ?? -Infinity, i.max ?? Infinity);
136
136
  }
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)];
137
+ function g(e, t, n) {
138
+ 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
139
  }
140
140
  //#endregion
141
141
  //#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) : {
142
+ function _(e) {
143
+ if ("padding" in e && e.padding != null) return v(e.padding);
144
+ let t = "block" in e && e.block != null ? y(e.block) : {
145
145
  top: 0,
146
146
  bottom: 0
147
- }, n = "inline" in e && e.inline != null ? y(e.inline) : {
147
+ }, n = "inline" in e && e.inline != null ? b(e.inline) : {
148
148
  left: 0,
149
149
  right: 0
150
150
  };
@@ -155,7 +155,7 @@ function g(e) {
155
155
  left: n.left
156
156
  };
157
157
  }
158
- function _(e) {
158
+ function v(e) {
159
159
  if (typeof e == "number") return {
160
160
  top: e,
161
161
  right: e,
@@ -183,7 +183,7 @@ function _(e) {
183
183
  left: 0
184
184
  };
185
185
  }
186
- function v(e) {
186
+ function y(e) {
187
187
  if (typeof e == "number") return {
188
188
  top: e,
189
189
  bottom: e
@@ -203,7 +203,7 @@ function v(e) {
203
203
  bottom: 0
204
204
  };
205
205
  }
206
- function y(e) {
206
+ function b(e) {
207
207
  if (typeof e == "number") return {
208
208
  left: e,
209
209
  right: e
@@ -225,14 +225,17 @@ function y(e) {
225
225
  }
226
226
  //#endregion
227
227
  //#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") {
228
+ function x(e, t, n, r) {
229
+ let i = _({ padding: n }), a = typeof r == "string" ? r : r.mode, o = typeof r == "string" ? "bottom" : r.snapEdge ?? "bottom";
230
+ if (a === "none") return i;
231
+ if (a === "height") {
232
232
  let n = e % t;
233
- n !== 0 && (i.bottom += t - n);
233
+ if (n !== 0) {
234
+ let e = t - n;
235
+ o === "top" ? i.top += e : i.bottom += e;
236
+ }
234
237
  }
235
- if (r === "clamp") {
238
+ if (a === "clamp") {
236
239
  i.top %= t;
237
240
  let n = e % t;
238
241
  n !== 0 && (i.bottom += t - n), i.bottom %= t;
@@ -241,24 +244,24 @@ function b(e, t, n, r) {
241
244
  }
242
245
  //#endregion
243
246
  //#region packages/core/src/utils/merge.ts
244
- function x(e, t, n) {
247
+ function S(e, t, n) {
245
248
  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
249
  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
250
  }
248
251
  //#endregion
249
252
  //#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 = {
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 = {
251
254
  template: "none",
252
255
  columnsCount: 0,
253
256
  calculatedGap: 0,
254
257
  isValid: !1
255
258
  };
256
259
  function ne(e, t, n) {
257
- let r = t.variant ?? "line", i = t.base ?? 8, a = m(t.gap ?? 0, {
260
+ let r = t.variant ?? "line", i = t.base ?? 8, a = h(t.gap ?? 0, {
258
261
  base: i,
259
262
  context: n
260
263
  });
261
- if (!e) return C;
264
+ if (!e) return w;
262
265
  switch (r) {
263
266
  case "line": {
264
267
  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 +273,9 @@ function ne(e, t, n) {
270
273
  };
271
274
  }
272
275
  case "pattern": {
273
- if (!t.columns || !Array.isArray(t.columns) || !te(t.columns)) return C;
276
+ if (!t.columns || !Array.isArray(t.columns) || !te(t.columns)) return w;
274
277
  let e = t.columns.map((e) => typeof e == "number" ? `${e}px` : e);
275
- return e.some((e) => e === "0" || e === "0px") ? C : {
278
+ return e.some((e) => e === "0" || e === "0px") ? w : {
276
279
  template: e.join(" "),
277
280
  columnsCount: e.length,
278
281
  calculatedGap: a,
@@ -281,8 +284,8 @@ function ne(e, t, n) {
281
284
  }
282
285
  case "fixed": {
283
286
  let e = typeof t.columns == "number" ? t.columns : 0;
284
- return e < 1 ? C : {
285
- template: `repeat(${e}, ${t.columnWidth ? s(t.columnWidth) : "1fr"})`,
287
+ return e < 1 ? w : {
288
+ template: `repeat(${e}, ${t.columnWidth ? c(t.columnWidth) : "1fr"})`,
286
289
  columnsCount: e,
287
290
  calculatedGap: a,
288
291
  isValid: !0
@@ -296,7 +299,7 @@ function ne(e, t, n) {
296
299
  calculatedGap: a,
297
300
  isValid: !0
298
301
  };
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;
302
+ 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
303
  return {
301
304
  template: `repeat(auto-fill, ${i})`,
302
305
  columnsCount: s,
@@ -315,13 +318,13 @@ function ne(e, t, n) {
315
318
  }
316
319
  }
317
320
  }
318
- var w = (e, t, n) => {
321
+ var T = (e, t, n) => {
319
322
  let r = {};
320
323
  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
324
  };
322
325
  //#endregion
323
326
  //#region packages/core/src/descriptors/guide.ts
324
- function T({ variant: e, base: t, gap: n, columns: r, columnWidth: i }) {
327
+ function E({ variant: e, base: t, gap: n, columns: r, columnWidth: i }) {
325
328
  switch (e) {
326
329
  case "line": return {
327
330
  variant: "line",
@@ -354,7 +357,7 @@ function T({ variant: e, base: t, gap: n, columns: r, columnWidth: i }) {
354
357
  base: t
355
358
  };
356
359
  }
357
- var E = (e, t) => ({
360
+ var D = (e, t) => ({
358
361
  "--bkgd-w": "100%",
359
362
  "--bkgd-h": "100%",
360
363
  "--bkgd-mw": "none",
@@ -365,45 +368,45 @@ var E = (e, t) => ({
365
368
  "--bkgd-cl": t,
366
369
  "--bkgd-g": "0"
367
370
  });
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 = {
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 = {
370
373
  "--bkgd-cl": u ?? n.line,
371
374
  "--bkgd-cp": u ?? n.pattern,
372
375
  "--bkgd-ca": u ?? n.auto,
373
376
  "--bkgd-cf": u ?? n.fixed,
374
- "--bkgd-w": s(a ?? "100%"),
375
- "--bkgd-h": s(o ?? "100%"),
376
- ...x({
377
+ "--bkgd-w": c(a ?? "100%"),
378
+ "--bkgd-h": c(o ?? "100%"),
379
+ ...S({
377
380
  key: "--bkgd-mw",
378
- value: s(l || "none"),
381
+ value: c(l || "none"),
379
382
  defaultStyles: h
380
383
  }),
381
- ...x({
384
+ ...S({
382
385
  key: "--bkgd-cw",
383
- value: s(c || "60px"),
386
+ value: c(s || "60px"),
384
387
  defaultStyles: h
385
388
  }),
386
- ...x({
389
+ ...S({
387
390
  key: "--bkgd-n",
388
391
  value: `${f}`,
389
392
  defaultStyles: h
390
393
  }),
391
- ...x({
394
+ ...S({
392
395
  key: "--bkgd-b",
393
396
  value: "0",
394
397
  defaultStyles: h
395
398
  }),
396
- ...x({
399
+ ...S({
397
400
  key: "--bkgd-cl",
398
401
  value: u ?? n.line,
399
402
  defaultStyles: h
400
403
  }),
401
- ...x({
404
+ ...S({
402
405
  key: "--bkgd-g",
403
406
  value: `${p}px`,
404
407
  defaultStyles: h
405
408
  }),
406
- ...x({
409
+ ...S({
407
410
  key: "--bkgd-j",
408
411
  value: i || "center",
409
412
  defaultStyles: h
@@ -423,22 +426,22 @@ function D(e) {
423
426
  }
424
427
  //#endregion
425
428
  //#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 = [
429
+ function k(e) {
430
+ 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
431
  f,
429
- m,
430
- _,
432
+ p,
433
+ h,
431
434
  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],
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],
434
437
  top: f,
435
- bottom: _,
438
+ bottom: h,
436
439
  base: t
437
440
  });
438
441
  return {
439
442
  containerStyle: {
440
- ...i === void 0 ? {} : { "--bkbl-w": s(i) },
441
- ...a === void 0 ? {} : { "--bkbl-h": s(a) },
443
+ ...i === void 0 ? {} : { "--bkbl-w": c(i) },
444
+ ...a === void 0 ? {} : { "--bkbl-h": c(a) },
442
445
  "--bkbl-cl": o ?? n.line,
443
446
  "--bkbl-cf": o ?? n.flat,
444
447
  "--bkbl-c": r === "line" ? "var(--bkbl-cl)" : "var(--bkbl-cf)",
@@ -456,13 +459,13 @@ function O(e) {
456
459
  }
457
460
  //#endregion
458
461
  //#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) },
462
+ function A(e) {
463
+ let { lineColor: t, width: n, height: r, span: i, colSpan: a, rowSpan: o, isVisible: s } = e, l = {
464
+ ...n === void 0 ? {} : { "--bkbx-w": c(n) },
465
+ ...r === void 0 ? {} : { "--bkbx-h": c(r) },
463
466
  "--bkbx-cl": t
464
- }, u = w(i, a, o), d = ["box"];
465
- return c && d.push("v"), {
467
+ }, u = T(i, a, o), d = ["box"];
468
+ return s && d.push("v"), {
466
469
  boxStyle: l,
467
470
  gridSpanStyle: u,
468
471
  classTokens: d
@@ -470,19 +473,19 @@ function k(e) {
470
473
  }
471
474
  //#endregion
472
475
  //#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], {
476
+ function j(e) {
477
+ let { base: t, colors: n, width: r, height: i, color: a, variant: o, isVisible: s } = e, [l, u] = g([r, i], [0, 0], {
475
478
  base: t,
476
479
  suppressWarnings: !0
477
480
  }), d = {
478
- ...i === void 0 ? {} : { "--bksp-h": s(u) },
479
- ...r === void 0 ? {} : { "--bksp-w": s(l) },
481
+ ...i === void 0 ? {} : { "--bksp-h": c(u) },
482
+ ...r === void 0 ? {} : { "--bksp-w": c(l) },
480
483
  "--bksp-b": `${t}px`,
481
484
  "--bksp-ct": a ?? n.text,
482
485
  "--bksp-cl": a ?? n.line,
483
486
  "--bksp-cf": a ?? n.flat
484
487
  }, f = ["spr"];
485
- return c && f.push(o), {
488
+ return s && f.push(o), {
486
489
  style: d,
487
490
  normWidth: l,
488
491
  normHeight: u,
@@ -491,14 +494,14 @@ function A(e) {
491
494
  }
492
495
  //#endregion
493
496
  //#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) {
497
+ function re(e) {
498
+ let { base: t, color: n, width: r, height: i, padding: a, enableSpacers: o, isVisible: s } = e, l = {};
499
+ 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
500
  let { top: e, right: t, bottom: n, left: r } = a;
498
501
  (e > 0 || n > 0) && (l.paddingBlock = `${e}px ${n}px`), (r > 0 || t > 0) && (l.paddingInline = `${r}px ${t}px`);
499
502
  }
500
503
  let u = ["pad"];
501
- return c && o && u.push("v"), {
504
+ return s && o && u.push("v"), {
502
505
  containerStyle: l,
503
506
  classTokens: u
504
507
  };
@@ -507,8 +510,8 @@ function j(e) {
507
510
  //#region packages/remix/src/Config.ts
508
511
  function M(e) {
509
512
  return () => {
510
- let t = a({
511
- parentConfig: e.props.__baselineConfig ?? e.context.get(N) ?? r,
513
+ let t = o({
514
+ parentConfig: e.props.__baselineConfig ?? e.context.get(N) ?? i,
512
515
  base: e.props.base,
513
516
  baseline: e.props.baseline,
514
517
  guide: e.props.guide,
@@ -531,7 +534,7 @@ var N = M, P = (e) => {
531
534
  };
532
535
  //#endregion
533
536
  //#region packages/dom/src/measure.ts
534
- function re(e, t) {
537
+ function F(e, t) {
535
538
  let n = {
536
539
  width: 0,
537
540
  height: 0
@@ -555,7 +558,7 @@ function re(e, t) {
555
558
  }
556
559
  //#endregion
557
560
  //#region packages/dom/src/virtual.ts
558
- function ie(e, t, n) {
561
+ function I(e, t, n) {
559
562
  let { totalItems: r, itemHeight: i, buffer: a = 0 } = t;
560
563
  if (!Number.isFinite(i) || i <= 0) throw Error("createVirtualTracker requires itemHeight to be greater than 0");
561
564
  if (!Number.isFinite(r) || r < 0) throw Error("createVirtualTracker requires totalItems to be 0 or greater");
@@ -582,11 +585,11 @@ function ie(e, t, n) {
582
585
  };
583
586
  }
584
587
  //#endregion
585
- //#region packages/remix/src/shared.ts
586
- function F(...e) {
588
+ //#region packages/remix/src/shared.tsx
589
+ function L(...e) {
587
590
  return e.filter(Boolean).join(" ");
588
591
  }
589
- function I(...e) {
592
+ function R(...e) {
590
593
  let t = {};
591
594
  for (let n of e) if (n) {
592
595
  if (typeof n == "string") {
@@ -597,10 +600,10 @@ function I(...e) {
597
600
  }
598
601
  return t;
599
602
  }
600
- function L(e, t, n) {
603
+ function z(e, t, n) {
601
604
  return e.context.get(t) ?? n;
602
605
  }
603
- function R(e, t) {
606
+ function B(e, t) {
604
607
  let n = e ?? t;
605
608
  return {
606
609
  isShown: n === "visible",
@@ -608,46 +611,46 @@ function R(e, t) {
608
611
  debugging: n
609
612
  };
610
613
  }
611
- var z = 40, B = /* @__PURE__ */ new WeakSet(), V = [], H = !1;
612
- function U() {
613
- H = !1;
614
- let e = V.splice(0, z);
614
+ var V = 40, H = /* @__PURE__ */ new WeakSet(), U = [], W = !1;
615
+ function G() {
616
+ W = !1;
617
+ let e = U.splice(0, V);
615
618
  for (let t of e) {
616
619
  if (t.signal.aborted) {
617
- B.delete(t);
620
+ H.delete(t);
618
621
  continue;
619
622
  }
620
623
  try {
621
- t.update().catch(() => void 0).finally(() => B.delete(t));
624
+ t.update().catch(() => void 0).finally(() => H.delete(t));
622
625
  } catch {
623
- B.delete(t);
626
+ H.delete(t);
624
627
  }
625
628
  }
626
- V.length > 0 && W();
627
- }
628
- function W() {
629
- H || (H = !0, setTimeout(typeof requestAnimationFrame == "function" ? () => requestAnimationFrame(U) : () => setTimeout(U, 0), 0));
629
+ U.length > 0 && K();
630
630
  }
631
- function G(e) {
632
- e.signal.aborted || B.has(e) || (B.add(e), V.push(e), W());
631
+ function K() {
632
+ W || (W = !0, setTimeout(typeof requestAnimationFrame == "function" ? () => requestAnimationFrame(G) : () => setTimeout(G, 0), 0));
633
633
  }
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
634
+ function q(e) {
635
+ e.signal.aborted || H.has(e) || (H.add(e), U.push(e), K());
636
+ }
637
+ function J(t, r) {
638
+ let a = e(t, r);
639
+ return ((e) => () => {
640
+ let t = e.context.get(N), r = e.props.__baselineConfig ?? t ?? i;
641
+ return /* @__PURE__ */ n(a, {
642
+ ...e.props,
643
+ __baselineConfig: r
641
644
  });
642
645
  });
643
646
  }
644
- function q(e) {
645
- let t = null, r, i = !1, a = 0, o = (e) => {
647
+ function Y(e) {
648
+ let n = null, r, i = !1, a = 0, o = (e) => {
646
649
  e.aborted || i || a >= 10 || (a += 1, r?.refresh(), requestAnimationFrame(() => o(e)));
647
650
  };
648
651
  return {
649
- attach: n((n, s) => {
650
- t = n, typeof ResizeObserver < "u" && (r = re(n, (t) => {
652
+ attach: t((t, s) => {
653
+ n = t, typeof ResizeObserver < "u" && (r = F(t, (t) => {
651
654
  i = t.width > 0 || t.height > 0;
652
655
  let n = () => {
653
656
  s.aborted || e(t);
@@ -656,13 +659,13 @@ function q(e) {
656
659
  }), queueMicrotask(() => {
657
660
  s.aborted || (r?.refresh(), requestAnimationFrame(() => o(s)));
658
661
  })), s.addEventListener("abort", () => {
659
- r?.disconnect(), r = void 0, i = !1, a = 0, t = null;
662
+ r?.disconnect(), r = void 0, i = !1, a = 0, n = null;
660
663
  }, { once: !0 });
661
664
  }),
662
- getElement: () => t
665
+ getElement: () => n
663
666
  };
664
667
  }
665
- function J(e, t, n, r = 160) {
668
+ function ie(e, t, n, r = 160) {
666
669
  let i, a = "", o = 0, s = {
667
670
  start: 0,
668
671
  end: 0
@@ -677,7 +680,7 @@ function J(e, t, n, r = 160) {
677
680
  d !== a && (c(), a = d, o = e, s = {
678
681
  start: 0,
679
682
  end: e
680
- }, n(s), i = ie(u, {
683
+ }, n(s), i = I(u, {
681
684
  totalItems: e,
682
685
  itemHeight: l,
683
686
  buffer: r
@@ -695,185 +698,181 @@ function J(e, t, n, r = 160) {
695
698
  };
696
699
  }
697
700
  //#endregion
698
- //#region packages/remix/src/Baseline.ts
699
- function ae(t) {
700
- let n = {
701
+ //#region packages/remix/src/Baseline.tsx
702
+ function ae(e) {
703
+ let t = {
701
704
  width: 0,
702
705
  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);
706
+ }, r = () => {
707
+ q(e);
708
+ }, a = Y((e) => {
709
+ (e.width !== t.width || e.height !== t.height) && (t = e, r());
710
+ }), o = ie(e, a.getElement, r);
708
711
  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({
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({
710
713
  base: l,
711
- colors: c.baseline.colors,
714
+ colors: s.baseline.colors,
712
715
  variant: u,
713
- width: i.width,
714
- height: i.height,
715
- color: i.color,
716
- containerWidth: n.width,
717
- containerHeight: n.height,
716
+ width: r.width,
717
+ height: r.height,
718
+ color: r.color,
719
+ containerWidth: t.width,
720
+ containerHeight: t.height,
718
721
  spacing: {
719
- padding: i.padding,
720
- block: i.block,
721
- inline: i.inline
722
+ padding: r.padding,
723
+ block: r.block,
724
+ inline: r.inline
722
725
  },
723
726
  isVisible: d.isShown
724
727
  });
725
- if (i.ssrMode) return e("div", {
726
- className: F("bk-bas", "bk-h", "bk-ssr", i.className),
728
+ if (r.ssrMode) return /* @__PURE__ */ n("div", {
729
+ className: L("bk-bas", "bk-h", "bk-ssr", r.className),
727
730
  "data-testid": "baseline",
728
731
  "aria-hidden": !0,
729
- style: I(f.containerStyle, {
730
- width: s(i.width ?? "100%"),
731
- height: s(i.height ?? "100%")
732
- }, i.style)
732
+ style: R(f.containerStyle, {
733
+ width: c(r.width ?? "100%"),
734
+ height: c(r.height ?? "100%")
735
+ }, r.style)
733
736
  });
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", {
737
+ 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;
740
+ return /* @__PURE__ */ n("div", {
738
741
  className: "bk-row",
739
- key: r,
740
742
  "data-row-index": r,
741
743
  style: f.getRowStyle(r)
742
- });
744
+ }, r);
743
745
  }) : [];
744
- return e("div", {
745
- className: F(...f.classTokens.map((e) => `bk-${e}`), i.className),
746
+ return /* @__PURE__ */ n("div", {
747
+ className: L(...f.classTokens.map((e) => `bk-${e}`), r.className),
746
748
  "data-testid": "baseline",
747
749
  "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,
750
+ style: R(f.containerStyle, {
751
+ width: c(r.width ?? "100%"),
752
+ height: c(r.height ?? "100%")
753
+ }, r.style),
754
+ mix: typeof window > "u" || r.ssrMode ? void 0 : a.attach,
753
755
  children: m
754
756
  });
755
757
  };
756
758
  }
757
- var oe = K(`${import.meta.url}#Baseline`, ae);
759
+ var oe = J(`${import.meta.url}#Baseline`, ae);
758
760
  //#endregion
759
- //#region packages/remix/src/Guide.ts
760
- function se(t) {
761
- let n = {
761
+ //#region packages/remix/src/Guide.tsx
762
+ function se(e) {
763
+ let t = {
762
764
  width: 0,
763
765
  height: 0
764
- }, i = () => {
765
- G(t);
766
- }, a = q((e) => {
767
- (e.width !== n.width || e.height !== n.height) && (n = e, i());
766
+ }, a = () => {
767
+ q(e);
768
+ }, o = Y((e) => {
769
+ (e.width !== t.width || e.height !== t.height) && (t = e, a());
768
770
  });
769
771
  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, {
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,
774
+ base: s.base,
775
+ gap: a.gap ?? 0,
776
+ columns: a.columns,
777
+ columnWidth: a.columnWidth
778
+ }), d = ne(t.width, u, {
777
779
  viewportWidth: typeof window > "u" ? void 0 : window.innerWidth,
778
780
  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
781
+ }), f = O({
782
+ base: s.base,
783
+ colors: s.guide.colors,
784
+ variant: c,
785
+ align: a.align ?? "center",
786
+ width: a.width,
787
+ height: a.height,
788
+ columnWidth: a.columnWidth,
789
+ maxWidth: a.maxWidth,
790
+ color: a.color,
791
+ template: d.template,
792
+ columnsCount: d.columnsCount,
793
+ calculatedGap: d.calculatedGap,
794
+ isVisible: l.isShown
793
795
  });
794
- if (i.ssrMode) return e("div", {
795
- className: F("bk-gde", "bk-h", "bk-ssr", i.className),
796
+ if (a.ssrMode) return /* @__PURE__ */ n("div", {
797
+ className: L("bk-gde", "bk-h", "bk-ssr", a.className),
796
798
  "data-testid": "guide",
797
- "data-variant": s,
799
+ "data-variant": c,
798
800
  "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
801
+ style: R({
802
+ width: a.width ?? "100%",
803
+ height: a.height ?? "100%",
804
+ maxWidth: a.maxWidth ?? "none"
805
+ }, a.style),
806
+ children: a.children
805
807
  });
806
- let f = !d.isLineVariant && c.isShown ? Array.from({ length: d.columnsCount }, (t, n) => e("div", {
807
- key: n,
808
+ let p = !f.isLineVariant && l.isShown ? Array.from({ length: f.columnsCount }, (e, t) => /* @__PURE__ */ n("div", {
808
809
  className: "bk-col",
809
- "data-column-index": n,
810
- "data-variant": s
811
- })) : null, p = c.isShown ? e("div", {
810
+ "data-column-index": t,
811
+ "data-variant": c
812
+ }, t)) : null, m = l.isShown ? /* @__PURE__ */ n("div", {
812
813
  className: "bk-cols",
813
- "data-variant": s,
814
- children: f
814
+ "data-variant": c,
815
+ children: p
815
816
  }) : null;
816
- return e("div", {
817
- className: F(...d.classTokens.map((e) => `bk-${e}`), i.className),
817
+ return /* @__PURE__ */ r("div", {
818
+ className: L(...f.classTokens.map((e) => `bk-${e}`), a.className),
818
819
  "data-testid": "guide",
819
- "data-variant": s,
820
+ "data-variant": c,
820
821
  "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]
822
+ style: R(f.containerStyle, a.style),
823
+ mix: typeof window > "u" || a.ssrMode ? void 0 : o.attach,
824
+ children: [m, a.children]
824
825
  });
825
826
  };
826
827
  }
827
- var ce = K(`${import.meta.url}#Guide`, se);
828
+ var ce = J(`${import.meta.url}#Guide`, se);
828
829
  //#endregion
829
- //#region packages/remix/src/Spacer.ts
830
- function le(t) {
830
+ //#region packages/remix/src/Spacer.tsx
831
+ function le(e) {
831
832
  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",
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({
834
+ base: o,
835
+ colors: a.spacer.colors,
836
+ width: t.width,
837
+ height: t.height,
838
+ color: t.color,
839
+ variant: s,
840
+ isVisible: c.isShown
841
+ }), u = c.isShown && t.indicatorNode ? [l.normHeight === 0 ? null : /* @__PURE__ */ n("span", {
842
842
  className: "bk-indicator",
843
843
  "aria-hidden": !0,
844
- children: n.indicatorNode(c.normHeight, "height")
845
- }), c.normWidth === 0 ? null : e("span", {
846
- key: "width",
844
+ children: t.indicatorNode(l.normHeight, "height")
845
+ }, "height"), l.normWidth === 0 ? null : /* @__PURE__ */ n("span", {
847
846
  className: "bk-indicator",
848
847
  "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),
848
+ children: t.indicatorNode(l.normWidth, "width")
849
+ }, "width")] : null;
850
+ return /* @__PURE__ */ r("div", {
851
+ className: L(...l.classTokens.map((e) => `bk-${e}`), t.className),
853
852
  "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]
853
+ "data-variant": s,
854
+ "data-height": `${l.normHeight}px`,
855
+ style: R(l.style, t.style),
856
+ children: [u, t.children]
858
857
  });
859
858
  };
860
859
  }
861
- var Y = K(`${import.meta.url}#Spacer`, le), X = { gridColumn: "1 / -1" }, Z = { gridRow: "2 / 3" }, ue = {
860
+ var X = J(`${import.meta.url}#Spacer`, le), ue = X, Z = { gridColumn: "1 / -1" }, Q = { gridRow: "2 / 3" }, de = {
862
861
  gridRow: "2 / 3",
863
862
  gridColumn: "2 / 3"
864
863
  };
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));
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));
868
867
  });
869
868
  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({
869
+ let s = e.props, c = s.__baselineConfig ?? z(e, N, i), l = B(s.debugging, c.padder.debugging);
870
+ t = c.base, r = _({
872
871
  padding: s.padding,
873
872
  block: s.block,
874
873
  inline: s.inline
875
874
  });
876
- let u = s.ssrMode ? i : a ?? i, d = typeof window > "u" || s.ssrMode ? void 0 : o.attach, f = j({
875
+ let u = s.ssrMode ? r : a ?? r, d = typeof window > "u" || s.ssrMode ? void 0 : o.attach, f = re({
877
876
  base: c.base,
878
877
  color: c.padder.color,
879
878
  width: s.width,
@@ -882,108 +881,104 @@ function Q(t) {
882
881
  enableSpacers: !l.isNone,
883
882
  isVisible: l.isShown
884
883
  });
885
- if (l.isNone) return e("div", {
886
- className: F(...f.classTokens.map((e) => `bk-${e}`), s.className),
884
+ if (l.isNone) return /* @__PURE__ */ n("div", {
885
+ className: L(...f.classTokens.map((e) => `bk-${e}`), s.className),
887
886
  "data-testid": "padder",
888
887
  mix: d,
889
- style: I(f.containerStyle, s.style),
888
+ style: R(f.containerStyle, s.style),
890
889
  children: s.children
891
890
  });
892
- let p = c.spacer.variant, m = (t, n) => e(Y, {
891
+ let p = c.spacer.variant, m = (e, t) => /* @__PURE__ */ n(ue, {
893
892
  __baselineConfig: c,
894
- width: t === "100%" ? void 0 : t,
895
- height: n === "100%" ? void 0 : n,
893
+ width: e === "100%" ? void 0 : e,
894
+ height: t === "100%" ? void 0 : t,
896
895
  variant: p,
897
896
  debugging: l.debugging,
898
897
  indicatorNode: s.indicatorNode
899
898
  }), h = [
900
- u.top >= 0 ? e("div", {
901
- key: "top",
902
- style: X,
903
- children: m("100%", u.top)
904
- }) : null,
905
- u.left >= 0 ? e("div", {
906
- key: "left",
899
+ u.top >= 0 ? /* @__PURE__ */ n("div", {
907
900
  style: Z,
901
+ children: m("100%", u.top)
902
+ }, "top") : null,
903
+ u.left >= 0 ? /* @__PURE__ */ n("div", {
904
+ style: Q,
908
905
  children: m(u.left, "100%")
909
- }) : null,
910
- e("div", {
911
- key: "content",
906
+ }, "left") : null,
907
+ /* @__PURE__ */ n("div", {
912
908
  className: "bk-pad-content",
913
909
  "data-testid": "padder-content",
914
- style: ue,
910
+ style: de,
915
911
  children: s.children
916
- }),
917
- u.right >= 0 ? e("div", {
918
- key: "right",
919
- style: Z,
912
+ }, "content"),
913
+ u.right >= 0 ? /* @__PURE__ */ n("div", {
914
+ style: Q,
920
915
  children: m(u.right, "100%")
921
- }) : null,
922
- u.bottom >= 0 ? e("div", {
923
- key: "bottom",
924
- style: X,
916
+ }, "right") : null,
917
+ u.bottom >= 0 ? /* @__PURE__ */ n("div", {
918
+ style: Z,
925
919
  children: m("100%", u.bottom)
926
- }) : null
920
+ }, "bottom") : null
927
921
  ];
928
- return e("div", {
929
- className: F(...f.classTokens.map((e) => `bk-${e}`), s.className),
922
+ return /* @__PURE__ */ n("div", {
923
+ className: L(...f.classTokens.map((e) => `bk-${e}`), s.className),
930
924
  "data-testid": "padder",
931
925
  mix: d,
932
- style: I(f.containerStyle, s.style),
926
+ style: R(f.containerStyle, s.style),
933
927
  children: h
934
928
  });
935
929
  };
936
930
  }
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());
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, {
937
+ mode: r,
938
+ snapEdge: a
939
+ }), c());
945
940
  });
946
941
  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
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
951
946
  });
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],
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],
965
960
  width: "fit-content",
966
- height: s.height,
967
- debugging: d.debugging,
961
+ height: c.height,
962
+ debugging: p.debugging,
968
963
  ssrMode: !0,
969
- children: s.children
964
+ children: c.children
970
965
  });
971
- return e("div", {
972
- className: F(...m.classTokens.map((e) => `bk-${e}`), s.className),
966
+ return /* @__PURE__ */ n("div", {
967
+ className: L(...g.classTokens.map((e) => `bk-${e}`), c.className),
973
968
  "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,
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,
978
973
  base: 1,
979
974
  spacer: { variant: "flat" },
980
- children: h
975
+ children: v
981
976
  })
982
977
  });
983
978
  };
984
979
  }
985
- var fe = K(`${import.meta.url}#Box`, de);
980
+ var he = J(`${import.meta.url}#Box`, me);
986
981
  //#endregion
987
- export { oe as Baseline, fe as Box, N as Config, ce as Guide, $ as Padder, Y as Spacer };
982
+ export { oe as Baseline, he as Box, N as Config, ce as Guide, $ as Padder, X as Spacer };
988
983
 
989
984
  //# sourceMappingURL=remix.mjs.map