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,176 +0,0 @@
1
- import * as React from "react"
2
- import * as LabelPrimitive from "@radix-ui/react-label"
3
- import { Slot } from "@radix-ui/react-slot"
4
- import {
5
- Controller,
6
- FormProvider,
7
- useFormContext,
8
- type ControllerProps,
9
- type FieldPath,
10
- type FieldValues,
11
- } from "react-hook-form"
12
-
13
- import { cn } from "@/lib/utils"
14
- import { Label } from "@/components/ui/label"
15
-
16
- const Form = FormProvider
17
-
18
- type FormFieldContextValue<
19
- TFieldValues extends FieldValues = FieldValues,
20
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
21
- > = {
22
- name: TName
23
- }
24
-
25
- const FormFieldContext = React.createContext<FormFieldContextValue | null>(null)
26
-
27
- const FormField = <
28
- TFieldValues extends FieldValues = FieldValues,
29
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
30
- >({
31
- ...props
32
- }: ControllerProps<TFieldValues, TName>) => {
33
- return (
34
- <FormFieldContext.Provider value={{ name: props.name }}>
35
- <Controller {...props} />
36
- </FormFieldContext.Provider>
37
- )
38
- }
39
-
40
- const useFormField = () => {
41
- const fieldContext = React.useContext(FormFieldContext)
42
- const itemContext = React.useContext(FormItemContext)
43
- const { getFieldState, formState } = useFormContext()
44
-
45
- if (!fieldContext) {
46
- throw new Error("useFormField should be used within <FormField>")
47
- }
48
-
49
- if (!itemContext) {
50
- throw new Error("useFormField should be used within <FormItem>")
51
- }
52
-
53
- const fieldState = getFieldState(fieldContext.name, formState)
54
-
55
- const { id } = itemContext
56
-
57
- return {
58
- id,
59
- name: fieldContext.name,
60
- formItemId: `${id}-form-item`,
61
- formDescriptionId: `${id}-form-item-description`,
62
- formMessageId: `${id}-form-item-message`,
63
- ...fieldState,
64
- }
65
- }
66
-
67
- type FormItemContextValue = {
68
- id: string
69
- }
70
-
71
- const FormItemContext = React.createContext<FormItemContextValue | null>(null)
72
-
73
- const FormItem = React.forwardRef<
74
- HTMLDivElement,
75
- React.HTMLAttributes<HTMLDivElement>
76
- >(({ className, ...props }, ref) => {
77
- const id = React.useId()
78
-
79
- return (
80
- <FormItemContext.Provider value={{ id }}>
81
- <div ref={ref} className={cn("space-y-2", className)} {...props} />
82
- </FormItemContext.Provider>
83
- )
84
- })
85
- FormItem.displayName = "FormItem"
86
-
87
- const FormLabel = React.forwardRef<
88
- React.ElementRef<typeof LabelPrimitive.Root>,
89
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
90
- >(({ className, ...props }, ref) => {
91
- const { error, formItemId } = useFormField()
92
-
93
- return (
94
- <Label
95
- ref={ref}
96
- className={cn(error && "text-destructive", className)}
97
- htmlFor={formItemId}
98
- {...props}
99
- />
100
- )
101
- })
102
- FormLabel.displayName = "FormLabel"
103
-
104
- const FormControl = React.forwardRef<
105
- React.ElementRef<typeof Slot>,
106
- React.ComponentPropsWithoutRef<typeof Slot>
107
- >(({ ...props }, ref) => {
108
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
109
-
110
- return (
111
- <Slot
112
- ref={ref}
113
- id={formItemId}
114
- aria-describedby={
115
- !error
116
- ? `${formDescriptionId}`
117
- : `${formDescriptionId} ${formMessageId}`
118
- }
119
- aria-invalid={!!error}
120
- {...props}
121
- />
122
- )
123
- })
124
- FormControl.displayName = "FormControl"
125
-
126
- const FormDescription = React.forwardRef<
127
- HTMLParagraphElement,
128
- React.HTMLAttributes<HTMLParagraphElement>
129
- >(({ className, ...props }, ref) => {
130
- const { formDescriptionId } = useFormField()
131
-
132
- return (
133
- <p
134
- ref={ref}
135
- id={formDescriptionId}
136
- className={cn("text-sm text-muted-foreground", className)}
137
- {...props}
138
- />
139
- )
140
- })
141
- FormDescription.displayName = "FormDescription"
142
-
143
- const FormMessage = React.forwardRef<
144
- HTMLParagraphElement,
145
- React.HTMLAttributes<HTMLParagraphElement>
146
- >(({ className, children, ...props }, ref) => {
147
- const { error, formMessageId } = useFormField()
148
- const body = error ? String(error?.message ?? "") : children
149
-
150
- if (!body) {
151
- return null
152
- }
153
-
154
- return (
155
- <p
156
- ref={ref}
157
- id={formMessageId}
158
- className={cn("text-sm font-medium text-destructive", className)}
159
- {...props}
160
- >
161
- {body}
162
- </p>
163
- )
164
- })
165
- FormMessage.displayName = "FormMessage"
166
-
167
- export {
168
- useFormField,
169
- Form,
170
- FormItem,
171
- FormLabel,
172
- FormControl,
173
- FormDescription,
174
- FormMessage,
175
- FormField,
176
- }
@@ -1,27 +0,0 @@
1
- import * as React from "react"
2
- import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const HoverCard = HoverCardPrimitive.Root
7
-
8
- const HoverCardTrigger = HoverCardPrimitive.Trigger
9
-
10
- const HoverCardContent = React.forwardRef<
11
- React.ElementRef<typeof HoverCardPrimitive.Content>,
12
- React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
13
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14
- <HoverCardPrimitive.Content
15
- ref={ref}
16
- align={align}
17
- sideOffset={sideOffset}
18
- className={cn(
19
- "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-hover-card-content-transform-origin]",
20
- className
21
- )}
22
- {...props}
23
- />
24
- ))
25
- HoverCardContent.displayName = HoverCardPrimitive.Content.displayName
26
-
27
- export { HoverCard, HoverCardTrigger, HoverCardContent }
@@ -1,54 +0,0 @@
1
- // Auto-generated index file for UI components
2
- export * from "./accordion";
3
- export * from "./alert-dialog";
4
- export * from "./alert";
5
- export * from "./aspect-ratio";
6
- export * from "./avatar";
7
- export * from "./badge";
8
- export * from "./breadcrumb";
9
- export * from "./button-group";
10
- export * from "./button";
11
- export * from "./calendar";
12
- export * from "./card";
13
- export * from "./carousel";
14
- export * from "./chart";
15
- export * from "./checkbox";
16
- export * from "./collapsible";
17
- export * from "./command";
18
- export * from "./context-menu";
19
- export * from "./dialog";
20
- export * from "./drawer";
21
- export * from "./dropdown-menu";
22
- export * from "./empty";
23
- export * from "./field";
24
- export * from "./form";
25
- export * from "./hover-card";
26
- export * from "./input-group";
27
- export * from "./input-otp";
28
- export * from "./input";
29
- export * from "./item";
30
- export * from "./kbd";
31
- export * from "./label";
32
- export * from "./menubar";
33
- export * from "./navigation-menu";
34
- export * from "./pagination";
35
- export * from "./popover";
36
- export * from "./progress";
37
- export * from "./radio-group";
38
- export * from "./resizable";
39
- export * from "./scroll-area";
40
- export * from "./select";
41
- export * from "./separator";
42
- export * from "./sheet";
43
- export * from "./sidebar";
44
- export * from "./skeleton";
45
- export * from "./slider";
46
- export * from "./sonner";
47
- export * from "./spinner";
48
- export * from "./switch";
49
- export * from "./table";
50
- export * from "./tabs";
51
- export * from "./textarea";
52
- export * from "./toggle-group";
53
- export * from "./toggle";
54
- export * from "./tooltip";
@@ -1,168 +0,0 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
-
4
- import { cn } from "@/lib/utils"
5
- import { Button } from "@/components/ui/button"
6
- import { Input } from "@/components/ui/input"
7
- import { Textarea } from "@/components/ui/textarea"
8
-
9
- function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
10
- return (
11
- <div
12
- data-slot="input-group"
13
- role="group"
14
- className={cn(
15
- "group/input-group border-input dark:bg-input/30 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow]",
16
- "h-9 has-[>textarea]:h-auto",
17
-
18
- // Variants based on alignment.
19
- "has-[>[data-align=inline-start]]:[&>input]:pl-2",
20
- "has-[>[data-align=inline-end]]:[&>input]:pr-2",
21
- "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
22
- "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
23
-
24
- // Focus state.
25
- "has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]:focus-visible]:ring-1",
26
-
27
- // Error state.
28
- "has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
29
-
30
- className
31
- )}
32
- {...props}
33
- />
34
- )
35
- }
36
-
37
- const inputGroupAddonVariants = cva(
38
- "text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
39
- {
40
- variants: {
41
- align: {
42
- "inline-start":
43
- "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
44
- "inline-end":
45
- "order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]",
46
- "block-start":
47
- "[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5",
48
- "block-end":
49
- "[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5",
50
- },
51
- },
52
- defaultVariants: {
53
- align: "inline-start",
54
- },
55
- }
56
- )
57
-
58
- function InputGroupAddon({
59
- className,
60
- align = "inline-start",
61
- ...props
62
- }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
63
- return (
64
- <div
65
- role="group"
66
- data-slot="input-group-addon"
67
- data-align={align}
68
- className={cn(inputGroupAddonVariants({ align }), className)}
69
- onClick={(e) => {
70
- if ((e.target as HTMLElement).closest("button")) {
71
- return
72
- }
73
- e.currentTarget.parentElement?.querySelector("input")?.focus()
74
- }}
75
- {...props}
76
- />
77
- )
78
- }
79
-
80
- const inputGroupButtonVariants = cva(
81
- "flex items-center gap-2 text-sm shadow-none",
82
- {
83
- variants: {
84
- size: {
85
- xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
86
- sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
87
- "icon-xs":
88
- "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
89
- "icon-sm": "size-8 p-0 has-[>svg]:p-0",
90
- },
91
- },
92
- defaultVariants: {
93
- size: "xs",
94
- },
95
- }
96
- )
97
-
98
- function InputGroupButton({
99
- className,
100
- type = "button",
101
- variant = "ghost",
102
- size = "xs",
103
- ...props
104
- }: Omit<React.ComponentProps<typeof Button>, "size"> &
105
- VariantProps<typeof inputGroupButtonVariants>) {
106
- return (
107
- <Button
108
- type={type}
109
- data-size={size}
110
- variant={variant}
111
- className={cn(inputGroupButtonVariants({ size }), className)}
112
- {...props}
113
- />
114
- )
115
- }
116
-
117
- function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
118
- return (
119
- <span
120
- className={cn(
121
- "text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
122
- className
123
- )}
124
- {...props}
125
- />
126
- )
127
- }
128
-
129
- function InputGroupInput({
130
- className,
131
- ...props
132
- }: React.ComponentProps<"input">) {
133
- return (
134
- <Input
135
- data-slot="input-group-control"
136
- className={cn(
137
- "flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
138
- className
139
- )}
140
- {...props}
141
- />
142
- )
143
- }
144
-
145
- function InputGroupTextarea({
146
- className,
147
- ...props
148
- }: React.ComponentProps<"textarea">) {
149
- return (
150
- <Textarea
151
- data-slot="input-group-control"
152
- className={cn(
153
- "flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
154
- className
155
- )}
156
- {...props}
157
- />
158
- )
159
- }
160
-
161
- export {
162
- InputGroup,
163
- InputGroupAddon,
164
- InputGroupButton,
165
- InputGroupText,
166
- InputGroupInput,
167
- InputGroupTextarea,
168
- }
@@ -1,69 +0,0 @@
1
- import * as React from "react"
2
- import { OTPInput, OTPInputContext } from "input-otp"
3
- import { Dot } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const InputOTP = React.forwardRef<
8
- React.ElementRef<typeof OTPInput>,
9
- React.ComponentPropsWithoutRef<typeof OTPInput>
10
- >(({ className, containerClassName, ...props }, ref) => (
11
- <OTPInput
12
- ref={ref}
13
- containerClassName={cn(
14
- "flex items-center gap-2 has-[:disabled]:opacity-50",
15
- containerClassName
16
- )}
17
- className={cn("disabled:cursor-not-allowed", className)}
18
- {...props}
19
- />
20
- ))
21
- InputOTP.displayName = "InputOTP"
22
-
23
- const InputOTPGroup = React.forwardRef<
24
- React.ElementRef<"div">,
25
- React.ComponentPropsWithoutRef<"div">
26
- >(({ className, ...props }, ref) => (
27
- <div ref={ref} className={cn("flex items-center", className)} {...props} />
28
- ))
29
- InputOTPGroup.displayName = "InputOTPGroup"
30
-
31
- const InputOTPSlot = React.forwardRef<
32
- React.ElementRef<"div">,
33
- React.ComponentPropsWithoutRef<"div"> & { index: number }
34
- >(({ index, className, ...props }, ref) => {
35
- const inputOTPContext = React.useContext(OTPInputContext)
36
- const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]
37
-
38
- return (
39
- <div
40
- ref={ref}
41
- className={cn(
42
- "relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
43
- isActive && "z-10 ring-2 ring-ring ring-offset-background",
44
- className
45
- )}
46
- {...props}
47
- >
48
- {char}
49
- {hasFakeCaret && (
50
- <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
51
- <div className="h-4 w-px animate-caret-blink bg-foreground duration-1000" />
52
- </div>
53
- )}
54
- </div>
55
- )
56
- })
57
- InputOTPSlot.displayName = "InputOTPSlot"
58
-
59
- const InputOTPSeparator = React.forwardRef<
60
- React.ElementRef<"div">,
61
- React.ComponentPropsWithoutRef<"div">
62
- >(({ ...props }, ref) => (
63
- <div ref={ref} role="separator" {...props}>
64
- <Dot />
65
- </div>
66
- ))
67
- InputOTPSeparator.displayName = "InputOTPSeparator"
68
-
69
- export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
@@ -1,22 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
6
- ({ className, type, ...props }, ref) => {
7
- return (
8
- <input
9
- type={type}
10
- className={cn(
11
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
- className
13
- )}
14
- ref={ref}
15
- {...props}
16
- />
17
- )
18
- }
19
- )
20
- Input.displayName = "Input"
21
-
22
- export { Input }