@compa11y/react 0.1.0 → 0.1.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 +487 -5
- package/dist/chunk-36S2JYVF.cjs +1 -0
- package/dist/chunk-AJ7JSWUT.cjs +1 -0
- package/dist/chunk-DDFEION3.cjs +1 -0
- package/dist/chunk-DWU3PTJO.cjs +1 -0
- package/dist/chunk-FD4F6ONU.cjs +1 -0
- package/dist/chunk-FOVHQAY5.cjs +1 -0
- package/dist/chunk-GITBIGD4.js +1 -0
- package/dist/chunk-HEA4NAOM.js +1 -0
- package/dist/chunk-IZ7LLPPV.js +1 -0
- package/dist/chunk-JS3UD7KS.cjs +1 -0
- package/dist/chunk-MAR6RBHF.cjs +1 -0
- package/dist/chunk-MD4AVTLT.js +1 -0
- package/dist/chunk-SB6ASQ36.js +1 -0
- package/dist/chunk-VMM4K2K4.js +1 -0
- package/dist/chunk-XEJXACWE.js +1 -0
- package/dist/chunk-ZB3SYGHE.js +1 -0
- package/dist/components/combobox/index.cjs +1 -31
- package/dist/components/combobox/index.js +1 -6
- package/dist/components/dialog/index.cjs +1 -46
- package/dist/components/dialog/index.js +1 -5
- package/dist/components/menu/index.cjs +1 -46
- package/dist/components/menu/index.js +1 -5
- package/dist/components/tabs/index.cjs +1 -35
- package/dist/components/tabs/index.js +1 -6
- package/dist/components/toast/index.cjs +1 -24
- package/dist/components/toast/index.js +1 -3
- package/dist/index.cjs +1 -702
- package/dist/index.d.cts +760 -3
- package/dist/index.d.ts +760 -3
- package/dist/index.js +1 -430
- package/package.json +44 -3
- package/dist/chunk-2S4C6FGA.js +0 -380
- package/dist/chunk-2S4C6FGA.js.map +0 -1
- package/dist/chunk-52J4Z3QD.cjs +0 -45
- package/dist/chunk-52J4Z3QD.cjs.map +0 -1
- package/dist/chunk-C7QK2I7H.js +0 -373
- package/dist/chunk-C7QK2I7H.js.map +0 -1
- package/dist/chunk-D2UMS62N.cjs +0 -245
- package/dist/chunk-D2UMS62N.cjs.map +0 -1
- package/dist/chunk-E265U2RK.js +0 -234
- package/dist/chunk-E265U2RK.js.map +0 -1
- package/dist/chunk-E4XJRXWM.js +0 -215
- package/dist/chunk-E4XJRXWM.js.map +0 -1
- package/dist/chunk-GDLOJH6K.cjs +0 -110
- package/dist/chunk-GDLOJH6K.cjs.map +0 -1
- package/dist/chunk-IR46CNNY.cjs +0 -329
- package/dist/chunk-IR46CNNY.cjs.map +0 -1
- package/dist/chunk-JXYOE7SH.js +0 -103
- package/dist/chunk-JXYOE7SH.js.map +0 -1
- package/dist/chunk-O3YYQZ5O.js +0 -317
- package/dist/chunk-O3YYQZ5O.js.map +0 -1
- package/dist/chunk-OIVTOU4Z.cjs +0 -386
- package/dist/chunk-OIVTOU4Z.cjs.map +0 -1
- package/dist/chunk-OND5B7UG.js +0 -85
- package/dist/chunk-OND5B7UG.js.map +0 -1
- package/dist/chunk-R4FR6M6I.cjs +0 -383
- package/dist/chunk-R4FR6M6I.cjs.map +0 -1
- package/dist/chunk-RBDQCIS7.cjs +0 -89
- package/dist/chunk-RBDQCIS7.cjs.map +0 -1
- package/dist/chunk-SOBS7MIH.cjs +0 -220
- package/dist/chunk-SOBS7MIH.cjs.map +0 -1
- package/dist/chunk-WURPAE3R.js +0 -41
- package/dist/chunk-WURPAE3R.js.map +0 -1
- package/dist/components/combobox/index.cjs.map +0 -1
- package/dist/components/combobox/index.js.map +0 -1
- package/dist/components/dialog/index.cjs.map +0 -1
- package/dist/components/dialog/index.js.map +0 -1
- package/dist/components/menu/index.cjs.map +0 -1
- package/dist/components/menu/index.js.map +0 -1
- package/dist/components/tabs/index.cjs.map +0 -1
- package/dist/components/tabs/index.js.map +0 -1
- package/dist/components/toast/index.cjs.map +0 -1
- package/dist/components/toast/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,702 +1 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkIR46CNNY_cjs = require('./chunk-IR46CNNY.cjs');
|
|
4
|
-
var chunkR4FR6M6I_cjs = require('./chunk-R4FR6M6I.cjs');
|
|
5
|
-
var chunkD2UMS62N_cjs = require('./chunk-D2UMS62N.cjs');
|
|
6
|
-
var chunkSOBS7MIH_cjs = require('./chunk-SOBS7MIH.cjs');
|
|
7
|
-
var chunkOIVTOU4Z_cjs = require('./chunk-OIVTOU4Z.cjs');
|
|
8
|
-
var chunkRBDQCIS7_cjs = require('./chunk-RBDQCIS7.cjs');
|
|
9
|
-
var chunkGDLOJH6K_cjs = require('./chunk-GDLOJH6K.cjs');
|
|
10
|
-
var chunk52J4Z3QD_cjs = require('./chunk-52J4Z3QD.cjs');
|
|
11
|
-
var react = require('react');
|
|
12
|
-
var core = require('@compa11y/core');
|
|
13
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
14
|
-
|
|
15
|
-
function useFocusVisible() {
|
|
16
|
-
const [isFocusVisible, setIsFocusVisible] = react.useState(false);
|
|
17
|
-
react.useEffect(() => {
|
|
18
|
-
const cleanup = core.initFocusVisible();
|
|
19
|
-
return cleanup;
|
|
20
|
-
}, []);
|
|
21
|
-
const handleFocus = react.useCallback(() => {
|
|
22
|
-
setIsFocusVisible(core.isFocusVisible());
|
|
23
|
-
}, []);
|
|
24
|
-
const handleBlur = react.useCallback(() => {
|
|
25
|
-
setIsFocusVisible(false);
|
|
26
|
-
}, []);
|
|
27
|
-
return {
|
|
28
|
-
isFocusVisible,
|
|
29
|
-
focusProps: {
|
|
30
|
-
onFocus: handleFocus,
|
|
31
|
-
onBlur: handleBlur
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function useFocusManager(options = {}) {
|
|
36
|
-
const {
|
|
37
|
-
autoFocus = false,
|
|
38
|
-
restoreFocus = false,
|
|
39
|
-
focusVisible = true
|
|
40
|
-
} = options;
|
|
41
|
-
const elementRef = react.useCallback(
|
|
42
|
-
(node) => {
|
|
43
|
-
if (node && autoFocus) {
|
|
44
|
-
requestAnimationFrame(() => {
|
|
45
|
-
if (focusVisible) {
|
|
46
|
-
core.focusWithVisibleRing(node);
|
|
47
|
-
} else {
|
|
48
|
-
node.focus();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
[autoFocus, focusVisible]
|
|
54
|
-
);
|
|
55
|
-
react.useEffect(() => {
|
|
56
|
-
if (!restoreFocus) return;
|
|
57
|
-
const previousElement = document.activeElement;
|
|
58
|
-
return () => {
|
|
59
|
-
if (previousElement && previousElement.focus) {
|
|
60
|
-
previousElement.focus();
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}, [restoreFocus]);
|
|
64
|
-
return elementRef;
|
|
65
|
-
}
|
|
66
|
-
function useFocusControl() {
|
|
67
|
-
const elementRef = react.useCallback((_node) => {
|
|
68
|
-
}, []);
|
|
69
|
-
const focus = react.useCallback((options) => {
|
|
70
|
-
const element = elementRef;
|
|
71
|
-
if (element.current) {
|
|
72
|
-
if (options?.visible) {
|
|
73
|
-
core.focusWithVisibleRing(element.current);
|
|
74
|
-
} else {
|
|
75
|
-
element.current.focus();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}, []);
|
|
79
|
-
return { ref: elementRef, focus };
|
|
80
|
-
}
|
|
81
|
-
function useFocusWithin() {
|
|
82
|
-
const [hasFocus, setHasFocus] = react.useState(false);
|
|
83
|
-
const containerRef = react.useCallback((_node) => {
|
|
84
|
-
}, []);
|
|
85
|
-
const handleFocusIn = react.useCallback(() => {
|
|
86
|
-
setHasFocus(true);
|
|
87
|
-
}, []);
|
|
88
|
-
const handleFocusOut = react.useCallback((event) => {
|
|
89
|
-
const container = event.currentTarget;
|
|
90
|
-
const relatedTarget = event.relatedTarget;
|
|
91
|
-
if (!relatedTarget || !container.contains(relatedTarget)) {
|
|
92
|
-
setHasFocus(false);
|
|
93
|
-
}
|
|
94
|
-
}, []);
|
|
95
|
-
return {
|
|
96
|
-
ref: containerRef,
|
|
97
|
-
hasFocus,
|
|
98
|
-
focusWithinProps: {
|
|
99
|
-
onFocus: handleFocusIn,
|
|
100
|
-
onBlur: handleFocusOut
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
function useRovingTabindex(options) {
|
|
105
|
-
const {
|
|
106
|
-
itemCount,
|
|
107
|
-
initialIndex = 0,
|
|
108
|
-
wrap = true,
|
|
109
|
-
orientation = "both",
|
|
110
|
-
onChange
|
|
111
|
-
} = options;
|
|
112
|
-
const [activeIndex, setActiveIndex] = react.useState(initialIndex);
|
|
113
|
-
const itemRefs = react.useRef([]);
|
|
114
|
-
react.useEffect(() => {
|
|
115
|
-
if (activeIndex >= itemCount) {
|
|
116
|
-
setActiveIndex(Math.max(0, itemCount - 1));
|
|
117
|
-
}
|
|
118
|
-
}, [itemCount, activeIndex]);
|
|
119
|
-
const moveTo = react.useCallback(
|
|
120
|
-
(index) => {
|
|
121
|
-
let newIndex = index;
|
|
122
|
-
if (newIndex < 0) {
|
|
123
|
-
newIndex = wrap ? itemCount - 1 : 0;
|
|
124
|
-
} else if (newIndex >= itemCount) {
|
|
125
|
-
newIndex = wrap ? 0 : itemCount - 1;
|
|
126
|
-
}
|
|
127
|
-
setActiveIndex(newIndex);
|
|
128
|
-
onChange?.(newIndex);
|
|
129
|
-
const element = itemRefs.current[newIndex];
|
|
130
|
-
element?.focus();
|
|
131
|
-
},
|
|
132
|
-
[itemCount, wrap, onChange]
|
|
133
|
-
);
|
|
134
|
-
const handleKeyDown = react.useCallback(
|
|
135
|
-
(event, index) => {
|
|
136
|
-
let handled = false;
|
|
137
|
-
switch (event.key) {
|
|
138
|
-
case "ArrowRight":
|
|
139
|
-
if (orientation === "horizontal" || orientation === "both") {
|
|
140
|
-
moveTo(index + 1);
|
|
141
|
-
handled = true;
|
|
142
|
-
}
|
|
143
|
-
break;
|
|
144
|
-
case "ArrowLeft":
|
|
145
|
-
if (orientation === "horizontal" || orientation === "both") {
|
|
146
|
-
moveTo(index - 1);
|
|
147
|
-
handled = true;
|
|
148
|
-
}
|
|
149
|
-
break;
|
|
150
|
-
case "ArrowDown":
|
|
151
|
-
if (orientation === "vertical" || orientation === "both") {
|
|
152
|
-
moveTo(index + 1);
|
|
153
|
-
handled = true;
|
|
154
|
-
}
|
|
155
|
-
break;
|
|
156
|
-
case "ArrowUp":
|
|
157
|
-
if (orientation === "vertical" || orientation === "both") {
|
|
158
|
-
moveTo(index - 1);
|
|
159
|
-
handled = true;
|
|
160
|
-
}
|
|
161
|
-
break;
|
|
162
|
-
case "Home":
|
|
163
|
-
moveTo(0);
|
|
164
|
-
handled = true;
|
|
165
|
-
break;
|
|
166
|
-
case "End":
|
|
167
|
-
moveTo(itemCount - 1);
|
|
168
|
-
handled = true;
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
if (handled) {
|
|
172
|
-
event.preventDefault();
|
|
173
|
-
event.stopPropagation();
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
[orientation, moveTo, itemCount]
|
|
177
|
-
);
|
|
178
|
-
const getItemProps = react.useCallback(
|
|
179
|
-
(index) => ({
|
|
180
|
-
ref: (el) => {
|
|
181
|
-
itemRefs.current[index] = el;
|
|
182
|
-
},
|
|
183
|
-
tabIndex: index === activeIndex ? 0 : -1,
|
|
184
|
-
onKeyDown: (event) => handleKeyDown(event, index),
|
|
185
|
-
onFocus: () => {
|
|
186
|
-
if (index !== activeIndex) {
|
|
187
|
-
setActiveIndex(index);
|
|
188
|
-
onChange?.(index);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}),
|
|
192
|
-
[activeIndex, handleKeyDown, onChange]
|
|
193
|
-
);
|
|
194
|
-
return {
|
|
195
|
-
activeIndex,
|
|
196
|
-
setActiveIndex: moveTo,
|
|
197
|
-
getItemProps,
|
|
198
|
-
first: () => moveTo(0),
|
|
199
|
-
last: () => moveTo(itemCount - 1),
|
|
200
|
-
next: () => moveTo(activeIndex + 1),
|
|
201
|
-
previous: () => moveTo(activeIndex - 1)
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
function useRovingTabindexMap(ids, options = {}) {
|
|
205
|
-
const roving = useRovingTabindex({
|
|
206
|
-
...options,
|
|
207
|
-
itemCount: ids.length
|
|
208
|
-
});
|
|
209
|
-
const getItemProps = react.useCallback(
|
|
210
|
-
(id) => {
|
|
211
|
-
const index = ids.indexOf(id);
|
|
212
|
-
if (index === -1) {
|
|
213
|
-
throw new Error(`Unknown item ID: ${id}`);
|
|
214
|
-
}
|
|
215
|
-
return roving.getItemProps(index);
|
|
216
|
-
},
|
|
217
|
-
[ids, roving]
|
|
218
|
-
);
|
|
219
|
-
const activeId = ids[roving.activeIndex];
|
|
220
|
-
return {
|
|
221
|
-
...roving,
|
|
222
|
-
activeId,
|
|
223
|
-
getItemProps,
|
|
224
|
-
setActiveId: (id) => {
|
|
225
|
-
const index = ids.indexOf(id);
|
|
226
|
-
if (index !== -1) {
|
|
227
|
-
roving.setActiveIndex(index);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
var warnings = core.createComponentWarnings("Switch");
|
|
233
|
-
var Switch = react.forwardRef(
|
|
234
|
-
function Switch2({
|
|
235
|
-
checked: controlledChecked,
|
|
236
|
-
defaultChecked = false,
|
|
237
|
-
onCheckedChange,
|
|
238
|
-
label,
|
|
239
|
-
disabled = false,
|
|
240
|
-
unstyled = false,
|
|
241
|
-
className,
|
|
242
|
-
size = "md",
|
|
243
|
-
"aria-label": ariaLabel,
|
|
244
|
-
"aria-labelledby": ariaLabelledby,
|
|
245
|
-
onClick,
|
|
246
|
-
...props
|
|
247
|
-
}, ref) {
|
|
248
|
-
const id = chunk52J4Z3QD_cjs.useId("switch");
|
|
249
|
-
const labelId = `${id}-label`;
|
|
250
|
-
const { announce: announce2 } = chunkRBDQCIS7_cjs.useAnnouncer();
|
|
251
|
-
const [uncontrolledChecked, setUncontrolledChecked] = react.useState(defaultChecked);
|
|
252
|
-
const isControlled = controlledChecked !== void 0;
|
|
253
|
-
const checked = isControlled ? controlledChecked : uncontrolledChecked;
|
|
254
|
-
react.useEffect(() => {
|
|
255
|
-
if (!label && !ariaLabel && !ariaLabelledby) {
|
|
256
|
-
warnings.warning(
|
|
257
|
-
"Switch has no accessible label. Screen readers need this to identify the switch.",
|
|
258
|
-
'Add label="Description", aria-label="...", or aria-labelledby="..."'
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
}, [label, ariaLabel, ariaLabelledby]);
|
|
262
|
-
const toggleSwitch = react.useCallback(() => {
|
|
263
|
-
if (disabled) return;
|
|
264
|
-
const newChecked = !checked;
|
|
265
|
-
if (!isControlled) {
|
|
266
|
-
setUncontrolledChecked(newChecked);
|
|
267
|
-
}
|
|
268
|
-
onCheckedChange?.(newChecked);
|
|
269
|
-
const labelText = label || ariaLabel || "Switch";
|
|
270
|
-
announce2(`${labelText} ${newChecked ? "on" : "off"}`);
|
|
271
|
-
}, [
|
|
272
|
-
checked,
|
|
273
|
-
disabled,
|
|
274
|
-
isControlled,
|
|
275
|
-
onCheckedChange,
|
|
276
|
-
label,
|
|
277
|
-
ariaLabel,
|
|
278
|
-
announce2
|
|
279
|
-
]);
|
|
280
|
-
const handleClick = react.useCallback(
|
|
281
|
-
(event) => {
|
|
282
|
-
onClick?.(event);
|
|
283
|
-
if (!event.defaultPrevented) {
|
|
284
|
-
toggleSwitch();
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
[onClick, toggleSwitch]
|
|
288
|
-
);
|
|
289
|
-
const keyboardProps = chunkGDLOJH6K_cjs.useKeyboard(
|
|
290
|
-
{
|
|
291
|
-
" ": () => {
|
|
292
|
-
toggleSwitch();
|
|
293
|
-
},
|
|
294
|
-
Enter: () => {
|
|
295
|
-
toggleSwitch();
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
{ preventDefault: true }
|
|
299
|
-
);
|
|
300
|
-
const handleKeyDown = (event) => {
|
|
301
|
-
props.onKeyDown?.(event);
|
|
302
|
-
if (!event.defaultPrevented) {
|
|
303
|
-
keyboardProps.onKeyDown(event);
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
const computedAriaLabel = ariaLabel;
|
|
307
|
-
const computedAriaLabelledby = ariaLabelledby || (label ? labelId : void 0);
|
|
308
|
-
const wrapperStructuralStyles = {
|
|
309
|
-
display: "inline-flex",
|
|
310
|
-
alignItems: "center"
|
|
311
|
-
};
|
|
312
|
-
const sizes = {
|
|
313
|
-
sm: { width: 32, height: 18, thumb: 14, translate: 14 },
|
|
314
|
-
md: { width: 44, height: 24, thumb: 20, translate: 20 },
|
|
315
|
-
lg: { width: 56, height: 30, thumb: 26, translate: 26 }
|
|
316
|
-
};
|
|
317
|
-
const sizeConfig = sizes[size];
|
|
318
|
-
const trackStructuralStyles = {
|
|
319
|
-
position: "relative",
|
|
320
|
-
display: "inline-flex",
|
|
321
|
-
alignItems: "center",
|
|
322
|
-
flexShrink: 0,
|
|
323
|
-
width: sizeConfig.width,
|
|
324
|
-
height: sizeConfig.height,
|
|
325
|
-
border: "none",
|
|
326
|
-
padding: 2,
|
|
327
|
-
cursor: disabled ? "not-allowed" : "pointer"
|
|
328
|
-
};
|
|
329
|
-
const trackVisualStyles = unstyled ? {} : {
|
|
330
|
-
backgroundColor: checked ? "#0066cc" : "#d1d5db",
|
|
331
|
-
borderRadius: sizeConfig.height / 2,
|
|
332
|
-
transition: "background-color 0.2s ease",
|
|
333
|
-
opacity: disabled ? 0.5 : 1
|
|
334
|
-
};
|
|
335
|
-
const thumbStructuralStyles = {
|
|
336
|
-
position: "absolute",
|
|
337
|
-
left: 2,
|
|
338
|
-
width: sizeConfig.thumb,
|
|
339
|
-
height: sizeConfig.thumb,
|
|
340
|
-
pointerEvents: "none",
|
|
341
|
-
transform: checked ? `translateX(${sizeConfig.translate}px)` : "translateX(0)"
|
|
342
|
-
};
|
|
343
|
-
const thumbVisualStyles = unstyled ? {} : {
|
|
344
|
-
backgroundColor: "white",
|
|
345
|
-
borderRadius: "50%",
|
|
346
|
-
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
|
|
347
|
-
transition: "transform 0.2s ease"
|
|
348
|
-
};
|
|
349
|
-
const labelStyles = unstyled ? {
|
|
350
|
-
marginLeft: 8,
|
|
351
|
-
userSelect: "none",
|
|
352
|
-
cursor: disabled ? "not-allowed" : "pointer"
|
|
353
|
-
} : {
|
|
354
|
-
marginLeft: 8,
|
|
355
|
-
userSelect: "none",
|
|
356
|
-
cursor: disabled ? "not-allowed" : "pointer",
|
|
357
|
-
opacity: disabled ? 0.5 : 1
|
|
358
|
-
};
|
|
359
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
360
|
-
"div",
|
|
361
|
-
{
|
|
362
|
-
style: wrapperStructuralStyles,
|
|
363
|
-
"data-compa11y-switch-wrapper": true,
|
|
364
|
-
"data-size": size,
|
|
365
|
-
children: [
|
|
366
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
367
|
-
"button",
|
|
368
|
-
{
|
|
369
|
-
ref,
|
|
370
|
-
type: "button",
|
|
371
|
-
role: "switch",
|
|
372
|
-
"aria-checked": checked,
|
|
373
|
-
"aria-label": computedAriaLabel,
|
|
374
|
-
"aria-labelledby": computedAriaLabelledby,
|
|
375
|
-
disabled,
|
|
376
|
-
onClick: handleClick,
|
|
377
|
-
onKeyDown: handleKeyDown,
|
|
378
|
-
className,
|
|
379
|
-
style: { ...trackStructuralStyles, ...trackVisualStyles },
|
|
380
|
-
tabIndex: disabled ? -1 : 0,
|
|
381
|
-
"data-compa11y-switch": true,
|
|
382
|
-
"data-checked": checked,
|
|
383
|
-
"data-disabled": disabled || void 0,
|
|
384
|
-
"data-size": size,
|
|
385
|
-
...props,
|
|
386
|
-
onFocus: (e) => {
|
|
387
|
-
if (!unstyled) {
|
|
388
|
-
e.currentTarget.style.outline = "2px solid #0066cc";
|
|
389
|
-
e.currentTarget.style.outlineOffset = "2px";
|
|
390
|
-
}
|
|
391
|
-
props.onFocus?.(e);
|
|
392
|
-
},
|
|
393
|
-
onBlur: (e) => {
|
|
394
|
-
if (!unstyled) {
|
|
395
|
-
e.currentTarget.style.outline = "none";
|
|
396
|
-
}
|
|
397
|
-
props.onBlur?.(e);
|
|
398
|
-
},
|
|
399
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
400
|
-
"span",
|
|
401
|
-
{
|
|
402
|
-
style: { ...thumbStructuralStyles, ...thumbVisualStyles },
|
|
403
|
-
"data-compa11y-switch-thumb": true,
|
|
404
|
-
"aria-hidden": "true"
|
|
405
|
-
}
|
|
406
|
-
)
|
|
407
|
-
}
|
|
408
|
-
),
|
|
409
|
-
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
410
|
-
"label",
|
|
411
|
-
{
|
|
412
|
-
id: labelId,
|
|
413
|
-
onClick: disabled ? void 0 : () => toggleSwitch(),
|
|
414
|
-
style: labelStyles,
|
|
415
|
-
"data-compa11y-switch-label": true,
|
|
416
|
-
children: label
|
|
417
|
-
}
|
|
418
|
-
)
|
|
419
|
-
]
|
|
420
|
-
}
|
|
421
|
-
);
|
|
422
|
-
}
|
|
423
|
-
);
|
|
424
|
-
Switch.displayName = "Switch";
|
|
425
|
-
|
|
426
|
-
Object.defineProperty(exports, "Dialog", {
|
|
427
|
-
enumerable: true,
|
|
428
|
-
get: function () { return chunkIR46CNNY_cjs.DialogCompound; }
|
|
429
|
-
});
|
|
430
|
-
Object.defineProperty(exports, "DialogActions", {
|
|
431
|
-
enumerable: true,
|
|
432
|
-
get: function () { return chunkIR46CNNY_cjs.DialogActions; }
|
|
433
|
-
});
|
|
434
|
-
Object.defineProperty(exports, "DialogBase", {
|
|
435
|
-
enumerable: true,
|
|
436
|
-
get: function () { return chunkIR46CNNY_cjs.Dialog; }
|
|
437
|
-
});
|
|
438
|
-
Object.defineProperty(exports, "DialogClose", {
|
|
439
|
-
enumerable: true,
|
|
440
|
-
get: function () { return chunkIR46CNNY_cjs.DialogClose; }
|
|
441
|
-
});
|
|
442
|
-
Object.defineProperty(exports, "DialogContent", {
|
|
443
|
-
enumerable: true,
|
|
444
|
-
get: function () { return chunkIR46CNNY_cjs.DialogContent; }
|
|
445
|
-
});
|
|
446
|
-
Object.defineProperty(exports, "DialogDescription", {
|
|
447
|
-
enumerable: true,
|
|
448
|
-
get: function () { return chunkIR46CNNY_cjs.DialogDescription; }
|
|
449
|
-
});
|
|
450
|
-
Object.defineProperty(exports, "DialogTitle", {
|
|
451
|
-
enumerable: true,
|
|
452
|
-
get: function () { return chunkIR46CNNY_cjs.DialogTitle; }
|
|
453
|
-
});
|
|
454
|
-
Object.defineProperty(exports, "DialogTrigger", {
|
|
455
|
-
enumerable: true,
|
|
456
|
-
get: function () { return chunkIR46CNNY_cjs.DialogTrigger; }
|
|
457
|
-
});
|
|
458
|
-
Object.defineProperty(exports, "useDialogContext", {
|
|
459
|
-
enumerable: true,
|
|
460
|
-
get: function () { return chunkIR46CNNY_cjs.useDialogContext; }
|
|
461
|
-
});
|
|
462
|
-
Object.defineProperty(exports, "useFocusTrap", {
|
|
463
|
-
enumerable: true,
|
|
464
|
-
get: function () { return chunkIR46CNNY_cjs.useFocusTrap; }
|
|
465
|
-
});
|
|
466
|
-
Object.defineProperty(exports, "useFocusTrapControls", {
|
|
467
|
-
enumerable: true,
|
|
468
|
-
get: function () { return chunkIR46CNNY_cjs.useFocusTrapControls; }
|
|
469
|
-
});
|
|
470
|
-
Object.defineProperty(exports, "ActionMenu", {
|
|
471
|
-
enumerable: true,
|
|
472
|
-
get: function () { return chunkR4FR6M6I_cjs.ActionMenuCompound; }
|
|
473
|
-
});
|
|
474
|
-
Object.defineProperty(exports, "ActionMenuBase", {
|
|
475
|
-
enumerable: true,
|
|
476
|
-
get: function () { return chunkR4FR6M6I_cjs.ActionMenu; }
|
|
477
|
-
});
|
|
478
|
-
Object.defineProperty(exports, "ActionMenuContent", {
|
|
479
|
-
enumerable: true,
|
|
480
|
-
get: function () { return chunkR4FR6M6I_cjs.ActionMenuContent; }
|
|
481
|
-
});
|
|
482
|
-
Object.defineProperty(exports, "ActionMenuItem", {
|
|
483
|
-
enumerable: true,
|
|
484
|
-
get: function () { return chunkR4FR6M6I_cjs.ActionMenuItem; }
|
|
485
|
-
});
|
|
486
|
-
Object.defineProperty(exports, "ActionMenuLabel", {
|
|
487
|
-
enumerable: true,
|
|
488
|
-
get: function () { return chunkR4FR6M6I_cjs.ActionMenuLabel; }
|
|
489
|
-
});
|
|
490
|
-
Object.defineProperty(exports, "ActionMenuSeparator", {
|
|
491
|
-
enumerable: true,
|
|
492
|
-
get: function () { return chunkR4FR6M6I_cjs.ActionMenuSeparator; }
|
|
493
|
-
});
|
|
494
|
-
Object.defineProperty(exports, "ActionMenuTrigger", {
|
|
495
|
-
enumerable: true,
|
|
496
|
-
get: function () { return chunkR4FR6M6I_cjs.ActionMenuTrigger; }
|
|
497
|
-
});
|
|
498
|
-
Object.defineProperty(exports, "useActionMenuContext", {
|
|
499
|
-
enumerable: true,
|
|
500
|
-
get: function () { return chunkR4FR6M6I_cjs.useActionMenuContext; }
|
|
501
|
-
});
|
|
502
|
-
Object.defineProperty(exports, "Tab", {
|
|
503
|
-
enumerable: true,
|
|
504
|
-
get: function () { return chunkD2UMS62N_cjs.Tab; }
|
|
505
|
-
});
|
|
506
|
-
Object.defineProperty(exports, "TabList", {
|
|
507
|
-
enumerable: true,
|
|
508
|
-
get: function () { return chunkD2UMS62N_cjs.TabList; }
|
|
509
|
-
});
|
|
510
|
-
Object.defineProperty(exports, "TabPanel", {
|
|
511
|
-
enumerable: true,
|
|
512
|
-
get: function () { return chunkD2UMS62N_cjs.TabPanel; }
|
|
513
|
-
});
|
|
514
|
-
Object.defineProperty(exports, "Tabs", {
|
|
515
|
-
enumerable: true,
|
|
516
|
-
get: function () { return chunkD2UMS62N_cjs.TabsCompound; }
|
|
517
|
-
});
|
|
518
|
-
Object.defineProperty(exports, "TabsBase", {
|
|
519
|
-
enumerable: true,
|
|
520
|
-
get: function () { return chunkD2UMS62N_cjs.Tabs; }
|
|
521
|
-
});
|
|
522
|
-
Object.defineProperty(exports, "useTabsContext", {
|
|
523
|
-
enumerable: true,
|
|
524
|
-
get: function () { return chunkD2UMS62N_cjs.useTabsContext; }
|
|
525
|
-
});
|
|
526
|
-
Object.defineProperty(exports, "ToastProvider", {
|
|
527
|
-
enumerable: true,
|
|
528
|
-
get: function () { return chunkSOBS7MIH_cjs.ToastProvider; }
|
|
529
|
-
});
|
|
530
|
-
Object.defineProperty(exports, "ToastViewport", {
|
|
531
|
-
enumerable: true,
|
|
532
|
-
get: function () { return chunkSOBS7MIH_cjs.ToastViewport; }
|
|
533
|
-
});
|
|
534
|
-
Object.defineProperty(exports, "useToast", {
|
|
535
|
-
enumerable: true,
|
|
536
|
-
get: function () { return chunkSOBS7MIH_cjs.useToast; }
|
|
537
|
-
});
|
|
538
|
-
Object.defineProperty(exports, "useToastHelpers", {
|
|
539
|
-
enumerable: true,
|
|
540
|
-
get: function () { return chunkSOBS7MIH_cjs.useToastHelpers; }
|
|
541
|
-
});
|
|
542
|
-
Object.defineProperty(exports, "Combobox", {
|
|
543
|
-
enumerable: true,
|
|
544
|
-
get: function () { return chunkOIVTOU4Z_cjs.ComboboxCompound; }
|
|
545
|
-
});
|
|
546
|
-
Object.defineProperty(exports, "ComboboxBase", {
|
|
547
|
-
enumerable: true,
|
|
548
|
-
get: function () { return chunkOIVTOU4Z_cjs.Combobox; }
|
|
549
|
-
});
|
|
550
|
-
Object.defineProperty(exports, "ComboboxInput", {
|
|
551
|
-
enumerable: true,
|
|
552
|
-
get: function () { return chunkOIVTOU4Z_cjs.ComboboxInput; }
|
|
553
|
-
});
|
|
554
|
-
Object.defineProperty(exports, "ComboboxListbox", {
|
|
555
|
-
enumerable: true,
|
|
556
|
-
get: function () { return chunkOIVTOU4Z_cjs.ComboboxListbox; }
|
|
557
|
-
});
|
|
558
|
-
Object.defineProperty(exports, "ComboboxOption", {
|
|
559
|
-
enumerable: true,
|
|
560
|
-
get: function () { return chunkOIVTOU4Z_cjs.ComboboxOption; }
|
|
561
|
-
});
|
|
562
|
-
Object.defineProperty(exports, "useAnnounceLoading", {
|
|
563
|
-
enumerable: true,
|
|
564
|
-
get: function () { return chunkRBDQCIS7_cjs.useAnnounceLoading; }
|
|
565
|
-
});
|
|
566
|
-
Object.defineProperty(exports, "useAnnounceOnChange", {
|
|
567
|
-
enumerable: true,
|
|
568
|
-
get: function () { return chunkRBDQCIS7_cjs.useAnnounceOnChange; }
|
|
569
|
-
});
|
|
570
|
-
Object.defineProperty(exports, "useAnnouncer", {
|
|
571
|
-
enumerable: true,
|
|
572
|
-
get: function () { return chunkRBDQCIS7_cjs.useAnnouncer; }
|
|
573
|
-
});
|
|
574
|
-
Object.defineProperty(exports, "useGridKeyboard", {
|
|
575
|
-
enumerable: true,
|
|
576
|
-
get: function () { return chunkGDLOJH6K_cjs.useGridKeyboard; }
|
|
577
|
-
});
|
|
578
|
-
Object.defineProperty(exports, "useKeyPressed", {
|
|
579
|
-
enumerable: true,
|
|
580
|
-
get: function () { return chunkGDLOJH6K_cjs.useKeyPressed; }
|
|
581
|
-
});
|
|
582
|
-
Object.defineProperty(exports, "useKeyboard", {
|
|
583
|
-
enumerable: true,
|
|
584
|
-
get: function () { return chunkGDLOJH6K_cjs.useKeyboard; }
|
|
585
|
-
});
|
|
586
|
-
Object.defineProperty(exports, "useMenuKeyboard", {
|
|
587
|
-
enumerable: true,
|
|
588
|
-
get: function () { return chunkGDLOJH6K_cjs.useMenuKeyboard; }
|
|
589
|
-
});
|
|
590
|
-
Object.defineProperty(exports, "useTabsKeyboard", {
|
|
591
|
-
enumerable: true,
|
|
592
|
-
get: function () { return chunkGDLOJH6K_cjs.useTabsKeyboard; }
|
|
593
|
-
});
|
|
594
|
-
Object.defineProperty(exports, "useTypeAhead", {
|
|
595
|
-
enumerable: true,
|
|
596
|
-
get: function () { return chunkGDLOJH6K_cjs.useTypeAhead; }
|
|
597
|
-
});
|
|
598
|
-
Object.defineProperty(exports, "useId", {
|
|
599
|
-
enumerable: true,
|
|
600
|
-
get: function () { return chunk52J4Z3QD_cjs.useId; }
|
|
601
|
-
});
|
|
602
|
-
Object.defineProperty(exports, "useIdScope", {
|
|
603
|
-
enumerable: true,
|
|
604
|
-
get: function () { return chunk52J4Z3QD_cjs.useIdScope; }
|
|
605
|
-
});
|
|
606
|
-
Object.defineProperty(exports, "useIds", {
|
|
607
|
-
enumerable: true,
|
|
608
|
-
get: function () { return chunk52J4Z3QD_cjs.useIds; }
|
|
609
|
-
});
|
|
610
|
-
Object.defineProperty(exports, "announce", {
|
|
611
|
-
enumerable: true,
|
|
612
|
-
get: function () { return core.announce; }
|
|
613
|
-
});
|
|
614
|
-
Object.defineProperty(exports, "announceAssertive", {
|
|
615
|
-
enumerable: true,
|
|
616
|
-
get: function () { return core.announceAssertive; }
|
|
617
|
-
});
|
|
618
|
-
Object.defineProperty(exports, "announceError", {
|
|
619
|
-
enumerable: true,
|
|
620
|
-
get: function () { return core.announceError; }
|
|
621
|
-
});
|
|
622
|
-
Object.defineProperty(exports, "announcePolite", {
|
|
623
|
-
enumerable: true,
|
|
624
|
-
get: function () { return core.announcePolite; }
|
|
625
|
-
});
|
|
626
|
-
Object.defineProperty(exports, "announceProgress", {
|
|
627
|
-
enumerable: true,
|
|
628
|
-
get: function () { return core.announceProgress; }
|
|
629
|
-
});
|
|
630
|
-
Object.defineProperty(exports, "announceStatus", {
|
|
631
|
-
enumerable: true,
|
|
632
|
-
get: function () { return core.announceStatus; }
|
|
633
|
-
});
|
|
634
|
-
Object.defineProperty(exports, "aria", {
|
|
635
|
-
enumerable: true,
|
|
636
|
-
get: function () { return core.aria; }
|
|
637
|
-
});
|
|
638
|
-
Object.defineProperty(exports, "buildAriaProps", {
|
|
639
|
-
enumerable: true,
|
|
640
|
-
get: function () { return core.buildAriaProps; }
|
|
641
|
-
});
|
|
642
|
-
Object.defineProperty(exports, "checks", {
|
|
643
|
-
enumerable: true,
|
|
644
|
-
get: function () { return core.checks; }
|
|
645
|
-
});
|
|
646
|
-
Object.defineProperty(exports, "createComponentWarnings", {
|
|
647
|
-
enumerable: true,
|
|
648
|
-
get: function () { return core.createComponentWarnings; }
|
|
649
|
-
});
|
|
650
|
-
Object.defineProperty(exports, "hasAccessibleName", {
|
|
651
|
-
enumerable: true,
|
|
652
|
-
get: function () { return core.hasAccessibleName; }
|
|
653
|
-
});
|
|
654
|
-
Object.defineProperty(exports, "isAndroid", {
|
|
655
|
-
enumerable: true,
|
|
656
|
-
get: function () { return core.isAndroid; }
|
|
657
|
-
});
|
|
658
|
-
Object.defineProperty(exports, "isBrowser", {
|
|
659
|
-
enumerable: true,
|
|
660
|
-
get: function () { return core.isBrowser; }
|
|
661
|
-
});
|
|
662
|
-
Object.defineProperty(exports, "isIOS", {
|
|
663
|
-
enumerable: true,
|
|
664
|
-
get: function () { return core.isIOS; }
|
|
665
|
-
});
|
|
666
|
-
Object.defineProperty(exports, "isMac", {
|
|
667
|
-
enumerable: true,
|
|
668
|
-
get: function () { return core.isMac; }
|
|
669
|
-
});
|
|
670
|
-
Object.defineProperty(exports, "mergeAriaIds", {
|
|
671
|
-
enumerable: true,
|
|
672
|
-
get: function () { return core.mergeAriaIds; }
|
|
673
|
-
});
|
|
674
|
-
Object.defineProperty(exports, "prefersDarkMode", {
|
|
675
|
-
enumerable: true,
|
|
676
|
-
get: function () { return core.prefersDarkMode; }
|
|
677
|
-
});
|
|
678
|
-
Object.defineProperty(exports, "prefersHighContrast", {
|
|
679
|
-
enumerable: true,
|
|
680
|
-
get: function () { return core.prefersHighContrast; }
|
|
681
|
-
});
|
|
682
|
-
Object.defineProperty(exports, "prefersReducedMotion", {
|
|
683
|
-
enumerable: true,
|
|
684
|
-
get: function () { return core.prefersReducedMotion; }
|
|
685
|
-
});
|
|
686
|
-
Object.defineProperty(exports, "setWarningHandler", {
|
|
687
|
-
enumerable: true,
|
|
688
|
-
get: function () { return core.setWarningHandler; }
|
|
689
|
-
});
|
|
690
|
-
Object.defineProperty(exports, "warn", {
|
|
691
|
-
enumerable: true,
|
|
692
|
-
get: function () { return core.warn; }
|
|
693
|
-
});
|
|
694
|
-
exports.Switch = Switch;
|
|
695
|
-
exports.useFocusControl = useFocusControl;
|
|
696
|
-
exports.useFocusManager = useFocusManager;
|
|
697
|
-
exports.useFocusVisible = useFocusVisible;
|
|
698
|
-
exports.useFocusWithin = useFocusWithin;
|
|
699
|
-
exports.useRovingTabindex = useRovingTabindex;
|
|
700
|
-
exports.useRovingTabindexMap = useRovingTabindexMap;
|
|
701
|
-
//# sourceMappingURL=index.cjs.map
|
|
702
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var chunkFD4F6ONU_cjs=require('./chunk-FD4F6ONU.cjs'),chunk36S2JYVF_cjs=require('./chunk-36S2JYVF.cjs'),chunkDWU3PTJO_cjs=require('./chunk-DWU3PTJO.cjs'),chunkDDFEION3_cjs=require('./chunk-DDFEION3.cjs'),chunkFOVHQAY5_cjs=require('./chunk-FOVHQAY5.cjs'),chunkJS3UD7KS_cjs=require('./chunk-JS3UD7KS.cjs'),chunkAJ7JSWUT_cjs=require('./chunk-AJ7JSWUT.cjs'),chunkMAR6RBHF_cjs=require('./chunk-MAR6RBHF.cjs'),react=require('react'),core=require('@compa11y/core'),jsxRuntime=require('react/jsx-runtime');function te(){let[x,t]=react.useState(false);react.useEffect(()=>core.initFocusVisible(),[]);let c=react.useCallback(()=>{t(core.isFocusVisible());},[]),r=react.useCallback(()=>{t(false);},[]);return {isFocusVisible:x,focusProps:{onFocus:c,onBlur:r}}}function Ot(x={}){let{autoFocus:t=false,restoreFocus:c=false,focusVisible:r=true}=x,e=react.useCallback(n=>{n&&t&&requestAnimationFrame(()=>{r?core.focusWithVisibleRing(n):n.focus();});},[t,r]);return react.useEffect(()=>{if(!c)return;let n=document.activeElement;return ()=>{n&&n.focus&&n.focus();}},[c]),e}function At(){let x=react.useCallback(c=>{},[]),t=react.useCallback(c=>{let r=x;r.current&&(c?.visible?core.focusWithVisibleRing(r.current):r.current.focus());},[]);return {ref:x,focus:t}}function Vt(){let[x,t]=react.useState(false),c=react.useCallback(n=>{},[]),r=react.useCallback(()=>{t(true);},[]),e=react.useCallback(n=>{let i=n.currentTarget,l=n.relatedTarget;(!l||!i.contains(l))&&t(false);},[]);return {ref:c,hasFocus:x,focusWithinProps:{onFocus:r,onBlur:e}}}function Qe(x){let{itemCount:t,initialIndex:c=0,wrap:r=true,orientation:e="both",onChange:n}=x,[i,l]=react.useState(c),o=react.useRef([]);react.useEffect(()=>{i>=t&&l(Math.max(0,t-1));},[t,i]);let a=react.useCallback(b=>{let f=b;f<0?f=r?t-1:0:f>=t&&(f=r?0:t-1),l(f),n?.(f),o.current[f]?.focus();},[t,r,n]),p=react.useCallback((b,f)=>{let m=false;switch(b.key){case "ArrowRight":(e==="horizontal"||e==="both")&&(a(f+1),m=true);break;case "ArrowLeft":(e==="horizontal"||e==="both")&&(a(f-1),m=true);break;case "ArrowDown":(e==="vertical"||e==="both")&&(a(f+1),m=true);break;case "ArrowUp":(e==="vertical"||e==="both")&&(a(f-1),m=true);break;case "Home":a(0),m=true;break;case "End":a(t-1),m=true;break}m&&(b.preventDefault(),b.stopPropagation());},[e,a,t]),s=react.useCallback(b=>({ref:f=>{o.current[b]=f;},tabIndex:b===i?0:-1,onKeyDown:f=>p(f,b),onFocus:()=>{b!==i&&(l(b),n?.(b));}}),[i,p,n]);return {activeIndex:i,setActiveIndex:a,getItemProps:s,first:()=>a(0),last:()=>a(t-1),next:()=>a(i+1),previous:()=>a(i-1)}}function Nt(x,t={}){let c=Qe({...t,itemCount:x.length}),r=react.useCallback(n=>{let i=x.indexOf(n);if(i===-1)throw new Error(`Unknown item ID: ${n}`);return c.getItemProps(i)},[x,c]),e=x[c.activeIndex];return {...c,activeId:e,getItemProps:r,setActiveId:n=>{let i=x.indexOf(n);i!==-1&&c.setActiveIndex(i);}}}var nn=core.createComponentWarnings("Select"),Gt=react.createContext(null);function nt(){let x=react.useContext(Gt);if(!x)throw new Error("Select compound components must be used within a Select component");return x}function Dt(x,t,c){let r=x.length,e=t+c;e<0&&(e=r-1),e>=r&&(e=0);let n=e;for(;x[e]?.disabled;)if(e+=c,e<0&&(e=r-1),e>=r&&(e=0),e===n)return -1;return e}function Bt(x){return x.findIndex(t=>!t.disabled)}function zt(x){for(let t=x.length-1;t>=0;t--)if(!x[t]?.disabled)return t;return -1}function at({options:x,value:t,defaultValue:c,onValueChange:r,disabled:e=false,placeholder:n="Select an option...","aria-label":i,"aria-labelledby":l,children:o}){let[a,p]=react.useState(c??null),[s,b]=react.useState(false),[f,m]=react.useState(-1),u=react.useRef(null),T=t!==void 0?t:a,C=chunkMAR6RBHF_cjs.a("select-trigger"),S=chunkMAR6RBHF_cjs.a("select-listbox"),R=chunkMAR6RBHF_cjs.a("select-option"),d=react.useCallback(P=>{t===void 0&&p(P),r?.(P);},[t,r]),y=react.useCallback(P=>`${R}-${P}`,[R]),w=react.useCallback(P=>{d(P.value),b(false),m(-1),u.current?.focus();},[d]);react.useEffect(()=>{!i&&!l&&nn.warning("Select has no accessible label.","Add aria-label or aria-labelledby prop.");},[i,l]);let E={selectedValue:T,setSelectedValue:d,isOpen:s,setIsOpen:b,highlightedIndex:f,setHighlightedIndex:m,options:x,triggerId:C,listboxId:S,getOptionId:y,onSelect:w,triggerRef:u,placeholder:n,disabled:e};return jsxRuntime.jsx(Gt.Provider,{value:E,children:jsxRuntime.jsx("div",{"data-compa11y-select":true,"data-disabled":e||void 0,children:o})})}var rt=react.forwardRef(function({onKeyDown:t,onClick:c,onBlur:r,...e},n){let{selectedValue:i,isOpen:l,setIsOpen:o,highlightedIndex:a,setHighlightedIndex:p,options:s,triggerId:b,listboxId:f,getOptionId:m,onSelect:u,triggerRef:T,placeholder:C,disabled:S}=nt(),{announce:R}=chunkJS3UD7KS_cjs.a(),d=chunkAJ7JSWUT_cjs.e(s.map(h=>h.label),h=>{let F=s.findIndex(H=>H.label===h&&!H.disabled);F>=0&&(l||o(true),p(F));},{disabled:S}),y=react.useCallback((h=false)=>{o(true);let F=s.findIndex(H=>H.value===i);F>=0?p(F):p(h?zt(s):Bt(s));},[s,i,o,p]),w=chunkAJ7JSWUT_cjs.a({ArrowDown:()=>{if(!l)y();else {let h=Dt(s,a,1);h>=0&&p(h);}},ArrowUp:()=>{if(!l)y(true);else {let h=Dt(s,a,-1);h>=0&&p(h);}},Enter:()=>{if(l&&a>=0){let h=s[a];h&&!h.disabled&&(u(h),R(`${h.label} selected`));}else l||y();}," ":()=>{if(l&&a>=0){let h=s[a];h&&!h.disabled&&(u(h),R(`${h.label} selected`));}else l||y();},Escape:()=>{l&&(o(false),p(-1));},Home:()=>{l&&p(Bt(s));},End:()=>{l&&p(zt(s));},Tab:()=>(l&&(o(false),p(-1)),false)},{preventDefault:true,stopPropagation:false}),E=h=>{t?.(h),h.defaultPrevented||w.onKeyDown(h),h.defaultPrevented||d.onKeyDown(h);},P=h=>{c?.(h),!h.defaultPrevented&&!S&&(l?(o(false),p(-1)):y());},O=h=>{r?.(h),setTimeout(()=>{o(false),p(-1);},150);},N=l&&a>=0?m(a):void 0,A=s.find(h=>h.value===i),$=A?.label??C,g=react.useCallback(h=>{T.current=h,typeof n=="function"?n(h):n&&(n.current=h);},[n,T]);return jsxRuntime.jsxs("button",{ref:g,id:b,type:"button",role:"combobox","aria-expanded":l,"aria-controls":f,"aria-haspopup":"listbox","aria-activedescendant":N,disabled:S,onKeyDown:E,onClick:P,onBlur:O,"data-compa11y-select-trigger":true,"data-placeholder":!A||void 0,...e,children:[jsxRuntime.jsx("span",{"data-compa11y-select-value":true,children:$}),jsxRuntime.jsx("span",{"aria-hidden":"true","data-compa11y-select-chevron":true,children:"\u25BC"})]})}),it=react.forwardRef(function({children:t,style:c,...r},e){let{isOpen:n,options:i,listboxId:l,triggerId:o}=nt(),{announce:a}=chunkJS3UD7KS_cjs.a(),p=react.useRef(null),[s,b]=react.useState("bottom");react.useEffect(()=>{n&&a(`${i.length} option${i.length===1?"":"s"} available`);},[n,i.length,a]),react.useLayoutEffect(()=>{if(n&&p.current){let C=p.current.getBoundingClientRect(),R=window.innerHeight-C.top,d=C.top,y=Math.min(C.height,200);R<y+50&&d>R?b("top"):b("bottom");}},[n]);let f=T=>{T.preventDefault();},m=react.useCallback(T=>{p.current=T,typeof e=="function"?e(T):e&&(e.current=T);},[e]);return n?jsxRuntime.jsx("ul",{ref:m,id:l,role:"listbox","aria-labelledby":o,style:{...c,...s==="top"?{bottom:"100%",top:"auto",marginBottom:"4px",marginTop:0}:{}},onMouseDown:f,"data-compa11y-select-listbox":true,"data-position":s,...r,children:t??i.map((T,C)=>jsxRuntime.jsx(ke,{option:T,index:C},T.value))}):null}),ke=react.forwardRef(function({option:t,index:c,onClick:r,onMouseEnter:e,...n},i){let{selectedValue:l,highlightedIndex:o,setHighlightedIndex:a,getOptionId:p,onSelect:s}=nt(),{announce:b}=chunkJS3UD7KS_cjs.a(),f=react.useRef(null),m=l===t.value,u=o===c,T=p(c);react.useEffect(()=>{u&&f.current&&f.current.scrollIntoView({block:"nearest",behavior:"smooth"});},[u]);let C=d=>{r?.(d),!d.defaultPrevented&&!t.disabled&&(s(t),b(`${t.label} selected`));},S=d=>{e?.(d),t.disabled||a(c);},R=react.useCallback(d=>{f.current=d,typeof i=="function"?i(d):i&&(i.current=d);},[i]);return jsxRuntime.jsxs("li",{ref:R,id:T,role:"option","aria-selected":m,"aria-disabled":t.disabled,"data-highlighted":u,"data-selected":m,"data-disabled":t.disabled,onClick:C,onMouseEnter:S,"data-compa11y-select-option":true,...n,children:[jsxRuntime.jsx("span",{"data-compa11y-select-option-text":true,children:t.label}),m&&jsxRuntime.jsx("span",{"aria-hidden":"true","data-compa11y-select-check":true,children:"\u2713"})]})}),$t=Object.assign(at,{Trigger:rt,Listbox:it,Option:ke});var Wt=core.createComponentWarnings("Checkbox"),cn=()=>jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",style:{display:"block"},children:jsxRuntime.jsx("path",{d:"M2.5 6L5 8.5L9.5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),un=()=>jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",style:{display:"block"},children:jsxRuntime.jsx("path",{d:"M3 6H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),Ut=react.createContext(null);function ct(){return react.useContext(Ut)}var we=react.forwardRef(function({value:t,defaultValue:c=[],onValueChange:r,disabled:e=false,legend:n,error:i,orientation:l="vertical",name:o,unstyled:a=false,className:p="",children:s,"aria-label":b,"aria-labelledby":f},m){let u=chunkMAR6RBHF_cjs.a("checkbox-group"),T=o||u,C=chunkMAR6RBHF_cjs.a("checkbox-group-error"),[S,R]=react.useState(c),d=t!==void 0,y=d?t:S;react.useEffect(()=>{!n&&!b&&!f&&Wt.warning("CheckboxGroup has no accessible label. Screen readers need this to identify the group.",'Add legend="...", aria-label="...", or aria-labelledby="..."');},[n,b,f]);let w=react.useCallback((g,h)=>{let F=d?t:S,H=h?[...F,g]:F.filter(D=>D!==g);d||R(H),r?.(H);},[d,t,S,r]),E={name:T,value:y,disabled:e,unstyled:a,onCheckboxChange:w},P=!!i,O={border:"none",margin:0,padding:0,minWidth:0},N=a?{padding:0,marginBottom:"0.5rem"}:{padding:0,marginBottom:"0.5rem",fontWeight:600},A={display:"flex",flexDirection:l==="horizontal"?"row":"column",flexWrap:l==="horizontal"?"wrap":void 0,gap:"var(--compa11y-checkbox-group-gap, 0.75rem)"},$=a?{marginTop:"0.25rem"}:{color:"var(--compa11y-checkbox-group-error-color, #ef4444)",fontSize:"0.8125rem",marginTop:"0.25rem"};return jsxRuntime.jsx(Ut.Provider,{value:E,children:jsxRuntime.jsxs("fieldset",{ref:m,className:p,"aria-label":b,"aria-labelledby":f,"aria-describedby":P?C:void 0,disabled:e,"data-compa11y-checkbox-group":"","data-orientation":l,"data-disabled":e?"true":void 0,style:O,children:[n&&jsxRuntime.jsx("legend",{"data-compa11y-checkbox-group-legend":"",style:N,children:n}),jsxRuntime.jsx("div",{style:A,children:s}),P&&jsxRuntime.jsx("div",{id:C,role:"alert","data-compa11y-checkbox-group-error":"",style:$,children:i})]})})});we.displayName="CheckboxGroup";var He=react.forwardRef(function({checked:t,defaultChecked:c=false,onCheckedChange:r,indeterminate:e=false,label:n,hint:i,error:l,disabled:o=false,value:a,required:p=false,unstyled:s,className:b="",size:f="md",name:m,"aria-label":u,"aria-labelledby":T,"aria-describedby":C,onClick:S,onFocus:R,onBlur:d,...y},w){let E=ct(),P=chunkMAR6RBHF_cjs.a("checkbox"),O=`${P}-input`,N=`${P}-label`,A=`${P}-hint`,$=`${P}-error`,{announce:g}=chunkJS3UD7KS_cjs.a(),{isFocusVisible:h,focusProps:F}=te(),H=E!==null,D=H&&E.disabled||o,z=s??(H?E.unstyled:false),I=H?E.name:m,[U,q]=react.useState(c),W=H?E.value.includes(a||""):t!==void 0?t:U,K=react.useRef(null),V=react.useCallback(ce=>{K.current=ce,typeof w=="function"?w(ce):w&&(w.current=ce);},[w]);react.useEffect(()=>{K.current&&(K.current.indeterminate=e);},[e]),react.useEffect(()=>{!n&&!u&&!T&&Wt.warning("Checkbox has no accessible label. Screen readers need this to identify the checkbox.",'Add label="...", aria-label="...", or aria-labelledby="..."');},[n,u,T]);let j=react.useCallback(ce=>{let Le=ce.target.checked;H?E.onCheckboxChange(a||"",Le):(t===void 0&&q(Le),r?.(Le)),g(`${typeof n=="string"?n:u||"Checkbox"} ${Le?"checked":"unchecked"}`);},[H,E,a,t,r,n,u,g]),X=react.useCallback(ce=>{F.onFocus(),R?.(ce);},[F,R]),J=react.useCallback(ce=>{F.onBlur(),d?.(ce);},[F,d]),_=!!n,ee=!!i,oe=!!l,ne=[];C&&ne.push(C),ee&&ne.push(A),oe&&ne.push($);let v=ne.length?ne.join(" "):void 0,M={sm:{box:16},md:{box:20},lg:{box:24}}[f],L={display:"inline-flex",alignItems:"flex-start",gap:"0.5rem",cursor:D?"not-allowed":"pointer",userSelect:"none",...D&&!z?{opacity:.5}:{}},G={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},Re={position:"absolute",opacity:0,width:"100%",height:"100%",margin:0,cursor:"inherit",zIndex:1},xe=z?{}:{width:M.box,height:M.box,minWidth:24,minHeight:24,border:W||e?"var(--compa11y-checkbox-checked-border, 2px solid #0066cc)":"var(--compa11y-checkbox-border, 2px solid #666)",borderRadius:"var(--compa11y-checkbox-radius, 3px)",background:W||e?"var(--compa11y-checkbox-checked-bg, #0066cc)":"var(--compa11y-checkbox-bg, white)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.15s ease",pointerEvents:"none",color:"var(--compa11y-checkbox-check-color, white)",...h?{outline:"2px solid var(--compa11y-focus-color, #0066cc)",outlineOffset:"2px"}:{}},po={display:"flex",flexDirection:"column",gap:"0.125rem",paddingTop:"0.125rem"},bo=z?{cursor:"inherit"}:{cursor:"inherit",color:"var(--compa11y-checkbox-label-color, inherit)"},fo=z?{}:{color:"var(--compa11y-checkbox-hint-color, #666)",fontSize:"0.8125rem"},mo=z?{}:{color:"var(--compa11y-checkbox-error-color, #ef4444)",fontSize:"0.8125rem"};return jsxRuntime.jsxs("div",{className:b,"data-compa11y-checkbox":"","data-checked":W?"true":"false","data-indeterminate":e?"true":void 0,"data-disabled":D?"true":void 0,"data-size":f,style:L,children:[jsxRuntime.jsxs("div",{style:G,children:[jsxRuntime.jsx("input",{ref:V,type:"checkbox",id:O,name:I,value:a,checked:W,onChange:j,onClick:S,onFocus:X,onBlur:J,disabled:D,required:p,"aria-required":p||void 0,"aria-invalid":oe||void 0,"aria-label":!_&&!T?u:void 0,"aria-labelledby":T||(_?N:void 0),"aria-describedby":v,"aria-checked":e?"mixed":W,tabIndex:D?-1:0,style:Re,...y}),!z&&jsxRuntime.jsxs("div",{"data-compa11y-checkbox-indicator":"","aria-hidden":"true",style:xe,children:[W&&!e&&jsxRuntime.jsx(cn,{}),e&&jsxRuntime.jsx(un,{})]})]}),(_||ee||oe)&&jsxRuntime.jsxs("div",{style:po,children:[_&&jsxRuntime.jsxs("label",{htmlFor:O,id:N,"data-compa11y-checkbox-label":"",style:bo,children:[n,p&&jsxRuntime.jsx("span",{"aria-hidden":"true",style:{color:"var(--compa11y-checkbox-required-color, #ef4444)",marginLeft:"0.125rem"},children:"*"})]}),ee&&jsxRuntime.jsx("div",{id:A,"data-compa11y-checkbox-hint":"",style:fo,children:i}),oe&&jsxRuntime.jsx("div",{id:$,role:"alert","data-compa11y-checkbox-error":"",style:mo,children:l})]})]})});He.displayName="Checkbox";var Fe=react.forwardRef(function({children:t,className:c},r){return jsxRuntime.jsx("div",{ref:r,className:c,"data-compa11y-checkbox-indicator":"","aria-hidden":"true",children:t})});Fe.displayName="CheckboxIndicator";var qt=Object.assign(He,{Group:we,Indicator:Fe});var mn=core.createComponentWarnings("RadioGroup"),pt=react.createContext(null);function bt(){let x=react.useContext(pt);if(!x)throw new Error("[Compa11y RadioGroup]: Radio must be used within a RadioGroup.");return x}var Oe=react.forwardRef(function({value:t,defaultValue:c,onValueChange:r,disabled:e=false,discoverable:n=true,required:i=false,orientation:l="vertical",name:o,legend:a,hint:p,error:s,unstyled:b=false,className:f="",children:m,"aria-label":u,"aria-labelledby":T},C){let S=chunkMAR6RBHF_cjs.a("radiogroup"),R=o||S,d=chunkMAR6RBHF_cjs.a("radiogroup-hint"),y=chunkMAR6RBHF_cjs.a("radiogroup-error"),[w,E]=react.useState(c??null),P=t!==void 0,O=P?t:w,N=react.useRef(new Map);react.useEffect(()=>{!a&&!u&&!T&&mn.warning("RadioGroup has no accessible label. Screen readers need this to identify the group.",'Add legend="...", aria-label="...", or aria-labelledby="..."');},[a,u,T]);let A=react.useCallback(V=>{e||(P||E(V),r?.(V));},[e,P,r]),$=react.useCallback((V,j)=>{N.current.set(V,j);},[]),g=react.useCallback(V=>{N.current.delete(V);},[]),h=react.useCallback((V,j)=>{N.current.set(V,j);},[]),F=react.useCallback(()=>{let V=[];return N.current.forEach((j,X)=>{!j&&!e&&V.push(X);}),V},[e]),H=react.useRef(null),D=C||H,z=react.useCallback(V=>{let j=F();if(j.length===0)return;let X=O?j.indexOf(O):-1,J;switch(V){case "next":J=X<0?0:(X+1)%j.length;break;case "prev":J=X<0?j.length-1:(X-1+j.length)%j.length;break;case "first":J=0;break;case "last":J=j.length-1;break}let _=j[J];if(_!==void 0){A(_);let ee=typeof D=="object"&&D?D.current:null;ee&&ee.querySelector(`input[type="radio"][value="${CSS.escape(_)}"]`)?.focus();}},[F,O,A,D]),I=chunkAJ7JSWUT_cjs.a({ArrowDown:()=>z("next"),ArrowRight:()=>z("next"),ArrowUp:()=>z("prev"),ArrowLeft:()=>z("prev"),Home:()=>z("first"),End:()=>z("last")},{preventDefault:true,stopPropagation:true,disabled:e}),U={name:R,value:O??null,disabled:e,discoverable:n,required:i,unstyled:b,orientation:l,onValueChange:A,registerRadio:$,unregisterRadio:g,updateRadioDisabled:h},q=[];p&&q.push(d),s&&q.push(y);let W=q.length>0?q.join(" "):void 0,K=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:b?{display:"flex",flexDirection:l==="horizontal"?"row":"column"}:{display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:"var(--compa11y-radio-gap, 0.75rem)"},children:m}),p&&jsxRuntime.jsx("div",{id:d,style:b?{}:{color:"var(--compa11y-radio-group-hint-color, #666)",fontSize:"0.8125rem",marginTop:"0.25rem"},children:p}),s&&jsxRuntime.jsx("div",{id:y,role:"alert",style:b?{}:{color:"var(--compa11y-radio-group-error-color, #ef4444)",fontSize:"0.8125rem",marginTop:"0.25rem"},children:s})]});return a?jsxRuntime.jsx(pt.Provider,{value:U,children:jsxRuntime.jsxs("fieldset",{ref:D,role:"radiogroup","aria-label":u,"aria-labelledby":T,"aria-orientation":l,"aria-required":i||void 0,"aria-disabled":e||void 0,"aria-invalid":s?true:void 0,"aria-describedby":W,className:`compa11y-radiogroup ${f}`.trim(),"data-compa11y-radiogroup":"","data-orientation":l,"data-disabled":e?"true":void 0,"data-error":s?"true":void 0,onKeyDown:I.onKeyDown,style:b?{border:"none",margin:0,padding:0,minWidth:0}:{border:"none",margin:0,padding:0,minWidth:0},children:[jsxRuntime.jsxs("legend",{style:b?{}:{padding:0,marginBottom:"var(--compa11y-radio-group-legend-gap, 0.5rem)",fontWeight:"var(--compa11y-radio-group-legend-weight, 600)",color:"var(--compa11y-radio-group-legend-color, inherit)",fontSize:"var(--compa11y-radio-group-legend-size, 1rem)"},children:[a,i&&!b&&jsxRuntime.jsxs("span",{"aria-hidden":"true",style:{color:"var(--compa11y-radio-group-required-color, #ef4444)",marginLeft:"0.125rem"},children:[" ","*"]})]}),K]})}):jsxRuntime.jsx(pt.Provider,{value:U,children:jsxRuntime.jsx("div",{ref:D,role:"radiogroup","aria-label":u,"aria-labelledby":T,"aria-orientation":l,"aria-required":i||void 0,"aria-disabled":e||void 0,"aria-invalid":s?true:void 0,"aria-describedby":W,className:`compa11y-radiogroup ${f}`.trim(),"data-compa11y-radiogroup":"","data-orientation":l,"data-disabled":e?"true":void 0,"data-error":s?"true":void 0,onKeyDown:I.onKeyDown,children:K})})});Oe.displayName="RadioGroup";var Ae=react.forwardRef(function({value:t,disabled:c=false,discoverable:r,label:e,hint:n,unstyled:i,className:l="",children:o,"aria-label":a},p){let s=bt(),b=chunkMAR6RBHF_cjs.a("radio"),f=chunkMAR6RBHF_cjs.a("radio-hint"),m=s.disabled||c,u=r??s.discoverable,T=i??s.unstyled,C=s.value===t,{announce:S}=chunkJS3UD7KS_cjs.a(),{isFocusVisible:R,focusProps:d}=te(),y=react.useRef(null),w=react.useCallback(I=>{y.current=I,typeof p=="function"?p(I):p&&(p.current=I);},[p]);react.useEffect(()=>(s.registerRadio(t,m),()=>s.unregisterRadio(t)),[t]),react.useEffect(()=>{s.updateRadioDisabled(t,m);},[m,t]);let E=react.useCallback(I=>{if(m){I.preventDefault();return}s.onValueChange(t),S(`${e||(typeof o=="string"?o:null)||t} selected`,{politeness:"polite"});},[m,s,t,e,o,S]),P=react.useCallback(I=>{m&&I.preventDefault();},[m]),O=react.useCallback(I=>{d.onFocus(),!C&&!m&&s.onValueChange(t);},[d,C,m,s,t]),N=react.useCallback(()=>{d.onBlur();},[d]),A=!!(o||e),$=o||e,g=`${b}-label`,h=!!n,F=(()=>{if(s.value!==null)return false;let I=Array.from(y.current?.closest('[role="radiogroup"]')?.querySelectorAll('input[type="radio"]')??[]);for(let U of I){let q=U;if(!q.disabled&&q.getAttribute("aria-disabled")!=="true")return q.value===t}return false})(),H=m&&!u?-1:C||s.value===null&&F?0:-1,D=m&&!u,z=h?f:void 0;return jsxRuntime.jsxs("label",{htmlFor:b,className:`compa11y-radio-wrapper ${l}`.trim(),"data-compa11y-radio":"","data-value":t,"data-checked":C?"true":"false","data-disabled":m?"true":void 0,style:T?{display:"inline-flex",alignItems:"flex-start",cursor:m?"not-allowed":"pointer",gap:"0.5rem"}:{display:"inline-flex",alignItems:"flex-start",gap:"var(--compa11y-radio-gap, 0.5rem)",cursor:m?"not-allowed":"pointer",userSelect:"none",opacity:m?.5:1},children:[jsxRuntime.jsxs("div",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:[jsxRuntime.jsx("input",{ref:w,type:"radio",id:b,name:s.name,value:t,checked:C,onChange:E,onClick:P,onFocus:O,onBlur:N,disabled:D,tabIndex:H,"aria-disabled":m?"true":void 0,"aria-label":A?void 0:a,"aria-labelledby":A?g:void 0,"aria-describedby":z,required:s.required,className:"compa11y-radio-input",style:{position:"absolute",opacity:0,width:"var(--compa11y-radio-size, 1.25rem)",height:"var(--compa11y-radio-size, 1.25rem)",margin:0,cursor:m?"not-allowed":"pointer"}}),!T&&jsxRuntime.jsx("div",{className:"compa11y-radio-circle",style:{width:"var(--compa11y-radio-size, 1.25rem)",height:"var(--compa11y-radio-size, 1.25rem)",minWidth:"24px",minHeight:"24px",border:C?"var(--compa11y-radio-checked-border, 2px solid #0066cc)":"var(--compa11y-radio-border, 2px solid #666)",borderRadius:"50%",background:C?"var(--compa11y-radio-checked-bg, #0066cc)":"var(--compa11y-radio-bg, white)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.15s ease",pointerEvents:"none",...R?{outline:"2px solid var(--compa11y-focus-color, #0066cc)",outlineOffset:"2px"}:{}},children:jsxRuntime.jsx("div",{"aria-hidden":"true",style:{width:"var(--compa11y-radio-dot-size, 0.5rem)",height:"var(--compa11y-radio-dot-size, 0.5rem)",borderRadius:"50%",background:"var(--compa11y-radio-dot-color, white)",opacity:C?1:0,transform:C?"scale(1)":"scale(0)",transition:"all 0.15s ease"}})})]}),(A||h)&&jsxRuntime.jsxs("div",{style:T?{}:{display:"flex",flexDirection:"column",gap:"0.125rem",paddingTop:"0.125rem"},children:[A&&jsxRuntime.jsx("span",{id:g,className:"compa11y-radio-label",style:T?{}:{color:"var(--compa11y-radio-label-color, inherit)",fontSize:"var(--compa11y-radio-label-size, 1rem)"},children:$}),h&&jsxRuntime.jsx("span",{id:f,className:"compa11y-radio-hint",style:T?{}:{color:"var(--compa11y-radio-hint-color, #666)",fontSize:"var(--compa11y-radio-hint-size, 0.8125rem)"},children:n})]})]})});Ae.displayName="Radio";var Yt=Object.assign(Oe,{Radio:Ae});var Tn=core.createComponentWarnings("Switch"),mt=react.forwardRef(function({checked:t,defaultChecked:c=false,onCheckedChange:r,label:e,disabled:n=false,unstyled:i=false,className:l,size:o="md","aria-label":a,"aria-labelledby":p,onClick:s,...b},f){let u=`${chunkMAR6RBHF_cjs.a("switch")}-label`,{announce:T}=chunkJS3UD7KS_cjs.a(),[C,S]=react.useState(c),R=t!==void 0,d=R?t:C;react.useEffect(()=>{!e&&!a&&!p&&Tn.warning("Switch has no accessible label. Screen readers need this to identify the switch.",'Add label="Description", aria-label="...", or aria-labelledby="..."');},[e,a,p]);let y=react.useCallback(()=>{if(n)return;let I=!d;R||S(I),r?.(I),T(`${e||a||"Switch"} ${I?"on":"off"}`);},[d,n,R,r,e,a,T]),w=react.useCallback(I=>{s?.(I),I.defaultPrevented||y();},[s,y]),E=chunkAJ7JSWUT_cjs.a({" ":()=>{y();},Enter:()=>{y();}},{preventDefault:true}),P=I=>{b.onKeyDown?.(I),I.defaultPrevented||E.onKeyDown(I);},O=a,N=p||(e?u:void 0),A={display:"inline-flex",alignItems:"center"},g={sm:{width:32,height:18,thumb:14,translate:14},md:{width:44,height:24,thumb:20,translate:20},lg:{width:56,height:30,thumb:26,translate:26}}[o],h={position:"relative",display:"inline-flex",alignItems:"center",flexShrink:0,width:g.width,height:g.height,border:"none",padding:2,cursor:n?"not-allowed":"pointer"},F=i?{}:{backgroundColor:d?"#0066cc":"#d1d5db",borderRadius:g.height/2,transition:"background-color 0.2s ease",opacity:n?.5:1},H={position:"absolute",left:2,width:g.thumb,height:g.thumb,pointerEvents:"none",transform:d?`translateX(${g.translate}px)`:"translateX(0)"},D=i?{}:{backgroundColor:"white",borderRadius:"50%",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",transition:"transform 0.2s ease"},z=i?{marginLeft:8,userSelect:"none",cursor:n?"not-allowed":"pointer"}:{marginLeft:8,userSelect:"none",cursor:n?"not-allowed":"pointer",opacity:n?.5:1};return jsxRuntime.jsxs("div",{style:A,"data-compa11y-switch-wrapper":true,"data-size":o,children:[jsxRuntime.jsx("button",{ref:f,type:"button",role:"switch","aria-checked":d,"aria-label":O,"aria-labelledby":N,disabled:n,onClick:w,onKeyDown:P,className:l,style:{...h,...F},tabIndex:n?-1:0,"data-compa11y-switch":true,"data-checked":d,"data-disabled":n||void 0,"data-size":o,...b,onFocus:I=>{i||(I.currentTarget.style.outline="2px solid #0066cc",I.currentTarget.style.outlineOffset="2px"),b.onFocus?.(I);},onBlur:I=>{i||(I.currentTarget.style.outline="none"),b.onBlur?.(I);},children:jsxRuntime.jsx("span",{style:{...H,...D},"data-compa11y-switch-thumb":true,"aria-hidden":"true"})}),e&&jsxRuntime.jsx("label",{id:u,onClick:n?void 0:()=>y(),style:z,"data-compa11y-switch-label":true,children:e})]})});mt.displayName="Switch";var In=core.createComponentWarnings("Listbox"),Qt=react.createContext(null);function De(){let x=react.useContext(Qt);if(!x)throw new Error("[Compa11y Listbox]: Option/Group must be used within a Listbox.");return x}var eo=react.createContext({groupDisabled:false}),Be=react.forwardRef(function({value:t,defaultValue:c,onValueChange:r,multiple:e=false,disabled:n=false,discoverable:i=true,orientation:l="vertical",unstyled:o=false,className:a="",children:p,"aria-label":s,"aria-labelledby":b},f){let m=chunkMAR6RBHF_cjs.a("listbox"),{announce:u}=chunkJS3UD7KS_cjs.a(),[T,C]=react.useState(()=>c??(e?[]:"")),S=t!==void 0,R=S?t:T,d=react.useMemo(()=>e?new Set(Array.isArray(R)?R:[]):new Set(R?[String(R)]:[]),[R,e]),[y,w]=react.useState(null),E=react.useRef(new Map),[P,O]=react.useState(0),N=react.useCallback((v,k,M)=>{E.current.set(v,{disabled:k,label:M}),O(L=>L+1);},[]),A=react.useCallback(v=>{E.current.delete(v),O(k=>k+1);},[]),$=react.useCallback((v,k)=>{let M=E.current.get(v);M&&E.current.set(v,{...M,disabled:k});},[]),g=react.useMemo(()=>{let v=[];return E.current.forEach((k,M)=>{!k.disabled&&!n&&v.push(M);}),v},[P,n]);react.useEffect(()=>{!s&&!b&&In.warning("Listbox has no accessible label. Screen readers need this.",'Add aria-label="..." or aria-labelledby="..."');},[s,b]);let h=react.useCallback(v=>d.has(v),[d]),F=react.useCallback(v=>{if(n)return;let k=E.current.get(v);if(k?.disabled)return;let M,L=k?.label||v;if(e){let G=new Set(d);G.has(v)?(G.delete(v),u(`${L} deselected`,{politeness:"polite"})):(G.add(v),u(`${L} selected`,{politeness:"polite"})),M=Array.from(G);}else M=v,u(`${L} selected`,{politeness:"polite"});S||C(M),r?.(M);},[n,e,d,S,r,u]),H=react.useCallback(v=>{if(g.length===0)return;let k=y?g.indexOf(y):-1,M;switch(v){case "next":M=k<0?0:Math.min(k+1,g.length-1);break;case "prev":M=k<0?g.length-1:Math.max(k-1,0);break;case "first":M=0;break;case "last":M=g.length-1;break}let L=g[M];if(L!==void 0)if(w(L),e){let Re=E.current.get(L)?.label||L,xe=d.has(L);u(`${Re}${xe?", selected":""}`,{politeness:"polite"});}else {let Re=E.current.get(L)?.label||L,xe=L;S||C(xe),r?.(xe),u(`${Re} selected`,{politeness:"polite"});}},[g,y,e,S,r,u,d]),D=react.useCallback(()=>{y&&e&&F(y);},[y,e,F]),z=react.useCallback(()=>{if(!e||!y)return;let v=g.indexOf(y);if(v<0)return;let k=g.slice(0,v+1),M=new Set(d);k.forEach(G=>M.add(G));let L=Array.from(M);S||C(L),r?.(L),w(g[0]??null),u(`${k.length} items selected`,{politeness:"polite"});},[e,y,g,d,S,r,u]),I=react.useCallback(()=>{if(!e||!y)return;let v=g.indexOf(y);if(v<0)return;let k=g.slice(v),M=new Set(d);k.forEach(G=>M.add(G));let L=Array.from(M);S||C(L),r?.(L),w(g[g.length-1]??null),u(`${k.length} items selected`,{politeness:"polite"});},[e,y,g,d,S,r,u]),U=react.useCallback(()=>{if(!e)return;let v=g.every(M=>d.has(M)),k;v?(k=[],u("All deselected",{politeness:"polite"})):(k=[...g],u("All selected",{politeness:"polite"})),S||C(k),r?.(k);},[e,g,d,S,r,u]),q=react.useMemo(()=>{let v={ArrowDown:()=>H("next"),ArrowUp:()=>H("prev"),Home:()=>H("first"),End:()=>H("last")};return e&&(v[" "]=()=>D(),v["Shift+ArrowDown"]=()=>{H("next"),setTimeout(()=>D(),0);},v["Shift+ArrowUp"]=()=>{H("prev"),setTimeout(()=>D(),0);},v["Ctrl+Shift+Home"]=()=>z(),v["Ctrl+Shift+End"]=()=>I(),v["Ctrl+a"]=()=>U(),v["Meta+a"]=()=>U()),v},[e,H,D,z,I,U]),W=chunkAJ7JSWUT_cjs.a(q,{preventDefault:true,stopPropagation:true,disabled:n}),K=react.useMemo(()=>Array.from(E.current.values()).map(v=>v.label),[P]),V=chunkAJ7JSWUT_cjs.e(K,v=>{for(let[k,M]of E.current.entries())if(M.label===v&&!M.disabled){if(w(k),!e){let L=k;S||C(L),r?.(L),u(`${v} selected`,{politeness:"polite"});}break}},{disabled:n}),j=react.useCallback(v=>{W.onKeyDown(v),v.defaultPrevented||V.onKeyDown(v);},[W,V]),X=react.useCallback(()=>{if(!y){if(!e&&R&&typeof R=="string"){w(R);return}if(e&&Array.isArray(R)&&R.length>0){w(R[0]??null);return}g.length>0&&w(g[0]??null);}},[y,e,R,g]),J=react.useCallback(()=>{},[]),_=react.useRef(null);react.useEffect(()=>{y&&_.current&&_.current.querySelector(`[data-value="${CSS.escape(y)}"]`)?.scrollIntoView({block:"nearest"});},[y]);let ee=react.useMemo(()=>({multiple:e,disabled:n,discoverable:i,unstyled:o,orientation:l,selectedValues:d,focusedValue:y,onSelect:F,onFocusOption:w,registerOption:N,unregisterOption:A,updateOptionDisabled:$,isSelected:h,listboxId:m}),[e,n,i,o,l,d,y,F,N,A,$,h,m]),oe=react.useCallback(v=>{_.current=v,typeof f=="function"?f(v):f&&(f.current=v);},[f]),ne=y?`${m}-option-${y}`:void 0;return jsxRuntime.jsx(Qt.Provider,{value:ee,children:jsxRuntime.jsx("div",{ref:oe,role:"listbox","aria-label":s,"aria-labelledby":b,"aria-orientation":l,"aria-multiselectable":e||void 0,"aria-disabled":n||void 0,"aria-activedescendant":ne,tabIndex:n&&!i?-1:0,className:`compa11y-listbox ${a}`.trim(),"data-compa11y-listbox":"","data-orientation":l,"data-disabled":n?"true":void 0,"data-multiple":e?"true":void 0,onKeyDown:j,onFocus:X,onBlur:J,style:o?{}:{width:"var(--compa11y-listbox-width, 250px)",maxHeight:"var(--compa11y-listbox-max-height, 300px)",overflowY:"auto",border:"var(--compa11y-listbox-border, 1px solid #e0e0e0)",borderRadius:"var(--compa11y-listbox-radius, 4px)",background:"var(--compa11y-listbox-bg, white)",padding:"var(--compa11y-listbox-padding, 0.25rem 0)",...n?{opacity:"var(--compa11y-listbox-disabled-opacity, 0.5)",cursor:"not-allowed"}:{}},children:p})})});Be.displayName="Listbox";var ze=react.forwardRef(function({value:t,disabled:c=false,discoverable:r,unstyled:e,className:n="",children:i,"aria-label":l},o){let a=De(),{groupDisabled:p}=react.useContext(eo),s=a.disabled||p||c,b=e??a.unstyled,f=a.isSelected(t),m=a.focusedValue===t,u=`${a.listboxId}-option-${t}`,T=react.useRef(""),C=react.useRef(null),S=react.useCallback(d=>{C.current=d,typeof o=="function"?o(d):o&&(o.current=d);},[o]);react.useEffect(()=>{let d=typeof i=="string"?i:C.current?.textContent?.trim()||t;return T.current=d,a.registerOption(t,s,d),()=>a.unregisterOption(t)},[t]),react.useEffect(()=>{a.updateOptionDisabled(t,s);},[s,t]);let R=react.useCallback(d=>{if(s){d.preventDefault();return}a.onFocusOption(t),a.onSelect(t);},[s,a,t]);return jsxRuntime.jsxs("div",{ref:S,id:u,role:"option","aria-selected":f,"aria-disabled":s||void 0,"aria-label":l,className:`compa11y-listbox-option ${n}`.trim(),"data-compa11y-listbox-option":"","data-value":t,"data-selected":f?"true":"false","data-focused":m?"true":"false","data-disabled":s?"true":void 0,onClick:R,style:b?{cursor:s?"not-allowed":"pointer"}:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"var(--compa11y-listbox-option-padding, 0.5rem 0.75rem)",cursor:s?"not-allowed":"pointer",userSelect:"none",transition:"background 0.1s ease",background:m?f?"var(--compa11y-listbox-option-selected-hover-bg, #cce0ff)":"var(--compa11y-listbox-option-hover-bg, #f5f5f5)":f?"var(--compa11y-listbox-option-selected-bg, #e6f0ff)":"transparent",fontWeight:f?500:"normal",opacity:s?.5:1},children:[jsxRuntime.jsx("span",{style:{flex:1},children:i}),f&&!b&&jsxRuntime.jsx("span",{"aria-hidden":"true",style:{fontSize:"0.875rem",color:"var(--compa11y-listbox-check-color, #0066cc)",marginLeft:"0.5rem"},children:"\u2713"})]})});ze.displayName="ListboxOption";var Ge=react.forwardRef(function({label:t,disabled:c=false,unstyled:r,className:e="",children:n},i){let l=De(),o=r??l.unstyled,a=chunkMAR6RBHF_cjs.a("listbox-group"),p=react.useMemo(()=>({groupDisabled:l.disabled||c}),[l.disabled,c]);return jsxRuntime.jsx(eo.Provider,{value:p,children:jsxRuntime.jsxs("div",{ref:i,role:"group","aria-labelledby":a,"aria-disabled":c||void 0,className:`compa11y-listbox-group ${e}`.trim(),"data-compa11y-listbox-group":"","data-disabled":c?"true":void 0,style:o?{}:{opacity:c?.5:1},children:[jsxRuntime.jsx("div",{id:a,role:"presentation",style:o?{}:{padding:"var(--compa11y-listbox-group-label-padding, 0.5rem 0.75rem 0.25rem)",fontSize:"var(--compa11y-listbox-group-label-size, 0.75rem)",fontWeight:600,color:"var(--compa11y-listbox-group-label-color, #666)",textTransform:"uppercase",letterSpacing:"0.05em"},children:t}),n]})})});Ge.displayName="ListboxGroup";var to=Object.assign(Be,{Option:ze,Group:Ge});var ro=react.createContext(null);function Te(){let x=react.useContext(ro);if(!x)throw new Error("[Compa11y Input]: Input sub-components (Input.Label, Input.Field, etc.) must be used within <Input>.");return x}var $e=react.forwardRef(function({children:t,className:c},r){let e=Te();return jsxRuntime.jsxs("label",{ref:r,id:e.labelId,htmlFor:e.fieldId,"data-compa11y-input-label":"",className:c,style:e.unstyled?{}:{display:"block",color:e.disabled?"var(--compa11y-input-disabled-color, #999)":"var(--compa11y-input-label-color, inherit)",fontSize:"var(--compa11y-input-label-size, 0.875rem)",fontWeight:"var(--compa11y-input-label-weight, 500)"},children:[t,e.required&&jsxRuntime.jsx("span",{"data-compa11y-input-required":"","aria-hidden":"true",style:e.unstyled?{}:{color:"var(--compa11y-input-required-color, #ef4444)",marginLeft:"0.125rem"},children:"*"})]})});$e.displayName="InputLabel";var Ke=react.forwardRef(function({type:t="text",onFocus:c,onBlur:r,className:e,style:n,...i},l){let o=Te(),a=react.useRef(null),p=react.useCallback(u=>{a.current=u,typeof l=="function"?l(u):l&&(l.current=u);},[l]),s=react.useCallback(u=>{o.setValue(u.target.value);},[o.setValue]),b=react.useCallback(u=>{o.focusProps.onFocus(),c?.(u);},[o.focusProps,c]),f=react.useCallback(u=>{o.focusProps.onBlur(),r?.(u);},[o.focusProps,r]),m=[];return m.push(o.hintId),o.hasError&&m.push(o.errorId),jsxRuntime.jsx("input",{ref:p,id:o.fieldId,type:t,value:o.value,onChange:s,onFocus:b,onBlur:f,disabled:o.disabled,readOnly:o.readOnly,"aria-describedby":m.join(" ")||void 0,"aria-invalid":o.hasError?"true":void 0,"aria-required":o.required?"true":void 0,"data-compa11y-input-field":"",className:e,style:o.unstyled?n:{width:"100%",padding:"var(--compa11y-input-padding, 0.5rem 0.75rem)",border:o.hasError?"1px solid var(--compa11y-input-border-error, #ef4444)":"var(--compa11y-input-border, 1px solid #ccc)",borderRadius:"var(--compa11y-input-radius, 4px)",fontSize:"var(--compa11y-input-font-size, 0.875rem)",fontFamily:"inherit",background:o.disabled?"var(--compa11y-input-disabled-bg, #f5f5f5)":o.readOnly?"var(--compa11y-input-readonly-bg, #f9f9f9)":"var(--compa11y-input-bg, white)",color:"inherit",cursor:o.disabled?"not-allowed":void 0,opacity:o.disabled?"var(--compa11y-input-disabled-opacity, 0.7)":void 0,...o.isFocusVisible&&!o.disabled?{outline:o.hasError?"2px solid var(--compa11y-input-border-error, #ef4444)":"2px solid var(--compa11y-focus-color, #0066cc)",outlineOffset:"-1px",borderColor:o.hasError?"var(--compa11y-input-border-error, #ef4444)":"var(--compa11y-input-border-focus, #0066cc)"}:{},...n},...i})});Ke.displayName="InputField";var je=react.forwardRef(function({children:t,className:c},r){let e=Te();return jsxRuntime.jsx("div",{ref:r,id:e.hintId,"data-compa11y-input-hint":"",className:c,style:e.unstyled?{}:{color:"var(--compa11y-input-hint-color, #666)",fontSize:"var(--compa11y-input-hint-size, 0.8125rem)"},children:t})});je.displayName="InputHint";var We=react.forwardRef(function({children:t,className:c},r){let e=Te();return t?jsxRuntime.jsx("div",{ref:r,id:e.errorId,role:"alert","data-compa11y-input-error":"",className:c,style:e.unstyled?{}:{color:"var(--compa11y-input-error-color, #ef4444)",fontSize:"var(--compa11y-input-error-size, 0.8125rem)"},children:t}):null});We.displayName="InputError";var Ue=react.forwardRef(function({value:t,defaultValue:c="",onValueChange:r,type:e="text",label:n,hint:i,error:l,required:o=false,disabled:a=false,readOnly:p=false,"aria-label":s,"aria-labelledby":b,placeholder:f,name:m,autoComplete:u,maxLength:T,minLength:C,pattern:S,inputMode:R,id:d,unstyled:y=false,className:w,onFocus:E,onBlur:P,children:O},N){let A=chunkMAR6RBHF_cjs.a("input"),$=d||A,g=`${$}-field`,h=`${$}-label`,F=`${$}-hint`,H=`${$}-error`,[D,z]=react.useState(c),I=t!==void 0,U=I?t:D,q=react.useCallback(G=>{I||z(G),r?.(G);},[I,r]),{isFocusVisible:W,focusProps:K}=te();react.useEffect(()=>{process.env.NODE_ENV!=="production"&&!(react.Children.count(O)>0)&&!n&&!s&&!b&&console.warn("[Compa11y Input]: Input has no accessible label. Screen readers need this to identify the input. Use label prop, aria-label, or aria-labelledby.");},[O,n,s,b]);let V=!!l,j=react.Children.count(O)>0,X={fieldId:g,labelId:h,hintId:F,errorId:H,value:U,setValue:q,hasError:V,disabled:a,readOnly:p,required:o,isFocusVisible:W,focusProps:K,unstyled:y},J={"data-compa11y-input":"","data-error":V?"true":"false","data-disabled":a?"true":"false","data-required":o?"true":"false","data-readonly":p?"true":"false"},_=y?{}:{display:"flex",flexDirection:"column",gap:"0.25rem"};if(j)return jsxRuntime.jsx(ro.Provider,{value:X,children:jsxRuntime.jsx("div",{...J,className:w,style:_,children:O})});let ee=react.useRef(null),oe=react.useCallback(G=>{ee.current=G,typeof N=="function"?N(G):N&&(N.current=G);},[N]),ne=react.useCallback(G=>{q(G.target.value);},[q]),v=react.useCallback(G=>{K.onFocus(),E?.(G);},[K,E]),k=react.useCallback(G=>{K.onBlur(),P?.(G);},[K,P]),M=[];i&&M.push(F),V&&M.push(H);let L=M.length>0?M.join(" "):void 0;return jsxRuntime.jsxs("div",{...J,className:w,style:_,children:[n&&jsxRuntime.jsxs("label",{id:h,htmlFor:g,"data-compa11y-input-label":"",style:y?{}:{display:"block",color:a?"var(--compa11y-input-disabled-color, #999)":"var(--compa11y-input-label-color, inherit)",fontSize:"var(--compa11y-input-label-size, 0.875rem)",fontWeight:"var(--compa11y-input-label-weight, 500)"},children:[n,o&&jsxRuntime.jsx("span",{"data-compa11y-input-required":"","aria-hidden":"true",style:y?{}:{color:"var(--compa11y-input-required-color, #ef4444)",marginLeft:"0.125rem"},children:"*"})]}),jsxRuntime.jsx("input",{ref:oe,id:g,type:e,value:U,onChange:ne,onFocus:v,onBlur:k,disabled:a,readOnly:p,required:o,placeholder:f,name:m,autoComplete:u,maxLength:T,minLength:C,pattern:S,inputMode:R,"aria-label":n?void 0:s,"aria-labelledby":!n&&b?b:n?h:void 0,"aria-describedby":L,"aria-invalid":V?"true":void 0,"aria-required":o?"true":void 0,"data-compa11y-input-field":"",style:y?{}:{width:"100%",padding:"var(--compa11y-input-padding, 0.5rem 0.75rem)",border:V?"1px solid var(--compa11y-input-border-error, #ef4444)":"var(--compa11y-input-border, 1px solid #ccc)",borderRadius:"var(--compa11y-input-radius, 4px)",fontSize:"var(--compa11y-input-font-size, 0.875rem)",fontFamily:"inherit",background:a?"var(--compa11y-input-disabled-bg, #f5f5f5)":p?"var(--compa11y-input-readonly-bg, #f9f9f9)":"var(--compa11y-input-bg, white)",color:"inherit",cursor:a?"not-allowed":void 0,opacity:a?"var(--compa11y-input-disabled-opacity, 0.7)":void 0,...W&&!a?{outline:V?"2px solid var(--compa11y-input-border-error, #ef4444)":"2px solid var(--compa11y-focus-color, #0066cc)",outlineOffset:"-1px",borderColor:V?"var(--compa11y-input-border-error, #ef4444)":"var(--compa11y-input-border-focus, #0066cc)"}:{}}}),i&&jsxRuntime.jsx("div",{id:F,"data-compa11y-input-hint":"",style:y?{}:{color:"var(--compa11y-input-hint-color, #666)",fontSize:"var(--compa11y-input-hint-size, 0.8125rem)"},children:i}),V&&jsxRuntime.jsx("div",{id:H,role:"alert","data-compa11y-input-error":"",style:y?{}:{color:"var(--compa11y-input-error-color, #ef4444)",fontSize:"var(--compa11y-input-error-size, 0.8125rem)"},children:l})]})});Ue.displayName="Input";var io=Object.assign(Ue,{Label:$e,Field:Ke,Hint:je,Error:We});var Hn={primary:{background:"var(--compa11y-button-primary-bg, #0066cc)",color:"var(--compa11y-button-primary-color, white)",border:"var(--compa11y-button-primary-border, 1px solid #0066cc)"},secondary:{background:"var(--compa11y-button-secondary-bg, white)",color:"var(--compa11y-button-secondary-color, #333)",border:"var(--compa11y-button-secondary-border, 1px solid #ccc)"},danger:{background:"var(--compa11y-button-danger-bg, #ef4444)",color:"var(--compa11y-button-danger-color, white)",border:"var(--compa11y-button-danger-border, 1px solid #ef4444)"},outline:{background:"var(--compa11y-button-outline-bg, transparent)",color:"var(--compa11y-button-outline-color, #0066cc)",border:"var(--compa11y-button-outline-border, 1px solid #0066cc)"},ghost:{background:"var(--compa11y-button-ghost-bg, transparent)",color:"var(--compa11y-button-ghost-color, #333)",border:"var(--compa11y-button-ghost-border, 1px solid transparent)"}},Fn={sm:{padding:"var(--compa11y-button-padding-sm, 0.25rem 0.5rem)",fontSize:"var(--compa11y-button-font-size-sm, 0.75rem)"},md:{padding:"var(--compa11y-button-padding-md, 0.5rem 1rem)",fontSize:"var(--compa11y-button-font-size-md, 0.875rem)"},lg:{padding:"var(--compa11y-button-padding-lg, 0.75rem 1.5rem)",fontSize:"var(--compa11y-button-font-size-lg, 1rem)"}},ht=react.forwardRef(function({variant:t="secondary",size:c="md",type:r="button",disabled:e=false,discoverable:n=false,loading:i=false,unstyled:l=false,"aria-label":o,className:a,style:p,onClick:s,onFocus:b,onBlur:f,children:m,...u},T){let C=chunkMAR6RBHF_cjs.a("button"),S=react.useRef(null),R=react.useCallback(g=>{S.current=g,typeof T=="function"?T(g):T&&(T.current=g);},[T]),{isFocusVisible:d,focusProps:y}=te();react.useEffect(()=>{process.env.NODE_ENV!=="production"&&!m&&!o&&!u["aria-labelledby"]&&console.warn("[Compa11y Button]: Button has no accessible label. Screen readers need this to identify the button. Add text content, aria-label, or aria-labelledby.");},[m,o,u["aria-labelledby"]]);let w=e&&!n,E=e||i,P=react.useCallback(g=>{if(E){g.preventDefault();return}s?.(g);},[E,s]),O=react.useCallback(g=>{y.onFocus(),b?.(g);},[y,b]),N=react.useCallback(g=>{y.onBlur(),f?.(g);},[y,f]),A={"data-compa11y-button":"","data-variant":t,"data-size":c,"data-disabled":e?"true":"false","data-loading":i?"true":"false"},$=l?{}:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"0.5rem",borderRadius:"var(--compa11y-button-radius, 4px)",fontFamily:"inherit",fontWeight:"var(--compa11y-button-font-weight, 500)",lineHeight:"1.5",cursor:E?"not-allowed":"pointer",opacity:e?"var(--compa11y-button-disabled-opacity, 0.5)":void 0,transition:"background-color 0.15s ease, border-color 0.15s ease",...Hn[t],...Fn[c],...d&&!w?{outline:"2px solid var(--compa11y-focus-color, #0066cc)",outlineOffset:"2px"}:{}};return jsxRuntime.jsxs("button",{ref:R,id:C,type:r,disabled:w,tabIndex:e&&!n?void 0:0,"aria-disabled":E?"true":void 0,"aria-busy":i?"true":void 0,"aria-label":o,onClick:P,onFocus:O,onBlur:N,className:a,style:{...$,...p},...A,...u,children:[i&&jsxRuntime.jsx("span",{"data-compa11y-button-spinner":"","aria-hidden":"true",style:l?{}:{display:"inline-block",width:"1em",height:"1em",border:"2px solid currentColor",borderRightColor:"transparent",borderRadius:"50%",animation:"compa11y-spin 0.6s linear infinite"}}),m]})});ht.displayName="Button";var co=react.createContext(null);function Ce(){let x=react.useContext(co);if(!x)throw new Error("[Compa11y Textarea]: Textarea sub-components (Textarea.Label, Textarea.Field, etc.) must be used within <Textarea>.");return x}var _e=react.forwardRef(function({children:t,className:c},r){let e=Ce();return jsxRuntime.jsxs("label",{ref:r,id:e.labelId,htmlFor:e.fieldId,"data-compa11y-textarea-label":"",className:c,style:e.unstyled?{}:{display:"block",color:e.disabled?"var(--compa11y-textarea-disabled-color, #999)":"var(--compa11y-textarea-label-color, inherit)",fontSize:"var(--compa11y-textarea-label-size, 0.875rem)",fontWeight:"var(--compa11y-textarea-label-weight, 500)"},children:[t,e.required&&jsxRuntime.jsx("span",{"data-compa11y-textarea-required":"","aria-hidden":"true",style:e.unstyled?{}:{color:"var(--compa11y-textarea-required-color, #ef4444)",marginLeft:"0.125rem"},children:"*"})]})});_e.displayName="TextareaLabel";var Ye=react.forwardRef(function({onFocus:t,onBlur:c,className:r,style:e,rows:n,...i},l){let o=Ce(),a=react.useRef(null),p=react.useCallback(u=>{a.current=u,typeof l=="function"?l(u):l&&(l.current=u);},[l]),s=react.useCallback(u=>{o.setValue(u.target.value);},[o.setValue]),b=react.useCallback(u=>{o.focusProps.onFocus(),t?.(u);},[o.focusProps,t]),f=react.useCallback(u=>{o.focusProps.onBlur(),c?.(u);},[o.focusProps,c]),m=[];return m.push(o.hintId),o.hasError&&m.push(o.errorId),jsxRuntime.jsx("textarea",{ref:p,id:o.fieldId,rows:n??o.rows,value:o.value,onChange:s,onFocus:b,onBlur:f,disabled:o.disabled,readOnly:o.readOnly,"aria-describedby":m.join(" ")||void 0,"aria-invalid":o.hasError?"true":void 0,"aria-required":o.required?"true":void 0,"data-compa11y-textarea-field":"",className:r,style:o.unstyled?e:{width:"100%",padding:"var(--compa11y-textarea-padding, 0.5rem 0.75rem)",border:o.hasError?"1px solid var(--compa11y-textarea-border-error, #ef4444)":"var(--compa11y-textarea-border, 1px solid #ccc)",borderRadius:"var(--compa11y-textarea-radius, 4px)",fontSize:"var(--compa11y-textarea-font-size, 0.875rem)",fontFamily:"inherit",lineHeight:"1.5",resize:o.resize,background:o.disabled?"var(--compa11y-textarea-disabled-bg, #f5f5f5)":o.readOnly?"var(--compa11y-textarea-readonly-bg, #f9f9f9)":"var(--compa11y-textarea-bg, white)",color:"inherit",cursor:o.disabled?"not-allowed":void 0,opacity:o.disabled?"var(--compa11y-textarea-disabled-opacity, 0.7)":void 0,...o.isFocusVisible&&!o.disabled?{outline:o.hasError?"2px solid var(--compa11y-textarea-border-error, #ef4444)":"2px solid var(--compa11y-focus-color, #0066cc)",outlineOffset:"-1px",borderColor:o.hasError?"var(--compa11y-textarea-border-error, #ef4444)":"var(--compa11y-textarea-border-focus, #0066cc)"}:{},...e},...i})});Ye.displayName="TextareaField";var Xe=react.forwardRef(function({children:t,className:c},r){let e=Ce();return jsxRuntime.jsx("div",{ref:r,id:e.hintId,"data-compa11y-textarea-hint":"",className:c,style:e.unstyled?{}:{color:"var(--compa11y-textarea-hint-color, #666)",fontSize:"var(--compa11y-textarea-hint-size, 0.8125rem)"},children:t})});Xe.displayName="TextareaHint";var Je=react.forwardRef(function({children:t,className:c},r){let e=Ce();return t?jsxRuntime.jsx("div",{ref:r,id:e.errorId,role:"alert","data-compa11y-textarea-error":"",className:c,style:e.unstyled?{}:{color:"var(--compa11y-textarea-error-color, #ef4444)",fontSize:"var(--compa11y-textarea-error-size, 0.8125rem)"},children:t}):null});Je.displayName="TextareaError";var Ze=react.forwardRef(function({value:t,defaultValue:c="",onValueChange:r,rows:e=3,resize:n="vertical",label:i,hint:l,error:o,required:a=false,disabled:p=false,readOnly:s=false,"aria-label":b,"aria-labelledby":f,placeholder:m,name:u,autoComplete:T,maxLength:C,minLength:S,id:R,unstyled:d=false,className:y,onFocus:w,onBlur:E,children:P},O){let N=chunkMAR6RBHF_cjs.a("textarea"),A=R||N,$=`${A}-field`,g=`${A}-label`,h=`${A}-hint`,F=`${A}-error`,[H,D]=react.useState(c),z=t!==void 0,I=z?t:H,U=react.useCallback(L=>{z||D(L),r?.(L);},[z,r]),{isFocusVisible:q,focusProps:W}=te();react.useEffect(()=>{process.env.NODE_ENV!=="production"&&!(react.Children.count(P)>0)&&!i&&!b&&!f&&console.warn("[Compa11y Textarea]: Textarea has no accessible label. Screen readers need this to identify the textarea. Use label prop, aria-label, or aria-labelledby.");},[P,i,b,f]);let K=!!o,V=react.Children.count(P)>0,j={fieldId:$,labelId:g,hintId:h,errorId:F,value:I,setValue:U,hasError:K,disabled:p,readOnly:s,required:a,rows:e,resize:n,isFocusVisible:q,focusProps:W,unstyled:d},X={"data-compa11y-textarea":"","data-error":K?"true":"false","data-disabled":p?"true":"false","data-required":a?"true":"false","data-readonly":s?"true":"false"},J=d?{}:{display:"flex",flexDirection:"column",gap:"0.25rem"};if(V)return jsxRuntime.jsx(co.Provider,{value:j,children:jsxRuntime.jsx("div",{...X,className:y,style:J,children:P})});let _=react.useRef(null),ee=react.useCallback(L=>{_.current=L,typeof O=="function"?O(L):O&&(O.current=L);},[O]),oe=react.useCallback(L=>{U(L.target.value);},[U]),ne=react.useCallback(L=>{W.onFocus(),w?.(L);},[W,w]),v=react.useCallback(L=>{W.onBlur(),E?.(L);},[W,E]),k=[];l&&k.push(h),K&&k.push(F);let M=k.length>0?k.join(" "):void 0;return jsxRuntime.jsxs("div",{...X,className:y,style:J,children:[i&&jsxRuntime.jsxs("label",{id:g,htmlFor:$,"data-compa11y-textarea-label":"",style:d?{}:{display:"block",color:p?"var(--compa11y-textarea-disabled-color, #999)":"var(--compa11y-textarea-label-color, inherit)",fontSize:"var(--compa11y-textarea-label-size, 0.875rem)",fontWeight:"var(--compa11y-textarea-label-weight, 500)"},children:[i,a&&jsxRuntime.jsx("span",{"data-compa11y-textarea-required":"","aria-hidden":"true",style:d?{}:{color:"var(--compa11y-textarea-required-color, #ef4444)",marginLeft:"0.125rem"},children:"*"})]}),jsxRuntime.jsx("textarea",{ref:ee,id:$,rows:e,value:I,onChange:oe,onFocus:ne,onBlur:v,disabled:p,readOnly:s,required:a,placeholder:m,name:u,autoComplete:T,maxLength:C,minLength:S,"aria-label":i?void 0:b,"aria-labelledby":!i&&f?f:i?g:void 0,"aria-describedby":M,"aria-invalid":K?"true":void 0,"aria-required":a?"true":void 0,"data-compa11y-textarea-field":"",style:d?{}:{width:"100%",padding:"var(--compa11y-textarea-padding, 0.5rem 0.75rem)",border:K?"1px solid var(--compa11y-textarea-border-error, #ef4444)":"var(--compa11y-textarea-border, 1px solid #ccc)",borderRadius:"var(--compa11y-textarea-radius, 4px)",fontSize:"var(--compa11y-textarea-font-size, 0.875rem)",fontFamily:"inherit",lineHeight:"1.5",resize:n,background:p?"var(--compa11y-textarea-disabled-bg, #f5f5f5)":s?"var(--compa11y-textarea-readonly-bg, #f9f9f9)":"var(--compa11y-textarea-bg, white)",color:"inherit",cursor:p?"not-allowed":void 0,opacity:p?"var(--compa11y-textarea-disabled-opacity, 0.7)":void 0,...q&&!p?{outline:K?"2px solid var(--compa11y-textarea-border-error, #ef4444)":"2px solid var(--compa11y-focus-color, #0066cc)",outlineOffset:"-1px",borderColor:K?"var(--compa11y-textarea-border-error, #ef4444)":"var(--compa11y-textarea-border-focus, #0066cc)"}:{}}}),l&&jsxRuntime.jsx("div",{id:h,"data-compa11y-textarea-hint":"",style:d?{}:{color:"var(--compa11y-textarea-hint-color, #666)",fontSize:"var(--compa11y-textarea-hint-size, 0.8125rem)"},children:l}),K&&jsxRuntime.jsx("div",{id:F,role:"alert","data-compa11y-textarea-error":"",style:d?{}:{color:"var(--compa11y-textarea-error-color, #ef4444)",fontSize:"var(--compa11y-textarea-error-size, 0.8125rem)"},children:o})]})});Ze.displayName="Textarea";var uo=Object.assign(Ze,{Label:_e,Field:Ye,Hint:Xe,Error:Je});Object.defineProperty(exports,"Dialog",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.k}});Object.defineProperty(exports,"DialogActions",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.j}});Object.defineProperty(exports,"DialogBase",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.d}});Object.defineProperty(exports,"DialogClose",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.h}});Object.defineProperty(exports,"DialogContent",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.i}});Object.defineProperty(exports,"DialogDescription",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.g}});Object.defineProperty(exports,"DialogTitle",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.f}});Object.defineProperty(exports,"DialogTrigger",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.e}});Object.defineProperty(exports,"useDialogContext",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.c}});Object.defineProperty(exports,"useFocusTrap",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.a}});Object.defineProperty(exports,"useFocusTrapControls",{enumerable:true,get:function(){return chunkFD4F6ONU_cjs.b}});Object.defineProperty(exports,"ActionMenu",{enumerable:true,get:function(){return chunk36S2JYVF_cjs.i}});Object.defineProperty(exports,"ActionMenuBase",{enumerable:true,get:function(){return chunk36S2JYVF_cjs.c}});Object.defineProperty(exports,"ActionMenuContent",{enumerable:true,get:function(){return chunk36S2JYVF_cjs.e}});Object.defineProperty(exports,"ActionMenuItem",{enumerable:true,get:function(){return chunk36S2JYVF_cjs.f}});Object.defineProperty(exports,"ActionMenuLabel",{enumerable:true,get:function(){return chunk36S2JYVF_cjs.h}});Object.defineProperty(exports,"ActionMenuSeparator",{enumerable:true,get:function(){return chunk36S2JYVF_cjs.g}});Object.defineProperty(exports,"ActionMenuTrigger",{enumerable:true,get:function(){return chunk36S2JYVF_cjs.d}});Object.defineProperty(exports,"useActionMenuContext",{enumerable:true,get:function(){return chunk36S2JYVF_cjs.a}});Object.defineProperty(exports,"Tab",{enumerable:true,get:function(){return chunkDWU3PTJO_cjs.d}});Object.defineProperty(exports,"TabList",{enumerable:true,get:function(){return chunkDWU3PTJO_cjs.c}});Object.defineProperty(exports,"TabPanel",{enumerable:true,get:function(){return chunkDWU3PTJO_cjs.e}});Object.defineProperty(exports,"Tabs",{enumerable:true,get:function(){return chunkDWU3PTJO_cjs.f}});Object.defineProperty(exports,"TabsBase",{enumerable:true,get:function(){return chunkDWU3PTJO_cjs.b}});Object.defineProperty(exports,"useTabsContext",{enumerable:true,get:function(){return chunkDWU3PTJO_cjs.a}});Object.defineProperty(exports,"ToastProvider",{enumerable:true,get:function(){return chunkDDFEION3_cjs.b}});Object.defineProperty(exports,"ToastViewport",{enumerable:true,get:function(){return chunkDDFEION3_cjs.c}});Object.defineProperty(exports,"useToast",{enumerable:true,get:function(){return chunkDDFEION3_cjs.a}});Object.defineProperty(exports,"useToastHelpers",{enumerable:true,get:function(){return chunkDDFEION3_cjs.d}});Object.defineProperty(exports,"Combobox",{enumerable:true,get:function(){return chunkFOVHQAY5_cjs.e}});Object.defineProperty(exports,"ComboboxBase",{enumerable:true,get:function(){return chunkFOVHQAY5_cjs.a}});Object.defineProperty(exports,"ComboboxInput",{enumerable:true,get:function(){return chunkFOVHQAY5_cjs.b}});Object.defineProperty(exports,"ComboboxListbox",{enumerable:true,get:function(){return chunkFOVHQAY5_cjs.c}});Object.defineProperty(exports,"ComboboxOption",{enumerable:true,get:function(){return chunkFOVHQAY5_cjs.d}});Object.defineProperty(exports,"useAnnounceLoading",{enumerable:true,get:function(){return chunkJS3UD7KS_cjs.c}});Object.defineProperty(exports,"useAnnounceOnChange",{enumerable:true,get:function(){return chunkJS3UD7KS_cjs.b}});Object.defineProperty(exports,"useAnnouncer",{enumerable:true,get:function(){return chunkJS3UD7KS_cjs.a}});Object.defineProperty(exports,"useGridKeyboard",{enumerable:true,get:function(){return chunkAJ7JSWUT_cjs.d}});Object.defineProperty(exports,"useKeyPressed",{enumerable:true,get:function(){return chunkAJ7JSWUT_cjs.f}});Object.defineProperty(exports,"useKeyboard",{enumerable:true,get:function(){return chunkAJ7JSWUT_cjs.a}});Object.defineProperty(exports,"useMenuKeyboard",{enumerable:true,get:function(){return chunkAJ7JSWUT_cjs.b}});Object.defineProperty(exports,"useTabsKeyboard",{enumerable:true,get:function(){return chunkAJ7JSWUT_cjs.c}});Object.defineProperty(exports,"useTypeAhead",{enumerable:true,get:function(){return chunkAJ7JSWUT_cjs.e}});Object.defineProperty(exports,"useId",{enumerable:true,get:function(){return chunkMAR6RBHF_cjs.a}});Object.defineProperty(exports,"useIdScope",{enumerable:true,get:function(){return chunkMAR6RBHF_cjs.c}});Object.defineProperty(exports,"useIds",{enumerable:true,get:function(){return chunkMAR6RBHF_cjs.b}});Object.defineProperty(exports,"announce",{enumerable:true,get:function(){return core.announce}});Object.defineProperty(exports,"announceAssertive",{enumerable:true,get:function(){return core.announceAssertive}});Object.defineProperty(exports,"announceError",{enumerable:true,get:function(){return core.announceError}});Object.defineProperty(exports,"announcePolite",{enumerable:true,get:function(){return core.announcePolite}});Object.defineProperty(exports,"announceProgress",{enumerable:true,get:function(){return core.announceProgress}});Object.defineProperty(exports,"announceStatus",{enumerable:true,get:function(){return core.announceStatus}});Object.defineProperty(exports,"aria",{enumerable:true,get:function(){return core.aria}});Object.defineProperty(exports,"buildAriaProps",{enumerable:true,get:function(){return core.buildAriaProps}});Object.defineProperty(exports,"checks",{enumerable:true,get:function(){return core.checks}});Object.defineProperty(exports,"createComponentWarnings",{enumerable:true,get:function(){return core.createComponentWarnings}});Object.defineProperty(exports,"hasAccessibleName",{enumerable:true,get:function(){return core.hasAccessibleName}});Object.defineProperty(exports,"isAndroid",{enumerable:true,get:function(){return core.isAndroid}});Object.defineProperty(exports,"isBrowser",{enumerable:true,get:function(){return core.isBrowser}});Object.defineProperty(exports,"isIOS",{enumerable:true,get:function(){return core.isIOS}});Object.defineProperty(exports,"isMac",{enumerable:true,get:function(){return core.isMac}});Object.defineProperty(exports,"mergeAriaIds",{enumerable:true,get:function(){return core.mergeAriaIds}});Object.defineProperty(exports,"prefersDarkMode",{enumerable:true,get:function(){return core.prefersDarkMode}});Object.defineProperty(exports,"prefersHighContrast",{enumerable:true,get:function(){return core.prefersHighContrast}});Object.defineProperty(exports,"prefersReducedMotion",{enumerable:true,get:function(){return core.prefersReducedMotion}});Object.defineProperty(exports,"setWarningHandler",{enumerable:true,get:function(){return core.setWarningHandler}});Object.defineProperty(exports,"warn",{enumerable:true,get:function(){return core.warn}});exports.Button=ht;exports.Checkbox=qt;exports.CheckboxBase=He;exports.CheckboxGroup=we;exports.CheckboxIndicator=Fe;exports.Input=io;exports.InputBase=Ue;exports.InputError=We;exports.InputField=Ke;exports.InputHint=je;exports.InputLabel=$e;exports.Listbox=to;exports.ListboxBase=Be;exports.ListboxGroup=Ge;exports.ListboxOption=ze;exports.Radio=Ae;exports.RadioGroup=Yt;exports.RadioGroupBase=Oe;exports.Select=$t;exports.SelectBase=at;exports.SelectListbox=it;exports.SelectOptionItem=ke;exports.SelectTrigger=rt;exports.Switch=mt;exports.Textarea=uo;exports.TextareaBase=Ze;exports.TextareaError=Je;exports.TextareaField=Ye;exports.TextareaHint=Xe;exports.TextareaLabel=_e;exports.useCheckboxGroupContext=ct;exports.useFocusControl=At;exports.useFocusManager=Ot;exports.useFocusVisible=te;exports.useFocusWithin=Vt;exports.useInputContext=Te;exports.useListboxContext=De;exports.useRadioGroupContext=bt;exports.useRovingTabindex=Qe;exports.useRovingTabindexMap=Nt;exports.useTextareaContext=Ce;
|