@servicetitan/json-render-react 0.2.0 → 0.3.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/catalog/context/catalog-prompt.md +229 -0
- package/dist/catalog/context/schema.json +56 -0
- package/dist/catalog/core/catalog-prompt.md +104 -90
- package/dist/catalog/core/schema.json +0 -1
- package/dist/catalog/marketing/catalog-prompt.md +104 -90
- package/dist/catalog/marketing/schema.json +0 -1
- package/dist/context/catalog/catalog-def.d.ts +50 -0
- package/dist/context/catalog/context-card.catalog.d.ts +19 -0
- package/dist/context/catalog/context-card.d.ts +8 -0
- package/dist/context/catalog/context-data-table.catalog.d.ts +34 -0
- package/dist/context/catalog/context-data-table.css.d.ts +2 -0
- package/dist/context/catalog/context-data-table.d.ts +6 -0
- package/dist/context/catalog/context-file-list.catalog.d.ts +11 -0
- package/dist/context/catalog/context-file-list.css.d.ts +16 -0
- package/dist/context/catalog/context-file-list.d.ts +6 -0
- package/dist/context/catalog/context-list.catalog.d.ts +48 -0
- package/dist/context/catalog/context-list.css.d.ts +16 -0
- package/dist/context/catalog/context-list.d.ts +6 -0
- package/dist/context/catalog/context-metric-grid.catalog.d.ts +22 -0
- package/dist/context/catalog/context-metric-grid.css.d.ts +13 -0
- package/dist/context/catalog/context-metric-grid.d.ts +6 -0
- package/dist/context/catalog/context-note-list.catalog.d.ts +15 -0
- package/dist/context/catalog/context-note-list.d.ts +6 -0
- package/dist/context/catalog/context-overview.catalog.d.ts +8 -0
- package/dist/context/catalog/context-overview.css.d.ts +2 -0
- package/dist/context/catalog/context-overview.d.ts +6 -0
- package/dist/context/catalog/context-panel.catalog.d.ts +6 -0
- package/dist/context/catalog/context-panel.css.d.ts +1 -0
- package/dist/context/catalog/context-panel.d.ts +6 -0
- package/dist/context/catalog/context-tabular-list.catalog.d.ts +19 -0
- package/dist/context/catalog/context-tabular-list.css.d.ts +17 -0
- package/dist/context/catalog/context-tabular-list.d.ts +6 -0
- package/dist/context/catalog/index.d.ts +10 -0
- package/dist/context/catalog/schemas.d.ts +151 -0
- package/dist/context/components/collapsible-card.css.d.ts +41 -0
- package/dist/context/components/collapsible-card.d.ts +14 -0
- package/dist/context/components/context-ai-summary.css.d.ts +5 -0
- package/dist/context/components/context-ai-summary.d.ts +4 -0
- package/dist/context/components/context-chip-tone.d.ts +10 -0
- package/dist/context/components/context-note-list.css.d.ts +10 -0
- package/dist/context/components/context-render-error-boundary.d.ts +21 -0
- package/dist/context/constants.d.ts +6 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/validate-context-spec-deep.d.ts +9 -0
- package/dist/context/validate-context-spec.d.ts +11 -0
- package/dist/core/catalog/alert.catalog.d.ts +2 -0
- package/dist/core/catalog/button.catalog.d.ts +3 -0
- package/dist/core/catalog/card.catalog.d.ts +2 -0
- package/dist/core/catalog/catalog-def.d.ts +33 -19
- package/dist/core/catalog/checkbox.catalog.d.ts +1 -0
- package/dist/core/catalog/chip.catalog.d.ts +1 -0
- package/dist/core/catalog/flex.catalog.d.ts +13 -0
- package/dist/core/catalog/grid.catalog.d.ts +4 -0
- package/dist/core/catalog/input.catalog.d.ts +1 -0
- package/dist/core/catalog/link.catalog.d.ts +2 -0
- package/dist/core/catalog/listbox.catalog.d.ts +1 -0
- package/dist/core/catalog/radio-group.catalog.d.ts +1 -0
- package/dist/core/catalog/schemas.d.ts +33 -19
- package/dist/core/catalog/switch.catalog.d.ts +1 -0
- package/dist/core/catalog/text.catalog.d.ts +0 -8
- package/dist/core/catalog/textarea.catalog.d.ts +1 -0
- package/dist/generate.d.ts +4 -4
- package/dist/index.d.ts +6 -3
- package/dist/json-render-react.js +1820 -705
- package/dist/json-render-react.js.map +1 -1
- package/dist/marketing/catalog/catalog.d.ts +1 -1
- package/dist/marketing/catalog/index.d.ts +1 -1
- package/dist/marketing/catalog/scoped-catalogs.d.ts +4 -0
- package/dist/registry-utils.d.ts +1 -1
- package/dist/registry.d.ts +1 -0
- package/dist/renderers/context-spec-renderer.d.ts +6 -0
- package/dist/renderers/sectioned-context-renderer.css.d.ts +1 -0
- package/dist/renderers/sectioned-context-renderer.d.ts +36 -0
- package/dist/renderers/spec-renderer.d.ts +6 -1
- package/dist/renderers/types.d.ts +2 -1
- package/dist/renderers/wrap-context-registry.d.ts +3 -0
- package/dist/scoped-catalog.d.ts +64 -0
- package/dist/styles.css +1 -1
- package/dist/test/setup-dom.d.ts +1 -0
- package/dist/types.d.ts +6 -3
- package/package.json +4 -2
- package/dist/core/catalog/badge.catalog.d.ts +0 -12
- package/dist/core/catalog/badge.css.d.ts +0 -1
- package/dist/core/catalog/badge.d.ts +0 -8
- package/dist/marketing/catalog/teams.d.ts +0 -4
- package/dist/team-catalog.d.ts +0 -26
|
@@ -1,203 +1,855 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { AiMark as e, Alert as t, Badge as n, Button as r, Card as i, Checkbox as a, Chip as o, Divider as s, FieldLabel as c, Flex as l, Grid as u, Icon as d, Link as f, Listbox as ee, OverflowText as te, ProgressBar as ne, Radio as re, SkeletonRectangle as ie, SkeletonText as ae, Switch as oe, Text as p, TextField as se, Textarea as ce } from "@servicetitan/anvil2";
|
|
2
|
+
import { Card as m, Dialog as le, Link as ue, Text as h } from "@servicetitan/carto-react-kit";
|
|
3
|
+
import { IconChevronDown as de } from "@servicetitan/carto-react-kit/icons";
|
|
4
|
+
import { Children as g, Component as fe, Fragment as pe, useEffect as _, useId as me, useMemo as v, useRef as y, useState as b } from "react";
|
|
5
|
+
import { core as x } from "@servicetitan/anvil2/token";
|
|
6
|
+
import { Fragment as he, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
7
|
+
import { z as w } from "zod";
|
|
8
|
+
import { DataTable as ge, createColumnHelper as _e } from "@servicetitan/anvil2/beta";
|
|
9
|
+
import ve from "@servicetitan/anvil2/assets/icons/material/round/image.svg";
|
|
10
|
+
import ye from "@servicetitan/anvil2/assets/icons/st/document_audio.svg";
|
|
11
|
+
import be from "@servicetitan/anvil2/assets/icons/st/document_doc.svg";
|
|
12
|
+
import xe from "@servicetitan/anvil2/assets/icons/st/document_form.svg";
|
|
13
|
+
import Se from "@servicetitan/anvil2/assets/icons/st/document_other.svg";
|
|
14
|
+
import Ce from "@servicetitan/anvil2/assets/icons/st/document_pdf.svg";
|
|
15
|
+
import we from "@servicetitan/anvil2/assets/icons/st/document_spreadsheet.svg";
|
|
16
|
+
import Te from "@servicetitan/anvil2/assets/icons/st/document_text.svg";
|
|
17
|
+
import { primitive as Ee } from "@servicetitan/carto-react-kit/tokens";
|
|
18
|
+
import { defineCatalog as T, getByPath as E, validateSpec as De } from "@json-render/core";
|
|
19
|
+
import { schema as D } from "@json-render/react/schema";
|
|
20
|
+
import { JSONUIProvider as Oe, Renderer as ke, createStateStore as Ae, defineRegistry as je, useStateStore as O } from "@json-render/react";
|
|
21
|
+
import * as k from "@amcharts/amcharts5";
|
|
22
|
+
import * as A from "@amcharts/amcharts5/xy";
|
|
23
|
+
import Me from "@amcharts/amcharts5/themes/Animated";
|
|
24
|
+
import { ThemeCategorical as Ne, ThemeMonochrome as Pe, ThemeSemantic as Fe } from "@servicetitan/anvil2-ext-charts/am5";
|
|
25
|
+
import Ie from "@servicetitan/anvil2/assets/icons/material/round/check_circle.svg";
|
|
26
|
+
import Le from "@servicetitan/anvil2/assets/icons/material/round/radio_button_unchecked.svg";
|
|
27
|
+
import Re from "@servicetitan/anvil2/assets/icons/st/in_progress.svg";
|
|
28
|
+
import * as ze from "@amcharts/amcharts5/percent";
|
|
29
|
+
//#region ../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.20.1/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
30
|
+
function Be(e, t) {
|
|
31
|
+
if (typeof e != "object" || !e) return e;
|
|
32
|
+
var n = e[Symbol.toPrimitive];
|
|
33
|
+
if (n !== void 0) {
|
|
34
|
+
var r = n.call(e, t || "default");
|
|
35
|
+
if (typeof r != "object") return r;
|
|
36
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
37
|
+
}
|
|
38
|
+
return (t === "string" ? String : Number)(e);
|
|
39
|
+
}
|
|
40
|
+
function Ve(e) {
|
|
41
|
+
var t = Be(e, "string");
|
|
42
|
+
return typeof t == "symbol" ? t : String(t);
|
|
43
|
+
}
|
|
44
|
+
function He(e, t, n) {
|
|
45
|
+
return t = Ve(t), t in e ? Object.defineProperty(e, t, {
|
|
46
|
+
value: n,
|
|
47
|
+
enumerable: !0,
|
|
48
|
+
configurable: !0,
|
|
49
|
+
writable: !0
|
|
50
|
+
}) : e[t] = n, e;
|
|
51
|
+
}
|
|
52
|
+
function Ue(e, t) {
|
|
53
|
+
var n = Object.keys(e);
|
|
54
|
+
if (Object.getOwnPropertySymbols) {
|
|
55
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
56
|
+
t && (r = r.filter(function(t) {
|
|
57
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
58
|
+
})), n.push.apply(n, r);
|
|
59
|
+
}
|
|
60
|
+
return n;
|
|
61
|
+
}
|
|
62
|
+
function We(e) {
|
|
63
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
64
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
65
|
+
t % 2 ? Ue(Object(n), !0).forEach(function(t) {
|
|
66
|
+
He(e, t, n[t]);
|
|
67
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ue(Object(n)).forEach(function(t) {
|
|
68
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return e;
|
|
72
|
+
}
|
|
73
|
+
function Ge(e, t) {
|
|
74
|
+
var n = {};
|
|
75
|
+
for (var r in e) n[r] = t(e[r], r);
|
|
76
|
+
return n;
|
|
77
|
+
}
|
|
78
|
+
var Ke = (e, t, n) => {
|
|
79
|
+
for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
|
|
80
|
+
return !0;
|
|
81
|
+
}, j = (e) => {
|
|
82
|
+
var t = (t) => {
|
|
83
|
+
var n = e.defaultClassName, r = We(We({}, e.defaultVariants), t);
|
|
84
|
+
for (var i in r) {
|
|
85
|
+
var a = r[i] ?? e.defaultVariants[i];
|
|
86
|
+
if (a != null) {
|
|
87
|
+
var o = a;
|
|
88
|
+
typeof o == "boolean" && (o = o === !0 ? "true" : "false");
|
|
89
|
+
var s = e.variantClassNames[i][o];
|
|
90
|
+
s && (n += " " + s);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (var [c, l] of e.compoundVariants) Ke(c, r, e.defaultVariants) && (n += " " + l);
|
|
94
|
+
return n;
|
|
95
|
+
};
|
|
96
|
+
return t.variants = () => Object.keys(e.variantClassNames), t.classNames = {
|
|
97
|
+
get base() {
|
|
98
|
+
return e.defaultClassName.split(" ")[0];
|
|
99
|
+
},
|
|
100
|
+
get variants() {
|
|
101
|
+
return Ge(e.variantClassNames, (e) => Ge(e, (e) => e.split(" ")[0]));
|
|
102
|
+
}
|
|
103
|
+
}, t;
|
|
104
|
+
}, qe = "_7hazmf0", Je = "_7hazmf1", Ye = "_7hazmf2", Xe = j({
|
|
105
|
+
defaultClassName: "_7hazmf3",
|
|
106
|
+
variantClassNames: { expanded: {
|
|
107
|
+
true: "_7hazmf4",
|
|
108
|
+
false: "_7hazmf5"
|
|
109
|
+
} },
|
|
110
|
+
defaultVariants: { expanded: !1 },
|
|
111
|
+
compoundVariants: []
|
|
112
|
+
}), Ze = j({
|
|
113
|
+
defaultClassName: "_7hazmf6",
|
|
114
|
+
variantClassNames: { expanded: {
|
|
115
|
+
true: "_7hazmf7",
|
|
116
|
+
false: "_7hazmf8"
|
|
117
|
+
} },
|
|
118
|
+
defaultVariants: { expanded: !1 },
|
|
119
|
+
compoundVariants: []
|
|
120
|
+
}), Qe = "_7hazmf9", $e = "_7hazmfa", et = "_7hazmfb", tt = j({
|
|
121
|
+
defaultClassName: "_7hazmfc",
|
|
122
|
+
variantClassNames: { expanded: {
|
|
123
|
+
true: "_7hazmfd",
|
|
124
|
+
false: "_7hazmfe"
|
|
125
|
+
} },
|
|
126
|
+
defaultVariants: { expanded: !1 },
|
|
127
|
+
compoundVariants: []
|
|
128
|
+
}), M = [
|
|
129
|
+
"success",
|
|
130
|
+
"warning",
|
|
131
|
+
"danger",
|
|
132
|
+
"info",
|
|
133
|
+
"neutral"
|
|
134
|
+
], nt = {
|
|
135
|
+
success: x.semantic.BackgroundColorSuccessSubdued.value,
|
|
136
|
+
warning: x.semantic.BackgroundColorWarningSubdued.value,
|
|
137
|
+
danger: x.semantic.BackgroundColorDangerSubdued.value,
|
|
138
|
+
info: x.semantic.BackgroundColorPrimarySubdued.value,
|
|
139
|
+
neutral: x.semantic.BackgroundColorSecondary.value
|
|
140
|
+
};
|
|
141
|
+
function rt(e = "neutral") {
|
|
142
|
+
return nt[e];
|
|
143
|
+
}
|
|
144
|
+
var it = {
|
|
145
|
+
success: x.semantic.BackgroundColorSuccess.value,
|
|
146
|
+
warning: x.semantic.BackgroundColorWarning.value,
|
|
147
|
+
danger: x.semantic.ForegroundColorDanger.value,
|
|
148
|
+
info: x.semantic.ForegroundColorPrimary.value,
|
|
149
|
+
neutral: void 0
|
|
150
|
+
};
|
|
151
|
+
function N(e) {
|
|
152
|
+
return it[e];
|
|
153
|
+
}
|
|
154
|
+
function at(e) {
|
|
155
|
+
if (e == null || e === "") return null;
|
|
156
|
+
if (typeof e == "object" && e && "label" in e) {
|
|
157
|
+
let t = e;
|
|
158
|
+
return {
|
|
159
|
+
label: t.label,
|
|
160
|
+
tone: t.tone ?? "neutral"
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return typeof e == "string" ? {
|
|
164
|
+
label: e,
|
|
165
|
+
tone: "neutral"
|
|
166
|
+
} : {
|
|
167
|
+
label: String(e),
|
|
168
|
+
tone: "neutral"
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/context/components/collapsible-card.tsx
|
|
173
|
+
function ot({ badge: e }) {
|
|
174
|
+
return typeof e == "number" ? /* @__PURE__ */ S(o, {
|
|
175
|
+
label: String(e),
|
|
176
|
+
size: "small",
|
|
177
|
+
style: { marginTop: "2px" }
|
|
178
|
+
}) : /* @__PURE__ */ S(o, {
|
|
179
|
+
label: e.label,
|
|
180
|
+
size: "small",
|
|
181
|
+
color: rt(e.tone ?? "neutral"),
|
|
182
|
+
style: { marginTop: "2px" }
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
var st = ({ title: e, badge: t, defaultExpanded: n = !0, children: r }) => {
|
|
186
|
+
let [i, a] = b(n), [o, s] = b(n), c = me();
|
|
187
|
+
return /* @__PURE__ */ S("div", {
|
|
188
|
+
className: qe,
|
|
189
|
+
children: /* @__PURE__ */ S(m, {
|
|
190
|
+
padding: "base",
|
|
191
|
+
content: /* @__PURE__ */ C("div", {
|
|
192
|
+
className: Ye,
|
|
193
|
+
children: [/* @__PURE__ */ S(h, {
|
|
194
|
+
variant: "headline",
|
|
195
|
+
el: "h3",
|
|
196
|
+
size: "substantial",
|
|
197
|
+
text: /* @__PURE__ */ C("button", {
|
|
198
|
+
type: "button",
|
|
199
|
+
"aria-expanded": i,
|
|
200
|
+
"aria-controls": c,
|
|
201
|
+
onClick: () => {
|
|
202
|
+
a((e) => {
|
|
203
|
+
let t = !e;
|
|
204
|
+
return t && s(!0), t;
|
|
205
|
+
});
|
|
206
|
+
},
|
|
207
|
+
className: Qe,
|
|
208
|
+
children: [/* @__PURE__ */ C("span", {
|
|
209
|
+
className: $e,
|
|
210
|
+
children: [/* @__PURE__ */ S("span", {
|
|
211
|
+
className: et,
|
|
212
|
+
children: e
|
|
213
|
+
}), t == null ? null : /* @__PURE__ */ S(ot, { badge: t })]
|
|
214
|
+
}), /* @__PURE__ */ S(de, { className: tt({ expanded: i }) })]
|
|
215
|
+
})
|
|
216
|
+
}), /* @__PURE__ */ S("div", {
|
|
217
|
+
className: Xe({ expanded: i }),
|
|
218
|
+
onTransitionEnd: (e) => {
|
|
219
|
+
e.propertyName !== "grid-template-rows" || i || s(!1);
|
|
220
|
+
},
|
|
221
|
+
children: /* @__PURE__ */ S("div", {
|
|
222
|
+
className: Ze({ expanded: i }),
|
|
223
|
+
children: /* @__PURE__ */ S("div", {
|
|
224
|
+
id: c,
|
|
225
|
+
className: Je,
|
|
226
|
+
"aria-hidden": !i,
|
|
227
|
+
children: o ? r : null
|
|
228
|
+
})
|
|
229
|
+
})
|
|
230
|
+
})]
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
});
|
|
234
|
+
}, ct = w.object({
|
|
235
|
+
label: w.string(),
|
|
236
|
+
tone: w.enum(M).optional()
|
|
237
|
+
}), lt = w.union([w.number().int().nonnegative(), ct]), ut = {
|
|
238
|
+
props: w.object({
|
|
239
|
+
title: w.string(),
|
|
240
|
+
defaultExpanded: w.boolean().optional(),
|
|
241
|
+
badge: lt.optional()
|
|
242
|
+
}),
|
|
243
|
+
slots: ["default"],
|
|
244
|
+
description: "Collapsible card for the Context panel. Each card holds a single content component as its body. Optional badge shows a count (number) or status label ({ label, tone? }) in the card header. Use defaultExpanded: false to start collapsed."
|
|
245
|
+
}, dt = ({ props: e, children: t }) => /* @__PURE__ */ S(st, {
|
|
246
|
+
title: e.title,
|
|
247
|
+
...e.badge == null ? {} : { badge: e.badge },
|
|
248
|
+
defaultExpanded: e.defaultExpanded ?? !0,
|
|
249
|
+
children: t
|
|
250
|
+
}), ft = w.object({
|
|
251
|
+
label: w.string(),
|
|
252
|
+
tone: w.enum(M).optional()
|
|
253
|
+
}), pt = w.union([
|
|
254
|
+
w.string(),
|
|
255
|
+
w.number(),
|
|
256
|
+
w.null(),
|
|
257
|
+
ft
|
|
258
|
+
]), mt = w.object({
|
|
259
|
+
key: w.string(),
|
|
260
|
+
header: w.string(),
|
|
261
|
+
type: w.enum([
|
|
262
|
+
"text",
|
|
263
|
+
"currency",
|
|
264
|
+
"chip",
|
|
265
|
+
"delta"
|
|
266
|
+
]).optional(),
|
|
267
|
+
sortable: w.boolean().optional()
|
|
268
|
+
}), ht = w.record(w.string(), pt).and(w.object({ id: w.string() })), gt = {
|
|
269
|
+
props: w.object({
|
|
270
|
+
columns: w.array(mt),
|
|
271
|
+
rows: w.array(ht),
|
|
272
|
+
defaultSortedColumn: w.object({
|
|
273
|
+
id: w.string(),
|
|
274
|
+
desc: w.boolean().optional()
|
|
275
|
+
}).optional()
|
|
276
|
+
}),
|
|
277
|
+
slots: [],
|
|
278
|
+
description: "Read-only DataTable for context cards. Column type: text (default), currency, chip, or delta. Chip cells: plain string (neutral tone) or { label, tone } where tone is success | warning | danger | info | neutral. Delta cells: signed string ('+5%', '-3%') or null — positive renders danger-red, negative renders success-green, null renders '–'. Rows must include id."
|
|
279
|
+
}, _t = "_1b4fiav0", vt = "_1b4fiav1";
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/context/catalog/context-data-table.tsx
|
|
282
|
+
function yt(e) {
|
|
283
|
+
if (e == null || e === "" || e === "–" || e === "0" || e === "0%") return {
|
|
284
|
+
text: "–",
|
|
285
|
+
sign: "none"
|
|
286
|
+
};
|
|
287
|
+
let t = String(e).trim();
|
|
288
|
+
return t.startsWith("+") || !t.startsWith("-") && parseFloat(t) > 0 ? {
|
|
289
|
+
text: t,
|
|
290
|
+
sign: "positive"
|
|
291
|
+
} : t.startsWith("-") || parseFloat(t) < 0 ? {
|
|
292
|
+
text: t,
|
|
293
|
+
sign: "negative"
|
|
294
|
+
} : {
|
|
295
|
+
text: t,
|
|
296
|
+
sign: "none"
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
var bt = ({ props: e }) => /* @__PURE__ */ S("div", {
|
|
300
|
+
className: _t,
|
|
301
|
+
children: /* @__PURE__ */ S(ge, {
|
|
302
|
+
columns: v(() => {
|
|
303
|
+
let t = _e();
|
|
304
|
+
return e.columns.map((e) => t(e.key, {
|
|
305
|
+
header: { label: e.header },
|
|
306
|
+
...e.sortable ? { sortable: !0 } : {},
|
|
307
|
+
...e.type === "currency" ? { type: "currency" } : {},
|
|
308
|
+
...e.type === "chip" ? { renderCell: (e) => {
|
|
309
|
+
let t = at(e);
|
|
310
|
+
return t ? /* @__PURE__ */ S(o, {
|
|
311
|
+
label: t.label,
|
|
312
|
+
size: "small",
|
|
313
|
+
color: rt(t.tone)
|
|
314
|
+
}) : null;
|
|
315
|
+
} } : {},
|
|
316
|
+
...e.type === "delta" ? { renderCell: (e) => {
|
|
317
|
+
let { text: t, sign: n } = yt(e), r = n === "positive" ? N("danger") : n === "negative" ? N("success") : void 0;
|
|
318
|
+
return /* @__PURE__ */ S("span", {
|
|
319
|
+
className: vt,
|
|
320
|
+
style: r ? { color: r } : void 0,
|
|
321
|
+
children: t
|
|
322
|
+
});
|
|
323
|
+
} } : {}
|
|
324
|
+
}));
|
|
325
|
+
}, [e.columns]),
|
|
326
|
+
data: v(() => e.rows.map((e) => ({ ...e })), [e.rows]),
|
|
327
|
+
isSelectable: !1,
|
|
328
|
+
...e.defaultSortedColumn ? { defaultSortedColumn: {
|
|
329
|
+
id: e.defaultSortedColumn.id,
|
|
330
|
+
desc: e.defaultSortedColumn.desc ?? !1
|
|
331
|
+
} } : {}
|
|
332
|
+
})
|
|
333
|
+
}), xt = w.object({
|
|
334
|
+
label: w.string(),
|
|
335
|
+
url: w.string()
|
|
336
|
+
}), St = {
|
|
337
|
+
props: w.object({ items: w.array(xt) }),
|
|
338
|
+
slots: [],
|
|
339
|
+
description: "Vertical list of file attachments and documents. Each row shows a color-coded file-type icon (inferred from the extension: pdf, xlsx/csv, doc/docx, image, or generic) and the filename. Clicking a row opens a preview dialog. Image files render from url; other files show a large icon and a Download footer action. Use for Completed Forms and Attachments sections."
|
|
340
|
+
}, Ct = "_1afcqze0", wt = "_1afcqze1", Tt = "_1afcqze2", Et = "_1afcqze3", Dt = "_1afcqze4", Ot = "_1afcqze5", kt = "_1afcqze6", At = "_1afcqze7", jt = "_1afcqze8";
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region src/context/catalog/context-file-list.tsx
|
|
343
|
+
function Mt(e) {
|
|
344
|
+
let t = e.toLowerCase();
|
|
345
|
+
return t.endsWith(".pdf") ? "pdf" : /\.(xlsx|xls|csv|numbers)$/.test(t) ? "spreadsheet" : /\.(doc|docx|pages)$/.test(t) ? /form/i.test(t.replace(/\.[^.]+$/, "")) ? "form" : "doc" : /\.(txt|rtf|md)$/.test(t) ? "text" : /\.(mp3|wav|aac|m4a|flac|ogg)$/.test(t) ? "audio" : /\.(jpg|jpeg|png|gif|webp|heic|svg)$/.test(t) ? "image" : /form/i.test(t.replace(/\.[^.]+$/, "")) ? "form" : "generic";
|
|
346
|
+
}
|
|
347
|
+
var Nt = {
|
|
348
|
+
pdf: {
|
|
349
|
+
svg: Ce,
|
|
350
|
+
color: "#DC2626"
|
|
351
|
+
},
|
|
352
|
+
spreadsheet: {
|
|
353
|
+
svg: we,
|
|
354
|
+
color: "#16A34A"
|
|
355
|
+
},
|
|
356
|
+
doc: {
|
|
357
|
+
svg: be,
|
|
358
|
+
color: "#2563EB"
|
|
359
|
+
},
|
|
360
|
+
text: {
|
|
361
|
+
svg: Te,
|
|
362
|
+
color: "#6B7280"
|
|
363
|
+
},
|
|
364
|
+
form: {
|
|
365
|
+
svg: xe,
|
|
366
|
+
color: "#2563EB"
|
|
367
|
+
},
|
|
368
|
+
audio: {
|
|
369
|
+
svg: ye,
|
|
370
|
+
color: "#6B7280"
|
|
371
|
+
},
|
|
372
|
+
image: {
|
|
373
|
+
svg: ve,
|
|
374
|
+
color: "#374151"
|
|
375
|
+
},
|
|
376
|
+
generic: {
|
|
377
|
+
svg: Se,
|
|
378
|
+
color: "#6B7280"
|
|
379
|
+
}
|
|
380
|
+
}, Pt = { "--a2-mod-icon-font-size": "80px" };
|
|
381
|
+
function Ft({ kind: e }) {
|
|
382
|
+
let { svg: t, color: n } = Nt[e];
|
|
383
|
+
return /* @__PURE__ */ S("div", {
|
|
384
|
+
className: Et,
|
|
385
|
+
"aria-hidden": "true",
|
|
386
|
+
children: /* @__PURE__ */ S(d, {
|
|
387
|
+
svg: t,
|
|
388
|
+
size: "medium",
|
|
389
|
+
color: n
|
|
390
|
+
})
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
function It(e, t) {
|
|
394
|
+
let n = document.createElement("a");
|
|
395
|
+
n.href = e, n.download = t, n.target = "_blank", n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), n.remove();
|
|
396
|
+
}
|
|
397
|
+
function Lt({ label: e }) {
|
|
398
|
+
return /* @__PURE__ */ S(h, {
|
|
399
|
+
variant: "body",
|
|
400
|
+
size: "regular",
|
|
401
|
+
text: e,
|
|
402
|
+
className: jt
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
function Rt({ item: e, kind: t }) {
|
|
406
|
+
let { svg: n, color: r } = Nt[t];
|
|
407
|
+
return /* @__PURE__ */ C("div", {
|
|
408
|
+
className: Dt,
|
|
409
|
+
children: [/* @__PURE__ */ S("div", {
|
|
410
|
+
className: Ot,
|
|
411
|
+
children: t === "image" ? /* @__PURE__ */ S("img", {
|
|
412
|
+
src: e.url,
|
|
413
|
+
alt: e.label,
|
|
414
|
+
className: kt
|
|
415
|
+
}) : /* @__PURE__ */ S("div", {
|
|
416
|
+
className: At,
|
|
417
|
+
children: /* @__PURE__ */ S(d, {
|
|
418
|
+
svg: n,
|
|
419
|
+
color: r,
|
|
420
|
+
style: Pt
|
|
421
|
+
})
|
|
422
|
+
})
|
|
423
|
+
}), /* @__PURE__ */ S(Lt, { label: e.label })]
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
function zt({ item: e, onPreview: t }) {
|
|
427
|
+
let n = Mt(e.label);
|
|
428
|
+
return /* @__PURE__ */ S(m, {
|
|
429
|
+
className: wt,
|
|
430
|
+
padding: "snug",
|
|
431
|
+
onPress: t,
|
|
432
|
+
label: `Preview ${e.label}`,
|
|
433
|
+
content: /* @__PURE__ */ C("div", {
|
|
434
|
+
className: Tt,
|
|
435
|
+
children: [/* @__PURE__ */ S(Ft, { kind: n }), /* @__PURE__ */ S(h, {
|
|
436
|
+
variant: "body",
|
|
437
|
+
size: "compact",
|
|
438
|
+
text: e.label
|
|
439
|
+
})]
|
|
440
|
+
})
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
function Bt({ item: e }) {
|
|
444
|
+
let [t, n] = b(!1), r = Mt(e.label);
|
|
445
|
+
return /* @__PURE__ */ C(he, { children: [/* @__PURE__ */ S(zt, {
|
|
446
|
+
item: e,
|
|
447
|
+
onPreview: () => n(!0)
|
|
448
|
+
}), /* @__PURE__ */ S(le, {
|
|
449
|
+
title: "View Attachment",
|
|
450
|
+
content: /* @__PURE__ */ S(Rt, {
|
|
451
|
+
item: e,
|
|
452
|
+
kind: r
|
|
453
|
+
}),
|
|
454
|
+
isOpen: t,
|
|
455
|
+
onOpenChange: n,
|
|
456
|
+
...r === "image" ? {} : { primaryAction: {
|
|
457
|
+
label: "Download",
|
|
458
|
+
onPress: () => It(e.url, e.label)
|
|
459
|
+
} }
|
|
460
|
+
})] });
|
|
461
|
+
}
|
|
462
|
+
var Vt = ({ props: e }) => /* @__PURE__ */ S("div", {
|
|
463
|
+
className: Ct,
|
|
464
|
+
children: e.items.map((e, t) => /* @__PURE__ */ S(Bt, { item: e }, `${e.label}-${t}`))
|
|
465
|
+
}), Ht = w.object({
|
|
466
|
+
title: w.string(),
|
|
467
|
+
identifier: w.string().optional(),
|
|
468
|
+
identifierHref: w.string().optional(),
|
|
469
|
+
meta: w.string().optional(),
|
|
470
|
+
callout: w.string().optional(),
|
|
471
|
+
calloutTone: w.enum(M).optional(),
|
|
472
|
+
calloutLabel: w.string().optional()
|
|
473
|
+
}), Ut = {
|
|
474
|
+
props: w.object({ items: w.array(Ht) }),
|
|
475
|
+
slots: [],
|
|
476
|
+
description: "Flat list for timesheets and recent jobs. Each item has a required title, optional identifier link + meta on the left, and optional callout + calloutLabel on the right. For grouped procurement records with aligned columns, use ContextTabularList instead."
|
|
477
|
+
}, Wt = "blgld0", Gt = "blgld1", Kt = "blgld2", qt = "blgld3", Jt = "blgld4", Yt = "blgld5", Xt = "blgld6", Zt = "blgld7";
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/context/catalog/context-list.tsx
|
|
480
|
+
function Qt({ item: e }) {
|
|
481
|
+
let t = e.calloutTone ? N(e.calloutTone) : void 0, n = e.identifier, r = e.callout != null || e.calloutLabel != null;
|
|
482
|
+
return /* @__PURE__ */ C("div", {
|
|
483
|
+
className: qt,
|
|
484
|
+
children: [/* @__PURE__ */ C("div", {
|
|
485
|
+
className: Jt,
|
|
486
|
+
children: [/* @__PURE__ */ C("div", {
|
|
487
|
+
className: Yt,
|
|
488
|
+
children: [
|
|
489
|
+
n && e.identifierHref ? /* @__PURE__ */ S(ue, {
|
|
490
|
+
href: e.identifierHref,
|
|
491
|
+
target: "_blank",
|
|
492
|
+
text: n
|
|
493
|
+
}) : n ? /* @__PURE__ */ S(h, {
|
|
494
|
+
variant: "body",
|
|
495
|
+
size: "compact",
|
|
496
|
+
text: n
|
|
497
|
+
}) : null,
|
|
498
|
+
n ? /* @__PURE__ */ S("span", {
|
|
499
|
+
"aria-hidden": "true",
|
|
500
|
+
className: Xt
|
|
501
|
+
}) : null,
|
|
502
|
+
/* @__PURE__ */ S(h, {
|
|
503
|
+
variant: "body",
|
|
504
|
+
size: "regular",
|
|
505
|
+
text: e.title
|
|
506
|
+
})
|
|
507
|
+
]
|
|
508
|
+
}), e.meta ? /* @__PURE__ */ S(h, {
|
|
509
|
+
variant: "body",
|
|
510
|
+
size: "fine",
|
|
511
|
+
text: e.meta,
|
|
512
|
+
className: Gt
|
|
513
|
+
}) : null]
|
|
514
|
+
}), r ? /* @__PURE__ */ C("div", {
|
|
515
|
+
className: Zt,
|
|
516
|
+
children: [e.callout ? /* @__PURE__ */ S(h, {
|
|
517
|
+
variant: "headline",
|
|
518
|
+
el: "h6",
|
|
519
|
+
size: "regular",
|
|
520
|
+
text: e.callout,
|
|
521
|
+
...t ? { style: { color: t } } : {}
|
|
522
|
+
}) : null, e.calloutLabel ? /* @__PURE__ */ S(h, {
|
|
523
|
+
variant: "eyebrow",
|
|
524
|
+
text: e.calloutLabel,
|
|
525
|
+
className: Gt
|
|
526
|
+
}) : null]
|
|
527
|
+
}) : null]
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
var $t = ({ props: e }) => /* @__PURE__ */ S("div", {
|
|
531
|
+
className: Wt,
|
|
532
|
+
children: e.items.map((e, t) => /* @__PURE__ */ S("div", {
|
|
533
|
+
className: Kt,
|
|
534
|
+
children: /* @__PURE__ */ S(Qt, { item: e })
|
|
535
|
+
}, e.identifier ?? e.title ?? t))
|
|
536
|
+
}), en = w.object({
|
|
537
|
+
label: w.string(),
|
|
538
|
+
value: w.string(),
|
|
539
|
+
tone: w.enum(M).optional()
|
|
540
|
+
}), tn = {
|
|
541
|
+
props: w.object({
|
|
542
|
+
items: w.array(en),
|
|
543
|
+
columns: w.enum(["3", "4"]).optional()
|
|
544
|
+
}),
|
|
545
|
+
slots: [],
|
|
546
|
+
description: "KPI grid with label and value pairs. Optional columns: 3 (default) or 4. Each item supports an optional tone (danger | warning | success | info | neutral) to color the value text."
|
|
547
|
+
}, nn = j({
|
|
548
|
+
defaultClassName: "_16tl57e0",
|
|
549
|
+
variantClassNames: { columns: {
|
|
550
|
+
3: "_16tl57e1",
|
|
551
|
+
4: "_16tl57e2"
|
|
552
|
+
} },
|
|
553
|
+
defaultVariants: { columns: "3" },
|
|
554
|
+
compoundVariants: []
|
|
555
|
+
}), rn = "_16tl57e3", an = "_16tl57e4", on = ({ props: e }) => /* @__PURE__ */ S("div", {
|
|
556
|
+
className: nn({ columns: e.columns === "4" ? "4" : "3" }),
|
|
557
|
+
children: e.items.map((e) => {
|
|
558
|
+
let t = e.tone ? N(e.tone) : void 0;
|
|
559
|
+
return /* @__PURE__ */ C("div", {
|
|
560
|
+
className: an,
|
|
561
|
+
children: [/* @__PURE__ */ S(h, {
|
|
562
|
+
variant: "eyebrow",
|
|
563
|
+
text: e.label.toUpperCase(),
|
|
564
|
+
className: rn
|
|
565
|
+
}), /* @__PURE__ */ S(h, {
|
|
566
|
+
variant: "headline",
|
|
567
|
+
el: "h6",
|
|
568
|
+
size: "regular",
|
|
569
|
+
text: e.value,
|
|
570
|
+
...t ? { style: { color: t } } : {}
|
|
571
|
+
})]
|
|
572
|
+
}, e.label);
|
|
573
|
+
})
|
|
574
|
+
}), sn = "_2pn4ri0", cn = ({ summary: e }) => /* @__PURE__ */ S("div", {
|
|
575
|
+
className: sn,
|
|
576
|
+
"data-carto": "context-ai-summary",
|
|
577
|
+
children: /* @__PURE__ */ S(m, {
|
|
578
|
+
highlighted: !0,
|
|
579
|
+
padding: "snug",
|
|
580
|
+
role: "status",
|
|
581
|
+
style: { width: "100%" },
|
|
582
|
+
content: /* @__PURE__ */ S(h, {
|
|
583
|
+
variant: "body",
|
|
584
|
+
size: "regular",
|
|
585
|
+
text: e
|
|
586
|
+
})
|
|
587
|
+
})
|
|
588
|
+
}), ln = "_4l9lye0", un = "_4l9lye1", dn = "_4l9lye2", fn = "_4l9lye3", P = "_4l9lye4", pn = w.object({
|
|
589
|
+
category: w.string().optional(),
|
|
590
|
+
body: w.string(),
|
|
591
|
+
author: w.string().optional(),
|
|
592
|
+
date: w.string().optional(),
|
|
593
|
+
truncate: w.boolean().optional()
|
|
594
|
+
}), mn = {
|
|
595
|
+
props: w.object({
|
|
596
|
+
summary: w.string().optional(),
|
|
597
|
+
items: w.array(pn)
|
|
598
|
+
}),
|
|
599
|
+
slots: [],
|
|
600
|
+
description: "Notes & Summaries list. Optional summary renders an AI-highlighted box at the top. Each item shows an optional category eyebrow (e.g. 'JOB SUMMARY'), body text, and optional author + date at top-right. Set truncate: true on long items to clamp to ~3 lines with an inline More/Less expand."
|
|
601
|
+
};
|
|
602
|
+
//#endregion
|
|
603
|
+
//#region src/context/catalog/context-note-list.tsx
|
|
604
|
+
function hn({ item: e }) {
|
|
605
|
+
return /* @__PURE__ */ C("div", {
|
|
606
|
+
className: dn,
|
|
607
|
+
children: [e.category || e.author || e.date ? /* @__PURE__ */ C("div", {
|
|
608
|
+
className: fn,
|
|
609
|
+
children: [e.category ? /* @__PURE__ */ S(h, {
|
|
610
|
+
variant: "eyebrow",
|
|
611
|
+
text: e.category,
|
|
612
|
+
className: P
|
|
613
|
+
}) : /* @__PURE__ */ S("span", {}), e.author || e.date ? /* @__PURE__ */ S(h, {
|
|
614
|
+
variant: "eyebrow",
|
|
615
|
+
text: [e.author, e.date].filter(Boolean).join(" · "),
|
|
616
|
+
className: P
|
|
617
|
+
}) : null]
|
|
618
|
+
}) : null, e.truncate ? /* @__PURE__ */ S(te, {
|
|
619
|
+
rows: 3,
|
|
620
|
+
expandable: !0,
|
|
621
|
+
expandText: "More",
|
|
622
|
+
collapseText: "Less",
|
|
623
|
+
children: e.body
|
|
624
|
+
}) : /* @__PURE__ */ S(h, {
|
|
625
|
+
variant: "body",
|
|
626
|
+
size: "regular",
|
|
627
|
+
text: e.body
|
|
628
|
+
})]
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
var gn = ({ props: e }) => /* @__PURE__ */ C("div", {
|
|
632
|
+
className: ln,
|
|
633
|
+
children: [e.summary ? /* @__PURE__ */ S("div", {
|
|
634
|
+
className: un,
|
|
635
|
+
children: /* @__PURE__ */ S(cn, { summary: e.summary })
|
|
636
|
+
}) : null, e.items.map((e, t) => /* @__PURE__ */ S(hn, { item: e }, `${e.category ?? ""}-${t}`))]
|
|
637
|
+
}), _n = {
|
|
638
|
+
props: w.object({ summary: w.string() }),
|
|
639
|
+
slots: [],
|
|
640
|
+
description: "AI-generated overview summary for the Context panel. Optional first child of ContextPanel. Renders as a plain section (not a card): Overview headline with sparkle icon and body text. Leaf node — no children."
|
|
641
|
+
}, vn = "_1ysu3qn0", yn = "_1ysu3qn1", bn = ({ props: t }) => /* @__PURE__ */ C("section", {
|
|
642
|
+
className: vn,
|
|
643
|
+
children: [/* @__PURE__ */ C("div", {
|
|
644
|
+
className: yn,
|
|
645
|
+
children: [/* @__PURE__ */ S(h, {
|
|
646
|
+
variant: "headline",
|
|
647
|
+
el: "h2",
|
|
648
|
+
size: "substantial",
|
|
649
|
+
text: "Overview"
|
|
650
|
+
}), /* @__PURE__ */ S(e, {
|
|
651
|
+
size: "small",
|
|
652
|
+
type: "gradient"
|
|
653
|
+
})]
|
|
654
|
+
}), /* @__PURE__ */ S(h, {
|
|
655
|
+
variant: "body",
|
|
656
|
+
size: "regular",
|
|
657
|
+
text: t.summary
|
|
658
|
+
})]
|
|
659
|
+
}), xn = {
|
|
660
|
+
props: w.object({}),
|
|
661
|
+
slots: ["default"],
|
|
662
|
+
description: "Root container for the Context panel. MUST be the spec root. Children MUST only be ContextOverview (optional, first) followed by one or more ContextCard components."
|
|
663
|
+
}, F = "_19nljxi0", Sn = ({ children: e }) => /* @__PURE__ */ S("div", {
|
|
664
|
+
className: F,
|
|
665
|
+
children: g.toArray(e).filter(Boolean)
|
|
666
|
+
}), Cn = w.object({
|
|
667
|
+
label: w.string(),
|
|
668
|
+
value: w.string()
|
|
669
|
+
}), wn = w.object({
|
|
670
|
+
eyebrow: w.string().optional(),
|
|
671
|
+
identifier: w.string().optional(),
|
|
672
|
+
identifierHref: w.string().optional(),
|
|
673
|
+
fields: w.array(Cn)
|
|
674
|
+
}), Tn = w.object({
|
|
675
|
+
label: w.string(),
|
|
676
|
+
items: w.array(wn)
|
|
677
|
+
}), En = {
|
|
678
|
+
props: w.object({ groups: w.array(Tn) }),
|
|
679
|
+
slots: [],
|
|
680
|
+
description: "Grouped tabular list for procurement-style records. Each group has a vendor label and rows with an optional eyebrow + identifier in the first column and additional label/value field columns (e.g. DATE, AMOUNT). Use inside ContextCard for Procurement sections."
|
|
681
|
+
}, Dn = "_5kl5rv0", On = "_5kl5rv1", kn = "_5kl5rv2", I = "_5kl5rv3", An = "_5kl5rv4", jn = "_5kl5rv5", Mn = "_5kl5rv6";
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region src/context/catalog/context-tabular-list.tsx
|
|
684
|
+
function Nn(e) {
|
|
685
|
+
let t = e + 1;
|
|
686
|
+
if (t <= 1) return "max-content";
|
|
687
|
+
let n = `minmax(${Ee.size[400]}, 1fr)`;
|
|
688
|
+
return Array(t).fill("max-content").join(` ${n} `);
|
|
689
|
+
}
|
|
690
|
+
function Pn(e) {
|
|
691
|
+
return e * 2 + 1;
|
|
692
|
+
}
|
|
693
|
+
function Fn({ item: e, gridRow: t }) {
|
|
694
|
+
let n = (e) => ({
|
|
695
|
+
style: {
|
|
696
|
+
gridColumn: Pn(e),
|
|
697
|
+
gridRow: t
|
|
698
|
+
},
|
|
699
|
+
className: Mn
|
|
700
|
+
});
|
|
701
|
+
return /* @__PURE__ */ C(he, { children: [/* @__PURE__ */ C("div", {
|
|
702
|
+
...n(0),
|
|
703
|
+
children: [e.eyebrow ? /* @__PURE__ */ S(h, {
|
|
704
|
+
variant: "eyebrow",
|
|
705
|
+
text: e.eyebrow,
|
|
706
|
+
className: I
|
|
707
|
+
}) : null, e.identifier && e.identifierHref ? /* @__PURE__ */ S(ue, {
|
|
708
|
+
href: e.identifierHref,
|
|
709
|
+
target: "_blank",
|
|
710
|
+
text: e.identifier
|
|
711
|
+
}) : e.identifier ? /* @__PURE__ */ S(h, {
|
|
712
|
+
variant: "body",
|
|
713
|
+
size: "compact",
|
|
714
|
+
text: e.identifier
|
|
715
|
+
}) : null]
|
|
716
|
+
}), e.fields.map((e, t) => /* @__PURE__ */ C("div", {
|
|
717
|
+
...n(t + 1),
|
|
718
|
+
children: [/* @__PURE__ */ S(h, {
|
|
719
|
+
variant: "eyebrow",
|
|
720
|
+
text: e.label,
|
|
721
|
+
className: I
|
|
722
|
+
}), /* @__PURE__ */ S(h, {
|
|
723
|
+
variant: "body",
|
|
724
|
+
size: "compact",
|
|
725
|
+
text: e.value
|
|
726
|
+
})]
|
|
727
|
+
}, e.label))] });
|
|
728
|
+
}
|
|
729
|
+
var In = ({ props: e }) => /* @__PURE__ */ S("div", {
|
|
730
|
+
className: Dn,
|
|
731
|
+
children: e.groups.map((e) => {
|
|
732
|
+
let t = e.items[0]?.fields.length ?? 0;
|
|
733
|
+
return /* @__PURE__ */ C("div", {
|
|
734
|
+
className: On,
|
|
735
|
+
children: [/* @__PURE__ */ S("div", {
|
|
736
|
+
className: kn,
|
|
737
|
+
children: /* @__PURE__ */ S(h, {
|
|
738
|
+
variant: "headline",
|
|
739
|
+
el: "h5",
|
|
740
|
+
size: "regular",
|
|
741
|
+
text: e.label
|
|
742
|
+
})
|
|
743
|
+
}), /* @__PURE__ */ S("div", {
|
|
744
|
+
className: An,
|
|
745
|
+
style: { gridTemplateColumns: Nn(t) },
|
|
746
|
+
children: e.items.map((e, t) => {
|
|
747
|
+
let n = t * 2 + 1;
|
|
748
|
+
return /* @__PURE__ */ C(pe, { children: [t > 0 ? /* @__PURE__ */ S("div", {
|
|
749
|
+
className: jn,
|
|
750
|
+
style: { gridRow: t * 2 }
|
|
751
|
+
}) : null, /* @__PURE__ */ S(Fn, {
|
|
752
|
+
item: e,
|
|
753
|
+
gridRow: n
|
|
754
|
+
})] }, e.identifier ?? e.eyebrow ?? t);
|
|
755
|
+
})
|
|
756
|
+
})]
|
|
757
|
+
}, e.label);
|
|
758
|
+
})
|
|
759
|
+
}), L = {
|
|
760
|
+
ContextPanel: xn,
|
|
761
|
+
ContextOverview: _n,
|
|
762
|
+
ContextCard: ut
|
|
763
|
+
}, R = {
|
|
764
|
+
ContextNoteList: mn,
|
|
765
|
+
ContextMetricGrid: tn,
|
|
766
|
+
ContextDataTable: gt,
|
|
767
|
+
ContextList: Ut,
|
|
768
|
+
ContextTabularList: En,
|
|
769
|
+
ContextFileList: St
|
|
770
|
+
}, z = {
|
|
18
771
|
"atlas.submitUserAction": {
|
|
19
|
-
params:
|
|
20
|
-
data:
|
|
21
|
-
actionId:
|
|
772
|
+
params: w.object({
|
|
773
|
+
data: w.record(w.string(), w.unknown()).optional(),
|
|
774
|
+
actionId: w.string().optional()
|
|
22
775
|
}),
|
|
23
776
|
description: "Submit form data. actionId overrides default \"form_submit\" identifier."
|
|
24
777
|
},
|
|
25
778
|
"atlas.navigate": {
|
|
26
|
-
params:
|
|
779
|
+
params: w.object({ url: w.string() }),
|
|
27
780
|
description: "Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app."
|
|
28
781
|
},
|
|
29
782
|
"atlas.toolCall": {
|
|
30
|
-
params:
|
|
31
|
-
tool:
|
|
32
|
-
args:
|
|
783
|
+
params: w.object({
|
|
784
|
+
tool: w.string(),
|
|
785
|
+
args: w.record(w.string(), w.unknown()).optional()
|
|
33
786
|
}),
|
|
34
787
|
description: "Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent."
|
|
35
788
|
}
|
|
36
|
-
},
|
|
789
|
+
}, Ln = {
|
|
37
790
|
"atlas.submitUserAction": async (e) => {},
|
|
38
791
|
"atlas.navigate": async (e) => {},
|
|
39
792
|
"atlas.toolCall": async (e) => {}
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
], P = {
|
|
45
|
-
props: c.object({
|
|
46
|
-
title: c.string(),
|
|
47
|
-
status: c.enum([
|
|
793
|
+
}, Rn = {
|
|
794
|
+
props: w.object({
|
|
795
|
+
title: w.string(),
|
|
796
|
+
status: w.enum([
|
|
48
797
|
"info",
|
|
49
798
|
"success",
|
|
50
799
|
"warning",
|
|
51
800
|
"danger"
|
|
52
801
|
]).optional(),
|
|
53
|
-
dismissible:
|
|
802
|
+
dismissible: w.boolean().optional(),
|
|
803
|
+
aiMark: w.boolean().optional()
|
|
54
804
|
}),
|
|
55
805
|
slots: ["default"],
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region src/utils/defined-props.ts
|
|
65
|
-
function F(e) {
|
|
66
|
-
let t = {};
|
|
67
|
-
for (let n of Object.keys(e)) {
|
|
68
|
-
let r = e[n];
|
|
69
|
-
r !== void 0 && (t[n] = r);
|
|
70
|
-
}
|
|
71
|
-
return t;
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/core/catalog/badge.catalog.ts
|
|
75
|
-
var I = {
|
|
76
|
-
props: c.object({
|
|
77
|
-
content: c.string().optional(),
|
|
78
|
-
offset: c.object({
|
|
79
|
-
x: c.string().optional(),
|
|
80
|
-
y: c.string().optional()
|
|
81
|
-
}).optional()
|
|
82
|
-
}),
|
|
83
|
-
slots: ["default"],
|
|
84
|
-
description: "Unread notification count on a Button or Link. Wrap the interactive element as a child of Badge (the renderer adds position:relative). content: numerical count only (e.g. 3, 99+); omit for dot-only. offset: {x, y} CSS values to fine-tune position on non-square anchors like links."
|
|
85
|
-
}, me = "_128xbc80", he = ({ props: e, children: t }) => {
|
|
86
|
-
let n = e.offset ? F({
|
|
87
|
-
x: e.offset.x,
|
|
88
|
-
y: e.offset.y
|
|
89
|
-
}) : void 0, r = n ? /* @__PURE__ */ y(u, {
|
|
90
|
-
offset: n,
|
|
91
|
-
children: e.content
|
|
92
|
-
}) : /* @__PURE__ */ y(u, { children: e.content });
|
|
93
|
-
return t ? /* @__PURE__ */ b("div", {
|
|
94
|
-
className: me,
|
|
95
|
-
children: [t, r]
|
|
96
|
-
}) : r;
|
|
97
|
-
}, L = {
|
|
98
|
-
props: c.object({
|
|
99
|
-
data: c.array(c.object({
|
|
100
|
-
category: c.string(),
|
|
101
|
-
value: c.number()
|
|
806
|
+
events: ["close"],
|
|
807
|
+
description: "Inline notification banner with a required title. status: info (default) | success | warning | danger — danger for errors, warning for cautions, success for confirmations. Put the main message in the alert's children (rendered below the title). dismissible: true adds a close button that emits a \"close\" event."
|
|
808
|
+
}, zn = {
|
|
809
|
+
props: w.object({
|
|
810
|
+
data: w.array(w.object({
|
|
811
|
+
category: w.string(),
|
|
812
|
+
value: w.number()
|
|
102
813
|
})),
|
|
103
|
-
orientation:
|
|
104
|
-
theme:
|
|
814
|
+
orientation: w.enum(["vertical", "horizontal"]).optional(),
|
|
815
|
+
theme: w.enum([
|
|
105
816
|
"monochrome",
|
|
106
817
|
"categorical",
|
|
107
818
|
"semantic"
|
|
108
819
|
]).optional(),
|
|
109
|
-
height:
|
|
110
|
-
unit:
|
|
820
|
+
height: w.number().optional(),
|
|
821
|
+
unit: w.string().optional()
|
|
111
822
|
}),
|
|
112
823
|
slots: [],
|
|
113
824
|
description: "Bar chart (vertical or horizontal) with Anvil2 theme. data: [{category, value}]. theme: monochrome (default, ≤4 vars), categorical (5-9 distinct), semantic (success/neutral/warning/danger order). unit: tooltip suffix."
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
let n = {
|
|
119
|
-
monochrome: D,
|
|
120
|
-
categorical: ue,
|
|
121
|
-
semantic: de
|
|
122
|
-
}[t] ?? D;
|
|
123
|
-
e.setThemes([le.new(e), n.new(e)]);
|
|
124
|
-
}
|
|
125
|
-
//#endregion
|
|
126
|
-
//#region src/core/catalog/bar-chart.tsx
|
|
127
|
-
var ge = ({ props: e }) => {
|
|
128
|
-
let t = E(null);
|
|
129
|
-
return w(() => {
|
|
130
|
-
let n = t.current;
|
|
131
|
-
if (!n) return;
|
|
132
|
-
let r, i = () => {
|
|
133
|
-
r && r.dispose(), r = x.Root.new(n), z(r, e.theme);
|
|
134
|
-
let t = r.container.children.push(S.XYChart.new(r, { paddingLeft: 0 }));
|
|
135
|
-
if (e.orientation === "horizontal") {
|
|
136
|
-
let n = t.yAxes.push(S.CategoryAxis.new(r, {
|
|
137
|
-
categoryField: "category",
|
|
138
|
-
renderer: S.AxisRendererY.new(r, { minGridDistance: 20 })
|
|
139
|
-
})), i = t.xAxes.push(S.ValueAxis.new(r, { renderer: S.AxisRendererX.new(r, {}) })), a = t.series.push(S.ColumnSeries.new(r, {
|
|
140
|
-
xAxis: i,
|
|
141
|
-
yAxis: n,
|
|
142
|
-
valueXField: "value",
|
|
143
|
-
categoryYField: "category"
|
|
144
|
-
}));
|
|
145
|
-
a.columns.template.setAll({ tooltipText: `{categoryY}: ${e.unit ?? ""}{valueX}` }), n.data.setAll(e.data), a.data.setAll(e.data);
|
|
146
|
-
} else {
|
|
147
|
-
let n = t.xAxes.push(S.CategoryAxis.new(r, {
|
|
148
|
-
categoryField: "category",
|
|
149
|
-
renderer: S.AxisRendererX.new(r, { minGridDistance: 30 })
|
|
150
|
-
})), i = t.yAxes.push(S.ValueAxis.new(r, { renderer: S.AxisRendererY.new(r, {}) })), a = t.series.push(S.ColumnSeries.new(r, {
|
|
151
|
-
xAxis: n,
|
|
152
|
-
yAxis: i,
|
|
153
|
-
valueYField: "value",
|
|
154
|
-
categoryXField: "category"
|
|
155
|
-
}));
|
|
156
|
-
a.columns.template.setAll({ tooltipText: `{categoryX}: ${e.unit ?? ""}{valueY}` }), n.data.setAll(e.data), a.data.setAll(e.data);
|
|
157
|
-
}
|
|
158
|
-
}, a = new ResizeObserver((e) => {
|
|
159
|
-
(e[0]?.contentRect.width ?? 0) > 0 && !r && i();
|
|
160
|
-
});
|
|
161
|
-
return a.observe(n), n.offsetWidth > 0 && i(), () => {
|
|
162
|
-
a.disconnect(), r?.dispose();
|
|
163
|
-
};
|
|
164
|
-
}, []), /* @__PURE__ */ y("div", {
|
|
165
|
-
ref: t,
|
|
166
|
-
className: R,
|
|
167
|
-
style: { height: e.height ?? 300 }
|
|
168
|
-
});
|
|
169
|
-
}, B = {
|
|
170
|
-
props: c.object({
|
|
171
|
-
label: c.string(),
|
|
172
|
-
appearance: c.enum([
|
|
825
|
+
}, Bn = {
|
|
826
|
+
props: w.object({
|
|
827
|
+
label: w.string(),
|
|
828
|
+
appearance: w.enum([
|
|
173
829
|
"primary",
|
|
174
830
|
"secondary",
|
|
175
|
-
"ghost"
|
|
831
|
+
"ghost",
|
|
832
|
+
"danger"
|
|
176
833
|
]).optional(),
|
|
177
|
-
size:
|
|
834
|
+
size: w.enum([
|
|
178
835
|
"xsmall",
|
|
179
836
|
"small",
|
|
180
837
|
"medium",
|
|
181
838
|
"large"
|
|
182
839
|
]).optional(),
|
|
183
|
-
loading:
|
|
184
|
-
disabled:
|
|
840
|
+
loading: w.boolean().optional(),
|
|
841
|
+
disabled: w.boolean().optional(),
|
|
842
|
+
badge: w.string().optional()
|
|
185
843
|
}),
|
|
186
844
|
slots: [],
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
onClick: () => t("press"),
|
|
196
|
-
children: e.label
|
|
197
|
-
}), V = {
|
|
198
|
-
props: c.object({
|
|
199
|
-
background: c.enum(["strong", "stronger"]).optional(),
|
|
200
|
-
padding: c.enum([
|
|
845
|
+
events: ["press"],
|
|
846
|
+
description: "Clickable button. Emits a \"press\" event when clicked; inside a form the host treats press as a submit and uses the element key as the actionId, so no explicit on.press wiring is needed for form submits. appearance: primary | secondary (default) | ghost | danger (destructive actions like delete/cancel). size: xsmall | small | medium (default) | large. loading: true shows a spinner and blocks interaction. disabled: true prevents interaction. badge: optional notification count shown as a superscript (e.g. \"3\", \"99+\"); use an empty string for a dot-only indicator."
|
|
847
|
+
}, Vn = {
|
|
848
|
+
props: w.object({
|
|
849
|
+
title: w.string().optional(),
|
|
850
|
+
description: w.string().optional(),
|
|
851
|
+
background: w.enum(["strong", "stronger"]).optional(),
|
|
852
|
+
padding: w.enum([
|
|
201
853
|
"0",
|
|
202
854
|
"xsmall",
|
|
203
855
|
"small",
|
|
@@ -206,39 +858,35 @@ var ge = ({ props: e }) => {
|
|
|
206
858
|
]).optional()
|
|
207
859
|
}),
|
|
208
860
|
slots: ["default"],
|
|
209
|
-
description: "White surface
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
children: t
|
|
216
|
-
}), H = {
|
|
217
|
-
props: c.object({
|
|
218
|
-
label: c.string(),
|
|
219
|
-
checked: c.boolean().optional(),
|
|
220
|
-
disabled: c.boolean().optional()
|
|
861
|
+
description: "White surface that groups a logical section of related content. title: optional headline rendered at the top of the card. description: optional subdued line below the title. Children render below the header and are stacked vertically with consistent spacing — you do not need to wrap them in a Flex. Prefer the built-in title/description over standalone Text children for the heading. background: strong | stronger for nested/elevated surfaces. padding: 0 | xsmall | small | medium (default) | large. Do not nest a Card inside another Card."
|
|
862
|
+
}, Hn = {
|
|
863
|
+
props: w.object({
|
|
864
|
+
label: w.string(),
|
|
865
|
+
checked: w.boolean().optional(),
|
|
866
|
+
disabled: w.boolean().optional()
|
|
221
867
|
}),
|
|
222
868
|
slots: [],
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
869
|
+
events: ["change"],
|
|
870
|
+
description: "Checkbox for selecting zero or more independent options that are submitted with a form (one Checkbox per option). For a single on/off setting with immediate effect prefer Switch. Bind state with $bindState on checked; emits a \"change\" event when toggled. disabled: true prevents toggling."
|
|
871
|
+
}, Un = {
|
|
872
|
+
props: w.object({
|
|
873
|
+
label: w.string(),
|
|
874
|
+
size: w.enum(["small", "medium"]).optional(),
|
|
875
|
+
color: w.string().optional(),
|
|
876
|
+
icon: w.enum([
|
|
230
877
|
"check-circle",
|
|
231
878
|
"in-progress",
|
|
232
879
|
"radio-button-unchecked"
|
|
233
880
|
]).optional(),
|
|
234
|
-
removable:
|
|
881
|
+
removable: w.boolean().optional()
|
|
235
882
|
}),
|
|
236
883
|
slots: [],
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
884
|
+
events: ["close"],
|
|
885
|
+
description: "Inline label pill for metadata, tags, or categories — use for job statuses, not notification counts (use a Button/Link badge prop for those). size: small | medium (default). color: any CSS color. icon: optional leading status icon. removable: true adds a close button that emits a \"close\" event (ignored when size=small)."
|
|
886
|
+
}, Wn = {
|
|
887
|
+
props: w.object({
|
|
888
|
+
vertical: w.boolean().optional(),
|
|
889
|
+
spacing: w.enum([
|
|
242
890
|
"0",
|
|
243
891
|
"half",
|
|
244
892
|
"1",
|
|
@@ -250,50 +898,54 @@ var ge = ({ props: e }) => {
|
|
|
250
898
|
"8",
|
|
251
899
|
"12"
|
|
252
900
|
]).optional(),
|
|
253
|
-
alignContent:
|
|
901
|
+
alignContent: w.enum([
|
|
254
902
|
"start",
|
|
255
903
|
"center",
|
|
256
904
|
"end"
|
|
257
905
|
]).optional()
|
|
258
906
|
}),
|
|
259
907
|
slots: [],
|
|
260
|
-
description: "
|
|
261
|
-
},
|
|
262
|
-
props:
|
|
263
|
-
data:
|
|
264
|
-
category:
|
|
265
|
-
value:
|
|
908
|
+
description: "Horizontal (default) or vertical rule that separates content sections. vertical: true for a vertical separator between side-by-side content. spacing (space around the divider, ~4px per step): 0 (default) | half | 1–6 | 8 | 12. alignContent: alignment of any divider content (start | center | end). Place between logical sections — not as a top/bottom border of a container."
|
|
909
|
+
}, Gn = {
|
|
910
|
+
props: w.object({
|
|
911
|
+
data: w.array(w.object({
|
|
912
|
+
category: w.string(),
|
|
913
|
+
value: w.number()
|
|
266
914
|
})),
|
|
267
|
-
theme:
|
|
915
|
+
theme: w.enum([
|
|
268
916
|
"monochrome",
|
|
269
917
|
"categorical",
|
|
270
918
|
"semantic"
|
|
271
919
|
]).optional(),
|
|
272
|
-
showLegend:
|
|
273
|
-
height:
|
|
274
|
-
unit:
|
|
920
|
+
showLegend: w.boolean().optional(),
|
|
921
|
+
height: w.number().optional(),
|
|
922
|
+
unit: w.string().optional()
|
|
275
923
|
}),
|
|
276
924
|
slots: [],
|
|
277
925
|
description: "Donut chart with optional legend and Anvil2 theme. data: [{category, value}]. theme: monochrome (≤4 vars), categorical (5-9 distinct), semantic (status values)."
|
|
278
|
-
},
|
|
279
|
-
props:
|
|
280
|
-
direction:
|
|
281
|
-
gap:
|
|
926
|
+
}, Kn = {
|
|
927
|
+
props: w.object({
|
|
928
|
+
direction: w.enum(["row", "column"]).optional(),
|
|
929
|
+
gap: w.enum([
|
|
930
|
+
"0",
|
|
931
|
+
"half",
|
|
282
932
|
"1",
|
|
283
933
|
"2",
|
|
284
934
|
"3",
|
|
285
935
|
"4",
|
|
286
936
|
"5",
|
|
287
|
-
"6"
|
|
937
|
+
"6",
|
|
938
|
+
"8",
|
|
939
|
+
"12"
|
|
288
940
|
]).optional(),
|
|
289
|
-
alignItems:
|
|
941
|
+
alignItems: w.enum([
|
|
290
942
|
"center",
|
|
291
943
|
"flex-start",
|
|
292
944
|
"flex-end",
|
|
293
945
|
"stretch",
|
|
294
946
|
"baseline"
|
|
295
947
|
]).optional(),
|
|
296
|
-
justifyContent:
|
|
948
|
+
justifyContent: w.enum([
|
|
297
949
|
"center",
|
|
298
950
|
"flex-start",
|
|
299
951
|
"flex-end",
|
|
@@ -301,54 +953,67 @@ var ge = ({ props: e }) => {
|
|
|
301
953
|
"space-around",
|
|
302
954
|
"space-evenly"
|
|
303
955
|
]).optional(),
|
|
304
|
-
|
|
956
|
+
alignSelf: w.enum([
|
|
957
|
+
"auto",
|
|
958
|
+
"center",
|
|
959
|
+
"flex-start",
|
|
960
|
+
"flex-end",
|
|
961
|
+
"stretch",
|
|
962
|
+
"baseline"
|
|
963
|
+
]).optional(),
|
|
964
|
+
wrap: w.enum([
|
|
305
965
|
"wrap",
|
|
306
966
|
"nowrap",
|
|
307
967
|
"wrap-reverse"
|
|
308
968
|
]).optional(),
|
|
309
|
-
grow:
|
|
310
|
-
shrink:
|
|
311
|
-
|
|
969
|
+
grow: w.number().optional(),
|
|
970
|
+
shrink: w.number().optional(),
|
|
971
|
+
basis: w.string().optional(),
|
|
972
|
+
inline: w.boolean().optional()
|
|
312
973
|
}),
|
|
313
974
|
slots: ["default"],
|
|
314
|
-
description: "Flex layout container. gap: 1=4px 2=8px 3=12px 4=16px 5=20px 6=24px
|
|
315
|
-
},
|
|
316
|
-
props:
|
|
317
|
-
templateColumns:
|
|
318
|
-
gap:
|
|
975
|
+
description: "Flex layout container. direction: row (default) | column — always set column when stacking children vertically. gap (spacing token, ~4px per step): half=2px 1=4px 2=8px 3=12px 4=16px 5=20px 6=24px 8=32px 12=48px. alignItems: cross-axis alignment of children. justifyContent: main-axis distribution. When this Flex is itself a child of another Flex, use grow (1=fill available space), shrink, basis (CSS flex-basis e.g. \"200px\"), and alignSelf to control how it flexes."
|
|
976
|
+
}, B = {
|
|
977
|
+
props: w.object({
|
|
978
|
+
templateColumns: w.string().optional(),
|
|
979
|
+
gap: w.enum([
|
|
980
|
+
"0",
|
|
981
|
+
"half",
|
|
319
982
|
"1",
|
|
320
983
|
"2",
|
|
321
984
|
"3",
|
|
322
985
|
"4",
|
|
323
986
|
"5",
|
|
324
|
-
"6"
|
|
987
|
+
"6",
|
|
988
|
+
"8",
|
|
989
|
+
"12"
|
|
325
990
|
]).optional(),
|
|
326
|
-
bordered:
|
|
991
|
+
bordered: w.boolean().optional()
|
|
327
992
|
}),
|
|
328
993
|
slots: ["default"],
|
|
329
|
-
description: "CSS Grid layout. templateColumns: CSS grid-template-columns value — \"repeat(3, 1fr)\" for equal columns, \"200px 1fr\" for fixed+flex two-column (e.g. key-value tables), \"1fr 1fr 80px\" for multi-column tables. Children flow into grid cells left-to-right, top-to-bottom. gap: 1=4px … 6=24px. bordered: true renders a bordered table with row separators and cell padding — use for key-value and data tables."
|
|
330
|
-
},
|
|
331
|
-
props:
|
|
332
|
-
name:
|
|
994
|
+
description: "CSS Grid layout. templateColumns: CSS grid-template-columns value — \"repeat(3, 1fr)\" for equal columns, \"200px 1fr\" for fixed+flex two-column (e.g. key-value tables), \"1fr 1fr 80px\" for multi-column tables. Children flow into grid cells left-to-right, top-to-bottom. gap (spacing token, ~4px per step): 1=4px 2=8px … 6=24px 8=32px 12=48px (default 2). bordered: true renders a bordered table with row separators and cell padding — use for key-value and data tables."
|
|
995
|
+
}, qn = {
|
|
996
|
+
props: w.object({
|
|
997
|
+
name: w.enum([
|
|
333
998
|
"check-circle",
|
|
334
999
|
"in-progress",
|
|
335
1000
|
"radio-button-unchecked"
|
|
336
1001
|
]),
|
|
337
|
-
size:
|
|
1002
|
+
size: w.enum([
|
|
338
1003
|
"small",
|
|
339
1004
|
"medium",
|
|
340
1005
|
"large",
|
|
341
1006
|
"xlarge"
|
|
342
1007
|
]).optional(),
|
|
343
|
-
color:
|
|
1008
|
+
color: w.string().optional()
|
|
344
1009
|
}),
|
|
345
1010
|
slots: [],
|
|
346
|
-
description: "
|
|
347
|
-
},
|
|
348
|
-
props:
|
|
349
|
-
label:
|
|
350
|
-
placeholder:
|
|
351
|
-
type:
|
|
1011
|
+
description: "Small status icon. name (only these three are available): check-circle=completed/success checkmark, in-progress=partial circle (active/working), radio-button-unchecked=empty circle (pending/not started). size: small | medium (default) | large | xlarge. color: any CSS color (defaults to the current text color). Commonly paired with status Text in lists and checklists."
|
|
1012
|
+
}, Jn = {
|
|
1013
|
+
props: w.object({
|
|
1014
|
+
label: w.string(),
|
|
1015
|
+
placeholder: w.string().optional(),
|
|
1016
|
+
type: w.enum([
|
|
352
1017
|
"text",
|
|
353
1018
|
"password",
|
|
354
1019
|
"email",
|
|
@@ -356,187 +1021,559 @@ var ge = ({ props: e }) => {
|
|
|
356
1021
|
"url",
|
|
357
1022
|
"number"
|
|
358
1023
|
]).optional(),
|
|
359
|
-
value:
|
|
360
|
-
disabled:
|
|
1024
|
+
value: w.string().optional(),
|
|
1025
|
+
disabled: w.boolean().optional()
|
|
361
1026
|
}),
|
|
362
1027
|
slots: [],
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
1028
|
+
events: ["change"],
|
|
1029
|
+
description: "Free-text input field for user-typed values (names, notes, numbers, etc). type: text (default), password (masked), email, tel (phone), url, number. Bind value with $bindState so the typed value is captured in state; emits a \"change\" event on every keystroke. Prefer this over Listbox when the value is not from a fixed list. disabled: true prevents editing."
|
|
1030
|
+
}, Yn = {
|
|
1031
|
+
props: w.object({
|
|
1032
|
+
data: w.array(w.record(w.string(), w.union([w.string(), w.number()]))),
|
|
1033
|
+
series: w.array(w.string()).optional(),
|
|
1034
|
+
theme: w.enum([
|
|
369
1035
|
"monochrome",
|
|
370
1036
|
"categorical",
|
|
371
1037
|
"semantic"
|
|
372
1038
|
]).optional(),
|
|
373
|
-
showLegend:
|
|
374
|
-
showDots:
|
|
375
|
-
height:
|
|
376
|
-
unit:
|
|
1039
|
+
showLegend: w.boolean().optional(),
|
|
1040
|
+
showDots: w.boolean().optional(),
|
|
1041
|
+
height: w.number().optional(),
|
|
1042
|
+
unit: w.string().optional()
|
|
377
1043
|
}),
|
|
378
1044
|
slots: [],
|
|
379
1045
|
description: "Line chart for tracking trends over time with optional multiple series. data: array of objects with a \"category\" key (x-axis label) and one numeric key per series (e.g. [{category: \"Jan\", revenue: 100, cost: 60}]). series: explicit list of series keys to plot (inferred from data keys if omitted, max 6). theme: monochrome (1-2 series), categorical (3-6 distinct). showLegend: true when multiple series (default true for 2+ series). showDots: true adds data-point markers (default true). unit: tooltip value suffix."
|
|
380
|
-
},
|
|
381
|
-
props:
|
|
382
|
-
label:
|
|
383
|
-
href:
|
|
384
|
-
appearance:
|
|
385
|
-
target:
|
|
386
|
-
ghost:
|
|
1046
|
+
}, Xn = {
|
|
1047
|
+
props: w.object({
|
|
1048
|
+
label: w.string(),
|
|
1049
|
+
href: w.string(),
|
|
1050
|
+
appearance: w.enum(["primary", "secondary"]).optional(),
|
|
1051
|
+
target: w.enum(["_blank", "_self"]).optional(),
|
|
1052
|
+
ghost: w.boolean().optional(),
|
|
1053
|
+
badge: w.string().optional()
|
|
387
1054
|
}),
|
|
388
1055
|
slots: [],
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
1056
|
+
events: ["press"],
|
|
1057
|
+
description: "Inline navigation link (renders an <a>). Emits a \"press\" event when clicked — handle navigation in on.press; href and target are inputs for the host/router rather than native browser navigation. href: destination URL for the host/router. appearance: primary (default) | secondary. target: _blank marks the link as external (shows external-link icon) and lets the host open a new tab if desired. ghost: quieter styling (primary only). badge: optional notification count shown as a superscript (e.g. \"5\"); use an empty string for a dot-only indicator."
|
|
1058
|
+
}, Zn = {
|
|
1059
|
+
props: w.object({
|
|
1060
|
+
label: w.string(),
|
|
1061
|
+
options: w.array(w.object({
|
|
1062
|
+
value: w.string(),
|
|
1063
|
+
label: w.string()
|
|
396
1064
|
})),
|
|
397
|
-
value:
|
|
398
|
-
disabled:
|
|
1065
|
+
value: w.string().optional(),
|
|
1066
|
+
disabled: w.boolean().optional()
|
|
399
1067
|
}),
|
|
400
1068
|
slots: [],
|
|
401
|
-
|
|
402
|
-
},
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
1069
|
+
events: ["change"],
|
|
1070
|
+
description: "Single-select dropdown for choosing one value from a fixed list of known options. options: [{ value, label }] — value is stored in state, label is shown. Bind the selection with $bindState on value; emits a \"change\" event on selection. Use only when options are predefined; for free-text user input use Input, and for 2–7 visible mutually-exclusive choices prefer RadioGroup. disabled: true prevents selection."
|
|
1071
|
+
}, Qn = {
|
|
1072
|
+
props: w.object({
|
|
1073
|
+
label: w.string(),
|
|
1074
|
+
value: w.number().min(0).max(100).optional(),
|
|
1075
|
+
description: w.string().optional(),
|
|
1076
|
+
indeterminate: w.boolean().optional()
|
|
408
1077
|
}),
|
|
409
1078
|
slots: [],
|
|
410
|
-
description: "
|
|
411
|
-
},
|
|
412
|
-
props:
|
|
413
|
-
label:
|
|
414
|
-
options:
|
|
415
|
-
value:
|
|
416
|
-
label:
|
|
1079
|
+
description: "Horizontal progress bar showing task completion. label is required (the accessible name for the bar). value: 0–100 percentage filled. Omit value and set indeterminate=true when progress cannot be measured (do not set both). description: optional helper text shown below the bar."
|
|
1080
|
+
}, $n = {
|
|
1081
|
+
props: w.object({
|
|
1082
|
+
label: w.string(),
|
|
1083
|
+
options: w.array(w.object({
|
|
1084
|
+
value: w.string(),
|
|
1085
|
+
label: w.string()
|
|
417
1086
|
})),
|
|
418
|
-
value:
|
|
419
|
-
disabled:
|
|
1087
|
+
value: w.string().optional(),
|
|
1088
|
+
disabled: w.boolean().optional()
|
|
420
1089
|
}),
|
|
421
1090
|
slots: [],
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
1091
|
+
events: ["change"],
|
|
1092
|
+
description: "Group of radio buttons for picking one option from 2–7 visible mutually-exclusive choices. options: [{ value, label }]. Bind the selection with $bindState on value; emits a \"change\" event on selection. For longer option lists use Listbox. disabled: true prevents selection."
|
|
1093
|
+
}, er = {
|
|
1094
|
+
props: w.object({
|
|
1095
|
+
label: w.string(),
|
|
1096
|
+
checked: w.boolean().optional(),
|
|
1097
|
+
disabled: w.boolean().optional()
|
|
428
1098
|
}),
|
|
429
1099
|
slots: [],
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
1100
|
+
events: ["change"],
|
|
1101
|
+
description: "Toggle switch for a single binary on/off setting with immediate effect (no form submit). Prefer over Checkbox for enabling/disabling features. Bind state with $bindState on checked; emits a \"change\" event when toggled. disabled: true prevents toggling."
|
|
1102
|
+
}, tr = {
|
|
1103
|
+
props: w.object({
|
|
1104
|
+
content: w.string(),
|
|
1105
|
+
variant: w.enum([
|
|
435
1106
|
"headline",
|
|
436
1107
|
"body",
|
|
437
1108
|
"eyebrow"
|
|
438
1109
|
]).optional(),
|
|
439
|
-
size:
|
|
1110
|
+
size: w.enum([
|
|
440
1111
|
"small",
|
|
441
1112
|
"medium",
|
|
442
1113
|
"large",
|
|
443
1114
|
"xlarge"
|
|
444
1115
|
]).optional(),
|
|
445
|
-
subdued:
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
1116
|
+
subdued: w.boolean().optional()
|
|
1117
|
+
}),
|
|
1118
|
+
slots: [],
|
|
1119
|
+
description: "Display text. variant: headline=bold title, eyebrow=small uppercase label, body=default (default variant). size: small | medium (default) | large | xlarge — applies to headline and body only (ignored for eyebrow). subdued: deemphasized secondary text (body only). Use eyebrow+headline pairs for KPI/stat labels above values."
|
|
1120
|
+
}, nr = {
|
|
1121
|
+
props: w.object({
|
|
1122
|
+
label: w.string(),
|
|
1123
|
+
placeholder: w.string().optional(),
|
|
1124
|
+
description: w.string().optional(),
|
|
1125
|
+
moreInfo: w.string().optional(),
|
|
1126
|
+
value: w.string().optional(),
|
|
1127
|
+
rows: w.number().optional(),
|
|
1128
|
+
disabled: w.boolean().optional()
|
|
454
1129
|
}),
|
|
455
1130
|
slots: [],
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
1131
|
+
events: ["change"],
|
|
1132
|
+
description: "Multi-line free-text input for long values (notes, descriptions, email body). Bind value with $bindState; emits a \"change\" event on every keystroke. rows: visible row count (default 3). description: helper text below the field. moreInfo: tooltip text on the label. disabled: true prevents editing."
|
|
1133
|
+
}, V = {
|
|
1134
|
+
Text: tr,
|
|
1135
|
+
Card: Vn,
|
|
1136
|
+
Flex: Kn,
|
|
1137
|
+
Grid: B,
|
|
1138
|
+
Alert: Rn,
|
|
1139
|
+
Divider: Wn,
|
|
1140
|
+
Icon: qn,
|
|
1141
|
+
Chip: Un,
|
|
1142
|
+
Link: Xn,
|
|
1143
|
+
ProgressBar: Qn,
|
|
1144
|
+
BarChart: zn,
|
|
1145
|
+
DonutChart: Gn,
|
|
1146
|
+
LineChart: Yn,
|
|
1147
|
+
Button: Bn,
|
|
1148
|
+
Checkbox: Hn,
|
|
1149
|
+
Input: Jn,
|
|
1150
|
+
Textarea: nr,
|
|
1151
|
+
Listbox: Zn,
|
|
1152
|
+
RadioGroup: $n,
|
|
1153
|
+
Switch: er
|
|
1154
|
+
};
|
|
1155
|
+
//#endregion
|
|
1156
|
+
//#region src/scoped-catalog.ts
|
|
1157
|
+
function H(e = {}) {
|
|
1158
|
+
let { core: t = "all", overrides: n = {}, components: r = {} } = e, i = {
|
|
1159
|
+
...t === "all" ? { ...V } : Object.fromEntries(t.map((e) => {
|
|
1160
|
+
let t = V[e];
|
|
1161
|
+
if (!t) throw Error(`Unknown core component: ${String(e)}`);
|
|
1162
|
+
return [e, t];
|
|
1163
|
+
})),
|
|
1164
|
+
...r
|
|
1165
|
+
};
|
|
1166
|
+
for (let [e, t] of Object.entries(n)) {
|
|
1167
|
+
let n = i[e];
|
|
1168
|
+
if (!n || !t) continue;
|
|
1169
|
+
let r = t.description ?? (t.append ? `${n.description} ${t.append}` : n.description);
|
|
1170
|
+
i[e] = {
|
|
1171
|
+
...n,
|
|
1172
|
+
description: r
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
return i;
|
|
1176
|
+
}
|
|
1177
|
+
function rr(e) {
|
|
1178
|
+
return e;
|
|
1179
|
+
}
|
|
1180
|
+
function ir(e) {
|
|
1181
|
+
let t = H({
|
|
1182
|
+
core: e.core ?? "all",
|
|
1183
|
+
...e.overrides ? { overrides: e.overrides } : {},
|
|
1184
|
+
...e.components ? { components: e.components } : {}
|
|
1185
|
+
}), n = Object.fromEntries(Object.entries(e.actions ?? {}).map(([t, n]) => [`${e.prefix}.${t}`, n])), r = T(D, {
|
|
1186
|
+
components: t,
|
|
1187
|
+
actions: {
|
|
1188
|
+
...z,
|
|
1189
|
+
...n
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
return {
|
|
1193
|
+
prefix: e.prefix,
|
|
1194
|
+
catalog: r,
|
|
1195
|
+
prompt(t) {
|
|
1196
|
+
let n = [
|
|
1197
|
+
r.prompt(),
|
|
1198
|
+
"\n",
|
|
1199
|
+
t
|
|
1200
|
+
];
|
|
1201
|
+
return e.rules && n.push("\n", e.rules), n.join("");
|
|
1202
|
+
},
|
|
1203
|
+
jsonSchema() {
|
|
1204
|
+
return r.jsonSchema();
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
var ar = H({
|
|
1209
|
+
core: [
|
|
1210
|
+
"Text",
|
|
1211
|
+
"Chip",
|
|
1212
|
+
"Link",
|
|
1213
|
+
"Alert"
|
|
1214
|
+
],
|
|
1215
|
+
overrides: { Link: { append: "In a context panel, links appear inside content primitives (ContextList, ContextTabularList identifier links, ContextNoteList, etc.); use a standalone Link only for inline references within rich text." } },
|
|
1216
|
+
components: {
|
|
1217
|
+
...L,
|
|
1218
|
+
...R
|
|
1219
|
+
}
|
|
1220
|
+
}), or = T(D, {
|
|
1221
|
+
components: ar,
|
|
1222
|
+
actions: z
|
|
1223
|
+
}), U = [
|
|
1224
|
+
{
|
|
1225
|
+
name: "ContextPanel",
|
|
1226
|
+
catalog: L.ContextPanel,
|
|
1227
|
+
renderer: Sn,
|
|
1228
|
+
renderers: ["context"]
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
name: "ContextOverview",
|
|
1232
|
+
catalog: L.ContextOverview,
|
|
1233
|
+
renderer: bn,
|
|
1234
|
+
renderers: ["context"]
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
name: "ContextCard",
|
|
1238
|
+
catalog: L.ContextCard,
|
|
1239
|
+
renderer: dt,
|
|
1240
|
+
renderers: ["context"]
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
name: "ContextNoteList",
|
|
1244
|
+
catalog: R.ContextNoteList,
|
|
1245
|
+
renderer: gn,
|
|
1246
|
+
renderers: ["context"]
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
name: "ContextMetricGrid",
|
|
1250
|
+
catalog: R.ContextMetricGrid,
|
|
1251
|
+
renderer: on,
|
|
1252
|
+
renderers: ["context"]
|
|
1253
|
+
},
|
|
1254
|
+
{
|
|
1255
|
+
name: "ContextDataTable",
|
|
1256
|
+
catalog: R.ContextDataTable,
|
|
1257
|
+
renderer: bt,
|
|
1258
|
+
renderers: ["context"]
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
name: "ContextList",
|
|
1262
|
+
catalog: R.ContextList,
|
|
1263
|
+
renderer: $t,
|
|
1264
|
+
renderers: ["context"]
|
|
1265
|
+
},
|
|
1266
|
+
{
|
|
1267
|
+
name: "ContextTabularList",
|
|
1268
|
+
catalog: R.ContextTabularList,
|
|
1269
|
+
renderer: In,
|
|
1270
|
+
renderers: ["context"]
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
name: "ContextFileList",
|
|
1274
|
+
catalog: R.ContextFileList,
|
|
1275
|
+
renderer: Vt,
|
|
1276
|
+
renderers: ["context"]
|
|
1277
|
+
}
|
|
1278
|
+
];
|
|
1279
|
+
Object.fromEntries(U.filter(({ name: e }) => e in L).map(({ name: e, renderer: t }) => [e, t])), Object.fromEntries(U.filter(({ name: e }) => e in R).map(({ name: e, renderer: t }) => [e, t]));
|
|
1280
|
+
//#endregion
|
|
1281
|
+
//#region src/context/constants.ts
|
|
1282
|
+
var sr = [
|
|
1283
|
+
"ContextPanel",
|
|
1284
|
+
"ContextOverview",
|
|
1285
|
+
"ContextCard"
|
|
1286
|
+
], cr = ["ContextOverview", "ContextCard"];
|
|
1287
|
+
function lr(e) {
|
|
1288
|
+
return sr.includes(e);
|
|
1289
|
+
}
|
|
1290
|
+
function ur(e) {
|
|
1291
|
+
return cr.includes(e);
|
|
1292
|
+
}
|
|
1293
|
+
//#endregion
|
|
1294
|
+
//#region src/context/validate-context-spec.ts
|
|
1295
|
+
function W(e, t) {
|
|
1296
|
+
return e.elements[t];
|
|
1297
|
+
}
|
|
1298
|
+
function dr(e, t, n = /* @__PURE__ */ new Set()) {
|
|
1299
|
+
let r = W(e, t);
|
|
1300
|
+
if (!r || n.has(t)) return n;
|
|
1301
|
+
n.add(t);
|
|
1302
|
+
for (let t of r.children ?? []) dr(e, t, n);
|
|
1303
|
+
return n;
|
|
1304
|
+
}
|
|
1305
|
+
function G(e) {
|
|
1306
|
+
let t = [], n = e.root, r = W(e, n);
|
|
1307
|
+
if (!r) return t.push({
|
|
1308
|
+
path: "/root",
|
|
1309
|
+
message: "Root element is missing from elements map."
|
|
1310
|
+
}), t;
|
|
1311
|
+
if (r.type !== "ContextPanel") return t.push({
|
|
1312
|
+
path: `/elements/${n}`,
|
|
1313
|
+
message: `Root must be ContextPanel, got "${r.type}".`
|
|
1314
|
+
}), t;
|
|
1315
|
+
let i = 0;
|
|
1316
|
+
for (let n of r.children ?? []) {
|
|
1317
|
+
let r = W(e, n);
|
|
1318
|
+
if (!r) {
|
|
1319
|
+
t.push({
|
|
1320
|
+
path: `/elements/${n}`,
|
|
1321
|
+
message: `Child "${n}" referenced by ContextPanel is missing.`
|
|
1322
|
+
});
|
|
1323
|
+
continue;
|
|
1324
|
+
}
|
|
1325
|
+
if (!ur(r.type)) {
|
|
1326
|
+
t.push({
|
|
1327
|
+
path: `/elements/${n}`,
|
|
1328
|
+
message: `Direct child of ContextPanel must be ContextOverview or ContextCard — got "${r.type}".`
|
|
1329
|
+
});
|
|
1330
|
+
continue;
|
|
1331
|
+
}
|
|
1332
|
+
r.type === "ContextOverview" && (i += 1, i > 1 && t.push({
|
|
1333
|
+
path: `/elements/${n}`,
|
|
1334
|
+
message: "ContextOverview may appear at most once in ContextPanel."
|
|
1335
|
+
}));
|
|
1336
|
+
for (let r of dr(e, n)) {
|
|
1337
|
+
if (r === n) continue;
|
|
1338
|
+
let i = W(e, r);
|
|
1339
|
+
i && lr(i.type) && t.push({
|
|
1340
|
+
path: `/elements/${r}`,
|
|
1341
|
+
message: `Shell component "${i.type}" cannot be nested inside a card.`
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
return t;
|
|
1346
|
+
}
|
|
1347
|
+
function K(e) {
|
|
1348
|
+
return e.map((e) => `${(e.severity ?? "error").toUpperCase()} ${e.path}: ${e.message}`).join("\n");
|
|
1349
|
+
}
|
|
1350
|
+
//#endregion
|
|
1351
|
+
//#region src/context/validate-context-spec-deep.ts
|
|
1352
|
+
function q(e, t, n, r) {
|
|
1353
|
+
e.push({
|
|
1354
|
+
path: t,
|
|
1355
|
+
message: n,
|
|
1356
|
+
severity: r
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
function fr(e, t) {
|
|
1360
|
+
return t.length === 0 ? e : `${e}/${t.map((e) => typeof e == "number" ? `[${e}]` : `.${String(e)}`).join("").replace(/^\./, "")}`;
|
|
1361
|
+
}
|
|
1362
|
+
function pr(e) {
|
|
1363
|
+
return ar[e];
|
|
1364
|
+
}
|
|
1365
|
+
function mr(e) {
|
|
1366
|
+
return (e?.slots?.length ?? 0) === 0;
|
|
1367
|
+
}
|
|
1368
|
+
function hr(e, t) {
|
|
1369
|
+
for (let [n, r] of Object.entries(e.elements)) r && r.type === "ContextCard" && r.props.defaultExpanded === !1 && q(t, `/elements/${n}/props/defaultExpanded`, "defaultExpanded: false shows only the card header until the user expands the card.", "warn");
|
|
1370
|
+
}
|
|
1371
|
+
function gr(e) {
|
|
1372
|
+
let t = [];
|
|
1373
|
+
for (let n of G(e)) q(t, n.path, n.message, "error");
|
|
1374
|
+
let n = De(e);
|
|
1375
|
+
if (!n.valid) for (let e of n.issues) q(t, e.elementKey ? `/elements/${e.elementKey}` : "/", e.message, e.severity === "warning" ? "warn" : "error");
|
|
1376
|
+
let r = or.validate(e);
|
|
1377
|
+
if (!r.success && r.error) for (let e of r.error.issues) {
|
|
1378
|
+
let n = e.path.length > 0 ? `/${e.path.join("/")}` : "/";
|
|
1379
|
+
n.endsWith("/visible") || n.endsWith("/children") && e.message.includes("expected array, received undefined") || q(t, n, e.message, "error");
|
|
1380
|
+
}
|
|
1381
|
+
for (let [n, r] of Object.entries(e.elements)) {
|
|
1382
|
+
if (!r) continue;
|
|
1383
|
+
let e = pr(r.type);
|
|
1384
|
+
if (!e) {
|
|
1385
|
+
q(t, `/elements/${n}`, `Unknown component type "${r.type}" for context catalog.`, "error");
|
|
1386
|
+
continue;
|
|
1387
|
+
}
|
|
1388
|
+
if (e.props) {
|
|
1389
|
+
let i = e.props.safeParse(r.props ?? {});
|
|
1390
|
+
if (!i.success) for (let e of i.error.issues) q(t, fr(`/elements/${n}/props`, e.path), e.message, "error");
|
|
1391
|
+
}
|
|
1392
|
+
let i = r.children, a = mr(e);
|
|
1393
|
+
i === void 0 && a && q(t, `/elements/${n}/children`, `Leaf element "${r.type}" should include "children": [].`, "warn"), a && (i?.length ?? 0) > 0 && q(t, `/elements/${n}/children`, `Leaf component "${r.type}" must not have children.`, "error");
|
|
1394
|
+
}
|
|
1395
|
+
return hr(e, t), t;
|
|
1396
|
+
}
|
|
1397
|
+
function _r(e) {
|
|
1398
|
+
let t = [], n = structuredClone(e);
|
|
1399
|
+
for (let [e, r] of Object.entries(n.elements)) {
|
|
1400
|
+
if (!r) continue;
|
|
1401
|
+
let n = mr(pr(r.type));
|
|
1402
|
+
r.children === void 0 && n && (r.children = [], t.push(`Added children: [] to leaf element "${e}".`)), n && r.children && r.children.length > 0 && (r.children = [], t.push(`Removed illegal children from leaf element "${e}".`));
|
|
1403
|
+
}
|
|
1404
|
+
return {
|
|
1405
|
+
spec: n,
|
|
1406
|
+
fixes: t
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
function vr(e) {
|
|
1410
|
+
return e.some((e) => e.severity !== "warn");
|
|
1411
|
+
}
|
|
1412
|
+
function yr(e) {
|
|
1413
|
+
return K(gr(e));
|
|
1414
|
+
}
|
|
1415
|
+
//#endregion
|
|
1416
|
+
//#region src/core/catalog/alert.tsx
|
|
1417
|
+
var br = ({ props: e, emit: n, children: r }) => /* @__PURE__ */ S(t, {
|
|
1418
|
+
title: e.title,
|
|
1419
|
+
status: e.status ?? "info",
|
|
1420
|
+
...e.aiMark ? { aiMark: !0 } : {},
|
|
1421
|
+
...e.dismissible ? { onClose: () => n("close") } : {},
|
|
1422
|
+
children: r
|
|
1423
|
+
}), J = "zf6dad0";
|
|
1424
|
+
//#endregion
|
|
1425
|
+
//#region src/core/catalog/chart-utils.ts
|
|
1426
|
+
function Y(e, t = "monochrome") {
|
|
1427
|
+
let n = {
|
|
1428
|
+
monochrome: Pe,
|
|
1429
|
+
categorical: Ne,
|
|
1430
|
+
semantic: Fe
|
|
1431
|
+
}[t] ?? Pe;
|
|
1432
|
+
e.setThemes([Me.new(e), n.new(e)]);
|
|
1433
|
+
}
|
|
1434
|
+
//#endregion
|
|
1435
|
+
//#region src/core/catalog/bar-chart.tsx
|
|
1436
|
+
var xr = ({ props: e }) => {
|
|
1437
|
+
let t = y(null);
|
|
1438
|
+
return _(() => {
|
|
1439
|
+
let n = t.current;
|
|
1440
|
+
if (!n) return;
|
|
1441
|
+
let r, i = () => {
|
|
1442
|
+
r && r.dispose(), r = k.Root.new(n), Y(r, e.theme);
|
|
1443
|
+
let t = r.container.children.push(A.XYChart.new(r, { paddingLeft: 0 }));
|
|
1444
|
+
if (e.orientation === "horizontal") {
|
|
1445
|
+
let n = t.yAxes.push(A.CategoryAxis.new(r, {
|
|
1446
|
+
categoryField: "category",
|
|
1447
|
+
renderer: A.AxisRendererY.new(r, { minGridDistance: 20 })
|
|
1448
|
+
})), i = t.xAxes.push(A.ValueAxis.new(r, { renderer: A.AxisRendererX.new(r, {}) })), a = t.series.push(A.ColumnSeries.new(r, {
|
|
1449
|
+
xAxis: i,
|
|
1450
|
+
yAxis: n,
|
|
1451
|
+
valueXField: "value",
|
|
1452
|
+
categoryYField: "category"
|
|
1453
|
+
}));
|
|
1454
|
+
a.columns.template.setAll({ tooltipText: `{categoryY}: ${e.unit ?? ""}{valueX}` }), n.data.setAll(e.data), a.data.setAll(e.data);
|
|
1455
|
+
} else {
|
|
1456
|
+
let n = t.xAxes.push(A.CategoryAxis.new(r, {
|
|
1457
|
+
categoryField: "category",
|
|
1458
|
+
renderer: A.AxisRendererX.new(r, { minGridDistance: 30 })
|
|
1459
|
+
})), i = t.yAxes.push(A.ValueAxis.new(r, { renderer: A.AxisRendererY.new(r, {}) })), a = t.series.push(A.ColumnSeries.new(r, {
|
|
1460
|
+
xAxis: n,
|
|
1461
|
+
yAxis: i,
|
|
1462
|
+
valueYField: "value",
|
|
1463
|
+
categoryXField: "category"
|
|
1464
|
+
}));
|
|
1465
|
+
a.columns.template.setAll({ tooltipText: `{categoryX}: ${e.unit ?? ""}{valueY}` }), n.data.setAll(e.data), a.data.setAll(e.data);
|
|
1466
|
+
}
|
|
1467
|
+
}, a = new ResizeObserver((e) => {
|
|
1468
|
+
(e[0]?.contentRect.width ?? 0) > 0 && !r && i();
|
|
1469
|
+
});
|
|
1470
|
+
return a.observe(n), n.offsetWidth > 0 && i(), () => {
|
|
1471
|
+
a.disconnect(), r?.dispose();
|
|
1472
|
+
};
|
|
1473
|
+
}, []), /* @__PURE__ */ S("div", {
|
|
1474
|
+
ref: t,
|
|
1475
|
+
className: J,
|
|
1476
|
+
style: { height: e.height ?? 300 }
|
|
1477
|
+
});
|
|
1478
|
+
};
|
|
1479
|
+
//#endregion
|
|
1480
|
+
//#region src/utils/defined-props.ts
|
|
1481
|
+
function X(e) {
|
|
1482
|
+
let t = {};
|
|
1483
|
+
for (let n of Object.keys(e)) {
|
|
1484
|
+
let r = e[n];
|
|
1485
|
+
r !== void 0 && (t[n] = r);
|
|
1486
|
+
}
|
|
1487
|
+
return t;
|
|
1488
|
+
}
|
|
1489
|
+
//#endregion
|
|
1490
|
+
//#region src/core/catalog/button.tsx
|
|
1491
|
+
var Sr = ({ props: e, emit: t }) => /* @__PURE__ */ C(r, {
|
|
1492
|
+
appearance: e.appearance ?? "secondary",
|
|
1493
|
+
...X({
|
|
1494
|
+
size: e.size,
|
|
1495
|
+
loading: e.loading,
|
|
1496
|
+
disabled: e.disabled
|
|
466
1497
|
}),
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
})
|
|
495
|
-
|
|
496
|
-
|
|
1498
|
+
onClick: () => t("press"),
|
|
1499
|
+
children: [e.label, e.badge === void 0 ? null : /* @__PURE__ */ S(n, {
|
|
1500
|
+
"aria-label": e.badge ? `${e.badge} unread` : "unread",
|
|
1501
|
+
children: e.badge
|
|
1502
|
+
})]
|
|
1503
|
+
}), Cr = ({ props: e, children: t }) => {
|
|
1504
|
+
let n = e.title !== void 0 || e.description !== void 0;
|
|
1505
|
+
return /* @__PURE__ */ C(i, {
|
|
1506
|
+
flexDirection: "column",
|
|
1507
|
+
gap: "3",
|
|
1508
|
+
...X({
|
|
1509
|
+
background: e.background,
|
|
1510
|
+
padding: e.padding
|
|
1511
|
+
}),
|
|
1512
|
+
children: [n ? /* @__PURE__ */ C(l, {
|
|
1513
|
+
direction: "column",
|
|
1514
|
+
gap: "half",
|
|
1515
|
+
children: [e.title === void 0 ? null : /* @__PURE__ */ S(p, {
|
|
1516
|
+
variant: "headline",
|
|
1517
|
+
el: "h3",
|
|
1518
|
+
size: "small",
|
|
1519
|
+
children: e.title
|
|
1520
|
+
}), e.description === void 0 ? null : /* @__PURE__ */ S(p, {
|
|
1521
|
+
variant: "body",
|
|
1522
|
+
subdued: !0,
|
|
1523
|
+
children: e.description
|
|
1524
|
+
})]
|
|
1525
|
+
}) : null, t]
|
|
1526
|
+
});
|
|
1527
|
+
}, wr = T(D, {
|
|
1528
|
+
components: V,
|
|
1529
|
+
actions: z
|
|
1530
|
+
}), Tr = ({ props: e, bindings: t, emit: n }) => {
|
|
1531
|
+
let r = t?.checked, { state: i, set: o } = O(), s = r ? E(i, r) : void 0, c = r ? s ?? e.checked ?? !1 : e.checked ?? !1;
|
|
1532
|
+
return /* @__PURE__ */ S(a, {
|
|
497
1533
|
label: e.label,
|
|
498
|
-
checked:
|
|
1534
|
+
checked: c,
|
|
1535
|
+
...X({ disabled: e.disabled }),
|
|
499
1536
|
onClick: (e, t) => {
|
|
500
|
-
|
|
1537
|
+
r && o(r, !(t?.checked ?? !1)), n("change");
|
|
501
1538
|
}
|
|
502
1539
|
});
|
|
503
|
-
},
|
|
504
|
-
"check-circle":
|
|
505
|
-
"in-progress":
|
|
506
|
-
"radio-button-unchecked":
|
|
507
|
-
},
|
|
508
|
-
let n = e.icon ?
|
|
509
|
-
return /* @__PURE__ */
|
|
1540
|
+
}, Er = {
|
|
1541
|
+
"check-circle": Ie,
|
|
1542
|
+
"in-progress": Re,
|
|
1543
|
+
"radio-button-unchecked": Le
|
|
1544
|
+
}, Dr = ({ props: e, emit: t }) => {
|
|
1545
|
+
let n = e.icon ? Er[e.icon] : void 0, r = e.removable && e.size !== "small" ? () => t("close") : void 0;
|
|
1546
|
+
return /* @__PURE__ */ S(o, {
|
|
510
1547
|
label: e.label,
|
|
511
|
-
...
|
|
1548
|
+
...X({
|
|
512
1549
|
size: e.size,
|
|
513
1550
|
color: e.color,
|
|
514
1551
|
icon: n,
|
|
515
1552
|
onClose: r
|
|
516
1553
|
})
|
|
517
1554
|
});
|
|
518
|
-
},
|
|
1555
|
+
}, Or = ({ props: e }) => /* @__PURE__ */ S(s, { ...X({
|
|
519
1556
|
vertical: e.vertical,
|
|
520
1557
|
spacing: e.spacing,
|
|
521
1558
|
alignContent: e.alignContent
|
|
522
|
-
}) }),
|
|
523
|
-
let t =
|
|
524
|
-
return
|
|
1559
|
+
}) }), kr = ({ props: e }) => {
|
|
1560
|
+
let t = y(null);
|
|
1561
|
+
return _(() => {
|
|
525
1562
|
let n = t.current;
|
|
526
1563
|
if (!n) return;
|
|
527
1564
|
let r, i = () => {
|
|
528
|
-
r && r.dispose(), r =
|
|
529
|
-
let t = r.container.children.push(
|
|
1565
|
+
r && r.dispose(), r = k.Root.new(n), Y(r, e.theme);
|
|
1566
|
+
let t = r.container.children.push(ze.PieChart.new(r, {
|
|
530
1567
|
layout: r.horizontalLayout,
|
|
531
|
-
innerRadius:
|
|
532
|
-
})), i = t.series.push(
|
|
1568
|
+
innerRadius: k.percent(50)
|
|
1569
|
+
})), i = t.series.push(ze.PieSeries.new(r, {
|
|
533
1570
|
valueField: "value",
|
|
534
1571
|
categoryField: "category",
|
|
535
1572
|
legendValueText: ""
|
|
536
1573
|
}));
|
|
537
|
-
i.labels.template.set("text", "{valuePercentTotal.formatNumber('#.')}%"), i.data.setAll(e.data), (e.showLegend ?? !0) && t.children.push(
|
|
538
|
-
centerY:
|
|
539
|
-
y:
|
|
1574
|
+
i.labels.template.set("text", "{valuePercentTotal.formatNumber('#.')}%"), i.data.setAll(e.data), (e.showLegend ?? !0) && t.children.push(k.Legend.new(r, {
|
|
1575
|
+
centerY: k.percent(50),
|
|
1576
|
+
y: k.percent(50),
|
|
540
1577
|
layout: r.verticalLayout
|
|
541
1578
|
})).data.setAll(i.dataItems);
|
|
542
1579
|
}, a = new ResizeObserver((e) => {
|
|
@@ -545,107 +1582,109 @@ var ge = ({ props: e }) => {
|
|
|
545
1582
|
return a.observe(n), n.offsetWidth > 0 && i(), () => {
|
|
546
1583
|
a.disconnect(), r?.dispose();
|
|
547
1584
|
};
|
|
548
|
-
}, []), /* @__PURE__ */
|
|
1585
|
+
}, []), /* @__PURE__ */ S("div", {
|
|
549
1586
|
ref: t,
|
|
550
|
-
className:
|
|
1587
|
+
className: J,
|
|
551
1588
|
style: { height: e.height ?? 300 }
|
|
552
1589
|
});
|
|
553
|
-
},
|
|
554
|
-
...
|
|
1590
|
+
}, Ar = ({ props: e, children: t }) => /* @__PURE__ */ S(l, {
|
|
1591
|
+
...X({
|
|
555
1592
|
direction: e.direction,
|
|
556
1593
|
gap: e.gap,
|
|
557
1594
|
alignItems: e.alignItems,
|
|
558
1595
|
justifyContent: e.justifyContent,
|
|
1596
|
+
alignSelf: e.alignSelf,
|
|
559
1597
|
wrap: e.wrap,
|
|
560
1598
|
grow: e.grow,
|
|
561
1599
|
shrink: e.shrink,
|
|
1600
|
+
basis: e.basis,
|
|
562
1601
|
inline: e.inline
|
|
563
1602
|
}),
|
|
564
1603
|
children: t
|
|
565
|
-
}),
|
|
1604
|
+
}), jr = (...e) => e.filter(Boolean).join(" "), Mr = "_1v76lkh0", Nr = "_1v76lkh1";
|
|
566
1605
|
//#endregion
|
|
567
1606
|
//#region src/core/catalog/grid.tsx
|
|
568
|
-
function
|
|
1607
|
+
function Pr(e) {
|
|
569
1608
|
let t = e.match(/repeat\(\s*(\d+)/);
|
|
570
1609
|
return t?.[1] ? Number(t[1]) : e.trim().split(/\s+/).length;
|
|
571
1610
|
}
|
|
572
|
-
var
|
|
1611
|
+
var Fr = ({ props: e, children: t }) => {
|
|
573
1612
|
if (e.bordered) {
|
|
574
|
-
let n = e.templateColumns ?? "1fr", r =
|
|
575
|
-
return /* @__PURE__ */
|
|
576
|
-
className:
|
|
1613
|
+
let n = e.templateColumns ?? "1fr", r = g.count(t), i = Math.max(1, Pr(n)), a = Math.max(0, r - (r % i || i));
|
|
1614
|
+
return /* @__PURE__ */ S("div", {
|
|
1615
|
+
className: Mr,
|
|
577
1616
|
style: { gridTemplateColumns: n },
|
|
578
|
-
children:
|
|
579
|
-
className:
|
|
1617
|
+
children: g.map(t, (e, t) => /* @__PURE__ */ S("div", {
|
|
1618
|
+
className: jr(Nr, t < a && "_1v76lkh2"),
|
|
580
1619
|
children: e
|
|
581
1620
|
}))
|
|
582
1621
|
});
|
|
583
1622
|
}
|
|
584
|
-
return /* @__PURE__ */
|
|
1623
|
+
return /* @__PURE__ */ S(u, {
|
|
585
1624
|
templateColumns: e.templateColumns,
|
|
586
1625
|
gap: e.gap ?? "2",
|
|
587
1626
|
children: t
|
|
588
1627
|
});
|
|
589
|
-
},
|
|
590
|
-
"check-circle":
|
|
591
|
-
"in-progress":
|
|
592
|
-
"radio-button-unchecked":
|
|
593
|
-
},
|
|
594
|
-
let t =
|
|
595
|
-
return t ? /* @__PURE__ */
|
|
1628
|
+
}, Ir = {
|
|
1629
|
+
"check-circle": Ie,
|
|
1630
|
+
"in-progress": Re,
|
|
1631
|
+
"radio-button-unchecked": Le
|
|
1632
|
+
}, Lr = ({ props: e }) => {
|
|
1633
|
+
let t = Ir[e.name];
|
|
1634
|
+
return t ? /* @__PURE__ */ S(d, {
|
|
596
1635
|
svg: t,
|
|
597
|
-
...
|
|
1636
|
+
...X({
|
|
598
1637
|
size: e.size,
|
|
599
1638
|
color: e.color
|
|
600
1639
|
})
|
|
601
1640
|
}) : null;
|
|
602
|
-
},
|
|
603
|
-
let
|
|
604
|
-
return /* @__PURE__ */
|
|
1641
|
+
}, Rr = ({ props: e, bindings: t, emit: n }) => {
|
|
1642
|
+
let r = t?.value, { state: i, set: a } = O(), o = r ? E(i, r) : void 0, s = r ? o ?? e.value ?? "" : e.value ?? "";
|
|
1643
|
+
return /* @__PURE__ */ S(se, {
|
|
605
1644
|
label: e.label,
|
|
606
1645
|
type: e.type ?? "text",
|
|
607
|
-
value:
|
|
608
|
-
...
|
|
1646
|
+
value: s,
|
|
1647
|
+
...X({
|
|
609
1648
|
placeholder: e.placeholder,
|
|
610
1649
|
disabled: e.disabled
|
|
611
1650
|
}),
|
|
612
1651
|
onChange: (e) => {
|
|
613
|
-
|
|
1652
|
+
r && a(r, e.target.value), n("change");
|
|
614
1653
|
}
|
|
615
1654
|
});
|
|
616
|
-
},
|
|
617
|
-
let t =
|
|
618
|
-
return
|
|
1655
|
+
}, zr = ({ props: e }) => {
|
|
1656
|
+
let t = y(null);
|
|
1657
|
+
return _(() => {
|
|
619
1658
|
let n = t.current;
|
|
620
1659
|
if (!n) return;
|
|
621
1660
|
let r, i = () => {
|
|
622
|
-
r && r.dispose(), r =
|
|
623
|
-
let t = r.container.children.push(
|
|
1661
|
+
r && r.dispose(), r = k.Root.new(n), Y(r, e.theme);
|
|
1662
|
+
let t = r.container.children.push(A.XYChart.new(r, { paddingLeft: 0 })), i = t.xAxes.push(A.CategoryAxis.new(r, {
|
|
624
1663
|
categoryField: "category",
|
|
625
|
-
renderer:
|
|
626
|
-
})), a = t.yAxes.push(
|
|
1664
|
+
renderer: A.AxisRendererX.new(r, { minGridDistance: 30 })
|
|
1665
|
+
})), a = t.yAxes.push(A.ValueAxis.new(r, { renderer: A.AxisRendererY.new(r, {}) })), o = e.data[0], s = e.series ?? (o ? Object.keys(o).filter((e) => e !== "category") : []);
|
|
627
1666
|
for (let n of s) {
|
|
628
|
-
let o = t.series.push(
|
|
1667
|
+
let o = t.series.push(A.LineSeries.new(r, {
|
|
629
1668
|
name: n,
|
|
630
1669
|
xAxis: i,
|
|
631
1670
|
yAxis: a,
|
|
632
1671
|
valueYField: n,
|
|
633
1672
|
categoryXField: "category",
|
|
634
|
-
tooltip:
|
|
1673
|
+
tooltip: k.Tooltip.new(r, { labelText: `${n}: ${e.unit ?? ""}{valueY}` })
|
|
635
1674
|
}));
|
|
636
1675
|
o.strokes.template.setAll({ strokeWidth: 2 }), (e.showDots ?? !0) && o.bullets.push(() => {
|
|
637
1676
|
if (!r) throw Error("Chart root is not initialized");
|
|
638
1677
|
let e = o.get("fill");
|
|
639
|
-
return
|
|
1678
|
+
return k.Bullet.new(r, { sprite: k.Circle.new(r, {
|
|
640
1679
|
radius: 4,
|
|
641
1680
|
...e ? { fill: e } : {},
|
|
642
1681
|
strokeWidth: 0
|
|
643
1682
|
}) });
|
|
644
1683
|
}), o.data.setAll(e.data);
|
|
645
1684
|
}
|
|
646
|
-
i.data.setAll(e.data), (e.showLegend ?? s.length > 1) && t.children.push(
|
|
647
|
-
centerX:
|
|
648
|
-
x:
|
|
1685
|
+
i.data.setAll(e.data), (e.showLegend ?? s.length > 1) && t.children.push(k.Legend.new(r, {
|
|
1686
|
+
centerX: k.percent(50),
|
|
1687
|
+
x: k.percent(50),
|
|
649
1688
|
marginTop: 8
|
|
650
1689
|
})).data.setAll(t.series.values);
|
|
651
1690
|
}, a = new ResizeObserver((e) => {
|
|
@@ -654,114 +1693,51 @@ var Ie = ({ props: e, children: t }) => {
|
|
|
654
1693
|
return a.observe(n), n.offsetWidth > 0 && i(), () => {
|
|
655
1694
|
a.disconnect(), r?.dispose();
|
|
656
1695
|
};
|
|
657
|
-
}, []), /* @__PURE__ */
|
|
1696
|
+
}, []), /* @__PURE__ */ S("div", {
|
|
658
1697
|
ref: t,
|
|
659
|
-
className:
|
|
1698
|
+
className: J,
|
|
660
1699
|
style: { height: e.height ?? 300 }
|
|
661
1700
|
});
|
|
662
|
-
},
|
|
663
|
-
let { label:
|
|
1701
|
+
}, Br = ({ props: e, emit: t }) => {
|
|
1702
|
+
let { label: r, href: i, appearance: a, target: o, ghost: s, badge: c } = e, l = (e) => {
|
|
664
1703
|
e.preventDefault(), t("press");
|
|
665
|
-
}
|
|
666
|
-
|
|
1704
|
+
}, u = c === void 0 ? r : /* @__PURE__ */ C("span", {
|
|
1705
|
+
style: {
|
|
1706
|
+
position: "relative",
|
|
1707
|
+
display: "inline-flex",
|
|
1708
|
+
alignItems: "center"
|
|
1709
|
+
},
|
|
1710
|
+
children: [r, /* @__PURE__ */ S(n, {
|
|
1711
|
+
"aria-label": c ? `${c} unread` : "unread",
|
|
1712
|
+
offset: {
|
|
1713
|
+
x: "8px",
|
|
1714
|
+
y: "0px"
|
|
1715
|
+
},
|
|
1716
|
+
children: c
|
|
1717
|
+
})]
|
|
1718
|
+
});
|
|
1719
|
+
return a === "secondary" ? /* @__PURE__ */ S(f, {
|
|
667
1720
|
appearance: "secondary",
|
|
668
1721
|
ghost: !1,
|
|
669
|
-
href:
|
|
670
|
-
...
|
|
671
|
-
onClick:
|
|
672
|
-
children:
|
|
673
|
-
}) :
|
|
1722
|
+
href: i,
|
|
1723
|
+
...o ? { target: o } : {},
|
|
1724
|
+
onClick: l,
|
|
1725
|
+
children: u
|
|
1726
|
+
}) : s === void 0 ? /* @__PURE__ */ S(f, {
|
|
674
1727
|
appearance: "primary",
|
|
675
|
-
href:
|
|
676
|
-
...
|
|
677
|
-
onClick:
|
|
678
|
-
children:
|
|
679
|
-
}) : /* @__PURE__ */
|
|
1728
|
+
href: i,
|
|
1729
|
+
...o ? { target: o } : {},
|
|
1730
|
+
onClick: l,
|
|
1731
|
+
children: u
|
|
1732
|
+
}) : /* @__PURE__ */ S(f, {
|
|
680
1733
|
appearance: "primary",
|
|
681
|
-
ghost:
|
|
682
|
-
href:
|
|
683
|
-
...
|
|
684
|
-
onClick:
|
|
685
|
-
children:
|
|
1734
|
+
ghost: s,
|
|
1735
|
+
href: i,
|
|
1736
|
+
...o ? { target: o } : {},
|
|
1737
|
+
onClick: l,
|
|
1738
|
+
children: u
|
|
686
1739
|
});
|
|
687
|
-
}
|
|
688
|
-
//#endregion
|
|
689
|
-
//#region ../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.20.1/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
690
|
-
function He(e, t) {
|
|
691
|
-
if (typeof e != "object" || !e) return e;
|
|
692
|
-
var n = e[Symbol.toPrimitive];
|
|
693
|
-
if (n !== void 0) {
|
|
694
|
-
var r = n.call(e, t || "default");
|
|
695
|
-
if (typeof r != "object") return r;
|
|
696
|
-
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
697
|
-
}
|
|
698
|
-
return (t === "string" ? String : Number)(e);
|
|
699
|
-
}
|
|
700
|
-
function Ue(e) {
|
|
701
|
-
var t = He(e, "string");
|
|
702
|
-
return typeof t == "symbol" ? t : String(t);
|
|
703
|
-
}
|
|
704
|
-
function We(e, t, n) {
|
|
705
|
-
return t = Ue(t), t in e ? Object.defineProperty(e, t, {
|
|
706
|
-
value: n,
|
|
707
|
-
enumerable: !0,
|
|
708
|
-
configurable: !0,
|
|
709
|
-
writable: !0
|
|
710
|
-
}) : e[t] = n, e;
|
|
711
|
-
}
|
|
712
|
-
function Ge(e, t) {
|
|
713
|
-
var n = Object.keys(e);
|
|
714
|
-
if (Object.getOwnPropertySymbols) {
|
|
715
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
716
|
-
t && (r = r.filter(function(t) {
|
|
717
|
-
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
718
|
-
})), n.push.apply(n, r);
|
|
719
|
-
}
|
|
720
|
-
return n;
|
|
721
|
-
}
|
|
722
|
-
function Ke(e) {
|
|
723
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
724
|
-
var n = arguments[t] == null ? {} : arguments[t];
|
|
725
|
-
t % 2 ? Ge(Object(n), !0).forEach(function(t) {
|
|
726
|
-
We(e, t, n[t]);
|
|
727
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ge(Object(n)).forEach(function(t) {
|
|
728
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
return e;
|
|
732
|
-
}
|
|
733
|
-
function qe(e, t) {
|
|
734
|
-
var n = {};
|
|
735
|
-
for (var r in e) n[r] = t(e[r], r);
|
|
736
|
-
return n;
|
|
737
|
-
}
|
|
738
|
-
var Je = (e, t, n) => {
|
|
739
|
-
for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
|
|
740
|
-
return !0;
|
|
741
|
-
}, Ye = (e) => {
|
|
742
|
-
var t = (t) => {
|
|
743
|
-
var n = e.defaultClassName, r = Ke(Ke({}, e.defaultVariants), t);
|
|
744
|
-
for (var i in r) {
|
|
745
|
-
var a = r[i] ?? e.defaultVariants[i];
|
|
746
|
-
if (a != null) {
|
|
747
|
-
var o = a;
|
|
748
|
-
typeof o == "boolean" && (o = o === !0 ? "true" : "false");
|
|
749
|
-
var s = e.variantClassNames[i][o];
|
|
750
|
-
s && (n += " " + s);
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
for (var [c, l] of e.compoundVariants) Je(c, r, e.defaultVariants) && (n += " " + l);
|
|
754
|
-
return n;
|
|
755
|
-
};
|
|
756
|
-
return t.variants = () => Object.keys(e.variantClassNames), t.classNames = {
|
|
757
|
-
get base() {
|
|
758
|
-
return e.defaultClassName.split(" ")[0];
|
|
759
|
-
},
|
|
760
|
-
get variants() {
|
|
761
|
-
return qe(e.variantClassNames, (e) => qe(e, (e) => e.split(" ")[0]));
|
|
762
|
-
}
|
|
763
|
-
}, t;
|
|
764
|
-
}, Xe = Ye({
|
|
1740
|
+
}, Vr = j({
|
|
765
1741
|
defaultClassName: "_1le8ba60",
|
|
766
1742
|
variantClassNames: { disabled: {
|
|
767
1743
|
true: "_1le8ba61",
|
|
@@ -769,163 +1745,151 @@ var Je = (e, t, n) => {
|
|
|
769
1745
|
} },
|
|
770
1746
|
defaultVariants: {},
|
|
771
1747
|
compoundVariants: []
|
|
772
|
-
}),
|
|
1748
|
+
}), Hr = [
|
|
773
1749
|
{
|
|
774
1750
|
name: "Text",
|
|
775
|
-
catalog:
|
|
776
|
-
renderer: ({ props: e }) => {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
variant: "body",
|
|
807
|
-
size: e.size,
|
|
808
|
-
children: e.content
|
|
809
|
-
});
|
|
810
|
-
},
|
|
811
|
-
renderers: N
|
|
1751
|
+
catalog: tr,
|
|
1752
|
+
renderer: ({ props: e }) => e.variant === "headline" ? e.size === void 0 ? /* @__PURE__ */ S(p, {
|
|
1753
|
+
variant: "headline",
|
|
1754
|
+
el: "h3",
|
|
1755
|
+
children: e.content
|
|
1756
|
+
}) : /* @__PURE__ */ S(p, {
|
|
1757
|
+
variant: "headline",
|
|
1758
|
+
el: "h3",
|
|
1759
|
+
size: e.size,
|
|
1760
|
+
children: e.content
|
|
1761
|
+
}) : e.variant === "eyebrow" ? /* @__PURE__ */ S(p, {
|
|
1762
|
+
variant: "eyebrow",
|
|
1763
|
+
children: e.content
|
|
1764
|
+
}) : e.size !== void 0 && e.subdued !== void 0 ? /* @__PURE__ */ S(p, {
|
|
1765
|
+
variant: "body",
|
|
1766
|
+
size: e.size,
|
|
1767
|
+
subdued: e.subdued,
|
|
1768
|
+
children: e.content
|
|
1769
|
+
}) : e.size === void 0 ? e.subdued === void 0 ? /* @__PURE__ */ S(p, {
|
|
1770
|
+
variant: "body",
|
|
1771
|
+
children: e.content
|
|
1772
|
+
}) : /* @__PURE__ */ S(p, {
|
|
1773
|
+
variant: "body",
|
|
1774
|
+
subdued: e.subdued,
|
|
1775
|
+
children: e.content
|
|
1776
|
+
}) : /* @__PURE__ */ S(p, {
|
|
1777
|
+
variant: "body",
|
|
1778
|
+
size: e.size,
|
|
1779
|
+
children: e.content
|
|
1780
|
+
}),
|
|
1781
|
+
renderers: ["all"]
|
|
812
1782
|
},
|
|
813
1783
|
{
|
|
814
1784
|
name: "Card",
|
|
815
|
-
catalog:
|
|
816
|
-
renderer:
|
|
817
|
-
renderers:
|
|
1785
|
+
catalog: Vn,
|
|
1786
|
+
renderer: Cr,
|
|
1787
|
+
renderers: ["all"]
|
|
818
1788
|
},
|
|
819
1789
|
{
|
|
820
1790
|
name: "Flex",
|
|
821
|
-
catalog:
|
|
822
|
-
renderer:
|
|
823
|
-
renderers:
|
|
1791
|
+
catalog: Kn,
|
|
1792
|
+
renderer: Ar,
|
|
1793
|
+
renderers: ["all"]
|
|
824
1794
|
},
|
|
825
1795
|
{
|
|
826
1796
|
name: "Grid",
|
|
827
|
-
catalog:
|
|
828
|
-
renderer:
|
|
829
|
-
renderers:
|
|
1797
|
+
catalog: B,
|
|
1798
|
+
renderer: Fr,
|
|
1799
|
+
renderers: ["all"]
|
|
830
1800
|
},
|
|
831
1801
|
{
|
|
832
1802
|
name: "Alert",
|
|
833
|
-
catalog:
|
|
834
|
-
renderer:
|
|
835
|
-
renderers:
|
|
1803
|
+
catalog: Rn,
|
|
1804
|
+
renderer: br,
|
|
1805
|
+
renderers: ["all"]
|
|
836
1806
|
},
|
|
837
1807
|
{
|
|
838
1808
|
name: "Divider",
|
|
839
|
-
catalog:
|
|
840
|
-
renderer:
|
|
841
|
-
renderers:
|
|
1809
|
+
catalog: Wn,
|
|
1810
|
+
renderer: Or,
|
|
1811
|
+
renderers: ["all"]
|
|
842
1812
|
},
|
|
843
1813
|
{
|
|
844
1814
|
name: "Icon",
|
|
845
|
-
catalog:
|
|
846
|
-
renderer:
|
|
847
|
-
renderers:
|
|
848
|
-
},
|
|
849
|
-
{
|
|
850
|
-
name: "Badge",
|
|
851
|
-
catalog: I,
|
|
852
|
-
renderer: he,
|
|
853
|
-
renderers: N
|
|
1815
|
+
catalog: qn,
|
|
1816
|
+
renderer: Lr,
|
|
1817
|
+
renderers: ["all"]
|
|
854
1818
|
},
|
|
855
1819
|
{
|
|
856
1820
|
name: "Chip",
|
|
857
|
-
catalog:
|
|
858
|
-
renderer:
|
|
859
|
-
renderers:
|
|
1821
|
+
catalog: Un,
|
|
1822
|
+
renderer: Dr,
|
|
1823
|
+
renderers: ["all"]
|
|
860
1824
|
},
|
|
861
1825
|
{
|
|
862
1826
|
name: "Link",
|
|
863
|
-
catalog:
|
|
864
|
-
renderer:
|
|
865
|
-
renderers:
|
|
1827
|
+
catalog: Xn,
|
|
1828
|
+
renderer: Br,
|
|
1829
|
+
renderers: ["all"]
|
|
866
1830
|
},
|
|
867
1831
|
{
|
|
868
1832
|
name: "ProgressBar",
|
|
869
|
-
catalog:
|
|
1833
|
+
catalog: Qn,
|
|
870
1834
|
renderer: ({ props: e }) => {
|
|
871
|
-
let t =
|
|
872
|
-
return e.indeterminate || e.value === void 0 ? /* @__PURE__ */
|
|
1835
|
+
let t = X({ description: e.description });
|
|
1836
|
+
return e.indeterminate || e.value === void 0 ? /* @__PURE__ */ S(ne, {
|
|
873
1837
|
label: e.label,
|
|
874
1838
|
indeterminate: !0,
|
|
875
1839
|
...t
|
|
876
|
-
}) : /* @__PURE__ */
|
|
1840
|
+
}) : /* @__PURE__ */ S(ne, {
|
|
877
1841
|
label: e.label,
|
|
878
1842
|
value: e.value,
|
|
879
1843
|
...t
|
|
880
1844
|
});
|
|
881
1845
|
},
|
|
882
|
-
renderers:
|
|
1846
|
+
renderers: ["all"]
|
|
883
1847
|
},
|
|
884
1848
|
{
|
|
885
1849
|
name: "BarChart",
|
|
886
|
-
catalog:
|
|
887
|
-
renderer:
|
|
888
|
-
renderers:
|
|
1850
|
+
catalog: zn,
|
|
1851
|
+
renderer: xr,
|
|
1852
|
+
renderers: ["all"]
|
|
889
1853
|
},
|
|
890
1854
|
{
|
|
891
1855
|
name: "DonutChart",
|
|
892
|
-
catalog:
|
|
893
|
-
renderer:
|
|
894
|
-
renderers:
|
|
1856
|
+
catalog: Gn,
|
|
1857
|
+
renderer: kr,
|
|
1858
|
+
renderers: ["all"]
|
|
895
1859
|
},
|
|
896
1860
|
{
|
|
897
1861
|
name: "LineChart",
|
|
898
|
-
catalog:
|
|
899
|
-
renderer:
|
|
900
|
-
renderers:
|
|
1862
|
+
catalog: Yn,
|
|
1863
|
+
renderer: zr,
|
|
1864
|
+
renderers: ["all"]
|
|
901
1865
|
},
|
|
902
1866
|
{
|
|
903
1867
|
name: "Button",
|
|
904
|
-
catalog:
|
|
905
|
-
renderer:
|
|
906
|
-
renderers:
|
|
1868
|
+
catalog: Bn,
|
|
1869
|
+
renderer: Sr,
|
|
1870
|
+
renderers: ["all"]
|
|
907
1871
|
},
|
|
908
1872
|
{
|
|
909
1873
|
name: "Checkbox",
|
|
910
|
-
catalog:
|
|
911
|
-
renderer:
|
|
912
|
-
renderers:
|
|
1874
|
+
catalog: Hn,
|
|
1875
|
+
renderer: Tr,
|
|
1876
|
+
renderers: ["all"]
|
|
913
1877
|
},
|
|
914
1878
|
{
|
|
915
1879
|
name: "Input",
|
|
916
|
-
catalog:
|
|
917
|
-
renderer:
|
|
918
|
-
renderers:
|
|
1880
|
+
catalog: Jn,
|
|
1881
|
+
renderer: Rr,
|
|
1882
|
+
renderers: ["all"]
|
|
919
1883
|
},
|
|
920
1884
|
{
|
|
921
1885
|
name: "Textarea",
|
|
922
|
-
catalog:
|
|
923
|
-
renderer: ({ props: e, bindings:
|
|
924
|
-
let
|
|
925
|
-
return /* @__PURE__ */
|
|
1886
|
+
catalog: nr,
|
|
1887
|
+
renderer: ({ props: e, bindings: t, emit: n }) => {
|
|
1888
|
+
let r = t?.value, { state: i, set: a } = O(), o = r ? E(i, r) : void 0, s = r ? o ?? e.value ?? "" : e.value ?? "";
|
|
1889
|
+
return /* @__PURE__ */ S(ce, {
|
|
926
1890
|
label: e.label,
|
|
927
|
-
value:
|
|
928
|
-
...
|
|
1891
|
+
value: s,
|
|
1892
|
+
...X({
|
|
929
1893
|
placeholder: e.placeholder,
|
|
930
1894
|
description: e.description,
|
|
931
1895
|
moreInfo: e.moreInfo,
|
|
@@ -933,123 +1897,93 @@ var Je = (e, t, n) => {
|
|
|
933
1897
|
disabled: e.disabled
|
|
934
1898
|
}),
|
|
935
1899
|
onChange: (e) => {
|
|
936
|
-
|
|
1900
|
+
r && a(r, e.target.value), n("change");
|
|
937
1901
|
}
|
|
938
1902
|
});
|
|
939
1903
|
},
|
|
940
|
-
renderers:
|
|
1904
|
+
renderers: ["all"]
|
|
941
1905
|
},
|
|
942
1906
|
{
|
|
943
1907
|
name: "Listbox",
|
|
944
|
-
catalog:
|
|
945
|
-
renderer: ({ props: e, bindings:
|
|
946
|
-
let
|
|
1908
|
+
catalog: Zn,
|
|
1909
|
+
renderer: ({ props: e, bindings: t, emit: n }) => {
|
|
1910
|
+
let r = t?.value, { state: i, set: a } = O(), o = r ? E(i, r) : void 0, s = r ? o ?? e.value ?? "" : e.value ?? "", l = e.options.map((e) => ({
|
|
947
1911
|
id: e.value,
|
|
948
1912
|
label: e.label
|
|
949
|
-
})),
|
|
950
|
-
return /* @__PURE__ */
|
|
951
|
-
className:
|
|
952
|
-
children: [/* @__PURE__ */
|
|
953
|
-
items:
|
|
954
|
-
...
|
|
1913
|
+
})), u = l.find((e) => e.id === s);
|
|
1914
|
+
return /* @__PURE__ */ C("div", {
|
|
1915
|
+
className: Vr({ disabled: e.disabled ?? !1 }),
|
|
1916
|
+
children: [/* @__PURE__ */ S(c, { children: e.label }), /* @__PURE__ */ S(ee, {
|
|
1917
|
+
items: l,
|
|
1918
|
+
...u ? { selected: u } : {},
|
|
955
1919
|
onSelectionChange: (e) => {
|
|
956
1920
|
let t = e?.id ?? "";
|
|
957
|
-
|
|
1921
|
+
r && a(r, t), n("change");
|
|
958
1922
|
},
|
|
959
|
-
children: ({ items: e }) => e.map((e) => /* @__PURE__ */
|
|
1923
|
+
children: ({ items: e }) => e.map((e) => /* @__PURE__ */ S(ee.Option, {
|
|
960
1924
|
item: e,
|
|
961
1925
|
children: e.label
|
|
962
1926
|
}, e.id))
|
|
963
1927
|
})]
|
|
964
1928
|
});
|
|
965
1929
|
},
|
|
966
|
-
renderers:
|
|
1930
|
+
renderers: ["all"]
|
|
967
1931
|
},
|
|
968
1932
|
{
|
|
969
1933
|
name: "RadioGroup",
|
|
970
|
-
catalog:
|
|
971
|
-
renderer: ({ props: e, bindings:
|
|
972
|
-
let
|
|
973
|
-
return /* @__PURE__ */
|
|
1934
|
+
catalog: $n,
|
|
1935
|
+
renderer: ({ props: e, bindings: t, emit: n }) => {
|
|
1936
|
+
let r = t?.value, { state: i, set: a } = O(), o = r ? E(i, r) : void 0, s = r ? o ?? e.value ?? "" : e.value ?? "";
|
|
1937
|
+
return /* @__PURE__ */ S(re.Group, {
|
|
974
1938
|
legend: e.label,
|
|
975
|
-
children: e.options.map((
|
|
976
|
-
label:
|
|
977
|
-
value:
|
|
978
|
-
checked:
|
|
1939
|
+
children: e.options.map((t) => /* @__PURE__ */ S(re, {
|
|
1940
|
+
label: t.label,
|
|
1941
|
+
value: t.value,
|
|
1942
|
+
checked: s === t.value,
|
|
1943
|
+
...X({ disabled: e.disabled }),
|
|
979
1944
|
onChange: () => {
|
|
980
|
-
|
|
1945
|
+
r && a(r, t.value), n("change");
|
|
981
1946
|
}
|
|
982
|
-
},
|
|
1947
|
+
}, t.value))
|
|
983
1948
|
});
|
|
984
1949
|
},
|
|
985
|
-
renderers:
|
|
1950
|
+
renderers: ["all"]
|
|
986
1951
|
},
|
|
987
1952
|
{
|
|
988
1953
|
name: "Switch",
|
|
989
|
-
catalog:
|
|
990
|
-
renderer: ({ props: e, bindings:
|
|
991
|
-
let
|
|
992
|
-
return /* @__PURE__ */
|
|
1954
|
+
catalog: er,
|
|
1955
|
+
renderer: ({ props: e, bindings: t, emit: n }) => {
|
|
1956
|
+
let r = t?.checked, { state: i, set: a } = O(), o = r ? E(i, r) : void 0, s = r ? o ?? e.checked ?? !1 : e.checked ?? !1;
|
|
1957
|
+
return /* @__PURE__ */ S(oe, {
|
|
993
1958
|
label: e.label,
|
|
994
1959
|
value: e.label,
|
|
995
|
-
checked:
|
|
1960
|
+
checked: s,
|
|
1961
|
+
...X({ disabled: e.disabled }),
|
|
996
1962
|
onChange: (e, t) => {
|
|
997
|
-
|
|
1963
|
+
r && a(r, t?.checked ?? !1), n("change");
|
|
998
1964
|
}
|
|
999
1965
|
});
|
|
1000
1966
|
},
|
|
1001
|
-
renderers:
|
|
1967
|
+
renderers: ["all"]
|
|
1002
1968
|
}
|
|
1003
1969
|
];
|
|
1004
|
-
Object.fromEntries(
|
|
1005
|
-
//#endregion
|
|
1006
|
-
//#region src/team-catalog.ts
|
|
1007
|
-
function Qe(e) {
|
|
1008
|
-
return e;
|
|
1009
|
-
}
|
|
1010
|
-
function $e(t) {
|
|
1011
|
-
let n = {
|
|
1012
|
-
...we,
|
|
1013
|
-
...t.components ?? {}
|
|
1014
|
-
}, r = Object.fromEntries(Object.entries(t.actions ?? {}).map(([e, n]) => [`${t.prefix}.${e}`, n])), i = e(s, {
|
|
1015
|
-
components: n,
|
|
1016
|
-
actions: {
|
|
1017
|
-
...M,
|
|
1018
|
-
...r
|
|
1019
|
-
}
|
|
1020
|
-
});
|
|
1021
|
-
return {
|
|
1022
|
-
prefix: t.prefix,
|
|
1023
|
-
catalog: i,
|
|
1024
|
-
prompt(e) {
|
|
1025
|
-
let n = [
|
|
1026
|
-
i.prompt(),
|
|
1027
|
-
"\n",
|
|
1028
|
-
e
|
|
1029
|
-
];
|
|
1030
|
-
return t.rules && n.push("\n", t.rules), n.join("");
|
|
1031
|
-
},
|
|
1032
|
-
jsonSchema() {
|
|
1033
|
-
return i.jsonSchema();
|
|
1034
|
-
}
|
|
1035
|
-
};
|
|
1036
|
-
}
|
|
1970
|
+
Object.fromEntries(Hr.map(({ name: e, renderer: t }) => [e, t]));
|
|
1037
1971
|
//#endregion
|
|
1038
1972
|
//#region src/marketing/catalog/components/revenue-card.catalog.ts
|
|
1039
|
-
var
|
|
1040
|
-
props:
|
|
1041
|
-
title:
|
|
1042
|
-
value:
|
|
1043
|
-
trend:
|
|
1973
|
+
var Ur = {
|
|
1974
|
+
props: w.object({
|
|
1975
|
+
title: w.string(),
|
|
1976
|
+
value: w.string(),
|
|
1977
|
+
trend: w.enum([
|
|
1044
1978
|
"up",
|
|
1045
1979
|
"down",
|
|
1046
1980
|
"flat"
|
|
1047
1981
|
]).optional(),
|
|
1048
|
-
delta:
|
|
1982
|
+
delta: w.string().optional()
|
|
1049
1983
|
}),
|
|
1050
1984
|
slots: [],
|
|
1051
1985
|
description: "KPI metric card. trend: up=green↑ down=red↓ flat=grey→. delta e.g. \"+12% vs last month\". Leaf node — no children."
|
|
1052
|
-
},
|
|
1986
|
+
}, Wr = j({
|
|
1053
1987
|
defaultClassName: "cy2dbi0",
|
|
1054
1988
|
variantClassNames: { trend: {
|
|
1055
1989
|
up: "cy2dbi1",
|
|
@@ -1058,32 +1992,32 @@ var et = {
|
|
|
1058
1992
|
} },
|
|
1059
1993
|
defaultVariants: {},
|
|
1060
1994
|
compoundVariants: []
|
|
1061
|
-
}),
|
|
1995
|
+
}), Gr = [{
|
|
1062
1996
|
name: "RevenueCard",
|
|
1063
|
-
catalog:
|
|
1997
|
+
catalog: Ur,
|
|
1064
1998
|
renderer: ({ props: e }) => {
|
|
1065
|
-
let t = e.trend ?? "flat", n = e.trend === "up" ? "↑" : e.trend === "down" ? "↓" : "→", r =
|
|
1066
|
-
return /* @__PURE__ */
|
|
1999
|
+
let t = e.trend ?? "flat", n = e.trend === "up" ? "↑" : e.trend === "down" ? "↓" : "→", r = Wr({ trend: t });
|
|
2000
|
+
return /* @__PURE__ */ S(i, { children: /* @__PURE__ */ C(l, {
|
|
1067
2001
|
direction: "column",
|
|
1068
2002
|
gap: "2",
|
|
1069
2003
|
children: [
|
|
1070
|
-
/* @__PURE__ */
|
|
2004
|
+
/* @__PURE__ */ S(p, {
|
|
1071
2005
|
variant: "eyebrow",
|
|
1072
2006
|
children: e.title
|
|
1073
2007
|
}),
|
|
1074
|
-
/* @__PURE__ */
|
|
2008
|
+
/* @__PURE__ */ S(p, {
|
|
1075
2009
|
variant: "headline",
|
|
1076
2010
|
el: "h3",
|
|
1077
2011
|
children: e.value
|
|
1078
2012
|
}),
|
|
1079
|
-
e.delta && /* @__PURE__ */
|
|
2013
|
+
e.delta && /* @__PURE__ */ C(l, {
|
|
1080
2014
|
direction: "row",
|
|
1081
2015
|
gap: "1",
|
|
1082
2016
|
alignItems: "center",
|
|
1083
|
-
children: [/* @__PURE__ */
|
|
2017
|
+
children: [/* @__PURE__ */ S("span", {
|
|
1084
2018
|
className: r,
|
|
1085
2019
|
children: n
|
|
1086
|
-
}), /* @__PURE__ */
|
|
2020
|
+
}), /* @__PURE__ */ S(p, {
|
|
1087
2021
|
variant: "eyebrow",
|
|
1088
2022
|
className: r,
|
|
1089
2023
|
children: e.delta
|
|
@@ -1092,36 +2026,43 @@ var et = {
|
|
|
1092
2026
|
]
|
|
1093
2027
|
}) });
|
|
1094
2028
|
},
|
|
1095
|
-
renderers:
|
|
2029
|
+
renderers: ["chat"]
|
|
1096
2030
|
}];
|
|
1097
2031
|
//#endregion
|
|
1098
2032
|
//#region src/registry-utils.ts
|
|
1099
|
-
function
|
|
1100
|
-
return e.filter(({ renderers: e }) => e.includes(t));
|
|
2033
|
+
function Kr(e, t) {
|
|
2034
|
+
return t === "all" ? [...e] : e.filter(({ renderers: e }) => e.includes("all") || e.includes(t));
|
|
1101
2035
|
}
|
|
1102
|
-
function
|
|
2036
|
+
function qr(e) {
|
|
1103
2037
|
return Object.fromEntries(e.map(({ name: e, catalog: t }) => [e, t]));
|
|
1104
2038
|
}
|
|
1105
|
-
function
|
|
2039
|
+
function Jr(e) {
|
|
1106
2040
|
return Object.fromEntries(e.map(({ name: e, renderer: t }) => [e, t]));
|
|
1107
2041
|
}
|
|
1108
2042
|
//#endregion
|
|
1109
2043
|
//#region src/registry.ts
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
2044
|
+
var Yr = [
|
|
2045
|
+
...Hr,
|
|
2046
|
+
...Gr,
|
|
2047
|
+
...U
|
|
2048
|
+
];
|
|
2049
|
+
function Z(e = "chat") {
|
|
2050
|
+
let t = Kr(Yr, e), n = qr(t), r = Jr(t);
|
|
2051
|
+
return je(T(D, {
|
|
2052
|
+
components: n,
|
|
2053
|
+
actions: z
|
|
1116
2054
|
}), {
|
|
1117
|
-
components:
|
|
1118
|
-
actions:
|
|
2055
|
+
components: r,
|
|
2056
|
+
actions: Ln
|
|
1119
2057
|
});
|
|
1120
2058
|
}
|
|
1121
|
-
var
|
|
2059
|
+
var Q = Z("chat"), Xr = Q.registry, Zr = Q.handlers, Qr = Q.executeAction;
|
|
2060
|
+
function $r() {
|
|
2061
|
+
return Z("context");
|
|
2062
|
+
}
|
|
1122
2063
|
//#endregion
|
|
1123
2064
|
//#region src/renderers/internal/enrichments/button-actions.ts
|
|
1124
|
-
function
|
|
2065
|
+
function ei(e) {
|
|
1125
2066
|
let t = { ...e.elements };
|
|
1126
2067
|
for (let [e, n] of Object.entries(t)) {
|
|
1127
2068
|
if (n.type !== "Button" || n.on?.press) continue;
|
|
@@ -1144,40 +2085,214 @@ function dt(e) {
|
|
|
1144
2085
|
}
|
|
1145
2086
|
//#endregion
|
|
1146
2087
|
//#region src/renderers/internal/enrichments/useEnrichedSpec.ts
|
|
1147
|
-
function
|
|
1148
|
-
return
|
|
2088
|
+
function ti(e, t) {
|
|
2089
|
+
return v(() => t.reduce((e, t) => t(e), e), [e, t]);
|
|
1149
2090
|
}
|
|
1150
2091
|
//#endregion
|
|
1151
2092
|
//#region src/renderers/spec-renderer.tsx
|
|
1152
|
-
var
|
|
1153
|
-
let
|
|
1154
|
-
if (
|
|
1155
|
-
let
|
|
1156
|
-
return /* @__PURE__ */
|
|
2093
|
+
var ni = [ei], $ = ({ spec: e, registry: t, handlers: n, actions: r, loading: i }) => {
|
|
2094
|
+
let a = ti(e, ni), o = y(null), s = y(null);
|
|
2095
|
+
if (o.current !== e && (o.current = e, s.current = Ae(a.state ?? {})), s.current === null) throw Error("State store is not initialized");
|
|
2096
|
+
let c = s.current;
|
|
2097
|
+
return /* @__PURE__ */ S(Oe, {
|
|
1157
2098
|
registry: t,
|
|
1158
|
-
store:
|
|
1159
|
-
handlers:
|
|
1160
|
-
let e =
|
|
1161
|
-
setState:
|
|
1162
|
-
getSnapshot: () =>
|
|
2099
|
+
store: c,
|
|
2100
|
+
handlers: v(() => {
|
|
2101
|
+
let e = n(() => void 0, () => c.getSnapshot()), t = r ? r({
|
|
2102
|
+
setState: c.set,
|
|
2103
|
+
getSnapshot: () => c.getSnapshot()
|
|
1163
2104
|
}) : {};
|
|
1164
2105
|
return {
|
|
1165
2106
|
...e,
|
|
1166
2107
|
...t
|
|
1167
2108
|
};
|
|
1168
2109
|
}, [
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
2110
|
+
n,
|
|
2111
|
+
r,
|
|
2112
|
+
c
|
|
1172
2113
|
]),
|
|
1173
|
-
functions:
|
|
1174
|
-
children: /* @__PURE__ */
|
|
1175
|
-
spec:
|
|
1176
|
-
registry: t
|
|
2114
|
+
functions: v(() => ({ computeTotal: (e) => `$${((Number.parseFloat(String(e.quantity ?? 0)) || 0) * (Number.parseFloat(String(e.unitPrice ?? "0").replace(/[^0-9.]/g, "")) || 0)).toFixed(2)}` }), []),
|
|
2115
|
+
children: /* @__PURE__ */ S(ke, {
|
|
2116
|
+
spec: a,
|
|
2117
|
+
registry: t,
|
|
2118
|
+
loading: i ?? !1
|
|
1177
2119
|
})
|
|
1178
2120
|
});
|
|
2121
|
+
}, ri = class extends fe {
|
|
2122
|
+
state = {
|
|
2123
|
+
hasError: !1,
|
|
2124
|
+
message: ""
|
|
2125
|
+
};
|
|
2126
|
+
static getDerivedStateFromError(e) {
|
|
2127
|
+
return {
|
|
2128
|
+
hasError: !0,
|
|
2129
|
+
message: e.message
|
|
2130
|
+
};
|
|
2131
|
+
}
|
|
2132
|
+
componentDidCatch(e, t) {
|
|
2133
|
+
console.error(`[ContextSpecRenderer] Rendering error in <${this.props.elementType}>:`, e, t.componentStack), this.props.onError?.({
|
|
2134
|
+
elementType: this.props.elementType,
|
|
2135
|
+
message: e.message
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
render() {
|
|
2139
|
+
return this.state.hasError ? process.env.NODE_ENV === "production" ? null : /* @__PURE__ */ S(t, {
|
|
2140
|
+
status: "danger",
|
|
2141
|
+
title: `${this.props.elementType} failed to render`,
|
|
2142
|
+
children: /* @__PURE__ */ S(p, {
|
|
2143
|
+
variant: "body",
|
|
2144
|
+
children: this.state.message
|
|
2145
|
+
})
|
|
2146
|
+
}) : this.props.children;
|
|
2147
|
+
}
|
|
2148
|
+
};
|
|
2149
|
+
//#endregion
|
|
2150
|
+
//#region src/renderers/wrap-context-registry.tsx
|
|
2151
|
+
function ii(e, t) {
|
|
2152
|
+
if (process.env.NODE_ENV === "production") return e;
|
|
2153
|
+
let n = { ...e };
|
|
2154
|
+
for (let [r, i] of Object.entries(e)) {
|
|
2155
|
+
let e = i;
|
|
2156
|
+
n[r] = ((n) => /* @__PURE__ */ S(ri, {
|
|
2157
|
+
elementType: r,
|
|
2158
|
+
...t ? { onError: t } : {},
|
|
2159
|
+
children: /* @__PURE__ */ S(e, { ...n })
|
|
2160
|
+
}));
|
|
2161
|
+
}
|
|
2162
|
+
return n;
|
|
2163
|
+
}
|
|
2164
|
+
//#endregion
|
|
2165
|
+
//#region src/renderers/context-spec-renderer.tsx
|
|
2166
|
+
var ai = ({ spec: e, registry: t, handlers: n, actions: r, onRenderError: i, loading: a }) => {
|
|
2167
|
+
let o = a ? [] : G(e);
|
|
2168
|
+
o.length > 0 && process.env.NODE_ENV !== "production" && console.warn(`[ContextSpecRenderer] Spec validation issues:\n${K(o.map((e) => ({
|
|
2169
|
+
...e,
|
|
2170
|
+
severity: "error"
|
|
2171
|
+
})))}`);
|
|
2172
|
+
let s = t ?? Z("context").registry, c = n ?? Z("context").handlers;
|
|
2173
|
+
return /* @__PURE__ */ S($, {
|
|
2174
|
+
spec: e,
|
|
2175
|
+
registry: v(() => ii(s, i), [s, i]),
|
|
2176
|
+
handlers: c,
|
|
2177
|
+
...r ? { actions: r } : {},
|
|
2178
|
+
...a === void 0 ? {} : { loading: a }
|
|
2179
|
+
});
|
|
2180
|
+
}, oi = "nilaa0";
|
|
2181
|
+
//#endregion
|
|
2182
|
+
//#region src/renderers/sectioned-context-renderer.tsx
|
|
2183
|
+
function si(e, t) {
|
|
2184
|
+
let n = {}, r = !1, i = (t) => {
|
|
2185
|
+
let a = e.elements[t];
|
|
2186
|
+
if (!a) {
|
|
2187
|
+
r = !0;
|
|
2188
|
+
return;
|
|
2189
|
+
}
|
|
2190
|
+
if (!n[t]) {
|
|
2191
|
+
n[t] = a;
|
|
2192
|
+
for (let e of a.children ?? []) i(e);
|
|
2193
|
+
}
|
|
2194
|
+
};
|
|
2195
|
+
return i(t), {
|
|
2196
|
+
elements: n,
|
|
2197
|
+
hasMissingRefs: r
|
|
2198
|
+
};
|
|
2199
|
+
}
|
|
2200
|
+
function ci(e, t) {
|
|
2201
|
+
let { elements: n, hasMissingRefs: r } = si(e, t), i = {
|
|
2202
|
+
root: t,
|
|
2203
|
+
elements: n
|
|
2204
|
+
}, a = e.state;
|
|
2205
|
+
return a !== void 0 && (i.state = a), {
|
|
2206
|
+
spec: i,
|
|
2207
|
+
hasMissingRefs: r
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
2210
|
+
function li(e, t) {
|
|
2211
|
+
let n = y(/* @__PURE__ */ new Map());
|
|
2212
|
+
return v(() => {
|
|
2213
|
+
if (!e?.root) return [];
|
|
2214
|
+
let r = e.elements[e.root];
|
|
2215
|
+
if (!r) return [];
|
|
2216
|
+
let i = (r.children ?? []).filter((t) => e.elements[t]), a = n.current, o = /* @__PURE__ */ new Map(), s = i.map((n, r) => {
|
|
2217
|
+
let { spec: s, hasMissingRefs: c } = ci(e, n), l = JSON.stringify(s), u = a.get(n), d = u && u.key === l ? u.spec : s;
|
|
2218
|
+
o.set(n, {
|
|
2219
|
+
key: l,
|
|
2220
|
+
spec: d
|
|
2221
|
+
});
|
|
2222
|
+
let f = r === i.length - 1;
|
|
2223
|
+
return {
|
|
2224
|
+
id: n,
|
|
2225
|
+
spec: d,
|
|
2226
|
+
status: c || f && t ? "loading" : "ready"
|
|
2227
|
+
};
|
|
2228
|
+
});
|
|
2229
|
+
return n.current = o, s;
|
|
2230
|
+
}, [e, t]);
|
|
2231
|
+
}
|
|
2232
|
+
function ui(e) {
|
|
2233
|
+
let t = y(/* @__PURE__ */ new Map());
|
|
2234
|
+
return v(() => {
|
|
2235
|
+
let n = t.current, r = /* @__PURE__ */ new Map(), i = e.map((e) => {
|
|
2236
|
+
let t = e.spec ? JSON.stringify(e.spec) : "", i = n.get(e.id), a = e.spec && i && i.key === t ? i.spec : e.spec;
|
|
2237
|
+
return r.set(e.id, {
|
|
2238
|
+
key: t,
|
|
2239
|
+
spec: a
|
|
2240
|
+
}), a === e.spec ? e : {
|
|
2241
|
+
...e,
|
|
2242
|
+
spec: a
|
|
2243
|
+
};
|
|
2244
|
+
});
|
|
2245
|
+
return t.current = r, i;
|
|
2246
|
+
}, [e]);
|
|
2247
|
+
}
|
|
2248
|
+
function di({ title: e }) {
|
|
2249
|
+
return /* @__PURE__ */ C("div", {
|
|
2250
|
+
className: Je,
|
|
2251
|
+
"data-testid": "context-section-skeleton",
|
|
2252
|
+
children: [/* @__PURE__ */ S(ae, {
|
|
2253
|
+
variant: "headline",
|
|
2254
|
+
...e ? { "aria-label": `Loading ${e}` } : {}
|
|
2255
|
+
}), /* @__PURE__ */ S(ie, { height: "64px" })]
|
|
2256
|
+
});
|
|
2257
|
+
}
|
|
2258
|
+
function fi({ slot: e, registry: t, handlers: n, actions: r }) {
|
|
2259
|
+
return e.spec ? /* @__PURE__ */ C("div", {
|
|
2260
|
+
"data-testid": `context-section-${e.id}`,
|
|
2261
|
+
"data-status": e.status,
|
|
2262
|
+
children: [/* @__PURE__ */ S($, {
|
|
2263
|
+
spec: e.spec,
|
|
2264
|
+
registry: t,
|
|
2265
|
+
handlers: n,
|
|
2266
|
+
loading: e.status === "loading",
|
|
2267
|
+
...r ? { actions: r } : {}
|
|
2268
|
+
}), e.status === "loading" ? /* @__PURE__ */ S("div", {
|
|
2269
|
+
className: oi,
|
|
2270
|
+
children: /* @__PURE__ */ S(ae, {
|
|
2271
|
+
variant: "body",
|
|
2272
|
+
rows: 2,
|
|
2273
|
+
"aria-label": "Loading more of this section"
|
|
2274
|
+
})
|
|
2275
|
+
}) : null]
|
|
2276
|
+
}) : /* @__PURE__ */ S(di, { ...e.title ? { title: e.title } : {} });
|
|
2277
|
+
}
|
|
2278
|
+
var pi = ({ spec: e, sections: t, loading: n = !1, registry: r, handlers: i, actions: a, onRenderError: o }) => {
|
|
2279
|
+
let s = v(() => Z("context"), []), c = r ?? s.registry, l = i ?? s.handlers, u = v(() => ii(c, o), [c, o]), d = li(e, n);
|
|
2280
|
+
return /* @__PURE__ */ S("div", {
|
|
2281
|
+
className: F,
|
|
2282
|
+
"data-testid": "sectioned-context-panel",
|
|
2283
|
+
children: ui(t ?? d).map((e) => /* @__PURE__ */ S(ri, {
|
|
2284
|
+
elementType: e.id,
|
|
2285
|
+
...o ? { onError: o } : {},
|
|
2286
|
+
children: /* @__PURE__ */ S(fi, {
|
|
2287
|
+
slot: e,
|
|
2288
|
+
registry: u,
|
|
2289
|
+
handlers: l,
|
|
2290
|
+
...a ? { actions: a } : {}
|
|
2291
|
+
})
|
|
2292
|
+
}, e.id))
|
|
2293
|
+
});
|
|
1179
2294
|
};
|
|
1180
2295
|
//#endregion
|
|
1181
|
-
export {
|
|
2296
|
+
export { ai as ContextSpecRenderer, pi as SectionedContextRenderer, $ as SpecRenderer, wr as catalog, H as composeCatalogComponents, or as contextCatalog, rr as createScopedCatalog, Qr as executeAction, ci as extractSectionSpec, yr as formatContextRenderReport, K as formatContextSpecIssues, $r as getContextRegistry, Z as getRegistry, Zr as handlers, vr as hasContextSpecErrors, ir as mergeCatalogs, _r as postProcessContextSpec, Xr as registry, G as validateContextSpec, gr as validateContextSpecDeep };
|
|
1182
2297
|
|
|
1183
2298
|
//# sourceMappingURL=json-render-react.js.map
|