pxengine 0.1.12 → 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 (182) hide show
  1. package/dist/registry.json +1 -1
  2. package/package.json +2 -4
  3. package/config/tailwind-preset.js +0 -106
  4. package/src/atoms/AccordionAtom.tsx +0 -44
  5. package/src/atoms/AlertAtom.tsx +0 -48
  6. package/src/atoms/AlertDialogAtom.tsx +0 -66
  7. package/src/atoms/AspectRatioAtom.tsx +0 -27
  8. package/src/atoms/AvatarAtom.tsx +0 -21
  9. package/src/atoms/BadgeAtom.tsx +0 -35
  10. package/src/atoms/BreadcrumbAtom.tsx +0 -36
  11. package/src/atoms/ButtonAtom.tsx +0 -65
  12. package/src/atoms/CalendarAtom.tsx +0 -24
  13. package/src/atoms/CardAtom.tsx +0 -66
  14. package/src/atoms/CarouselAtom.tsx +0 -40
  15. package/src/atoms/ChartAtom.tsx +0 -192
  16. package/src/atoms/CheckboxAtom.tsx +0 -33
  17. package/src/atoms/CollapsibleAtom.tsx +0 -44
  18. package/src/atoms/CommandAtom.tsx +0 -46
  19. package/src/atoms/ContextMenuAtom.tsx +0 -49
  20. package/src/atoms/DialogAtom.tsx +0 -68
  21. package/src/atoms/DrawerAtom.tsx +0 -49
  22. package/src/atoms/DropdownMenuAtom.tsx +0 -49
  23. package/src/atoms/FormInputAtom.tsx +0 -101
  24. package/src/atoms/FormSelectAtom.tsx +0 -110
  25. package/src/atoms/FormTextareaAtom.tsx +0 -93
  26. package/src/atoms/InputAtom.tsx +0 -216
  27. package/src/atoms/InputOTPAtom.tsx +0 -49
  28. package/src/atoms/KbdAtom.tsx +0 -25
  29. package/src/atoms/LabelAtom.tsx +0 -23
  30. package/src/atoms/LayoutAtom.tsx +0 -45
  31. package/src/atoms/PaginationAtom.tsx +0 -49
  32. package/src/atoms/PopoverAtom.tsx +0 -40
  33. package/src/atoms/ProgressAtom.tsx +0 -15
  34. package/src/atoms/RadioGroupAtom.tsx +0 -31
  35. package/src/atoms/RatingAtom.tsx +0 -37
  36. package/src/atoms/ResizableAtom.tsx +0 -51
  37. package/src/atoms/ScrollAreaAtom.tsx +0 -31
  38. package/src/atoms/SeparatorAtom.tsx +0 -16
  39. package/src/atoms/SheetAtom.tsx +0 -72
  40. package/src/atoms/SkeletonAtom.tsx +0 -22
  41. package/src/atoms/SliderAtom.tsx +0 -32
  42. package/src/atoms/SpinnerAtom.tsx +0 -26
  43. package/src/atoms/SwitchAtom.tsx +0 -32
  44. package/src/atoms/TableAtom.tsx +0 -60
  45. package/src/atoms/TabsAtom.tsx +0 -40
  46. package/src/atoms/TextAtom.tsx +0 -36
  47. package/src/atoms/TextareaAtom.tsx +0 -42
  48. package/src/atoms/TimelineAtom.tsx +0 -77
  49. package/src/atoms/ToggleAtom.tsx +0 -36
  50. package/src/atoms/TooltipAtom.tsx +0 -39
  51. package/src/atoms/VideoAtom.tsx +0 -34
  52. package/src/atoms/index.ts +0 -49
  53. package/src/components/index.ts +0 -178
  54. package/src/components/ui/accordion.tsx +0 -56
  55. package/src/components/ui/alert-dialog.tsx +0 -139
  56. package/src/components/ui/alert.tsx +0 -59
  57. package/src/components/ui/aspect-ratio.tsx +0 -5
  58. package/src/components/ui/avatar.tsx +0 -50
  59. package/src/components/ui/badge.tsx +0 -36
  60. package/src/components/ui/breadcrumb.tsx +0 -115
  61. package/src/components/ui/button-group.tsx +0 -83
  62. package/src/components/ui/button.tsx +0 -56
  63. package/src/components/ui/calendar.tsx +0 -213
  64. package/src/components/ui/card.tsx +0 -79
  65. package/src/components/ui/carousel.tsx +0 -260
  66. package/src/components/ui/chart.tsx +0 -367
  67. package/src/components/ui/checkbox.tsx +0 -28
  68. package/src/components/ui/collapsible.tsx +0 -11
  69. package/src/components/ui/command.tsx +0 -153
  70. package/src/components/ui/context-menu.tsx +0 -198
  71. package/src/components/ui/dialog.tsx +0 -122
  72. package/src/components/ui/drawer.tsx +0 -116
  73. package/src/components/ui/dropdown-menu.tsx +0 -200
  74. package/src/components/ui/empty.tsx +0 -104
  75. package/src/components/ui/field.tsx +0 -244
  76. package/src/components/ui/form.tsx +0 -176
  77. package/src/components/ui/hover-card.tsx +0 -27
  78. package/src/components/ui/index.ts +0 -54
  79. package/src/components/ui/input-group.tsx +0 -168
  80. package/src/components/ui/input-otp.tsx +0 -69
  81. package/src/components/ui/input.tsx +0 -22
  82. package/src/components/ui/item.tsx +0 -193
  83. package/src/components/ui/kbd.tsx +0 -28
  84. package/src/components/ui/label.tsx +0 -26
  85. package/src/components/ui/menubar.tsx +0 -254
  86. package/src/components/ui/navigation-menu.tsx +0 -128
  87. package/src/components/ui/pagination.tsx +0 -117
  88. package/src/components/ui/popover.tsx +0 -29
  89. package/src/components/ui/progress.tsx +0 -28
  90. package/src/components/ui/radio-group.tsx +0 -42
  91. package/src/components/ui/resizable.tsx +0 -44
  92. package/src/components/ui/scroll-area.tsx +0 -46
  93. package/src/components/ui/select.tsx +0 -160
  94. package/src/components/ui/separator.tsx +0 -29
  95. package/src/components/ui/sheet.tsx +0 -140
  96. package/src/components/ui/sidebar.tsx +0 -771
  97. package/src/components/ui/skeleton.tsx +0 -15
  98. package/src/components/ui/slider.tsx +0 -26
  99. package/src/components/ui/sonner.tsx +0 -45
  100. package/src/components/ui/spinner.tsx +0 -16
  101. package/src/components/ui/switch.tsx +0 -27
  102. package/src/components/ui/table.tsx +0 -117
  103. package/src/components/ui/tabs.tsx +0 -53
  104. package/src/components/ui/textarea.tsx +0 -22
  105. package/src/components/ui/toggle-group.tsx +0 -61
  106. package/src/components/ui/toggle.tsx +0 -43
  107. package/src/components/ui/tooltip.tsx +0 -30
  108. package/src/hooks/use-mobile.tsx +0 -19
  109. package/src/index.ts +0 -24
  110. package/src/lib/countries.ts +0 -203
  111. package/src/lib/index.ts +0 -2
  112. package/src/lib/utils.ts +0 -15
  113. package/src/lib/validators/index.ts +0 -1
  114. package/src/lib/validators/theme.ts +0 -148
  115. package/src/molecules/creator-discovery/AudienceDemographicsCard/AudienceDemographicsCard.tsx +0 -44
  116. package/src/molecules/creator-discovery/AudienceDemographicsCard/index.ts +0 -1
  117. package/src/molecules/creator-discovery/AudienceMetricCard/AudienceMetricCard.tsx +0 -50
  118. package/src/molecules/creator-discovery/AudienceMetricCard/index.ts +0 -1
  119. package/src/molecules/creator-discovery/BrandAffinityGroup/BrandAffinityGroup.tsx +0 -36
  120. package/src/molecules/creator-discovery/BrandAffinityGroup/index.ts +0 -1
  121. package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx +0 -123
  122. package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.types.ts +0 -13
  123. package/src/molecules/creator-discovery/CampaignSeedCard/index.ts +0 -2
  124. package/src/molecules/creator-discovery/ContentPreviewGallery/ContentPreviewGallery.tsx +0 -41
  125. package/src/molecules/creator-discovery/ContentPreviewGallery/index.ts +0 -1
  126. package/src/molecules/creator-discovery/CreatorActionHeader/CreatorActionHeader.tsx +0 -77
  127. package/src/molecules/creator-discovery/CreatorActionHeader/index.ts +0 -1
  128. package/src/molecules/creator-discovery/CreatorGridCard/CreatorGridCard.tsx +0 -104
  129. package/src/molecules/creator-discovery/CreatorGridCard/index.ts +0 -1
  130. package/src/molecules/creator-discovery/CreatorProfileSummary/CreatorProfileSummary.tsx +0 -65
  131. package/src/molecules/creator-discovery/CreatorProfileSummary/index.ts +0 -1
  132. package/src/molecules/creator-discovery/GrowthChartCard/GrowthChartCard.tsx +0 -58
  133. package/src/molecules/creator-discovery/GrowthChartCard/index.ts +0 -1
  134. package/src/molecules/creator-discovery/MCQCard/MCQCard.tsx +0 -165
  135. package/src/molecules/creator-discovery/MCQCard/MCQCard.types.ts +0 -71
  136. package/src/molecules/creator-discovery/MCQCard/index.ts +0 -2
  137. package/src/molecules/creator-discovery/PlatformIconGroup/PlatformIconGroup.tsx +0 -72
  138. package/src/molecules/creator-discovery/PlatformIconGroup/index.ts +0 -1
  139. package/src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx +0 -334
  140. package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx +0 -111
  141. package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.types.ts +0 -18
  142. package/src/molecules/creator-discovery/SearchSpecCard/index.ts +0 -3
  143. package/src/molecules/creator-discovery/TopPostsGrid/TopPostsGrid.tsx +0 -49
  144. package/src/molecules/creator-discovery/TopPostsGrid/index.ts +0 -1
  145. package/src/molecules/creator-discovery/index.ts +0 -13
  146. package/src/molecules/generic/ActionButton/ActionButton.tsx +0 -137
  147. package/src/molecules/generic/ActionButton/ActionButton.types.ts +0 -68
  148. package/src/molecules/generic/ActionButton/index.ts +0 -2
  149. package/src/molecules/generic/DataGrid/DataGrid.tsx +0 -102
  150. package/src/molecules/generic/DataGrid/index.ts +0 -1
  151. package/src/molecules/generic/EditableField/EditableField.tsx +0 -229
  152. package/src/molecules/generic/EditableField/EditableField.types.ts +0 -73
  153. package/src/molecules/generic/EditableField/index.ts +0 -2
  154. package/src/molecules/generic/EmptyState/EmptyState.tsx +0 -61
  155. package/src/molecules/generic/EmptyState/index.ts +0 -1
  156. package/src/molecules/generic/FileUpload/FileUpload.tsx +0 -62
  157. package/src/molecules/generic/FileUpload/index.ts +0 -1
  158. package/src/molecules/generic/FilterBar/FilterBar.tsx +0 -54
  159. package/src/molecules/generic/FilterBar/index.ts +0 -1
  160. package/src/molecules/generic/FormCard/FormCard.tsx +0 -136
  161. package/src/molecules/generic/FormCard/FormCard.types.ts +0 -93
  162. package/src/molecules/generic/FormCard/index.ts +0 -2
  163. package/src/molecules/generic/LoadingOverlay/LoadingOverlay.tsx +0 -39
  164. package/src/molecules/generic/LoadingOverlay/index.ts +0 -1
  165. package/src/molecules/generic/NotificationList/NotificationList.tsx +0 -80
  166. package/src/molecules/generic/NotificationList/index.ts +0 -1
  167. package/src/molecules/generic/StatsGrid/StatsGrid.tsx +0 -80
  168. package/src/molecules/generic/StatsGrid/index.ts +0 -1
  169. package/src/molecules/generic/StepWizard/StepWizard.tsx +0 -67
  170. package/src/molecules/generic/StepWizard/index.ts +0 -1
  171. package/src/molecules/generic/TagCloud/TagCloud.tsx +0 -32
  172. package/src/molecules/generic/TagCloud/index.ts +0 -1
  173. package/src/molecules/generic/index.ts +0 -12
  174. package/src/molecules/index.ts +0 -2
  175. package/src/render/PXEngineRenderer.tsx +0 -458
  176. package/src/render/index.ts +0 -1
  177. package/src/styles/globals.css +0 -146
  178. package/src/types/atoms.ts +0 -450
  179. package/src/types/common.ts +0 -116
  180. package/src/types/index.ts +0 -3
  181. package/src/types/molecules.ts +0 -279
  182. package/src/types/schema.ts +0 -12
@@ -1,200 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
5
- import { Check, ChevronRight, Circle } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const DropdownMenu = DropdownMenuPrimitive.Root
10
-
11
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
12
-
13
- const DropdownMenuGroup = DropdownMenuPrimitive.Group
14
-
15
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal
16
-
17
- const DropdownMenuSub = DropdownMenuPrimitive.Sub
18
-
19
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
20
-
21
- const DropdownMenuSubTrigger = React.forwardRef<
22
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
23
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
24
- inset?: boolean
25
- }
26
- >(({ className, inset, children, ...props }, ref) => (
27
- <DropdownMenuPrimitive.SubTrigger
28
- ref={ref}
29
- className={cn(
30
- "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
31
- inset && "pl-8",
32
- className
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- <ChevronRight className="ml-auto" />
38
- </DropdownMenuPrimitive.SubTrigger>
39
- ))
40
- DropdownMenuSubTrigger.displayName =
41
- DropdownMenuPrimitive.SubTrigger.displayName
42
-
43
- const DropdownMenuSubContent = React.forwardRef<
44
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
45
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
46
- >(({ className, ...props }, ref) => (
47
- <DropdownMenuPrimitive.SubContent
48
- ref={ref}
49
- className={cn(
50
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
51
- className
52
- )}
53
- {...props}
54
- />
55
- ))
56
- DropdownMenuSubContent.displayName =
57
- DropdownMenuPrimitive.SubContent.displayName
58
-
59
- const DropdownMenuContent = React.forwardRef<
60
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
61
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
62
- >(({ className, sideOffset = 4, ...props }, ref) => (
63
- <DropdownMenuPrimitive.Portal>
64
- <DropdownMenuPrimitive.Content
65
- ref={ref}
66
- sideOffset={sideOffset}
67
- className={cn(
68
- "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
69
- className
70
- )}
71
- {...props}
72
- />
73
- </DropdownMenuPrimitive.Portal>
74
- ))
75
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
76
-
77
- const DropdownMenuItem = React.forwardRef<
78
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
79
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
80
- inset?: boolean
81
- }
82
- >(({ className, inset, ...props }, ref) => (
83
- <DropdownMenuPrimitive.Item
84
- ref={ref}
85
- className={cn(
86
- "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
87
- inset && "pl-8",
88
- className
89
- )}
90
- {...props}
91
- />
92
- ))
93
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
94
-
95
- const DropdownMenuCheckboxItem = React.forwardRef<
96
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
97
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
98
- >(({ className, children, checked, ...props }, ref) => (
99
- <DropdownMenuPrimitive.CheckboxItem
100
- ref={ref}
101
- className={cn(
102
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
103
- className
104
- )}
105
- checked={checked}
106
- {...props}
107
- >
108
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
109
- <DropdownMenuPrimitive.ItemIndicator>
110
- <Check className="h-4 w-4" />
111
- </DropdownMenuPrimitive.ItemIndicator>
112
- </span>
113
- {children}
114
- </DropdownMenuPrimitive.CheckboxItem>
115
- ))
116
- DropdownMenuCheckboxItem.displayName =
117
- DropdownMenuPrimitive.CheckboxItem.displayName
118
-
119
- const DropdownMenuRadioItem = React.forwardRef<
120
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
121
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
122
- >(({ className, children, ...props }, ref) => (
123
- <DropdownMenuPrimitive.RadioItem
124
- ref={ref}
125
- className={cn(
126
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
127
- className
128
- )}
129
- {...props}
130
- >
131
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
132
- <DropdownMenuPrimitive.ItemIndicator>
133
- <Circle className="h-2 w-2 fill-current" />
134
- </DropdownMenuPrimitive.ItemIndicator>
135
- </span>
136
- {children}
137
- </DropdownMenuPrimitive.RadioItem>
138
- ))
139
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
140
-
141
- const DropdownMenuLabel = React.forwardRef<
142
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
143
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
144
- inset?: boolean
145
- }
146
- >(({ className, inset, ...props }, ref) => (
147
- <DropdownMenuPrimitive.Label
148
- ref={ref}
149
- className={cn(
150
- "px-2 py-1.5 text-sm font-semibold",
151
- inset && "pl-8",
152
- className
153
- )}
154
- {...props}
155
- />
156
- ))
157
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
158
-
159
- const DropdownMenuSeparator = React.forwardRef<
160
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
161
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
162
- >(({ className, ...props }, ref) => (
163
- <DropdownMenuPrimitive.Separator
164
- ref={ref}
165
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
166
- {...props}
167
- />
168
- ))
169
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
170
-
171
- const DropdownMenuShortcut = ({
172
- className,
173
- ...props
174
- }: React.HTMLAttributes<HTMLSpanElement>) => {
175
- return (
176
- <span
177
- className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
178
- {...props}
179
- />
180
- )
181
- }
182
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
183
-
184
- export {
185
- DropdownMenu,
186
- DropdownMenuTrigger,
187
- DropdownMenuContent,
188
- DropdownMenuItem,
189
- DropdownMenuCheckboxItem,
190
- DropdownMenuRadioItem,
191
- DropdownMenuLabel,
192
- DropdownMenuSeparator,
193
- DropdownMenuShortcut,
194
- DropdownMenuGroup,
195
- DropdownMenuPortal,
196
- DropdownMenuSub,
197
- DropdownMenuSubContent,
198
- DropdownMenuSubTrigger,
199
- DropdownMenuRadioGroup,
200
- }
@@ -1,104 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- function Empty({ className, ...props }: React.ComponentProps<"div">) {
6
- return (
7
- <div
8
- data-slot="empty"
9
- className={cn(
10
- "flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",
11
- className
12
- )}
13
- {...props}
14
- />
15
- )
16
- }
17
-
18
- function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) {
19
- return (
20
- <div
21
- data-slot="empty-header"
22
- className={cn(
23
- "flex max-w-sm flex-col items-center gap-2 text-center",
24
- className
25
- )}
26
- {...props}
27
- />
28
- )
29
- }
30
-
31
- const emptyMediaVariants = cva(
32
- "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
33
- {
34
- variants: {
35
- variant: {
36
- default: "bg-transparent",
37
- icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6",
38
- },
39
- },
40
- defaultVariants: {
41
- variant: "default",
42
- },
43
- }
44
- )
45
-
46
- function EmptyMedia({
47
- className,
48
- variant = "default",
49
- ...props
50
- }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>) {
51
- return (
52
- <div
53
- data-slot="empty-icon"
54
- data-variant={variant}
55
- className={cn(emptyMediaVariants({ variant, className }))}
56
- {...props}
57
- />
58
- )
59
- }
60
-
61
- function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {
62
- return (
63
- <div
64
- data-slot="empty-title"
65
- className={cn("text-lg font-medium tracking-tight", className)}
66
- {...props}
67
- />
68
- )
69
- }
70
-
71
- function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {
72
- return (
73
- <div
74
- data-slot="empty-description"
75
- className={cn(
76
- "text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
77
- className
78
- )}
79
- {...props}
80
- />
81
- )
82
- }
83
-
84
- function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {
85
- return (
86
- <div
87
- data-slot="empty-content"
88
- className={cn(
89
- "flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",
90
- className
91
- )}
92
- {...props}
93
- />
94
- )
95
- }
96
-
97
- export {
98
- Empty,
99
- EmptyHeader,
100
- EmptyTitle,
101
- EmptyDescription,
102
- EmptyContent,
103
- EmptyMedia,
104
- }
@@ -1,244 +0,0 @@
1
- "use client"
2
-
3
- import { useMemo } from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
-
6
- import { cn } from "@/lib/utils"
7
- import { Label } from "@/components/ui/label"
8
- import { Separator } from "@/components/ui/separator"
9
-
10
- function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
11
- return (
12
- <fieldset
13
- data-slot="field-set"
14
- className={cn(
15
- "flex flex-col gap-6",
16
- "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
17
- className
18
- )}
19
- {...props}
20
- />
21
- )
22
- }
23
-
24
- function FieldLegend({
25
- className,
26
- variant = "legend",
27
- ...props
28
- }: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {
29
- return (
30
- <legend
31
- data-slot="field-legend"
32
- data-variant={variant}
33
- className={cn(
34
- "mb-3 font-medium",
35
- "data-[variant=legend]:text-base",
36
- "data-[variant=label]:text-sm",
37
- className
38
- )}
39
- {...props}
40
- />
41
- )
42
- }
43
-
44
- function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
45
- return (
46
- <div
47
- data-slot="field-group"
48
- className={cn(
49
- "group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
50
- className
51
- )}
52
- {...props}
53
- />
54
- )
55
- }
56
-
57
- const fieldVariants = cva(
58
- "group/field data-[invalid=true]:text-destructive flex w-full gap-3",
59
- {
60
- variants: {
61
- orientation: {
62
- vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
63
- horizontal: [
64
- "flex-row items-center",
65
- "[&>[data-slot=field-label]]:flex-auto",
66
- "has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start",
67
- ],
68
- responsive: [
69
- "@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
70
- "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
71
- "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
72
- ],
73
- },
74
- },
75
- defaultVariants: {
76
- orientation: "vertical",
77
- },
78
- }
79
- )
80
-
81
- function Field({
82
- className,
83
- orientation = "vertical",
84
- ...props
85
- }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {
86
- return (
87
- <div
88
- role="group"
89
- data-slot="field"
90
- data-orientation={orientation}
91
- className={cn(fieldVariants({ orientation }), className)}
92
- {...props}
93
- />
94
- )
95
- }
96
-
97
- function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
98
- return (
99
- <div
100
- data-slot="field-content"
101
- className={cn(
102
- "group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
103
- className
104
- )}
105
- {...props}
106
- />
107
- )
108
- }
109
-
110
- function FieldLabel({
111
- className,
112
- ...props
113
- }: React.ComponentProps<typeof Label>) {
114
- return (
115
- <Label
116
- data-slot="field-label"
117
- className={cn(
118
- "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
119
- "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4",
120
- "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
121
- className
122
- )}
123
- {...props}
124
- />
125
- )
126
- }
127
-
128
- function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
129
- return (
130
- <div
131
- data-slot="field-label"
132
- className={cn(
133
- "flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50",
134
- className
135
- )}
136
- {...props}
137
- />
138
- )
139
- }
140
-
141
- function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
142
- return (
143
- <p
144
- data-slot="field-description"
145
- className={cn(
146
- "text-muted-foreground text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
147
- "nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5",
148
- "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
149
- className
150
- )}
151
- {...props}
152
- />
153
- )
154
- }
155
-
156
- function FieldSeparator({
157
- children,
158
- className,
159
- ...props
160
- }: React.ComponentProps<"div"> & {
161
- children?: React.ReactNode
162
- }) {
163
- return (
164
- <div
165
- data-slot="field-separator"
166
- data-content={!!children}
167
- className={cn(
168
- "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
169
- className
170
- )}
171
- {...props}
172
- >
173
- <Separator className="absolute inset-0 top-1/2" />
174
- {children && (
175
- <span
176
- className="bg-background text-muted-foreground relative mx-auto block w-fit px-2"
177
- data-slot="field-separator-content"
178
- >
179
- {children}
180
- </span>
181
- )}
182
- </div>
183
- )
184
- }
185
-
186
- function FieldError({
187
- className,
188
- children,
189
- errors,
190
- ...props
191
- }: React.ComponentProps<"div"> & {
192
- errors?: Array<{ message?: string } | undefined>
193
- }) {
194
- const content = useMemo(() => {
195
- if (children) {
196
- return children
197
- }
198
-
199
- if (!errors) {
200
- return null
201
- }
202
-
203
- if (errors?.length === 1 && errors[0]?.message) {
204
- return errors[0].message
205
- }
206
-
207
- return (
208
- <ul className="ml-4 flex list-disc flex-col gap-1">
209
- {errors.map(
210
- (error, index) =>
211
- error?.message && <li key={index}>{error.message}</li>
212
- )}
213
- </ul>
214
- )
215
- }, [children, errors])
216
-
217
- if (!content) {
218
- return null
219
- }
220
-
221
- return (
222
- <div
223
- role="alert"
224
- data-slot="field-error"
225
- className={cn("text-destructive text-sm font-normal", className)}
226
- {...props}
227
- >
228
- {content}
229
- </div>
230
- )
231
- }
232
-
233
- export {
234
- Field,
235
- FieldLabel,
236
- FieldDescription,
237
- FieldError,
238
- FieldGroup,
239
- FieldLegend,
240
- FieldSeparator,
241
- FieldSet,
242
- FieldContent,
243
- FieldTitle,
244
- }