@bysages/solid 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/components/ai-prompt-input/index.mjs +37 -35
  2. package/dist/components/angle-slider/index.d.mts +15 -1
  3. package/dist/components/angle-slider/index.mjs +57 -2
  4. package/dist/components/calendar/index.d.mts +19 -7
  5. package/dist/components/calendar/index.mjs +212 -138
  6. package/dist/components/carousel/index.d.mts +15 -1
  7. package/dist/components/carousel/index.mjs +68 -4
  8. package/dist/components/checkbox/index.d.mts +16 -1
  9. package/dist/components/checkbox/index.mjs +53 -2
  10. package/dist/components/checkbox-group/index.d.mts +10 -3
  11. package/dist/components/checkbox-group/index.mjs +2 -2
  12. package/dist/components/chip/index.d.mts +1 -1
  13. package/dist/components/clipboard/index.d.mts +14 -1
  14. package/dist/components/clipboard/index.mjs +57 -2
  15. package/dist/components/date-input/index.d.mts +16 -2
  16. package/dist/components/date-input/index.mjs +51 -2
  17. package/dist/components/date-picker/index.d.mts +27 -2
  18. package/dist/components/date-picker/index.mjs +152 -3
  19. package/dist/components/editable/index.d.mts +17 -1
  20. package/dist/components/editable/index.mjs +80 -2
  21. package/dist/components/field/index.d.mts +16 -1
  22. package/dist/components/field/index.mjs +52 -4
  23. package/dist/components/fieldset/index.d.mts +15 -3
  24. package/dist/components/fieldset/index.mjs +46 -4
  25. package/dist/components/file-upload/index.d.mts +21 -1
  26. package/dist/components/file-upload/index.mjs +65 -2
  27. package/dist/components/floating-panel/index.d.mts +15 -3
  28. package/dist/components/floating-panel/index.mjs +112 -4
  29. package/dist/components/form/index.d.mts +44 -2
  30. package/dist/components/image-cropper/index.d.mts +8 -1
  31. package/dist/components/image-cropper/index.mjs +42 -4
  32. package/dist/components/json-tree-view/index.d.mts +11 -2
  33. package/dist/components/json-tree-view/index.mjs +16 -1
  34. package/dist/components/listbox/index.d.mts +21 -1
  35. package/dist/components/listbox/index.mjs +58 -3
  36. package/dist/components/marquee/index.d.mts +12 -1
  37. package/dist/components/marquee/index.mjs +45 -4
  38. package/dist/components/navigation-menu/index.d.mts +17 -1
  39. package/dist/components/navigation-menu/index.mjs +65 -5
  40. package/dist/components/number-input/index.d.mts +20 -1
  41. package/dist/components/number-input/index.mjs +71 -2
  42. package/dist/components/pagination/index.d.mts +22 -2
  43. package/dist/components/pagination/index.mjs +104 -5
  44. package/dist/components/password-input/index.d.mts +18 -1
  45. package/dist/components/password-input/index.mjs +56 -2
  46. package/dist/components/pin-input/index.d.mts +18 -1
  47. package/dist/components/pin-input/index.mjs +54 -2
  48. package/dist/components/progress/index.d.mts +19 -1
  49. package/dist/components/progress/index.mjs +105 -6
  50. package/dist/components/qr-code/index.d.mts +8 -1
  51. package/dist/components/qr-code/index.mjs +21 -4
  52. package/dist/components/radio-group/index.d.mts +23 -1
  53. package/dist/components/radio-group/index.mjs +65 -2
  54. package/dist/components/rating-group/index.d.mts +15 -1
  55. package/dist/components/rating-group/index.mjs +51 -2
  56. package/dist/components/scroll-area/index.d.mts +11 -3
  57. package/dist/components/scroll-area/index.mjs +36 -4
  58. package/dist/components/segment-group/index.d.mts +27 -4
  59. package/dist/components/segment-group/index.mjs +65 -6
  60. package/dist/components/signature-pad/index.d.mts +16 -1
  61. package/dist/components/signature-pad/index.mjs +63 -4
  62. package/dist/components/slider/index.d.mts +20 -1
  63. package/dist/components/slider/index.mjs +66 -2
  64. package/dist/components/splitter/index.d.mts +15 -1
  65. package/dist/components/splitter/index.mjs +57 -4
  66. package/dist/components/steps/index.d.mts +5 -1
  67. package/dist/components/steps/index.mjs +9 -2
  68. package/dist/components/swap/index.d.mts +11 -3
  69. package/dist/components/swap/index.mjs +34 -4
  70. package/dist/components/switch/index.d.mts +16 -1
  71. package/dist/components/switch/index.mjs +47 -2
  72. package/dist/components/table/index.d.mts +2 -0
  73. package/dist/components/table/index.mjs +13 -11
  74. package/dist/components/tag/index.d.mts +29 -0
  75. package/dist/components/tag/index.mjs +121 -0
  76. package/dist/components/tags-input/index.d.mts +18 -1
  77. package/dist/components/tags-input/index.mjs +82 -2
  78. package/dist/components/timer/index.d.mts +12 -1
  79. package/dist/components/timer/index.mjs +56 -4
  80. package/dist/components/toast/index.d.mts +10 -5
  81. package/dist/components/toast/index.mjs +37 -5
  82. package/dist/components/toc/index.d.mts +2 -11
  83. package/dist/components/toc/index.mjs +1 -1
  84. package/dist/components/toggle/index.d.mts +8 -1
  85. package/dist/components/toggle/index.mjs +26 -4
  86. package/dist/components/toggle-group/index.d.mts +23 -1
  87. package/dist/components/toggle-group/index.mjs +57 -3
  88. package/dist/components/tree-view/index.d.mts +32 -2
  89. package/dist/components/tree-view/index.mjs +93 -4
  90. package/dist/components/user/index.mjs +8 -2
  91. package/dist/generative/index.d.mts +47 -0
  92. package/dist/generative/index.mjs +942 -0
  93. package/dist/index-BU5U5w04.d.mts +35 -0
  94. package/dist/index.d.mts +43 -42
  95. package/dist/index.mjs +3 -2
  96. package/dist/toc-DRHr8_eD.mjs +88 -0
  97. package/package.json +2 -2
  98. package/dist/index-B1-quIrl.d.mts +0 -1815
  99. package/dist/toc-CqvGOp34.mjs +0 -31
@@ -0,0 +1,942 @@
1
+ import { r as iconNode } from "../icon-DTqmJCd5.mjs";
2
+ import { Button } from "../components/button/index.mjs";
3
+ import { Alert } from "../components/alert/index.mjs";
4
+ import { Avatar } from "../components/avatar/index.mjs";
5
+ import { Badge } from "../components/badge/index.mjs";
6
+ import { Spinner } from "../components/spinner/index.mjs";
7
+ import { Card } from "../components/card/index.mjs";
8
+ import { t as Input } from "../input-BL3N3L8g.mjs";
9
+ import { Checkbox } from "../components/checkbox/index.mjs";
10
+ import { Progress } from "../components/progress/index.mjs";
11
+ import { RadioGroup } from "../components/radio-group/index.mjs";
12
+ import { t as Select } from "../select-DI7pFspF.mjs";
13
+ import { Separator } from "../components/separator/index.mjs";
14
+ import { Slider } from "../components/slider/index.mjs";
15
+ import { Stack } from "../components/stack/index.mjs";
16
+ import { Stat } from "../components/stat/index.mjs";
17
+ import { Switch } from "../components/switch/index.mjs";
18
+ import { Textarea } from "../components/textarea/index.mjs";
19
+ import { Typography } from "../components/typography/index.mjs";
20
+ import { createComponent } from "@solidjs/web";
21
+ import { For, Show, createComponent as createComponent$1 } from "solid-js";
22
+ import { createListCollection } from "@ark-ui/solid/collection";
23
+ import { z } from "zod";
24
+ import { defineRegistry, useBoundProp } from "@json-render/solid";
25
+ import { defineCatalog } from "@json-render/core";
26
+ import { schema } from "@json-render/solid/schema";
27
+ //#region \0rolldown/runtime.js
28
+ var __defProp = Object.defineProperty;
29
+ var __exportAll = (all, no_symbols) => {
30
+ let target = {};
31
+ for (var name in all) __defProp(target, name, {
32
+ get: all[name],
33
+ enumerable: true
34
+ });
35
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
36
+ return target;
37
+ };
38
+ //#endregion
39
+ //#region src/generative/faces.generated.ts
40
+ /** Name the faces a family contributes; the identity keeps inference
41
+ * honest at the call site. */
42
+ function defineFace(faces) {
43
+ return faces;
44
+ }
45
+ /** Map a catalog Heading level to a measure — the serif voice stays, the
46
+ * size steps down. */
47
+ const headingClass = {
48
+ "1": "text-4xl",
49
+ "2": "text-3xl",
50
+ "3": "text-2xl",
51
+ "4": "text-xl",
52
+ "5": "text-lg",
53
+ "6": "text-base"
54
+ };
55
+ function initials(name) {
56
+ return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("");
57
+ }
58
+ function slug(value) {
59
+ return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") || value;
60
+ }
61
+ /** The vocabulary the wrappers speak. One face per composed name — the
62
+ * per-family assemblies in each wrapper spread these and add only the
63
+ * rendering. */
64
+ const faces$1 = defineFace({
65
+ Alert: {
66
+ props: z.object({
67
+ status: z.enum([
68
+ "success",
69
+ "warning",
70
+ "danger",
71
+ "info",
72
+ "ink"
73
+ ]).optional(),
74
+ title: z.string().optional(),
75
+ message: z.string().optional()
76
+ }),
77
+ description: "A bordered notice; status picks the pigment."
78
+ },
79
+ Avatar: {
80
+ props: z.object({
81
+ name: z.string(),
82
+ src: z.string().optional(),
83
+ size: z.enum([
84
+ "sm",
85
+ "md",
86
+ "lg"
87
+ ]).optional()
88
+ }),
89
+ description: "A person's seal: image when given, initials as the fallback."
90
+ },
91
+ Badge: {
92
+ props: z.object({
93
+ text: z.string(),
94
+ tone: z.enum([
95
+ "ink",
96
+ "primary",
97
+ "success",
98
+ "warning",
99
+ "danger",
100
+ "info"
101
+ ]).optional(),
102
+ variant: z.enum([
103
+ "solid",
104
+ "subtle",
105
+ "outline"
106
+ ]).optional()
107
+ }),
108
+ description: "A small status seal beside content; reads at a glance."
109
+ },
110
+ Button: {
111
+ props: z.object({
112
+ label: z.string(),
113
+ variant: z.enum([
114
+ "solid",
115
+ "outline",
116
+ "ghost",
117
+ "subtle"
118
+ ]).optional(),
119
+ tone: z.enum([
120
+ "ink",
121
+ "success",
122
+ "warning",
123
+ "danger",
124
+ "info"
125
+ ]).optional(),
126
+ size: z.enum([
127
+ "sm",
128
+ "md",
129
+ "lg"
130
+ ]).optional(),
131
+ disabled: z.boolean().optional()
132
+ }),
133
+ description: "The primary action register: solid ink for the one main action, outline, ghost, or subtle for the rest."
134
+ },
135
+ Card: {
136
+ props: z.object({
137
+ title: z.string().optional(),
138
+ description: z.string().optional()
139
+ }),
140
+ slots: [
141
+ "default",
142
+ "header",
143
+ "footer"
144
+ ],
145
+ description: "Grouping vessel. Give title and description instead of hand-building a header; children render in the body; footer holds actions."
146
+ },
147
+ Checkbox: {
148
+ props: z.object({
149
+ label: z.string(),
150
+ checked: z.boolean().optional(),
151
+ disabled: z.boolean().optional()
152
+ }),
153
+ description: "One independent box with its label."
154
+ },
155
+ Heading: {
156
+ props: z.object({
157
+ text: z.string(),
158
+ level: z.enum([
159
+ "1",
160
+ "2",
161
+ "3",
162
+ "4",
163
+ "5",
164
+ "6"
165
+ ]).optional()
166
+ }),
167
+ description: "Section heading. One per view at level 1; do not skip levels."
168
+ },
169
+ Input: {
170
+ props: z.object({
171
+ label: z.string().optional(),
172
+ placeholder: z.string().optional(),
173
+ type: z.enum([
174
+ "text",
175
+ "email",
176
+ "url",
177
+ "search",
178
+ "tel"
179
+ ]).optional(),
180
+ value: z.string().optional(),
181
+ disabled: z.boolean().optional()
182
+ }),
183
+ description: "A single-line field; rely on border, surface and the focus halo."
184
+ },
185
+ Progress: {
186
+ props: z.object({
187
+ value: z.number().optional(),
188
+ label: z.string().optional(),
189
+ max: z.number().optional()
190
+ }),
191
+ description: "A working track that fills toward done."
192
+ },
193
+ RadioGroup: {
194
+ props: z.object({
195
+ label: z.string().optional(),
196
+ items: z.array(z.string()).optional()
197
+ }),
198
+ description: "Several boxes where exactly one may hold."
199
+ },
200
+ Select: {
201
+ props: z.object({
202
+ label: z.string().optional(),
203
+ placeholder: z.string().optional(),
204
+ options: z.array(z.object({
205
+ label: z.string(),
206
+ value: z.string()
207
+ })),
208
+ value: z.union([z.string(), z.array(z.string())]).optional(),
209
+ multiple: z.boolean().optional(),
210
+ disabled: z.boolean().optional()
211
+ }),
212
+ description: "A choice field that opens a ruled list; options carry label and value."
213
+ },
214
+ Separator: {
215
+ props: z.object({ orientation: z.enum(["horizontal", "vertical"]).optional() }),
216
+ description: "Hairline divider between sections."
217
+ },
218
+ Slider: {
219
+ props: z.object({
220
+ label: z.string().optional(),
221
+ value: z.number().optional(),
222
+ min: z.number().optional(),
223
+ max: z.number().optional(),
224
+ step: z.number().optional()
225
+ }),
226
+ description: "A ruled track the hand slides between bounds."
227
+ },
228
+ Spinner: {
229
+ props: z.object({
230
+ size: z.enum([
231
+ "sm",
232
+ "md",
233
+ "lg"
234
+ ]).optional(),
235
+ label: z.string().optional()
236
+ }),
237
+ description: "A quiet wheel for work still settling."
238
+ },
239
+ Stack: {
240
+ props: z.object({
241
+ direction: z.enum(["column", "row"]).optional(),
242
+ gap: z.enum([
243
+ "none",
244
+ "xs",
245
+ "sm",
246
+ "md",
247
+ "lg",
248
+ "xl"
249
+ ]).optional(),
250
+ align: z.enum([
251
+ "start",
252
+ "center",
253
+ "end",
254
+ "stretch",
255
+ "baseline"
256
+ ]).optional(),
257
+ justify: z.enum([
258
+ "start",
259
+ "center",
260
+ "end",
261
+ "space-between",
262
+ "space-around"
263
+ ]).optional(),
264
+ wrap: z.boolean().optional()
265
+ }),
266
+ slots: ["default"],
267
+ description: "Flex container for layout. direction column stacks vertically, row lays side by side. gap is a named spacing step."
268
+ },
269
+ Stat: {
270
+ props: z.object({
271
+ label: z.string(),
272
+ value: z.string(),
273
+ change: z.string().optional(),
274
+ direction: z.enum([
275
+ "up",
276
+ "down",
277
+ "flat"
278
+ ]).optional()
279
+ }),
280
+ description: "One loud figure with its quiet label and an optional delta."
281
+ },
282
+ Switch: {
283
+ props: z.object({
284
+ label: z.string().optional(),
285
+ checked: z.boolean().optional(),
286
+ disabled: z.boolean().optional()
287
+ }),
288
+ description: "An instant on/off; label names what it switches."
289
+ },
290
+ Text: {
291
+ props: z.object({
292
+ text: z.string(),
293
+ variant: z.enum([
294
+ "body",
295
+ "lead",
296
+ "muted",
297
+ "label"
298
+ ]).optional()
299
+ }),
300
+ description: "A prose voice: lead opens, body carries, muted whispers, label names."
301
+ },
302
+ Textarea: {
303
+ props: z.object({
304
+ label: z.string().optional(),
305
+ placeholder: z.string().optional(),
306
+ rows: z.number().int().optional(),
307
+ value: z.string().optional(),
308
+ disabled: z.boolean().optional()
309
+ }),
310
+ description: "A multi-line field for prose-length answers."
311
+ }
312
+ });
313
+ //#endregion
314
+ //#region src/generative/shared.ts
315
+ /** Name the entries a family contributes; the identity keeps inference
316
+ * honest at the call site. */
317
+ function defineEntry(entries) {
318
+ return entries;
319
+ }
320
+ const textVoices = {
321
+ body: Typography.Body,
322
+ lead: Typography.Lead,
323
+ muted: Typography.Muted,
324
+ label: Typography.Label
325
+ };
326
+ /** Two-way binding plumbing: the resolved value plus its write-back
327
+ * setter, typed for the family's use. */
328
+ function useBound(value, path) {
329
+ return useBoundProp(value, path);
330
+ }
331
+ const collectionCache = /* @__PURE__ */ new Map();
332
+ function collectionFor(options) {
333
+ const key = JSON.stringify(options);
334
+ let collection = collectionCache.get(key);
335
+ if (!collection) {
336
+ collection = createListCollection({ items: options });
337
+ collectionCache.set(key, collection);
338
+ }
339
+ return collection;
340
+ }
341
+ /** A labelled field: the label whispers above, the control answers. */
342
+ function labelled(label, control) {
343
+ return label ? createComponent$1(Stack, {
344
+ gap: "xs",
345
+ get children() {
346
+ return [createComponent$1(Typography.Label, { get children() {
347
+ return label;
348
+ } }), control];
349
+ }
350
+ }) : control;
351
+ }
352
+ //#endregion
353
+ //#region src/components/alert/generative.tsx
354
+ var generative_exports$17 = /* @__PURE__ */ __exportAll({ default: () => generative_default$17 });
355
+ /** A bordered notice; status picks the pigment. */
356
+ var generative_default$17 = defineEntry({ Alert: {
357
+ ...faces$1.Alert,
358
+ component: ({ props }) => createComponent$1(Alert.Root, {
359
+ get status() {
360
+ return props.status ?? "ink";
361
+ },
362
+ get children() {
363
+ return [createComponent$1(Alert.Icon, {}), createComponent$1(Alert.Body, { get children() {
364
+ return [createComponent$1(Alert.Title, { get children() {
365
+ return props.title;
366
+ } }), createComponent$1(Show, {
367
+ keyed: true,
368
+ get when() {
369
+ return props.message != null;
370
+ },
371
+ get children() {
372
+ return createComponent$1(Alert.Description, { get children() {
373
+ return props.message;
374
+ } });
375
+ }
376
+ })];
377
+ } })];
378
+ }
379
+ })
380
+ } });
381
+ //#endregion
382
+ //#region src/components/avatar/generative.tsx
383
+ var generative_exports$16 = /* @__PURE__ */ __exportAll({ default: () => generative_default$16 });
384
+ /** A person's seal: image when given, initials as the fallback. */
385
+ var generative_default$16 = defineEntry({ Avatar: {
386
+ ...faces$1.Avatar,
387
+ component: ({ props }) => createComponent$1(Avatar.Root, {
388
+ get size() {
389
+ return props.size;
390
+ },
391
+ get children() {
392
+ return [createComponent$1(Show, {
393
+ keyed: true,
394
+ get when() {
395
+ return props.src != null;
396
+ },
397
+ get children() {
398
+ return createComponent$1(Avatar.Image, {
399
+ get src() {
400
+ return props.src;
401
+ },
402
+ get alt() {
403
+ return props.name;
404
+ }
405
+ });
406
+ }
407
+ }), createComponent$1(Avatar.Fallback, { get children() {
408
+ return initials(props.name);
409
+ } })];
410
+ }
411
+ })
412
+ } });
413
+ //#endregion
414
+ //#region src/components/badge/generative.tsx
415
+ var generative_exports$15 = /* @__PURE__ */ __exportAll({ default: () => generative_default$15 });
416
+ /** A small status seal beside content; reads at a glance. */
417
+ var generative_default$15 = defineEntry({ Badge: {
418
+ ...faces$1.Badge,
419
+ component: ({ props }) => createComponent$1(Badge, {
420
+ get tone() {
421
+ return props.tone;
422
+ },
423
+ get variant() {
424
+ return props.variant;
425
+ },
426
+ get children() {
427
+ return props.text;
428
+ }
429
+ })
430
+ } });
431
+ //#endregion
432
+ //#region src/components/button/generative.tsx
433
+ var generative_exports$14 = /* @__PURE__ */ __exportAll({ default: () => generative_default$14 });
434
+ /** The primary action register: solid ink for the one main action, outline, ghost, or subtle for the rest. */
435
+ var generative_default$14 = defineEntry({ Button: {
436
+ ...faces$1.Button,
437
+ component: ({ props, emit }) => createComponent$1(Button, {
438
+ get variant() {
439
+ return props.variant ?? "solid";
440
+ },
441
+ get tone() {
442
+ return props.tone;
443
+ },
444
+ get size() {
445
+ return props.size;
446
+ },
447
+ get disabled() {
448
+ return props.disabled;
449
+ },
450
+ onClick: () => emit("press"),
451
+ get children() {
452
+ return props.label;
453
+ }
454
+ })
455
+ } });
456
+ //#endregion
457
+ //#region src/components/card/generative.tsx
458
+ var generative_exports$13 = /* @__PURE__ */ __exportAll({ default: () => generative_default$13 });
459
+ /** Grouping vessel. Give title and description instead of hand-building a header; children render in the body. */
460
+ var generative_default$13 = defineEntry({ Card: {
461
+ ...faces$1.Card,
462
+ component: ({ props, children }) => createComponent$1(Card.Root, { get children() {
463
+ return [createComponent$1(Show, {
464
+ keyed: true,
465
+ get when() {
466
+ return props.title != null || props.description != null;
467
+ },
468
+ get children() {
469
+ return createComponent$1(Card.Header, { get children() {
470
+ return [createComponent$1(Show, {
471
+ keyed: true,
472
+ get when() {
473
+ return props.title != null;
474
+ },
475
+ get children() {
476
+ return createComponent$1(Card.Title, { get children() {
477
+ return props.title;
478
+ } });
479
+ }
480
+ }), createComponent$1(Show, {
481
+ keyed: true,
482
+ get when() {
483
+ return props.description != null;
484
+ },
485
+ get children() {
486
+ return createComponent$1(Card.Description, { get children() {
487
+ return props.description;
488
+ } });
489
+ }
490
+ })];
491
+ } });
492
+ }
493
+ }), createComponent$1(Card.Content, { get children() {
494
+ return children;
495
+ } })];
496
+ } })
497
+ } });
498
+ //#endregion
499
+ //#region src/components/checkbox/generative.tsx
500
+ var generative_exports$12 = /* @__PURE__ */ __exportAll({ default: () => generative_default$12 });
501
+ /** One independent box with its label. */
502
+ var generative_default$12 = defineEntry({ Checkbox: {
503
+ ...faces$1.Checkbox,
504
+ component: ({ props }) => {
505
+ const mark = iconNode("check");
506
+ return createComponent$1(Checkbox.Root, {
507
+ get defaultChecked() {
508
+ return props.checked ?? false;
509
+ },
510
+ get disabled() {
511
+ return props.disabled;
512
+ },
513
+ get children() {
514
+ return [
515
+ createComponent$1(Checkbox.Control, { get children() {
516
+ return createComponent$1(Checkbox.Indicator, { get children() {
517
+ return mark;
518
+ } });
519
+ } }),
520
+ createComponent$1(Checkbox.Label, { get children() {
521
+ return props.label;
522
+ } }),
523
+ createComponent$1(Checkbox.HiddenInput, {})
524
+ ];
525
+ }
526
+ });
527
+ }
528
+ } });
529
+ //#endregion
530
+ //#region src/components/input/generative.tsx
531
+ var generative_exports$11 = /* @__PURE__ */ __exportAll({ default: () => generative_default$11 });
532
+ /** A single-line field; rely on border, surface and the focus halo. */
533
+ var generative_default$11 = defineEntry({ Input: {
534
+ ...faces$1.Input,
535
+ component: ({ props, bindings }) => {
536
+ const [value, setValue] = useBound(props.value, bindings?.value);
537
+ return labelled(props.label, createComponent$1(Input, {
538
+ get value() {
539
+ return value ?? "";
540
+ },
541
+ get placeholder() {
542
+ return props.placeholder;
543
+ },
544
+ get type() {
545
+ return props.type;
546
+ },
547
+ get disabled() {
548
+ return props.disabled;
549
+ },
550
+ onValueChange: (next) => setValue(next)
551
+ }));
552
+ }
553
+ } });
554
+ //#endregion
555
+ //#region src/components/progress/generative.tsx
556
+ var generative_exports$10 = /* @__PURE__ */ __exportAll({ default: () => generative_default$10 });
557
+ /** A working track that fills toward done. */
558
+ var generative_default$10 = defineEntry({ Progress: {
559
+ ...faces$1.Progress,
560
+ component: ({ props }) => createComponent$1(Progress.Root, {
561
+ get value() {
562
+ return props.value;
563
+ },
564
+ get max() {
565
+ return props.max;
566
+ },
567
+ get children() {
568
+ return [createComponent$1(Show, {
569
+ keyed: true,
570
+ get when() {
571
+ return props.label != null;
572
+ },
573
+ get children() {
574
+ return createComponent$1(Progress.Label, { get children() {
575
+ return props.label;
576
+ } });
577
+ }
578
+ }), createComponent$1(Progress.Track, { get children() {
579
+ return createComponent$1(Progress.Range, {});
580
+ } })];
581
+ }
582
+ })
583
+ } });
584
+ //#endregion
585
+ //#region src/components/radio-group/generative.tsx
586
+ var generative_exports$9 = /* @__PURE__ */ __exportAll({ default: () => generative_default$9 });
587
+ /** Several boxes where exactly one may hold. */
588
+ var generative_default$9 = defineEntry({ RadioGroup: {
589
+ ...faces$1.RadioGroup,
590
+ component: ({ props }) => {
591
+ const values = () => props.items ?? [
592
+ "Option A",
593
+ "Option B",
594
+ "Option C"
595
+ ];
596
+ const list = createComponent$1(Stack, {
597
+ gap: "sm",
598
+ get children() {
599
+ return createComponent(For, {
600
+ get each() {
601
+ return values();
602
+ },
603
+ children: (value) => createComponent$1(RadioGroup.Item, {
604
+ get value() {
605
+ return value;
606
+ },
607
+ get children() {
608
+ return [
609
+ createComponent$1(RadioGroup.ItemControl, {}),
610
+ createComponent$1(RadioGroup.ItemText, { get children() {
611
+ return value;
612
+ } }),
613
+ createComponent$1(RadioGroup.ItemHiddenInput, {})
614
+ ];
615
+ }
616
+ })
617
+ });
618
+ }
619
+ });
620
+ return labelled(props.label, createComponent$1(RadioGroup.Root, {
621
+ get defaultValue() {
622
+ return slug(values()[0] ?? "");
623
+ },
624
+ get children() {
625
+ return list;
626
+ }
627
+ }));
628
+ }
629
+ } });
630
+ //#endregion
631
+ //#region src/components/select/generative.tsx
632
+ var generative_exports$8 = /* @__PURE__ */ __exportAll({ default: () => generative_default$8 });
633
+ /** A choice field that opens a ruled list; options carry label and value. */
634
+ var generative_default$8 = defineEntry({ Select: {
635
+ ...faces$1.Select,
636
+ component: ({ props, bindings }) => {
637
+ const [value, setValue] = useBound(props.value, bindings?.value);
638
+ const collection = collectionFor(props.options);
639
+ return labelled(props.label, createComponent$1(Select.Root, {
640
+ collection,
641
+ get disabled() {
642
+ return props.disabled;
643
+ },
644
+ get multiple() {
645
+ return props.multiple;
646
+ },
647
+ get value() {
648
+ return props.multiple ? Array.isArray(value) ? value : value ? [value] : void 0 : typeof value === "string" ? [value] : void 0;
649
+ },
650
+ onValueChange: (details) => setValue(props.multiple ? details.value : details.value[0] ?? ""),
651
+ get children() {
652
+ return [
653
+ createComponent$1(Select.Control, { get children() {
654
+ return [createComponent$1(Select.Trigger, { get children() {
655
+ return createComponent$1(Select.ValueText, { get placeholder() {
656
+ return props.placeholder;
657
+ } });
658
+ } }), createComponent$1(Select.Indicator, { get children() {
659
+ return iconNode("chevrons-up-down");
660
+ } })];
661
+ } }),
662
+ createComponent$1(Select.Positioner, { get children() {
663
+ return createComponent$1(Select.Content, { get children() {
664
+ return createComponent$1(Select.ItemGroup, { get children() {
665
+ return createComponent(For, {
666
+ get each() {
667
+ return props.options;
668
+ },
669
+ children: (option) => createComponent$1(Select.Item, {
670
+ get item() {
671
+ return option;
672
+ },
673
+ get children() {
674
+ return [createComponent$1(Select.ItemText, { get children() {
675
+ return option.label;
676
+ } }), createComponent$1(Select.ItemIndicator, { get children() {
677
+ return iconNode("check");
678
+ } })];
679
+ }
680
+ })
681
+ });
682
+ } });
683
+ } });
684
+ } }),
685
+ createComponent$1(Select.HiddenSelect, {})
686
+ ];
687
+ }
688
+ }));
689
+ }
690
+ } });
691
+ //#endregion
692
+ //#region src/components/separator/generative.tsx
693
+ var generative_exports$7 = /* @__PURE__ */ __exportAll({ default: () => generative_default$7 });
694
+ /** Hairline divider between sections. */
695
+ var generative_default$7 = defineEntry({ Separator: {
696
+ ...faces$1.Separator,
697
+ component: ({ props }) => createComponent$1(Separator, {
698
+ get orientation() {
699
+ return props.orientation ?? "horizontal";
700
+ },
701
+ decorative: true
702
+ })
703
+ } });
704
+ //#endregion
705
+ //#region src/components/slider/generative.tsx
706
+ var generative_exports$6 = /* @__PURE__ */ __exportAll({ default: () => generative_default$6 });
707
+ /** A ruled track the hand slides between bounds. */
708
+ var generative_default$6 = defineEntry({ Slider: {
709
+ ...faces$1.Slider,
710
+ component: ({ props }) => labelled(props.label, createComponent$1(Slider.Root, {
711
+ get defaultValue() {
712
+ return [props.value ?? 50];
713
+ },
714
+ get min() {
715
+ return props.min;
716
+ },
717
+ get max() {
718
+ return props.max;
719
+ },
720
+ get step() {
721
+ return props.step;
722
+ },
723
+ get children() {
724
+ return [createComponent$1(Slider.Control, { get children() {
725
+ return [createComponent$1(Slider.Track, { get children() {
726
+ return createComponent$1(Slider.Range, {});
727
+ } }), createComponent$1(Slider.Thumb, { index: 0 })];
728
+ } })];
729
+ }
730
+ }))
731
+ } });
732
+ //#endregion
733
+ //#region src/components/spinner/generative.tsx
734
+ var generative_exports$5 = /* @__PURE__ */ __exportAll({ default: () => generative_default$5 });
735
+ /** A quiet wheel for work still settling. */
736
+ var generative_default$5 = defineEntry({ Spinner: {
737
+ ...faces$1.Spinner,
738
+ component: ({ props }) => createComponent$1(Spinner, {
739
+ get size() {
740
+ return props.size;
741
+ },
742
+ get "aria-label"() {
743
+ return props.label;
744
+ }
745
+ })
746
+ } });
747
+ //#endregion
748
+ //#region src/components/stack/generative.tsx
749
+ var generative_exports$4 = /* @__PURE__ */ __exportAll({ default: () => generative_default$4 });
750
+ /** Flex container for layout. direction column stacks vertically, row lays side by side. gap is a named spacing step. */
751
+ var generative_default$4 = defineEntry({ Stack: {
752
+ ...faces$1.Stack,
753
+ component: ({ props, children }) => createComponent$1(Stack, {
754
+ get direction() {
755
+ return props.direction ?? "column";
756
+ },
757
+ get gap() {
758
+ return props.gap ?? "md";
759
+ },
760
+ get align() {
761
+ return props.align;
762
+ },
763
+ get justify() {
764
+ return props.justify;
765
+ },
766
+ get wrap() {
767
+ return props.wrap;
768
+ },
769
+ get children() {
770
+ return children;
771
+ }
772
+ })
773
+ } });
774
+ //#endregion
775
+ //#region src/components/stat/generative.tsx
776
+ var generative_exports$3 = /* @__PURE__ */ __exportAll({ default: () => generative_default$3 });
777
+ /** One loud figure with its quiet label and an optional delta. */
778
+ var generative_default$3 = defineEntry({ Stat: {
779
+ ...faces$1.Stat,
780
+ component: ({ props }) => createComponent$1(Stat.Root, { get children() {
781
+ return [
782
+ createComponent$1(Stat.Label, { get children() {
783
+ return props.label;
784
+ } }),
785
+ createComponent$1(Stat.Value, { get children() {
786
+ return props.value;
787
+ } }),
788
+ createComponent$1(Show, {
789
+ keyed: true,
790
+ get when() {
791
+ return props.change != null;
792
+ },
793
+ get children() {
794
+ return createComponent$1(Stat.Delta, {
795
+ get direction() {
796
+ return props.direction ?? "flat";
797
+ },
798
+ get children() {
799
+ return props.change;
800
+ }
801
+ });
802
+ }
803
+ })
804
+ ];
805
+ } })
806
+ } });
807
+ //#endregion
808
+ //#region src/components/switch/generative.tsx
809
+ var generative_exports$2 = /* @__PURE__ */ __exportAll({ default: () => generative_default$2 });
810
+ /** An instant on/off; label names what it switches. */
811
+ var generative_default$2 = defineEntry({ Switch: {
812
+ ...faces$1.Switch,
813
+ component: ({ props, bindings }) => {
814
+ const [checked, setChecked] = useBound(props.checked, bindings?.checked);
815
+ return createComponent$1(Switch.Root, {
816
+ get checked() {
817
+ return checked ?? false;
818
+ },
819
+ get disabled() {
820
+ return props.disabled;
821
+ },
822
+ onCheckedChange: (details) => setChecked(details.checked),
823
+ get children() {
824
+ return [
825
+ createComponent$1(Switch.Control, { get children() {
826
+ return createComponent$1(Switch.Thumb, {});
827
+ } }),
828
+ createComponent$1(Switch.Label, { get children() {
829
+ return props.label;
830
+ } }),
831
+ createComponent$1(Switch.HiddenInput, {})
832
+ ];
833
+ }
834
+ });
835
+ }
836
+ } });
837
+ //#endregion
838
+ //#region src/components/textarea/generative.tsx
839
+ var generative_exports$1 = /* @__PURE__ */ __exportAll({ default: () => generative_default$1 });
840
+ /** A multi-line field for prose-length answers. */
841
+ var generative_default$1 = defineEntry({ Textarea: {
842
+ ...faces$1.Textarea,
843
+ component: ({ props, bindings }) => {
844
+ const [value, setValue] = useBound(props.value, bindings?.value);
845
+ return labelled(props.label, createComponent$1(Textarea, {
846
+ get value() {
847
+ return value ?? "";
848
+ },
849
+ get placeholder() {
850
+ return props.placeholder;
851
+ },
852
+ get rows() {
853
+ return props.rows;
854
+ },
855
+ get disabled() {
856
+ return props.disabled;
857
+ },
858
+ onValueChange: (next) => setValue(next)
859
+ }));
860
+ }
861
+ } });
862
+ //#endregion
863
+ //#region src/components/typography/generative.tsx
864
+ var generative_exports = /* @__PURE__ */ __exportAll({ default: () => generative_default });
865
+ /** Section heading. One per view at level 1; do not skip levels. */
866
+ var generative_default = defineEntry({
867
+ Heading: {
868
+ ...faces$1.Heading,
869
+ component: ({ props }) => createComponent$1(Typography.Heading, {
870
+ get class() {
871
+ return headingClass[props.level ?? "2"];
872
+ },
873
+ get children() {
874
+ return props.text;
875
+ }
876
+ })
877
+ },
878
+ Text: {
879
+ ...faces$1.Text,
880
+ component: ({ props }) => {
881
+ const Voice = textVoices[props.variant ?? "body"];
882
+ return createComponent$1(Voice, { get children() {
883
+ return props.text;
884
+ } });
885
+ }
886
+ }
887
+ });
888
+ //#endregion
889
+ //#region src/generative/index.ts
890
+ /** Every family writes its own generative face beside the component —
891
+ * `components/<family>/generative.tsx` — and this module is where they
892
+ * meet: one glob picks the faces up, so a family that lands in the
893
+ * package is in the vocabulary without anyone editing this file. */
894
+ const modules = /* #__PURE__ */ Object.assign({
895
+ "../components/alert/generative.tsx": generative_exports$17,
896
+ "../components/avatar/generative.tsx": generative_exports$16,
897
+ "../components/badge/generative.tsx": generative_exports$15,
898
+ "../components/button/generative.tsx": generative_exports$14,
899
+ "../components/card/generative.tsx": generative_exports$13,
900
+ "../components/checkbox/generative.tsx": generative_exports$12,
901
+ "../components/input/generative.tsx": generative_exports$11,
902
+ "../components/progress/generative.tsx": generative_exports$10,
903
+ "../components/radio-group/generative.tsx": generative_exports$9,
904
+ "../components/select/generative.tsx": generative_exports$8,
905
+ "../components/separator/generative.tsx": generative_exports$7,
906
+ "../components/slider/generative.tsx": generative_exports$6,
907
+ "../components/spinner/generative.tsx": generative_exports$5,
908
+ "../components/stack/generative.tsx": generative_exports$4,
909
+ "../components/stat/generative.tsx": generative_exports$3,
910
+ "../components/switch/generative.tsx": generative_exports$2,
911
+ "../components/textarea/generative.tsx": generative_exports$1,
912
+ "../components/typography/generative.tsx": generative_exports
913
+ });
914
+ const entries = {};
915
+ for (const [file, module] of Object.entries(modules)) {
916
+ const family = file.match(/components\/([^/]+)\/generative\.tsx/)?.[1] ?? file;
917
+ for (const [name, entry] of Object.entries(module.default ?? {})) {
918
+ if (entries[name]) throw new Error("Two generative faces claim \"" + name + "\": " + entries[name]._from + " and " + family);
919
+ entries[name] = {
920
+ ...entry,
921
+ _from: family
922
+ };
923
+ }
924
+ }
925
+ const faces = Object.fromEntries(Object.entries(entries).map(([name, entry]) => [name, {
926
+ props: entry.props,
927
+ description: entry.description
928
+ }]));
929
+ const catalog = defineCatalog(schema, {
930
+ components: faces,
931
+ actions: {}
932
+ });
933
+ const { registry } = defineRegistry(catalog, {
934
+ actions: {},
935
+ components: Object.fromEntries(Object.entries(entries).map(([name, entry]) => [name, entry.component]))
936
+ });
937
+ /** Which family each face came home from. A family may speak under
938
+ * several names - Layout plus its parts, Bento plus its cell - and the
939
+ * palette groups by provenance, never by guessing from the name. */
940
+ const faceFamilies = Object.fromEntries(Object.entries(entries).map(([name, entry]) => [name, entry._from]));
941
+ //#endregion
942
+ export { catalog, faceFamilies, registry };