@fiestaboard/ui 5.9.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.
- package/dist/components/chrome/pagination.d.ts +75 -0
- package/dist/components/chrome/pagination.js +93 -0
- package/dist/components/chrome/pagination.js.map +1 -0
- package/dist/components/chrome/top-nav.d.ts +102 -0
- package/dist/components/chrome/top-nav.js +91 -0
- package/dist/components/chrome/top-nav.js.map +1 -0
- package/dist/components/containment/action-card.d.ts +95 -0
- package/dist/components/containment/action-card.js +91 -0
- package/dist/components/containment/action-card.js.map +1 -0
- package/dist/components/containment/card.d.ts +24 -1
- package/dist/components/containment/card.js +11 -10
- package/dist/components/containment/card.js.map +1 -1
- package/dist/components/containment/icon-tile.d.ts +1 -1
- package/dist/components/editor/color-picker-content.js +17 -17
- package/dist/components/editor/filter-picker-content.js +20 -20
- package/dist/components/editor/formatting-picker-content.js +20 -20
- package/dist/components/editor/formula/formula-editor-panel.js +184 -184
- package/dist/components/editor/formula/formula-editor-panel.js.map +1 -1
- package/dist/components/editor/node-views/color-tile-node-view.js +5 -5
- package/dist/components/editor/node-views/formula-node-view.js +9 -9
- package/dist/components/editor/template-editor-toolbar.js +44 -44
- package/dist/components/editor/template-editor.js +23 -23
- package/dist/components/editor/toolbar-dropdown.js +6 -6
- package/dist/components/editor/variable-picker-content.js +79 -79
- package/dist/components/feedback/alert.d.ts +1 -1
- package/dist/components/feedback/badge.d.ts +1 -1
- package/dist/components/feedback/badge.js +6 -6
- package/dist/components/feedback/chip.js +6 -6
- package/dist/components/feedback/spinner.d.ts +1 -1
- package/dist/components/feedback/status-dot.d.ts +1 -1
- package/dist/components/forms/button.d.ts +2 -2
- package/dist/components/forms/button.js +6 -6
- package/dist/components/forms/field.d.ts +66 -0
- package/dist/components/forms/field.js +64 -0
- package/dist/components/forms/field.js.map +1 -0
- package/dist/components/forms/swatch.d.ts +4 -4
- package/dist/components/forms/time-picker.js +24 -24
- package/dist/components/forms/toggle-card.d.ts +2 -2
- package/dist/components/forms/toggle.d.ts +1 -1
- package/dist/components/plugin/plugin-card.js +5 -5
- package/dist/components/typography/heading.d.ts +2 -2
- package/dist/components/typography/kbd.d.ts +35 -0
- package/dist/components/typography/kbd.js +115 -0
- package/dist/components/typography/kbd.js.map +1 -0
- package/dist/components/typography/text.d.ts +2 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.js +113 -108
- 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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
|
14
|
-
import { history as
|
|
15
|
-
import { HighlightStyle as
|
|
16
|
-
import { EditorState as
|
|
17
|
-
import { EditorView as
|
|
18
|
-
import { tags as
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
47
|
-
number:
|
|
48
|
-
variable:
|
|
49
|
-
function:
|
|
50
|
-
operator:
|
|
51
|
-
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
|
-
}),
|
|
53
|
+
}), ve = C.define([
|
|
54
54
|
{
|
|
55
|
-
tag:
|
|
55
|
+
tag: E.keyword,
|
|
56
56
|
color: "var(--fiesta-formula-function)",
|
|
57
57
|
fontWeight: "600"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
tag:
|
|
60
|
+
tag: E.string,
|
|
61
61
|
color: "var(--fiesta-formula-string)"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
tag:
|
|
64
|
+
tag: E.number,
|
|
65
65
|
color: "var(--fiesta-formula-number)"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
|
-
tag:
|
|
68
|
+
tag: E.variableName,
|
|
69
69
|
color: "var(--fiesta-formula-variable)"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
tag:
|
|
72
|
+
tag: E.operator,
|
|
73
73
|
color: "var(--muted-foreground)"
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
|
-
tag:
|
|
76
|
+
tag: E.punctuation,
|
|
77
77
|
color: "var(--muted-foreground)"
|
|
78
78
|
}
|
|
79
|
-
]),
|
|
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
|
-
}),
|
|
110
|
+
}), k = [
|
|
111
111
|
"logic",
|
|
112
112
|
"math",
|
|
113
113
|
"text",
|
|
114
114
|
"convert",
|
|
115
115
|
"color"
|
|
116
|
-
],
|
|
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
|
|
143
|
+
function A(e, t) {
|
|
144
144
|
return Object.hasOwn(e, t) ? e[t] : void 0;
|
|
145
145
|
}
|
|
146
|
-
var
|
|
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
|
|
162
|
-
return /* @__PURE__ */
|
|
161
|
+
function xe({ render: e, onInsert: t }) {
|
|
162
|
+
return /* @__PURE__ */ x(ue, { children: e({ onInsert: t }) });
|
|
163
163
|
}
|
|
164
|
-
function
|
|
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
|
|
169
|
-
let
|
|
170
|
-
...
|
|
171
|
-
...
|
|
172
|
-
},
|
|
173
|
-
logic:
|
|
174
|
-
math:
|
|
175
|
-
text:
|
|
176
|
-
convert:
|
|
177
|
-
color:
|
|
178
|
-
},
|
|
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
|
-
|
|
181
|
-
}, [
|
|
182
|
-
let
|
|
183
|
-
expr:
|
|
184
|
-
validationState:
|
|
185
|
-
hasValidator:
|
|
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:
|
|
191
|
-
validationState:
|
|
192
|
-
hasValidator:
|
|
190
|
+
expr: L,
|
|
191
|
+
validationState: z,
|
|
192
|
+
hasValidator: F,
|
|
193
193
|
onConfirm: p
|
|
194
194
|
};
|
|
195
195
|
}, [
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
L,
|
|
197
|
+
z,
|
|
198
|
+
F,
|
|
199
199
|
p
|
|
200
200
|
]);
|
|
201
|
-
let
|
|
201
|
+
let X = y(C);
|
|
202
202
|
v(() => {
|
|
203
|
-
|
|
204
|
-
}, [
|
|
205
|
-
let
|
|
206
|
-
|
|
203
|
+
X.current = C;
|
|
204
|
+
}, [C]);
|
|
205
|
+
let Z = _((e) => {
|
|
206
|
+
G.current && clearTimeout(G.current);
|
|
207
207
|
let t = e.trim();
|
|
208
|
-
t && (
|
|
209
|
-
let e =
|
|
210
|
-
if (e &&
|
|
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 (
|
|
213
|
-
n.valid ? (
|
|
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
|
-
|
|
215
|
+
B("idle"), H(null);
|
|
216
216
|
}
|
|
217
217
|
}, 300));
|
|
218
|
-
}, []),
|
|
219
|
-
if (!e.trim() || !
|
|
220
|
-
|
|
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
|
-
|
|
224
|
-
}, [
|
|
223
|
+
B("validating"), Z(e);
|
|
224
|
+
}, [F, Z]), Ee = y(Q);
|
|
225
225
|
v(() => {
|
|
226
|
-
|
|
227
|
-
}, [
|
|
228
|
-
|
|
229
|
-
}), [d,
|
|
230
|
-
if (!
|
|
231
|
-
let e = new
|
|
232
|
-
state:
|
|
233
|
-
doc:
|
|
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
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
...
|
|
243
|
-
|
|
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
|
|
248
|
+
return M(e, t, n, q.current) ? (r(e.trim()), !0) : !1;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
]),
|
|
252
|
-
|
|
252
|
+
T.updateListener.of((e) => {
|
|
253
253
|
if (!e.docChanged) return;
|
|
254
|
-
let t =
|
|
255
|
-
|
|
254
|
+
let t = O(e.state.doc.toString());
|
|
255
|
+
R(t), Ee.current(t);
|
|
256
256
|
}),
|
|
257
|
-
|
|
257
|
+
T.domEventHandlers({ mousedown: (e) => e.stopPropagation() })
|
|
258
258
|
]
|
|
259
259
|
}),
|
|
260
|
-
parent:
|
|
260
|
+
parent: U.current
|
|
261
261
|
});
|
|
262
|
-
return
|
|
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(),
|
|
266
|
+
e.destroy(), W.current = null;
|
|
267
267
|
};
|
|
268
268
|
}, []), v(() => {
|
|
269
|
-
let e =
|
|
270
|
-
if (!e ||
|
|
271
|
-
let t =
|
|
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
|
-
}, [
|
|
280
|
+
}, [L]);
|
|
281
281
|
let De = () => {
|
|
282
|
-
|
|
282
|
+
M(L, z, F, J) && p(L.trim());
|
|
283
283
|
}, Oe = (e) => {
|
|
284
|
-
let t = `${e}()`, n =
|
|
284
|
+
let t = `${e}()`, n = W.current;
|
|
285
285
|
if (!n) return;
|
|
286
|
-
let r =
|
|
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(),
|
|
294
|
+
}), n.focus(), R(t);
|
|
295
295
|
}, ke = (e) => {
|
|
296
|
-
let t = e.replace(/^\{\{/, "").replace(/\}\}$/, ""), n =
|
|
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 =
|
|
308
|
-
|
|
307
|
+
let i = O(n.state.doc.toString());
|
|
308
|
+
R(i);
|
|
309
309
|
}, Ae = (e) => {
|
|
310
|
-
|
|
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 = !
|
|
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 = [...
|
|
321
|
-
return /* @__PURE__ */
|
|
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]",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
327
|
+
children: /* @__PURE__ */ S(a, {
|
|
328
328
|
defaultValue: "functions",
|
|
329
329
|
children: [
|
|
330
|
-
|
|
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__ */
|
|
332
|
+
children: /* @__PURE__ */ S(s, {
|
|
333
333
|
className: "h-8 w-full bg-muted p-0.5",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
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:
|
|
338
|
-
}), /* @__PURE__ */
|
|
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:
|
|
341
|
+
children: P.variablesTab
|
|
342
342
|
})]
|
|
343
343
|
})
|
|
344
344
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ S(o, {
|
|
346
346
|
value: "functions",
|
|
347
347
|
className: "mt-0",
|
|
348
|
-
children: [
|
|
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":
|
|
352
|
+
"aria-label": P.loading,
|
|
353
353
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
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__ */
|
|
358
|
+
}), /* @__PURE__ */ x(u, {
|
|
359
359
|
gap: "1",
|
|
360
360
|
className: "px-2 pb-2",
|
|
361
361
|
children: Me.map((t) => {
|
|
362
|
-
let
|
|
363
|
-
return /* @__PURE__ */
|
|
364
|
-
className: e("overflow-hidden border-l-2",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
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": !
|
|
369
|
-
"aria-controls":
|
|
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",
|
|
371
|
-
children: [/* @__PURE__ */
|
|
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]",
|
|
375
|
-
children: [
|
|
376
|
-
}),
|
|
377
|
-
}), !
|
|
378
|
-
id:
|
|
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:
|
|
380
|
+
children: a.map((e) => /* @__PURE__ */ S(ee, { children: [/* @__PURE__ */ x(re, {
|
|
381
381
|
asChild: !0,
|
|
382
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
399
|
+
}), /* @__PURE__ */ S(te, {
|
|
400
400
|
side: "right",
|
|
401
401
|
className: "max-w-[220px]",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
419
|
+
w && /* @__PURE__ */ x(o, {
|
|
420
420
|
value: "variables",
|
|
421
421
|
className: "mt-0",
|
|
422
|
-
children: /* @__PURE__ */
|
|
423
|
-
fallback: /* @__PURE__ */
|
|
422
|
+
children: /* @__PURE__ */ x(ce, {
|
|
423
|
+
fallback: /* @__PURE__ */ S(r, {
|
|
424
424
|
className: "p-3 min-w-[300px]",
|
|
425
425
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
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__ */
|
|
432
|
-
render:
|
|
431
|
+
children: /* @__PURE__ */ x(xe, {
|
|
432
|
+
render: w,
|
|
433
433
|
onInsert: ke
|
|
434
434
|
})
|
|
435
435
|
})
|
|
436
436
|
})
|
|
437
437
|
]
|
|
438
438
|
})
|
|
439
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
446
|
+
/* @__PURE__ */ x(n, {
|
|
447
447
|
as: "span",
|
|
448
|
-
id:
|
|
448
|
+
id: I,
|
|
449
449
|
tone: "muted",
|
|
450
450
|
weight: "semibold",
|
|
451
451
|
className: "text-[10px] uppercase tracking-widest",
|
|
452
|
-
children:
|
|
452
|
+
children: P.formulaExpression
|
|
453
453
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
className: e("rounded-md border overflow-hidden sm:flex-1 sm:flex sm:flex-col sm:min-h-0",
|
|
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__ */
|
|
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",
|
|
461
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
465
|
+
}), /* @__PURE__ */ x(n, {
|
|
466
466
|
as: "span",
|
|
467
467
|
className: "flex items-center",
|
|
468
|
-
children:
|
|
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__ */
|
|
472
|
-
ref:
|
|
471
|
+
/* @__PURE__ */ x(r, {
|
|
472
|
+
ref: U,
|
|
473
473
|
className: "sm:flex-1 sm:min-h-0 sm:overflow-hidden"
|
|
474
474
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
className: e("px-2.5 py-1 border-t bg-muted/20 select-none sm:flex-shrink-0",
|
|
477
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
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__ */
|
|
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:
|
|
494
|
+
children: V
|
|
495
495
|
})]
|
|
496
496
|
})
|
|
497
497
|
]
|
|
498
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
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 ?
|
|
509
|
-
}), /* @__PURE__ */
|
|
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" ?
|
|
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 {
|
|
525
|
+
export { j as DEFAULT_FORMULA_EDITOR_LABELS, N as FormulaEditorPanel };
|
|
526
526
|
|
|
527
527
|
//# sourceMappingURL=formula-editor-panel.js.map
|