@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blips/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Blips UI Component Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -61,7 +61,15 @@
|
|
|
61
61
|
"./components/textarea": "./src/components/textarea.tsx",
|
|
62
62
|
"./components/toggle": "./src/components/toggle.tsx",
|
|
63
63
|
"./components/toggle-group": "./src/components/toggle-group.tsx",
|
|
64
|
-
"./components/tooltip": "./src/components/tooltip.tsx"
|
|
64
|
+
"./components/tooltip": "./src/components/tooltip.tsx",
|
|
65
|
+
"./components/button-group": "./src/components/button-group.tsx",
|
|
66
|
+
"./components/chart": "./src/components/chart.tsx",
|
|
67
|
+
"./components/form": "./src/components/form.tsx",
|
|
68
|
+
"./components/input-group": "./src/components/input-group.tsx",
|
|
69
|
+
"./components/kbd": "./src/components/kbd.tsx",
|
|
70
|
+
"./components/sidebar": "./src/components/sidebar.tsx",
|
|
71
|
+
"./components/spinner": "./src/components/spinner.tsx",
|
|
72
|
+
"./hooks/use-mobile": "./src/hooks/use-mobile.tsx"
|
|
65
73
|
},
|
|
66
74
|
"files": [
|
|
67
75
|
"dist",
|
|
@@ -70,19 +78,12 @@
|
|
|
70
78
|
"sideEffects": [
|
|
71
79
|
"**/*.css"
|
|
72
80
|
],
|
|
73
|
-
"scripts": {
|
|
74
|
-
"build": "tsup",
|
|
75
|
-
"dev": "tsup --watch",
|
|
76
|
-
"typecheck": "tsc --noEmit",
|
|
77
|
-
"lint": "biome lint src/",
|
|
78
|
-
"clean": "rm -rf dist .turbo",
|
|
79
|
-
"registry:build": "node scripts/build-registry.js"
|
|
80
|
-
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
83
83
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
+
"@hookform/resolvers": "^5.2.2",
|
|
86
87
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
87
88
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
88
89
|
"@radix-ui/react-aspect-ratio": "^1.1.8",
|
|
@@ -118,10 +119,13 @@
|
|
|
118
119
|
"lucide-react": "^0.468.0",
|
|
119
120
|
"next-themes": "^0.4.6",
|
|
120
121
|
"react-day-picker": "^9.13.0",
|
|
122
|
+
"react-hook-form": "^7.71.1",
|
|
121
123
|
"react-resizable-panels": "^4.5.9",
|
|
124
|
+
"recharts": "2.15.4",
|
|
122
125
|
"sonner": "^2.0.7",
|
|
123
126
|
"tailwind-merge": "^2.6.0",
|
|
124
|
-
"vaul": "^1.1.2"
|
|
127
|
+
"vaul": "^1.1.2",
|
|
128
|
+
"zod": "^4.3.6"
|
|
125
129
|
},
|
|
126
130
|
"devDependencies": {
|
|
127
131
|
"@types/node": "^22.10.2",
|
|
@@ -149,5 +153,13 @@
|
|
|
149
153
|
"radix-ui",
|
|
150
154
|
"blips"
|
|
151
155
|
],
|
|
152
|
-
"license": "MIT"
|
|
153
|
-
|
|
156
|
+
"license": "MIT",
|
|
157
|
+
"scripts": {
|
|
158
|
+
"build": "tsup",
|
|
159
|
+
"dev": "tsup --watch",
|
|
160
|
+
"typecheck": "tsc --noEmit",
|
|
161
|
+
"lint": "biome lint src/",
|
|
162
|
+
"clean": "rm -rf dist .turbo",
|
|
163
|
+
"registry:build": "node scripts/build-registry.js"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
3
|
+
import { ChevronDown } from "lucide-react"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
|
-
const Accordion = AccordionPrimitive.Root
|
|
7
|
+
const Accordion = AccordionPrimitive.Root
|
|
8
8
|
|
|
9
9
|
const AccordionItem = React.forwardRef<
|
|
10
10
|
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
@@ -15,8 +15,8 @@ const AccordionItem = React.forwardRef<
|
|
|
15
15
|
className={cn("border-b", className)}
|
|
16
16
|
{...props}
|
|
17
17
|
/>
|
|
18
|
-
))
|
|
19
|
-
AccordionItem.displayName = "AccordionItem"
|
|
18
|
+
))
|
|
19
|
+
AccordionItem.displayName = "AccordionItem"
|
|
20
20
|
|
|
21
21
|
const AccordionTrigger = React.forwardRef<
|
|
22
22
|
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
@@ -35,8 +35,8 @@ const AccordionTrigger = React.forwardRef<
|
|
|
35
35
|
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
36
36
|
</AccordionPrimitive.Trigger>
|
|
37
37
|
</AccordionPrimitive.Header>
|
|
38
|
-
))
|
|
39
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
38
|
+
))
|
|
39
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
40
40
|
|
|
41
41
|
const AccordionContent = React.forwardRef<
|
|
42
42
|
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
@@ -49,8 +49,8 @@ const AccordionContent = React.forwardRef<
|
|
|
49
49
|
>
|
|
50
50
|
<div className={cn("pb-4 pt-0", className)}>{children}</div>
|
|
51
51
|
</AccordionPrimitive.Content>
|
|
52
|
-
))
|
|
52
|
+
))
|
|
53
53
|
|
|
54
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
|
54
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
|
55
55
|
|
|
56
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
56
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import { buttonVariants } from "./button";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { buttonVariants } from "@/components/button"
|
|
7
6
|
|
|
8
|
-
const
|
|
7
|
+
const AlertDialog = AlertDialogPrimitive.Root
|
|
9
8
|
|
|
10
|
-
const
|
|
9
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
10
|
+
|
|
11
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
11
12
|
|
|
12
13
|
const AlertDialogOverlay = React.forwardRef<
|
|
13
14
|
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
@@ -21,8 +22,8 @@ const AlertDialogOverlay = React.forwardRef<
|
|
|
21
22
|
{...props}
|
|
22
23
|
ref={ref}
|
|
23
24
|
/>
|
|
24
|
-
))
|
|
25
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
|
|
25
|
+
))
|
|
26
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
|
|
26
27
|
|
|
27
28
|
const AlertDialogContent = React.forwardRef<
|
|
28
29
|
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
@@ -39,8 +40,8 @@ const AlertDialogContent = React.forwardRef<
|
|
|
39
40
|
{...props}
|
|
40
41
|
/>
|
|
41
42
|
</AlertDialogPortal>
|
|
42
|
-
))
|
|
43
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
43
|
+
))
|
|
44
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
44
45
|
|
|
45
46
|
const AlertDialogHeader = ({
|
|
46
47
|
className,
|
|
@@ -53,8 +54,8 @@ const AlertDialogHeader = ({
|
|
|
53
54
|
)}
|
|
54
55
|
{...props}
|
|
55
56
|
/>
|
|
56
|
-
)
|
|
57
|
-
AlertDialogHeader.displayName = "AlertDialogHeader"
|
|
57
|
+
)
|
|
58
|
+
AlertDialogHeader.displayName = "AlertDialogHeader"
|
|
58
59
|
|
|
59
60
|
const AlertDialogFooter = ({
|
|
60
61
|
className,
|
|
@@ -67,8 +68,8 @@ const AlertDialogFooter = ({
|
|
|
67
68
|
)}
|
|
68
69
|
{...props}
|
|
69
70
|
/>
|
|
70
|
-
)
|
|
71
|
-
AlertDialogFooter.displayName = "AlertDialogFooter"
|
|
71
|
+
)
|
|
72
|
+
AlertDialogFooter.displayName = "AlertDialogFooter"
|
|
72
73
|
|
|
73
74
|
const AlertDialogTitle = React.forwardRef<
|
|
74
75
|
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
@@ -79,8 +80,8 @@ const AlertDialogTitle = React.forwardRef<
|
|
|
79
80
|
className={cn("text-lg font-semibold", className)}
|
|
80
81
|
{...props}
|
|
81
82
|
/>
|
|
82
|
-
))
|
|
83
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
|
|
83
|
+
))
|
|
84
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
|
|
84
85
|
|
|
85
86
|
const AlertDialogDescription = React.forwardRef<
|
|
86
87
|
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
@@ -91,9 +92,9 @@ const AlertDialogDescription = React.forwardRef<
|
|
|
91
92
|
className={cn("text-sm text-muted-foreground", className)}
|
|
92
93
|
{...props}
|
|
93
94
|
/>
|
|
94
|
-
))
|
|
95
|
+
))
|
|
95
96
|
AlertDialogDescription.displayName =
|
|
96
|
-
AlertDialogPrimitive.Description.displayName
|
|
97
|
+
AlertDialogPrimitive.Description.displayName
|
|
97
98
|
|
|
98
99
|
const AlertDialogAction = React.forwardRef<
|
|
99
100
|
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
@@ -104,8 +105,8 @@ const AlertDialogAction = React.forwardRef<
|
|
|
104
105
|
className={cn(buttonVariants(), className)}
|
|
105
106
|
{...props}
|
|
106
107
|
/>
|
|
107
|
-
))
|
|
108
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
|
|
108
|
+
))
|
|
109
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
|
|
109
110
|
|
|
110
111
|
const AlertDialogCancel = React.forwardRef<
|
|
111
112
|
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
@@ -120,8 +121,8 @@ const AlertDialogCancel = React.forwardRef<
|
|
|
120
121
|
)}
|
|
121
122
|
{...props}
|
|
122
123
|
/>
|
|
123
|
-
))
|
|
124
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|
124
|
+
))
|
|
125
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|
125
126
|
|
|
126
127
|
export {
|
|
127
128
|
AlertDialog,
|
|
@@ -135,4 +136,4 @@ export {
|
|
|
135
136
|
AlertDialogDescription,
|
|
136
137
|
AlertDialogAction,
|
|
137
138
|
AlertDialogCancel,
|
|
138
|
-
}
|
|
139
|
+
}
|
package/src/components/alert.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
7
|
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
@@ -17,7 +17,7 @@ const alertVariants = cva(
|
|
|
17
17
|
variant: "default",
|
|
18
18
|
},
|
|
19
19
|
}
|
|
20
|
-
)
|
|
20
|
+
)
|
|
21
21
|
|
|
22
22
|
const Alert = React.forwardRef<
|
|
23
23
|
HTMLDivElement,
|
|
@@ -29,8 +29,8 @@ const Alert = React.forwardRef<
|
|
|
29
29
|
className={cn(alertVariants({ variant }), className)}
|
|
30
30
|
{...props}
|
|
31
31
|
/>
|
|
32
|
-
))
|
|
33
|
-
Alert.displayName = "Alert"
|
|
32
|
+
))
|
|
33
|
+
Alert.displayName = "Alert"
|
|
34
34
|
|
|
35
35
|
const AlertTitle = React.forwardRef<
|
|
36
36
|
HTMLParagraphElement,
|
|
@@ -41,8 +41,8 @@ const AlertTitle = React.forwardRef<
|
|
|
41
41
|
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
|
|
42
42
|
{...props}
|
|
43
43
|
/>
|
|
44
|
-
))
|
|
45
|
-
AlertTitle.displayName = "AlertTitle"
|
|
44
|
+
))
|
|
45
|
+
AlertTitle.displayName = "AlertTitle"
|
|
46
46
|
|
|
47
47
|
const AlertDescription = React.forwardRef<
|
|
48
48
|
HTMLParagraphElement,
|
|
@@ -53,7 +53,7 @@ const AlertDescription = React.forwardRef<
|
|
|
53
53
|
className={cn("text-sm [&_p]:leading-relaxed", className)}
|
|
54
54
|
{...props}
|
|
55
55
|
/>
|
|
56
|
-
))
|
|
57
|
-
AlertDescription.displayName = "AlertDescription"
|
|
56
|
+
))
|
|
57
|
+
AlertDescription.displayName = "AlertDescription"
|
|
58
58
|
|
|
59
|
-
export { Alert, AlertTitle, AlertDescription }
|
|
59
|
+
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
|
|
1
|
+
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
|
|
2
2
|
|
|
3
|
-
const AspectRatio = AspectRatioPrimitive.Root
|
|
3
|
+
const AspectRatio = AspectRatioPrimitive.Root
|
|
4
4
|
|
|
5
|
-
export { AspectRatio }
|
|
5
|
+
export { AspectRatio }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
|
5
5
|
|
|
6
|
-
import { cn } from "
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
7
|
|
|
8
8
|
const Avatar = React.forwardRef<
|
|
9
9
|
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
@@ -17,8 +17,8 @@ const Avatar = React.forwardRef<
|
|
|
17
17
|
)}
|
|
18
18
|
{...props}
|
|
19
19
|
/>
|
|
20
|
-
))
|
|
21
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
20
|
+
))
|
|
21
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
22
22
|
|
|
23
23
|
const AvatarImage = React.forwardRef<
|
|
24
24
|
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
@@ -29,8 +29,8 @@ const AvatarImage = React.forwardRef<
|
|
|
29
29
|
className={cn("aspect-square h-full w-full", className)}
|
|
30
30
|
{...props}
|
|
31
31
|
/>
|
|
32
|
-
))
|
|
33
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
32
|
+
))
|
|
33
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
34
34
|
|
|
35
35
|
const AvatarFallback = React.forwardRef<
|
|
36
36
|
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
@@ -44,7 +44,7 @@ const AvatarFallback = React.forwardRef<
|
|
|
44
44
|
)}
|
|
45
45
|
{...props}
|
|
46
46
|
/>
|
|
47
|
-
))
|
|
48
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
47
|
+
))
|
|
48
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
49
49
|
|
|
50
|
-
export { Avatar, AvatarImage, AvatarFallback }
|
|
50
|
+
export { Avatar, AvatarImage, AvatarFallback }
|
package/src/components/badge.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
1
|
+
import type * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
6
|
const badgeVariants = cva(
|
|
7
7
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
@@ -21,7 +21,7 @@ const badgeVariants = cva(
|
|
|
21
21
|
variant: "default",
|
|
22
22
|
},
|
|
23
23
|
}
|
|
24
|
-
)
|
|
24
|
+
)
|
|
25
25
|
|
|
26
26
|
export interface BadgeProps
|
|
27
27
|
extends React.HTMLAttributes<HTMLDivElement>,
|
|
@@ -30,7 +30,7 @@ export interface BadgeProps
|
|
|
30
30
|
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
31
31
|
return (
|
|
32
32
|
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
33
|
-
)
|
|
33
|
+
)
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export { Badge, badgeVariants }
|
|
36
|
+
export { Badge, badgeVariants }
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { ChevronRight, MoreHorizontal } from "lucide-react"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
7
|
const Breadcrumb = React.forwardRef<
|
|
8
8
|
HTMLElement,
|
|
9
9
|
React.ComponentPropsWithoutRef<"nav"> & {
|
|
10
|
-
separator?: React.ReactNode
|
|
10
|
+
separator?: React.ReactNode
|
|
11
11
|
}
|
|
12
|
-
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
|
|
13
|
-
Breadcrumb.displayName = "Breadcrumb"
|
|
12
|
+
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
|
|
13
|
+
Breadcrumb.displayName = "Breadcrumb"
|
|
14
14
|
|
|
15
15
|
const BreadcrumbList = React.forwardRef<
|
|
16
16
|
HTMLOListElement,
|
|
@@ -24,8 +24,8 @@ const BreadcrumbList = React.forwardRef<
|
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
26
26
|
/>
|
|
27
|
-
))
|
|
28
|
-
BreadcrumbList.displayName = "BreadcrumbList"
|
|
27
|
+
))
|
|
28
|
+
BreadcrumbList.displayName = "BreadcrumbList"
|
|
29
29
|
|
|
30
30
|
const BreadcrumbItem = React.forwardRef<
|
|
31
31
|
HTMLLIElement,
|
|
@@ -36,16 +36,16 @@ const BreadcrumbItem = React.forwardRef<
|
|
|
36
36
|
className={cn("inline-flex items-center gap-1.5", className)}
|
|
37
37
|
{...props}
|
|
38
38
|
/>
|
|
39
|
-
))
|
|
40
|
-
BreadcrumbItem.displayName = "BreadcrumbItem"
|
|
39
|
+
))
|
|
40
|
+
BreadcrumbItem.displayName = "BreadcrumbItem"
|
|
41
41
|
|
|
42
42
|
const BreadcrumbLink = React.forwardRef<
|
|
43
43
|
HTMLAnchorElement,
|
|
44
44
|
React.ComponentPropsWithoutRef<"a"> & {
|
|
45
|
-
asChild?: boolean
|
|
45
|
+
asChild?: boolean
|
|
46
46
|
}
|
|
47
47
|
>(({ asChild, className, ...props }, ref) => {
|
|
48
|
-
const Comp = asChild ? Slot : "a"
|
|
48
|
+
const Comp = asChild ? Slot : "a"
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<Comp
|
|
@@ -53,9 +53,9 @@ const BreadcrumbLink = React.forwardRef<
|
|
|
53
53
|
className={cn("transition-colors hover:text-foreground", className)}
|
|
54
54
|
{...props}
|
|
55
55
|
/>
|
|
56
|
-
)
|
|
57
|
-
})
|
|
58
|
-
BreadcrumbLink.displayName = "BreadcrumbLink"
|
|
56
|
+
)
|
|
57
|
+
})
|
|
58
|
+
BreadcrumbLink.displayName = "BreadcrumbLink"
|
|
59
59
|
|
|
60
60
|
const BreadcrumbPage = React.forwardRef<
|
|
61
61
|
HTMLSpanElement,
|
|
@@ -69,8 +69,8 @@ const BreadcrumbPage = React.forwardRef<
|
|
|
69
69
|
className={cn("font-normal text-foreground", className)}
|
|
70
70
|
{...props}
|
|
71
71
|
/>
|
|
72
|
-
))
|
|
73
|
-
BreadcrumbPage.displayName = "BreadcrumbPage"
|
|
72
|
+
))
|
|
73
|
+
BreadcrumbPage.displayName = "BreadcrumbPage"
|
|
74
74
|
|
|
75
75
|
const BreadcrumbSeparator = ({
|
|
76
76
|
children,
|
|
@@ -85,8 +85,8 @@ const BreadcrumbSeparator = ({
|
|
|
85
85
|
>
|
|
86
86
|
{children ?? <ChevronRight />}
|
|
87
87
|
</li>
|
|
88
|
-
)
|
|
89
|
-
BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
|
|
88
|
+
)
|
|
89
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
|
|
90
90
|
|
|
91
91
|
const BreadcrumbEllipsis = ({
|
|
92
92
|
className,
|
|
@@ -101,8 +101,8 @@ const BreadcrumbEllipsis = ({
|
|
|
101
101
|
<MoreHorizontal className="h-4 w-4" />
|
|
102
102
|
<span className="sr-only">More</span>
|
|
103
103
|
</span>
|
|
104
|
-
)
|
|
105
|
-
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
|
|
104
|
+
)
|
|
105
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
|
|
106
106
|
|
|
107
107
|
export {
|
|
108
108
|
Breadcrumb,
|
|
@@ -112,4 +112,4 @@ export {
|
|
|
112
112
|
BreadcrumbPage,
|
|
113
113
|
BreadcrumbSeparator,
|
|
114
114
|
BreadcrumbEllipsis,
|
|
115
|
-
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { Separator } from "@/components/separator"
|
|
6
|
+
|
|
7
|
+
const buttonGroupVariants = cva(
|
|
8
|
+
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
orientation: {
|
|
12
|
+
horizontal:
|
|
13
|
+
"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
14
|
+
vertical:
|
|
15
|
+
"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
orientation: "horizontal",
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
function ButtonGroup({
|
|
25
|
+
className,
|
|
26
|
+
orientation,
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
role="group"
|
|
32
|
+
data-slot="button-group"
|
|
33
|
+
data-orientation={orientation}
|
|
34
|
+
className={cn(buttonGroupVariants({ orientation }), className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function ButtonGroupText({
|
|
41
|
+
className,
|
|
42
|
+
asChild = false,
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<"div"> & {
|
|
45
|
+
asChild?: boolean
|
|
46
|
+
}) {
|
|
47
|
+
const Comp = asChild ? Slot : "div"
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Comp
|
|
51
|
+
className={cn(
|
|
52
|
+
"bg-muted shadow-xs flex items-center gap-2 rounded-md border px-4 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
53
|
+
className
|
|
54
|
+
)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function ButtonGroupSeparator({
|
|
61
|
+
className,
|
|
62
|
+
orientation = "vertical",
|
|
63
|
+
...props
|
|
64
|
+
}: React.ComponentProps<typeof Separator>) {
|
|
65
|
+
return (
|
|
66
|
+
<Separator
|
|
67
|
+
data-slot="button-group-separator"
|
|
68
|
+
orientation={orientation}
|
|
69
|
+
className={cn(
|
|
70
|
+
"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
|
|
71
|
+
className
|
|
72
|
+
)}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
ButtonGroup,
|
|
80
|
+
ButtonGroupSeparator,
|
|
81
|
+
ButtonGroupText,
|
|
82
|
+
buttonGroupVariants,
|
|
83
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
8
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -31,26 +31,26 @@ const buttonVariants = cva(
|
|
|
31
31
|
size: "default",
|
|
32
32
|
},
|
|
33
33
|
}
|
|
34
|
-
)
|
|
34
|
+
)
|
|
35
35
|
|
|
36
36
|
export interface ButtonProps
|
|
37
37
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
38
38
|
VariantProps<typeof buttonVariants> {
|
|
39
|
-
asChild?: boolean
|
|
39
|
+
asChild?: boolean
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
43
43
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
44
|
-
const Comp = asChild ? Slot : "button"
|
|
44
|
+
const Comp = asChild ? Slot : "button"
|
|
45
45
|
return (
|
|
46
46
|
<Comp
|
|
47
47
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
48
48
|
ref={ref}
|
|
49
49
|
{...props}
|
|
50
50
|
/>
|
|
51
|
-
)
|
|
51
|
+
)
|
|
52
52
|
}
|
|
53
|
-
)
|
|
54
|
-
Button.displayName = "Button"
|
|
53
|
+
)
|
|
54
|
+
Button.displayName = "Button"
|
|
55
55
|
|
|
56
|
-
export { Button, buttonVariants }
|
|
56
|
+
export { Button, buttonVariants }
|