@silicajs/ui 0.1.0 → 0.1.2
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 +13 -4
- package/postcss.config.mjs +1 -1
- package/src/components/avatar.tsx +109 -0
- package/src/components/badge.tsx +9 -9
- package/src/components/breadcrumb.tsx +18 -21
- package/src/components/button.tsx +7 -7
- package/src/components/card.tsx +15 -15
- package/src/components/collapsible.tsx +6 -6
- package/src/components/command.tsx +30 -30
- package/src/components/dialog.tsx +24 -25
- package/src/components/dropdown-menu.tsx +47 -43
- package/src/components/input-group.tsx +25 -25
- package/src/components/input.tsx +6 -6
- package/src/components/scroll-area.tsx +8 -8
- package/src/components/separator.tsx +6 -6
- package/src/components/sheet.tsx +22 -23
- package/src/components/sidebar.tsx +124 -124
- package/src/components/skeleton.tsx +3 -3
- package/src/components/textarea.tsx +5 -5
- package/src/components/toc-list.tsx +5 -2
- package/src/components/tooltip.tsx +9 -9
- package/src/hooks/use-mobile.ts +13 -11
- package/src/lib/utils.ts +3 -3
- package/src/styles/globals.css +100 -2
package/src/components/sheet.tsx
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog"
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
5
5
|
|
|
6
|
-
import { cn } from "@silicajs/ui/lib/utils"
|
|
7
|
-
import { Button } from "@silicajs/ui/components/button"
|
|
8
|
-
import { XIcon } from "lucide-react"
|
|
6
|
+
import { cn } from "@silicajs/ui/lib/utils";
|
|
7
|
+
import { Button } from "@silicajs/ui/components/button";
|
|
8
|
+
import { XIcon } from "lucide-react";
|
|
9
9
|
|
|
10
10
|
function Sheet({ ...props }: SheetPrimitive.Root.Props) {
|
|
11
|
-
return <SheetPrimitive.Root data-slot="sheet" {...props}
|
|
11
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {
|
|
15
|
-
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props}
|
|
15
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function SheetClose({ ...props }: SheetPrimitive.Close.Props) {
|
|
19
|
-
return <SheetPrimitive.Close data-slot="sheet-close" {...props}
|
|
19
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {
|
|
23
|
-
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props}
|
|
23
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {
|
|
@@ -29,11 +29,11 @@ function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {
|
|
|
29
29
|
data-slot="sheet-overlay"
|
|
30
30
|
className={cn(
|
|
31
31
|
"fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",
|
|
32
|
-
className
|
|
32
|
+
className,
|
|
33
33
|
)}
|
|
34
34
|
{...props}
|
|
35
35
|
/>
|
|
36
|
-
)
|
|
36
|
+
);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function SheetContent({
|
|
@@ -43,8 +43,8 @@ function SheetContent({
|
|
|
43
43
|
showCloseButton = true,
|
|
44
44
|
...props
|
|
45
45
|
}: SheetPrimitive.Popup.Props & {
|
|
46
|
-
side?: "top" | "right" | "bottom" | "left"
|
|
47
|
-
showCloseButton?: boolean
|
|
46
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
47
|
+
showCloseButton?: boolean;
|
|
48
48
|
}) {
|
|
49
49
|
return (
|
|
50
50
|
<SheetPortal>
|
|
@@ -54,7 +54,7 @@ function SheetContent({
|
|
|
54
54
|
data-side={side}
|
|
55
55
|
className={cn(
|
|
56
56
|
"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
57
|
-
className
|
|
57
|
+
className,
|
|
58
58
|
)}
|
|
59
59
|
{...props}
|
|
60
60
|
>
|
|
@@ -70,14 +70,13 @@ function SheetContent({
|
|
|
70
70
|
/>
|
|
71
71
|
}
|
|
72
72
|
>
|
|
73
|
-
<XIcon
|
|
74
|
-
/>
|
|
73
|
+
<XIcon />
|
|
75
74
|
<span className="sr-only">Close</span>
|
|
76
75
|
</SheetPrimitive.Close>
|
|
77
76
|
)}
|
|
78
77
|
</SheetPrimitive.Popup>
|
|
79
78
|
</SheetPortal>
|
|
80
|
-
)
|
|
79
|
+
);
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -87,7 +86,7 @@ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
87
86
|
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
88
87
|
{...props}
|
|
89
88
|
/>
|
|
90
|
-
)
|
|
89
|
+
);
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -97,7 +96,7 @@ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
97
96
|
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
98
97
|
{...props}
|
|
99
98
|
/>
|
|
100
|
-
)
|
|
99
|
+
);
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
|
|
@@ -107,7 +106,7 @@ function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
|
|
|
107
106
|
className={cn("font-heading font-medium text-foreground", className)}
|
|
108
107
|
{...props}
|
|
109
108
|
/>
|
|
110
|
-
)
|
|
109
|
+
);
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
function SheetDescription({
|
|
@@ -120,7 +119,7 @@ function SheetDescription({
|
|
|
120
119
|
className={cn("text-sm text-muted-foreground", className)}
|
|
121
120
|
{...props}
|
|
122
121
|
/>
|
|
123
|
-
)
|
|
122
|
+
);
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
export {
|
|
@@ -132,4 +131,4 @@ export {
|
|
|
132
131
|
SheetFooter,
|
|
133
132
|
SheetTitle,
|
|
134
133
|
SheetDescription,
|
|
135
|
-
}
|
|
134
|
+
};
|