@adea-ai/ui 0.12.0 → 0.13.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/LICENSE +201 -0
- package/dist/components/account-drawer.d.ts +1 -1
- package/dist/components/account-drawer.js +12 -12
- package/dist/components/on-screen-controls.js +12 -12
- package/dist/components/scene-settings.d.ts +3 -3
- package/dist/components/scene-settings.js +11 -11
- package/dist/components/theme-provider.d.ts +1 -1
- package/dist/components/theme-provider.js +2 -2
- package/dist/components/theme-toggle.js +8 -8
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.js +15 -15
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.js +19 -19
- package/dist/components/ui/card.d.ts +1 -1
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/dialog.d.ts +4 -4
- package/dist/components/ui/dialog.js +10 -10
- package/dist/components/ui/drawer.d.ts +5 -5
- package/dist/components/ui/drawer.js +26 -26
- package/dist/components/ui/dropdown-menu.d.ts +5 -5
- package/dist/components/ui/dropdown-menu.js +12 -12
- package/dist/components/ui/empty.d.ts +7 -7
- package/dist/components/ui/empty.js +11 -11
- package/dist/components/ui/field.d.ts +12 -12
- package/dist/components/ui/field.js +22 -22
- package/dist/components/ui/input.d.ts +2 -2
- package/dist/components/ui/input.js +3 -3
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/label.js +3 -3
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.js +6 -6
- package/dist/components/ui/separator.d.ts +1 -1
- package/dist/components/ui/separator.js +5 -5
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.js +2 -2
- package/dist/components/ui/spinner.d.ts +2 -2
- package/dist/components/ui/spinner.js +3 -3
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.js +5 -5
- package/dist/components/ui/tabs.d.ts +2 -2
- package/dist/components/ui/tabs.js +13 -13
- package/dist/components/ui/toggle-group.d.ts +6 -6
- package/dist/components/ui/toggle-group.js +13 -13
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/toggle.js +11 -11
- package/dist/components/ui/tooltip.d.ts +3 -3
- package/dist/components/ui/tooltip.js +5 -5
- package/dist/components/version-dialog.d.ts +1 -1
- package/dist/components/version-dialog.js +33 -33
- package/dist/components/workspace-brand.js +1 -1
- package/dist/components/workspace-logo.d.ts +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.js +19 -19
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/lib/version-notes.js +18 -18
- package/package.json +24 -9
- package/src/components/account-drawer.tsx +27 -27
- package/src/components/on-screen-controls.tsx +45 -45
- package/src/components/scene-settings.tsx +55 -55
- package/src/components/theme-provider.tsx +7 -7
- package/src/components/theme-toggle.tsx +20 -20
- package/src/components/ui/badge.tsx +20 -20
- package/src/components/ui/button.tsx +24 -24
- package/src/components/ui/card.tsx +6 -6
- package/src/components/ui/dialog.tsx +24 -24
- package/src/components/ui/drawer.tsx +55 -55
- package/src/components/ui/dropdown-menu.tsx +39 -39
- package/src/components/ui/empty.tsx +25 -25
- package/src/components/ui/field.tsx +55 -55
- package/src/components/ui/input.tsx +7 -7
- package/src/components/ui/label.tsx +7 -7
- package/src/components/ui/radio-group.tsx +9 -9
- package/src/components/ui/separator.tsx +7 -7
- package/src/components/ui/skeleton.tsx +5 -5
- package/src/components/ui/spinner.tsx +6 -6
- package/src/components/ui/switch.tsx +8 -8
- package/src/components/ui/tabs.tsx +21 -21
- package/src/components/ui/toggle-group.tsx +25 -25
- package/src/components/ui/toggle.tsx +15 -15
- package/src/components/ui/tooltip.tsx +13 -13
- package/src/components/version-dialog.tsx +113 -113
- package/src/components/workspace-brand.tsx +4 -4
- package/src/components/workspace-logo.tsx +2 -2
- package/src/index.tsx +19 -19
- package/src/lib/utils.ts +3 -3
- package/src/lib/version-notes.ts +23 -23
- package/src/styles/conventional-workspace.css +26 -26
- package/src/styles/globals.css +2 -2
- package/src/styles/theme.css +1 -1
- package/src/styles/workspace-shell.css +2 -2
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { Drawer as DrawerPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Drawer as DrawerPrimitive } from '@base-ui/react/drawer'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
6
|
+
import { cn } from '#lib/utils'
|
|
7
7
|
|
|
8
8
|
type DrawerContextProps = {
|
|
9
|
-
hasSnapPoints: boolean
|
|
10
|
-
modal: DrawerPrimitive.Root.Props[
|
|
11
|
-
showSwipeHandle: boolean
|
|
12
|
-
swipeDirection: NonNullable<DrawerPrimitive.Root.Props[
|
|
13
|
-
}
|
|
9
|
+
hasSnapPoints: boolean
|
|
10
|
+
modal: DrawerPrimitive.Root.Props['modal']
|
|
11
|
+
showSwipeHandle: boolean
|
|
12
|
+
swipeDirection: NonNullable<DrawerPrimitive.Root.Props['swipeDirection']>
|
|
13
|
+
}
|
|
14
14
|
|
|
15
|
-
const DrawerContext = React.createContext<DrawerContextProps | null>(null)
|
|
15
|
+
const DrawerContext = React.createContext<DrawerContextProps | null>(null)
|
|
16
16
|
|
|
17
17
|
function useDrawer() {
|
|
18
|
-
const context = React.useContext(DrawerContext)
|
|
18
|
+
const context = React.useContext(DrawerContext)
|
|
19
19
|
|
|
20
20
|
if (!context) {
|
|
21
|
-
throw new Error(
|
|
21
|
+
throw new Error('useDrawer must be used within a Drawer.')
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
return context
|
|
24
|
+
return context
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function Drawer({
|
|
28
28
|
modal = true,
|
|
29
29
|
showSwipeHandle = false,
|
|
30
30
|
snapPoints,
|
|
31
|
-
swipeDirection =
|
|
31
|
+
swipeDirection = 'down',
|
|
32
32
|
...props
|
|
33
33
|
}: DrawerPrimitive.Root.Props & {
|
|
34
|
-
showSwipeHandle?: boolean
|
|
34
|
+
showSwipeHandle?: boolean
|
|
35
35
|
}) {
|
|
36
|
-
const hasSnapPoints = snapPoints != null && snapPoints.length > 0
|
|
36
|
+
const hasSnapPoints = snapPoints != null && snapPoints.length > 0
|
|
37
37
|
const contextValue = React.useMemo(
|
|
38
38
|
() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
|
|
39
39
|
[hasSnapPoints, modal, showSwipeHandle, swipeDirection]
|
|
40
|
-
)
|
|
40
|
+
)
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
43
|
<DrawerContext.Provider value={contextValue}>
|
|
@@ -49,19 +49,19 @@ function Drawer({
|
|
|
49
49
|
{...props}
|
|
50
50
|
/>
|
|
51
51
|
</DrawerContext.Provider>
|
|
52
|
-
)
|
|
52
|
+
)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {
|
|
56
|
-
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props}
|
|
56
|
+
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {
|
|
60
|
-
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props}
|
|
60
|
+
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {
|
|
64
|
-
return <DrawerPrimitive.Close data-slot="drawer-close" {...props}
|
|
64
|
+
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
function DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props) {
|
|
@@ -69,35 +69,35 @@ function DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props)
|
|
|
69
69
|
<DrawerPrimitive.Backdrop
|
|
70
70
|
data-slot="drawer-overlay"
|
|
71
71
|
className={cn(
|
|
72
|
-
|
|
72
|
+
'fixed inset-0 z-[110] min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute',
|
|
73
73
|
className
|
|
74
74
|
)}
|
|
75
75
|
{...props}
|
|
76
76
|
/>
|
|
77
|
-
)
|
|
77
|
+
)
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
function DrawerSwipeHandle({ className, ...props }: React.ComponentProps<
|
|
80
|
+
function DrawerSwipeHandle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
81
81
|
return (
|
|
82
82
|
<div
|
|
83
83
|
data-slot="drawer-swipe-handle"
|
|
84
84
|
aria-hidden="true"
|
|
85
85
|
className={cn(
|
|
86
|
-
|
|
86
|
+
'relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-axis=y]/drawer-popup:justify-center group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:items-start after:block after:shrink-0 after:rounded-full after:bg-muted group-data-[swipe-axis=x]/drawer-popup:after:h-24 group-data-[swipe-axis=x]/drawer-popup:after:w-1 group-data-[swipe-axis=y]/drawer-popup:after:h-1 group-data-[swipe-axis=y]/drawer-popup:after:w-24 active:cursor-grabbing',
|
|
87
87
|
className
|
|
88
88
|
)}
|
|
89
89
|
{...props}
|
|
90
90
|
/>
|
|
91
|
-
)
|
|
91
|
+
)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
function DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.Props) {
|
|
95
|
-
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()
|
|
96
|
-
const swipeAxis = swipeDirection ===
|
|
95
|
+
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()
|
|
96
|
+
const swipeAxis = swipeDirection === 'down' || swipeDirection === 'up' ? 'y' : 'x'
|
|
97
97
|
|
|
98
98
|
return (
|
|
99
99
|
<DrawerPortal data-slot="drawer-portal">
|
|
100
|
-
{modal === true && <DrawerOverlay data-snap-points={hasSnapPoints ?
|
|
100
|
+
{modal === true && <DrawerOverlay data-snap-points={hasSnapPoints ? '' : undefined} />}
|
|
101
101
|
<DrawerPrimitive.Viewport
|
|
102
102
|
data-slot="drawer-viewport"
|
|
103
103
|
data-modal={modal}
|
|
@@ -106,32 +106,32 @@ function DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.
|
|
|
106
106
|
<DrawerPrimitive.Popup
|
|
107
107
|
data-slot="drawer-popup"
|
|
108
108
|
data-swipe-axis={swipeAxis}
|
|
109
|
-
data-snap-points={hasSnapPoints ?
|
|
109
|
+
data-snap-points={hasSnapPoints ? '' : undefined}
|
|
110
110
|
className={cn(
|
|
111
111
|
// Base.
|
|
112
|
-
|
|
112
|
+
'group/drawer-popup pointer-events-auto fixed z-[110] m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b',
|
|
113
113
|
// Nested.
|
|
114
|
-
|
|
114
|
+
'data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95',
|
|
115
115
|
// Bleed.
|
|
116
|
-
|
|
116
|
+
'after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full',
|
|
117
117
|
// Sizing.
|
|
118
|
-
|
|
118
|
+
'[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]',
|
|
119
119
|
// Stack.
|
|
120
|
-
|
|
120
|
+
'[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]',
|
|
121
121
|
// Transitions.
|
|
122
|
-
|
|
122
|
+
'data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]',
|
|
123
123
|
// Axis: y.
|
|
124
|
-
|
|
124
|
+
'data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)',
|
|
125
125
|
// Axis: x.
|
|
126
|
-
|
|
126
|
+
'data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row',
|
|
127
127
|
// Direction: down.
|
|
128
|
-
|
|
128
|
+
'data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]',
|
|
129
129
|
// Direction: up.
|
|
130
|
-
|
|
130
|
+
'data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]',
|
|
131
131
|
// Direction: left.
|
|
132
|
-
|
|
132
|
+
'data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]',
|
|
133
133
|
// Direction: right.
|
|
134
|
-
|
|
134
|
+
'data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]',
|
|
135
135
|
className
|
|
136
136
|
)}
|
|
137
137
|
{...props}
|
|
@@ -140,7 +140,7 @@ function DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.
|
|
|
140
140
|
<DrawerPrimitive.Content
|
|
141
141
|
data-slot="drawer-content"
|
|
142
142
|
className={cn(
|
|
143
|
-
|
|
143
|
+
'flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none'
|
|
144
144
|
)}
|
|
145
145
|
>
|
|
146
146
|
{children}
|
|
@@ -148,50 +148,50 @@ function DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.
|
|
|
148
148
|
</DrawerPrimitive.Popup>
|
|
149
149
|
</DrawerPrimitive.Viewport>
|
|
150
150
|
</DrawerPortal>
|
|
151
|
-
)
|
|
151
|
+
)
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
function DrawerHeader({ className, ...props }: React.ComponentProps<
|
|
154
|
+
function DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
155
155
|
return (
|
|
156
156
|
<div
|
|
157
157
|
data-slot="drawer-header"
|
|
158
158
|
className={cn(
|
|
159
|
-
|
|
159
|
+
'flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0.5 md:text-left',
|
|
160
160
|
className
|
|
161
161
|
)}
|
|
162
162
|
{...props}
|
|
163
163
|
/>
|
|
164
|
-
)
|
|
164
|
+
)
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
function DrawerFooter({ className, ...props }: React.ComponentProps<
|
|
167
|
+
function DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
168
168
|
return (
|
|
169
169
|
<div
|
|
170
170
|
data-slot="drawer-footer"
|
|
171
|
-
className={cn(
|
|
171
|
+
className={cn('mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0', className)}
|
|
172
172
|
{...props}
|
|
173
173
|
/>
|
|
174
|
-
)
|
|
174
|
+
)
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {
|
|
178
178
|
return (
|
|
179
179
|
<DrawerPrimitive.Title
|
|
180
180
|
data-slot="drawer-title"
|
|
181
|
-
className={cn(
|
|
181
|
+
className={cn('text-base font-medium text-foreground', className)}
|
|
182
182
|
{...props}
|
|
183
183
|
/>
|
|
184
|
-
)
|
|
184
|
+
)
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
function DrawerDescription({ className, ...props }: DrawerPrimitive.Description.Props) {
|
|
188
188
|
return (
|
|
189
189
|
<DrawerPrimitive.Description
|
|
190
190
|
data-slot="drawer-description"
|
|
191
|
-
className={cn(
|
|
191
|
+
className={cn('text-sm text-balance text-muted-foreground', className)}
|
|
192
192
|
{...props}
|
|
193
193
|
/>
|
|
194
|
-
)
|
|
194
|
+
)
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
export {
|
|
@@ -206,4 +206,4 @@ export {
|
|
|
206
206
|
DrawerFooter,
|
|
207
207
|
DrawerTitle,
|
|
208
208
|
DrawerDescription,
|
|
209
|
-
}
|
|
209
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { Menu as MenuPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { ChevronRightIcon, CheckIcon } from
|
|
6
|
+
import { cn } from '#lib/utils'
|
|
7
|
+
import { ChevronRightIcon, CheckIcon } from 'lucide-react'
|
|
8
8
|
|
|
9
9
|
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
10
|
-
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props}
|
|
10
|
+
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
|
|
14
|
-
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props}
|
|
14
|
+
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
|
|
18
|
-
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props}
|
|
18
|
+
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function DropdownMenuContent({
|
|
22
|
-
align =
|
|
22
|
+
align = 'start',
|
|
23
23
|
alignOffset = 0,
|
|
24
|
-
side =
|
|
24
|
+
side = 'bottom',
|
|
25
25
|
sideOffset = 4,
|
|
26
26
|
className,
|
|
27
27
|
...props
|
|
28
28
|
}: MenuPrimitive.Popup.Props &
|
|
29
|
-
Pick<MenuPrimitive.Positioner.Props,
|
|
29
|
+
Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {
|
|
30
30
|
return (
|
|
31
31
|
<MenuPrimitive.Portal>
|
|
32
32
|
<MenuPrimitive.Positioner
|
|
@@ -39,18 +39,18 @@ function DropdownMenuContent({
|
|
|
39
39
|
<MenuPrimitive.Popup
|
|
40
40
|
data-slot="dropdown-menu-content"
|
|
41
41
|
className={cn(
|
|
42
|
-
|
|
42
|
+
'z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
43
43
|
className
|
|
44
44
|
)}
|
|
45
45
|
{...props}
|
|
46
46
|
/>
|
|
47
47
|
</MenuPrimitive.Positioner>
|
|
48
48
|
</MenuPrimitive.Portal>
|
|
49
|
-
)
|
|
49
|
+
)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
|
|
53
|
-
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props}
|
|
53
|
+
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
function DropdownMenuLabel({
|
|
@@ -58,29 +58,29 @@ function DropdownMenuLabel({
|
|
|
58
58
|
inset,
|
|
59
59
|
...props
|
|
60
60
|
}: MenuPrimitive.GroupLabel.Props & {
|
|
61
|
-
inset?: boolean
|
|
61
|
+
inset?: boolean
|
|
62
62
|
}) {
|
|
63
63
|
return (
|
|
64
64
|
<MenuPrimitive.GroupLabel
|
|
65
65
|
data-slot="dropdown-menu-label"
|
|
66
66
|
data-inset={inset}
|
|
67
67
|
className={cn(
|
|
68
|
-
|
|
68
|
+
'px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7',
|
|
69
69
|
className
|
|
70
70
|
)}
|
|
71
71
|
{...props}
|
|
72
72
|
/>
|
|
73
|
-
)
|
|
73
|
+
)
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function DropdownMenuItem({
|
|
77
77
|
className,
|
|
78
78
|
inset,
|
|
79
|
-
variant =
|
|
79
|
+
variant = 'default',
|
|
80
80
|
...props
|
|
81
81
|
}: MenuPrimitive.Item.Props & {
|
|
82
|
-
inset?: boolean
|
|
83
|
-
variant?:
|
|
82
|
+
inset?: boolean
|
|
83
|
+
variant?: 'default' | 'destructive'
|
|
84
84
|
}) {
|
|
85
85
|
return (
|
|
86
86
|
<MenuPrimitive.Item
|
|
@@ -93,11 +93,11 @@ function DropdownMenuItem({
|
|
|
93
93
|
)}
|
|
94
94
|
{...props}
|
|
95
95
|
/>
|
|
96
|
-
)
|
|
96
|
+
)
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
|
|
100
|
-
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props}
|
|
100
|
+
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
function DropdownMenuSubTrigger({
|
|
@@ -106,7 +106,7 @@ function DropdownMenuSubTrigger({
|
|
|
106
106
|
children,
|
|
107
107
|
...props
|
|
108
108
|
}: MenuPrimitive.SubmenuTrigger.Props & {
|
|
109
|
-
inset?: boolean
|
|
109
|
+
inset?: boolean
|
|
110
110
|
}) {
|
|
111
111
|
return (
|
|
112
112
|
<MenuPrimitive.SubmenuTrigger
|
|
@@ -121,13 +121,13 @@ function DropdownMenuSubTrigger({
|
|
|
121
121
|
{children}
|
|
122
122
|
<ChevronRightIcon className="ml-auto" />
|
|
123
123
|
</MenuPrimitive.SubmenuTrigger>
|
|
124
|
-
)
|
|
124
|
+
)
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
function DropdownMenuSubContent({
|
|
128
|
-
align =
|
|
128
|
+
align = 'start',
|
|
129
129
|
alignOffset = -3,
|
|
130
|
-
side =
|
|
130
|
+
side = 'right',
|
|
131
131
|
sideOffset = 0,
|
|
132
132
|
className,
|
|
133
133
|
...props
|
|
@@ -136,7 +136,7 @@ function DropdownMenuSubContent({
|
|
|
136
136
|
<DropdownMenuContent
|
|
137
137
|
data-slot="dropdown-menu-sub-content"
|
|
138
138
|
className={cn(
|
|
139
|
-
|
|
139
|
+
'w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
140
140
|
className
|
|
141
141
|
)}
|
|
142
142
|
align={align}
|
|
@@ -145,7 +145,7 @@ function DropdownMenuSubContent({
|
|
|
145
145
|
sideOffset={sideOffset}
|
|
146
146
|
{...props}
|
|
147
147
|
/>
|
|
148
|
-
)
|
|
148
|
+
)
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
function DropdownMenuCheckboxItem({
|
|
@@ -155,7 +155,7 @@ function DropdownMenuCheckboxItem({
|
|
|
155
155
|
inset,
|
|
156
156
|
...props
|
|
157
157
|
}: MenuPrimitive.CheckboxItem.Props & {
|
|
158
|
-
inset?: boolean
|
|
158
|
+
inset?: boolean
|
|
159
159
|
}) {
|
|
160
160
|
return (
|
|
161
161
|
<MenuPrimitive.CheckboxItem
|
|
@@ -178,11 +178,11 @@ function DropdownMenuCheckboxItem({
|
|
|
178
178
|
</span>
|
|
179
179
|
{children}
|
|
180
180
|
</MenuPrimitive.CheckboxItem>
|
|
181
|
-
)
|
|
181
|
+
)
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
185
|
-
return <MenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props}
|
|
185
|
+
return <MenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
function DropdownMenuRadioItem({
|
|
@@ -191,7 +191,7 @@ function DropdownMenuRadioItem({
|
|
|
191
191
|
inset,
|
|
192
192
|
...props
|
|
193
193
|
}: MenuPrimitive.RadioItem.Props & {
|
|
194
|
-
inset?: boolean
|
|
194
|
+
inset?: boolean
|
|
195
195
|
}) {
|
|
196
196
|
return (
|
|
197
197
|
<MenuPrimitive.RadioItem
|
|
@@ -213,30 +213,30 @@ function DropdownMenuRadioItem({
|
|
|
213
213
|
</span>
|
|
214
214
|
{children}
|
|
215
215
|
</MenuPrimitive.RadioItem>
|
|
216
|
-
)
|
|
216
|
+
)
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props) {
|
|
220
220
|
return (
|
|
221
221
|
<MenuPrimitive.Separator
|
|
222
222
|
data-slot="dropdown-menu-separator"
|
|
223
|
-
className={cn(
|
|
223
|
+
className={cn('-mx-1 my-1 h-px bg-border', className)}
|
|
224
224
|
{...props}
|
|
225
225
|
/>
|
|
226
|
-
)
|
|
226
|
+
)
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<
|
|
229
|
+
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
230
230
|
return (
|
|
231
231
|
<span
|
|
232
232
|
data-slot="dropdown-menu-shortcut"
|
|
233
233
|
className={cn(
|
|
234
|
-
|
|
234
|
+
'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',
|
|
235
235
|
className
|
|
236
236
|
)}
|
|
237
237
|
{...props}
|
|
238
238
|
/>
|
|
239
|
-
)
|
|
239
|
+
)
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
export {
|
|
@@ -255,4 +255,4 @@ export {
|
|
|
255
255
|
DropdownMenuSub,
|
|
256
256
|
DropdownMenuSubTrigger,
|
|
257
257
|
DropdownMenuSubContent,
|
|
258
|
-
}
|
|
258
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { cva, type VariantProps } from
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
2
|
|
|
3
|
-
import { cn } from
|
|
3
|
+
import { cn } from '#lib/utils'
|
|
4
4
|
|
|
5
|
-
function Empty({ className, ...props }: React.ComponentProps<
|
|
5
|
+
function Empty({ className, ...props }: React.ComponentProps<'div'>) {
|
|
6
6
|
return (
|
|
7
7
|
<div
|
|
8
8
|
data-slot="empty"
|
|
9
9
|
className={cn(
|
|
10
|
-
|
|
10
|
+
'flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance',
|
|
11
11
|
className
|
|
12
12
|
)}
|
|
13
13
|
{...props}
|
|
14
14
|
/>
|
|
15
|
-
)
|
|
15
|
+
)
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function EmptyHeader({ className, ...props }: React.ComponentProps<
|
|
18
|
+
function EmptyHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
19
19
|
return (
|
|
20
20
|
<div
|
|
21
21
|
data-slot="empty-header"
|
|
22
|
-
className={cn(
|
|
22
|
+
className={cn('flex max-w-sm flex-col items-center gap-2', className)}
|
|
23
23
|
{...props}
|
|
24
24
|
/>
|
|
25
|
-
)
|
|
25
|
+
)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const emptyMediaVariants = cva(
|
|
29
|
-
|
|
29
|
+
'mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
30
30
|
{
|
|
31
31
|
variants: {
|
|
32
32
|
variant: {
|
|
33
|
-
default:
|
|
33
|
+
default: 'bg-transparent',
|
|
34
34
|
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|
|
38
|
-
variant:
|
|
38
|
+
variant: 'default',
|
|
39
39
|
},
|
|
40
40
|
}
|
|
41
|
-
)
|
|
41
|
+
)
|
|
42
42
|
|
|
43
43
|
function EmptyMedia({
|
|
44
44
|
className,
|
|
45
|
-
variant =
|
|
45
|
+
variant = 'default',
|
|
46
46
|
...props
|
|
47
|
-
}: React.ComponentProps<
|
|
47
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>) {
|
|
48
48
|
return (
|
|
49
49
|
<div
|
|
50
50
|
data-slot="empty-icon"
|
|
@@ -52,43 +52,43 @@ function EmptyMedia({
|
|
|
52
52
|
className={cn(emptyMediaVariants({ variant, className }))}
|
|
53
53
|
{...props}
|
|
54
54
|
/>
|
|
55
|
-
)
|
|
55
|
+
)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
function EmptyTitle({ className, ...props }: React.ComponentProps<
|
|
58
|
+
function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
59
59
|
return (
|
|
60
60
|
<div
|
|
61
61
|
data-slot="empty-title"
|
|
62
|
-
className={cn(
|
|
62
|
+
className={cn('text-sm font-medium tracking-tight', className)}
|
|
63
63
|
{...props}
|
|
64
64
|
/>
|
|
65
|
-
)
|
|
65
|
+
)
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
function EmptyDescription({ className, ...props }: React.ComponentProps<
|
|
68
|
+
function EmptyDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
69
69
|
return (
|
|
70
70
|
<div
|
|
71
71
|
data-slot="empty-description"
|
|
72
72
|
className={cn(
|
|
73
|
-
|
|
73
|
+
'text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
|
|
74
74
|
className
|
|
75
75
|
)}
|
|
76
76
|
{...props}
|
|
77
77
|
/>
|
|
78
|
-
)
|
|
78
|
+
)
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
function EmptyContent({ className, ...props }: React.ComponentProps<
|
|
81
|
+
function EmptyContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
82
82
|
return (
|
|
83
83
|
<div
|
|
84
84
|
data-slot="empty-content"
|
|
85
85
|
className={cn(
|
|
86
|
-
|
|
86
|
+
'flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance',
|
|
87
87
|
className
|
|
88
88
|
)}
|
|
89
89
|
{...props}
|
|
90
90
|
/>
|
|
91
|
-
)
|
|
91
|
+
)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia }
|
|
94
|
+
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia }
|