@open-slide/core 1.14.0 → 1.15.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/dist/{build-Dx-qTg82.js → build-DrkaQpAq.js} +1 -1
- package/dist/cli/bin.js +3 -3
- package/dist/{config-DvRA48y9.js → config-DKSETejG.js} +4 -1
- package/dist/{dev-BGXWqVUZ.js → dev-BxOIqyXR.js} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/{preview-CdQnIB39.js → preview-CazS8gpR.js} +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +2 -2
- package/src/app/components/asset-view.tsx +29 -10
- package/src/app/components/inspector/image-crop-dialog.tsx +3 -3
- package/src/app/components/inspector/inspect-overlay.tsx +44 -32
- package/src/app/components/inspector/inspector-panel.tsx +31 -26
- package/src/app/components/language-toggle.tsx +1 -1
- package/src/app/components/overview-grid.tsx +14 -12
- package/src/app/components/present/control-bar.tsx +24 -21
- package/src/app/components/present/progress-bar.tsx +1 -1
- package/src/app/components/sidebar/folder-item.tsx +26 -22
- package/src/app/components/sidebar/icon-picker.tsx +8 -8
- package/src/app/components/sidebar/sidebar-footer.tsx +2 -2
- package/src/app/components/sidebar/sidebar.tsx +22 -18
- package/src/app/components/style-panel/style-panel.tsx +8 -4
- package/src/app/components/theme-toggle.tsx +3 -3
- package/src/app/components/themes/theme-detail.tsx +2 -2
- package/src/app/components/themes/themes-gallery.tsx +1 -1
- package/src/app/components/thumbnail-rail.tsx +67 -63
- package/src/app/components/ui/badge.tsx +16 -13
- package/src/app/components/ui/button.tsx +4 -10
- package/src/app/components/ui/context-menu.tsx +46 -36
- package/src/app/components/ui/dialog.tsx +11 -13
- package/src/app/components/ui/dropdown-menu.tsx +59 -37
- package/src/app/components/ui/label.tsx +2 -5
- package/src/app/components/ui/popover.tsx +25 -18
- package/src/app/components/ui/progress.tsx +8 -6
- package/src/app/components/ui/scroll-area.tsx +5 -5
- package/src/app/components/ui/select.tsx +40 -41
- package/src/app/components/ui/separator.tsx +3 -5
- package/src/app/components/ui/slider.tsx +25 -18
- package/src/app/components/ui/tabs.tsx +8 -8
- package/src/app/components/ui/toggle-group.tsx +8 -7
- package/src/app/components/ui/toggle.tsx +5 -5
- package/src/app/components/ui/tooltip.tsx +39 -22
- package/src/app/routes/home-shell.tsx +24 -20
- package/src/app/routes/home.tsx +48 -42
- package/src/app/routes/presenter.tsx +1 -1
- package/src/app/routes/slide.tsx +54 -47
- package/src/app/styles.css +86 -110
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
5
|
-
import { Select as SelectPrimitive } from "
|
|
5
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select"
|
|
6
6
|
|
|
7
7
|
import { cn } from "@/lib/utils"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
12
|
-
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
13
|
-
}
|
|
9
|
+
const Select = SelectPrimitive.Root
|
|
14
10
|
|
|
15
11
|
function SelectGroup({
|
|
16
12
|
...props
|
|
@@ -49,9 +45,9 @@ function SelectTrigger({
|
|
|
49
45
|
{...props}
|
|
50
46
|
>
|
|
51
47
|
{children}
|
|
52
|
-
<SelectPrimitive.Icon
|
|
53
|
-
<ChevronDownIcon className="size-3.5 opacity-50" />
|
|
54
|
-
|
|
48
|
+
<SelectPrimitive.Icon
|
|
49
|
+
render={<ChevronDownIcon className="size-3.5 opacity-50" />}
|
|
50
|
+
/>
|
|
55
51
|
</SelectPrimitive.Trigger>
|
|
56
52
|
)
|
|
57
53
|
}
|
|
@@ -59,36 +55,39 @@ function SelectTrigger({
|
|
|
59
55
|
function SelectContent({
|
|
60
56
|
className,
|
|
61
57
|
children,
|
|
62
|
-
|
|
58
|
+
side,
|
|
63
59
|
align = "center",
|
|
60
|
+
sideOffset = 4,
|
|
61
|
+
alignOffset,
|
|
62
|
+
alignItemWithTrigger = true,
|
|
64
63
|
...props
|
|
65
|
-
}: React.ComponentProps<typeof SelectPrimitive.
|
|
64
|
+
}: React.ComponentProps<typeof SelectPrimitive.Popup> &
|
|
65
|
+
Pick<
|
|
66
|
+
React.ComponentProps<typeof SelectPrimitive.Positioner>,
|
|
67
|
+
"side" | "sideOffset" | "align" | "alignOffset" | "alignItemWithTrigger"
|
|
68
|
+
>) {
|
|
66
69
|
return (
|
|
67
70
|
<SelectPrimitive.Portal>
|
|
68
|
-
<SelectPrimitive.
|
|
69
|
-
|
|
70
|
-
className={cn(
|
|
71
|
-
"relative z-50 max-h-(--radix-select-content-available-height) min-w-[9rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[8px] border border-border bg-popover text-popover-foreground shadow-floating data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 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",
|
|
72
|
-
position === "popper" &&
|
|
73
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
74
|
-
className
|
|
75
|
-
)}
|
|
76
|
-
position={position}
|
|
71
|
+
<SelectPrimitive.Positioner
|
|
72
|
+
side={side}
|
|
77
73
|
align={align}
|
|
78
|
-
{
|
|
74
|
+
sideOffset={sideOffset}
|
|
75
|
+
alignOffset={alignOffset}
|
|
76
|
+
alignItemWithTrigger={alignItemWithTrigger}
|
|
79
77
|
>
|
|
80
|
-
<
|
|
81
|
-
|
|
78
|
+
<SelectPrimitive.Popup
|
|
79
|
+
data-slot="select-content"
|
|
82
80
|
className={cn(
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
81
|
+
"relative isolate z-50 max-h-(--available-height) min-w-[9rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[8px] border border-border bg-popover text-popover-foreground shadow-floating transition-[transform,scale,opacity] data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0",
|
|
82
|
+
className
|
|
86
83
|
)}
|
|
84
|
+
{...props}
|
|
87
85
|
>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
<SelectScrollUpButton />
|
|
87
|
+
<SelectPrimitive.List className="p-1">{children}</SelectPrimitive.List>
|
|
88
|
+
<SelectScrollDownButton />
|
|
89
|
+
</SelectPrimitive.Popup>
|
|
90
|
+
</SelectPrimitive.Positioner>
|
|
92
91
|
</SelectPrimitive.Portal>
|
|
93
92
|
)
|
|
94
93
|
}
|
|
@@ -96,9 +95,9 @@ function SelectContent({
|
|
|
96
95
|
function SelectLabel({
|
|
97
96
|
className,
|
|
98
97
|
...props
|
|
99
|
-
}: React.ComponentProps<typeof SelectPrimitive.
|
|
98
|
+
}: React.ComponentProps<typeof SelectPrimitive.GroupLabel>) {
|
|
100
99
|
return (
|
|
101
|
-
<SelectPrimitive.
|
|
100
|
+
<SelectPrimitive.GroupLabel
|
|
102
101
|
data-slot="select-label"
|
|
103
102
|
className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
|
|
104
103
|
{...props}
|
|
@@ -115,7 +114,7 @@ function SelectItem({
|
|
|
115
114
|
<SelectPrimitive.Item
|
|
116
115
|
data-slot="select-item"
|
|
117
116
|
className={cn(
|
|
118
|
-
"relative flex w-full cursor-default items-center gap-2 rounded-[5px] py-1.5 pr-8 pl-2 text-[12.5px] outline-hidden select-none
|
|
117
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-[5px] py-1.5 pr-8 pl-2 text-[12.5px] outline-hidden select-none data-highlighted:bg-foreground data-highlighted:text-background data-[disabled]:pointer-events-none data-[disabled]:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 [&_svg:not([class*='text-'])]:text-current *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
119
118
|
className
|
|
120
119
|
)}
|
|
121
120
|
{...props}
|
|
@@ -149,36 +148,36 @@ function SelectSeparator({
|
|
|
149
148
|
function SelectScrollUpButton({
|
|
150
149
|
className,
|
|
151
150
|
...props
|
|
152
|
-
}: React.ComponentProps<typeof SelectPrimitive.
|
|
151
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {
|
|
153
152
|
return (
|
|
154
|
-
<SelectPrimitive.
|
|
153
|
+
<SelectPrimitive.ScrollUpArrow
|
|
155
154
|
data-slot="select-scroll-up-button"
|
|
156
155
|
className={cn(
|
|
157
|
-
"flex cursor-default items-center justify-center py-1",
|
|
156
|
+
"top-0 flex w-full cursor-default items-center justify-center py-1",
|
|
158
157
|
className
|
|
159
158
|
)}
|
|
160
159
|
{...props}
|
|
161
160
|
>
|
|
162
161
|
<ChevronUpIcon className="size-4" />
|
|
163
|
-
</SelectPrimitive.
|
|
162
|
+
</SelectPrimitive.ScrollUpArrow>
|
|
164
163
|
)
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
function SelectScrollDownButton({
|
|
168
167
|
className,
|
|
169
168
|
...props
|
|
170
|
-
}: React.ComponentProps<typeof SelectPrimitive.
|
|
169
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {
|
|
171
170
|
return (
|
|
172
|
-
<SelectPrimitive.
|
|
171
|
+
<SelectPrimitive.ScrollDownArrow
|
|
173
172
|
data-slot="select-scroll-down-button"
|
|
174
173
|
className={cn(
|
|
175
|
-
"flex cursor-default items-center justify-center py-1",
|
|
174
|
+
"bottom-0 flex w-full cursor-default items-center justify-center py-1",
|
|
176
175
|
className
|
|
177
176
|
)}
|
|
178
177
|
{...props}
|
|
179
178
|
>
|
|
180
179
|
<ChevronDownIcon className="size-4" />
|
|
181
|
-
</SelectPrimitive.
|
|
180
|
+
</SelectPrimitive.ScrollDownArrow>
|
|
182
181
|
)
|
|
183
182
|
}
|
|
184
183
|
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { Separator as SeparatorPrimitive } from '
|
|
4
|
+
import { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
|
|
5
5
|
|
|
6
6
|
import { cn } from '@/lib/utils';
|
|
7
7
|
|
|
8
8
|
function Separator({
|
|
9
9
|
className,
|
|
10
10
|
orientation = 'horizontal',
|
|
11
|
-
decorative = true,
|
|
12
11
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof SeparatorPrimitive
|
|
12
|
+
}: React.ComponentProps<typeof SeparatorPrimitive>) {
|
|
14
13
|
return (
|
|
15
|
-
<SeparatorPrimitive
|
|
14
|
+
<SeparatorPrimitive
|
|
16
15
|
data-slot="separator"
|
|
17
|
-
decorative={decorative}
|
|
18
16
|
orientation={orientation}
|
|
19
17
|
className={cn(
|
|
20
18
|
'shrink-0 bg-hairline data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { Slider as SliderPrimitive } from "
|
|
2
|
+
import { Slider as SliderPrimitive } from "@base-ui/react/slider"
|
|
3
3
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
@@ -28,32 +28,39 @@ function Slider({
|
|
|
28
28
|
value={value}
|
|
29
29
|
min={min}
|
|
30
30
|
max={max}
|
|
31
|
+
thumbAlignment="edge"
|
|
31
32
|
className={cn(
|
|
32
33
|
"group/slider relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
33
34
|
className
|
|
34
35
|
)}
|
|
35
36
|
{...props}
|
|
36
37
|
>
|
|
37
|
-
<SliderPrimitive.
|
|
38
|
-
data-slot="slider-
|
|
39
|
-
className=
|
|
40
|
-
"relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-[3px] data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-[3px]"
|
|
41
|
-
)}
|
|
38
|
+
<SliderPrimitive.Control
|
|
39
|
+
data-slot="slider-control"
|
|
40
|
+
className="relative flex w-full grow items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col"
|
|
42
41
|
>
|
|
43
|
-
<SliderPrimitive.
|
|
44
|
-
data-slot="slider-
|
|
42
|
+
<SliderPrimitive.Track
|
|
43
|
+
data-slot="slider-track"
|
|
45
44
|
className={cn(
|
|
46
|
-
"
|
|
45
|
+
"relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-[3px] data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-[3px]"
|
|
47
46
|
)}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
>
|
|
48
|
+
<SliderPrimitive.Indicator
|
|
49
|
+
data-slot="slider-range"
|
|
50
|
+
className={cn(
|
|
51
|
+
"absolute bg-foreground data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
52
|
+
)}
|
|
53
|
+
/>
|
|
54
|
+
</SliderPrimitive.Track>
|
|
55
|
+
{Array.from({ length: _values.length }, (_, index) => (
|
|
56
|
+
<SliderPrimitive.Thumb
|
|
57
|
+
data-slot="slider-thumb"
|
|
58
|
+
index={index}
|
|
59
|
+
key={index}
|
|
60
|
+
className="block size-3.5 shrink-0 rounded-full border border-foreground bg-card shadow-edge transition-transform hover:scale-110 focus-visible:scale-110 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/50 disabled:pointer-events-none disabled:opacity-50"
|
|
61
|
+
/>
|
|
62
|
+
))}
|
|
63
|
+
</SliderPrimitive.Control>
|
|
57
64
|
</SliderPrimitive.Root>
|
|
58
65
|
)
|
|
59
66
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { Tabs as TabsPrimitive } from '
|
|
3
|
+
import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
|
|
4
4
|
|
|
5
5
|
import { cn } from '@/lib/utils';
|
|
6
6
|
|
|
@@ -50,15 +50,15 @@ function TabsList({
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.
|
|
53
|
+
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Tab>) {
|
|
54
54
|
return (
|
|
55
|
-
<TabsPrimitive.
|
|
55
|
+
<TabsPrimitive.Tab
|
|
56
56
|
data-slot="tabs-trigger"
|
|
57
57
|
className={cn(
|
|
58
58
|
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-[5px] border border-transparent px-2.5 text-[12px] font-medium whitespace-nowrap text-foreground/55 transition-colors group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
59
|
-
'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-
|
|
60
|
-
'data-
|
|
61
|
-
'after:absolute after:bg-brand after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:-bottom-[6px] group-data-[orientation=horizontal]/tabs:after:h-[2px] 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-
|
|
59
|
+
'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent',
|
|
60
|
+
'data-active:bg-card data-active:text-foreground data-active:shadow-edge dark:data-active:bg-foreground/10',
|
|
61
|
+
'after:absolute after:bg-brand after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:-bottom-[6px] group-data-[orientation=horizontal]/tabs:after:h-[2px] 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-active:after:opacity-100',
|
|
62
62
|
className,
|
|
63
63
|
)}
|
|
64
64
|
{...props}
|
|
@@ -66,9 +66,9 @@ function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPr
|
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.
|
|
69
|
+
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Panel>) {
|
|
70
70
|
return (
|
|
71
|
-
<TabsPrimitive.
|
|
71
|
+
<TabsPrimitive.Panel
|
|
72
72
|
data-slot="tabs-content"
|
|
73
73
|
className={cn('flex-1 outline-none', className)}
|
|
74
74
|
{...props}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import { type VariantProps } from "class-variance-authority"
|
|
5
|
-
import { ToggleGroup as ToggleGroupPrimitive } from "
|
|
5
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group"
|
|
6
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
|
|
6
7
|
|
|
7
8
|
import { cn } from "@/lib/utils"
|
|
8
9
|
import { toggleVariants } from "@/components/ui/toggle"
|
|
@@ -24,12 +25,12 @@ function ToggleGroup({
|
|
|
24
25
|
spacing = 0,
|
|
25
26
|
children,
|
|
26
27
|
...props
|
|
27
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive
|
|
28
|
+
}: React.ComponentProps<typeof ToggleGroupPrimitive> &
|
|
28
29
|
VariantProps<typeof toggleVariants> & {
|
|
29
30
|
spacing?: number
|
|
30
31
|
}) {
|
|
31
32
|
return (
|
|
32
|
-
<ToggleGroupPrimitive
|
|
33
|
+
<ToggleGroupPrimitive
|
|
33
34
|
data-slot="toggle-group"
|
|
34
35
|
data-variant={variant}
|
|
35
36
|
data-size={size}
|
|
@@ -44,7 +45,7 @@ function ToggleGroup({
|
|
|
44
45
|
<ToggleGroupContext.Provider value={{ variant, size, spacing }}>
|
|
45
46
|
{children}
|
|
46
47
|
</ToggleGroupContext.Provider>
|
|
47
|
-
</ToggleGroupPrimitive
|
|
48
|
+
</ToggleGroupPrimitive>
|
|
48
49
|
)
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -54,12 +55,12 @@ function ToggleGroupItem({
|
|
|
54
55
|
variant,
|
|
55
56
|
size,
|
|
56
57
|
...props
|
|
57
|
-
}: React.ComponentProps<typeof
|
|
58
|
+
}: React.ComponentProps<typeof TogglePrimitive> &
|
|
58
59
|
VariantProps<typeof toggleVariants>) {
|
|
59
60
|
const context = React.useContext(ToggleGroupContext)
|
|
60
61
|
|
|
61
62
|
return (
|
|
62
|
-
<
|
|
63
|
+
<TogglePrimitive
|
|
63
64
|
data-slot="toggle-group-item"
|
|
64
65
|
data-variant={context.variant || variant}
|
|
65
66
|
data-size={context.size || size}
|
|
@@ -76,7 +77,7 @@ function ToggleGroupItem({
|
|
|
76
77
|
{...props}
|
|
77
78
|
>
|
|
78
79
|
{children}
|
|
79
|
-
</
|
|
80
|
+
</TogglePrimitive>
|
|
80
81
|
)
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
import { Toggle as TogglePrimitive } from "
|
|
3
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
|
|
4
4
|
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
7
|
const toggleVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center gap-2 rounded-[5px] text-[12px] font-medium whitespace-nowrap outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 data-
|
|
8
|
+
"inline-flex items-center justify-center gap-2 rounded-[5px] text-[12px] font-medium whitespace-nowrap outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 data-pressed:bg-foreground data-pressed:text-background [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default: "bg-transparent text-foreground/70",
|
|
13
13
|
outline:
|
|
14
|
-
"border border-border bg-card text-foreground/75 hover:border-foreground/20 data-
|
|
14
|
+
"border border-border bg-card text-foreground/75 hover:border-foreground/20 data-pressed:border-foreground",
|
|
15
15
|
},
|
|
16
16
|
size: {
|
|
17
17
|
default: "h-8 min-w-8 px-2",
|
|
@@ -31,10 +31,10 @@ function Toggle({
|
|
|
31
31
|
variant,
|
|
32
32
|
size,
|
|
33
33
|
...props
|
|
34
|
-
}: React.ComponentProps<typeof TogglePrimitive
|
|
34
|
+
}: React.ComponentProps<typeof TogglePrimitive> &
|
|
35
35
|
VariantProps<typeof toggleVariants>) {
|
|
36
36
|
return (
|
|
37
|
-
<TogglePrimitive
|
|
37
|
+
<TogglePrimitive
|
|
38
38
|
data-slot="toggle"
|
|
39
39
|
className={cn(toggleVariants({ variant, size, className }))}
|
|
40
40
|
{...props}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { Tooltip as TooltipPrimitive } from "
|
|
2
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip"
|
|
3
3
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
6
|
function TooltipProvider({
|
|
7
|
-
|
|
7
|
+
delay = 0,
|
|
8
8
|
...props
|
|
9
9
|
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
10
|
-
return
|
|
11
|
-
<TooltipPrimitive.Provider
|
|
12
|
-
data-slot="tooltip-provider"
|
|
13
|
-
delayDuration={delayDuration}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
)
|
|
10
|
+
return <TooltipPrimitive.Provider delay={delay} {...props} />
|
|
17
11
|
}
|
|
18
12
|
|
|
19
13
|
function Tooltip({
|
|
@@ -30,27 +24,50 @@ function TooltipTrigger({
|
|
|
30
24
|
|
|
31
25
|
function TooltipContent({
|
|
32
26
|
className,
|
|
27
|
+
side,
|
|
33
28
|
sideOffset = 0,
|
|
29
|
+
align,
|
|
30
|
+
alignOffset,
|
|
31
|
+
collisionPadding,
|
|
34
32
|
children,
|
|
35
33
|
container,
|
|
36
34
|
...props
|
|
37
|
-
}: React.ComponentProps<typeof TooltipPrimitive.
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Popup> &
|
|
36
|
+
Pick<
|
|
37
|
+
React.ComponentProps<typeof TooltipPrimitive.Positioner>,
|
|
38
|
+
"side" | "sideOffset" | "align" | "alignOffset" | "collisionPadding"
|
|
39
|
+
> & {
|
|
40
|
+
container?: React.ComponentProps<typeof TooltipPrimitive.Portal>["container"]
|
|
41
|
+
}) {
|
|
40
42
|
return (
|
|
41
43
|
<TooltipPrimitive.Portal container={container}>
|
|
42
|
-
<TooltipPrimitive.
|
|
43
|
-
|
|
44
|
+
<TooltipPrimitive.Positioner
|
|
45
|
+
side={side}
|
|
44
46
|
sideOffset={sideOffset}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{...props}
|
|
47
|
+
align={align}
|
|
48
|
+
alignOffset={alignOffset}
|
|
49
|
+
collisionPadding={collisionPadding}
|
|
50
|
+
className="isolate z-50"
|
|
50
51
|
>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
<TooltipPrimitive.Popup
|
|
53
|
+
data-slot="tooltip-content"
|
|
54
|
+
className={cn(
|
|
55
|
+
"w-fit origin-(--transform-origin) rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background transition-[transform,scale,opacity] data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0 data-[instant]:duration-0",
|
|
56
|
+
className
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
>
|
|
60
|
+
{children}
|
|
61
|
+
<TooltipPrimitive.Arrow
|
|
62
|
+
className={cn(
|
|
63
|
+
"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-inherit",
|
|
64
|
+
"data-[side=top]:-bottom-2.5 data-[side=bottom]:top-1",
|
|
65
|
+
"data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2",
|
|
66
|
+
"data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2",
|
|
67
|
+
)}
|
|
68
|
+
/>
|
|
69
|
+
</TooltipPrimitive.Popup>
|
|
70
|
+
</TooltipPrimitive.Positioner>
|
|
54
71
|
</TooltipPrimitive.Portal>
|
|
55
72
|
)
|
|
56
73
|
}
|
|
@@ -170,25 +170,27 @@ export function HomeShell() {
|
|
|
170
170
|
/>
|
|
171
171
|
</div>
|
|
172
172
|
|
|
173
|
-
<div className="
|
|
173
|
+
<div className="relative flex min-w-0 flex-1 flex-col overflow-y-auto bg-canvas">
|
|
174
174
|
<div className="flex items-center justify-between border-b border-hairline bg-sidebar px-4 py-3 md:hidden">
|
|
175
175
|
<h1 className="font-heading text-lg font-bold tracking-tight">{t.home.appTitle}</h1>
|
|
176
176
|
<div className="-mr-1.5 flex items-center gap-0.5">
|
|
177
177
|
<LanguageToggle />
|
|
178
178
|
<ThemeToggle />
|
|
179
179
|
<DropdownMenu>
|
|
180
|
-
<DropdownMenuTrigger
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
180
|
+
<DropdownMenuTrigger
|
|
181
|
+
render={
|
|
182
|
+
<button
|
|
183
|
+
type="button"
|
|
184
|
+
aria-label={t.home.menu}
|
|
185
|
+
className="flex size-8 items-center justify-center rounded-[6px] text-muted-foreground hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground"
|
|
186
|
+
>
|
|
187
|
+
<Menu className="size-4" />
|
|
188
|
+
</button>
|
|
189
|
+
}
|
|
190
|
+
/>
|
|
189
191
|
<DropdownMenuContent align="end" className="min-w-[200px]">
|
|
190
192
|
<DropdownMenuItem
|
|
191
|
-
|
|
193
|
+
onClick={() => selectFolder(ALL_SLIDES_ID)}
|
|
192
194
|
className={cn(
|
|
193
195
|
selectedId !== THEMES_ID &&
|
|
194
196
|
selectedId !== ASSETS_ID &&
|
|
@@ -200,21 +202,23 @@ export function HomeShell() {
|
|
|
200
202
|
<span className="folio">{slideIds.length.toString().padStart(2, '0')}</span>
|
|
201
203
|
</DropdownMenuItem>
|
|
202
204
|
<DropdownMenuItem
|
|
203
|
-
|
|
205
|
+
onClick={() => selectFolder(THEMES_ID)}
|
|
204
206
|
className={cn(selectedId === THEMES_ID && 'bg-muted text-foreground')}
|
|
205
207
|
>
|
|
206
208
|
<FolderIconChip icon={{ type: 'emoji', value: '🎨' }} />
|
|
207
209
|
<span className="flex-1 truncate">{t.home.themes}</span>
|
|
208
210
|
<span className="folio">{themeRegistry.length.toString().padStart(2, '0')}</span>
|
|
209
211
|
</DropdownMenuItem>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
{import.meta.env.DEV && (
|
|
213
|
+
<DropdownMenuItem
|
|
214
|
+
onClick={() => selectFolder(ASSETS_ID)}
|
|
215
|
+
className={cn(selectedId === ASSETS_ID && 'bg-muted text-foreground')}
|
|
216
|
+
>
|
|
217
|
+
<FolderIconChip icon={{ type: 'emoji', value: '🗂️' }} />
|
|
218
|
+
<span className="flex-1 truncate">{t.home.assets}</span>
|
|
219
|
+
<span className="folio">{globalAssets.length.toString().padStart(2, '0')}</span>
|
|
220
|
+
</DropdownMenuItem>
|
|
221
|
+
)}
|
|
218
222
|
</DropdownMenuContent>
|
|
219
223
|
</DropdownMenu>
|
|
220
224
|
</div>
|