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