@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/select.tsx
CHANGED
|
@@ -1,163 +1,163 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
-
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
4
|
-
import { cn } from "../utils/cn";
|
|
5
|
-
import {
|
|
6
|
-
floatingSurfaceAnimateClass,
|
|
7
|
-
floatingSurfaceClass,
|
|
8
|
-
} from "./_menu-classes";
|
|
9
|
-
|
|
10
|
-
const Select = SelectPrimitive.Root;
|
|
11
|
-
const SelectGroup = SelectPrimitive.Group;
|
|
12
|
-
const SelectValue = SelectPrimitive.Value;
|
|
13
|
-
|
|
14
|
-
const SelectTrigger = React.forwardRef<
|
|
15
|
-
React.ComponentRef<typeof SelectPrimitive.Trigger>,
|
|
16
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
17
|
-
>(({ className, children, ...props }, ref) => (
|
|
18
|
-
<SelectPrimitive.Trigger
|
|
19
|
-
ref={ref}
|
|
20
|
-
className={cn(
|
|
21
|
-
"flex h-10 w-full max-sm:min-w-0 items-center justify-between whitespace-nowrap rounded-field border border-border bg-field-background px-3.5 py-2 text-base sm:text-sm ring-offset-background placeholder:text-field-placeholder transition-[border-color,box-shadow,background-color] duration-200 ease-smooth focus-visible:border-focus-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
22
|
-
className,
|
|
23
|
-
)}
|
|
24
|
-
{...props}
|
|
25
|
-
>
|
|
26
|
-
{children}
|
|
27
|
-
<SelectPrimitive.Icon asChild>
|
|
28
|
-
<IconChevronDown className="h-4 w-4 text-muted/85" />
|
|
29
|
-
</SelectPrimitive.Icon>
|
|
30
|
-
</SelectPrimitive.Trigger>
|
|
31
|
-
));
|
|
32
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
33
|
-
|
|
34
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
35
|
-
React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
36
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
37
|
-
>(({ className, ...props }, ref) => (
|
|
38
|
-
<SelectPrimitive.ScrollUpButton
|
|
39
|
-
ref={ref}
|
|
40
|
-
className={cn(
|
|
41
|
-
"flex cursor-default items-center justify-center py-1 text-muted",
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
<IconChevronUp className="h-4 w-4" />
|
|
47
|
-
</SelectPrimitive.ScrollUpButton>
|
|
48
|
-
));
|
|
49
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
50
|
-
|
|
51
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
52
|
-
React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
53
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
54
|
-
>(({ className, ...props }, ref) => (
|
|
55
|
-
<SelectPrimitive.ScrollDownButton
|
|
56
|
-
ref={ref}
|
|
57
|
-
className={cn(
|
|
58
|
-
"flex cursor-default items-center justify-center py-1 text-muted",
|
|
59
|
-
className,
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
<IconChevronDown className="h-4 w-4" />
|
|
64
|
-
</SelectPrimitive.ScrollDownButton>
|
|
65
|
-
));
|
|
66
|
-
SelectScrollDownButton.displayName =
|
|
67
|
-
SelectPrimitive.ScrollDownButton.displayName;
|
|
68
|
-
|
|
69
|
-
const SelectContent = React.forwardRef<
|
|
70
|
-
React.ComponentRef<typeof SelectPrimitive.Content>,
|
|
71
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
72
|
-
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
73
|
-
<SelectPrimitive.Portal>
|
|
74
|
-
<SelectPrimitive.Content
|
|
75
|
-
ref={ref}
|
|
76
|
-
className={cn(
|
|
77
|
-
"relative z-50 max-h-96 w-
|
|
78
|
-
floatingSurfaceClass,
|
|
79
|
-
floatingSurfaceAnimateClass,
|
|
80
|
-
position === "popper" &&
|
|
81
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
82
|
-
className,
|
|
83
|
-
)}
|
|
84
|
-
position={position}
|
|
85
|
-
{...props}
|
|
86
|
-
>
|
|
87
|
-
<SelectScrollUpButton />
|
|
88
|
-
<SelectPrimitive.Viewport
|
|
89
|
-
className={cn(
|
|
90
|
-
"p-1.5",
|
|
91
|
-
position === "popper" &&
|
|
92
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
|
93
|
-
)}
|
|
94
|
-
>
|
|
95
|
-
{children}
|
|
96
|
-
</SelectPrimitive.Viewport>
|
|
97
|
-
<SelectScrollDownButton />
|
|
98
|
-
</SelectPrimitive.Content>
|
|
99
|
-
</SelectPrimitive.Portal>
|
|
100
|
-
));
|
|
101
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
102
|
-
|
|
103
|
-
const SelectLabel = React.forwardRef<
|
|
104
|
-
React.ComponentRef<typeof SelectPrimitive.Label>,
|
|
105
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
106
|
-
>(({ className, ...props }, ref) => (
|
|
107
|
-
<SelectPrimitive.Label
|
|
108
|
-
ref={ref}
|
|
109
|
-
className={cn(
|
|
110
|
-
"px-2.5 py-1.5 text-xs font-semibold uppercase tracking-widest text-muted",
|
|
111
|
-
className,
|
|
112
|
-
)}
|
|
113
|
-
{...props}
|
|
114
|
-
/>
|
|
115
|
-
));
|
|
116
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
117
|
-
|
|
118
|
-
const SelectItem = React.forwardRef<
|
|
119
|
-
React.ComponentRef<typeof SelectPrimitive.Item>,
|
|
120
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
121
|
-
>(({ className, children, ...props }, ref) => (
|
|
122
|
-
<SelectPrimitive.Item
|
|
123
|
-
ref={ref}
|
|
124
|
-
className={cn(
|
|
125
|
-
"relative flex w-full cursor-pointer select-none items-center rounded-lg py-2 pl-2.5 pr-8 text-sm outline-none transition-[background-color,color] focus:bg-default focus:text-foreground data-[highlighted]:bg-default data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
126
|
-
className,
|
|
127
|
-
)}
|
|
128
|
-
{...props}
|
|
129
|
-
>
|
|
130
|
-
<span className="absolute right-2.5 flex h-3.5 w-3.5 items-center justify-center">
|
|
131
|
-
<SelectPrimitive.ItemIndicator>
|
|
132
|
-
<IconCheck className="h-4 w-4" />
|
|
133
|
-
</SelectPrimitive.ItemIndicator>
|
|
134
|
-
</span>
|
|
135
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
136
|
-
</SelectPrimitive.Item>
|
|
137
|
-
));
|
|
138
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
139
|
-
|
|
140
|
-
const SelectSeparator = React.forwardRef<
|
|
141
|
-
React.ComponentRef<typeof SelectPrimitive.Separator>,
|
|
142
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
143
|
-
>(({ className, ...props }, ref) => (
|
|
144
|
-
<SelectPrimitive.Separator
|
|
145
|
-
ref={ref}
|
|
146
|
-
className={cn("-mx-1.5 my-1 h-px bg-separator", className)}
|
|
147
|
-
{...props}
|
|
148
|
-
/>
|
|
149
|
-
));
|
|
150
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
151
|
-
|
|
152
|
-
export {
|
|
153
|
-
Select,
|
|
154
|
-
SelectGroup,
|
|
155
|
-
SelectValue,
|
|
156
|
-
SelectTrigger,
|
|
157
|
-
SelectContent,
|
|
158
|
-
SelectLabel,
|
|
159
|
-
SelectItem,
|
|
160
|
-
SelectSeparator,
|
|
161
|
-
SelectScrollUpButton,
|
|
162
|
-
SelectScrollDownButton,
|
|
163
|
-
};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
4
|
+
import { cn } from "../utils/cn";
|
|
5
|
+
import {
|
|
6
|
+
floatingSurfaceAnimateClass,
|
|
7
|
+
floatingSurfaceClass,
|
|
8
|
+
} from "./_menu-classes";
|
|
9
|
+
|
|
10
|
+
const Select = SelectPrimitive.Root;
|
|
11
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
12
|
+
const SelectValue = SelectPrimitive.Value;
|
|
13
|
+
|
|
14
|
+
const SelectTrigger = React.forwardRef<
|
|
15
|
+
React.ComponentRef<typeof SelectPrimitive.Trigger>,
|
|
16
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
17
|
+
>(({ className, children, ...props }, ref) => (
|
|
18
|
+
<SelectPrimitive.Trigger
|
|
19
|
+
ref={ref}
|
|
20
|
+
className={cn(
|
|
21
|
+
"flex h-10 w-full max-sm:min-w-0 items-center justify-between whitespace-nowrap rounded-field border border-border bg-field-background px-3.5 py-2 text-base sm:text-sm ring-offset-background placeholder:text-field-placeholder transition-[border-color,box-shadow,background-color] duration-200 ease-smooth focus-visible:border-focus-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
22
|
+
className,
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
<SelectPrimitive.Icon asChild>
|
|
28
|
+
<IconChevronDown className="h-4 w-4 text-muted/85" />
|
|
29
|
+
</SelectPrimitive.Icon>
|
|
30
|
+
</SelectPrimitive.Trigger>
|
|
31
|
+
));
|
|
32
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
33
|
+
|
|
34
|
+
const SelectScrollUpButton = React.forwardRef<
|
|
35
|
+
React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
36
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
37
|
+
>(({ className, ...props }, ref) => (
|
|
38
|
+
<SelectPrimitive.ScrollUpButton
|
|
39
|
+
ref={ref}
|
|
40
|
+
className={cn(
|
|
41
|
+
"flex cursor-default items-center justify-center py-1 text-muted",
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
44
|
+
{...props}
|
|
45
|
+
>
|
|
46
|
+
<IconChevronUp className="h-4 w-4" />
|
|
47
|
+
</SelectPrimitive.ScrollUpButton>
|
|
48
|
+
));
|
|
49
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
50
|
+
|
|
51
|
+
const SelectScrollDownButton = React.forwardRef<
|
|
52
|
+
React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
53
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
54
|
+
>(({ className, ...props }, ref) => (
|
|
55
|
+
<SelectPrimitive.ScrollDownButton
|
|
56
|
+
ref={ref}
|
|
57
|
+
className={cn(
|
|
58
|
+
"flex cursor-default items-center justify-center py-1 text-muted",
|
|
59
|
+
className,
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
<IconChevronDown className="h-4 w-4" />
|
|
64
|
+
</SelectPrimitive.ScrollDownButton>
|
|
65
|
+
));
|
|
66
|
+
SelectScrollDownButton.displayName =
|
|
67
|
+
SelectPrimitive.ScrollDownButton.displayName;
|
|
68
|
+
|
|
69
|
+
const SelectContent = React.forwardRef<
|
|
70
|
+
React.ComponentRef<typeof SelectPrimitive.Content>,
|
|
71
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
72
|
+
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
73
|
+
<SelectPrimitive.Portal>
|
|
74
|
+
<SelectPrimitive.Content
|
|
75
|
+
ref={ref}
|
|
76
|
+
className={cn(
|
|
77
|
+
"relative z-50 max-h-96 min-w-32 overflow-hidden outline-none",
|
|
78
|
+
floatingSurfaceClass,
|
|
79
|
+
floatingSurfaceAnimateClass,
|
|
80
|
+
position === "popper" &&
|
|
81
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
82
|
+
className,
|
|
83
|
+
)}
|
|
84
|
+
position={position}
|
|
85
|
+
{...props}
|
|
86
|
+
>
|
|
87
|
+
<SelectScrollUpButton />
|
|
88
|
+
<SelectPrimitive.Viewport
|
|
89
|
+
className={cn(
|
|
90
|
+
"p-1.5",
|
|
91
|
+
position === "popper" &&
|
|
92
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
|
93
|
+
)}
|
|
94
|
+
>
|
|
95
|
+
{children}
|
|
96
|
+
</SelectPrimitive.Viewport>
|
|
97
|
+
<SelectScrollDownButton />
|
|
98
|
+
</SelectPrimitive.Content>
|
|
99
|
+
</SelectPrimitive.Portal>
|
|
100
|
+
));
|
|
101
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
102
|
+
|
|
103
|
+
const SelectLabel = React.forwardRef<
|
|
104
|
+
React.ComponentRef<typeof SelectPrimitive.Label>,
|
|
105
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
106
|
+
>(({ className, ...props }, ref) => (
|
|
107
|
+
<SelectPrimitive.Label
|
|
108
|
+
ref={ref}
|
|
109
|
+
className={cn(
|
|
110
|
+
"px-2.5 py-1.5 text-xs font-semibold uppercase tracking-widest text-muted",
|
|
111
|
+
className,
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
));
|
|
116
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
117
|
+
|
|
118
|
+
const SelectItem = React.forwardRef<
|
|
119
|
+
React.ComponentRef<typeof SelectPrimitive.Item>,
|
|
120
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
121
|
+
>(({ className, children, ...props }, ref) => (
|
|
122
|
+
<SelectPrimitive.Item
|
|
123
|
+
ref={ref}
|
|
124
|
+
className={cn(
|
|
125
|
+
"relative flex w-full cursor-pointer select-none items-center rounded-lg py-2 pl-2.5 pr-8 text-sm outline-none transition-[background-color,color] focus:bg-default focus:text-foreground data-[highlighted]:bg-default data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
126
|
+
className,
|
|
127
|
+
)}
|
|
128
|
+
{...props}
|
|
129
|
+
>
|
|
130
|
+
<span className="absolute right-2.5 flex h-3.5 w-3.5 items-center justify-center">
|
|
131
|
+
<SelectPrimitive.ItemIndicator>
|
|
132
|
+
<IconCheck className="h-4 w-4" />
|
|
133
|
+
</SelectPrimitive.ItemIndicator>
|
|
134
|
+
</span>
|
|
135
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
136
|
+
</SelectPrimitive.Item>
|
|
137
|
+
));
|
|
138
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
139
|
+
|
|
140
|
+
const SelectSeparator = React.forwardRef<
|
|
141
|
+
React.ComponentRef<typeof SelectPrimitive.Separator>,
|
|
142
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
143
|
+
>(({ className, ...props }, ref) => (
|
|
144
|
+
<SelectPrimitive.Separator
|
|
145
|
+
ref={ref}
|
|
146
|
+
className={cn("-mx-1.5 my-1 h-px bg-separator", className)}
|
|
147
|
+
{...props}
|
|
148
|
+
/>
|
|
149
|
+
));
|
|
150
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
151
|
+
|
|
152
|
+
export {
|
|
153
|
+
Select,
|
|
154
|
+
SelectGroup,
|
|
155
|
+
SelectValue,
|
|
156
|
+
SelectTrigger,
|
|
157
|
+
SelectContent,
|
|
158
|
+
SelectLabel,
|
|
159
|
+
SelectItem,
|
|
160
|
+
SelectSeparator,
|
|
161
|
+
SelectScrollUpButton,
|
|
162
|
+
SelectScrollDownButton,
|
|
163
|
+
};
|
package/src/ui/separator.tsx
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
|
-
import { cn } from "../utils/cn";
|
|
4
|
-
|
|
5
|
-
const Separator = React.forwardRef<
|
|
6
|
-
React.ComponentRef<typeof SeparatorPrimitive.Root>,
|
|
7
|
-
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
8
|
-
>(
|
|
9
|
-
(
|
|
10
|
-
{ className, orientation = "horizontal", decorative = true, ...props },
|
|
11
|
-
ref,
|
|
12
|
-
) => (
|
|
13
|
-
<SeparatorPrimitive.Root
|
|
14
|
-
ref={ref}
|
|
15
|
-
decorative={decorative}
|
|
16
|
-
orientation={orientation}
|
|
17
|
-
className={cn(
|
|
18
|
-
"shrink-0 bg-separator",
|
|
19
|
-
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
20
|
-
className,
|
|
21
|
-
)}
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
),
|
|
25
|
-
);
|
|
26
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
27
|
-
|
|
28
|
-
export { Separator };
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
|
|
5
|
+
const Separator = React.forwardRef<
|
|
6
|
+
React.ComponentRef<typeof SeparatorPrimitive.Root>,
|
|
7
|
+
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
8
|
+
>(
|
|
9
|
+
(
|
|
10
|
+
{ className, orientation = "horizontal", decorative = true, ...props },
|
|
11
|
+
ref,
|
|
12
|
+
) => (
|
|
13
|
+
<SeparatorPrimitive.Root
|
|
14
|
+
ref={ref}
|
|
15
|
+
decorative={decorative}
|
|
16
|
+
orientation={orientation}
|
|
17
|
+
className={cn(
|
|
18
|
+
"shrink-0 bg-separator",
|
|
19
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
),
|
|
25
|
+
);
|
|
26
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
27
|
+
|
|
28
|
+
export { Separator };
|
package/src/ui/sheet.tsx
CHANGED
|
@@ -1,87 +1,100 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { Drawer as DrawerPrimitive } from "vaul";
|
|
5
|
-
import { cn } from "../utils/cn";
|
|
6
|
-
|
|
7
|
-
type SheetSide = "top" | "bottom" | "left" | "right";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
5
|
+
import { cn } from "../utils/cn";
|
|
6
|
+
|
|
7
|
+
type SheetSide = "top" | "bottom" | "left" | "right";
|
|
8
|
+
|
|
9
|
+
// vaul animates and drags from the Root's `direction`; SheetContent reads it
|
|
10
|
+
// so `<Sheet direction="right">` places the panel on the right by default.
|
|
11
|
+
const SheetDirectionContext = React.createContext<SheetSide>("bottom");
|
|
12
|
+
|
|
13
|
+
function Sheet({
|
|
14
|
+
shouldScaleBackground = false,
|
|
15
|
+
direction = "bottom",
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
|
18
|
+
return (
|
|
19
|
+
<SheetDirectionContext.Provider value={direction}>
|
|
20
|
+
<DrawerPrimitive.Root
|
|
21
|
+
shouldScaleBackground={shouldScaleBackground}
|
|
22
|
+
direction={direction}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
</SheetDirectionContext.Provider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const SheetTrigger = DrawerPrimitive.Trigger;
|
|
30
|
+
const SheetPortal = DrawerPrimitive.Portal;
|
|
31
|
+
const SheetClose = DrawerPrimitive.Close;
|
|
32
|
+
const SheetHandle = DrawerPrimitive.Handle;
|
|
33
|
+
const SheetTitle = DrawerPrimitive.Title;
|
|
34
|
+
const SheetDescription = DrawerPrimitive.Description;
|
|
35
|
+
|
|
36
|
+
const SheetOverlay = React.forwardRef<
|
|
37
|
+
React.ComponentRef<typeof DrawerPrimitive.Overlay>,
|
|
38
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
|
|
39
|
+
>(({ className, ...props }, ref) => (
|
|
40
|
+
<DrawerPrimitive.Overlay
|
|
41
|
+
ref={ref}
|
|
42
|
+
className={cn(
|
|
43
|
+
"fixed inset-0 z-50 bg-backdrop backdrop-blur-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
));
|
|
49
|
+
SheetOverlay.displayName = "SheetOverlay";
|
|
50
|
+
|
|
51
|
+
const sheetSideClass: Record<SheetSide, string> = {
|
|
52
|
+
bottom: "inset-x-0 bottom-0 mt-24 flex h-auto flex-col rounded-t-2xl",
|
|
53
|
+
top: "inset-x-0 top-0 mb-24 flex h-auto flex-col rounded-b-2xl",
|
|
54
|
+
left: "inset-y-2 left-2 right-auto flex h-auto w-80 max-w-[88vw] flex-col rounded-2xl",
|
|
55
|
+
right:
|
|
56
|
+
"inset-y-2 left-auto right-2 flex h-auto w-80 max-w-[88vw] flex-col rounded-2xl",
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const SheetContent = React.forwardRef<
|
|
60
|
+
React.ComponentRef<typeof DrawerPrimitive.Content>,
|
|
61
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {
|
|
62
|
+
/** Defaults to the parent Sheet's `direction`. */
|
|
63
|
+
side?: SheetSide;
|
|
64
|
+
}
|
|
65
|
+
>(({ className, children, side: sideProp, ...props }, ref) => {
|
|
66
|
+
const direction = React.useContext(SheetDirectionContext);
|
|
67
|
+
const side = sideProp ?? direction;
|
|
68
|
+
return (
|
|
69
|
+
<SheetPortal>
|
|
70
|
+
<SheetOverlay />
|
|
71
|
+
<DrawerPrimitive.Content
|
|
72
|
+
ref={ref}
|
|
73
|
+
className={cn(
|
|
74
|
+
"fixed z-50 bg-overlay/95 text-overlay-foreground smooth-shadow-ring-xl outline-hidden backdrop-blur-xl",
|
|
75
|
+
sheetSideClass[side],
|
|
76
|
+
className,
|
|
77
|
+
)}
|
|
78
|
+
{...props}
|
|
79
|
+
>
|
|
80
|
+
{side === "bottom" || side === "top" ? (
|
|
81
|
+
<SheetHandle className="mx-auto mt-3 mb-1 h-1 w-12 shrink-0 rounded-full bg-surface-tertiary" />
|
|
82
|
+
) : null}
|
|
83
|
+
{children}
|
|
84
|
+
</DrawerPrimitive.Content>
|
|
85
|
+
</SheetPortal>
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
SheetContent.displayName = "SheetContent";
|
|
89
|
+
|
|
90
|
+
export {
|
|
91
|
+
Sheet,
|
|
92
|
+
SheetPortal,
|
|
93
|
+
SheetOverlay,
|
|
94
|
+
SheetTrigger,
|
|
95
|
+
SheetClose,
|
|
96
|
+
SheetContent,
|
|
97
|
+
SheetHandle,
|
|
98
|
+
SheetTitle,
|
|
99
|
+
SheetDescription,
|
|
100
|
+
};
|
package/src/ui/skeleton.tsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { cn } from "../utils/cn";
|
|
2
|
-
|
|
3
|
-
function Skeleton({
|
|
4
|
-
className,
|
|
5
|
-
...props
|
|
6
|
-
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
7
|
-
return (
|
|
8
|
-
<div
|
|
9
|
-
className={cn(
|
|
10
|
-
"animate-pulse rounded-lg bg-surface-secondary/70",
|
|
11
|
-
className,
|
|
12
|
-
)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { Skeleton };
|
|
1
|
+
import { cn } from "../utils/cn";
|
|
2
|
+
|
|
3
|
+
function Skeleton({
|
|
4
|
+
className,
|
|
5
|
+
...props
|
|
6
|
+
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
className={cn(
|
|
10
|
+
"animate-pulse rounded-lg bg-surface-secondary/70",
|
|
11
|
+
className,
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { Skeleton };
|
package/src/ui/sonner.css
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unstyled toasts skip Sonner's data-styled rules, so stacked back toasts show
|
|
3
|
-
* full overlapping content. Mirror the styled-mode stack: hide inner content on
|
|
4
|
-
* collapsed back cards, expand spacing on hover (data-expanded on the toaster).
|
|
5
|
-
*/
|
|
6
|
-
[data-sonner-toaster]
|
|
7
|
-
[data-sonner-toast][data-expanded="false"][data-front="false"] {
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
pointer-events: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
[data-sonner-toaster]
|
|
13
|
-
[data-sonner-toast][data-expanded="false"][data-front="false"]
|
|
14
|
-
> * {
|
|
15
|
-
opacity: 0;
|
|
16
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Unstyled toasts skip Sonner's data-styled rules, so stacked back toasts show
|
|
3
|
+
* full overlapping content. Mirror the styled-mode stack: hide inner content on
|
|
4
|
+
* collapsed back cards, expand spacing on hover (data-expanded on the toaster).
|
|
5
|
+
*/
|
|
6
|
+
[data-sonner-toaster]
|
|
7
|
+
[data-sonner-toast][data-expanded="false"][data-front="false"] {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-sonner-toaster]
|
|
13
|
+
[data-sonner-toast][data-expanded="false"][data-front="false"]
|
|
14
|
+
> * {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|