@zentauri-ui/zentauri-components 1.7.1 → 1.7.3
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 -5
- package/cli/registry.json +2 -0
- package/dist/chunk-BC6M42HQ.mjs +251 -0
- package/dist/chunk-BC6M42HQ.mjs.map +1 -0
- package/dist/chunk-KEKMMNL5.mjs +600 -0
- package/dist/chunk-KEKMMNL5.mjs.map +1 -0
- package/dist/chunk-NZDHSIIC.js +616 -0
- package/dist/chunk-NZDHSIIC.js.map +1 -0
- package/dist/chunk-QSPXPU72.js +259 -0
- package/dist/chunk-QSPXPU72.js.map +1 -0
- package/dist/design-system/command.d.ts +41 -0
- package/dist/design-system/command.d.ts.map +1 -0
- package/dist/design-system/index.d.ts +2 -0
- package/dist/design-system/index.d.ts.map +1 -1
- package/dist/design-system/popover.d.ts +40 -0
- package/dist/design-system/popover.d.ts.map +1 -0
- package/dist/ui/command/animated/animations.d.ts +3 -0
- package/dist/ui/command/animated/animations.d.ts.map +1 -0
- package/dist/ui/command/animated/command-content-animated.d.ts +6 -0
- package/dist/ui/command/animated/command-content-animated.d.ts.map +1 -0
- package/dist/ui/command/animated/index.d.ts +4 -0
- package/dist/ui/command/animated/index.d.ts.map +1 -0
- package/dist/ui/command/animated/types.d.ts +9 -0
- package/dist/ui/command/animated/types.d.ts.map +1 -0
- package/dist/ui/command/animated.js +92 -0
- package/dist/ui/command/animated.js.map +1 -0
- package/dist/ui/command/animated.mjs +89 -0
- package/dist/ui/command/animated.mjs.map +1 -0
- package/dist/ui/command/command-base.d.ts +53 -0
- package/dist/ui/command/command-base.d.ts.map +1 -0
- package/dist/ui/command/command.d.ts +6 -0
- package/dist/ui/command/command.d.ts.map +1 -0
- package/dist/ui/command/index.d.ts +5 -0
- package/dist/ui/command/index.d.ts.map +1 -0
- package/dist/ui/command/types.d.ts +111 -0
- package/dist/ui/command/types.d.ts.map +1 -0
- package/dist/ui/command/variants.d.ts +15 -0
- package/dist/ui/command/variants.d.ts.map +1 -0
- package/dist/ui/command.js +69 -0
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/command.mjs +16 -0
- package/dist/ui/command.mjs.map +1 -0
- package/dist/ui/popover/animated/animations.d.ts +3 -0
- package/dist/ui/popover/animated/animations.d.ts.map +1 -0
- package/dist/ui/popover/animated/index.d.ts +4 -0
- package/dist/ui/popover/animated/index.d.ts.map +1 -0
- package/dist/ui/popover/animated/popover-content-animated.d.ts +3 -0
- package/dist/ui/popover/animated/popover-content-animated.d.ts.map +1 -0
- package/dist/ui/popover/animated/types.d.ts +9 -0
- package/dist/ui/popover/animated/types.d.ts.map +1 -0
- package/dist/ui/popover/animated.js +67 -0
- package/dist/ui/popover/animated.js.map +1 -0
- package/dist/ui/popover/animated.mjs +64 -0
- package/dist/ui/popover/animated.mjs.map +1 -0
- package/dist/ui/popover/index.d.ts +4 -0
- package/dist/ui/popover/index.d.ts.map +1 -0
- package/dist/ui/popover/popover-base.d.ts +8 -0
- package/dist/ui/popover/popover-base.d.ts.map +1 -0
- package/dist/ui/popover/popover.d.ts +2 -0
- package/dist/ui/popover/popover.d.ts.map +1 -0
- package/dist/ui/popover/types.d.ts +34 -0
- package/dist/ui/popover/types.d.ts.map +1 -0
- package/dist/ui/popover/variants.d.ts +6 -0
- package/dist/ui/popover/variants.d.ts.map +1 -0
- package/dist/ui/popover.js +34 -0
- package/dist/ui/popover.js.map +1 -0
- package/dist/ui/popover.mjs +5 -0
- package/dist/ui/popover.mjs.map +1 -0
- package/package.json +1 -1
- package/src/design-system/command.ts +80 -0
- package/src/design-system/index.ts +2 -0
- package/src/design-system/popover.ts +66 -0
- package/src/ui/command/animated/animations.ts +29 -0
- package/src/ui/command/animated/command-content-animated.tsx +58 -0
- package/src/ui/command/animated/index.ts +10 -0
- package/src/ui/command/animated/types.ts +23 -0
- package/src/ui/command/command-base.tsx +660 -0
- package/src/ui/command/command.test.tsx +130 -0
- package/src/ui/command/command.tsx +8 -0
- package/src/ui/command/index.ts +34 -0
- package/src/ui/command/types.ts +129 -0
- package/src/ui/command/variants.ts +41 -0
- package/src/ui/popover/animated/animations.ts +15 -0
- package/src/ui/popover/animated/index.ts +10 -0
- package/src/ui/popover/animated/popover-content-animated.tsx +54 -0
- package/src/ui/popover/animated/types.ts +18 -0
- package/src/ui/popover/index.ts +18 -0
- package/src/ui/popover/popover-base.tsx +261 -0
- package/src/ui/popover/popover.test.tsx +84 -0
- package/src/ui/popover/popover.tsx +8 -0
- package/src/ui/popover/types.ts +38 -0
- package/src/ui/popover/variants.ts +21 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Children,
|
|
5
|
+
cloneElement,
|
|
6
|
+
createContext,
|
|
7
|
+
isValidElement,
|
|
8
|
+
useCallback,
|
|
9
|
+
useContext,
|
|
10
|
+
useEffect,
|
|
11
|
+
useId,
|
|
12
|
+
useRef,
|
|
13
|
+
useState,
|
|
14
|
+
type RefObject,
|
|
15
|
+
type KeyboardEventHandler,
|
|
16
|
+
type MouseEventHandler,
|
|
17
|
+
type ReactElement,
|
|
18
|
+
type Ref,
|
|
19
|
+
useMemo,
|
|
20
|
+
} from "react";
|
|
21
|
+
|
|
22
|
+
import { cn } from "../../lib/utils";
|
|
23
|
+
|
|
24
|
+
import type {
|
|
25
|
+
PopoverAlign,
|
|
26
|
+
PopoverContentProps,
|
|
27
|
+
PopoverContextType,
|
|
28
|
+
PopoverProps,
|
|
29
|
+
PopoverSide,
|
|
30
|
+
PopoverTriggerProps,
|
|
31
|
+
} from "./types";
|
|
32
|
+
import { popoverContentVariants } from "./variants";
|
|
33
|
+
|
|
34
|
+
export const PopoverContext = createContext<PopoverContextType | null>(null);
|
|
35
|
+
|
|
36
|
+
export const usePopover = () => {
|
|
37
|
+
const context = useContext(PopoverContext);
|
|
38
|
+
if (!context) {
|
|
39
|
+
throw new Error("Popover components must be used within Popover");
|
|
40
|
+
}
|
|
41
|
+
return context;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function mergeRefs<T>(...refs: Array<Ref<T> | undefined>) {
|
|
45
|
+
return (node: T) => {
|
|
46
|
+
for (const ref of refs) {
|
|
47
|
+
if (typeof ref === "function") {
|
|
48
|
+
ref(node);
|
|
49
|
+
} else if (ref) {
|
|
50
|
+
(ref as RefObject<T | null>).current = node;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function sideAlignClass(side: PopoverSide, align: PopoverAlign) {
|
|
57
|
+
const sideClasses = {
|
|
58
|
+
top: "bottom-full mb-2",
|
|
59
|
+
bottom: "top-full mt-2",
|
|
60
|
+
left: "right-full mr-2",
|
|
61
|
+
right: "left-full ml-2",
|
|
62
|
+
} satisfies Record<PopoverSide, string>;
|
|
63
|
+
|
|
64
|
+
const verticalAlign = {
|
|
65
|
+
start: "left-0",
|
|
66
|
+
center: "left-1/2 -translate-x-1/2",
|
|
67
|
+
end: "right-0",
|
|
68
|
+
} satisfies Record<PopoverAlign, string>;
|
|
69
|
+
|
|
70
|
+
const horizontalAlign = {
|
|
71
|
+
start: "top-0",
|
|
72
|
+
center: "top-1/2 -translate-y-1/2",
|
|
73
|
+
end: "bottom-0",
|
|
74
|
+
} satisfies Record<PopoverAlign, string>;
|
|
75
|
+
|
|
76
|
+
return cn(
|
|
77
|
+
sideClasses[side],
|
|
78
|
+
side === "top" || side === "bottom"
|
|
79
|
+
? verticalAlign[align]
|
|
80
|
+
: horizontalAlign[align],
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const Popover = ({
|
|
85
|
+
children,
|
|
86
|
+
defaultOpen = false,
|
|
87
|
+
open: controlledOpen,
|
|
88
|
+
onOpenChange,
|
|
89
|
+
closeOnEscape = true,
|
|
90
|
+
closeOnOutsideClick = true,
|
|
91
|
+
}: PopoverProps) => {
|
|
92
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
93
|
+
const contentId = `${useId()}-popover`;
|
|
94
|
+
const triggerRef = useRef<HTMLElement | null>(null);
|
|
95
|
+
const contentRef = useRef<HTMLDivElement | null>(null);
|
|
96
|
+
|
|
97
|
+
const isControlled = controlledOpen !== undefined;
|
|
98
|
+
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
99
|
+
|
|
100
|
+
const setOpen = useCallback(
|
|
101
|
+
(value: boolean) => {
|
|
102
|
+
if (!isControlled) {
|
|
103
|
+
setUncontrolledOpen(value);
|
|
104
|
+
}
|
|
105
|
+
onOpenChange?.(value);
|
|
106
|
+
},
|
|
107
|
+
[isControlled, onOpenChange],
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const toggleOpen = useCallback(() => setOpen(!open), [open, setOpen]);
|
|
111
|
+
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (!open) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const onPointerDown = (event: PointerEvent) => {
|
|
118
|
+
if (!closeOnOutsideClick) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const target = event.target as Node;
|
|
122
|
+
if (
|
|
123
|
+
contentRef.current?.contains(target) ||
|
|
124
|
+
triggerRef.current?.contains(target)
|
|
125
|
+
) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
setOpen(false);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
132
|
+
if (event.key === "Escape" && closeOnEscape) {
|
|
133
|
+
setOpen(false);
|
|
134
|
+
triggerRef.current?.focus();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
139
|
+
document.addEventListener("keydown", onKeyDown);
|
|
140
|
+
|
|
141
|
+
return () => {
|
|
142
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
143
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
144
|
+
};
|
|
145
|
+
}, [closeOnEscape, closeOnOutsideClick, open, setOpen]);
|
|
146
|
+
|
|
147
|
+
const contextValue = useMemo(
|
|
148
|
+
() => ({
|
|
149
|
+
open,
|
|
150
|
+
setOpen,
|
|
151
|
+
toggleOpen,
|
|
152
|
+
contentId,
|
|
153
|
+
triggerRef,
|
|
154
|
+
contentRef,
|
|
155
|
+
}),
|
|
156
|
+
[open, setOpen, toggleOpen, contentId],
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<PopoverContext.Provider
|
|
161
|
+
value={contextValue}
|
|
162
|
+
>
|
|
163
|
+
<div className="relative inline-block">{children}</div>
|
|
164
|
+
</PopoverContext.Provider>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const PopoverTrigger = ({
|
|
169
|
+
children,
|
|
170
|
+
className,
|
|
171
|
+
}: PopoverTriggerProps) => {
|
|
172
|
+
const { open, toggleOpen, contentId, triggerRef } = usePopover();
|
|
173
|
+
const childList = Children.toArray(children).filter(
|
|
174
|
+
(node) => node !== null && node !== undefined && typeof node !== "boolean",
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
const soleCandidate =
|
|
178
|
+
childList.length === 1 && isValidElement(childList[0])
|
|
179
|
+
? (childList[0] as ReactElement<{
|
|
180
|
+
className?: string;
|
|
181
|
+
ref?: Ref<HTMLElement>;
|
|
182
|
+
onClick?: MouseEventHandler;
|
|
183
|
+
onKeyDown?: KeyboardEventHandler;
|
|
184
|
+
"aria-expanded"?: boolean;
|
|
185
|
+
"aria-haspopup"?: string;
|
|
186
|
+
"aria-controls"?: string;
|
|
187
|
+
}>)
|
|
188
|
+
: undefined;
|
|
189
|
+
|
|
190
|
+
if (soleCandidate) {
|
|
191
|
+
return cloneElement(soleCandidate, {
|
|
192
|
+
ref: mergeRefs(triggerRef, soleCandidate.props.ref),
|
|
193
|
+
onClick: (event) => {
|
|
194
|
+
soleCandidate.props.onClick?.(event);
|
|
195
|
+
if (!event.defaultPrevented) {
|
|
196
|
+
toggleOpen();
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
onKeyDown: (event) => {
|
|
200
|
+
soleCandidate.props.onKeyDown?.(event);
|
|
201
|
+
if (event.key === "Escape") {
|
|
202
|
+
event.preventDefault();
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
className: cn(className, soleCandidate.props.className),
|
|
206
|
+
"aria-expanded": open,
|
|
207
|
+
"aria-haspopup": "dialog",
|
|
208
|
+
"aria-controls": open ? contentId : undefined,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<button
|
|
214
|
+
ref={triggerRef as Ref<HTMLButtonElement>}
|
|
215
|
+
type="button"
|
|
216
|
+
className={className}
|
|
217
|
+
aria-expanded={open}
|
|
218
|
+
aria-haspopup="dialog"
|
|
219
|
+
aria-controls={open ? contentId : undefined}
|
|
220
|
+
onClick={toggleOpen}
|
|
221
|
+
>
|
|
222
|
+
{children}
|
|
223
|
+
</button>
|
|
224
|
+
);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export const PopoverContent = ({
|
|
228
|
+
children,
|
|
229
|
+
className,
|
|
230
|
+
variant,
|
|
231
|
+
size,
|
|
232
|
+
width,
|
|
233
|
+
side = "bottom",
|
|
234
|
+
align = "center",
|
|
235
|
+
role = "dialog",
|
|
236
|
+
...props
|
|
237
|
+
}: PopoverContentProps) => {
|
|
238
|
+
const { open, contentId, contentRef } = usePopover();
|
|
239
|
+
|
|
240
|
+
if (!open) {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return (
|
|
245
|
+
<div
|
|
246
|
+
ref={contentRef}
|
|
247
|
+
id={contentId}
|
|
248
|
+
data-open={open}
|
|
249
|
+
role={role}
|
|
250
|
+
tabIndex={-1}
|
|
251
|
+
className={cn(
|
|
252
|
+
popoverContentVariants({ variant, size, width }),
|
|
253
|
+
sideAlignClass(side, align),
|
|
254
|
+
className,
|
|
255
|
+
)}
|
|
256
|
+
{...props}
|
|
257
|
+
>
|
|
258
|
+
{children}
|
|
259
|
+
</div>
|
|
260
|
+
);
|
|
261
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { render, screen, waitFor } from "@testing-library/react";
|
|
2
|
+
import userEvent from "@testing-library/user-event";
|
|
3
|
+
import { describe, expect, it, vi } from "vitest";
|
|
4
|
+
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
6
|
+
|
|
7
|
+
describe("Popover", () => {
|
|
8
|
+
it("should open and close popover content from the trigger", async () => {
|
|
9
|
+
const user = userEvent.setup();
|
|
10
|
+
render(
|
|
11
|
+
<Popover>
|
|
12
|
+
<PopoverTrigger>
|
|
13
|
+
<button type="button">Open panel</button>
|
|
14
|
+
</PopoverTrigger>
|
|
15
|
+
<PopoverContent>Interactive panel</PopoverContent>
|
|
16
|
+
</Popover>,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const trigger = screen.getByRole("button", { name: "Open panel" });
|
|
20
|
+
await user.click(trigger);
|
|
21
|
+
expect(screen.getByRole("dialog")).toHaveTextContent("Interactive panel");
|
|
22
|
+
expect(trigger).toHaveAttribute("aria-expanded", "true");
|
|
23
|
+
|
|
24
|
+
await user.click(trigger);
|
|
25
|
+
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("should close when clicking outside the popover", async () => {
|
|
29
|
+
const user = userEvent.setup();
|
|
30
|
+
render(
|
|
31
|
+
<>
|
|
32
|
+
<Popover defaultOpen>
|
|
33
|
+
<PopoverTrigger>
|
|
34
|
+
<button type="button">Open panel</button>
|
|
35
|
+
</PopoverTrigger>
|
|
36
|
+
<PopoverContent>Panel body</PopoverContent>
|
|
37
|
+
</Popover>
|
|
38
|
+
<button type="button">Outside</button>
|
|
39
|
+
</>,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
expect(screen.getByRole("dialog")).toBeInTheDocument();
|
|
43
|
+
await user.click(screen.getByRole("button", { name: "Outside" }));
|
|
44
|
+
await waitFor(() => {
|
|
45
|
+
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("should close on Escape and return focus to the trigger", async () => {
|
|
50
|
+
const user = userEvent.setup();
|
|
51
|
+
render(
|
|
52
|
+
<Popover defaultOpen>
|
|
53
|
+
<PopoverTrigger>
|
|
54
|
+
<button type="button">Focus trigger</button>
|
|
55
|
+
</PopoverTrigger>
|
|
56
|
+
<PopoverContent>Escape closes me</PopoverContent>
|
|
57
|
+
</Popover>,
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
await user.keyboard("{Escape}");
|
|
61
|
+
await waitFor(() => {
|
|
62
|
+
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
|
|
63
|
+
});
|
|
64
|
+
expect(screen.getByRole("button", { name: "Focus trigger" })).toHaveFocus();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("should support controlled open state", async () => {
|
|
68
|
+
const user = userEvent.setup();
|
|
69
|
+
const onOpenChange = vi.fn();
|
|
70
|
+
|
|
71
|
+
render(
|
|
72
|
+
<Popover open={false} onOpenChange={onOpenChange}>
|
|
73
|
+
<PopoverTrigger>
|
|
74
|
+
<button type="button">Controlled</button>
|
|
75
|
+
</PopoverTrigger>
|
|
76
|
+
<PopoverContent>Controlled body</PopoverContent>
|
|
77
|
+
</Popover>,
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
await user.click(screen.getByRole("button", { name: "Controlled" }));
|
|
81
|
+
expect(onOpenChange).toHaveBeenCalledWith(true);
|
|
82
|
+
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
3
|
+
import { popoverContentVariants } from "./variants";
|
|
4
|
+
|
|
5
|
+
export type PopoverSide = "top" | "left" | "bottom" | "right";
|
|
6
|
+
export type PopoverAlign = "start" | "center" | "end";
|
|
7
|
+
|
|
8
|
+
export type PopoverContextType = {
|
|
9
|
+
open: boolean;
|
|
10
|
+
setOpen: (value: boolean) => void;
|
|
11
|
+
toggleOpen: () => void;
|
|
12
|
+
contentId: string;
|
|
13
|
+
triggerRef: React.RefObject<HTMLElement | null>;
|
|
14
|
+
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type PopoverProps = {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
open?: boolean;
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
closeOnEscape?: boolean;
|
|
23
|
+
closeOnOutsideClick?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type PopoverTriggerProps = {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type PopoverContentProps = ComponentPropsWithRef<"div"> & {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
variant?: VariantProps<typeof popoverContentVariants>["variant"]
|
|
34
|
+
size?: VariantProps<typeof popoverContentVariants>["size"];
|
|
35
|
+
width?: VariantProps<typeof popoverContentVariants>["width"];
|
|
36
|
+
side?: PopoverSide;
|
|
37
|
+
align?: PopoverAlign;
|
|
38
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
zuiPopoverContentBase,
|
|
5
|
+
zuiPopoverContentSizes,
|
|
6
|
+
zuiPopoverContentVariants,
|
|
7
|
+
zuiPopoverContentWidths,
|
|
8
|
+
} from "../../design-system/popover";
|
|
9
|
+
|
|
10
|
+
export const popoverContentVariants = cva(zuiPopoverContentBase, {
|
|
11
|
+
variants: {
|
|
12
|
+
variant: zuiPopoverContentVariants,
|
|
13
|
+
size: zuiPopoverContentSizes,
|
|
14
|
+
width: zuiPopoverContentWidths,
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
size: "md",
|
|
19
|
+
width: "xs",
|
|
20
|
+
},
|
|
21
|
+
});
|