@interactive-inc/docs-client 0.0.1
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/.tanstack/tmp/router-generator-Eq20Yx/50b11a0f488e61cf92364a7e585c1448 +123 -0
- package/.tanstack/tmp/router-generator-KQIYSa/aecb094e4891f9475b91de590abc8809 +117 -0
- package/.tanstack/tmp/router-generator-ekW2pI/aecb094e4891f9475b91de590abc8809 +117 -0
- package/app/components/archived-file-list-view.tsx +99 -0
- package/app/components/directory-file-list-view.tsx +32 -0
- package/app/components/directory-file-tree-node.tsx +96 -0
- package/app/components/directory-layout-sidebar.tsx +181 -0
- package/app/components/directory-page-view.tsx +208 -0
- package/app/components/directory-table-view.tsx +383 -0
- package/app/components/editable-table-cell/boolean-editable-cell.tsx +44 -0
- package/app/components/editable-table-cell/multi-boolean-editable-cell.tsx +59 -0
- package/app/components/editable-table-cell/multi-number-editable-cell.tsx +62 -0
- package/app/components/editable-table-cell/multi-relation-editable-cell.tsx +19 -0
- package/app/components/editable-table-cell/multi-select-number-editable-cell.tsx +82 -0
- package/app/components/editable-table-cell/multi-select-text-editable-cell.tsx +82 -0
- package/app/components/editable-table-cell/multi-text-editable-cell.tsx +62 -0
- package/app/components/editable-table-cell/number-editable-cell.tsx +54 -0
- package/app/components/editable-table-cell/relation-editable-cell.tsx +20 -0
- package/app/components/editable-table-cell/select-number-editable-cell.tsx +43 -0
- package/app/components/editable-table-cell/select-text-editable-cell.tsx +33 -0
- package/app/components/editable-table-cell/string-editable-cell.tsx +42 -0
- package/app/components/editable-table-cell.tsx +129 -0
- package/app/components/file-card.tsx +120 -0
- package/app/components/file-tree-icon.tsx +26 -0
- package/app/components/file-view/archive-restore-banner.tsx +86 -0
- package/app/components/file-view/csv-file-view.tsx +50 -0
- package/app/components/file-view/default-file-view.tsx +11 -0
- package/app/components/file-view/editable-csv-cell.tsx +37 -0
- package/app/components/file-view/editable-front-matter-view.tsx +105 -0
- package/app/components/file-view/file-csv-columns-view.tsx +181 -0
- package/app/components/file-view/file-csv-table.tsx +142 -0
- package/app/components/file-view/file-header.tsx +115 -0
- package/app/components/file-view/file-page-view.tsx +165 -0
- package/app/components/file-view/front-matter-input-field.tsx +157 -0
- package/app/components/file-view/front-matter-view.tsx +30 -0
- package/app/components/file-view/json-file-editor.tsx +38 -0
- package/app/components/file-view/markdown-file-view.tsx +71 -0
- package/app/components/file-view/multi-relation-select.tsx +129 -0
- package/app/components/file-view/render-front-matter-value.tsx +57 -0
- package/app/components/file-view/single-relation-select.tsx +41 -0
- package/app/components/file-view/sortable-csv-row.tsx +57 -0
- package/app/components/file-view/sortable-header.tsx +30 -0
- package/app/components/file-view/utils.ts +8 -0
- package/app/components/milestones-editor.tsx +95 -0
- package/app/components/page-header.tsx +20 -0
- package/app/components/project-view/feature-item.tsx +139 -0
- package/app/components/project-view/project-page-group.tsx +125 -0
- package/app/components/project-view/project-view.tsx +230 -0
- package/app/components/project-view/unlinked-features-section.tsx +73 -0
- package/app/components/providers.tsx +21 -0
- package/app/components/reload-button.tsx +25 -0
- package/app/components/sidebar-button.tsx +13 -0
- package/app/components/ui/alert.tsx +66 -0
- package/app/components/ui/badge.tsx +46 -0
- package/app/components/ui/button.tsx +59 -0
- package/app/components/ui/card.tsx +92 -0
- package/app/components/ui/dialog.tsx +133 -0
- package/app/components/ui/emoji-picker.tsx +133 -0
- package/app/components/ui/icons.tsx +3 -0
- package/app/components/ui/input.tsx +21 -0
- package/app/components/ui/select.tsx +183 -0
- package/app/components/ui/separator.tsx +26 -0
- package/app/components/ui/sheet.tsx +137 -0
- package/app/components/ui/sidebar.tsx +724 -0
- package/app/components/ui/simple-sidebar.tsx +50 -0
- package/app/components/ui/skeleton.tsx +13 -0
- package/app/components/ui/sonner.tsx +23 -0
- package/app/components/ui/table.tsx +114 -0
- package/app/components/ui/tabs.tsx +53 -0
- package/app/components/ui/textarea.tsx +18 -0
- package/app/components/ui/tooltip.tsx +59 -0
- package/app/components/vscode-button.tsx +23 -0
- package/app/hooks/use-directory-query.ts +22 -0
- package/app/hooks/use-file-properties-mutation.ts +38 -0
- package/app/hooks/use-file-query.ts +21 -0
- package/app/hooks/use-mobile.ts +19 -0
- package/app/main.css +122 -0
- package/app/main.tsx +38 -0
- package/app/routes/$.index.tsx +25 -0
- package/app/routes/$.tsx +20 -0
- package/app/routes/__root.tsx +20 -0
- package/app/routes/_index.tsx +17 -0
- package/app/routes/apps.client.$.tsx +21 -0
- package/build/assets/index.css +1 -0
- package/build/assets/index.js +298 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +23 -0
- package/components.json +21 -0
- package/package.json +54 -0
- package/tsconfig.index.json +17 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { XIcon } from "lucide-react"
|
|
2
|
+
import { Dialog as DialogPrimitive } from "radix-ui"
|
|
3
|
+
import type * as React from "react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
function Dialog({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
10
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function DialogTrigger({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
16
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function DialogPortal({
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
22
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function DialogClose({
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
28
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function DialogOverlay({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
|
35
|
+
return (
|
|
36
|
+
<DialogPrimitive.Overlay
|
|
37
|
+
data-slot="dialog-overlay"
|
|
38
|
+
className={cn(
|
|
39
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function DialogContent({
|
|
48
|
+
className,
|
|
49
|
+
children,
|
|
50
|
+
...props
|
|
51
|
+
}: React.ComponentProps<typeof DialogPrimitive.Content>) {
|
|
52
|
+
return (
|
|
53
|
+
<DialogPortal data-slot="dialog-portal">
|
|
54
|
+
<DialogOverlay />
|
|
55
|
+
<DialogPrimitive.Content
|
|
56
|
+
data-slot="dialog-content"
|
|
57
|
+
className={cn(
|
|
58
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",
|
|
59
|
+
className,
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
<DialogPrimitive.Close className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0">
|
|
65
|
+
<XIcon />
|
|
66
|
+
<span className="sr-only">Close</span>
|
|
67
|
+
</DialogPrimitive.Close>
|
|
68
|
+
</DialogPrimitive.Content>
|
|
69
|
+
</DialogPortal>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
74
|
+
return (
|
|
75
|
+
<div
|
|
76
|
+
data-slot="dialog-header"
|
|
77
|
+
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
data-slot="dialog-footer"
|
|
87
|
+
className={cn(
|
|
88
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
89
|
+
className,
|
|
90
|
+
)}
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function DialogTitle({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
100
|
+
return (
|
|
101
|
+
<DialogPrimitive.Title
|
|
102
|
+
data-slot="dialog-title"
|
|
103
|
+
className={cn("font-semibold text-lg leading-none", className)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function DialogDescription({
|
|
110
|
+
className,
|
|
111
|
+
...props
|
|
112
|
+
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
|
|
113
|
+
return (
|
|
114
|
+
<DialogPrimitive.Description
|
|
115
|
+
data-slot="dialog-description"
|
|
116
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
117
|
+
{...props}
|
|
118
|
+
/>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export {
|
|
123
|
+
Dialog,
|
|
124
|
+
DialogClose,
|
|
125
|
+
DialogContent,
|
|
126
|
+
DialogDescription,
|
|
127
|
+
DialogFooter,
|
|
128
|
+
DialogHeader,
|
|
129
|
+
DialogOverlay,
|
|
130
|
+
DialogPortal,
|
|
131
|
+
DialogTitle,
|
|
132
|
+
DialogTrigger,
|
|
133
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { useState } from "react"
|
|
2
|
+
import { Button } from "@/components/ui/button"
|
|
3
|
+
import {
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogTitle,
|
|
7
|
+
DialogTrigger,
|
|
8
|
+
} from "@/components/ui/dialog"
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
currentIcon?: string
|
|
12
|
+
onIconSelect: (icon: string) => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const EMOJI_LIST = [
|
|
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
|
+
"🔬",
|
|
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
|
+
"🕹️",
|
|
88
|
+
"🎲",
|
|
89
|
+
"♠️",
|
|
90
|
+
"♥️",
|
|
91
|
+
"♦️",
|
|
92
|
+
"♣️",
|
|
93
|
+
"🃏",
|
|
94
|
+
"🀄",
|
|
95
|
+
"📦",
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
export function EmojiPicker(props: Props) {
|
|
99
|
+
const [open, setOpen] = useState(false)
|
|
100
|
+
|
|
101
|
+
const handleEmojiSelect = (emoji: string) => {
|
|
102
|
+
props.onIconSelect(emoji)
|
|
103
|
+
setOpen(false)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
108
|
+
<DialogTrigger asChild>
|
|
109
|
+
<Button variant="outline" size="icon">
|
|
110
|
+
{props.currentIcon || "📁"}
|
|
111
|
+
</Button>
|
|
112
|
+
</DialogTrigger>
|
|
113
|
+
<DialogContent className="max-w-md">
|
|
114
|
+
<DialogTitle>アイコンを選択</DialogTitle>
|
|
115
|
+
<div className="space-y-4">
|
|
116
|
+
<div className="grid max-h-64 grid-cols-10 gap-2 overflow-y-auto">
|
|
117
|
+
{EMOJI_LIST.map((emoji) => (
|
|
118
|
+
<Button
|
|
119
|
+
key={emoji}
|
|
120
|
+
variant="ghost"
|
|
121
|
+
size="sm"
|
|
122
|
+
className="h-8 w-8 p-0"
|
|
123
|
+
onClick={() => handleEmojiSelect(emoji)}
|
|
124
|
+
>
|
|
125
|
+
{emoji}
|
|
126
|
+
</Button>
|
|
127
|
+
))}
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</DialogContent>
|
|
131
|
+
</Dialog>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
6
|
+
return (
|
|
7
|
+
<input
|
|
8
|
+
type={type}
|
|
9
|
+
data-slot="input"
|
|
10
|
+
className={cn(
|
|
11
|
+
"flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",
|
|
12
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
13
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Input }
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
2
|
+
import { Select as SelectPrimitive } from "radix-ui"
|
|
3
|
+
import type * as React from "react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
function Select({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
10
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function SelectGroup({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
16
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function SelectValue({
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
22
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function SelectTrigger({
|
|
26
|
+
className,
|
|
27
|
+
size = "default",
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
31
|
+
size?: "sm" | "default"
|
|
32
|
+
}) {
|
|
33
|
+
return (
|
|
34
|
+
<SelectPrimitive.Trigger
|
|
35
|
+
data-slot="select-trigger"
|
|
36
|
+
data-size={size}
|
|
37
|
+
className={cn(
|
|
38
|
+
"flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
<SelectPrimitive.Icon asChild>
|
|
45
|
+
<ChevronDownIcon className="size-4 opacity-50" />
|
|
46
|
+
</SelectPrimitive.Icon>
|
|
47
|
+
</SelectPrimitive.Trigger>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function SelectContent({
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
position = "popper",
|
|
55
|
+
...props
|
|
56
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
57
|
+
return (
|
|
58
|
+
<SelectPrimitive.Portal>
|
|
59
|
+
<SelectPrimitive.Content
|
|
60
|
+
data-slot="select-content"
|
|
61
|
+
className={cn(
|
|
62
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
63
|
+
position === "popper" &&
|
|
64
|
+
"data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1",
|
|
65
|
+
className,
|
|
66
|
+
)}
|
|
67
|
+
position={position}
|
|
68
|
+
{...props}
|
|
69
|
+
>
|
|
70
|
+
<SelectScrollUpButton />
|
|
71
|
+
<SelectPrimitive.Viewport
|
|
72
|
+
className={cn(
|
|
73
|
+
"p-1",
|
|
74
|
+
position === "popper" &&
|
|
75
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1",
|
|
76
|
+
)}
|
|
77
|
+
>
|
|
78
|
+
{children}
|
|
79
|
+
</SelectPrimitive.Viewport>
|
|
80
|
+
<SelectScrollDownButton />
|
|
81
|
+
</SelectPrimitive.Content>
|
|
82
|
+
</SelectPrimitive.Portal>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function SelectLabel({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
90
|
+
return (
|
|
91
|
+
<SelectPrimitive.Label
|
|
92
|
+
data-slot="select-label"
|
|
93
|
+
className={cn("px-2 py-1.5 text-muted-foreground text-xs", className)}
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function SelectItem({
|
|
100
|
+
className,
|
|
101
|
+
children,
|
|
102
|
+
...props
|
|
103
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
104
|
+
return (
|
|
105
|
+
<SelectPrimitive.Item
|
|
106
|
+
data-slot="select-item"
|
|
107
|
+
className={cn(
|
|
108
|
+
"relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
109
|
+
className,
|
|
110
|
+
)}
|
|
111
|
+
{...props}
|
|
112
|
+
>
|
|
113
|
+
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
114
|
+
<SelectPrimitive.ItemIndicator>
|
|
115
|
+
<CheckIcon className="size-4" />
|
|
116
|
+
</SelectPrimitive.ItemIndicator>
|
|
117
|
+
</span>
|
|
118
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
119
|
+
</SelectPrimitive.Item>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function SelectSeparator({
|
|
124
|
+
className,
|
|
125
|
+
...props
|
|
126
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
127
|
+
return (
|
|
128
|
+
<SelectPrimitive.Separator
|
|
129
|
+
data-slot="select-separator"
|
|
130
|
+
className={cn("-mx-1 pointer-events-none my-1 h-px bg-border", className)}
|
|
131
|
+
{...props}
|
|
132
|
+
/>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function SelectScrollUpButton({
|
|
137
|
+
className,
|
|
138
|
+
...props
|
|
139
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
140
|
+
return (
|
|
141
|
+
<SelectPrimitive.ScrollUpButton
|
|
142
|
+
data-slot="select-scroll-up-button"
|
|
143
|
+
className={cn(
|
|
144
|
+
"flex cursor-default items-center justify-center py-1",
|
|
145
|
+
className,
|
|
146
|
+
)}
|
|
147
|
+
{...props}
|
|
148
|
+
>
|
|
149
|
+
<ChevronUpIcon className="size-4" />
|
|
150
|
+
</SelectPrimitive.ScrollUpButton>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function SelectScrollDownButton({
|
|
155
|
+
className,
|
|
156
|
+
...props
|
|
157
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
158
|
+
return (
|
|
159
|
+
<SelectPrimitive.ScrollDownButton
|
|
160
|
+
data-slot="select-scroll-down-button"
|
|
161
|
+
className={cn(
|
|
162
|
+
"flex cursor-default items-center justify-center py-1",
|
|
163
|
+
className,
|
|
164
|
+
)}
|
|
165
|
+
{...props}
|
|
166
|
+
>
|
|
167
|
+
<ChevronDownIcon className="size-4" />
|
|
168
|
+
</SelectPrimitive.ScrollDownButton>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
Select,
|
|
174
|
+
SelectContent,
|
|
175
|
+
SelectGroup,
|
|
176
|
+
SelectItem,
|
|
177
|
+
SelectLabel,
|
|
178
|
+
SelectScrollDownButton,
|
|
179
|
+
SelectScrollUpButton,
|
|
180
|
+
SelectSeparator,
|
|
181
|
+
SelectTrigger,
|
|
182
|
+
SelectValue,
|
|
183
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Separator as SeparatorPrimitive } from "radix-ui"
|
|
2
|
+
import type * as React from "react"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
function Separator({
|
|
7
|
+
className,
|
|
8
|
+
orientation = "horizontal",
|
|
9
|
+
decorative = true,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<SeparatorPrimitive.Root
|
|
14
|
+
data-slot="separator-root"
|
|
15
|
+
decorative={decorative}
|
|
16
|
+
orientation={orientation}
|
|
17
|
+
className={cn(
|
|
18
|
+
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px",
|
|
19
|
+
className,
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { Separator }
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { XIcon } from "lucide-react"
|
|
2
|
+
import { Dialog as SheetPrimitive } from "radix-ui"
|
|
3
|
+
import type * as React from "react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
8
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function SheetTrigger({
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
14
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function SheetClose({
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
20
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function SheetPortal({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
26
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function SheetOverlay({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
33
|
+
return (
|
|
34
|
+
<SheetPrimitive.Overlay
|
|
35
|
+
data-slot="sheet-overlay"
|
|
36
|
+
className={cn(
|
|
37
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function SheetContent({
|
|
46
|
+
className,
|
|
47
|
+
children,
|
|
48
|
+
side = "right",
|
|
49
|
+
...props
|
|
50
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
51
|
+
side?: "top" | "right" | "bottom" | "left"
|
|
52
|
+
}) {
|
|
53
|
+
return (
|
|
54
|
+
<SheetPortal>
|
|
55
|
+
<SheetOverlay />
|
|
56
|
+
<SheetPrimitive.Content
|
|
57
|
+
data-slot="sheet-content"
|
|
58
|
+
className={cn(
|
|
59
|
+
"fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
60
|
+
side === "right" &&
|
|
61
|
+
"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",
|
|
62
|
+
side === "left" &&
|
|
63
|
+
"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",
|
|
64
|
+
side === "top" &&
|
|
65
|
+
"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
66
|
+
side === "bottom" &&
|
|
67
|
+
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
68
|
+
className,
|
|
69
|
+
)}
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
{children}
|
|
73
|
+
<SheetPrimitive.Close className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
|
|
74
|
+
<XIcon className="size-4" />
|
|
75
|
+
<span className="sr-only">Close</span>
|
|
76
|
+
</SheetPrimitive.Close>
|
|
77
|
+
</SheetPrimitive.Content>
|
|
78
|
+
</SheetPortal>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
83
|
+
return (
|
|
84
|
+
<div
|
|
85
|
+
data-slot="sheet-header"
|
|
86
|
+
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
87
|
+
{...props}
|
|
88
|
+
/>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
93
|
+
return (
|
|
94
|
+
<div
|
|
95
|
+
data-slot="sheet-footer"
|
|
96
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function SheetTitle({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
106
|
+
return (
|
|
107
|
+
<SheetPrimitive.Title
|
|
108
|
+
data-slot="sheet-title"
|
|
109
|
+
className={cn("font-semibold text-foreground", className)}
|
|
110
|
+
{...props}
|
|
111
|
+
/>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function SheetDescription({
|
|
116
|
+
className,
|
|
117
|
+
...props
|
|
118
|
+
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
119
|
+
return (
|
|
120
|
+
<SheetPrimitive.Description
|
|
121
|
+
data-slot="sheet-description"
|
|
122
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
Sheet,
|
|
130
|
+
SheetTrigger,
|
|
131
|
+
SheetClose,
|
|
132
|
+
SheetContent,
|
|
133
|
+
SheetHeader,
|
|
134
|
+
SheetFooter,
|
|
135
|
+
SheetTitle,
|
|
136
|
+
SheetDescription,
|
|
137
|
+
}
|