pxengine 0.1.11 → 0.1.13

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 (186) hide show
  1. package/dist/index.cjs +205 -120
  2. package/dist/index.d.cts +1 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +205 -120
  5. package/dist/registry.json +1200 -288
  6. package/package.json +9 -4
  7. package/config/tailwind-preset.js +0 -106
  8. package/src/atoms/AccordionAtom.tsx +0 -44
  9. package/src/atoms/AlertAtom.tsx +0 -46
  10. package/src/atoms/AlertDialogAtom.tsx +0 -66
  11. package/src/atoms/AspectRatioAtom.tsx +0 -27
  12. package/src/atoms/AvatarAtom.tsx +0 -20
  13. package/src/atoms/BadgeAtom.tsx +0 -33
  14. package/src/atoms/BreadcrumbAtom.tsx +0 -36
  15. package/src/atoms/ButtonAtom.tsx +0 -63
  16. package/src/atoms/CalendarAtom.tsx +0 -24
  17. package/src/atoms/CardAtom.tsx +0 -64
  18. package/src/atoms/CarouselAtom.tsx +0 -40
  19. package/src/atoms/ChartAtom.tsx +0 -190
  20. package/src/atoms/CheckboxAtom.tsx +0 -33
  21. package/src/atoms/CollapsibleAtom.tsx +0 -44
  22. package/src/atoms/CommandAtom.tsx +0 -46
  23. package/src/atoms/ContextMenuAtom.tsx +0 -49
  24. package/src/atoms/DialogAtom.tsx +0 -68
  25. package/src/atoms/DrawerAtom.tsx +0 -49
  26. package/src/atoms/DropdownMenuAtom.tsx +0 -49
  27. package/src/atoms/FormInputAtom.tsx +0 -101
  28. package/src/atoms/FormSelectAtom.tsx +0 -110
  29. package/src/atoms/FormTextareaAtom.tsx +0 -93
  30. package/src/atoms/InputAtom.tsx +0 -188
  31. package/src/atoms/InputOTPAtom.tsx +0 -49
  32. package/src/atoms/KbdAtom.tsx +0 -25
  33. package/src/atoms/LabelAtom.tsx +0 -23
  34. package/src/atoms/LayoutAtom.tsx +0 -45
  35. package/src/atoms/PaginationAtom.tsx +0 -49
  36. package/src/atoms/PopoverAtom.tsx +0 -40
  37. package/src/atoms/ProgressAtom.tsx +0 -15
  38. package/src/atoms/RadioGroupAtom.tsx +0 -31
  39. package/src/atoms/RatingAtom.tsx +0 -37
  40. package/src/atoms/ResizableAtom.tsx +0 -51
  41. package/src/atoms/ScrollAreaAtom.tsx +0 -31
  42. package/src/atoms/SeparatorAtom.tsx +0 -16
  43. package/src/atoms/SheetAtom.tsx +0 -72
  44. package/src/atoms/SkeletonAtom.tsx +0 -22
  45. package/src/atoms/SliderAtom.tsx +0 -32
  46. package/src/atoms/SpinnerAtom.tsx +0 -26
  47. package/src/atoms/SwitchAtom.tsx +0 -32
  48. package/src/atoms/TableAtom.tsx +0 -58
  49. package/src/atoms/TabsAtom.tsx +0 -40
  50. package/src/atoms/TextAtom.tsx +0 -35
  51. package/src/atoms/TextareaAtom.tsx +0 -42
  52. package/src/atoms/TimelineAtom.tsx +0 -77
  53. package/src/atoms/ToggleAtom.tsx +0 -36
  54. package/src/atoms/TooltipAtom.tsx +0 -39
  55. package/src/atoms/VideoAtom.tsx +0 -34
  56. package/src/atoms/index.ts +0 -49
  57. package/src/components/index.ts +0 -178
  58. package/src/components/ui/accordion.tsx +0 -56
  59. package/src/components/ui/alert-dialog.tsx +0 -139
  60. package/src/components/ui/alert.tsx +0 -59
  61. package/src/components/ui/aspect-ratio.tsx +0 -5
  62. package/src/components/ui/avatar.tsx +0 -50
  63. package/src/components/ui/badge.tsx +0 -36
  64. package/src/components/ui/breadcrumb.tsx +0 -115
  65. package/src/components/ui/button-group.tsx +0 -83
  66. package/src/components/ui/button.tsx +0 -56
  67. package/src/components/ui/calendar.tsx +0 -213
  68. package/src/components/ui/card.tsx +0 -79
  69. package/src/components/ui/carousel.tsx +0 -260
  70. package/src/components/ui/chart.tsx +0 -367
  71. package/src/components/ui/checkbox.tsx +0 -28
  72. package/src/components/ui/collapsible.tsx +0 -11
  73. package/src/components/ui/command.tsx +0 -153
  74. package/src/components/ui/context-menu.tsx +0 -198
  75. package/src/components/ui/dialog.tsx +0 -122
  76. package/src/components/ui/drawer.tsx +0 -116
  77. package/src/components/ui/dropdown-menu.tsx +0 -200
  78. package/src/components/ui/empty.tsx +0 -104
  79. package/src/components/ui/field.tsx +0 -244
  80. package/src/components/ui/form.tsx +0 -176
  81. package/src/components/ui/hover-card.tsx +0 -27
  82. package/src/components/ui/index.ts +0 -54
  83. package/src/components/ui/input-group.tsx +0 -168
  84. package/src/components/ui/input-otp.tsx +0 -69
  85. package/src/components/ui/input.tsx +0 -22
  86. package/src/components/ui/item.tsx +0 -193
  87. package/src/components/ui/kbd.tsx +0 -28
  88. package/src/components/ui/label.tsx +0 -26
  89. package/src/components/ui/menubar.tsx +0 -254
  90. package/src/components/ui/navigation-menu.tsx +0 -128
  91. package/src/components/ui/pagination.tsx +0 -117
  92. package/src/components/ui/popover.tsx +0 -29
  93. package/src/components/ui/progress.tsx +0 -28
  94. package/src/components/ui/radio-group.tsx +0 -42
  95. package/src/components/ui/resizable.tsx +0 -44
  96. package/src/components/ui/scroll-area.tsx +0 -46
  97. package/src/components/ui/select.tsx +0 -160
  98. package/src/components/ui/separator.tsx +0 -29
  99. package/src/components/ui/sheet.tsx +0 -140
  100. package/src/components/ui/sidebar.tsx +0 -771
  101. package/src/components/ui/skeleton.tsx +0 -15
  102. package/src/components/ui/slider.tsx +0 -26
  103. package/src/components/ui/sonner.tsx +0 -45
  104. package/src/components/ui/spinner.tsx +0 -16
  105. package/src/components/ui/switch.tsx +0 -27
  106. package/src/components/ui/table.tsx +0 -117
  107. package/src/components/ui/tabs.tsx +0 -53
  108. package/src/components/ui/textarea.tsx +0 -22
  109. package/src/components/ui/toggle-group.tsx +0 -61
  110. package/src/components/ui/toggle.tsx +0 -43
  111. package/src/components/ui/tooltip.tsx +0 -30
  112. package/src/hooks/use-mobile.tsx +0 -19
  113. package/src/index.ts +0 -24
  114. package/src/lib/countries.ts +0 -203
  115. package/src/lib/index.ts +0 -2
  116. package/src/lib/utils.ts +0 -15
  117. package/src/lib/validators/index.ts +0 -1
  118. package/src/lib/validators/theme.ts +0 -148
  119. package/src/molecules/creator-discovery/AudienceDemographicsCard/AudienceDemographicsCard.tsx +0 -44
  120. package/src/molecules/creator-discovery/AudienceDemographicsCard/index.ts +0 -1
  121. package/src/molecules/creator-discovery/AudienceMetricCard/AudienceMetricCard.tsx +0 -50
  122. package/src/molecules/creator-discovery/AudienceMetricCard/index.ts +0 -1
  123. package/src/molecules/creator-discovery/BrandAffinityGroup/BrandAffinityGroup.tsx +0 -36
  124. package/src/molecules/creator-discovery/BrandAffinityGroup/index.ts +0 -1
  125. package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx +0 -123
  126. package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.types.ts +0 -13
  127. package/src/molecules/creator-discovery/CampaignSeedCard/index.ts +0 -2
  128. package/src/molecules/creator-discovery/ContentPreviewGallery/ContentPreviewGallery.tsx +0 -41
  129. package/src/molecules/creator-discovery/ContentPreviewGallery/index.ts +0 -1
  130. package/src/molecules/creator-discovery/CreatorActionHeader/CreatorActionHeader.tsx +0 -77
  131. package/src/molecules/creator-discovery/CreatorActionHeader/index.ts +0 -1
  132. package/src/molecules/creator-discovery/CreatorGridCard/CreatorGridCard.tsx +0 -104
  133. package/src/molecules/creator-discovery/CreatorGridCard/index.ts +0 -1
  134. package/src/molecules/creator-discovery/CreatorProfileSummary/CreatorProfileSummary.tsx +0 -65
  135. package/src/molecules/creator-discovery/CreatorProfileSummary/index.ts +0 -1
  136. package/src/molecules/creator-discovery/GrowthChartCard/GrowthChartCard.tsx +0 -58
  137. package/src/molecules/creator-discovery/GrowthChartCard/index.ts +0 -1
  138. package/src/molecules/creator-discovery/MCQCard/MCQCard.tsx +0 -165
  139. package/src/molecules/creator-discovery/MCQCard/MCQCard.types.ts +0 -71
  140. package/src/molecules/creator-discovery/MCQCard/index.ts +0 -2
  141. package/src/molecules/creator-discovery/PlatformIconGroup/PlatformIconGroup.tsx +0 -72
  142. package/src/molecules/creator-discovery/PlatformIconGroup/index.ts +0 -1
  143. package/src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx +0 -334
  144. package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx +0 -111
  145. package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.types.ts +0 -18
  146. package/src/molecules/creator-discovery/SearchSpecCard/index.ts +0 -3
  147. package/src/molecules/creator-discovery/TopPostsGrid/TopPostsGrid.tsx +0 -49
  148. package/src/molecules/creator-discovery/TopPostsGrid/index.ts +0 -1
  149. package/src/molecules/creator-discovery/index.ts +0 -13
  150. package/src/molecules/generic/ActionButton/ActionButton.tsx +0 -137
  151. package/src/molecules/generic/ActionButton/ActionButton.types.ts +0 -68
  152. package/src/molecules/generic/ActionButton/index.ts +0 -2
  153. package/src/molecules/generic/DataGrid/DataGrid.tsx +0 -102
  154. package/src/molecules/generic/DataGrid/index.ts +0 -1
  155. package/src/molecules/generic/EditableField/EditableField.tsx +0 -229
  156. package/src/molecules/generic/EditableField/EditableField.types.ts +0 -73
  157. package/src/molecules/generic/EditableField/index.ts +0 -2
  158. package/src/molecules/generic/EmptyState/EmptyState.tsx +0 -61
  159. package/src/molecules/generic/EmptyState/index.ts +0 -1
  160. package/src/molecules/generic/FileUpload/FileUpload.tsx +0 -62
  161. package/src/molecules/generic/FileUpload/index.ts +0 -1
  162. package/src/molecules/generic/FilterBar/FilterBar.tsx +0 -54
  163. package/src/molecules/generic/FilterBar/index.ts +0 -1
  164. package/src/molecules/generic/FormCard/FormCard.tsx +0 -136
  165. package/src/molecules/generic/FormCard/FormCard.types.ts +0 -93
  166. package/src/molecules/generic/FormCard/index.ts +0 -2
  167. package/src/molecules/generic/LoadingOverlay/LoadingOverlay.tsx +0 -39
  168. package/src/molecules/generic/LoadingOverlay/index.ts +0 -1
  169. package/src/molecules/generic/NotificationList/NotificationList.tsx +0 -80
  170. package/src/molecules/generic/NotificationList/index.ts +0 -1
  171. package/src/molecules/generic/StatsGrid/StatsGrid.tsx +0 -80
  172. package/src/molecules/generic/StatsGrid/index.ts +0 -1
  173. package/src/molecules/generic/StepWizard/StepWizard.tsx +0 -67
  174. package/src/molecules/generic/StepWizard/index.ts +0 -1
  175. package/src/molecules/generic/TagCloud/TagCloud.tsx +0 -32
  176. package/src/molecules/generic/TagCloud/index.ts +0 -1
  177. package/src/molecules/generic/index.ts +0 -12
  178. package/src/molecules/index.ts +0 -2
  179. package/src/render/PXEngineRenderer.tsx +0 -416
  180. package/src/render/index.ts +0 -1
  181. package/src/styles/globals.css +0 -146
  182. package/src/types/atoms.ts +0 -449
  183. package/src/types/common.ts +0 -116
  184. package/src/types/index.ts +0 -3
  185. package/src/types/molecules.ts +0 -279
  186. package/src/types/schema.ts +0 -12
@@ -1,190 +0,0 @@
1
- import React from "react";
2
- import {
3
- ChartContainer,
4
- ChartTooltip,
5
- ChartTooltipContent,
6
- ChartLegend,
7
- ChartLegendContent,
8
- type ChartConfig,
9
- } from "@/components/ui/chart";
10
- import {
11
- Bar,
12
- BarChart,
13
- Line,
14
- LineChart,
15
- Area,
16
- AreaChart,
17
- Pie,
18
- PieChart,
19
- Radar,
20
- RadarChart,
21
- RadialBar,
22
- RadialBarChart,
23
- XAxis,
24
- CartesianGrid,
25
- PolarGrid,
26
- PolarAngleAxis,
27
- } from "recharts";
28
- import { ChartAtomType } from "../types/atoms";
29
- import { cn } from "@/lib/utils";
30
-
31
- /**
32
- * ChartAtom
33
- * A versatile chart component wrapping Shadcn Chart primitives and Recharts.
34
- */
35
- export const ChartAtom: React.FC<ChartAtomType> = ({
36
- chartType,
37
- data,
38
- config,
39
- XAxisKey,
40
- YAxisKey,
41
- showTooltip = true,
42
- showLegend = true,
43
- stacked = false,
44
- className,
45
- }) => {
46
- const renderChart = () => {
47
- switch (chartType) {
48
- case "bar":
49
- return (
50
- <BarChart data={data}>
51
- <CartesianGrid vertical={false} />
52
- <XAxis
53
- dataKey={XAxisKey}
54
- tickLine={false}
55
- tickMargin={10}
56
- axisLine={false}
57
- tickFormatter={(value) => value.toString().slice(0, 3)}
58
- />
59
- {showTooltip && (
60
- <ChartTooltip content={<ChartTooltipContent hideLabel />} />
61
- )}
62
- {showLegend && <ChartLegend content={<ChartLegendContent />} />}
63
- {Object.keys(config).map((key) => (
64
- <Bar
65
- key={key}
66
- dataKey={key}
67
- fill={`var(--color-${key})`}
68
- radius={8}
69
- stackId={stacked ? "a" : undefined}
70
- />
71
- ))}
72
- </BarChart>
73
- );
74
- case "line":
75
- return (
76
- <LineChart data={data}>
77
- <CartesianGrid vertical={false} />
78
- <XAxis
79
- dataKey={XAxisKey}
80
- tickLine={false}
81
- axisLine={false}
82
- tickMargin={8}
83
- tickFormatter={(value) => value.toString().slice(0, 3)}
84
- />
85
- {showTooltip && (
86
- <ChartTooltip content={<ChartTooltipContent hideLabel />} />
87
- )}
88
- {Object.keys(config).map((key) => (
89
- <Line
90
- key={key}
91
- dataKey={key}
92
- type="natural"
93
- stroke={`var(--color-${key})`}
94
- strokeWidth={2}
95
- dot={false}
96
- />
97
- ))}
98
- </LineChart>
99
- );
100
- case "area":
101
- return (
102
- <AreaChart data={data}>
103
- <CartesianGrid vertical={false} />
104
- <XAxis
105
- dataKey={XAxisKey}
106
- tickLine={false}
107
- axisLine={false}
108
- tickMargin={8}
109
- tickFormatter={(value) => value.toString().slice(0, 3)}
110
- />
111
- {showTooltip && (
112
- <ChartTooltip content={<ChartTooltipContent hideLabel />} />
113
- )}
114
- {Object.keys(config).map((key) => (
115
- <Area
116
- key={key}
117
- dataKey={key}
118
- type="natural"
119
- fill={`var(--color-${key})`}
120
- fillOpacity={0.4}
121
- stroke={`var(--color-${key})`}
122
- stackId={stacked ? "a" : undefined}
123
- />
124
- ))}
125
- </AreaChart>
126
- );
127
- case "pie":
128
- return (
129
- <PieChart>
130
- {showTooltip && (
131
- <ChartTooltip content={<ChartTooltipContent hideLabel />} />
132
- )}
133
- <Pie
134
- data={data}
135
- dataKey={YAxisKey || "value"}
136
- nameKey={XAxisKey || "name"}
137
- innerRadius={60}
138
- strokeWidth={5}
139
- />
140
- </PieChart>
141
- );
142
- case "radar":
143
- return (
144
- <RadarChart data={data}>
145
- {showTooltip && (
146
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
147
- )}
148
- <PolarGrid />
149
- <PolarAngleAxis dataKey={XAxisKey} />
150
- {Object.keys(config).map((key) => (
151
- <Radar
152
- key={key}
153
- dataKey={key}
154
- fill={`var(--color-${key})`}
155
- fillOpacity={0.6}
156
- />
157
- ))}
158
- </RadarChart>
159
- );
160
- case "radial":
161
- return (
162
- <RadialBarChart
163
- data={data}
164
- innerRadius={30}
165
- outerRadius={110}
166
- barSize={10}
167
- >
168
- {showTooltip && (
169
- <ChartTooltip
170
- cursor={false}
171
- content={<ChartTooltipContent hideLabel nameKey={XAxisKey} />}
172
- />
173
- )}
174
- <RadialBar dataKey={YAxisKey || "value"} background />
175
- </RadialBarChart>
176
- );
177
- default:
178
- return null;
179
- }
180
- };
181
-
182
- return (
183
- <ChartContainer
184
- config={config as ChartConfig}
185
- className={cn("min-h-[200px] w-full", className)}
186
- >
187
- {renderChart() as React.ReactElement}
188
- </ChartContainer>
189
- );
190
- };
@@ -1,33 +0,0 @@
1
- import React from "react";
2
- import { Checkbox } from "@/components/ui/checkbox";
3
- import { CheckboxAtomType } from "../types/atoms";
4
- import { Label } from "@/components/ui/label";
5
- import { cn } from "@/lib/utils";
6
-
7
- /**
8
- * CheckboxAtom
9
- * Wraps shadcn Checkbox with label support
10
- */
11
- export const CheckboxAtom: React.FC<
12
- CheckboxAtomType & { onCheckedChange?: (checked: boolean) => void }
13
- > = ({ id, label, checked, disabled, className, onCheckedChange }) => {
14
- return (
15
- <div className={cn("flex items-center space-x-2", className)}>
16
- <Checkbox
17
- id={id}
18
- checked={checked}
19
- disabled={disabled}
20
- onCheckedChange={onCheckedChange}
21
- className="rounded border-purple-300 text-purple-600 focus:ring-purple-500"
22
- />
23
- {label && (
24
- <Label
25
- htmlFor={id}
26
- className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer"
27
- >
28
- {label}
29
- </Label>
30
- )}
31
- </div>
32
- );
33
- };
@@ -1,44 +0,0 @@
1
- import React from "react";
2
- import {
3
- Collapsible,
4
- CollapsibleContent,
5
- CollapsibleTrigger,
6
- } from "@/components/ui/collapsible";
7
- import { CollapsibleAtomType, UIComponent } from "../types/schema";
8
- import { cn } from "@/lib/utils";
9
-
10
- interface Props extends CollapsibleAtomType {
11
- renderComponent: (component: UIComponent) => React.ReactNode;
12
- }
13
-
14
- export const CollapsibleAtom: React.FC<Props> = ({
15
- trigger,
16
- content,
17
- defaultOpen = false,
18
- className,
19
- renderComponent,
20
- }) => {
21
- return (
22
- <Collapsible
23
- defaultOpen={defaultOpen}
24
- className={cn("w-full space-y-2", className)}
25
- >
26
- <CollapsibleTrigger asChild>
27
- <div className="flex items-center justify-between space-x-4 px-4 py-2 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors">
28
- {trigger.map((child) => (
29
- <React.Fragment key={child.id}>
30
- {renderComponent(child)}
31
- </React.Fragment>
32
- ))}
33
- </div>
34
- </CollapsibleTrigger>
35
- <CollapsibleContent className="space-y-2">
36
- {content.map((child) => (
37
- <React.Fragment key={child.id}>
38
- {renderComponent(child)}
39
- </React.Fragment>
40
- ))}
41
- </CollapsibleContent>
42
- </Collapsible>
43
- );
44
- };
@@ -1,46 +0,0 @@
1
- import React from "react";
2
- import {
3
- Command,
4
- CommandEmpty,
5
- CommandGroup,
6
- CommandInput,
7
- CommandItem,
8
- CommandList,
9
- CommandSeparator,
10
- } from "@/components/ui/command";
11
- import { CommandAtomType } from "../types/schema";
12
- import { cn } from "@/lib/utils";
13
-
14
- export const CommandAtom: React.FC<CommandAtomType> = ({
15
- placeholder = "Search...",
16
- groups,
17
- className,
18
- }) => {
19
- return (
20
- <div
21
- className={cn(
22
- "rounded-2xl border border-gray-100 shadow-lg overflow-hidden bg-white max-w-[400px]",
23
- className,
24
- )}
25
- >
26
- <Command>
27
- <CommandInput placeholder={placeholder} />
28
- <CommandList>
29
- <CommandEmpty>No results found.</CommandEmpty>
30
- {groups.map((group, i) => (
31
- <React.Fragment key={i}>
32
- <CommandGroup heading={group.heading}>
33
- {group.items.map((item, j) => (
34
- <CommandItem key={j} value={item.value}>
35
- <span>{item.label}</span>
36
- </CommandItem>
37
- ))}
38
- </CommandGroup>
39
- {i < groups.length - 1 && <CommandSeparator />}
40
- </React.Fragment>
41
- ))}
42
- </CommandList>
43
- </Command>
44
- </div>
45
- );
46
- };
@@ -1,49 +0,0 @@
1
- import React from "react";
2
- import {
3
- ContextMenu,
4
- ContextMenuContent,
5
- ContextMenuItem,
6
- ContextMenuTrigger,
7
- } from "@/components/ui/context-menu";
8
- import { ContextMenuAtomType } from "../types/atoms";
9
- import { cn } from "@/lib/utils";
10
- import * as Icons from "lucide-react";
11
-
12
- /**
13
- * ContextMenuAtom
14
- * Wraps shadcn ContextMenu
15
- */
16
- export const ContextMenuAtom: React.FC<
17
- ContextMenuAtomType & { onAction?: (action: string) => void }
18
- > = ({ trigger, items, className, onAction }) => {
19
- return (
20
- <ContextMenu>
21
- <ContextMenuTrigger asChild>{trigger}</ContextMenuTrigger>
22
- <ContextMenuContent
23
- className={cn(
24
- "w-64 bg-white/80 backdrop-blur-md border-purple-100",
25
- className,
26
- )}
27
- >
28
- {items.map((item) => {
29
- const Icon = item.icon ? (Icons as any)[item.icon] : null;
30
- return (
31
- <ContextMenuItem
32
- key={item.value}
33
- disabled={item.disabled}
34
- onClick={() => item.action && onAction?.(item.action)}
35
- className={cn(
36
- "flex items-center gap-2 cursor-pointer focus:bg-purple-50",
37
- item.isDestructive &&
38
- "text-red-600 focus:text-red-700 focus:bg-red-50",
39
- )}
40
- >
41
- {Icon && <Icon className="w-4 h-4" />}
42
- <span>{item.label}</span>
43
- </ContextMenuItem>
44
- );
45
- })}
46
- </ContextMenuContent>
47
- </ContextMenu>
48
- );
49
- };
@@ -1,68 +0,0 @@
1
- import React from "react";
2
- import {
3
- Dialog,
4
- DialogContent,
5
- DialogDescription,
6
- DialogHeader,
7
- DialogTitle,
8
- DialogTrigger,
9
- DialogFooter,
10
- } from "@/components/ui/dialog";
11
- import { DialogAtomType, UIComponent } from "../types/schema";
12
- import { cn } from "@/lib/utils";
13
-
14
- interface Props extends DialogAtomType {
15
- renderComponent: (component: UIComponent) => React.ReactNode;
16
- }
17
-
18
- export const DialogAtom: React.FC<Props> = ({
19
- title,
20
- description,
21
- trigger,
22
- children,
23
- footer,
24
- className,
25
- renderComponent,
26
- }) => {
27
- return (
28
- <Dialog>
29
- <DialogTrigger asChild>
30
- <div className={cn("inline-block cursor-pointer", className)}>
31
- {trigger.map((child) => (
32
- <React.Fragment key={child.id}>
33
- {renderComponent(child)}
34
- </React.Fragment>
35
- ))}
36
- </div>
37
- </DialogTrigger>
38
- <DialogContent className="sm:max-w-[425px] rounded-3xl p-6 bg-white/95 backdrop-blur-md shadow-3xl border-gray-100">
39
- <DialogHeader>
40
- <DialogTitle className="text-xl font-bold bg-gradient-to-r from-purple600 to-indigo-600 bg-clip-text text-transparent">
41
- {title}
42
- </DialogTitle>
43
- {description && (
44
- <DialogDescription className="text-gray-500 font-medium pt-1">
45
- {description}
46
- </DialogDescription>
47
- )}
48
- </DialogHeader>
49
- <div className="py-4">
50
- {children.map((child) => (
51
- <React.Fragment key={child.id}>
52
- {renderComponent(child)}
53
- </React.Fragment>
54
- ))}
55
- </div>
56
- {footer && (
57
- <DialogFooter className="pt-2">
58
- {footer.map((child) => (
59
- <React.Fragment key={child.id}>
60
- {renderComponent(child)}
61
- </React.Fragment>
62
- ))}
63
- </DialogFooter>
64
- )}
65
- </DialogContent>
66
- </Dialog>
67
- );
68
- };
@@ -1,49 +0,0 @@
1
- import React from "react";
2
- import {
3
- Drawer,
4
- DrawerContent,
5
- DrawerDescription,
6
- DrawerHeader,
7
- DrawerTitle,
8
- DrawerTrigger,
9
- } from "@/components/ui/drawer";
10
- import { DrawerAtomType } from "../types/atoms";
11
- import { cn } from "@/lib/utils";
12
-
13
- /**
14
- * DrawerAtom
15
- * Wraps shadcn Drawer for mobile-first views
16
- */
17
- export const DrawerAtom: React.FC<DrawerAtomType> = ({
18
- title,
19
- description,
20
- trigger,
21
- children,
22
- className,
23
- }) => {
24
- return (
25
- <Drawer>
26
- <DrawerTrigger asChild>{trigger}</DrawerTrigger>
27
- <DrawerContent
28
- className={cn(
29
- "bg-white/95 backdrop-blur-xl border-t border-purple-100",
30
- className,
31
- )}
32
- >
33
- <div className="mx-auto w-full max-w-sm">
34
- {(title || description) && (
35
- <DrawerHeader>
36
- {title && (
37
- <DrawerTitle className="text-purple-900">{title}</DrawerTitle>
38
- )}
39
- {description && (
40
- <DrawerDescription>{description}</DrawerDescription>
41
- )}
42
- </DrawerHeader>
43
- )}
44
- <div className="p-4 pb-8">{children}</div>
45
- </div>
46
- </DrawerContent>
47
- </Drawer>
48
- );
49
- };
@@ -1,49 +0,0 @@
1
- import React from "react";
2
- import {
3
- DropdownMenu,
4
- DropdownMenuContent,
5
- DropdownMenuItem,
6
- DropdownMenuTrigger,
7
- } from "@/components/ui/dropdown-menu";
8
- import { DropdownMenuAtomType } from "../types/atoms";
9
- import { cn } from "@/lib/utils";
10
- import * as Icons from "lucide-react";
11
-
12
- /**
13
- * DropdownMenuAtom
14
- * Wraps shadcn DropdownMenu
15
- */
16
- export const DropdownMenuAtom: React.FC<
17
- DropdownMenuAtomType & { onAction?: (action: string) => void }
18
- > = ({ trigger, items, className, onAction }) => {
19
- return (
20
- <DropdownMenu>
21
- <DropdownMenuTrigger asChild>{trigger}</DropdownMenuTrigger>
22
- <DropdownMenuContent
23
- className={cn(
24
- "w-56 bg-white/80 backdrop-blur-md border-purple-100",
25
- className,
26
- )}
27
- >
28
- {items.map((item) => {
29
- const Icon = item.icon ? (Icons as any)[item.icon] : null;
30
- return (
31
- <DropdownMenuItem
32
- key={item.value}
33
- disabled={item.disabled}
34
- onClick={() => item.action && onAction?.(item.action)}
35
- className={cn(
36
- "flex items-center gap-2 cursor-pointer focus:bg-purple-50",
37
- item.isDestructive &&
38
- "text-red-600 focus:text-red-700 focus:bg-red-50",
39
- )}
40
- >
41
- {Icon && <Icon className="w-4 h-4" />}
42
- <span>{item.label}</span>
43
- </DropdownMenuItem>
44
- );
45
- })}
46
- </DropdownMenuContent>
47
- </DropdownMenu>
48
- );
49
- };
@@ -1,101 +0,0 @@
1
- import React from "react";
2
- import {
3
- Form,
4
- FormField,
5
- FormItem,
6
- FormLabel,
7
- FormControl,
8
- FormDescription,
9
- FormMessage,
10
- } from "@/components/ui/form";
11
- import { Input } from "@/components/ui/input";
12
- import { useForm } from "react-hook-form";
13
- import { cn } from "@/lib/utils";
14
-
15
- export interface FormInputAtomType {
16
- type: "FormInput";
17
- name: string;
18
- label?: string;
19
- placeholder?: string;
20
- description?: string;
21
- defaultValue?: string;
22
- required?: boolean;
23
- inputType?:
24
- | "text"
25
- | "email"
26
- | "password"
27
- | "number"
28
- | "tel"
29
- | "url"
30
- | "date"
31
- | "time";
32
- className?: string;
33
- id?: string;
34
- }
35
-
36
- interface FormInputAtomProps extends Omit<FormInputAtomType, "type"> {
37
- renderComponent?: any;
38
- children?: any;
39
- }
40
-
41
- /**
42
- * FormInputAtom
43
- *
44
- * Self-contained form input component that properly wraps FormField, FormItem, FormLabel, and FormControl.
45
- * This component provides the necessary React Context for form components to work correctly.
46
- *
47
- * Features:
48
- * - Handles all form context requirements internally
49
- * - Supports various input types (text, email, password, etc.)
50
- * - Includes validation support through react-hook-form
51
- * - Schema-safe for dynamic rendering via PXEngineRenderer
52
- */
53
- export const FormInputAtom: React.FC<FormInputAtomProps> = ({
54
- name,
55
- label,
56
- placeholder,
57
- description,
58
- defaultValue = "",
59
- required = false,
60
- inputType = "text",
61
- className,
62
- id,
63
- }) => {
64
- // Safe fallback for name to prevent RHF crash
65
- const fieldName =
66
- name || id || `input-${Math.random().toString(36).substring(2, 9)}`;
67
-
68
- // Create a local form context for this field
69
- const form = useForm({
70
- defaultValues: {
71
- [fieldName]: defaultValue,
72
- },
73
- });
74
-
75
- return (
76
- <Form {...form}>
77
- <FormField
78
- control={form.control}
79
- name={fieldName}
80
- rules={{
81
- required: required ? `${label || name} is required` : undefined,
82
- }}
83
- render={({ field }) => (
84
- <FormItem className={cn("w-full", className)}>
85
- {label && <FormLabel>{label}</FormLabel>}
86
- <FormControl>
87
- <Input
88
- type={inputType}
89
- placeholder={placeholder}
90
- id={id || `form-input-${name}`}
91
- {...field}
92
- />
93
- </FormControl>
94
- {description && <FormDescription>{description}</FormDescription>}
95
- <FormMessage />
96
- </FormItem>
97
- )}
98
- />
99
- </Form>
100
- );
101
- };