@fiestaboard/ui 2.2.4 → 2.2.5

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.
@@ -1,49 +1,49 @@
1
1
  "use client";
2
2
  import { resolveColorCode as e } from "../../lib/board-colors.js";
3
- import { BOARD_CHARS as t, EXTRA_CHARS as n, getCharFromToken as r, getCharIndex as i, isColorTile as a, messageToGrid as o, tokensEqual as s } from "../../lib/board-characters.js";
4
- import { isNoteArray as c, resolveDimensions as l } from "../../lib/board-dimensions.js";
5
- import { gapClasses as u, paddingClasses as d, radiusClasses as f, sizeClasses as p, textSizeClasses as m } from "../../lib/board-metrics.js";
6
- import { SEAM_CLASS as h, charLeafBoxShadow as g, seamStyle as _ } from "./board-surfaces.js";
7
- import { reducedMotionQuery as v, useReducedMotion as y } from "./reduced-motion.js";
8
- import { memo as b, useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
9
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
3
+ import { BOARD_CHARS as t, EXTRA_CHARS as n, getCharFromToken as r, getCharIndex as i, isColorTile as a, messageToGrid as o, messageToText as s, tokensEqual as c } from "../../lib/board-characters.js";
4
+ import { isNoteArray as l, resolveDimensions as u } from "../../lib/board-dimensions.js";
5
+ import { gapClasses as d, paddingClasses as f, radiusClasses as p, sizeClasses as m, textSizeClasses as h } from "../../lib/board-metrics.js";
6
+ import { SEAM_CLASS as g, charLeafBoxShadow as _, seamStyle as v } from "./board-surfaces.js";
7
+ import { reducedMotionQuery as y, useReducedMotion as b } from "./reduced-motion.js";
8
+ import { memo as x, useCallback as S, useEffect as C, useMemo as w, useRef as T, useState as E } from "react";
9
+ import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
10
10
  //#region src/components/board/board-display.tsx
11
- var k = "\n @keyframes flapDown { from { transform: rotateX(0deg); } to { transform: rotateX(-90deg); } }\n @keyframes flapUp { from { transform: rotateX(90deg); } to { transform: rotateX(0deg); } }\n @keyframes flapShadow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }\n ", A = {
11
+ var A = "\n @keyframes flapDown { from { transform: rotateX(0deg); } to { transform: rotateX(-90deg); } }\n @keyframes flapUp { from { transform: rotateX(90deg); } to { transform: rotateX(0deg); } }\n @keyframes flapShadow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }\n ", j = {
12
12
  white: "\n 0 2px 4px rgba(0,0,0,0.2),\n inset 0 1px 2px rgba(0,0,0,0.1),\n inset 0 -1px 2px rgba(255,255,255,0.5),\n inset 1px 0 1px rgba(0,0,0,0.08),\n inset -1px 0 1px rgba(255,255,255,0.4)\n ",
13
13
  black: "\n 0 2px 4px rgba(0,0,0,0.5),\n inset 0 1px 2px rgba(0,0,0,0.8),\n inset 0 -1px 1px rgba(255,255,255,0.08),\n inset 1px 0 1px rgba(0,0,0,0.5),\n inset -1px 0 1px rgba(255,255,255,0.05)\n "
14
- }, j = {
14
+ }, M = {
15
15
  black: {
16
16
  backgroundColor: "var(--color-board-surface-dark)",
17
- boxShadow: A.black,
17
+ boxShadow: j.black,
18
18
  contain: "layout style paint"
19
19
  },
20
20
  white: {
21
21
  backgroundColor: "var(--color-board-surface-light)",
22
- boxShadow: A.white,
22
+ boxShadow: j.white,
23
23
  contain: "layout style paint"
24
24
  }
25
- }, M = {
25
+ }, N = {
26
26
  black: {
27
- ...j.black,
27
+ ...M.black,
28
28
  perspective: "800px",
29
29
  isolation: "isolate"
30
30
  },
31
31
  white: {
32
- ...j.white,
32
+ ...M.white,
33
33
  perspective: "800px",
34
34
  isolation: "isolate"
35
35
  }
36
- }, N = "\n 0 2px 4px rgba(0,0,0,0.3),\n inset 0 1px 1px rgba(255,255,255,0.15),\n inset 0 -1px 1px rgba(0,0,0,0.25),\n inset 1px 0 1px rgba(255,255,255,0.1),\n inset -1px 0 1px rgba(0,0,0,0.2)\n ", P = {
36
+ }, P = "\n 0 2px 4px rgba(0,0,0,0.3),\n inset 0 1px 1px rgba(255,255,255,0.15),\n inset 0 -1px 1px rgba(0,0,0,0.25),\n inset 1px 0 1px rgba(255,255,255,0.1),\n inset -1px 0 1px rgba(0,0,0,0.2)\n ", F = {
37
37
  hardware: 16,
38
38
  quick: 48,
39
39
  standard: 80,
40
40
  relaxed: 130
41
- }, F = 8, I = 2e3;
42
- function L(e) {
43
- let t = typeof e == "string" ? P[e] : e.durationMs;
44
- return Number.isFinite(t) ? Math.min(I, Math.max(F, Math.round(t))) : P.standard;
45
- }
41
+ }, I = 8, L = 2e3;
46
42
  function R(e) {
43
+ let t = typeof e == "string" ? F[e] : e.durationMs;
44
+ return Number.isFinite(t) ? Math.min(L, Math.max(I, Math.round(t))) : F.standard;
45
+ }
46
+ function z(e) {
47
47
  let t = Math.round(e / 2);
48
48
  return {
49
49
  stepMs: e,
@@ -95,14 +95,14 @@ var ee = {
95
95
  background: "linear-gradient(to bottom, rgba(0,0,0,0.15), transparent)",
96
96
  pointerEvents: "none"
97
97
  }
98
- }, z = {
98
+ }, B = {
99
99
  white: "linear-gradient(to bottom, rgba(0,0,0,0.06), transparent)",
100
100
  black: "linear-gradient(to bottom, rgba(0,0,0,0.3), transparent)"
101
- }, B = /* @__PURE__ */ new Map();
101
+ }, V = /* @__PURE__ */ new Map();
102
102
  function ie(e) {
103
- let t = B.get(e);
103
+ let t = V.get(e);
104
104
  if (t) return t;
105
- let n = R(e), r = {
105
+ let n = z(e), r = {
106
106
  topFlap: {
107
107
  position: "absolute",
108
108
  top: 0,
@@ -137,7 +137,7 @@ function ie(e) {
137
137
  left: 0,
138
138
  right: 0,
139
139
  height: "50%",
140
- background: z.white,
140
+ background: B.white,
141
141
  zIndex: 4,
142
142
  pointerEvents: "none",
143
143
  opacity: 0,
@@ -149,7 +149,7 @@ function ie(e) {
149
149
  left: 0,
150
150
  right: 0,
151
151
  height: "50%",
152
- background: z.black,
152
+ background: B.black,
153
153
  zIndex: 4,
154
154
  pointerEvents: "none",
155
155
  opacity: 0,
@@ -157,53 +157,53 @@ function ie(e) {
157
157
  }
158
158
  }
159
159
  };
160
- return B.set(e, r), r;
160
+ return V.set(e, r), r;
161
161
  }
162
- var V = {
162
+ var H = {
163
163
  white: "\n 0 8px 32px rgba(0,0,0,0.12),\n 0 4px 16px rgba(0,0,0,0.08),\n inset 0 1px 2px rgba(255,255,255,0.9),\n inset 0 0 0 1px rgba(255,255,255,0.5)\n ",
164
164
  black: "\n 0 8px 32px rgba(0,0,0,0.6),\n 0 4px 16px rgba(0,0,0,0.4),\n inset 0 1px 1px rgba(255,255,255,0.08),\n inset 0 0 0 1px rgba(255,255,255,0.03)\n "
165
- }, H = b(function({ token: r, size: a, boardType: o }) {
166
- let s = o === "white", c = s ? "var(--color-board-surface-light)" : "var(--color-board-surface-dark)", l = s ? "var(--color-board-text-on-light)" : "var(--color-board-text-on-dark)", u = p[a], d = m[a], v = f[a], y = /* @__PURE__ */ D("div", {
167
- className: h,
168
- style: _[o]
165
+ }, U = x(function({ token: r, size: a, boardType: o }) {
166
+ let s = o === "white", c = s ? "var(--color-board-surface-light)" : "var(--color-board-surface-dark)", l = s ? "var(--color-board-text-on-light)" : "var(--color-board-text-on-dark)", u = m[a], d = h[a], f = p[a], y = /* @__PURE__ */ O("div", {
167
+ className: g,
168
+ style: v[o]
169
169
  });
170
170
  if (r.type === "color") {
171
171
  let t = e(r.code, s), n = a === "sm" ? "3px 1px 4px" : a === "md" ? "4px 2px 5px" : "5px 2px 6px";
172
- return /* @__PURE__ */ O("div", {
173
- className: `${u} relative ${v} overflow-hidden`,
172
+ return /* @__PURE__ */ k("div", {
173
+ className: `${u} relative ${f} overflow-hidden`,
174
174
  style: { backgroundColor: c },
175
- children: [/* @__PURE__ */ D("div", {
176
- className: `absolute ${v}`,
175
+ children: [/* @__PURE__ */ O("div", {
176
+ className: `absolute ${f}`,
177
177
  style: {
178
178
  inset: n,
179
179
  backgroundColor: t,
180
- boxShadow: N
180
+ boxShadow: P
181
181
  }
182
182
  }), y]
183
183
  });
184
184
  }
185
185
  let b = n[r.value] ? r.value : t[i(r.value)], x = b === " ";
186
- return /* @__PURE__ */ O("div", {
187
- className: `${u} relative ${v} overflow-hidden flex items-center justify-center`,
186
+ return /* @__PURE__ */ k("div", {
187
+ className: `${u} relative ${f} overflow-hidden flex items-center justify-center`,
188
188
  style: {
189
189
  backgroundColor: c,
190
- boxShadow: g[o]
190
+ boxShadow: _[o]
191
191
  },
192
- children: [!x && /* @__PURE__ */ D("span", {
192
+ children: [!x && /* @__PURE__ */ O("span", {
193
193
  className: `${d} font-mono font-semibold select-none leading-none`,
194
194
  style: { color: r.value === "♥" ? "#eb4034" : l },
195
195
  children: b
196
196
  }), y]
197
197
  });
198
- }), U = b(function({ row: e, rowIdx: t, size: n, gapClass: i, boardType: a, showSeams: o = !1, isRowSeam: s = !1, seamGap: c = "6px", emitCellMetadata: l = !1 }) {
199
- return /* @__PURE__ */ D("div", {
198
+ }), W = x(function({ row: e, rowIdx: t, size: n, gapClass: i, boardType: a, showSeams: o = !1, isRowSeam: s = !1, seamGap: c = "6px", emitCellMetadata: l = !1 }) {
199
+ return /* @__PURE__ */ O("div", {
200
200
  "data-note-row": "",
201
201
  ...s ? { "data-note-row-seam": "true" } : {},
202
202
  className: `flex ${i} justify-center`,
203
203
  style: s ? { marginTop: c } : void 0,
204
204
  children: e.map((e, i) => {
205
205
  let s = o && i > 0 && i % 15 == 0;
206
- return /* @__PURE__ */ D("div", {
206
+ return /* @__PURE__ */ O("div", {
207
207
  "data-note-tile": "",
208
208
  ...l ? {
209
209
  "data-row": t,
@@ -212,7 +212,7 @@ var V = {
212
212
  } : {},
213
213
  ...s ? { "data-note-col-seam": "true" } : {},
214
214
  style: s ? { marginLeft: c } : void 0,
215
- children: /* @__PURE__ */ D(H, {
215
+ children: /* @__PURE__ */ O(U, {
216
216
  token: e,
217
217
  size: n,
218
218
  boardType: a
@@ -220,15 +220,15 @@ var V = {
220
220
  }, `col-${t}-${i}`);
221
221
  })
222
222
  });
223
- }), W = b(function({ row: e, rowIdx: t, size: n, gapClass: r, boardType: i = "black", isAnimating: a = !1, animationsEnabled: o = !0, flapStepMs: s, showSeams: c = !1, isRowSeam: l = !1, seamGap: u = "6px", emitCellMetadata: d = !1 }) {
224
- return /* @__PURE__ */ D("div", {
223
+ }), G = x(function({ row: e, rowIdx: t, size: n, gapClass: r, boardType: i = "black", isAnimating: a = !1, animationsEnabled: o = !0, flapStepMs: s, showSeams: c = !1, isRowSeam: l = !1, seamGap: u = "6px", emitCellMetadata: d = !1 }) {
224
+ return /* @__PURE__ */ O("div", {
225
225
  "data-note-row": "",
226
226
  ...l ? { "data-note-row-seam": "true" } : {},
227
227
  className: `flex ${r} justify-center`,
228
228
  style: l ? { marginTop: u } : void 0,
229
229
  children: e.map((e, r) => {
230
230
  let l = c && r > 0 && r % 15 == 0;
231
- return /* @__PURE__ */ D("div", {
231
+ return /* @__PURE__ */ O("div", {
232
232
  "data-note-tile": "",
233
233
  ...d ? {
234
234
  "data-row": t,
@@ -236,7 +236,7 @@ var V = {
236
236
  } : {},
237
237
  ...l ? { "data-note-col-seam": "true" } : {},
238
238
  style: l ? { marginLeft: u } : void 0,
239
- children: /* @__PURE__ */ D(J, {
239
+ children: /* @__PURE__ */ O(Y, {
240
240
  token: e,
241
241
  size: n,
242
242
  boardType: i,
@@ -251,43 +251,43 @@ var V = {
251
251
  });
252
252
  }, (e, t) => {
253
253
  if (e.row.length !== t.row.length || e.size !== t.size || e.gapClass !== t.gapClass || e.boardType !== t.boardType || e.isAnimating !== t.isAnimating || e.animationsEnabled !== t.animationsEnabled || e.flapStepMs !== t.flapStepMs || e.showSeams !== t.showSeams || e.isRowSeam !== t.isRowSeam || e.seamGap !== t.seamGap || e.emitCellMetadata !== t.emitCellMetadata) return !1;
254
- for (let n = 0; n < e.row.length; n++) if (!s(e.row[n], t.row[n])) return !1;
254
+ for (let n = 0; n < e.row.length; n++) if (!c(e.row[n], t.row[n])) return !1;
255
255
  return !0;
256
- }), G = /* @__PURE__ */ new Map();
257
- function K(e, t) {
256
+ }), K = /* @__PURE__ */ new Map();
257
+ function q(e, t) {
258
258
  t.intervalId === null && (t.intervalId = setInterval(() => {
259
259
  for (let e of [...t.subscribers]) e();
260
260
  }, e));
261
261
  }
262
- function q(e) {
262
+ function J(e) {
263
263
  e.intervalId !== null && (clearInterval(e.intervalId), e.intervalId = null);
264
264
  }
265
- v?.addEventListener("change", (e) => {
266
- for (let [t, n] of G) e.matches ? q(n) : n.subscribers.size > 0 && K(t, n);
265
+ y?.addEventListener("change", (e) => {
266
+ for (let [t, n] of K) e.matches ? J(n) : n.subscribers.size > 0 && q(t, n);
267
267
  });
268
268
  function ae(e, t) {
269
- let n = G.get(e);
269
+ let n = K.get(e);
270
270
  n || (n = {
271
271
  subscribers: /* @__PURE__ */ new Set(),
272
272
  intervalId: null
273
- }, G.set(e, n));
273
+ }, K.set(e, n));
274
274
  let r = n;
275
- return r.subscribers.add(t), v?.matches || K(e, r), () => {
276
- r.subscribers.delete(t), r.subscribers.size === 0 && (q(r), G.delete(e));
275
+ return r.subscribers.add(t), y?.matches || q(e, r), () => {
276
+ r.subscribers.delete(t), r.subscribers.size === 0 && (J(r), K.delete(e));
277
277
  };
278
278
  }
279
- var J = b(function({ token: o, size: s = "md", boardType: c = "black", isAnimating: l = !1, animationsEnabled: u = !0, flapStepMs: d, rowIdx: h = 0, colIdx: v = 0 }) {
280
- let y = u && l, b = c === "white", C = b ? "var(--color-board-surface-light)" : "var(--color-board-surface-dark)", k = b ? "var(--color-board-text-on-light)" : "var(--color-board-text-on-dark)", A = r(o), P = i(A), F = d, I = ie(F), [L, R] = T(() => P), [z, B] = T(!1), V = w(L), H = w(!1), U = w(P), W = w(y), G = w(!1), K = w(P);
281
- S(() => {
282
- K.current = P;
283
- }, [P]);
284
- let q = x((e) => {
279
+ var Y = x(function({ token: o, size: s = "md", boardType: c = "black", isAnimating: l = !1, animationsEnabled: u = !0, flapStepMs: d, rowIdx: f = 0, colIdx: g = 0 }) {
280
+ let y = u && l, b = c === "white", x = b ? "var(--color-board-surface-light)" : "var(--color-board-surface-dark)", w = b ? "var(--color-board-text-on-light)" : "var(--color-board-text-on-dark)", A = r(o), j = i(A), F = d, I = ie(F), [L, R] = E(() => j), [z, B] = E(!1), V = T(L), H = T(!1), U = T(j), W = T(y), G = T(!1), K = T(j);
281
+ C(() => {
282
+ K.current = j;
283
+ }, [j]);
284
+ let q = S((e) => {
285
285
  V.current = e, R(e);
286
- }, []), J = x((e) => {
286
+ }, []), J = S((e) => {
287
287
  H.current = e, B(e);
288
- }, []), Y = w(null), X = w(0), Z = x(() => {
288
+ }, []), Y = T(null), X = T(0), Z = S(() => {
289
289
  Y.current !== null && (clearInterval(Y.current), Y.current = null);
290
- }, []), Q = x(() => {
290
+ }, []), Q = S(() => {
291
291
  let e = U.current, n = V.current, r = () => {
292
292
  Z(), J(!1), G.current = !1;
293
293
  };
@@ -301,10 +301,10 @@ var J = b(function({ token: o, size: s = "md", boardType: c = "black", isAnimati
301
301
  q,
302
302
  J,
303
303
  Z
304
- ]), $ = x((e) => {
304
+ ]), $ = S((e) => {
305
305
  (Y.current === null || X.current !== e) && (Z(), X.current = e, Y.current = setInterval(Q, e));
306
306
  }, [Q, Z]);
307
- S(() => Z, [Z]), S(() => {
307
+ C(() => Z, [Z]), C(() => {
308
308
  let e = W.current;
309
309
  W.current = y;
310
310
  let n = K.current;
@@ -341,27 +341,27 @@ var J = b(function({ token: o, size: s = "md", boardType: c = "black", isAnimati
341
341
  $,
342
342
  Q,
343
343
  Z
344
- ]), S(() => {
344
+ ]), C(() => {
345
345
  if (!u) {
346
- U.current = P, Z(), J(!1), q(P);
346
+ U.current = j, Z(), J(!1), q(j);
347
347
  return;
348
348
  }
349
349
  if (y || G.current) {
350
- U.current = P;
350
+ U.current = j;
351
351
  return;
352
352
  }
353
353
  if (H.current) {
354
- U.current = P, $(F);
354
+ U.current = j, $(F);
355
355
  return;
356
356
  }
357
357
  let e = U.current;
358
- if (U.current = P, e === P || V.current === P) {
359
- Z(), J(!1), V.current !== P && q(P);
358
+ if (U.current = j, e === j || V.current === j) {
359
+ Z(), J(!1), V.current !== j && q(j);
360
360
  return;
361
361
  }
362
362
  J(!0), Q(), H.current && $(F);
363
363
  }, [
364
- P,
364
+ j,
365
365
  y,
366
366
  F,
367
367
  u,
@@ -372,23 +372,23 @@ var J = b(function({ token: o, size: s = "md", boardType: c = "black", isAnimati
372
372
  Z
373
373
  ]);
374
374
  let oe = t[L], se = (L - 1 + t.length) % t.length, ce = t[se];
375
- return /* @__PURE__ */ D(E, { children: /* @__PURE__ */ O("div", {
376
- className: `relative ${p[s]} ${f[s]} overflow-hidden`,
377
- "data-testid": `char-tile-${h}-${v}`,
375
+ return /* @__PURE__ */ O(D, { children: /* @__PURE__ */ k("div", {
376
+ className: `relative ${m[s]} ${p[s]} overflow-hidden`,
377
+ "data-testid": `char-tile-${f}-${g}`,
378
378
  "data-current-char": oe,
379
379
  "data-target-char": A,
380
380
  "data-is-animating": y,
381
381
  "data-is-transitioning": z,
382
- style: y || z ? M[c] : j[c],
382
+ style: y || z ? N[c] : M[c],
383
383
  children: [
384
384
  !y && !z && (() => {
385
385
  if (o.type === "color") {
386
386
  let t = e(o.code, b);
387
- return /* @__PURE__ */ D("div", {
387
+ return /* @__PURE__ */ O("div", {
388
388
  className: `absolute inset-0 ${s === "sm" ? "[--color-margin-top:3px] [--color-margin-bottom:4px] [--color-margin-h:1px]" : s === "md" ? "[--color-margin-top:3px] sm:[--color-margin-top:4px] md:[--color-margin-top:5px] lg:[--color-margin-top:6px] [--color-margin-bottom:4px] sm:[--color-margin-bottom:6px] md:[--color-margin-bottom:7px] lg:[--color-margin-bottom:8px] [--color-margin-h:1px] sm:[--color-margin-h:2px]" : "[--color-margin-top:4px] sm:[--color-margin-top:5px] md:[--color-margin-top:6px] lg:[--color-margin-top:8px] [--color-margin-bottom:5px] sm:[--color-margin-bottom:7px] md:[--color-margin-bottom:8px] lg:[--color-margin-bottom:10px] [--color-margin-h:2px] md:[--color-margin-h:3px]"} flex items-center justify-center`,
389
389
  style: { zIndex: 2 },
390
- children: /* @__PURE__ */ D("div", {
391
- className: `relative ${f[s]} overflow-hidden`,
390
+ children: /* @__PURE__ */ O("div", {
391
+ className: `relative ${p[s]} overflow-hidden`,
392
392
  style: {
393
393
  marginTop: "var(--color-margin-top)",
394
394
  marginBottom: "var(--color-margin-bottom)",
@@ -397,50 +397,50 @@ var J = b(function({ token: o, size: s = "md", boardType: c = "black", isAnimati
397
397
  width: "calc(100% - (var(--color-margin-h) * 2))",
398
398
  height: "calc(100% - (var(--color-margin-top) + var(--color-margin-bottom)))",
399
399
  backgroundColor: t,
400
- boxShadow: N
400
+ boxShadow: P
401
401
  }
402
402
  })
403
403
  }, `static-color-${o.code}`);
404
404
  }
405
- let i = r(o), l = n[i] ? i : t[P], u = a(l), d = u ? e(l, b) : C, p = l === "♥" ? "#eb4034" : k;
406
- return /* @__PURE__ */ O("div", {
405
+ let i = r(o), l = n[i] ? i : t[j], u = a(l), d = u ? e(l, b) : x, f = l === "♥" ? "#eb4034" : w;
406
+ return /* @__PURE__ */ k("div", {
407
407
  className: "absolute inset-0 flex items-center justify-center overflow-hidden",
408
408
  style: {
409
409
  zIndex: 2,
410
410
  backgroundColor: d,
411
411
  marginLeft: u ? "-4px" : 0,
412
412
  marginRight: u ? "-4px" : 0,
413
- boxShadow: u ? void 0 : g[c]
413
+ boxShadow: u ? void 0 : _[c]
414
414
  },
415
415
  children: [
416
- !u && l !== " " && /* @__PURE__ */ D("span", {
417
- className: `${m[s]} font-mono font-semibold select-none leading-none relative z-10`,
418
- style: { color: p },
416
+ !u && l !== " " && /* @__PURE__ */ O("span", {
417
+ className: `${h[s]} font-mono font-semibold select-none leading-none relative z-10`,
418
+ style: { color: f },
419
419
  children: l
420
420
  }),
421
- !u && l === " " && /* @__PURE__ */ D("span", {
422
- className: `${m[s]} font-mono font-semibold select-none leading-none relative z-10`,
421
+ !u && l === " " && /* @__PURE__ */ O("span", {
422
+ className: `${h[s]} font-mono font-semibold select-none leading-none relative z-10`,
423
423
  style: {
424
- color: k,
424
+ color: w,
425
425
  visibility: "hidden"
426
426
  },
427
427
  "aria-hidden": "true",
428
428
  children: " "
429
429
  }),
430
- u && /* @__PURE__ */ D("div", {
431
- className: `absolute inset-0 ${f[s]}`,
430
+ u && /* @__PURE__ */ O("div", {
431
+ className: `absolute inset-0 ${p[s]}`,
432
432
  style: {
433
433
  backgroundColor: d,
434
- boxShadow: N
434
+ boxShadow: P
435
435
  }
436
436
  })
437
437
  ]
438
- }, `static-char-${P}`);
438
+ }, `static-char-${j}`);
439
439
  })(),
440
440
  (y || z) && (() => {
441
441
  let t = oe, n = (t, n) => {
442
- let r = a(t), i = r ? e(t, b) : C, o = t === "♥";
443
- return /* @__PURE__ */ D("div", {
442
+ let r = a(t), i = r ? e(t, b) : x, o = t === "♥";
443
+ return /* @__PURE__ */ O("div", {
444
444
  style: {
445
445
  position: "absolute",
446
446
  ...n ? { top: 0 } : { bottom: 0 },
@@ -452,41 +452,41 @@ var J = b(function({ token: o, size: s = "md", boardType: c = "black", isAnimati
452
452
  justifyContent: "center",
453
453
  backgroundColor: i
454
454
  },
455
- children: !r && t !== " " && /* @__PURE__ */ D("span", {
456
- className: `${m[s]} font-mono font-semibold select-none leading-none`,
457
- style: { color: o ? "#eb4034" : k },
455
+ children: !r && t !== " " && /* @__PURE__ */ O("span", {
456
+ className: `${h[s]} font-mono font-semibold select-none leading-none`,
457
+ style: { color: o ? "#eb4034" : w },
458
458
  children: t
459
459
  })
460
460
  });
461
461
  };
462
- return /* @__PURE__ */ O(E, { children: [
463
- /* @__PURE__ */ D("div", {
462
+ return /* @__PURE__ */ k(D, { children: [
463
+ /* @__PURE__ */ O("div", {
464
464
  style: ee,
465
465
  children: n(t, !0)
466
466
  }),
467
- /* @__PURE__ */ D("div", {
467
+ /* @__PURE__ */ O("div", {
468
468
  style: te,
469
469
  children: n(ce, !1)
470
470
  }),
471
- /* @__PURE__ */ O("div", {
471
+ /* @__PURE__ */ k("div", {
472
472
  style: I.topFlap,
473
- children: [n(ce, !0), /* @__PURE__ */ D("div", { style: ne })]
473
+ children: [n(ce, !0), /* @__PURE__ */ O("div", { style: ne })]
474
474
  }, `ft-${L}`),
475
- /* @__PURE__ */ O("div", {
475
+ /* @__PURE__ */ k("div", {
476
476
  style: I.bottomFlap,
477
- children: [n(t, !1), /* @__PURE__ */ D("div", { style: re[c] })]
477
+ children: [n(t, !1), /* @__PURE__ */ O("div", { style: re[c] })]
478
478
  }, `fb-${L}`),
479
- /* @__PURE__ */ D("div", { style: I.castShadow[c] }, `fs-${L}`),
480
- /* @__PURE__ */ D("div", {
479
+ /* @__PURE__ */ O("div", { style: I.castShadow[c] }, `fs-${L}`),
480
+ /* @__PURE__ */ O("div", {
481
481
  className: "absolute top-1/2 left-0 right-0 h-[2px] pointer-events-none",
482
- style: _[c]
482
+ style: v[c]
483
483
  })
484
484
  ] });
485
485
  })(),
486
- !y && !z && L === P && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("div", {
486
+ !y && !z && L === j && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("div", {
487
487
  className: "absolute top-1/2 left-0 right-0 h-[2px] pointer-events-none",
488
- style: _[c]
489
- }), /* @__PURE__ */ D("div", {
488
+ style: v[c]
489
+ }), /* @__PURE__ */ O("div", {
490
490
  className: "absolute inset-0 pointer-events-none",
491
491
  style: {
492
492
  zIndex: 1,
@@ -495,76 +495,82 @@ var J = b(function({ token: o, size: s = "md", boardType: c = "black", isAnimati
495
495
  })] })
496
496
  ]
497
497
  }) });
498
- }, (e, t) => s(e.token, t.token) && e.size === t.size && e.boardType === t.boardType && e.isAnimating === t.isAnimating && e.animationsEnabled === t.animationsEnabled && e.flapStepMs === t.flapStepMs), Y = (e) => `Board display: ${e}`, X = b(function({ message: e, isLoading: t = !1, size: n = "md", className: r = "", boardType: i = "black", deviceType: a = "flagship", isStatic: s = !1, notesWide: f = 1, notesTall: p = 1, emitCellMetadata: m = !1, animationsEnabled: h = !0, flapSpeed: g = "standard", loadingLabel: _ = "Loading board display", emptyLabel: v = "Empty board display", messageLabel: b = Y }) {
499
- let x = y(), S = h && !x, w = L(g), T = l(a, f, p), E = c(a), A = n === "sm" ? "6px" : n === "md" ? "8px" : "10px", j = C(() => o(e ?? "", T.rows, T.cols, a), [
498
+ }, (e, t) => c(e.token, t.token) && e.size === t.size && e.boardType === t.boardType && e.isAnimating === t.isAnimating && e.animationsEnabled === t.animationsEnabled && e.flapStepMs === t.flapStepMs), X = (e) => `Board display: ${e}`, Z = "Board display", Q = x(function({ message: e, isLoading: t = !1, size: n = "md", className: r = "", boardType: i = "black", deviceType: a = "flagship", isStatic: c = !1, notesWide: p = 1, notesTall: m = 1, emitCellMetadata: h = !1, animationsEnabled: g = !0, flapSpeed: _ = "standard", loadingLabel: v = "Loading board display", emptyLabel: y = "Empty board display", messageLabel: x = X }) {
499
+ let S = b(), C = g && !S, T = R(_), E = u(a, p, m), D = l(a), j = n === "sm" ? "6px" : n === "md" ? "8px" : "10px", M = w(() => o(e ?? "", E.rows, E.cols, a), [
500
500
  e,
501
- T.rows,
502
- T.cols,
501
+ E.rows,
502
+ E.cols,
503
503
  a
504
- ]), M = i === "white", N = M ? "var(--color-board-bezel-light)" : "var(--color-board-bezel-dark)", P = M ? "var(--color-board-bezel-border-light)" : "var(--color-board-bezel-border-dark)", F = V[i], I = n === "sm" ? "rounded-lg border-[3px]" : "rounded-lg sm:rounded-xl border-[3px] sm:border-[4px] lg:border-[5px]", R = C(() => t ? _ : e ? b(e.replace(/\{[^}]*\}/g, "").replace(/\n/g, " ").trim()) : v, [
504
+ ]), N = i === "white", P = N ? "var(--color-board-bezel-light)" : "var(--color-board-bezel-dark)", F = N ? "var(--color-board-bezel-border-light)" : "var(--color-board-bezel-border-dark)", I = H[i], L = n === "sm" ? "rounded-lg border-[3px]" : "rounded-lg sm:rounded-xl border-[3px] sm:border-[4px] lg:border-[5px]", z = w(() => {
505
+ if (t) return v;
506
+ if (!e) return y;
507
+ let n = s(e, a);
508
+ return n ? x(n) : Z;
509
+ }, [
505
510
  e,
511
+ a,
506
512
  t,
507
- _,
508
513
  v,
509
- b
514
+ y,
515
+ x
510
516
  ]);
511
- return /* @__PURE__ */ O("div", {
517
+ return /* @__PURE__ */ k("div", {
512
518
  className: "w-full flex justify-center",
513
- children: [!s && /* @__PURE__ */ D("style", {
519
+ children: [!c && /* @__PURE__ */ O("style", {
514
520
  href: "board-flap-keyframes",
515
521
  precedence: "default",
516
- children: k
517
- }), /* @__PURE__ */ D("div", {
522
+ children: A
523
+ }), /* @__PURE__ */ O("div", {
518
524
  role: "img",
519
- "aria-label": R,
525
+ "aria-label": z,
520
526
  "data-slot": "board-display",
521
527
  "data-board-preview": "",
522
- className: `${I} ${r}`,
528
+ className: `${L} ${r}`,
523
529
  style: {
524
- backgroundColor: N,
525
- borderColor: P,
526
- boxShadow: F,
530
+ backgroundColor: P,
531
+ borderColor: F,
532
+ boxShadow: I,
527
533
  width: "fit-content"
528
534
  },
529
- children: /* @__PURE__ */ D("div", {
530
- className: `${d[n]} relative`,
535
+ children: /* @__PURE__ */ O("div", {
536
+ className: `${f[n]} relative`,
531
537
  "aria-hidden": "true",
532
- style: { background: M ? "linear-gradient(135deg, var(--color-board-surface-light) 0%, var(--color-board-bezel-border-light) 100%)" : "linear-gradient(135deg, var(--color-board-surface-dark) 0%, var(--color-board-black) 100%)" },
533
- children: /* @__PURE__ */ D("div", {
534
- className: `flex flex-col ${u[n]}`,
535
- children: j.map((e, r) => {
536
- let a = E && r > 0 && r % 3 == 0;
537
- return s ? /* @__PURE__ */ D(U, {
538
+ style: { background: N ? "linear-gradient(135deg, var(--color-board-surface-light) 0%, var(--color-board-bezel-border-light) 100%)" : "linear-gradient(135deg, var(--color-board-surface-dark) 0%, var(--color-board-black) 100%)" },
539
+ children: /* @__PURE__ */ O("div", {
540
+ className: `flex flex-col ${d[n]}`,
541
+ children: M.map((e, r) => {
542
+ let a = D && r > 0 && r % 3 == 0;
543
+ return c ? /* @__PURE__ */ O(W, {
538
544
  row: e,
539
545
  rowIdx: r,
540
546
  size: n,
541
- gapClass: u[n],
547
+ gapClass: d[n],
542
548
  boardType: i,
543
- showSeams: E,
549
+ showSeams: D,
544
550
  isRowSeam: a,
545
- seamGap: A,
546
- emitCellMetadata: m
547
- }, `row-${r}`) : /* @__PURE__ */ D(W, {
551
+ seamGap: j,
552
+ emitCellMetadata: h
553
+ }, `row-${r}`) : /* @__PURE__ */ O(G, {
548
554
  row: e,
549
555
  rowIdx: r,
550
556
  size: n,
551
- gapClass: u[n],
557
+ gapClass: d[n],
552
558
  boardType: i,
553
559
  isAnimating: t,
554
- animationsEnabled: S,
555
- flapStepMs: w,
556
- showSeams: E,
560
+ animationsEnabled: C,
561
+ flapStepMs: T,
562
+ showSeams: D,
557
563
  isRowSeam: a,
558
- seamGap: A,
559
- emitCellMetadata: m
564
+ seamGap: j,
565
+ emitCellMetadata: h
560
566
  }, `row-${r}`);
561
567
  })
562
568
  })
563
569
  })
564
570
  })]
565
571
  });
566
- }, (e, t) => e.message === t.message && e.isLoading === t.isLoading && e.size === t.size && e.className === t.className && e.boardType === t.boardType && e.deviceType === t.deviceType && e.notesWide === t.notesWide && e.notesTall === t.notesTall && e.isStatic === t.isStatic && e.emitCellMetadata === t.emitCellMetadata && e.animationsEnabled === t.animationsEnabled && L(e.flapSpeed ?? "standard") === L(t.flapSpeed ?? "standard") && e.loadingLabel === t.loadingLabel && e.emptyLabel === t.emptyLabel && e.messageLabel === t.messageLabel);
572
+ }, (e, t) => e.message === t.message && e.isLoading === t.isLoading && e.size === t.size && e.className === t.className && e.boardType === t.boardType && e.deviceType === t.deviceType && e.notesWide === t.notesWide && e.notesTall === t.notesTall && e.isStatic === t.isStatic && e.emitCellMetadata === t.emitCellMetadata && e.animationsEnabled === t.animationsEnabled && R(e.flapSpeed ?? "standard") === R(t.flapSpeed ?? "standard") && e.loadingLabel === t.loadingLabel && e.emptyLabel === t.emptyLabel && e.messageLabel === t.messageLabel);
567
573
  //#endregion
568
- export { X as BoardDisplay, P as FLAP_SPEED_PRESETS, R as deriveFlapTiming, L as resolveFlapSpeed };
574
+ export { Q as BoardDisplay, F as FLAP_SPEED_PRESETS, z as deriveFlapTiming, R as resolveFlapSpeed };
569
575
 
570
576
  //# sourceMappingURL=board-display.js.map