@react-spectrum/radio 3.4.2 → 3.5.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.
Files changed (2) hide show
  1. package/dist/import.mjs +206 -0
  2. package/package.json +16 -11
@@ -0,0 +1,206 @@
1
+ import "./main.css";
2
+ import {useStyleProps as $4hD9r$useStyleProps, useFocusableRef as $4hD9r$useFocusableRef, classNames as $4hD9r$classNames, useDOMRef as $4hD9r$useDOMRef} from "@react-spectrum/utils";
3
+ import {FocusRing as $4hD9r$FocusRing} from "@react-aria/focus";
4
+ import $4hD9r$react, {useRef as $4hD9r$useRef, forwardRef as $4hD9r$forwardRef, useContext as $4hD9r$useContext} from "react";
5
+ import {useHover as $4hD9r$useHover} from "@react-aria/interactions";
6
+ import {useRadio as $4hD9r$useRadio, useRadioGroup as $4hD9r$useRadioGroup} from "@react-aria/radio";
7
+ import {Field as $4hD9r$Field} from "@react-spectrum/label";
8
+ import {useFormProps as $4hD9r$useFormProps} from "@react-spectrum/form";
9
+ import {useProviderProps as $4hD9r$useProviderProps} from "@react-spectrum/provider";
10
+ import {useRadioGroupState as $4hD9r$useRadioGroupState} from "@react-stately/radio";
11
+
12
+ function $parcel$interopDefault(a) {
13
+ return a && a.__esModule ? a.default : a;
14
+ }
15
+ function $parcel$export(e, n, v, s) {
16
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
17
+ }
18
+ /*
19
+ * Copyright 2020 Adobe. All rights reserved.
20
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
+ * you may not use this file except in compliance with the License. You may obtain a copy
22
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
+ *
24
+ * Unless required by applicable law or agreed to in writing, software distributed under
25
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
+ * OF ANY KIND, either express or implied. See the License for the specific language
27
+ * governing permissions and limitations under the License.
28
+ */ /// <reference types="css-module-types" />
29
+ /*
30
+ * Copyright 2020 Adobe. All rights reserved.
31
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
32
+ * you may not use this file except in compliance with the License. You may obtain a copy
33
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
34
+ *
35
+ * Unless required by applicable law or agreed to in writing, software distributed under
36
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
37
+ * OF ANY KIND, either express or implied. See the License for the specific language
38
+ * governing permissions and limitations under the License.
39
+ */
40
+
41
+
42
+ var $d1246d70e6c52742$exports = {};
43
+
44
+ $parcel$export($d1246d70e6c52742$exports, "spectrum-Radio", () => $d1246d70e6c52742$export$26ebd4dbfef068c5, (v) => $d1246d70e6c52742$export$26ebd4dbfef068c5 = v);
45
+ $parcel$export($d1246d70e6c52742$exports, "spectrum-Radio-input", () => $d1246d70e6c52742$export$c0ce6f9a6a2de1cc, (v) => $d1246d70e6c52742$export$c0ce6f9a6a2de1cc = v);
46
+ $parcel$export($d1246d70e6c52742$exports, "spectrum-Radio-button", () => $d1246d70e6c52742$export$bf9d5e902c33bf05, (v) => $d1246d70e6c52742$export$bf9d5e902c33bf05 = v);
47
+ $parcel$export($d1246d70e6c52742$exports, "focus-ring", () => $d1246d70e6c52742$export$f39a09f249340e2a, (v) => $d1246d70e6c52742$export$f39a09f249340e2a = v);
48
+ $parcel$export($d1246d70e6c52742$exports, "spectrum-Radio-label", () => $d1246d70e6c52742$export$b0f8395a9667922d, (v) => $d1246d70e6c52742$export$b0f8395a9667922d = v);
49
+ $parcel$export($d1246d70e6c52742$exports, "spectrum-Radio--labelBelow", () => $d1246d70e6c52742$export$9443e7082698950d, (v) => $d1246d70e6c52742$export$9443e7082698950d = v);
50
+ $parcel$export($d1246d70e6c52742$exports, "is-hovered", () => $d1246d70e6c52742$export$b8813cd5d7824ce7, (v) => $d1246d70e6c52742$export$b8813cd5d7824ce7 = v);
51
+ $parcel$export($d1246d70e6c52742$exports, "spectrum-Radio--quiet", () => $d1246d70e6c52742$export$6db66b55a897f36d, (v) => $d1246d70e6c52742$export$6db66b55a897f36d = v);
52
+ $parcel$export($d1246d70e6c52742$exports, "is-invalid", () => $d1246d70e6c52742$export$14a30de2866685fa, (v) => $d1246d70e6c52742$export$14a30de2866685fa = v);
53
+ var $d1246d70e6c52742$export$26ebd4dbfef068c5;
54
+ var $d1246d70e6c52742$export$c0ce6f9a6a2de1cc;
55
+ var $d1246d70e6c52742$export$bf9d5e902c33bf05;
56
+ var $d1246d70e6c52742$export$f39a09f249340e2a;
57
+ var $d1246d70e6c52742$export$b0f8395a9667922d;
58
+ var $d1246d70e6c52742$export$9443e7082698950d;
59
+ var $d1246d70e6c52742$export$b8813cd5d7824ce7;
60
+ var $d1246d70e6c52742$export$6db66b55a897f36d;
61
+ var $d1246d70e6c52742$export$14a30de2866685fa;
62
+ $d1246d70e6c52742$export$26ebd4dbfef068c5 = "spectrum-Radio_bf46c2";
63
+ $d1246d70e6c52742$export$c0ce6f9a6a2de1cc = "spectrum-Radio-input_bf46c2";
64
+ $d1246d70e6c52742$export$bf9d5e902c33bf05 = "spectrum-Radio-button_bf46c2";
65
+ $d1246d70e6c52742$export$f39a09f249340e2a = "focus-ring_bf46c2";
66
+ $d1246d70e6c52742$export$b0f8395a9667922d = "spectrum-Radio-label_bf46c2";
67
+ $d1246d70e6c52742$export$9443e7082698950d = "spectrum-Radio--labelBelow_bf46c2";
68
+ $d1246d70e6c52742$export$b8813cd5d7824ce7 = "is-hovered_bf46c2";
69
+ $d1246d70e6c52742$export$6db66b55a897f36d = "spectrum-Radio--quiet_bf46c2";
70
+ $d1246d70e6c52742$export$14a30de2866685fa = "is-invalid_bf46c2";
71
+
72
+
73
+
74
+
75
+ /*
76
+ * Copyright 2020 Adobe. All rights reserved.
77
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
78
+ * you may not use this file except in compliance with the License. You may obtain a copy
79
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
80
+ *
81
+ * Unless required by applicable law or agreed to in writing, software distributed under
82
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
83
+ * OF ANY KIND, either express or implied. See the License for the specific language
84
+ * governing permissions and limitations under the License.
85
+ */
86
+ const $f394bff9e10389a0$export$b118023277d4a5c3 = (0, $4hD9r$react).createContext(null);
87
+ function $f394bff9e10389a0$export$b054eba74077a826() {
88
+ return (0, $4hD9r$useContext)($f394bff9e10389a0$export$b118023277d4a5c3);
89
+ }
90
+
91
+
92
+ function $337c5cb580c4e6ba$var$Radio(props, ref) {
93
+ let { isDisabled: isDisabled , children: children , autoFocus: autoFocus , ...otherProps } = props;
94
+ let { styleProps: styleProps } = (0, $4hD9r$useStyleProps)(otherProps);
95
+ let { hoverProps: hoverProps , isHovered: isHovered } = (0, $4hD9r$useHover)({
96
+ isDisabled: isDisabled
97
+ });
98
+ let inputRef = (0, $4hD9r$useRef)(null);
99
+ let domRef = (0, $4hD9r$useFocusableRef)(ref, inputRef);
100
+ let radioGroupProps = (0, $f394bff9e10389a0$export$b054eba74077a826)();
101
+ let { isEmphasized: isEmphasized , validationState: validationState , state: state } = radioGroupProps;
102
+ let { inputProps: inputProps } = (0, $4hD9r$useRadio)({
103
+ ...props,
104
+ ...radioGroupProps,
105
+ isDisabled: isDisabled
106
+ }, state, inputRef);
107
+ return /*#__PURE__*/ (0, $4hD9r$react).createElement("label", {
108
+ ...styleProps,
109
+ ...hoverProps,
110
+ ref: domRef,
111
+ className: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d1246d70e6c52742$exports))), "spectrum-Radio", {
112
+ // Removing. Pending design feedback.
113
+ // 'spectrum-Radio--labelBelow': labelPosition === 'bottom',
114
+ "spectrum-Radio--quiet": !isEmphasized,
115
+ "is-disabled": isDisabled,
116
+ "is-invalid": validationState === "invalid",
117
+ "is-hovered": isHovered
118
+ }, styleProps.className)
119
+ }, /*#__PURE__*/ (0, $4hD9r$react).createElement((0, $4hD9r$FocusRing), {
120
+ focusRingClass: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d1246d70e6c52742$exports))), "focus-ring"),
121
+ autoFocus: autoFocus
122
+ }, /*#__PURE__*/ (0, $4hD9r$react).createElement("input", {
123
+ ...inputProps,
124
+ ref: inputRef,
125
+ className: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d1246d70e6c52742$exports))), "spectrum-Radio-input")
126
+ })), /*#__PURE__*/ (0, $4hD9r$react).createElement("span", {
127
+ className: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d1246d70e6c52742$exports))), "spectrum-Radio-button")
128
+ }), children && /*#__PURE__*/ (0, $4hD9r$react).createElement("span", {
129
+ className: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d1246d70e6c52742$exports))), "spectrum-Radio-label")
130
+ }, children));
131
+ }
132
+ /**
133
+ * Radio buttons allow users to select a single option from a list of mutually exclusive options.
134
+ * All possible options are exposed up front for users to compare.
135
+ */ const $337c5cb580c4e6ba$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $4hD9r$forwardRef)($337c5cb580c4e6ba$var$Radio);
136
+
137
+
138
+ /*
139
+ * Copyright 2020 Adobe. All rights reserved.
140
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
141
+ * you may not use this file except in compliance with the License. You may obtain a copy
142
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
143
+ *
144
+ * Unless required by applicable law or agreed to in writing, software distributed under
145
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
146
+ * OF ANY KIND, either express or implied. See the License for the specific language
147
+ * governing permissions and limitations under the License.
148
+ */
149
+
150
+
151
+
152
+ var $4cb2b26710154c56$exports = {};
153
+
154
+ $parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup", () => $4cb2b26710154c56$export$75eb16cbfc18279c, (v) => $4cb2b26710154c56$export$75eb16cbfc18279c = v);
155
+ $parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup-group", () => $4cb2b26710154c56$export$984c7bbbfc7ddffc, (v) => $4cb2b26710154c56$export$984c7bbbfc7ddffc = v);
156
+ $parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup-group--horizontal", () => $4cb2b26710154c56$export$1ad8646bcba21c0e, (v) => $4cb2b26710154c56$export$1ad8646bcba21c0e = v);
157
+ var $4cb2b26710154c56$export$75eb16cbfc18279c;
158
+ var $4cb2b26710154c56$export$984c7bbbfc7ddffc;
159
+ var $4cb2b26710154c56$export$1ad8646bcba21c0e;
160
+ $4cb2b26710154c56$export$75eb16cbfc18279c = "spectrum-FieldGroup_41d350";
161
+ $4cb2b26710154c56$export$984c7bbbfc7ddffc = "spectrum-FieldGroup-group_41d350";
162
+ $4cb2b26710154c56$export$1ad8646bcba21c0e = "spectrum-FieldGroup-group--horizontal_41d350";
163
+
164
+
165
+
166
+
167
+
168
+
169
+ function $ac9b96486fc4badf$var$RadioGroup(props, ref) {
170
+ props = (0, $4hD9r$useProviderProps)(props);
171
+ props = (0, $4hD9r$useFormProps)(props);
172
+ let { isEmphasized: isEmphasized , validationState: validationState , children: children , orientation: orientation = "vertical" } = props;
173
+ let domRef = (0, $4hD9r$useDOMRef)(ref);
174
+ let state = (0, $4hD9r$useRadioGroupState)(props);
175
+ let { radioGroupProps: radioGroupProps , labelProps: labelProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $4hD9r$useRadioGroup)(props, state);
176
+ return /*#__PURE__*/ (0, $4hD9r$react).createElement((0, $4hD9r$Field), {
177
+ ...props,
178
+ ref: domRef,
179
+ wrapperClassName: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($4cb2b26710154c56$exports))), "spectrum-FieldGroup"),
180
+ labelProps: labelProps,
181
+ descriptionProps: descriptionProps,
182
+ errorMessageProps: errorMessageProps,
183
+ elementType: "span"
184
+ }, /*#__PURE__*/ (0, $4hD9r$react).createElement("div", {
185
+ ...radioGroupProps,
186
+ className: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($4cb2b26710154c56$exports))), "spectrum-FieldGroup-group", {
187
+ "spectrum-FieldGroup-group--horizontal": orientation === "horizontal"
188
+ })
189
+ }, /*#__PURE__*/ (0, $4hD9r$react).createElement((0, $f394bff9e10389a0$export$b118023277d4a5c3).Provider, {
190
+ value: {
191
+ isEmphasized: isEmphasized,
192
+ validationState: validationState,
193
+ state: state
194
+ }
195
+ }, children)));
196
+ }
197
+ /**
198
+ * Radio groups allow users to select a single option from a list of mutually exclusive options.
199
+ * All possible options are exposed up front for users to compare.
200
+ */ const $ac9b96486fc4badf$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $4hD9r$react).forwardRef($ac9b96486fc4badf$var$RadioGroup);
201
+
202
+
203
+
204
+
205
+ export {$337c5cb580c4e6ba$export$d7b12c4107be0d61 as Radio, $ac9b96486fc4badf$export$a98f0dcb43a68a25 as RadioGroup};
206
+ //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-spectrum/radio",
3
- "version": "3.4.2",
3
+ "version": "3.5.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/import.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -31,15 +36,15 @@
31
36
  "url": "https://github.com/adobe/react-spectrum"
32
37
  },
33
38
  "dependencies": {
34
- "@react-aria/focus": "^3.10.1",
35
- "@react-aria/interactions": "^3.13.1",
36
- "@react-aria/radio": "^3.4.2",
37
- "@react-spectrum/form": "^3.5.2",
38
- "@react-spectrum/label": "^3.10.0",
39
- "@react-spectrum/utils": "^3.8.1",
40
- "@react-stately/radio": "^3.6.2",
41
- "@react-types/radio": "^3.3.1",
42
- "@react-types/shared": "^3.16.0",
39
+ "@react-aria/focus": "^3.11.0",
40
+ "@react-aria/interactions": "^3.14.0",
41
+ "@react-aria/radio": "^3.5.0",
42
+ "@react-spectrum/form": "^3.6.0",
43
+ "@react-spectrum/label": "^3.11.0",
44
+ "@react-spectrum/utils": "^3.9.0",
45
+ "@react-stately/radio": "^3.7.0",
46
+ "@react-types/radio": "^3.4.0",
47
+ "@react-types/shared": "^3.17.0",
43
48
  "@swc/helpers": "^0.4.14"
44
49
  },
45
50
  "devDependencies": {
@@ -52,5 +57,5 @@
52
57
  "publishConfig": {
53
58
  "access": "public"
54
59
  },
55
- "gitHead": "5480d76bd815e239366f92852c76b6831ad2a4fd"
60
+ "gitHead": "a0efee84aa178cb1a202951dfd6d8de02b292307"
56
61
  }