@syscore/ui-library 1.1.9 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/components/ui/Navigation.tsx +958 -0
- package/client/components/ui/SearchField.tsx +157 -0
- package/client/components/ui/StrategyTable.tsx +303 -0
- package/client/components/ui/Tag.tsx +127 -0
- package/client/components/ui/alert-dialog.tsx +1 -1
- package/client/components/ui/button.tsx +67 -127
- package/client/components/ui/calendar.tsx +2 -2
- package/client/components/ui/card.tsx +10 -13
- package/client/components/ui/carousel.tsx +56 -46
- package/client/components/ui/command.tsx +27 -16
- package/client/components/ui/dialog.tsx +113 -92
- package/client/components/ui/label.tsx +5 -3
- package/client/components/ui/menubar.tsx +1 -1
- package/client/components/ui/pagination.tsx +3 -3
- package/client/components/ui/sidebar.tsx +1 -1
- package/client/components/ui/tabs.tsx +350 -5
- package/client/components/ui/toggle.tsx +71 -19
- package/client/components/ui/tooltip.tsx +69 -18
- package/client/global.css +635 -58
- package/dist/ui/fonts/FT-Made/FTMade-Regular.otf +0 -0
- package/dist/ui/fonts/FT-Made/FTMade-Regular.ttf +0 -0
- package/dist/ui/fonts/FT-Made/FTMade-Regular.woff +0 -0
- package/dist/ui/fonts/FT-Made/FTMade-Regular.woff2 +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-black.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-blackitalic.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-bold.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-bolditalic.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-extrabold.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-extrabolditalic.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-extralight.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-extralightitalic.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-italic.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-light.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-lightitalic.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-medium.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-mediumitalic.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-regular.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-semibold.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-semibolditalic.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-thin.otf +0 -0
- package/dist/ui/fonts/Mazzard-M/mazzardsoftm-thinitalic.otf +0 -0
- package/dist/ui/index.cjs.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.es.js +401 -329
- package/package.json +3 -2
|
@@ -1,95 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
4
6
|
|
|
5
7
|
const buttonVariants = cva(
|
|
6
|
-
"inline-flex items-center justify-center
|
|
8
|
+
"group inline-flex items-center justify-center rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer",
|
|
7
9
|
{
|
|
8
10
|
variants: {
|
|
9
11
|
variant: {
|
|
10
|
-
// CTA
|
|
11
|
-
"primary-gradient":
|
|
12
|
-
|
|
13
|
-
"bg-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"bg-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"text-
|
|
25
|
-
|
|
26
|
-
"hover:bg-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"text-blue-600 bg-blue-50 shadow-xs",
|
|
30
|
-
"border border-blue-200",
|
|
31
|
-
"hover:bg-blue-50/80",
|
|
32
|
-
],
|
|
33
|
-
// Utility Button Variants
|
|
34
|
-
"utility-primary": ["text-white bg-blue-600", "hover:bg-blue-600/90"],
|
|
35
|
-
"utility-secondary": [
|
|
36
|
-
"text-blue-600 bg-white",
|
|
37
|
-
"border border-blue-200",
|
|
38
|
-
"hover:bg-gray-50",
|
|
39
|
-
],
|
|
40
|
-
"utility-tertiary": [
|
|
41
|
-
"text-gray-600 bg-white",
|
|
42
|
-
"border border-gray-200",
|
|
43
|
-
"hover:bg-gray-50",
|
|
44
|
-
],
|
|
45
|
-
"tooltip-primary": ["text-white bg-cyan-300", "hover:bg-cyan-300/90"],
|
|
46
|
-
"tooltip-secondary": ["text-white bg-gray-500", "hover:bg-gray-500/90"],
|
|
47
|
-
// Icon Button Variants
|
|
48
|
-
"icon-reset": [
|
|
49
|
-
"text-gray-500 bg-white",
|
|
50
|
-
"border border-gray-100",
|
|
51
|
-
"hover:bg-gray-50",
|
|
52
|
-
"p-0",
|
|
53
|
-
],
|
|
54
|
-
"icon-close": [
|
|
55
|
-
"text-gray-500 bg-white",
|
|
56
|
-
"border border-gray-100",
|
|
57
|
-
"hover:bg-gray-50",
|
|
58
|
-
"p-0",
|
|
59
|
-
],
|
|
60
|
-
"icon-close-semi": [
|
|
61
|
-
"text-white bg-black/8",
|
|
62
|
-
"hover:bg-black/12",
|
|
63
|
-
"p-0",
|
|
64
|
-
],
|
|
65
|
-
"icon-utility": [
|
|
66
|
-
"text-gray-500 bg-white",
|
|
67
|
-
"border border-gray-100",
|
|
68
|
-
"hover:bg-gray-50",
|
|
69
|
-
"p-0",
|
|
70
|
-
],
|
|
71
|
-
"icon-account": [
|
|
72
|
-
"bg-white border border-gray-100",
|
|
73
|
-
"hover:bg-gray-50",
|
|
74
|
-
"p-0",
|
|
75
|
-
],
|
|
76
|
-
"icon-account-semi": ["bg-black/8 hover:bg-black/12", "p-0"],
|
|
12
|
+
// CTA variants
|
|
13
|
+
"primary-gradient": "text-white hover:opacity-90 btn-primary-gradient",
|
|
14
|
+
"primary-dark":
|
|
15
|
+
"bg-cyan-800 text-white hover:bg-cyan-900 focus-visible:ring-cyan-800",
|
|
16
|
+
"secondary-light":
|
|
17
|
+
"bg-white border border-gray-200 text-cyan-800 hover:bg-gray-50 focus-visible:ring-gray-200",
|
|
18
|
+
"tertiary-light":
|
|
19
|
+
"bg-blue-50 border border-blue-200 text-blue-600 hover:bg-blue-100 focus-visible:ring-blue-200",
|
|
20
|
+
// Utility variants
|
|
21
|
+
"general-primary":
|
|
22
|
+
"bg-blue-600 text-white hover:bg-blue-700 focus-visible:ring-blue-600",
|
|
23
|
+
"general-secondary":
|
|
24
|
+
"bg-white border border-blue-200 text-blue-600 hover:bg-blue-50 focus-visible:ring-blue-200",
|
|
25
|
+
"general-tertiary":
|
|
26
|
+
"bg-white border border-gray-200 text-gray-600 hover:bg-gray-50 focus-visible:ring-gray-200",
|
|
27
|
+
"tooltip-primary":
|
|
28
|
+
"bg-cyan-300 text-white hover:bg-cyan-400 focus-visible:ring-cyan-300",
|
|
29
|
+
"tooltip-secondary":
|
|
30
|
+
"bg-gray-500 text-white hover:bg-gray-600 focus-visible:ring-gray-500",
|
|
77
31
|
},
|
|
78
32
|
size: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
xl: "h-16 px-10 text-lg rounded-full", // xlarge CTA
|
|
84
|
-
icon: "h-8 w-8 rounded-full", // 32px icon buttons
|
|
85
|
-
},
|
|
86
|
-
fullWidth: {
|
|
87
|
-
true: "w-full",
|
|
33
|
+
xlarge: "h-16 px-10",
|
|
34
|
+
large: "h-12 px-8",
|
|
35
|
+
utility: "h-8 px-4",
|
|
36
|
+
icon: "size-[32px]",
|
|
88
37
|
},
|
|
89
38
|
},
|
|
39
|
+
compoundVariants: [
|
|
40
|
+
{
|
|
41
|
+
size: "xlarge",
|
|
42
|
+
className: "font-semibold",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
size: "large",
|
|
46
|
+
className: "font-semibold",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
size: "utility",
|
|
50
|
+
className: "font-semibold",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
size: "icon",
|
|
54
|
+
className: "p-0 bg-white border border-gray-100 ",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
90
57
|
defaultVariants: {
|
|
91
|
-
variant: "primary-
|
|
92
|
-
size: "
|
|
58
|
+
variant: "primary-dark",
|
|
59
|
+
size: "large",
|
|
93
60
|
},
|
|
94
61
|
},
|
|
95
62
|
);
|
|
@@ -97,60 +64,33 @@ const buttonVariants = cva(
|
|
|
97
64
|
export interface ButtonProps
|
|
98
65
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
99
66
|
VariantProps<typeof buttonVariants> {
|
|
100
|
-
|
|
101
|
-
rightIcon?: React.ReactNode;
|
|
102
|
-
iconOnly?: React.ReactNode;
|
|
67
|
+
asChild?: boolean;
|
|
103
68
|
}
|
|
104
69
|
|
|
105
|
-
|
|
106
|
-
(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
style,
|
|
117
|
-
...props
|
|
118
|
-
},
|
|
119
|
-
ref,
|
|
120
|
-
) => {
|
|
121
|
-
// Use DM Sans for button text to approximate Mazzard Soft M
|
|
122
|
-
const buttonStyle = {
|
|
123
|
-
fontFamily:
|
|
124
|
-
"'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
125
|
-
...style,
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
if (iconOnly) {
|
|
129
|
-
return (
|
|
130
|
-
<button
|
|
131
|
-
ref={ref}
|
|
132
|
-
className={cn(
|
|
133
|
-
buttonVariants({ variant, size: size || "icon", fullWidth }),
|
|
134
|
-
className,
|
|
135
|
-
)}
|
|
136
|
-
style={buttonStyle}
|
|
137
|
-
{...props}
|
|
138
|
-
>
|
|
139
|
-
{iconOnly}
|
|
140
|
-
</button>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
70
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
71
|
+
({ className, variant, size, children, style, ...props }, ref) => {
|
|
72
|
+
// Determine body class based on size for text labels
|
|
73
|
+
const bodyClass =
|
|
74
|
+
size === "xlarge"
|
|
75
|
+
? "body-large"
|
|
76
|
+
: size === "large"
|
|
77
|
+
? "body-base"
|
|
78
|
+
: size === "utility"
|
|
79
|
+
? "body-small"
|
|
80
|
+
: "";
|
|
143
81
|
|
|
144
82
|
return (
|
|
145
83
|
<button
|
|
84
|
+
className={cn(buttonVariants({ variant, size }), className)}
|
|
85
|
+
style={style}
|
|
146
86
|
ref={ref}
|
|
147
|
-
className={cn(buttonVariants({ variant, size, fullWidth }), className)}
|
|
148
|
-
style={buttonStyle}
|
|
149
87
|
{...props}
|
|
150
88
|
>
|
|
151
|
-
{
|
|
152
|
-
|
|
153
|
-
|
|
89
|
+
{size === "icon" ? (
|
|
90
|
+
children
|
|
91
|
+
) : (
|
|
92
|
+
<span className={cn("relative z-10", bodyClass)}>{children}</span>
|
|
93
|
+
)}
|
|
154
94
|
</button>
|
|
155
95
|
);
|
|
156
96
|
},
|
|
@@ -158,4 +98,4 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
158
98
|
|
|
159
99
|
Button.displayName = "Button";
|
|
160
100
|
|
|
161
|
-
export { buttonVariants };
|
|
101
|
+
export { Button, buttonVariants };
|
|
@@ -24,7 +24,7 @@ function Calendar({
|
|
|
24
24
|
caption_label: "text-sm font-medium",
|
|
25
25
|
nav: "space-x-1 flex items-center",
|
|
26
26
|
nav_button: cn(
|
|
27
|
-
buttonVariants({ variant: "
|
|
27
|
+
buttonVariants({ variant: "general-secondary" }),
|
|
28
28
|
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
|
|
29
29
|
),
|
|
30
30
|
nav_button_previous: "absolute left-1",
|
|
@@ -36,7 +36,7 @@ function Calendar({
|
|
|
36
36
|
row: "flex w-full mt-2",
|
|
37
37
|
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
38
38
|
day: cn(
|
|
39
|
-
buttonVariants({ variant: "
|
|
39
|
+
buttonVariants({ variant: "general-tertiary" }),
|
|
40
40
|
"h-9 w-9 p-0 font-normal aria-selected:opacity-100",
|
|
41
41
|
),
|
|
42
42
|
day_range_end: "day-range-end",
|
|
@@ -9,7 +9,7 @@ const Card = React.forwardRef<
|
|
|
9
9
|
<div
|
|
10
10
|
ref={ref}
|
|
11
11
|
className={cn(
|
|
12
|
-
"rounded-lg border
|
|
12
|
+
"rounded-lg border border-gray-100 bg-cyan-50 shadow-xs p-6 space-y-6",
|
|
13
13
|
className,
|
|
14
14
|
)}
|
|
15
15
|
{...props}
|
|
@@ -21,11 +21,7 @@ const CardHeader = React.forwardRef<
|
|
|
21
21
|
HTMLDivElement,
|
|
22
22
|
React.HTMLAttributes<HTMLDivElement>
|
|
23
23
|
>(({ className, ...props }, ref) => (
|
|
24
|
-
<div
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
24
|
+
<div ref={ref} className={cn("flex flex-col gap-6", className)} {...props} />
|
|
29
25
|
));
|
|
30
26
|
CardHeader.displayName = "CardHeader";
|
|
31
27
|
|
|
@@ -35,10 +31,7 @@ const CardTitle = React.forwardRef<
|
|
|
35
31
|
>(({ className, ...props }, ref) => (
|
|
36
32
|
<h3
|
|
37
33
|
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
"text-2xl font-semibold leading-none tracking-tight",
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
34
|
+
className={cn("heading-xxsmall text-gray-800", className)}
|
|
42
35
|
{...props}
|
|
43
36
|
/>
|
|
44
37
|
));
|
|
@@ -50,7 +43,7 @@ const CardDescription = React.forwardRef<
|
|
|
50
43
|
>(({ className, ...props }, ref) => (
|
|
51
44
|
<p
|
|
52
45
|
ref={ref}
|
|
53
|
-
className={cn("
|
|
46
|
+
className={cn("body-base text-gray-800", className)}
|
|
54
47
|
{...props}
|
|
55
48
|
/>
|
|
56
49
|
));
|
|
@@ -60,7 +53,11 @@ const CardContent = React.forwardRef<
|
|
|
60
53
|
HTMLDivElement,
|
|
61
54
|
React.HTMLAttributes<HTMLDivElement>
|
|
62
55
|
>(({ className, ...props }, ref) => (
|
|
63
|
-
<div
|
|
56
|
+
<div
|
|
57
|
+
ref={ref}
|
|
58
|
+
className={cn("body-base text-gray-800", className)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
64
61
|
));
|
|
65
62
|
CardContent.displayName = "CardContent";
|
|
66
63
|
|
|
@@ -70,7 +67,7 @@ const CardFooter = React.forwardRef<
|
|
|
70
67
|
>(({ className, ...props }, ref) => (
|
|
71
68
|
<div
|
|
72
69
|
ref={ref}
|
|
73
|
-
className={cn("flex items-center
|
|
70
|
+
className={cn("flex items-center body-base text-gray-800", className)}
|
|
74
71
|
{...props}
|
|
75
72
|
/>
|
|
76
73
|
));
|
|
@@ -195,59 +195,69 @@ CarouselItem.displayName = "CarouselItem";
|
|
|
195
195
|
const CarouselPrevious = React.forwardRef<
|
|
196
196
|
HTMLButtonElement,
|
|
197
197
|
React.ComponentProps<typeof Button>
|
|
198
|
-
>(
|
|
199
|
-
|
|
198
|
+
>(
|
|
199
|
+
(
|
|
200
|
+
{ className, variant = "general-secondary", size = "icon", ...props },
|
|
201
|
+
ref,
|
|
202
|
+
) => {
|
|
203
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
200
204
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
205
|
+
return (
|
|
206
|
+
<Button
|
|
207
|
+
ref={ref}
|
|
208
|
+
variant={variant}
|
|
209
|
+
size={size}
|
|
210
|
+
className={cn(
|
|
211
|
+
"absolute h-8 w-8 rounded-full",
|
|
212
|
+
orientation === "horizontal"
|
|
213
|
+
? "-left-12 top-1/2 -translate-y-1/2"
|
|
214
|
+
: "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
215
|
+
className,
|
|
216
|
+
)}
|
|
217
|
+
disabled={!canScrollPrev}
|
|
218
|
+
onClick={scrollPrev}
|
|
219
|
+
{...props}
|
|
220
|
+
>
|
|
221
|
+
<ArrowLeft className="h-4 w-4" />
|
|
222
|
+
<span className="sr-only">Previous slide</span>
|
|
223
|
+
</Button>
|
|
224
|
+
);
|
|
225
|
+
},
|
|
226
|
+
);
|
|
222
227
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
223
228
|
|
|
224
229
|
const CarouselNext = React.forwardRef<
|
|
225
230
|
HTMLButtonElement,
|
|
226
231
|
React.ComponentProps<typeof Button>
|
|
227
|
-
>(
|
|
228
|
-
|
|
232
|
+
>(
|
|
233
|
+
(
|
|
234
|
+
{ className, variant = "general-secondary", size = "icon", ...props },
|
|
235
|
+
ref,
|
|
236
|
+
) => {
|
|
237
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
229
238
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
239
|
+
return (
|
|
240
|
+
<Button
|
|
241
|
+
ref={ref}
|
|
242
|
+
variant={variant}
|
|
243
|
+
size={size}
|
|
244
|
+
className={cn(
|
|
245
|
+
"absolute h-8 w-8 rounded-full",
|
|
246
|
+
orientation === "horizontal"
|
|
247
|
+
? "-right-12 top-1/2 -translate-y-1/2"
|
|
248
|
+
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
249
|
+
className,
|
|
250
|
+
)}
|
|
251
|
+
disabled={!canScrollNext}
|
|
252
|
+
onClick={scrollNext}
|
|
253
|
+
{...props}
|
|
254
|
+
>
|
|
255
|
+
<ArrowRight className="h-4 w-4" />
|
|
256
|
+
<span className="sr-only">Next slide</span>
|
|
257
|
+
</Button>
|
|
258
|
+
);
|
|
259
|
+
},
|
|
260
|
+
);
|
|
251
261
|
CarouselNext.displayName = "CarouselNext";
|
|
252
262
|
|
|
253
263
|
export {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { type DialogProps } from "@radix-ui/react-dialog";
|
|
3
5
|
import { Command as CommandPrimitive } from "cmdk";
|
|
@@ -12,22 +14,17 @@ const Command = React.forwardRef<
|
|
|
12
14
|
>(({ className, ...props }, ref) => (
|
|
13
15
|
<CommandPrimitive
|
|
14
16
|
ref={ref}
|
|
15
|
-
className={cn(
|
|
16
|
-
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
17
|
+
className={cn("flex h-full w-full flex-col overflow-hidden", className)}
|
|
19
18
|
{...props}
|
|
20
19
|
/>
|
|
21
20
|
));
|
|
22
21
|
Command.displayName = CommandPrimitive.displayName;
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
|
|
23
|
+
const CommandDialog = ({ children, ...props }: DialogProps) => {
|
|
27
24
|
return (
|
|
28
25
|
<Dialog {...props}>
|
|
29
26
|
<DialogContent className="overflow-hidden p-0 shadow-lg">
|
|
30
|
-
<Command className="
|
|
27
|
+
<Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
31
28
|
{children}
|
|
32
29
|
</Command>
|
|
33
30
|
</DialogContent>
|
|
@@ -35,16 +32,27 @@ const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
|
|
|
35
32
|
);
|
|
36
33
|
};
|
|
37
34
|
|
|
35
|
+
interface CommandInputProps
|
|
36
|
+
extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> {
|
|
37
|
+
icon?: React.ComponentType<{ className?: string }>;
|
|
38
|
+
}
|
|
39
|
+
|
|
38
40
|
const CommandInput = React.forwardRef<
|
|
39
41
|
React.ElementRef<typeof CommandPrimitive.Input>,
|
|
40
|
-
|
|
41
|
-
>(({ className, ...props }, ref) => (
|
|
42
|
-
<div
|
|
43
|
-
|
|
42
|
+
CommandInputProps
|
|
43
|
+
>(({ className, icon: Icon = Search, ...props }, ref) => (
|
|
44
|
+
<div
|
|
45
|
+
className={cn(
|
|
46
|
+
"group relative flex h-14 w-full sm:min-w-[344px] items-center gap-4 rounded-lg border border-gray-200 bg-white p-4 focus:ring-0 focus:outline-none",
|
|
47
|
+
className,
|
|
48
|
+
)}
|
|
49
|
+
cmdk-input-wrapper=""
|
|
50
|
+
>
|
|
51
|
+
<Icon className=" h-4 w-4 shrink-0 group-focus-within:-translate-x-4 group-focus-within:opacity-0 ease-in-out duration-200" />
|
|
44
52
|
<CommandPrimitive.Input
|
|
45
53
|
ref={ref}
|
|
46
54
|
className={cn(
|
|
47
|
-
"
|
|
55
|
+
"text-base w-full ring-0 outline-none group-focus-within:-translate-x-8 ease-in-out duration-200",
|
|
48
56
|
className,
|
|
49
57
|
)}
|
|
50
58
|
{...props}
|
|
@@ -60,7 +68,10 @@ const CommandList = React.forwardRef<
|
|
|
60
68
|
>(({ className, ...props }, ref) => (
|
|
61
69
|
<CommandPrimitive.List
|
|
62
70
|
ref={ref}
|
|
63
|
-
className={cn(
|
|
71
|
+
className={cn(
|
|
72
|
+
"max-h-[300px] overflow-y-auto overflow-x-hidden bg-gray-700 rounded-b-lg",
|
|
73
|
+
className,
|
|
74
|
+
)}
|
|
64
75
|
{...props}
|
|
65
76
|
/>
|
|
66
77
|
));
|
|
@@ -87,7 +98,7 @@ const CommandGroup = React.forwardRef<
|
|
|
87
98
|
<CommandPrimitive.Group
|
|
88
99
|
ref={ref}
|
|
89
100
|
className={cn(
|
|
90
|
-
"overflow-hidden
|
|
101
|
+
"group overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground ",
|
|
91
102
|
className,
|
|
92
103
|
)}
|
|
93
104
|
{...props}
|
|
@@ -115,7 +126,7 @@ const CommandItem = React.forwardRef<
|
|
|
115
126
|
<CommandPrimitive.Item
|
|
116
127
|
ref={ref}
|
|
117
128
|
className={cn(
|
|
118
|
-
"relative flex
|
|
129
|
+
"relative flex w-full items-center gap-2 cursor-default select-none p-4 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-gray-700 hover:bg-[rgba(0,0,0,0.2)] text-gray-200",
|
|
119
130
|
className,
|
|
120
131
|
)}
|
|
121
132
|
{...props}
|