@tempots/beatui 1.7.4 → 1.9.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/{ar-Wr6gMs-M.cjs → ar-CEzAem0F.cjs} +1 -1
- package/dist/{ar-fdUqbCvM.js → ar-CQieaqsq.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/auth-divider-B8yr-E_b.cjs +1 -0
- package/dist/{auth-divider-D9KnNeyF.js → auth-divider-Byh5BWLc.js} +91 -88
- package/dist/beatui.css +1 -0
- package/dist/beatui.tailwind.css +1 -0
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +27 -26
- package/dist/card-BkA7Wvbh.cjs +1 -0
- package/dist/card-DX1DwGbL.js +62 -0
- package/dist/{colors-C2sgnzFH.js → colors-CyMhfbJi.js} +64 -58
- package/dist/{colors-DPCHjRMj.cjs → colors-IXZF9U-s.cjs} +1 -1
- package/dist/control-hqEuMzyI.js +343 -0
- package/dist/control-muup9GF1.cjs +1 -0
- package/dist/custom-validation-BA9iJWl_.cjs +1 -0
- package/dist/custom-validation-BOBoUwHY.js +181 -0
- package/dist/{de-C5-k5Eov.js → de-CBIwvkAH.js} +1 -1
- package/dist/{de-DZqdSEta.cjs → de-DdfxrlT3.cjs} +1 -1
- package/dist/deep-merge-8fwp1z4X.js +1346 -0
- package/dist/deep-merge-VDGE_HQD.cjs +1 -0
- package/dist/duration-input-DmsljXl3.cjs +1 -0
- package/dist/{duration-input-D4V_PHIg.js → duration-input-ZQlcqdXU.js} +32 -31
- package/dist/{editor-toolbar-group-FpOHrmtx.js → editor-toolbar-group-BNTBMJCe.js} +2 -2
- package/dist/{editor-toolbar-group-C_ft_T8D.cjs → editor-toolbar-group-DiMzqYgz.cjs} +1 -1
- package/dist/{es-h6jmoF4X.js → es--9HaEj2D.js} +1 -1
- package/dist/{es-CJgYfRap.cjs → es-DSdljxFJ.cjs} +1 -1
- package/dist/{fa-BuxK837l.js → fa-1Z-akcW7.js} +1 -1
- package/dist/{fa-BQ5PzwNY.cjs → fa-BolmeWRT.cjs} +1 -1
- package/dist/flyout-CuKFh_T7.js +151 -0
- package/dist/flyout-DC_tKaTG.cjs +1 -0
- package/dist/{fr-Bv3TG44U.cjs → fr-CODgUuoZ.cjs} +1 -1
- package/dist/{fr-BwILQ9G2.js → fr-DhHM9rou.js} +1 -1
- package/dist/{he-yC9Sc7JD.js → he-CBamXbGJ.js} +1 -1
- package/dist/{he-5LbvgMCC.cjs → he-Juw-dr28.cjs} +1 -1
- package/dist/{hi-Da7rcCpP.js → hi-DvvcX-Ra.js} +1 -1
- package/dist/{hi-YWhWcG_L.cjs → hi-R749jeg-.cjs} +1 -1
- package/dist/{index-CvU9E9wd.js → index-BfQaT5Jy.js} +104 -104
- package/dist/{index-XogEKwdt.cjs → index-Dv7nPuwA.cjs} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +6713 -9831
- package/dist/{input-container-CyOgiiQD.cjs → input-container-BaWQLWB6.cjs} +1 -1
- package/dist/{input-container-8JFB11xN.js → input-container-DCS5oJ4S.js} +4 -4
- package/dist/{it-BxOIJE45.cjs → it-DT5oRZDH.cjs} +1 -1
- package/dist/{it-Yeklau78.js → it-aV6i8Qxz.js} +1 -1
- package/dist/{ja-Dxj9Q5Yd.js → ja-CuLhGnJX.js} +1 -1
- package/dist/{ja-CNhjK06P.cjs → ja-CwKaCYLB.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +83 -79
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +2 -2
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +74 -72
- package/dist/{ko-DgkqcXTs.cjs → ko-Bucro9ID.cjs} +1 -1
- package/dist/{ko-gn_MsegK.js → ko-D-66BsEX.js} +1 -1
- package/dist/lexical/index.cjs.js +1 -1
- package/dist/lexical/index.es.js +5 -5
- package/dist/menu-BFLFKceF.cjs +1 -0
- package/dist/menu-BO6zqyfq.js +220 -0
- package/dist/modal-6Mq3vS5r.js +309 -0
- package/dist/modal-d77-TMc4.cjs +1 -0
- package/dist/{nl-vHNFtXXb.js → nl-CAny6wvm.js} +1 -1
- package/dist/{nl-Dy9lmbBO.cjs → nl-D7vHpehb.cjs} +1 -1
- package/dist/notice-BNGx86Yg.js +110 -0
- package/dist/notice-iF6zBMq9.cjs +1 -0
- package/dist/{oneof-branch-detection-Q_jxvJIA.js → oneof-branch-detection-Bm17RhC2.js} +27 -26
- package/dist/oneof-branch-detection-DZ4MrfBp.cjs +1 -0
- package/dist/openui/index.cjs.js +9 -0
- package/dist/openui/index.es.js +2174 -0
- package/dist/password-input-Bipt7Wsu.cjs +1 -0
- package/dist/password-input-mkRmrEPq.js +105 -0
- package/dist/{pl-BtYbtsmG.cjs → pl-CSiXoOKT.cjs} +1 -1
- package/dist/{pl-C0UdHla0.js → pl-rmZLgQ_V.js} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +4 -4
- package/dist/{pt-CtNmqQ1X.cjs → pt-CJT-iq4y.cjs} +1 -1
- package/dist/{pt-DGKtfN0d.js → pt-DHnajqAi.js} +1 -1
- package/dist/{ru-CpXYLt-v.js → ru-C_E8OZNE.js} +1 -1
- package/dist/{ru-BaL_NPRU.cjs → ru-G3sr_ctV.cjs} +1 -1
- package/dist/slider-input-SLguFA0d.cjs +1 -0
- package/dist/slider-input-VYAMm7pE.js +285 -0
- package/dist/stepper-24p16Zsv.cjs +1 -0
- package/dist/stepper-TlzbfYWa.js +3222 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +38 -40
- package/dist/tailwind/vite-plugin.cjs.js +14 -12
- package/dist/tailwind/vite-plugin.es.js +317 -246
- package/dist/text-area-BdemKQ_w.cjs +1 -0
- package/dist/text-area-Br83-_PQ.js +431 -0
- package/dist/{text-input-NJypZSnE.js → text-input-ByuxdX8w.js} +5 -5
- package/dist/{text-input-DS5zlXb2.cjs → text-input-MjlUC_9u.cjs} +1 -1
- package/dist/{toolbar-BF2L6WKC.js → toolbar-CEBTTjHh.js} +1 -1
- package/dist/{toolbar-BBwfe8U9.cjs → toolbar-DWawYFFX.cjs} +1 -1
- package/dist/{tr-DwOd87oB.cjs → tr-DcxLHHTC.cjs} +1 -1
- package/dist/{tr-DIFZDFW_.js → tr-bVXwloKC.js} +1 -1
- package/dist/{translations-EwEmHe3v.cjs → translations-D3xqZUTA.cjs} +1 -1
- package/dist/{translations-BCMP-h52.js → translations-DU9wTV1y.js} +20 -19
- package/dist/{translations-5cXBrENb.js → translations-RT_UN8ny.js} +1 -1
- package/dist/{translations-BqWc0ZHz.cjs → translations-qljG2Chq.cjs} +1 -1
- package/dist/types/components/navigation/stepper.d.ts +4 -4
- package/dist/types/openui/index.d.ts +28 -0
- package/dist/types/openui/library/define-component.d.ts +15 -0
- package/dist/types/openui/library/library.d.ts +7 -0
- package/dist/types/openui/library/prompt-generator.d.ts +5 -0
- package/dist/types/openui/library/types.d.ts +33 -0
- package/dist/types/openui/parser/parser.d.ts +8 -0
- package/dist/types/openui/parser/streaming-parser.d.ts +14 -0
- package/dist/types/openui/parser/tokenizer.d.ts +9 -0
- package/dist/types/openui/parser/types.d.ts +46 -0
- package/dist/types/openui/registry/button.d.ts +148 -0
- package/dist/types/openui/registry/data.d.ts +177 -0
- package/dist/types/openui/registry/form.d.ts +65 -0
- package/dist/types/openui/registry/format.d.ts +67 -0
- package/dist/types/openui/registry/index.d.ts +9 -0
- package/dist/types/openui/registry/layout.d.ts +45 -0
- package/dist/types/openui/registry/navigation.d.ts +149 -0
- package/dist/types/openui/registry/overlay.d.ts +56 -0
- package/dist/types/openui/registry/typography.d.ts +17 -0
- package/dist/types/openui/renderer/action-context.d.ts +24 -0
- package/dist/types/openui/renderer/node-resolver.d.ts +9 -0
- package/dist/types/openui/renderer/openui-renderer.d.ts +32 -0
- package/dist/types/openui/renderer/skeleton.d.ts +2 -0
- package/dist/types/openui/streaming/from-fetch.d.ts +7 -0
- package/dist/types/openui/streaming/from-sse.d.ts +7 -0
- package/dist/types/openui/streaming/from-websocket.d.ts +10 -0
- package/dist/types/openui/streaming/types.d.ts +5 -0
- package/dist/types/tailwind/preset.d.ts +25 -4
- package/dist/types/tailwind/vite-plugin.d.ts +17 -5
- package/dist/types/tokens/colors.d.ts +87 -9
- package/dist/types/tokens/index.d.ts +7 -6
- package/dist/{ur-DBst-TXc.js → ur-Dls2qb4V.js} +1 -1
- package/dist/{ur-D9nLchps.cjs → ur-IRQoHh1E.cjs} +1 -1
- package/dist/use-form-BZ8vDYOv.cjs +2 -0
- package/dist/use-form-DsCzINfm.js +750 -0
- package/dist/utils-D3-NApSw.cjs +1 -0
- package/dist/utils-Nbh7yQ73.js +105 -0
- package/dist/{vi-Dg1aiMr5.cjs → vi-Bi9SvVCP.cjs} +1 -1
- package/dist/{vi-DQOJp32U.js → vi-C3mTzj50.js} +1 -1
- package/dist/widget-customization-BV6XB2v_.cjs +1 -0
- package/dist/widget-customization-Bso45ONQ.js +1198 -0
- package/dist/{zh-DPK4HXl2.js → zh-B4JRJBt2.js} +1 -1
- package/dist/{zh-tbwSTbmn.cjs → zh-BMU5rYu1.cjs} +1 -1
- package/package.json +31 -20
- package/dist/auth-divider-CjcrgXmq.cjs +0 -1
- package/dist/custom-validation-7por5nJN.js +0 -488
- package/dist/custom-validation-CLscGHY4.cjs +0 -1
- package/dist/deep-merge-D90SW1Ci.cjs +0 -1
- package/dist/deep-merge-DT2H9AGq.js +0 -1765
- package/dist/duration-input-4AQnQpyo.cjs +0 -1
- package/dist/menu-B60Q9j3-.cjs +0 -1
- package/dist/menu-BkqFGcXg.js +0 -366
- package/dist/notice-CQGJyZ8o.js +0 -211
- package/dist/notice-p2IqXS5-.cjs +0 -1
- package/dist/oneof-branch-detection-xDDDdYRk.cjs +0 -1
- package/dist/use-form-8NnZ-KHk.js +0 -1090
- package/dist/use-form-Dcra7GeE.cjs +0 -2
- package/dist/utils-DmEuG3Np.cjs +0 -1
- package/dist/utils-vUtP6iPG.js +0 -165
- package/dist/widget-customization-BIBva3f-.js +0 -1458
- package/dist/widget-customization-pqmtsraC.cjs +0 -1
|
@@ -0,0 +1,2174 @@
|
|
|
1
|
+
import { z as t } from "zod";
|
|
2
|
+
import { html as z, attr as x, prop as p, style as X, Empty as A, Fragment as Y, makeProviderMark as ee, Provide as Z, WithCtx as te, Value as B, renderableOfTNode as W, renderWithContext as _, OnDispose as ne } from "@tempots/dom";
|
|
3
|
+
import { S as oe, E as ae, M as ie, D as re, L as se } from "../stack-BLMteGTn.js";
|
|
4
|
+
import { G as le, a as ce, T as ue, b as de, S as me } from "../text-area-Br83-_PQ.js";
|
|
5
|
+
import { C as pe } from "../card-DX1DwGbL.js";
|
|
6
|
+
import { G as K, D as be, A as ge, C as he, a as fe, T as ye, b as ve, c as we, S as ze, d as Se, e as Ce, f as je, B as ke, g as Ae, h as V, i as xe, j as Te, P as Ie, k as Le, I as Oe, H as Pe, R as Fe, l as De, m as Ee, O as Be, n as Ne, o as Me, p as Re, q as $e, r as Ge, s as Ze, t as We, u as _e, v as Ke, w as Ve, x as Ue, F as He, y as qe, z as Je, E as Qe, J as Xe, K as Ye, L as et } from "../stepper-TlzbfYWa.js";
|
|
7
|
+
import { B as j } from "../input-container-DCS5oJ4S.js";
|
|
8
|
+
import { C as tt, b as nt } from "../control-hqEuMzyI.js";
|
|
9
|
+
import { I as ot } from "../translations-DU9wTV1y.js";
|
|
10
|
+
import { T as at } from "../text-input-ByuxdX8w.js";
|
|
11
|
+
import { P as it, E as rt } from "../password-input-mkRmrEPq.js";
|
|
12
|
+
import { S as st, R as lt, a as ct } from "../slider-input-VYAMm7pE.js";
|
|
13
|
+
import { M as ut } from "../modal-6Mq3vS5r.js";
|
|
14
|
+
function dt(e) {
|
|
15
|
+
const n = e.split(`
|
|
16
|
+
`), a = [];
|
|
17
|
+
let o = "";
|
|
18
|
+
for (const i of n) {
|
|
19
|
+
const r = i.trimEnd();
|
|
20
|
+
if (o === "" && r.trim() === "")
|
|
21
|
+
continue;
|
|
22
|
+
if (o !== "" ? o += `
|
|
23
|
+
` + r : o = r, mt(o) <= 0) {
|
|
24
|
+
const s = o.trim();
|
|
25
|
+
s !== "" && a.push(s), o = "";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return o.trim() !== "" && a.push(o.trim()), a;
|
|
29
|
+
}
|
|
30
|
+
function mt(e) {
|
|
31
|
+
let n = 0, a = !1, o = 0;
|
|
32
|
+
for (; o < e.length; ) {
|
|
33
|
+
const i = e[o];
|
|
34
|
+
if (a) {
|
|
35
|
+
if (i === "\\") {
|
|
36
|
+
o += 2;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
i === '"' && (a = !1);
|
|
40
|
+
} else
|
|
41
|
+
i === '"' ? a = !0 : i === "(" || i === "[" || i === "{" ? n++ : (i === ")" || i === "]" || i === "}") && n--;
|
|
42
|
+
o++;
|
|
43
|
+
}
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
function H(e) {
|
|
47
|
+
return (n) => pt(n, e);
|
|
48
|
+
}
|
|
49
|
+
function pt(e, n) {
|
|
50
|
+
const a = dt(e), o = /* @__PURE__ */ new Map(), i = [], r = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), s = e.split(`
|
|
51
|
+
`);
|
|
52
|
+
let u = 0;
|
|
53
|
+
for (let d = 0; d < a.length; d++) {
|
|
54
|
+
const m = a[d], g = m.split(`
|
|
55
|
+
`)[0].trim();
|
|
56
|
+
for (; u < s.length && !s[u].trim().startsWith(g.slice(0, 20)); )
|
|
57
|
+
u++;
|
|
58
|
+
const h = u + 1, f = m.indexOf("=");
|
|
59
|
+
if (f === -1) {
|
|
60
|
+
i.push({
|
|
61
|
+
line: h,
|
|
62
|
+
message: `Malformed statement (no '='): ${m}`,
|
|
63
|
+
code: "syntax"
|
|
64
|
+
}), u++;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const y = m.slice(0, f).trim(), S = m.slice(f + 1).trim();
|
|
68
|
+
if (!bt(y)) {
|
|
69
|
+
i.push({
|
|
70
|
+
line: h,
|
|
71
|
+
message: `Invalid identifier: '${y}'`,
|
|
72
|
+
code: "syntax"
|
|
73
|
+
}), u++;
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
let G;
|
|
77
|
+
try {
|
|
78
|
+
G = E(
|
|
79
|
+
S,
|
|
80
|
+
c,
|
|
81
|
+
i,
|
|
82
|
+
h,
|
|
83
|
+
n
|
|
84
|
+
);
|
|
85
|
+
} catch {
|
|
86
|
+
i.push({
|
|
87
|
+
line: h,
|
|
88
|
+
message: `Failed to parse expression: ${S}`,
|
|
89
|
+
code: "syntax"
|
|
90
|
+
}), u++;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
r.add(y), o.set(y, { value: G }), u++;
|
|
94
|
+
}
|
|
95
|
+
const b = [...c].filter((d) => !r.has(d));
|
|
96
|
+
return {
|
|
97
|
+
root: o.has("root") ? o.get("root").value : null,
|
|
98
|
+
statements: o,
|
|
99
|
+
meta: {
|
|
100
|
+
incomplete: !1,
|
|
101
|
+
unresolved: b,
|
|
102
|
+
statementCount: o.size,
|
|
103
|
+
errors: i
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function bt(e) {
|
|
108
|
+
return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e);
|
|
109
|
+
}
|
|
110
|
+
function E(e, n, a, o, i) {
|
|
111
|
+
if (e = e.trim(), e === "null")
|
|
112
|
+
return { type: "null" };
|
|
113
|
+
if (e === "true")
|
|
114
|
+
return { type: "boolean", value: !0 };
|
|
115
|
+
if (e === "false")
|
|
116
|
+
return { type: "boolean", value: !1 };
|
|
117
|
+
if (e.startsWith('"'))
|
|
118
|
+
return gt(e);
|
|
119
|
+
if (/^-?\d/.test(e) || /^-?\.\d/.test(e)) {
|
|
120
|
+
const r = Number(e);
|
|
121
|
+
if (!isNaN(r))
|
|
122
|
+
return { type: "number", value: r };
|
|
123
|
+
}
|
|
124
|
+
if (e.startsWith("["))
|
|
125
|
+
return ht(e, n, a, o, i);
|
|
126
|
+
if (e.startsWith("{"))
|
|
127
|
+
return ft(e, n, a, o, i);
|
|
128
|
+
if (/^[A-Z]/.test(e) && e.includes("("))
|
|
129
|
+
return vt(e, n, a, o, i);
|
|
130
|
+
if (/^[a-z_]/.test(e)) {
|
|
131
|
+
const r = e;
|
|
132
|
+
return n.add(r), { type: "reference", name: r };
|
|
133
|
+
}
|
|
134
|
+
if (/^[A-Z][a-zA-Z0-9_]*$/.test(e)) {
|
|
135
|
+
const r = e;
|
|
136
|
+
return i && !i.has(r) && a.push({
|
|
137
|
+
line: o,
|
|
138
|
+
message: `Unknown component: '${r}'`,
|
|
139
|
+
code: "unknown-component"
|
|
140
|
+
}), { type: "component", name: r, args: [] };
|
|
141
|
+
}
|
|
142
|
+
throw new Error(`Cannot parse expression: ${e}`);
|
|
143
|
+
}
|
|
144
|
+
function gt(e) {
|
|
145
|
+
if (!e.startsWith('"') || !e.endsWith('"'))
|
|
146
|
+
throw new Error(`Malformed string: ${e}`);
|
|
147
|
+
return { type: "string", value: e.slice(1, -1).replace(
|
|
148
|
+
/\\(["\\/bfnrt]|u[0-9a-fA-F]{4})/g,
|
|
149
|
+
(o, i) => {
|
|
150
|
+
switch (i[0]) {
|
|
151
|
+
case '"':
|
|
152
|
+
return '"';
|
|
153
|
+
case "\\":
|
|
154
|
+
return "\\";
|
|
155
|
+
case "/":
|
|
156
|
+
return "/";
|
|
157
|
+
case "b":
|
|
158
|
+
return "\b";
|
|
159
|
+
case "f":
|
|
160
|
+
return "\f";
|
|
161
|
+
case "n":
|
|
162
|
+
return `
|
|
163
|
+
`;
|
|
164
|
+
case "r":
|
|
165
|
+
return "\r";
|
|
166
|
+
case "t":
|
|
167
|
+
return " ";
|
|
168
|
+
case "u":
|
|
169
|
+
return String.fromCharCode(parseInt(i.slice(1), 16));
|
|
170
|
+
default:
|
|
171
|
+
return i;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
) };
|
|
175
|
+
}
|
|
176
|
+
function $(e) {
|
|
177
|
+
const n = [];
|
|
178
|
+
let a = 0, o = !1, i = 0, r = 0;
|
|
179
|
+
for (; r < e.length; ) {
|
|
180
|
+
const s = e[r];
|
|
181
|
+
if (o) {
|
|
182
|
+
if (s === "\\") {
|
|
183
|
+
r += 2;
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
s === '"' && (o = !1);
|
|
187
|
+
} else
|
|
188
|
+
s === '"' ? o = !0 : s === "(" || s === "[" || s === "{" ? a++ : s === ")" || s === "]" || s === "}" ? a-- : s === "," && a === 0 && (n.push(e.slice(i, r).trim()), i = r + 1);
|
|
189
|
+
r++;
|
|
190
|
+
}
|
|
191
|
+
const c = e.slice(i).trim();
|
|
192
|
+
return c !== "" && n.push(c), n;
|
|
193
|
+
}
|
|
194
|
+
function ht(e, n, a, o, i) {
|
|
195
|
+
const r = e.slice(1, -1).trim();
|
|
196
|
+
return r === "" ? { type: "array", items: [] } : { type: "array", items: $(r).map(
|
|
197
|
+
(u) => E(u, n, a, o, i)
|
|
198
|
+
) };
|
|
199
|
+
}
|
|
200
|
+
function ft(e, n, a, o, i) {
|
|
201
|
+
const r = e.slice(1, -1).trim();
|
|
202
|
+
if (r === "")
|
|
203
|
+
return { type: "object", entries: {} };
|
|
204
|
+
const c = $(r), s = {};
|
|
205
|
+
for (const u of c) {
|
|
206
|
+
const b = yt(u);
|
|
207
|
+
if (b === -1)
|
|
208
|
+
throw new Error(`Malformed object entry: ${u}`);
|
|
209
|
+
const v = u.slice(0, b).trim(), d = u.slice(b + 1).trim();
|
|
210
|
+
s[v] = E(
|
|
211
|
+
d,
|
|
212
|
+
n,
|
|
213
|
+
a,
|
|
214
|
+
o,
|
|
215
|
+
i
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
return { type: "object", entries: s };
|
|
219
|
+
}
|
|
220
|
+
function yt(e) {
|
|
221
|
+
let n = 0, a = !1, o = 0;
|
|
222
|
+
for (; o < e.length; ) {
|
|
223
|
+
const i = e[o];
|
|
224
|
+
if (a) {
|
|
225
|
+
if (i === "\\") {
|
|
226
|
+
o += 2;
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
i === '"' && (a = !1);
|
|
230
|
+
} else if (i === '"')
|
|
231
|
+
a = !0;
|
|
232
|
+
else if (i === "(" || i === "[" || i === "{")
|
|
233
|
+
n++;
|
|
234
|
+
else if (i === ")" || i === "]" || i === "}")
|
|
235
|
+
n--;
|
|
236
|
+
else if (i === ":" && n === 0)
|
|
237
|
+
return o;
|
|
238
|
+
o++;
|
|
239
|
+
}
|
|
240
|
+
return -1;
|
|
241
|
+
}
|
|
242
|
+
function vt(e, n, a, o, i) {
|
|
243
|
+
const r = e.indexOf("("), c = e.slice(0, r).trim();
|
|
244
|
+
i && !i.has(c) && a.push({
|
|
245
|
+
line: o,
|
|
246
|
+
message: `Unknown component: '${c}'`,
|
|
247
|
+
code: "unknown-component"
|
|
248
|
+
});
|
|
249
|
+
const s = e.slice(r + 1, -1).trim();
|
|
250
|
+
if (s === "")
|
|
251
|
+
return { type: "component", name: c, args: [] };
|
|
252
|
+
const b = $(s).map(
|
|
253
|
+
(v) => E(v, n, a, o, i)
|
|
254
|
+
);
|
|
255
|
+
return { type: "component", name: c, args: b };
|
|
256
|
+
}
|
|
257
|
+
function Vt(e) {
|
|
258
|
+
const n = H(e);
|
|
259
|
+
let a = "", o = {
|
|
260
|
+
root: null,
|
|
261
|
+
statements: /* @__PURE__ */ new Map(),
|
|
262
|
+
meta: {
|
|
263
|
+
incomplete: !0,
|
|
264
|
+
unresolved: [],
|
|
265
|
+
statementCount: 0,
|
|
266
|
+
errors: []
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
return {
|
|
270
|
+
push(i) {
|
|
271
|
+
return a += i, o = n(a), o;
|
|
272
|
+
},
|
|
273
|
+
getResult() {
|
|
274
|
+
return o;
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function l(e) {
|
|
279
|
+
return Object.freeze({
|
|
280
|
+
name: e.name,
|
|
281
|
+
props: e.props,
|
|
282
|
+
description: e.description,
|
|
283
|
+
renderer: e.renderer
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
function q(e) {
|
|
287
|
+
return e._def ?? {};
|
|
288
|
+
}
|
|
289
|
+
function k(e) {
|
|
290
|
+
const n = q(e);
|
|
291
|
+
if (!n.type) return "unknown";
|
|
292
|
+
const a = n.type ?? "unknown";
|
|
293
|
+
switch (a) {
|
|
294
|
+
case "string":
|
|
295
|
+
return "string";
|
|
296
|
+
case "number":
|
|
297
|
+
case "int":
|
|
298
|
+
return "number";
|
|
299
|
+
case "boolean":
|
|
300
|
+
return "boolean";
|
|
301
|
+
case "bigint":
|
|
302
|
+
return "bigint";
|
|
303
|
+
case "null":
|
|
304
|
+
return "null";
|
|
305
|
+
case "undefined":
|
|
306
|
+
return "undefined";
|
|
307
|
+
case "any":
|
|
308
|
+
case "unknown":
|
|
309
|
+
return a;
|
|
310
|
+
case "enum": {
|
|
311
|
+
const o = n.entries;
|
|
312
|
+
return o && typeof o == "object" ? Object.values(o).map((r) => JSON.stringify(r)).join(" | ") : "enum";
|
|
313
|
+
}
|
|
314
|
+
case "literal": {
|
|
315
|
+
const o = n.value;
|
|
316
|
+
return JSON.stringify(o);
|
|
317
|
+
}
|
|
318
|
+
case "optional": {
|
|
319
|
+
const o = n.innerType;
|
|
320
|
+
return o ? `${k(o)} | undefined` : "optional";
|
|
321
|
+
}
|
|
322
|
+
case "nullable": {
|
|
323
|
+
const o = n.innerType;
|
|
324
|
+
return o ? `${k(o)} | null` : "nullable";
|
|
325
|
+
}
|
|
326
|
+
case "array": {
|
|
327
|
+
const o = n.element;
|
|
328
|
+
return o ? `${k(o)}[]` : "array";
|
|
329
|
+
}
|
|
330
|
+
case "object":
|
|
331
|
+
return "object";
|
|
332
|
+
case "union": {
|
|
333
|
+
const o = n.options;
|
|
334
|
+
return Array.isArray(o) ? o.map((i) => k(i)).join(" | ") : "union";
|
|
335
|
+
}
|
|
336
|
+
case "record":
|
|
337
|
+
return "record";
|
|
338
|
+
case "map":
|
|
339
|
+
return "map";
|
|
340
|
+
case "set":
|
|
341
|
+
return "set";
|
|
342
|
+
case "tuple":
|
|
343
|
+
return "tuple";
|
|
344
|
+
case "date":
|
|
345
|
+
return "Date";
|
|
346
|
+
case "transform":
|
|
347
|
+
case "pipe": {
|
|
348
|
+
const o = n.innerType ?? n.in;
|
|
349
|
+
return o ? k(o) : a;
|
|
350
|
+
}
|
|
351
|
+
default:
|
|
352
|
+
return a;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function N(e) {
|
|
356
|
+
const n = [];
|
|
357
|
+
n.push(`### ${e.name}`), n.push(""), n.push(e.description), n.push("");
|
|
358
|
+
const a = e.props.shape, o = Object.entries(a);
|
|
359
|
+
if (o.length > 0) {
|
|
360
|
+
n.push("**Props** (named, all optional unless marked):");
|
|
361
|
+
for (const [i, r] of o) {
|
|
362
|
+
const c = k(r), b = q(r)?.type === "optional" || !1 ? "?" : "";
|
|
363
|
+
n.push(`- \`${i}${b}\`: ${c}`);
|
|
364
|
+
}
|
|
365
|
+
} else
|
|
366
|
+
n.push("No props.");
|
|
367
|
+
return n.join(`
|
|
368
|
+
`);
|
|
369
|
+
}
|
|
370
|
+
function wt(e, n, a) {
|
|
371
|
+
const o = [];
|
|
372
|
+
if (o.push("# OpenUI Lang System Prompt"), o.push(""), o.push("## Syntax"), o.push(""), o.push(
|
|
373
|
+
"OpenUI Lang uses a simple declarative syntax where each statement takes the form:"
|
|
374
|
+
), o.push(""), o.push("```"), o.push("identifier = Expression"), o.push("```"), o.push(""), o.push(
|
|
375
|
+
"Components accept named props as an object. Only include the props you need — all are optional unless noted:"
|
|
376
|
+
), o.push(""), o.push("```"), o.push(
|
|
377
|
+
'btn = Button({label: "Click Me", variant: "filled", color: "primary"})'
|
|
378
|
+
), o.push('card = Card({title: "Hello", content: "World"})'), o.push(
|
|
379
|
+
"layout = Stack([child1, child2]) // children array for layout components"
|
|
380
|
+
), o.push("```"), o.push(""), o.push(
|
|
381
|
+
"Components are instantiated by name with positional arguments matching their prop order."
|
|
382
|
+
), o.push(
|
|
383
|
+
"Children are nested inside component blocks using indentation or braces."
|
|
384
|
+
), o.push(""), o.push("## Available Components"), o.push(""), n && n.length > 0) {
|
|
385
|
+
const i = new Set(n.flatMap((c) => c.components));
|
|
386
|
+
for (const c of n) {
|
|
387
|
+
o.push(`### Group: ${c.name}`), o.push(""), o.push(c.description), o.push("");
|
|
388
|
+
for (const s of c.components) {
|
|
389
|
+
const u = e.get(s);
|
|
390
|
+
u && (o.push(N(u)), o.push(""));
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
const r = [...e.values()].filter(
|
|
394
|
+
(c) => !i.has(c.name)
|
|
395
|
+
);
|
|
396
|
+
if (r.length > 0) {
|
|
397
|
+
o.push("### Other Components"), o.push("");
|
|
398
|
+
for (const c of r)
|
|
399
|
+
o.push(N(c)), o.push("");
|
|
400
|
+
}
|
|
401
|
+
} else
|
|
402
|
+
for (const i of e.values())
|
|
403
|
+
o.push(N(i)), o.push("");
|
|
404
|
+
if (o.push("## Rules"), o.push(""), o.push(
|
|
405
|
+
"- Always pass props as a named object: `Component({key: value, ...})`"
|
|
406
|
+
), o.push(
|
|
407
|
+
"- Only include the props you need — omit optional ones for defaults."
|
|
408
|
+
), o.push(
|
|
409
|
+
"- Layout components take children as an array: `Stack([child1, child2])`"
|
|
410
|
+
), o.push(
|
|
411
|
+
"- Use references for composition: `root = Stack([header, content])`"
|
|
412
|
+
), o.push("- Do not invent component names not listed above."), a?.additionalRules && a.additionalRules.length > 0)
|
|
413
|
+
for (const i of a.additionalRules)
|
|
414
|
+
o.push(`- ${i}`);
|
|
415
|
+
return o.join(`
|
|
416
|
+
`);
|
|
417
|
+
}
|
|
418
|
+
function J(e) {
|
|
419
|
+
return e?._def ?? {};
|
|
420
|
+
}
|
|
421
|
+
function zt(e) {
|
|
422
|
+
const n = /* @__PURE__ */ new Map();
|
|
423
|
+
for (const a of e)
|
|
424
|
+
n.set(a.name, a);
|
|
425
|
+
return n;
|
|
426
|
+
}
|
|
427
|
+
function St(e) {
|
|
428
|
+
try {
|
|
429
|
+
return t.toJSONSchema(e.props);
|
|
430
|
+
} catch {
|
|
431
|
+
const n = {}, a = [];
|
|
432
|
+
for (const [i, r] of Object.entries(e.props.shape)) {
|
|
433
|
+
const c = J(r), s = c.type === "optional";
|
|
434
|
+
s || a.push(i);
|
|
435
|
+
const u = s && c.innerType ? c.innerType : r;
|
|
436
|
+
n[i] = O(u);
|
|
437
|
+
}
|
|
438
|
+
const o = {
|
|
439
|
+
type: "object",
|
|
440
|
+
properties: n
|
|
441
|
+
};
|
|
442
|
+
return a.length > 0 && (o.required = a), o;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function O(e) {
|
|
446
|
+
const n = J(e);
|
|
447
|
+
if (!n.type) return {};
|
|
448
|
+
switch (n.type) {
|
|
449
|
+
case "string":
|
|
450
|
+
return { type: "string" };
|
|
451
|
+
case "number":
|
|
452
|
+
case "int":
|
|
453
|
+
return { type: "number" };
|
|
454
|
+
case "boolean":
|
|
455
|
+
return { type: "boolean" };
|
|
456
|
+
case "bigint":
|
|
457
|
+
return { type: "integer" };
|
|
458
|
+
case "null":
|
|
459
|
+
return { type: "null" };
|
|
460
|
+
case "array":
|
|
461
|
+
return {
|
|
462
|
+
type: "array",
|
|
463
|
+
items: n.element ? O(n.element) : {}
|
|
464
|
+
};
|
|
465
|
+
case "object": {
|
|
466
|
+
const a = {};
|
|
467
|
+
if (n.shape)
|
|
468
|
+
for (const [o, i] of Object.entries(n.shape))
|
|
469
|
+
a[o] = O(i);
|
|
470
|
+
return { type: "object", properties: a };
|
|
471
|
+
}
|
|
472
|
+
case "enum":
|
|
473
|
+
return n.entries && typeof n.entries == "object" ? { enum: Object.values(n.entries) } : { type: "string" };
|
|
474
|
+
case "literal":
|
|
475
|
+
return { const: n.value };
|
|
476
|
+
case "optional":
|
|
477
|
+
case "nullable":
|
|
478
|
+
return n.innerType ? O(n.innerType) : {};
|
|
479
|
+
case "union":
|
|
480
|
+
return Array.isArray(n.options) ? { oneOf: n.options.map(O) } : {};
|
|
481
|
+
default:
|
|
482
|
+
return {};
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
function Q(e) {
|
|
486
|
+
const n = zt(e.components), a = e.root, o = e.groups;
|
|
487
|
+
return {
|
|
488
|
+
get components() {
|
|
489
|
+
return n;
|
|
490
|
+
},
|
|
491
|
+
get root() {
|
|
492
|
+
return a;
|
|
493
|
+
},
|
|
494
|
+
get(r) {
|
|
495
|
+
return n.get(r);
|
|
496
|
+
},
|
|
497
|
+
has(r) {
|
|
498
|
+
return n.has(r);
|
|
499
|
+
},
|
|
500
|
+
prompt(r) {
|
|
501
|
+
const c = r?.groups ?? o;
|
|
502
|
+
return wt(n, c, r);
|
|
503
|
+
},
|
|
504
|
+
toJSONSchema() {
|
|
505
|
+
const r = {};
|
|
506
|
+
for (const [c, s] of n)
|
|
507
|
+
r[c] = St(s);
|
|
508
|
+
return r;
|
|
509
|
+
},
|
|
510
|
+
extend(r) {
|
|
511
|
+
const c = new Map(n);
|
|
512
|
+
if (r.components)
|
|
513
|
+
for (const s of r.components)
|
|
514
|
+
c.set(s.name, s);
|
|
515
|
+
return Q({
|
|
516
|
+
components: [...c.values()],
|
|
517
|
+
root: r.root ?? a,
|
|
518
|
+
groups: o
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
const Ct = [
|
|
524
|
+
l({
|
|
525
|
+
name: "Stack",
|
|
526
|
+
props: t.object({
|
|
527
|
+
children: t.array(t.any()).optional()
|
|
528
|
+
}),
|
|
529
|
+
description: "Vertical stack layout that arranges children in a column with consistent spacing.",
|
|
530
|
+
renderer: (e) => oe(K("md"), ...e.children ?? [])
|
|
531
|
+
}),
|
|
532
|
+
l({
|
|
533
|
+
name: "Group",
|
|
534
|
+
props: t.object({
|
|
535
|
+
children: t.array(t.any()).optional()
|
|
536
|
+
}),
|
|
537
|
+
description: "Horizontal group layout that arranges children in a row with consistent spacing.",
|
|
538
|
+
renderer: (e) => le(K("md"), ...e.children ?? [])
|
|
539
|
+
}),
|
|
540
|
+
l({
|
|
541
|
+
name: "Card",
|
|
542
|
+
props: t.object({
|
|
543
|
+
title: t.string().optional(),
|
|
544
|
+
content: t.string().optional(),
|
|
545
|
+
variant: t.enum(["default", "elevated", "outlined", "flat"]).optional(),
|
|
546
|
+
children: t.array(t.any()).optional()
|
|
547
|
+
}),
|
|
548
|
+
description: 'A container with optional title and content text. Card("My Title", "Description text")',
|
|
549
|
+
renderer: (e) => {
|
|
550
|
+
const n = [];
|
|
551
|
+
return e.title && n.push(z.h3(x.class("font-semibold text-lg"), e.title)), e.content && n.push(
|
|
552
|
+
z.p(x.class("text-gray-600 dark:text-gray-400"), e.content)
|
|
553
|
+
), e.children && n.push(...e.children), pe({ variant: e.variant }, ...n);
|
|
554
|
+
}
|
|
555
|
+
}),
|
|
556
|
+
l({
|
|
557
|
+
name: "Divider",
|
|
558
|
+
props: t.object({
|
|
559
|
+
orientation: t.enum(["horizontal", "vertical"]).optional(),
|
|
560
|
+
variant: t.enum(["solid", "dashed", "dotted"]).optional(),
|
|
561
|
+
tone: t.enum(["subtle", "default", "strong"]).optional(),
|
|
562
|
+
label: t.string().optional(),
|
|
563
|
+
labelAlign: t.enum(["left", "center", "right"]).optional()
|
|
564
|
+
}),
|
|
565
|
+
description: "A visual separator for dividing content sections.",
|
|
566
|
+
renderer: (e) => be({
|
|
567
|
+
orientation: e.orientation,
|
|
568
|
+
variant: e.variant,
|
|
569
|
+
tone: e.tone,
|
|
570
|
+
label: e.label,
|
|
571
|
+
labelAlign: e.labelAlign
|
|
572
|
+
})
|
|
573
|
+
}),
|
|
574
|
+
l({
|
|
575
|
+
name: "Accordion",
|
|
576
|
+
props: t.object({
|
|
577
|
+
items: t.array(
|
|
578
|
+
t.object({
|
|
579
|
+
key: t.string(),
|
|
580
|
+
header: t.string(),
|
|
581
|
+
body: t.string(),
|
|
582
|
+
defaultOpen: t.boolean().optional(),
|
|
583
|
+
disabled: t.boolean().optional()
|
|
584
|
+
})
|
|
585
|
+
),
|
|
586
|
+
multiple: t.boolean().optional(),
|
|
587
|
+
size: t.enum(["xs", "sm", "md", "lg", "xl"]).optional(),
|
|
588
|
+
variant: t.enum(["default", "separated"]).optional()
|
|
589
|
+
}),
|
|
590
|
+
description: "An accordion component with collapsible sections. Each item has a clickable header that toggles content.",
|
|
591
|
+
renderer: (e) => ge({
|
|
592
|
+
items: e.items.map((n) => ({
|
|
593
|
+
key: n.key,
|
|
594
|
+
header: n.header,
|
|
595
|
+
body: z.p(n.body),
|
|
596
|
+
defaultOpen: n.defaultOpen,
|
|
597
|
+
disabled: n.disabled
|
|
598
|
+
})),
|
|
599
|
+
multiple: e.multiple,
|
|
600
|
+
size: e.size,
|
|
601
|
+
variant: e.variant
|
|
602
|
+
})
|
|
603
|
+
}),
|
|
604
|
+
l({
|
|
605
|
+
name: "Center",
|
|
606
|
+
props: t.object({
|
|
607
|
+
gap: t.enum(["none", "xs", "sm", "md", "lg", "xl", "2xl"]).optional(),
|
|
608
|
+
children: t.array(t.any()).optional()
|
|
609
|
+
}),
|
|
610
|
+
description: "Centers its children both horizontally and vertically within a container.",
|
|
611
|
+
renderer: (e) => he({ gap: e.gap }, ...e.children ?? [])
|
|
612
|
+
}),
|
|
613
|
+
l({
|
|
614
|
+
name: "Collapse",
|
|
615
|
+
props: t.object({
|
|
616
|
+
open: t.boolean(),
|
|
617
|
+
children: t.array(t.any()).optional()
|
|
618
|
+
}),
|
|
619
|
+
description: "Animated collapsible container that smoothly expands and contracts its content.",
|
|
620
|
+
renderer: (e) => fe({ open: e.open }, ...e.children ?? [])
|
|
621
|
+
})
|
|
622
|
+
], F = t.enum([
|
|
623
|
+
"filled",
|
|
624
|
+
"light",
|
|
625
|
+
"outline",
|
|
626
|
+
"dashed",
|
|
627
|
+
"default",
|
|
628
|
+
"subtle",
|
|
629
|
+
"text"
|
|
630
|
+
]), T = t.enum(["xs", "sm", "md", "lg", "xl"]), I = t.enum([
|
|
631
|
+
"primary",
|
|
632
|
+
"secondary",
|
|
633
|
+
"success",
|
|
634
|
+
"warning",
|
|
635
|
+
"danger",
|
|
636
|
+
"info",
|
|
637
|
+
"neutral",
|
|
638
|
+
"base"
|
|
639
|
+
]), jt = [
|
|
640
|
+
l({
|
|
641
|
+
name: "Button",
|
|
642
|
+
props: t.object({
|
|
643
|
+
label: t.string(),
|
|
644
|
+
variant: F.optional(),
|
|
645
|
+
size: T.optional(),
|
|
646
|
+
color: I.optional(),
|
|
647
|
+
disabled: t.boolean().optional(),
|
|
648
|
+
actionType: t.string().optional(),
|
|
649
|
+
actionParams: t.record(t.string(), t.unknown()).optional()
|
|
650
|
+
}),
|
|
651
|
+
description: 'Clickable button. Set actionType to dispatch an action on click. Button("Click Me", "filled", "md", "primary", false, "submit_form", {key: "value"})',
|
|
652
|
+
renderer: (e) => {
|
|
653
|
+
const n = e.__onAction;
|
|
654
|
+
return j(
|
|
655
|
+
{
|
|
656
|
+
variant: e.variant,
|
|
657
|
+
size: e.size,
|
|
658
|
+
color: e.color,
|
|
659
|
+
disabled: e.disabled,
|
|
660
|
+
onClick: e.actionType ? () => {
|
|
661
|
+
n?.({
|
|
662
|
+
kind: "button",
|
|
663
|
+
type: e.actionType,
|
|
664
|
+
params: e.actionParams ?? {},
|
|
665
|
+
humanFriendlyMessage: `Clicked: ${e.label}`
|
|
666
|
+
});
|
|
667
|
+
} : void 0
|
|
668
|
+
},
|
|
669
|
+
e.label
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
}),
|
|
673
|
+
l({
|
|
674
|
+
name: "ToggleButton",
|
|
675
|
+
props: t.object({
|
|
676
|
+
label: t.string(),
|
|
677
|
+
pressed: t.boolean(),
|
|
678
|
+
variant: F.optional(),
|
|
679
|
+
size: T.optional(),
|
|
680
|
+
color: I.optional(),
|
|
681
|
+
disabled: t.boolean().optional()
|
|
682
|
+
}),
|
|
683
|
+
description: "A toggle button that can be pressed/unpressed, styled as a button with visual feedback for the pressed state.",
|
|
684
|
+
renderer: (e) => {
|
|
685
|
+
const n = p(e.pressed);
|
|
686
|
+
return ye(
|
|
687
|
+
{
|
|
688
|
+
pressed: n,
|
|
689
|
+
onChange: (a) => n.set(a),
|
|
690
|
+
variant: e.variant,
|
|
691
|
+
size: e.size,
|
|
692
|
+
color: e.color,
|
|
693
|
+
disabled: e.disabled
|
|
694
|
+
},
|
|
695
|
+
e.label
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
}),
|
|
699
|
+
l({
|
|
700
|
+
name: "CopyButton",
|
|
701
|
+
props: t.object({
|
|
702
|
+
text: t.string(),
|
|
703
|
+
variant: F.optional(),
|
|
704
|
+
size: T.optional(),
|
|
705
|
+
color: I.optional()
|
|
706
|
+
}),
|
|
707
|
+
description: "A button that copies text to the clipboard with visual feedback.",
|
|
708
|
+
renderer: (e) => ve({
|
|
709
|
+
text: e.text,
|
|
710
|
+
variant: e.variant,
|
|
711
|
+
size: e.size,
|
|
712
|
+
color: e.color
|
|
713
|
+
})
|
|
714
|
+
}),
|
|
715
|
+
l({
|
|
716
|
+
name: "CloseButton",
|
|
717
|
+
props: t.object({
|
|
718
|
+
size: T.optional(),
|
|
719
|
+
color: I.optional(),
|
|
720
|
+
icon: t.string().optional()
|
|
721
|
+
}),
|
|
722
|
+
description: "A small icon-only button for dismissing modals, drawers, notifications, and tags.",
|
|
723
|
+
renderer: (e) => tt({
|
|
724
|
+
size: e.size,
|
|
725
|
+
color: e.color,
|
|
726
|
+
icon: e.icon
|
|
727
|
+
})
|
|
728
|
+
}),
|
|
729
|
+
l({
|
|
730
|
+
name: "ToggleButtonGroup",
|
|
731
|
+
props: t.object({
|
|
732
|
+
items: t.array(
|
|
733
|
+
t.object({
|
|
734
|
+
key: t.string(),
|
|
735
|
+
label: t.string(),
|
|
736
|
+
disabled: t.boolean().optional()
|
|
737
|
+
})
|
|
738
|
+
),
|
|
739
|
+
selectedKeys: t.array(t.string()).optional(),
|
|
740
|
+
multiple: t.boolean().optional(),
|
|
741
|
+
variant: F.optional(),
|
|
742
|
+
size: T.optional(),
|
|
743
|
+
color: I.optional(),
|
|
744
|
+
orientation: t.enum(["horizontal", "vertical"]).optional()
|
|
745
|
+
}),
|
|
746
|
+
description: "A group container for toggle buttons that manages single or multiple selection.",
|
|
747
|
+
renderer: (e) => {
|
|
748
|
+
const n = p(e.selectedKeys ?? []);
|
|
749
|
+
return we({
|
|
750
|
+
items: e.items,
|
|
751
|
+
value: n,
|
|
752
|
+
onChange: (a) => n.set(a),
|
|
753
|
+
multiple: e.multiple,
|
|
754
|
+
variant: e.variant,
|
|
755
|
+
size: e.size,
|
|
756
|
+
color: e.color,
|
|
757
|
+
orientation: e.orientation
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
})
|
|
761
|
+
], D = t.enum(["xs", "sm", "md", "lg", "xl"]), C = t.enum([
|
|
762
|
+
"primary",
|
|
763
|
+
"secondary",
|
|
764
|
+
"success",
|
|
765
|
+
"warning",
|
|
766
|
+
"danger",
|
|
767
|
+
"info",
|
|
768
|
+
"neutral",
|
|
769
|
+
"base"
|
|
770
|
+
]), kt = [
|
|
771
|
+
l({
|
|
772
|
+
name: "StatCard",
|
|
773
|
+
props: t.object({
|
|
774
|
+
title: t.string(),
|
|
775
|
+
value: t.string(),
|
|
776
|
+
trend: t.string().optional(),
|
|
777
|
+
trendDirection: t.enum(["up", "down", "flat"]).optional(),
|
|
778
|
+
variant: t.enum(["default", "elevated", "outlined"]).optional(),
|
|
779
|
+
size: D.optional(),
|
|
780
|
+
color: C.optional()
|
|
781
|
+
}),
|
|
782
|
+
description: 'Dashboard metric card. StatCard({title: "Revenue", value: "$12k", trend: "+8%", trendDirection: "up"})',
|
|
783
|
+
renderer: (e) => ze(
|
|
784
|
+
{
|
|
785
|
+
variant: e.variant,
|
|
786
|
+
size: e.size,
|
|
787
|
+
color: e.color
|
|
788
|
+
},
|
|
789
|
+
je({}, e.title),
|
|
790
|
+
Ce({}, e.value),
|
|
791
|
+
...e.trendDirection != null ? [
|
|
792
|
+
Se({
|
|
793
|
+
value: e.trend ?? "",
|
|
794
|
+
direction: e.trendDirection
|
|
795
|
+
})
|
|
796
|
+
] : []
|
|
797
|
+
)
|
|
798
|
+
}),
|
|
799
|
+
l({
|
|
800
|
+
name: "Badge",
|
|
801
|
+
props: t.object({
|
|
802
|
+
label: t.string(),
|
|
803
|
+
variant: t.enum([
|
|
804
|
+
"filled",
|
|
805
|
+
"light",
|
|
806
|
+
"outline",
|
|
807
|
+
"dashed",
|
|
808
|
+
"default",
|
|
809
|
+
"subtle",
|
|
810
|
+
"text"
|
|
811
|
+
]).optional(),
|
|
812
|
+
size: D.optional(),
|
|
813
|
+
color: C.optional(),
|
|
814
|
+
circle: t.boolean().optional()
|
|
815
|
+
}),
|
|
816
|
+
description: "A small status indicator or label component with theme-aware colors.",
|
|
817
|
+
renderer: (e) => ke(
|
|
818
|
+
{
|
|
819
|
+
variant: e.variant,
|
|
820
|
+
size: e.size,
|
|
821
|
+
color: e.color,
|
|
822
|
+
circle: e.circle
|
|
823
|
+
},
|
|
824
|
+
e.label
|
|
825
|
+
)
|
|
826
|
+
}),
|
|
827
|
+
l({
|
|
828
|
+
name: "AutoColorBadge",
|
|
829
|
+
props: t.object({
|
|
830
|
+
label: t.string(),
|
|
831
|
+
size: D.optional()
|
|
832
|
+
}),
|
|
833
|
+
description: "A badge that automatically assigns a color based on the label text.",
|
|
834
|
+
renderer: (e) => Ae(
|
|
835
|
+
{
|
|
836
|
+
size: e.size
|
|
837
|
+
},
|
|
838
|
+
e.label
|
|
839
|
+
)
|
|
840
|
+
}),
|
|
841
|
+
l({
|
|
842
|
+
name: "Avatar",
|
|
843
|
+
props: t.object({
|
|
844
|
+
name: t.string().optional(),
|
|
845
|
+
src: t.string().optional(),
|
|
846
|
+
icon: t.string().optional(),
|
|
847
|
+
size: t.enum(["xs", "sm", "md", "lg", "xl", "2xl"]).optional(),
|
|
848
|
+
variant: t.enum(["circle", "square"]).optional(),
|
|
849
|
+
color: C.optional(),
|
|
850
|
+
bordered: t.boolean().optional()
|
|
851
|
+
}),
|
|
852
|
+
description: "Renders a user avatar with image, initials, or icon fallback.",
|
|
853
|
+
renderer: (e) => V({
|
|
854
|
+
name: e.name,
|
|
855
|
+
src: e.src,
|
|
856
|
+
icon: e.icon,
|
|
857
|
+
size: e.size,
|
|
858
|
+
variant: e.variant,
|
|
859
|
+
color: e.color,
|
|
860
|
+
bordered: e.bordered
|
|
861
|
+
})
|
|
862
|
+
}),
|
|
863
|
+
l({
|
|
864
|
+
name: "AvatarGroup",
|
|
865
|
+
props: t.object({
|
|
866
|
+
names: t.array(t.string()),
|
|
867
|
+
size: t.enum(["xs", "sm", "md", "lg", "xl", "2xl"]).optional(),
|
|
868
|
+
spacing: t.enum(["tight", "normal"]).optional(),
|
|
869
|
+
overflow: t.number().optional()
|
|
870
|
+
}),
|
|
871
|
+
description: "Renders a container for grouping multiple Avatar components with overlapping or spaced layout.",
|
|
872
|
+
renderer: (e) => xe(
|
|
873
|
+
{ size: e.size, spacing: e.spacing },
|
|
874
|
+
...e.names.map((n) => V({ name: n, size: e.size })),
|
|
875
|
+
...e.overflow != null ? [
|
|
876
|
+
Te({
|
|
877
|
+
count: e.overflow,
|
|
878
|
+
size: e.size
|
|
879
|
+
})
|
|
880
|
+
] : []
|
|
881
|
+
)
|
|
882
|
+
}),
|
|
883
|
+
l({
|
|
884
|
+
name: "ProgressBar",
|
|
885
|
+
props: t.object({
|
|
886
|
+
value: t.number().optional(),
|
|
887
|
+
size: t.enum(["sm", "md", "lg"]).optional(),
|
|
888
|
+
color: C.optional(),
|
|
889
|
+
max: t.number().optional(),
|
|
890
|
+
showLabel: t.boolean().optional()
|
|
891
|
+
}),
|
|
892
|
+
description: 'Horizontal progress bar. ProgressBar(75, "md") shows 75% progress.',
|
|
893
|
+
renderer: (e) => Ie({
|
|
894
|
+
value: e.value,
|
|
895
|
+
max: e.max,
|
|
896
|
+
size: e.size,
|
|
897
|
+
color: e.color,
|
|
898
|
+
showLabel: e.showLabel ?? !0
|
|
899
|
+
})
|
|
900
|
+
}),
|
|
901
|
+
// DataTable is too complex to register meaningfully here - skip with TODO
|
|
902
|
+
// TODO: DataTable requires column definitions and data models that can't be expressed as simple props
|
|
903
|
+
l({
|
|
904
|
+
name: "Skeleton",
|
|
905
|
+
props: t.object({
|
|
906
|
+
variant: t.enum(["text", "rect", "circle"]).optional(),
|
|
907
|
+
width: t.string().optional(),
|
|
908
|
+
height: t.string().optional(),
|
|
909
|
+
lines: t.number().optional(),
|
|
910
|
+
animate: t.boolean().optional()
|
|
911
|
+
}),
|
|
912
|
+
description: "A loading placeholder component that shows a shimmer animation.",
|
|
913
|
+
renderer: (e) => Le({
|
|
914
|
+
variant: e.variant,
|
|
915
|
+
width: e.width,
|
|
916
|
+
height: e.height,
|
|
917
|
+
lines: e.lines,
|
|
918
|
+
animate: e.animate
|
|
919
|
+
})
|
|
920
|
+
}),
|
|
921
|
+
l({
|
|
922
|
+
name: "Indicator",
|
|
923
|
+
props: t.object({
|
|
924
|
+
show: t.boolean().optional(),
|
|
925
|
+
count: t.number().optional(),
|
|
926
|
+
color: C.optional(),
|
|
927
|
+
placement: t.enum(["top-right", "top-left", "bottom-right", "bottom-left"]).optional(),
|
|
928
|
+
size: D.optional(),
|
|
929
|
+
children: t.array(t.any()).optional()
|
|
930
|
+
}),
|
|
931
|
+
description: "Overlays a small dot or count badge on any child content for notification counts or status.",
|
|
932
|
+
renderer: (e) => Oe(
|
|
933
|
+
{
|
|
934
|
+
show: e.show,
|
|
935
|
+
count: e.count,
|
|
936
|
+
color: e.color,
|
|
937
|
+
placement: e.placement,
|
|
938
|
+
size: e.size
|
|
939
|
+
},
|
|
940
|
+
...e.children ?? []
|
|
941
|
+
)
|
|
942
|
+
}),
|
|
943
|
+
l({
|
|
944
|
+
name: "HistoryTimeline",
|
|
945
|
+
props: t.object({
|
|
946
|
+
entries: t.array(
|
|
947
|
+
t.object({
|
|
948
|
+
id: t.string(),
|
|
949
|
+
action: t.string(),
|
|
950
|
+
actionColor: t.string(),
|
|
951
|
+
icon: t.string(),
|
|
952
|
+
target: t.string(),
|
|
953
|
+
targetIcon: t.string(),
|
|
954
|
+
actor: t.object({ name: t.string(), initials: t.string() }),
|
|
955
|
+
time: t.string(),
|
|
956
|
+
detail: t.string(),
|
|
957
|
+
restorable: t.boolean().optional()
|
|
958
|
+
})
|
|
959
|
+
)
|
|
960
|
+
}),
|
|
961
|
+
description: "A timeline component displaying a history of actions with filtering support.",
|
|
962
|
+
renderer: (e) => Pe({
|
|
963
|
+
entries: p(e.entries)
|
|
964
|
+
})
|
|
965
|
+
}),
|
|
966
|
+
l({
|
|
967
|
+
name: "Icon",
|
|
968
|
+
props: t.object({
|
|
969
|
+
icon: t.string(),
|
|
970
|
+
size: t.enum(["xs", "sm", "md", "lg", "xl", "2xl"]).optional(),
|
|
971
|
+
color: C.optional(),
|
|
972
|
+
title: t.string().optional()
|
|
973
|
+
}),
|
|
974
|
+
description: "Renders an SVG icon from the Iconify icon library with lazy-loading and caching.",
|
|
975
|
+
renderer: (e) => ot({
|
|
976
|
+
icon: e.icon,
|
|
977
|
+
size: e.size,
|
|
978
|
+
color: e.color,
|
|
979
|
+
title: e.title
|
|
980
|
+
})
|
|
981
|
+
})
|
|
982
|
+
], w = t.enum(["xs", "sm", "md", "lg", "xl"]), At = [
|
|
983
|
+
l({
|
|
984
|
+
name: "TextInput",
|
|
985
|
+
props: t.object({
|
|
986
|
+
value: t.string().optional(),
|
|
987
|
+
placeholder: t.string().optional(),
|
|
988
|
+
disabled: t.boolean().optional(),
|
|
989
|
+
size: w.optional()
|
|
990
|
+
}),
|
|
991
|
+
description: "A single-line text input component.",
|
|
992
|
+
renderer: (e) => {
|
|
993
|
+
const n = p(e.value ?? "");
|
|
994
|
+
return at({
|
|
995
|
+
value: n,
|
|
996
|
+
onChange: (a) => n.set(a),
|
|
997
|
+
placeholder: e.placeholder,
|
|
998
|
+
disabled: e.disabled,
|
|
999
|
+
size: e.size
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
}),
|
|
1003
|
+
l({
|
|
1004
|
+
name: "NumberInput",
|
|
1005
|
+
props: t.object({
|
|
1006
|
+
value: t.number().optional(),
|
|
1007
|
+
placeholder: t.string().optional(),
|
|
1008
|
+
disabled: t.boolean().optional(),
|
|
1009
|
+
size: w.optional(),
|
|
1010
|
+
min: t.number().optional(),
|
|
1011
|
+
max: t.number().optional(),
|
|
1012
|
+
step: t.number().optional()
|
|
1013
|
+
}),
|
|
1014
|
+
description: "A number input component for numeric values.",
|
|
1015
|
+
renderer: (e) => {
|
|
1016
|
+
const n = p(e.value ?? 0);
|
|
1017
|
+
return ce({
|
|
1018
|
+
value: n,
|
|
1019
|
+
onChange: (a) => n.set(a),
|
|
1020
|
+
placeholder: e.placeholder,
|
|
1021
|
+
disabled: e.disabled,
|
|
1022
|
+
size: e.size,
|
|
1023
|
+
min: e.min,
|
|
1024
|
+
max: e.max,
|
|
1025
|
+
step: e.step
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
}),
|
|
1029
|
+
l({
|
|
1030
|
+
name: "PasswordInput",
|
|
1031
|
+
props: t.object({
|
|
1032
|
+
value: t.string().optional(),
|
|
1033
|
+
placeholder: t.string().optional(),
|
|
1034
|
+
disabled: t.boolean().optional(),
|
|
1035
|
+
size: w.optional()
|
|
1036
|
+
}),
|
|
1037
|
+
description: "A password input with toggle to show/hide the value.",
|
|
1038
|
+
renderer: (e) => {
|
|
1039
|
+
const n = p(e.value ?? "");
|
|
1040
|
+
return it({
|
|
1041
|
+
value: n,
|
|
1042
|
+
onChange: (a) => n.set(a),
|
|
1043
|
+
placeholder: e.placeholder,
|
|
1044
|
+
disabled: e.disabled,
|
|
1045
|
+
size: e.size
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
}),
|
|
1049
|
+
l({
|
|
1050
|
+
name: "EmailInput",
|
|
1051
|
+
props: t.object({
|
|
1052
|
+
value: t.string().optional(),
|
|
1053
|
+
placeholder: t.string().optional(),
|
|
1054
|
+
disabled: t.boolean().optional(),
|
|
1055
|
+
size: w.optional()
|
|
1056
|
+
}),
|
|
1057
|
+
description: "An email address input component.",
|
|
1058
|
+
renderer: (e) => {
|
|
1059
|
+
const n = p(e.value ?? "");
|
|
1060
|
+
return rt({
|
|
1061
|
+
value: n,
|
|
1062
|
+
onChange: (a) => n.set(a),
|
|
1063
|
+
placeholder: e.placeholder,
|
|
1064
|
+
disabled: e.disabled,
|
|
1065
|
+
size: e.size
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
}),
|
|
1069
|
+
l({
|
|
1070
|
+
name: "TextArea",
|
|
1071
|
+
props: t.object({
|
|
1072
|
+
value: t.string().optional(),
|
|
1073
|
+
placeholder: t.string().optional(),
|
|
1074
|
+
disabled: t.boolean().optional(),
|
|
1075
|
+
size: w.optional(),
|
|
1076
|
+
rows: t.number().optional()
|
|
1077
|
+
}),
|
|
1078
|
+
description: "A multi-line text input component.",
|
|
1079
|
+
renderer: (e) => {
|
|
1080
|
+
const n = p(e.value ?? "");
|
|
1081
|
+
return ue({
|
|
1082
|
+
value: n,
|
|
1083
|
+
onChange: (a) => n.set(a),
|
|
1084
|
+
placeholder: e.placeholder,
|
|
1085
|
+
disabled: e.disabled,
|
|
1086
|
+
size: e.size,
|
|
1087
|
+
rows: e.rows
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
}),
|
|
1091
|
+
l({
|
|
1092
|
+
name: "CheckboxInput",
|
|
1093
|
+
props: t.object({
|
|
1094
|
+
checked: t.boolean().optional(),
|
|
1095
|
+
placeholder: t.string().optional(),
|
|
1096
|
+
disabled: t.boolean().optional(),
|
|
1097
|
+
size: w.optional()
|
|
1098
|
+
}),
|
|
1099
|
+
description: "A custom checkbox input component with icon-based checked/unchecked states.",
|
|
1100
|
+
renderer: (e) => {
|
|
1101
|
+
const n = p(e.checked ?? !1);
|
|
1102
|
+
return nt({
|
|
1103
|
+
value: n,
|
|
1104
|
+
onChange: (a) => n.set(a),
|
|
1105
|
+
placeholder: e.placeholder,
|
|
1106
|
+
disabled: e.disabled,
|
|
1107
|
+
size: e.size
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
}),
|
|
1111
|
+
l({
|
|
1112
|
+
name: "Switch",
|
|
1113
|
+
props: t.object({
|
|
1114
|
+
value: t.boolean().optional(),
|
|
1115
|
+
disabled: t.boolean().optional(),
|
|
1116
|
+
size: w.optional(),
|
|
1117
|
+
color: t.enum([
|
|
1118
|
+
"primary",
|
|
1119
|
+
"secondary",
|
|
1120
|
+
"success",
|
|
1121
|
+
"warning",
|
|
1122
|
+
"danger",
|
|
1123
|
+
"info",
|
|
1124
|
+
"neutral",
|
|
1125
|
+
"base"
|
|
1126
|
+
]).optional()
|
|
1127
|
+
}),
|
|
1128
|
+
description: "A toggle switch component for boolean on/off states with animated thumb transition.",
|
|
1129
|
+
renderer: (e) => {
|
|
1130
|
+
const n = p(e.value ?? !1);
|
|
1131
|
+
return st({
|
|
1132
|
+
value: n,
|
|
1133
|
+
onChange: (a) => n.set(a),
|
|
1134
|
+
disabled: e.disabled,
|
|
1135
|
+
size: e.size,
|
|
1136
|
+
color: e.color
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
}),
|
|
1140
|
+
l({
|
|
1141
|
+
name: "RadioGroup",
|
|
1142
|
+
props: t.object({
|
|
1143
|
+
options: t.array(
|
|
1144
|
+
t.object({
|
|
1145
|
+
value: t.string(),
|
|
1146
|
+
label: t.string(),
|
|
1147
|
+
description: t.string().optional(),
|
|
1148
|
+
disabled: t.boolean().optional()
|
|
1149
|
+
})
|
|
1150
|
+
),
|
|
1151
|
+
value: t.string().optional(),
|
|
1152
|
+
orientation: t.enum(["horizontal", "vertical"]).optional(),
|
|
1153
|
+
size: w.optional(),
|
|
1154
|
+
disabled: t.boolean().optional()
|
|
1155
|
+
}),
|
|
1156
|
+
description: "A group of radio buttons allowing the user to select one option from a mutually exclusive list.",
|
|
1157
|
+
renderer: (e) => {
|
|
1158
|
+
const n = p(e.value ?? e.options[0]?.value ?? "");
|
|
1159
|
+
return Fe({
|
|
1160
|
+
options: p(e.options),
|
|
1161
|
+
value: n,
|
|
1162
|
+
onChange: (a) => n.set(a),
|
|
1163
|
+
orientation: e.orientation,
|
|
1164
|
+
size: e.size,
|
|
1165
|
+
disabled: e.disabled
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
}),
|
|
1169
|
+
l({
|
|
1170
|
+
name: "NativeSelect",
|
|
1171
|
+
props: t.object({
|
|
1172
|
+
options: t.array(
|
|
1173
|
+
t.object({
|
|
1174
|
+
value: t.string(),
|
|
1175
|
+
label: t.string()
|
|
1176
|
+
})
|
|
1177
|
+
),
|
|
1178
|
+
value: t.string().optional(),
|
|
1179
|
+
placeholder: t.string().optional(),
|
|
1180
|
+
disabled: t.boolean().optional(),
|
|
1181
|
+
size: w.optional()
|
|
1182
|
+
}),
|
|
1183
|
+
description: "A native HTML select dropdown input component.",
|
|
1184
|
+
renderer: (e) => {
|
|
1185
|
+
const n = p(e.value ?? e.options[0]?.value ?? "");
|
|
1186
|
+
return de({
|
|
1187
|
+
options: p(
|
|
1188
|
+
e.options.map((a) => ({
|
|
1189
|
+
type: "value",
|
|
1190
|
+
value: a.value,
|
|
1191
|
+
label: a.label
|
|
1192
|
+
}))
|
|
1193
|
+
),
|
|
1194
|
+
value: n,
|
|
1195
|
+
onChange: (a) => n.set(a),
|
|
1196
|
+
placeholder: e.placeholder,
|
|
1197
|
+
disabled: e.disabled,
|
|
1198
|
+
size: e.size
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
}),
|
|
1202
|
+
l({
|
|
1203
|
+
name: "RatingInput",
|
|
1204
|
+
props: t.object({
|
|
1205
|
+
value: t.number().optional(),
|
|
1206
|
+
max: t.number().optional(),
|
|
1207
|
+
disabled: t.boolean().optional(),
|
|
1208
|
+
size: w.optional()
|
|
1209
|
+
}),
|
|
1210
|
+
description: "A star rating input component with fractional precision support.",
|
|
1211
|
+
renderer: (e) => {
|
|
1212
|
+
const n = p(e.value ?? 0);
|
|
1213
|
+
return lt({
|
|
1214
|
+
value: n,
|
|
1215
|
+
onChange: (a) => n.set(a),
|
|
1216
|
+
max: e.max,
|
|
1217
|
+
disabled: e.disabled,
|
|
1218
|
+
size: e.size
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
}),
|
|
1222
|
+
l({
|
|
1223
|
+
name: "SliderInput",
|
|
1224
|
+
props: t.object({
|
|
1225
|
+
value: t.number().optional(),
|
|
1226
|
+
min: t.number().optional(),
|
|
1227
|
+
max: t.number().optional(),
|
|
1228
|
+
step: t.number().optional(),
|
|
1229
|
+
disabled: t.boolean().optional(),
|
|
1230
|
+
size: w.optional()
|
|
1231
|
+
}),
|
|
1232
|
+
description: "A range slider input component.",
|
|
1233
|
+
renderer: (e) => {
|
|
1234
|
+
const n = p(e.value ?? e.min ?? 0);
|
|
1235
|
+
return ct({
|
|
1236
|
+
value: n,
|
|
1237
|
+
onChange: (a) => n.set(a),
|
|
1238
|
+
min: e.min,
|
|
1239
|
+
max: e.max,
|
|
1240
|
+
step: e.step,
|
|
1241
|
+
disabled: e.disabled,
|
|
1242
|
+
size: e.size
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
}),
|
|
1246
|
+
l({
|
|
1247
|
+
name: "ColorInput",
|
|
1248
|
+
props: t.object({
|
|
1249
|
+
value: t.string().optional(),
|
|
1250
|
+
disabled: t.boolean().optional(),
|
|
1251
|
+
size: w.optional()
|
|
1252
|
+
}),
|
|
1253
|
+
description: "A color picker input component.",
|
|
1254
|
+
renderer: (e) => {
|
|
1255
|
+
const n = p(e.value ?? "#000000");
|
|
1256
|
+
return De({
|
|
1257
|
+
value: n,
|
|
1258
|
+
onChange: (a) => n.set(a),
|
|
1259
|
+
disabled: e.disabled,
|
|
1260
|
+
size: e.size
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
}),
|
|
1264
|
+
l({
|
|
1265
|
+
name: "TagInput",
|
|
1266
|
+
props: t.object({
|
|
1267
|
+
tags: t.array(t.string()).optional(),
|
|
1268
|
+
placeholder: t.string().optional(),
|
|
1269
|
+
disabled: t.boolean().optional(),
|
|
1270
|
+
size: w.optional()
|
|
1271
|
+
}),
|
|
1272
|
+
description: "An input for entering and managing a list of tags.",
|
|
1273
|
+
renderer: (e) => {
|
|
1274
|
+
const n = p(e.tags ?? []);
|
|
1275
|
+
return Ee({
|
|
1276
|
+
values: n,
|
|
1277
|
+
onChange: (a) => n.set(a),
|
|
1278
|
+
placeholder: e.placeholder,
|
|
1279
|
+
disabled: e.disabled,
|
|
1280
|
+
size: e.size
|
|
1281
|
+
});
|
|
1282
|
+
}
|
|
1283
|
+
}),
|
|
1284
|
+
l({
|
|
1285
|
+
name: "OTPInput",
|
|
1286
|
+
props: t.object({
|
|
1287
|
+
value: t.string().optional(),
|
|
1288
|
+
length: t.number().optional(),
|
|
1289
|
+
disabled: t.boolean().optional(),
|
|
1290
|
+
size: w.optional()
|
|
1291
|
+
}),
|
|
1292
|
+
description: "A one-time password input with individual character fields.",
|
|
1293
|
+
renderer: (e) => {
|
|
1294
|
+
const n = p(e.value ?? "");
|
|
1295
|
+
return Be({
|
|
1296
|
+
value: n,
|
|
1297
|
+
onChange: (a) => n.set(a),
|
|
1298
|
+
length: e.length,
|
|
1299
|
+
disabled: e.disabled,
|
|
1300
|
+
size: e.size
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
}),
|
|
1304
|
+
l({
|
|
1305
|
+
name: "SegmentedInput",
|
|
1306
|
+
props: t.object({
|
|
1307
|
+
options: t.record(t.string(), t.string()),
|
|
1308
|
+
value: t.string().optional(),
|
|
1309
|
+
size: w.optional(),
|
|
1310
|
+
disabled: t.boolean().optional(),
|
|
1311
|
+
variant: t.enum(["pill", "squared"]).optional()
|
|
1312
|
+
}),
|
|
1313
|
+
description: "A segmented control for selecting one option from a set, similar to a tab bar or radio group.",
|
|
1314
|
+
renderer: (e) => {
|
|
1315
|
+
const n = Object.keys(e.options), a = p(e.value ?? n[0] ?? "");
|
|
1316
|
+
return me({
|
|
1317
|
+
options: e.options,
|
|
1318
|
+
value: a,
|
|
1319
|
+
onChange: (o) => a.set(o),
|
|
1320
|
+
size: e.size,
|
|
1321
|
+
disabled: e.disabled,
|
|
1322
|
+
variant: e.variant
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
})
|
|
1326
|
+
], L = t.enum(["xs", "sm", "md", "lg", "xl"]), M = t.enum([
|
|
1327
|
+
"primary",
|
|
1328
|
+
"secondary",
|
|
1329
|
+
"success",
|
|
1330
|
+
"warning",
|
|
1331
|
+
"danger",
|
|
1332
|
+
"info",
|
|
1333
|
+
"neutral",
|
|
1334
|
+
"base"
|
|
1335
|
+
]), xt = [
|
|
1336
|
+
l({
|
|
1337
|
+
name: "Tabs",
|
|
1338
|
+
props: t.object({
|
|
1339
|
+
items: t.array(
|
|
1340
|
+
t.object({
|
|
1341
|
+
key: t.string(),
|
|
1342
|
+
label: t.string(),
|
|
1343
|
+
content: t.string().optional(),
|
|
1344
|
+
disabled: t.boolean().optional()
|
|
1345
|
+
})
|
|
1346
|
+
),
|
|
1347
|
+
activeKey: t.string().optional(),
|
|
1348
|
+
size: L.optional(),
|
|
1349
|
+
variant: t.enum(["default", "filled", "outline", "underline", "pill"]).optional(),
|
|
1350
|
+
color: M.optional(),
|
|
1351
|
+
orientation: t.enum(["horizontal", "vertical"]).optional()
|
|
1352
|
+
}),
|
|
1353
|
+
description: "A tabbed navigation component with content panels for each tab.",
|
|
1354
|
+
renderer: (e) => {
|
|
1355
|
+
const n = e.activeKey ?? e.items[0]?.key ?? "", a = p(n);
|
|
1356
|
+
return Ne({
|
|
1357
|
+
items: e.items.map((o) => ({
|
|
1358
|
+
key: o.key,
|
|
1359
|
+
label: o.label,
|
|
1360
|
+
content: () => z.div(X.padding("1rem 0"), o.content ?? ""),
|
|
1361
|
+
disabled: o.disabled
|
|
1362
|
+
})),
|
|
1363
|
+
value: a,
|
|
1364
|
+
onChange: (o) => a.set(o),
|
|
1365
|
+
size: e.size,
|
|
1366
|
+
variant: e.variant ?? "underline",
|
|
1367
|
+
color: e.color,
|
|
1368
|
+
orientation: e.orientation
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
}),
|
|
1372
|
+
l({
|
|
1373
|
+
name: "Breadcrumbs",
|
|
1374
|
+
props: t.object({
|
|
1375
|
+
items: t.array(
|
|
1376
|
+
t.object({
|
|
1377
|
+
label: t.string(),
|
|
1378
|
+
href: t.string().optional(),
|
|
1379
|
+
icon: t.string().optional(),
|
|
1380
|
+
current: t.boolean().optional()
|
|
1381
|
+
})
|
|
1382
|
+
),
|
|
1383
|
+
separator: t.string().optional(),
|
|
1384
|
+
maxItems: t.number().optional(),
|
|
1385
|
+
size: L.optional()
|
|
1386
|
+
}),
|
|
1387
|
+
description: "A breadcrumb navigation component showing the current page location within a hierarchy.",
|
|
1388
|
+
renderer: (e) => Me({
|
|
1389
|
+
items: p(e.items),
|
|
1390
|
+
separator: e.separator,
|
|
1391
|
+
maxItems: e.maxItems,
|
|
1392
|
+
size: e.size
|
|
1393
|
+
})
|
|
1394
|
+
}),
|
|
1395
|
+
l({
|
|
1396
|
+
name: "Pagination",
|
|
1397
|
+
props: t.object({
|
|
1398
|
+
currentPage: t.number(),
|
|
1399
|
+
totalPages: t.number(),
|
|
1400
|
+
siblings: t.number().optional(),
|
|
1401
|
+
showPrevNext: t.boolean().optional(),
|
|
1402
|
+
showFirstLast: t.boolean().optional(),
|
|
1403
|
+
size: L.optional(),
|
|
1404
|
+
variant: t.enum(["filled", "outline", "default"]).optional(),
|
|
1405
|
+
color: M.optional()
|
|
1406
|
+
}),
|
|
1407
|
+
description: "A pagination control for navigating between pages of content.",
|
|
1408
|
+
renderer: (e) => {
|
|
1409
|
+
const n = p(e.currentPage);
|
|
1410
|
+
return Re({
|
|
1411
|
+
currentPage: n,
|
|
1412
|
+
totalPages: e.totalPages,
|
|
1413
|
+
onChange: (a) => n.set(a),
|
|
1414
|
+
siblings: e.siblings,
|
|
1415
|
+
showPrevNext: e.showPrevNext,
|
|
1416
|
+
showFirstLast: e.showFirstLast,
|
|
1417
|
+
size: e.size,
|
|
1418
|
+
variant: e.variant,
|
|
1419
|
+
color: e.color
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
}),
|
|
1423
|
+
l({
|
|
1424
|
+
name: "Stepper",
|
|
1425
|
+
props: t.object({
|
|
1426
|
+
steps: t.array(
|
|
1427
|
+
t.object({
|
|
1428
|
+
label: t.string(),
|
|
1429
|
+
description: t.string().optional(),
|
|
1430
|
+
icon: t.string().optional()
|
|
1431
|
+
})
|
|
1432
|
+
),
|
|
1433
|
+
activeStep: t.number().optional(),
|
|
1434
|
+
orientation: t.enum(["horizontal", "vertical"]).optional(),
|
|
1435
|
+
variant: t.enum(["default", "compact"]).optional(),
|
|
1436
|
+
size: L.optional(),
|
|
1437
|
+
color: M.optional(),
|
|
1438
|
+
showNavigation: t.boolean().optional()
|
|
1439
|
+
}),
|
|
1440
|
+
description: "A step-by-step wizard component for multi-step forms or workflows.",
|
|
1441
|
+
renderer: (e) => {
|
|
1442
|
+
const n = p(e.activeStep ?? 0);
|
|
1443
|
+
return $e({
|
|
1444
|
+
steps: e.steps.map((a) => ({
|
|
1445
|
+
label: a.label,
|
|
1446
|
+
description: a.description,
|
|
1447
|
+
icon: a.icon
|
|
1448
|
+
})),
|
|
1449
|
+
value: n,
|
|
1450
|
+
onChange: (a) => n.set(a),
|
|
1451
|
+
orientation: e.orientation,
|
|
1452
|
+
variant: e.variant,
|
|
1453
|
+
size: e.size,
|
|
1454
|
+
color: e.color,
|
|
1455
|
+
showNavigation: e.showNavigation
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
}),
|
|
1459
|
+
l({
|
|
1460
|
+
name: "TreeView",
|
|
1461
|
+
props: t.object({
|
|
1462
|
+
items: t.array(
|
|
1463
|
+
t.object({
|
|
1464
|
+
id: t.string(),
|
|
1465
|
+
label: t.string(),
|
|
1466
|
+
icon: t.string().optional(),
|
|
1467
|
+
badge: t.string().optional(),
|
|
1468
|
+
children: t.array(
|
|
1469
|
+
t.object({
|
|
1470
|
+
id: t.string(),
|
|
1471
|
+
label: t.string(),
|
|
1472
|
+
icon: t.string().optional()
|
|
1473
|
+
})
|
|
1474
|
+
).optional()
|
|
1475
|
+
})
|
|
1476
|
+
),
|
|
1477
|
+
selectedId: t.string().optional(),
|
|
1478
|
+
size: L.optional()
|
|
1479
|
+
}),
|
|
1480
|
+
description: "A hierarchical tree view component for displaying nested data with expand/collapse.",
|
|
1481
|
+
renderer: (e) => {
|
|
1482
|
+
const n = p(e.selectedId);
|
|
1483
|
+
return Ge({
|
|
1484
|
+
items: p(e.items),
|
|
1485
|
+
selectedId: n,
|
|
1486
|
+
onSelect: (a) => n.set(a),
|
|
1487
|
+
size: e.size
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
}),
|
|
1491
|
+
l({
|
|
1492
|
+
name: "Sidebar",
|
|
1493
|
+
props: t.object({
|
|
1494
|
+
backgroundMode: t.enum(["light", "dark"]).optional(),
|
|
1495
|
+
groups: t.array(
|
|
1496
|
+
t.object({
|
|
1497
|
+
label: t.string(),
|
|
1498
|
+
links: t.array(
|
|
1499
|
+
t.object({
|
|
1500
|
+
label: t.string(),
|
|
1501
|
+
href: t.string().optional(),
|
|
1502
|
+
icon: t.string().optional(),
|
|
1503
|
+
active: t.boolean().optional()
|
|
1504
|
+
})
|
|
1505
|
+
)
|
|
1506
|
+
})
|
|
1507
|
+
).optional()
|
|
1508
|
+
}),
|
|
1509
|
+
description: "A navigation sidebar component for application layouts, supporting grouped links.",
|
|
1510
|
+
renderer: (e) => Ze(
|
|
1511
|
+
{ backgroundMode: e.backgroundMode },
|
|
1512
|
+
...(e.groups ?? []).map(
|
|
1513
|
+
(n) => We(
|
|
1514
|
+
{ header: n.label },
|
|
1515
|
+
...n.links.map(
|
|
1516
|
+
(a) => _e({
|
|
1517
|
+
content: a.label,
|
|
1518
|
+
href: a.href ?? "#",
|
|
1519
|
+
icon: a.icon
|
|
1520
|
+
})
|
|
1521
|
+
)
|
|
1522
|
+
)
|
|
1523
|
+
)
|
|
1524
|
+
)
|
|
1525
|
+
})
|
|
1526
|
+
], Tt = [
|
|
1527
|
+
l({
|
|
1528
|
+
name: "Modal",
|
|
1529
|
+
props: t.object({
|
|
1530
|
+
triggerLabel: t.string(),
|
|
1531
|
+
title: t.string().optional(),
|
|
1532
|
+
body: t.string(),
|
|
1533
|
+
footerLabel: t.string().optional(),
|
|
1534
|
+
size: t.enum(["sm", "md", "lg", "xl"]).optional(),
|
|
1535
|
+
dismissable: t.boolean().optional(),
|
|
1536
|
+
position: t.enum([
|
|
1537
|
+
"center",
|
|
1538
|
+
"top",
|
|
1539
|
+
"bottom",
|
|
1540
|
+
"left",
|
|
1541
|
+
"right",
|
|
1542
|
+
"top-start",
|
|
1543
|
+
"top-end",
|
|
1544
|
+
"bottom-start",
|
|
1545
|
+
"bottom-end"
|
|
1546
|
+
]).optional()
|
|
1547
|
+
}),
|
|
1548
|
+
description: "A modal dialog component with structured header, body, and footer sections. Renders a trigger button that opens the modal.",
|
|
1549
|
+
renderer: (e) => ut(
|
|
1550
|
+
{
|
|
1551
|
+
size: e.size,
|
|
1552
|
+
dismissable: e.dismissable,
|
|
1553
|
+
position: e.position
|
|
1554
|
+
},
|
|
1555
|
+
(n, a) => j(
|
|
1556
|
+
{
|
|
1557
|
+
onClick: () => n({
|
|
1558
|
+
header: e.title ? z.h2(e.title) : void 0,
|
|
1559
|
+
body: z.p(e.body),
|
|
1560
|
+
footer: e.footerLabel ? j(
|
|
1561
|
+
{ variant: "filled", onClick: a },
|
|
1562
|
+
e.footerLabel
|
|
1563
|
+
) : void 0
|
|
1564
|
+
})
|
|
1565
|
+
},
|
|
1566
|
+
e.triggerLabel
|
|
1567
|
+
)
|
|
1568
|
+
)
|
|
1569
|
+
}),
|
|
1570
|
+
l({
|
|
1571
|
+
name: "Drawer",
|
|
1572
|
+
props: t.object({
|
|
1573
|
+
triggerLabel: t.string(),
|
|
1574
|
+
title: t.string().optional(),
|
|
1575
|
+
body: t.string(),
|
|
1576
|
+
side: t.enum(["top", "right", "bottom", "left", "inline-start", "inline-end"]).optional(),
|
|
1577
|
+
size: t.enum(["sm", "md", "lg", "xl"]).optional()
|
|
1578
|
+
}),
|
|
1579
|
+
description: "A slide-out panel component that anchors to any side of the viewport. Renders a trigger button.",
|
|
1580
|
+
renderer: (e) => Ke(
|
|
1581
|
+
(n, a) => j(
|
|
1582
|
+
{
|
|
1583
|
+
onClick: () => n({
|
|
1584
|
+
side: e.side,
|
|
1585
|
+
size: e.size,
|
|
1586
|
+
header: e.title ? z.h3(e.title) : void 0,
|
|
1587
|
+
body: z.p(e.body)
|
|
1588
|
+
})
|
|
1589
|
+
},
|
|
1590
|
+
e.triggerLabel
|
|
1591
|
+
)
|
|
1592
|
+
)
|
|
1593
|
+
}),
|
|
1594
|
+
l({
|
|
1595
|
+
name: "Tooltip",
|
|
1596
|
+
props: t.object({
|
|
1597
|
+
content: t.string(),
|
|
1598
|
+
triggerLabel: t.string(),
|
|
1599
|
+
placement: t.enum([
|
|
1600
|
+
"top",
|
|
1601
|
+
"bottom",
|
|
1602
|
+
"left",
|
|
1603
|
+
"right",
|
|
1604
|
+
"top-start",
|
|
1605
|
+
"top-end",
|
|
1606
|
+
"bottom-start",
|
|
1607
|
+
"bottom-end"
|
|
1608
|
+
]).optional()
|
|
1609
|
+
}),
|
|
1610
|
+
description: "A tooltip that provides contextual information when hovering or focusing on an element. Must be a child of the trigger element.",
|
|
1611
|
+
renderer: (e) => j(
|
|
1612
|
+
{},
|
|
1613
|
+
e.triggerLabel,
|
|
1614
|
+
Ve({
|
|
1615
|
+
content: e.content,
|
|
1616
|
+
placement: e.placement
|
|
1617
|
+
})
|
|
1618
|
+
)
|
|
1619
|
+
}),
|
|
1620
|
+
l({
|
|
1621
|
+
name: "Popover",
|
|
1622
|
+
props: t.object({
|
|
1623
|
+
content: t.string(),
|
|
1624
|
+
triggerLabel: t.string(),
|
|
1625
|
+
placement: t.enum([
|
|
1626
|
+
"top",
|
|
1627
|
+
"bottom",
|
|
1628
|
+
"left",
|
|
1629
|
+
"right",
|
|
1630
|
+
"top-start",
|
|
1631
|
+
"top-end",
|
|
1632
|
+
"bottom-start",
|
|
1633
|
+
"bottom-end"
|
|
1634
|
+
]).optional()
|
|
1635
|
+
}),
|
|
1636
|
+
description: "A popover that displays arbitrary content in a positioned overlay panel triggered by clicking. Must be a child of the trigger element.",
|
|
1637
|
+
renderer: (e) => j(
|
|
1638
|
+
{ stopPropagation: !1 },
|
|
1639
|
+
e.triggerLabel,
|
|
1640
|
+
Ue({
|
|
1641
|
+
content: z.div(z.p(e.content)),
|
|
1642
|
+
placement: e.placement
|
|
1643
|
+
})
|
|
1644
|
+
)
|
|
1645
|
+
})
|
|
1646
|
+
], It = [
|
|
1647
|
+
l({
|
|
1648
|
+
name: "FormatNumber",
|
|
1649
|
+
props: t.object({
|
|
1650
|
+
value: t.number(),
|
|
1651
|
+
style: t.enum(["decimal", "currency", "percent", "unit"]).optional(),
|
|
1652
|
+
currency: t.string().optional(),
|
|
1653
|
+
notation: t.enum(["standard", "scientific", "engineering", "compact"]).optional(),
|
|
1654
|
+
minimumFractionDigits: t.number().optional(),
|
|
1655
|
+
maximumFractionDigits: t.number().optional(),
|
|
1656
|
+
locale: t.string().optional()
|
|
1657
|
+
}),
|
|
1658
|
+
description: "Locale-aware number formatting component.",
|
|
1659
|
+
renderer: (e) => He({
|
|
1660
|
+
value: e.value,
|
|
1661
|
+
style: e.style,
|
|
1662
|
+
currency: e.currency,
|
|
1663
|
+
notation: e.notation,
|
|
1664
|
+
minimumFractionDigits: e.minimumFractionDigits,
|
|
1665
|
+
maximumFractionDigits: e.maximumFractionDigits,
|
|
1666
|
+
locale: e.locale
|
|
1667
|
+
})
|
|
1668
|
+
}),
|
|
1669
|
+
l({
|
|
1670
|
+
name: "FormatDate",
|
|
1671
|
+
props: t.object({
|
|
1672
|
+
value: t.string(),
|
|
1673
|
+
dateStyle: t.enum(["full", "long", "medium", "short"]).optional(),
|
|
1674
|
+
locale: t.string().optional(),
|
|
1675
|
+
timeZone: t.string().optional()
|
|
1676
|
+
}),
|
|
1677
|
+
description: "Locale-aware date formatting component.",
|
|
1678
|
+
renderer: (e) => qe({
|
|
1679
|
+
value: e.value,
|
|
1680
|
+
dateStyle: e.dateStyle,
|
|
1681
|
+
locale: e.locale,
|
|
1682
|
+
timeZone: e.timeZone
|
|
1683
|
+
})
|
|
1684
|
+
}),
|
|
1685
|
+
l({
|
|
1686
|
+
name: "FormatTime",
|
|
1687
|
+
props: t.object({
|
|
1688
|
+
value: t.string(),
|
|
1689
|
+
timeStyle: t.enum(["full", "long", "medium", "short"]).optional(),
|
|
1690
|
+
locale: t.string().optional(),
|
|
1691
|
+
timeZone: t.string().optional(),
|
|
1692
|
+
hour12: t.boolean().optional()
|
|
1693
|
+
}),
|
|
1694
|
+
description: "Locale-aware time formatting component.",
|
|
1695
|
+
renderer: (e) => Je({
|
|
1696
|
+
value: e.value,
|
|
1697
|
+
timeStyle: e.timeStyle,
|
|
1698
|
+
locale: e.locale,
|
|
1699
|
+
timeZone: e.timeZone,
|
|
1700
|
+
hour12: e.hour12
|
|
1701
|
+
})
|
|
1702
|
+
}),
|
|
1703
|
+
l({
|
|
1704
|
+
name: "FormatDateTime",
|
|
1705
|
+
props: t.object({
|
|
1706
|
+
value: t.string(),
|
|
1707
|
+
dateStyle: t.enum(["full", "long", "medium", "short"]).optional(),
|
|
1708
|
+
timeStyle: t.enum(["full", "long", "medium", "short"]).optional(),
|
|
1709
|
+
locale: t.string().optional(),
|
|
1710
|
+
timeZone: t.string().optional()
|
|
1711
|
+
}),
|
|
1712
|
+
description: "Locale-aware date and time formatting component combining date and time styles.",
|
|
1713
|
+
renderer: (e) => Qe({
|
|
1714
|
+
value: e.value,
|
|
1715
|
+
dateStyle: e.dateStyle,
|
|
1716
|
+
timeStyle: e.timeStyle,
|
|
1717
|
+
locale: e.locale,
|
|
1718
|
+
timeZone: e.timeZone
|
|
1719
|
+
})
|
|
1720
|
+
}),
|
|
1721
|
+
l({
|
|
1722
|
+
name: "FormatRelativeTime",
|
|
1723
|
+
props: t.object({
|
|
1724
|
+
value: t.number(),
|
|
1725
|
+
unit: t.enum([
|
|
1726
|
+
"year",
|
|
1727
|
+
"quarter",
|
|
1728
|
+
"month",
|
|
1729
|
+
"week",
|
|
1730
|
+
"day",
|
|
1731
|
+
"hour",
|
|
1732
|
+
"minute",
|
|
1733
|
+
"second"
|
|
1734
|
+
]),
|
|
1735
|
+
numeric: t.enum(["always", "auto"]).optional(),
|
|
1736
|
+
style: t.enum(["long", "short", "narrow"]).optional(),
|
|
1737
|
+
locale: t.string().optional()
|
|
1738
|
+
}),
|
|
1739
|
+
description: 'Locale-aware relative time formatting component (e.g., "2 days ago", "in 3 hours").',
|
|
1740
|
+
renderer: (e) => Xe({
|
|
1741
|
+
value: e.value,
|
|
1742
|
+
unit: e.unit,
|
|
1743
|
+
numeric: e.numeric,
|
|
1744
|
+
style: e.style,
|
|
1745
|
+
locale: e.locale
|
|
1746
|
+
})
|
|
1747
|
+
}),
|
|
1748
|
+
l({
|
|
1749
|
+
name: "FormatFileSize",
|
|
1750
|
+
props: t.object({
|
|
1751
|
+
value: t.number(),
|
|
1752
|
+
decimalPlaces: t.number().optional(),
|
|
1753
|
+
locale: t.string().optional()
|
|
1754
|
+
}),
|
|
1755
|
+
description: 'Locale-aware file size formatting component (e.g., "1.5 KB", "2.3 MB").',
|
|
1756
|
+
renderer: (e) => Ye({
|
|
1757
|
+
value: e.value,
|
|
1758
|
+
decimalPlaces: e.decimalPlaces,
|
|
1759
|
+
locale: e.locale
|
|
1760
|
+
})
|
|
1761
|
+
})
|
|
1762
|
+
], Lt = [
|
|
1763
|
+
l({
|
|
1764
|
+
name: "Kbd",
|
|
1765
|
+
props: t.object({
|
|
1766
|
+
key: t.string(),
|
|
1767
|
+
size: t.enum(["xs", "sm", "md"]).optional()
|
|
1768
|
+
}),
|
|
1769
|
+
description: "A styled keyboard key indicator component for displaying keyboard shortcuts.",
|
|
1770
|
+
renderer: (e) => et({ size: e.size }, e.key)
|
|
1771
|
+
}),
|
|
1772
|
+
l({
|
|
1773
|
+
name: "Label",
|
|
1774
|
+
props: t.object({
|
|
1775
|
+
text: t.string(),
|
|
1776
|
+
type: t.enum(["default", "emphasis", "muted", "danger"]).optional()
|
|
1777
|
+
}),
|
|
1778
|
+
description: "An inline label component for text with semantic styling variants.",
|
|
1779
|
+
renderer: (e) => {
|
|
1780
|
+
const n = e.type ?? "default";
|
|
1781
|
+
return n === "emphasis" ? ae(e.text) : n === "muted" ? ie(e.text) : n === "danger" ? re(e.text) : se(e.text);
|
|
1782
|
+
}
|
|
1783
|
+
})
|
|
1784
|
+
], Ut = Q({
|
|
1785
|
+
components: [
|
|
1786
|
+
...Ct,
|
|
1787
|
+
...jt,
|
|
1788
|
+
...kt,
|
|
1789
|
+
...At,
|
|
1790
|
+
...xt,
|
|
1791
|
+
...Tt,
|
|
1792
|
+
...It,
|
|
1793
|
+
...Lt
|
|
1794
|
+
],
|
|
1795
|
+
root: "Stack",
|
|
1796
|
+
groups: [
|
|
1797
|
+
{
|
|
1798
|
+
name: "Layout",
|
|
1799
|
+
description: "Structural containers",
|
|
1800
|
+
components: [
|
|
1801
|
+
"Stack",
|
|
1802
|
+
"Flex",
|
|
1803
|
+
"Card",
|
|
1804
|
+
"Divider",
|
|
1805
|
+
"Accordion",
|
|
1806
|
+
"Center",
|
|
1807
|
+
"Group",
|
|
1808
|
+
"Collapse"
|
|
1809
|
+
]
|
|
1810
|
+
},
|
|
1811
|
+
{
|
|
1812
|
+
name: "Button",
|
|
1813
|
+
description: "Interactive buttons",
|
|
1814
|
+
components: [
|
|
1815
|
+
"Button",
|
|
1816
|
+
"ToggleButton",
|
|
1817
|
+
"CopyButton",
|
|
1818
|
+
"CloseButton",
|
|
1819
|
+
"ToggleButtonGroup"
|
|
1820
|
+
]
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
name: "Data Display",
|
|
1824
|
+
description: "Content presentation",
|
|
1825
|
+
components: [
|
|
1826
|
+
"StatCard",
|
|
1827
|
+
"Badge",
|
|
1828
|
+
"AutoColorBadge",
|
|
1829
|
+
"Avatar",
|
|
1830
|
+
"AvatarGroup",
|
|
1831
|
+
"ProgressBar",
|
|
1832
|
+
"DataTable",
|
|
1833
|
+
"Skeleton",
|
|
1834
|
+
"Indicator",
|
|
1835
|
+
"HistoryTimeline",
|
|
1836
|
+
"Icon"
|
|
1837
|
+
]
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
name: "Form",
|
|
1841
|
+
description: "User input controls",
|
|
1842
|
+
components: [
|
|
1843
|
+
"TextInput",
|
|
1844
|
+
"NumberInput",
|
|
1845
|
+
"PasswordInput",
|
|
1846
|
+
"EmailInput",
|
|
1847
|
+
"TextArea",
|
|
1848
|
+
"CheckboxInput",
|
|
1849
|
+
"Switch",
|
|
1850
|
+
"RadioGroup",
|
|
1851
|
+
"NativeSelect",
|
|
1852
|
+
"DropdownInput",
|
|
1853
|
+
"ComboboxInput",
|
|
1854
|
+
"DatePicker",
|
|
1855
|
+
"TimePicker",
|
|
1856
|
+
"RatingInput",
|
|
1857
|
+
"SliderInput",
|
|
1858
|
+
"ColorInput",
|
|
1859
|
+
"TagInput",
|
|
1860
|
+
"OTPInput",
|
|
1861
|
+
"SegmentedInput"
|
|
1862
|
+
]
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
name: "Navigation",
|
|
1866
|
+
description: "Navigation controls",
|
|
1867
|
+
components: [
|
|
1868
|
+
"Tabs",
|
|
1869
|
+
"Breadcrumbs",
|
|
1870
|
+
"Pagination",
|
|
1871
|
+
"Stepper",
|
|
1872
|
+
"TreeView",
|
|
1873
|
+
"Sidebar"
|
|
1874
|
+
]
|
|
1875
|
+
},
|
|
1876
|
+
{
|
|
1877
|
+
name: "Overlay",
|
|
1878
|
+
description: "Floating content",
|
|
1879
|
+
components: ["Modal", "Drawer", "Tooltip", "Popover"]
|
|
1880
|
+
},
|
|
1881
|
+
{
|
|
1882
|
+
name: "Format",
|
|
1883
|
+
description: "Formatted values",
|
|
1884
|
+
components: [
|
|
1885
|
+
"FormatNumber",
|
|
1886
|
+
"FormatDate",
|
|
1887
|
+
"FormatTime",
|
|
1888
|
+
"FormatDateTime",
|
|
1889
|
+
"FormatRelativeTime",
|
|
1890
|
+
"FormatFileSize"
|
|
1891
|
+
]
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
name: "Typography",
|
|
1895
|
+
description: "Text elements",
|
|
1896
|
+
components: ["Kbd", "Label"]
|
|
1897
|
+
}
|
|
1898
|
+
]
|
|
1899
|
+
});
|
|
1900
|
+
function Ot() {
|
|
1901
|
+
return z.div(
|
|
1902
|
+
x.class("bc-skeleton bc-skeleton--text"),
|
|
1903
|
+
x.style("min-height: 1.5em; width: 100%;")
|
|
1904
|
+
);
|
|
1905
|
+
}
|
|
1906
|
+
function Pt(e) {
|
|
1907
|
+
return Object.keys(e.props.shape);
|
|
1908
|
+
}
|
|
1909
|
+
function P(e, n, a, o, i) {
|
|
1910
|
+
switch (e.type) {
|
|
1911
|
+
case "string":
|
|
1912
|
+
return e.value;
|
|
1913
|
+
case "number":
|
|
1914
|
+
return String(e.value);
|
|
1915
|
+
case "boolean":
|
|
1916
|
+
return String(e.value);
|
|
1917
|
+
case "null":
|
|
1918
|
+
return A;
|
|
1919
|
+
case "array":
|
|
1920
|
+
return Y(
|
|
1921
|
+
...e.items.map(
|
|
1922
|
+
(r) => P(r, n, a, o, i)
|
|
1923
|
+
)
|
|
1924
|
+
);
|
|
1925
|
+
case "object":
|
|
1926
|
+
return A;
|
|
1927
|
+
case "reference": {
|
|
1928
|
+
if (o) {
|
|
1929
|
+
const r = o.get(e.name);
|
|
1930
|
+
if (r)
|
|
1931
|
+
return P(r.value, n, a, o, i);
|
|
1932
|
+
}
|
|
1933
|
+
return Ot();
|
|
1934
|
+
}
|
|
1935
|
+
case "component": {
|
|
1936
|
+
const r = n.get(e.name);
|
|
1937
|
+
if (!r)
|
|
1938
|
+
return A;
|
|
1939
|
+
const c = Pt(r).includes("children"), s = e.args;
|
|
1940
|
+
let u = {}, b = [];
|
|
1941
|
+
if (s.length >= 1 && s[0].type === "object") {
|
|
1942
|
+
u = R(s[0]);
|
|
1943
|
+
const h = s[s.length - 1];
|
|
1944
|
+
s.length > 1 && h.type === "array" && c && (b = h.items);
|
|
1945
|
+
} else s.length >= 1 && s[0].type === "array" && c && (b = s[0].items);
|
|
1946
|
+
const v = b.map(
|
|
1947
|
+
(h) => P(h, n, a, o, i)
|
|
1948
|
+
);
|
|
1949
|
+
c && v.length > 0 && (u.children = v);
|
|
1950
|
+
const d = { ...u };
|
|
1951
|
+
delete d.children;
|
|
1952
|
+
const m = r.props.safeParse(d), g = m.success ? {
|
|
1953
|
+
...m.data,
|
|
1954
|
+
...u.children != null ? { children: u.children } : {}
|
|
1955
|
+
} : u;
|
|
1956
|
+
return i && u.actionType && (g.__onAction = i), r.renderer(g, v);
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
function R(e) {
|
|
1961
|
+
switch (e.type) {
|
|
1962
|
+
case "string":
|
|
1963
|
+
return e.value;
|
|
1964
|
+
case "number":
|
|
1965
|
+
return e.value;
|
|
1966
|
+
case "boolean":
|
|
1967
|
+
return e.value;
|
|
1968
|
+
case "null":
|
|
1969
|
+
return null;
|
|
1970
|
+
case "array":
|
|
1971
|
+
return e.items.map((n) => R(n));
|
|
1972
|
+
case "object":
|
|
1973
|
+
return Object.fromEntries(
|
|
1974
|
+
Object.entries(e.entries).map(([n, a]) => [n, R(a)])
|
|
1975
|
+
);
|
|
1976
|
+
case "reference":
|
|
1977
|
+
return e.name;
|
|
1978
|
+
case "component":
|
|
1979
|
+
return e.name;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
const U = {
|
|
1983
|
+
mark: ee("OpenUI:ActionContext"),
|
|
1984
|
+
create: (e = {}) => {
|
|
1985
|
+
const n = p([]);
|
|
1986
|
+
return {
|
|
1987
|
+
value: {
|
|
1988
|
+
onAction: e.onAction,
|
|
1989
|
+
actions: n
|
|
1990
|
+
},
|
|
1991
|
+
dispose: () => n.dispose()
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
};
|
|
1995
|
+
function Ht(e) {
|
|
1996
|
+
const {
|
|
1997
|
+
library: n,
|
|
1998
|
+
response: a,
|
|
1999
|
+
isStreaming: o,
|
|
2000
|
+
onAction: i,
|
|
2001
|
+
onError: r,
|
|
2002
|
+
onComplete: c,
|
|
2003
|
+
debug: s
|
|
2004
|
+
} = e, u = i ? (d) => i(d) : void 0;
|
|
2005
|
+
function b(d) {
|
|
2006
|
+
if (!d) return A;
|
|
2007
|
+
const g = H(n)(d);
|
|
2008
|
+
return g.meta.errors.length > 0 && r && r(g.meta.errors), g.root ? v(g.root, g) : A;
|
|
2009
|
+
}
|
|
2010
|
+
function v(d, m) {
|
|
2011
|
+
if (d.type === "reference") {
|
|
2012
|
+
const g = m.statements.get(d.name);
|
|
2013
|
+
return g ? v(g.value, m) : A;
|
|
2014
|
+
}
|
|
2015
|
+
if (d.type === "component") {
|
|
2016
|
+
const g = d.args.map((h) => {
|
|
2017
|
+
if (h.type === "reference") {
|
|
2018
|
+
const f = m.statements.get(h.name);
|
|
2019
|
+
return f ? f.value : h;
|
|
2020
|
+
}
|
|
2021
|
+
return h.type === "array" ? {
|
|
2022
|
+
...h,
|
|
2023
|
+
items: h.items.map((f) => {
|
|
2024
|
+
if (f.type === "reference") {
|
|
2025
|
+
const y = m.statements.get(f.name);
|
|
2026
|
+
return y ? y.value : f;
|
|
2027
|
+
}
|
|
2028
|
+
return f;
|
|
2029
|
+
})
|
|
2030
|
+
} : h;
|
|
2031
|
+
});
|
|
2032
|
+
return P(
|
|
2033
|
+
{ ...d, args: g },
|
|
2034
|
+
n,
|
|
2035
|
+
s,
|
|
2036
|
+
m.statements,
|
|
2037
|
+
u
|
|
2038
|
+
);
|
|
2039
|
+
}
|
|
2040
|
+
return P(d, n, s, m.statements, u);
|
|
2041
|
+
}
|
|
2042
|
+
return typeof a == "string" ? z.div(
|
|
2043
|
+
x.class(e.className ?? ""),
|
|
2044
|
+
Z(
|
|
2045
|
+
U,
|
|
2046
|
+
{ onAction: i },
|
|
2047
|
+
() => b(a)
|
|
2048
|
+
)
|
|
2049
|
+
) : z.div(
|
|
2050
|
+
x.class(e.className ?? ""),
|
|
2051
|
+
Z(
|
|
2052
|
+
U,
|
|
2053
|
+
{ onAction: i },
|
|
2054
|
+
() => te((d) => {
|
|
2055
|
+
let m = null;
|
|
2056
|
+
const g = B.get(a);
|
|
2057
|
+
if (g) {
|
|
2058
|
+
const y = W(b(g));
|
|
2059
|
+
m = _(y, d);
|
|
2060
|
+
}
|
|
2061
|
+
const h = B.on(a, (y) => {
|
|
2062
|
+
if (m && (m(!0), m = null), y) {
|
|
2063
|
+
const S = W(b(y));
|
|
2064
|
+
m = _(S, d);
|
|
2065
|
+
}
|
|
2066
|
+
});
|
|
2067
|
+
let f = null;
|
|
2068
|
+
return o !== void 0 && (f = B.on(o, (y) => {
|
|
2069
|
+
!y && c && c();
|
|
2070
|
+
})), ne(() => {
|
|
2071
|
+
h(), f && f(), m && m(!0);
|
|
2072
|
+
});
|
|
2073
|
+
})
|
|
2074
|
+
)
|
|
2075
|
+
);
|
|
2076
|
+
}
|
|
2077
|
+
function qt(e, n) {
|
|
2078
|
+
const a = p(""), o = p(!0), { onComplete: i, onError: r, extractContent: c, withCredentials: s } = n ?? {}, u = new EventSource(e, {
|
|
2079
|
+
withCredentials: s ?? !1
|
|
2080
|
+
});
|
|
2081
|
+
let b = "";
|
|
2082
|
+
return u.addEventListener("message", (d) => {
|
|
2083
|
+
const m = d.data;
|
|
2084
|
+
if (c)
|
|
2085
|
+
try {
|
|
2086
|
+
b += c(m);
|
|
2087
|
+
} catch {
|
|
2088
|
+
}
|
|
2089
|
+
else
|
|
2090
|
+
b += m;
|
|
2091
|
+
a.set(b);
|
|
2092
|
+
}), u.addEventListener("error", () => {
|
|
2093
|
+
if (u.readyState === EventSource.CLOSED)
|
|
2094
|
+
o.set(!1), i?.();
|
|
2095
|
+
else {
|
|
2096
|
+
const d = new Error("EventSource error");
|
|
2097
|
+
r?.(d), o.set(!1);
|
|
2098
|
+
}
|
|
2099
|
+
}), { response: a, isStreaming: o, abort: () => {
|
|
2100
|
+
u.close(), a.dispose(), o.dispose();
|
|
2101
|
+
} };
|
|
2102
|
+
}
|
|
2103
|
+
function Jt(e, n, a) {
|
|
2104
|
+
const o = p(""), i = p(!0), r = new AbortController(), c = () => {
|
|
2105
|
+
r.abort(), o.dispose(), i.dispose();
|
|
2106
|
+
};
|
|
2107
|
+
return fetch(e, { ...n, signal: r.signal }).then(async (s) => {
|
|
2108
|
+
const u = s.body;
|
|
2109
|
+
if (!u) {
|
|
2110
|
+
i.set(!1), a?.onComplete?.();
|
|
2111
|
+
return;
|
|
2112
|
+
}
|
|
2113
|
+
const b = u.getReader(), v = new TextDecoder();
|
|
2114
|
+
let d = "";
|
|
2115
|
+
for (; ; ) {
|
|
2116
|
+
const { done: m, value: g } = await b.read();
|
|
2117
|
+
if (m) break;
|
|
2118
|
+
const h = v.decode(g, { stream: !0 });
|
|
2119
|
+
if (a?.extractContent) {
|
|
2120
|
+
const f = h.split(`
|
|
2121
|
+
`);
|
|
2122
|
+
for (const y of f) {
|
|
2123
|
+
const S = y.trim();
|
|
2124
|
+
if (S)
|
|
2125
|
+
try {
|
|
2126
|
+
d += a.extractContent(S);
|
|
2127
|
+
} catch {
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
o.set(d);
|
|
2131
|
+
} else
|
|
2132
|
+
d += h, o.set(d);
|
|
2133
|
+
}
|
|
2134
|
+
i.set(!1), a?.onComplete?.();
|
|
2135
|
+
}).catch((s) => {
|
|
2136
|
+
s instanceof Error && s.name === "AbortError" || (a?.onError?.(s instanceof Error ? s : new Error(String(s))), i.set(!1));
|
|
2137
|
+
}), { response: o, isStreaming: i, abort: c };
|
|
2138
|
+
}
|
|
2139
|
+
function Qt(e, n) {
|
|
2140
|
+
const a = p(""), o = p(!0), { onComplete: i, onError: r, extractContent: c, protocols: s } = n ?? {}, u = s ? new WebSocket(e, s) : new WebSocket(e);
|
|
2141
|
+
let b = "";
|
|
2142
|
+
return u.addEventListener("message", (m) => {
|
|
2143
|
+
const g = m.data;
|
|
2144
|
+
if (c)
|
|
2145
|
+
try {
|
|
2146
|
+
b += c(g);
|
|
2147
|
+
} catch {
|
|
2148
|
+
}
|
|
2149
|
+
else
|
|
2150
|
+
b += g;
|
|
2151
|
+
a.set(b);
|
|
2152
|
+
}), u.addEventListener("close", () => {
|
|
2153
|
+
o.set(!1), i?.();
|
|
2154
|
+
}), u.addEventListener("error", () => {
|
|
2155
|
+
const m = new Error("WebSocket error");
|
|
2156
|
+
r?.(m), o.set(!1);
|
|
2157
|
+
}), { response: a, isStreaming: o, close: () => {
|
|
2158
|
+
u.close(), a.dispose(), o.dispose();
|
|
2159
|
+
}, send: (m) => {
|
|
2160
|
+
u.send(m);
|
|
2161
|
+
} };
|
|
2162
|
+
}
|
|
2163
|
+
export {
|
|
2164
|
+
U as ActionContextProvider,
|
|
2165
|
+
Ht as OpenUIRenderer,
|
|
2166
|
+
Ut as beatuiLibrary,
|
|
2167
|
+
Q as createLibrary,
|
|
2168
|
+
H as createParser,
|
|
2169
|
+
Vt as createStreamingParser,
|
|
2170
|
+
l as defineComponent,
|
|
2171
|
+
Jt as fromFetch,
|
|
2172
|
+
qt as fromSSE,
|
|
2173
|
+
Qt as fromWebSocket
|
|
2174
|
+
};
|