@react-spectrum/radio 3.7.11 → 3.7.13
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/Radio.main.js +3 -7
- package/dist/Radio.main.js.map +1 -1
- package/dist/Radio.mjs +4 -8
- package/dist/Radio.module.js +4 -8
- package/dist/Radio.module.js.map +1 -1
- package/dist/RadioGroup.main.js +2 -6
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +2 -6
- package/dist/RadioGroup.module.js +2 -6
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/{vars.1014f586.css → vars.f6adca10.css} +2 -2
- package/dist/{vars.1014f586.css.map → vars.f6adca10.css.map} +1 -1
- package/package.json +13 -12
- package/src/Radio.tsx +6 -9
- package/src/RadioGroup.tsx +6 -9
package/dist/Radio.main.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require("./vars.
|
1
|
+
require("./vars.f6adca10.css");
|
2
2
|
var $a8fbff4889c18df2$exports = require("./radio_vars_css.main.js");
|
3
3
|
var $f5a8721b9af05d97$exports = require("./context.main.js");
|
4
4
|
var $8lI9m$reactspectrumutils = require("@react-spectrum/utils");
|
@@ -34,7 +34,7 @@ $parcel$export(module.exports, "Radio", () => $e8d5518f9c1aca76$export$d7b12c410
|
|
34
34
|
|
35
35
|
|
36
36
|
|
37
|
-
|
37
|
+
const $e8d5518f9c1aca76$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $8lI9m$react.forwardRef)(function Radio(props, ref) {
|
38
38
|
let { isDisabled: isDisabled, children: children, autoFocus: autoFocus, ...otherProps } = props;
|
39
39
|
let { styleProps: styleProps } = (0, $8lI9m$reactspectrumutils.useStyleProps)(otherProps);
|
40
40
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $8lI9m$reactariainteractions.useHover)({
|
@@ -73,11 +73,7 @@ function $e8d5518f9c1aca76$var$Radio(props, ref) {
|
|
73
73
|
}), children && /*#__PURE__*/ (0, ($parcel$interopDefault($8lI9m$react))).createElement("span", {
|
74
74
|
className: (0, $8lI9m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a8fbff4889c18df2$exports))), 'spectrum-Radio-label')
|
75
75
|
}, children));
|
76
|
-
}
|
77
|
-
/**
|
78
|
-
* Radio buttons allow users to select a single option from a list of mutually exclusive options.
|
79
|
-
* All possible options are exposed up front for users to compare.
|
80
|
-
*/ const $e8d5518f9c1aca76$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $8lI9m$react.forwardRef)($e8d5518f9c1aca76$var$Radio);
|
76
|
+
});
|
81
77
|
|
82
78
|
|
83
79
|
//# sourceMappingURL=Radio.main.js.map
|
package/dist/Radio.main.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgBM,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE,SAAS,MAAM,KAAyB,EAAE,GAAmC;IAC3G,IAAI,cACF,UAAU,YACV,QAAQ,aACR,SAAS,EACT,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;oBAAC;IAAU;IAElD,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAElC,IAAI,kBAAkB,CAAA,GAAA,0CAAe;IACrC,IAAI,gBACF,YAAY,SACZ,KAAK,EACN,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,8BAAO,EAAE;QAC1B,GAAG,KAAK;QACR,GAAG,eAAe;oBAClB;IACF,GAAG,OAAO;IAEV,qBACE,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,kBACA;YACE,qCAAqC;YACrC,4DAA4D;YAC5D,yBAAyB,CAAC;YAC1B,eAAe;YACf,cAAc,MAAM,SAAS;YAC7B,cAAc;QAChB,GACA,WAAW,SAAS;qBAGxB,0DAAC,CAAA,GAAA,+BAAQ;QAAE,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAAe,WAAW;qBACtE,0DAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;uBAElC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACnC,0BACC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OACjC;AAKX","sources":["packages/@react-spectrum/radio/src/Radio.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumRadioProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/radio/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useRadio} from '@react-aria/radio';\nimport {useRadioProvider} from './context';\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nexport const Radio = forwardRef(function Radio(props: SpectrumRadioProps, ref: FocusableRef<HTMLLabelElement>) {\n let {\n isDisabled,\n children,\n autoFocus,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let radioGroupProps = useRadioProvider();\n let {\n isEmphasized,\n state\n } = radioGroupProps;\n\n let {inputProps} = useRadio({\n ...props,\n ...radioGroupProps,\n isDisabled\n }, state, inputRef);\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Radio',\n {\n // Removing. Pending design feedback.\n // 'spectrum-Radio--labelBelow': labelPosition === 'bottom',\n 'spectrum-Radio--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-invalid': state.isInvalid,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-Radio-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Radio-button')} />\n {children && (\n <span className={classNames(styles, 'spectrum-Radio-label')}>\n {children}\n </span>\n )}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Radio.main.js.map"}
|
package/dist/Radio.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import "./vars.
|
1
|
+
import "./vars.f6adca10.css";
|
2
2
|
import $1v8IR$radio_vars_cssmodulejs from "./radio_vars_css.mjs";
|
3
3
|
import {useRadioProvider as $f394bff9e10389a0$export$b054eba74077a826} from "./context.mjs";
|
4
4
|
import {useStyleProps as $1v8IR$useStyleProps, useFocusableRef as $1v8IR$useFocusableRef, classNames as $1v8IR$classNames} from "@react-spectrum/utils";
|
5
5
|
import {FocusRing as $1v8IR$FocusRing} from "@react-aria/focus";
|
6
|
-
import $1v8IR$react, {
|
6
|
+
import $1v8IR$react, {forwardRef as $1v8IR$forwardRef, useRef as $1v8IR$useRef} from "react";
|
7
7
|
import {useHover as $1v8IR$useHover} from "@react-aria/interactions";
|
8
8
|
import {useRadio as $1v8IR$useRadio} from "@react-aria/radio";
|
9
9
|
|
@@ -28,7 +28,7 @@ function $parcel$interopDefault(a) {
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
-
|
31
|
+
const $337c5cb580c4e6ba$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $1v8IR$forwardRef)(function Radio(props, ref) {
|
32
32
|
let { isDisabled: isDisabled, children: children, autoFocus: autoFocus, ...otherProps } = props;
|
33
33
|
let { styleProps: styleProps } = (0, $1v8IR$useStyleProps)(otherProps);
|
34
34
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $1v8IR$useHover)({
|
@@ -67,11 +67,7 @@ function $337c5cb580c4e6ba$var$Radio(props, ref) {
|
|
67
67
|
}), children && /*#__PURE__*/ (0, $1v8IR$react).createElement("span", {
|
68
68
|
className: (0, $1v8IR$classNames)((0, ($parcel$interopDefault($1v8IR$radio_vars_cssmodulejs))), 'spectrum-Radio-label')
|
69
69
|
}, children));
|
70
|
-
}
|
71
|
-
/**
|
72
|
-
* Radio buttons allow users to select a single option from a list of mutually exclusive options.
|
73
|
-
* All possible options are exposed up front for users to compare.
|
74
|
-
*/ const $337c5cb580c4e6ba$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $1v8IR$forwardRef)($337c5cb580c4e6ba$var$Radio);
|
70
|
+
});
|
75
71
|
|
76
72
|
|
77
73
|
export {$337c5cb580c4e6ba$export$d7b12c4107be0d61 as Radio};
|
package/dist/Radio.module.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import "./vars.
|
1
|
+
import "./vars.f6adca10.css";
|
2
2
|
import $1v8IR$radio_vars_cssmodulejs from "./radio_vars_css.module.js";
|
3
3
|
import {useRadioProvider as $f394bff9e10389a0$export$b054eba74077a826} from "./context.module.js";
|
4
4
|
import {useStyleProps as $1v8IR$useStyleProps, useFocusableRef as $1v8IR$useFocusableRef, classNames as $1v8IR$classNames} from "@react-spectrum/utils";
|
5
5
|
import {FocusRing as $1v8IR$FocusRing} from "@react-aria/focus";
|
6
|
-
import $1v8IR$react, {
|
6
|
+
import $1v8IR$react, {forwardRef as $1v8IR$forwardRef, useRef as $1v8IR$useRef} from "react";
|
7
7
|
import {useHover as $1v8IR$useHover} from "@react-aria/interactions";
|
8
8
|
import {useRadio as $1v8IR$useRadio} from "@react-aria/radio";
|
9
9
|
|
@@ -28,7 +28,7 @@ function $parcel$interopDefault(a) {
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
-
|
31
|
+
const $337c5cb580c4e6ba$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $1v8IR$forwardRef)(function Radio(props, ref) {
|
32
32
|
let { isDisabled: isDisabled, children: children, autoFocus: autoFocus, ...otherProps } = props;
|
33
33
|
let { styleProps: styleProps } = (0, $1v8IR$useStyleProps)(otherProps);
|
34
34
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $1v8IR$useHover)({
|
@@ -67,11 +67,7 @@ function $337c5cb580c4e6ba$var$Radio(props, ref) {
|
|
67
67
|
}), children && /*#__PURE__*/ (0, $1v8IR$react).createElement("span", {
|
68
68
|
className: (0, $1v8IR$classNames)((0, ($parcel$interopDefault($1v8IR$radio_vars_cssmodulejs))), 'spectrum-Radio-label')
|
69
69
|
}, children));
|
70
|
-
}
|
71
|
-
/**
|
72
|
-
* Radio buttons allow users to select a single option from a list of mutually exclusive options.
|
73
|
-
* All possible options are exposed up front for users to compare.
|
74
|
-
*/ const $337c5cb580c4e6ba$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $1v8IR$forwardRef)($337c5cb580c4e6ba$var$Radio);
|
70
|
+
});
|
75
71
|
|
76
72
|
|
77
73
|
export {$337c5cb580c4e6ba$export$d7b12c4107be0d61 as Radio};
|
package/dist/Radio.module.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgBM,MAAM,0DAAQ,CAAA,GAAA,iBAAS,EAAE,SAAS,MAAM,KAAyB,EAAE,GAAmC;IAC3G,IAAI,cACF,UAAU,YACV,QAAQ,aACR,SAAS,EACT,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAElD,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE,KAAK;IAElC,IAAI,kBAAkB,CAAA,GAAA,yCAAe;IACrC,IAAI,gBACF,YAAY,SACZ,KAAK,EACN,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QAC1B,GAAG,KAAK;QACR,GAAG,eAAe;oBAClB;IACF,GAAG,OAAO;IAEV,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,uDAAK,GACL,kBACA;YACE,qCAAqC;YACrC,4DAA4D;YAC5D,yBAAyB,CAAC;YAC1B,eAAe;YACf,cAAc,MAAM,SAAS;YAC7B,cAAc;QAChB,GACA,WAAW,SAAS;qBAGxB,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;QAAe,WAAW;qBACtE,gCAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;uBAElC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;QACnC,0BACC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;OACjC;AAKX","sources":["packages/@react-spectrum/radio/src/Radio.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumRadioProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/radio/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useRadio} from '@react-aria/radio';\nimport {useRadioProvider} from './context';\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nexport const Radio = forwardRef(function Radio(props: SpectrumRadioProps, ref: FocusableRef<HTMLLabelElement>) {\n let {\n isDisabled,\n children,\n autoFocus,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let radioGroupProps = useRadioProvider();\n let {\n isEmphasized,\n state\n } = radioGroupProps;\n\n let {inputProps} = useRadio({\n ...props,\n ...radioGroupProps,\n isDisabled\n }, state, inputRef);\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Radio',\n {\n // Removing. Pending design feedback.\n // 'spectrum-Radio--labelBelow': labelPosition === 'bottom',\n 'spectrum-Radio--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-invalid': state.isInvalid,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-Radio-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Radio-button')} />\n {children && (\n <span className={classNames(styles, 'spectrum-Radio-label')}>\n {children}\n </span>\n )}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Radio.module.js.map"}
|
package/dist/RadioGroup.main.js
CHANGED
@@ -38,7 +38,7 @@ $parcel$export(module.exports, "RadioGroup", () => $aa5529d97b69d048$export$a98f
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
-
|
41
|
+
const $aa5529d97b69d048$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, ($parcel$interopDefault($bzUrP$react))).forwardRef(function RadioGroup(props, ref) {
|
42
42
|
props = (0, $bzUrP$reactspectrumprovider.useProviderProps)(props);
|
43
43
|
props = (0, $bzUrP$reactspectrumform.useFormProps)(props);
|
44
44
|
let { isEmphasized: isEmphasized, children: children, orientation: orientation = 'vertical' } = props;
|
@@ -62,11 +62,7 @@ function $aa5529d97b69d048$var$RadioGroup(props, ref) {
|
|
62
62
|
state: state
|
63
63
|
}
|
64
64
|
}, children)));
|
65
|
-
}
|
66
|
-
/**
|
67
|
-
* Radio groups allow users to select a single option from a list of mutually exclusive options.
|
68
|
-
* All possible options are exposed up front for users to compare.
|
69
|
-
*/ const $aa5529d97b69d048$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, ($parcel$interopDefault($bzUrP$react))).forwardRef($aa5529d97b69d048$var$RadioGroup);
|
65
|
+
});
|
70
66
|
|
71
67
|
|
72
68
|
//# sourceMappingURL=RadioGroup.main.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAkBM,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,WAAW,KAA8B,EAAE,GAAwB;IACrH,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,gBACF,YAAY,YACZ,QAAQ,eACR,cAAc,YACf,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,QAAQ,CAAA,GAAA,2CAAiB,EAAE;IAC/B,IAAI,mBAAC,eAAe,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,mCAAY,EAAE,OAAO;IAE5D,qBACE,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,KAAK;QACR,GAAG,UAAU;QACd,KAAK;QACL,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACrC,aAAY;qBACZ,0DAAC;QACE,GAAG,eAAe;QACnB,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,0DAAC,CAAA,GAAA,sCAAW,EAAE,QAAQ;QACpB,OAAO;0BACL;mBACA;QACF;OACC;AAKX","sources":["packages/@react-spectrum/radio/src/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useDOMRef} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {RadioContext} from './context';\nimport React from 'react';\nimport {SpectrumRadioGroupProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/fieldgroup/vars.css';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useRadioGroup} from '@react-aria/radio';\nimport {useRadioGroupState} from '@react-stately/radio';\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nexport const RadioGroup = React.forwardRef(function RadioGroup(props: SpectrumRadioGroupProps, ref: DOMRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isEmphasized,\n children,\n orientation = 'vertical'\n } = props;\n\n let domRef = useDOMRef(ref);\n let state = useRadioGroupState(props);\n let {radioGroupProps, ...otherProps} = useRadioGroup(props, state);\n\n return (\n <Field\n {...props}\n {...otherProps}\n ref={domRef}\n wrapperClassName={classNames(styles, 'spectrum-FieldGroup')}\n elementType=\"span\">\n <div\n {...radioGroupProps}\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup-group',\n {\n 'spectrum-FieldGroup-group--horizontal': orientation === 'horizontal'\n }\n )\n }>\n <RadioContext.Provider\n value={{\n isEmphasized,\n state\n }}>\n {children}\n </RadioContext.Provider>\n </div>\n </Field>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.main.js.map"}
|
package/dist/RadioGroup.mjs
CHANGED
@@ -32,7 +32,7 @@ function $parcel$interopDefault(a) {
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
-
|
35
|
+
const $ac9b96486fc4badf$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $ah3ae$react).forwardRef(function RadioGroup(props, ref) {
|
36
36
|
props = (0, $ah3ae$useProviderProps)(props);
|
37
37
|
props = (0, $ah3ae$useFormProps)(props);
|
38
38
|
let { isEmphasized: isEmphasized, children: children, orientation: orientation = 'vertical' } = props;
|
@@ -56,11 +56,7 @@ function $ac9b96486fc4badf$var$RadioGroup(props, ref) {
|
|
56
56
|
state: state
|
57
57
|
}
|
58
58
|
}, children)));
|
59
|
-
}
|
60
|
-
/**
|
61
|
-
* Radio groups allow users to select a single option from a list of mutually exclusive options.
|
62
|
-
* All possible options are exposed up front for users to compare.
|
63
|
-
*/ const $ac9b96486fc4badf$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $ah3ae$react).forwardRef($ac9b96486fc4badf$var$RadioGroup);
|
59
|
+
});
|
64
60
|
|
65
61
|
|
66
62
|
export {$ac9b96486fc4badf$export$a98f0dcb43a68a25 as RadioGroup};
|
@@ -32,7 +32,7 @@ function $parcel$interopDefault(a) {
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
-
|
35
|
+
const $ac9b96486fc4badf$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $ah3ae$react).forwardRef(function RadioGroup(props, ref) {
|
36
36
|
props = (0, $ah3ae$useProviderProps)(props);
|
37
37
|
props = (0, $ah3ae$useFormProps)(props);
|
38
38
|
let { isEmphasized: isEmphasized, children: children, orientation: orientation = 'vertical' } = props;
|
@@ -56,11 +56,7 @@ function $ac9b96486fc4badf$var$RadioGroup(props, ref) {
|
|
56
56
|
state: state
|
57
57
|
}
|
58
58
|
}, children)));
|
59
|
-
}
|
60
|
-
/**
|
61
|
-
* Radio groups allow users to select a single option from a list of mutually exclusive options.
|
62
|
-
* All possible options are exposed up front for users to compare.
|
63
|
-
*/ const $ac9b96486fc4badf$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $ah3ae$react).forwardRef($ac9b96486fc4badf$var$RadioGroup);
|
59
|
+
});
|
64
60
|
|
65
61
|
|
66
62
|
export {$ac9b96486fc4badf$export$a98f0dcb43a68a25 as RadioGroup};
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAkBM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,WAAW,KAA8B,EAAE,GAAwB;IACrH,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,gBACF,YAAY,YACZ,QAAQ,eACR,cAAc,YACf,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,QAAQ,CAAA,GAAA,yBAAiB,EAAE;IAC/B,IAAI,mBAAC,eAAe,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,oBAAY,EAAE,OAAO;IAE5D,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACR,GAAG,UAAU;QACd,KAAK;QACL,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAK,GAAG;QACrC,aAAY;qBACZ,gCAAC;QACE,GAAG,eAAe;QACnB,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,4DAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,gCAAC,CAAA,GAAA,yCAAW,EAAE,QAAQ;QACpB,OAAO;0BACL;mBACA;QACF;OACC;AAKX","sources":["packages/@react-spectrum/radio/src/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useDOMRef} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {RadioContext} from './context';\nimport React from 'react';\nimport {SpectrumRadioGroupProps} from '@react-types/radio';\nimport styles from '@adobe/spectrum-css-temp/components/fieldgroup/vars.css';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useRadioGroup} from '@react-aria/radio';\nimport {useRadioGroupState} from '@react-stately/radio';\n\n/**\n * Radio groups allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nexport const RadioGroup = React.forwardRef(function RadioGroup(props: SpectrumRadioGroupProps, ref: DOMRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isEmphasized,\n children,\n orientation = 'vertical'\n } = props;\n\n let domRef = useDOMRef(ref);\n let state = useRadioGroupState(props);\n let {radioGroupProps, ...otherProps} = useRadioGroup(props, state);\n\n return (\n <Field\n {...props}\n {...otherProps}\n ref={domRef}\n wrapperClassName={classNames(styles, 'spectrum-FieldGroup')}\n elementType=\"span\">\n <div\n {...radioGroupProps}\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup-group',\n {\n 'spectrum-FieldGroup-group--horizontal': orientation === 'horizontal'\n }\n )\n }>\n <RadioContext.Provider\n value={{\n isEmphasized,\n state\n }}>\n {children}\n </RadioContext.Provider>\n </div>\n </Field>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;
|
1
|
+
{"mappings":";;;ACsBA;;;GAGG;AACH,OAAO,MAAM,uIA2DX,CAAC;AC7DH;;;GAGG;AACH,OAAO,MAAM,oHAyCX,CAAC;ACrDH,YAAY,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC","sources":["packages/@react-spectrum/radio/src/packages/@react-spectrum/radio/src/context.ts","packages/@react-spectrum/radio/src/packages/@react-spectrum/radio/src/Radio.tsx","packages/@react-spectrum/radio/src/packages/@react-spectrum/radio/src/RadioGroup.tsx","packages/@react-spectrum/radio/src/packages/@react-spectrum/radio/src/index.ts","packages/@react-spectrum/radio/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Radio} from './Radio';\nexport {RadioGroup} from './RadioGroup';\nexport type {SpectrumRadioProps} from '@react-types/radio';\nexport type {SpectrumRadioGroupProps} from '@react-types/radio';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
@@ -98,8 +98,8 @@
|
|
98
98
|
min-block-size: var(--spectrum-radio-height, var(--spectrum-global-dimension-size-400));
|
99
99
|
vertical-align: top;
|
100
100
|
isolation: isolate;
|
101
|
-
align-items: flex-start;
|
102
101
|
max-inline-size: 100%;
|
102
|
+
align-items: flex-start;
|
103
103
|
margin-inline-end: calc(var(--spectrum-radio-cursor-hit-x, var(--spectrum-global-dimension-size-100)) * 2);
|
104
104
|
display: inline-flex;
|
105
105
|
position: relative;
|
@@ -367,4 +367,4 @@
|
|
367
367
|
color: var(--spectrum-radio-emphasized-circle-border-color-error, var(--spectrum-global-color-red-500));
|
368
368
|
}
|
369
369
|
}
|
370
|
-
/*# sourceMappingURL=vars.
|
370
|
+
/*# sourceMappingURL=vars.f6adca10.css.map */
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA;;;;;;;;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AA8BE;;;;AAKE;;;;AAOE;;;;AAON;;;;;;;;;AAUA;;;;;;;;;;AAWE;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;AAiBF;;;;;;;AAME;;;;;AAMA;;;;AAkBE;;;;AAMJ;;;;AAKE;;;;;AASI;;;;;AAOA;;;;AAKF;;;;AAOE;;;;AAMA;;;;AAKF;;;;AAOE;;;;AASF;;;;AAME;;;;AAOA;;;;AAQA;;;;AAWA;;;;AAIF;;;;AAME;;;;AAIF;;;;AAME;;;;AAIF;;;;AAOE;;;;AAKA;;;;AALA;;;;AAKA;;;;AASF;;;;AAKF;;;;AAcI;;;;AAKA;;;;AALA;;;;AAKA;;;;AAON;EACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BI","sources":["packages/@adobe/spectrum-css-temp/components/radio/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.
|
1
|
+
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA;;;;;;;;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AA8BE;;;;AAKE;;;;AAOE;;;;AAON;;;;;;;;;AAUA;;;;;;;;;;AAWE;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;AAiBF;;;;;;;AAME;;;;;AAMA;;;;AAkBE;;;;AAMJ;;;;AAKE;;;;;AASI;;;;;AAOA;;;;AAKF;;;;AAOE;;;;AAMA;;;;AAKF;;;;AAOE;;;;AASF;;;;AAME;;;;AAOA;;;;AAQA;;;;AAWA;;;;AAIF;;;;AAME;;;;AAIF;;;;AAME;;;;AAIF;;;;AAOE;;;;AAKA;;;;AALA;;;;AAKA;;;;AASF;;;;AAKF;;;;AAcI;;;;AAKA;;;;AALA;;;;AAKA;;;;AAON;EACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BI","sources":["packages/@adobe/spectrum-css-temp/components/radio/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.f6adca10.css.map"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/radio",
|
3
|
-
"version": "3.7.
|
3
|
+
"version": "3.7.13",
|
4
4
|
"description": "Spectrum UI components in React",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/main.js",
|
@@ -36,15 +36,15 @@
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@react-aria/focus": "^3.
|
40
|
-
"@react-aria/interactions": "^3.
|
41
|
-
"@react-aria/radio": "^3.
|
42
|
-
"@react-spectrum/form": "^3.7.
|
43
|
-
"@react-spectrum/label": "^3.16.
|
44
|
-
"@react-spectrum/utils": "^3.12.
|
45
|
-
"@react-stately/radio": "^3.10.
|
46
|
-
"@react-types/radio": "^3.8.
|
47
|
-
"@react-types/shared": "^3.
|
39
|
+
"@react-aria/focus": "^3.20.0",
|
40
|
+
"@react-aria/interactions": "^3.24.0",
|
41
|
+
"@react-aria/radio": "^3.11.0",
|
42
|
+
"@react-spectrum/form": "^3.7.12",
|
43
|
+
"@react-spectrum/label": "^3.16.12",
|
44
|
+
"@react-spectrum/utils": "^3.12.2",
|
45
|
+
"@react-stately/radio": "^3.10.11",
|
46
|
+
"@react-types/radio": "^3.8.7",
|
47
|
+
"@react-types/shared": "^3.28.0",
|
48
48
|
"@swc/helpers": "^0.5.0"
|
49
49
|
},
|
50
50
|
"devDependencies": {
|
@@ -52,10 +52,11 @@
|
|
52
52
|
},
|
53
53
|
"peerDependencies": {
|
54
54
|
"@react-spectrum/provider": "^3.0.0",
|
55
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
55
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
56
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
56
57
|
},
|
57
58
|
"publishConfig": {
|
58
59
|
"access": "public"
|
59
60
|
},
|
60
|
-
"gitHead": "
|
61
|
+
"gitHead": "4d3c72c94eea2d72eb3a0e7d56000c6ef7e39726"
|
61
62
|
}
|
package/src/Radio.tsx
CHANGED
@@ -20,7 +20,11 @@ import {useHover} from '@react-aria/interactions';
|
|
20
20
|
import {useRadio} from '@react-aria/radio';
|
21
21
|
import {useRadioProvider} from './context';
|
22
22
|
|
23
|
-
|
23
|
+
/**
|
24
|
+
* Radio buttons allow users to select a single option from a list of mutually exclusive options.
|
25
|
+
* All possible options are exposed up front for users to compare.
|
26
|
+
*/
|
27
|
+
export const Radio = forwardRef(function Radio(props: SpectrumRadioProps, ref: FocusableRef<HTMLLabelElement>) {
|
24
28
|
let {
|
25
29
|
isDisabled,
|
26
30
|
children,
|
@@ -79,11 +83,4 @@ function Radio(props: SpectrumRadioProps, ref: FocusableRef<HTMLLabelElement>) {
|
|
79
83
|
)}
|
80
84
|
</label>
|
81
85
|
);
|
82
|
-
}
|
83
|
-
|
84
|
-
/**
|
85
|
-
* Radio buttons allow users to select a single option from a list of mutually exclusive options.
|
86
|
-
* All possible options are exposed up front for users to compare.
|
87
|
-
*/
|
88
|
-
const _Radio = forwardRef(Radio);
|
89
|
-
export {_Radio as Radio};
|
86
|
+
});
|
package/src/RadioGroup.tsx
CHANGED
@@ -22,7 +22,11 @@ import {useProviderProps} from '@react-spectrum/provider';
|
|
22
22
|
import {useRadioGroup} from '@react-aria/radio';
|
23
23
|
import {useRadioGroupState} from '@react-stately/radio';
|
24
24
|
|
25
|
-
|
25
|
+
/**
|
26
|
+
* Radio groups allow users to select a single option from a list of mutually exclusive options.
|
27
|
+
* All possible options are exposed up front for users to compare.
|
28
|
+
*/
|
29
|
+
export const RadioGroup = React.forwardRef(function RadioGroup(props: SpectrumRadioGroupProps, ref: DOMRef<HTMLElement>) {
|
26
30
|
props = useProviderProps(props);
|
27
31
|
props = useFormProps(props);
|
28
32
|
let {
|
@@ -63,11 +67,4 @@ function RadioGroup(props: SpectrumRadioGroupProps, ref: DOMRef<HTMLElement>) {
|
|
63
67
|
</div>
|
64
68
|
</Field>
|
65
69
|
);
|
66
|
-
}
|
67
|
-
|
68
|
-
/**
|
69
|
-
* Radio groups allow users to select a single option from a list of mutually exclusive options.
|
70
|
-
* All possible options are exposed up front for users to compare.
|
71
|
-
*/
|
72
|
-
const _RadioGroup = React.forwardRef(RadioGroup);
|
73
|
-
export {_RadioGroup as RadioGroup};
|
70
|
+
});
|