@blips/ui 0.0.1 → 1.0.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.
- package/dist/index.cjs +1347 -146
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +185 -6
- package/dist/index.d.ts +185 -6
- package/dist/index.js +1295 -148
- package/dist/index.js.map +1 -1
- package/package.json +25 -13
- package/src/components/accordion.tsx +12 -12
- package/src/components/alert-dialog.tsx +25 -24
- package/src/components/alert.tsx +11 -11
- package/src/components/aspect-ratio.tsx +3 -3
- package/src/components/avatar.tsx +11 -11
- package/src/components/badge.tsx +6 -6
- package/src/components/breadcrumb.tsx +23 -23
- package/src/components/button-group.tsx +83 -0
- package/src/components/button.tsx +11 -11
- package/src/components/calendar.tsx +21 -24
- package/src/components/card.tsx +15 -22
- package/src/components/carousel.tsx +72 -71
- package/src/components/chart.tsx +368 -0
- package/src/components/checkbox.tsx +7 -7
- package/src/components/collapsible.tsx +6 -6
- package/src/components/command.tsx +27 -26
- package/src/components/context-menu.tsx +33 -33
- package/src/components/dialog.tsx +22 -22
- package/src/components/drawer.tsx +21 -21
- package/src/components/dropdown-menu.tsx +34 -34
- package/src/components/form.tsx +178 -0
- package/src/components/hover-card.tsx +8 -8
- package/src/components/input-group.tsx +175 -0
- package/src/components/input-otp.tsx +16 -16
- package/src/components/input.tsx +6 -6
- package/src/components/kbd.tsx +28 -0
- package/src/components/label.tsx +9 -9
- package/src/components/menubar.tsx +36 -36
- package/src/components/navigation-menu.tsx +21 -21
- package/src/components/pagination.tsx +22 -21
- package/src/components/popover.tsx +8 -8
- package/src/components/progress.tsx +7 -7
- package/src/components/radio-group.tsx +11 -11
- package/src/components/resizable.tsx +14 -14
- package/src/components/scroll-area.tsx +8 -8
- package/src/components/select.tsx +23 -23
- package/src/components/separator.tsx +6 -6
- package/src/components/sheet.tsx +24 -24
- package/src/components/sidebar.tsx +774 -0
- package/src/components/skeleton.tsx +3 -3
- package/src/components/slider.tsx +6 -6
- package/src/components/sonner.tsx +9 -9
- package/src/components/spinner.tsx +16 -0
- package/src/components/switch.tsx +6 -6
- package/src/components/table.tsx +19 -19
- package/src/components/tabs.tsx +11 -11
- package/src/components/textarea.tsx +6 -6
- package/src/components/toggle-group.tsx +15 -14
- package/src/components/toggle.tsx +8 -8
- package/src/components/tooltip.tsx +10 -10
- package/src/globals.css +45 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.ts +78 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import type * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { Button } from "@/components/button"
|
|
6
|
+
import { Input } from "@/components/input"
|
|
7
|
+
import { Textarea } from "@/components/textarea"
|
|
8
|
+
|
|
9
|
+
function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
data-slot="input-group"
|
|
13
|
+
role="group"
|
|
14
|
+
className={cn(
|
|
15
|
+
"group/input-group border-input dark:bg-input/30 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow]",
|
|
16
|
+
"h-9 has-[>textarea]:h-auto",
|
|
17
|
+
|
|
18
|
+
// Variants based on alignment.
|
|
19
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
20
|
+
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
21
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
22
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
23
|
+
|
|
24
|
+
// Focus state.
|
|
25
|
+
"has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]:focus-visible]:ring-1",
|
|
26
|
+
|
|
27
|
+
// Error state.
|
|
28
|
+
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
29
|
+
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const inputGroupAddonVariants = cva(
|
|
38
|
+
"text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
|
|
39
|
+
{
|
|
40
|
+
variants: {
|
|
41
|
+
align: {
|
|
42
|
+
"inline-start":
|
|
43
|
+
"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
44
|
+
"inline-end":
|
|
45
|
+
"order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]",
|
|
46
|
+
"block-start":
|
|
47
|
+
"[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5",
|
|
48
|
+
"block-end":
|
|
49
|
+
"[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
align: "inline-start",
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
function InputGroupAddon({
|
|
59
|
+
className,
|
|
60
|
+
align = "inline-start",
|
|
61
|
+
...props
|
|
62
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
|
|
63
|
+
const focusInput = (e: React.SyntheticEvent<HTMLDivElement>) => {
|
|
64
|
+
if ((e.target as HTMLElement).closest("button")) {
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
role="group"
|
|
73
|
+
data-slot="input-group-addon"
|
|
74
|
+
data-align={align}
|
|
75
|
+
className={cn(inputGroupAddonVariants({ align }), className)}
|
|
76
|
+
onClick={focusInput}
|
|
77
|
+
onKeyDown={(e) => {
|
|
78
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
79
|
+
focusInput(e)
|
|
80
|
+
}
|
|
81
|
+
}}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const inputGroupButtonVariants = cva(
|
|
88
|
+
"flex items-center gap-2 text-sm shadow-none",
|
|
89
|
+
{
|
|
90
|
+
variants: {
|
|
91
|
+
size: {
|
|
92
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
93
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
94
|
+
"icon-xs":
|
|
95
|
+
"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
96
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
defaultVariants: {
|
|
100
|
+
size: "xs",
|
|
101
|
+
},
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
function InputGroupButton({
|
|
106
|
+
className,
|
|
107
|
+
type = "button",
|
|
108
|
+
variant = "ghost",
|
|
109
|
+
size = "xs",
|
|
110
|
+
...props
|
|
111
|
+
}: Omit<React.ComponentProps<typeof Button>, "size"> &
|
|
112
|
+
VariantProps<typeof inputGroupButtonVariants>) {
|
|
113
|
+
return (
|
|
114
|
+
<Button
|
|
115
|
+
type={type}
|
|
116
|
+
data-size={size}
|
|
117
|
+
variant={variant}
|
|
118
|
+
className={cn(inputGroupButtonVariants({ size }), className)}
|
|
119
|
+
{...props}
|
|
120
|
+
/>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
|
|
125
|
+
return (
|
|
126
|
+
<span
|
|
127
|
+
className={cn(
|
|
128
|
+
"text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
129
|
+
className
|
|
130
|
+
)}
|
|
131
|
+
{...props}
|
|
132
|
+
/>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function InputGroupInput({
|
|
137
|
+
className,
|
|
138
|
+
...props
|
|
139
|
+
}: React.ComponentProps<"input">) {
|
|
140
|
+
return (
|
|
141
|
+
<Input
|
|
142
|
+
data-slot="input-group-control"
|
|
143
|
+
className={cn(
|
|
144
|
+
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
145
|
+
className
|
|
146
|
+
)}
|
|
147
|
+
{...props}
|
|
148
|
+
/>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function InputGroupTextarea({
|
|
153
|
+
className,
|
|
154
|
+
...props
|
|
155
|
+
}: React.ComponentProps<"textarea">) {
|
|
156
|
+
return (
|
|
157
|
+
<Textarea
|
|
158
|
+
data-slot="input-group-control"
|
|
159
|
+
className={cn(
|
|
160
|
+
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
161
|
+
className
|
|
162
|
+
)}
|
|
163
|
+
{...props}
|
|
164
|
+
/>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export {
|
|
169
|
+
InputGroup,
|
|
170
|
+
InputGroupAddon,
|
|
171
|
+
InputGroupButton,
|
|
172
|
+
InputGroupText,
|
|
173
|
+
InputGroupInput,
|
|
174
|
+
InputGroupTextarea,
|
|
175
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { OTPInput, OTPInputContext } from "input-otp"
|
|
3
|
+
import { Dot } from "lucide-react"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
7
|
const InputOTP = React.forwardRef<
|
|
8
8
|
React.ElementRef<typeof OTPInput>,
|
|
@@ -17,23 +17,23 @@ const InputOTP = React.forwardRef<
|
|
|
17
17
|
className={cn("disabled:cursor-not-allowed", className)}
|
|
18
18
|
{...props}
|
|
19
19
|
/>
|
|
20
|
-
))
|
|
21
|
-
InputOTP.displayName = "InputOTP"
|
|
20
|
+
))
|
|
21
|
+
InputOTP.displayName = "InputOTP"
|
|
22
22
|
|
|
23
23
|
const InputOTPGroup = React.forwardRef<
|
|
24
24
|
React.ElementRef<"div">,
|
|
25
25
|
React.ComponentPropsWithoutRef<"div">
|
|
26
26
|
>(({ className, ...props }, ref) => (
|
|
27
27
|
<div ref={ref} className={cn("flex items-center", className)} {...props} />
|
|
28
|
-
))
|
|
29
|
-
InputOTPGroup.displayName = "InputOTPGroup"
|
|
28
|
+
))
|
|
29
|
+
InputOTPGroup.displayName = "InputOTPGroup"
|
|
30
30
|
|
|
31
31
|
const InputOTPSlot = React.forwardRef<
|
|
32
32
|
React.ElementRef<"div">,
|
|
33
33
|
React.ComponentPropsWithoutRef<"div"> & { index: number }
|
|
34
34
|
>(({ index, className, ...props }, ref) => {
|
|
35
|
-
const inputOTPContext = React.useContext(OTPInputContext)
|
|
36
|
-
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]
|
|
35
|
+
const inputOTPContext = React.useContext(OTPInputContext)
|
|
36
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<div
|
|
@@ -52,9 +52,9 @@ const InputOTPSlot = React.forwardRef<
|
|
|
52
52
|
</div>
|
|
53
53
|
)}
|
|
54
54
|
</div>
|
|
55
|
-
)
|
|
56
|
-
})
|
|
57
|
-
InputOTPSlot.displayName = "InputOTPSlot"
|
|
55
|
+
)
|
|
56
|
+
})
|
|
57
|
+
InputOTPSlot.displayName = "InputOTPSlot"
|
|
58
58
|
|
|
59
59
|
const InputOTPSeparator = React.forwardRef<
|
|
60
60
|
React.ElementRef<"div">,
|
|
@@ -63,7 +63,7 @@ const InputOTPSeparator = React.forwardRef<
|
|
|
63
63
|
<div ref={ref} role="separator" {...props}>
|
|
64
64
|
<Dot />
|
|
65
65
|
</div>
|
|
66
|
-
))
|
|
67
|
-
InputOTPSeparator.displayName = "InputOTPSeparator"
|
|
66
|
+
))
|
|
67
|
+
InputOTPSeparator.displayName = "InputOTPSeparator"
|
|
68
68
|
|
|
69
|
-
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
|
|
69
|
+
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
|
package/src/components/input.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from "react"
|
|
1
|
+
import * as React from "react"
|
|
2
2
|
|
|
3
|
-
import { cn } from "
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
4
|
|
|
5
5
|
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
|
6
6
|
({ className, type, ...props }, ref) => {
|
|
@@ -14,9 +14,9 @@ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
|
|
14
14
|
ref={ref}
|
|
15
15
|
{...props}
|
|
16
16
|
/>
|
|
17
|
-
)
|
|
17
|
+
)
|
|
18
18
|
}
|
|
19
|
-
)
|
|
20
|
-
Input.displayName = "Input"
|
|
19
|
+
)
|
|
20
|
+
Input.displayName = "Input"
|
|
21
21
|
|
|
22
|
-
export { Input }
|
|
22
|
+
export { Input }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from "@/lib/utils"
|
|
2
|
+
|
|
3
|
+
function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
|
|
4
|
+
return (
|
|
5
|
+
<kbd
|
|
6
|
+
data-slot="kbd"
|
|
7
|
+
className={cn(
|
|
8
|
+
"bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium",
|
|
9
|
+
"[&_svg:not([class*='size-'])]:size-3",
|
|
10
|
+
"[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
+
return (
|
|
20
|
+
<kbd
|
|
21
|
+
data-slot="kbd-group"
|
|
22
|
+
className={cn("inline-flex items-center gap-1", className)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { Kbd, KbdGroup }
|
package/src/components/label.tsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
6
|
|
|
7
|
-
import { cn } from "
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
8
|
|
|
9
9
|
const labelVariants = cva(
|
|
10
10
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
11
|
-
)
|
|
11
|
+
)
|
|
12
12
|
|
|
13
13
|
const Label = React.forwardRef<
|
|
14
14
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
@@ -20,7 +20,7 @@ const Label = React.forwardRef<
|
|
|
20
20
|
className={cn(labelVariants(), className)}
|
|
21
21
|
{...props}
|
|
22
22
|
/>
|
|
23
|
-
))
|
|
24
|
-
Label.displayName = LabelPrimitive.Root.displayName
|
|
23
|
+
))
|
|
24
|
+
Label.displayName = LabelPrimitive.Root.displayName
|
|
25
25
|
|
|
26
|
-
export { Label }
|
|
26
|
+
export { Label }
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar"
|
|
3
|
+
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
7
|
function MenubarMenu({
|
|
8
8
|
...props
|
|
9
9
|
}: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
|
|
10
|
-
return <MenubarPrimitive.Menu {...props}
|
|
10
|
+
return <MenubarPrimitive.Menu {...props} />
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function MenubarGroup({
|
|
14
14
|
...props
|
|
15
15
|
}: React.ComponentProps<typeof MenubarPrimitive.Group>) {
|
|
16
|
-
return <MenubarPrimitive.Group {...props}
|
|
16
|
+
return <MenubarPrimitive.Group {...props} />
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function MenubarPortal({
|
|
20
20
|
...props
|
|
21
21
|
}: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
|
|
22
|
-
return <MenubarPrimitive.Portal {...props}
|
|
22
|
+
return <MenubarPrimitive.Portal {...props} />
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
function MenubarRadioGroup({
|
|
26
26
|
...props
|
|
27
27
|
}: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
|
|
28
|
-
return <MenubarPrimitive.RadioGroup {...props}
|
|
28
|
+
return <MenubarPrimitive.RadioGroup {...props} />
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function MenubarSub({
|
|
32
32
|
...props
|
|
33
33
|
}: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
|
|
34
|
-
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props}
|
|
34
|
+
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const Menubar = React.forwardRef<
|
|
@@ -46,8 +46,8 @@ const Menubar = React.forwardRef<
|
|
|
46
46
|
)}
|
|
47
47
|
{...props}
|
|
48
48
|
/>
|
|
49
|
-
))
|
|
50
|
-
Menubar.displayName = MenubarPrimitive.Root.displayName
|
|
49
|
+
))
|
|
50
|
+
Menubar.displayName = MenubarPrimitive.Root.displayName
|
|
51
51
|
|
|
52
52
|
const MenubarTrigger = React.forwardRef<
|
|
53
53
|
React.ElementRef<typeof MenubarPrimitive.Trigger>,
|
|
@@ -61,13 +61,13 @@ const MenubarTrigger = React.forwardRef<
|
|
|
61
61
|
)}
|
|
62
62
|
{...props}
|
|
63
63
|
/>
|
|
64
|
-
))
|
|
65
|
-
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
|
|
64
|
+
))
|
|
65
|
+
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
|
|
66
66
|
|
|
67
67
|
const MenubarSubTrigger = React.forwardRef<
|
|
68
68
|
React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
|
|
69
69
|
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
|
|
70
|
-
inset?: boolean
|
|
70
|
+
inset?: boolean
|
|
71
71
|
}
|
|
72
72
|
>(({ className, inset, children, ...props }, ref) => (
|
|
73
73
|
<MenubarPrimitive.SubTrigger
|
|
@@ -82,8 +82,8 @@ const MenubarSubTrigger = React.forwardRef<
|
|
|
82
82
|
{children}
|
|
83
83
|
<ChevronRight className="ml-auto h-4 w-4" />
|
|
84
84
|
</MenubarPrimitive.SubTrigger>
|
|
85
|
-
))
|
|
86
|
-
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
|
|
85
|
+
))
|
|
86
|
+
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
|
|
87
87
|
|
|
88
88
|
const MenubarSubContent = React.forwardRef<
|
|
89
89
|
React.ElementRef<typeof MenubarPrimitive.SubContent>,
|
|
@@ -97,8 +97,8 @@ const MenubarSubContent = React.forwardRef<
|
|
|
97
97
|
)}
|
|
98
98
|
{...props}
|
|
99
99
|
/>
|
|
100
|
-
))
|
|
101
|
-
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
|
|
100
|
+
))
|
|
101
|
+
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
|
|
102
102
|
|
|
103
103
|
const MenubarContent = React.forwardRef<
|
|
104
104
|
React.ElementRef<typeof MenubarPrimitive.Content>,
|
|
@@ -122,13 +122,13 @@ const MenubarContent = React.forwardRef<
|
|
|
122
122
|
/>
|
|
123
123
|
</MenubarPrimitive.Portal>
|
|
124
124
|
)
|
|
125
|
-
)
|
|
126
|
-
MenubarContent.displayName = MenubarPrimitive.Content.displayName
|
|
125
|
+
)
|
|
126
|
+
MenubarContent.displayName = MenubarPrimitive.Content.displayName
|
|
127
127
|
|
|
128
128
|
const MenubarItem = React.forwardRef<
|
|
129
129
|
React.ElementRef<typeof MenubarPrimitive.Item>,
|
|
130
130
|
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
|
|
131
|
-
inset?: boolean
|
|
131
|
+
inset?: boolean
|
|
132
132
|
}
|
|
133
133
|
>(({ className, inset, ...props }, ref) => (
|
|
134
134
|
<MenubarPrimitive.Item
|
|
@@ -140,8 +140,8 @@ const MenubarItem = React.forwardRef<
|
|
|
140
140
|
)}
|
|
141
141
|
{...props}
|
|
142
142
|
/>
|
|
143
|
-
))
|
|
144
|
-
MenubarItem.displayName = MenubarPrimitive.Item.displayName
|
|
143
|
+
))
|
|
144
|
+
MenubarItem.displayName = MenubarPrimitive.Item.displayName
|
|
145
145
|
|
|
146
146
|
const MenubarCheckboxItem = React.forwardRef<
|
|
147
147
|
React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
|
|
@@ -163,8 +163,8 @@ const MenubarCheckboxItem = React.forwardRef<
|
|
|
163
163
|
</span>
|
|
164
164
|
{children}
|
|
165
165
|
</MenubarPrimitive.CheckboxItem>
|
|
166
|
-
))
|
|
167
|
-
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
|
|
166
|
+
))
|
|
167
|
+
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
|
|
168
168
|
|
|
169
169
|
const MenubarRadioItem = React.forwardRef<
|
|
170
170
|
React.ElementRef<typeof MenubarPrimitive.RadioItem>,
|
|
@@ -185,13 +185,13 @@ const MenubarRadioItem = React.forwardRef<
|
|
|
185
185
|
</span>
|
|
186
186
|
{children}
|
|
187
187
|
</MenubarPrimitive.RadioItem>
|
|
188
|
-
))
|
|
189
|
-
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
|
|
188
|
+
))
|
|
189
|
+
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
|
|
190
190
|
|
|
191
191
|
const MenubarLabel = React.forwardRef<
|
|
192
192
|
React.ElementRef<typeof MenubarPrimitive.Label>,
|
|
193
193
|
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
|
|
194
|
-
inset?: boolean
|
|
194
|
+
inset?: boolean
|
|
195
195
|
}
|
|
196
196
|
>(({ className, inset, ...props }, ref) => (
|
|
197
197
|
<MenubarPrimitive.Label
|
|
@@ -203,8 +203,8 @@ const MenubarLabel = React.forwardRef<
|
|
|
203
203
|
)}
|
|
204
204
|
{...props}
|
|
205
205
|
/>
|
|
206
|
-
))
|
|
207
|
-
MenubarLabel.displayName = MenubarPrimitive.Label.displayName
|
|
206
|
+
))
|
|
207
|
+
MenubarLabel.displayName = MenubarPrimitive.Label.displayName
|
|
208
208
|
|
|
209
209
|
const MenubarSeparator = React.forwardRef<
|
|
210
210
|
React.ElementRef<typeof MenubarPrimitive.Separator>,
|
|
@@ -215,8 +215,8 @@ const MenubarSeparator = React.forwardRef<
|
|
|
215
215
|
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
216
216
|
{...props}
|
|
217
217
|
/>
|
|
218
|
-
))
|
|
219
|
-
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
|
|
218
|
+
))
|
|
219
|
+
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
|
|
220
220
|
|
|
221
221
|
const MenubarShortcut = ({
|
|
222
222
|
className,
|
|
@@ -230,9 +230,9 @@ const MenubarShortcut = ({
|
|
|
230
230
|
)}
|
|
231
231
|
{...props}
|
|
232
232
|
/>
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
MenubarShortcut.displayname = "MenubarShortcut"
|
|
233
|
+
)
|
|
234
|
+
}
|
|
235
|
+
MenubarShortcut.displayname = "MenubarShortcut"
|
|
236
236
|
|
|
237
237
|
export {
|
|
238
238
|
Menubar,
|
|
@@ -251,4 +251,4 @@ export {
|
|
|
251
251
|
MenubarGroup,
|
|
252
252
|
MenubarSub,
|
|
253
253
|
MenubarShortcut,
|
|
254
|
-
}
|
|
254
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
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
5
|
|
|
6
|
-
import { cn } from "
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
7
|
|
|
8
8
|
const NavigationMenu = React.forwardRef<
|
|
9
9
|
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
|
@@ -20,8 +20,8 @@ const NavigationMenu = React.forwardRef<
|
|
|
20
20
|
{children}
|
|
21
21
|
<NavigationMenuViewport />
|
|
22
22
|
</NavigationMenuPrimitive.Root>
|
|
23
|
-
))
|
|
24
|
-
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
|
|
23
|
+
))
|
|
24
|
+
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
|
|
25
25
|
|
|
26
26
|
const NavigationMenuList = React.forwardRef<
|
|
27
27
|
React.ElementRef<typeof NavigationMenuPrimitive.List>,
|
|
@@ -35,14 +35,14 @@ const NavigationMenuList = React.forwardRef<
|
|
|
35
35
|
)}
|
|
36
36
|
{...props}
|
|
37
37
|
/>
|
|
38
|
-
))
|
|
39
|
-
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
|
|
38
|
+
))
|
|
39
|
+
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
|
|
40
40
|
|
|
41
|
-
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
|
41
|
+
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
|
42
42
|
|
|
43
43
|
const navigationMenuTriggerStyle = cva(
|
|
44
44
|
"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-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
|
|
45
|
-
)
|
|
45
|
+
)
|
|
46
46
|
|
|
47
47
|
const NavigationMenuTrigger = React.forwardRef<
|
|
48
48
|
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
|
|
@@ -59,8 +59,8 @@ const NavigationMenuTrigger = React.forwardRef<
|
|
|
59
59
|
aria-hidden="true"
|
|
60
60
|
/>
|
|
61
61
|
</NavigationMenuPrimitive.Trigger>
|
|
62
|
-
))
|
|
63
|
-
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
|
|
62
|
+
))
|
|
63
|
+
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
|
|
64
64
|
|
|
65
65
|
const NavigationMenuContent = React.forwardRef<
|
|
66
66
|
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
|
|
@@ -74,10 +74,10 @@ const NavigationMenuContent = React.forwardRef<
|
|
|
74
74
|
)}
|
|
75
75
|
{...props}
|
|
76
76
|
/>
|
|
77
|
-
))
|
|
78
|
-
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
|
|
77
|
+
))
|
|
78
|
+
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
|
|
79
79
|
|
|
80
|
-
const NavigationMenuLink = NavigationMenuPrimitive.Link
|
|
80
|
+
const NavigationMenuLink = NavigationMenuPrimitive.Link
|
|
81
81
|
|
|
82
82
|
const NavigationMenuViewport = React.forwardRef<
|
|
83
83
|
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
|
|
@@ -93,9 +93,9 @@ const NavigationMenuViewport = React.forwardRef<
|
|
|
93
93
|
{...props}
|
|
94
94
|
/>
|
|
95
95
|
</div>
|
|
96
|
-
))
|
|
96
|
+
))
|
|
97
97
|
NavigationMenuViewport.displayName =
|
|
98
|
-
NavigationMenuPrimitive.Viewport.displayName
|
|
98
|
+
NavigationMenuPrimitive.Viewport.displayName
|
|
99
99
|
|
|
100
100
|
const NavigationMenuIndicator = React.forwardRef<
|
|
101
101
|
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
|
|
@@ -111,9 +111,9 @@ const NavigationMenuIndicator = React.forwardRef<
|
|
|
111
111
|
>
|
|
112
112
|
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
113
113
|
</NavigationMenuPrimitive.Indicator>
|
|
114
|
-
))
|
|
114
|
+
))
|
|
115
115
|
NavigationMenuIndicator.displayName =
|
|
116
|
-
NavigationMenuPrimitive.Indicator.displayName
|
|
116
|
+
NavigationMenuPrimitive.Indicator.displayName
|
|
117
117
|
|
|
118
118
|
export {
|
|
119
119
|
navigationMenuTriggerStyle,
|
|
@@ -125,4 +125,4 @@ export {
|
|
|
125
125
|
NavigationMenuLink,
|
|
126
126
|
NavigationMenuIndicator,
|
|
127
127
|
NavigationMenuViewport,
|
|
128
|
-
}
|
|
128
|
+
}
|