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
package/package.json CHANGED
@@ -1,15 +1,20 @@
1
1
  {
2
2
  "name": "pxengine",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "description": "Shadcn-based UI component library for agent-driven interfaces",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
9
16
  "files": [
10
- "dist",
11
- "config",
12
- "src"
17
+ "dist"
13
18
  ],
14
19
  "scripts": {
15
20
  "build": "tsup && npm run generate-metadata",
@@ -1,106 +0,0 @@
1
- /**
2
- * @pxengine/ui Tailwind Preset
3
- *
4
- * This file allows consumers of the @pxengine/ui library to easily inherit
5
- * the custom theme, colors, and animations required for the components.
6
- *
7
- * Usage in tailwind.config.js:
8
- * presets: [require("@pxengine/ui/config/tailwind-preset")]
9
- */
10
-
11
- module.exports = {
12
- theme: {
13
- container: {
14
- center: true,
15
- padding: "2rem",
16
- screens: {
17
- "2xl": "1400px",
18
- },
19
- },
20
- extend: {
21
- fontFamily: {
22
- sans: ["Inter", "system-ui", "sans-serif"],
23
- noto: ["Noto Sans", "system-ui", "sans-serif"],
24
- grotesk: ["Space Grotesk", "system-ui", "sans-serif"],
25
- roboto: ["Roboto", "system-ui", "sans-serif"],
26
- },
27
- colors: {
28
- border: "hsl(var(--border))",
29
- input: "hsl(var(--input))",
30
- ring: "hsl(var(--ring))",
31
- background: "hsl(var(--background))",
32
- foreground: "hsl(var(--foreground))",
33
- primary: {
34
- DEFAULT: "hsl(var(--primary))",
35
- foreground: "hsl(var(--primary-foreground))",
36
- },
37
- secondary: {
38
- DEFAULT: "hsl(var(--secondary))",
39
- foreground: "hsl(var(--secondary-foreground))",
40
- },
41
- destructive: {
42
- DEFAULT: "hsl(var(--destructive))",
43
- foreground: "hsl(var(--destructive-foreground))",
44
- },
45
- muted: {
46
- DEFAULT: "hsl(var(--muted))",
47
- foreground: "hsl(var(--muted-foreground))",
48
- },
49
- accent: {
50
- DEFAULT: "hsl(var(--accent))",
51
- foreground: "hsl(var(--accent-foreground))",
52
- },
53
- popover: {
54
- DEFAULT: "hsl(var(--popover))",
55
- foreground: "hsl(var(--popover-foreground))",
56
- },
57
- card: {
58
- DEFAULT: "hsl(var(--card))",
59
- foreground: "hsl(var(--card-foreground))",
60
- },
61
- // Custom PXEngine colors
62
- gray25: "var(--gray25)",
63
- gray50: "var(--gray50)",
64
- gray100: "var(--gray100)",
65
- gray200: "var(--gray200)",
66
- gray300: "var(--gray300)",
67
- gray400: "var(--gray400)",
68
- gray500: "var(--gray500)",
69
- gray600: "var(--gray600)",
70
- gray700: "var(--gray700)",
71
- gray800: "var(--gray800)",
72
- gray900: "var(--gray900)",
73
- purple100: "var(--purple100)",
74
- purple200: "var(--purple200)",
75
- purple500: "var(--purple500)",
76
- purpleText: "var(--purple-text)",
77
- purple50: "var(--purple50)",
78
- purple20: "var(--purple20)",
79
- purpleBorder: "var(--purple-border)",
80
- purpleLight: "var(--purpleLight)",
81
- purpleText1: "var(--purple-text-1)",
82
- purpleText2: "var(--purple-text-2)",
83
- },
84
- borderRadius: {
85
- lg: "var(--radius)",
86
- md: "calc(var(--radius) - 2px)",
87
- sm: "calc(var(--radius) - 4px)",
88
- },
89
- keyframes: {
90
- "accordion-down": {
91
- from: { height: "0" },
92
- to: { height: "var(--radix-accordion-content-height)" },
93
- },
94
- "accordion-up": {
95
- from: { height: "var(--radix-accordion-content-height)" },
96
- to: { height: "0" },
97
- },
98
- },
99
- animation: {
100
- "accordion-down": "accordion-down 0.2s ease-out",
101
- "accordion-up": "accordion-up 0.2s ease-out",
102
- },
103
- },
104
- },
105
- plugins: [require("tailwindcss-animate")],
106
- };
@@ -1,44 +0,0 @@
1
- import React from "react";
2
- import {
3
- Accordion,
4
- AccordionItem,
5
- AccordionTrigger,
6
- AccordionContent,
7
- } from "@/components/ui/accordion";
8
- import { AccordionAtomType, UIComponent } from "../types/schema";
9
- import { cn } from "@/lib/utils";
10
-
11
- interface Props extends AccordionAtomType {
12
- renderComponent: (component: UIComponent) => React.ReactNode;
13
- }
14
-
15
- export const AccordionAtom: React.FC<Props> = ({
16
- items,
17
- className,
18
- renderComponent,
19
- }) => {
20
- return (
21
- <Accordion type="single" collapsible className={cn("w-full", className)}>
22
- {items.map((item) => (
23
- <AccordionItem
24
- key={item.value}
25
- value={item.value}
26
- className="border-gray-100"
27
- >
28
- <AccordionTrigger className="text-sm font-semibold hover:no-underline hover:text-purple600 py-4">
29
- {item.trigger}
30
- </AccordionTrigger>
31
- <AccordionContent>
32
- <div className="pt-2 pb-4">
33
- {item.content.map((child) => (
34
- <React.Fragment key={child.id}>
35
- {renderComponent(child)}
36
- </React.Fragment>
37
- ))}
38
- </div>
39
- </AccordionContent>
40
- </AccordionItem>
41
- ))}
42
- </Accordion>
43
- );
44
- };
@@ -1,46 +0,0 @@
1
- import React from "react";
2
- import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert";
3
- import { AlertAtomType } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
- import { AlertCircle, CheckCircle2, Info, AlertTriangle } from "lucide-react";
6
-
7
- export const AlertAtom: React.FC<AlertAtomType> = ({
8
- title,
9
- description,
10
- variant = "default",
11
- className,
12
- }) => {
13
- const IconMap: any = {
14
- default: Info,
15
- destructive: AlertCircle,
16
- warning: AlertTriangle,
17
- info: Info,
18
- success: CheckCircle2,
19
- };
20
-
21
- const Icon = IconMap[variant] || Info;
22
-
23
- const variantMap: any = {
24
- warning:
25
- "border-amber-200 bg-amber-50 text-amber-900 [&>svg]:text-amber-600",
26
- info: "border-blue-200 bg-blue-50 text-blue-900 [&>svg]:text-blue-600",
27
- success:
28
- "border-green-200 bg-green-50 text-green-900 [&>svg]:text-green-600",
29
- };
30
-
31
- const customClass = variantMap[variant] || "";
32
- const shadcnVariant = ["warning", "info", "success"].includes(variant)
33
- ? "default"
34
- : (variant as any);
35
-
36
- return (
37
- <Alert
38
- variant={shadcnVariant}
39
- className={cn("rounded-2xl", customClass, className)}
40
- >
41
- <Icon className="h-4 w-4" />
42
- <AlertTitle className="font-bold">{title}</AlertTitle>
43
- {description && <AlertDescription>{description}</AlertDescription>}
44
- </Alert>
45
- );
46
- };
@@ -1,66 +0,0 @@
1
- import React from "react";
2
- import {
3
- AlertDialog,
4
- AlertDialogAction,
5
- AlertDialogCancel,
6
- AlertDialogContent,
7
- AlertDialogDescription,
8
- AlertDialogFooter,
9
- AlertDialogHeader,
10
- AlertDialogTitle,
11
- AlertDialogTrigger,
12
- } from "@/components/ui/alert-dialog";
13
- import { AlertDialogAtomType, UIComponent } from "../types/schema";
14
- import { cn } from "@/lib/utils";
15
-
16
- interface Props extends AlertDialogAtomType {
17
- renderComponent: (component: UIComponent) => React.ReactNode;
18
- onAction?: (action: string) => void;
19
- }
20
-
21
- export const AlertDialogAtom: React.FC<Props> = ({
22
- title,
23
- description,
24
- trigger,
25
- confirmLabel = "Continue",
26
- cancelLabel = "Cancel",
27
- action,
28
- onAction,
29
- className,
30
- renderComponent,
31
- }) => {
32
- return (
33
- <AlertDialog>
34
- <AlertDialogTrigger asChild>
35
- <div className={cn("inline-block cursor-pointer", className)}>
36
- {trigger.map((child) => (
37
- <React.Fragment key={child.id}>
38
- {renderComponent(child)}
39
- </React.Fragment>
40
- ))}
41
- </div>
42
- </AlertDialogTrigger>
43
- <AlertDialogContent className="rounded-3xl p-6 bg-white shadow-3xl border-gray-100">
44
- <AlertDialogHeader>
45
- <AlertDialogTitle className="text-lg font-bold text-gray-900">
46
- {title}
47
- </AlertDialogTitle>
48
- <AlertDialogDescription className="text-gray-500 font-medium">
49
- {description}
50
- </AlertDialogDescription>
51
- </AlertDialogHeader>
52
- <AlertDialogFooter className="gap-2 sm:gap-0">
53
- <AlertDialogCancel className="rounded-full border-gray-200 hover:bg-gray-50 font-semibold">
54
- {cancelLabel}
55
- </AlertDialogCancel>
56
- <AlertDialogAction
57
- onClick={() => action && onAction?.(action)}
58
- className="rounded-full bg-purple500 hover:bg-purple600 text-white font-semibold transition-all shadow-md hover:shadow-lg"
59
- >
60
- {confirmLabel}
61
- </AlertDialogAction>
62
- </AlertDialogFooter>
63
- </AlertDialogContent>
64
- </AlertDialog>
65
- );
66
- };
@@ -1,27 +0,0 @@
1
- import React from "react";
2
- import { AspectRatio } from "@/components/ui/aspect-ratio";
3
- import { AspectRatioAtomType, UIComponent } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
-
6
- interface Props extends AspectRatioAtomType {
7
- renderComponent: (component: UIComponent) => React.ReactNode;
8
- }
9
-
10
- export const AspectRatioAtom: React.FC<Props> = ({
11
- ratio = 16 / 9,
12
- children,
13
- className,
14
- renderComponent,
15
- }) => {
16
- return (
17
- <div className={cn("w-full", className)}>
18
- <AspectRatio ratio={ratio}>
19
- {children.map((child) => (
20
- <React.Fragment key={child.id}>
21
- {renderComponent(child)}
22
- </React.Fragment>
23
- ))}
24
- </AspectRatio>
25
- </div>
26
- );
27
- };
@@ -1,20 +0,0 @@
1
- import React from "react";
2
- import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
3
- import { AvatarAtomType } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
-
6
- export const AvatarAtom: React.FC<AvatarAtomType> = ({
7
- src,
8
- fallback,
9
- alt,
10
- className,
11
- }) => {
12
- return (
13
- <Avatar className={cn("h-10 w-10", className)}>
14
- {src && <AvatarImage src={src} alt={alt} />}
15
- <AvatarFallback className="bg-purple50 text-purple600 font-bold uppercase">
16
- {fallback}
17
- </AvatarFallback>
18
- </Avatar>
19
- );
20
- };
@@ -1,33 +0,0 @@
1
- import React from "react";
2
- import { Badge } from "@/components/ui/badge";
3
- import { BadgeAtomType } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
-
6
- export const BadgeAtom: React.FC<BadgeAtomType> = ({
7
- label,
8
- variant = "default",
9
- className,
10
- }) => {
11
- const customVariants: any = {
12
- purple: "bg-primary/10 text-primary border-primary/20 hover:bg-primary/20",
13
- green:
14
- "bg-emerald-500/10 text-emerald-500 border-emerald-500/20 hover:bg-emerald-500/20",
15
- };
16
-
17
- const isCustom = ["purple", "green"].includes(variant || "");
18
- const shadcnVariant = isCustom ? "outline" : (variant as any);
19
- const customClass = isCustom ? customVariants[variant!] : "";
20
-
21
- return (
22
- <Badge
23
- variant={shadcnVariant}
24
- className={cn(
25
- "rounded-full px-3 py-0.5 font-bold transition-all",
26
- customClass,
27
- className,
28
- )}
29
- >
30
- {label}
31
- </Badge>
32
- );
33
- };
@@ -1,36 +0,0 @@
1
- import React from "react";
2
- import {
3
- Breadcrumb,
4
- BreadcrumbItem,
5
- BreadcrumbLink,
6
- BreadcrumbList,
7
- BreadcrumbPage,
8
- BreadcrumbSeparator,
9
- } from "@/components/ui/breadcrumb";
10
- import { BreadcrumbAtomType } from "../types/schema";
11
-
12
- export const BreadcrumbAtom: React.FC<BreadcrumbAtomType> = ({
13
- items,
14
- className,
15
- }) => {
16
- return (
17
- <Breadcrumb className={className}>
18
- <BreadcrumbList>
19
- {items.map((item, index) => (
20
- <React.Fragment key={index}>
21
- <BreadcrumbItem>
22
- {item.isCurrent ? (
23
- <BreadcrumbPage>{item.label}</BreadcrumbPage>
24
- ) : (
25
- <BreadcrumbLink href={item.href || "#"}>
26
- {item.label}
27
- </BreadcrumbLink>
28
- )}
29
- </BreadcrumbItem>
30
- {index < items.length - 1 && <BreadcrumbSeparator />}
31
- </React.Fragment>
32
- ))}
33
- </BreadcrumbList>
34
- </Breadcrumb>
35
- );
36
- };
@@ -1,63 +0,0 @@
1
- import React from "react";
2
- import { Button } from "@/components/ui/button";
3
- import { ButtonAtomType } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
- import { Loader2 } from "lucide-react";
6
-
7
- interface Props extends ButtonAtomType {
8
- onAction?: (action: string) => void;
9
- }
10
-
11
- /**
12
- * ButtonAtom
13
- * Wraps shadcn Button with schema support and premium variants
14
- */
15
- export const ButtonAtom: React.FC<Props> = ({
16
- label,
17
- variant = "default",
18
- size = "default",
19
- action,
20
- disabled = false,
21
- isLoading = false,
22
- onAction,
23
- className,
24
- }) => {
25
- const handleClick = (e: React.MouseEvent) => {
26
- e.preventDefault();
27
- e.stopPropagation();
28
- if (action && onAction) {
29
- onAction(action);
30
- }
31
- };
32
-
33
- const variantMap: any = {
34
- purple:
35
- "bg-primary text-primary-foreground hover:bg-primary/90 shadow-[0_4px_14px_0_hsl(var(--primary)/30%)] transition-all active:scale-95 font-bold",
36
- gradient:
37
- "bg-gradient-to-r from-primary via-purple-500 to-indigo-600 text-primary-foreground hover:opacity-95 shadow-[0_4px_14px_0_hsl(var(--primary)/40%)] active:scale-95 font-bold",
38
- };
39
-
40
- const customClass = variantMap[variant] || "";
41
- const shadcnVariant = ["purple", "gradient"].includes(variant)
42
- ? "default"
43
- : (variant as any);
44
-
45
- return (
46
- <Button
47
- variant={shadcnVariant}
48
- size={size as any}
49
- disabled={disabled || isLoading}
50
- onClick={handleClick}
51
- className={cn("rounded-full font-semibold", customClass, className)}
52
- >
53
- {isLoading ? (
54
- <>
55
- <Loader2 className="mr-2 h-4 w-4 animate-spin" />
56
- {label}
57
- </>
58
- ) : (
59
- label
60
- )}
61
- </Button>
62
- );
63
- };
@@ -1,24 +0,0 @@
1
- import React from "react";
2
- import { Calendar } from "@/components/ui/calendar";
3
- import { CalendarAtomType } from "../types/schema";
4
- import { cn } from "@/lib/utils";
5
-
6
- export const CalendarAtom: React.FC<CalendarAtomType> = ({
7
- mode = "single",
8
- selectedDate,
9
- className,
10
- }) => {
11
- // Simple conversion for demonstration
12
- const date = selectedDate ? new Date(selectedDate as string) : undefined;
13
-
14
- return (
15
- <div
16
- className={cn(
17
- "p-4 bg-background/80 backdrop-blur-xl rounded-[28px] border border-border/50 shadow-[0_20px_50px_rgba(0,0,0,0.1)] inline-block transition-all hover:shadow-[0_20px_60px_rgba(0,0,0,0.15)] ring-1 ring-border/5",
18
- className,
19
- )}
20
- >
21
- <Calendar mode={mode as any} selected={date} className="rounded-xl" />
22
- </div>
23
- );
24
- };
@@ -1,64 +0,0 @@
1
- import React from "react";
2
- import {
3
- Card,
4
- CardHeader,
5
- CardTitle,
6
- CardDescription,
7
- CardContent,
8
- CardFooter,
9
- } from "@/components/ui/card";
10
- import { CardAtomType, UIComponent } from "../types/schema";
11
- import { cn } from "@/lib/utils";
12
-
13
- interface Props extends CardAtomType {
14
- renderComponent: (component: UIComponent, index?: number) => React.ReactNode;
15
- }
16
-
17
- /**
18
- * CardAtom
19
- * Standardized Card wrapper for the Universal Renderer
20
- */
21
- export const CardAtom: React.FC<Props> = ({
22
- title,
23
- description,
24
- children,
25
- footer,
26
- className,
27
- renderComponent,
28
- }) => {
29
- return (
30
- <Card
31
- className={cn(
32
- "rounded-[32px] border border-border/50 bg-card/80 text-card-foreground shadow-[0_8px_30px_rgb(0,0,0,0.04)] overflow-hidden backdrop-blur-xl ring-1 ring-border/5",
33
- className,
34
- )}
35
- >
36
- {(title || description) && (
37
- <CardHeader>
38
- {title && (
39
- <CardTitle className="text-xl font-bold text-gray900">
40
- {title}
41
- </CardTitle>
42
- )}
43
- {description && <CardDescription>{description}</CardDescription>}
44
- </CardHeader>
45
- )}
46
- <CardContent className="space-y-4">
47
- {children.map((child, index) => (
48
- <React.Fragment key={child.id || `card-content-${index}`}>
49
- {renderComponent(child, index)}
50
- </React.Fragment>
51
- ))}
52
- </CardContent>
53
- {footer && footer.length > 0 && (
54
- <CardFooter className="bg-gray50/50 border-t border-gray200 flex flex-wrap gap-2 pt-6">
55
- {footer.map((footerChild, index) => (
56
- <React.Fragment key={footerChild.id || `card-footer-${index}`}>
57
- {renderComponent(footerChild, index)}
58
- </React.Fragment>
59
- ))}
60
- </CardFooter>
61
- )}
62
- </Card>
63
- );
64
- };
@@ -1,40 +0,0 @@
1
- import React from "react";
2
- import {
3
- Carousel,
4
- CarouselContent,
5
- CarouselItem,
6
- CarouselNext,
7
- CarouselPrevious,
8
- } from "@/components/ui/carousel";
9
- import { CarouselAtomType, UIComponent } from "../types/schema";
10
- import { cn } from "@/lib/utils";
11
-
12
- interface Props extends CarouselAtomType {
13
- renderComponent: (component: UIComponent) => React.ReactNode;
14
- }
15
-
16
- export const CarouselAtom: React.FC<Props> = ({
17
- items,
18
- className,
19
- renderComponent,
20
- }) => {
21
- return (
22
- <Carousel className={cn("w-full max-w-xs mx-auto", className)}>
23
- <CarouselContent>
24
- {items.map((slide, index) => (
25
- <CarouselItem key={index}>
26
- <div className="p-1">
27
- {slide.map((child) => (
28
- <React.Fragment key={child.id}>
29
- {renderComponent(child)}
30
- </React.Fragment>
31
- ))}
32
- </div>
33
- </CarouselItem>
34
- ))}
35
- </CarouselContent>
36
- <CarouselPrevious />
37
- <CarouselNext />
38
- </Carousel>
39
- );
40
- };