pxengine 0.1.0

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 (127) hide show
  1. package/README.md +175 -0
  2. package/config/tailwind-preset.js +106 -0
  3. package/dist/index.d.mts +1259 -0
  4. package/dist/index.d.ts +1259 -0
  5. package/dist/index.js +5175 -0
  6. package/dist/index.mjs +4929 -0
  7. package/package.json +94 -0
  8. package/src/atoms/AccordionAtom.tsx +44 -0
  9. package/src/atoms/AlertAtom.tsx +46 -0
  10. package/src/atoms/AlertDialogAtom.tsx +66 -0
  11. package/src/atoms/AspectRatioAtom.tsx +27 -0
  12. package/src/atoms/AvatarAtom.tsx +20 -0
  13. package/src/atoms/BadgeAtom.tsx +25 -0
  14. package/src/atoms/BreadcrumbAtom.tsx +36 -0
  15. package/src/atoms/ButtonAtom.tsx +63 -0
  16. package/src/atoms/CalendarAtom.tsx +24 -0
  17. package/src/atoms/CardAtom.tsx +64 -0
  18. package/src/atoms/CarouselAtom.tsx +40 -0
  19. package/src/atoms/CollapsibleAtom.tsx +44 -0
  20. package/src/atoms/CommandAtom.tsx +46 -0
  21. package/src/atoms/DialogAtom.tsx +68 -0
  22. package/src/atoms/InputAtom.tsx +162 -0
  23. package/src/atoms/LayoutAtom.tsx +43 -0
  24. package/src/atoms/PaginationAtom.tsx +49 -0
  25. package/src/atoms/PopoverAtom.tsx +40 -0
  26. package/src/atoms/ProgressAtom.tsx +15 -0
  27. package/src/atoms/ScrollAreaAtom.tsx +31 -0
  28. package/src/atoms/SeparatorAtom.tsx +16 -0
  29. package/src/atoms/SheetAtom.tsx +72 -0
  30. package/src/atoms/SkeletonAtom.tsx +22 -0
  31. package/src/atoms/SpinnerAtom.tsx +26 -0
  32. package/src/atoms/TableAtom.tsx +58 -0
  33. package/src/atoms/TabsAtom.tsx +40 -0
  34. package/src/atoms/TextAtom.tsx +35 -0
  35. package/src/atoms/TooltipAtom.tsx +39 -0
  36. package/src/atoms/index.ts +28 -0
  37. package/src/components/index.ts +178 -0
  38. package/src/components/ui/accordion.tsx +56 -0
  39. package/src/components/ui/alert-dialog.tsx +139 -0
  40. package/src/components/ui/alert.tsx +59 -0
  41. package/src/components/ui/aspect-ratio.tsx +5 -0
  42. package/src/components/ui/avatar.tsx +50 -0
  43. package/src/components/ui/badge.tsx +36 -0
  44. package/src/components/ui/breadcrumb.tsx +115 -0
  45. package/src/components/ui/button-group.tsx +83 -0
  46. package/src/components/ui/button.tsx +56 -0
  47. package/src/components/ui/calendar.tsx +213 -0
  48. package/src/components/ui/card.tsx +79 -0
  49. package/src/components/ui/carousel.tsx +260 -0
  50. package/src/components/ui/chart.tsx +367 -0
  51. package/src/components/ui/checkbox.tsx +28 -0
  52. package/src/components/ui/collapsible.tsx +11 -0
  53. package/src/components/ui/command.tsx +153 -0
  54. package/src/components/ui/context-menu.tsx +198 -0
  55. package/src/components/ui/dialog.tsx +122 -0
  56. package/src/components/ui/drawer.tsx +116 -0
  57. package/src/components/ui/dropdown-menu.tsx +200 -0
  58. package/src/components/ui/empty.tsx +104 -0
  59. package/src/components/ui/field.tsx +244 -0
  60. package/src/components/ui/form.tsx +176 -0
  61. package/src/components/ui/hover-card.tsx +27 -0
  62. package/src/components/ui/input-group.tsx +168 -0
  63. package/src/components/ui/input-otp.tsx +69 -0
  64. package/src/components/ui/input.tsx +22 -0
  65. package/src/components/ui/item.tsx +193 -0
  66. package/src/components/ui/kbd.tsx +28 -0
  67. package/src/components/ui/label.tsx +26 -0
  68. package/src/components/ui/menubar.tsx +254 -0
  69. package/src/components/ui/navigation-menu.tsx +128 -0
  70. package/src/components/ui/pagination.tsx +117 -0
  71. package/src/components/ui/popover.tsx +29 -0
  72. package/src/components/ui/progress.tsx +28 -0
  73. package/src/components/ui/radio-group.tsx +42 -0
  74. package/src/components/ui/resizable.tsx +45 -0
  75. package/src/components/ui/scroll-area.tsx +46 -0
  76. package/src/components/ui/select.tsx +160 -0
  77. package/src/components/ui/separator.tsx +29 -0
  78. package/src/components/ui/sheet.tsx +140 -0
  79. package/src/components/ui/sidebar.tsx +771 -0
  80. package/src/components/ui/skeleton.tsx +15 -0
  81. package/src/components/ui/slider.tsx +26 -0
  82. package/src/components/ui/sonner.tsx +45 -0
  83. package/src/components/ui/spinner.tsx +16 -0
  84. package/src/components/ui/switch.tsx +27 -0
  85. package/src/components/ui/table.tsx +117 -0
  86. package/src/components/ui/tabs.tsx +53 -0
  87. package/src/components/ui/textarea.tsx +22 -0
  88. package/src/components/ui/toggle-group.tsx +61 -0
  89. package/src/components/ui/toggle.tsx +43 -0
  90. package/src/components/ui/tooltip.tsx +30 -0
  91. package/src/hooks/use-mobile.tsx +19 -0
  92. package/src/index.ts +24 -0
  93. package/src/lib/countries.ts +203 -0
  94. package/src/lib/index.ts +2 -0
  95. package/src/lib/utils.ts +15 -0
  96. package/src/lib/validators/index.ts +1 -0
  97. package/src/lib/validators/theme.ts +148 -0
  98. package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx +123 -0
  99. package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.types.ts +13 -0
  100. package/src/molecules/creator-discovery/CampaignSeedCard/index.ts +2 -0
  101. package/src/molecules/creator-discovery/MCQCard/MCQCard.tsx +165 -0
  102. package/src/molecules/creator-discovery/MCQCard/MCQCard.types.ts +71 -0
  103. package/src/molecules/creator-discovery/MCQCard/index.ts +2 -0
  104. package/src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx +334 -0
  105. package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx +111 -0
  106. package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.types.ts +18 -0
  107. package/src/molecules/creator-discovery/SearchSpecCard/index.ts +3 -0
  108. package/src/molecules/creator-discovery/index.ts +3 -0
  109. package/src/molecules/generic/ActionButton/ActionButton.tsx +137 -0
  110. package/src/molecules/generic/ActionButton/ActionButton.types.ts +68 -0
  111. package/src/molecules/generic/ActionButton/index.ts +2 -0
  112. package/src/molecules/generic/EditableField/EditableField.tsx +229 -0
  113. package/src/molecules/generic/EditableField/EditableField.types.ts +73 -0
  114. package/src/molecules/generic/EditableField/index.ts +2 -0
  115. package/src/molecules/generic/FormCard/FormCard.tsx +136 -0
  116. package/src/molecules/generic/FormCard/FormCard.types.ts +93 -0
  117. package/src/molecules/generic/FormCard/index.ts +2 -0
  118. package/src/molecules/generic/index.ts +3 -0
  119. package/src/molecules/index.ts +2 -0
  120. package/src/render/PXEngineRenderer.tsx +272 -0
  121. package/src/render/index.ts +1 -0
  122. package/src/styles/globals.css +146 -0
  123. package/src/types/atoms.ts +294 -0
  124. package/src/types/common.ts +116 -0
  125. package/src/types/index.ts +3 -0
  126. package/src/types/molecules.ts +54 -0
  127. package/src/types/schema.ts +12 -0
@@ -0,0 +1,272 @@
1
+ import React from "react";
2
+ import { UIComponent, UISchema, UIAtom, UIMolecule } from "../types/schema";
3
+ import * as Atoms from "../atoms";
4
+ import * as Molecules from "../molecules/index"; // Explicit index to help resolution
5
+
6
+ // NOTE: This renderer will be used by the frontend to interpret JSON schemas
7
+ // generated by the AI agent via the MCP server.
8
+
9
+ interface PXEngineRendererProps {
10
+ schema: UISchema | UIComponent;
11
+ onAction?: (action: string, payload?: any) => void;
12
+ }
13
+
14
+ /**
15
+ * PXEngineRenderer
16
+ *
17
+ * The core engine of the @pxengine-ui library.
18
+ * Recursively renders Atoms and Molecules based on the provided JSON schema.
19
+ */
20
+ export const PXEngineRenderer: React.FC<PXEngineRendererProps> = ({
21
+ schema,
22
+ onAction,
23
+ }) => {
24
+ // Determine if it's a full schema or just a component
25
+ const root = "root" in schema ? schema.root : schema;
26
+
27
+ /**
28
+ * Render Atomic components (UI Primitives)
29
+ */
30
+ const renderAtom = (
31
+ atom: UIAtom,
32
+ renderComponent: (c: UIComponent) => React.ReactNode,
33
+ ): React.ReactNode => {
34
+ const { type, id } = atom;
35
+
36
+ switch (type) {
37
+ case "layout":
38
+ return (
39
+ <Atoms.LayoutAtom
40
+ key={id}
41
+ {...(atom as any)}
42
+ renderComponent={renderComponent}
43
+ />
44
+ );
45
+ case "card":
46
+ return (
47
+ <Atoms.CardAtom
48
+ key={id}
49
+ {...(atom as any)}
50
+ renderComponent={renderComponent}
51
+ />
52
+ );
53
+ case "text":
54
+ return <Atoms.TextAtom key={id} {...(atom as any)} />;
55
+ case "button":
56
+ return (
57
+ <Atoms.ButtonAtom key={id} {...(atom as any)} onAction={onAction} />
58
+ );
59
+ case "input":
60
+ return <Atoms.InputAtom key={id} {...(atom as any)} />;
61
+ case "badge":
62
+ return <Atoms.BadgeAtom key={id} {...(atom as any)} />;
63
+ case "avatar":
64
+ return <Atoms.AvatarAtom key={id} {...(atom as any)} />;
65
+ case "progress":
66
+ return <Atoms.ProgressAtom key={id} {...(atom as any)} />;
67
+ case "skeleton":
68
+ return <Atoms.SkeletonAtom key={id} {...(atom as any)} />;
69
+ case "alert":
70
+ return <Atoms.AlertAtom key={id} {...(atom as any)} />;
71
+ case "separator":
72
+ return <Atoms.SeparatorAtom key={id} {...(atom as any)} />;
73
+ case "table":
74
+ return <Atoms.TableAtom key={id} {...(atom as any)} />;
75
+ case "tabs":
76
+ return (
77
+ <Atoms.TabsAtom
78
+ key={id}
79
+ {...(atom as any)}
80
+ renderComponent={renderComponent}
81
+ />
82
+ );
83
+ case "accordion":
84
+ return (
85
+ <Atoms.AccordionAtom
86
+ key={id}
87
+ {...(atom as any)}
88
+ renderComponent={renderComponent}
89
+ />
90
+ );
91
+ case "scroll-area":
92
+ return (
93
+ <Atoms.ScrollAreaAtom
94
+ key={id}
95
+ {...(atom as any)}
96
+ renderComponent={renderComponent}
97
+ />
98
+ );
99
+ case "carousel":
100
+ return (
101
+ <Atoms.CarouselAtom
102
+ key={id}
103
+ {...(atom as any)}
104
+ renderComponent={renderComponent}
105
+ />
106
+ );
107
+ case "aspect-ratio":
108
+ return (
109
+ <Atoms.AspectRatioAtom
110
+ key={id}
111
+ {...(atom as any)}
112
+ renderComponent={renderComponent}
113
+ />
114
+ );
115
+ case "collapsible":
116
+ return (
117
+ <Atoms.CollapsibleAtom
118
+ key={id}
119
+ {...(atom as any)}
120
+ renderComponent={renderComponent}
121
+ />
122
+ );
123
+ case "tooltip":
124
+ return (
125
+ <Atoms.TooltipAtom
126
+ key={id}
127
+ {...(atom as any)}
128
+ renderComponent={renderComponent}
129
+ />
130
+ );
131
+ case "popover":
132
+ return (
133
+ <Atoms.PopoverAtom
134
+ key={id}
135
+ {...(atom as any)}
136
+ renderComponent={renderComponent}
137
+ />
138
+ );
139
+ case "dialog":
140
+ return (
141
+ <Atoms.DialogAtom
142
+ key={id}
143
+ {...(atom as any)}
144
+ renderComponent={renderComponent}
145
+ />
146
+ );
147
+ case "sheet":
148
+ return (
149
+ <Atoms.SheetAtom
150
+ key={id}
151
+ {...(atom as any)}
152
+ renderComponent={renderComponent}
153
+ />
154
+ );
155
+ case "alert-dialog":
156
+ return (
157
+ <Atoms.AlertDialogAtom
158
+ key={id}
159
+ {...(atom as any)}
160
+ onAction={onAction}
161
+ renderComponent={renderComponent}
162
+ />
163
+ );
164
+ case "breadcrumb":
165
+ return <Atoms.BreadcrumbAtom key={id} {...(atom as any)} />;
166
+ case "spinner":
167
+ return <Atoms.SpinnerAtom key={id} {...(atom as any)} />;
168
+ case "calendar":
169
+ return <Atoms.CalendarAtom key={id} {...(atom as any)} />;
170
+ case "pagination":
171
+ return <Atoms.PaginationAtom key={id} {...(atom as any)} />;
172
+ case "command":
173
+ return <Atoms.CommandAtom key={id} {...(atom as any)} />;
174
+ default:
175
+ return null;
176
+ }
177
+ };
178
+
179
+ /**
180
+ * Render Molecule components (Domain-specific / Complex)
181
+ */
182
+ const renderMolecule = (molecule: UIMolecule): React.ReactNode => {
183
+ const { type, id } = molecule;
184
+
185
+ switch (type) {
186
+ case "campaign-seed":
187
+ return (
188
+ <Molecules.CampaignSeedCard
189
+ key={id}
190
+ {...(molecule as any)}
191
+ onProceed={() =>
192
+ onAction?.((molecule as any).proceedAction || "proceed")
193
+ }
194
+ />
195
+ );
196
+ case "search-spec":
197
+ return (
198
+ <Molecules.SearchSpecCard
199
+ key={id}
200
+ {...(molecule as any)}
201
+ onProceed={() =>
202
+ onAction?.((molecule as any).proceedAction || "proceed")
203
+ }
204
+ />
205
+ );
206
+ case "mcq":
207
+ return (
208
+ <Molecules.MCQCard
209
+ key={id}
210
+ {...(molecule as any)}
211
+ onProceed={() =>
212
+ onAction?.((molecule as any).proceedAction || "proceed")
213
+ }
214
+ />
215
+ );
216
+ case "action-button":
217
+ return (
218
+ <Molecules.ActionButton
219
+ key={id}
220
+ {...(molecule as any)}
221
+ onProceed={() => onAction?.((molecule as any).action || "proceed")}
222
+ />
223
+ );
224
+ default:
225
+ return null;
226
+ }
227
+ };
228
+
229
+ const renderComponent = (component: UIComponent): React.ReactNode => {
230
+ const { type } = component;
231
+
232
+ // Route based on defined Atom types
233
+ const isAtom = [
234
+ "layout",
235
+ "card",
236
+ "text",
237
+ "button",
238
+ "input",
239
+ "badge",
240
+ "avatar",
241
+ "progress",
242
+ "skeleton",
243
+ "alert",
244
+ "separator",
245
+ "table",
246
+ "tabs",
247
+ "accordion",
248
+ "scroll-area",
249
+ "carousel",
250
+ "aspect-ratio",
251
+ "collapsible",
252
+ "tooltip",
253
+ "popover",
254
+ "dialog",
255
+ "sheet",
256
+ "alert-dialog",
257
+ "breadcrumb",
258
+ "spinner",
259
+ "calendar",
260
+ "pagination",
261
+ "command",
262
+ ].includes(type);
263
+
264
+ if (isAtom) {
265
+ return renderAtom(component as UIAtom, renderComponent);
266
+ }
267
+
268
+ return renderMolecule(component as UIMolecule);
269
+ };
270
+
271
+ return <>{renderComponent(root)}</>;
272
+ };
@@ -0,0 +1 @@
1
+ export * from "./PXEngineRenderer";
@@ -0,0 +1,146 @@
1
+ @tailwind base;
2
+
3
+ @custom-variant dark (&:is(.dark *));
4
+ @tailwind components;
5
+ @tailwind utilities;
6
+
7
+ @layer base {
8
+ :root {
9
+ --background: 0 0% 100%;
10
+ --foreground: 222.2 84% 4.9%;
11
+ --card: 0 0% 100%;
12
+ --card-foreground: 222.2 84% 4.9%;
13
+ --popover: 0 0% 100%;
14
+ --popover-foreground: 222.2 84% 4.9%;
15
+ --primary: 222.2 47.4% 11.2%;
16
+ --primary-foreground: 210 40% 98%;
17
+ --secondary: 210 40% 96.1%;
18
+ --secondary-foreground: 222.2 47.4% 11.2%;
19
+ --muted: 210 40% 96.1%;
20
+ --muted-foreground: 215.4 16.3% 46.9%;
21
+ --accent: 210 40% 96.1%;
22
+ --accent-foreground: 222.2 47.4% 11.2%;
23
+ --destructive: 0 84.2% 60.2%;
24
+ --destructive-foreground: 210 40% 98%;
25
+ --border: 214.3 31.8% 91.4%;
26
+ --input: 214.3 31.8% 91.4%;
27
+ --ring: 222.2 84% 4.9%;
28
+ --radius: 0.5rem;
29
+
30
+ /* Custom theme variables (will be inherited from client) */
31
+ --gray25: #fcfcfd;
32
+ --gray50: #f9fafb;
33
+ --gray100: #f2f4f7;
34
+ --gray200: #eaecf0;
35
+ --gray300: #d0d5dd;
36
+ --gray400: #98a2b3;
37
+ --gray500: #667085;
38
+ --gray600: #475467;
39
+ --gray700: #344054;
40
+ --gray800: #1d2939;
41
+ --gray900: #101828;
42
+ --purple100: #f4f3ff;
43
+ --purple200: #988cff;
44
+ --purple500: #6941c6;
45
+ --purple-text: #7f56d9;
46
+ --purple50: #f9f5ff;
47
+ --purple20: #f4ebff;
48
+ --purple-border: #d6bbfb;
49
+ --purpleLight: #f4f3ff;
50
+ --purple-text-1: #7f56d9;
51
+ --purple-text-2: #6941c6;
52
+ }
53
+
54
+ .dark {
55
+ --background: 222.2 84% 4.9%;
56
+ --foreground: 210 40% 98%;
57
+ --card: 222.2 84% 4.9%;
58
+ --card-foreground: 210 40% 98%;
59
+ --popover: 222.2 84% 4.9%;
60
+ --popover-foreground: 210 40% 98%;
61
+ --primary: 210 40% 98%;
62
+ --primary-foreground: 222.2 47.4% 11.2%;
63
+ --secondary: 217.2 32.6% 17.5%;
64
+ --secondary-foreground: 210 40% 98%;
65
+ --muted: 217.2 32.6% 17.5%;
66
+ --muted-foreground: 215 20.2% 65.1%;
67
+ --accent: 217.2 32.6% 17.5%;
68
+ --accent-foreground: 210 40% 98%;
69
+ --destructive: 0 62.8% 30.6%;
70
+ --destructive-foreground: 210 40% 98%;
71
+ --border: 217.2 32.6% 17.5%;
72
+ --input: 217.2 32.6% 17.5%;
73
+ --ring: 212.7 26.8% 83.9%;
74
+ }
75
+ }
76
+
77
+ @layer base {
78
+ * {
79
+ @apply border-border;
80
+ }
81
+ body {
82
+ @apply bg-background text-foreground;
83
+ }
84
+ }
85
+
86
+ :root {
87
+ --sidebar: hsl(0 0% 98%);
88
+ --sidebar-foreground: hsl(240 5.3% 26.1%);
89
+ --sidebar-primary: hsl(240 5.9% 10%);
90
+ --sidebar-primary-foreground: hsl(0 0% 98%);
91
+ --sidebar-accent: hsl(240 4.8% 95.9%);
92
+ --sidebar-accent-foreground: hsl(240 5.9% 10%);
93
+ --sidebar-border: hsl(220 13% 91%);
94
+ --sidebar-ring: hsl(217.2 91.2% 59.8%);
95
+ }
96
+
97
+ .dark {
98
+ --sidebar: hsl(240 5.9% 10%);
99
+ --sidebar-foreground: hsl(240 4.8% 95.9%);
100
+ --sidebar-primary: hsl(224.3 76.3% 48%);
101
+ --sidebar-primary-foreground: hsl(0 0% 100%);
102
+ --sidebar-accent: hsl(240 3.7% 15.9%);
103
+ --sidebar-accent-foreground: hsl(240 4.8% 95.9%);
104
+ --sidebar-border: hsl(240 3.7% 15.9%);
105
+ --sidebar-ring: hsl(217.2 91.2% 59.8%);
106
+ }
107
+
108
+ @theme inline {
109
+ --color-sidebar: var(--sidebar);
110
+ --color-sidebar-foreground: var(--sidebar-foreground);
111
+ --color-sidebar-primary: var(--sidebar-primary);
112
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
113
+ --color-sidebar-accent: var(--sidebar-accent);
114
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
115
+ --color-sidebar-border: var(--sidebar-border);
116
+ --color-sidebar-ring: var(--sidebar-ring);
117
+ --animate-accordion-down: accordion-down 0.2s ease-out;
118
+ --animate-accordion-up: accordion-up 0.2s ease-out;
119
+
120
+ @keyframes accordion-down {
121
+ from {
122
+ height: 0;
123
+ }
124
+ to {
125
+ height: var(--radix-accordion-content-height);
126
+ }
127
+ }
128
+
129
+ @keyframes accordion-up {
130
+ from {
131
+ height: var(--radix-accordion-content-height);
132
+ }
133
+ to {
134
+ height: 0;
135
+ }
136
+ }
137
+ }
138
+
139
+ @layer base {
140
+ * {
141
+ @apply border-border outline-ring/50;
142
+ }
143
+ body {
144
+ @apply bg-background text-foreground;
145
+ }
146
+ }
@@ -0,0 +1,294 @@
1
+ export type LayoutDirection = "vertical" | "horizontal" | "grid";
2
+ export type GapSize = "none" | "sm" | "md" | "lg" | "xl";
3
+ export type TextVariant = "h1" | "h2" | "h3" | "h4" | "p" | "small" | "muted" | "label";
4
+ export type ButtonVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "purple" | "gradient";
5
+ export type ButtonSize = "default" | "sm" | "lg" | "icon" | "xl";
6
+ export type InputType = "text" | "email" | "password" | "number" | "search" | "tel" | "url" | "textarea" | "select" | "slider" | "checkbox" | "switch" | "radio" | "otp" | "date";
7
+
8
+ export interface BaseAtom {
9
+ id: string;
10
+ type: string;
11
+ className?: string;
12
+ }
13
+
14
+ // ============================================================================
15
+ // FORM ATOMS
16
+ // ============================================================================
17
+
18
+ export interface ButtonAtomType extends BaseAtom {
19
+ type: "button";
20
+ label: string;
21
+ variant?: ButtonVariant;
22
+ size?: ButtonSize;
23
+ action?: string;
24
+ disabled?: boolean;
25
+ isLoading?: boolean;
26
+ }
27
+
28
+ export interface InputAtomType extends BaseAtom {
29
+ type: "input";
30
+ inputType: InputType;
31
+ label?: string;
32
+ placeholder?: string;
33
+ defaultValue?: any;
34
+ required?: boolean;
35
+ disabled?: boolean;
36
+ options?: Array<{ label: string; value: string }>;
37
+ config?: Record<string, any>;
38
+ }
39
+
40
+ export interface ToggleAtomType extends BaseAtom {
41
+ type: "toggle";
42
+ label: string;
43
+ pressed?: boolean;
44
+ disabled?: boolean;
45
+ }
46
+
47
+ // ============================================================================
48
+ // LAYOUT & DISPLAY ATOMS
49
+ // ============================================================================
50
+
51
+ export interface TextAtomType extends BaseAtom {
52
+ type: "text";
53
+ content: string;
54
+ variant: TextVariant;
55
+ }
56
+
57
+ export interface LayoutAtomType extends BaseAtom {
58
+ type: "layout";
59
+ direction: LayoutDirection;
60
+ gap?: GapSize;
61
+ children: any[]; // Recursive
62
+ }
63
+
64
+ export interface CardAtomType extends BaseAtom {
65
+ type: "card";
66
+ title?: string;
67
+ description?: string;
68
+ children: any[];
69
+ footer?: any[];
70
+ }
71
+
72
+ export interface TabsAtomType extends BaseAtom {
73
+ type: "tabs";
74
+ defaultValue: string;
75
+ tabs: Array<{
76
+ value: string;
77
+ label: string;
78
+ content: any[];
79
+ }>;
80
+ }
81
+
82
+ export interface AccordionAtomType extends BaseAtom {
83
+ type: "accordion";
84
+ items: Array<{
85
+ value: string;
86
+ trigger: string;
87
+ content: any[];
88
+ }>;
89
+ }
90
+
91
+ export interface SeparatorAtomType extends BaseAtom {
92
+ type: "separator";
93
+ orientation?: "horizontal" | "vertical";
94
+ }
95
+
96
+ export interface ScrollAreaAtomType extends BaseAtom {
97
+ type: "scroll-area";
98
+ maxHeight?: string;
99
+ children: any[];
100
+ }
101
+
102
+ // ============================================================================
103
+ // DATA DISPLAY ATOMS
104
+ // ============================================================================
105
+
106
+ export interface AvatarAtomType extends BaseAtom {
107
+ type: "avatar";
108
+ src?: string;
109
+ fallback: string;
110
+ alt?: string;
111
+ }
112
+
113
+ export interface BadgeAtomType extends BaseAtom {
114
+ type: "badge";
115
+ label: string;
116
+ variant?: "default" | "secondary" | "destructive" | "outline" | "purple" | "green";
117
+ }
118
+
119
+ export interface ProgressAtomType extends BaseAtom {
120
+ type: "progress";
121
+ value: number; // 0 to 100
122
+ }
123
+
124
+ export interface TableAtomType extends BaseAtom {
125
+ type: "table";
126
+ headers: string[];
127
+ rows: any[][];
128
+ }
129
+
130
+ export interface CarouselAtomType extends BaseAtom {
131
+ type: "carousel";
132
+ items: any[][]; // Array of children per slide
133
+ }
134
+
135
+ export interface AlertAtomType extends BaseAtom {
136
+ type: "alert";
137
+ title: string;
138
+ description?: string;
139
+ variant?: "default" | "destructive" | "warning" | "info" | "success";
140
+ }
141
+
142
+ // ============================================================================
143
+ // OVERLAY ATOMS
144
+ // ============================================================================
145
+
146
+ export interface TooltipAtomType extends BaseAtom {
147
+ type: "tooltip";
148
+ content: string;
149
+ children: any[];
150
+ }
151
+
152
+ export interface PopoverAtomType extends BaseAtom {
153
+ type: "popover";
154
+ trigger: any[];
155
+ content: any[];
156
+ }
157
+
158
+ export interface DialogAtomType extends BaseAtom {
159
+ type: "dialog";
160
+ title: string;
161
+ description?: string;
162
+ trigger: any[];
163
+ children: any[];
164
+ footer?: any[];
165
+ }
166
+
167
+ // ============================================================================
168
+ // ADDITIONAL LAYOUT ATOMS
169
+ // ============================================================================
170
+
171
+ export interface AspectRatioAtomType extends BaseAtom {
172
+ type: "aspect-ratio";
173
+ ratio: number;
174
+ children: any[];
175
+ }
176
+
177
+ export interface CollapsibleAtomType extends BaseAtom {
178
+ type: "collapsible";
179
+ trigger: any[];
180
+ content: any[];
181
+ defaultOpen?: boolean;
182
+ }
183
+
184
+ // ============================================================================
185
+ // ADDITIONAL OVERLAY ATOMS
186
+ // ============================================================================
187
+
188
+ export interface SheetAtomType extends BaseAtom {
189
+ type: "sheet";
190
+ side?: "top" | "bottom" | "left" | "right";
191
+ title?: string;
192
+ description?: string;
193
+ trigger: any[];
194
+ children: any[];
195
+ footer?: any[];
196
+ }
197
+
198
+ export interface AlertDialogAtomType extends BaseAtom {
199
+ type: "alert-dialog";
200
+ title: string;
201
+ description?: string;
202
+ trigger: any[];
203
+ confirmLabel?: string;
204
+ cancelLabel?: string;
205
+ action?: string;
206
+ }
207
+
208
+ // ============================================================================
209
+ // NAVIGATION ATOMS
210
+ // ============================================================================
211
+
212
+ export interface BreadcrumbAtomType extends BaseAtom {
213
+ type: "breadcrumb";
214
+ items: Array<{
215
+ label: string;
216
+ href?: string;
217
+ isCurrent?: boolean;
218
+ }>;
219
+ }
220
+
221
+ // ============================================================================
222
+ // UTILITY ATOMS
223
+ // ============================================================================
224
+
225
+ export interface SkeletonAtomType extends BaseAtom {
226
+ type: "skeleton";
227
+ shape?: "rect" | "circle";
228
+ width?: string | number;
229
+ height?: string | number;
230
+ }
231
+
232
+ export interface SpinnerAtomType extends BaseAtom {
233
+ type: "spinner";
234
+ size?: "sm" | "md" | "lg" | "xl";
235
+ }
236
+
237
+ export interface CommandAtomType extends BaseAtom {
238
+ type: "command";
239
+ placeholder?: string;
240
+ groups: Array<{
241
+ heading?: string;
242
+ items: Array<{
243
+ label: string;
244
+ value: string;
245
+ icon?: string;
246
+ action?: string;
247
+ }>;
248
+ }>;
249
+ }
250
+
251
+ export interface PaginationAtomType extends BaseAtom {
252
+ type: "pagination";
253
+ currentPage: number;
254
+ totalPages: number;
255
+ hasNext?: boolean;
256
+ hasPrev?: boolean;
257
+ }
258
+
259
+ export interface CalendarAtomType extends BaseAtom {
260
+ type: "calendar";
261
+ mode?: "single" | "range" | "multiple";
262
+ selectedDate?: string | string[];
263
+ }
264
+
265
+ export type UIAtom =
266
+ | ButtonAtomType
267
+ | InputAtomType
268
+ | ToggleAtomType
269
+ | TextAtomType
270
+ | LayoutAtomType
271
+ | CardAtomType
272
+ | TabsAtomType
273
+ | AccordionAtomType
274
+ | SeparatorAtomType
275
+ | ScrollAreaAtomType
276
+ | AspectRatioAtomType
277
+ | CollapsibleAtomType
278
+ | AvatarAtomType
279
+ | BadgeAtomType
280
+ | ProgressAtomType
281
+ | TableAtomType
282
+ | CarouselAtomType
283
+ | AlertAtomType
284
+ | TooltipAtomType
285
+ | PopoverAtomType
286
+ | DialogAtomType
287
+ | SheetAtomType
288
+ | AlertDialogAtomType
289
+ | SkeletonAtomType
290
+ | SpinnerAtomType
291
+ | BreadcrumbAtomType
292
+ | CalendarAtomType
293
+ | PaginationAtomType
294
+ | CommandAtomType;