@vvedantb/ui 0.1.1 → 0.1.3
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/LICENSE +21 -21
- package/package.json +3 -2
- package/src/ai-elements/artifact.tsx +99 -99
- package/src/ai-elements/attachments.tsx +366 -366
- package/src/ai-elements/chain-of-thought.tsx +212 -212
- package/src/ai-elements/code-block.tsx +478 -478
- package/src/ai-elements/conversation.tsx +157 -157
- package/src/ai-elements/image.tsx +25 -25
- package/src/ai-elements/inline-citation.tsx +252 -252
- package/src/ai-elements/message.tsx +269 -269
- package/src/ai-elements/model-selector.tsx +211 -211
- package/src/ai-elements/prompt-input.tsx +1018 -1018
- package/src/ai-elements/queue.tsx +251 -251
- package/src/ai-elements/reasoning.tsx +178 -178
- package/src/ai-elements/shimmer.tsx +56 -56
- package/src/ai-elements/sources.tsx +77 -77
- package/src/ai-elements/speech-input.tsx +290 -290
- package/src/ai-elements/suggestion.tsx +191 -191
- package/src/css.d.ts +2 -2
- package/src/index.ts +96 -96
- package/src/motion/presets.ts +35 -35
- package/src/motion/presets.vibot.ts +105 -105
- package/src/ui/_menu-classes.ts +30 -30
- package/src/ui/_menu-classes.vibot.ts +33 -33
- package/src/ui/accordion.tsx +81 -81
- package/src/ui/accordion.verve.tsx +56 -56
- package/src/ui/badge.tsx +34 -34
- package/src/ui/breadcrumb.tsx +83 -83
- package/src/ui/button-group.tsx +84 -84
- package/src/ui/button.tsx +57 -57
- package/src/ui/card.tsx +27 -27
- package/src/ui/carousel.tsx +211 -211
- package/src/ui/checkbox.tsx +27 -27
- package/src/ui/clear-input.tsx +170 -170
- package/src/ui/clear-input.vibot.tsx +76 -76
- package/src/ui/clearInputDissolve.ts +214 -214
- package/src/ui/collapsible.tsx +7 -7
- package/src/ui/command.tsx +148 -148
- package/src/ui/context-menu.tsx +173 -173
- package/src/ui/dialog.tsx +149 -149
- package/src/ui/dropdown-menu.tsx +178 -178
- package/src/ui/hover-card.tsx +31 -31
- package/src/ui/input-group.tsx +162 -162
- package/src/ui/input-group.verve.tsx +150 -150
- package/src/ui/input.tsx +21 -21
- package/src/ui/kbd.tsx +18 -18
- package/src/ui/label.tsx +20 -20
- package/src/ui/labeled-switch-row.tsx +53 -53
- package/src/ui/modalTransition.ts +85 -85
- package/src/ui/pagination.tsx +47 -47
- package/src/ui/popover.tsx +33 -33
- package/src/ui/progress.tsx +25 -25
- package/src/ui/radix-select.tsx +202 -202
- package/src/ui/scroll-area.tsx +55 -55
- package/src/ui/scroll-area.verve.tsx +43 -43
- package/src/ui/search-input.tsx +29 -29
- package/src/ui/select.tsx +163 -163
- package/src/ui/separator.tsx +28 -28
- package/src/ui/sheet.tsx +100 -87
- package/src/ui/skeleton.tsx +18 -18
- package/src/ui/sonner.css +16 -16
- package/src/ui/sonner.tsx +47 -47
- package/src/ui/spinner.tsx +27 -27
- package/src/ui/surface-classes.ts +55 -55
- package/src/ui/switch.tsx +26 -26
- package/src/ui/table.tsx +123 -123
- package/src/ui/tabs.tsx +140 -140
- package/src/ui/tabsSliding.ts +56 -56
- package/src/ui/textarea.tsx +21 -21
- package/src/ui/time-picker.tsx +170 -170
- package/src/ui/tooltip.tsx +25 -25
- package/src/ui/visually-hidden.tsx +3 -3
- package/src/utils/cn.ts +16 -16
- package/src/utils/ref.ts +10 -10
package/src/ui/radix-select.tsx
CHANGED
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
3
|
-
import { Select as SelectPrimitive } from "radix-ui";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../utils/cn";
|
|
6
|
-
import {
|
|
7
|
-
floatingSurfaceAnimateClass,
|
|
8
|
-
floatingSurfaceClass,
|
|
9
|
-
menuItemClass,
|
|
10
|
-
} from "./_menu-classes";
|
|
11
|
-
|
|
12
|
-
function Select({
|
|
13
|
-
...props
|
|
14
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
15
|
-
return <SelectPrimitive.Root data-slot="select" {...props} />;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function SelectGroup({
|
|
19
|
-
...props
|
|
20
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
21
|
-
return <SelectPrimitive.Group data-slot="select-group" {...props} />;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function SelectValue({
|
|
25
|
-
...props
|
|
26
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
27
|
-
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function SelectTrigger({
|
|
31
|
-
className,
|
|
32
|
-
size = "default",
|
|
33
|
-
children,
|
|
34
|
-
...props
|
|
35
|
-
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
36
|
-
size?: "sm" | "default";
|
|
37
|
-
}) {
|
|
38
|
-
return (
|
|
39
|
-
<SelectPrimitive.Trigger
|
|
40
|
-
data-slot="select-trigger"
|
|
41
|
-
data-size={size}
|
|
42
|
-
className={cn(
|
|
43
|
-
"flex w-fit items-center justify-between gap-2 rounded-field border border-border bg-field-background px-3.5 py-2 text-sm whitespace-nowrap ring-offset-background transition-[border-color,box-shadow,background-color,transform] duration-200 ease-smooth active:duration-100 active:ease-out active:scale-[0.98] placeholder:text-field-placeholder focus-visible:border-focus-border focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger data-placeholder:text-muted [&_svg:not([class*='text-'])]:text-muted data-[size=default]:h-10 data-[size=sm]:h-8 data-[slot=select-value]:*:line-clamp-1 data-[slot=select-value]:*:flex data-[slot=select-value]:*:items-center data-[slot=select-value]:*:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
44
|
-
className,
|
|
45
|
-
)}
|
|
46
|
-
{...props}
|
|
47
|
-
>
|
|
48
|
-
{children}
|
|
49
|
-
<SelectPrimitive.Icon asChild>
|
|
50
|
-
<IconChevronDown className="size-4 opacity-50" />
|
|
51
|
-
</SelectPrimitive.Icon>
|
|
52
|
-
</SelectPrimitive.Trigger>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function SelectContent({
|
|
57
|
-
className,
|
|
58
|
-
children,
|
|
59
|
-
position = "item-aligned",
|
|
60
|
-
align = "center",
|
|
61
|
-
...props
|
|
62
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
63
|
-
return (
|
|
64
|
-
<SelectPrimitive.Portal>
|
|
65
|
-
<SelectPrimitive.Content
|
|
66
|
-
data-slot="select-content"
|
|
67
|
-
className={cn(
|
|
68
|
-
"relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto",
|
|
69
|
-
floatingSurfaceClass,
|
|
70
|
-
floatingSurfaceAnimateClass,
|
|
71
|
-
position === "popper" &&
|
|
72
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
73
|
-
className,
|
|
74
|
-
)}
|
|
75
|
-
position={position}
|
|
76
|
-
align={align}
|
|
77
|
-
{...props}
|
|
78
|
-
>
|
|
79
|
-
<SelectScrollUpButton />
|
|
80
|
-
<SelectPrimitive.Viewport
|
|
81
|
-
className={cn(
|
|
82
|
-
"p-1.5",
|
|
83
|
-
position === "popper" &&
|
|
84
|
-
"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1",
|
|
85
|
-
)}
|
|
86
|
-
>
|
|
87
|
-
{children}
|
|
88
|
-
</SelectPrimitive.Viewport>
|
|
89
|
-
<SelectScrollDownButton />
|
|
90
|
-
</SelectPrimitive.Content>
|
|
91
|
-
</SelectPrimitive.Portal>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function SelectLabel({
|
|
96
|
-
className,
|
|
97
|
-
...props
|
|
98
|
-
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
99
|
-
return (
|
|
100
|
-
<SelectPrimitive.Label
|
|
101
|
-
data-slot="select-label"
|
|
102
|
-
className={cn(
|
|
103
|
-
"text-muted px-2.5 py-1.5 text-xs font-semibold uppercase tracking-widest",
|
|
104
|
-
className,
|
|
105
|
-
)}
|
|
106
|
-
{...props}
|
|
107
|
-
/>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function SelectItem({
|
|
112
|
-
className,
|
|
113
|
-
children,
|
|
114
|
-
...props
|
|
115
|
-
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
116
|
-
return (
|
|
117
|
-
<SelectPrimitive.Item
|
|
118
|
-
data-slot="select-item"
|
|
119
|
-
className={cn(
|
|
120
|
-
"[&_svg:not([class*='text-'])]:text-muted relative flex w-full cursor-pointer select-none items-center gap-2 rounded-lg py-2 pl-2.5 pr-8 text-sm outline-hidden [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 last:[span]:*:flex last:[span]:*:items-center last:[span]:*:gap-2",
|
|
121
|
-
menuItemClass,
|
|
122
|
-
className,
|
|
123
|
-
)}
|
|
124
|
-
{...props}
|
|
125
|
-
>
|
|
126
|
-
<span
|
|
127
|
-
data-slot="select-item-indicator"
|
|
128
|
-
className="absolute right-2 flex size-3.5 items-center justify-center"
|
|
129
|
-
>
|
|
130
|
-
<SelectPrimitive.ItemIndicator>
|
|
131
|
-
<IconCheck className="size-4" />
|
|
132
|
-
</SelectPrimitive.ItemIndicator>
|
|
133
|
-
</span>
|
|
134
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
135
|
-
</SelectPrimitive.Item>
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function SelectSeparator({
|
|
140
|
-
className,
|
|
141
|
-
...props
|
|
142
|
-
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
143
|
-
return (
|
|
144
|
-
<SelectPrimitive.Separator
|
|
145
|
-
data-slot="select-separator"
|
|
146
|
-
className={cn(
|
|
147
|
-
"bg-separator pointer-events-none -mx-1.5 my-1 h-px",
|
|
148
|
-
className,
|
|
149
|
-
)}
|
|
150
|
-
{...props}
|
|
151
|
-
/>
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function SelectScrollUpButton({
|
|
156
|
-
className,
|
|
157
|
-
...props
|
|
158
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
159
|
-
return (
|
|
160
|
-
<SelectPrimitive.ScrollUpButton
|
|
161
|
-
data-slot="select-scroll-up-button"
|
|
162
|
-
className={cn(
|
|
163
|
-
"flex cursor-default items-center justify-center py-1",
|
|
164
|
-
className,
|
|
165
|
-
)}
|
|
166
|
-
{...props}
|
|
167
|
-
>
|
|
168
|
-
<IconChevronUp className="size-4" />
|
|
169
|
-
</SelectPrimitive.ScrollUpButton>
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function SelectScrollDownButton({
|
|
174
|
-
className,
|
|
175
|
-
...props
|
|
176
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
177
|
-
return (
|
|
178
|
-
<SelectPrimitive.ScrollDownButton
|
|
179
|
-
data-slot="select-scroll-down-button"
|
|
180
|
-
className={cn(
|
|
181
|
-
"flex cursor-default items-center justify-center py-1",
|
|
182
|
-
className,
|
|
183
|
-
)}
|
|
184
|
-
{...props}
|
|
185
|
-
>
|
|
186
|
-
<IconChevronDown className="size-4" />
|
|
187
|
-
</SelectPrimitive.ScrollDownButton>
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export {
|
|
192
|
-
Select,
|
|
193
|
-
SelectContent,
|
|
194
|
-
SelectGroup,
|
|
195
|
-
SelectItem,
|
|
196
|
-
SelectLabel,
|
|
197
|
-
SelectScrollDownButton,
|
|
198
|
-
SelectScrollUpButton,
|
|
199
|
-
SelectSeparator,
|
|
200
|
-
SelectTrigger,
|
|
201
|
-
SelectValue,
|
|
202
|
-
};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
3
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../utils/cn";
|
|
6
|
+
import {
|
|
7
|
+
floatingSurfaceAnimateClass,
|
|
8
|
+
floatingSurfaceClass,
|
|
9
|
+
menuItemClass,
|
|
10
|
+
} from "./_menu-classes";
|
|
11
|
+
|
|
12
|
+
function Select({
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
15
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function SelectGroup({
|
|
19
|
+
...props
|
|
20
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
21
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function SelectValue({
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
27
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function SelectTrigger({
|
|
31
|
+
className,
|
|
32
|
+
size = "default",
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
36
|
+
size?: "sm" | "default";
|
|
37
|
+
}) {
|
|
38
|
+
return (
|
|
39
|
+
<SelectPrimitive.Trigger
|
|
40
|
+
data-slot="select-trigger"
|
|
41
|
+
data-size={size}
|
|
42
|
+
className={cn(
|
|
43
|
+
"flex w-fit items-center justify-between gap-2 rounded-field border border-border bg-field-background px-3.5 py-2 text-sm whitespace-nowrap ring-offset-background transition-[border-color,box-shadow,background-color,transform] duration-200 ease-smooth active:duration-100 active:ease-out active:scale-[0.98] placeholder:text-field-placeholder focus-visible:border-focus-border focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger data-placeholder:text-muted [&_svg:not([class*='text-'])]:text-muted data-[size=default]:h-10 data-[size=sm]:h-8 data-[slot=select-value]:*:line-clamp-1 data-[slot=select-value]:*:flex data-[slot=select-value]:*:items-center data-[slot=select-value]:*:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
{...props}
|
|
47
|
+
>
|
|
48
|
+
{children}
|
|
49
|
+
<SelectPrimitive.Icon asChild>
|
|
50
|
+
<IconChevronDown className="size-4 opacity-50" />
|
|
51
|
+
</SelectPrimitive.Icon>
|
|
52
|
+
</SelectPrimitive.Trigger>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function SelectContent({
|
|
57
|
+
className,
|
|
58
|
+
children,
|
|
59
|
+
position = "item-aligned",
|
|
60
|
+
align = "center",
|
|
61
|
+
...props
|
|
62
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
63
|
+
return (
|
|
64
|
+
<SelectPrimitive.Portal>
|
|
65
|
+
<SelectPrimitive.Content
|
|
66
|
+
data-slot="select-content"
|
|
67
|
+
className={cn(
|
|
68
|
+
"relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto",
|
|
69
|
+
floatingSurfaceClass,
|
|
70
|
+
floatingSurfaceAnimateClass,
|
|
71
|
+
position === "popper" &&
|
|
72
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
73
|
+
className,
|
|
74
|
+
)}
|
|
75
|
+
position={position}
|
|
76
|
+
align={align}
|
|
77
|
+
{...props}
|
|
78
|
+
>
|
|
79
|
+
<SelectScrollUpButton />
|
|
80
|
+
<SelectPrimitive.Viewport
|
|
81
|
+
className={cn(
|
|
82
|
+
"p-1.5",
|
|
83
|
+
position === "popper" &&
|
|
84
|
+
"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1",
|
|
85
|
+
)}
|
|
86
|
+
>
|
|
87
|
+
{children}
|
|
88
|
+
</SelectPrimitive.Viewport>
|
|
89
|
+
<SelectScrollDownButton />
|
|
90
|
+
</SelectPrimitive.Content>
|
|
91
|
+
</SelectPrimitive.Portal>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function SelectLabel({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
99
|
+
return (
|
|
100
|
+
<SelectPrimitive.Label
|
|
101
|
+
data-slot="select-label"
|
|
102
|
+
className={cn(
|
|
103
|
+
"text-muted px-2.5 py-1.5 text-xs font-semibold uppercase tracking-widest",
|
|
104
|
+
className,
|
|
105
|
+
)}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function SelectItem({
|
|
112
|
+
className,
|
|
113
|
+
children,
|
|
114
|
+
...props
|
|
115
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
116
|
+
return (
|
|
117
|
+
<SelectPrimitive.Item
|
|
118
|
+
data-slot="select-item"
|
|
119
|
+
className={cn(
|
|
120
|
+
"[&_svg:not([class*='text-'])]:text-muted relative flex w-full cursor-pointer select-none items-center gap-2 rounded-lg py-2 pl-2.5 pr-8 text-sm outline-hidden [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 last:[span]:*:flex last:[span]:*:items-center last:[span]:*:gap-2",
|
|
121
|
+
menuItemClass,
|
|
122
|
+
className,
|
|
123
|
+
)}
|
|
124
|
+
{...props}
|
|
125
|
+
>
|
|
126
|
+
<span
|
|
127
|
+
data-slot="select-item-indicator"
|
|
128
|
+
className="absolute right-2 flex size-3.5 items-center justify-center"
|
|
129
|
+
>
|
|
130
|
+
<SelectPrimitive.ItemIndicator>
|
|
131
|
+
<IconCheck className="size-4" />
|
|
132
|
+
</SelectPrimitive.ItemIndicator>
|
|
133
|
+
</span>
|
|
134
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
135
|
+
</SelectPrimitive.Item>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function SelectSeparator({
|
|
140
|
+
className,
|
|
141
|
+
...props
|
|
142
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
143
|
+
return (
|
|
144
|
+
<SelectPrimitive.Separator
|
|
145
|
+
data-slot="select-separator"
|
|
146
|
+
className={cn(
|
|
147
|
+
"bg-separator pointer-events-none -mx-1.5 my-1 h-px",
|
|
148
|
+
className,
|
|
149
|
+
)}
|
|
150
|
+
{...props}
|
|
151
|
+
/>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function SelectScrollUpButton({
|
|
156
|
+
className,
|
|
157
|
+
...props
|
|
158
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
159
|
+
return (
|
|
160
|
+
<SelectPrimitive.ScrollUpButton
|
|
161
|
+
data-slot="select-scroll-up-button"
|
|
162
|
+
className={cn(
|
|
163
|
+
"flex cursor-default items-center justify-center py-1",
|
|
164
|
+
className,
|
|
165
|
+
)}
|
|
166
|
+
{...props}
|
|
167
|
+
>
|
|
168
|
+
<IconChevronUp className="size-4" />
|
|
169
|
+
</SelectPrimitive.ScrollUpButton>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function SelectScrollDownButton({
|
|
174
|
+
className,
|
|
175
|
+
...props
|
|
176
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
177
|
+
return (
|
|
178
|
+
<SelectPrimitive.ScrollDownButton
|
|
179
|
+
data-slot="select-scroll-down-button"
|
|
180
|
+
className={cn(
|
|
181
|
+
"flex cursor-default items-center justify-center py-1",
|
|
182
|
+
className,
|
|
183
|
+
)}
|
|
184
|
+
{...props}
|
|
185
|
+
>
|
|
186
|
+
<IconChevronDown className="size-4" />
|
|
187
|
+
</SelectPrimitive.ScrollDownButton>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export {
|
|
192
|
+
Select,
|
|
193
|
+
SelectContent,
|
|
194
|
+
SelectGroup,
|
|
195
|
+
SelectItem,
|
|
196
|
+
SelectLabel,
|
|
197
|
+
SelectScrollDownButton,
|
|
198
|
+
SelectScrollUpButton,
|
|
199
|
+
SelectSeparator,
|
|
200
|
+
SelectTrigger,
|
|
201
|
+
SelectValue,
|
|
202
|
+
};
|
package/src/ui/scroll-area.tsx
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
3
|
-
import { cn } from "../utils/cn";
|
|
4
|
-
|
|
5
|
-
function ScrollArea({
|
|
6
|
-
className,
|
|
7
|
-
children,
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
10
|
-
return (
|
|
11
|
-
<ScrollAreaPrimitive.Root
|
|
12
|
-
data-slot="scroll-area"
|
|
13
|
-
className={cn("relative", className)}
|
|
14
|
-
{...props}
|
|
15
|
-
>
|
|
16
|
-
<ScrollAreaPrimitive.Viewport
|
|
17
|
-
data-slot="scroll-area-viewport"
|
|
18
|
-
className="size-full rounded-[inherit] outline-hidden"
|
|
19
|
-
>
|
|
20
|
-
{children}
|
|
21
|
-
</ScrollAreaPrimitive.Viewport>
|
|
22
|
-
<ScrollBar />
|
|
23
|
-
<ScrollAreaPrimitive.Corner />
|
|
24
|
-
</ScrollAreaPrimitive.Root>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function ScrollBar({
|
|
29
|
-
className,
|
|
30
|
-
orientation = "vertical",
|
|
31
|
-
...props
|
|
32
|
-
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
33
|
-
return (
|
|
34
|
-
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
35
|
-
data-slot="scroll-area-scrollbar"
|
|
36
|
-
orientation={orientation}
|
|
37
|
-
className={cn(
|
|
38
|
-
"flex touch-none p-px transition-colors select-none",
|
|
39
|
-
orientation === "vertical" &&
|
|
40
|
-
"h-full w-2.5 border-l border-l-transparent",
|
|
41
|
-
orientation === "horizontal" &&
|
|
42
|
-
"h-2.5 flex-col border-t border-t-transparent",
|
|
43
|
-
className,
|
|
44
|
-
)}
|
|
45
|
-
{...props}
|
|
46
|
-
>
|
|
47
|
-
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
48
|
-
data-slot="scroll-area-thumb"
|
|
49
|
-
className="bg-scrollbar/35 hover:bg-scrollbar/55 relative flex-1 rounded-full transition-colors"
|
|
50
|
-
/>
|
|
51
|
-
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { ScrollArea, ScrollBar };
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
|
|
5
|
+
function ScrollArea({
|
|
6
|
+
className,
|
|
7
|
+
children,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
10
|
+
return (
|
|
11
|
+
<ScrollAreaPrimitive.Root
|
|
12
|
+
data-slot="scroll-area"
|
|
13
|
+
className={cn("relative", className)}
|
|
14
|
+
{...props}
|
|
15
|
+
>
|
|
16
|
+
<ScrollAreaPrimitive.Viewport
|
|
17
|
+
data-slot="scroll-area-viewport"
|
|
18
|
+
className="size-full rounded-[inherit] outline-hidden"
|
|
19
|
+
>
|
|
20
|
+
{children}
|
|
21
|
+
</ScrollAreaPrimitive.Viewport>
|
|
22
|
+
<ScrollBar />
|
|
23
|
+
<ScrollAreaPrimitive.Corner />
|
|
24
|
+
</ScrollAreaPrimitive.Root>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function ScrollBar({
|
|
29
|
+
className,
|
|
30
|
+
orientation = "vertical",
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
33
|
+
return (
|
|
34
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
35
|
+
data-slot="scroll-area-scrollbar"
|
|
36
|
+
orientation={orientation}
|
|
37
|
+
className={cn(
|
|
38
|
+
"flex touch-none p-px transition-colors select-none",
|
|
39
|
+
orientation === "vertical" &&
|
|
40
|
+
"h-full w-2.5 border-l border-l-transparent",
|
|
41
|
+
orientation === "horizontal" &&
|
|
42
|
+
"h-2.5 flex-col border-t border-t-transparent",
|
|
43
|
+
className,
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
48
|
+
data-slot="scroll-area-thumb"
|
|
49
|
+
className="bg-scrollbar/35 hover:bg-scrollbar/55 relative flex-1 rounded-full transition-colors"
|
|
50
|
+
/>
|
|
51
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3
|
-
import { cn } from "../utils/cn";
|
|
4
|
-
|
|
5
|
-
const ScrollArea = React.forwardRef<
|
|
6
|
-
React.ComponentRef<typeof ScrollAreaPrimitive.Root>,
|
|
7
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
8
|
-
>(({ className, children, ...props }, ref) => (
|
|
9
|
-
<ScrollAreaPrimitive.Root
|
|
10
|
-
ref={ref}
|
|
11
|
-
className={cn("relative overflow-hidden", className)}
|
|
12
|
-
{...props}
|
|
13
|
-
>
|
|
14
|
-
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
15
|
-
{children}
|
|
16
|
-
</ScrollAreaPrimitive.Viewport>
|
|
17
|
-
<ScrollBar />
|
|
18
|
-
<ScrollAreaPrimitive.Corner />
|
|
19
|
-
</ScrollAreaPrimitive.Root>
|
|
20
|
-
));
|
|
21
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
22
|
-
|
|
23
|
-
const ScrollBar = React.forwardRef<
|
|
24
|
-
React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
26
|
-
>(({ className, orientation = "vertical", ...props }, ref) => (
|
|
27
|
-
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
28
|
-
ref={ref}
|
|
29
|
-
orientation={orientation}
|
|
30
|
-
className={cn(
|
|
31
|
-
"flex touch-none select-none transition-colors",
|
|
32
|
-
orientation === "vertical" && "h-full w-2.5 p-px",
|
|
33
|
-
orientation === "horizontal" && "h-2.5 flex-col p-px",
|
|
34
|
-
className,
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
>
|
|
38
|
-
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-scrollbar/80" />
|
|
39
|
-
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
40
|
-
));
|
|
41
|
-
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
42
|
-
|
|
43
|
-
export { ScrollArea, ScrollBar };
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
|
|
5
|
+
const ScrollArea = React.forwardRef<
|
|
6
|
+
React.ComponentRef<typeof ScrollAreaPrimitive.Root>,
|
|
7
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
8
|
+
>(({ className, children, ...props }, ref) => (
|
|
9
|
+
<ScrollAreaPrimitive.Root
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn("relative overflow-hidden", className)}
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
15
|
+
{children}
|
|
16
|
+
</ScrollAreaPrimitive.Viewport>
|
|
17
|
+
<ScrollBar />
|
|
18
|
+
<ScrollAreaPrimitive.Corner />
|
|
19
|
+
</ScrollAreaPrimitive.Root>
|
|
20
|
+
));
|
|
21
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
22
|
+
|
|
23
|
+
const ScrollBar = React.forwardRef<
|
|
24
|
+
React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
26
|
+
>(({ className, orientation = "vertical", ...props }, ref) => (
|
|
27
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
28
|
+
ref={ref}
|
|
29
|
+
orientation={orientation}
|
|
30
|
+
className={cn(
|
|
31
|
+
"flex touch-none select-none transition-colors",
|
|
32
|
+
orientation === "vertical" && "h-full w-2.5 p-px",
|
|
33
|
+
orientation === "horizontal" && "h-2.5 flex-col p-px",
|
|
34
|
+
className,
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-scrollbar/80" />
|
|
39
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
40
|
+
));
|
|
41
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
42
|
+
|
|
43
|
+
export { ScrollArea, ScrollBar };
|
package/src/ui/search-input.tsx
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { IconSearch } from "@tabler/icons-react";
|
|
5
|
-
import { cn } from "../utils/cn";
|
|
6
|
-
import { ClearInput, type ClearInputProps } from "./clear-input";
|
|
7
|
-
|
|
8
|
-
export type SearchInputProps = Omit<ClearInputProps, "leading">;
|
|
9
|
-
|
|
10
|
-
const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(
|
|
11
|
-
({ className, ...props }, ref) => {
|
|
12
|
-
return (
|
|
13
|
-
<ClearInput
|
|
14
|
-
ref={ref}
|
|
15
|
-
className={cn("h-8 pl-8 text-sm", className)}
|
|
16
|
-
leading={
|
|
17
|
-
<IconSearch
|
|
18
|
-
size={16}
|
|
19
|
-
className="pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 shrink-0 text-muted"
|
|
20
|
-
/>
|
|
21
|
-
}
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
},
|
|
26
|
-
);
|
|
27
|
-
SearchInput.displayName = "SearchInput";
|
|
28
|
-
|
|
29
|
-
export { SearchInput };
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { IconSearch } from "@tabler/icons-react";
|
|
5
|
+
import { cn } from "../utils/cn";
|
|
6
|
+
import { ClearInput, type ClearInputProps } from "./clear-input";
|
|
7
|
+
|
|
8
|
+
export type SearchInputProps = Omit<ClearInputProps, "leading">;
|
|
9
|
+
|
|
10
|
+
const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(
|
|
11
|
+
({ className, ...props }, ref) => {
|
|
12
|
+
return (
|
|
13
|
+
<ClearInput
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn("h-8 pl-8 text-sm", className)}
|
|
16
|
+
leading={
|
|
17
|
+
<IconSearch
|
|
18
|
+
size={16}
|
|
19
|
+
className="pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 shrink-0 text-muted"
|
|
20
|
+
/>
|
|
21
|
+
}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
SearchInput.displayName = "SearchInput";
|
|
28
|
+
|
|
29
|
+
export { SearchInput };
|