@intent-driven/adapter-shadcn 0.1.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/dist/index.mjs ADDED
@@ -0,0 +1,709 @@
1
+ // src/adapter.jsx
2
+ import * as React from "react";
3
+ import * as Dialog from "@radix-ui/react-dialog";
4
+ import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
5
+ import * as SelectPrimitive from "@radix-ui/react-select";
6
+ import * as TabsPrimitive from "@radix-ui/react-tabs";
7
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
8
+ import { clsx } from "clsx";
9
+ import {
10
+ Pencil,
11
+ Trash2,
12
+ Plus,
13
+ Check,
14
+ X,
15
+ MoreHorizontal,
16
+ Search,
17
+ ChevronDown,
18
+ Pin,
19
+ PinOff,
20
+ Reply,
21
+ Send,
22
+ Star,
23
+ Bell,
24
+ BellOff,
25
+ Archive,
26
+ Copy,
27
+ Eye,
28
+ Lock,
29
+ Unlock,
30
+ Settings,
31
+ User,
32
+ LogOut,
33
+ Play,
34
+ Square,
35
+ Save,
36
+ Download,
37
+ Upload,
38
+ RefreshCw,
39
+ Filter,
40
+ Calendar,
41
+ Clock,
42
+ Heart,
43
+ ThumbsUp,
44
+ ThumbsDown,
45
+ Flag,
46
+ MessageSquare,
47
+ Phone,
48
+ Video,
49
+ Mic,
50
+ MicOff,
51
+ Volume2,
52
+ VolumeX,
53
+ Link,
54
+ Unlink,
55
+ Move,
56
+ Maximize2,
57
+ AlertTriangle,
58
+ Info,
59
+ HelpCircle,
60
+ ArrowRight,
61
+ ArrowLeft,
62
+ Home,
63
+ Target,
64
+ Award,
65
+ TrendingUp,
66
+ Flame,
67
+ Zap,
68
+ BookOpen,
69
+ Dumbbell,
70
+ DollarSign,
71
+ Briefcase,
72
+ Users,
73
+ Smile,
74
+ Palette,
75
+ Umbrella,
76
+ Globe,
77
+ Compass,
78
+ CheckSquare
79
+ } from "lucide-react";
80
+ import "./theme.css";
81
+ import { jsx, jsxs } from "react/jsx-runtime";
82
+ var EMOJI_TO_LUCIDE = {
83
+ "\u270E": Pencil,
84
+ "\u270F\uFE0F": Pencil,
85
+ "\u{1F5D1}": Trash2,
86
+ "\u{1F5D1}\uFE0F": Trash2,
87
+ "\u2795": Plus,
88
+ "+": Plus,
89
+ "\u2713": Check,
90
+ "\u2714": Check,
91
+ "\u2714\uFE0F": Check,
92
+ "\u2715": X,
93
+ "\u2717": X,
94
+ "\u274C": X,
95
+ "\u22EF": MoreHorizontal,
96
+ "\u2026": MoreHorizontal,
97
+ "\u{1F50D}": Search,
98
+ "\u{1F4CC}": Pin,
99
+ "\u{1F4CD}": Pin,
100
+ "\u21A9": Reply,
101
+ "\u21A9\uFE0F": Reply,
102
+ "\u{1F4E4}": Send,
103
+ "\u2B50": Star,
104
+ "\u{1F514}": Bell,
105
+ "\u{1F515}": BellOff,
106
+ "\u{1F4E6}": Archive,
107
+ "\u{1F4CB}": Copy,
108
+ "\u{1F441}": Eye,
109
+ "\u{1F512}": Lock,
110
+ "\u{1F513}": Unlock,
111
+ "\u2699": Settings,
112
+ "\u2699\uFE0F": Settings,
113
+ "\u{1F464}": User,
114
+ "\u{1F6AA}": LogOut,
115
+ "\u25B6": Play,
116
+ "\u23F9": Square,
117
+ "\u{1F4BE}": Save,
118
+ "\u{1F4E5}": Download,
119
+ "\u{1F4E4}": Upload,
120
+ "\u{1F504}": RefreshCw,
121
+ "\u{1F503}": RefreshCw,
122
+ "\u{1F5C2}": Filter,
123
+ "\u{1F4C5}": Calendar,
124
+ "\u{1F550}": Clock,
125
+ "\u2764\uFE0F": Heart,
126
+ "\u{1F44D}": ThumbsUp,
127
+ "\u{1F44E}": ThumbsDown,
128
+ "\u{1F6A9}": Flag,
129
+ "\u{1F4AC}": MessageSquare,
130
+ "\u{1F4DE}": Phone,
131
+ "\u{1F4F9}": Video,
132
+ "\u{1F3A4}": Mic,
133
+ "\u{1F507}": MicOff,
134
+ "\u{1F50A}": Volume2,
135
+ "\u{1F508}": VolumeX,
136
+ "\u{1F517}": Link,
137
+ "\u2702": Unlink,
138
+ "\u2194": Move,
139
+ "\u2922": Maximize2,
140
+ "\u26A0": AlertTriangle,
141
+ "\u26A0\uFE0F": AlertTriangle,
142
+ "\u2139": Info,
143
+ "\u2139\uFE0F": Info,
144
+ "\u2753": HelpCircle,
145
+ "\u2192": ArrowRight,
146
+ "\u2190": ArrowLeft,
147
+ "\u{1F3E0}": Home,
148
+ "\u{1F3AF}": Target,
149
+ "\u{1F3C6}": Award,
150
+ "\u{1F4C8}": TrendingUp,
151
+ "\u{1F525}": Flame,
152
+ "\u26A1": Zap,
153
+ "\u{1F4DA}": BookOpen,
154
+ "\u{1F4AA}": Dumbbell,
155
+ "\u{1F4B0}": DollarSign,
156
+ "\u{1F4BC}": Briefcase,
157
+ "\u{1F91D}": Users,
158
+ "\u{1F9D8}": Smile,
159
+ "\u{1F3A8}": Palette,
160
+ "\u{1F3D6}\uFE0F": Umbrella,
161
+ "\u{1F30D}": Globe,
162
+ "\u{1F9ED}": Compass,
163
+ "\u2705": CheckSquare,
164
+ "\u2610": CheckSquare
165
+ };
166
+ function resolveLucide(emoji) {
167
+ if (!emoji) return null;
168
+ return EMOJI_TO_LUCIDE[emoji] || null;
169
+ }
170
+ var inputBase = [
171
+ "w-full rounded-[var(--radius-doodle)] border-2 border-dashed",
172
+ "border-[var(--color-doodle-border)] bg-[var(--color-doodle-bg)]",
173
+ "px-3 py-2 font-[var(--font-doodle)] text-[var(--color-doodle-ink)]",
174
+ "placeholder:text-[var(--color-doodle-ink-light)]/50",
175
+ "focus:outline-none focus:border-[var(--color-doodle-accent)] transition-colors"
176
+ ].join(" ");
177
+ function ShadcnTextInput({ spec, value, onChange }) {
178
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
179
+ spec.label && /* @__PURE__ */ jsx("label", { style: { fontSize: 13, fontWeight: 500, color: "var(--color-doodle-ink-light)", fontFamily: "var(--font-doodle)" }, children: spec.label }),
180
+ /* @__PURE__ */ jsx(
181
+ "input",
182
+ {
183
+ type: spec.type === "email" ? "email" : spec.type === "url" ? "url" : spec.type === "tel" ? "tel" : "text",
184
+ style: {
185
+ width: "100%",
186
+ borderRadius: "var(--radius-doodle)",
187
+ border: "1.5px solid var(--color-doodle-ink)",
188
+ background: "var(--color-doodle-bg)",
189
+ padding: "8px 12px",
190
+ fontFamily: "var(--font-doodle)",
191
+ color: "var(--color-doodle-ink)",
192
+ fontSize: 14,
193
+ outline: "none"
194
+ },
195
+ placeholder: spec.placeholder || "",
196
+ value: value || "",
197
+ onChange: (e) => onChange(e.target.value),
198
+ required: spec.required
199
+ }
200
+ )
201
+ ] });
202
+ }
203
+ function ShadcnTextarea({ spec, value, onChange }) {
204
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
205
+ spec.label && /* @__PURE__ */ jsx("label", { style: { fontSize: 13, fontWeight: 500, color: "var(--color-doodle-ink-light)", fontFamily: "var(--font-doodle)" }, children: spec.label }),
206
+ /* @__PURE__ */ jsx(
207
+ "textarea",
208
+ {
209
+ style: {
210
+ width: "100%",
211
+ borderRadius: "var(--radius-doodle)",
212
+ border: "1.5px solid var(--color-doodle-ink)",
213
+ background: "var(--color-doodle-bg)",
214
+ padding: "8px 12px",
215
+ fontFamily: "var(--font-doodle)",
216
+ color: "var(--color-doodle-ink)",
217
+ fontSize: 14,
218
+ minHeight: 80,
219
+ resize: "vertical",
220
+ outline: "none"
221
+ },
222
+ placeholder: spec.placeholder || "",
223
+ value: value || "",
224
+ onChange: (e) => onChange(e.target.value),
225
+ rows: 3
226
+ }
227
+ )
228
+ ] });
229
+ }
230
+ function ShadcnNumber({ spec, value, onChange }) {
231
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
232
+ spec.label && /* @__PURE__ */ jsx("label", { style: { fontSize: 13, fontWeight: 500, color: "var(--color-doodle-ink-light)", fontFamily: "var(--font-doodle)" }, children: spec.label }),
233
+ /* @__PURE__ */ jsx(
234
+ "input",
235
+ {
236
+ type: "number",
237
+ style: {
238
+ width: "100%",
239
+ borderRadius: "var(--radius-doodle)",
240
+ border: "1.5px solid var(--color-doodle-ink)",
241
+ background: "var(--color-doodle-bg)",
242
+ padding: "8px 12px",
243
+ fontFamily: "var(--font-doodle)",
244
+ color: "var(--color-doodle-ink)",
245
+ fontSize: 14,
246
+ outline: "none"
247
+ },
248
+ value: value ?? "",
249
+ onChange: (e) => onChange(e.target.value === "" ? null : Number(e.target.value)),
250
+ min: spec.min,
251
+ max: spec.max
252
+ }
253
+ )
254
+ ] });
255
+ }
256
+ function ShadcnDateTime({ spec, value, onChange }) {
257
+ const isTimeOnly = spec.name && /time/i.test(spec.name) && !/date/i.test(spec.name);
258
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
259
+ spec.label && /* @__PURE__ */ jsx("label", { style: { fontSize: 13, fontWeight: 500, color: "var(--color-doodle-ink-light)", fontFamily: "var(--font-doodle)" }, children: spec.label }),
260
+ /* @__PURE__ */ jsx(
261
+ "input",
262
+ {
263
+ type: isTimeOnly ? "time" : "date",
264
+ style: {
265
+ width: "100%",
266
+ borderRadius: "var(--radius-doodle)",
267
+ border: "1.5px solid var(--color-doodle-ink)",
268
+ background: "var(--color-doodle-bg)",
269
+ padding: "8px 12px",
270
+ fontFamily: "var(--font-doodle)",
271
+ color: "var(--color-doodle-ink)",
272
+ fontSize: 14,
273
+ outline: "none"
274
+ },
275
+ value: value || "",
276
+ onChange: (e) => onChange(e.target.value)
277
+ }
278
+ )
279
+ ] });
280
+ }
281
+ function ShadcnSelect({ spec, value, onChange }) {
282
+ const options = spec.options || [];
283
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
284
+ spec.label && /* @__PURE__ */ jsx("label", { style: { fontSize: 13, fontWeight: 500, color: "var(--color-doodle-ink-light)", fontFamily: "var(--font-doodle)" }, children: spec.label }),
285
+ /* @__PURE__ */ jsxs(SelectPrimitive.Root, { value: value || "", onValueChange: onChange, children: [
286
+ /* @__PURE__ */ jsxs(
287
+ SelectPrimitive.Trigger,
288
+ {
289
+ style: {
290
+ display: "flex",
291
+ alignItems: "center",
292
+ justifyContent: "space-between",
293
+ width: "100%",
294
+ borderRadius: "var(--radius-doodle)",
295
+ border: "2px dashed var(--color-doodle-border)",
296
+ background: "var(--color-doodle-bg)",
297
+ padding: "8px 12px",
298
+ fontFamily: "var(--font-doodle)",
299
+ color: "var(--color-doodle-ink)",
300
+ fontSize: 14,
301
+ cursor: "pointer"
302
+ },
303
+ children: [
304
+ /* @__PURE__ */ jsx(SelectPrimitive.Value, { placeholder: spec.placeholder || "\u0412\u044B\u0431\u0440\u0430\u0442\u044C..." }),
305
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 }) })
306
+ ]
307
+ }
308
+ ),
309
+ /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(
310
+ SelectPrimitive.Content,
311
+ {
312
+ style: {
313
+ background: "var(--color-doodle-bg)",
314
+ border: "2px solid var(--color-doodle-border)",
315
+ borderRadius: "var(--radius-doodle)",
316
+ boxShadow: "4px 4px 0 var(--color-doodle-border)",
317
+ zIndex: 9999,
318
+ fontFamily: "var(--font-doodle)"
319
+ },
320
+ position: "popper",
321
+ sideOffset: 4,
322
+ children: /* @__PURE__ */ jsx(SelectPrimitive.Viewport, { style: { padding: 4 }, children: options.map((opt) => /* @__PURE__ */ jsx(
323
+ SelectPrimitive.Item,
324
+ {
325
+ value: opt.value || opt,
326
+ style: {
327
+ padding: "8px 12px",
328
+ borderRadius: 8,
329
+ cursor: "pointer",
330
+ color: "var(--color-doodle-ink)",
331
+ outline: "none",
332
+ fontSize: 14
333
+ },
334
+ children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children: opt.label || opt })
335
+ },
336
+ opt.value || opt
337
+ )) })
338
+ }
339
+ ) })
340
+ ] })
341
+ ] });
342
+ }
343
+ var btnBase = {
344
+ borderRadius: "var(--radius-doodle)",
345
+ fontFamily: "var(--font-doodle)",
346
+ cursor: "pointer",
347
+ transition: "all 0.15s",
348
+ border: "2px solid",
349
+ fontSize: 14
350
+ };
351
+ function ShadcnPrimaryButton({ children, onClick, disabled, ...props }) {
352
+ return /* @__PURE__ */ jsx(
353
+ "button",
354
+ {
355
+ onClick,
356
+ disabled,
357
+ style: {
358
+ ...btnBase,
359
+ padding: "8px 16px",
360
+ fontWeight: 700,
361
+ background: "var(--color-doodle-accent)",
362
+ color: "white",
363
+ borderColor: "var(--color-doodle-accent)",
364
+ boxShadow: "2px 2px 0 var(--color-doodle-ink)",
365
+ opacity: disabled ? 0.5 : 1
366
+ },
367
+ ...props,
368
+ children
369
+ }
370
+ );
371
+ }
372
+ function ShadcnSecondaryButton({ children, onClick, disabled, ...props }) {
373
+ return /* @__PURE__ */ jsx(
374
+ "button",
375
+ {
376
+ onClick,
377
+ disabled,
378
+ style: {
379
+ ...btnBase,
380
+ padding: "8px 16px",
381
+ background: "transparent",
382
+ color: "var(--color-doodle-ink)",
383
+ borderColor: "var(--color-doodle-border)",
384
+ borderStyle: "dashed",
385
+ opacity: disabled ? 0.5 : 1
386
+ },
387
+ ...props,
388
+ children
389
+ }
390
+ );
391
+ }
392
+ function ShadcnDangerButton({ children, onClick, disabled, ...props }) {
393
+ return /* @__PURE__ */ jsx(
394
+ "button",
395
+ {
396
+ onClick,
397
+ disabled,
398
+ style: {
399
+ ...btnBase,
400
+ padding: "8px 16px",
401
+ fontWeight: 700,
402
+ background: "var(--color-doodle-warn)",
403
+ color: "white",
404
+ borderColor: "var(--color-doodle-warn)",
405
+ boxShadow: "2px 2px 0 var(--color-doodle-ink)",
406
+ opacity: disabled ? 0.5 : 1
407
+ },
408
+ ...props,
409
+ children
410
+ }
411
+ );
412
+ }
413
+ function ShadcnIntentButton({ spec, onClick, disabled }) {
414
+ const Icon2 = spec.icon ? resolveLucide(spec.icon) : null;
415
+ const label = spec.label || spec.intentId;
416
+ const isDanger = spec.irreversibility === "high" || spec.variant === "danger";
417
+ return /* @__PURE__ */ jsxs(
418
+ "button",
419
+ {
420
+ onClick,
421
+ disabled,
422
+ style: {
423
+ ...btnBase,
424
+ display: "inline-flex",
425
+ alignItems: "center",
426
+ gap: 6,
427
+ padding: "6px 14px",
428
+ fontSize: 14,
429
+ background: isDanger ? "transparent" : "var(--color-doodle-bg)",
430
+ color: isDanger ? "var(--color-doodle-warn)" : "var(--color-doodle-ink)",
431
+ borderColor: isDanger ? "var(--color-doodle-warn)" : "var(--color-doodle-ink)",
432
+ borderStyle: "solid",
433
+ borderWidth: 1.5,
434
+ boxShadow: "1.5px 1.5px 0 var(--color-doodle-ink)",
435
+ opacity: disabled ? 0.5 : 1
436
+ },
437
+ title: label,
438
+ children: [
439
+ Icon2 && /* @__PURE__ */ jsx(Icon2, { size: 16 }),
440
+ /* @__PURE__ */ jsx("span", { children: label })
441
+ ]
442
+ }
443
+ );
444
+ }
445
+ function ShadcnOverflowMenu({ items, triggerIcon, triggerLabel }) {
446
+ if (!items || items.length === 0) return null;
447
+ return /* @__PURE__ */ jsxs(DropdownMenu.Root, { children: [
448
+ /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { style: {
449
+ ...btnBase,
450
+ padding: 8,
451
+ background: "transparent",
452
+ color: "var(--color-doodle-ink)",
453
+ borderColor: "var(--color-doodle-border)",
454
+ borderStyle: "dashed"
455
+ }, children: /* @__PURE__ */ jsx(MoreHorizontal, { size: 16 }) }) }),
456
+ /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(
457
+ DropdownMenu.Content,
458
+ {
459
+ align: "end",
460
+ collisionPadding: 16,
461
+ style: {
462
+ background: "var(--color-doodle-bg)",
463
+ border: "2px solid var(--color-doodle-ink)",
464
+ borderRadius: "var(--radius-doodle)",
465
+ boxShadow: "3px 3px 0 var(--color-doodle-ink)",
466
+ padding: 4,
467
+ zIndex: 9999,
468
+ fontFamily: "var(--font-doodle)",
469
+ minWidth: 180,
470
+ maxWidth: "90vw"
471
+ },
472
+ sideOffset: 6,
473
+ children: items.map((item, i) => {
474
+ if (item.divider) return /* @__PURE__ */ jsx(DropdownMenu.Separator, { style: { height: 1, background: "var(--color-doodle-border)", margin: "4px 0" } }, item.key);
475
+ const IconCmp = item.icon ? resolveLucide(item.icon) : null;
476
+ return /* @__PURE__ */ jsxs(
477
+ DropdownMenu.Item,
478
+ {
479
+ style: {
480
+ display: "flex",
481
+ alignItems: "center",
482
+ gap: 8,
483
+ padding: "8px 12px",
484
+ borderRadius: 8,
485
+ fontSize: 13,
486
+ color: "var(--color-doodle-ink)",
487
+ outline: "none",
488
+ cursor: "pointer"
489
+ },
490
+ onSelect: () => item.onClick?.(),
491
+ children: [
492
+ IconCmp && /* @__PURE__ */ jsx(IconCmp, { size: 14 }),
493
+ /* @__PURE__ */ jsx("span", { children: item.label })
494
+ ]
495
+ },
496
+ item.key || i
497
+ );
498
+ })
499
+ }
500
+ ) })
501
+ ] });
502
+ }
503
+ function ShadcnModalShell({ opened, onClose, title, children }) {
504
+ return /* @__PURE__ */ jsx(Dialog.Root, { open: opened, onOpenChange: (v) => {
505
+ if (!v) onClose();
506
+ }, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
507
+ /* @__PURE__ */ jsx(Dialog.Overlay, { style: {
508
+ position: "fixed",
509
+ inset: 0,
510
+ background: "rgba(0,0,0,0.4)",
511
+ backdropFilter: "blur(4px)",
512
+ zIndex: 9999
513
+ } }),
514
+ /* @__PURE__ */ jsxs(Dialog.Content, { style: {
515
+ position: "fixed",
516
+ left: "50%",
517
+ top: "50%",
518
+ transform: "translate(-50%, -50%)",
519
+ zIndex: 9999,
520
+ width: "calc(100% - 32px)",
521
+ maxWidth: 420,
522
+ maxHeight: "85vh",
523
+ overflowY: "auto",
524
+ background: "var(--color-doodle-bg)",
525
+ border: "2px solid var(--color-doodle-border)",
526
+ borderRadius: "var(--radius-doodle)",
527
+ padding: "var(--spacing-doodle)",
528
+ fontFamily: "var(--font-doodle)",
529
+ boxShadow: "4px 4px 0 var(--color-doodle-ink)"
530
+ }, children: [
531
+ /* @__PURE__ */ jsx(Dialog.Title, { style: {
532
+ fontSize: 18,
533
+ fontWeight: 700,
534
+ color: "var(--color-doodle-ink)",
535
+ textDecoration: "underline",
536
+ textDecorationStyle: "wavy",
537
+ textDecorationColor: "var(--color-doodle-border)",
538
+ textUnderlineOffset: 4,
539
+ marginBottom: 16
540
+ }, children: title }),
541
+ children,
542
+ /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx("button", { style: {
543
+ position: "absolute",
544
+ top: 12,
545
+ right: 12,
546
+ background: "none",
547
+ border: "none",
548
+ color: "var(--color-doodle-ink-light)",
549
+ cursor: "pointer",
550
+ padding: 4
551
+ }, children: /* @__PURE__ */ jsx(X, { size: 18 }) }) })
552
+ ] })
553
+ ] }) });
554
+ }
555
+ function ShadcnTabs({ tabs, value, onChange }) {
556
+ return /* @__PURE__ */ jsx(TabsPrimitive.Root, { value, onValueChange: onChange, children: /* @__PURE__ */ jsx(TabsPrimitive.List, { style: {
557
+ display: "flex",
558
+ borderBottom: "2px dashed var(--color-doodle-border)",
559
+ fontFamily: "var(--font-doodle)",
560
+ overflowX: "auto",
561
+ gap: 0
562
+ }, children: tabs.map((tab) => /* @__PURE__ */ jsx(
563
+ TabsPrimitive.Trigger,
564
+ {
565
+ value: tab.value,
566
+ style: {
567
+ padding: "8px 16px",
568
+ fontSize: 13,
569
+ whiteSpace: "nowrap",
570
+ background: "transparent",
571
+ border: "none",
572
+ cursor: "pointer",
573
+ fontFamily: "inherit",
574
+ borderBottom: "2px solid transparent",
575
+ marginBottom: -2,
576
+ color: "var(--color-doodle-ink-light)"
577
+ },
578
+ children: tab.label
579
+ },
580
+ tab.value
581
+ )) }) });
582
+ }
583
+ function ShadcnHeading({ children, level = 2, ...props }) {
584
+ const Tag = `h${Math.min(level, 6)}`;
585
+ const sizes = { 1: 24, 2: 20, 3: 18, 4: 16, 5: 14, 6: 13 };
586
+ return /* @__PURE__ */ jsx(Tag, { style: {
587
+ fontSize: sizes[level] || 18,
588
+ fontWeight: 700,
589
+ fontFamily: "var(--font-doodle)",
590
+ color: "var(--color-doodle-ink)",
591
+ textDecoration: "underline",
592
+ textDecorationStyle: "wavy",
593
+ textDecorationColor: "var(--color-doodle-border)",
594
+ textUnderlineOffset: 4,
595
+ margin: 0
596
+ }, ...props, children });
597
+ }
598
+ function ShadcnText({ children, preset, ...props }) {
599
+ const colors = {
600
+ dimmed: "var(--color-doodle-ink-light)",
601
+ accent: "var(--color-doodle-accent)",
602
+ danger: "var(--color-doodle-warn)",
603
+ success: "var(--color-doodle-accent)"
604
+ };
605
+ return /* @__PURE__ */ jsx("span", { style: {
606
+ fontFamily: "var(--font-doodle)",
607
+ color: colors[preset] || "var(--color-doodle-ink)"
608
+ }, ...props, children });
609
+ }
610
+ function ShadcnBadge({ children, color, ...props }) {
611
+ return /* @__PURE__ */ jsx("span", { style: {
612
+ display: "inline-flex",
613
+ alignItems: "center",
614
+ padding: "2px 8px",
615
+ borderRadius: 20,
616
+ fontSize: 12,
617
+ fontWeight: 700,
618
+ fontFamily: "var(--font-doodle)",
619
+ border: `2px solid ${color || "var(--color-doodle-border)"}`,
620
+ background: "var(--color-doodle-highlight)",
621
+ color: color || "var(--color-doodle-ink)"
622
+ }, ...props, children });
623
+ }
624
+ function ShadcnAvatar({ src, name, size = 32, ...props }) {
625
+ const initials = (name || "?").split(" ").map((w) => w[0]).join("").slice(0, 2).toUpperCase();
626
+ return /* @__PURE__ */ jsxs(AvatarPrimitive.Root, { style: {
627
+ display: "inline-flex",
628
+ alignItems: "center",
629
+ justifyContent: "center",
630
+ borderRadius: "50%",
631
+ overflow: "hidden",
632
+ border: "2px solid var(--color-doodle-border)",
633
+ background: "var(--color-doodle-highlight)",
634
+ fontFamily: "var(--font-doodle)",
635
+ width: size,
636
+ height: size
637
+ }, ...props, children: [
638
+ /* @__PURE__ */ jsx(AvatarPrimitive.Image, { src, alt: name, style: { width: "100%", height: "100%", objectFit: "cover" } }),
639
+ /* @__PURE__ */ jsx(AvatarPrimitive.Fallback, { style: {
640
+ display: "flex",
641
+ alignItems: "center",
642
+ justifyContent: "center",
643
+ width: "100%",
644
+ height: "100%",
645
+ color: "var(--color-doodle-ink)",
646
+ fontSize: Math.round(size * 0.4),
647
+ fontWeight: 700
648
+ }, children: initials })
649
+ ] });
650
+ }
651
+ function ShadcnPaper({ children, ...props }) {
652
+ return /* @__PURE__ */ jsx("div", { style: {
653
+ borderRadius: "var(--radius-doodle)",
654
+ border: "1.5px solid var(--color-doodle-ink)",
655
+ background: "var(--color-doodle-bg)",
656
+ padding: "var(--spacing-doodle)",
657
+ boxShadow: "2px 2px 0 var(--color-doodle-ink)"
658
+ }, ...props, children });
659
+ }
660
+ var shadcnAdapter = {
661
+ name: "shadcn",
662
+ parameter: {
663
+ text: ShadcnTextInput,
664
+ textarea: ShadcnTextarea,
665
+ email: ShadcnTextInput,
666
+ url: ShadcnTextInput,
667
+ tel: ShadcnTextInput,
668
+ number: ShadcnNumber,
669
+ datetime: ShadcnDateTime,
670
+ select: ShadcnSelect
671
+ },
672
+ button: {
673
+ primary: ShadcnPrimaryButton,
674
+ secondary: ShadcnSecondaryButton,
675
+ danger: ShadcnDangerButton,
676
+ intent: ShadcnIntentButton,
677
+ overflow: ShadcnOverflowMenu
678
+ },
679
+ shell: {
680
+ modal: ShadcnModalShell,
681
+ tabs: ShadcnTabs
682
+ },
683
+ primitive: {
684
+ heading: ShadcnHeading,
685
+ text: ShadcnText,
686
+ badge: ShadcnBadge,
687
+ avatar: ShadcnAvatar,
688
+ paper: ShadcnPaper
689
+ },
690
+ icon: {
691
+ resolve: resolveLucide
692
+ }
693
+ };
694
+
695
+ // src/provider.jsx
696
+ import React2 from "react";
697
+ import { registerUIAdapter } from "@intent-driven/renderer";
698
+ import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
699
+ function ShadcnAdapterProvider({ children }) {
700
+ React2.useEffect(() => {
701
+ registerUIAdapter(shadcnAdapter);
702
+ }, []);
703
+ return /* @__PURE__ */ jsx2(Fragment, { children });
704
+ }
705
+ export {
706
+ ShadcnAdapterProvider,
707
+ shadcnAdapter
708
+ };
709
+ //# sourceMappingURL=index.mjs.map