@open-slide/core 0.0.3 → 0.0.5
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/dist/build-BCORlVF3.js +16 -0
- package/dist/cli/bin.js +25 -36
- package/dist/{config-g-uy_P5U.js → config-DF58h0l4.js} +132 -5
- package/dist/dev-h-rxb3xY.js +19 -0
- package/dist/preview-lskE0s8A.js +17 -0
- package/dist/vite/index.js +1 -1
- package/package.json +5 -2
- package/src/app/components/ClickNavZones.tsx +34 -0
- package/src/app/components/Player.tsx +25 -3
- package/src/app/components/ThumbnailRail.tsx +8 -0
- package/src/app/components/inspector/CommentPopover.tsx +3 -11
- package/src/app/components/inspector/InspectOverlay.tsx +16 -4
- package/src/app/components/inspector/InspectorProvider.tsx +8 -1
- package/src/app/components/sidebar/FolderItem.tsx +1 -4
- package/src/app/components/ui/dialog.tsx +141 -0
- package/src/app/components/ui/dropdown-menu.tsx +41 -70
- package/src/app/components/ui/popover.tsx +22 -37
- package/src/app/components/ui/tabs.tsx +26 -36
- package/src/app/lib/export-html.ts +320 -0
- package/src/app/lib/folders.ts +40 -4
- package/src/app/lib/sdk.ts +1 -3
- package/src/app/routes/Home.tsx +453 -65
- package/src/app/routes/Slide.tsx +151 -38
- package/dist/build-Cav2jYyI.js +0 -14
- package/dist/dev-CFmlBbLh.js +0 -14
- package/dist/preview-CotwHU_d.js +0 -12
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { XIcon } from 'lucide-react';
|
|
2
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
import { Button } from '@/components/ui/button';
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
|
+
|
|
7
|
+
function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
8
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
12
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
16
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
20
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function DialogOverlay({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
|
27
|
+
return (
|
|
28
|
+
<DialogPrimitive.Overlay
|
|
29
|
+
data-slot="dialog-overlay"
|
|
30
|
+
className={cn(
|
|
31
|
+
'fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0',
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function DialogContent({
|
|
40
|
+
className,
|
|
41
|
+
children,
|
|
42
|
+
showCloseButton = true,
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
45
|
+
showCloseButton?: boolean;
|
|
46
|
+
}) {
|
|
47
|
+
return (
|
|
48
|
+
<DialogPortal data-slot="dialog-portal">
|
|
49
|
+
<DialogOverlay />
|
|
50
|
+
<DialogPrimitive.Content
|
|
51
|
+
data-slot="dialog-content"
|
|
52
|
+
className={cn(
|
|
53
|
+
'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 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg',
|
|
54
|
+
className,
|
|
55
|
+
)}
|
|
56
|
+
{...props}
|
|
57
|
+
>
|
|
58
|
+
{children}
|
|
59
|
+
{showCloseButton && (
|
|
60
|
+
<DialogPrimitive.Close
|
|
61
|
+
data-slot="dialog-close"
|
|
62
|
+
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-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
63
|
+
>
|
|
64
|
+
<XIcon />
|
|
65
|
+
<span className="sr-only">Close</span>
|
|
66
|
+
</DialogPrimitive.Close>
|
|
67
|
+
)}
|
|
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({
|
|
84
|
+
className,
|
|
85
|
+
showCloseButton = false,
|
|
86
|
+
children,
|
|
87
|
+
...props
|
|
88
|
+
}: React.ComponentProps<'div'> & {
|
|
89
|
+
showCloseButton?: boolean;
|
|
90
|
+
}) {
|
|
91
|
+
return (
|
|
92
|
+
<div
|
|
93
|
+
data-slot="dialog-footer"
|
|
94
|
+
className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}
|
|
95
|
+
{...props}
|
|
96
|
+
>
|
|
97
|
+
{children}
|
|
98
|
+
{showCloseButton && (
|
|
99
|
+
<DialogPrimitive.Close asChild>
|
|
100
|
+
<Button variant="outline">Close</Button>
|
|
101
|
+
</DialogPrimitive.Close>
|
|
102
|
+
)}
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
108
|
+
return (
|
|
109
|
+
<DialogPrimitive.Title
|
|
110
|
+
data-slot="dialog-title"
|
|
111
|
+
className={cn('text-lg leading-none font-semibold', className)}
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function DialogDescription({
|
|
118
|
+
className,
|
|
119
|
+
...props
|
|
120
|
+
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
|
|
121
|
+
return (
|
|
122
|
+
<DialogPrimitive.Description
|
|
123
|
+
data-slot="dialog-description"
|
|
124
|
+
className={cn('text-sm text-muted-foreground', className)}
|
|
125
|
+
{...props}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
Dialog,
|
|
132
|
+
DialogClose,
|
|
133
|
+
DialogContent,
|
|
134
|
+
DialogDescription,
|
|
135
|
+
DialogFooter,
|
|
136
|
+
DialogHeader,
|
|
137
|
+
DialogOverlay,
|
|
138
|
+
DialogPortal,
|
|
139
|
+
DialogTitle,
|
|
140
|
+
DialogTrigger,
|
|
141
|
+
};
|
|
@@ -1,34 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from
|
|
5
|
-
import { DropdownMenu as DropdownMenuPrimitive } from
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
5
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
|
|
6
6
|
|
|
7
|
-
import { cn } from
|
|
7
|
+
import { cn } from '@/lib/utils';
|
|
8
8
|
|
|
9
|
-
function DropdownMenu({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
12
|
-
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
9
|
+
function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
10
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
function DropdownMenuPortal({
|
|
16
14
|
...props
|
|
17
15
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
18
|
-
return
|
|
19
|
-
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
20
|
-
)
|
|
16
|
+
return <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
function DropdownMenuTrigger({
|
|
24
20
|
...props
|
|
25
21
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
26
|
-
return
|
|
27
|
-
<DropdownMenuPrimitive.Trigger
|
|
28
|
-
data-slot="dropdown-menu-trigger"
|
|
29
|
-
{...props}
|
|
30
|
-
/>
|
|
31
|
-
)
|
|
22
|
+
return <DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
|
|
32
23
|
}
|
|
33
24
|
|
|
34
25
|
function DropdownMenuContent({
|
|
@@ -42,31 +33,27 @@ function DropdownMenuContent({
|
|
|
42
33
|
data-slot="dropdown-menu-content"
|
|
43
34
|
sideOffset={sideOffset}
|
|
44
35
|
className={cn(
|
|
45
|
-
|
|
46
|
-
className
|
|
36
|
+
'z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
|
|
37
|
+
className,
|
|
47
38
|
)}
|
|
48
39
|
{...props}
|
|
49
40
|
/>
|
|
50
41
|
</DropdownMenuPrimitive.Portal>
|
|
51
|
-
)
|
|
42
|
+
);
|
|
52
43
|
}
|
|
53
44
|
|
|
54
|
-
function DropdownMenuGroup({
|
|
55
|
-
...props
|
|
56
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
57
|
-
return (
|
|
58
|
-
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
59
|
-
)
|
|
45
|
+
function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
46
|
+
return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
|
|
60
47
|
}
|
|
61
48
|
|
|
62
49
|
function DropdownMenuItem({
|
|
63
50
|
className,
|
|
64
51
|
inset,
|
|
65
|
-
variant =
|
|
52
|
+
variant = 'default',
|
|
66
53
|
...props
|
|
67
54
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
68
|
-
inset?: boolean
|
|
69
|
-
variant?:
|
|
55
|
+
inset?: boolean;
|
|
56
|
+
variant?: 'default' | 'destructive';
|
|
70
57
|
}) {
|
|
71
58
|
return (
|
|
72
59
|
<DropdownMenuPrimitive.Item
|
|
@@ -75,11 +62,11 @@ function DropdownMenuItem({
|
|
|
75
62
|
data-variant={variant}
|
|
76
63
|
className={cn(
|
|
77
64
|
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
78
|
-
className
|
|
65
|
+
className,
|
|
79
66
|
)}
|
|
80
67
|
{...props}
|
|
81
68
|
/>
|
|
82
|
-
)
|
|
69
|
+
);
|
|
83
70
|
}
|
|
84
71
|
|
|
85
72
|
function DropdownMenuCheckboxItem({
|
|
@@ -93,7 +80,7 @@ function DropdownMenuCheckboxItem({
|
|
|
93
80
|
data-slot="dropdown-menu-checkbox-item"
|
|
94
81
|
className={cn(
|
|
95
82
|
"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
96
|
-
className
|
|
83
|
+
className,
|
|
97
84
|
)}
|
|
98
85
|
checked={checked}
|
|
99
86
|
{...props}
|
|
@@ -105,18 +92,13 @@ function DropdownMenuCheckboxItem({
|
|
|
105
92
|
</span>
|
|
106
93
|
{children}
|
|
107
94
|
</DropdownMenuPrimitive.CheckboxItem>
|
|
108
|
-
)
|
|
95
|
+
);
|
|
109
96
|
}
|
|
110
97
|
|
|
111
98
|
function DropdownMenuRadioGroup({
|
|
112
99
|
...props
|
|
113
100
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
114
|
-
return
|
|
115
|
-
<DropdownMenuPrimitive.RadioGroup
|
|
116
|
-
data-slot="dropdown-menu-radio-group"
|
|
117
|
-
{...props}
|
|
118
|
-
/>
|
|
119
|
-
)
|
|
101
|
+
return <DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />;
|
|
120
102
|
}
|
|
121
103
|
|
|
122
104
|
function DropdownMenuRadioItem({
|
|
@@ -129,7 +111,7 @@ function DropdownMenuRadioItem({
|
|
|
129
111
|
data-slot="dropdown-menu-radio-item"
|
|
130
112
|
className={cn(
|
|
131
113
|
"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
132
|
-
className
|
|
114
|
+
className,
|
|
133
115
|
)}
|
|
134
116
|
{...props}
|
|
135
117
|
>
|
|
@@ -140,7 +122,7 @@ function DropdownMenuRadioItem({
|
|
|
140
122
|
</span>
|
|
141
123
|
{children}
|
|
142
124
|
</DropdownMenuPrimitive.RadioItem>
|
|
143
|
-
)
|
|
125
|
+
);
|
|
144
126
|
}
|
|
145
127
|
|
|
146
128
|
function DropdownMenuLabel({
|
|
@@ -148,19 +130,16 @@ function DropdownMenuLabel({
|
|
|
148
130
|
inset,
|
|
149
131
|
...props
|
|
150
132
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
151
|
-
inset?: boolean
|
|
133
|
+
inset?: boolean;
|
|
152
134
|
}) {
|
|
153
135
|
return (
|
|
154
136
|
<DropdownMenuPrimitive.Label
|
|
155
137
|
data-slot="dropdown-menu-label"
|
|
156
138
|
data-inset={inset}
|
|
157
|
-
className={cn(
|
|
158
|
-
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
159
|
-
className
|
|
160
|
-
)}
|
|
139
|
+
className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}
|
|
161
140
|
{...props}
|
|
162
141
|
/>
|
|
163
|
-
)
|
|
142
|
+
);
|
|
164
143
|
}
|
|
165
144
|
|
|
166
145
|
function DropdownMenuSeparator({
|
|
@@ -170,32 +149,24 @@ function DropdownMenuSeparator({
|
|
|
170
149
|
return (
|
|
171
150
|
<DropdownMenuPrimitive.Separator
|
|
172
151
|
data-slot="dropdown-menu-separator"
|
|
173
|
-
className={cn(
|
|
152
|
+
className={cn('-mx-1 my-1 h-px bg-border', className)}
|
|
174
153
|
{...props}
|
|
175
154
|
/>
|
|
176
|
-
)
|
|
155
|
+
);
|
|
177
156
|
}
|
|
178
157
|
|
|
179
|
-
function DropdownMenuShortcut({
|
|
180
|
-
className,
|
|
181
|
-
...props
|
|
182
|
-
}: React.ComponentProps<"span">) {
|
|
158
|
+
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
183
159
|
return (
|
|
184
160
|
<span
|
|
185
161
|
data-slot="dropdown-menu-shortcut"
|
|
186
|
-
className={cn(
|
|
187
|
-
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
188
|
-
className
|
|
189
|
-
)}
|
|
162
|
+
className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}
|
|
190
163
|
{...props}
|
|
191
164
|
/>
|
|
192
|
-
)
|
|
165
|
+
);
|
|
193
166
|
}
|
|
194
167
|
|
|
195
|
-
function DropdownMenuSub({
|
|
196
|
-
...props
|
|
197
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
198
|
-
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
|
|
168
|
+
function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
169
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
|
|
199
170
|
}
|
|
200
171
|
|
|
201
172
|
function DropdownMenuSubTrigger({
|
|
@@ -204,7 +175,7 @@ function DropdownMenuSubTrigger({
|
|
|
204
175
|
children,
|
|
205
176
|
...props
|
|
206
177
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
207
|
-
inset?: boolean
|
|
178
|
+
inset?: boolean;
|
|
208
179
|
}) {
|
|
209
180
|
return (
|
|
210
181
|
<DropdownMenuPrimitive.SubTrigger
|
|
@@ -212,14 +183,14 @@ function DropdownMenuSubTrigger({
|
|
|
212
183
|
data-inset={inset}
|
|
213
184
|
className={cn(
|
|
214
185
|
"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
215
|
-
className
|
|
186
|
+
className,
|
|
216
187
|
)}
|
|
217
188
|
{...props}
|
|
218
189
|
>
|
|
219
190
|
{children}
|
|
220
191
|
<ChevronRightIcon className="ml-auto size-4" />
|
|
221
192
|
</DropdownMenuPrimitive.SubTrigger>
|
|
222
|
-
)
|
|
193
|
+
);
|
|
223
194
|
}
|
|
224
195
|
|
|
225
196
|
function DropdownMenuSubContent({
|
|
@@ -230,12 +201,12 @@ function DropdownMenuSubContent({
|
|
|
230
201
|
<DropdownMenuPrimitive.SubContent
|
|
231
202
|
data-slot="dropdown-menu-sub-content"
|
|
232
203
|
className={cn(
|
|
233
|
-
|
|
234
|
-
className
|
|
204
|
+
'z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
|
|
205
|
+
className,
|
|
235
206
|
)}
|
|
236
207
|
{...props}
|
|
237
208
|
/>
|
|
238
|
-
)
|
|
209
|
+
);
|
|
239
210
|
}
|
|
240
211
|
|
|
241
212
|
export {
|
|
@@ -254,4 +225,4 @@ export {
|
|
|
254
225
|
DropdownMenuSub,
|
|
255
226
|
DropdownMenuSubTrigger,
|
|
256
227
|
DropdownMenuSubContent,
|
|
257
|
-
}
|
|
228
|
+
};
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { Popover as PopoverPrimitive } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
5
|
|
|
6
|
-
function Popover({
|
|
7
|
-
...props
|
|
8
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
9
|
-
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
6
|
+
function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
7
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
|
-
function PopoverTrigger({
|
|
13
|
-
...props
|
|
14
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
15
|
-
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
10
|
+
function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
11
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
16
12
|
}
|
|
17
13
|
|
|
18
14
|
function PopoverContent({
|
|
19
15
|
className,
|
|
20
|
-
align =
|
|
16
|
+
align = 'center',
|
|
21
17
|
sideOffset = 4,
|
|
22
18
|
...props
|
|
23
19
|
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
@@ -28,52 +24,41 @@ function PopoverContent({
|
|
|
28
24
|
align={align}
|
|
29
25
|
sideOffset={sideOffset}
|
|
30
26
|
className={cn(
|
|
31
|
-
|
|
32
|
-
className
|
|
27
|
+
'z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
|
|
28
|
+
className,
|
|
33
29
|
)}
|
|
34
30
|
{...props}
|
|
35
31
|
/>
|
|
36
32
|
</PopoverPrimitive.Portal>
|
|
37
|
-
)
|
|
33
|
+
);
|
|
38
34
|
}
|
|
39
35
|
|
|
40
|
-
function PopoverAnchor({
|
|
41
|
-
...props
|
|
42
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
43
|
-
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
36
|
+
function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
37
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
|
|
44
38
|
}
|
|
45
39
|
|
|
46
|
-
function PopoverHeader({ className, ...props }: React.ComponentProps<
|
|
40
|
+
function PopoverHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
47
41
|
return (
|
|
48
42
|
<div
|
|
49
43
|
data-slot="popover-header"
|
|
50
|
-
className={cn(
|
|
44
|
+
className={cn('flex flex-col gap-1 text-sm', className)}
|
|
51
45
|
{...props}
|
|
52
46
|
/>
|
|
53
|
-
)
|
|
47
|
+
);
|
|
54
48
|
}
|
|
55
49
|
|
|
56
|
-
function PopoverTitle({ className, ...props }: React.ComponentProps<
|
|
57
|
-
return (
|
|
58
|
-
<div
|
|
59
|
-
data-slot="popover-title"
|
|
60
|
-
className={cn("font-medium", className)}
|
|
61
|
-
{...props}
|
|
62
|
-
/>
|
|
63
|
-
)
|
|
50
|
+
function PopoverTitle({ className, ...props }: React.ComponentProps<'h2'>) {
|
|
51
|
+
return <div data-slot="popover-title" className={cn('font-medium', className)} {...props} />;
|
|
64
52
|
}
|
|
65
53
|
|
|
66
|
-
function PopoverDescription({
|
|
67
|
-
className,
|
|
68
|
-
...props
|
|
69
|
-
}: React.ComponentProps<"p">) {
|
|
54
|
+
function PopoverDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
70
55
|
return (
|
|
71
56
|
<p
|
|
72
57
|
data-slot="popover-description"
|
|
73
|
-
className={cn(
|
|
58
|
+
className={cn('text-muted-foreground', className)}
|
|
74
59
|
{...props}
|
|
75
60
|
/>
|
|
76
|
-
)
|
|
61
|
+
);
|
|
77
62
|
}
|
|
78
63
|
|
|
79
64
|
export {
|
|
@@ -84,4 +69,4 @@ export {
|
|
|
84
69
|
PopoverHeader,
|
|
85
70
|
PopoverTitle,
|
|
86
71
|
PopoverDescription,
|
|
87
|
-
}
|
|
72
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { cva, type VariantProps } from
|
|
3
|
-
import { Tabs as TabsPrimitive } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { Tabs as TabsPrimitive } from 'radix-ui';
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
6
|
|
|
7
7
|
function Tabs({
|
|
8
8
|
className,
|
|
9
|
-
orientation =
|
|
9
|
+
orientation = 'horizontal',
|
|
10
10
|
...props
|
|
11
11
|
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
12
12
|
return (
|
|
@@ -14,36 +14,32 @@ function Tabs({
|
|
|
14
14
|
data-slot="tabs"
|
|
15
15
|
data-orientation={orientation}
|
|
16
16
|
orientation={orientation}
|
|
17
|
-
className={cn(
|
|
18
|
-
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
19
|
-
className
|
|
20
|
-
)}
|
|
17
|
+
className={cn('group/tabs flex gap-2 data-[orientation=horizontal]:flex-col', className)}
|
|
21
18
|
{...props}
|
|
22
19
|
/>
|
|
23
|
-
)
|
|
20
|
+
);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
const tabsListVariants = cva(
|
|
27
|
-
|
|
24
|
+
'group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none',
|
|
28
25
|
{
|
|
29
26
|
variants: {
|
|
30
27
|
variant: {
|
|
31
|
-
default:
|
|
32
|
-
line:
|
|
28
|
+
default: 'bg-muted',
|
|
29
|
+
line: 'gap-1 bg-transparent',
|
|
33
30
|
},
|
|
34
31
|
},
|
|
35
32
|
defaultVariants: {
|
|
36
|
-
variant:
|
|
33
|
+
variant: 'default',
|
|
37
34
|
},
|
|
38
|
-
}
|
|
39
|
-
)
|
|
35
|
+
},
|
|
36
|
+
);
|
|
40
37
|
|
|
41
38
|
function TabsList({
|
|
42
39
|
className,
|
|
43
|
-
variant =
|
|
40
|
+
variant = 'default',
|
|
44
41
|
...props
|
|
45
|
-
}: React.ComponentProps<typeof TabsPrimitive.List> &
|
|
46
|
-
VariantProps<typeof tabsListVariants>) {
|
|
42
|
+
}: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>) {
|
|
47
43
|
return (
|
|
48
44
|
<TabsPrimitive.List
|
|
49
45
|
data-slot="tabs-list"
|
|
@@ -51,39 +47,33 @@ function TabsList({
|
|
|
51
47
|
className={cn(tabsListVariants({ variant }), className)}
|
|
52
48
|
{...props}
|
|
53
49
|
/>
|
|
54
|
-
)
|
|
50
|
+
);
|
|
55
51
|
}
|
|
56
52
|
|
|
57
|
-
function TabsTrigger({
|
|
58
|
-
className,
|
|
59
|
-
...props
|
|
60
|
-
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
53
|
+
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
61
54
|
return (
|
|
62
55
|
<TabsPrimitive.Trigger
|
|
63
56
|
data-slot="tabs-trigger"
|
|
64
57
|
className={cn(
|
|
65
58
|
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
className
|
|
59
|
+
'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent',
|
|
60
|
+
'data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground',
|
|
61
|
+
'after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100',
|
|
62
|
+
className,
|
|
70
63
|
)}
|
|
71
64
|
{...props}
|
|
72
65
|
/>
|
|
73
|
-
)
|
|
66
|
+
);
|
|
74
67
|
}
|
|
75
68
|
|
|
76
|
-
function TabsContent({
|
|
77
|
-
className,
|
|
78
|
-
...props
|
|
79
|
-
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
69
|
+
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
80
70
|
return (
|
|
81
71
|
<TabsPrimitive.Content
|
|
82
72
|
data-slot="tabs-content"
|
|
83
|
-
className={cn(
|
|
73
|
+
className={cn('flex-1 outline-none', className)}
|
|
84
74
|
{...props}
|
|
85
75
|
/>
|
|
86
|
-
)
|
|
76
|
+
);
|
|
87
77
|
}
|
|
88
78
|
|
|
89
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
|
|
79
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|