@inspirare/design-system 0.0.8 → 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,185 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as SelectPrimitive from "@radix-ui/react-select";
5
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ function Select({
10
+ ...props
11
+ }: React.ComponentProps<typeof SelectPrimitive.Root>) {
12
+ return <SelectPrimitive.Root data-slot="select" {...props} />;
13
+ }
14
+
15
+ function SelectGroup({
16
+ ...props
17
+ }: React.ComponentProps<typeof SelectPrimitive.Group>) {
18
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />;
19
+ }
20
+
21
+ function SelectValue({
22
+ ...props
23
+ }: React.ComponentProps<typeof SelectPrimitive.Value>) {
24
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />;
25
+ }
26
+
27
+ function SelectTrigger({
28
+ className,
29
+ size = "default",
30
+ children,
31
+ ...props
32
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
33
+ size?: "sm" | "default";
34
+ }) {
35
+ return (
36
+ <SelectPrimitive.Trigger
37
+ data-slot="select-trigger"
38
+ data-size={size}
39
+ className={cn(
40
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit cursor-pointer items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
41
+ className
42
+ )}
43
+ {...props}
44
+ >
45
+ {children}
46
+ <SelectPrimitive.Icon asChild>
47
+ <ChevronDownIcon className="size-4 opacity-50" />
48
+ </SelectPrimitive.Icon>
49
+ </SelectPrimitive.Trigger>
50
+ );
51
+ }
52
+
53
+ function SelectContent({
54
+ className,
55
+ children,
56
+ position = "popper",
57
+ ...props
58
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
59
+ return (
60
+ <SelectPrimitive.Portal>
61
+ <SelectPrimitive.Content
62
+ data-slot="select-content"
63
+ className={cn(
64
+ "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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
65
+ position === "popper" &&
66
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
67
+ className
68
+ )}
69
+ position={position}
70
+ {...props}
71
+ >
72
+ <SelectScrollUpButton />
73
+ <SelectPrimitive.Viewport
74
+ className={cn(
75
+ "p-1",
76
+ position === "popper" &&
77
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
78
+ )}
79
+ >
80
+ {children}
81
+ </SelectPrimitive.Viewport>
82
+ <SelectScrollDownButton />
83
+ </SelectPrimitive.Content>
84
+ </SelectPrimitive.Portal>
85
+ );
86
+ }
87
+
88
+ function SelectLabel({
89
+ className,
90
+ ...props
91
+ }: React.ComponentProps<typeof SelectPrimitive.Label>) {
92
+ return (
93
+ <SelectPrimitive.Label
94
+ data-slot="select-label"
95
+ className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
96
+ {...props}
97
+ />
98
+ );
99
+ }
100
+
101
+ function SelectItem({
102
+ className,
103
+ children,
104
+ ...props
105
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
106
+ return (
107
+ <SelectPrimitive.Item
108
+ data-slot="select-item"
109
+ className={cn(
110
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
111
+ className
112
+ )}
113
+ {...props}
114
+ >
115
+ <span className="absolute right-2 flex size-3.5 items-center justify-center">
116
+ <SelectPrimitive.ItemIndicator>
117
+ <CheckIcon className="size-4" />
118
+ </SelectPrimitive.ItemIndicator>
119
+ </span>
120
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
121
+ </SelectPrimitive.Item>
122
+ );
123
+ }
124
+
125
+ function SelectSeparator({
126
+ className,
127
+ ...props
128
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
129
+ return (
130
+ <SelectPrimitive.Separator
131
+ data-slot="select-separator"
132
+ className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
133
+ {...props}
134
+ />
135
+ );
136
+ }
137
+
138
+ function SelectScrollUpButton({
139
+ className,
140
+ ...props
141
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
142
+ return (
143
+ <SelectPrimitive.ScrollUpButton
144
+ data-slot="select-scroll-up-button"
145
+ className={cn(
146
+ "flex cursor-pointer items-center justify-center py-1",
147
+ className
148
+ )}
149
+ {...props}
150
+ >
151
+ <ChevronUpIcon className="size-4" />
152
+ </SelectPrimitive.ScrollUpButton>
153
+ );
154
+ }
155
+
156
+ function SelectScrollDownButton({
157
+ className,
158
+ ...props
159
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
160
+ return (
161
+ <SelectPrimitive.ScrollDownButton
162
+ data-slot="select-scroll-down-button"
163
+ className={cn(
164
+ "flex cursor-pointer items-center justify-center py-1",
165
+ className
166
+ )}
167
+ {...props}
168
+ >
169
+ <ChevronDownIcon className="size-4" />
170
+ </SelectPrimitive.ScrollDownButton>
171
+ );
172
+ }
173
+
174
+ export {
175
+ Select,
176
+ SelectContent,
177
+ SelectGroup,
178
+ SelectItem,
179
+ SelectLabel,
180
+ SelectScrollDownButton,
181
+ SelectScrollUpButton,
182
+ SelectSeparator,
183
+ SelectTrigger,
184
+ SelectValue,
185
+ };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function Separator({
9
+ className,
10
+ orientation = "horizontal",
11
+ decorative = true,
12
+ ...props
13
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
14
+ return (
15
+ <SeparatorPrimitive.Root
16
+ data-slot="separator"
17
+ decorative={decorative}
18
+ orientation={orientation}
19
+ className={cn(
20
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
21
+ className
22
+ )}
23
+ {...props}
24
+ />
25
+ );
26
+ }
27
+
28
+ export { Separator };
@@ -0,0 +1,153 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
5
+ import { XIcon } from "lucide-react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
10
+ return <SheetPrimitive.Root data-slot="sheet" {...props} />;
11
+ }
12
+
13
+ function SheetTrigger({
14
+ className,
15
+ ...props
16
+ }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
17
+ return (
18
+ <SheetPrimitive.Trigger
19
+ data-slot="sheet-trigger"
20
+ className={cn("cursor-pointer", className)}
21
+ {...props}
22
+ />
23
+ );
24
+ }
25
+
26
+ function SheetClose({
27
+ className,
28
+ ...props
29
+ }: React.ComponentProps<typeof SheetPrimitive.Close>) {
30
+ return (
31
+ <SheetPrimitive.Close
32
+ data-slot="sheet-close"
33
+ className={cn("cursor-pointer", className)}
34
+ {...props}
35
+ />
36
+ );
37
+ }
38
+
39
+ function SheetPortal({
40
+ ...props
41
+ }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
42
+ return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
43
+ }
44
+
45
+ function SheetOverlay({
46
+ className,
47
+ ...props
48
+ }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
49
+ return (
50
+ <SheetPrimitive.Overlay
51
+ data-slot="sheet-overlay"
52
+ className={cn(
53
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
54
+ className
55
+ )}
56
+ {...props}
57
+ />
58
+ );
59
+ }
60
+
61
+ function SheetContent({
62
+ className,
63
+ children,
64
+ side = "right",
65
+ ...props
66
+ }: React.ComponentProps<typeof SheetPrimitive.Content> & {
67
+ side?: "top" | "right" | "bottom" | "left";
68
+ }) {
69
+ return (
70
+ <SheetPortal>
71
+ <SheetOverlay />
72
+ <SheetPrimitive.Content
73
+ data-slot="sheet-content"
74
+ className={cn(
75
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
76
+ side === "right" &&
77
+ "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
78
+ side === "left" &&
79
+ "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
80
+ side === "top" &&
81
+ "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
82
+ side === "bottom" &&
83
+ "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
84
+ className
85
+ )}
86
+ {...props}
87
+ >
88
+ {children}
89
+ <SheetPrimitive.Close className="ring-offset-background cursor-pointer focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
90
+ <XIcon className="size-4" />
91
+ <span className="sr-only">Close</span>
92
+ </SheetPrimitive.Close>
93
+ </SheetPrimitive.Content>
94
+ </SheetPortal>
95
+ );
96
+ }
97
+
98
+ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
99
+ return (
100
+ <div
101
+ data-slot="sheet-header"
102
+ className={cn("flex flex-col gap-1.5 p-4", className)}
103
+ {...props}
104
+ />
105
+ );
106
+ }
107
+
108
+ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
109
+ return (
110
+ <div
111
+ data-slot="sheet-footer"
112
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
113
+ {...props}
114
+ />
115
+ );
116
+ }
117
+
118
+ function SheetTitle({
119
+ className,
120
+ ...props
121
+ }: React.ComponentProps<typeof SheetPrimitive.Title>) {
122
+ return (
123
+ <SheetPrimitive.Title
124
+ data-slot="sheet-title"
125
+ className={cn("text-foreground font-semibold", className)}
126
+ {...props}
127
+ />
128
+ );
129
+ }
130
+
131
+ function SheetDescription({
132
+ className,
133
+ ...props
134
+ }: React.ComponentProps<typeof SheetPrimitive.Description>) {
135
+ return (
136
+ <SheetPrimitive.Description
137
+ data-slot="sheet-description"
138
+ className={cn("text-muted-foreground text-sm", className)}
139
+ {...props}
140
+ />
141
+ );
142
+ }
143
+
144
+ export {
145
+ Sheet,
146
+ SheetTrigger,
147
+ SheetClose,
148
+ SheetContent,
149
+ SheetHeader,
150
+ SheetFooter,
151
+ SheetTitle,
152
+ SheetDescription,
153
+ };
@@ -0,0 +1,121 @@
1
+ import { cn } from "@/lib/utils";
2
+
3
+ function Skeleton({
4
+ className,
5
+ ...props
6
+ }: React.HTMLAttributes<HTMLDivElement>) {
7
+ return (
8
+ <div
9
+ className={cn(
10
+ "animate-pulse rounded-md bg-gradient-to-r from-muted via-muted/80 to-muted",
11
+ "relative overflow-hidden",
12
+ "before:absolute before:inset-0",
13
+ "before:bg-gradient-to-r before:from-transparent before:via-primary/5 before:to-transparent",
14
+ "before:animate-[shimmer_2s_ease-in-out_infinite]",
15
+ className
16
+ )}
17
+ {...props}
18
+ />
19
+ );
20
+ }
21
+
22
+ // Skeleton variants with Inspirare visual identity
23
+ function SkeletonText({
24
+ className,
25
+ variant = "default",
26
+ ...props
27
+ }: React.HTMLAttributes<HTMLDivElement> & {
28
+ variant?: "default" | "title" | "subtitle" | "caption";
29
+ }) {
30
+ const variants = {
31
+ default: "h-4",
32
+ title: "h-6",
33
+ subtitle: "h-5",
34
+ caption: "h-3",
35
+ };
36
+
37
+ return (
38
+ <Skeleton
39
+ className={cn(
40
+ variants[variant],
41
+ "bg-gradient-to-r from-muted via-primary/10 to-muted",
42
+ className
43
+ )}
44
+ {...props}
45
+ />
46
+ );
47
+ }
48
+
49
+ function SkeletonAvatar({
50
+ className,
51
+ size = "default",
52
+ ...props
53
+ }: React.HTMLAttributes<HTMLDivElement> & {
54
+ size?: "sm" | "default" | "lg";
55
+ }) {
56
+ const sizes = {
57
+ sm: "h-6 w-6",
58
+ default: "h-8 w-8",
59
+ lg: "h-12 w-12",
60
+ };
61
+
62
+ return (
63
+ <Skeleton
64
+ className={cn(
65
+ "rounded-full",
66
+ sizes[size],
67
+ "bg-gradient-to-br from-primary/20 via-muted to-primary/10",
68
+ className
69
+ )}
70
+ {...props}
71
+ />
72
+ );
73
+ }
74
+
75
+ function SkeletonButton({
76
+ className,
77
+ variant = "default",
78
+ ...props
79
+ }: React.HTMLAttributes<HTMLDivElement> & {
80
+ variant?: "default" | "sm" | "lg";
81
+ }) {
82
+ const variants = {
83
+ sm: "h-7 w-16",
84
+ default: "h-9 w-20",
85
+ lg: "h-11 w-24",
86
+ };
87
+
88
+ return (
89
+ <Skeleton
90
+ className={cn(
91
+ "rounded-md",
92
+ variants[variant],
93
+ "bg-gradient-to-r from-primary/10 via-muted to-primary/5",
94
+ className
95
+ )}
96
+ {...props}
97
+ />
98
+ );
99
+ }
100
+
101
+ function SkeletonCard({
102
+ className,
103
+ children,
104
+ ...props
105
+ }: React.HTMLAttributes<HTMLDivElement>) {
106
+ return (
107
+ <div
108
+ className={cn(
109
+ "rounded-lg border border-border/50 p-4 space-y-3",
110
+ "bg-gradient-to-br from-background via-background/95 to-primary/5",
111
+ "shadow-sm",
112
+ className
113
+ )}
114
+ {...props}
115
+ >
116
+ {children}
117
+ </div>
118
+ );
119
+ }
120
+
121
+ export { Skeleton, SkeletonText, SkeletonAvatar, SkeletonButton, SkeletonCard };
@@ -0,0 +1,63 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as SliderPrimitive from "@radix-ui/react-slider";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function Slider({
9
+ className,
10
+ defaultValue,
11
+ value,
12
+ min = 0,
13
+ max = 100,
14
+ ...props
15
+ }: React.ComponentProps<typeof SliderPrimitive.Root>) {
16
+ const _values = React.useMemo(
17
+ () =>
18
+ Array.isArray(value)
19
+ ? value
20
+ : Array.isArray(defaultValue)
21
+ ? defaultValue
22
+ : [min, max],
23
+ [value, defaultValue, min, max]
24
+ );
25
+
26
+ return (
27
+ <SliderPrimitive.Root
28
+ data-slot="slider"
29
+ defaultValue={defaultValue}
30
+ value={value}
31
+ min={min}
32
+ max={max}
33
+ className={cn(
34
+ "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
35
+ className
36
+ )}
37
+ {...props}
38
+ >
39
+ <SliderPrimitive.Track
40
+ data-slot="slider-track"
41
+ className={cn(
42
+ "bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
43
+ )}
44
+ >
45
+ <SliderPrimitive.Range
46
+ data-slot="slider-range"
47
+ className={cn(
48
+ "bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
49
+ )}
50
+ />
51
+ </SliderPrimitive.Track>
52
+ {Array.from({ length: _values.length }, (_, index) => (
53
+ <SliderPrimitive.Thumb
54
+ data-slot="slider-thumb"
55
+ key={index}
56
+ className="border-primary bg-background ring-ring/50 block size-4 shrink-0 cursor-pointer rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
57
+ />
58
+ ))}
59
+ </SliderPrimitive.Root>
60
+ );
61
+ }
62
+
63
+ export { Slider };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ import { useTheme } from "next-themes";
4
+ import { Toaster as Sonner, type ToasterProps } from "sonner";
5
+
6
+ const Toaster = ({ ...props }: ToasterProps) => {
7
+ const { theme = "system" } = useTheme();
8
+
9
+ return (
10
+ <Sonner
11
+ theme={theme as ToasterProps["theme"]}
12
+ className="toaster group"
13
+ style={
14
+ {
15
+ "--normal-bg": "var(--popover)",
16
+ "--normal-text": "var(--popover-foreground)",
17
+ "--normal-border": "var(--border)",
18
+ } as React.CSSProperties
19
+ }
20
+ {...props}
21
+ />
22
+ );
23
+ };
24
+
25
+ export { Toaster };
@@ -0,0 +1,35 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Switch as SwitchPrimitive } from "radix-ui"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Switch({
9
+ className,
10
+ size = "default",
11
+ ...props
12
+ }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
13
+ size?: "sm" | "default"
14
+ }) {
15
+ return (
16
+ <SwitchPrimitive.Root
17
+ data-slot="switch"
18
+ data-size={size}
19
+ className={cn(
20
+ "peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",
21
+ className
22
+ )}
23
+ {...props}
24
+ >
25
+ <SwitchPrimitive.Thumb
26
+ data-slot="switch-thumb"
27
+ className={cn(
28
+ "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"
29
+ )}
30
+ />
31
+ </SwitchPrimitive.Root>
32
+ )
33
+ }
34
+
35
+ export { Switch }