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.
- package/dist/index.cjs +205 -120
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +205 -120
- package/dist/registry.json +1200 -288
- package/package.json +9 -4
- package/config/tailwind-preset.js +0 -106
- package/src/atoms/AccordionAtom.tsx +0 -44
- package/src/atoms/AlertAtom.tsx +0 -46
- package/src/atoms/AlertDialogAtom.tsx +0 -66
- package/src/atoms/AspectRatioAtom.tsx +0 -27
- package/src/atoms/AvatarAtom.tsx +0 -20
- package/src/atoms/BadgeAtom.tsx +0 -33
- package/src/atoms/BreadcrumbAtom.tsx +0 -36
- package/src/atoms/ButtonAtom.tsx +0 -63
- package/src/atoms/CalendarAtom.tsx +0 -24
- package/src/atoms/CardAtom.tsx +0 -64
- package/src/atoms/CarouselAtom.tsx +0 -40
- package/src/atoms/ChartAtom.tsx +0 -190
- package/src/atoms/CheckboxAtom.tsx +0 -33
- package/src/atoms/CollapsibleAtom.tsx +0 -44
- package/src/atoms/CommandAtom.tsx +0 -46
- package/src/atoms/ContextMenuAtom.tsx +0 -49
- package/src/atoms/DialogAtom.tsx +0 -68
- package/src/atoms/DrawerAtom.tsx +0 -49
- package/src/atoms/DropdownMenuAtom.tsx +0 -49
- package/src/atoms/FormInputAtom.tsx +0 -101
- package/src/atoms/FormSelectAtom.tsx +0 -110
- package/src/atoms/FormTextareaAtom.tsx +0 -93
- package/src/atoms/InputAtom.tsx +0 -188
- package/src/atoms/InputOTPAtom.tsx +0 -49
- package/src/atoms/KbdAtom.tsx +0 -25
- package/src/atoms/LabelAtom.tsx +0 -23
- package/src/atoms/LayoutAtom.tsx +0 -45
- package/src/atoms/PaginationAtom.tsx +0 -49
- package/src/atoms/PopoverAtom.tsx +0 -40
- package/src/atoms/ProgressAtom.tsx +0 -15
- package/src/atoms/RadioGroupAtom.tsx +0 -31
- package/src/atoms/RatingAtom.tsx +0 -37
- package/src/atoms/ResizableAtom.tsx +0 -51
- package/src/atoms/ScrollAreaAtom.tsx +0 -31
- package/src/atoms/SeparatorAtom.tsx +0 -16
- package/src/atoms/SheetAtom.tsx +0 -72
- package/src/atoms/SkeletonAtom.tsx +0 -22
- package/src/atoms/SliderAtom.tsx +0 -32
- package/src/atoms/SpinnerAtom.tsx +0 -26
- package/src/atoms/SwitchAtom.tsx +0 -32
- package/src/atoms/TableAtom.tsx +0 -58
- package/src/atoms/TabsAtom.tsx +0 -40
- package/src/atoms/TextAtom.tsx +0 -35
- package/src/atoms/TextareaAtom.tsx +0 -42
- package/src/atoms/TimelineAtom.tsx +0 -77
- package/src/atoms/ToggleAtom.tsx +0 -36
- package/src/atoms/TooltipAtom.tsx +0 -39
- package/src/atoms/VideoAtom.tsx +0 -34
- package/src/atoms/index.ts +0 -49
- package/src/components/index.ts +0 -178
- package/src/components/ui/accordion.tsx +0 -56
- package/src/components/ui/alert-dialog.tsx +0 -139
- package/src/components/ui/alert.tsx +0 -59
- package/src/components/ui/aspect-ratio.tsx +0 -5
- package/src/components/ui/avatar.tsx +0 -50
- package/src/components/ui/badge.tsx +0 -36
- package/src/components/ui/breadcrumb.tsx +0 -115
- package/src/components/ui/button-group.tsx +0 -83
- package/src/components/ui/button.tsx +0 -56
- package/src/components/ui/calendar.tsx +0 -213
- package/src/components/ui/card.tsx +0 -79
- package/src/components/ui/carousel.tsx +0 -260
- package/src/components/ui/chart.tsx +0 -367
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/collapsible.tsx +0 -11
- package/src/components/ui/command.tsx +0 -153
- package/src/components/ui/context-menu.tsx +0 -198
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/drawer.tsx +0 -116
- package/src/components/ui/dropdown-menu.tsx +0 -200
- package/src/components/ui/empty.tsx +0 -104
- package/src/components/ui/field.tsx +0 -244
- package/src/components/ui/form.tsx +0 -176
- package/src/components/ui/hover-card.tsx +0 -27
- package/src/components/ui/index.ts +0 -54
- package/src/components/ui/input-group.tsx +0 -168
- package/src/components/ui/input-otp.tsx +0 -69
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/item.tsx +0 -193
- package/src/components/ui/kbd.tsx +0 -28
- package/src/components/ui/label.tsx +0 -26
- package/src/components/ui/menubar.tsx +0 -254
- package/src/components/ui/navigation-menu.tsx +0 -128
- package/src/components/ui/pagination.tsx +0 -117
- package/src/components/ui/popover.tsx +0 -29
- package/src/components/ui/progress.tsx +0 -28
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/resizable.tsx +0 -44
- package/src/components/ui/scroll-area.tsx +0 -46
- package/src/components/ui/select.tsx +0 -160
- package/src/components/ui/separator.tsx +0 -29
- package/src/components/ui/sheet.tsx +0 -140
- package/src/components/ui/sidebar.tsx +0 -771
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/slider.tsx +0 -26
- package/src/components/ui/sonner.tsx +0 -45
- package/src/components/ui/spinner.tsx +0 -16
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -117
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toggle-group.tsx +0 -61
- package/src/components/ui/toggle.tsx +0 -43
- package/src/components/ui/tooltip.tsx +0 -30
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/index.ts +0 -24
- package/src/lib/countries.ts +0 -203
- package/src/lib/index.ts +0 -2
- package/src/lib/utils.ts +0 -15
- package/src/lib/validators/index.ts +0 -1
- package/src/lib/validators/theme.ts +0 -148
- package/src/molecules/creator-discovery/AudienceDemographicsCard/AudienceDemographicsCard.tsx +0 -44
- package/src/molecules/creator-discovery/AudienceDemographicsCard/index.ts +0 -1
- package/src/molecules/creator-discovery/AudienceMetricCard/AudienceMetricCard.tsx +0 -50
- package/src/molecules/creator-discovery/AudienceMetricCard/index.ts +0 -1
- package/src/molecules/creator-discovery/BrandAffinityGroup/BrandAffinityGroup.tsx +0 -36
- package/src/molecules/creator-discovery/BrandAffinityGroup/index.ts +0 -1
- package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx +0 -123
- package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.types.ts +0 -13
- package/src/molecules/creator-discovery/CampaignSeedCard/index.ts +0 -2
- package/src/molecules/creator-discovery/ContentPreviewGallery/ContentPreviewGallery.tsx +0 -41
- package/src/molecules/creator-discovery/ContentPreviewGallery/index.ts +0 -1
- package/src/molecules/creator-discovery/CreatorActionHeader/CreatorActionHeader.tsx +0 -77
- package/src/molecules/creator-discovery/CreatorActionHeader/index.ts +0 -1
- package/src/molecules/creator-discovery/CreatorGridCard/CreatorGridCard.tsx +0 -104
- package/src/molecules/creator-discovery/CreatorGridCard/index.ts +0 -1
- package/src/molecules/creator-discovery/CreatorProfileSummary/CreatorProfileSummary.tsx +0 -65
- package/src/molecules/creator-discovery/CreatorProfileSummary/index.ts +0 -1
- package/src/molecules/creator-discovery/GrowthChartCard/GrowthChartCard.tsx +0 -58
- package/src/molecules/creator-discovery/GrowthChartCard/index.ts +0 -1
- package/src/molecules/creator-discovery/MCQCard/MCQCard.tsx +0 -165
- package/src/molecules/creator-discovery/MCQCard/MCQCard.types.ts +0 -71
- package/src/molecules/creator-discovery/MCQCard/index.ts +0 -2
- package/src/molecules/creator-discovery/PlatformIconGroup/PlatformIconGroup.tsx +0 -72
- package/src/molecules/creator-discovery/PlatformIconGroup/index.ts +0 -1
- package/src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx +0 -334
- package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx +0 -111
- package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.types.ts +0 -18
- package/src/molecules/creator-discovery/SearchSpecCard/index.ts +0 -3
- package/src/molecules/creator-discovery/TopPostsGrid/TopPostsGrid.tsx +0 -49
- package/src/molecules/creator-discovery/TopPostsGrid/index.ts +0 -1
- package/src/molecules/creator-discovery/index.ts +0 -13
- package/src/molecules/generic/ActionButton/ActionButton.tsx +0 -137
- package/src/molecules/generic/ActionButton/ActionButton.types.ts +0 -68
- package/src/molecules/generic/ActionButton/index.ts +0 -2
- package/src/molecules/generic/DataGrid/DataGrid.tsx +0 -102
- package/src/molecules/generic/DataGrid/index.ts +0 -1
- package/src/molecules/generic/EditableField/EditableField.tsx +0 -229
- package/src/molecules/generic/EditableField/EditableField.types.ts +0 -73
- package/src/molecules/generic/EditableField/index.ts +0 -2
- package/src/molecules/generic/EmptyState/EmptyState.tsx +0 -61
- package/src/molecules/generic/EmptyState/index.ts +0 -1
- package/src/molecules/generic/FileUpload/FileUpload.tsx +0 -62
- package/src/molecules/generic/FileUpload/index.ts +0 -1
- package/src/molecules/generic/FilterBar/FilterBar.tsx +0 -54
- package/src/molecules/generic/FilterBar/index.ts +0 -1
- package/src/molecules/generic/FormCard/FormCard.tsx +0 -136
- package/src/molecules/generic/FormCard/FormCard.types.ts +0 -93
- package/src/molecules/generic/FormCard/index.ts +0 -2
- package/src/molecules/generic/LoadingOverlay/LoadingOverlay.tsx +0 -39
- package/src/molecules/generic/LoadingOverlay/index.ts +0 -1
- package/src/molecules/generic/NotificationList/NotificationList.tsx +0 -80
- package/src/molecules/generic/NotificationList/index.ts +0 -1
- package/src/molecules/generic/StatsGrid/StatsGrid.tsx +0 -80
- package/src/molecules/generic/StatsGrid/index.ts +0 -1
- package/src/molecules/generic/StepWizard/StepWizard.tsx +0 -67
- package/src/molecules/generic/StepWizard/index.ts +0 -1
- package/src/molecules/generic/TagCloud/TagCloud.tsx +0 -32
- package/src/molecules/generic/TagCloud/index.ts +0 -1
- package/src/molecules/generic/index.ts +0 -12
- package/src/molecules/index.ts +0 -2
- package/src/render/PXEngineRenderer.tsx +0 -416
- package/src/render/index.ts +0 -1
- package/src/styles/globals.css +0 -146
- package/src/types/atoms.ts +0 -449
- package/src/types/common.ts +0 -116
- package/src/types/index.ts +0 -3
- package/src/types/molecules.ts +0 -279
- 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 }
|