@react-aria/checkbox 3.0.0-nightly.2911 → 3.0.0-nightly.2917
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/useCheckbox.main.js +3 -3
- package/dist/useCheckbox.mjs +3 -3
- package/dist/useCheckbox.module.js +3 -3
- package/dist/useCheckboxGroup.main.js +4 -4
- package/dist/useCheckboxGroup.mjs +4 -4
- package/dist/useCheckboxGroup.module.js +4 -4
- package/dist/useCheckboxGroupItem.main.js +5 -5
- package/dist/useCheckboxGroupItem.mjs +5 -5
- package/dist/useCheckboxGroupItem.module.js +5 -5
- package/package.json +12 -12
package/dist/useCheckbox.main.js
CHANGED
|
@@ -35,7 +35,7 @@ function $468c774d7db917b7$export$e375f10ce42261c5(props, state, inputRef) {
|
|
|
35
35
|
isInvalid: isInvalid
|
|
36
36
|
}, state, inputRef);
|
|
37
37
|
(0, $ar5WQ$reactariaform.useFormValidation)(props, validationState, inputRef);
|
|
38
|
-
let { isIndeterminate: isIndeterminate, isRequired: isRequired, validationBehavior: validationBehavior =
|
|
38
|
+
let { isIndeterminate: isIndeterminate, isRequired: isRequired, validationBehavior: validationBehavior = 'aria' } = props;
|
|
39
39
|
(0, $ar5WQ$react.useEffect)(()=>{
|
|
40
40
|
// indeterminate is a property, but it can only be set via javascript
|
|
41
41
|
// https://css-tricks.com/indeterminate-checkboxes/
|
|
@@ -46,8 +46,8 @@ function $468c774d7db917b7$export$e375f10ce42261c5(props, state, inputRef) {
|
|
|
46
46
|
inputProps: {
|
|
47
47
|
...inputProps,
|
|
48
48
|
checked: isSelected,
|
|
49
|
-
|
|
50
|
-
required: isRequired && validationBehavior ===
|
|
49
|
+
'aria-required': isRequired && validationBehavior === 'aria' || undefined,
|
|
50
|
+
required: isRequired && validationBehavior === 'native'
|
|
51
51
|
},
|
|
52
52
|
isSelected: isSelected,
|
|
53
53
|
isPressed: isPressed,
|
package/dist/useCheckbox.mjs
CHANGED
|
@@ -29,7 +29,7 @@ function $406796ff087fe49b$export$e375f10ce42261c5(props, state, inputRef) {
|
|
|
29
29
|
isInvalid: isInvalid
|
|
30
30
|
}, state, inputRef);
|
|
31
31
|
(0, $jNP0e$useFormValidation)(props, validationState, inputRef);
|
|
32
|
-
let { isIndeterminate: isIndeterminate, isRequired: isRequired, validationBehavior: validationBehavior =
|
|
32
|
+
let { isIndeterminate: isIndeterminate, isRequired: isRequired, validationBehavior: validationBehavior = 'aria' } = props;
|
|
33
33
|
(0, $jNP0e$useEffect)(()=>{
|
|
34
34
|
// indeterminate is a property, but it can only be set via javascript
|
|
35
35
|
// https://css-tricks.com/indeterminate-checkboxes/
|
|
@@ -40,8 +40,8 @@ function $406796ff087fe49b$export$e375f10ce42261c5(props, state, inputRef) {
|
|
|
40
40
|
inputProps: {
|
|
41
41
|
...inputProps,
|
|
42
42
|
checked: isSelected,
|
|
43
|
-
|
|
44
|
-
required: isRequired && validationBehavior ===
|
|
43
|
+
'aria-required': isRequired && validationBehavior === 'aria' || undefined,
|
|
44
|
+
required: isRequired && validationBehavior === 'native'
|
|
45
45
|
},
|
|
46
46
|
isSelected: isSelected,
|
|
47
47
|
isPressed: isPressed,
|
|
@@ -29,7 +29,7 @@ function $406796ff087fe49b$export$e375f10ce42261c5(props, state, inputRef) {
|
|
|
29
29
|
isInvalid: isInvalid
|
|
30
30
|
}, state, inputRef);
|
|
31
31
|
(0, $jNP0e$useFormValidation)(props, validationState, inputRef);
|
|
32
|
-
let { isIndeterminate: isIndeterminate, isRequired: isRequired, validationBehavior: validationBehavior =
|
|
32
|
+
let { isIndeterminate: isIndeterminate, isRequired: isRequired, validationBehavior: validationBehavior = 'aria' } = props;
|
|
33
33
|
(0, $jNP0e$useEffect)(()=>{
|
|
34
34
|
// indeterminate is a property, but it can only be set via javascript
|
|
35
35
|
// https://css-tricks.com/indeterminate-checkboxes/
|
|
@@ -40,8 +40,8 @@ function $406796ff087fe49b$export$e375f10ce42261c5(props, state, inputRef) {
|
|
|
40
40
|
inputProps: {
|
|
41
41
|
...inputProps,
|
|
42
42
|
checked: isSelected,
|
|
43
|
-
|
|
44
|
-
required: isRequired && validationBehavior ===
|
|
43
|
+
'aria-required': isRequired && validationBehavior === 'aria' || undefined,
|
|
44
|
+
required: isRequired && validationBehavior === 'native'
|
|
45
45
|
},
|
|
46
46
|
isSelected: isSelected,
|
|
47
47
|
isPressed: isPressed,
|
|
@@ -24,13 +24,13 @@ $parcel$export(module.exports, "useCheckboxGroup", () => $253685172d17db7d$expor
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
function $253685172d17db7d$export$49ff6f28c54f1cbe(props, state) {
|
|
27
|
-
let { isDisabled: isDisabled, name: name, validationBehavior: validationBehavior =
|
|
27
|
+
let { isDisabled: isDisabled, name: name, validationBehavior: validationBehavior = 'aria' } = props;
|
|
28
28
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
29
29
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $6d1SX$reactarialabel.useField)({
|
|
30
30
|
...props,
|
|
31
31
|
// Checkbox group is not an HTML input element so it
|
|
32
32
|
// shouldn't be labeled by a <label> element.
|
|
33
|
-
labelElementType:
|
|
33
|
+
labelElementType: 'span',
|
|
34
34
|
isInvalid: isInvalid,
|
|
35
35
|
errorMessage: props.errorMessage || validationErrors
|
|
36
36
|
});
|
|
@@ -50,8 +50,8 @@ function $253685172d17db7d$export$49ff6f28c54f1cbe(props, state) {
|
|
|
50
50
|
});
|
|
51
51
|
return {
|
|
52
52
|
groupProps: (0, $6d1SX$reactariautils.mergeProps)(domProps, {
|
|
53
|
-
role:
|
|
54
|
-
|
|
53
|
+
role: 'group',
|
|
54
|
+
'aria-disabled': isDisabled || undefined,
|
|
55
55
|
...fieldProps,
|
|
56
56
|
...focusWithinProps
|
|
57
57
|
}),
|
|
@@ -18,13 +18,13 @@ import {useFocusWithin as $gtLuF$useFocusWithin} from "@react-aria/interactions"
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
function $1e9fce0cfacc738b$export$49ff6f28c54f1cbe(props, state) {
|
|
21
|
-
let { isDisabled: isDisabled, name: name, validationBehavior: validationBehavior =
|
|
21
|
+
let { isDisabled: isDisabled, name: name, validationBehavior: validationBehavior = 'aria' } = props;
|
|
22
22
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
23
23
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $gtLuF$useField)({
|
|
24
24
|
...props,
|
|
25
25
|
// Checkbox group is not an HTML input element so it
|
|
26
26
|
// shouldn't be labeled by a <label> element.
|
|
27
|
-
labelElementType:
|
|
27
|
+
labelElementType: 'span',
|
|
28
28
|
isInvalid: isInvalid,
|
|
29
29
|
errorMessage: props.errorMessage || validationErrors
|
|
30
30
|
});
|
|
@@ -44,8 +44,8 @@ function $1e9fce0cfacc738b$export$49ff6f28c54f1cbe(props, state) {
|
|
|
44
44
|
});
|
|
45
45
|
return {
|
|
46
46
|
groupProps: (0, $gtLuF$mergeProps)(domProps, {
|
|
47
|
-
role:
|
|
48
|
-
|
|
47
|
+
role: 'group',
|
|
48
|
+
'aria-disabled': isDisabled || undefined,
|
|
49
49
|
...fieldProps,
|
|
50
50
|
...focusWithinProps
|
|
51
51
|
}),
|
|
@@ -18,13 +18,13 @@ import {useFocusWithin as $gtLuF$useFocusWithin} from "@react-aria/interactions"
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
function $1e9fce0cfacc738b$export$49ff6f28c54f1cbe(props, state) {
|
|
21
|
-
let { isDisabled: isDisabled, name: name, validationBehavior: validationBehavior =
|
|
21
|
+
let { isDisabled: isDisabled, name: name, validationBehavior: validationBehavior = 'aria' } = props;
|
|
22
22
|
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
23
23
|
let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $gtLuF$useField)({
|
|
24
24
|
...props,
|
|
25
25
|
// Checkbox group is not an HTML input element so it
|
|
26
26
|
// shouldn't be labeled by a <label> element.
|
|
27
|
-
labelElementType:
|
|
27
|
+
labelElementType: 'span',
|
|
28
28
|
isInvalid: isInvalid,
|
|
29
29
|
errorMessage: props.errorMessage || validationErrors
|
|
30
30
|
});
|
|
@@ -44,8 +44,8 @@ function $1e9fce0cfacc738b$export$49ff6f28c54f1cbe(props, state) {
|
|
|
44
44
|
});
|
|
45
45
|
return {
|
|
46
46
|
groupProps: (0, $gtLuF$mergeProps)(domProps, {
|
|
47
|
-
role:
|
|
48
|
-
|
|
47
|
+
role: 'group',
|
|
48
|
+
'aria-disabled': isDisabled || undefined,
|
|
49
49
|
...fieldProps,
|
|
50
50
|
...focusWithinProps
|
|
51
51
|
}),
|
|
@@ -44,7 +44,7 @@ function $07e03121d6ac83c8$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
44
44
|
value: toggleState.isSelected,
|
|
45
45
|
// Server validation is handled at the group level.
|
|
46
46
|
name: undefined,
|
|
47
|
-
validationBehavior:
|
|
47
|
+
validationBehavior: 'aria'
|
|
48
48
|
});
|
|
49
49
|
// Update the checkbox group state when realtime validation changes.
|
|
50
50
|
let nativeValidation = (0, $2Rh3D$react.useRef)((0, $2Rh3D$reactstatelyform.DEFAULT_VALIDATION_RESULT));
|
|
@@ -54,7 +54,7 @@ function $07e03121d6ac83c8$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
54
54
|
(0, $2Rh3D$react.useEffect)(updateValidation);
|
|
55
55
|
// Combine group and checkbox level validation.
|
|
56
56
|
let combinedRealtimeValidation = state.realtimeValidation.isInvalid ? state.realtimeValidation : realtimeValidation;
|
|
57
|
-
let displayValidation = validationBehavior ===
|
|
57
|
+
let displayValidation = validationBehavior === 'native' ? state.displayValidation : combinedRealtimeValidation;
|
|
58
58
|
var _props_isRequired;
|
|
59
59
|
let res = (0, $468c774d7db917b7$exports.useCheckbox)({
|
|
60
60
|
...props,
|
|
@@ -78,11 +78,11 @@ function $07e03121d6ac83c8$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
78
78
|
...res,
|
|
79
79
|
inputProps: {
|
|
80
80
|
...res.inputProps,
|
|
81
|
-
|
|
82
|
-
props[
|
|
81
|
+
'aria-describedby': [
|
|
82
|
+
props['aria-describedby'],
|
|
83
83
|
state.isInvalid ? errorMessageId : null,
|
|
84
84
|
descriptionId
|
|
85
|
-
].filter(Boolean).join(
|
|
85
|
+
].filter(Boolean).join(' ') || undefined
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
}
|
|
@@ -38,7 +38,7 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
38
38
|
value: toggleState.isSelected,
|
|
39
39
|
// Server validation is handled at the group level.
|
|
40
40
|
name: undefined,
|
|
41
|
-
validationBehavior:
|
|
41
|
+
validationBehavior: 'aria'
|
|
42
42
|
});
|
|
43
43
|
// Update the checkbox group state when realtime validation changes.
|
|
44
44
|
let nativeValidation = (0, $6clEo$useRef)((0, $6clEo$DEFAULT_VALIDATION_RESULT));
|
|
@@ -48,7 +48,7 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
48
48
|
(0, $6clEo$useEffect)(updateValidation);
|
|
49
49
|
// Combine group and checkbox level validation.
|
|
50
50
|
let combinedRealtimeValidation = state.realtimeValidation.isInvalid ? state.realtimeValidation : realtimeValidation;
|
|
51
|
-
let displayValidation = validationBehavior ===
|
|
51
|
+
let displayValidation = validationBehavior === 'native' ? state.displayValidation : combinedRealtimeValidation;
|
|
52
52
|
var _props_isRequired;
|
|
53
53
|
let res = (0, $406796ff087fe49b$export$e375f10ce42261c5)({
|
|
54
54
|
...props,
|
|
@@ -72,11 +72,11 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
72
72
|
...res,
|
|
73
73
|
inputProps: {
|
|
74
74
|
...res.inputProps,
|
|
75
|
-
|
|
76
|
-
props[
|
|
75
|
+
'aria-describedby': [
|
|
76
|
+
props['aria-describedby'],
|
|
77
77
|
state.isInvalid ? errorMessageId : null,
|
|
78
78
|
descriptionId
|
|
79
|
-
].filter(Boolean).join(
|
|
79
|
+
].filter(Boolean).join(' ') || undefined
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
}
|
|
@@ -38,7 +38,7 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
38
38
|
value: toggleState.isSelected,
|
|
39
39
|
// Server validation is handled at the group level.
|
|
40
40
|
name: undefined,
|
|
41
|
-
validationBehavior:
|
|
41
|
+
validationBehavior: 'aria'
|
|
42
42
|
});
|
|
43
43
|
// Update the checkbox group state when realtime validation changes.
|
|
44
44
|
let nativeValidation = (0, $6clEo$useRef)((0, $6clEo$DEFAULT_VALIDATION_RESULT));
|
|
@@ -48,7 +48,7 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
48
48
|
(0, $6clEo$useEffect)(updateValidation);
|
|
49
49
|
// Combine group and checkbox level validation.
|
|
50
50
|
let combinedRealtimeValidation = state.realtimeValidation.isInvalid ? state.realtimeValidation : realtimeValidation;
|
|
51
|
-
let displayValidation = validationBehavior ===
|
|
51
|
+
let displayValidation = validationBehavior === 'native' ? state.displayValidation : combinedRealtimeValidation;
|
|
52
52
|
var _props_isRequired;
|
|
53
53
|
let res = (0, $406796ff087fe49b$export$e375f10ce42261c5)({
|
|
54
54
|
...props,
|
|
@@ -72,11 +72,11 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
|
|
|
72
72
|
...res,
|
|
73
73
|
inputProps: {
|
|
74
74
|
...res.inputProps,
|
|
75
|
-
|
|
76
|
-
props[
|
|
75
|
+
'aria-describedby': [
|
|
76
|
+
props['aria-describedby'],
|
|
77
77
|
state.isInvalid ? errorMessageId : null,
|
|
78
78
|
descriptionId
|
|
79
|
-
].filter(Boolean).join(
|
|
79
|
+
].filter(Boolean).join(' ') || undefined
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/checkbox",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.2917+c34886769",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/form": "3.0.
|
|
26
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
|
27
|
-
"@react-aria/label": "3.0.0-nightly.
|
|
28
|
-
"@react-aria/toggle": "3.0.0-nightly.
|
|
29
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
30
|
-
"@react-stately/checkbox": "3.6.
|
|
31
|
-
"@react-stately/form": "3.0.
|
|
32
|
-
"@react-stately/toggle": "3.0.0-nightly.
|
|
33
|
-
"@react-types/checkbox": "3.0.0-nightly.
|
|
34
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
25
|
+
"@react-aria/form": "3.0.6-nightly.4629+c34886769",
|
|
26
|
+
"@react-aria/interactions": "3.0.0-nightly.2917+c34886769",
|
|
27
|
+
"@react-aria/label": "3.0.0-nightly.2917+c34886769",
|
|
28
|
+
"@react-aria/toggle": "3.0.0-nightly.2917+c34886769",
|
|
29
|
+
"@react-aria/utils": "3.0.0-nightly.2917+c34886769",
|
|
30
|
+
"@react-stately/checkbox": "3.6.6-nightly.4629+c34886769",
|
|
31
|
+
"@react-stately/form": "3.0.4-nightly.4629+c34886769",
|
|
32
|
+
"@react-stately/toggle": "3.0.0-nightly.2917+c34886769",
|
|
33
|
+
"@react-types/checkbox": "3.0.0-nightly.2917+c34886769",
|
|
34
|
+
"@react-types/shared": "3.0.0-nightly.2917+c34886769",
|
|
35
35
|
"@swc/helpers": "^0.5.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "c34886769d3e69bb56553a02eead6a0fd877e754"
|
|
44
44
|
}
|