@react-aria/radio 3.10.3 → 3.10.4

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.
@@ -26,11 +26,11 @@ $parcel$export(module.exports, "useRadio", () => $e184702b1b7f1863$export$37b096
26
26
 
27
27
 
28
28
  function $e184702b1b7f1863$export$37b0961d2f4751e2(props, state, ref) {
29
- let { value: value, children: children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby } = props;
29
+ let { value: value, children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby } = props;
30
30
  const isDisabled = props.isDisabled || state.isDisabled;
31
31
  let hasChildren = children != null;
32
32
  let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;
33
- if (!hasChildren && !hasAriaLabel) console.warn("If you do not provide children, you must specify an aria-label for accessibility");
33
+ if (!hasChildren && !hasAriaLabel) console.warn('If you do not provide children, you must specify an aria-label for accessibility');
34
34
  let checked = state.selectedValue === value;
35
35
  let onChange = (e)=>{
36
36
  e.stopPropagation();
@@ -69,19 +69,19 @@ function $e184702b1b7f1863$export$37b0961d2f4751e2(props, state, ref) {
69
69
  }),
70
70
  inputProps: (0, $gWC9A$reactariautils.mergeProps)(domProps, {
71
71
  ...interactions,
72
- type: "radio",
72
+ type: 'radio',
73
73
  name: name,
74
74
  tabIndex: tabIndex,
75
75
  disabled: isDisabled,
76
- required: state.isRequired && validationBehavior === "native",
76
+ required: state.isRequired && validationBehavior === 'native',
77
77
  checked: checked,
78
78
  value: value,
79
79
  onChange: onChange,
80
- "aria-describedby": [
81
- props["aria-describedby"],
80
+ 'aria-describedby': [
81
+ props['aria-describedby'],
82
82
  state.isInvalid ? errorMessageId : null,
83
83
  descriptionId
84
- ].filter(Boolean).join(" ") || undefined
84
+ ].filter(Boolean).join(' ') || undefined
85
85
  }),
86
86
  isDisabled: isDisabled,
87
87
  isSelected: checked,
package/dist/useRadio.mjs CHANGED
@@ -20,11 +20,11 @@ import {usePress as $5jJ3f$usePress} from "@react-aria/interactions";
20
20
 
21
21
 
22
22
  function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
23
- let { value: value, children: children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby } = props;
23
+ let { value: value, children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby } = props;
24
24
  const isDisabled = props.isDisabled || state.isDisabled;
25
25
  let hasChildren = children != null;
26
26
  let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;
27
- if (!hasChildren && !hasAriaLabel) console.warn("If you do not provide children, you must specify an aria-label for accessibility");
27
+ if (!hasChildren && !hasAriaLabel) console.warn('If you do not provide children, you must specify an aria-label for accessibility');
28
28
  let checked = state.selectedValue === value;
29
29
  let onChange = (e)=>{
30
30
  e.stopPropagation();
@@ -63,19 +63,19 @@ function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
63
63
  }),
64
64
  inputProps: (0, $5jJ3f$mergeProps)(domProps, {
65
65
  ...interactions,
66
- type: "radio",
66
+ type: 'radio',
67
67
  name: name,
68
68
  tabIndex: tabIndex,
69
69
  disabled: isDisabled,
70
- required: state.isRequired && validationBehavior === "native",
70
+ required: state.isRequired && validationBehavior === 'native',
71
71
  checked: checked,
72
72
  value: value,
73
73
  onChange: onChange,
74
- "aria-describedby": [
75
- props["aria-describedby"],
74
+ 'aria-describedby': [
75
+ props['aria-describedby'],
76
76
  state.isInvalid ? errorMessageId : null,
77
77
  descriptionId
78
- ].filter(Boolean).join(" ") || undefined
78
+ ].filter(Boolean).join(' ') || undefined
79
79
  }),
80
80
  isDisabled: isDisabled,
81
81
  isSelected: checked,
@@ -85,4 +85,4 @@ function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
85
85
 
86
86
 
87
87
  export {$0d5c49892c1215da$export$37b0961d2f4751e2 as useRadio};
88
- //# sourceMappingURL=useRadio.mjs.map
88
+ //# sourceMappingURL=useRadio.module.js.map
@@ -20,11 +20,11 @@ import {usePress as $5jJ3f$usePress} from "@react-aria/interactions";
20
20
 
21
21
 
22
22
  function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
23
- let { value: value, children: children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby } = props;
23
+ let { value: value, children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby } = props;
24
24
  const isDisabled = props.isDisabled || state.isDisabled;
25
25
  let hasChildren = children != null;
26
26
  let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;
27
- if (!hasChildren && !hasAriaLabel) console.warn("If you do not provide children, you must specify an aria-label for accessibility");
27
+ if (!hasChildren && !hasAriaLabel) console.warn('If you do not provide children, you must specify an aria-label for accessibility');
28
28
  let checked = state.selectedValue === value;
29
29
  let onChange = (e)=>{
30
30
  e.stopPropagation();
@@ -63,19 +63,19 @@ function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
63
63
  }),
64
64
  inputProps: (0, $5jJ3f$mergeProps)(domProps, {
65
65
  ...interactions,
66
- type: "radio",
66
+ type: 'radio',
67
67
  name: name,
68
68
  tabIndex: tabIndex,
69
69
  disabled: isDisabled,
70
- required: state.isRequired && validationBehavior === "native",
70
+ required: state.isRequired && validationBehavior === 'native',
71
71
  checked: checked,
72
72
  value: value,
73
73
  onChange: onChange,
74
- "aria-describedby": [
75
- props["aria-describedby"],
74
+ 'aria-describedby': [
75
+ props['aria-describedby'],
76
76
  state.isInvalid ? errorMessageId : null,
77
77
  descriptionId
78
- ].filter(Boolean).join(" ") || undefined
78
+ ].filter(Boolean).join(' ') || undefined
79
79
  }),
80
80
  isDisabled: isDisabled,
81
81
  isSelected: checked,
@@ -28,14 +28,14 @@ $parcel$export(module.exports, "useRadioGroup", () => $dfcade00a56a6317$export$6
28
28
 
29
29
 
30
30
  function $dfcade00a56a6317$export$62b9571f283ff5c2(props, state) {
31
- let { name: name, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = "vertical", validationBehavior: validationBehavior = "aria" } = props;
31
+ let { name: name, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = 'vertical', validationBehavior: validationBehavior = 'aria' } = props;
32
32
  let { direction: direction } = (0, $bNSfM$reactariai18n.useLocale)();
33
33
  let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
34
34
  let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $bNSfM$reactarialabel.useField)({
35
35
  ...props,
36
36
  // Radio group is not an HTML input element so it
37
37
  // shouldn't be labeled by a <label> element.
38
- labelElementType: "span",
38
+ labelElementType: 'span',
39
39
  isInvalid: state.isInvalid,
40
40
  errorMessage: props.errorMessage || validationErrors
41
41
  });
@@ -57,19 +57,19 @@ function $dfcade00a56a6317$export$62b9571f283ff5c2(props, state) {
57
57
  let onKeyDown = (e)=>{
58
58
  let nextDir;
59
59
  switch(e.key){
60
- case "ArrowRight":
61
- if (direction === "rtl" && orientation !== "vertical") nextDir = "prev";
62
- else nextDir = "next";
60
+ case 'ArrowRight':
61
+ if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'prev';
62
+ else nextDir = 'next';
63
63
  break;
64
- case "ArrowLeft":
65
- if (direction === "rtl" && orientation !== "vertical") nextDir = "next";
66
- else nextDir = "prev";
64
+ case 'ArrowLeft':
65
+ if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'next';
66
+ else nextDir = 'prev';
67
67
  break;
68
- case "ArrowDown":
69
- nextDir = "next";
68
+ case 'ArrowDown':
69
+ nextDir = 'next';
70
70
  break;
71
- case "ArrowUp":
72
- nextDir = "prev";
71
+ case 'ArrowUp':
72
+ nextDir = 'prev';
73
73
  break;
74
74
  default:
75
75
  return;
@@ -79,7 +79,7 @@ function $dfcade00a56a6317$export$62b9571f283ff5c2(props, state) {
79
79
  from: e.target
80
80
  });
81
81
  let nextElem;
82
- if (nextDir === "next") {
82
+ if (nextDir === 'next') {
83
83
  nextElem = walker.nextNode();
84
84
  if (!nextElem) {
85
85
  walker.currentNode = e.currentTarget;
@@ -108,14 +108,14 @@ function $dfcade00a56a6317$export$62b9571f283ff5c2(props, state) {
108
108
  return {
109
109
  radioGroupProps: (0, $bNSfM$reactariautils.mergeProps)(domProps, {
110
110
  // https://www.w3.org/TR/wai-aria-1.2/#radiogroup
111
- role: "radiogroup",
111
+ role: 'radiogroup',
112
112
  onKeyDown: onKeyDown,
113
- "aria-invalid": state.isInvalid || undefined,
114
- "aria-errormessage": props["aria-errormessage"],
115
- "aria-readonly": isReadOnly || undefined,
116
- "aria-required": isRequired || undefined,
117
- "aria-disabled": isDisabled || undefined,
118
- "aria-orientation": orientation,
113
+ 'aria-invalid': state.isInvalid || undefined,
114
+ 'aria-errormessage': props['aria-errormessage'],
115
+ 'aria-readonly': isReadOnly || undefined,
116
+ 'aria-required': isRequired || undefined,
117
+ 'aria-disabled': isDisabled || undefined,
118
+ 'aria-orientation': orientation,
119
119
  ...fieldProps,
120
120
  ...focusWithinProps
121
121
  }),
@@ -22,14 +22,14 @@ import {useLocale as $czmJy$useLocale} from "@react-aria/i18n";
22
22
 
23
23
 
24
24
  function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
25
- let { name: name, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = "vertical", validationBehavior: validationBehavior = "aria" } = props;
25
+ let { name: name, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = 'vertical', validationBehavior: validationBehavior = 'aria' } = props;
26
26
  let { direction: direction } = (0, $czmJy$useLocale)();
27
27
  let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
28
28
  let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $czmJy$useField)({
29
29
  ...props,
30
30
  // Radio group is not an HTML input element so it
31
31
  // shouldn't be labeled by a <label> element.
32
- labelElementType: "span",
32
+ labelElementType: 'span',
33
33
  isInvalid: state.isInvalid,
34
34
  errorMessage: props.errorMessage || validationErrors
35
35
  });
@@ -51,19 +51,19 @@ function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
51
51
  let onKeyDown = (e)=>{
52
52
  let nextDir;
53
53
  switch(e.key){
54
- case "ArrowRight":
55
- if (direction === "rtl" && orientation !== "vertical") nextDir = "prev";
56
- else nextDir = "next";
54
+ case 'ArrowRight':
55
+ if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'prev';
56
+ else nextDir = 'next';
57
57
  break;
58
- case "ArrowLeft":
59
- if (direction === "rtl" && orientation !== "vertical") nextDir = "next";
60
- else nextDir = "prev";
58
+ case 'ArrowLeft':
59
+ if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'next';
60
+ else nextDir = 'prev';
61
61
  break;
62
- case "ArrowDown":
63
- nextDir = "next";
62
+ case 'ArrowDown':
63
+ nextDir = 'next';
64
64
  break;
65
- case "ArrowUp":
66
- nextDir = "prev";
65
+ case 'ArrowUp':
66
+ nextDir = 'prev';
67
67
  break;
68
68
  default:
69
69
  return;
@@ -73,7 +73,7 @@ function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
73
73
  from: e.target
74
74
  });
75
75
  let nextElem;
76
- if (nextDir === "next") {
76
+ if (nextDir === 'next') {
77
77
  nextElem = walker.nextNode();
78
78
  if (!nextElem) {
79
79
  walker.currentNode = e.currentTarget;
@@ -102,14 +102,14 @@ function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
102
102
  return {
103
103
  radioGroupProps: (0, $czmJy$mergeProps)(domProps, {
104
104
  // https://www.w3.org/TR/wai-aria-1.2/#radiogroup
105
- role: "radiogroup",
105
+ role: 'radiogroup',
106
106
  onKeyDown: onKeyDown,
107
- "aria-invalid": state.isInvalid || undefined,
108
- "aria-errormessage": props["aria-errormessage"],
109
- "aria-readonly": isReadOnly || undefined,
110
- "aria-required": isRequired || undefined,
111
- "aria-disabled": isDisabled || undefined,
112
- "aria-orientation": orientation,
107
+ 'aria-invalid': state.isInvalid || undefined,
108
+ 'aria-errormessage': props['aria-errormessage'],
109
+ 'aria-readonly': isReadOnly || undefined,
110
+ 'aria-required': isRequired || undefined,
111
+ 'aria-disabled': isDisabled || undefined,
112
+ 'aria-orientation': orientation,
113
113
  ...fieldProps,
114
114
  ...focusWithinProps
115
115
  }),
@@ -124,4 +124,4 @@ function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
124
124
 
125
125
 
126
126
  export {$430f30ed08ec25fa$export$62b9571f283ff5c2 as useRadioGroup};
127
- //# sourceMappingURL=useRadioGroup.mjs.map
127
+ //# sourceMappingURL=useRadioGroup.module.js.map
@@ -22,14 +22,14 @@ import {useLocale as $czmJy$useLocale} from "@react-aria/i18n";
22
22
 
23
23
 
24
24
  function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
25
- let { name: name, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = "vertical", validationBehavior: validationBehavior = "aria" } = props;
25
+ let { name: name, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = 'vertical', validationBehavior: validationBehavior = 'aria' } = props;
26
26
  let { direction: direction } = (0, $czmJy$useLocale)();
27
27
  let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
28
28
  let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $czmJy$useField)({
29
29
  ...props,
30
30
  // Radio group is not an HTML input element so it
31
31
  // shouldn't be labeled by a <label> element.
32
- labelElementType: "span",
32
+ labelElementType: 'span',
33
33
  isInvalid: state.isInvalid,
34
34
  errorMessage: props.errorMessage || validationErrors
35
35
  });
@@ -51,19 +51,19 @@ function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
51
51
  let onKeyDown = (e)=>{
52
52
  let nextDir;
53
53
  switch(e.key){
54
- case "ArrowRight":
55
- if (direction === "rtl" && orientation !== "vertical") nextDir = "prev";
56
- else nextDir = "next";
54
+ case 'ArrowRight':
55
+ if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'prev';
56
+ else nextDir = 'next';
57
57
  break;
58
- case "ArrowLeft":
59
- if (direction === "rtl" && orientation !== "vertical") nextDir = "next";
60
- else nextDir = "prev";
58
+ case 'ArrowLeft':
59
+ if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'next';
60
+ else nextDir = 'prev';
61
61
  break;
62
- case "ArrowDown":
63
- nextDir = "next";
62
+ case 'ArrowDown':
63
+ nextDir = 'next';
64
64
  break;
65
- case "ArrowUp":
66
- nextDir = "prev";
65
+ case 'ArrowUp':
66
+ nextDir = 'prev';
67
67
  break;
68
68
  default:
69
69
  return;
@@ -73,7 +73,7 @@ function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
73
73
  from: e.target
74
74
  });
75
75
  let nextElem;
76
- if (nextDir === "next") {
76
+ if (nextDir === 'next') {
77
77
  nextElem = walker.nextNode();
78
78
  if (!nextElem) {
79
79
  walker.currentNode = e.currentTarget;
@@ -102,14 +102,14 @@ function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
102
102
  return {
103
103
  radioGroupProps: (0, $czmJy$mergeProps)(domProps, {
104
104
  // https://www.w3.org/TR/wai-aria-1.2/#radiogroup
105
- role: "radiogroup",
105
+ role: 'radiogroup',
106
106
  onKeyDown: onKeyDown,
107
- "aria-invalid": state.isInvalid || undefined,
108
- "aria-errormessage": props["aria-errormessage"],
109
- "aria-readonly": isReadOnly || undefined,
110
- "aria-required": isRequired || undefined,
111
- "aria-disabled": isDisabled || undefined,
112
- "aria-orientation": orientation,
107
+ 'aria-invalid': state.isInvalid || undefined,
108
+ 'aria-errormessage': props['aria-errormessage'],
109
+ 'aria-readonly': isReadOnly || undefined,
110
+ 'aria-required': isRequired || undefined,
111
+ 'aria-disabled': isDisabled || undefined,
112
+ 'aria-orientation': orientation,
113
113
  ...fieldProps,
114
114
  ...focusWithinProps
115
115
  }),
package/dist/utils.mjs CHANGED
@@ -12,4 +12,4 @@
12
12
 
13
13
 
14
14
  export {$884aeceb3d67f00f$export$37b65e5b5444d35c as radioGroupData};
15
- //# sourceMappingURL=utils.mjs.map
15
+ //# sourceMappingURL=utils.module.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/radio",
3
- "version": "3.10.3",
3
+ "version": "3.10.4",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,15 +22,15 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-aria/focus": "^3.17.0",
26
- "@react-aria/form": "^3.0.4",
27
- "@react-aria/i18n": "^3.11.0",
28
- "@react-aria/interactions": "^3.21.2",
29
- "@react-aria/label": "^3.7.7",
30
- "@react-aria/utils": "^3.24.0",
31
- "@react-stately/radio": "^3.10.3",
32
- "@react-types/radio": "^3.8.0",
33
- "@react-types/shared": "^3.23.0",
25
+ "@react-aria/focus": "^3.17.1",
26
+ "@react-aria/form": "^3.0.5",
27
+ "@react-aria/i18n": "^3.11.1",
28
+ "@react-aria/interactions": "^3.21.3",
29
+ "@react-aria/label": "^3.7.8",
30
+ "@react-aria/utils": "^3.24.1",
31
+ "@react-stately/radio": "^3.10.4",
32
+ "@react-types/radio": "^3.8.1",
33
+ "@react-types/shared": "^3.23.1",
34
34
  "@swc/helpers": "^0.5.0"
35
35
  },
36
36
  "peerDependencies": {
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd"
42
+ "gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
43
43
  }