@bysages/react 0.4.2 → 0.4.4

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 (71) hide show
  1. package/dist/{ai-response-nhDOlELQ.mjs → ai-response-CjjjprMY.mjs} +10 -3
  2. package/dist/{chevron-a2nIZKN4.mjs → chevron-BA7kV9m7.mjs} +1 -1
  3. package/dist/components/accordion/index.mjs +1 -1
  4. package/dist/components/ai/index.mjs +1 -1
  5. package/dist/components/ai-attachments/index.mjs +1 -1
  6. package/dist/components/ai-prompt-input/index.mjs +1 -1
  7. package/dist/components/ai-reasoning/index.mjs +1 -1
  8. package/dist/components/ai-response/index.mjs +1 -1
  9. package/dist/components/ai-tool/index.mjs +1 -1
  10. package/dist/components/alert/index.mjs +1 -1
  11. package/dist/components/avatar/index.d.mts +12 -2
  12. package/dist/components/avatar/index.mjs +18 -3
  13. package/dist/components/back-top/index.mjs +1 -1
  14. package/dist/components/banner/index.d.mts +16 -2
  15. package/dist/components/banner/index.mjs +19 -3
  16. package/dist/components/breadcrumb/index.d.mts +15 -1
  17. package/dist/components/breadcrumb/index.mjs +20 -2
  18. package/dist/components/calendar/index.mjs +1 -1
  19. package/dist/components/carousel/index.mjs +1 -1
  20. package/dist/components/cascade-select/index.mjs +1 -1
  21. package/dist/components/checkbox/index.mjs +1 -1
  22. package/dist/components/checkbox-group/index.mjs +1 -1
  23. package/dist/components/clipboard/index.mjs +1 -1
  24. package/dist/components/collapsible/index.mjs +1 -1
  25. package/dist/components/color-picker/index.d.mts +2 -0
  26. package/dist/components/color-picker/index.mjs +36 -22
  27. package/dist/components/combobox/index.mjs +1 -1
  28. package/dist/components/date-picker/index.mjs +1 -1
  29. package/dist/components/dialog/index.mjs +1 -1
  30. package/dist/components/drawer/index.mjs +1 -1
  31. package/dist/components/dynamic-input/index.mjs +1 -1
  32. package/dist/components/editable/index.mjs +1 -1
  33. package/dist/components/file-upload/index.mjs +2 -6
  34. package/dist/components/float-button/index.d.mts +22 -1
  35. package/dist/components/float-button/index.mjs +28 -2
  36. package/dist/components/floating-panel/index.mjs +6 -1
  37. package/dist/components/image/index.mjs +1 -1
  38. package/dist/components/image-viewer/index.mjs +1 -1
  39. package/dist/components/json-tree-view/index.mjs +1 -1
  40. package/dist/components/listbox/index.mjs +1 -1
  41. package/dist/components/media-player/index.mjs +1 -1
  42. package/dist/components/menu/index.mjs +1 -1
  43. package/dist/components/number-input/index.mjs +1 -1
  44. package/dist/components/order-list/index.mjs +1 -1
  45. package/dist/components/pagination/index.mjs +1 -1
  46. package/dist/components/password-input/index.mjs +1 -1
  47. package/dist/components/popover/index.mjs +1 -1
  48. package/dist/components/rating-group/index.mjs +1 -1
  49. package/dist/components/result/index.mjs +2 -1
  50. package/dist/components/select/index.mjs +1 -1
  51. package/dist/components/signature-pad/index.mjs +1 -1
  52. package/dist/components/split-button/index.mjs +1 -1
  53. package/dist/components/swap/index.mjs +1 -1
  54. package/dist/components/table/index.mjs +2 -2
  55. package/dist/components/tag/index.mjs +14 -8
  56. package/dist/components/tags-input/index.mjs +1 -1
  57. package/dist/components/toast/index.mjs +15 -2
  58. package/dist/components/toggle-group/index.mjs +1 -1
  59. package/dist/components/transfer/index.mjs +1 -1
  60. package/dist/components/tree-select/index.mjs +1 -1
  61. package/dist/components/tree-view/index.mjs +1 -1
  62. package/dist/generative/index.d.mts +53 -0
  63. package/dist/generative/index.mjs +735 -0
  64. package/dist/icon-Cri0-7-x.mjs +38 -0
  65. package/dist/{image-viewer-B-hKFkEw.mjs → image-viewer-D4FuYrk6.mjs} +1 -1
  66. package/dist/index.d.mts +5 -5
  67. package/dist/index.mjs +4 -4
  68. package/dist/{media-player-DjVvo1_7.mjs → media-player-C0WcjVI-.mjs} +2 -2
  69. package/dist/{select-i9UZsQCU.mjs → select-D_soVdWK.mjs} +1 -1
  70. package/package.json +2 -2
  71. package/dist/icon-BALgGtNK.mjs +0 -18
@@ -0,0 +1,735 @@
1
+ import { r as iconNode } from "../icon-Cri0-7-x.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 { Banner } from "../components/banner/index.mjs";
7
+ import { Spinner } from "../components/spinner/index.mjs";
8
+ import { Breadcrumb } from "../components/breadcrumb/index.mjs";
9
+ import { Card } from "../components/card/index.mjs";
10
+ import { t as Input } from "../input-BDpQ0e6G.mjs";
11
+ import { Checkbox } from "../components/checkbox/index.mjs";
12
+ import { FloatButton } from "../components/float-button/index.mjs";
13
+ import { Progress } from "../components/progress/index.mjs";
14
+ import { RadioGroup } from "../components/radio-group/index.mjs";
15
+ import { t as Select } from "../select-D_soVdWK.mjs";
16
+ import { Separator } from "../components/separator/index.mjs";
17
+ import { Slider } from "../components/slider/index.mjs";
18
+ import { Stack } from "../components/stack/index.mjs";
19
+ import { Stat } from "../components/stat/index.mjs";
20
+ import { Switch } from "../components/switch/index.mjs";
21
+ import { Textarea } from "../components/textarea/index.mjs";
22
+ import { Typography } from "../components/typography/index.mjs";
23
+ import { jsx } from "react/jsx-runtime";
24
+ import { createElement } from "react";
25
+ import { z } from "zod";
26
+ import { defineRegistry, useBoundProp } from "@json-render/react";
27
+ import { defineCatalog } from "@json-render/core";
28
+ import { schema } from "@json-render/react/schema";
29
+ //#region \0rolldown/runtime.js
30
+ var __defProp = Object.defineProperty;
31
+ var __exportAll = (all, no_symbols) => {
32
+ let target = {};
33
+ for (var name in all) __defProp(target, name, {
34
+ get: all[name],
35
+ enumerable: true
36
+ });
37
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
38
+ return target;
39
+ };
40
+ //#endregion
41
+ //#region src/generative/faces.generated.ts
42
+ /** Name the faces a family contributes; the identity keeps inference
43
+ * honest at the call site. */
44
+ function defineFace(faces) {
45
+ return faces;
46
+ }
47
+ /** Map a catalog Heading level to a measure — the serif voice stays, the
48
+ * size steps down. */
49
+ const headingClass = {
50
+ "1": "text-4xl",
51
+ "2": "text-3xl",
52
+ "3": "text-2xl",
53
+ "4": "text-xl",
54
+ "5": "text-lg",
55
+ "6": "text-base"
56
+ };
57
+ function slug(value) {
58
+ return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") || value;
59
+ }
60
+ /** The vocabulary the wrappers speak. One face per composed name — the
61
+ * per-family assemblies in each wrapper spread these and add only the
62
+ * rendering. */
63
+ const faces$1 = defineFace({
64
+ Alert: {
65
+ props: z.object({
66
+ status: z.enum([
67
+ "success",
68
+ "warning",
69
+ "danger",
70
+ "info",
71
+ "ink"
72
+ ]).optional(),
73
+ title: z.string().optional(),
74
+ message: z.string().optional()
75
+ }),
76
+ description: "A bordered notice; status picks the pigment."
77
+ },
78
+ Avatar: {
79
+ props: z.object({
80
+ name: z.string(),
81
+ src: z.string().optional(),
82
+ size: z.enum([
83
+ "sm",
84
+ "md",
85
+ "lg"
86
+ ]).optional()
87
+ }),
88
+ description: "A person's seal: image when given, initials as the fallback."
89
+ },
90
+ Banner: {
91
+ props: z.object({
92
+ status: z.enum([
93
+ "ink",
94
+ "info",
95
+ "success",
96
+ "warning",
97
+ "danger"
98
+ ]).optional(),
99
+ title: z.string().optional(),
100
+ message: z.string().optional(),
101
+ dismissible: z.boolean().optional()
102
+ }),
103
+ description: "A full-width notice that speaks once across the page."
104
+ },
105
+ Breadcrumb: {
106
+ props: z.object({ items: z.array(z.string()).optional() }),
107
+ description: "A trail of waymarks from home to the current page."
108
+ },
109
+ Badge: {
110
+ props: z.object({
111
+ text: z.string(),
112
+ tone: z.enum([
113
+ "ink",
114
+ "primary",
115
+ "success",
116
+ "warning",
117
+ "danger",
118
+ "info"
119
+ ]).optional(),
120
+ variant: z.enum([
121
+ "solid",
122
+ "subtle",
123
+ "outline"
124
+ ]).optional()
125
+ }),
126
+ description: "A small status seal beside content; reads at a glance."
127
+ },
128
+ Button: {
129
+ props: z.object({
130
+ label: z.string(),
131
+ variant: z.enum([
132
+ "solid",
133
+ "outline",
134
+ "ghost",
135
+ "subtle"
136
+ ]).optional(),
137
+ tone: z.enum([
138
+ "ink",
139
+ "success",
140
+ "warning",
141
+ "danger",
142
+ "info"
143
+ ]).optional(),
144
+ size: z.enum([
145
+ "sm",
146
+ "md",
147
+ "lg"
148
+ ]).optional(),
149
+ disabled: z.boolean().optional()
150
+ }),
151
+ description: "The primary action register: solid ink for the one main action, outline, ghost, or subtle for the rest."
152
+ },
153
+ Card: {
154
+ props: z.object({
155
+ title: z.string().optional(),
156
+ description: z.string().optional()
157
+ }),
158
+ slots: [
159
+ "default",
160
+ "header",
161
+ "footer"
162
+ ],
163
+ description: "Grouping vessel. Give title and description instead of hand-building a header; children render in the body; footer holds actions."
164
+ },
165
+ Checkbox: {
166
+ props: z.object({
167
+ label: z.string(),
168
+ checked: z.boolean().optional(),
169
+ disabled: z.boolean().optional()
170
+ }),
171
+ description: "One independent box with its label."
172
+ },
173
+ FloatButton: {
174
+ props: z.object({
175
+ label: z.string().optional(),
176
+ actions: z.array(z.object({
177
+ label: z.string(),
178
+ icon: z.string().optional(),
179
+ disabled: z.boolean().optional()
180
+ })).optional(),
181
+ placement: z.enum([
182
+ "bottom-end",
183
+ "bottom-start",
184
+ "top-end",
185
+ "top-start"
186
+ ]).optional(),
187
+ size: z.enum([
188
+ "sm",
189
+ "md",
190
+ "lg"
191
+ ]).optional(),
192
+ defaultOpen: z.boolean().optional()
193
+ }),
194
+ description: "A floating action and its fanned alternatives; actions use curated icon names."
195
+ },
196
+ Heading: {
197
+ props: z.object({
198
+ text: z.string(),
199
+ level: z.enum([
200
+ "1",
201
+ "2",
202
+ "3",
203
+ "4",
204
+ "5",
205
+ "6"
206
+ ]).optional()
207
+ }),
208
+ description: "Section heading. One per view at level 1; do not skip levels."
209
+ },
210
+ Input: {
211
+ props: z.object({
212
+ label: z.string().optional(),
213
+ placeholder: z.string().optional(),
214
+ type: z.enum([
215
+ "text",
216
+ "email",
217
+ "url",
218
+ "search",
219
+ "tel"
220
+ ]).optional(),
221
+ value: z.string().optional(),
222
+ disabled: z.boolean().optional()
223
+ }),
224
+ description: "A single-line field; rely on border, surface and the focus halo."
225
+ },
226
+ Progress: {
227
+ props: z.object({
228
+ value: z.number().optional(),
229
+ label: z.string().optional(),
230
+ max: z.number().optional()
231
+ }),
232
+ description: "A working track that fills toward done."
233
+ },
234
+ RadioGroup: {
235
+ props: z.object({
236
+ label: z.string().optional(),
237
+ items: z.array(z.string()).optional()
238
+ }),
239
+ description: "Several boxes where exactly one may hold."
240
+ },
241
+ Select: {
242
+ props: z.object({
243
+ label: z.string().optional(),
244
+ placeholder: z.string().optional(),
245
+ options: z.array(z.object({
246
+ label: z.string(),
247
+ value: z.string()
248
+ })),
249
+ value: z.union([z.string(), z.array(z.string())]).optional(),
250
+ multiple: z.boolean().optional(),
251
+ disabled: z.boolean().optional()
252
+ }),
253
+ description: "A choice field that opens a ruled list; options carry label and value."
254
+ },
255
+ Separator: {
256
+ props: z.object({ orientation: z.enum(["horizontal", "vertical"]).optional() }),
257
+ description: "Hairline divider between sections."
258
+ },
259
+ Slider: {
260
+ props: z.object({
261
+ label: z.string().optional(),
262
+ value: z.number().optional(),
263
+ min: z.number().optional(),
264
+ max: z.number().optional(),
265
+ step: z.number().optional()
266
+ }),
267
+ description: "A ruled track the hand slides between bounds."
268
+ },
269
+ Spinner: {
270
+ props: z.object({
271
+ size: z.enum([
272
+ "sm",
273
+ "md",
274
+ "lg"
275
+ ]).optional(),
276
+ label: z.string().optional()
277
+ }),
278
+ description: "A quiet wheel for work still settling."
279
+ },
280
+ Stack: {
281
+ props: z.object({
282
+ direction: z.enum(["column", "row"]).optional(),
283
+ gap: z.enum([
284
+ "none",
285
+ "xs",
286
+ "sm",
287
+ "md",
288
+ "lg",
289
+ "xl"
290
+ ]).optional(),
291
+ align: z.enum([
292
+ "start",
293
+ "center",
294
+ "end",
295
+ "stretch",
296
+ "baseline"
297
+ ]).optional(),
298
+ justify: z.enum([
299
+ "start",
300
+ "center",
301
+ "end",
302
+ "space-between",
303
+ "space-around"
304
+ ]).optional(),
305
+ wrap: z.boolean().optional()
306
+ }),
307
+ slots: ["default"],
308
+ description: "Flex container for layout. direction column stacks vertically, row lays side by side. gap is a named spacing step."
309
+ },
310
+ Stat: {
311
+ props: z.object({
312
+ label: z.string(),
313
+ value: z.string(),
314
+ change: z.string().optional(),
315
+ direction: z.enum([
316
+ "up",
317
+ "down",
318
+ "flat"
319
+ ]).optional()
320
+ }),
321
+ description: "One loud figure with its quiet label and an optional delta."
322
+ },
323
+ Switch: {
324
+ props: z.object({
325
+ label: z.string().optional(),
326
+ checked: z.boolean().optional(),
327
+ disabled: z.boolean().optional()
328
+ }),
329
+ description: "An instant on/off; label names what it switches."
330
+ },
331
+ Text: {
332
+ props: z.object({
333
+ text: z.string(),
334
+ variant: z.enum([
335
+ "body",
336
+ "lead",
337
+ "muted",
338
+ "label"
339
+ ]).optional()
340
+ }),
341
+ description: "A prose voice: lead opens, body carries, muted whispers, label names."
342
+ },
343
+ Textarea: {
344
+ props: z.object({
345
+ label: z.string().optional(),
346
+ placeholder: z.string().optional(),
347
+ rows: z.number().int().optional(),
348
+ value: z.string().optional(),
349
+ disabled: z.boolean().optional()
350
+ }),
351
+ description: "A multi-line field for prose-length answers."
352
+ }
353
+ });
354
+ //#endregion
355
+ //#region src/generative/shared.ts
356
+ /** Name the entries a family contributes; the identity keeps inference
357
+ * honest at the call site. */
358
+ function defineEntry(entries) {
359
+ return entries;
360
+ }
361
+ const textVoices = {
362
+ body: Typography.Body,
363
+ lead: Typography.Lead,
364
+ muted: Typography.Muted,
365
+ label: Typography.Label
366
+ };
367
+ /** Two-way binding plumbing: the resolved value plus its write-back
368
+ * setter, typed for the family's use. */
369
+ function useBound(value, path) {
370
+ return useBoundProp(value, path);
371
+ }
372
+ /** A labelled field: the label whispers above, the control answers. */
373
+ function labelled(label, control) {
374
+ return label ? createElement(Stack, { gap: "xs" }, createElement(Typography.Label, null, label), control) : control;
375
+ }
376
+ //#endregion
377
+ //#region src/components/alert/generative.ts
378
+ var generative_exports$20 = /* @__PURE__ */ __exportAll({ default: () => generative_default$20 });
379
+ /** A bordered notice; status picks the pigment. */
380
+ var generative_default$20 = defineEntry({ Alert: {
381
+ ...faces$1.Alert,
382
+ component: ({ props }) => createElement(Alert.Root, { status: props.status ?? "ink" }, createElement(Alert.Icon), createElement(Alert.Body, null, createElement(Alert.Title, null, props.title), props.message != null ? createElement(Alert.Description, null, props.message) : null))
383
+ } });
384
+ //#endregion
385
+ //#region src/components/avatar/generative.ts
386
+ var generative_exports$19 = /* @__PURE__ */ __exportAll({ default: () => generative_default$19 });
387
+ /** A person's seal: image when given, initials as the fallback. */
388
+ var generative_default$19 = defineEntry({ Avatar: {
389
+ ...faces$1.Avatar,
390
+ component: ({ props }) => createElement(Avatar, { ...props })
391
+ } });
392
+ //#endregion
393
+ //#region src/components/badge/generative.ts
394
+ var generative_exports$18 = /* @__PURE__ */ __exportAll({ default: () => generative_default$18 });
395
+ /** A small status seal beside content; reads at a glance. */
396
+ var generative_default$18 = defineEntry({ Badge: {
397
+ ...faces$1.Badge,
398
+ component: ({ props }) => createElement(Badge, {
399
+ tone: props.tone,
400
+ variant: props.variant
401
+ }, props.text)
402
+ } });
403
+ //#endregion
404
+ //#region src/components/banner/generative.ts
405
+ var generative_exports$17 = /* @__PURE__ */ __exportAll({ default: () => generative_default$17 });
406
+ /** A full-width notice that speaks once across the page. */
407
+ var generative_default$17 = defineEntry({ Banner: {
408
+ ...faces$1.Banner,
409
+ component: ({ props }) => createElement(Banner, {
410
+ ...props,
411
+ dismissible: true
412
+ })
413
+ } });
414
+ //#endregion
415
+ //#region src/components/breadcrumb/generative.ts
416
+ var generative_exports$16 = /* @__PURE__ */ __exportAll({ default: () => generative_default$16 });
417
+ /** A trail of waymarks from home to the current page. */
418
+ var generative_default$16 = defineEntry({ Breadcrumb: {
419
+ ...faces$1.Breadcrumb,
420
+ component: ({ props }) => {
421
+ const labels = props.items ?? [
422
+ "Home",
423
+ "Guides",
424
+ "Ink"
425
+ ];
426
+ const items = labels.map((label, index) => index === labels.length - 1 ? { label } : {
427
+ label,
428
+ href: `#${slug(label)}`
429
+ });
430
+ return createElement(Breadcrumb, { items });
431
+ }
432
+ } });
433
+ //#endregion
434
+ //#region src/components/button/generative.ts
435
+ var generative_exports$15 = /* @__PURE__ */ __exportAll({ default: () => generative_default$15 });
436
+ /** The primary action register: solid ink for the one main action, outline, ghost, or subtle for the rest. */
437
+ var generative_default$15 = defineEntry({ Button: {
438
+ ...faces$1.Button,
439
+ component: ({ props, emit }) => createElement(Button, {
440
+ variant: props.variant ?? "solid",
441
+ tone: props.tone,
442
+ size: props.size,
443
+ disabled: props.disabled,
444
+ onClick: () => emit("press")
445
+ }, props.label)
446
+ } });
447
+ //#endregion
448
+ //#region src/components/card/generative.ts
449
+ var generative_exports$14 = /* @__PURE__ */ __exportAll({ default: () => generative_default$14 });
450
+ /** Grouping vessel. Give title and description instead of hand-building a header; children render in the body; footer holds actions. */
451
+ var generative_default$14 = defineEntry({ Card: {
452
+ ...faces$1.Card,
453
+ component: ({ props, children, slots }) => {
454
+ const header = slots?.header ?? null;
455
+ const footer = slots?.footer ?? null;
456
+ return createElement(Card.Root, null, header ? createElement(Card.Header, null, header) : props.title != null || props.description != null ? createElement(Card.Header, null, props.title != null ? createElement(Card.Title, null, props.title) : null, props.description != null ? createElement(Card.Description, null, props.description) : null) : null, createElement(Card.Content, null, children), footer ? createElement(Card.Footer, null, footer) : null);
457
+ }
458
+ } });
459
+ //#endregion
460
+ //#region src/components/checkbox/generative.ts
461
+ var generative_exports$13 = /* @__PURE__ */ __exportAll({ default: () => generative_default$13 });
462
+ /** One independent box with its label. */
463
+ var generative_default$13 = defineEntry({ Checkbox: {
464
+ ...faces$1.Checkbox,
465
+ component: ({ props }) => {
466
+ const mark = iconNode("check");
467
+ return createElement(Checkbox.Root, {
468
+ defaultChecked: props.checked ?? false,
469
+ disabled: props.disabled
470
+ }, [
471
+ createElement(Checkbox.Control, null, createElement(Checkbox.Indicator, null, mark)),
472
+ createElement(Checkbox.Label, null, props.label),
473
+ createElement(Checkbox.HiddenInput)
474
+ ]);
475
+ }
476
+ } });
477
+ //#endregion
478
+ //#region src/components/float-button/generative.ts
479
+ var generative_exports$12 = /* @__PURE__ */ __exportAll({ default: () => generative_default$12 });
480
+ /** A floating action cluster; named actions fan out from one corner. */
481
+ var generative_default$12 = defineEntry({ FloatButton: {
482
+ ...faces$1.FloatButton,
483
+ component: ({ props }) => {
484
+ const actions = Array.isArray(props.actions) ? props.actions : [{ label: "Edit" }];
485
+ return createElement(FloatButton, {
486
+ ...props,
487
+ actions: actions.map((action) => ({
488
+ ...action,
489
+ icon: action.icon ?? "pencil"
490
+ })),
491
+ defaultOpen: true
492
+ });
493
+ }
494
+ } });
495
+ //#endregion
496
+ //#region src/components/input/generative.ts
497
+ var generative_exports$11 = /* @__PURE__ */ __exportAll({ default: () => generative_default$11 });
498
+ /** A single-line field; rely on border, surface and the focus halo. */
499
+ var generative_default$11 = defineEntry({ Input: {
500
+ ...faces$1.Input,
501
+ component: ({ props, bindings }) => {
502
+ const [value, setValue] = useBound(props.value, bindings?.value);
503
+ return labelled(props.label, createElement(Input, {
504
+ value: value ?? "",
505
+ placeholder: props.placeholder,
506
+ type: props.type,
507
+ disabled: props.disabled,
508
+ onValueChange: (next) => setValue(next)
509
+ }));
510
+ }
511
+ } });
512
+ //#endregion
513
+ //#region src/components/progress/generative.ts
514
+ var generative_exports$10 = /* @__PURE__ */ __exportAll({ default: () => generative_default$10 });
515
+ /** A working track that fills toward done. */
516
+ var generative_default$10 = defineEntry({ Progress: {
517
+ ...faces$1.Progress,
518
+ component: ({ props }) => createElement(Progress.Root, {
519
+ value: props.value,
520
+ max: props.max
521
+ }, props.label != null ? createElement(Progress.Label, null, props.label) : null, createElement(Progress.Track, null, createElement(Progress.Range)))
522
+ } });
523
+ //#endregion
524
+ //#region src/components/radio-group/generative.ts
525
+ var generative_exports$9 = /* @__PURE__ */ __exportAll({ default: () => generative_default$9 });
526
+ /** Several boxes where exactly one may hold. */
527
+ var generative_default$9 = defineEntry({ RadioGroup: {
528
+ ...faces$1.RadioGroup,
529
+ component: ({ props }) => {
530
+ const values = props.items ?? [
531
+ "Option A",
532
+ "Option B",
533
+ "Option C"
534
+ ];
535
+ return labelled(props.label, createElement(RadioGroup.Root, { defaultValue: slug(values[0] ?? "") }, createElement(Stack, { gap: "sm" }, values.map((value) => createElement(RadioGroup.Item, {
536
+ key: value,
537
+ value
538
+ }, createElement(RadioGroup.ItemControl), createElement(RadioGroup.ItemText, null, value), createElement(RadioGroup.ItemHiddenInput))))));
539
+ }
540
+ } });
541
+ //#endregion
542
+ //#region src/components/select/generative.tsx
543
+ var generative_exports$8 = /* @__PURE__ */ __exportAll({ default: () => generative_default$8 });
544
+ /** A choice field that opens a ruled list; options carry label and value. */
545
+ var generative_default$8 = defineEntry({ Select: {
546
+ ...faces$1.Select,
547
+ component: ({ props, bindings }) => {
548
+ const [value, setValue] = useBound(props.value, bindings?.value);
549
+ return /* @__PURE__ */ jsx(Select, {
550
+ label: props.label,
551
+ placeholder: props.placeholder,
552
+ options: props.options,
553
+ multiple: props.multiple,
554
+ disabled: props.disabled,
555
+ value: props.multiple ? Array.isArray(value) ? value : value ? [value] : void 0 : Array.isArray(value) ? value.at(0) ?? "" : value,
556
+ onValueChange: setValue
557
+ });
558
+ }
559
+ } });
560
+ //#endregion
561
+ //#region src/components/separator/generative.ts
562
+ var generative_exports$7 = /* @__PURE__ */ __exportAll({ default: () => generative_default$7 });
563
+ /** Hairline divider between sections. */
564
+ var generative_default$7 = defineEntry({ Separator: {
565
+ ...faces$1.Separator,
566
+ component: ({ props }) => createElement(Separator, {
567
+ orientation: props.orientation ?? "horizontal",
568
+ decorative: true
569
+ })
570
+ } });
571
+ //#endregion
572
+ //#region src/components/slider/generative.ts
573
+ var generative_exports$6 = /* @__PURE__ */ __exportAll({ default: () => generative_default$6 });
574
+ /** A ruled track the hand slides between bounds. */
575
+ var generative_default$6 = defineEntry({ Slider: {
576
+ ...faces$1.Slider,
577
+ component: ({ props }) => labelled(props.label, createElement(Slider.Root, {
578
+ defaultValue: [props.value ?? 50],
579
+ min: props.min,
580
+ max: props.max,
581
+ step: props.step
582
+ }, [createElement(Slider.Control, null, [createElement(Slider.Track, null, createElement(Slider.Range)), createElement(Slider.Thumb, {
583
+ index: 0,
584
+ key: 0
585
+ })])]))
586
+ } });
587
+ //#endregion
588
+ //#region src/components/spinner/generative.ts
589
+ var generative_exports$5 = /* @__PURE__ */ __exportAll({ default: () => generative_default$5 });
590
+ /** A quiet wheel for work still settling. */
591
+ var generative_default$5 = defineEntry({ Spinner: {
592
+ ...faces$1.Spinner,
593
+ component: ({ props }) => createElement(Spinner, {
594
+ size: props.size,
595
+ "aria-label": props.label
596
+ })
597
+ } });
598
+ //#endregion
599
+ //#region src/components/stack/generative.ts
600
+ var generative_exports$4 = /* @__PURE__ */ __exportAll({ default: () => generative_default$4 });
601
+ /** Flex container for layout. direction column stacks vertically, row lays side by side. gap is a named spacing step. */
602
+ var generative_default$4 = defineEntry({ Stack: {
603
+ ...faces$1.Stack,
604
+ component: ({ props, children }) => createElement(Stack, {
605
+ direction: props.direction ?? "column",
606
+ gap: props.gap ?? "md",
607
+ align: props.align,
608
+ justify: props.justify,
609
+ wrap: props.wrap
610
+ }, children)
611
+ } });
612
+ //#endregion
613
+ //#region src/components/stat/generative.ts
614
+ var generative_exports$3 = /* @__PURE__ */ __exportAll({ default: () => generative_default$3 });
615
+ /** One loud figure with its quiet label and an optional delta. */
616
+ var generative_default$3 = defineEntry({ Stat: {
617
+ ...faces$1.Stat,
618
+ component: ({ props }) => createElement(Stat.Root, null, [
619
+ createElement(Stat.Label, null, props.label),
620
+ createElement(Stat.Value, null, props.value),
621
+ props.change != null ? createElement(Stat.Delta, { direction: props.direction ?? "flat" }, props.change) : null
622
+ ])
623
+ } });
624
+ //#endregion
625
+ //#region src/components/switch/generative.ts
626
+ var generative_exports$2 = /* @__PURE__ */ __exportAll({ default: () => generative_default$2 });
627
+ /** An instant on/off; label names what it switches. */
628
+ var generative_default$2 = defineEntry({ Switch: {
629
+ ...faces$1.Switch,
630
+ component: ({ props, bindings }) => {
631
+ const [checked, setChecked] = useBound(props.checked, bindings?.checked);
632
+ return createElement(Switch.Root, {
633
+ checked: checked ?? false,
634
+ disabled: props.disabled,
635
+ onCheckedChange: (details) => setChecked(details.checked)
636
+ }, [
637
+ createElement(Switch.Control, null, createElement(Switch.Thumb)),
638
+ props.label != null ? createElement(Switch.Label, null, props.label) : null,
639
+ createElement(Switch.HiddenInput)
640
+ ]);
641
+ }
642
+ } });
643
+ //#endregion
644
+ //#region src/components/textarea/generative.ts
645
+ var generative_exports$1 = /* @__PURE__ */ __exportAll({ default: () => generative_default$1 });
646
+ /** A multi-line field for prose-length answers. */
647
+ var generative_default$1 = defineEntry({ Textarea: {
648
+ ...faces$1.Textarea,
649
+ component: ({ props, bindings }) => {
650
+ const [value, setValue] = useBound(props.value, bindings?.value);
651
+ return labelled(props.label, createElement(Textarea, {
652
+ value: value ?? "",
653
+ placeholder: props.placeholder,
654
+ rows: props.rows,
655
+ disabled: props.disabled,
656
+ onValueChange: (next) => setValue(next)
657
+ }));
658
+ }
659
+ } });
660
+ //#endregion
661
+ //#region src/components/typography/generative.ts
662
+ var generative_exports = /* @__PURE__ */ __exportAll({ default: () => generative_default });
663
+ /** Section heading. One per view at level 1; do not skip levels. */
664
+ var generative_default = defineEntry({
665
+ Heading: {
666
+ ...faces$1.Heading,
667
+ component: ({ props }) => createElement(Typography.Heading, { className: headingClass[props.level ?? "2"] }, props.text)
668
+ },
669
+ Text: {
670
+ ...faces$1.Text,
671
+ component: ({ props }) => {
672
+ const Voice = textVoices[props.variant ?? "body"];
673
+ return createElement(Voice, null, props.text);
674
+ }
675
+ }
676
+ });
677
+ //#endregion
678
+ //#region src/generative/index.ts
679
+ /** Every family writes its own generative face beside the component —
680
+ * `components/<family>/generative.ts` — and this module is where they
681
+ * meet: one glob picks the faces up, so a family that lands in the
682
+ * package is in the vocabulary without anyone editing this file. */
683
+ const modules = /* #__PURE__ */ Object.assign({
684
+ "../components/alert/generative.ts": generative_exports$20,
685
+ "../components/avatar/generative.ts": generative_exports$19,
686
+ "../components/badge/generative.ts": generative_exports$18,
687
+ "../components/banner/generative.ts": generative_exports$17,
688
+ "../components/breadcrumb/generative.ts": generative_exports$16,
689
+ "../components/button/generative.ts": generative_exports$15,
690
+ "../components/card/generative.ts": generative_exports$14,
691
+ "../components/checkbox/generative.ts": generative_exports$13,
692
+ "../components/float-button/generative.ts": generative_exports$12,
693
+ "../components/input/generative.ts": generative_exports$11,
694
+ "../components/progress/generative.ts": generative_exports$10,
695
+ "../components/radio-group/generative.ts": generative_exports$9,
696
+ "../components/select/generative.tsx": generative_exports$8,
697
+ "../components/separator/generative.ts": generative_exports$7,
698
+ "../components/slider/generative.ts": generative_exports$6,
699
+ "../components/spinner/generative.ts": generative_exports$5,
700
+ "../components/stack/generative.ts": generative_exports$4,
701
+ "../components/stat/generative.ts": generative_exports$3,
702
+ "../components/switch/generative.ts": generative_exports$2,
703
+ "../components/textarea/generative.ts": generative_exports$1,
704
+ "../components/typography/generative.ts": generative_exports
705
+ });
706
+ const entries = {};
707
+ for (const [file, module] of Object.entries(modules)) {
708
+ const family = file.match(/components\/([^/]+)\/generative\.tsx?/)?.[1] ?? file;
709
+ for (const [name, entry] of Object.entries(module.default ?? {})) {
710
+ if (entries[name]) throw new Error("Two generative faces claim \"" + name + "\": " + entries[name]._from + " and " + family);
711
+ entries[name] = {
712
+ ...entry,
713
+ _from: family
714
+ };
715
+ }
716
+ }
717
+ const faces = Object.fromEntries(Object.entries(entries).map(([name, entry]) => [name, {
718
+ props: entry.props,
719
+ slots: entry.slots,
720
+ description: entry.description
721
+ }]));
722
+ const catalog = defineCatalog(schema, {
723
+ components: faces,
724
+ actions: {}
725
+ });
726
+ const { registry } = defineRegistry(catalog, {
727
+ actions: {},
728
+ components: Object.fromEntries(Object.entries(entries).map(([name, entry]) => [name, entry.component]))
729
+ });
730
+ /** Which family each face came home from. A family may speak under
731
+ * several names - Layout plus its parts, Bento plus its cell - and the
732
+ * palette groups by provenance, never by guessing from the name. */
733
+ const faceFamilies = Object.fromEntries(Object.entries(entries).map(([name, entry]) => [name, entry._from]));
734
+ //#endregion
735
+ export { catalog, faceFamilies, registry };