@vvedantb/ui 0.1.2 → 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/package.json +1 -1
- package/src/ai-elements/message.tsx +2 -2
- package/src/ai-elements/speech-input.tsx +2 -2
- package/src/ui/accordion.verve.tsx +2 -2
- package/src/ui/badge.tsx +1 -1
- package/src/ui/clear-input.tsx +1 -1
- package/src/ui/command.tsx +2 -2
- package/src/ui/input-group.verve.tsx +1 -1
- package/src/ui/kbd.tsx +1 -1
- package/src/ui/select.tsx +1 -1
- package/src/ui/sheet.tsx +36 -23
package/package.json
CHANGED
|
@@ -33,8 +33,8 @@ export const MessageContent = ({
|
|
|
33
33
|
}: MessageContentProps) => (
|
|
34
34
|
<div
|
|
35
35
|
className={cn(
|
|
36
|
-
"
|
|
37
|
-
"group-[.is-user]:ml-auto group-[.is-user]:rounded-2xl group-[.is-user]:rounded-br-md group-[.is-user]:bg-
|
|
36
|
+
"flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm",
|
|
37
|
+
"group-[.is-user]:ml-auto group-[.is-user]:rounded-2xl group-[.is-user]:rounded-br-md group-[.is-user]:bg-accent group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-accent-foreground",
|
|
38
38
|
"group-[.is-assistant]:px-0 group-[.is-assistant]:text-foreground",
|
|
39
39
|
className,
|
|
40
40
|
)}
|
|
@@ -250,8 +250,8 @@ export const SpeechInput = ({
|
|
|
250
250
|
className={cn(
|
|
251
251
|
"relative z-10 rounded-full transition-[background-color,transform] duration-200 ease-smooth active:duration-100 active:ease-out",
|
|
252
252
|
isListening
|
|
253
|
-
? "bg-
|
|
254
|
-
: "bg-
|
|
253
|
+
? "bg-danger text-danger-foreground hover:bg-danger/80 hover:text-danger-foreground"
|
|
254
|
+
: "bg-accent text-accent-foreground hover:bg-accent/80 hover:text-accent-foreground",
|
|
255
255
|
className,
|
|
256
256
|
)}
|
|
257
257
|
disabled={isDisabled}
|
|
@@ -31,7 +31,7 @@ const AccordionTrigger = React.forwardRef<
|
|
|
31
31
|
{...props}
|
|
32
32
|
>
|
|
33
33
|
{children}
|
|
34
|
-
<IconChevronDown className="h-4 w-4 shrink-0 text-muted
|
|
34
|
+
<IconChevronDown className="h-4 w-4 shrink-0 text-muted transition-transform duration-200" />
|
|
35
35
|
</AccordionPrimitive.Trigger>
|
|
36
36
|
</AccordionPrimitive.Header>
|
|
37
37
|
));
|
|
@@ -46,7 +46,7 @@ const AccordionContent = React.forwardRef<
|
|
|
46
46
|
className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
47
47
|
{...props}
|
|
48
48
|
>
|
|
49
|
-
<div className={cn("pb-4 pt-0 text-muted
|
|
49
|
+
<div className={cn("pb-4 pt-0 text-muted", className)}>
|
|
50
50
|
{children}
|
|
51
51
|
</div>
|
|
52
52
|
</AccordionPrimitive.Content>
|
package/src/ui/badge.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import { cn } from "../utils/cn";
|
|
3
3
|
|
|
4
4
|
const badgeVariants = cva(
|
|
5
|
-
"inline-flex items-center gap-1 rounded-full border border-transparent px-2.5 py-1 text-xs font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2",
|
|
5
|
+
"inline-flex items-center gap-1 rounded-full border border-transparent px-2.5 py-1 text-xs font-medium tracking-normal transition-colors focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:ring-offset-background",
|
|
6
6
|
{
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
package/src/ui/clear-input.tsx
CHANGED
|
@@ -152,7 +152,7 @@ const ClearInput = React.forwardRef<HTMLInputElement, ClearInputProps>(
|
|
|
152
152
|
{value.length > 0 && !clearing ? (
|
|
153
153
|
<button
|
|
154
154
|
type="button"
|
|
155
|
-
className="t-clear-btn absolute right-2 top-1/2 z-4 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md text-muted
|
|
155
|
+
className="t-clear-btn absolute right-2 top-1/2 z-4 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md text-muted transition-[background-color,color,transform] duration-100 ease-out active:scale-[0.92] hover:bg-surface-tertiary/50 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring"
|
|
156
156
|
aria-label={clearLabel}
|
|
157
157
|
onPointerDown={preventFocusSteal}
|
|
158
158
|
onMouseDown={preventFocusSteal}
|
package/src/ui/command.tsx
CHANGED
|
@@ -72,10 +72,10 @@ CommandList.displayName = CommandPrimitive.List.displayName;
|
|
|
72
72
|
const CommandEmpty = React.forwardRef<
|
|
73
73
|
React.ComponentRef<typeof CommandPrimitive.Empty>,
|
|
74
74
|
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
|
|
75
|
-
>((props, ref) => (
|
|
75
|
+
>(({ className, ...props }, ref) => (
|
|
76
76
|
<CommandPrimitive.Empty
|
|
77
77
|
ref={ref}
|
|
78
|
-
className="py-8 text-center text-sm text-muted"
|
|
78
|
+
className={cn("py-8 text-center text-sm text-muted", className)}
|
|
79
79
|
{...props}
|
|
80
80
|
/>
|
|
81
81
|
));
|
package/src/ui/kbd.tsx
CHANGED
|
@@ -6,7 +6,7 @@ const Kbd = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(
|
|
|
6
6
|
<kbd
|
|
7
7
|
ref={ref}
|
|
8
8
|
className={cn(
|
|
9
|
-
"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded-md bg-surface-secondary px-1.5 font-mono text-[10px] font-medium text-muted
|
|
9
|
+
"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded-md bg-surface-secondary px-1.5 font-mono text-[10px] font-medium text-muted",
|
|
10
10
|
className,
|
|
11
11
|
)}
|
|
12
12
|
{...props}
|
package/src/ui/select.tsx
CHANGED
|
@@ -74,7 +74,7 @@ const SelectContent = React.forwardRef<
|
|
|
74
74
|
<SelectPrimitive.Content
|
|
75
75
|
ref={ref}
|
|
76
76
|
className={cn(
|
|
77
|
-
"relative z-50 max-h-96 w-
|
|
77
|
+
"relative z-50 max-h-96 min-w-32 overflow-hidden outline-none",
|
|
78
78
|
floatingSurfaceClass,
|
|
79
79
|
floatingSurfaceAnimateClass,
|
|
80
80
|
position === "popper" &&
|
package/src/ui/sheet.tsx
CHANGED
|
@@ -6,15 +6,23 @@ import { cn } from "../utils/cn";
|
|
|
6
6
|
|
|
7
7
|
type SheetSide = "top" | "bottom" | "left" | "right";
|
|
8
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
|
+
|
|
9
13
|
function Sheet({
|
|
10
14
|
shouldScaleBackground = false,
|
|
15
|
+
direction = "bottom",
|
|
11
16
|
...props
|
|
12
17
|
}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
|
13
18
|
return (
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
<SheetDirectionContext.Provider value={direction}>
|
|
20
|
+
<DrawerPrimitive.Root
|
|
21
|
+
shouldScaleBackground={shouldScaleBackground}
|
|
22
|
+
direction={direction}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
</SheetDirectionContext.Provider>
|
|
18
26
|
);
|
|
19
27
|
}
|
|
20
28
|
|
|
@@ -51,27 +59,32 @@ const sheetSideClass: Record<SheetSide, string> = {
|
|
|
51
59
|
const SheetContent = React.forwardRef<
|
|
52
60
|
React.ComponentRef<typeof DrawerPrimitive.Content>,
|
|
53
61
|
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {
|
|
62
|
+
/** Defaults to the parent Sheet's `direction`. */
|
|
54
63
|
side?: SheetSide;
|
|
55
64
|
}
|
|
56
|
-
>(({ className, children, side
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
className
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
+
});
|
|
75
88
|
SheetContent.displayName = "SheetContent";
|
|
76
89
|
|
|
77
90
|
export {
|