@stagewise/ui 0.1.0 → 0.2.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/README.md +9 -3
- package/package.json +9 -15
- package/src/components/ui/accordion.tsx +13 -15
- package/src/components/ui/alert-dialog.tsx +38 -38
- package/src/components/ui/alert.tsx +22 -22
- package/src/components/ui/aspect-ratio.tsx +6 -6
- package/src/components/ui/avatar.tsx +30 -30
- package/src/components/ui/badge.tsx +24 -22
- package/src/components/ui/breadcrumb.tsx +34 -37
- package/src/components/ui/bubble.tsx +48 -48
- package/src/components/ui/button-group.tsx +24 -24
- package/src/components/ui/button.tsx +24 -24
- package/src/components/ui/calendar.tsx +94 -81
- package/src/components/ui/card.tsx +30 -30
- package/src/components/ui/carousel.tsx +95 -92
- package/src/components/ui/chart.tsx +110 -110
- package/src/components/ui/checkbox.tsx +9 -10
- package/src/components/ui/collapsible.tsx +5 -5
- package/src/components/ui/combobox.tsx +51 -44
- package/src/components/ui/command.tsx +173 -190
- package/src/components/ui/context-menu.tsx +60 -50
- package/src/components/ui/dialog.tsx +33 -34
- package/src/components/ui/direction.tsx +1 -1
- package/src/components/ui/drawer.tsx +61 -61
- package/src/components/ui/dropdown-menu.tsx +54 -50
- package/src/components/ui/empty.tsx +30 -30
- package/src/components/ui/field.tsx +64 -64
- package/src/components/ui/hover-card.tsx +12 -12
- package/src/components/ui/input-group.tsx +54 -54
- package/src/components/ui/input-otp.tsx +24 -25
- package/src/components/ui/input.tsx +8 -8
- package/src/components/ui/item.tsx +64 -64
- package/src/components/ui/kbd.tsx +8 -8
- package/src/components/ui/klex-logo-combo.tsx +69 -0
- package/src/components/ui/klex-logo-text.tsx +70 -0
- package/src/components/ui/klex-logo.tsx +146 -0
- package/src/components/ui/label.tsx +8 -8
- package/src/components/ui/marker.tsx +25 -25
- package/src/components/ui/menubar.tsx +54 -50
- package/src/components/ui/message-scroller.tsx +130 -0
- package/src/components/ui/message.tsx +27 -27
- package/src/components/ui/native-select.tsx +22 -18
- package/src/components/ui/navigation-menu.tsx +37 -34
- package/src/components/ui/pagination.tsx +34 -31
- package/src/components/ui/popover.tsx +19 -19
- package/src/components/ui/progress.tsx +16 -16
- package/src/components/ui/questionnaire.tsx +72 -69
- package/src/components/ui/radio-group.tsx +9 -9
- package/src/components/ui/resizable.tsx +19 -12
- package/src/components/ui/scroll-area.tsx +10 -10
- package/src/components/ui/select.tsx +39 -34
- package/src/components/ui/separator.tsx +7 -7
- package/src/components/ui/sheet.tsx +31 -32
- package/src/components/ui/sidebar.tsx +244 -232
- package/src/components/ui/skeleton.tsx +5 -5
- package/src/components/ui/slider.tsx +11 -7
- package/src/components/ui/spinner.tsx +15 -6
- package/src/components/ui/stagewise-logo-combo.tsx +43 -0
- package/src/components/ui/stagewise-logo-text.tsx +30 -0
- package/src/components/ui/stagewise-logo.tsx +42 -0
- package/src/components/ui/switch.tsx +9 -9
- package/src/components/ui/table.tsx +31 -31
- package/src/components/ui/tabs.tsx +37 -26
- package/src/components/ui/textarea.tsx +7 -7
- package/src/components/ui/toast.tsx +70 -70
- package/src/components/ui/toggle-group.tsx +26 -26
- package/src/components/ui/toggle.tsx +15 -15
- package/src/components/ui/tooltip.tsx +13 -13
- package/src/hooks/use-mobile.ts +13 -11
- package/src/icons/custom/ui-outline-18/IconKlexOutline18.tsx +39 -0
- package/src/icons/custom/ui-outline-18/IconLaptop.tsx +35 -0
- package/src/icons/custom/ui-outline-18/IconSignOut.tsx +33 -0
- package/src/icons/custom/ui-outline-18/index.ts +4 -1
- package/src/icons/index.ts +42 -20
- package/src/icons/nucleo/social-media/IconMicrosoftEntraId.tsx +56 -0
- package/src/icons/nucleo/social-media/index.ts +1 -0
- package/src/icons/nucleo/ui-outline-18/IconArrowDownOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconArrowTurnRightOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconArrowUpOutline18.tsx +35 -0
- package/src/icons/nucleo/ui-outline-18/IconChartPieOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconChevronMaximizeDiagonal2Outline18.tsx +33 -0
- package/src/icons/nucleo/ui-outline-18/IconChevronUpOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconEmptyOutline18.tsx +41 -0
- package/src/icons/nucleo/ui-outline-18/IconEyeOffOutline18.tsx +18 -0
- package/src/icons/nucleo/ui-outline-18/IconLinkBrokenOutline18.tsx +66 -0
- package/src/icons/nucleo/ui-outline-18/IconLock18Outline.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconMinusOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconMsgs2Outline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconPanelLeftOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconSidebarLeft2HideOutline18.tsx +63 -0
- package/src/icons/nucleo/ui-outline-18/IconSidebarRight2HideOutline18.tsx +63 -0
- package/src/icons/nucleo/ui-outline-18/index.ts +11 -1
- package/src/icons/provider/IconAnthropic.tsx +15 -0
- package/src/icons/provider/IconCodex.tsx +18 -0
- package/src/icons/provider/IconDiscord.tsx +17 -0
- package/src/icons/provider/IconGemini.tsx +152 -0
- package/src/icons/provider/IconLinear.tsx +9 -0
- package/src/icons/provider/IconOpenAI.tsx +15 -0
- package/src/icons/provider/IconOpenRouter.tsx +24 -0
- package/src/icons/provider/IconSlack.tsx +24 -0
- package/src/icons/provider/IconTelegram.tsx +29 -0
- package/src/icons/provider/IconWhatsapp.tsx +14 -0
- package/src/icons/provider/LICENSE +21 -0
- package/src/icons/provider/index.ts +10 -0
- package/src/index.ts +68 -61
- package/src/lib/utils.ts +3 -3
- package/src/styles/bridge.css +7 -3
- package/src/styles/derived-utilities.css +129 -50
- package/src/styles/index.css +17 -2
- package/src/styles/palette.css +266 -105
- package/src/styles/scroll-fade.css +116 -0
- package/src/styles/tailwind-tokens.css +3 -0
- package/src/styles/theme.css +57 -43
|
@@ -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
|
-
[hasSnapPoints, modal, showSwipeHandle, swipeDirection]
|
|
40
|
-
)
|
|
39
|
+
[hasSnapPoints, modal, showSwipeHandle, swipeDirection],
|
|
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({
|
|
@@ -72,29 +72,29 @@ function DrawerOverlay({
|
|
|
72
72
|
<DrawerPrimitive.Backdrop
|
|
73
73
|
data-slot="drawer-overlay"
|
|
74
74
|
className={cn(
|
|
75
|
-
|
|
76
|
-
className
|
|
75
|
+
'fixed inset-0 z-50 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',
|
|
76
|
+
className,
|
|
77
77
|
)}
|
|
78
78
|
{...props}
|
|
79
79
|
/>
|
|
80
|
-
)
|
|
80
|
+
);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
function DrawerSwipeHandle({
|
|
84
84
|
className,
|
|
85
85
|
...props
|
|
86
|
-
}: React.ComponentProps<
|
|
86
|
+
}: React.ComponentProps<'div'>) {
|
|
87
87
|
return (
|
|
88
88
|
<div
|
|
89
89
|
data-slot="drawer-swipe-handle"
|
|
90
90
|
aria-hidden="true"
|
|
91
91
|
className={cn(
|
|
92
|
-
|
|
93
|
-
className
|
|
92
|
+
'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',
|
|
93
|
+
className,
|
|
94
94
|
)}
|
|
95
95
|
{...props}
|
|
96
96
|
/>
|
|
97
|
-
)
|
|
97
|
+
);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
function DrawerContent({
|
|
@@ -102,14 +102,14 @@ function DrawerContent({
|
|
|
102
102
|
children,
|
|
103
103
|
...props
|
|
104
104
|
}: DrawerPrimitive.Popup.Props) {
|
|
105
|
-
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()
|
|
105
|
+
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();
|
|
106
106
|
const swipeAxis =
|
|
107
|
-
swipeDirection ===
|
|
107
|
+
swipeDirection === 'down' || swipeDirection === 'up' ? 'y' : 'x';
|
|
108
108
|
|
|
109
109
|
return (
|
|
110
110
|
<DrawerPortal data-slot="drawer-portal">
|
|
111
111
|
{modal === true && (
|
|
112
|
-
<DrawerOverlay data-snap-points={hasSnapPoints ?
|
|
112
|
+
<DrawerOverlay data-snap-points={hasSnapPoints ? '' : undefined} />
|
|
113
113
|
)}
|
|
114
114
|
<DrawerPrimitive.Viewport
|
|
115
115
|
data-slot="drawer-viewport"
|
|
@@ -119,33 +119,33 @@ function DrawerContent({
|
|
|
119
119
|
<DrawerPrimitive.Popup
|
|
120
120
|
data-slot="drawer-popup"
|
|
121
121
|
data-swipe-axis={swipeAxis}
|
|
122
|
-
data-snap-points={hasSnapPoints ?
|
|
122
|
+
data-snap-points={hasSnapPoints ? '' : undefined}
|
|
123
123
|
className={cn(
|
|
124
124
|
// Base.
|
|
125
|
-
|
|
125
|
+
'group/drawer-popup pointer-events-auto fixed z-50 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',
|
|
126
126
|
// Nested.
|
|
127
|
-
|
|
127
|
+
'data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95',
|
|
128
128
|
// Bleed.
|
|
129
|
-
|
|
129
|
+
'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',
|
|
130
130
|
// Sizing.
|
|
131
|
-
|
|
131
|
+
'[--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]',
|
|
132
132
|
// Stack.
|
|
133
|
-
|
|
133
|
+
'[--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]',
|
|
134
134
|
// Transitions.
|
|
135
|
-
|
|
135
|
+
'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)]',
|
|
136
136
|
// Axis: y.
|
|
137
|
-
|
|
137
|
+
'data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)',
|
|
138
138
|
// Axis: x.
|
|
139
|
-
|
|
139
|
+
'data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row',
|
|
140
140
|
// Direction: down.
|
|
141
|
-
|
|
141
|
+
'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)))]',
|
|
142
142
|
// Direction: up.
|
|
143
|
-
|
|
143
|
+
'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)))]',
|
|
144
144
|
// Direction: left.
|
|
145
|
-
|
|
145
|
+
'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%))]',
|
|
146
146
|
// Direction: right.
|
|
147
|
-
|
|
148
|
-
className
|
|
147
|
+
'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%))]',
|
|
148
|
+
className,
|
|
149
149
|
)}
|
|
150
150
|
{...props}
|
|
151
151
|
>
|
|
@@ -153,7 +153,7 @@ function DrawerContent({
|
|
|
153
153
|
<DrawerPrimitive.Content
|
|
154
154
|
data-slot="drawer-content"
|
|
155
155
|
className={cn(
|
|
156
|
-
|
|
156
|
+
'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',
|
|
157
157
|
)}
|
|
158
158
|
>
|
|
159
159
|
{children}
|
|
@@ -161,30 +161,30 @@ function DrawerContent({
|
|
|
161
161
|
</DrawerPrimitive.Popup>
|
|
162
162
|
</DrawerPrimitive.Viewport>
|
|
163
163
|
</DrawerPortal>
|
|
164
|
-
)
|
|
164
|
+
);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
function DrawerHeader({ className, ...props }: React.ComponentProps<
|
|
167
|
+
function DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
168
168
|
return (
|
|
169
169
|
<div
|
|
170
170
|
data-slot="drawer-header"
|
|
171
171
|
className={cn(
|
|
172
|
-
|
|
173
|
-
className
|
|
172
|
+
'flex shrink-0 flex-col gap-0 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0 md:text-left',
|
|
173
|
+
className,
|
|
174
174
|
)}
|
|
175
175
|
{...props}
|
|
176
176
|
/>
|
|
177
|
-
)
|
|
177
|
+
);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
function DrawerFooter({ className, ...props }: React.ComponentProps<
|
|
180
|
+
function DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
181
181
|
return (
|
|
182
182
|
<div
|
|
183
183
|
data-slot="drawer-footer"
|
|
184
|
-
className={cn(
|
|
184
|
+
className={cn('mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0', className)}
|
|
185
185
|
{...props}
|
|
186
186
|
/>
|
|
187
|
-
)
|
|
187
|
+
);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {
|
|
@@ -192,12 +192,12 @@ function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {
|
|
|
192
192
|
<DrawerPrimitive.Title
|
|
193
193
|
data-slot="drawer-title"
|
|
194
194
|
className={cn(
|
|
195
|
-
|
|
196
|
-
className
|
|
195
|
+
'font-heading text-base font-medium text-foreground',
|
|
196
|
+
className,
|
|
197
197
|
)}
|
|
198
198
|
{...props}
|
|
199
199
|
/>
|
|
200
|
-
)
|
|
200
|
+
);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
function DrawerDescription({
|
|
@@ -207,10 +207,10 @@ function DrawerDescription({
|
|
|
207
207
|
return (
|
|
208
208
|
<DrawerPrimitive.Description
|
|
209
209
|
data-slot="drawer-description"
|
|
210
|
-
className={cn(
|
|
210
|
+
className={cn('text-sm text-balance text-muted-foreground', className)}
|
|
211
211
|
{...props}
|
|
212
212
|
/>
|
|
213
|
-
)
|
|
213
|
+
);
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
export {
|
|
@@ -225,4 +225,4 @@ export {
|
|
|
225
225
|
DrawerFooter,
|
|
226
226
|
DrawerTitle,
|
|
227
227
|
DrawerDescription,
|
|
228
|
-
}
|
|
228
|
+
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { Menu as MenuPrimitive } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
5
|
-
import { IconChevronRightOutline18, IconCheckOutline18 } from
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { IconChevronRightOutline18, IconCheckOutline18 } from '../../icons';
|
|
6
6
|
|
|
7
7
|
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
8
|
-
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props}
|
|
8
|
+
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
|
|
12
|
-
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props}
|
|
12
|
+
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
|
|
16
|
-
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props}
|
|
16
|
+
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function DropdownMenuContent({
|
|
20
|
-
align =
|
|
20
|
+
align = 'start',
|
|
21
21
|
alignOffset = 0,
|
|
22
|
-
side =
|
|
22
|
+
side = 'bottom',
|
|
23
23
|
sideOffset = 4,
|
|
24
24
|
className,
|
|
25
25
|
...props
|
|
26
26
|
}: MenuPrimitive.Popup.Props &
|
|
27
27
|
Pick<
|
|
28
28
|
MenuPrimitive.Positioner.Props,
|
|
29
|
-
|
|
29
|
+
'align' | 'alignOffset' | 'side' | 'sideOffset'
|
|
30
30
|
>) {
|
|
31
31
|
return (
|
|
32
32
|
<MenuPrimitive.Portal>
|
|
@@ -39,46 +39,49 @@ function DropdownMenuContent({
|
|
|
39
39
|
>
|
|
40
40
|
<MenuPrimitive.Popup
|
|
41
41
|
data-slot="dropdown-menu-content"
|
|
42
|
-
className={cn(
|
|
42
|
+
className={cn(
|
|
43
|
+
'z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 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:fade-out-0 data-closed:zoom-out-95 relative bg-popover **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
43
46
|
{...props}
|
|
44
47
|
/>
|
|
45
48
|
</MenuPrimitive.Positioner>
|
|
46
49
|
</MenuPrimitive.Portal>
|
|
47
|
-
)
|
|
50
|
+
);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
|
|
51
|
-
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props}
|
|
54
|
+
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
function DropdownMenuLabel({
|
|
55
58
|
className,
|
|
56
59
|
inset,
|
|
57
60
|
...props
|
|
58
|
-
}: React.ComponentProps<
|
|
59
|
-
inset?: boolean
|
|
61
|
+
}: React.ComponentProps<'div'> & {
|
|
62
|
+
inset?: boolean;
|
|
60
63
|
}) {
|
|
61
64
|
return (
|
|
62
65
|
<div
|
|
63
66
|
data-slot="dropdown-menu-label"
|
|
64
67
|
data-inset={inset}
|
|
65
68
|
className={cn(
|
|
66
|
-
|
|
67
|
-
className
|
|
69
|
+
'px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7',
|
|
70
|
+
className,
|
|
68
71
|
)}
|
|
69
72
|
{...props}
|
|
70
73
|
/>
|
|
71
|
-
)
|
|
74
|
+
);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
function DropdownMenuItem({
|
|
75
78
|
className,
|
|
76
79
|
inset,
|
|
77
|
-
variant =
|
|
80
|
+
variant = 'default',
|
|
78
81
|
...props
|
|
79
82
|
}: MenuPrimitive.Item.Props & {
|
|
80
|
-
inset?: boolean
|
|
81
|
-
variant?:
|
|
83
|
+
inset?: boolean;
|
|
84
|
+
variant?: 'default' | 'destructive';
|
|
82
85
|
}) {
|
|
83
86
|
return (
|
|
84
87
|
<MenuPrimitive.Item
|
|
@@ -87,15 +90,15 @@ function DropdownMenuItem({
|
|
|
87
90
|
data-variant={variant}
|
|
88
91
|
className={cn(
|
|
89
92
|
"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 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 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
|
|
90
|
-
className
|
|
93
|
+
className,
|
|
91
94
|
)}
|
|
92
95
|
{...props}
|
|
93
96
|
/>
|
|
94
|
-
)
|
|
97
|
+
);
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
|
|
98
|
-
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props}
|
|
101
|
+
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />;
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
function DropdownMenuSubTrigger({
|
|
@@ -104,7 +107,7 @@ function DropdownMenuSubTrigger({
|
|
|
104
107
|
children,
|
|
105
108
|
...props
|
|
106
109
|
}: MenuPrimitive.SubmenuTrigger.Props & {
|
|
107
|
-
inset?: boolean
|
|
110
|
+
inset?: boolean;
|
|
108
111
|
}) {
|
|
109
112
|
return (
|
|
110
113
|
<MenuPrimitive.SubmenuTrigger
|
|
@@ -112,20 +115,20 @@ function DropdownMenuSubTrigger({
|
|
|
112
115
|
data-inset={inset}
|
|
113
116
|
className={cn(
|
|
114
117
|
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
115
|
-
className
|
|
118
|
+
className,
|
|
116
119
|
)}
|
|
117
120
|
{...props}
|
|
118
121
|
>
|
|
119
122
|
{children}
|
|
120
|
-
<IconChevronRightOutline18 className="ml-auto" />
|
|
123
|
+
<IconChevronRightOutline18 className="ml-auto size-3" />
|
|
121
124
|
</MenuPrimitive.SubmenuTrigger>
|
|
122
|
-
)
|
|
125
|
+
);
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
function DropdownMenuSubContent({
|
|
126
|
-
align =
|
|
129
|
+
align = 'start',
|
|
127
130
|
alignOffset = -3,
|
|
128
|
-
side =
|
|
131
|
+
side = 'right',
|
|
129
132
|
sideOffset = 0,
|
|
130
133
|
className,
|
|
131
134
|
...props
|
|
@@ -133,14 +136,17 @@ function DropdownMenuSubContent({
|
|
|
133
136
|
return (
|
|
134
137
|
<DropdownMenuContent
|
|
135
138
|
data-slot="dropdown-menu-sub-content"
|
|
136
|
-
className={cn(
|
|
139
|
+
className={cn(
|
|
140
|
+
'w-auto min-w-[96px] rounded-lg p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 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 relative bg-popover **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',
|
|
141
|
+
className,
|
|
142
|
+
)}
|
|
137
143
|
align={align}
|
|
138
144
|
alignOffset={alignOffset}
|
|
139
145
|
side={side}
|
|
140
146
|
sideOffset={sideOffset}
|
|
141
147
|
{...props}
|
|
142
148
|
/>
|
|
143
|
-
)
|
|
149
|
+
);
|
|
144
150
|
}
|
|
145
151
|
|
|
146
152
|
function DropdownMenuCheckboxItem({
|
|
@@ -150,7 +156,7 @@ function DropdownMenuCheckboxItem({
|
|
|
150
156
|
inset,
|
|
151
157
|
...props
|
|
152
158
|
}: MenuPrimitive.CheckboxItem.Props & {
|
|
153
|
-
inset?: boolean
|
|
159
|
+
inset?: boolean;
|
|
154
160
|
}) {
|
|
155
161
|
return (
|
|
156
162
|
<MenuPrimitive.CheckboxItem
|
|
@@ -158,7 +164,7 @@ function DropdownMenuCheckboxItem({
|
|
|
158
164
|
data-inset={inset}
|
|
159
165
|
className={cn(
|
|
160
166
|
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
161
|
-
className
|
|
167
|
+
className,
|
|
162
168
|
)}
|
|
163
169
|
checked={checked}
|
|
164
170
|
{...props}
|
|
@@ -168,13 +174,12 @@ function DropdownMenuCheckboxItem({
|
|
|
168
174
|
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
169
175
|
>
|
|
170
176
|
<MenuPrimitive.CheckboxItemIndicator>
|
|
171
|
-
<IconCheckOutline18
|
|
172
|
-
/>
|
|
177
|
+
<IconCheckOutline18 />
|
|
173
178
|
</MenuPrimitive.CheckboxItemIndicator>
|
|
174
179
|
</span>
|
|
175
180
|
{children}
|
|
176
181
|
</MenuPrimitive.CheckboxItem>
|
|
177
|
-
)
|
|
182
|
+
);
|
|
178
183
|
}
|
|
179
184
|
|
|
180
185
|
function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
@@ -183,7 +188,7 @@ function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
|
183
188
|
data-slot="dropdown-menu-radio-group"
|
|
184
189
|
{...props}
|
|
185
190
|
/>
|
|
186
|
-
)
|
|
191
|
+
);
|
|
187
192
|
}
|
|
188
193
|
|
|
189
194
|
function DropdownMenuRadioItem({
|
|
@@ -192,7 +197,7 @@ function DropdownMenuRadioItem({
|
|
|
192
197
|
inset,
|
|
193
198
|
...props
|
|
194
199
|
}: MenuPrimitive.RadioItem.Props & {
|
|
195
|
-
inset?: boolean
|
|
200
|
+
inset?: boolean;
|
|
196
201
|
}) {
|
|
197
202
|
return (
|
|
198
203
|
<MenuPrimitive.RadioItem
|
|
@@ -200,7 +205,7 @@ function DropdownMenuRadioItem({
|
|
|
200
205
|
data-inset={inset}
|
|
201
206
|
className={cn(
|
|
202
207
|
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
203
|
-
className
|
|
208
|
+
className,
|
|
204
209
|
)}
|
|
205
210
|
{...props}
|
|
206
211
|
>
|
|
@@ -209,13 +214,12 @@ function DropdownMenuRadioItem({
|
|
|
209
214
|
data-slot="dropdown-menu-radio-item-indicator"
|
|
210
215
|
>
|
|
211
216
|
<MenuPrimitive.RadioItemIndicator>
|
|
212
|
-
<IconCheckOutline18
|
|
213
|
-
/>
|
|
217
|
+
<IconCheckOutline18 />
|
|
214
218
|
</MenuPrimitive.RadioItemIndicator>
|
|
215
219
|
</span>
|
|
216
220
|
{children}
|
|
217
221
|
</MenuPrimitive.RadioItem>
|
|
218
|
-
)
|
|
222
|
+
);
|
|
219
223
|
}
|
|
220
224
|
|
|
221
225
|
function DropdownMenuSeparator({
|
|
@@ -225,26 +229,26 @@ function DropdownMenuSeparator({
|
|
|
225
229
|
return (
|
|
226
230
|
<MenuPrimitive.Separator
|
|
227
231
|
data-slot="dropdown-menu-separator"
|
|
228
|
-
className={cn(
|
|
232
|
+
className={cn('-mx-1 my-1 h-px bg-border', className)}
|
|
229
233
|
{...props}
|
|
230
234
|
/>
|
|
231
|
-
)
|
|
235
|
+
);
|
|
232
236
|
}
|
|
233
237
|
|
|
234
238
|
function DropdownMenuShortcut({
|
|
235
239
|
className,
|
|
236
240
|
...props
|
|
237
|
-
}: React.ComponentProps<
|
|
241
|
+
}: React.ComponentProps<'span'>) {
|
|
238
242
|
return (
|
|
239
243
|
<span
|
|
240
244
|
data-slot="dropdown-menu-shortcut"
|
|
241
245
|
className={cn(
|
|
242
|
-
|
|
243
|
-
className
|
|
246
|
+
'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',
|
|
247
|
+
className,
|
|
244
248
|
)}
|
|
245
249
|
{...props}
|
|
246
250
|
/>
|
|
247
|
-
)
|
|
251
|
+
);
|
|
248
252
|
}
|
|
249
253
|
|
|
250
254
|
export {
|
|
@@ -263,4 +267,4 @@ export {
|
|
|
263
267
|
DropdownMenuSub,
|
|
264
268
|
DropdownMenuSubTrigger,
|
|
265
269
|
DropdownMenuSubContent,
|
|
266
|
-
}
|
|
270
|
+
};
|