@fiestaboard/ui 5.8.0 → 5.10.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.
Files changed (50) hide show
  1. package/README.md +2 -2
  2. package/dist/components/chrome/pagination.d.ts +75 -0
  3. package/dist/components/chrome/pagination.js +93 -0
  4. package/dist/components/chrome/pagination.js.map +1 -0
  5. package/dist/components/chrome/top-nav.d.ts +102 -0
  6. package/dist/components/chrome/top-nav.js +91 -0
  7. package/dist/components/chrome/top-nav.js.map +1 -0
  8. package/dist/components/containment/action-card.d.ts +95 -0
  9. package/dist/components/containment/action-card.js +91 -0
  10. package/dist/components/containment/action-card.js.map +1 -0
  11. package/dist/components/containment/card.d.ts +24 -1
  12. package/dist/components/containment/card.js +11 -10
  13. package/dist/components/containment/card.js.map +1 -1
  14. package/dist/components/containment/icon-tile.d.ts +1 -1
  15. package/dist/components/editor/color-picker-content.js +17 -17
  16. package/dist/components/editor/filter-picker-content.js +20 -20
  17. package/dist/components/editor/formatting-picker-content.js +20 -20
  18. package/dist/components/editor/formula/formula-editor-panel.js +184 -184
  19. package/dist/components/editor/formula/formula-editor-panel.js.map +1 -1
  20. package/dist/components/editor/node-views/color-tile-node-view.js +5 -5
  21. package/dist/components/editor/node-views/formula-node-view.js +9 -9
  22. package/dist/components/editor/template-editor-toolbar.js +44 -44
  23. package/dist/components/editor/template-editor.js +23 -23
  24. package/dist/components/editor/toolbar-dropdown.js +6 -6
  25. package/dist/components/editor/variable-picker-content.js +79 -79
  26. package/dist/components/feedback/alert.d.ts +1 -1
  27. package/dist/components/feedback/badge.d.ts +1 -1
  28. package/dist/components/feedback/badge.js +6 -6
  29. package/dist/components/feedback/chip.js +6 -6
  30. package/dist/components/feedback/spinner.d.ts +1 -1
  31. package/dist/components/feedback/status-dot.d.ts +1 -1
  32. package/dist/components/forms/button.d.ts +2 -2
  33. package/dist/components/forms/button.js +6 -6
  34. package/dist/components/forms/field.d.ts +66 -0
  35. package/dist/components/forms/field.js +64 -0
  36. package/dist/components/forms/field.js.map +1 -0
  37. package/dist/components/forms/swatch.d.ts +4 -4
  38. package/dist/components/forms/time-picker.js +24 -24
  39. package/dist/components/forms/toggle-card.d.ts +2 -2
  40. package/dist/components/forms/toggle.d.ts +1 -1
  41. package/dist/components/plugin/plugin-card.js +5 -5
  42. package/dist/components/typography/heading.d.ts +2 -2
  43. package/dist/components/typography/kbd.d.ts +35 -0
  44. package/dist/components/typography/kbd.js +115 -0
  45. package/dist/components/typography/kbd.js.map +1 -0
  46. package/dist/components/typography/text.d.ts +2 -2
  47. package/dist/index.d.ts +5 -0
  48. package/dist/index.js +113 -108
  49. package/dist/theme.css +54 -9
  50. package/package.json +1 -1
@@ -1,23 +1,23 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../../lib/utils.js";
3
3
  import { Button as t } from "../../forms/button.js";
4
- import { Box as n } from "../../layout/box.js";
5
- import { Flex as r } from "../../layout/flex.js";
6
- import { Tabs as i, TabsContent as a, TabsList as o, TabsTrigger as s } from "../../containment/tabs.js";
7
- import { Skeleton as c } from "../../feedback/skeleton.js";
8
- import { Text as l } from "../../typography/text.js";
4
+ import { Text as n } from "../../typography/text.js";
5
+ import { Box as r } from "../../layout/box.js";
6
+ import { Flex as i } from "../../layout/flex.js";
7
+ import { Tabs as a, TabsContent as o, TabsList as s, TabsTrigger as c } from "../../containment/tabs.js";
8
+ import { Skeleton as l } from "../../feedback/skeleton.js";
9
9
  import { Stack as u } from "../../layout/stack.js";
10
10
  import { Tooltip as ee, TooltipContent as te, TooltipProvider as ne, TooltipTrigger as re } from "../../overlays/tooltip.js";
11
11
  import { ArrowLeftRight as d, CheckCircle2 as ie, ChevronDown as ae, ChevronRight as oe, GitBranch as f, Hash as p, Loader2 as se, Palette as m, Type as h, XCircle as g } from "lucide-react";
12
12
  import { Suspense as ce, useCallback as _, useEffect as v, useId as le, useRef as y, useState as b } from "react";
13
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
14
- import { history as ue, historyKeymap as de, indentWithTab as fe } from "@codemirror/commands";
15
- import { HighlightStyle as w, StreamLanguage as T, syntaxHighlighting as pe } from "@codemirror/language";
16
- import { EditorState as me } from "@codemirror/state";
17
- import { EditorView as E, keymap as he } from "@codemirror/view";
18
- import { tags as D } from "@lezer/highlight";
13
+ import { Fragment as ue, jsx as x, jsxs as S } from "react/jsx-runtime";
14
+ import { history as de, historyKeymap as fe, indentWithTab as pe } from "@codemirror/commands";
15
+ import { HighlightStyle as C, StreamLanguage as w, syntaxHighlighting as me } from "@codemirror/language";
16
+ import { EditorState as he } from "@codemirror/state";
17
+ import { EditorView as T, keymap as ge } from "@codemirror/view";
18
+ import { tags as E } from "@lezer/highlight";
19
19
  //#region src/components/editor/formula/formula-editor-panel.tsx
20
- function O(e) {
20
+ function D(e) {
21
21
  let t = "", n = 0, r = !1, i = !1;
22
22
  for (let a = 0; a < e.length; a++) {
23
23
  let o = e[a];
@@ -33,50 +33,50 @@ function O(e) {
33
33
  }
34
34
  return t.trim();
35
35
  }
36
- function k(e) {
36
+ function O(e) {
37
37
  let t = "", n = !1, r = !1;
38
38
  for (let i of e) n ? (t += i, i === "\"" && (n = !1), r = !1) : i === "\"" ? (n = !0, t += i, r = !1) : i === "\n" ? r = !0 : i === " " && r || (t += i, r = !1);
39
39
  return t.trim();
40
40
  }
41
- var ge = T.define({
41
+ var _e = w.define({
42
42
  token(e) {
43
43
  return e.eatSpace() ? null : e.match(/"[^"]*"/) ? "string" : e.match(/\d+\.?\d*/) ? "number" : e.match(/[a-z_][a-z0-9_]*(?:\.[a-z_][a-z0-9_]*)*/) ? "variable" : e.match(/[A-Z][A-Z0-9_]*/) ? "function" : e.match(/[<>]=?|[!=]=|[+\-*/]/) ? "operator" : e.match(/[(),]/) ? "punctuation" : (e.next(), null);
44
44
  },
45
45
  tokenTable: {
46
- string: D.string,
47
- number: D.number,
48
- variable: D.variableName,
49
- function: D.keyword,
50
- operator: D.operator,
51
- punctuation: D.punctuation
46
+ string: E.string,
47
+ number: E.number,
48
+ variable: E.variableName,
49
+ function: E.keyword,
50
+ operator: E.operator,
51
+ punctuation: E.punctuation
52
52
  }
53
- }), _e = w.define([
53
+ }), ve = C.define([
54
54
  {
55
- tag: D.keyword,
55
+ tag: E.keyword,
56
56
  color: "var(--fiesta-formula-function)",
57
57
  fontWeight: "600"
58
58
  },
59
59
  {
60
- tag: D.string,
60
+ tag: E.string,
61
61
  color: "var(--fiesta-formula-string)"
62
62
  },
63
63
  {
64
- tag: D.number,
64
+ tag: E.number,
65
65
  color: "var(--fiesta-formula-number)"
66
66
  },
67
67
  {
68
- tag: D.variableName,
68
+ tag: E.variableName,
69
69
  color: "var(--fiesta-formula-variable)"
70
70
  },
71
71
  {
72
- tag: D.operator,
72
+ tag: E.operator,
73
73
  color: "var(--muted-foreground)"
74
74
  },
75
75
  {
76
- tag: D.punctuation,
76
+ tag: E.punctuation,
77
77
  color: "var(--muted-foreground)"
78
78
  }
79
- ]), ve = E.theme({
79
+ ]), ye = T.theme({
80
80
  "&": {
81
81
  fontSize: "0.75rem",
82
82
  fontFamily: "var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace)",
@@ -107,13 +107,13 @@ var ge = T.define({
107
107
  "&.cm-focused .cm-selectionBackground": { background: "var(--accent) !important" },
108
108
  ".cm-gutters": { display: "none" },
109
109
  ".cm-placeholder": { color: "var(--muted-foreground)" }
110
- }), A = [
110
+ }), k = [
111
111
  "logic",
112
112
  "math",
113
113
  "text",
114
114
  "convert",
115
115
  "color"
116
- ], ye = {
116
+ ], be = {
117
117
  logic: {
118
118
  icon: f,
119
119
  text: "text-violet-400",
@@ -140,10 +140,10 @@ var ge = T.define({
140
140
  border: "border-l-pink-400/60"
141
141
  }
142
142
  };
143
- function j(e, t) {
143
+ function A(e, t) {
144
144
  return Object.hasOwn(e, t) ? e[t] : void 0;
145
145
  }
146
- var M = {
146
+ var j = {
147
147
  functionsTab: "Functions",
148
148
  variablesTab: "Variables",
149
149
  loading: "Loading…",
@@ -158,117 +158,117 @@ var M = {
158
158
  categoryConversion: "Conversion",
159
159
  categoryColor: "Color"
160
160
  };
161
- function be({ render: e, onInsert: t }) {
162
- return /* @__PURE__ */ S(x, { children: e({ onInsert: t }) });
161
+ function xe({ render: e, onInsert: t }) {
162
+ return /* @__PURE__ */ x(ue, { children: e({ onInsert: t }) });
163
163
  }
164
- function N(e, t, n, r) {
164
+ function M(e, t, n, r) {
165
165
  let i = e.trim();
166
166
  return i ? !n || t === "valid" && r === i : !1;
167
167
  }
168
- function P({ initialExpr: d = "", mode: f, onConfirm: p, onCancel: m, formulaFunctions: h, isLoadingFunctions: x = !1, validateExpression: w, renderVariablePicker: T, labels: D, className: P }) {
169
- let F = {
170
- ...M,
171
- ...D
172
- }, xe = {
173
- logic: F.categoryLogic,
174
- math: F.categoryMath,
175
- text: F.categoryText,
176
- convert: F.categoryConversion,
177
- color: F.categoryColor
178
- }, I = w !== void 0, L = le(), [R, z] = b(d), [B, V] = b(d && I ? "validating" : "idle"), [H, U] = b(null), [Se, Ce] = b(/* @__PURE__ */ new Set()), W = y(null), G = y(null), K = y(null), q = y(R);
168
+ function N({ initialExpr: d = "", mode: f, onConfirm: p, onCancel: m, formulaFunctions: h, isLoadingFunctions: ue = !1, validateExpression: C, renderVariablePicker: w, labels: E, className: N }) {
169
+ let P = {
170
+ ...j,
171
+ ...E
172
+ }, Se = {
173
+ logic: P.categoryLogic,
174
+ math: P.categoryMath,
175
+ text: P.categoryText,
176
+ convert: P.categoryConversion,
177
+ color: P.categoryColor
178
+ }, F = C !== void 0, I = le(), [L, R] = b(d), [z, B] = b(d && F ? "validating" : "idle"), [V, H] = b(null), [Ce, we] = b(/* @__PURE__ */ new Set()), U = y(null), W = y(null), G = y(null), K = y(L);
179
179
  v(() => {
180
- q.current = R;
181
- }, [R]);
182
- let J = y(null), [we, Y] = b(null), Te = y({
183
- expr: R,
184
- validationState: B,
185
- hasValidator: I,
180
+ K.current = L;
181
+ }, [L]);
182
+ let q = y(null), [J, Y] = b(null), Te = y({
183
+ expr: L,
184
+ validationState: z,
185
+ hasValidator: F,
186
186
  onConfirm: p
187
187
  });
188
188
  v(() => {
189
189
  Te.current = {
190
- expr: R,
191
- validationState: B,
192
- hasValidator: I,
190
+ expr: L,
191
+ validationState: z,
192
+ hasValidator: F,
193
193
  onConfirm: p
194
194
  };
195
195
  }, [
196
- R,
197
- B,
198
- I,
196
+ L,
197
+ z,
198
+ F,
199
199
  p
200
200
  ]);
201
- let Ee = y(w);
201
+ let X = y(C);
202
202
  v(() => {
203
- Ee.current = w;
204
- }, [w]);
205
- let X = _((e) => {
206
- K.current && clearTimeout(K.current);
203
+ X.current = C;
204
+ }, [C]);
205
+ let Z = _((e) => {
206
+ G.current && clearTimeout(G.current);
207
207
  let t = e.trim();
208
- t && (K.current = setTimeout(async () => {
209
- let e = Ee.current;
210
- if (e && q.current.trim() === t) try {
208
+ t && (G.current = setTimeout(async () => {
209
+ let e = X.current;
210
+ if (e && K.current.trim() === t) try {
211
211
  let n = await e(t);
212
- if (q.current.trim() !== t) return;
213
- n.valid ? (J.current = t, Y(t), V("valid"), U(null)) : (J.current = null, Y(null), V("invalid"), U(n.error ? n.error.replace(/^Formula\s+/, "") : null));
212
+ if (K.current.trim() !== t) return;
213
+ n.valid ? (q.current = t, Y(t), B("valid"), H(null)) : (q.current = null, Y(null), B("invalid"), H(n.error ? n.error.replace(/^Formula\s+/, "") : null));
214
214
  } catch {
215
- V("idle"), U(null);
215
+ B("idle"), H(null);
216
216
  }
217
217
  }, 300));
218
- }, []), Z = _((e) => {
219
- if (!e.trim() || !I) {
220
- K.current && clearTimeout(K.current), J.current = null, Y(null), V("idle"), U(null);
218
+ }, []), Q = _((e) => {
219
+ if (!e.trim() || !F) {
220
+ G.current && clearTimeout(G.current), q.current = null, Y(null), B("idle"), H(null);
221
221
  return;
222
222
  }
223
- V("validating"), X(e);
224
- }, [I, X]), Q = y(Z);
223
+ B("validating"), Z(e);
224
+ }, [F, Z]), Ee = y(Q);
225
225
  v(() => {
226
- Q.current = Z;
227
- }, [Z]), v(() => (X(d), () => {
228
- K.current && clearTimeout(K.current);
229
- }), [d, X]), v(() => {
230
- if (!W.current) return;
231
- let e = new E({
232
- state: me.create({
233
- doc: O(d),
226
+ Ee.current = Q;
227
+ }, [Q]), v(() => (Z(d), () => {
228
+ G.current && clearTimeout(G.current);
229
+ }), [d, Z]), v(() => {
230
+ if (!U.current) return;
231
+ let e = new T({
232
+ state: he.create({
233
+ doc: D(d),
234
234
  extensions: [
235
- ge,
236
- pe(_e),
237
- ve,
238
- ue(),
239
- E.lineWrapping,
240
- E.contentAttributes.of({ "aria-labelledby": L }),
241
- he.of([
242
- ...de,
243
- fe,
235
+ _e,
236
+ me(ve),
237
+ ye,
238
+ de(),
239
+ T.lineWrapping,
240
+ T.contentAttributes.of({ "aria-labelledby": I }),
241
+ ge.of([
242
+ ...fe,
243
+ pe,
244
244
  {
245
245
  key: "Mod-Enter",
246
246
  run: () => {
247
247
  let { expr: e, validationState: t, hasValidator: n, onConfirm: r } = Te.current;
248
- return N(e, t, n, J.current) ? (r(e.trim()), !0) : !1;
248
+ return M(e, t, n, q.current) ? (r(e.trim()), !0) : !1;
249
249
  }
250
250
  }
251
251
  ]),
252
- E.updateListener.of((e) => {
252
+ T.updateListener.of((e) => {
253
253
  if (!e.docChanged) return;
254
- let t = k(e.state.doc.toString());
255
- z(t), Q.current(t);
254
+ let t = O(e.state.doc.toString());
255
+ R(t), Ee.current(t);
256
256
  }),
257
- E.domEventHandlers({ mousedown: (e) => e.stopPropagation() })
257
+ T.domEventHandlers({ mousedown: (e) => e.stopPropagation() })
258
258
  ]
259
259
  }),
260
- parent: W.current
260
+ parent: U.current
261
261
  });
262
- return G.current = e, e.focus(), f === "edit" && d && e.dispatch({ selection: {
262
+ return W.current = e, e.focus(), f === "edit" && d && e.dispatch({ selection: {
263
263
  anchor: 0,
264
264
  head: e.state.doc.length
265
265
  } }), () => {
266
- e.destroy(), G.current = null;
266
+ e.destroy(), W.current = null;
267
267
  };
268
268
  }, []), v(() => {
269
- let e = G.current;
270
- if (!e || k(e.state.doc.toString()) === R) return;
271
- let t = O(R);
269
+ let e = W.current;
270
+ if (!e || O(e.state.doc.toString()) === L) return;
271
+ let t = D(L);
272
272
  e.dispatch({
273
273
  changes: {
274
274
  from: 0,
@@ -277,13 +277,13 @@ function P({ initialExpr: d = "", mode: f, onConfirm: p, onCancel: m, formulaFun
277
277
  },
278
278
  selection: { anchor: t.length }
279
279
  });
280
- }, [R]);
280
+ }, [L]);
281
281
  let De = () => {
282
- N(R, B, I, we) && p(R.trim());
282
+ M(L, z, F, J) && p(L.trim());
283
283
  }, Oe = (e) => {
284
- let t = `${e}()`, n = G.current;
284
+ let t = `${e}()`, n = W.current;
285
285
  if (!n) return;
286
- let r = O(t), i = r.indexOf("\n"), a = i >= 0 ? r.indexOf("\n", i + 1) : -1, o = a >= 0 ? a : r.length;
286
+ let r = D(t), i = r.indexOf("\n"), a = i >= 0 ? r.indexOf("\n", i + 1) : -1, o = a >= 0 ? a : r.length;
287
287
  n.dispatch({
288
288
  changes: {
289
289
  from: 0,
@@ -291,9 +291,9 @@ function P({ initialExpr: d = "", mode: f, onConfirm: p, onCancel: m, formulaFun
291
291
  insert: r
292
292
  },
293
293
  selection: { anchor: o }
294
- }), n.focus(), z(t);
294
+ }), n.focus(), R(t);
295
295
  }, ke = (e) => {
296
- let t = e.replace(/^\{\{/, "").replace(/\}\}$/, ""), n = G.current;
296
+ let t = e.replace(/^\{\{/, "").replace(/\}\}$/, ""), n = W.current;
297
297
  if (!n) return;
298
298
  let r = n.state.selection.main.head;
299
299
  n.dispatch({
@@ -304,107 +304,107 @@ function P({ initialExpr: d = "", mode: f, onConfirm: p, onCancel: m, formulaFun
304
304
  },
305
305
  selection: { anchor: r + t.length }
306
306
  }), n.focus();
307
- let i = k(n.state.doc.toString());
308
- z(i);
307
+ let i = O(n.state.doc.toString());
308
+ R(i);
309
309
  }, Ae = (e) => {
310
- Ce((t) => {
310
+ we((t) => {
311
311
  let n = new Set(t);
312
312
  return n.has(e) ? n.delete(e) : n.add(e), n;
313
313
  });
314
- }, je = !N(R, B, I, we), $ = /* @__PURE__ */ new Map();
314
+ }, je = !M(L, z, F, J), $ = /* @__PURE__ */ new Map();
315
315
  for (let e of h ?? []) {
316
316
  let t = $.get(e.category);
317
317
  t ? t.push(e) : $.set(e.category, [e]);
318
318
  }
319
319
  for (let e of $.values()) e.sort((e, t) => e.name.localeCompare(t.name));
320
- let Me = [...A.filter((e) => $.get(e)?.length), ...[...$.keys()].filter((e) => !A.includes(e)).sort((e, t) => e.localeCompare(t))];
321
- return /* @__PURE__ */ S(ne, { children: /* @__PURE__ */ C(r, {
320
+ let Me = [...k.filter((e) => $.get(e)?.length), ...[...$.keys()].filter((e) => !k.includes(e)).sort((e, t) => e.localeCompare(t))];
321
+ return /* @__PURE__ */ x(ne, { children: /* @__PURE__ */ S(i, {
322
322
  "data-slot": "formula-editor-panel",
323
323
  direction: "col",
324
- className: e("sm:flex-row w-full sm:h-[560px]", P),
325
- children: [/* @__PURE__ */ S(n, {
324
+ className: e("sm:flex-row w-full sm:h-[560px]", N),
325
+ children: [/* @__PURE__ */ x(r, {
326
326
  className: e("order-2 sm:order-1", "sm:w-[260px] sm:flex-shrink-0", "border-t sm:border-t-0 sm:border-r border-border", "sm:overflow-y-auto"),
327
- children: /* @__PURE__ */ C(i, {
327
+ children: /* @__PURE__ */ S(a, {
328
328
  defaultValue: "functions",
329
329
  children: [
330
- T && /* @__PURE__ */ S(n, {
330
+ w && /* @__PURE__ */ x(r, {
331
331
  className: "px-3 pt-2 pb-1 sm:sticky sm:top-0 sm:bg-popover sm:z-10 sm:border-b sm:border-border/50",
332
- children: /* @__PURE__ */ C(o, {
332
+ children: /* @__PURE__ */ S(s, {
333
333
  className: "h-8 w-full bg-muted p-0.5",
334
- children: [/* @__PURE__ */ S(s, {
334
+ children: [/* @__PURE__ */ x(c, {
335
335
  value: "functions",
336
336
  className: "flex-1 h-full text-xs px-2 data-[active]:bg-background data-[active]:shadow-sm",
337
- children: F.functionsTab
338
- }), /* @__PURE__ */ S(s, {
337
+ children: P.functionsTab
338
+ }), /* @__PURE__ */ x(c, {
339
339
  value: "variables",
340
340
  className: "flex-1 h-full text-xs px-2 data-[active]:bg-background data-[active]:shadow-sm",
341
- children: F.variablesTab
341
+ children: P.variablesTab
342
342
  })]
343
343
  })
344
344
  }),
345
- /* @__PURE__ */ C(a, {
345
+ /* @__PURE__ */ S(o, {
346
346
  value: "functions",
347
347
  className: "mt-0",
348
- children: [x && /* @__PURE__ */ C(u, {
348
+ children: [ue && /* @__PURE__ */ S(u, {
349
349
  gap: "1.5",
350
350
  className: "px-3 py-2",
351
351
  role: "status",
352
- "aria-label": F.loading,
352
+ "aria-label": P.loading,
353
353
  children: [
354
- /* @__PURE__ */ S(c, { className: "h-3 w-2/3" }),
355
- /* @__PURE__ */ S(c, { className: "h-3 w-1/2" }),
356
- /* @__PURE__ */ S(c, { className: "h-3 w-3/4" })
354
+ /* @__PURE__ */ x(l, { className: "h-3 w-2/3" }),
355
+ /* @__PURE__ */ x(l, { className: "h-3 w-1/2" }),
356
+ /* @__PURE__ */ x(l, { className: "h-3 w-3/4" })
357
357
  ]
358
- }), /* @__PURE__ */ S(u, {
358
+ }), /* @__PURE__ */ x(u, {
359
359
  gap: "1",
360
360
  className: "px-2 pb-2",
361
361
  children: Me.map((t) => {
362
- let r = Se.has(t), i = $.get(t) ?? [], a = j(ye, t), o = a?.icon, s = `${L}-cat-${t}`;
363
- return /* @__PURE__ */ C(n, {
364
- className: e("overflow-hidden border-l-2", a?.border ?? "border-border/0"),
365
- children: [/* @__PURE__ */ C("button", {
362
+ let i = Ce.has(t), a = $.get(t) ?? [], o = A(be, t), s = o?.icon, c = `${I}-cat-${t}`;
363
+ return /* @__PURE__ */ S(r, {
364
+ className: e("overflow-hidden border-l-2", o?.border ?? "border-border/0"),
365
+ children: [/* @__PURE__ */ S("button", {
366
366
  type: "button",
367
367
  onClick: () => Ae(t),
368
- "aria-expanded": !r,
369
- "aria-controls": s,
370
- className: e("flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold transition-colors", "bg-muted/40 hover:bg-muted/70", "focus-ring", a?.text ?? "text-muted-foreground"),
371
- children: [/* @__PURE__ */ C(l, {
368
+ "aria-expanded": !i,
369
+ "aria-controls": c,
370
+ className: e("flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold transition-colors", "bg-muted/40 hover:bg-muted/70", "focus-ring", o?.text ?? "text-muted-foreground"),
371
+ children: [/* @__PURE__ */ S(n, {
372
372
  as: "span",
373
373
  weight: "semibold",
374
- className: e("flex items-center gap-1.5 text-[11px]", a?.text ?? "text-muted-foreground"),
375
- children: [o && /* @__PURE__ */ S(o, { className: "w-3 h-3" }), j(xe, t) ?? t]
376
- }), S(r ? oe : ae, { className: "w-3 h-3 text-muted-foreground" })]
377
- }), !r && /* @__PURE__ */ S(n, {
378
- id: s,
374
+ className: e("flex items-center gap-1.5 text-[11px]", o?.text ?? "text-muted-foreground"),
375
+ children: [s && /* @__PURE__ */ x(s, { className: "w-3 h-3" }), A(Se, t) ?? t]
376
+ }), x(i ? oe : ae, { className: "w-3 h-3 text-muted-foreground" })]
377
+ }), !i && /* @__PURE__ */ x(r, {
378
+ id: c,
379
379
  className: "py-0.5",
380
- children: i.map((e) => /* @__PURE__ */ C(ee, { children: [/* @__PURE__ */ S(re, {
380
+ children: a.map((e) => /* @__PURE__ */ S(ee, { children: [/* @__PURE__ */ x(re, {
381
381
  asChild: !0,
382
- children: /* @__PURE__ */ C("button", {
382
+ children: /* @__PURE__ */ S("button", {
383
383
  type: "button",
384
384
  onClick: () => Oe(e.name),
385
385
  className: "w-full text-left px-3 py-1 text-xs hover:bg-accent hover:text-accent-foreground transition-colors flex items-baseline gap-2 group focus-ring",
386
- children: [/* @__PURE__ */ S(l, {
386
+ children: [/* @__PURE__ */ x(n, {
387
387
  as: "span",
388
388
  size: "xs",
389
389
  weight: "semibold",
390
390
  className: "font-mono flex-shrink-0 group-hover:text-accent-foreground",
391
391
  children: e.name
392
- }), /* @__PURE__ */ S(l, {
392
+ }), /* @__PURE__ */ x(n, {
393
393
  as: "span",
394
394
  tone: "muted",
395
395
  className: "font-mono text-[10px] truncate group-hover:text-accent-foreground/70",
396
396
  children: e.signature
397
397
  })]
398
398
  })
399
- }), /* @__PURE__ */ C(te, {
399
+ }), /* @__PURE__ */ S(te, {
400
400
  side: "right",
401
401
  className: "max-w-[220px]",
402
- children: [/* @__PURE__ */ S(l, {
402
+ children: [/* @__PURE__ */ x(n, {
403
403
  size: "xs",
404
404
  weight: "semibold",
405
405
  className: "font-mono",
406
406
  children: e.signature
407
- }), /* @__PURE__ */ S(l, {
407
+ }), /* @__PURE__ */ x(n, {
408
408
  size: "xs",
409
409
  tone: "muted",
410
410
  className: "mt-0.5",
@@ -416,65 +416,65 @@ function P({ initialExpr: d = "", mode: f, onConfirm: p, onCancel: m, formulaFun
416
416
  })
417
417
  })]
418
418
  }),
419
- T && /* @__PURE__ */ S(a, {
419
+ w && /* @__PURE__ */ x(o, {
420
420
  value: "variables",
421
421
  className: "mt-0",
422
- children: /* @__PURE__ */ S(ce, {
423
- fallback: /* @__PURE__ */ C(n, {
422
+ children: /* @__PURE__ */ x(ce, {
423
+ fallback: /* @__PURE__ */ S(r, {
424
424
  className: "p-3 min-w-[300px]",
425
425
  children: [
426
- /* @__PURE__ */ S(c, { className: "h-4 w-full mb-2" }),
427
- /* @__PURE__ */ S(c, { className: "h-4 w-3/4 mb-2" }),
428
- /* @__PURE__ */ S(c, { className: "h-4 w-1/2" })
426
+ /* @__PURE__ */ x(l, { className: "h-4 w-full mb-2" }),
427
+ /* @__PURE__ */ x(l, { className: "h-4 w-3/4 mb-2" }),
428
+ /* @__PURE__ */ x(l, { className: "h-4 w-1/2" })
429
429
  ]
430
430
  }),
431
- children: /* @__PURE__ */ S(be, {
432
- render: T,
431
+ children: /* @__PURE__ */ x(xe, {
432
+ render: w,
433
433
  onInsert: ke
434
434
  })
435
435
  })
436
436
  })
437
437
  ]
438
438
  })
439
- }), /* @__PURE__ */ C(r, {
439
+ }), /* @__PURE__ */ S(i, {
440
440
  direction: "col",
441
441
  className: "order-1 sm:order-2 flex-1 min-w-0 sm:overflow-hidden",
442
- children: [/* @__PURE__ */ C(u, {
442
+ children: [/* @__PURE__ */ S(u, {
443
443
  gap: "1.5",
444
444
  className: "px-3 pt-3 pb-2.5 sm:flex-1 sm:flex sm:flex-col sm:overflow-hidden",
445
445
  children: [
446
- /* @__PURE__ */ S(l, {
446
+ /* @__PURE__ */ x(n, {
447
447
  as: "span",
448
- id: L,
448
+ id: I,
449
449
  tone: "muted",
450
450
  weight: "semibold",
451
451
  className: "text-[10px] uppercase tracking-widest",
452
- children: F.formulaExpression
452
+ children: P.formulaExpression
453
453
  }),
454
- /* @__PURE__ */ C(n, {
455
- className: e("rounded-md border overflow-hidden sm:flex-1 sm:flex sm:flex-col sm:min-h-0", B === "invalid" && "border-destructive", B === "valid" && "border-success", B !== "invalid" && B !== "valid" && "border-border"),
454
+ /* @__PURE__ */ S(r, {
455
+ className: e("rounded-md border overflow-hidden sm:flex-1 sm:flex sm:flex-col sm:min-h-0", z === "invalid" && "border-destructive", z === "valid" && "border-success", z !== "invalid" && z !== "valid" && "border-border"),
456
456
  children: [
457
- /* @__PURE__ */ C(r, {
457
+ /* @__PURE__ */ S(i, {
458
458
  align: "center",
459
459
  justify: "between",
460
- className: e("px-2.5 py-1 border-b sm:flex-shrink-0", "bg-muted/20 select-none", B === "invalid" && "border-destructive/40", B === "valid" && "border-success/40", B !== "invalid" && B !== "valid" && "border-border"),
461
- children: [/* @__PURE__ */ S(l, {
460
+ className: e("px-2.5 py-1 border-b sm:flex-shrink-0", "bg-muted/20 select-none", z === "invalid" && "border-destructive/40", z === "valid" && "border-success/40", z !== "invalid" && z !== "valid" && "border-border"),
461
+ children: [/* @__PURE__ */ x(n, {
462
462
  as: "span",
463
463
  className: "text-[10px] text-muted-foreground/50 font-mono",
464
464
  children: "{{="
465
- }), /* @__PURE__ */ S(l, {
465
+ }), /* @__PURE__ */ x(n, {
466
466
  as: "span",
467
467
  className: "flex items-center",
468
- children: B === "valid" && R.trim() ? /* @__PURE__ */ S(ie, { className: "w-3.5 h-3.5 text-success" }) : B === "invalid" ? /* @__PURE__ */ S(g, { className: "w-3.5 h-3.5 text-destructive" }) : B === "validating" ? /* @__PURE__ */ S(se, { className: "w-3.5 h-3.5 text-muted-foreground/50 animate-spin motion-reduce:animate-none" }) : null
468
+ children: z === "valid" && L.trim() ? /* @__PURE__ */ x(ie, { className: "w-3.5 h-3.5 text-success" }) : z === "invalid" ? /* @__PURE__ */ x(g, { className: "w-3.5 h-3.5 text-destructive" }) : z === "validating" ? /* @__PURE__ */ x(se, { className: "w-3.5 h-3.5 text-muted-foreground/50 animate-spin motion-reduce:animate-none" }) : null
469
469
  })]
470
470
  }),
471
- /* @__PURE__ */ S(n, {
472
- ref: W,
471
+ /* @__PURE__ */ x(r, {
472
+ ref: U,
473
473
  className: "sm:flex-1 sm:min-h-0 sm:overflow-hidden"
474
474
  }),
475
- /* @__PURE__ */ S(n, {
476
- className: e("px-2.5 py-1 border-t bg-muted/20 select-none sm:flex-shrink-0", B === "invalid" && "border-destructive/40", B === "valid" && "border-success/40", B !== "invalid" && B !== "valid" && "border-border"),
477
- children: /* @__PURE__ */ S(l, {
475
+ /* @__PURE__ */ x(r, {
476
+ className: e("px-2.5 py-1 border-t bg-muted/20 select-none sm:flex-shrink-0", z === "invalid" && "border-destructive/40", z === "valid" && "border-success/40", z !== "invalid" && z !== "valid" && "border-border"),
477
+ children: /* @__PURE__ */ x(n, {
478
478
  as: "span",
479
479
  className: "text-[10px] text-muted-foreground/50 font-mono",
480
480
  children: "}}"
@@ -482,37 +482,37 @@ function P({ initialExpr: d = "", mode: f, onConfirm: p, onCancel: m, formulaFun
482
482
  })
483
483
  ]
484
484
  }),
485
- B === "invalid" && H && /* @__PURE__ */ C(r, {
485
+ z === "invalid" && V && /* @__PURE__ */ S(i, {
486
486
  align: "start",
487
487
  gap: "1",
488
488
  role: "alert",
489
489
  className: "text-destructive",
490
- children: [/* @__PURE__ */ S(g, { className: "w-3 h-3 flex-shrink-0 mt-0.5" }), /* @__PURE__ */ S(l, {
490
+ children: [/* @__PURE__ */ x(g, { className: "w-3 h-3 flex-shrink-0 mt-0.5" }), /* @__PURE__ */ x(n, {
491
491
  as: "span",
492
492
  tone: "destructive",
493
493
  className: "text-[10px]",
494
- children: H
494
+ children: V
495
495
  })]
496
496
  })
497
497
  ]
498
- }), /* @__PURE__ */ C(r, {
498
+ }), /* @__PURE__ */ S(i, {
499
499
  justify: "end",
500
500
  gap: "2",
501
501
  className: "flex-shrink-0 border-t border-border px-3 py-2",
502
- children: [f === "edit" && m && /* @__PURE__ */ S(t, {
502
+ children: [f === "edit" && m && /* @__PURE__ */ x(t, {
503
503
  type: "button",
504
504
  variant: "outline",
505
505
  size: "sm",
506
506
  onClick: m,
507
507
  className: "text-xs",
508
- children: d ? F.close : F.cancel
509
- }), /* @__PURE__ */ C(t, {
508
+ children: d ? P.close : P.cancel
509
+ }), /* @__PURE__ */ S(t, {
510
510
  type: "button",
511
511
  size: "sm",
512
512
  onClick: De,
513
513
  disabled: je,
514
514
  className: "text-xs",
515
- children: [f === "create" ? F.insert : F.done, /* @__PURE__ */ S("kbd", {
515
+ children: [f === "create" ? P.insert : P.done, /* @__PURE__ */ x("kbd", {
516
516
  className: "hidden sm:inline-flex items-center gap-0.5 px-1 py-0.5 rounded-sm text-[9px] font-sans opacity-60 bg-primary-foreground/20",
517
517
  children: "⌘↵"
518
518
  })]
@@ -522,6 +522,6 @@ function P({ initialExpr: d = "", mode: f, onConfirm: p, onCancel: m, formulaFun
522
522
  }) });
523
523
  }
524
524
  //#endregion
525
- export { M as DEFAULT_FORMULA_EDITOR_LABELS, P as FormulaEditorPanel };
525
+ export { j as DEFAULT_FORMULA_EDITOR_LABELS, N as FormulaEditorPanel };
526
526
 
527
527
  //# sourceMappingURL=formula-editor-panel.js.map