@inspirare/design-system 0.0.9 → 0.0.10

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 (54) hide show
  1. package/dist/index.css +1 -1
  2. package/package.json +5 -3
  3. package/src/App.css +184 -0
  4. package/src/App.tsx +222 -0
  5. package/src/assets/hero.png +0 -0
  6. package/src/assets/react.svg +1 -0
  7. package/src/assets/vite.svg +1 -0
  8. package/src/components/ui/accessibility-improvements.tsx +117 -0
  9. package/src/components/ui/accordion.tsx +66 -0
  10. package/src/components/ui/alert-dialog.tsx +151 -0
  11. package/src/components/ui/avatar.tsx +53 -0
  12. package/src/components/ui/badge.tsx +46 -0
  13. package/src/components/ui/button.tsx +59 -0
  14. package/src/components/ui/calendar.tsx +220 -0
  15. package/src/components/ui/card.tsx +92 -0
  16. package/src/components/ui/checkbox.tsx +32 -0
  17. package/src/components/ui/collapsible.tsx +36 -0
  18. package/src/components/ui/color-picker.tsx +183 -0
  19. package/src/components/ui/command.tsx +184 -0
  20. package/src/components/ui/dialog.tsx +157 -0
  21. package/src/components/ui/drawer.tsx +149 -0
  22. package/src/components/ui/dropdown-menu.tsx +259 -0
  23. package/src/components/ui/form.tsx +168 -0
  24. package/src/components/ui/hover-card.tsx +49 -0
  25. package/src/components/ui/input.tsx +21 -0
  26. package/src/components/ui/label.tsx +24 -0
  27. package/src/components/ui/popover.tsx +55 -0
  28. package/src/components/ui/progress.tsx +31 -0
  29. package/src/components/ui/radio-group.tsx +43 -0
  30. package/src/components/ui/scroll-area.tsx +32 -0
  31. package/src/components/ui/select.tsx +185 -0
  32. package/src/components/ui/separator.tsx +28 -0
  33. package/src/components/ui/sheet.tsx +153 -0
  34. package/src/components/ui/skeleton.tsx +121 -0
  35. package/src/components/ui/slider.tsx +63 -0
  36. package/src/components/ui/sonner.tsx +25 -0
  37. package/src/components/ui/switch.tsx +35 -0
  38. package/src/components/ui/table.tsx +116 -0
  39. package/src/components/ui/tabs.tsx +66 -0
  40. package/src/components/ui/textarea.tsx +18 -0
  41. package/src/components/ui/theme-toggle.tsx +106 -0
  42. package/src/components/ui/toggle-group.tsx +73 -0
  43. package/src/components/ui/toggle.tsx +47 -0
  44. package/src/components/ui/tooltip.tsx +68 -0
  45. package/src/demo/ButtonsDemo.tsx +82 -0
  46. package/src/demo/CalendarDemo.tsx +25 -0
  47. package/src/demo/FeedbackDemo.tsx +113 -0
  48. package/src/demo/FormsDemo.tsx +100 -0
  49. package/src/demo/NavigationDemo.tsx +141 -0
  50. package/src/demo/OverlaysDemo.tsx +187 -0
  51. package/src/index.css +1434 -0
  52. package/src/index.ts +41 -0
  53. package/src/lib/utils.ts +6 -0
  54. package/src/main.tsx +13 -0
@@ -0,0 +1,259 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
5
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ function DropdownMenu({
10
+ ...props
11
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
12
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
13
+ }
14
+
15
+ function DropdownMenuPortal({
16
+ ...props
17
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
18
+ return (
19
+ <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
20
+ );
21
+ }
22
+
23
+ function DropdownMenuTrigger({
24
+ className,
25
+ ...props
26
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
27
+ return (
28
+ <DropdownMenuPrimitive.Trigger
29
+ data-slot="dropdown-menu-trigger"
30
+ className={cn("cursor-pointer", className)}
31
+ {...props}
32
+ />
33
+ );
34
+ }
35
+
36
+ function DropdownMenuContent({
37
+ className,
38
+ sideOffset = 4,
39
+ ...props
40
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
41
+ return (
42
+ <DropdownMenuPrimitive.Portal>
43
+ <DropdownMenuPrimitive.Content
44
+ data-slot="dropdown-menu-content"
45
+ sideOffset={sideOffset}
46
+ className={cn(
47
+ "bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
48
+ className
49
+ )}
50
+ {...props}
51
+ />
52
+ </DropdownMenuPrimitive.Portal>
53
+ );
54
+ }
55
+
56
+ function DropdownMenuGroup({
57
+ ...props
58
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
59
+ return (
60
+ <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
61
+ );
62
+ }
63
+
64
+ function DropdownMenuItem({
65
+ className,
66
+ inset,
67
+ variant = "default",
68
+ ...props
69
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
70
+ inset?: boolean;
71
+ variant?: "default" | "destructive";
72
+ }) {
73
+ return (
74
+ <DropdownMenuPrimitive.Item
75
+ data-slot="dropdown-menu-item"
76
+ data-inset={inset}
77
+ data-variant={variant}
78
+ className={cn(
79
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
80
+ className
81
+ )}
82
+ {...props}
83
+ />
84
+ );
85
+ }
86
+
87
+ function DropdownMenuCheckboxItem({
88
+ className,
89
+ children,
90
+ checked,
91
+ ...props
92
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
93
+ return (
94
+ <DropdownMenuPrimitive.CheckboxItem
95
+ data-slot="dropdown-menu-checkbox-item"
96
+ className={cn(
97
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
98
+ className
99
+ )}
100
+ checked={checked}
101
+ {...props}
102
+ >
103
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
104
+ <DropdownMenuPrimitive.ItemIndicator>
105
+ <CheckIcon className="size-4" />
106
+ </DropdownMenuPrimitive.ItemIndicator>
107
+ </span>
108
+ {children}
109
+ </DropdownMenuPrimitive.CheckboxItem>
110
+ );
111
+ }
112
+
113
+ function DropdownMenuRadioGroup({
114
+ ...props
115
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
116
+ return (
117
+ <DropdownMenuPrimitive.RadioGroup
118
+ data-slot="dropdown-menu-radio-group"
119
+ {...props}
120
+ />
121
+ );
122
+ }
123
+
124
+ function DropdownMenuRadioItem({
125
+ className,
126
+ children,
127
+ ...props
128
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
129
+ return (
130
+ <DropdownMenuPrimitive.RadioItem
131
+ data-slot="dropdown-menu-radio-item"
132
+ className={cn(
133
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
134
+ className
135
+ )}
136
+ {...props}
137
+ >
138
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
139
+ <DropdownMenuPrimitive.ItemIndicator>
140
+ <CircleIcon className="size-2 fill-current" />
141
+ </DropdownMenuPrimitive.ItemIndicator>
142
+ </span>
143
+ {children}
144
+ </DropdownMenuPrimitive.RadioItem>
145
+ );
146
+ }
147
+
148
+ function DropdownMenuLabel({
149
+ className,
150
+ inset,
151
+ ...props
152
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
153
+ inset?: boolean;
154
+ }) {
155
+ return (
156
+ <DropdownMenuPrimitive.Label
157
+ data-slot="dropdown-menu-label"
158
+ data-inset={inset}
159
+ className={cn(
160
+ "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
161
+ className
162
+ )}
163
+ {...props}
164
+ />
165
+ );
166
+ }
167
+
168
+ function DropdownMenuSeparator({
169
+ className,
170
+ ...props
171
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
172
+ return (
173
+ <DropdownMenuPrimitive.Separator
174
+ data-slot="dropdown-menu-separator"
175
+ className={cn("bg-border -mx-1 my-1 h-px", className)}
176
+ {...props}
177
+ />
178
+ );
179
+ }
180
+
181
+ function DropdownMenuShortcut({
182
+ className,
183
+ ...props
184
+ }: React.ComponentProps<"span">) {
185
+ return (
186
+ <span
187
+ data-slot="dropdown-menu-shortcut"
188
+ className={cn(
189
+ "text-muted-foreground ml-auto text-xs tracking-widest",
190
+ className
191
+ )}
192
+ {...props}
193
+ />
194
+ );
195
+ }
196
+
197
+ function DropdownMenuSub({
198
+ ...props
199
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
200
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
201
+ }
202
+
203
+ function DropdownMenuSubTrigger({
204
+ className,
205
+ inset,
206
+ children,
207
+ ...props
208
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
209
+ inset?: boolean;
210
+ }) {
211
+ return (
212
+ <DropdownMenuPrimitive.SubTrigger
213
+ data-slot="dropdown-menu-sub-trigger"
214
+ data-inset={inset}
215
+ className={cn(
216
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-pointer items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
217
+ className
218
+ )}
219
+ {...props}
220
+ >
221
+ {children}
222
+ <ChevronRightIcon className="ml-auto size-4" />
223
+ </DropdownMenuPrimitive.SubTrigger>
224
+ );
225
+ }
226
+
227
+ function DropdownMenuSubContent({
228
+ className,
229
+ ...props
230
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
231
+ return (
232
+ <DropdownMenuPrimitive.SubContent
233
+ data-slot="dropdown-menu-sub-content"
234
+ className={cn(
235
+ "bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
236
+ className
237
+ )}
238
+ {...props}
239
+ />
240
+ );
241
+ }
242
+
243
+ export {
244
+ DropdownMenu,
245
+ DropdownMenuPortal,
246
+ DropdownMenuTrigger,
247
+ DropdownMenuContent,
248
+ DropdownMenuGroup,
249
+ DropdownMenuLabel,
250
+ DropdownMenuItem,
251
+ DropdownMenuCheckboxItem,
252
+ DropdownMenuRadioGroup,
253
+ DropdownMenuRadioItem,
254
+ DropdownMenuSeparator,
255
+ DropdownMenuShortcut,
256
+ DropdownMenuSub,
257
+ DropdownMenuSubTrigger,
258
+ DropdownMenuSubContent,
259
+ };
@@ -0,0 +1,168 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as LabelPrimitive from "@radix-ui/react-label";
5
+ import { Slot } from "@radix-ui/react-slot";
6
+ import {
7
+ Controller,
8
+ FormProvider,
9
+ useFormContext,
10
+ useFormState,
11
+ type ControllerProps,
12
+ type FieldPath,
13
+ type FieldValues,
14
+ } from "react-hook-form";
15
+
16
+ import { cn } from "@/lib/utils";
17
+ import { Label } from "@/components/ui/label";
18
+
19
+ const Form = FormProvider;
20
+
21
+ type FormFieldContextValue<
22
+ TFieldValues extends FieldValues = FieldValues,
23
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
24
+ > = {
25
+ name: TName;
26
+ };
27
+
28
+ const FormFieldContext = React.createContext<FormFieldContextValue>(
29
+ {} as FormFieldContextValue
30
+ );
31
+
32
+ const FormField = <
33
+ TFieldValues extends FieldValues = FieldValues,
34
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
35
+ >({
36
+ ...props
37
+ }: ControllerProps<TFieldValues, TName>) => {
38
+ return (
39
+ <FormFieldContext.Provider value={{ name: props.name }}>
40
+ <Controller {...props} />
41
+ </FormFieldContext.Provider>
42
+ );
43
+ };
44
+
45
+ const useFormField = () => {
46
+ const fieldContext = React.useContext(FormFieldContext);
47
+ const itemContext = React.useContext(FormItemContext);
48
+ const { getFieldState } = useFormContext();
49
+ const formState = useFormState({ name: fieldContext.name });
50
+ const fieldState = getFieldState(fieldContext.name, formState);
51
+
52
+ if (!fieldContext) {
53
+ throw new Error("useFormField should be used within <FormField>");
54
+ }
55
+
56
+ const { id } = itemContext;
57
+
58
+ return {
59
+ id,
60
+ name: fieldContext.name,
61
+ formItemId: `${id}-form-item`,
62
+ formDescriptionId: `${id}-form-item-description`,
63
+ formMessageId: `${id}-form-item-message`,
64
+ ...fieldState,
65
+ };
66
+ };
67
+
68
+ type FormItemContextValue = {
69
+ id: string;
70
+ };
71
+
72
+ const FormItemContext = React.createContext<FormItemContextValue>(
73
+ {} as FormItemContextValue
74
+ );
75
+
76
+ function FormItem({ className, ...props }: React.ComponentProps<"div">) {
77
+ const id = React.useId();
78
+
79
+ return (
80
+ <FormItemContext.Provider value={{ id }}>
81
+ <div
82
+ data-slot="form-item"
83
+ className={cn("grid gap-2", className)}
84
+ {...props}
85
+ />
86
+ </FormItemContext.Provider>
87
+ );
88
+ }
89
+
90
+ function FormLabel({
91
+ className,
92
+ ...props
93
+ }: React.ComponentProps<typeof LabelPrimitive.Root>) {
94
+ const { error, formItemId } = useFormField();
95
+
96
+ return (
97
+ <Label
98
+ data-slot="form-label"
99
+ data-error={!!error}
100
+ className={cn("data-[error=true]:text-destructive", className)}
101
+ htmlFor={formItemId}
102
+ {...props}
103
+ />
104
+ );
105
+ }
106
+
107
+ function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
108
+ const { error, formItemId, formDescriptionId, formMessageId } =
109
+ useFormField();
110
+
111
+ return (
112
+ <Slot
113
+ data-slot="form-control"
114
+ id={formItemId}
115
+ aria-describedby={
116
+ !error
117
+ ? `${formDescriptionId}`
118
+ : `${formDescriptionId} ${formMessageId}`
119
+ }
120
+ aria-invalid={!!error}
121
+ {...props}
122
+ />
123
+ );
124
+ }
125
+
126
+ function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
127
+ const { formDescriptionId } = useFormField();
128
+
129
+ return (
130
+ <p
131
+ data-slot="form-description"
132
+ id={formDescriptionId}
133
+ className={cn("text-muted-foreground text-sm", className)}
134
+ {...props}
135
+ />
136
+ );
137
+ }
138
+
139
+ function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
140
+ const { error, formMessageId } = useFormField();
141
+ const body = error ? String(error?.message ?? "") : props.children;
142
+
143
+ if (!body) {
144
+ return null;
145
+ }
146
+
147
+ return (
148
+ <p
149
+ data-slot="form-message"
150
+ id={formMessageId}
151
+ className={cn("text-destructive text-sm", className)}
152
+ {...props}
153
+ >
154
+ {body}
155
+ </p>
156
+ );
157
+ }
158
+
159
+ export {
160
+ useFormField,
161
+ Form,
162
+ FormItem,
163
+ FormLabel,
164
+ FormControl,
165
+ FormDescription,
166
+ FormMessage,
167
+ FormField,
168
+ };
@@ -0,0 +1,49 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function HoverCard({
9
+ ...props
10
+ }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
11
+ return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />;
12
+ }
13
+
14
+ function HoverCardTrigger({
15
+ className,
16
+ ...props
17
+ }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
18
+ return (
19
+ <HoverCardPrimitive.Trigger
20
+ data-slot="hover-card-trigger"
21
+ className={cn("cursor-pointer", className)}
22
+ {...props}
23
+ />
24
+ );
25
+ }
26
+
27
+ function HoverCardContent({
28
+ className,
29
+ align = "center",
30
+ sideOffset = 4,
31
+ ...props
32
+ }: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
33
+ return (
34
+ <HoverCardPrimitive.Portal data-slot="hover-card-portal">
35
+ <HoverCardPrimitive.Content
36
+ data-slot="hover-card-content"
37
+ align={align}
38
+ sideOffset={sideOffset}
39
+ className={cn(
40
+ "bg-popover text-popover-foreground 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 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ </HoverCardPrimitive.Portal>
46
+ );
47
+ }
48
+
49
+ export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
+ return (
7
+ <input
8
+ type={type}
9
+ data-slot="input"
10
+ className={cn(
11
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
13
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
14
+ className
15
+ )}
16
+ {...props}
17
+ />
18
+ );
19
+ }
20
+
21
+ export { Input };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as LabelPrimitive from "@radix-ui/react-label";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function Label({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<typeof LabelPrimitive.Root>) {
12
+ return (
13
+ <LabelPrimitive.Root
14
+ data-slot="label"
15
+ className={cn(
16
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
17
+ className
18
+ )}
19
+ {...props}
20
+ />
21
+ );
22
+ }
23
+
24
+ export { Label };
@@ -0,0 +1,55 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function Popover({
9
+ ...props
10
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />;
12
+ }
13
+
14
+ function PopoverTrigger({
15
+ className,
16
+ ...props
17
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
18
+ return (
19
+ <PopoverPrimitive.Trigger
20
+ data-slot="popover-trigger"
21
+ className={cn("cursor-pointer", className)}
22
+ {...props}
23
+ />
24
+ );
25
+ }
26
+
27
+ function PopoverContent({
28
+ className,
29
+ align = "center",
30
+ sideOffset = 4,
31
+ ...props
32
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
33
+ return (
34
+ <PopoverPrimitive.Portal>
35
+ <PopoverPrimitive.Content
36
+ data-slot="popover-content"
37
+ align={align}
38
+ sideOffset={sideOffset}
39
+ className={cn(
40
+ "bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ </PopoverPrimitive.Portal>
46
+ );
47
+ }
48
+
49
+ function PopoverAnchor({
50
+ ...props
51
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
52
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
53
+ }
54
+
55
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as ProgressPrimitive from "@radix-ui/react-progress";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function Progress({
9
+ className,
10
+ value,
11
+ ...props
12
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
13
+ return (
14
+ <ProgressPrimitive.Root
15
+ data-slot="progress"
16
+ className={cn(
17
+ "bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
18
+ className
19
+ )}
20
+ {...props}
21
+ >
22
+ <ProgressPrimitive.Indicator
23
+ data-slot="progress-indicator"
24
+ className="bg-primary h-full w-full flex-1 transition-all"
25
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
26
+ />
27
+ </ProgressPrimitive.Root>
28
+ );
29
+ }
30
+
31
+ export { Progress };
@@ -0,0 +1,43 @@
1
+ import * as React from "react"
2
+ import { CircleIcon } from "lucide-react"
3
+ import { RadioGroup as RadioGroupPrimitive } from "radix-ui"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function RadioGroup({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
11
+ return (
12
+ <RadioGroupPrimitive.Root
13
+ data-slot="radio-group"
14
+ className={cn("grid gap-3", className)}
15
+ {...props}
16
+ />
17
+ )
18
+ }
19
+
20
+ function RadioGroupItem({
21
+ className,
22
+ ...props
23
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
24
+ return (
25
+ <RadioGroupPrimitive.Item
26
+ data-slot="radio-group-item"
27
+ className={cn(
28
+ "aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
29
+ className
30
+ )}
31
+ {...props}
32
+ >
33
+ <RadioGroupPrimitive.Indicator
34
+ data-slot="radio-group-indicator"
35
+ className="relative flex items-center justify-center"
36
+ >
37
+ <CircleIcon className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" />
38
+ </RadioGroupPrimitive.Indicator>
39
+ </RadioGroupPrimitive.Item>
40
+ )
41
+ }
42
+
43
+ export { RadioGroup, RadioGroupItem }
@@ -0,0 +1,32 @@
1
+ "use client";
2
+
3
+ import { cn } from "@/lib/utils";
4
+ import * as React from "react";
5
+
6
+ export type ScrollAreaProps = {
7
+ className?: string;
8
+ children?: React.ReactNode;
9
+ };
10
+
11
+ const ScrollArea = React.memo(function ScrollArea({
12
+ className,
13
+ children,
14
+ }: ScrollAreaProps) {
15
+ return (
16
+ <div
17
+ data-slot="scroll-area"
18
+ className={cn("relative overflow-auto", className)}
19
+ >
20
+ <div
21
+ data-slot="scroll-area-viewport"
22
+ className="size-full rounded-[inherit]"
23
+ >
24
+ {children}
25
+ </div>
26
+ </div>
27
+ );
28
+ });
29
+
30
+ const ScrollBar = () => null;
31
+
32
+ export { ScrollArea, ScrollBar };