@a11y-core/react 0.1.0-alpha.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/README.md +252 -0
- package/dist/chunk-3WBTHTVK.js +41 -0
- package/dist/chunk-3WBTHTVK.js.map +1 -0
- package/dist/chunk-47MFBHV6.js +85 -0
- package/dist/chunk-47MFBHV6.js.map +1 -0
- package/dist/chunk-7A3IDIUB.cjs +89 -0
- package/dist/chunk-7A3IDIUB.cjs.map +1 -0
- package/dist/chunk-AZFZWGI6.cjs +383 -0
- package/dist/chunk-AZFZWGI6.cjs.map +1 -0
- package/dist/chunk-CTW5D77X.cjs +220 -0
- package/dist/chunk-CTW5D77X.cjs.map +1 -0
- package/dist/chunk-EY73HQNR.js +380 -0
- package/dist/chunk-EY73HQNR.js.map +1 -0
- package/dist/chunk-FJABCNFE.js +215 -0
- package/dist/chunk-FJABCNFE.js.map +1 -0
- package/dist/chunk-FTZ5KCOO.js +326 -0
- package/dist/chunk-FTZ5KCOO.js.map +1 -0
- package/dist/chunk-GS3H4T2O.cjs +106 -0
- package/dist/chunk-GS3H4T2O.cjs.map +1 -0
- package/dist/chunk-N6L4GLFC.cjs +45 -0
- package/dist/chunk-N6L4GLFC.cjs.map +1 -0
- package/dist/chunk-N774QCHE.js +234 -0
- package/dist/chunk-N774QCHE.js.map +1 -0
- package/dist/chunk-OSHIYZCZ.cjs +386 -0
- package/dist/chunk-OSHIYZCZ.cjs.map +1 -0
- package/dist/chunk-SRJSGDIA.js +373 -0
- package/dist/chunk-SRJSGDIA.js.map +1 -0
- package/dist/chunk-THB5U7YC.cjs +338 -0
- package/dist/chunk-THB5U7YC.cjs.map +1 -0
- package/dist/chunk-U6DUSMEA.js +99 -0
- package/dist/chunk-U6DUSMEA.js.map +1 -0
- package/dist/chunk-WDCYEMBO.cjs +245 -0
- package/dist/chunk-WDCYEMBO.cjs.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 +698 -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 +426 -0
- package/dist/index.js.map +1 -0
- package/package.json +89 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkTHB5U7YC_cjs = require('./chunk-THB5U7YC.cjs');
|
|
4
|
+
var chunkAZFZWGI6_cjs = require('./chunk-AZFZWGI6.cjs');
|
|
5
|
+
var chunkWDCYEMBO_cjs = require('./chunk-WDCYEMBO.cjs');
|
|
6
|
+
var chunkCTW5D77X_cjs = require('./chunk-CTW5D77X.cjs');
|
|
7
|
+
var chunkOSHIYZCZ_cjs = require('./chunk-OSHIYZCZ.cjs');
|
|
8
|
+
var chunk7A3IDIUB_cjs = require('./chunk-7A3IDIUB.cjs');
|
|
9
|
+
var chunkGS3H4T2O_cjs = require('./chunk-GS3H4T2O.cjs');
|
|
10
|
+
var chunkN6L4GLFC_cjs = require('./chunk-N6L4GLFC.cjs');
|
|
11
|
+
var react = require('react');
|
|
12
|
+
var core = require('@a11y-core/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 { autoFocus = false, restoreFocus = false, focusVisible = true } = options;
|
|
37
|
+
const elementRef = react.useCallback(
|
|
38
|
+
(node) => {
|
|
39
|
+
if (node && autoFocus) {
|
|
40
|
+
requestAnimationFrame(() => {
|
|
41
|
+
if (focusVisible) {
|
|
42
|
+
core.focusWithVisibleRing(node);
|
|
43
|
+
} else {
|
|
44
|
+
node.focus();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
[autoFocus, focusVisible]
|
|
50
|
+
);
|
|
51
|
+
react.useEffect(() => {
|
|
52
|
+
if (!restoreFocus) return;
|
|
53
|
+
const previousElement = document.activeElement;
|
|
54
|
+
return () => {
|
|
55
|
+
if (previousElement && previousElement.focus) {
|
|
56
|
+
previousElement.focus();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}, [restoreFocus]);
|
|
60
|
+
return elementRef;
|
|
61
|
+
}
|
|
62
|
+
function useFocusControl() {
|
|
63
|
+
const elementRef = react.useCallback((_node) => {
|
|
64
|
+
}, []);
|
|
65
|
+
const focus = react.useCallback((options) => {
|
|
66
|
+
const element = elementRef;
|
|
67
|
+
if (element.current) {
|
|
68
|
+
if (options?.visible) {
|
|
69
|
+
core.focusWithVisibleRing(element.current);
|
|
70
|
+
} else {
|
|
71
|
+
element.current.focus();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, []);
|
|
75
|
+
return { ref: elementRef, focus };
|
|
76
|
+
}
|
|
77
|
+
function useFocusWithin() {
|
|
78
|
+
const [hasFocus, setHasFocus] = react.useState(false);
|
|
79
|
+
const containerRef = react.useCallback((_node) => {
|
|
80
|
+
}, []);
|
|
81
|
+
const handleFocusIn = react.useCallback(() => {
|
|
82
|
+
setHasFocus(true);
|
|
83
|
+
}, []);
|
|
84
|
+
const handleFocusOut = react.useCallback((event) => {
|
|
85
|
+
const container = event.currentTarget;
|
|
86
|
+
const relatedTarget = event.relatedTarget;
|
|
87
|
+
if (!relatedTarget || !container.contains(relatedTarget)) {
|
|
88
|
+
setHasFocus(false);
|
|
89
|
+
}
|
|
90
|
+
}, []);
|
|
91
|
+
return {
|
|
92
|
+
ref: containerRef,
|
|
93
|
+
hasFocus,
|
|
94
|
+
focusWithinProps: {
|
|
95
|
+
onFocus: handleFocusIn,
|
|
96
|
+
onBlur: handleFocusOut
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function useRovingTabindex(options) {
|
|
101
|
+
const {
|
|
102
|
+
itemCount,
|
|
103
|
+
initialIndex = 0,
|
|
104
|
+
wrap = true,
|
|
105
|
+
orientation = "both",
|
|
106
|
+
onChange
|
|
107
|
+
} = options;
|
|
108
|
+
const [activeIndex, setActiveIndex] = react.useState(initialIndex);
|
|
109
|
+
const itemRefs = react.useRef([]);
|
|
110
|
+
react.useEffect(() => {
|
|
111
|
+
if (activeIndex >= itemCount) {
|
|
112
|
+
setActiveIndex(Math.max(0, itemCount - 1));
|
|
113
|
+
}
|
|
114
|
+
}, [itemCount, activeIndex]);
|
|
115
|
+
const moveTo = react.useCallback(
|
|
116
|
+
(index) => {
|
|
117
|
+
let newIndex = index;
|
|
118
|
+
if (newIndex < 0) {
|
|
119
|
+
newIndex = wrap ? itemCount - 1 : 0;
|
|
120
|
+
} else if (newIndex >= itemCount) {
|
|
121
|
+
newIndex = wrap ? 0 : itemCount - 1;
|
|
122
|
+
}
|
|
123
|
+
setActiveIndex(newIndex);
|
|
124
|
+
onChange?.(newIndex);
|
|
125
|
+
const element = itemRefs.current[newIndex];
|
|
126
|
+
element?.focus();
|
|
127
|
+
},
|
|
128
|
+
[itemCount, wrap, onChange]
|
|
129
|
+
);
|
|
130
|
+
const handleKeyDown = react.useCallback(
|
|
131
|
+
(event, index) => {
|
|
132
|
+
let handled = false;
|
|
133
|
+
switch (event.key) {
|
|
134
|
+
case "ArrowRight":
|
|
135
|
+
if (orientation === "horizontal" || orientation === "both") {
|
|
136
|
+
moveTo(index + 1);
|
|
137
|
+
handled = true;
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
case "ArrowLeft":
|
|
141
|
+
if (orientation === "horizontal" || orientation === "both") {
|
|
142
|
+
moveTo(index - 1);
|
|
143
|
+
handled = true;
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
case "ArrowDown":
|
|
147
|
+
if (orientation === "vertical" || orientation === "both") {
|
|
148
|
+
moveTo(index + 1);
|
|
149
|
+
handled = true;
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
case "ArrowUp":
|
|
153
|
+
if (orientation === "vertical" || orientation === "both") {
|
|
154
|
+
moveTo(index - 1);
|
|
155
|
+
handled = true;
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
case "Home":
|
|
159
|
+
moveTo(0);
|
|
160
|
+
handled = true;
|
|
161
|
+
break;
|
|
162
|
+
case "End":
|
|
163
|
+
moveTo(itemCount - 1);
|
|
164
|
+
handled = true;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
if (handled) {
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
event.stopPropagation();
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
[orientation, moveTo, itemCount]
|
|
173
|
+
);
|
|
174
|
+
const getItemProps = react.useCallback(
|
|
175
|
+
(index) => ({
|
|
176
|
+
ref: (el) => {
|
|
177
|
+
itemRefs.current[index] = el;
|
|
178
|
+
},
|
|
179
|
+
tabIndex: index === activeIndex ? 0 : -1,
|
|
180
|
+
onKeyDown: (event) => handleKeyDown(event, index),
|
|
181
|
+
onFocus: () => {
|
|
182
|
+
if (index !== activeIndex) {
|
|
183
|
+
setActiveIndex(index);
|
|
184
|
+
onChange?.(index);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}),
|
|
188
|
+
[activeIndex, handleKeyDown, onChange]
|
|
189
|
+
);
|
|
190
|
+
return {
|
|
191
|
+
activeIndex,
|
|
192
|
+
setActiveIndex: moveTo,
|
|
193
|
+
getItemProps,
|
|
194
|
+
first: () => moveTo(0),
|
|
195
|
+
last: () => moveTo(itemCount - 1),
|
|
196
|
+
next: () => moveTo(activeIndex + 1),
|
|
197
|
+
previous: () => moveTo(activeIndex - 1)
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function useRovingTabindexMap(ids, options = {}) {
|
|
201
|
+
const roving = useRovingTabindex({
|
|
202
|
+
...options,
|
|
203
|
+
itemCount: ids.length
|
|
204
|
+
});
|
|
205
|
+
const getItemProps = react.useCallback(
|
|
206
|
+
(id) => {
|
|
207
|
+
const index = ids.indexOf(id);
|
|
208
|
+
if (index === -1) {
|
|
209
|
+
throw new Error(`Unknown item ID: ${id}`);
|
|
210
|
+
}
|
|
211
|
+
return roving.getItemProps(index);
|
|
212
|
+
},
|
|
213
|
+
[ids, roving]
|
|
214
|
+
);
|
|
215
|
+
const activeId = ids[roving.activeIndex];
|
|
216
|
+
return {
|
|
217
|
+
...roving,
|
|
218
|
+
activeId,
|
|
219
|
+
getItemProps,
|
|
220
|
+
setActiveId: (id) => {
|
|
221
|
+
const index = ids.indexOf(id);
|
|
222
|
+
if (index !== -1) {
|
|
223
|
+
roving.setActiveIndex(index);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
var warnings = core.createComponentWarnings("Switch");
|
|
229
|
+
var Switch = react.forwardRef(
|
|
230
|
+
function Switch2({
|
|
231
|
+
checked: controlledChecked,
|
|
232
|
+
defaultChecked = false,
|
|
233
|
+
onCheckedChange,
|
|
234
|
+
label,
|
|
235
|
+
disabled = false,
|
|
236
|
+
unstyled = false,
|
|
237
|
+
className,
|
|
238
|
+
size = "md",
|
|
239
|
+
"aria-label": ariaLabel,
|
|
240
|
+
"aria-labelledby": ariaLabelledby,
|
|
241
|
+
onClick,
|
|
242
|
+
...props
|
|
243
|
+
}, ref) {
|
|
244
|
+
const id = chunkN6L4GLFC_cjs.useId("switch");
|
|
245
|
+
const labelId = `${id}-label`;
|
|
246
|
+
const { announce: announce2 } = chunk7A3IDIUB_cjs.useAnnouncer();
|
|
247
|
+
const [uncontrolledChecked, setUncontrolledChecked] = react.useState(defaultChecked);
|
|
248
|
+
const isControlled = controlledChecked !== void 0;
|
|
249
|
+
const checked = isControlled ? controlledChecked : uncontrolledChecked;
|
|
250
|
+
react.useEffect(() => {
|
|
251
|
+
if (!label && !ariaLabel && !ariaLabelledby) {
|
|
252
|
+
warnings.warning(
|
|
253
|
+
"Switch has no accessible label. Screen readers need this to identify the switch.",
|
|
254
|
+
'Add label="Description", aria-label="...", or aria-labelledby="..."'
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
}, [label, ariaLabel, ariaLabelledby]);
|
|
258
|
+
const toggleSwitch = react.useCallback(() => {
|
|
259
|
+
if (disabled) return;
|
|
260
|
+
const newChecked = !checked;
|
|
261
|
+
if (!isControlled) {
|
|
262
|
+
setUncontrolledChecked(newChecked);
|
|
263
|
+
}
|
|
264
|
+
onCheckedChange?.(newChecked);
|
|
265
|
+
const labelText = label || ariaLabel || "Switch";
|
|
266
|
+
announce2(`${labelText} ${newChecked ? "on" : "off"}`);
|
|
267
|
+
}, [
|
|
268
|
+
checked,
|
|
269
|
+
disabled,
|
|
270
|
+
isControlled,
|
|
271
|
+
onCheckedChange,
|
|
272
|
+
label,
|
|
273
|
+
ariaLabel,
|
|
274
|
+
announce2
|
|
275
|
+
]);
|
|
276
|
+
const handleClick = react.useCallback(
|
|
277
|
+
(event) => {
|
|
278
|
+
onClick?.(event);
|
|
279
|
+
if (!event.defaultPrevented) {
|
|
280
|
+
toggleSwitch();
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
[onClick, toggleSwitch]
|
|
284
|
+
);
|
|
285
|
+
const keyboardProps = chunkGS3H4T2O_cjs.useKeyboard(
|
|
286
|
+
{
|
|
287
|
+
" ": () => {
|
|
288
|
+
toggleSwitch();
|
|
289
|
+
},
|
|
290
|
+
Enter: () => {
|
|
291
|
+
toggleSwitch();
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{ preventDefault: true }
|
|
295
|
+
);
|
|
296
|
+
const handleKeyDown = (event) => {
|
|
297
|
+
props.onKeyDown?.(event);
|
|
298
|
+
if (!event.defaultPrevented) {
|
|
299
|
+
keyboardProps.onKeyDown(event);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
const computedAriaLabel = ariaLabel;
|
|
303
|
+
const computedAriaLabelledby = ariaLabelledby || (label ? labelId : void 0);
|
|
304
|
+
const wrapperStructuralStyles = {
|
|
305
|
+
display: "inline-flex",
|
|
306
|
+
alignItems: "center"
|
|
307
|
+
};
|
|
308
|
+
const sizes = {
|
|
309
|
+
sm: { width: 32, height: 18, thumb: 14, translate: 14 },
|
|
310
|
+
md: { width: 44, height: 24, thumb: 20, translate: 20 },
|
|
311
|
+
lg: { width: 56, height: 30, thumb: 26, translate: 26 }
|
|
312
|
+
};
|
|
313
|
+
const sizeConfig = sizes[size];
|
|
314
|
+
const trackStructuralStyles = {
|
|
315
|
+
position: "relative",
|
|
316
|
+
display: "inline-flex",
|
|
317
|
+
alignItems: "center",
|
|
318
|
+
flexShrink: 0,
|
|
319
|
+
width: sizeConfig.width,
|
|
320
|
+
height: sizeConfig.height,
|
|
321
|
+
border: "none",
|
|
322
|
+
padding: 2,
|
|
323
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
324
|
+
};
|
|
325
|
+
const trackVisualStyles = unstyled ? {} : {
|
|
326
|
+
backgroundColor: checked ? "#0066cc" : "#d1d5db",
|
|
327
|
+
borderRadius: sizeConfig.height / 2,
|
|
328
|
+
transition: "background-color 0.2s ease",
|
|
329
|
+
opacity: disabled ? 0.5 : 1
|
|
330
|
+
};
|
|
331
|
+
const thumbStructuralStyles = {
|
|
332
|
+
position: "absolute",
|
|
333
|
+
left: 2,
|
|
334
|
+
width: sizeConfig.thumb,
|
|
335
|
+
height: sizeConfig.thumb,
|
|
336
|
+
pointerEvents: "none",
|
|
337
|
+
transform: checked ? `translateX(${sizeConfig.translate}px)` : "translateX(0)"
|
|
338
|
+
};
|
|
339
|
+
const thumbVisualStyles = unstyled ? {} : {
|
|
340
|
+
backgroundColor: "white",
|
|
341
|
+
borderRadius: "50%",
|
|
342
|
+
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
|
|
343
|
+
transition: "transform 0.2s ease"
|
|
344
|
+
};
|
|
345
|
+
const labelStyles = unstyled ? {
|
|
346
|
+
marginLeft: 8,
|
|
347
|
+
userSelect: "none",
|
|
348
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
349
|
+
} : {
|
|
350
|
+
marginLeft: 8,
|
|
351
|
+
userSelect: "none",
|
|
352
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
353
|
+
opacity: disabled ? 0.5 : 1
|
|
354
|
+
};
|
|
355
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
356
|
+
"div",
|
|
357
|
+
{
|
|
358
|
+
style: wrapperStructuralStyles,
|
|
359
|
+
"data-a11y-core-switch-wrapper": true,
|
|
360
|
+
"data-size": size,
|
|
361
|
+
children: [
|
|
362
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
363
|
+
"button",
|
|
364
|
+
{
|
|
365
|
+
ref,
|
|
366
|
+
type: "button",
|
|
367
|
+
role: "switch",
|
|
368
|
+
"aria-checked": checked,
|
|
369
|
+
"aria-label": computedAriaLabel,
|
|
370
|
+
"aria-labelledby": computedAriaLabelledby,
|
|
371
|
+
disabled,
|
|
372
|
+
onClick: handleClick,
|
|
373
|
+
onKeyDown: handleKeyDown,
|
|
374
|
+
className,
|
|
375
|
+
style: { ...trackStructuralStyles, ...trackVisualStyles },
|
|
376
|
+
tabIndex: disabled ? -1 : 0,
|
|
377
|
+
"data-a11y-core-switch": true,
|
|
378
|
+
"data-checked": checked,
|
|
379
|
+
"data-disabled": disabled || void 0,
|
|
380
|
+
"data-size": size,
|
|
381
|
+
...props,
|
|
382
|
+
onFocus: (e) => {
|
|
383
|
+
if (!unstyled) {
|
|
384
|
+
e.currentTarget.style.outline = "2px solid #0066cc";
|
|
385
|
+
e.currentTarget.style.outlineOffset = "2px";
|
|
386
|
+
}
|
|
387
|
+
props.onFocus?.(e);
|
|
388
|
+
},
|
|
389
|
+
onBlur: (e) => {
|
|
390
|
+
if (!unstyled) {
|
|
391
|
+
e.currentTarget.style.outline = "none";
|
|
392
|
+
}
|
|
393
|
+
props.onBlur?.(e);
|
|
394
|
+
},
|
|
395
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
396
|
+
"span",
|
|
397
|
+
{
|
|
398
|
+
style: { ...thumbStructuralStyles, ...thumbVisualStyles },
|
|
399
|
+
"data-a11y-core-switch-thumb": true,
|
|
400
|
+
"aria-hidden": "true"
|
|
401
|
+
}
|
|
402
|
+
)
|
|
403
|
+
}
|
|
404
|
+
),
|
|
405
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
406
|
+
"label",
|
|
407
|
+
{
|
|
408
|
+
id: labelId,
|
|
409
|
+
onClick: disabled ? void 0 : () => toggleSwitch(),
|
|
410
|
+
style: labelStyles,
|
|
411
|
+
"data-a11y-core-switch-label": true,
|
|
412
|
+
children: label
|
|
413
|
+
}
|
|
414
|
+
)
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
);
|
|
420
|
+
Switch.displayName = "Switch";
|
|
421
|
+
|
|
422
|
+
Object.defineProperty(exports, "Dialog", {
|
|
423
|
+
enumerable: true,
|
|
424
|
+
get: function () { return chunkTHB5U7YC_cjs.DialogCompound; }
|
|
425
|
+
});
|
|
426
|
+
Object.defineProperty(exports, "DialogActions", {
|
|
427
|
+
enumerable: true,
|
|
428
|
+
get: function () { return chunkTHB5U7YC_cjs.DialogActions; }
|
|
429
|
+
});
|
|
430
|
+
Object.defineProperty(exports, "DialogBase", {
|
|
431
|
+
enumerable: true,
|
|
432
|
+
get: function () { return chunkTHB5U7YC_cjs.Dialog; }
|
|
433
|
+
});
|
|
434
|
+
Object.defineProperty(exports, "DialogClose", {
|
|
435
|
+
enumerable: true,
|
|
436
|
+
get: function () { return chunkTHB5U7YC_cjs.DialogClose; }
|
|
437
|
+
});
|
|
438
|
+
Object.defineProperty(exports, "DialogContent", {
|
|
439
|
+
enumerable: true,
|
|
440
|
+
get: function () { return chunkTHB5U7YC_cjs.DialogContent; }
|
|
441
|
+
});
|
|
442
|
+
Object.defineProperty(exports, "DialogDescription", {
|
|
443
|
+
enumerable: true,
|
|
444
|
+
get: function () { return chunkTHB5U7YC_cjs.DialogDescription; }
|
|
445
|
+
});
|
|
446
|
+
Object.defineProperty(exports, "DialogTitle", {
|
|
447
|
+
enumerable: true,
|
|
448
|
+
get: function () { return chunkTHB5U7YC_cjs.DialogTitle; }
|
|
449
|
+
});
|
|
450
|
+
Object.defineProperty(exports, "DialogTrigger", {
|
|
451
|
+
enumerable: true,
|
|
452
|
+
get: function () { return chunkTHB5U7YC_cjs.DialogTrigger; }
|
|
453
|
+
});
|
|
454
|
+
Object.defineProperty(exports, "useDialogContext", {
|
|
455
|
+
enumerable: true,
|
|
456
|
+
get: function () { return chunkTHB5U7YC_cjs.useDialogContext; }
|
|
457
|
+
});
|
|
458
|
+
Object.defineProperty(exports, "useFocusTrap", {
|
|
459
|
+
enumerable: true,
|
|
460
|
+
get: function () { return chunkTHB5U7YC_cjs.useFocusTrap; }
|
|
461
|
+
});
|
|
462
|
+
Object.defineProperty(exports, "useFocusTrapControls", {
|
|
463
|
+
enumerable: true,
|
|
464
|
+
get: function () { return chunkTHB5U7YC_cjs.useFocusTrapControls; }
|
|
465
|
+
});
|
|
466
|
+
Object.defineProperty(exports, "ActionMenu", {
|
|
467
|
+
enumerable: true,
|
|
468
|
+
get: function () { return chunkAZFZWGI6_cjs.ActionMenuCompound; }
|
|
469
|
+
});
|
|
470
|
+
Object.defineProperty(exports, "ActionMenuBase", {
|
|
471
|
+
enumerable: true,
|
|
472
|
+
get: function () { return chunkAZFZWGI6_cjs.ActionMenu; }
|
|
473
|
+
});
|
|
474
|
+
Object.defineProperty(exports, "ActionMenuContent", {
|
|
475
|
+
enumerable: true,
|
|
476
|
+
get: function () { return chunkAZFZWGI6_cjs.ActionMenuContent; }
|
|
477
|
+
});
|
|
478
|
+
Object.defineProperty(exports, "ActionMenuItem", {
|
|
479
|
+
enumerable: true,
|
|
480
|
+
get: function () { return chunkAZFZWGI6_cjs.ActionMenuItem; }
|
|
481
|
+
});
|
|
482
|
+
Object.defineProperty(exports, "ActionMenuLabel", {
|
|
483
|
+
enumerable: true,
|
|
484
|
+
get: function () { return chunkAZFZWGI6_cjs.ActionMenuLabel; }
|
|
485
|
+
});
|
|
486
|
+
Object.defineProperty(exports, "ActionMenuSeparator", {
|
|
487
|
+
enumerable: true,
|
|
488
|
+
get: function () { return chunkAZFZWGI6_cjs.ActionMenuSeparator; }
|
|
489
|
+
});
|
|
490
|
+
Object.defineProperty(exports, "ActionMenuTrigger", {
|
|
491
|
+
enumerable: true,
|
|
492
|
+
get: function () { return chunkAZFZWGI6_cjs.ActionMenuTrigger; }
|
|
493
|
+
});
|
|
494
|
+
Object.defineProperty(exports, "useActionMenuContext", {
|
|
495
|
+
enumerable: true,
|
|
496
|
+
get: function () { return chunkAZFZWGI6_cjs.useActionMenuContext; }
|
|
497
|
+
});
|
|
498
|
+
Object.defineProperty(exports, "Tab", {
|
|
499
|
+
enumerable: true,
|
|
500
|
+
get: function () { return chunkWDCYEMBO_cjs.Tab; }
|
|
501
|
+
});
|
|
502
|
+
Object.defineProperty(exports, "TabList", {
|
|
503
|
+
enumerable: true,
|
|
504
|
+
get: function () { return chunkWDCYEMBO_cjs.TabList; }
|
|
505
|
+
});
|
|
506
|
+
Object.defineProperty(exports, "TabPanel", {
|
|
507
|
+
enumerable: true,
|
|
508
|
+
get: function () { return chunkWDCYEMBO_cjs.TabPanel; }
|
|
509
|
+
});
|
|
510
|
+
Object.defineProperty(exports, "Tabs", {
|
|
511
|
+
enumerable: true,
|
|
512
|
+
get: function () { return chunkWDCYEMBO_cjs.TabsCompound; }
|
|
513
|
+
});
|
|
514
|
+
Object.defineProperty(exports, "TabsBase", {
|
|
515
|
+
enumerable: true,
|
|
516
|
+
get: function () { return chunkWDCYEMBO_cjs.Tabs; }
|
|
517
|
+
});
|
|
518
|
+
Object.defineProperty(exports, "useTabsContext", {
|
|
519
|
+
enumerable: true,
|
|
520
|
+
get: function () { return chunkWDCYEMBO_cjs.useTabsContext; }
|
|
521
|
+
});
|
|
522
|
+
Object.defineProperty(exports, "ToastProvider", {
|
|
523
|
+
enumerable: true,
|
|
524
|
+
get: function () { return chunkCTW5D77X_cjs.ToastProvider; }
|
|
525
|
+
});
|
|
526
|
+
Object.defineProperty(exports, "ToastViewport", {
|
|
527
|
+
enumerable: true,
|
|
528
|
+
get: function () { return chunkCTW5D77X_cjs.ToastViewport; }
|
|
529
|
+
});
|
|
530
|
+
Object.defineProperty(exports, "useToast", {
|
|
531
|
+
enumerable: true,
|
|
532
|
+
get: function () { return chunkCTW5D77X_cjs.useToast; }
|
|
533
|
+
});
|
|
534
|
+
Object.defineProperty(exports, "useToastHelpers", {
|
|
535
|
+
enumerable: true,
|
|
536
|
+
get: function () { return chunkCTW5D77X_cjs.useToastHelpers; }
|
|
537
|
+
});
|
|
538
|
+
Object.defineProperty(exports, "Combobox", {
|
|
539
|
+
enumerable: true,
|
|
540
|
+
get: function () { return chunkOSHIYZCZ_cjs.ComboboxCompound; }
|
|
541
|
+
});
|
|
542
|
+
Object.defineProperty(exports, "ComboboxBase", {
|
|
543
|
+
enumerable: true,
|
|
544
|
+
get: function () { return chunkOSHIYZCZ_cjs.Combobox; }
|
|
545
|
+
});
|
|
546
|
+
Object.defineProperty(exports, "ComboboxInput", {
|
|
547
|
+
enumerable: true,
|
|
548
|
+
get: function () { return chunkOSHIYZCZ_cjs.ComboboxInput; }
|
|
549
|
+
});
|
|
550
|
+
Object.defineProperty(exports, "ComboboxListbox", {
|
|
551
|
+
enumerable: true,
|
|
552
|
+
get: function () { return chunkOSHIYZCZ_cjs.ComboboxListbox; }
|
|
553
|
+
});
|
|
554
|
+
Object.defineProperty(exports, "ComboboxOption", {
|
|
555
|
+
enumerable: true,
|
|
556
|
+
get: function () { return chunkOSHIYZCZ_cjs.ComboboxOption; }
|
|
557
|
+
});
|
|
558
|
+
Object.defineProperty(exports, "useAnnounceLoading", {
|
|
559
|
+
enumerable: true,
|
|
560
|
+
get: function () { return chunk7A3IDIUB_cjs.useAnnounceLoading; }
|
|
561
|
+
});
|
|
562
|
+
Object.defineProperty(exports, "useAnnounceOnChange", {
|
|
563
|
+
enumerable: true,
|
|
564
|
+
get: function () { return chunk7A3IDIUB_cjs.useAnnounceOnChange; }
|
|
565
|
+
});
|
|
566
|
+
Object.defineProperty(exports, "useAnnouncer", {
|
|
567
|
+
enumerable: true,
|
|
568
|
+
get: function () { return chunk7A3IDIUB_cjs.useAnnouncer; }
|
|
569
|
+
});
|
|
570
|
+
Object.defineProperty(exports, "useGridKeyboard", {
|
|
571
|
+
enumerable: true,
|
|
572
|
+
get: function () { return chunkGS3H4T2O_cjs.useGridKeyboard; }
|
|
573
|
+
});
|
|
574
|
+
Object.defineProperty(exports, "useKeyPressed", {
|
|
575
|
+
enumerable: true,
|
|
576
|
+
get: function () { return chunkGS3H4T2O_cjs.useKeyPressed; }
|
|
577
|
+
});
|
|
578
|
+
Object.defineProperty(exports, "useKeyboard", {
|
|
579
|
+
enumerable: true,
|
|
580
|
+
get: function () { return chunkGS3H4T2O_cjs.useKeyboard; }
|
|
581
|
+
});
|
|
582
|
+
Object.defineProperty(exports, "useMenuKeyboard", {
|
|
583
|
+
enumerable: true,
|
|
584
|
+
get: function () { return chunkGS3H4T2O_cjs.useMenuKeyboard; }
|
|
585
|
+
});
|
|
586
|
+
Object.defineProperty(exports, "useTabsKeyboard", {
|
|
587
|
+
enumerable: true,
|
|
588
|
+
get: function () { return chunkGS3H4T2O_cjs.useTabsKeyboard; }
|
|
589
|
+
});
|
|
590
|
+
Object.defineProperty(exports, "useTypeAhead", {
|
|
591
|
+
enumerable: true,
|
|
592
|
+
get: function () { return chunkGS3H4T2O_cjs.useTypeAhead; }
|
|
593
|
+
});
|
|
594
|
+
Object.defineProperty(exports, "useId", {
|
|
595
|
+
enumerable: true,
|
|
596
|
+
get: function () { return chunkN6L4GLFC_cjs.useId; }
|
|
597
|
+
});
|
|
598
|
+
Object.defineProperty(exports, "useIdScope", {
|
|
599
|
+
enumerable: true,
|
|
600
|
+
get: function () { return chunkN6L4GLFC_cjs.useIdScope; }
|
|
601
|
+
});
|
|
602
|
+
Object.defineProperty(exports, "useIds", {
|
|
603
|
+
enumerable: true,
|
|
604
|
+
get: function () { return chunkN6L4GLFC_cjs.useIds; }
|
|
605
|
+
});
|
|
606
|
+
Object.defineProperty(exports, "announce", {
|
|
607
|
+
enumerable: true,
|
|
608
|
+
get: function () { return core.announce; }
|
|
609
|
+
});
|
|
610
|
+
Object.defineProperty(exports, "announceAssertive", {
|
|
611
|
+
enumerable: true,
|
|
612
|
+
get: function () { return core.announceAssertive; }
|
|
613
|
+
});
|
|
614
|
+
Object.defineProperty(exports, "announceError", {
|
|
615
|
+
enumerable: true,
|
|
616
|
+
get: function () { return core.announceError; }
|
|
617
|
+
});
|
|
618
|
+
Object.defineProperty(exports, "announcePolite", {
|
|
619
|
+
enumerable: true,
|
|
620
|
+
get: function () { return core.announcePolite; }
|
|
621
|
+
});
|
|
622
|
+
Object.defineProperty(exports, "announceProgress", {
|
|
623
|
+
enumerable: true,
|
|
624
|
+
get: function () { return core.announceProgress; }
|
|
625
|
+
});
|
|
626
|
+
Object.defineProperty(exports, "announceStatus", {
|
|
627
|
+
enumerable: true,
|
|
628
|
+
get: function () { return core.announceStatus; }
|
|
629
|
+
});
|
|
630
|
+
Object.defineProperty(exports, "aria", {
|
|
631
|
+
enumerable: true,
|
|
632
|
+
get: function () { return core.aria; }
|
|
633
|
+
});
|
|
634
|
+
Object.defineProperty(exports, "buildAriaProps", {
|
|
635
|
+
enumerable: true,
|
|
636
|
+
get: function () { return core.buildAriaProps; }
|
|
637
|
+
});
|
|
638
|
+
Object.defineProperty(exports, "checks", {
|
|
639
|
+
enumerable: true,
|
|
640
|
+
get: function () { return core.checks; }
|
|
641
|
+
});
|
|
642
|
+
Object.defineProperty(exports, "createComponentWarnings", {
|
|
643
|
+
enumerable: true,
|
|
644
|
+
get: function () { return core.createComponentWarnings; }
|
|
645
|
+
});
|
|
646
|
+
Object.defineProperty(exports, "hasAccessibleName", {
|
|
647
|
+
enumerable: true,
|
|
648
|
+
get: function () { return core.hasAccessibleName; }
|
|
649
|
+
});
|
|
650
|
+
Object.defineProperty(exports, "isAndroid", {
|
|
651
|
+
enumerable: true,
|
|
652
|
+
get: function () { return core.isAndroid; }
|
|
653
|
+
});
|
|
654
|
+
Object.defineProperty(exports, "isBrowser", {
|
|
655
|
+
enumerable: true,
|
|
656
|
+
get: function () { return core.isBrowser; }
|
|
657
|
+
});
|
|
658
|
+
Object.defineProperty(exports, "isIOS", {
|
|
659
|
+
enumerable: true,
|
|
660
|
+
get: function () { return core.isIOS; }
|
|
661
|
+
});
|
|
662
|
+
Object.defineProperty(exports, "isMac", {
|
|
663
|
+
enumerable: true,
|
|
664
|
+
get: function () { return core.isMac; }
|
|
665
|
+
});
|
|
666
|
+
Object.defineProperty(exports, "mergeAriaIds", {
|
|
667
|
+
enumerable: true,
|
|
668
|
+
get: function () { return core.mergeAriaIds; }
|
|
669
|
+
});
|
|
670
|
+
Object.defineProperty(exports, "prefersDarkMode", {
|
|
671
|
+
enumerable: true,
|
|
672
|
+
get: function () { return core.prefersDarkMode; }
|
|
673
|
+
});
|
|
674
|
+
Object.defineProperty(exports, "prefersHighContrast", {
|
|
675
|
+
enumerable: true,
|
|
676
|
+
get: function () { return core.prefersHighContrast; }
|
|
677
|
+
});
|
|
678
|
+
Object.defineProperty(exports, "prefersReducedMotion", {
|
|
679
|
+
enumerable: true,
|
|
680
|
+
get: function () { return core.prefersReducedMotion; }
|
|
681
|
+
});
|
|
682
|
+
Object.defineProperty(exports, "setWarningHandler", {
|
|
683
|
+
enumerable: true,
|
|
684
|
+
get: function () { return core.setWarningHandler; }
|
|
685
|
+
});
|
|
686
|
+
Object.defineProperty(exports, "warn", {
|
|
687
|
+
enumerable: true,
|
|
688
|
+
get: function () { return core.warn; }
|
|
689
|
+
});
|
|
690
|
+
exports.Switch = Switch;
|
|
691
|
+
exports.useFocusControl = useFocusControl;
|
|
692
|
+
exports.useFocusManager = useFocusManager;
|
|
693
|
+
exports.useFocusVisible = useFocusVisible;
|
|
694
|
+
exports.useFocusWithin = useFocusWithin;
|
|
695
|
+
exports.useRovingTabindex = useRovingTabindex;
|
|
696
|
+
exports.useRovingTabindexMap = useRovingTabindexMap;
|
|
697
|
+
//# sourceMappingURL=index.cjs.map
|
|
698
|
+
//# sourceMappingURL=index.cjs.map
|