minka-ds 0.1.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 +25 -0
- package/src/components/ui/badge.tsx +63 -0
- package/src/components/ui/breadcrumb.tsx +109 -0
- package/src/components/ui/button-group.tsx +89 -0
- package/src/components/ui/button.tsx +65 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/cell.tsx +104 -0
- package/src/components/ui/collapsible.tsx +33 -0
- package/src/components/ui/combobox.tsx +310 -0
- package/src/components/ui/data-table.tsx +275 -0
- package/src/components/ui/dialog.tsx +160 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/input-group.tsx +170 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +26 -0
- package/src/components/ui/pagination.tsx +127 -0
- package/src/components/ui/select.tsx +198 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/sheet.tsx +145 -0
- package/src/components/ui/sidebar.tsx +726 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/table.tsx +142 -0
- package/src/components/ui/tabs.tsx +109 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/tooltip.tsx +57 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/index.ts +28 -0
- package/src/lib/utils.ts +33 -0
- package/tokens/primitives.css +227 -0
- package/tokens/text-utilities.css +44 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import {
|
|
3
|
+
ChevronLeftIcon,
|
|
4
|
+
ChevronRightIcon,
|
|
5
|
+
MoreHorizontalIcon,
|
|
6
|
+
} from "lucide-react"
|
|
7
|
+
|
|
8
|
+
import { cn } from "../../lib/utils"
|
|
9
|
+
import { buttonVariants, type Button } from "./button"
|
|
10
|
+
|
|
11
|
+
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
12
|
+
return (
|
|
13
|
+
<nav
|
|
14
|
+
role="navigation"
|
|
15
|
+
aria-label="pagination"
|
|
16
|
+
data-slot="pagination"
|
|
17
|
+
className={cn("mx-auto flex w-full justify-center", className)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function PaginationContent({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<"ul">) {
|
|
27
|
+
return (
|
|
28
|
+
<ul
|
|
29
|
+
data-slot="pagination-content"
|
|
30
|
+
className={cn("flex flex-row items-center gap-1", className)}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
37
|
+
return <li data-slot="pagination-item" {...props} />
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type PaginationLinkProps = {
|
|
41
|
+
isActive?: boolean
|
|
42
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> &
|
|
43
|
+
React.ComponentProps<"a">
|
|
44
|
+
|
|
45
|
+
function PaginationLink({
|
|
46
|
+
className,
|
|
47
|
+
isActive,
|
|
48
|
+
size = "icon-sm",
|
|
49
|
+
...props
|
|
50
|
+
}: PaginationLinkProps) {
|
|
51
|
+
return (
|
|
52
|
+
<a
|
|
53
|
+
aria-current={isActive ? "page" : undefined}
|
|
54
|
+
data-slot="pagination-link"
|
|
55
|
+
data-active={isActive}
|
|
56
|
+
className={cn(
|
|
57
|
+
buttonVariants({
|
|
58
|
+
variant: isActive ? "outline" : "ghost",
|
|
59
|
+
size,
|
|
60
|
+
}),
|
|
61
|
+
className
|
|
62
|
+
)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function PaginationPrevious({
|
|
69
|
+
className,
|
|
70
|
+
...props
|
|
71
|
+
}: React.ComponentProps<typeof PaginationLink>) {
|
|
72
|
+
return (
|
|
73
|
+
<PaginationLink
|
|
74
|
+
aria-label="Go to previous page"
|
|
75
|
+
size="sm"
|
|
76
|
+
className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
|
|
77
|
+
{...props}
|
|
78
|
+
>
|
|
79
|
+
<ChevronLeftIcon />
|
|
80
|
+
<span className="hidden sm:block">Previous</span>
|
|
81
|
+
</PaginationLink>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function PaginationNext({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: React.ComponentProps<typeof PaginationLink>) {
|
|
89
|
+
return (
|
|
90
|
+
<PaginationLink
|
|
91
|
+
aria-label="Go to next page"
|
|
92
|
+
size="sm"
|
|
93
|
+
className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
|
|
94
|
+
{...props}
|
|
95
|
+
>
|
|
96
|
+
<span className="hidden sm:block">Next</span>
|
|
97
|
+
<ChevronRightIcon />
|
|
98
|
+
</PaginationLink>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function PaginationEllipsis({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<"span">) {
|
|
106
|
+
return (
|
|
107
|
+
<span
|
|
108
|
+
aria-hidden
|
|
109
|
+
data-slot="pagination-ellipsis"
|
|
110
|
+
className={cn("flex size-9 items-center justify-center", className)}
|
|
111
|
+
{...props}
|
|
112
|
+
>
|
|
113
|
+
<MoreHorizontalIcon className="size-4" />
|
|
114
|
+
<span className="sr-only">More pages</span>
|
|
115
|
+
</span>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
Pagination,
|
|
121
|
+
PaginationContent,
|
|
122
|
+
PaginationLink,
|
|
123
|
+
PaginationItem,
|
|
124
|
+
PaginationPrevious,
|
|
125
|
+
PaginationNext,
|
|
126
|
+
PaginationEllipsis,
|
|
127
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
5
|
+
import { Select as SelectPrimitive } from "radix-ui"
|
|
6
|
+
|
|
7
|
+
import { cn } from "../../lib/utils"
|
|
8
|
+
|
|
9
|
+
function Select({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
12
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function SelectGroup({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
18
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function SelectValue({
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
24
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function SelectTrigger({
|
|
28
|
+
className,
|
|
29
|
+
size = "default",
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
33
|
+
size?: "sm" | "default"
|
|
34
|
+
}) {
|
|
35
|
+
return (
|
|
36
|
+
<SelectPrimitive.Trigger
|
|
37
|
+
data-slot="select-trigger"
|
|
38
|
+
data-size={size}
|
|
39
|
+
className={cn(
|
|
40
|
+
"flex w-fit items-center justify-between gap-2 [border-radius:var(--radius-input)] border border-[var(--color-border-default)] bg-[var(--color-bg-raised)] px-3 py-2 text-body-sm text-[var(--color-text-default)] whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none",
|
|
41
|
+
"data-[placeholder]:text-[var(--color-text-hint)]",
|
|
42
|
+
"data-[size=default]:h-9 data-[size=sm]:h-8",
|
|
43
|
+
"focus-visible:border-[var(--color-border-focus)] focus-visible:ring-[3px] focus-visible:ring-[var(--color-border-focus)]/50",
|
|
44
|
+
"disabled:cursor-not-allowed disabled:bg-[var(--color-bg-disabled)] disabled:text-[var(--color-text-disabled)] disabled:border-[var(--color-border-disabled)]",
|
|
45
|
+
"aria-invalid:border-[var(--color-border-error)] aria-invalid:ring-[3px] aria-invalid:ring-[var(--color-border-error)]/20",
|
|
46
|
+
"*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2",
|
|
47
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-[var(--color-text-hint)]",
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
<SelectPrimitive.Icon asChild>
|
|
54
|
+
<ChevronDownIcon className="size-4 text-[var(--color-text-hint)]" />
|
|
55
|
+
</SelectPrimitive.Icon>
|
|
56
|
+
</SelectPrimitive.Trigger>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function SelectContent({
|
|
61
|
+
className,
|
|
62
|
+
children,
|
|
63
|
+
position = "item-aligned",
|
|
64
|
+
align = "center",
|
|
65
|
+
...props
|
|
66
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
67
|
+
return (
|
|
68
|
+
<SelectPrimitive.Portal>
|
|
69
|
+
<SelectPrimitive.Content
|
|
70
|
+
data-slot="select-content"
|
|
71
|
+
className={cn(
|
|
72
|
+
"relative z-[var(--z-dropdown)] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto [border-radius:var(--radius-popover)] border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] text-[var(--color-text-default)] shadow-[var(--shadow-popover)]",
|
|
73
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
74
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
75
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
76
|
+
position === "popper" &&
|
|
77
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
78
|
+
className
|
|
79
|
+
)}
|
|
80
|
+
position={position}
|
|
81
|
+
align={align}
|
|
82
|
+
{...props}
|
|
83
|
+
>
|
|
84
|
+
<SelectScrollUpButton />
|
|
85
|
+
<SelectPrimitive.Viewport
|
|
86
|
+
className={cn(
|
|
87
|
+
"p-1",
|
|
88
|
+
position === "popper" &&
|
|
89
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
90
|
+
)}
|
|
91
|
+
>
|
|
92
|
+
{children}
|
|
93
|
+
</SelectPrimitive.Viewport>
|
|
94
|
+
<SelectScrollDownButton />
|
|
95
|
+
</SelectPrimitive.Content>
|
|
96
|
+
</SelectPrimitive.Portal>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function SelectLabel({
|
|
101
|
+
className,
|
|
102
|
+
...props
|
|
103
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
104
|
+
return (
|
|
105
|
+
<SelectPrimitive.Label
|
|
106
|
+
data-slot="select-label"
|
|
107
|
+
className={cn("px-2 py-1.5 text-caption text-[var(--color-text-muted)]", className)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function SelectItem({
|
|
114
|
+
className,
|
|
115
|
+
children,
|
|
116
|
+
...props
|
|
117
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
118
|
+
return (
|
|
119
|
+
<SelectPrimitive.Item
|
|
120
|
+
data-slot="select-item"
|
|
121
|
+
className={cn(
|
|
122
|
+
"relative flex w-full cursor-default items-center gap-2 [border-radius:var(--radius-tag)] py-1.5 pr-8 pl-2 text-body-sm outline-hidden select-none",
|
|
123
|
+
"focus:bg-[var(--color-action-ghost-hover)] focus:text-[var(--color-action-ghost-foreground)]",
|
|
124
|
+
"data-[disabled]:pointer-events-none data-[disabled]:text-[var(--color-text-disabled)]",
|
|
125
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-[var(--color-text-hint)]",
|
|
126
|
+
"*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
127
|
+
className
|
|
128
|
+
)}
|
|
129
|
+
{...props}
|
|
130
|
+
>
|
|
131
|
+
<span
|
|
132
|
+
data-slot="select-item-indicator"
|
|
133
|
+
className="absolute right-2 flex size-3.5 items-center justify-center"
|
|
134
|
+
>
|
|
135
|
+
<SelectPrimitive.ItemIndicator>
|
|
136
|
+
<CheckIcon className="size-4" />
|
|
137
|
+
</SelectPrimitive.ItemIndicator>
|
|
138
|
+
</span>
|
|
139
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
140
|
+
</SelectPrimitive.Item>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function SelectSeparator({
|
|
145
|
+
className,
|
|
146
|
+
...props
|
|
147
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
148
|
+
return (
|
|
149
|
+
<SelectPrimitive.Separator
|
|
150
|
+
data-slot="select-separator"
|
|
151
|
+
className={cn("pointer-events-none -mx-1 my-1 h-px bg-[var(--color-border-subtle)]", className)}
|
|
152
|
+
{...props}
|
|
153
|
+
/>
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function SelectScrollUpButton({
|
|
158
|
+
className,
|
|
159
|
+
...props
|
|
160
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
161
|
+
return (
|
|
162
|
+
<SelectPrimitive.ScrollUpButton
|
|
163
|
+
data-slot="select-scroll-up-button"
|
|
164
|
+
className={cn("flex cursor-default items-center justify-center py-1 text-[var(--color-text-hint)]", className)}
|
|
165
|
+
{...props}
|
|
166
|
+
>
|
|
167
|
+
<ChevronUpIcon className="size-4" />
|
|
168
|
+
</SelectPrimitive.ScrollUpButton>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function SelectScrollDownButton({
|
|
173
|
+
className,
|
|
174
|
+
...props
|
|
175
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
176
|
+
return (
|
|
177
|
+
<SelectPrimitive.ScrollDownButton
|
|
178
|
+
data-slot="select-scroll-down-button"
|
|
179
|
+
className={cn("flex cursor-default items-center justify-center py-1 text-[var(--color-text-hint)]", className)}
|
|
180
|
+
{...props}
|
|
181
|
+
>
|
|
182
|
+
<ChevronDownIcon className="size-4" />
|
|
183
|
+
</SelectPrimitive.ScrollDownButton>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export {
|
|
188
|
+
Select,
|
|
189
|
+
SelectContent,
|
|
190
|
+
SelectGroup,
|
|
191
|
+
SelectItem,
|
|
192
|
+
SelectLabel,
|
|
193
|
+
SelectScrollDownButton,
|
|
194
|
+
SelectScrollUpButton,
|
|
195
|
+
SelectSeparator,
|
|
196
|
+
SelectTrigger,
|
|
197
|
+
SelectValue,
|
|
198
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Separator as SeparatorPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../lib/utils"
|
|
7
|
+
|
|
8
|
+
function Separator({
|
|
9
|
+
className,
|
|
10
|
+
orientation = "horizontal",
|
|
11
|
+
decorative = true,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
14
|
+
return (
|
|
15
|
+
<SeparatorPrimitive.Root
|
|
16
|
+
data-slot="separator"
|
|
17
|
+
decorative={decorative}
|
|
18
|
+
orientation={orientation}
|
|
19
|
+
className={cn(
|
|
20
|
+
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { Separator }
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { XIcon } from "lucide-react"
|
|
5
|
+
import { Dialog as SheetPrimitive } from "radix-ui"
|
|
6
|
+
|
|
7
|
+
import { cn } from "../../lib/utils"
|
|
8
|
+
|
|
9
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
10
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function SheetTrigger({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
16
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function SheetClose({
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
22
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function SheetPortal({
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
28
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function SheetOverlay({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
35
|
+
return (
|
|
36
|
+
<SheetPrimitive.Overlay
|
|
37
|
+
data-slot="sheet-overlay"
|
|
38
|
+
className={cn(
|
|
39
|
+
"fixed inset-0 [z-index:var(--z-modal)] bg-[var(--color-bg-backdrop)] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function SheetContent({
|
|
48
|
+
className,
|
|
49
|
+
children,
|
|
50
|
+
side = "right",
|
|
51
|
+
showCloseButton = true,
|
|
52
|
+
container,
|
|
53
|
+
...props
|
|
54
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
55
|
+
side?: "top" | "right" | "bottom" | "left"
|
|
56
|
+
showCloseButton?: boolean
|
|
57
|
+
container?: HTMLElement | null
|
|
58
|
+
}) {
|
|
59
|
+
return (
|
|
60
|
+
<SheetPortal container={container}>
|
|
61
|
+
<SheetOverlay />
|
|
62
|
+
<SheetPrimitive.Content
|
|
63
|
+
data-slot="sheet-content"
|
|
64
|
+
className={cn(
|
|
65
|
+
"fixed [z-index:var(--z-modal)] flex flex-col gap-4 bg-[var(--color-bg-overlay)] shadow-[var(--shadow-modal)] transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",
|
|
66
|
+
side === "right" &&
|
|
67
|
+
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
68
|
+
side === "left" &&
|
|
69
|
+
"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
70
|
+
side === "top" &&
|
|
71
|
+
"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
72
|
+
side === "bottom" &&
|
|
73
|
+
"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
74
|
+
className
|
|
75
|
+
)}
|
|
76
|
+
{...props}
|
|
77
|
+
>
|
|
78
|
+
{children}
|
|
79
|
+
{showCloseButton && (
|
|
80
|
+
<SheetPrimitive.Close className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary">
|
|
81
|
+
<XIcon className="size-4" />
|
|
82
|
+
<span className="sr-only">Close</span>
|
|
83
|
+
</SheetPrimitive.Close>
|
|
84
|
+
)}
|
|
85
|
+
</SheetPrimitive.Content>
|
|
86
|
+
</SheetPortal>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
91
|
+
return (
|
|
92
|
+
<div
|
|
93
|
+
data-slot="sheet-header"
|
|
94
|
+
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
101
|
+
return (
|
|
102
|
+
<div
|
|
103
|
+
data-slot="sheet-footer"
|
|
104
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function SheetTitle({
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
114
|
+
return (
|
|
115
|
+
<SheetPrimitive.Title
|
|
116
|
+
data-slot="sheet-title"
|
|
117
|
+
className={cn("text-heading-4 text-[var(--color-text-default)]", className)}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function SheetDescription({
|
|
124
|
+
className,
|
|
125
|
+
...props
|
|
126
|
+
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
127
|
+
return (
|
|
128
|
+
<SheetPrimitive.Description
|
|
129
|
+
data-slot="sheet-description"
|
|
130
|
+
className={cn("text-body-sm text-[var(--color-text-muted)]", className)}
|
|
131
|
+
{...props}
|
|
132
|
+
/>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
Sheet,
|
|
138
|
+
SheetTrigger,
|
|
139
|
+
SheetClose,
|
|
140
|
+
SheetContent,
|
|
141
|
+
SheetHeader,
|
|
142
|
+
SheetFooter,
|
|
143
|
+
SheetTitle,
|
|
144
|
+
SheetDescription,
|
|
145
|
+
}
|