@snapdragonsnursery/react-components 1.7.0 → 1.9.0
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 +7 -1
- package/src/EmployeeSearchPage.test.jsx +6 -1
- package/src/components/app-sidebar.jsx +205 -0
- package/src/components/nav-main.jsx +60 -0
- package/src/components/nav-projects.jsx +76 -0
- package/src/components/nav-user.jsx +104 -0
- package/src/components/room-switcher.jsx +116 -0
- package/src/components/site-switcher.jsx +116 -0
- package/src/components/team-switcher.jsx +83 -0
- package/src/components/theme-mode-toggle.jsx +62 -0
- package/src/components/ui/avatar.jsx +47 -0
- package/src/components/ui/breadcrumb.jsx +112 -0
- package/src/components/ui/collapsible.jsx +23 -0
- package/src/components/ui/dropdown-menu.jsx +221 -0
- package/src/components/ui/separator.jsx +25 -0
- package/src/components/ui/sheet.jsx +140 -0
- package/src/components/ui/sidebar.jsx +681 -0
- package/src/components/ui/skeleton.jsx +15 -0
- package/src/components/ui/tooltip.jsx +53 -0
- package/src/hooks/use-current-site.js +61 -0
- package/src/hooks/use-mobile.js +19 -0
- package/src/index.css +44 -0
- package/src/index.d.ts +67 -0
- package/src/index.js +48 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog"
|
|
5
|
+
import { XIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "../../lib/utils"
|
|
8
|
+
|
|
9
|
+
function Sheet({
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function SheetTrigger({
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function SheetClose({
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function SheetPortal({
|
|
28
|
+
...props
|
|
29
|
+
}) {
|
|
30
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function SheetOverlay({
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}) {
|
|
37
|
+
return (
|
|
38
|
+
<SheetPrimitive.Overlay
|
|
39
|
+
data-slot="sheet-overlay"
|
|
40
|
+
className={cn(
|
|
41
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
42
|
+
className
|
|
43
|
+
)}
|
|
44
|
+
{...props} />
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function SheetContent({
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
side = "right",
|
|
52
|
+
...props
|
|
53
|
+
}) {
|
|
54
|
+
return (
|
|
55
|
+
<SheetPortal>
|
|
56
|
+
<SheetOverlay />
|
|
57
|
+
<SheetPrimitive.Content
|
|
58
|
+
data-slot="sheet-content"
|
|
59
|
+
className={cn(
|
|
60
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
61
|
+
side === "right" &&
|
|
62
|
+
"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
63
|
+
side === "left" &&
|
|
64
|
+
"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
65
|
+
side === "top" &&
|
|
66
|
+
"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
67
|
+
side === "bottom" &&
|
|
68
|
+
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
69
|
+
className
|
|
70
|
+
)}
|
|
71
|
+
{...props}>
|
|
72
|
+
{children}
|
|
73
|
+
<SheetPrimitive.Close
|
|
74
|
+
className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
|
|
75
|
+
<XIcon className="size-4" />
|
|
76
|
+
<span className="sr-only">Close</span>
|
|
77
|
+
</SheetPrimitive.Close>
|
|
78
|
+
</SheetPrimitive.Content>
|
|
79
|
+
</SheetPortal>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function SheetHeader({
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
}) {
|
|
87
|
+
return (
|
|
88
|
+
<div
|
|
89
|
+
data-slot="sheet-header"
|
|
90
|
+
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
91
|
+
{...props} />
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function SheetFooter({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}) {
|
|
99
|
+
return (
|
|
100
|
+
<div
|
|
101
|
+
data-slot="sheet-footer"
|
|
102
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
103
|
+
{...props} />
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function SheetTitle({
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
|
+
}) {
|
|
111
|
+
return (
|
|
112
|
+
<SheetPrimitive.Title
|
|
113
|
+
data-slot="sheet-title"
|
|
114
|
+
className={cn("text-foreground font-semibold", className)}
|
|
115
|
+
{...props} />
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function SheetDescription({
|
|
120
|
+
className,
|
|
121
|
+
...props
|
|
122
|
+
}) {
|
|
123
|
+
return (
|
|
124
|
+
<SheetPrimitive.Description
|
|
125
|
+
data-slot="sheet-description"
|
|
126
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
127
|
+
{...props} />
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export {
|
|
132
|
+
Sheet,
|
|
133
|
+
SheetTrigger,
|
|
134
|
+
SheetClose,
|
|
135
|
+
SheetContent,
|
|
136
|
+
SheetHeader,
|
|
137
|
+
SheetFooter,
|
|
138
|
+
SheetTitle,
|
|
139
|
+
SheetDescription,
|
|
140
|
+
}
|