@nationaldesignstudio/react 0.6.0 → 0.7.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/dist/accordion/index.d.ts +95 -0
- package/dist/accordion/index.js +143 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/background/index.d.ts +149 -0
- package/dist/background/index.js +200 -0
- package/dist/background/index.js.map +1 -0
- package/dist/banner/index.d.ts +101 -0
- package/dist/banner/index.js +81 -0
- package/dist/banner/index.js.map +1 -0
- package/dist/blurred-video-backdrop/index.d.ts +233 -0
- package/dist/blurred-video-backdrop/index.js +266 -0
- package/dist/blurred-video-backdrop/index.js.map +1 -0
- package/dist/button/index.d.ts +180 -0
- package/dist/button/index.js +169 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button-B2g5fH9b.d.ts +152 -0
- package/dist/card/index.d.ts +406 -0
- package/dist/card/index.js +219 -0
- package/dist/card/index.js.map +1 -0
- package/dist/card-grid/index.d.ts +90 -0
- package/dist/card-grid/index.js +74 -0
- package/dist/card-grid/index.js.map +1 -0
- package/dist/component-registry.md +136 -2
- package/dist/dev-toolbar/index.d.ts +8 -0
- package/dist/dev-toolbar/index.js +206 -0
- package/dist/dev-toolbar/index.js.map +1 -0
- package/dist/dialog/index.d.ts +268 -0
- package/dist/dialog/index.js +288 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/faq-section/index.d.ts +47 -0
- package/dist/faq-section/index.js +152 -0
- package/dist/faq-section/index.js.map +1 -0
- package/dist/grid-overlay/index.d.ts +10 -0
- package/dist/grid-overlay/index.js +38 -0
- package/dist/grid-overlay/index.js.map +1 -0
- package/dist/hero/index.d.ts +462 -0
- package/dist/hero/index.js +494 -0
- package/dist/hero/index.js.map +1 -0
- package/dist/hooks/index.d.ts +150 -0
- package/dist/hooks/index.js +339 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.d.ts +46 -5339
- package/dist/index.js +157 -4080
- package/dist/index.js.map +1 -1
- package/dist/input/index.d.ts +404 -0
- package/dist/input/index.js +393 -0
- package/dist/input/index.js.map +1 -0
- package/dist/navbar/index.d.ts +68 -0
- package/dist/navbar/index.js +227 -0
- package/dist/navbar/index.js.map +1 -0
- package/dist/ndstudio-footer/index.d.ts +32 -0
- package/dist/ndstudio-footer/index.js +35 -0
- package/dist/ndstudio-footer/index.js.map +1 -0
- package/dist/pager-control/index.d.ts +173 -0
- package/dist/pager-control/index.js +267 -0
- package/dist/pager-control/index.js.map +1 -0
- package/dist/popover/index.d.ts +200 -0
- package/dist/popover/index.js +290 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/prose/index.d.ts +39 -0
- package/dist/prose/index.js +56 -0
- package/dist/prose/index.js.map +1 -0
- package/dist/quote-block/index.d.ts +156 -0
- package/dist/quote-block/index.js +321 -0
- package/dist/quote-block/index.js.map +1 -0
- package/dist/river/index.d.ts +100 -0
- package/dist/river/index.js +107 -0
- package/dist/river/index.js.map +1 -0
- package/dist/select/index.d.ts +188 -0
- package/dist/select/index.js +295 -0
- package/dist/select/index.js.map +1 -0
- package/dist/theme/index.d.ts +149 -0
- package/dist/theme/index.js +211 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme-CzBPUlh_.d.ts +332 -0
- package/dist/tooltip/index.d.ts +166 -0
- package/dist/tooltip/index.js +200 -0
- package/dist/tooltip/index.js.map +1 -0
- package/dist/tout/index.d.ts +157 -0
- package/dist/tout/index.js +315 -0
- package/dist/tout/index.js.map +1 -0
- package/dist/two-column-section/index.d.ts +122 -0
- package/dist/two-column-section/index.js +121 -0
- package/dist/two-column-section/index.js.map +1 -0
- package/dist/us-gov-banner/index.d.ts +141 -0
- package/dist/us-gov-banner/index.js +74 -0
- package/dist/us-gov-banner/index.js.map +1 -0
- package/dist/use-captions-AkKlJhov.d.ts +71 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/video-dialog/index.d.ts +106 -0
- package/dist/video-dialog/index.js +1305 -0
- package/dist/video-dialog/index.js.map +1 -0
- package/dist/video-player/index.d.ts +115 -0
- package/dist/video-player/index.js +879 -0
- package/dist/video-player/index.js.map +1 -0
- package/dist/video-player-qxf-BURH.d.ts +236 -0
- package/dist/video-with-backdrop/index.d.ts +267 -0
- package/dist/video-with-backdrop/index.js +1284 -0
- package/dist/video-with-backdrop/index.js.map +1 -0
- package/package.json +13 -2
- package/src/components/organisms/us-gov-banner/us-gov-banner.tsx +5 -27
- package/src/theme/hooks.ts +2 -0
- package/src/theme/index.ts +2 -0
- package/src/theme/theme-provider.tsx +2 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { tv, cnBase } from 'tailwind-variants';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
// src/components/atoms/pager-control/pager-control.tsx
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return cnBase(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
var pagerControlVariants = tv({
|
|
12
|
+
base: "flex items-center",
|
|
13
|
+
variants: {
|
|
14
|
+
size: {
|
|
15
|
+
// Uses primitive spacing tokens
|
|
16
|
+
sm: "gap-2",
|
|
17
|
+
default: "gap-2",
|
|
18
|
+
lg: "gap-4"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
size: "default"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var dotBaseVariants = tv({
|
|
26
|
+
base: "cursor-pointer rounded-full transition-all duration-500 ease-[cubic-bezier(0.23,1,0.32,1)]",
|
|
27
|
+
variants: {
|
|
28
|
+
size: {
|
|
29
|
+
// Uses primitive spacing tokens
|
|
30
|
+
sm: "h-6",
|
|
31
|
+
default: "h-10",
|
|
32
|
+
lg: "h-16"
|
|
33
|
+
},
|
|
34
|
+
variant: {
|
|
35
|
+
charcoal: "",
|
|
36
|
+
ivory: ""
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
size: "default",
|
|
41
|
+
variant: "charcoal"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
var PagerControl = React.forwardRef(
|
|
45
|
+
({
|
|
46
|
+
className,
|
|
47
|
+
size,
|
|
48
|
+
variant,
|
|
49
|
+
count,
|
|
50
|
+
activeIndex: controlledIndex,
|
|
51
|
+
duration = 5e3,
|
|
52
|
+
autoPlay = true,
|
|
53
|
+
onChange,
|
|
54
|
+
pauseOnHover = true,
|
|
55
|
+
loop = true,
|
|
56
|
+
...props
|
|
57
|
+
}, ref) => {
|
|
58
|
+
const [internalIndex, setInternalIndex] = React.useState(0);
|
|
59
|
+
const [isPaused, setIsPaused] = React.useState(false);
|
|
60
|
+
const [progress, setProgress] = React.useState(0);
|
|
61
|
+
const activeIndex = controlledIndex !== void 0 ? controlledIndex : internalIndex;
|
|
62
|
+
const isControlled = controlledIndex !== void 0;
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
if (import.meta.env?.DEV) {
|
|
65
|
+
if (count < 1) {
|
|
66
|
+
console.warn("PagerControl: count must be at least 1");
|
|
67
|
+
}
|
|
68
|
+
if (controlledIndex !== void 0 && controlledIndex >= count) {
|
|
69
|
+
console.warn(
|
|
70
|
+
`PagerControl: activeIndex (${controlledIndex}) is out of bounds. Must be less than count (${count}).`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
if (controlledIndex !== void 0 && controlledIndex < 0) {
|
|
74
|
+
console.warn(
|
|
75
|
+
`PagerControl: activeIndex (${controlledIndex}) cannot be negative.`
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
if (isControlled && onChange === void 0) {
|
|
79
|
+
console.warn(
|
|
80
|
+
"PagerControl: controlled mode (activeIndex provided) requires an onChange handler."
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, [count, controlledIndex, isControlled, onChange]);
|
|
85
|
+
const safeActiveIndex = Math.max(0, Math.min(activeIndex, count - 1));
|
|
86
|
+
const animationFrameRef = React.useRef(null);
|
|
87
|
+
const startTimeRef = React.useRef(null);
|
|
88
|
+
const pausedProgressRef = React.useRef(0);
|
|
89
|
+
const goToNext = React.useCallback(() => {
|
|
90
|
+
const nextIndex = safeActiveIndex + 1;
|
|
91
|
+
if (nextIndex >= count) {
|
|
92
|
+
if (loop) {
|
|
93
|
+
if (!isControlled) setInternalIndex(0);
|
|
94
|
+
onChange?.(0);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
if (!isControlled) setInternalIndex(nextIndex);
|
|
98
|
+
onChange?.(nextIndex);
|
|
99
|
+
}
|
|
100
|
+
}, [safeActiveIndex, count, loop, isControlled, onChange]);
|
|
101
|
+
const goToIndex = React.useCallback(
|
|
102
|
+
(index) => {
|
|
103
|
+
if (!isControlled) setInternalIndex(index);
|
|
104
|
+
onChange?.(index);
|
|
105
|
+
setProgress(0);
|
|
106
|
+
pausedProgressRef.current = 0;
|
|
107
|
+
startTimeRef.current = null;
|
|
108
|
+
},
|
|
109
|
+
[isControlled, onChange]
|
|
110
|
+
);
|
|
111
|
+
React.useEffect(() => {
|
|
112
|
+
if (!autoPlay || duration <= 0 || isPaused) {
|
|
113
|
+
if (animationFrameRef.current) {
|
|
114
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
115
|
+
animationFrameRef.current = null;
|
|
116
|
+
}
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const animate = (timestamp) => {
|
|
120
|
+
if (startTimeRef.current === null) {
|
|
121
|
+
startTimeRef.current = timestamp - pausedProgressRef.current / 100 * duration;
|
|
122
|
+
}
|
|
123
|
+
const elapsed = timestamp - startTimeRef.current;
|
|
124
|
+
const newProgress = Math.min(elapsed / duration * 100, 100);
|
|
125
|
+
setProgress(newProgress);
|
|
126
|
+
if (newProgress >= 100) {
|
|
127
|
+
goToNext();
|
|
128
|
+
setProgress(0);
|
|
129
|
+
pausedProgressRef.current = 0;
|
|
130
|
+
startTimeRef.current = null;
|
|
131
|
+
} else {
|
|
132
|
+
animationFrameRef.current = requestAnimationFrame(animate);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
animationFrameRef.current = requestAnimationFrame(animate);
|
|
136
|
+
return () => {
|
|
137
|
+
if (animationFrameRef.current) {
|
|
138
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}, [autoPlay, duration, isPaused, goToNext]);
|
|
142
|
+
const handleMouseEnter = React.useCallback(() => {
|
|
143
|
+
if (pauseOnHover) {
|
|
144
|
+
pausedProgressRef.current = progress;
|
|
145
|
+
startTimeRef.current = null;
|
|
146
|
+
setIsPaused(true);
|
|
147
|
+
}
|
|
148
|
+
}, [pauseOnHover, progress]);
|
|
149
|
+
const handleMouseLeave = React.useCallback(() => {
|
|
150
|
+
if (pauseOnHover) {
|
|
151
|
+
setIsPaused(false);
|
|
152
|
+
}
|
|
153
|
+
}, [pauseOnHover]);
|
|
154
|
+
React.useEffect(() => {
|
|
155
|
+
if (isControlled) {
|
|
156
|
+
setProgress(0);
|
|
157
|
+
pausedProgressRef.current = 0;
|
|
158
|
+
startTimeRef.current = null;
|
|
159
|
+
}
|
|
160
|
+
}, [isControlled]);
|
|
161
|
+
const getDotWidth = (isActive) => {
|
|
162
|
+
if (isActive) {
|
|
163
|
+
switch (size) {
|
|
164
|
+
case "sm":
|
|
165
|
+
return "w-16";
|
|
166
|
+
case "lg":
|
|
167
|
+
return "w-36";
|
|
168
|
+
default:
|
|
169
|
+
return "w-28";
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
switch (size) {
|
|
173
|
+
case "sm":
|
|
174
|
+
return "w-6";
|
|
175
|
+
case "lg":
|
|
176
|
+
return "w-16";
|
|
177
|
+
default:
|
|
178
|
+
return "w-10";
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const getInactiveClasses = () => {
|
|
182
|
+
if (variant === "ivory") {
|
|
183
|
+
return "bg-alpha-white-30 hover:bg-alpha-white-60";
|
|
184
|
+
}
|
|
185
|
+
return "bg-alpha-black-30 hover:bg-alpha-black-60";
|
|
186
|
+
};
|
|
187
|
+
const getActiveTrackClass = () => {
|
|
188
|
+
if (variant === "ivory") {
|
|
189
|
+
return "bg-alpha-white-30";
|
|
190
|
+
}
|
|
191
|
+
return "bg-alpha-black-30";
|
|
192
|
+
};
|
|
193
|
+
const getProgressFillClass = () => {
|
|
194
|
+
if (variant === "ivory") {
|
|
195
|
+
return "bg-gray-50";
|
|
196
|
+
}
|
|
197
|
+
return "bg-gray-1200";
|
|
198
|
+
};
|
|
199
|
+
return /* @__PURE__ */ jsx(
|
|
200
|
+
"div",
|
|
201
|
+
{
|
|
202
|
+
ref,
|
|
203
|
+
role: "tablist",
|
|
204
|
+
"aria-label": "Page indicators",
|
|
205
|
+
className: pagerControlVariants({ size, class: className }),
|
|
206
|
+
onMouseEnter: handleMouseEnter,
|
|
207
|
+
onMouseLeave: handleMouseLeave,
|
|
208
|
+
...props,
|
|
209
|
+
children: Array.from({ length: count }, (_, index) => {
|
|
210
|
+
const isActive = index === safeActiveIndex;
|
|
211
|
+
if (isActive) {
|
|
212
|
+
return /* @__PURE__ */ jsx(
|
|
213
|
+
"button",
|
|
214
|
+
{
|
|
215
|
+
type: "button",
|
|
216
|
+
role: "tab",
|
|
217
|
+
"aria-selected": true,
|
|
218
|
+
"aria-label": `Page ${index + 1} of ${count}, current`,
|
|
219
|
+
className: cn(
|
|
220
|
+
"relative cursor-pointer overflow-hidden rounded-full transition-all duration-500 ease-[cubic-bezier(0.23,1,0.32,1)]",
|
|
221
|
+
dotBaseVariants({ size, variant }),
|
|
222
|
+
getDotWidth(true),
|
|
223
|
+
getActiveTrackClass()
|
|
224
|
+
),
|
|
225
|
+
onClick: () => goToIndex(index),
|
|
226
|
+
children: /* @__PURE__ */ jsx(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
className: cn(
|
|
230
|
+
"absolute top-0 bottom-0 left-0 h-full rounded-full",
|
|
231
|
+
getProgressFillClass()
|
|
232
|
+
),
|
|
233
|
+
style: {
|
|
234
|
+
width: autoPlay && duration > 0 ? `${progress}%` : "100%"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
},
|
|
239
|
+
index
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
return /* @__PURE__ */ jsx(
|
|
243
|
+
"button",
|
|
244
|
+
{
|
|
245
|
+
type: "button",
|
|
246
|
+
role: "tab",
|
|
247
|
+
"aria-selected": false,
|
|
248
|
+
"aria-label": `Go to page ${index + 1} of ${count}`,
|
|
249
|
+
className: cn(
|
|
250
|
+
dotBaseVariants({ size, variant }),
|
|
251
|
+
getDotWidth(false),
|
|
252
|
+
getInactiveClasses()
|
|
253
|
+
),
|
|
254
|
+
onClick: () => goToIndex(index)
|
|
255
|
+
},
|
|
256
|
+
index
|
|
257
|
+
);
|
|
258
|
+
})
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
PagerControl.displayName = "PagerControl";
|
|
264
|
+
|
|
265
|
+
export { PagerControl, pagerControlVariants };
|
|
266
|
+
//# sourceMappingURL=index.js.map
|
|
267
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/atoms/pager-control/pager-control.tsx"],"names":["twMerge"],"mappings":";;;;;;AAKO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAOA,MAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACDA,IAAM,uBAAuB,EAAA,CAAG;AAAA,EAC/B,IAAA,EAAM,mBAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACT,IAAA,EAAM;AAAA;AAAA,MAEL,EAAA,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A,CAAgB,EAAE,IAAA,EAAM,OAAA,EAAS,CAAA;AAAA,gBACjC,YAAY,KAAK,CAAA;AAAA,gBACjB,kBAAA;AAAmB,eACpB;AAAA,cACA,OAAA,EAAS,MAAM,SAAA,CAAU,KAAK;AAAA,aAAA;AAAA,YAVzB;AAAA,WAWN;AAAA,QAEF,CAAC;AAAA;AAAA,KACF;AAAA,EAEF;AACD;AACA,YAAA,CAAa,WAAA,GAAc,cAAA","file":"index.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { cnBase as twMerge } from \"tailwind-variants\";\n\nexport { twMerge };\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\nimport { cn } from \"@/lib/utils\";\n\nconst pagerControlVariants = tv({\n\tbase: \"flex items-center\",\n\tvariants: {\n\t\tsize: {\n\t\t\t// Uses primitive spacing tokens\n\t\t\tsm: \"gap-2\",\n\t\t\tdefault: \"gap-2\",\n\t\t\tlg: \"gap-4\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tsize: \"default\",\n\t},\n});\n\nconst dotBaseVariants = tv({\n\tbase: \"cursor-pointer rounded-full transition-all duration-500 ease-[cubic-bezier(0.23,1,0.32,1)]\",\n\tvariants: {\n\t\tsize: {\n\t\t\t// Uses primitive spacing tokens\n\t\t\tsm: \"h-6\",\n\t\t\tdefault: \"h-10\",\n\t\t\tlg: \"h-16\",\n\t\t},\n\t\tvariant: {\n\t\t\tcharcoal: \"\",\n\t\t\tivory: \"\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tsize: \"default\",\n\t\tvariant: \"charcoal\",\n\t},\n});\n\nexport interface PagerControlProps\n\textends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\">,\n\t\tVariantProps<typeof pagerControlVariants>,\n\t\tVariantProps<typeof dotBaseVariants> {\n\t/**\n\t * Total number of pages/items\n\t */\n\tcount: number;\n\t/**\n\t * Current active page index (0-based)\n\t */\n\tactiveIndex?: number;\n\t/**\n\t * Duration in milliseconds for each page before auto-advancing\n\t * Set to 0 to disable auto-advance\n\t * @default 5000\n\t */\n\tduration?: number;\n\t/**\n\t * Whether the pager should auto-advance\n\t * @default true\n\t */\n\tautoPlay?: boolean;\n\t/**\n\t * Callback when the active page changes\n\t */\n\tonChange?: (index: number) => void;\n\t/**\n\t * Whether to pause auto-advance on hover\n\t * @default true\n\t */\n\tpauseOnHover?: boolean;\n\t/**\n\t * Whether to loop back to the first page after the last\n\t * @default true\n\t */\n\tloop?: boolean;\n}\n\n/**\n * PagerControl component for indicating progress through a series of pages/slides.\n *\n * Features smooth width transitions when switching between dots and an animated\n * progress fill on the active dot that shows time remaining before auto-advancing\n * (similar to Apple's carousel indicators).\n *\n * Variants:\n * - charcoal: Dark dots (for light backgrounds)\n * - ivory: Light dots (for dark backgrounds)\n *\n * Sizes:\n * - sm: Small dots (6px height)\n * - default: Medium dots (10px height)\n * - lg: Large dots (16px height)\n */\nconst PagerControl = React.forwardRef<HTMLDivElement, PagerControlProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tsize,\n\t\t\tvariant,\n\t\t\tcount,\n\t\t\tactiveIndex: controlledIndex,\n\t\t\tduration = 5000,\n\t\t\tautoPlay = true,\n\t\t\tonChange,\n\t\t\tpauseOnHover = true,\n\t\t\tloop = true,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst [internalIndex, setInternalIndex] = React.useState(0);\n\t\tconst [isPaused, setIsPaused] = React.useState(false);\n\t\tconst [progress, setProgress] = React.useState(0);\n\n\t\t// Use controlled index if provided, otherwise use internal state\n\t\tconst activeIndex =\n\t\t\tcontrolledIndex !== undefined ? controlledIndex : internalIndex;\n\t\tconst isControlled = controlledIndex !== undefined;\n\n\t\t// Development warnings for common issues\n\t\tReact.useEffect(() => {\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tif (count < 1) {\n\t\t\t\t\tconsole.warn(\"PagerControl: count must be at least 1\");\n\t\t\t\t}\n\t\t\t\tif (controlledIndex !== undefined && controlledIndex >= count) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`PagerControl: activeIndex (${controlledIndex}) is out of bounds. Must be less than count (${count}).`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (controlledIndex !== undefined && controlledIndex < 0) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`PagerControl: activeIndex (${controlledIndex}) cannot be negative.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (isControlled && onChange === undefined) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\"PagerControl: controlled mode (activeIndex provided) requires an onChange handler.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}, [count, controlledIndex, isControlled, onChange]);\n\n\t\t// Clamp activeIndex to valid bounds\n\t\tconst safeActiveIndex = Math.max(0, Math.min(activeIndex, count - 1));\n\n\t\tconst animationFrameRef = React.useRef<number | null>(null);\n\t\tconst startTimeRef = React.useRef<number | null>(null);\n\t\tconst pausedProgressRef = React.useRef<number>(0);\n\n\t\tconst goToNext = React.useCallback(() => {\n\t\t\tconst nextIndex = safeActiveIndex + 1;\n\t\t\tif (nextIndex >= count) {\n\t\t\t\tif (loop) {\n\t\t\t\t\tif (!isControlled) setInternalIndex(0);\n\t\t\t\t\tonChange?.(0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!isControlled) setInternalIndex(nextIndex);\n\t\t\t\tonChange?.(nextIndex);\n\t\t\t}\n\t\t}, [safeActiveIndex, count, loop, isControlled, onChange]);\n\n\t\tconst goToIndex = React.useCallback(\n\t\t\t(index: number) => {\n\t\t\t\tif (!isControlled) setInternalIndex(index);\n\t\t\t\tonChange?.(index);\n\t\t\t\t// Reset progress when manually changing\n\t\t\t\tsetProgress(0);\n\t\t\t\tpausedProgressRef.current = 0;\n\t\t\t\tstartTimeRef.current = null;\n\t\t\t},\n\t\t\t[isControlled, onChange],\n\t\t);\n\n\t\t// Animation loop for smooth progress fill\n\t\tReact.useEffect(() => {\n\t\t\tif (!autoPlay || duration <= 0 || isPaused) {\n\t\t\t\tif (animationFrameRef.current) {\n\t\t\t\t\tcancelAnimationFrame(animationFrameRef.current);\n\t\t\t\t\tanimationFrameRef.current = null;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst animate = (timestamp: number) => {\n\t\t\t\tif (startTimeRef.current === null) {\n\t\t\t\t\tstartTimeRef.current =\n\t\t\t\t\t\ttimestamp - (pausedProgressRef.current / 100) * duration;\n\t\t\t\t}\n\n\t\t\t\tconst elapsed = timestamp - startTimeRef.current;\n\t\t\t\tconst newProgress = Math.min((elapsed / duration) * 100, 100);\n\t\t\t\tsetProgress(newProgress);\n\n\t\t\t\tif (newProgress >= 100) {\n\t\t\t\t\tgoToNext();\n\t\t\t\t\t// Reset for next cycle\n\t\t\t\t\tsetProgress(0);\n\t\t\t\t\tpausedProgressRef.current = 0;\n\t\t\t\t\tstartTimeRef.current = null;\n\t\t\t\t} else {\n\t\t\t\t\tanimationFrameRef.current = requestAnimationFrame(animate);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tanimationFrameRef.current = requestAnimationFrame(animate);\n\n\t\t\treturn () => {\n\t\t\t\tif (animationFrameRef.current) {\n\t\t\t\t\tcancelAnimationFrame(animationFrameRef.current);\n\t\t\t\t}\n\t\t\t};\n\t\t}, [autoPlay, duration, isPaused, goToNext]);\n\n\t\t// Handle pause/resume\n\t\tconst handleMouseEnter = React.useCallback(() => {\n\t\t\tif (pauseOnHover) {\n\t\t\t\tpausedProgressRef.current = progress;\n\t\t\t\tstartTimeRef.current = null;\n\t\t\t\tsetIsPaused(true);\n\t\t\t}\n\t\t}, [pauseOnHover, progress]);\n\n\t\tconst handleMouseLeave = React.useCallback(() => {\n\t\t\tif (pauseOnHover) {\n\t\t\t\tsetIsPaused(false);\n\t\t\t}\n\t\t}, [pauseOnHover]);\n\n\t\t// Reset progress when activeIndex changes externally (controlled mode)\n\t\tReact.useEffect(() => {\n\t\t\tif (isControlled) {\n\t\t\t\tsetProgress(0);\n\t\t\t\tpausedProgressRef.current = 0;\n\t\t\t\tstartTimeRef.current = null;\n\t\t\t}\n\t\t}, [isControlled]);\n\n\t\t// Get dot dimensions based on size - uses primitive spacing tokens\n\t\tconst getDotWidth = (isActive: boolean) => {\n\t\t\tif (isActive) {\n\t\t\t\tswitch (size) {\n\t\t\t\t\tcase \"sm\":\n\t\t\t\t\t\treturn \"w-16\";\n\t\t\t\t\tcase \"lg\":\n\t\t\t\t\t\treturn \"w-36\";\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn \"w-28\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch (size) {\n\t\t\t\tcase \"sm\":\n\t\t\t\t\treturn \"w-6\";\n\t\t\t\tcase \"lg\":\n\t\t\t\t\treturn \"w-16\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn \"w-10\";\n\t\t\t}\n\t\t};\n\n\t\t// Get background classes for inactive dots\n\t\tconst getInactiveClasses = () => {\n\t\t\tif (variant === \"ivory\") {\n\t\t\t\treturn \"bg-alpha-white-30 hover:bg-alpha-white-60\";\n\t\t\t}\n\t\t\treturn \"bg-alpha-black-30 hover:bg-alpha-black-60\";\n\t\t};\n\n\t\t// Get background class for active dot (the track/background)\n\t\tconst getActiveTrackClass = () => {\n\t\t\tif (variant === \"ivory\") {\n\t\t\t\treturn \"bg-alpha-white-30\";\n\t\t\t}\n\t\t\treturn \"bg-alpha-black-30\";\n\t\t};\n\n\t\t// Get fill color for the progress indicator\n\t\tconst getProgressFillClass = () => {\n\t\t\tif (variant === \"ivory\") {\n\t\t\t\treturn \"bg-gray-50\";\n\t\t\t}\n\t\t\treturn \"bg-gray-1200\";\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\trole=\"tablist\"\n\t\t\t\taria-label=\"Page indicators\"\n\t\t\t\tclassName={pagerControlVariants({ size, class: className })}\n\t\t\t\tonMouseEnter={handleMouseEnter}\n\t\t\t\tonMouseLeave={handleMouseLeave}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{Array.from({ length: count }, (_, index) => {\n\t\t\t\t\tconst isActive = index === safeActiveIndex;\n\n\t\t\t\t\tif (isActive) {\n\t\t\t\t\t\t// Active dot with progress fill\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: Pagination dots have fixed order based on count\n\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\taria-selected={true}\n\t\t\t\t\t\t\t\taria-label={`Page ${index + 1} of ${count}, current`}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\"relative cursor-pointer overflow-hidden rounded-full transition-all duration-500 ease-[cubic-bezier(0.23,1,0.32,1)]\",\n\t\t\t\t\t\t\t\t\tdotBaseVariants({ size, variant }),\n\t\t\t\t\t\t\t\t\tgetDotWidth(true),\n\t\t\t\t\t\t\t\t\tgetActiveTrackClass(),\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tonClick={() => goToIndex(index)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{/* Progress fill */}\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\"absolute top-0 bottom-0 left-0 h-full rounded-full\",\n\t\t\t\t\t\t\t\t\t\tgetProgressFillClass(),\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\twidth: autoPlay && duration > 0 ? `${progress}%` : \"100%\",\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Inactive dot\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: Pagination dots have fixed order based on count\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\taria-selected={false}\n\t\t\t\t\t\t\taria-label={`Go to page ${index + 1} of ${count}`}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\tdotBaseVariants({ size, variant }),\n\t\t\t\t\t\t\t\tgetDotWidth(false),\n\t\t\t\t\t\t\t\tgetInactiveClasses(),\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tonClick={() => goToIndex(index)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t);\n\t},\n);\nPagerControl.displayName = \"PagerControl\";\n\nexport { PagerControl, pagerControlVariants };\n"]}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import { VariantProps } from 'tailwind-variants';
|
|
4
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
5
|
+
import { Popover as Popover$1 } from '@base-ui-components/react/popover';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Popover popup variants
|
|
10
|
+
*
|
|
11
|
+
* Uses semantic overlay tokens for themeable styling:
|
|
12
|
+
* - color.overlay.background - Light background
|
|
13
|
+
* - color.overlay.border - Subtle border
|
|
14
|
+
* - color.overlay.text - Primary text
|
|
15
|
+
* - surface.overlay.radius - Rounded corners
|
|
16
|
+
* - spatial.component.overlay.padding/gap - Consistent spacing
|
|
17
|
+
*/
|
|
18
|
+
declare const popoverPopupVariants: tailwind_variants.TVReturnType<{
|
|
19
|
+
variant: {
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
}, undefined, string[], tailwind_variants_dist_config_js.TVConfig<{
|
|
23
|
+
variant: {
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
}, {
|
|
27
|
+
variant: {
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
}>, {
|
|
31
|
+
variant: {
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
35
|
+
variant: {
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
}, undefined, string[], tailwind_variants_dist_config_js.TVConfig<{
|
|
39
|
+
variant: {
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
}, {
|
|
43
|
+
variant: {
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
}>, unknown, unknown, undefined>>;
|
|
47
|
+
/**
|
|
48
|
+
* Popover arrow variants - uses shared floating arrow variants
|
|
49
|
+
*/
|
|
50
|
+
declare const popoverArrowVariants: tailwind_variants.TVReturnType<{} | {} | {}, undefined, string[], tailwind_variants_dist_config_js.TVConfig<unknown, {} | {}>, {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, string[], tailwind_variants_dist_config_js.TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>;
|
|
51
|
+
interface PopoverRootProps extends Popover$1.Root.Props {
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Popover Root
|
|
56
|
+
*
|
|
57
|
+
* Groups all popover parts. Does not render an element.
|
|
58
|
+
*/
|
|
59
|
+
declare const PopoverRoot: ({ children, ...props }: PopoverRootProps) => react_jsx_runtime.JSX.Element;
|
|
60
|
+
interface PopoverTriggerProps extends React.ComponentProps<typeof Popover$1.Trigger> {
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Popover Trigger
|
|
65
|
+
*
|
|
66
|
+
* The element that triggers the popover on click.
|
|
67
|
+
* Renders as the child element with popover behavior attached.
|
|
68
|
+
* When children is a single React element, uses `render` prop to avoid wrapper element.
|
|
69
|
+
*/
|
|
70
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<PopoverTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
interface PopoverPortalProps extends Popover$1.Portal.Props {
|
|
72
|
+
children: React.ReactNode;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Popover Portal
|
|
76
|
+
*
|
|
77
|
+
* Renders the popover popup in a portal outside the DOM hierarchy.
|
|
78
|
+
*/
|
|
79
|
+
declare const PopoverPortal: ({ children, ...props }: PopoverPortalProps) => react_jsx_runtime.JSX.Element;
|
|
80
|
+
interface PopoverBackdropProps extends Omit<React.ComponentProps<typeof Popover$1.Backdrop>, "className"> {
|
|
81
|
+
className?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Popover Backdrop
|
|
85
|
+
*
|
|
86
|
+
* Optional backdrop element that can be used to close the popover on click.
|
|
87
|
+
*/
|
|
88
|
+
declare const PopoverBackdrop: React.ForwardRefExoticComponent<Omit<PopoverBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
89
|
+
interface PopoverPositionerProps extends Omit<React.ComponentProps<typeof Popover$1.Positioner>, "className"> {
|
|
90
|
+
className?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Popover Positioner
|
|
94
|
+
*
|
|
95
|
+
* Positions the popover popup relative to the trigger.
|
|
96
|
+
*/
|
|
97
|
+
declare const PopoverPositioner: React.ForwardRefExoticComponent<Omit<PopoverPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
98
|
+
interface PopoverPopupProps extends Omit<React.ComponentProps<typeof Popover$1.Popup>, "className">, VariantProps<typeof popoverPopupVariants> {
|
|
99
|
+
className?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Popover Popup
|
|
103
|
+
*
|
|
104
|
+
* The popover content container with styled appearance.
|
|
105
|
+
*/
|
|
106
|
+
declare const PopoverPopup: React.ForwardRefExoticComponent<Omit<PopoverPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
107
|
+
interface PopoverArrowProps extends Omit<React.ComponentProps<typeof Popover$1.Arrow>, "className"> {
|
|
108
|
+
className?: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Popover Arrow
|
|
112
|
+
*
|
|
113
|
+
* Visual pointer element for the popover.
|
|
114
|
+
* Uses shared FloatingArrowSvg with overlay color tokens for fill and border.
|
|
115
|
+
*/
|
|
116
|
+
declare const PopoverArrow: React.ForwardRefExoticComponent<Omit<PopoverArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
117
|
+
interface PopoverTitleProps extends Omit<React.ComponentProps<typeof Popover$1.Title>, "className"> {
|
|
118
|
+
className?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Popover Title
|
|
122
|
+
*
|
|
123
|
+
* Title element for the popover content.
|
|
124
|
+
*/
|
|
125
|
+
declare const PopoverTitle: React.ForwardRefExoticComponent<Omit<PopoverTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
126
|
+
interface PopoverDescriptionProps extends Omit<React.ComponentProps<typeof Popover$1.Description>, "className"> {
|
|
127
|
+
className?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Popover Description
|
|
131
|
+
*
|
|
132
|
+
* Description element for the popover content.
|
|
133
|
+
*/
|
|
134
|
+
declare const PopoverDescription: React.ForwardRefExoticComponent<Omit<PopoverDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
135
|
+
interface PopoverCloseProps extends Omit<React.ComponentProps<typeof Popover$1.Close>, "className"> {
|
|
136
|
+
className?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Popover Close
|
|
140
|
+
*
|
|
141
|
+
* Close button for the popover.
|
|
142
|
+
*/
|
|
143
|
+
declare const PopoverClose: React.ForwardRefExoticComponent<Omit<PopoverCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
144
|
+
interface PopoverProps {
|
|
145
|
+
/** The content to show in the popover */
|
|
146
|
+
children: React.ReactNode;
|
|
147
|
+
/** The element that triggers the popover */
|
|
148
|
+
trigger: React.ReactNode;
|
|
149
|
+
/** Title for the popover (optional) */
|
|
150
|
+
title?: React.ReactNode;
|
|
151
|
+
/** Side of the trigger to show the popover */
|
|
152
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
153
|
+
/** Offset from the trigger */
|
|
154
|
+
sideOffset?: number;
|
|
155
|
+
/** Alignment along the side */
|
|
156
|
+
align?: "start" | "center" | "end";
|
|
157
|
+
/** Whether to show an arrow */
|
|
158
|
+
showArrow?: boolean;
|
|
159
|
+
/** Whether to show a close button */
|
|
160
|
+
showClose?: boolean;
|
|
161
|
+
/** Controlled open state */
|
|
162
|
+
open?: boolean;
|
|
163
|
+
/** Default open state */
|
|
164
|
+
defaultOpen?: boolean;
|
|
165
|
+
/** Callback when open state changes */
|
|
166
|
+
onOpenChange?: (open: boolean) => void;
|
|
167
|
+
/** Additional className for the popup */
|
|
168
|
+
className?: string;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Popover
|
|
172
|
+
*
|
|
173
|
+
* A simple, pre-composed popover component for common use cases.
|
|
174
|
+
* For more complex needs, use the compound components directly.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```tsx
|
|
178
|
+
* <Popover
|
|
179
|
+
* trigger={<Button>Click me</Button>}
|
|
180
|
+
* title="Popover Title"
|
|
181
|
+
* >
|
|
182
|
+
* <p>This is the popover content.</p>
|
|
183
|
+
* </Popover>
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
declare const Popover: ({ children, trigger, title, side, sideOffset, align, showArrow, showClose, open, defaultOpen, onOpenChange, className, }: PopoverProps) => react_jsx_runtime.JSX.Element;
|
|
187
|
+
declare const PopoverParts: (({ children, ...props }: PopoverRootProps) => react_jsx_runtime.JSX.Element) & {
|
|
188
|
+
Root: ({ children, ...props }: PopoverRootProps) => react_jsx_runtime.JSX.Element;
|
|
189
|
+
Trigger: React.ForwardRefExoticComponent<Omit<PopoverTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
190
|
+
Portal: ({ children, ...props }: PopoverPortalProps) => react_jsx_runtime.JSX.Element;
|
|
191
|
+
Backdrop: React.ForwardRefExoticComponent<Omit<PopoverBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
192
|
+
Positioner: React.ForwardRefExoticComponent<Omit<PopoverPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
193
|
+
Popup: React.ForwardRefExoticComponent<Omit<PopoverPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
194
|
+
Arrow: React.ForwardRefExoticComponent<Omit<PopoverArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
195
|
+
Title: React.ForwardRefExoticComponent<Omit<PopoverTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
196
|
+
Description: React.ForwardRefExoticComponent<Omit<PopoverDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
197
|
+
Close: React.ForwardRefExoticComponent<Omit<PopoverCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export { Popover, PopoverArrow, type PopoverArrowProps, PopoverBackdrop, type PopoverBackdropProps, PopoverClose, type PopoverCloseProps, PopoverDescription, type PopoverDescriptionProps, PopoverParts, PopoverPopup, type PopoverPopupProps, PopoverPortal, type PopoverPortalProps, PopoverPositioner, type PopoverPositionerProps, type PopoverProps, PopoverRoot, type PopoverRootProps, PopoverTitle, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerProps, popoverArrowVariants, popoverPopupVariants };
|