@vendure-io/ui 2.1.0 → 3.0.0-next.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/package.json +19 -5
- package/src/components/atoms/accordion.tsx +21 -6
- package/src/components/atoms/alert-dialog.tsx +31 -6
- package/src/components/atoms/alert.tsx +73 -13
- package/src/components/atoms/avatar.tsx +1 -1
- package/src/components/atoms/badge.tsx +7 -2
- package/src/components/atoms/breadcrumb.tsx +137 -4
- package/src/components/atoms/button-group.tsx +30 -6
- package/src/components/atoms/button.tsx +128 -18
- package/src/components/atoms/calendar.tsx +6 -6
- package/src/components/atoms/card.tsx +130 -16
- package/src/components/atoms/carousel.tsx +16 -9
- package/src/components/atoms/chart.tsx +87 -1
- package/src/components/atoms/checkbox.tsx +85 -7
- package/src/components/atoms/collapsible.tsx +2 -1
- package/src/components/atoms/combobox.tsx +147 -21
- package/src/components/atoms/command.tsx +414 -12
- package/src/components/atoms/context-menu.tsx +28 -23
- package/src/components/atoms/dialog.tsx +151 -29
- package/src/components/atoms/direction.tsx +23 -2
- package/src/components/atoms/drawer.tsx +15 -10
- package/src/components/atoms/dropdown-menu.tsx +43 -28
- package/src/components/atoms/empty.tsx +4 -0
- package/src/components/atoms/field.tsx +41 -15
- package/src/components/atoms/hover-card.tsx +61 -8
- package/src/components/atoms/input-group.tsx +17 -9
- package/src/components/atoms/input-otp.tsx +6 -6
- package/src/components/atoms/input.tsx +7 -1
- package/src/components/atoms/item.tsx +3 -3
- package/src/components/atoms/kbd.tsx +32 -3
- package/src/components/atoms/label-swap.tsx +82 -0
- package/src/components/atoms/label.tsx +1 -1
- package/src/components/atoms/menubar.tsx +28 -26
- package/src/components/atoms/native-select.tsx +3 -2
- package/src/components/atoms/navigation-menu.tsx +13 -8
- package/src/components/atoms/pagination.tsx +2 -2
- package/src/components/atoms/popover.tsx +23 -5
- package/src/components/atoms/progress.tsx +46 -33
- package/src/components/atoms/radio-group.tsx +9 -4
- package/src/components/atoms/resizable.tsx +1 -1
- package/src/components/atoms/scroll-area.tsx +2 -2
- package/src/components/atoms/select.tsx +258 -19
- package/src/components/atoms/sheet.tsx +59 -23
- package/src/components/atoms/sidebar.tsx +333 -23
- package/src/components/atoms/skeleton.tsx +1 -1
- package/src/components/atoms/slider.tsx +1 -1
- package/src/components/atoms/sonner.tsx +128 -38
- package/src/components/atoms/spinner.tsx +1 -1
- package/src/components/atoms/switch.tsx +10 -5
- package/src/components/atoms/table.tsx +147 -7
- package/src/components/atoms/tabs.tsx +3 -3
- package/src/components/atoms/textarea.tsx +3 -1
- package/src/components/atoms/toggle-group.tsx +4 -2
- package/src/components/atoms/toggle.tsx +28 -6
- package/src/components/atoms/tooltip.tsx +85 -15
- package/src/components/molecules/anonymized-token.tsx +24 -8
- package/src/components/molecules/app-shell.tsx +53 -20
- package/src/components/molecules/arrow-link.tsx +40 -0
- package/src/components/molecules/chip.tsx +2 -2
- package/src/components/molecules/code-block.tsx +54 -31
- package/src/components/molecules/collapsible-section.tsx +129 -0
- package/src/components/molecules/confirm-dialog.tsx +113 -9
- package/src/components/molecules/copyable-text.tsx +75 -11
- package/src/components/molecules/data-table/data-table-bulk-actions.tsx +32 -4
- package/src/components/molecules/data-table/data-table-column-header.tsx +20 -3
- package/src/components/molecules/data-table/data-table-filters.tsx +1 -1
- package/src/components/molecules/data-table/data-table-helpers.tsx +68 -1
- package/src/components/molecules/data-table/data-table-selection-storage.tsx +115 -0
- package/src/components/molecules/data-table/data-table-types.tsx +138 -4
- package/src/components/molecules/data-table/data-table-view-options.tsx +2 -2
- package/src/components/molecules/data-table/data-table.tsx +916 -84
- package/src/components/molecules/data-table/table-pagination.tsx +2 -2
- package/src/components/molecules/date-picker.tsx +13 -7
- package/src/components/molecules/date-range-picker.tsx +13 -6
- package/src/components/molecules/date-time-picker.tsx +13 -7
- package/src/components/molecules/date-time.tsx +8 -1
- package/src/components/molecules/direction-link.tsx +130 -0
- package/src/components/molecules/elapsed-time.tsx +223 -0
- package/src/components/molecules/file-dropzone.tsx +2 -2
- package/src/components/molecules/id-chip.tsx +169 -32
- package/src/components/molecules/inline-code.tsx +4 -0
- package/src/components/molecules/issued-secret.tsx +318 -0
- package/src/components/molecules/list-row.tsx +349 -0
- package/src/components/molecules/live-indicator.tsx +83 -0
- package/src/components/molecules/page-header.tsx +117 -5
- package/src/components/molecules/password-input.tsx +2 -2
- package/src/components/molecules/relative-time.tsx +85 -56
- package/src/components/molecules/search-trigger.tsx +127 -0
- package/src/components/molecules/secret-value.tsx +26 -9
- package/src/components/molecules/skip-link.tsx +1 -1
- package/src/components/molecules/stat-card.tsx +4 -4
- package/src/components/molecules/state-views/empty-state.tsx +35 -17
- package/src/components/molecules/state-views/error-state.tsx +32 -14
- package/src/components/molecules/status-badge.tsx +415 -49
- package/src/components/molecules/time-tooltip.tsx +140 -0
- package/src/components/molecules/timeline.tsx +246 -0
- package/src/components/molecules/visibility-icon.tsx +89 -0
- package/src/hooks/use-active-label-size.ts +32 -0
- package/src/hooks/use-pinned-height.ts +55 -0
- package/src/hooks/use-scrolled.ts +27 -0
- package/src/lib/content-inset.ts +17 -0
- package/src/lib/control-name.ts +55 -0
- package/src/lib/dialog-padding.ts +48 -0
- package/src/lib/field-surface.ts +31 -0
- package/src/lib/format-elapsed.ts +67 -0
- package/src/lib/format-relative.ts +29 -1
- package/src/lib/highlight.ts +3 -3
- package/src/lib/menu-item.tsx +72 -0
- package/src/lib/outline-edge.ts +21 -0
- package/src/lib/popup-align.ts +67 -0
- package/src/lib/popup-direction.ts +22 -0
- package/src/lib/popup-motion.ts +19 -0
- package/src/lib/state-dictionary.ts +42 -6
- package/src/lib/syntax-colors.ts +8 -0
- package/src/lib/tint-recipes.ts +68 -0
- package/src/lib/tone-icons.ts +24 -0
- package/src/lib/trigger-slot.ts +16 -0
- package/src/lib/utils.ts +104 -1
|
@@ -3,23 +3,38 @@
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"
|
|
5
5
|
|
|
6
|
+
import type { Tone } from "@vendure-io/ui/lib/state-dictionary"
|
|
6
7
|
import { cn } from "@vendure-io/ui/lib/utils"
|
|
7
8
|
import { Button } from "@vendure-io/ui/components/atoms/button"
|
|
8
9
|
import { XIcon } from "lucide-react"
|
|
10
|
+
import { usePopupDir } from "../../lib/popup-direction.ts"
|
|
11
|
+
import { dialogPaddingStyle } from "../../lib/dialog-padding.ts"
|
|
12
|
+
import { usePinnedHeight } from "../../hooks/use-pinned-height.ts"
|
|
13
|
+
import { triggerSlot } from "../../lib/trigger-slot.ts"
|
|
9
14
|
|
|
10
15
|
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
|
11
16
|
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
|
|
15
|
-
return <DialogPrimitive.Trigger
|
|
20
|
+
return <DialogPrimitive.Trigger {...triggerSlot("dialog-trigger", props.render)} {...props} />
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
|
|
19
24
|
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
20
25
|
}
|
|
21
26
|
|
|
27
|
+
// DialogClose and DialogFooter tell the content they are there, so a dialog
|
|
28
|
+
// without either shows the ✕ (DialogContent `showCloseButton`).
|
|
29
|
+
const DialogCloseControlContext = React.createContext<(() => () => void) | null>(null)
|
|
30
|
+
|
|
31
|
+
function useRegisterCloseControl() {
|
|
32
|
+
const register = React.useContext(DialogCloseControlContext)
|
|
33
|
+
React.useLayoutEffect(() => register?.(), [register])
|
|
34
|
+
}
|
|
35
|
+
|
|
22
36
|
function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
|
|
37
|
+
useRegisterCloseControl()
|
|
23
38
|
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
24
39
|
}
|
|
25
40
|
|
|
@@ -31,7 +46,7 @@ function DialogOverlay({
|
|
|
31
46
|
<DialogPrimitive.Backdrop
|
|
32
47
|
data-slot="dialog-overlay"
|
|
33
48
|
className={cn(
|
|
34
|
-
"
|
|
49
|
+
"fixed inset-0 isolate z-50 bg-scrim transition-opacity duration-dialog-scrim ease-soft data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:duration-dialog-exit supports-backdrop-filter:backdrop-blur-[2px]",
|
|
35
50
|
className
|
|
36
51
|
)}
|
|
37
52
|
{...props}
|
|
@@ -39,54 +54,116 @@ function DialogOverlay({
|
|
|
39
54
|
)
|
|
40
55
|
}
|
|
41
56
|
|
|
57
|
+
// Tells DialogHeader to host the close button, so the ✕ stays pinned with the
|
|
58
|
+
// header while the body scrolls.
|
|
59
|
+
const DialogCloseButtonContext = React.createContext(false)
|
|
60
|
+
|
|
61
|
+
function DialogCloseButton({ className }: { className?: string }) {
|
|
62
|
+
return (
|
|
63
|
+
<DialogPrimitive.Close
|
|
64
|
+
data-slot="dialog-close"
|
|
65
|
+
// top-4.5 centres the 28px button on the 24px first line of the title.
|
|
66
|
+
render={
|
|
67
|
+
<Button
|
|
68
|
+
variant="ghost"
|
|
69
|
+
className={cn("absolute top-4.5 end-3.5", className)}
|
|
70
|
+
size="icon-sm"
|
|
71
|
+
/>
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
<XIcon
|
|
75
|
+
/>
|
|
76
|
+
<span className="sr-only">Close</span>
|
|
77
|
+
</DialogPrimitive.Close>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
42
81
|
function DialogContent({
|
|
43
82
|
className,
|
|
44
83
|
children,
|
|
45
|
-
showCloseButton
|
|
84
|
+
showCloseButton,
|
|
85
|
+
overlayClassName,
|
|
86
|
+
style,
|
|
46
87
|
...props
|
|
47
88
|
}: DialogPrimitive.Popup.Props & {
|
|
89
|
+
/**
|
|
90
|
+
* Shows a ✕ in the top-right corner. Left out, the dialog shows it only
|
|
91
|
+
* when it holds no `DialogFooter` and no `DialogClose`: a dialog with a
|
|
92
|
+
* footer closes with its Cancel, Escape or a click on the backdrop, and a
|
|
93
|
+
* dialog without one still has a visible way to close. `true` or `false`
|
|
94
|
+
* wins over that.
|
|
95
|
+
*/
|
|
48
96
|
showCloseButton?: boolean
|
|
97
|
+
/** Classes for the backdrop behind the dialog, e.g. `bg-scrim-subtle`. */
|
|
98
|
+
overlayClassName?: string
|
|
49
99
|
}) {
|
|
100
|
+
const dir = usePopupDir()
|
|
101
|
+
const [closeControls, setCloseControls] = React.useState(0)
|
|
102
|
+
const registerCloseControl = React.useCallback(() => {
|
|
103
|
+
setCloseControls((count) => count + 1)
|
|
104
|
+
return () => setCloseControls((count) => count - 1)
|
|
105
|
+
}, [])
|
|
106
|
+
const showClose = showCloseButton ?? closeControls === 0
|
|
50
107
|
return (
|
|
51
108
|
<DialogPortal>
|
|
52
|
-
<DialogOverlay />
|
|
109
|
+
<DialogOverlay className={overlayClassName} />
|
|
110
|
+
{/* Enters from 4px below at 96%: opacity 200ms, scale and translate 240ms on the strong ease-out. Leaves to 98% (opacity 120ms on `ease`, scale 140ms on the strong ease-out). The scrim fades in 180ms and out in 140ms. Reduced motion keeps the fades. */}
|
|
111
|
+
{/* At most the viewport height less 1rem on each side. A taller dialog scrolls inside; DialogHeader and DialogFooter stick to its top and bottom edges. */}
|
|
112
|
+
{/* The padding is `--dialog-padding` (20px), and the pinned header and footer reach over it. Change the variable; a `p-*` or `px-*` class also sets it (dialogPaddingStyle). */}
|
|
113
|
+
{/* One column as wide as the space inside the padding: content wider than that shrinks or wraps inside it instead of widening the dialog past its padding. */}
|
|
114
|
+
{/* The scroll padding is the pinned header's and footer's measured heights plus 4px for a focus ring: a focused field scrolls clear of both. */}
|
|
53
115
|
<DialogPrimitive.Popup
|
|
116
|
+
dir={dir}
|
|
54
117
|
data-slot="dialog-content"
|
|
55
118
|
className={cn(
|
|
56
|
-
"bg-overlay
|
|
119
|
+
"group/dialog-content bg-overlay shadow-overlay fixed top-1/2 left-1/2 z-50 grid grid-cols-[minmax(0,1fr)] max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-5 overflow-y-auto overscroll-contain rounded-2xl [--dialog-padding:--spacing(5)] p-(--dialog-padding) [scroll-padding-block:calc(var(--pinned-header-height,0px)+--spacing(1))_calc(var(--pinned-footer-height,0px)+--spacing(1))] text-sm transition-[opacity,scale,translate] duration-[var(--transition-duration-normal),var(--transition-duration-dialog-enter),var(--transition-duration-dialog-enter)] ease-out data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:duration-[var(--transition-duration-quick),var(--transition-duration-dialog-exit),var(--transition-duration-dialog-exit)] data-ending-style:ease-[var(--ease-soft),var(--ease-out),var(--ease-out)] motion-safe:data-starting-style:scale-96 motion-safe:data-starting-style:translate-y-[calc(-50%+4px)] motion-safe:data-ending-style:scale-98 outline-none sm:max-w-110",
|
|
57
120
|
className
|
|
58
121
|
)}
|
|
122
|
+
style={dialogPaddingStyle(className, style)}
|
|
59
123
|
{...props}
|
|
60
124
|
>
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
size="icon-sm"
|
|
70
|
-
/>
|
|
71
|
-
}
|
|
72
|
-
>
|
|
73
|
-
<XIcon
|
|
74
|
-
/>
|
|
75
|
-
<span className="sr-only">Close</span>
|
|
76
|
-
</DialogPrimitive.Close>
|
|
125
|
+
<DialogCloseControlContext.Provider value={registerCloseControl}>
|
|
126
|
+
<DialogCloseButtonContext.Provider value={showClose}>
|
|
127
|
+
{children}
|
|
128
|
+
</DialogCloseButtonContext.Provider>
|
|
129
|
+
</DialogCloseControlContext.Provider>
|
|
130
|
+
{/* A dialog without a DialogHeader keeps the ✕ here, in the corner. */}
|
|
131
|
+
{showClose && (
|
|
132
|
+
<DialogCloseButton className="group-has-data-[slot=dialog-header]/dialog-content:hidden" />
|
|
77
133
|
)}
|
|
78
134
|
</DialogPrimitive.Popup>
|
|
79
135
|
</DialogPortal>
|
|
80
136
|
)
|
|
81
137
|
}
|
|
82
138
|
|
|
83
|
-
|
|
139
|
+
// The header and the footer reach over the dialog's padding (`--dialog-padding`)
|
|
140
|
+
// and 16px of the 20px gap beside them, with the dialog's surface behind, so a
|
|
141
|
+
// scrolled body passes under them and stays clear of their text. The 4px left
|
|
142
|
+
// of the gap keeps a field's focus ring visible. The margins cancel the
|
|
143
|
+
// paddings: a short dialog keeps its layout. The sticky offsets are negative
|
|
144
|
+
// because a sticky box sticks inside the scroll container's padding. Each
|
|
145
|
+
// measures its height for the content's scroll padding (usePinnedHeight).
|
|
146
|
+
const pinned = "sticky z-10 -mx-(--dialog-padding) bg-overlay px-(--dialog-padding)"
|
|
147
|
+
|
|
148
|
+
function DialogHeader({ className, children, ref, ...props }: React.ComponentProps<"div">) {
|
|
149
|
+
const showCloseButton = React.useContext(DialogCloseButtonContext)
|
|
150
|
+
const pinnedRef = usePinnedHeight("--pinned-header-height", "dialog-content", ref)
|
|
84
151
|
return (
|
|
85
152
|
<div
|
|
153
|
+
ref={pinnedRef}
|
|
86
154
|
data-slot="dialog-header"
|
|
87
|
-
className={cn(
|
|
155
|
+
className={cn(
|
|
156
|
+
pinned,
|
|
157
|
+
"-top-(--dialog-padding) -mt-(--dialog-padding) -mb-4 flex flex-col gap-2.5 pt-(--dialog-padding) pb-4",
|
|
158
|
+
// The text stops before the close button, so a long title wraps instead of running under it.
|
|
159
|
+
showCloseButton && "pe-14",
|
|
160
|
+
className
|
|
161
|
+
)}
|
|
88
162
|
{...props}
|
|
89
|
-
|
|
163
|
+
>
|
|
164
|
+
{children}
|
|
165
|
+
{showCloseButton && <DialogCloseButton />}
|
|
166
|
+
</div>
|
|
90
167
|
)
|
|
91
168
|
}
|
|
92
169
|
|
|
@@ -94,15 +171,20 @@ function DialogFooter({
|
|
|
94
171
|
className,
|
|
95
172
|
showCloseButton = false,
|
|
96
173
|
children,
|
|
174
|
+
ref,
|
|
97
175
|
...props
|
|
98
176
|
}: React.ComponentProps<"div"> & {
|
|
99
177
|
showCloseButton?: boolean
|
|
100
178
|
}) {
|
|
179
|
+
useRegisterCloseControl()
|
|
180
|
+
const pinnedRef = usePinnedHeight("--pinned-footer-height", "dialog-content", ref)
|
|
101
181
|
return (
|
|
102
182
|
<div
|
|
183
|
+
ref={pinnedRef}
|
|
103
184
|
data-slot="dialog-footer"
|
|
104
185
|
className={cn(
|
|
105
|
-
|
|
186
|
+
pinned,
|
|
187
|
+
"-bottom-(--dialog-padding) -mt-4 -mb-(--dialog-padding) flex flex-col-reverse gap-2 pt-4 pb-(--dialog-padding) sm:flex-row sm:justify-end",
|
|
106
188
|
className
|
|
107
189
|
)}
|
|
108
190
|
{...props}
|
|
@@ -117,13 +199,53 @@ function DialogFooter({
|
|
|
117
199
|
)
|
|
118
200
|
}
|
|
119
201
|
|
|
120
|
-
|
|
202
|
+
// The colour of the title icon per tone. Neutral is the foreground at 60%;
|
|
203
|
+
// info is the brand mark, as on the toast.
|
|
204
|
+
const titleIconTone: Record<Tone, string> = {
|
|
205
|
+
neutral: "text-foreground/60",
|
|
206
|
+
progress: "text-foreground/60",
|
|
207
|
+
info: "text-brand-indicator",
|
|
208
|
+
success: "text-success-text",
|
|
209
|
+
warning: "text-warning-text",
|
|
210
|
+
critical: "text-destructive-text",
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function DialogTitle({
|
|
214
|
+
className,
|
|
215
|
+
icon,
|
|
216
|
+
tone = "neutral",
|
|
217
|
+
children,
|
|
218
|
+
...props
|
|
219
|
+
}: DialogPrimitive.Title.Props & {
|
|
220
|
+
/** An 18px icon before the title, e.g. `<RocketIcon />`. */
|
|
221
|
+
icon?: React.ReactNode
|
|
222
|
+
/** The colour of `icon`. Neutral by default; use a tone for a state. */
|
|
223
|
+
tone?: Tone
|
|
224
|
+
}) {
|
|
121
225
|
return (
|
|
122
226
|
<DialogPrimitive.Title
|
|
123
227
|
data-slot="dialog-title"
|
|
124
|
-
className={cn(
|
|
228
|
+
className={cn(
|
|
229
|
+
"text-style-dialog-title",
|
|
230
|
+
icon != null && "flex items-center gap-2.5",
|
|
231
|
+
className
|
|
232
|
+
)}
|
|
125
233
|
{...props}
|
|
126
|
-
|
|
234
|
+
>
|
|
235
|
+
{icon != null && (
|
|
236
|
+
<span
|
|
237
|
+
data-slot="dialog-title-icon"
|
|
238
|
+
aria-hidden="true"
|
|
239
|
+
className={cn(
|
|
240
|
+
"flex shrink-0 [&_svg:not([class*='size-'])]:size-4.5 [&_svg:not([class*='stroke-'])]:stroke-[1.75]",
|
|
241
|
+
titleIconTone[tone]
|
|
242
|
+
)}
|
|
243
|
+
>
|
|
244
|
+
{icon}
|
|
245
|
+
</span>
|
|
246
|
+
)}
|
|
247
|
+
{children}
|
|
248
|
+
</DialogPrimitive.Title>
|
|
127
249
|
)
|
|
128
250
|
}
|
|
129
251
|
|
|
@@ -135,7 +257,7 @@ function DialogDescription({
|
|
|
135
257
|
<DialogPrimitive.Description
|
|
136
258
|
data-slot="dialog-description"
|
|
137
259
|
className={cn(
|
|
138
|
-
"text-
|
|
260
|
+
"text-foreground-secondary *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",
|
|
139
261
|
className
|
|
140
262
|
)}
|
|
141
263
|
{...props}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
DirectionProvider,
|
|
3
|
+
import {
|
|
4
|
+
DirectionProvider as DirectionProviderPrimitive,
|
|
5
5
|
useDirection,
|
|
6
6
|
} from "@base-ui/react/direction-provider"
|
|
7
|
+
|
|
8
|
+
import { ProvidedDirection } from "../../lib/popup-direction.ts"
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Sets the direction for Base UI behaviour (keyboard navigation, sides and
|
|
12
|
+
* alignment) and for every popup inside it, which renders in a portal. It does
|
|
13
|
+
* not set `dir` on any element: set it on `<html>`, or on the element that
|
|
14
|
+
* wraps the right-to-left region, so the page's own layout follows too.
|
|
15
|
+
*/
|
|
16
|
+
function DirectionProvider({
|
|
17
|
+
direction = "ltr",
|
|
18
|
+
...props
|
|
19
|
+
}: DirectionProviderPrimitive.Props) {
|
|
20
|
+
return (
|
|
21
|
+
<ProvidedDirection.Provider value={direction}>
|
|
22
|
+
<DirectionProviderPrimitive direction={direction} {...props} />
|
|
23
|
+
</ProvidedDirection.Provider>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { DirectionProvider, useDirection }
|
|
@@ -4,11 +4,14 @@ import * as React from "react"
|
|
|
4
4
|
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer"
|
|
5
5
|
|
|
6
6
|
import { cn } from "@vendure-io/ui/lib/utils"
|
|
7
|
+
import { usePopupDir } from "../../lib/popup-direction.ts"
|
|
8
|
+
import { triggerSlot } from "../../lib/trigger-slot.ts"
|
|
7
9
|
|
|
8
10
|
// Follows the shadcn base-vega Base UI drawer (upstream replaced vaul, which
|
|
9
11
|
// depends on Radix). Divergences: the scrim and surface use the scrim and
|
|
10
|
-
// overlay slots, the title uses our type style,
|
|
11
|
-
//
|
|
12
|
+
// overlay slots, the title uses our type style, the slide uses the drawer
|
|
13
|
+
// easing, and reduced motion turns the slide off: the scrim and the panel fade
|
|
14
|
+
// in place.
|
|
12
15
|
|
|
13
16
|
type DrawerContextProps = {
|
|
14
17
|
hasSnapPoints: boolean
|
|
@@ -58,7 +61,7 @@ function Drawer({
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {
|
|
61
|
-
return <DrawerPrimitive.Trigger
|
|
64
|
+
return <DrawerPrimitive.Trigger {...triggerSlot("drawer-trigger", props.render)} {...props} />
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {
|
|
@@ -77,7 +80,7 @@ function DrawerOverlay({
|
|
|
77
80
|
<DrawerPrimitive.Backdrop
|
|
78
81
|
data-slot="drawer-overlay"
|
|
79
82
|
className={cn(
|
|
80
|
-
"fixed inset-0 z-50 min-h-dvh bg-scrim opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-
|
|
83
|
+
"fixed inset-0 z-50 min-h-dvh bg-scrim opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-drawer-slide ease-drawer select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*var(--transition-duration-drawer-swipe))] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-instant supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute",
|
|
81
84
|
className
|
|
82
85
|
)}
|
|
83
86
|
{...props}
|
|
@@ -94,7 +97,7 @@ function DrawerSwipeHandle({
|
|
|
94
97
|
data-slot="drawer-swipe-handle"
|
|
95
98
|
aria-hidden="true"
|
|
96
99
|
className={cn(
|
|
97
|
-
"relative z-10 flex shrink-0 cursor-grab transition-opacity duration-
|
|
100
|
+
"relative z-10 flex shrink-0 cursor-grab transition-opacity duration-normal 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-[100px] group-data-[swipe-axis=x]/drawer-popup:after:w-1.5 group-data-[swipe-axis=y]/drawer-popup:after:h-1.5 group-data-[swipe-axis=y]/drawer-popup:after:w-[100px] active:cursor-grabbing",
|
|
98
101
|
className
|
|
99
102
|
)}
|
|
100
103
|
{...props}
|
|
@@ -110,6 +113,7 @@ function DrawerContent({
|
|
|
110
113
|
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()
|
|
111
114
|
const swipeAxis =
|
|
112
115
|
swipeDirection === "down" || swipeDirection === "up" ? "y" : "x"
|
|
116
|
+
const dir = usePopupDir()
|
|
113
117
|
|
|
114
118
|
return (
|
|
115
119
|
<DrawerPortal data-slot="drawer-portal">
|
|
@@ -122,22 +126,23 @@ function DrawerContent({
|
|
|
122
126
|
className="pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto"
|
|
123
127
|
>
|
|
124
128
|
<DrawerPrimitive.Popup
|
|
129
|
+
dir={dir}
|
|
125
130
|
data-slot="drawer-popup"
|
|
126
131
|
data-swipe-axis={swipeAxis}
|
|
127
132
|
data-snap-points={hasSnapPoints ? "" : undefined}
|
|
128
133
|
className={cn(
|
|
129
134
|
// Base.
|
|
130
|
-
"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-overlay text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-
|
|
135
|
+
"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-overlay text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-drawer-slide ease-drawer 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 motion-reduce:transition-opacity motion-reduce:data-starting-style:opacity-0 motion-reduce:data-ending-style:opacity-0",
|
|
131
136
|
// Nested.
|
|
132
137
|
"data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
|
|
133
138
|
// Bleed.
|
|
134
|
-
"after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--
|
|
139
|
+
"after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--overlay)) 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",
|
|
135
140
|
// Sizing.
|
|
136
141
|
"[--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]",
|
|
137
142
|
// Stack.
|
|
138
143
|
"[--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]",
|
|
139
144
|
// Transitions.
|
|
140
|
-
"data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*
|
|
145
|
+
"motion-safe:data-ending-style:transform-(--closed-transform) motion-safe:data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*var(--transition-duration-drawer-swipe))] data-nested-drawer-swiping:duration-instant data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*var(--transition-duration-drawer-swipe))] motion-safe:data-starting-style:transform-(--closed-transform) data-swiping:duration-instant data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*var(--transition-duration-drawer-swipe))]",
|
|
141
146
|
// Axis: y.
|
|
142
147
|
"data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
|
|
143
148
|
// Axis: x.
|
|
@@ -158,7 +163,7 @@ function DrawerContent({
|
|
|
158
163
|
<DrawerPrimitive.Content
|
|
159
164
|
data-slot="drawer-content"
|
|
160
165
|
className={cn(
|
|
161
|
-
"flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-
|
|
166
|
+
"flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-slow ease-drawer-content 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"
|
|
162
167
|
)}
|
|
163
168
|
>
|
|
164
169
|
{children}
|
|
@@ -174,7 +179,7 @@ function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
174
179
|
<div
|
|
175
180
|
data-slot="drawer-header"
|
|
176
181
|
className={cn(
|
|
177
|
-
"flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-1.5 md:text-
|
|
182
|
+
"flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-1.5 md:text-start",
|
|
178
183
|
className
|
|
179
184
|
)}
|
|
180
185
|
{...props}
|
|
@@ -4,7 +4,12 @@ import * as React from "react"
|
|
|
4
4
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu"
|
|
5
5
|
|
|
6
6
|
import { cn } from "@vendure-io/ui/lib/utils"
|
|
7
|
-
import {
|
|
7
|
+
import { popupMotion } from "../../lib/popup-motion.ts"
|
|
8
|
+
import { ChevronRightIcon } from "lucide-react"
|
|
9
|
+
import { usePopupDir } from "../../lib/popup-direction.ts"
|
|
10
|
+
import { usePopupAlign } from "../../lib/popup-align.ts"
|
|
11
|
+
import { triggerSlot } from "../../lib/trigger-slot.ts"
|
|
12
|
+
import { menuCheckItem, menuItem, menuRadioItem, MenuCheck } from "../../lib/menu-item.tsx"
|
|
8
13
|
|
|
9
14
|
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
10
15
|
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
@@ -15,34 +20,49 @@ function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
|
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
|
|
18
|
-
return <MenuPrimitive.Trigger
|
|
23
|
+
return <MenuPrimitive.Trigger {...triggerSlot("dropdown-menu-trigger", props.render)} {...props} />
|
|
19
24
|
}
|
|
20
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Without an `align`, the menu opens toward the centre of the viewport: a
|
|
28
|
+
* trigger in the right half lines the menu up with its right edge, so the menu
|
|
29
|
+
* grows to the left and stays on screen, and a trigger in the left half lines
|
|
30
|
+
* it up with its left edge. The side is picked each time the menu opens. A
|
|
31
|
+
* menu that opens to the left or right of its trigger keeps "start". An
|
|
32
|
+
* explicit `align` always wins.
|
|
33
|
+
*/
|
|
21
34
|
function DropdownMenuContent({
|
|
22
|
-
align
|
|
35
|
+
align,
|
|
23
36
|
alignOffset = 0,
|
|
24
37
|
side = "bottom",
|
|
25
|
-
sideOffset =
|
|
38
|
+
sideOffset = 6,
|
|
26
39
|
className,
|
|
40
|
+
ref,
|
|
27
41
|
...props
|
|
28
42
|
}: MenuPrimitive.Popup.Props &
|
|
29
43
|
Pick<
|
|
30
44
|
MenuPrimitive.Positioner.Props,
|
|
31
45
|
"align" | "alignOffset" | "side" | "sideOffset"
|
|
32
46
|
>) {
|
|
47
|
+
// Without an align, the popup opens toward the centre of the screen.
|
|
48
|
+
const { popupRef, align: positionAlign } = usePopupAlign(align, side, ref)
|
|
49
|
+
const dir = usePopupDir()
|
|
33
50
|
return (
|
|
34
51
|
<MenuPrimitive.Portal>
|
|
35
52
|
<MenuPrimitive.Positioner
|
|
53
|
+
dir={dir}
|
|
36
54
|
className="isolate z-50 outline-none"
|
|
37
|
-
align={
|
|
55
|
+
align={positionAlign}
|
|
38
56
|
alignOffset={alignOffset}
|
|
39
57
|
side={side}
|
|
40
58
|
sideOffset={sideOffset}
|
|
41
59
|
>
|
|
42
|
-
{/*
|
|
60
|
+
{/* Opens with popupMotion, the motion every popup shares. */}
|
|
61
|
+
{/* No w-(--anchor-width) here: pinning the popup to the trigger width makes wide items wrap — the popup sizes to its content, min-w-60 keeps the 240px floor of the v3 look */}
|
|
43
62
|
<MenuPrimitive.Popup
|
|
63
|
+
ref={popupRef}
|
|
44
64
|
data-slot="dropdown-menu-content"
|
|
45
|
-
className={cn("
|
|
65
|
+
className={cn("bg-popover text-popover-foreground shadow-overlay rounded-xl p-1.25 z-50 max-h-(--available-height) min-w-60 overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden", popupMotion, className )}
|
|
46
66
|
{...props}
|
|
47
67
|
/>
|
|
48
68
|
</MenuPrimitive.Positioner>
|
|
@@ -66,7 +86,7 @@ function DropdownMenuLabel({
|
|
|
66
86
|
data-slot="dropdown-menu-label"
|
|
67
87
|
data-inset={inset}
|
|
68
88
|
className={cn(
|
|
69
|
-
"text-muted-foreground px-2 py-1.5 text-xs font-medium data-inset:
|
|
89
|
+
"text-muted-foreground px-2 py-1.5 text-xs font-medium data-inset:ps-8",
|
|
70
90
|
className
|
|
71
91
|
)}
|
|
72
92
|
{...props}
|
|
@@ -89,7 +109,7 @@ function DropdownMenuItem({
|
|
|
89
109
|
data-inset={inset}
|
|
90
110
|
data-variant={variant}
|
|
91
111
|
className={cn(
|
|
92
|
-
"
|
|
112
|
+
menuItem, "data-[variant=destructive]:text-destructive-text data-[variant=destructive]:not-data-disabled:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive-text data-[variant=destructive]:*:[svg]:text-destructive-text data-[variant=destructive]:[&>svg:not([class*='opacity-'])]:opacity-100 not-data-[variant=destructive]:not-data-disabled:focus:**:not-data-[slot=dropdown-menu-shortcut]:text-accent-foreground group/dropdown-menu-item",
|
|
93
113
|
className
|
|
94
114
|
)}
|
|
95
115
|
{...props}
|
|
@@ -114,21 +134,22 @@ function DropdownMenuSubTrigger({
|
|
|
114
134
|
data-slot="dropdown-menu-sub-trigger"
|
|
115
135
|
data-inset={inset}
|
|
116
136
|
className={cn(
|
|
117
|
-
"
|
|
137
|
+
menuItem, "not-data-[variant=destructive]:not-data-disabled:focus:**:not-data-[slot=dropdown-menu-shortcut]:text-accent-foreground data-popup-open:bg-muted data-popup-open:text-accent-foreground",
|
|
118
138
|
className
|
|
119
139
|
)}
|
|
120
140
|
{...props}
|
|
121
141
|
>
|
|
122
142
|
{children}
|
|
123
|
-
<ChevronRightIcon className="
|
|
143
|
+
<ChevronRightIcon className="ms-auto rtl:rotate-180" />
|
|
124
144
|
</MenuPrimitive.SubmenuTrigger>
|
|
125
145
|
)
|
|
126
146
|
}
|
|
127
147
|
|
|
128
148
|
function DropdownMenuSubContent({
|
|
129
149
|
align = "start",
|
|
130
|
-
alignOffset = -
|
|
131
|
-
|
|
150
|
+
alignOffset = -5,
|
|
151
|
+
// Logical: the sub-menu opens to the left in a right-to-left layout.
|
|
152
|
+
side = "inline-end",
|
|
132
153
|
sideOffset = 0,
|
|
133
154
|
className,
|
|
134
155
|
...props
|
|
@@ -137,7 +158,7 @@ function DropdownMenuSubContent({
|
|
|
137
158
|
<DropdownMenuContent
|
|
138
159
|
data-slot="dropdown-menu-sub-content"
|
|
139
160
|
className={cn(
|
|
140
|
-
"
|
|
161
|
+
"w-auto min-w-[96px]",
|
|
141
162
|
className
|
|
142
163
|
)}
|
|
143
164
|
align={align}
|
|
@@ -163,20 +184,17 @@ function DropdownMenuCheckboxItem({
|
|
|
163
184
|
data-slot="dropdown-menu-checkbox-item"
|
|
164
185
|
data-inset={inset}
|
|
165
186
|
className={cn(
|
|
166
|
-
"
|
|
187
|
+
menuItem, menuCheckItem, "not-data-disabled:focus:**:text-accent-foreground pe-8",
|
|
167
188
|
className
|
|
168
189
|
)}
|
|
169
190
|
checked={checked}
|
|
170
191
|
{...props}
|
|
171
192
|
>
|
|
172
193
|
<span
|
|
173
|
-
className="pointer-events-none absolute
|
|
194
|
+
className="pointer-events-none absolute end-2 flex items-center justify-center"
|
|
174
195
|
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
175
196
|
>
|
|
176
|
-
<
|
|
177
|
-
<CheckIcon
|
|
178
|
-
/>
|
|
179
|
-
</MenuPrimitive.CheckboxItemIndicator>
|
|
197
|
+
<MenuCheck />
|
|
180
198
|
</span>
|
|
181
199
|
{children}
|
|
182
200
|
</MenuPrimitive.CheckboxItem>
|
|
@@ -205,19 +223,16 @@ function DropdownMenuRadioItem({
|
|
|
205
223
|
data-slot="dropdown-menu-radio-item"
|
|
206
224
|
data-inset={inset}
|
|
207
225
|
className={cn(
|
|
208
|
-
"
|
|
226
|
+
menuItem, menuRadioItem, "not-data-disabled:focus:**:text-accent-foreground pe-8",
|
|
209
227
|
className
|
|
210
228
|
)}
|
|
211
229
|
{...props}
|
|
212
230
|
>
|
|
213
231
|
<span
|
|
214
|
-
className="pointer-events-none absolute
|
|
232
|
+
className="pointer-events-none absolute end-2 flex items-center justify-center"
|
|
215
233
|
data-slot="dropdown-menu-radio-item-indicator"
|
|
216
234
|
>
|
|
217
|
-
<
|
|
218
|
-
<CheckIcon
|
|
219
|
-
/>
|
|
220
|
-
</MenuPrimitive.RadioItemIndicator>
|
|
235
|
+
<MenuCheck />
|
|
221
236
|
</span>
|
|
222
237
|
{children}
|
|
223
238
|
</MenuPrimitive.RadioItem>
|
|
@@ -231,7 +246,7 @@ function DropdownMenuSeparator({
|
|
|
231
246
|
return (
|
|
232
247
|
<MenuPrimitive.Separator
|
|
233
248
|
data-slot="dropdown-menu-separator"
|
|
234
|
-
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
249
|
+
className={cn("bg-border -mx-1.25 my-1.25 h-px", className)}
|
|
235
250
|
{...props}
|
|
236
251
|
/>
|
|
237
252
|
)
|
|
@@ -245,7 +260,7 @@ function DropdownMenuShortcut({
|
|
|
245
260
|
<span
|
|
246
261
|
data-slot="dropdown-menu-shortcut"
|
|
247
262
|
className={cn(
|
|
248
|
-
"text-muted-foreground
|
|
263
|
+
"text-muted-foreground ms-auto ps-4 text-xs",
|
|
249
264
|
className
|
|
250
265
|
)}
|
|
251
266
|
{...props}
|
|
@@ -32,6 +32,10 @@ const emptyMediaVariants = cva(
|
|
|
32
32
|
variant: {
|
|
33
33
|
default: "bg-transparent",
|
|
34
34
|
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6",
|
|
35
|
+
// A bare icon with no chip, the icon of every state view (EmptyState,
|
|
36
|
+
// ErrorState): 28px, a light stroke and 40% opacity, so it marks the
|
|
37
|
+
// region without drawing focus.
|
|
38
|
+
bare: "text-foreground opacity-40 [&_svg]:stroke-[1.5] [&_svg:not([class*='size-'])]:size-7",
|
|
35
39
|
},
|
|
36
40
|
},
|
|
37
41
|
defaultVariants: {
|