@pebble-software/bonsai 0.1.2 → 0.2.1
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/README.md +31 -3
- package/dist/ast.js +1 -1
- package/dist/chunks/{builder.meta-WpXc5VBB.js → builder.meta-B7Y9M7Ab.js} +128 -122
- package/dist/chunks/builder.meta-B7Y9M7Ab.js.map +1 -0
- package/dist/chunks/create-renderer-C4nV9RV6.js +282 -0
- package/dist/chunks/create-renderer-C4nV9RV6.js.map +1 -0
- package/dist/chunks/index-CD5pykpk.js +367 -0
- package/dist/chunks/index-CD5pykpk.js.map +1 -0
- package/dist/chunks/{render-shared-Ci28BpkI.js → render-shared-Cwb527d4.js} +487 -445
- package/dist/chunks/render-shared-Cwb527d4.js.map +1 -0
- package/dist/components/core/render-shared.d.ts +25 -15
- package/dist/components/core/render-tree-client.d.ts +1 -1
- package/dist/components/ui/accordion.d.ts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +3 -3
- package/dist/core.js.map +1 -1
- package/dist/index.css +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/dist/lib/ast/evaluator.d.ts +1 -1
- package/dist/lib/ast/helpers.d.ts +3 -1
- package/dist/lib/ast/index.d.ts +1 -1
- package/dist/lib/ast/types.d.ts +4 -1
- package/dist/lib/ast/utils.d.ts +1 -1
- package/dist/lib/registry/json-schema-to-zod.d.ts +2 -2
- package/dist/lib/renderer/compile-template.d.ts +10 -2
- package/dist/lib/renderer/safe-props.d.ts +4 -0
- package/dist/library/schemas/src/bonsai.schema.d.ts +1 -2
- package/dist/presets/calendar.js.map +1 -1
- package/dist/presets/signature.js +1 -1
- package/dist/presets/signature.js.map +1 -1
- package/dist/renderer/core-registry.d.ts +1 -1
- package/dist/schemas.js +1 -1
- package/dist/styles/css/theme.css +8 -0
- package/dist/types.d.ts +8 -1
- package/package.json +7 -12
- package/dist/chunks/builder.meta-WpXc5VBB.js.map +0 -1
- package/dist/chunks/create-renderer-DHneTPd-.js +0 -280
- package/dist/chunks/create-renderer-DHneTPd-.js.map +0 -1
- package/dist/chunks/index-DzpRdatr.js +0 -359
- package/dist/chunks/index-DzpRdatr.js.map +0 -1
- package/dist/chunks/render-shared-Ci28BpkI.js.map +0 -1
- package/dist/components/ui/alert-dialog.d.ts +0 -23
- package/dist/components/ui/breadcrumb.d.ts +0 -10
- package/dist/components/ui/combobox.d.ts +0 -31
- package/dist/components/ui/command.d.ts +0 -23
- package/dist/components/ui/dialog.d.ts +0 -23
- package/dist/components/ui/drawer.d.ts +0 -22
- package/dist/components/ui/dropdown-menu.d.ts +0 -29
- package/dist/components/ui/form.d.ts +0 -24
- package/dist/components/ui/popover.d.ts +0 -9
- package/dist/components/ui/scroll-area.d.ts +0 -13
- package/dist/components/ui/sidebar.d.ts +0 -70
- package/dist/components/ui/toast.d.ts +0 -46
- package/dist/components/ui/tooltip.d.ts +0 -15
- package/dist/hooks/haptics.d.ts +0 -8
- package/dist/hooks/use-mobile.d.ts +0 -1
|
@@ -1,37 +1,43 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
2
|
import { COMPONENT as t } from "../constants.js";
|
|
3
|
-
const
|
|
3
|
+
const Se = e.object({
|
|
4
|
+
set: e.string().min(1, { message: "Action `set` needs a store path" }).refine((s) => !s.startsWith("{{"), {
|
|
5
|
+
message: "Action `set` takes a plain store path (e.g. `pizzaChoice`), not a {{binding}}"
|
|
6
|
+
}).meta({ description: "Store path to write, e.g. `pizzaChoice` or `row.selected` inside an `each`" }),
|
|
7
|
+
to: e.unknown().meta({ description: "Value to write (required; `null` clears): a literal or a `{{...}}` expression, evaluated against the state at click time" })
|
|
8
|
+
}).strict().meta({ id: "BonsaiClickAction" }), r = e.object({
|
|
4
9
|
id: e.string().optional().meta({ description: "Unique identifier for the element" }),
|
|
5
|
-
className: e.string().optional().meta({ description: "CSS classes to apply to the element" })
|
|
6
|
-
|
|
10
|
+
className: e.string().optional().meta({ description: "CSS classes to apply to the element" }),
|
|
11
|
+
onClick: e.array(Se).optional().meta({ description: "Store writes applied in order when the element is clicked" })
|
|
12
|
+
}).strict(), ye = r.extend({
|
|
7
13
|
href: e.string({ error: "Link destination (href) is required" }).min(1, { message: "Link destination (href) cannot be empty" })
|
|
8
|
-
}),
|
|
14
|
+
}), Le = r.extend({
|
|
9
15
|
variant: e.enum(["h1", "h2", "h3", "h4", "h5", "h6"], {
|
|
10
16
|
error: "Invalid heading variant. Must be one of: h1, h2, h3, h4, h5, or h6"
|
|
11
17
|
}).optional().meta({ description: "Heading level variant (h1-h6)" }),
|
|
12
18
|
as: e.enum(["h1", "h2", "h3", "h4", "h5", "h6"], {
|
|
13
19
|
error: "Invalid heading element type. Must be one of: h1, h2, h3, h4, h5, or h6"
|
|
14
20
|
}).optional().meta({ description: "Render as a different heading element" })
|
|
15
|
-
}).optional(),
|
|
21
|
+
}).optional(), ve = r.extend({
|
|
16
22
|
size: e.enum(["xs", "sm", "md", "lg", "xl"], {
|
|
17
23
|
error: "Invalid paragraph size. Must be one of: xs, sm, md, lg, or xl"
|
|
18
24
|
}).optional().meta({ description: "Paragraph text size" }),
|
|
19
25
|
variant: e.enum(["default", "muted"]).optional().meta({ description: "Paragraph style variant" }),
|
|
20
26
|
as: e.enum(["p", "div", "span"]).optional().meta({ description: "Render as a different element" })
|
|
21
|
-
}).optional(),
|
|
27
|
+
}).optional(), _e = r.optional(), Pe = r.optional(), De = r.optional(), fe = r.optional(), Be = r.optional(), we = r.optional(), Ue = r.extend({
|
|
22
28
|
variant: e.enum(["default", "success", "warning", "destructive"], {
|
|
23
29
|
error: "Invalid alert variant. Must be one of: default, success, warning, or destructive"
|
|
24
30
|
}).optional().meta({ description: "Alert style variant" }),
|
|
25
31
|
size: e.enum(["default", "sm", "lg"]).optional().meta({ description: "Alert size" }),
|
|
26
32
|
raised: e.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Alert shadow elevation" })
|
|
27
|
-
}).optional(),
|
|
33
|
+
}).optional(), Ge = r.extend({
|
|
28
34
|
variant: e.enum(["default", "secondary", "destructive", "outline", "ghost"], {
|
|
29
35
|
error: "Invalid badge variant. Must be one of: default, secondary, destructive, outline, or ghost"
|
|
30
36
|
}).optional().meta({ description: "Badge style variant" }),
|
|
31
37
|
size: e.enum(["sm", "md", "lg"]).optional().meta({ description: "Badge size" }),
|
|
32
38
|
raised: e.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Badge shadow elevation" }),
|
|
33
39
|
extrude: e.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Badge extrude elevation" })
|
|
34
|
-
}).optional(),
|
|
40
|
+
}).optional(), ke = r.extend({
|
|
35
41
|
variant: e.enum(["default", "secondary", "outline", "destructive", "warning", "ghost"], {
|
|
36
42
|
error: "Invalid button variant. Must be one of: default, secondary, outline, destructive, warning, or ghost"
|
|
37
43
|
}).optional().meta({ description: "Button style variant" }),
|
|
@@ -46,15 +52,15 @@ const r = e.object({
|
|
|
46
52
|
type: e.enum(["button", "submit"], {
|
|
47
53
|
error: "Invalid button type. Must be either 'button' or 'submit'"
|
|
48
54
|
}).optional().meta({ description: "Button type attribute" })
|
|
49
|
-
}).optional(),
|
|
55
|
+
}).optional(), ze = r.extend({
|
|
50
56
|
size: e.enum(["sm", "md"]).optional().meta({ description: "Card size" }),
|
|
51
57
|
raised: e.enum(["none", "xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Card shadow elevation" })
|
|
52
|
-
}).optional(), He = r.optional(),
|
|
58
|
+
}).optional(), He = r.optional(), Me = r.optional(), We = r.optional(), Fe = r.optional(), je = r.optional(), qe = r.optional(), Xe = r.optional(), Ve = r.extend({
|
|
53
59
|
checked: e.union([e.string(), e.boolean()]).optional().meta({ description: "Checkbox checked state" }),
|
|
54
60
|
disabled: e.union([e.string(), e.boolean()]).optional().meta({ description: "Whether the checkbox is disabled" }),
|
|
55
61
|
required: e.union([e.string(), e.boolean()]).optional().meta({ description: "Whether the checkbox must be checked" }),
|
|
56
62
|
size: e.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Checkbox size" })
|
|
57
|
-
}).strict(),
|
|
63
|
+
}).strict(), Ke = r.extend({
|
|
58
64
|
src: e.union(
|
|
59
65
|
[
|
|
60
66
|
e.url({ error: "Image source (src) must be a valid URL" }),
|
|
@@ -65,14 +71,14 @@ const r = e.object({
|
|
|
65
71
|
}
|
|
66
72
|
),
|
|
67
73
|
alt: e.string().optional().default("unknown image url").meta({ description: "Alternative text for the image" })
|
|
68
|
-
}).strict(),
|
|
74
|
+
}).strict(), Ye = r.extend({
|
|
69
75
|
value: e.union([e.string(), e.number()], {
|
|
70
76
|
error: "OTP value is required"
|
|
71
77
|
}).meta({ description: "Current OTP value" }),
|
|
72
78
|
placeholder: e.string().optional().meta({ description: "Placeholder text for the OTP input" }),
|
|
73
79
|
disabled: e.union([e.string(), e.boolean()]).optional().meta({ description: "Whether the OTP input is disabled" }),
|
|
74
80
|
containerClassName: e.string().optional().meta({ description: "Custom CSS class for the OTP input container" })
|
|
75
|
-
}).strict(),
|
|
81
|
+
}).strict(), Ze = r.extend({
|
|
76
82
|
type: e.enum(["text", "email", "password", "number"], {
|
|
77
83
|
error: "Invalid input type. Must be one of: text, email, password, or number"
|
|
78
84
|
}).optional().meta({ description: "Input type; a number input stores a number" }),
|
|
@@ -81,13 +87,13 @@ const r = e.object({
|
|
|
81
87
|
}).meta({ description: "Current input value" }),
|
|
82
88
|
placeholder: e.string().optional().meta({ description: "Placeholder text shown when empty" }),
|
|
83
89
|
disabled: e.union([e.string(), e.boolean()]).optional().meta({ description: "Whether the input is disabled" })
|
|
84
|
-
}).strict(),
|
|
90
|
+
}).strict(), Je = r.extend({
|
|
85
91
|
htmlFor: e.string().min(1, {
|
|
86
92
|
message: "Label 'for' attribute is required and must reference an input ID"
|
|
87
93
|
}).meta({ description: "ID of the associated input element" }),
|
|
88
94
|
size: e.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Label text size" }),
|
|
89
95
|
variant: e.enum(["default", "underline", "destructive"]).optional().meta({ description: "Label style variant" })
|
|
90
|
-
}).strict(),
|
|
96
|
+
}).strict(), Qe = r.extend({
|
|
91
97
|
checked: e.union([e.string(), e.boolean()], {
|
|
92
98
|
error: "Switch checked state is required"
|
|
93
99
|
}).meta({ description: "Current switch state" }),
|
|
@@ -95,7 +101,7 @@ const r = e.object({
|
|
|
95
101
|
required: e.union([e.string(), e.boolean()]).optional().meta({ description: "Whether the switch must be turned on" }),
|
|
96
102
|
size: e.enum(["sm", "md", "lg"]).optional().meta({ description: "Switch size" }),
|
|
97
103
|
rounded: e.enum(["none", "sm", "md", "lg", "full"]).optional().meta({ description: "Switch border radius" })
|
|
98
|
-
}).strict(),
|
|
104
|
+
}).strict(), $e = r.extend({
|
|
99
105
|
value: e.string({ error: "Textarea value is required" }).meta({ description: "Current textarea content" }),
|
|
100
106
|
placeholder: e.string().optional().meta({ description: "Placeholder text shown when empty" }),
|
|
101
107
|
disabled: e.union([e.string(), e.boolean()]).optional().meta({ description: "Whether the textarea is disabled" }),
|
|
@@ -103,39 +109,39 @@ const r = e.object({
|
|
|
103
109
|
rows: e.number().min(1, { message: "Minimum number of rows is 1" }).max(100, { message: "Maximum number of rows is 100" }).optional().meta({ description: "Number of visible text lines" }),
|
|
104
110
|
minLength: e.number().min(0, { message: "Minimum character length cannot be negative" }).optional().meta({ description: "Minimum number of characters allowed" }),
|
|
105
111
|
maxLength: e.number().max(1e4, { message: "Maximum character length cannot exceed 10,000" }).optional().meta({ description: "Maximum number of characters allowed" })
|
|
106
|
-
}).strict(),
|
|
112
|
+
}).strict(), et = r.optional(), tt = r.optional(), nt = r.extend({
|
|
107
113
|
align: e.enum(["inline-start", "inline-end", "block-start", "block-end"]).optional().meta({ description: "Alignment of the addon within the input group" })
|
|
108
|
-
}).optional(),
|
|
114
|
+
}).optional(), at = r.extend({
|
|
109
115
|
value: e.union([e.string(), e.number()], {
|
|
110
116
|
error: "Input value is required"
|
|
111
117
|
}).meta({ description: "Current input value" }),
|
|
112
118
|
placeholder: e.string().optional().meta({ description: "Placeholder text shown when empty" }),
|
|
113
119
|
disabled: e.union([e.string(), e.boolean()]).optional().meta({ description: "Whether the input is disabled" })
|
|
114
|
-
}).strict(),
|
|
120
|
+
}).strict(), ot = r.extend({
|
|
115
121
|
variant: e.enum(["default", "secondary", "outline", "destructive", "warning", "ghost"]).optional(),
|
|
116
122
|
size: e.enum(["xs", "sm", "md", "lg"]).optional()
|
|
117
|
-
}).optional(),
|
|
123
|
+
}).optional(), it = r.extend({
|
|
118
124
|
value: e.string({ error: "Textarea value is required" }).meta({ description: "Current textarea content" }),
|
|
119
125
|
placeholder: e.string().optional(),
|
|
120
126
|
disabled: e.union([e.string(), e.boolean()]).optional()
|
|
121
|
-
}).strict(),
|
|
127
|
+
}).strict(), rt = r.extend({
|
|
122
128
|
value: e.string().nullable().meta({ description: "Current signature value (base64 or null if empty)" }),
|
|
123
129
|
canvasClassname: e.string().optional().meta({ description: "Custom CSS class for the signature canvas" }),
|
|
124
130
|
imageType: e.enum(["image/png", "image/jpeg", "image/webp"]).optional().meta({ description: "Image format for the exported signature" })
|
|
125
|
-
}).strict(),
|
|
131
|
+
}).strict(), st = r.extend({
|
|
126
132
|
selected: e.union([e.string(), e.date(), e.array(e.date())], {
|
|
127
133
|
error: "Invalid calendar selection. Must be a date string, Date object, or array of dates"
|
|
128
134
|
}).optional().meta({ description: "Currently selected date(s)" }),
|
|
129
135
|
buttonVariant: e.enum(["default", "secondary", "outline", "destructive", "warning", "ghost"]).optional().meta({ description: "Variant for calendar navigation buttons" }),
|
|
130
136
|
hideWeekends: e.boolean().optional().meta({ description: "Whether to hide Saturday and Sunday columns" })
|
|
131
|
-
}).optional(),
|
|
137
|
+
}).optional(), lt = r.optional(), dt = r.optional(), ct = r.optional(), pt = r.optional(), mt = r.optional(), gt = r.optional(), ut = r.optional(), At = r.optional(), ht = r.extend({
|
|
132
138
|
variant: e.enum(["default", "contained", "separated"]).optional().meta({ description: "Accordion style variant" }),
|
|
133
139
|
raised: e.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Accordion shadow elevation" }),
|
|
134
140
|
extrude: e.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Accordion extrude elevation" })
|
|
135
|
-
}).optional(),
|
|
141
|
+
}).optional(), Tt = r.optional(), bt = r.extend({
|
|
136
142
|
disabled: e.union([e.string(), e.boolean()]).optional().meta({ description: "Whether the accordion trigger is disabled" }),
|
|
137
143
|
icon: e.any().optional().meta({ description: "Custom icon component for the trigger" })
|
|
138
|
-
}).optional(),
|
|
144
|
+
}).optional(), Ct = r.optional(), xt = r.extend({
|
|
139
145
|
src: e.string().optional().meta({ description: "Image source URL" }),
|
|
140
146
|
alt: e.string().optional().meta({ description: "Alternative text for the avatar image" }),
|
|
141
147
|
size: e.enum(["full", "sm", "md", "lg", "xl"]).optional().meta({ description: "Avatar size" }),
|
|
@@ -143,14 +149,14 @@ const r = e.object({
|
|
|
143
149
|
raised: e.enum(["xs", "sm", "md", "lg"]).optional().meta({ description: "Avatar shadow elevation" }),
|
|
144
150
|
fallback: e.string().optional().meta({ description: "Fallback text or element when image fails to load" }),
|
|
145
151
|
badge: e.any().optional().meta({ description: "Badge element to overlay on the avatar" })
|
|
146
|
-
}).optional(),
|
|
152
|
+
}).optional(), Nt = r.optional(), Et = r.optional(), Ot = r.optional(), It = r.extend({
|
|
147
153
|
variant: e.enum(["spinner", "ping"]).optional().meta({ description: "Loader animation variant" }),
|
|
148
154
|
fill: e.enum(["default", "destructive", "warning", "pending"]).optional().meta({ description: "Loader fill color" }),
|
|
149
155
|
size: e.enum(["sm", "md", "lg"]).optional().meta({ description: "Loader size" }),
|
|
150
156
|
icon: e.any().optional().meta({ description: "Custom spinner icon component" }),
|
|
151
157
|
pingIcon: e.any().optional().meta({ description: "Custom ping icon component" }),
|
|
152
158
|
iconProps: e.any().optional().meta({ description: "Props to pass to the icon components" })
|
|
153
|
-
}).optional(),
|
|
159
|
+
}).optional(), Rt = r.extend({
|
|
154
160
|
mode: e.enum(["single", "multiple"]).optional().meta({ description: "Progress display mode" }),
|
|
155
161
|
value: e.union([
|
|
156
162
|
e.number().nullable(),
|
|
@@ -164,174 +170,174 @@ const r = e.object({
|
|
|
164
170
|
size: e.enum(["xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Progress size" }),
|
|
165
171
|
raised: e.enum(["default", "xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Progress shadow elevation" }),
|
|
166
172
|
stacked: e.enum(["default", "xs", "sm", "md", "lg", "xl"]).optional().meta({ description: "Progress stacked spacing" })
|
|
167
|
-
}).optional(),
|
|
173
|
+
}).optional(), St = r.extend({
|
|
168
174
|
variant: e.enum(["circle", "square", "default", "text"]).optional().meta({ description: "Skeleton shape variant" }),
|
|
169
175
|
animate: e.boolean().optional().meta({ description: "Whether to animate the skeleton" })
|
|
170
176
|
}).optional(), yt = e.lazy(() => e.union([e.string(), Ee])), i = e.object({
|
|
171
177
|
children: e.array(yt).optional().meta({ description: "Child nodes to render inside this element" })
|
|
172
178
|
}), b = i.extend({
|
|
173
179
|
type: e.literal(t.DIV),
|
|
174
|
-
args:
|
|
180
|
+
args: fe
|
|
175
181
|
}).meta({ description: "Container div element for grouping content" }), C = i.extend({
|
|
176
182
|
type: e.literal(t.A),
|
|
177
183
|
args: ye
|
|
178
184
|
}).meta({ description: "Anchor/link element" }), x = i.extend({
|
|
179
185
|
type: e.literal(t.H),
|
|
180
|
-
args:
|
|
186
|
+
args: Le
|
|
181
187
|
}).meta({ description: "Heading element (h1-h6)" }), N = i.extend({
|
|
182
188
|
type: e.literal(t.P),
|
|
183
|
-
args:
|
|
189
|
+
args: ve
|
|
184
190
|
}).meta({ description: "Paragraph text element" }), E = i.extend({
|
|
185
191
|
type: e.literal(t.OL),
|
|
186
|
-
args:
|
|
192
|
+
args: _e
|
|
187
193
|
}).meta({ description: "Ordered list element" }), O = i.extend({
|
|
188
194
|
type: e.literal(t.UL),
|
|
189
|
-
args:
|
|
195
|
+
args: Pe
|
|
190
196
|
}).meta({ description: "Unordered list element" }), I = i.extend({
|
|
191
197
|
type: e.literal(t.LI),
|
|
192
|
-
args:
|
|
198
|
+
args: De
|
|
193
199
|
}).meta({ description: "List item element" }), R = i.extend({
|
|
194
200
|
type: e.literal(t.SPAN),
|
|
195
|
-
args: fe
|
|
196
|
-
}).meta({ description: "Inline span element" }), y = i.extend({
|
|
197
|
-
type: e.literal(t.SEPARATOR),
|
|
198
201
|
args: Be
|
|
199
|
-
}).meta({ description: "
|
|
202
|
+
}).meta({ description: "Inline span element" }), S = i.extend({
|
|
203
|
+
type: e.literal(t.SEPARATOR),
|
|
204
|
+
args: we
|
|
205
|
+
}).meta({ description: "Horizontal separator / divider element" }), y = i.extend({
|
|
200
206
|
type: e.literal(t.ALERT),
|
|
201
207
|
args: Ue
|
|
202
208
|
}).meta({ description: "Alert message box" }), L = i.extend({
|
|
203
209
|
type: e.literal(t.BADGE),
|
|
204
|
-
args:
|
|
210
|
+
args: Ge
|
|
205
211
|
}).meta({ description: "Badge/status indicator" }), v = i.extend({
|
|
206
212
|
type: e.literal(t.BUTTON),
|
|
207
|
-
args:
|
|
213
|
+
args: ke
|
|
208
214
|
}).meta({ description: "Clickable button element" }), _ = i.extend({
|
|
209
215
|
type: e.literal(t.CARD),
|
|
210
|
-
args:
|
|
216
|
+
args: ze
|
|
211
217
|
}).meta({ description: "Card container element" }), P = i.extend({
|
|
212
218
|
type: e.literal(t.CHECKBOX),
|
|
213
|
-
args:
|
|
219
|
+
args: Ve
|
|
214
220
|
}).meta({ description: "Checkbox input element" }), D = i.extend({
|
|
215
221
|
type: e.literal(t.IMAGE),
|
|
216
|
-
args:
|
|
222
|
+
args: Ke
|
|
217
223
|
}).meta({ description: "Image element" }), f = i.extend({
|
|
218
224
|
type: e.literal(t.OTP),
|
|
219
|
-
args:
|
|
225
|
+
args: Ye
|
|
220
226
|
}).meta({ description: "One-time password (OTP) input" }), B = i.extend({
|
|
221
227
|
type: e.literal(t.INPUT),
|
|
222
|
-
args: Ye
|
|
223
|
-
}).meta({ description: "Text input element" }), U = i.extend({
|
|
224
|
-
type: e.literal(t.LABEL),
|
|
225
228
|
args: Ze
|
|
226
|
-
}).meta({ description: "
|
|
227
|
-
type: e.literal(t.
|
|
229
|
+
}).meta({ description: "Text input element" }), w = i.extend({
|
|
230
|
+
type: e.literal(t.LABEL),
|
|
228
231
|
args: Je
|
|
232
|
+
}).meta({ description: "Form label element" }), U = i.extend({
|
|
233
|
+
type: e.literal(t.SWITCH),
|
|
234
|
+
args: Qe
|
|
229
235
|
}).meta({ description: "Toggle switch element" }), G = i.extend({
|
|
230
236
|
type: e.literal(t.TEXTAREA),
|
|
231
|
-
args:
|
|
237
|
+
args: $e
|
|
232
238
|
}).meta({ description: "Multi-line text input" }), k = i.extend({
|
|
233
239
|
type: e.literal(t.SIGNATURE),
|
|
234
|
-
args: it
|
|
235
|
-
}).meta({ description: "Signature pad input" }), H = i.extend({
|
|
236
|
-
type: e.literal(t.CALENDAR),
|
|
237
240
|
args: rt
|
|
238
|
-
}).meta({ description: "
|
|
241
|
+
}).meta({ description: "Signature pad input" }), z = i.extend({
|
|
242
|
+
type: e.literal(t.CALENDAR),
|
|
243
|
+
args: st
|
|
244
|
+
}).meta({ description: "Date picker calendar" }), H = i.extend({
|
|
239
245
|
type: e.literal(t.CARD_HEADER),
|
|
240
246
|
args: He
|
|
241
247
|
}).meta({ description: "Card header container" }), M = i.extend({
|
|
242
248
|
type: e.literal(t.CARD_TITLE),
|
|
243
|
-
args:
|
|
249
|
+
args: Me
|
|
244
250
|
}).meta({ description: "Card title element" }), W = i.extend({
|
|
245
251
|
type: e.literal(t.CARD_DESCRIPTION),
|
|
246
|
-
args:
|
|
252
|
+
args: We
|
|
247
253
|
}).meta({ description: "Card description element" }), F = i.extend({
|
|
248
254
|
type: e.literal(t.CARD_CONTENT),
|
|
249
|
-
args:
|
|
255
|
+
args: Fe
|
|
250
256
|
}).meta({ description: "Card content body" }), j = i.extend({
|
|
251
257
|
type: e.literal(t.CARD_FOOTER),
|
|
252
|
-
args:
|
|
258
|
+
args: je
|
|
253
259
|
}).meta({ description: "Card footer container" }), q = i.extend({
|
|
254
260
|
type: e.literal(t.CARD_ACTION),
|
|
255
|
-
args:
|
|
261
|
+
args: qe
|
|
256
262
|
}).meta({ description: "Card action slot" }), X = i.extend({
|
|
257
263
|
type: e.literal(t.CARD_ICON),
|
|
258
|
-
args:
|
|
264
|
+
args: Xe
|
|
259
265
|
}).meta({ description: "Card icon slot" }), V = i.extend({
|
|
260
266
|
type: e.literal(t.TABLE),
|
|
261
|
-
args:
|
|
267
|
+
args: lt
|
|
262
268
|
}).meta({ description: "Table container" }), K = i.extend({
|
|
263
269
|
type: e.literal(t.TABLE_HEADER),
|
|
264
|
-
args:
|
|
270
|
+
args: dt
|
|
265
271
|
}).meta({ description: "Table header section" }), Y = i.extend({
|
|
266
272
|
type: e.literal(t.TABLE_BODY),
|
|
267
|
-
args:
|
|
273
|
+
args: ct
|
|
268
274
|
}).meta({ description: "Table body section" }), Z = i.extend({
|
|
269
275
|
type: e.literal(t.TABLE_FOOTER),
|
|
270
|
-
args:
|
|
276
|
+
args: pt
|
|
271
277
|
}).meta({ description: "Table footer section" }), J = i.extend({
|
|
272
278
|
type: e.literal(t.TABLE_HEAD),
|
|
273
|
-
args:
|
|
279
|
+
args: mt
|
|
274
280
|
}).meta({ description: "Table header cell" }), Q = i.extend({
|
|
275
281
|
type: e.literal(t.TABLE_ROW),
|
|
276
|
-
args:
|
|
282
|
+
args: gt
|
|
277
283
|
}).meta({ description: "Table row" }), $ = i.extend({
|
|
278
284
|
type: e.literal(t.TABLE_CELL),
|
|
279
|
-
args:
|
|
285
|
+
args: ut
|
|
280
286
|
}).meta({ description: "Table data cell" }), ee = i.extend({
|
|
281
287
|
type: e.literal(t.TABLE_CAPTION),
|
|
282
|
-
args:
|
|
288
|
+
args: At
|
|
283
289
|
}).meta({ description: "Table caption" }), te = i.extend({
|
|
284
290
|
type: e.literal(t.ACCORDION),
|
|
285
|
-
args:
|
|
291
|
+
args: ht
|
|
286
292
|
}).meta({ description: "Accordion container" }), ne = i.extend({
|
|
287
293
|
type: e.literal(t.ACCORDION_ITEM),
|
|
288
|
-
args:
|
|
294
|
+
args: Tt
|
|
289
295
|
}).meta({ description: "Accordion item" }), ae = i.extend({
|
|
290
296
|
type: e.literal(t.ACCORDION_TRIGGER),
|
|
291
|
-
args:
|
|
297
|
+
args: bt
|
|
292
298
|
}).meta({ description: "Accordion trigger" }), oe = i.extend({
|
|
293
299
|
type: e.literal(t.ACCORDION_CONTENT),
|
|
294
|
-
args:
|
|
300
|
+
args: Ct
|
|
295
301
|
}).meta({ description: "Accordion content panel" }), ie = i.extend({
|
|
296
302
|
type: e.literal(t.AVATAR),
|
|
297
|
-
args:
|
|
303
|
+
args: xt
|
|
298
304
|
}).meta({ description: "Avatar image or fallback" }), re = i.extend({
|
|
299
305
|
type: e.literal(t.COLLAPSIBLE),
|
|
300
|
-
args:
|
|
306
|
+
args: Nt
|
|
301
307
|
}).meta({ description: "Collapsible container" }), se = i.extend({
|
|
302
308
|
type: e.literal(t.COLLAPSIBLE_TRIGGER),
|
|
303
|
-
args:
|
|
309
|
+
args: Et
|
|
304
310
|
}).meta({ description: "Collapsible trigger" }), le = i.extend({
|
|
305
311
|
type: e.literal(t.COLLAPSIBLE_CONTENT),
|
|
306
|
-
args:
|
|
312
|
+
args: Ot
|
|
307
313
|
}).meta({ description: "Collapsible content panel" }), de = i.extend({
|
|
308
314
|
type: e.literal(t.LOADER),
|
|
309
|
-
args:
|
|
315
|
+
args: It
|
|
310
316
|
}).meta({ description: "Loading spinner indicator" }), ce = i.extend({
|
|
311
317
|
type: e.literal(t.PROGRESS),
|
|
312
|
-
args:
|
|
318
|
+
args: Rt
|
|
313
319
|
}).meta({ description: "Progress bar indicator" }), pe = i.extend({
|
|
314
320
|
type: e.literal(t.SKELETON),
|
|
315
|
-
args:
|
|
321
|
+
args: St
|
|
316
322
|
}).meta({ description: "Skeleton loading placeholder" }), me = i.extend({
|
|
317
323
|
type: e.literal(t.INPUT_GROUP),
|
|
318
|
-
args:
|
|
324
|
+
args: et
|
|
319
325
|
}).meta({ description: "Input group container" }), ge = i.extend({
|
|
320
326
|
type: e.literal(t.INPUT_GROUP_TEXT),
|
|
321
|
-
args:
|
|
327
|
+
args: tt
|
|
322
328
|
}).meta({ description: "Text element within input group" }), ue = i.extend({
|
|
323
329
|
type: e.literal(t.INPUT_GROUP_ADDON),
|
|
324
|
-
args:
|
|
330
|
+
args: nt
|
|
325
331
|
}).meta({ description: "Addon container within input group" }), Ae = i.extend({
|
|
326
332
|
type: e.literal(t.INPUT_GROUP_INPUT),
|
|
327
|
-
args:
|
|
333
|
+
args: at
|
|
328
334
|
}).meta({ description: "Input element within input group" }), he = i.extend({
|
|
329
335
|
type: e.literal(t.INPUT_GROUP_BUTTON),
|
|
330
|
-
args:
|
|
336
|
+
args: ot
|
|
331
337
|
}).meta({ description: "Button element within input group" }), Te = i.extend({
|
|
332
338
|
type: e.literal(t.INPUT_GROUP_TEXTAREA),
|
|
333
|
-
args:
|
|
334
|
-
}).meta({ description: "Textarea element within input group" }),
|
|
339
|
+
args: it
|
|
340
|
+
}).meta({ description: "Textarea element within input group" }), Lt = e.object({
|
|
335
341
|
items: e.string({ error: "each.items is required" }).min(1, { message: "each.items cannot be empty" }).meta({
|
|
336
342
|
description: 'Binding path to the array to iterate, e.g. "{{applicants}}". Must be a plain path (not a computed/filtered expression) so each row maps back to a real store index for two-way binding.'
|
|
337
343
|
}),
|
|
@@ -342,12 +348,12 @@ const r = e.object({
|
|
|
342
348
|
})
|
|
343
349
|
}).strict(), be = i.extend({
|
|
344
350
|
type: e.literal(t.EACH),
|
|
345
|
-
args:
|
|
346
|
-
}).meta({ description: "Repeats its children once per item in a bound array" }),
|
|
351
|
+
args: Lt
|
|
352
|
+
}).meta({ description: "Repeats its children once per item in a bound array" }), vt = e.object({
|
|
347
353
|
condition: e.string({ error: "if.condition is required" }).min(1, { message: "if.condition cannot be empty" }).meta({ description: "Binding expression; children render only when it evaluates truthy" })
|
|
348
354
|
}).strict(), Ce = i.extend({
|
|
349
355
|
type: e.literal(t.IF),
|
|
350
|
-
args:
|
|
356
|
+
args: vt
|
|
351
357
|
}).meta({ description: "Conditionally renders its children based on a bound expression" });
|
|
352
358
|
function a(s) {
|
|
353
359
|
return s.shape.args;
|
|
@@ -355,25 +361,24 @@ function a(s) {
|
|
|
355
361
|
function o(s) {
|
|
356
362
|
return s.meta()?.description;
|
|
357
363
|
}
|
|
358
|
-
function
|
|
364
|
+
function _t(s) {
|
|
359
365
|
if (Object.keys(s).length === 0)
|
|
360
366
|
throw new Error("createTemplateSchema: registry must declare at least one component");
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
const T = c.extend({
|
|
367
|
+
const l = e.lazy(() => e.union([e.string(), c])), g = e.object({
|
|
368
|
+
children: e.array(l).optional().meta({ description: "Child nodes to render inside this element" })
|
|
369
|
+
}), d = Object.entries(s).map(([Ie, { argsSchema: Re, description: h }]) => {
|
|
370
|
+
const T = g.extend({
|
|
366
371
|
type: e.literal(Ie),
|
|
367
372
|
args: Re
|
|
368
373
|
});
|
|
369
374
|
return h ? T.meta({ description: h }) : T;
|
|
370
|
-
})
|
|
371
|
-
return l = e.discriminatedUnion(
|
|
375
|
+
}), c = e.discriminatedUnion(
|
|
372
376
|
"type",
|
|
373
|
-
|
|
374
|
-
)
|
|
377
|
+
d
|
|
378
|
+
);
|
|
379
|
+
return { Node: l, ComponentNode: c };
|
|
375
380
|
}
|
|
376
|
-
const
|
|
381
|
+
const Pt = {
|
|
377
382
|
[t.DIV]: { argsSchema: a(b), description: o(b) },
|
|
378
383
|
[t.A]: { argsSchema: a(C), description: o(C) },
|
|
379
384
|
[t.H]: { argsSchema: a(x), description: o(x) },
|
|
@@ -383,16 +388,16 @@ const _t = {
|
|
|
383
388
|
[t.LI]: { argsSchema: a(I), description: o(I) },
|
|
384
389
|
[t.SPAN]: { argsSchema: a(R), description: o(R) },
|
|
385
390
|
[t.SEPARATOR]: {
|
|
386
|
-
argsSchema: a(
|
|
387
|
-
description: o(
|
|
391
|
+
argsSchema: a(S),
|
|
392
|
+
description: o(S)
|
|
388
393
|
},
|
|
389
|
-
[t.ALERT]: { argsSchema: a(
|
|
394
|
+
[t.ALERT]: { argsSchema: a(y), description: o(y) },
|
|
390
395
|
[t.BADGE]: { argsSchema: a(L), description: o(L) },
|
|
391
396
|
[t.BUTTON]: { argsSchema: a(v), description: o(v) },
|
|
392
397
|
[t.CARD]: { argsSchema: a(_), description: o(_) },
|
|
393
398
|
[t.CARD_HEADER]: {
|
|
394
|
-
argsSchema: a(
|
|
395
|
-
description: o(
|
|
399
|
+
argsSchema: a(H),
|
|
400
|
+
description: o(H)
|
|
396
401
|
},
|
|
397
402
|
[t.CARD_TITLE]: {
|
|
398
403
|
argsSchema: a(M),
|
|
@@ -425,8 +430,8 @@ const _t = {
|
|
|
425
430
|
[t.IMAGE]: { argsSchema: a(D), description: o(D) },
|
|
426
431
|
[t.OTP]: { argsSchema: a(f), description: o(f) },
|
|
427
432
|
[t.INPUT]: { argsSchema: a(B), description: o(B) },
|
|
428
|
-
[t.LABEL]: { argsSchema: a(
|
|
429
|
-
[t.SWITCH]: { argsSchema: a(
|
|
433
|
+
[t.LABEL]: { argsSchema: a(w), description: o(w) },
|
|
434
|
+
[t.SWITCH]: { argsSchema: a(U), description: o(U) },
|
|
430
435
|
[t.TEXTAREA]: {
|
|
431
436
|
argsSchema: a(G),
|
|
432
437
|
description: o(G)
|
|
@@ -436,8 +441,8 @@ const _t = {
|
|
|
436
441
|
description: o(k)
|
|
437
442
|
},
|
|
438
443
|
[t.CALENDAR]: {
|
|
439
|
-
argsSchema: a(
|
|
440
|
-
description: o(
|
|
444
|
+
argsSchema: a(z),
|
|
445
|
+
description: o(z)
|
|
441
446
|
},
|
|
442
447
|
[t.TABLE]: { argsSchema: a(V), description: o(V) },
|
|
443
448
|
[t.TABLE_HEADER]: {
|
|
@@ -532,9 +537,9 @@ const _t = {
|
|
|
532
537
|
},
|
|
533
538
|
[t.EACH]: { argsSchema: a(be), description: o(be) },
|
|
534
539
|
[t.IF]: { argsSchema: a(Ce), description: o(Ce) }
|
|
535
|
-
}, Ne =
|
|
540
|
+
}, Ne = _t(Pt), Ee = Ne.ComponentNode, zt = Ne.Node, A = Object.fromEntries(
|
|
536
541
|
Ee.options.map((s) => [s.shape.type.value, s])
|
|
537
|
-
), Oe = e.registry(),
|
|
542
|
+
), Oe = e.registry(), Dt = e.registry(), n = t, ft = [
|
|
538
543
|
n.INPUT,
|
|
539
544
|
n.INPUT_GROUP_INPUT,
|
|
540
545
|
n.INPUT_GROUP_TEXTAREA,
|
|
@@ -581,10 +586,11 @@ const _t = {
|
|
|
581
586
|
[n.UL]: { accepts: [n.LI] },
|
|
582
587
|
[n.LI]: { parent: [n.OL, n.UL] }
|
|
583
588
|
};
|
|
584
|
-
for (const s of
|
|
585
|
-
const
|
|
589
|
+
for (const s of ft) u[s] = { ...u[s], accepts: "none" };
|
|
590
|
+
const Bt = {
|
|
586
591
|
id: { label: "Element ID", group: "Advanced" },
|
|
587
592
|
className: { label: "Classes", group: "Advanced" },
|
|
593
|
+
onClick: { label: "On click", control: "json", group: "Data" },
|
|
588
594
|
href: { label: "Link URL", group: "Content", placeholder: "https://" },
|
|
589
595
|
src: { label: "Image URL", group: "Content", placeholder: "https:// or {{binding}}" },
|
|
590
596
|
alt: { label: "Alt text", group: "Content" },
|
|
@@ -631,7 +637,7 @@ const ft = {
|
|
|
631
637
|
pingIcon: { label: "Ping icon", control: "json", group: "Advanced" },
|
|
632
638
|
iconProps: { label: "Icon props", control: "json", group: "Advanced" },
|
|
633
639
|
badge: { label: "Badge", control: "json", group: "Advanced" }
|
|
634
|
-
},
|
|
640
|
+
}, wt = {
|
|
635
641
|
[n.EACH]: { as: { label: "Item alias", group: "Data" } },
|
|
636
642
|
[n.H]: { as: { label: "Render as", group: "Advanced" } },
|
|
637
643
|
[n.P]: { as: { label: "Render as", group: "Advanced" } },
|
|
@@ -644,9 +650,9 @@ function Ut(s) {
|
|
|
644
650
|
}
|
|
645
651
|
for (const [s, l] of Object.entries(A)) {
|
|
646
652
|
Oe.add(l, { accepts: "any", ...u[s] });
|
|
647
|
-
const
|
|
648
|
-
for (const [
|
|
649
|
-
|
|
653
|
+
const g = Ut(s)?.shape ?? {};
|
|
654
|
+
for (const [d, c] of Object.entries(g))
|
|
655
|
+
Dt.add(c, { ...Bt[d], ...wt[s]?.[d] });
|
|
650
656
|
}
|
|
651
657
|
function Ht(s) {
|
|
652
658
|
const l = A[s];
|
|
@@ -655,12 +661,12 @@ function Ht(s) {
|
|
|
655
661
|
export {
|
|
656
662
|
Ee as C,
|
|
657
663
|
A as N,
|
|
658
|
-
|
|
659
|
-
|
|
664
|
+
Pt as P,
|
|
665
|
+
zt as a,
|
|
660
666
|
Ht as b,
|
|
661
|
-
|
|
662
|
-
|
|
667
|
+
_t as c,
|
|
668
|
+
Dt as f,
|
|
663
669
|
Ut as g,
|
|
664
670
|
Oe as n
|
|
665
671
|
};
|
|
666
|
-
//# sourceMappingURL=builder.meta-
|
|
672
|
+
//# sourceMappingURL=builder.meta-B7Y9M7Ab.js.map
|