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,37 +0,0 @@
1
- import React from "react";
2
- import { Star } from "lucide-react";
3
- import { RatingAtomType } from "../types/atoms";
4
- import { cn } from "@/lib/utils";
5
-
6
- /**
7
- * RatingAtom
8
- * A star rating component for display or user input.
9
- */
10
- export const RatingAtom: React.FC<
11
- RatingAtomType & { onChange?: (val: number) => void }
12
- > = ({ value, max = 5, readonly = false, className, onChange }) => {
13
- const [hoverValue, setHoverValue] = React.useState<number | null>(null);
14
-
15
- return (
16
- <div className={cn("flex items-center gap-1", className)}>
17
- {Array.from({ length: max }, (_, i) => {
18
- const starValue = i + 1;
19
- const isActive = (hoverValue ?? value) >= starValue;
20
-
21
- return (
22
- <Star
23
- key={i}
24
- className={cn(
25
- "h-5 w-5 transition-colors",
26
- isActive ? "fill-yellow-400 text-yellow-400" : "text-gray-300",
27
- !readonly && "cursor-pointer hover:scale-110",
28
- )}
29
- onClick={() => !readonly && onChange?.(starValue)}
30
- onMouseEnter={() => !readonly && setHoverValue(starValue)}
31
- onMouseLeave={() => !readonly && setHoverValue(null)}
32
- />
33
- );
34
- })}
35
- </div>
36
- );
37
- };
@@ -1,51 +0,0 @@
1
- import React from "react";
2
- import {
3
- ResizableHandle,
4
- ResizablePanel,
5
- ResizablePanelGroup,
6
- } from "@/components/ui/resizable";
7
- import { ResizableAtomType, UIComponent } from "../types/schema";
8
- import { cn } from "@/lib/utils";
9
-
10
- interface Props extends ResizableAtomType {
11
- renderComponent: (component: UIComponent, index?: number) => React.ReactNode;
12
- }
13
-
14
- /**
15
- * ResizableAtom
16
- * Wraps shadcn Resizable panels for complex layouts
17
- */
18
- export const ResizableAtom: React.FC<Props> = ({
19
- direction,
20
- panels,
21
- className,
22
- renderComponent,
23
- }) => {
24
- // Use a locally typed component to bypass DTS inference issues
25
- const Group = ResizablePanelGroup as any;
26
-
27
- return (
28
- <Group
29
- direction={direction}
30
- className={cn(
31
- "min-h-[200px] w-full rounded-lg border border-purple-100",
32
- className,
33
- )}
34
- >
35
- {panels.map((panel: any, i: number) => (
36
- <React.Fragment key={i}>
37
- <ResizablePanel defaultSize={panel.defaultSize} className="p-4">
38
- {panel.children.map((child: any, childIdx: number) => (
39
- <React.Fragment
40
- key={child.id || `resizable-child-${i}-${childIdx}`}
41
- >
42
- {renderComponent(child)}
43
- </React.Fragment>
44
- ))}
45
- </ResizablePanel>
46
- {i < panels.length - 1 && <ResizableHandle withHandle />}
47
- </React.Fragment>
48
- ))}
49
- </Group>
50
- );
51
- };
@@ -1,31 +0,0 @@
1
- import React from "react";
2
- import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
3
- import { ScrollAreaAtomType, UIComponent } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
-
6
- interface Props extends ScrollAreaAtomType {
7
- renderComponent: (component: UIComponent) => React.ReactNode;
8
- }
9
-
10
- export const ScrollAreaAtom: React.FC<Props> = ({
11
- maxHeight = "300px",
12
- children,
13
- className,
14
- renderComponent,
15
- }) => {
16
- return (
17
- <ScrollArea
18
- className={cn("rounded-xl border", className)}
19
- style={{ height: maxHeight }}
20
- >
21
- <div className="p-4">
22
- {children.map((child) => (
23
- <React.Fragment key={child.id}>
24
- {renderComponent(child)}
25
- </React.Fragment>
26
- ))}
27
- </div>
28
- <ScrollBar orientation="vertical" />
29
- </ScrollArea>
30
- );
31
- };
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { Separator } from "@/components/ui/separator";
3
- import { SeparatorAtomType } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
-
6
- export const SeparatorAtom: React.FC<SeparatorAtomType> = ({
7
- orientation = "horizontal",
8
- className,
9
- }) => {
10
- return (
11
- <Separator
12
- orientation={orientation}
13
- className={cn("bg-gray-100", className)}
14
- />
15
- );
16
- };
@@ -1,72 +0,0 @@
1
- import React from "react";
2
- import {
3
- Sheet,
4
- SheetContent,
5
- SheetDescription,
6
- SheetHeader,
7
- SheetTitle,
8
- SheetTrigger,
9
- SheetFooter,
10
- } from "@/components/ui/sheet";
11
- import { SheetAtomType, UIComponent } from "../types/schema";
12
- import { cn } from "@/lib/utils";
13
-
14
- interface Props extends SheetAtomType {
15
- renderComponent: (component: UIComponent) => React.ReactNode;
16
- }
17
-
18
- export const SheetAtom: React.FC<Props> = ({
19
- side = "right",
20
- title,
21
- description,
22
- trigger,
23
- children,
24
- footer,
25
- className,
26
- renderComponent,
27
- }) => {
28
- return (
29
- <Sheet>
30
- <SheetTrigger asChild>
31
- <div className={cn("inline-block cursor-pointer", className)}>
32
- {trigger.map((child) => (
33
- <React.Fragment key={child.id}>
34
- {renderComponent(child)}
35
- </React.Fragment>
36
- ))}
37
- </div>
38
- </SheetTrigger>
39
- <SheetContent
40
- side={side}
41
- className="bg-white/95 backdrop-blur-md border-l-gray-100 shadow-2xl p-6"
42
- >
43
- <SheetHeader>
44
- <SheetTitle className="text-xl font-bold text-gray-900">
45
- {title}
46
- </SheetTitle>
47
- {description && (
48
- <SheetDescription className="text-gray-500 font-medium">
49
- {description}
50
- </SheetDescription>
51
- )}
52
- </SheetHeader>
53
- <div className="py-8">
54
- {children.map((child) => (
55
- <React.Fragment key={child.id}>
56
- {renderComponent(child)}
57
- </React.Fragment>
58
- ))}
59
- </div>
60
- {footer && (
61
- <SheetFooter className="absolute bottom-6 left-6 right-6">
62
- {footer.map((child) => (
63
- <React.Fragment key={child.id}>
64
- {renderComponent(child)}
65
- </React.Fragment>
66
- ))}
67
- </SheetFooter>
68
- )}
69
- </SheetContent>
70
- </Sheet>
71
- );
72
- };
@@ -1,22 +0,0 @@
1
- import React from "react";
2
- import { Skeleton } from "@/components/ui/skeleton";
3
- import { SkeletonAtomType } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
-
6
- export const SkeletonAtom: React.FC<SkeletonAtomType> = ({
7
- shape = "rect",
8
- width,
9
- height,
10
- className,
11
- }) => {
12
- return (
13
- <Skeleton
14
- className={cn(
15
- shape === "circle" ? "rounded-full" : "rounded-md",
16
- "bg-gray-100",
17
- className,
18
- )}
19
- style={{ width, height }}
20
- />
21
- );
22
- };
@@ -1,32 +0,0 @@
1
- import React from "react";
2
- import { Slider } from "@/components/ui/slider";
3
- import { SliderAtomType } from "../types/atoms";
4
- import { cn } from "@/lib/utils";
5
-
6
- /**
7
- * SliderAtom
8
- * Wraps shadcn Slider
9
- */
10
- export const SliderAtom: React.FC<
11
- SliderAtomType & { onValueChange?: (value: number[]) => void }
12
- > = ({
13
- defaultValue = [50],
14
- max = 100,
15
- min = 0,
16
- step = 1,
17
- disabled,
18
- className,
19
- onValueChange,
20
- }) => {
21
- return (
22
- <Slider
23
- defaultValue={defaultValue}
24
- max={max}
25
- min={min}
26
- step={step}
27
- disabled={disabled}
28
- onValueChange={onValueChange}
29
- className={cn("w-full py-4", className)}
30
- />
31
- );
32
- };
@@ -1,26 +0,0 @@
1
- import React from "react";
2
- import { Loader2 } from "lucide-react";
3
- import { SpinnerAtomType } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
-
6
- export const SpinnerAtom: React.FC<SpinnerAtomType> = ({
7
- size = "md",
8
- className,
9
- }) => {
10
- const sizeMap = {
11
- sm: "h-4 w-4",
12
- md: "h-6 w-6",
13
- lg: "h-8 w-8",
14
- xl: "h-12 w-12",
15
- };
16
-
17
- return (
18
- <Loader2
19
- className={cn(
20
- "animate-spin text-purple500",
21
- sizeMap[size] || sizeMap.md,
22
- className,
23
- )}
24
- />
25
- );
26
- };
@@ -1,32 +0,0 @@
1
- import React from "react";
2
- import { Switch } from "@/components/ui/switch";
3
- import { SwitchAtomType } from "../types/atoms";
4
- import { Label } from "@/components/ui/label";
5
- import { cn } from "@/lib/utils";
6
-
7
- /**
8
- * SwitchAtom
9
- * Wraps shadcn Switch with label support
10
- */
11
- export const SwitchAtom: React.FC<
12
- SwitchAtomType & { 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
- <Switch
17
- id={id}
18
- checked={checked}
19
- disabled={disabled}
20
- onCheckedChange={onCheckedChange}
21
- />
22
- {label && (
23
- <Label
24
- htmlFor={id}
25
- className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer"
26
- >
27
- {label}
28
- </Label>
29
- )}
30
- </div>
31
- );
32
- };
@@ -1,58 +0,0 @@
1
- import React from "react";
2
- import {
3
- Table,
4
- TableBody,
5
- TableCell,
6
- TableHead,
7
- TableHeader,
8
- TableRow,
9
- } from "@/components/ui/table";
10
- import { TableAtomType } from "../types/schema";
11
- import { cn } from "@/lib/utils";
12
-
13
- export const TableAtom: React.FC<TableAtomType> = ({
14
- headers,
15
- rows,
16
- className,
17
- }) => {
18
- return (
19
- <div
20
- className={cn(
21
- "rounded-2xl border border-gray-100 overflow-hidden bg-white",
22
- className,
23
- )}
24
- >
25
- <Table>
26
- <TableHeader className="bg-gray-50/50">
27
- <TableRow>
28
- {headers.map((header, i) => (
29
- <TableHead
30
- key={i}
31
- className="text-xs font-bold text-gray-400 uppercase tracking-widest px-6 py-4"
32
- >
33
- {header}
34
- </TableHead>
35
- ))}
36
- </TableRow>
37
- </TableHeader>
38
- <TableBody>
39
- {rows.map((row, i) => (
40
- <TableRow
41
- key={i}
42
- className="hover:bg-purple-50/30 transition-colors border-gray-50"
43
- >
44
- {row.map((cell, j) => (
45
- <TableCell
46
- key={j}
47
- className="text-sm text-gray-700 px-6 py-4 font-medium"
48
- >
49
- {cell}
50
- </TableCell>
51
- ))}
52
- </TableRow>
53
- ))}
54
- </TableBody>
55
- </Table>
56
- </div>
57
- );
58
- };
@@ -1,40 +0,0 @@
1
- import React from "react";
2
- import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
3
- import { TabsAtomType, UIComponent } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
-
6
- interface Props extends TabsAtomType {
7
- renderComponent: (component: UIComponent) => React.ReactNode;
8
- }
9
-
10
- export const TabsAtom: React.FC<Props> = ({
11
- defaultValue,
12
- tabs,
13
- className,
14
- renderComponent,
15
- }) => {
16
- return (
17
- <Tabs defaultValue={defaultValue} className={cn("w-full", className)}>
18
- <TabsList className="bg-gray-100/50 p-1 rounded-xl">
19
- {tabs.map((tab) => (
20
- <TabsTrigger
21
- key={tab.value}
22
- value={tab.value}
23
- className="rounded-lg data-[state=active]:bg-white data-[state=active]:shadow-sm"
24
- >
25
- {tab.label}
26
- </TabsTrigger>
27
- ))}
28
- </TabsList>
29
- {tabs.map((tab) => (
30
- <TabsContent key={tab.value} value={tab.value} className="mt-4">
31
- {tab.content.map((child) => (
32
- <React.Fragment key={child.id}>
33
- {renderComponent(child)}
34
- </React.Fragment>
35
- ))}
36
- </TabsContent>
37
- ))}
38
- </Tabs>
39
- );
40
- };
@@ -1,35 +0,0 @@
1
- import React from "react";
2
- import { TextAtomType } from "../types/schema";
3
- import { cn } from "@/lib/utils";
4
-
5
- /**
6
- * TextAtom
7
- * Renders standardized text styles from UISchema
8
- */
9
- export const TextAtom: React.FC<TextAtomType> = ({
10
- content,
11
- variant = "p",
12
- className,
13
- }) => {
14
- const baseStyles: Record<string, string> = {
15
- h1: "scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl text-gray900",
16
- h2: "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0 text-gray900",
17
- h3: "scroll-m-20 text-2xl font-semibold tracking-tight text-gray900",
18
- h4: "scroll-m-20 text-xl font-semibold tracking-tight text-gray900",
19
- p: "leading-7 [&:not(:first-child)]:mt-6 text-gray700",
20
- small: "text-sm font-medium leading-none text-gray600",
21
- muted: "text-sm text-muted-foreground",
22
- label: "text-[10px] font-bold text-gray400 uppercase tracking-widest pl-1",
23
- };
24
-
25
- const Component =
26
- variant === "small" || variant === "muted" || variant === "label"
27
- ? "p"
28
- : variant;
29
-
30
- return (
31
- <Component className={cn(baseStyles[variant], className)}>
32
- {content}
33
- </Component>
34
- );
35
- };
@@ -1,42 +0,0 @@
1
- import React from "react";
2
- import { Textarea } from "@/components/ui/textarea";
3
- import { InputAtomType } from "../types/atoms";
4
- import { Label } from "@/components/ui/label";
5
- import { cn } from "@/lib/utils";
6
-
7
- /**
8
- * TextareaAtom
9
- * Standalone textarea atom
10
- */
11
- export const TextareaAtom: React.FC<
12
- InputAtomType & { onChange?: (val: string) => void }
13
- > = ({
14
- id,
15
- label,
16
- placeholder,
17
- defaultValue,
18
- disabled,
19
- required,
20
- className,
21
- onChange,
22
- }) => {
23
- return (
24
- <div className={cn("grid w-full gap-1.5", className)}>
25
- {label && (
26
- <Label htmlFor={id} className="font-semibold">
27
- {label}
28
- {required && <span className="text-red-500 ml-1">*</span>}
29
- </Label>
30
- )}
31
- <Textarea
32
- id={id}
33
- placeholder={placeholder}
34
- defaultValue={defaultValue}
35
- disabled={disabled}
36
- required={required}
37
- onChange={(e) => onChange?.(e.target.value)}
38
- className="min-h-[100px] border-purple-100 focus-visible:ring-purple-500 resize-none shadow-sm"
39
- />
40
- </div>
41
- );
42
- };
@@ -1,77 +0,0 @@
1
- import React from "react";
2
- import { TimelineAtomType } from "../types/atoms";
3
- import { cn } from "@/lib/utils";
4
- import * as Icons from "lucide-react";
5
-
6
- /**
7
- * TimelineAtom
8
- * A vertical timeline primitive for processes and steps.
9
- */
10
- export const TimelineAtom: React.FC<TimelineAtomType> = ({
11
- items,
12
- className,
13
- }) => {
14
- return (
15
- <div
16
- className={cn(
17
- "space-y-6 relative before:absolute before:inset-0 before:ml-5 before:-translate-x-px before:h-full before:w-0.5 before:bg-gradient-to-b before:from-purple-500 before:via-indigo-500 before:to-gray-200 before:pointer-events-none",
18
- className,
19
- )}
20
- >
21
- {items.map((item, i) => {
22
- const Icon = item.icon ? (Icons as any)[item.icon] : null;
23
- const isCompleted = item.status === "completed";
24
- const isActive = item.status === "active";
25
-
26
- return (
27
- <div key={i} className="relative flex items-start gap-6 group">
28
- <div
29
- className={cn(
30
- "flex items-center justify-center w-10 h-10 rounded-full border-4 border-white shadow-sm shrink-0 z-10 transition-all group-hover:scale-110",
31
- isCompleted
32
- ? "bg-purple-600 text-white"
33
- : isActive
34
- ? "bg-indigo-600 text-white ring-4 ring-indigo-50"
35
- : "bg-gray-100 text-gray-400",
36
- )}
37
- >
38
- {Icon ? (
39
- <Icon className="w-5 h-5" />
40
- ) : isCompleted ? (
41
- <Icons.Check className="w-5 h-5" />
42
- ) : (
43
- <div className="w-2 h-2 rounded-full bg-current" />
44
- )}
45
- </div>
46
- <div className="flex flex-col gap-1 pt-0.5">
47
- <div className="flex items-center gap-2">
48
- <h4
49
- className={cn(
50
- "font-bold text-sm",
51
- isCompleted
52
- ? "text-gray-900"
53
- : isActive
54
- ? "text-indigo-600"
55
- : "text-gray-500",
56
- )}
57
- >
58
- {item.title}
59
- </h4>
60
- {item.timestamp && (
61
- <span className="text-[10px] text-muted-foreground bg-gray-50 px-1.5 py-0.5 rounded-md font-medium border border-gray-100">
62
- {item.timestamp}
63
- </span>
64
- )}
65
- </div>
66
- {item.description && (
67
- <p className="text-xs text-muted-foreground leading-relaxed max-w-sm">
68
- {item.description}
69
- </p>
70
- )}
71
- </div>
72
- </div>
73
- );
74
- })}
75
- </div>
76
- );
77
- };
@@ -1,36 +0,0 @@
1
- import React from "react";
2
- import { Toggle } from "@/components/ui/toggle";
3
- import { ToggleAtomType } from "../types/atoms";
4
- import { cn } from "@/lib/utils";
5
-
6
- /**
7
- * ToggleAtom
8
- * Wraps shadcn Toggle
9
- */
10
- export const ToggleAtom: React.FC<
11
- ToggleAtomType & { onPressedChange?: (pressed: boolean) => void }
12
- > = ({
13
- label,
14
- pressed,
15
- disabled,
16
- size = "md",
17
- variant = "default",
18
- className,
19
- onPressedChange,
20
- }) => {
21
- return (
22
- <Toggle
23
- pressed={pressed}
24
- disabled={disabled}
25
- size={size as any}
26
- variant={variant as any}
27
- onPressedChange={onPressedChange}
28
- className={cn(
29
- "data-[state=on]:bg-purple-100 data-[state=on]:text-purple-900",
30
- className,
31
- )}
32
- >
33
- {label}
34
- </Toggle>
35
- );
36
- };
@@ -1,39 +0,0 @@
1
- import React from "react";
2
- import {
3
- Tooltip,
4
- TooltipContent,
5
- TooltipProvider,
6
- TooltipTrigger,
7
- } from "@/components/ui/tooltip";
8
- import { TooltipAtomType, UIComponent } from "../types/schema";
9
- import { cn } from "@/lib/utils";
10
-
11
- interface Props extends TooltipAtomType {
12
- renderComponent: (component: UIComponent) => React.ReactNode;
13
- }
14
-
15
- export const TooltipAtom: React.FC<Props> = ({
16
- content,
17
- children,
18
- className,
19
- renderComponent,
20
- }) => {
21
- return (
22
- <TooltipProvider>
23
- <Tooltip>
24
- <TooltipTrigger asChild>
25
- <div className={cn("inline-block", className)}>
26
- {children.map((child) => (
27
- <React.Fragment key={child.id}>
28
- {renderComponent(child)}
29
- </React.Fragment>
30
- ))}
31
- </div>
32
- </TooltipTrigger>
33
- <TooltipContent className="bg-gray-900 text-white border-none rounded-lg shadow-xl px-3 py-1.5 text-xs">
34
- {content}
35
- </TooltipContent>
36
- </Tooltip>
37
- </TooltipProvider>
38
- );
39
- };