tokka 0.2.0 → 0.2.1

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 (71) hide show
  1. package/components/accordion.tsx +55 -0
  2. package/components/alert-dialog.tsx +138 -0
  3. package/components/alert.tsx +58 -0
  4. package/components/aspect-ratio.tsx +5 -0
  5. package/components/avatar.tsx +47 -0
  6. package/components/badge.tsx +35 -0
  7. package/components/breadcrumb.tsx +114 -0
  8. package/components/button.tsx +56 -0
  9. package/components/calendar.tsx +63 -0
  10. package/components/card.tsx +74 -0
  11. package/components/carousel.tsx +259 -0
  12. package/components/chart.tsx +9 -0
  13. package/components/checkbox.tsx +27 -0
  14. package/components/collapsible.tsx +9 -0
  15. package/components/combobox.tsx +8 -0
  16. package/components/command.tsx +152 -0
  17. package/components/context-menu.tsx +197 -0
  18. package/components/data-table.tsx +9 -0
  19. package/components/date-picker.tsx +8 -0
  20. package/components/dialog.tsx +119 -0
  21. package/components/drawer.tsx +115 -0
  22. package/components/dropdown-menu.tsx +197 -0
  23. package/components/form.tsx +175 -0
  24. package/components/hover-card.tsx +26 -0
  25. package/components/input-otp.tsx +68 -0
  26. package/components/input.tsx +48 -0
  27. package/components/label.tsx +23 -0
  28. package/components/lib/utils.ts +6 -0
  29. package/components/menubar.tsx +233 -0
  30. package/components/native-select.tsx +29 -0
  31. package/components/navigation-menu.tsx +127 -0
  32. package/components/pagination.tsx +116 -0
  33. package/components/popover.tsx +28 -0
  34. package/components/progress.tsx +25 -0
  35. package/components/radio-group.tsx +41 -0
  36. package/components/resizable.tsx +42 -0
  37. package/components/scroll-area.tsx +45 -0
  38. package/components/select.tsx +157 -0
  39. package/components/separator.tsx +28 -0
  40. package/components/sheet.tsx +137 -0
  41. package/components/sidebar.tsx +249 -0
  42. package/components/skeleton.tsx +15 -0
  43. package/components/slider.tsx +25 -0
  44. package/components/sonner.tsx +25 -0
  45. package/components/spinner.tsx +33 -0
  46. package/components/switch.tsx +26 -0
  47. package/components/table.tsx +116 -0
  48. package/components/tabs.tsx +52 -0
  49. package/components/textarea.tsx +23 -0
  50. package/components/toggle-group.tsx +58 -0
  51. package/components/toggle.tsx +42 -0
  52. package/components/tooltip.tsx +27 -0
  53. package/dist/index.js +49 -2
  54. package/package.json +4 -2
  55. package/systems/README.md +56 -0
  56. package/systems/accessible/system.json +17 -0
  57. package/systems/accessible/tokens/primitives.json +9 -0
  58. package/systems/accessible/tokens/semantics.json +11 -0
  59. package/systems/brutalist/system.json +17 -0
  60. package/systems/brutalist/tokens/primitives.json +10 -0
  61. package/systems/brutalist/tokens/semantics.json +12 -0
  62. package/systems/corporate/system.json +20 -0
  63. package/systems/corporate/tokens/primitives.json +60 -0
  64. package/systems/corporate/tokens/semantics.json +68 -0
  65. package/systems/dark-mode/system.json +17 -0
  66. package/systems/dark-mode/tokens/primitives.json +10 -0
  67. package/systems/dark-mode/tokens/semantics.json +11 -0
  68. package/systems/package.json +14 -0
  69. package/systems/soft-saas/system.json +20 -0
  70. package/systems/soft-saas/tokens/primitives.json +235 -0
  71. package/systems/soft-saas/tokens/semantics.json +190 -0
@@ -0,0 +1,48 @@
1
+ import * as React from "react"
2
+ import { cn } from "./lib/utils"
3
+
4
+ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
5
+ icon?: React.ReactNode
6
+ trailing?: React.ReactNode
7
+ }
8
+
9
+ const Input = React.forwardRef<HTMLInputElement, InputProps>(
10
+ ({ className, type, icon, trailing, ...props }, ref) => {
11
+ if (icon || trailing) {
12
+ return (
13
+ <div className="relative flex items-center">
14
+ {icon && <span className="absolute left-3 text-muted-foreground">{icon}</span>}
15
+ <input
16
+ type={type}
17
+ className={cn(
18
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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",
19
+ icon && "pl-10",
20
+ trailing && "pr-10",
21
+ className
22
+ )}
23
+ ref={ref}
24
+ {...props}
25
+ />
26
+ {trailing && (
27
+ <span className="absolute right-3 text-muted-foreground">{trailing}</span>
28
+ )}
29
+ </div>
30
+ )
31
+ }
32
+
33
+ return (
34
+ <input
35
+ type={type}
36
+ className={cn(
37
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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",
38
+ className
39
+ )}
40
+ ref={ref}
41
+ {...props}
42
+ />
43
+ )
44
+ }
45
+ )
46
+ Input.displayName = "Input"
47
+
48
+ export { Input }
@@ -0,0 +1,23 @@
1
+ import * as React from "react"
2
+ import * as LabelPrimitive from "@radix-ui/react-label"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+ import { cn } from "./lib/utils"
5
+
6
+ const labelVariants = cva(
7
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
8
+ )
9
+
10
+ const Label = React.forwardRef<
11
+ React.ElementRef<typeof LabelPrimitive.Root>,
12
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
13
+ VariantProps<typeof labelVariants>
14
+ >(({ className, ...props }, ref) => (
15
+ <LabelPrimitive.Root
16
+ ref={ref}
17
+ className={cn(labelVariants(), className)}
18
+ {...props}
19
+ />
20
+ ))
21
+ Label.displayName = LabelPrimitive.Root.displayName
22
+
23
+ export { Label }
@@ -0,0 +1,6 @@
1
+ import { type ClassValue, clsx } from "clsx"
2
+ import { twMerge } from "tailwind-merge"
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -0,0 +1,233 @@
1
+ import * as React from "react"
2
+ import * as MenubarPrimitive from "@radix-ui/react-menubar"
3
+ import { Check, ChevronRight, Circle } from "lucide-react"
4
+ import { cn } from "./lib/utils"
5
+
6
+ const MenubarMenu: typeof MenubarPrimitive.Menu = MenubarPrimitive.Menu
7
+
8
+ const MenubarGroup: typeof MenubarPrimitive.Group = MenubarPrimitive.Group
9
+
10
+ const MenubarPortal: typeof MenubarPrimitive.Portal = MenubarPrimitive.Portal
11
+
12
+ const MenubarSub: typeof MenubarPrimitive.Sub = MenubarPrimitive.Sub
13
+
14
+ const MenubarRadioGroup: typeof MenubarPrimitive.RadioGroup = MenubarPrimitive.RadioGroup
15
+
16
+ const Menubar = React.forwardRef<
17
+ React.ElementRef<typeof MenubarPrimitive.Root>,
18
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
19
+ >(({ className, ...props }, ref) => (
20
+ <MenubarPrimitive.Root
21
+ ref={ref}
22
+ className={cn(
23
+ "flex h-10 items-center space-x-1 rounded-md border bg-background p-1",
24
+ className
25
+ )}
26
+ {...props}
27
+ />
28
+ ))
29
+ Menubar.displayName = MenubarPrimitive.Root.displayName
30
+
31
+ const MenubarTrigger = React.forwardRef<
32
+ React.ElementRef<typeof MenubarPrimitive.Trigger>,
33
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
34
+ >(({ className, ...props }, ref) => (
35
+ <MenubarPrimitive.Trigger
36
+ ref={ref}
37
+ className={cn(
38
+ "flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
39
+ className
40
+ )}
41
+ {...props}
42
+ />
43
+ ))
44
+ MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
45
+
46
+ const MenubarSubTrigger = React.forwardRef<
47
+ React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
48
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
49
+ inset?: boolean
50
+ }
51
+ >(({ className, inset, children, ...props }, ref) => (
52
+ <MenubarPrimitive.SubTrigger
53
+ ref={ref}
54
+ className={cn(
55
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
56
+ inset && "pl-8",
57
+ className
58
+ )}
59
+ {...props}
60
+ >
61
+ {children}
62
+ <ChevronRight className="ml-auto size-4" />
63
+ </MenubarPrimitive.SubTrigger>
64
+ ))
65
+ MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
66
+
67
+ const MenubarSubContent = React.forwardRef<
68
+ React.ElementRef<typeof MenubarPrimitive.SubContent>,
69
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
70
+ >(({ className, ...props }, ref) => (
71
+ <MenubarPrimitive.SubContent
72
+ ref={ref}
73
+ className={cn(
74
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",
75
+ className
76
+ )}
77
+ {...props}
78
+ />
79
+ ))
80
+ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
81
+
82
+ const MenubarContent = React.forwardRef<
83
+ React.ElementRef<typeof MenubarPrimitive.Content>,
84
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
85
+ >(
86
+ (
87
+ { className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
88
+ ref
89
+ ) => (
90
+ <MenubarPrimitive.Portal>
91
+ <MenubarPrimitive.Content
92
+ ref={ref}
93
+ align={align}
94
+ alignOffset={alignOffset}
95
+ sideOffset={sideOffset}
96
+ className={cn(
97
+ "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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",
98
+ className
99
+ )}
100
+ {...props}
101
+ />
102
+ </MenubarPrimitive.Portal>
103
+ )
104
+ )
105
+ MenubarContent.displayName = MenubarPrimitive.Content.displayName
106
+
107
+ const MenubarItem = React.forwardRef<
108
+ React.ElementRef<typeof MenubarPrimitive.Item>,
109
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
110
+ inset?: boolean
111
+ }
112
+ >(({ className, inset, ...props }, ref) => (
113
+ <MenubarPrimitive.Item
114
+ ref={ref}
115
+ className={cn(
116
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
117
+ inset && "pl-8",
118
+ className
119
+ )}
120
+ {...props}
121
+ />
122
+ ))
123
+ MenubarItem.displayName = MenubarPrimitive.Item.displayName
124
+
125
+ const MenubarCheckboxItem = React.forwardRef<
126
+ React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
127
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
128
+ >(({ className, children, checked, ...props }, ref) => (
129
+ <MenubarPrimitive.CheckboxItem
130
+ ref={ref}
131
+ className={cn(
132
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
133
+ className
134
+ )}
135
+ checked={checked}
136
+ {...props}
137
+ >
138
+ <span className="absolute left-2 flex size-3.5 items-center justify-center">
139
+ <MenubarPrimitive.ItemIndicator>
140
+ <Check className="size-4" />
141
+ </MenubarPrimitive.ItemIndicator>
142
+ </span>
143
+ {children}
144
+ </MenubarPrimitive.CheckboxItem>
145
+ ))
146
+ MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
147
+
148
+ const MenubarRadioItem = React.forwardRef<
149
+ React.ElementRef<typeof MenubarPrimitive.RadioItem>,
150
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
151
+ >(({ className, children, ...props }, ref) => (
152
+ <MenubarPrimitive.RadioItem
153
+ ref={ref}
154
+ className={cn(
155
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
156
+ className
157
+ )}
158
+ {...props}
159
+ >
160
+ <span className="absolute left-2 flex size-3.5 items-center justify-center">
161
+ <MenubarPrimitive.ItemIndicator>
162
+ <Circle className="size-2 fill-current" />
163
+ </MenubarPrimitive.ItemIndicator>
164
+ </span>
165
+ {children}
166
+ </MenubarPrimitive.RadioItem>
167
+ ))
168
+ MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
169
+
170
+ const MenubarLabel = React.forwardRef<
171
+ React.ElementRef<typeof MenubarPrimitive.Label>,
172
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
173
+ inset?: boolean
174
+ }
175
+ >(({ className, inset, ...props }, ref) => (
176
+ <MenubarPrimitive.Label
177
+ ref={ref}
178
+ className={cn(
179
+ "px-2 py-1.5 text-sm font-semibold",
180
+ inset && "pl-8",
181
+ className
182
+ )}
183
+ {...props}
184
+ />
185
+ ))
186
+ MenubarLabel.displayName = MenubarPrimitive.Label.displayName
187
+
188
+ const MenubarSeparator = React.forwardRef<
189
+ React.ElementRef<typeof MenubarPrimitive.Separator>,
190
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
191
+ >(({ className, ...props }, ref) => (
192
+ <MenubarPrimitive.Separator
193
+ ref={ref}
194
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
195
+ {...props}
196
+ />
197
+ ))
198
+ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
199
+
200
+ const MenubarShortcut = ({
201
+ className,
202
+ ...props
203
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
204
+ return (
205
+ <span
206
+ className={cn(
207
+ "ml-auto text-xs tracking-widest text-muted-foreground",
208
+ className
209
+ )}
210
+ {...props}
211
+ />
212
+ )
213
+ }
214
+ MenubarShortcut.displayname = "MenubarShortcut"
215
+
216
+ export {
217
+ Menubar,
218
+ MenubarMenu,
219
+ MenubarTrigger,
220
+ MenubarContent,
221
+ MenubarItem,
222
+ MenubarSeparator,
223
+ MenubarLabel,
224
+ MenubarCheckboxItem,
225
+ MenubarRadioGroup,
226
+ MenubarRadioItem,
227
+ MenubarPortal,
228
+ MenubarSubContent,
229
+ MenubarSubTrigger,
230
+ MenubarGroup,
231
+ MenubarSub,
232
+ MenubarShortcut,
233
+ }
@@ -0,0 +1,29 @@
1
+ import * as React from "react"
2
+ import { ChevronDown } from "lucide-react"
3
+ import { cn } from "./lib/utils"
4
+
5
+ export interface NativeSelectProps
6
+ extends React.SelectHTMLAttributes<HTMLSelectElement> {}
7
+
8
+ const NativeSelect = React.forwardRef<HTMLSelectElement, NativeSelectProps>(
9
+ ({ className, children, ...props }, ref) => {
10
+ return (
11
+ <div className="relative">
12
+ <select
13
+ className={cn(
14
+ "flex h-10 w-full appearance-none items-center justify-between rounded-md border border-input bg-background px-3 py-2 pr-8 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
15
+ className
16
+ )}
17
+ ref={ref}
18
+ {...props}
19
+ >
20
+ {children}
21
+ </select>
22
+ <ChevronDown className="pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 opacity-50" />
23
+ </div>
24
+ )
25
+ }
26
+ )
27
+ NativeSelect.displayName = "NativeSelect"
28
+
29
+ export { NativeSelect }
@@ -0,0 +1,127 @@
1
+ import * as React from "react"
2
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
3
+ import { cva } from "class-variance-authority"
4
+ import { ChevronDown } from "lucide-react"
5
+ import { cn } from "./lib/utils"
6
+
7
+ const NavigationMenu = React.forwardRef<
8
+ React.ElementRef<typeof NavigationMenuPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
10
+ >(({ className, children, ...props }, ref) => (
11
+ <NavigationMenuPrimitive.Root
12
+ ref={ref}
13
+ className={cn(
14
+ "relative z-10 flex max-w-max flex-1 items-center justify-center",
15
+ className
16
+ )}
17
+ {...props}
18
+ >
19
+ {children}
20
+ <NavigationMenuViewport />
21
+ </NavigationMenuPrimitive.Root>
22
+ ))
23
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
24
+
25
+ const NavigationMenuList = React.forwardRef<
26
+ React.ElementRef<typeof NavigationMenuPrimitive.List>,
27
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
28
+ >(({ className, ...props }, ref) => (
29
+ <NavigationMenuPrimitive.List
30
+ ref={ref}
31
+ className={cn(
32
+ "group flex flex-1 list-none items-center justify-center space-x-1",
33
+ className
34
+ )}
35
+ {...props}
36
+ />
37
+ ))
38
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
39
+
40
+ const NavigationMenuItem = NavigationMenuPrimitive.Item
41
+
42
+ const navigationMenuTriggerStyle = cva(
43
+ "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
44
+ )
45
+
46
+ const NavigationMenuTrigger = React.forwardRef<
47
+ React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
48
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
49
+ >(({ className, children, ...props }, ref) => (
50
+ <NavigationMenuPrimitive.Trigger
51
+ ref={ref}
52
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
53
+ {...props}
54
+ >
55
+ {children}{" "}
56
+ <ChevronDown
57
+ className="relative top-[1px] ml-1 size-3 transition duration-200 group-data-[state=open]:rotate-180"
58
+ aria-hidden="true"
59
+ />
60
+ </NavigationMenuPrimitive.Trigger>
61
+ ))
62
+ NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
63
+
64
+ const NavigationMenuContent = React.forwardRef<
65
+ React.ElementRef<typeof NavigationMenuPrimitive.Content>,
66
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
67
+ >(({ className, ...props }, ref) => (
68
+ <NavigationMenuPrimitive.Content
69
+ ref={ref}
70
+ className={cn(
71
+ "left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
72
+ className
73
+ )}
74
+ {...props}
75
+ />
76
+ ))
77
+ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
78
+
79
+ const NavigationMenuLink = NavigationMenuPrimitive.Link
80
+
81
+ const NavigationMenuViewport = React.forwardRef<
82
+ React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
83
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
84
+ >(({ className, ...props }, ref) => (
85
+ <div className={cn("absolute left-0 top-full flex justify-center")}>
86
+ <NavigationMenuPrimitive.Viewport
87
+ className={cn(
88
+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
89
+ className
90
+ )}
91
+ ref={ref}
92
+ {...props}
93
+ />
94
+ </div>
95
+ ))
96
+ NavigationMenuViewport.displayName =
97
+ NavigationMenuPrimitive.Viewport.displayName
98
+
99
+ const NavigationMenuIndicator = React.forwardRef<
100
+ React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
101
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
102
+ >(({ className, ...props }, ref) => (
103
+ <NavigationMenuPrimitive.Indicator
104
+ ref={ref}
105
+ className={cn(
106
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
107
+ className
108
+ )}
109
+ {...props}
110
+ >
111
+ <div className="relative top-[60%] size-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
112
+ </NavigationMenuPrimitive.Indicator>
113
+ ))
114
+ NavigationMenuIndicator.displayName =
115
+ NavigationMenuPrimitive.Indicator.displayName
116
+
117
+ export {
118
+ navigationMenuTriggerStyle,
119
+ NavigationMenu,
120
+ NavigationMenuList,
121
+ NavigationMenuItem,
122
+ NavigationMenuContent,
123
+ NavigationMenuTrigger,
124
+ NavigationMenuLink,
125
+ NavigationMenuIndicator,
126
+ NavigationMenuViewport,
127
+ }
@@ -0,0 +1,116 @@
1
+ import * as React from "react"
2
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
3
+ import { cn } from "./lib/utils"
4
+ import { type ButtonProps, buttonVariants } from "./button"
5
+
6
+ const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
7
+ <nav
8
+ role="navigation"
9
+ aria-label="pagination"
10
+ className={cn("mx-auto flex w-full justify-center", className)}
11
+ {...props}
12
+ />
13
+ )
14
+ Pagination.displayName = "Pagination"
15
+
16
+ const PaginationContent = React.forwardRef<
17
+ HTMLUListElement,
18
+ React.ComponentProps<"ul">
19
+ >(({ className, ...props }, ref) => (
20
+ <ul
21
+ ref={ref}
22
+ className={cn("flex flex-row items-center gap-1", className)}
23
+ {...props}
24
+ />
25
+ ))
26
+ PaginationContent.displayName = "PaginationContent"
27
+
28
+ const PaginationItem = React.forwardRef<
29
+ HTMLLIElement,
30
+ React.ComponentProps<"li">
31
+ >(({ className, ...props }, ref) => (
32
+ <li ref={ref} className={cn("", className)} {...props} />
33
+ ))
34
+ PaginationItem.displayName = "PaginationItem"
35
+
36
+ type PaginationLinkProps = {
37
+ isActive?: boolean
38
+ } & Pick<ButtonProps, "size"> &
39
+ React.ComponentProps<"a">
40
+
41
+ const PaginationLink = ({
42
+ className,
43
+ isActive,
44
+ size = "icon",
45
+ ...props
46
+ }: PaginationLinkProps) => (
47
+ <a
48
+ aria-current={isActive ? "page" : undefined}
49
+ className={cn(
50
+ buttonVariants({
51
+ variant: isActive ? "outline" : "ghost",
52
+ size,
53
+ }),
54
+ className
55
+ )}
56
+ {...props}
57
+ />
58
+ )
59
+ PaginationLink.displayName = "PaginationLink"
60
+
61
+ const PaginationPrevious = ({
62
+ className,
63
+ ...props
64
+ }: React.ComponentProps<typeof PaginationLink>) => (
65
+ <PaginationLink
66
+ aria-label="Go to previous page"
67
+ size="default"
68
+ className={cn("gap-1 pl-2.5", className)}
69
+ {...props}
70
+ >
71
+ <ChevronLeft className="size-4" />
72
+ <span>Previous</span>
73
+ </PaginationLink>
74
+ )
75
+ PaginationPrevious.displayName = "PaginationPrevious"
76
+
77
+ const PaginationNext = ({
78
+ className,
79
+ ...props
80
+ }: React.ComponentProps<typeof PaginationLink>) => (
81
+ <PaginationLink
82
+ aria-label="Go to next page"
83
+ size="default"
84
+ className={cn("gap-1 pr-2.5", className)}
85
+ {...props}
86
+ >
87
+ <span>Next</span>
88
+ <ChevronRight className="size-4" />
89
+ </PaginationLink>
90
+ )
91
+ PaginationNext.displayName = "PaginationNext"
92
+
93
+ const PaginationEllipsis = ({
94
+ className,
95
+ ...props
96
+ }: React.ComponentProps<"span">) => (
97
+ <span
98
+ aria-hidden
99
+ className={cn("flex size-9 items-center justify-center", className)}
100
+ {...props}
101
+ >
102
+ <MoreHorizontal className="size-4" />
103
+ <span className="sr-only">More pages</span>
104
+ </span>
105
+ )
106
+ PaginationEllipsis.displayName = "PaginationEllipsis"
107
+
108
+ export {
109
+ Pagination,
110
+ PaginationContent,
111
+ PaginationEllipsis,
112
+ PaginationItem,
113
+ PaginationLink,
114
+ PaginationNext,
115
+ PaginationPrevious,
116
+ }
@@ -0,0 +1,28 @@
1
+ import * as React from "react"
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover"
3
+ import { cn } from "./lib/utils"
4
+
5
+ const Popover = PopoverPrimitive.Root
6
+
7
+ const PopoverTrigger = PopoverPrimitive.Trigger
8
+
9
+ const PopoverContent = React.forwardRef<
10
+ React.ElementRef<typeof PopoverPrimitive.Content>,
11
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
12
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
13
+ <PopoverPrimitive.Portal>
14
+ <PopoverPrimitive.Content
15
+ ref={ref}
16
+ align={align}
17
+ sideOffset={sideOffset}
18
+ className={cn(
19
+ "z-50 w-72 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",
20
+ className
21
+ )}
22
+ {...props}
23
+ />
24
+ </PopoverPrimitive.Portal>
25
+ ))
26
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName
27
+
28
+ export { Popover, PopoverTrigger, PopoverContent }
@@ -0,0 +1,25 @@
1
+ import * as React from "react"
2
+ import * as ProgressPrimitive from "@radix-ui/react-progress"
3
+ import { cn } from "./lib/utils"
4
+
5
+ const Progress = React.forwardRef<
6
+ React.ElementRef<typeof ProgressPrimitive.Root>,
7
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
8
+ >(({ className, value, ...props }, ref) => (
9
+ <ProgressPrimitive.Root
10
+ ref={ref}
11
+ className={cn(
12
+ "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
13
+ className
14
+ )}
15
+ {...props}
16
+ >
17
+ <ProgressPrimitive.Indicator
18
+ className="h-full w-full flex-1 bg-primary transition-all"
19
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
20
+ />
21
+ </ProgressPrimitive.Root>
22
+ ))
23
+ Progress.displayName = ProgressPrimitive.Root.displayName
24
+
25
+ export { Progress }
@@ -0,0 +1,41 @@
1
+ import * as React from "react"
2
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
3
+ import { Circle } from "lucide-react"
4
+ import { cn } from "./lib/utils"
5
+
6
+ const RadioGroup = React.forwardRef<
7
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
8
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
9
+ >(({ className, ...props }, ref) => {
10
+ return (
11
+ <RadioGroupPrimitive.Root
12
+ className={cn("grid gap-2", className)}
13
+ {...props}
14
+ ref={ref}
15
+ />
16
+ )
17
+ })
18
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
19
+
20
+ const RadioGroupItem = React.forwardRef<
21
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
22
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
23
+ >(({ className, ...props }, ref) => {
24
+ return (
25
+ <RadioGroupPrimitive.Item
26
+ ref={ref}
27
+ className={cn(
28
+ "aspect-square size-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
29
+ className
30
+ )}
31
+ {...props}
32
+ >
33
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
34
+ <Circle className="size-2.5 fill-current text-current" />
35
+ </RadioGroupPrimitive.Indicator>
36
+ </RadioGroupPrimitive.Item>
37
+ )
38
+ })
39
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
40
+
41
+ export { RadioGroup, RadioGroupItem }