@compa11y/react 0.1.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/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/chunk-2S4C6FGA.js +380 -0
- package/dist/chunk-2S4C6FGA.js.map +1 -0
- package/dist/chunk-52J4Z3QD.cjs +45 -0
- package/dist/chunk-52J4Z3QD.cjs.map +1 -0
- package/dist/chunk-C7QK2I7H.js +373 -0
- package/dist/chunk-C7QK2I7H.js.map +1 -0
- package/dist/chunk-D2UMS62N.cjs +245 -0
- package/dist/chunk-D2UMS62N.cjs.map +1 -0
- package/dist/chunk-E265U2RK.js +234 -0
- package/dist/chunk-E265U2RK.js.map +1 -0
- package/dist/chunk-E4XJRXWM.js +215 -0
- package/dist/chunk-E4XJRXWM.js.map +1 -0
- package/dist/chunk-GDLOJH6K.cjs +110 -0
- package/dist/chunk-GDLOJH6K.cjs.map +1 -0
- package/dist/chunk-IR46CNNY.cjs +329 -0
- package/dist/chunk-IR46CNNY.cjs.map +1 -0
- package/dist/chunk-JXYOE7SH.js +103 -0
- package/dist/chunk-JXYOE7SH.js.map +1 -0
- package/dist/chunk-O3YYQZ5O.js +317 -0
- package/dist/chunk-O3YYQZ5O.js.map +1 -0
- package/dist/chunk-OIVTOU4Z.cjs +386 -0
- package/dist/chunk-OIVTOU4Z.cjs.map +1 -0
- package/dist/chunk-OND5B7UG.js +85 -0
- package/dist/chunk-OND5B7UG.js.map +1 -0
- package/dist/chunk-R4FR6M6I.cjs +383 -0
- package/dist/chunk-R4FR6M6I.cjs.map +1 -0
- package/dist/chunk-RBDQCIS7.cjs +89 -0
- package/dist/chunk-RBDQCIS7.cjs.map +1 -0
- package/dist/chunk-SOBS7MIH.cjs +220 -0
- package/dist/chunk-SOBS7MIH.cjs.map +1 -0
- package/dist/chunk-WURPAE3R.js +41 -0
- package/dist/chunk-WURPAE3R.js.map +1 -0
- package/dist/components/combobox/index.cjs +31 -0
- package/dist/components/combobox/index.cjs.map +1 -0
- package/dist/components/combobox/index.d.cts +55 -0
- package/dist/components/combobox/index.d.ts +55 -0
- package/dist/components/combobox/index.js +6 -0
- package/dist/components/combobox/index.js.map +1 -0
- package/dist/components/dialog/index.cjs +46 -0
- package/dist/components/dialog/index.cjs.map +1 -0
- package/dist/components/dialog/index.d.cts +84 -0
- package/dist/components/dialog/index.d.ts +84 -0
- package/dist/components/dialog/index.js +5 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/menu/index.cjs +46 -0
- package/dist/components/menu/index.cjs.map +1 -0
- package/dist/components/menu/index.d.cts +80 -0
- package/dist/components/menu/index.d.ts +80 -0
- package/dist/components/menu/index.js +5 -0
- package/dist/components/menu/index.js.map +1 -0
- package/dist/components/tabs/index.cjs +35 -0
- package/dist/components/tabs/index.cjs.map +1 -0
- package/dist/components/tabs/index.d.cts +65 -0
- package/dist/components/tabs/index.d.ts +65 -0
- package/dist/components/tabs/index.js +6 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/toast/index.cjs +24 -0
- package/dist/components/toast/index.cjs.map +1 -0
- package/dist/components/toast/index.d.cts +49 -0
- package/dist/components/toast/index.d.ts +49 -0
- package/dist/components/toast/index.js +3 -0
- package/dist/components/toast/index.js.map +1 -0
- package/dist/index.cjs +702 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +402 -0
- package/dist/index.d.ts +402 -0
- package/dist/index.js +430 -0
- package/dist/index.js.map +1 -0
- package/package.json +99 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,702 @@
|
|
|
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
|