@ichaingo/ui 1.1.0

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 (141) hide show
  1. package/.babelrc +12 -0
  2. package/README.md +103 -0
  3. package/components.json +21 -0
  4. package/dist/accordion.d.ts +13 -0
  5. package/dist/accordion.mjs +64 -0
  6. package/dist/alert-dialog.d.ts +27 -0
  7. package/dist/alert-dialog.mjs +146 -0
  8. package/dist/alert.d.ts +16 -0
  9. package/dist/alert.mjs +66 -0
  10. package/dist/aspect-ratio.d.ts +6 -0
  11. package/dist/aspect-ratio.mjs +10 -0
  12. package/dist/avatar.d.ts +11 -0
  13. package/dist/avatar.mjs +53 -0
  14. package/dist/badge.d.ts +14 -0
  15. package/dist/badge.mjs +39 -0
  16. package/dist/breadcrumb.d.ts +20 -0
  17. package/dist/breadcrumb.mjs +102 -0
  18. package/dist/button.d.ts +15 -0
  19. package/dist/button.mjs +49 -0
  20. package/dist/calendar.d.ts +23 -0
  21. package/dist/calendar.mjs +173 -0
  22. package/dist/card.d.ts +18 -0
  23. package/dist/card.mjs +90 -0
  24. package/dist/carousel.d.ts +42 -0
  25. package/dist/carousel.mjs +177 -0
  26. package/dist/checkbox.d.ts +7 -0
  27. package/dist/checkbox.mjs +31 -0
  28. package/dist/collapsible.d.ts +10 -0
  29. package/dist/collapsible.mjs +34 -0
  30. package/dist/command.d.ts +31 -0
  31. package/dist/command.mjs +170 -0
  32. package/dist/context-menu.d.ts +42 -0
  33. package/dist/context-menu.mjs +223 -0
  34. package/dist/dialog.d.ts +27 -0
  35. package/dist/dialog.mjs +136 -0
  36. package/dist/dropdown-menu.d.ts +42 -0
  37. package/dist/dropdown-menu.mjs +231 -0
  38. package/dist/form.d.ts +38 -0
  39. package/dist/form.mjs +101 -0
  40. package/dist/hover-card.d.ts +11 -0
  41. package/dist/hover-card.mjs +38 -0
  42. package/dist/input.d.ts +6 -0
  43. package/dist/input.mjs +21 -0
  44. package/dist/label.d.ts +7 -0
  45. package/dist/label.mjs +23 -0
  46. package/dist/menubar.d.ts +44 -0
  47. package/dist/menubar.mjs +251 -0
  48. package/dist/navigation-menu.d.ts +26 -0
  49. package/dist/navigation-menu.mjs +170 -0
  50. package/dist/pagination.d.ts +33 -0
  51. package/dist/pagination.mjs +116 -0
  52. package/dist/popover.d.ts +13 -0
  53. package/dist/popover.mjs +44 -0
  54. package/dist/progress.d.ts +7 -0
  55. package/dist/progress.mjs +31 -0
  56. package/dist/radio-group.d.ts +9 -0
  57. package/dist/radio-group.mjs +45 -0
  58. package/dist/resizable.d.ts +13 -0
  59. package/dist/resizable.mjs +48 -0
  60. package/dist/scroll-area.d.ts +9 -0
  61. package/dist/scroll-area.mjs +60 -0
  62. package/dist/select.d.ts +27 -0
  63. package/dist/select.mjs +169 -0
  64. package/dist/separator.d.ts +7 -0
  65. package/dist/separator.mjs +26 -0
  66. package/dist/sheet.d.ts +23 -0
  67. package/dist/sheet.mjs +126 -0
  68. package/dist/skeleton.d.ts +5 -0
  69. package/dist/skeleton.mjs +15 -0
  70. package/dist/slider.d.ts +7 -0
  71. package/dist/slider.mjs +63 -0
  72. package/dist/sonner.d.ts +6 -0
  73. package/dist/sonner.mjs +22 -0
  74. package/dist/switch.d.ts +7 -0
  75. package/dist/switch.mjs +31 -0
  76. package/dist/table.d.ts +20 -0
  77. package/dist/table.mjs +114 -0
  78. package/dist/tabs.d.ts +13 -0
  79. package/dist/tabs.mjs +67 -0
  80. package/dist/textarea.d.ts +6 -0
  81. package/dist/textarea.mjs +18 -0
  82. package/dist/toggle-group.d.ts +16 -0
  83. package/dist/toggle-group.mjs +62 -0
  84. package/dist/toggle.d.ts +14 -0
  85. package/dist/toggle.mjs +43 -0
  86. package/dist/tooltip.d.ts +13 -0
  87. package/dist/tooltip.mjs +55 -0
  88. package/dist/utils-B7J70Nno.js +8 -0
  89. package/eslint.config.mjs +12 -0
  90. package/package.json +273 -0
  91. package/postcss.config.js +6 -0
  92. package/src/components/ui/accordion.tsx +64 -0
  93. package/src/components/ui/alert-dialog.tsx +155 -0
  94. package/src/components/ui/alert.tsx +66 -0
  95. package/src/components/ui/aspect-ratio.tsx +9 -0
  96. package/src/components/ui/avatar.tsx +51 -0
  97. package/src/components/ui/badge.tsx +46 -0
  98. package/src/components/ui/breadcrumb.tsx +109 -0
  99. package/src/components/ui/button.tsx +59 -0
  100. package/src/components/ui/calendar.tsx +211 -0
  101. package/src/components/ui/card.tsx +92 -0
  102. package/src/components/ui/carousel.tsx +239 -0
  103. package/src/components/ui/checkbox.tsx +30 -0
  104. package/src/components/ui/collapsible.tsx +31 -0
  105. package/src/components/ui/command.tsx +182 -0
  106. package/src/components/ui/context-menu.tsx +250 -0
  107. package/src/components/ui/dialog.tsx +141 -0
  108. package/src/components/ui/dropdown-menu.tsx +255 -0
  109. package/src/components/ui/form.tsx +165 -0
  110. package/src/components/ui/hover-card.tsx +42 -0
  111. package/src/components/ui/input.tsx +21 -0
  112. package/src/components/ui/label.tsx +24 -0
  113. package/src/components/ui/menubar.tsx +274 -0
  114. package/src/components/ui/navigation-menu.tsx +168 -0
  115. package/src/components/ui/pagination.tsx +125 -0
  116. package/src/components/ui/popover.tsx +46 -0
  117. package/src/components/ui/progress.tsx +29 -0
  118. package/src/components/ui/radio-group.tsx +43 -0
  119. package/src/components/ui/resizable.tsx +54 -0
  120. package/src/components/ui/scroll-area.tsx +56 -0
  121. package/src/components/ui/select.tsx +183 -0
  122. package/src/components/ui/separator.tsx +26 -0
  123. package/src/components/ui/sheet.tsx +137 -0
  124. package/src/components/ui/skeleton.tsx +13 -0
  125. package/src/components/ui/slider.tsx +61 -0
  126. package/src/components/ui/sonner.tsx +23 -0
  127. package/src/components/ui/switch.tsx +29 -0
  128. package/src/components/ui/table.tsx +114 -0
  129. package/src/components/ui/tabs.tsx +64 -0
  130. package/src/components/ui/textarea.tsx +18 -0
  131. package/src/components/ui/toggle-group.tsx +71 -0
  132. package/src/components/ui/toggle.tsx +45 -0
  133. package/src/components/ui/tooltip.tsx +59 -0
  134. package/src/index.ts +46 -0
  135. package/src/lib/utils.ts +6 -0
  136. package/src/style.css +0 -0
  137. package/tailwind.config.js +52 -0
  138. package/tsconfig.json +19 -0
  139. package/tsconfig.lib.json +54 -0
  140. package/tsconfig.spec.json +32 -0
  141. package/vite.config.ts +136 -0
@@ -0,0 +1,54 @@
1
+ import * as React from "react"
2
+ import { GripVerticalIcon } from "lucide-react"
3
+ import * as ResizablePrimitive from "react-resizable-panels"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function ResizablePanelGroup({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {
11
+ return (
12
+ <ResizablePrimitive.PanelGroup
13
+ data-slot="resizable-panel-group"
14
+ className={cn(
15
+ "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
16
+ className
17
+ )}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ function ResizablePanel({
24
+ ...props
25
+ }: React.ComponentProps<typeof ResizablePrimitive.Panel>) {
26
+ return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
27
+ }
28
+
29
+ function ResizableHandle({
30
+ withHandle,
31
+ className,
32
+ ...props
33
+ }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
34
+ withHandle?: boolean
35
+ }) {
36
+ return (
37
+ <ResizablePrimitive.PanelResizeHandle
38
+ data-slot="resizable-handle"
39
+ className={cn(
40
+ "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
41
+ className
42
+ )}
43
+ {...props}
44
+ >
45
+ {withHandle && (
46
+ <div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
47
+ <GripVerticalIcon className="size-2.5" />
48
+ </div>
49
+ )}
50
+ </ResizablePrimitive.PanelResizeHandle>
51
+ )
52
+ }
53
+
54
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
@@ -0,0 +1,56 @@
1
+ import * as React from "react"
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function ScrollArea({
7
+ className,
8
+ children,
9
+ ...props
10
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
11
+ return (
12
+ <ScrollAreaPrimitive.Root
13
+ data-slot="scroll-area"
14
+ className={cn("relative", className)}
15
+ {...props}
16
+ >
17
+ <ScrollAreaPrimitive.Viewport
18
+ data-slot="scroll-area-viewport"
19
+ className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
20
+ >
21
+ {children}
22
+ </ScrollAreaPrimitive.Viewport>
23
+ <ScrollBar />
24
+ <ScrollAreaPrimitive.Corner />
25
+ </ScrollAreaPrimitive.Root>
26
+ )
27
+ }
28
+
29
+ function ScrollBar({
30
+ className,
31
+ orientation = "vertical",
32
+ ...props
33
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
34
+ return (
35
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
36
+ data-slot="scroll-area-scrollbar"
37
+ orientation={orientation}
38
+ className={cn(
39
+ "flex touch-none p-px transition-colors select-none",
40
+ orientation === "vertical" &&
41
+ "h-full w-2.5 border-l border-l-transparent",
42
+ orientation === "horizontal" &&
43
+ "h-2.5 flex-col border-t border-t-transparent",
44
+ className
45
+ )}
46
+ {...props}
47
+ >
48
+ <ScrollAreaPrimitive.ScrollAreaThumb
49
+ data-slot="scroll-area-thumb"
50
+ className="bg-border relative flex-1 rounded-full"
51
+ />
52
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
53
+ )
54
+ }
55
+
56
+ export { ScrollArea, ScrollBar }
@@ -0,0 +1,183 @@
1
+ import * as React from "react"
2
+ import * as SelectPrimitive from "@radix-ui/react-select"
3
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Select({
8
+ ...props
9
+ }: React.ComponentProps<typeof SelectPrimitive.Root>) {
10
+ return <SelectPrimitive.Root data-slot="select" {...props} />
11
+ }
12
+
13
+ function SelectGroup({
14
+ ...props
15
+ }: React.ComponentProps<typeof SelectPrimitive.Group>) {
16
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />
17
+ }
18
+
19
+ function SelectValue({
20
+ ...props
21
+ }: React.ComponentProps<typeof SelectPrimitive.Value>) {
22
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />
23
+ }
24
+
25
+ function SelectTrigger({
26
+ className,
27
+ size = "default",
28
+ children,
29
+ ...props
30
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
31
+ size?: "sm" | "default"
32
+ }) {
33
+ return (
34
+ <SelectPrimitive.Trigger
35
+ data-slot="select-trigger"
36
+ data-size={size}
37
+ className={cn(
38
+ "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 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",
39
+ className
40
+ )}
41
+ {...props}
42
+ >
43
+ {children}
44
+ <SelectPrimitive.Icon asChild>
45
+ <ChevronDownIcon className="size-4 opacity-50" />
46
+ </SelectPrimitive.Icon>
47
+ </SelectPrimitive.Trigger>
48
+ )
49
+ }
50
+
51
+ function SelectContent({
52
+ className,
53
+ children,
54
+ position = "popper",
55
+ ...props
56
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
57
+ return (
58
+ <SelectPrimitive.Portal>
59
+ <SelectPrimitive.Content
60
+ data-slot="select-content"
61
+ className={cn(
62
+ "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",
63
+ position === "popper" &&
64
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
65
+ className
66
+ )}
67
+ position={position}
68
+ {...props}
69
+ >
70
+ <SelectScrollUpButton />
71
+ <SelectPrimitive.Viewport
72
+ className={cn(
73
+ "p-1",
74
+ position === "popper" &&
75
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
76
+ )}
77
+ >
78
+ {children}
79
+ </SelectPrimitive.Viewport>
80
+ <SelectScrollDownButton />
81
+ </SelectPrimitive.Content>
82
+ </SelectPrimitive.Portal>
83
+ )
84
+ }
85
+
86
+ function SelectLabel({
87
+ className,
88
+ ...props
89
+ }: React.ComponentProps<typeof SelectPrimitive.Label>) {
90
+ return (
91
+ <SelectPrimitive.Label
92
+ data-slot="select-label"
93
+ className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
94
+ {...props}
95
+ />
96
+ )
97
+ }
98
+
99
+ function SelectItem({
100
+ className,
101
+ children,
102
+ ...props
103
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
104
+ return (
105
+ <SelectPrimitive.Item
106
+ data-slot="select-item"
107
+ className={cn(
108
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default 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",
109
+ className
110
+ )}
111
+ {...props}
112
+ >
113
+ <span className="absolute right-2 flex size-3.5 items-center justify-center">
114
+ <SelectPrimitive.ItemIndicator>
115
+ <CheckIcon className="size-4" />
116
+ </SelectPrimitive.ItemIndicator>
117
+ </span>
118
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
119
+ </SelectPrimitive.Item>
120
+ )
121
+ }
122
+
123
+ function SelectSeparator({
124
+ className,
125
+ ...props
126
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
127
+ return (
128
+ <SelectPrimitive.Separator
129
+ data-slot="select-separator"
130
+ className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
131
+ {...props}
132
+ />
133
+ )
134
+ }
135
+
136
+ function SelectScrollUpButton({
137
+ className,
138
+ ...props
139
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
140
+ return (
141
+ <SelectPrimitive.ScrollUpButton
142
+ data-slot="select-scroll-up-button"
143
+ className={cn(
144
+ "flex cursor-default items-center justify-center py-1",
145
+ className
146
+ )}
147
+ {...props}
148
+ >
149
+ <ChevronUpIcon className="size-4" />
150
+ </SelectPrimitive.ScrollUpButton>
151
+ )
152
+ }
153
+
154
+ function SelectScrollDownButton({
155
+ className,
156
+ ...props
157
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
158
+ return (
159
+ <SelectPrimitive.ScrollDownButton
160
+ data-slot="select-scroll-down-button"
161
+ className={cn(
162
+ "flex cursor-default items-center justify-center py-1",
163
+ className
164
+ )}
165
+ {...props}
166
+ >
167
+ <ChevronDownIcon className="size-4" />
168
+ </SelectPrimitive.ScrollDownButton>
169
+ )
170
+ }
171
+
172
+ export {
173
+ Select,
174
+ SelectContent,
175
+ SelectGroup,
176
+ SelectItem,
177
+ SelectLabel,
178
+ SelectScrollDownButton,
179
+ SelectScrollUpButton,
180
+ SelectSeparator,
181
+ SelectTrigger,
182
+ SelectValue,
183
+ }
@@ -0,0 +1,26 @@
1
+ import * as React from "react"
2
+ import * as SeparatorPrimitive from "@radix-ui/react-separator"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function Separator({
7
+ className,
8
+ orientation = "horizontal",
9
+ decorative = true,
10
+ ...props
11
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
12
+ return (
13
+ <SeparatorPrimitive.Root
14
+ data-slot="separator"
15
+ decorative={decorative}
16
+ orientation={orientation}
17
+ className={cn(
18
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
19
+ className
20
+ )}
21
+ {...props}
22
+ />
23
+ )
24
+ }
25
+
26
+ export { Separator }
@@ -0,0 +1,137 @@
1
+ import * as React from "react"
2
+ import * as SheetPrimitive from "@radix-ui/react-dialog"
3
+ import { XIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
8
+ return <SheetPrimitive.Root data-slot="sheet" {...props} />
9
+ }
10
+
11
+ function SheetTrigger({
12
+ ...props
13
+ }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
14
+ return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
15
+ }
16
+
17
+ function SheetClose({
18
+ ...props
19
+ }: React.ComponentProps<typeof SheetPrimitive.Close>) {
20
+ return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
21
+ }
22
+
23
+ function SheetPortal({
24
+ ...props
25
+ }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
26
+ return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
27
+ }
28
+
29
+ function SheetOverlay({
30
+ className,
31
+ ...props
32
+ }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
33
+ return (
34
+ <SheetPrimitive.Overlay
35
+ data-slot="sheet-overlay"
36
+ className={cn(
37
+ "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",
38
+ className
39
+ )}
40
+ {...props}
41
+ />
42
+ )
43
+ }
44
+
45
+ function SheetContent({
46
+ className,
47
+ children,
48
+ side = "right",
49
+ ...props
50
+ }: React.ComponentProps<typeof SheetPrimitive.Content> & {
51
+ side?: "top" | "right" | "bottom" | "left"
52
+ }) {
53
+ return (
54
+ <SheetPortal>
55
+ <SheetOverlay />
56
+ <SheetPrimitive.Content
57
+ data-slot="sheet-content"
58
+ className={cn(
59
+ "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",
60
+ side === "right" &&
61
+ "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",
62
+ side === "left" &&
63
+ "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",
64
+ side === "top" &&
65
+ "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
66
+ side === "bottom" &&
67
+ "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
68
+ className
69
+ )}
70
+ {...props}
71
+ >
72
+ {children}
73
+ <SheetPrimitive.Close className="ring-offset-background 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">
74
+ <XIcon className="size-4" />
75
+ <span className="sr-only">Close</span>
76
+ </SheetPrimitive.Close>
77
+ </SheetPrimitive.Content>
78
+ </SheetPortal>
79
+ )
80
+ }
81
+
82
+ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
83
+ return (
84
+ <div
85
+ data-slot="sheet-header"
86
+ className={cn("flex flex-col gap-1.5 p-4", className)}
87
+ {...props}
88
+ />
89
+ )
90
+ }
91
+
92
+ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
93
+ return (
94
+ <div
95
+ data-slot="sheet-footer"
96
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
97
+ {...props}
98
+ />
99
+ )
100
+ }
101
+
102
+ function SheetTitle({
103
+ className,
104
+ ...props
105
+ }: React.ComponentProps<typeof SheetPrimitive.Title>) {
106
+ return (
107
+ <SheetPrimitive.Title
108
+ data-slot="sheet-title"
109
+ className={cn("text-foreground font-semibold", className)}
110
+ {...props}
111
+ />
112
+ )
113
+ }
114
+
115
+ function SheetDescription({
116
+ className,
117
+ ...props
118
+ }: React.ComponentProps<typeof SheetPrimitive.Description>) {
119
+ return (
120
+ <SheetPrimitive.Description
121
+ data-slot="sheet-description"
122
+ className={cn("text-muted-foreground text-sm", className)}
123
+ {...props}
124
+ />
125
+ )
126
+ }
127
+
128
+ export {
129
+ Sheet,
130
+ SheetTrigger,
131
+ SheetClose,
132
+ SheetContent,
133
+ SheetHeader,
134
+ SheetFooter,
135
+ SheetTitle,
136
+ SheetDescription,
137
+ }
@@ -0,0 +1,13 @@
1
+ import { cn } from "@/lib/utils"
2
+
3
+ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
+ return (
5
+ <div
6
+ data-slot="skeleton"
7
+ className={cn("bg-accent animate-pulse rounded-md", className)}
8
+ {...props}
9
+ />
10
+ )
11
+ }
12
+
13
+ export { Skeleton }
@@ -0,0 +1,61 @@
1
+ import * as React from "react"
2
+ import * as SliderPrimitive from "@radix-ui/react-slider"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function Slider({
7
+ className,
8
+ defaultValue,
9
+ value,
10
+ min = 0,
11
+ max = 100,
12
+ ...props
13
+ }: React.ComponentProps<typeof SliderPrimitive.Root>) {
14
+ const _values = React.useMemo(
15
+ () =>
16
+ Array.isArray(value)
17
+ ? value
18
+ : Array.isArray(defaultValue)
19
+ ? defaultValue
20
+ : [min, max],
21
+ [value, defaultValue, min, max]
22
+ )
23
+
24
+ return (
25
+ <SliderPrimitive.Root
26
+ data-slot="slider"
27
+ defaultValue={defaultValue}
28
+ value={value}
29
+ min={min}
30
+ max={max}
31
+ className={cn(
32
+ "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",
33
+ className
34
+ )}
35
+ {...props}
36
+ >
37
+ <SliderPrimitive.Track
38
+ data-slot="slider-track"
39
+ className={cn(
40
+ "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"
41
+ )}
42
+ >
43
+ <SliderPrimitive.Range
44
+ data-slot="slider-range"
45
+ className={cn(
46
+ "bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
47
+ )}
48
+ />
49
+ </SliderPrimitive.Track>
50
+ {Array.from({ length: _values.length }, (_, index) => (
51
+ <SliderPrimitive.Thumb
52
+ data-slot="slider-thumb"
53
+ key={index}
54
+ className="border-primary bg-background ring-ring/50 block size-4 shrink-0 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"
55
+ />
56
+ ))}
57
+ </SliderPrimitive.Root>
58
+ )
59
+ }
60
+
61
+ export { Slider }
@@ -0,0 +1,23 @@
1
+ import { useTheme } from "next-themes"
2
+ import { Toaster as Sonner, ToasterProps } from "sonner"
3
+
4
+ const Toaster = ({ ...props }: ToasterProps) => {
5
+ const { theme = "system" } = useTheme()
6
+
7
+ return (
8
+ <Sonner
9
+ theme={theme as ToasterProps["theme"]}
10
+ className="toaster group"
11
+ style={
12
+ {
13
+ "--normal-bg": "var(--popover)",
14
+ "--normal-text": "var(--popover-foreground)",
15
+ "--normal-border": "var(--border)",
16
+ } as React.CSSProperties
17
+ }
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ export { Toaster }
@@ -0,0 +1,29 @@
1
+ import * as React from "react"
2
+ import * as SwitchPrimitive from "@radix-ui/react-switch"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function Switch({
7
+ className,
8
+ ...props
9
+ }: React.ComponentProps<typeof SwitchPrimitive.Root>) {
10
+ return (
11
+ <SwitchPrimitive.Root
12
+ data-slot="switch"
13
+ className={cn(
14
+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
15
+ className
16
+ )}
17
+ {...props}
18
+ >
19
+ <SwitchPrimitive.Thumb
20
+ data-slot="switch-thumb"
21
+ className={cn(
22
+ "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
23
+ )}
24
+ />
25
+ </SwitchPrimitive.Root>
26
+ )
27
+ }
28
+
29
+ export { Switch }