@react-spectrum/radio 3.0.0-nightly.2519 → 3.0.0-nightly.2534
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/import.mjs +72 -35
- package/dist/main.js +70 -33
- package/dist/main.js.map +1 -1
- package/dist/module.js +72 -35
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/RadioGroup.tsx +2 -4
package/dist/import.mjs
CHANGED
@@ -9,12 +9,77 @@ import {useFormProps as $4hD9r$useFormProps} from "@react-spectrum/form";
|
|
9
9
|
import {useProviderProps as $4hD9r$useProviderProps} from "@react-spectrum/provider";
|
10
10
|
import {useRadioGroupState as $4hD9r$useRadioGroupState} from "@react-stately/radio";
|
11
11
|
|
12
|
+
|
13
|
+
function $parcel$export(e, n, v, s) {
|
14
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
15
|
+
}
|
16
|
+
|
12
17
|
function $parcel$interopDefault(a) {
|
13
18
|
return a && a.__esModule ? a.default : a;
|
14
19
|
}
|
15
|
-
|
16
|
-
|
20
|
+
|
21
|
+
var $parcel$global = globalThis;
|
22
|
+
|
23
|
+
var $parcel$modules = {};
|
24
|
+
var $parcel$inits = {};
|
25
|
+
|
26
|
+
var parcelRequire = $parcel$global["parcelRequire7f0c"];
|
27
|
+
|
28
|
+
if (parcelRequire == null) {
|
29
|
+
parcelRequire = function(id) {
|
30
|
+
if (id in $parcel$modules) {
|
31
|
+
return $parcel$modules[id].exports;
|
32
|
+
}
|
33
|
+
if (id in $parcel$inits) {
|
34
|
+
var init = $parcel$inits[id];
|
35
|
+
delete $parcel$inits[id];
|
36
|
+
var module = {id: id, exports: {}};
|
37
|
+
$parcel$modules[id] = module;
|
38
|
+
init.call(module.exports, module, module.exports);
|
39
|
+
return module.exports;
|
40
|
+
}
|
41
|
+
var err = new Error("Cannot find module '" + id + "'");
|
42
|
+
err.code = 'MODULE_NOT_FOUND';
|
43
|
+
throw err;
|
44
|
+
};
|
45
|
+
|
46
|
+
parcelRequire.register = function register(id, init) {
|
47
|
+
$parcel$inits[id] = init;
|
48
|
+
};
|
49
|
+
|
50
|
+
$parcel$global["parcelRequire7f0c"] = parcelRequire;
|
17
51
|
}
|
52
|
+
|
53
|
+
var parcelRegister = parcelRequire.register;
|
54
|
+
parcelRegister("6Agev", function(module, exports) {
|
55
|
+
|
56
|
+
$parcel$export(module.exports, "focus-ring", () => $4cb2b26710154c56$export$f39a09f249340e2a, (v) => $4cb2b26710154c56$export$f39a09f249340e2a = v);
|
57
|
+
$parcel$export(module.exports, "i18nFontFamily", () => $4cb2b26710154c56$export$8c4ee2c50c22c514, (v) => $4cb2b26710154c56$export$8c4ee2c50c22c514 = v);
|
58
|
+
$parcel$export(module.exports, "spectrum-FieldGroup", () => $4cb2b26710154c56$export$75eb16cbfc18279c, (v) => $4cb2b26710154c56$export$75eb16cbfc18279c = v);
|
59
|
+
$parcel$export(module.exports, "spectrum-FieldGroup-group", () => $4cb2b26710154c56$export$984c7bbbfc7ddffc, (v) => $4cb2b26710154c56$export$984c7bbbfc7ddffc = v);
|
60
|
+
$parcel$export(module.exports, "spectrum-FieldGroup-group--horizontal", () => $4cb2b26710154c56$export$1ad8646bcba21c0e, (v) => $4cb2b26710154c56$export$1ad8646bcba21c0e = v);
|
61
|
+
$parcel$export(module.exports, "spectrum-FocusRing-ring", () => $4cb2b26710154c56$export$4109102f950813a6, (v) => $4cb2b26710154c56$export$4109102f950813a6 = v);
|
62
|
+
$parcel$export(module.exports, "spectrum-FocusRing", () => $4cb2b26710154c56$export$24c7f46a6e3605dd, (v) => $4cb2b26710154c56$export$24c7f46a6e3605dd = v);
|
63
|
+
$parcel$export(module.exports, "spectrum-FocusRing--quiet", () => $4cb2b26710154c56$export$2927016961429360, (v) => $4cb2b26710154c56$export$2927016961429360 = v);
|
64
|
+
var $4cb2b26710154c56$export$f39a09f249340e2a;
|
65
|
+
var $4cb2b26710154c56$export$8c4ee2c50c22c514;
|
66
|
+
var $4cb2b26710154c56$export$75eb16cbfc18279c;
|
67
|
+
var $4cb2b26710154c56$export$984c7bbbfc7ddffc;
|
68
|
+
var $4cb2b26710154c56$export$1ad8646bcba21c0e;
|
69
|
+
var $4cb2b26710154c56$export$4109102f950813a6;
|
70
|
+
var $4cb2b26710154c56$export$24c7f46a6e3605dd;
|
71
|
+
var $4cb2b26710154c56$export$2927016961429360;
|
72
|
+
$4cb2b26710154c56$export$f39a09f249340e2a = `hyn22G_focus-ring`;
|
73
|
+
$4cb2b26710154c56$export$8c4ee2c50c22c514 = `hyn22G_i18nFontFamily`;
|
74
|
+
$4cb2b26710154c56$export$75eb16cbfc18279c = `hyn22G_spectrum-FieldGroup`;
|
75
|
+
$4cb2b26710154c56$export$984c7bbbfc7ddffc = `hyn22G_spectrum-FieldGroup-group`;
|
76
|
+
$4cb2b26710154c56$export$1ad8646bcba21c0e = `hyn22G_spectrum-FieldGroup-group--horizontal`;
|
77
|
+
$4cb2b26710154c56$export$4109102f950813a6 = `hyn22G_spectrum-FocusRing-ring`;
|
78
|
+
$4cb2b26710154c56$export$24c7f46a6e3605dd = `hyn22G_spectrum-FocusRing ${$4cb2b26710154c56$export$4109102f950813a6}`;
|
79
|
+
$4cb2b26710154c56$export$2927016961429360 = `hyn22G_spectrum-FocusRing--quiet`;
|
80
|
+
|
81
|
+
});
|
82
|
+
|
18
83
|
/*
|
19
84
|
* Copyright 2020 Adobe. All rights reserved.
|
20
85
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
@@ -161,34 +226,8 @@ function $337c5cb580c4e6ba$var$Radio(props, ref) {
|
|
161
226
|
|
162
227
|
|
163
228
|
|
164
|
-
var $4cb2b26710154c56$exports = {};
|
165
|
-
|
166
|
-
$parcel$export($4cb2b26710154c56$exports, "focus-ring", () => $4cb2b26710154c56$export$f39a09f249340e2a, (v) => $4cb2b26710154c56$export$f39a09f249340e2a = v);
|
167
|
-
$parcel$export($4cb2b26710154c56$exports, "i18nFontFamily", () => $4cb2b26710154c56$export$8c4ee2c50c22c514, (v) => $4cb2b26710154c56$export$8c4ee2c50c22c514 = v);
|
168
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup", () => $4cb2b26710154c56$export$75eb16cbfc18279c, (v) => $4cb2b26710154c56$export$75eb16cbfc18279c = v);
|
169
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup-group", () => $4cb2b26710154c56$export$984c7bbbfc7ddffc, (v) => $4cb2b26710154c56$export$984c7bbbfc7ddffc = v);
|
170
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup-group--horizontal", () => $4cb2b26710154c56$export$1ad8646bcba21c0e, (v) => $4cb2b26710154c56$export$1ad8646bcba21c0e = v);
|
171
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FocusRing-ring", () => $4cb2b26710154c56$export$4109102f950813a6, (v) => $4cb2b26710154c56$export$4109102f950813a6 = v);
|
172
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FocusRing", () => $4cb2b26710154c56$export$24c7f46a6e3605dd, (v) => $4cb2b26710154c56$export$24c7f46a6e3605dd = v);
|
173
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FocusRing--quiet", () => $4cb2b26710154c56$export$2927016961429360, (v) => $4cb2b26710154c56$export$2927016961429360 = v);
|
174
|
-
var $4cb2b26710154c56$export$f39a09f249340e2a;
|
175
|
-
var $4cb2b26710154c56$export$8c4ee2c50c22c514;
|
176
|
-
var $4cb2b26710154c56$export$75eb16cbfc18279c;
|
177
|
-
var $4cb2b26710154c56$export$984c7bbbfc7ddffc;
|
178
|
-
var $4cb2b26710154c56$export$1ad8646bcba21c0e;
|
179
|
-
var $4cb2b26710154c56$export$4109102f950813a6;
|
180
|
-
var $4cb2b26710154c56$export$24c7f46a6e3605dd;
|
181
|
-
var $4cb2b26710154c56$export$2927016961429360;
|
182
|
-
$4cb2b26710154c56$export$f39a09f249340e2a = `hyn22G_focus-ring`;
|
183
|
-
$4cb2b26710154c56$export$8c4ee2c50c22c514 = `hyn22G_i18nFontFamily`;
|
184
|
-
$4cb2b26710154c56$export$75eb16cbfc18279c = `hyn22G_spectrum-FieldGroup`;
|
185
|
-
$4cb2b26710154c56$export$984c7bbbfc7ddffc = `hyn22G_spectrum-FieldGroup-group`;
|
186
|
-
$4cb2b26710154c56$export$1ad8646bcba21c0e = `hyn22G_spectrum-FieldGroup-group--horizontal`;
|
187
|
-
$4cb2b26710154c56$export$4109102f950813a6 = `hyn22G_spectrum-FocusRing-ring`;
|
188
|
-
$4cb2b26710154c56$export$24c7f46a6e3605dd = `hyn22G_spectrum-FocusRing ${$4cb2b26710154c56$export$4109102f950813a6}`;
|
189
|
-
$4cb2b26710154c56$export$2927016961429360 = `hyn22G_spectrum-FocusRing--quiet`;
|
190
|
-
|
191
229
|
|
230
|
+
var $6Agev = parcelRequire("6Agev");
|
192
231
|
|
193
232
|
|
194
233
|
|
@@ -199,18 +238,16 @@ function $ac9b96486fc4badf$var$RadioGroup(props, ref) {
|
|
199
238
|
let { isEmphasized: isEmphasized, children: children, orientation: orientation = "vertical" } = props;
|
200
239
|
let domRef = (0, $4hD9r$useDOMRef)(ref);
|
201
240
|
let state = (0, $4hD9r$useRadioGroupState)(props);
|
202
|
-
let { radioGroupProps: radioGroupProps,
|
241
|
+
let { radioGroupProps: radioGroupProps, ...otherProps } = (0, $4hD9r$useRadioGroup)(props, state);
|
203
242
|
return /*#__PURE__*/ (0, $4hD9r$react).createElement((0, $4hD9r$Field), {
|
204
243
|
...props,
|
244
|
+
...otherProps,
|
205
245
|
ref: domRef,
|
206
|
-
wrapperClassName: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
207
|
-
labelProps: labelProps,
|
208
|
-
descriptionProps: descriptionProps,
|
209
|
-
errorMessageProps: errorMessageProps,
|
246
|
+
wrapperClassName: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($6Agev))), "spectrum-FieldGroup"),
|
210
247
|
elementType: "span"
|
211
248
|
}, /*#__PURE__*/ (0, $4hD9r$react).createElement("div", {
|
212
249
|
...radioGroupProps,
|
213
|
-
className: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
250
|
+
className: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($6Agev))), "spectrum-FieldGroup-group", {
|
214
251
|
"spectrum-FieldGroup-group--horizontal": orientation === "horizontal"
|
215
252
|
})
|
216
253
|
}, /*#__PURE__*/ (0, $4hD9r$react).createElement((0, $f394bff9e10389a0$export$b118023277d4a5c3).Provider, {
|
package/dist/main.js
CHANGED
@@ -9,13 +9,78 @@ var $ltKMc$reactspectrumform = require("@react-spectrum/form");
|
|
9
9
|
var $ltKMc$reactspectrumprovider = require("@react-spectrum/provider");
|
10
10
|
var $ltKMc$reactstatelyradio = require("@react-stately/radio");
|
11
11
|
|
12
|
+
|
12
13
|
function $parcel$export(e, n, v, s) {
|
13
14
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
14
15
|
}
|
16
|
+
|
15
17
|
function $parcel$interopDefault(a) {
|
16
18
|
return a && a.__esModule ? a.default : a;
|
17
19
|
}
|
18
20
|
|
21
|
+
var $parcel$global = globalThis;
|
22
|
+
|
23
|
+
var $parcel$modules = {};
|
24
|
+
var $parcel$inits = {};
|
25
|
+
|
26
|
+
var parcelRequire = $parcel$global["parcelRequire7f0c"];
|
27
|
+
|
28
|
+
if (parcelRequire == null) {
|
29
|
+
parcelRequire = function(id) {
|
30
|
+
if (id in $parcel$modules) {
|
31
|
+
return $parcel$modules[id].exports;
|
32
|
+
}
|
33
|
+
if (id in $parcel$inits) {
|
34
|
+
var init = $parcel$inits[id];
|
35
|
+
delete $parcel$inits[id];
|
36
|
+
var module = {id: id, exports: {}};
|
37
|
+
$parcel$modules[id] = module;
|
38
|
+
init.call(module.exports, module, module.exports);
|
39
|
+
return module.exports;
|
40
|
+
}
|
41
|
+
var err = new Error("Cannot find module '" + id + "'");
|
42
|
+
err.code = 'MODULE_NOT_FOUND';
|
43
|
+
throw err;
|
44
|
+
};
|
45
|
+
|
46
|
+
parcelRequire.register = function register(id, init) {
|
47
|
+
$parcel$inits[id] = init;
|
48
|
+
};
|
49
|
+
|
50
|
+
$parcel$global["parcelRequire7f0c"] = parcelRequire;
|
51
|
+
}
|
52
|
+
|
53
|
+
var parcelRegister = parcelRequire.register;
|
54
|
+
parcelRegister("78bCb", function(module, exports) {
|
55
|
+
|
56
|
+
$parcel$export(module.exports, "focus-ring", () => $53124a3a0fd56fca$export$f39a09f249340e2a, (v) => $53124a3a0fd56fca$export$f39a09f249340e2a = v);
|
57
|
+
$parcel$export(module.exports, "i18nFontFamily", () => $53124a3a0fd56fca$export$8c4ee2c50c22c514, (v) => $53124a3a0fd56fca$export$8c4ee2c50c22c514 = v);
|
58
|
+
$parcel$export(module.exports, "spectrum-FieldGroup", () => $53124a3a0fd56fca$export$75eb16cbfc18279c, (v) => $53124a3a0fd56fca$export$75eb16cbfc18279c = v);
|
59
|
+
$parcel$export(module.exports, "spectrum-FieldGroup-group", () => $53124a3a0fd56fca$export$984c7bbbfc7ddffc, (v) => $53124a3a0fd56fca$export$984c7bbbfc7ddffc = v);
|
60
|
+
$parcel$export(module.exports, "spectrum-FieldGroup-group--horizontal", () => $53124a3a0fd56fca$export$1ad8646bcba21c0e, (v) => $53124a3a0fd56fca$export$1ad8646bcba21c0e = v);
|
61
|
+
$parcel$export(module.exports, "spectrum-FocusRing-ring", () => $53124a3a0fd56fca$export$4109102f950813a6, (v) => $53124a3a0fd56fca$export$4109102f950813a6 = v);
|
62
|
+
$parcel$export(module.exports, "spectrum-FocusRing", () => $53124a3a0fd56fca$export$24c7f46a6e3605dd, (v) => $53124a3a0fd56fca$export$24c7f46a6e3605dd = v);
|
63
|
+
$parcel$export(module.exports, "spectrum-FocusRing--quiet", () => $53124a3a0fd56fca$export$2927016961429360, (v) => $53124a3a0fd56fca$export$2927016961429360 = v);
|
64
|
+
var $53124a3a0fd56fca$export$f39a09f249340e2a;
|
65
|
+
var $53124a3a0fd56fca$export$8c4ee2c50c22c514;
|
66
|
+
var $53124a3a0fd56fca$export$75eb16cbfc18279c;
|
67
|
+
var $53124a3a0fd56fca$export$984c7bbbfc7ddffc;
|
68
|
+
var $53124a3a0fd56fca$export$1ad8646bcba21c0e;
|
69
|
+
var $53124a3a0fd56fca$export$4109102f950813a6;
|
70
|
+
var $53124a3a0fd56fca$export$24c7f46a6e3605dd;
|
71
|
+
var $53124a3a0fd56fca$export$2927016961429360;
|
72
|
+
$53124a3a0fd56fca$export$f39a09f249340e2a = `hyn22G_focus-ring`;
|
73
|
+
$53124a3a0fd56fca$export$8c4ee2c50c22c514 = `hyn22G_i18nFontFamily`;
|
74
|
+
$53124a3a0fd56fca$export$75eb16cbfc18279c = `hyn22G_spectrum-FieldGroup`;
|
75
|
+
$53124a3a0fd56fca$export$984c7bbbfc7ddffc = `hyn22G_spectrum-FieldGroup-group`;
|
76
|
+
$53124a3a0fd56fca$export$1ad8646bcba21c0e = `hyn22G_spectrum-FieldGroup-group--horizontal`;
|
77
|
+
$53124a3a0fd56fca$export$4109102f950813a6 = `hyn22G_spectrum-FocusRing-ring`;
|
78
|
+
$53124a3a0fd56fca$export$24c7f46a6e3605dd = `hyn22G_spectrum-FocusRing ${$53124a3a0fd56fca$export$4109102f950813a6}`;
|
79
|
+
$53124a3a0fd56fca$export$2927016961429360 = `hyn22G_spectrum-FocusRing--quiet`;
|
80
|
+
|
81
|
+
});
|
82
|
+
|
83
|
+
|
19
84
|
$parcel$export(module.exports, "Radio", () => $e8d5518f9c1aca76$export$d7b12c4107be0d61);
|
20
85
|
$parcel$export(module.exports, "RadioGroup", () => $aa5529d97b69d048$export$a98f0dcb43a68a25);
|
21
86
|
/*
|
@@ -164,34 +229,8 @@ function $e8d5518f9c1aca76$var$Radio(props, ref) {
|
|
164
229
|
|
165
230
|
|
166
231
|
|
167
|
-
var $53124a3a0fd56fca$exports = {};
|
168
|
-
|
169
|
-
$parcel$export($53124a3a0fd56fca$exports, "focus-ring", () => $53124a3a0fd56fca$export$f39a09f249340e2a, (v) => $53124a3a0fd56fca$export$f39a09f249340e2a = v);
|
170
|
-
$parcel$export($53124a3a0fd56fca$exports, "i18nFontFamily", () => $53124a3a0fd56fca$export$8c4ee2c50c22c514, (v) => $53124a3a0fd56fca$export$8c4ee2c50c22c514 = v);
|
171
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FieldGroup", () => $53124a3a0fd56fca$export$75eb16cbfc18279c, (v) => $53124a3a0fd56fca$export$75eb16cbfc18279c = v);
|
172
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FieldGroup-group", () => $53124a3a0fd56fca$export$984c7bbbfc7ddffc, (v) => $53124a3a0fd56fca$export$984c7bbbfc7ddffc = v);
|
173
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FieldGroup-group--horizontal", () => $53124a3a0fd56fca$export$1ad8646bcba21c0e, (v) => $53124a3a0fd56fca$export$1ad8646bcba21c0e = v);
|
174
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FocusRing-ring", () => $53124a3a0fd56fca$export$4109102f950813a6, (v) => $53124a3a0fd56fca$export$4109102f950813a6 = v);
|
175
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FocusRing", () => $53124a3a0fd56fca$export$24c7f46a6e3605dd, (v) => $53124a3a0fd56fca$export$24c7f46a6e3605dd = v);
|
176
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FocusRing--quiet", () => $53124a3a0fd56fca$export$2927016961429360, (v) => $53124a3a0fd56fca$export$2927016961429360 = v);
|
177
|
-
var $53124a3a0fd56fca$export$f39a09f249340e2a;
|
178
|
-
var $53124a3a0fd56fca$export$8c4ee2c50c22c514;
|
179
|
-
var $53124a3a0fd56fca$export$75eb16cbfc18279c;
|
180
|
-
var $53124a3a0fd56fca$export$984c7bbbfc7ddffc;
|
181
|
-
var $53124a3a0fd56fca$export$1ad8646bcba21c0e;
|
182
|
-
var $53124a3a0fd56fca$export$4109102f950813a6;
|
183
|
-
var $53124a3a0fd56fca$export$24c7f46a6e3605dd;
|
184
|
-
var $53124a3a0fd56fca$export$2927016961429360;
|
185
|
-
$53124a3a0fd56fca$export$f39a09f249340e2a = `hyn22G_focus-ring`;
|
186
|
-
$53124a3a0fd56fca$export$8c4ee2c50c22c514 = `hyn22G_i18nFontFamily`;
|
187
|
-
$53124a3a0fd56fca$export$75eb16cbfc18279c = `hyn22G_spectrum-FieldGroup`;
|
188
|
-
$53124a3a0fd56fca$export$984c7bbbfc7ddffc = `hyn22G_spectrum-FieldGroup-group`;
|
189
|
-
$53124a3a0fd56fca$export$1ad8646bcba21c0e = `hyn22G_spectrum-FieldGroup-group--horizontal`;
|
190
|
-
$53124a3a0fd56fca$export$4109102f950813a6 = `hyn22G_spectrum-FocusRing-ring`;
|
191
|
-
$53124a3a0fd56fca$export$24c7f46a6e3605dd = `hyn22G_spectrum-FocusRing ${$53124a3a0fd56fca$export$4109102f950813a6}`;
|
192
|
-
$53124a3a0fd56fca$export$2927016961429360 = `hyn22G_spectrum-FocusRing--quiet`;
|
193
|
-
|
194
232
|
|
233
|
+
var $78bCb = parcelRequire("78bCb");
|
195
234
|
|
196
235
|
|
197
236
|
|
@@ -202,18 +241,16 @@ function $aa5529d97b69d048$var$RadioGroup(props, ref) {
|
|
202
241
|
let { isEmphasized: isEmphasized, children: children, orientation: orientation = "vertical" } = props;
|
203
242
|
let domRef = (0, $ltKMc$reactspectrumutils.useDOMRef)(ref);
|
204
243
|
let state = (0, $ltKMc$reactstatelyradio.useRadioGroupState)(props);
|
205
|
-
let { radioGroupProps: radioGroupProps,
|
244
|
+
let { radioGroupProps: radioGroupProps, ...otherProps } = (0, $ltKMc$reactariaradio.useRadioGroup)(props, state);
|
206
245
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($ltKMc$react))).createElement((0, $ltKMc$reactspectrumlabel.Field), {
|
207
246
|
...props,
|
247
|
+
...otherProps,
|
208
248
|
ref: domRef,
|
209
|
-
wrapperClassName: (0, $ltKMc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
210
|
-
labelProps: labelProps,
|
211
|
-
descriptionProps: descriptionProps,
|
212
|
-
errorMessageProps: errorMessageProps,
|
249
|
+
wrapperClassName: (0, $ltKMc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($78bCb))), "spectrum-FieldGroup"),
|
213
250
|
elementType: "span"
|
214
251
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($ltKMc$react))).createElement("div", {
|
215
252
|
...radioGroupProps,
|
216
|
-
className: (0, $ltKMc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
253
|
+
className: (0, $ltKMc$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($78bCb))), "spectrum-FieldGroup-group", {
|
217
254
|
"spectrum-FieldGroup-group--horizontal": orientation === "horizontal"
|
218
255
|
})
|
219
256
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($ltKMc$react))).createElement((0, $f5a8721b9af05d97$export$b118023277d4a5c3).Provider, {
|
package/dist/main.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAZA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8B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BAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,mCAAY,EAAE,OAAO;IAE9F,qBACE,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QACrC,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,aAAY;qBACZ,0DAAC;QACE,GAAG,eAAe;QACnB,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,gEAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,0DAAC,CAAA,GAAA,yCAAW,EAAE;QACZ,OAAO;0BACL;mBACA;QACF;OACC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,WAAW;;","sources":["packages/@react-spectrum/radio/src/index.ts","packages/@react-spectrum/radio/src/Radio.tsx","packages/@adobe/spectrum-css-temp/components/radio/vars.css","packages/@react-spectrum/radio/src/context.ts","packages/@react-spectrum/radio/src/RadioGroup.tsx","packages/@adobe/spectrum-css-temp/components/fieldgroup/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/// <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","/*\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\nfunction 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\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 */\nconst _Radio = forwardRef(Radio);\nexport {_Radio as Radio};\n","/*\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","/*\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 {RadioGroupState} from '@react-stately/radio';\nimport React, {useContext} from 'react';\n\ninterface RadioGroupContext {\n isEmphasized?: boolean,\n name?: string,\n state: RadioGroupState\n}\n\nexport const RadioContext = React.createContext<RadioGroupContext | null>(null);\n\nexport function useRadioProvider(): RadioGroupContext {\n return useContext(RadioContext) || {} as RadioGroupContext;\n}\n","/*\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\nfunction 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, labelProps, descriptionProps, errorMessageProps} = useRadioGroup(props, state);\n\n return (\n <Field\n {...props}\n ref={domRef}\n wrapperClassName={classNames(styles, 'spectrum-FieldGroup')}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\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\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 */\nconst _RadioGroup = React.forwardRef(RadioGroup);\nexport {_RadioGroup as RadioGroup};\n","/*\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"],"names":[],"version":3,"file":"main.js.map"}
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAPA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAwC,CAAC,0BAA0B,CAAC;AACpE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0D,CAAC,4CAA4C,CAAC;AACxG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;;;;;;;ACPhF;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAZA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA0C,CAAC,4BAA4B,CA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,CAAA,GAAA,gEAAK,GAAG;uBAElC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QACnC,0BACC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;OACjC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAS,CAAA,GAAA,uBAAS,EAAE;;;AGvF1B;;;;;;;;;;CAUC;;;;;;;;;;AAcD,SAAS,iCAAW,KAA8B,EAAE,GAAwB;IAC1E,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,6CAAK,GAAG;QACrC,aAAY;qBACZ,0DAAC;QACE,GAAG,eAAe;QACnB,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,6CAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,0DAAC,CAAA,GAAA,yCAAW,EAAE,QAAQ;QACpB,OAAO;0BACL;mBACA;QACF;OACC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;;","sources":["packages/@adobe/spectrum-css-temp/components/fieldgroup/vars.css","packages/@react-spectrum/radio/src/index.ts","packages/@react-spectrum/radio/src/Radio.tsx","packages/@adobe/spectrum-css-temp/components/radio/vars.css","packages/@react-spectrum/radio/src/context.ts","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\n@import './index.css';\n","/*\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","/*\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\nfunction 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\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 */\nconst _Radio = forwardRef(Radio);\nexport {_Radio as Radio};\n","/*\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","/*\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 {RadioGroupState} from '@react-stately/radio';\nimport React, {useContext} from 'react';\n\ninterface RadioGroupContext {\n isEmphasized?: boolean,\n name?: string,\n state: RadioGroupState\n}\n\nexport const RadioContext = React.createContext<RadioGroupContext | null>(null);\n\nexport function useRadioProvider(): RadioGroupContext {\n return useContext(RadioContext) || {} as RadioGroupContext;\n}\n","/*\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\nfunction 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\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 */\nconst _RadioGroup = React.forwardRef(RadioGroup);\nexport {_RadioGroup as RadioGroup};\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
@@ -9,12 +9,77 @@ import {useFormProps as $4hD9r$useFormProps} from "@react-spectrum/form";
|
|
9
9
|
import {useProviderProps as $4hD9r$useProviderProps} from "@react-spectrum/provider";
|
10
10
|
import {useRadioGroupState as $4hD9r$useRadioGroupState} from "@react-stately/radio";
|
11
11
|
|
12
|
+
|
13
|
+
function $parcel$export(e, n, v, s) {
|
14
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
15
|
+
}
|
16
|
+
|
12
17
|
function $parcel$interopDefault(a) {
|
13
18
|
return a && a.__esModule ? a.default : a;
|
14
19
|
}
|
15
|
-
|
16
|
-
|
20
|
+
|
21
|
+
var $parcel$global = globalThis;
|
22
|
+
|
23
|
+
var $parcel$modules = {};
|
24
|
+
var $parcel$inits = {};
|
25
|
+
|
26
|
+
var parcelRequire = $parcel$global["parcelRequire7f0c"];
|
27
|
+
|
28
|
+
if (parcelRequire == null) {
|
29
|
+
parcelRequire = function(id) {
|
30
|
+
if (id in $parcel$modules) {
|
31
|
+
return $parcel$modules[id].exports;
|
32
|
+
}
|
33
|
+
if (id in $parcel$inits) {
|
34
|
+
var init = $parcel$inits[id];
|
35
|
+
delete $parcel$inits[id];
|
36
|
+
var module = {id: id, exports: {}};
|
37
|
+
$parcel$modules[id] = module;
|
38
|
+
init.call(module.exports, module, module.exports);
|
39
|
+
return module.exports;
|
40
|
+
}
|
41
|
+
var err = new Error("Cannot find module '" + id + "'");
|
42
|
+
err.code = 'MODULE_NOT_FOUND';
|
43
|
+
throw err;
|
44
|
+
};
|
45
|
+
|
46
|
+
parcelRequire.register = function register(id, init) {
|
47
|
+
$parcel$inits[id] = init;
|
48
|
+
};
|
49
|
+
|
50
|
+
$parcel$global["parcelRequire7f0c"] = parcelRequire;
|
17
51
|
}
|
52
|
+
|
53
|
+
var parcelRegister = parcelRequire.register;
|
54
|
+
parcelRegister("6Agev", function(module, exports) {
|
55
|
+
|
56
|
+
$parcel$export(module.exports, "focus-ring", () => $4cb2b26710154c56$export$f39a09f249340e2a, (v) => $4cb2b26710154c56$export$f39a09f249340e2a = v);
|
57
|
+
$parcel$export(module.exports, "i18nFontFamily", () => $4cb2b26710154c56$export$8c4ee2c50c22c514, (v) => $4cb2b26710154c56$export$8c4ee2c50c22c514 = v);
|
58
|
+
$parcel$export(module.exports, "spectrum-FieldGroup", () => $4cb2b26710154c56$export$75eb16cbfc18279c, (v) => $4cb2b26710154c56$export$75eb16cbfc18279c = v);
|
59
|
+
$parcel$export(module.exports, "spectrum-FieldGroup-group", () => $4cb2b26710154c56$export$984c7bbbfc7ddffc, (v) => $4cb2b26710154c56$export$984c7bbbfc7ddffc = v);
|
60
|
+
$parcel$export(module.exports, "spectrum-FieldGroup-group--horizontal", () => $4cb2b26710154c56$export$1ad8646bcba21c0e, (v) => $4cb2b26710154c56$export$1ad8646bcba21c0e = v);
|
61
|
+
$parcel$export(module.exports, "spectrum-FocusRing-ring", () => $4cb2b26710154c56$export$4109102f950813a6, (v) => $4cb2b26710154c56$export$4109102f950813a6 = v);
|
62
|
+
$parcel$export(module.exports, "spectrum-FocusRing", () => $4cb2b26710154c56$export$24c7f46a6e3605dd, (v) => $4cb2b26710154c56$export$24c7f46a6e3605dd = v);
|
63
|
+
$parcel$export(module.exports, "spectrum-FocusRing--quiet", () => $4cb2b26710154c56$export$2927016961429360, (v) => $4cb2b26710154c56$export$2927016961429360 = v);
|
64
|
+
var $4cb2b26710154c56$export$f39a09f249340e2a;
|
65
|
+
var $4cb2b26710154c56$export$8c4ee2c50c22c514;
|
66
|
+
var $4cb2b26710154c56$export$75eb16cbfc18279c;
|
67
|
+
var $4cb2b26710154c56$export$984c7bbbfc7ddffc;
|
68
|
+
var $4cb2b26710154c56$export$1ad8646bcba21c0e;
|
69
|
+
var $4cb2b26710154c56$export$4109102f950813a6;
|
70
|
+
var $4cb2b26710154c56$export$24c7f46a6e3605dd;
|
71
|
+
var $4cb2b26710154c56$export$2927016961429360;
|
72
|
+
$4cb2b26710154c56$export$f39a09f249340e2a = `hyn22G_focus-ring`;
|
73
|
+
$4cb2b26710154c56$export$8c4ee2c50c22c514 = `hyn22G_i18nFontFamily`;
|
74
|
+
$4cb2b26710154c56$export$75eb16cbfc18279c = `hyn22G_spectrum-FieldGroup`;
|
75
|
+
$4cb2b26710154c56$export$984c7bbbfc7ddffc = `hyn22G_spectrum-FieldGroup-group`;
|
76
|
+
$4cb2b26710154c56$export$1ad8646bcba21c0e = `hyn22G_spectrum-FieldGroup-group--horizontal`;
|
77
|
+
$4cb2b26710154c56$export$4109102f950813a6 = `hyn22G_spectrum-FocusRing-ring`;
|
78
|
+
$4cb2b26710154c56$export$24c7f46a6e3605dd = `hyn22G_spectrum-FocusRing ${$4cb2b26710154c56$export$4109102f950813a6}`;
|
79
|
+
$4cb2b26710154c56$export$2927016961429360 = `hyn22G_spectrum-FocusRing--quiet`;
|
80
|
+
|
81
|
+
});
|
82
|
+
|
18
83
|
/*
|
19
84
|
* Copyright 2020 Adobe. All rights reserved.
|
20
85
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
@@ -161,34 +226,8 @@ function $337c5cb580c4e6ba$var$Radio(props, ref) {
|
|
161
226
|
|
162
227
|
|
163
228
|
|
164
|
-
var $4cb2b26710154c56$exports = {};
|
165
|
-
|
166
|
-
$parcel$export($4cb2b26710154c56$exports, "focus-ring", () => $4cb2b26710154c56$export$f39a09f249340e2a, (v) => $4cb2b26710154c56$export$f39a09f249340e2a = v);
|
167
|
-
$parcel$export($4cb2b26710154c56$exports, "i18nFontFamily", () => $4cb2b26710154c56$export$8c4ee2c50c22c514, (v) => $4cb2b26710154c56$export$8c4ee2c50c22c514 = v);
|
168
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup", () => $4cb2b26710154c56$export$75eb16cbfc18279c, (v) => $4cb2b26710154c56$export$75eb16cbfc18279c = v);
|
169
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup-group", () => $4cb2b26710154c56$export$984c7bbbfc7ddffc, (v) => $4cb2b26710154c56$export$984c7bbbfc7ddffc = v);
|
170
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup-group--horizontal", () => $4cb2b26710154c56$export$1ad8646bcba21c0e, (v) => $4cb2b26710154c56$export$1ad8646bcba21c0e = v);
|
171
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FocusRing-ring", () => $4cb2b26710154c56$export$4109102f950813a6, (v) => $4cb2b26710154c56$export$4109102f950813a6 = v);
|
172
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FocusRing", () => $4cb2b26710154c56$export$24c7f46a6e3605dd, (v) => $4cb2b26710154c56$export$24c7f46a6e3605dd = v);
|
173
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FocusRing--quiet", () => $4cb2b26710154c56$export$2927016961429360, (v) => $4cb2b26710154c56$export$2927016961429360 = v);
|
174
|
-
var $4cb2b26710154c56$export$f39a09f249340e2a;
|
175
|
-
var $4cb2b26710154c56$export$8c4ee2c50c22c514;
|
176
|
-
var $4cb2b26710154c56$export$75eb16cbfc18279c;
|
177
|
-
var $4cb2b26710154c56$export$984c7bbbfc7ddffc;
|
178
|
-
var $4cb2b26710154c56$export$1ad8646bcba21c0e;
|
179
|
-
var $4cb2b26710154c56$export$4109102f950813a6;
|
180
|
-
var $4cb2b26710154c56$export$24c7f46a6e3605dd;
|
181
|
-
var $4cb2b26710154c56$export$2927016961429360;
|
182
|
-
$4cb2b26710154c56$export$f39a09f249340e2a = `hyn22G_focus-ring`;
|
183
|
-
$4cb2b26710154c56$export$8c4ee2c50c22c514 = `hyn22G_i18nFontFamily`;
|
184
|
-
$4cb2b26710154c56$export$75eb16cbfc18279c = `hyn22G_spectrum-FieldGroup`;
|
185
|
-
$4cb2b26710154c56$export$984c7bbbfc7ddffc = `hyn22G_spectrum-FieldGroup-group`;
|
186
|
-
$4cb2b26710154c56$export$1ad8646bcba21c0e = `hyn22G_spectrum-FieldGroup-group--horizontal`;
|
187
|
-
$4cb2b26710154c56$export$4109102f950813a6 = `hyn22G_spectrum-FocusRing-ring`;
|
188
|
-
$4cb2b26710154c56$export$24c7f46a6e3605dd = `hyn22G_spectrum-FocusRing ${$4cb2b26710154c56$export$4109102f950813a6}`;
|
189
|
-
$4cb2b26710154c56$export$2927016961429360 = `hyn22G_spectrum-FocusRing--quiet`;
|
190
|
-
|
191
229
|
|
230
|
+
var $6Agev = parcelRequire("6Agev");
|
192
231
|
|
193
232
|
|
194
233
|
|
@@ -199,18 +238,16 @@ function $ac9b96486fc4badf$var$RadioGroup(props, ref) {
|
|
199
238
|
let { isEmphasized: isEmphasized, children: children, orientation: orientation = "vertical" } = props;
|
200
239
|
let domRef = (0, $4hD9r$useDOMRef)(ref);
|
201
240
|
let state = (0, $4hD9r$useRadioGroupState)(props);
|
202
|
-
let { radioGroupProps: radioGroupProps,
|
241
|
+
let { radioGroupProps: radioGroupProps, ...otherProps } = (0, $4hD9r$useRadioGroup)(props, state);
|
203
242
|
return /*#__PURE__*/ (0, $4hD9r$react).createElement((0, $4hD9r$Field), {
|
204
243
|
...props,
|
244
|
+
...otherProps,
|
205
245
|
ref: domRef,
|
206
|
-
wrapperClassName: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
207
|
-
labelProps: labelProps,
|
208
|
-
descriptionProps: descriptionProps,
|
209
|
-
errorMessageProps: errorMessageProps,
|
246
|
+
wrapperClassName: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($6Agev))), "spectrum-FieldGroup"),
|
210
247
|
elementType: "span"
|
211
248
|
}, /*#__PURE__*/ (0, $4hD9r$react).createElement("div", {
|
212
249
|
...radioGroupProps,
|
213
|
-
className: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
250
|
+
className: (0, $4hD9r$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($6Agev))), "spectrum-FieldGroup-group", {
|
214
251
|
"spectrum-FieldGroup-group--horizontal": orientation === "horizontal"
|
215
252
|
})
|
216
253
|
}, /*#__PURE__*/ (0, $4hD9r$react).createElement((0, $f394bff9e10389a0$export$b118023277d4a5c3).Provider, {
|
package/dist/module.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAZA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8BAA8B,CAAC;AA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,GAAG,CAAA,GAAA,oBAAY,EAAE,OAAO;IAE9F,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QACrC,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,aAAY;qBACZ,gCAAC;QACE,GAAG,eAAe;QACnB,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,gEAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,gCAAC,CAAA,GAAA,yCAAW,EAAE;QACZ,OAAO;0BACL;mBACA;QACF;OACC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,WAAW;;","sources":["packages/@react-spectrum/radio/src/index.ts","packages/@react-spectrum/radio/src/Radio.tsx","packages/@adobe/spectrum-css-temp/components/radio/vars.css","packages/@react-spectrum/radio/src/context.ts","packages/@react-spectrum/radio/src/RadioGroup.tsx","packages/@adobe/spectrum-css-temp/components/fieldgroup/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/// <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","/*\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\nfunction 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\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 */\nconst _Radio = forwardRef(Radio);\nexport {_Radio as Radio};\n","/*\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","/*\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 {RadioGroupState} from '@react-stately/radio';\nimport React, {useContext} from 'react';\n\ninterface RadioGroupContext {\n isEmphasized?: boolean,\n name?: string,\n state: RadioGroupState\n}\n\nexport const RadioContext = React.createContext<RadioGroupContext | null>(null);\n\nexport function useRadioProvider(): RadioGroupContext {\n return useContext(RadioContext) || {} as RadioGroupContext;\n}\n","/*\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\nfunction 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, labelProps, descriptionProps, errorMessageProps} = useRadioGroup(props, state);\n\n return (\n <Field\n {...props}\n ref={domRef}\n wrapperClassName={classNames(styles, 'spectrum-FieldGroup')}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\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\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 */\nconst _RadioGroup = React.forwardRef(RadioGroup);\nexport {_RadioGroup as RadioGroup};\n","/*\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"],"names":[],"version":3,"file":"module.js.map"}
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAPA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAwC,CAAC,0BAA0B,CAAC;AACpE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0D,CAAC,4CAA4C,CAAC;AACxG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;;;;ACPhF;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAZA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAAyC,CAAC,2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ElC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QACnC,0BACC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;OACjC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAS,CAAA,GAAA,iBAAS,EAAE;;;AGvF1B;;;;;;;;;;CAUC;;;;;;;;;;AAcD,SAAS,iCAAW,KAA8B,EAAE,GAAwB;IAC1E,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,6CAAK,GAAG;QACrC,aAAY;qBACZ,gCAAC;QACE,GAAG,eAAe;QACnB,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,6CAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,gCAAC,CAAA,GAAA,yCAAW,EAAE,QAAQ;QACpB,OAAO;0BACL;mBACA;QACF;OACC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;;","sources":["packages/@adobe/spectrum-css-temp/components/fieldgroup/vars.css","packages/@react-spectrum/radio/src/index.ts","packages/@react-spectrum/radio/src/Radio.tsx","packages/@adobe/spectrum-css-temp/components/radio/vars.css","packages/@react-spectrum/radio/src/context.ts","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\n@import './index.css';\n","/*\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","/*\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\nfunction 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\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 */\nconst _Radio = forwardRef(Radio);\nexport {_Radio as Radio};\n","/*\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","/*\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 {RadioGroupState} from '@react-stately/radio';\nimport React, {useContext} from 'react';\n\ninterface RadioGroupContext {\n isEmphasized?: boolean,\n name?: string,\n state: RadioGroupState\n}\n\nexport const RadioContext = React.createContext<RadioGroupContext | null>(null);\n\nexport function useRadioProvider(): RadioGroupContext {\n return useContext(RadioContext) || {} as RadioGroupContext;\n}\n","/*\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\nfunction 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\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 */\nconst _RadioGroup = React.forwardRef(RadioGroup);\nexport {_RadioGroup as RadioGroup};\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;ACmFA;;;GAGG;AACH,OAAA,MAAM,qKAA0B,CAAC;
|
1
|
+
{"mappings":";;ACmFA;;;GAGG;AACH,OAAA,MAAM,qKAA0B,CAAC;ACpBjC;;;GAGG;AACH,OAAA,MAAM,kJAA0C,CAAC;ACvDjD,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"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/radio",
|
3
|
-
"version": "3.0.0-nightly.
|
3
|
+
"version": "3.0.0-nightly.2534+403ec27bf",
|
4
4
|
"description": "Spectrum UI components in React",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/main.js",
|
@@ -36,19 +36,19 @@
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@react-aria/focus": "3.0.0-nightly.
|
40
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
41
|
-
"@react-aria/radio": "3.0.0-nightly.
|
42
|
-
"@react-spectrum/form": "3.0.0-nightly.
|
43
|
-
"@react-spectrum/label": "3.15.2-nightly.
|
44
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
45
|
-
"@react-stately/radio": "3.0.0-nightly.
|
46
|
-
"@react-types/radio": "3.0.0-nightly.
|
47
|
-
"@react-types/shared": "3.0.0-nightly.
|
39
|
+
"@react-aria/focus": "3.0.0-nightly.2534+403ec27bf",
|
40
|
+
"@react-aria/interactions": "3.0.0-nightly.2534+403ec27bf",
|
41
|
+
"@react-aria/radio": "3.0.0-nightly.2534+403ec27bf",
|
42
|
+
"@react-spectrum/form": "3.0.0-nightly.2534+403ec27bf",
|
43
|
+
"@react-spectrum/label": "3.15.2-nightly.4245+403ec27bf",
|
44
|
+
"@react-spectrum/utils": "3.0.0-nightly.2534+403ec27bf",
|
45
|
+
"@react-stately/radio": "3.0.0-nightly.2534+403ec27bf",
|
46
|
+
"@react-types/radio": "3.0.0-nightly.2534+403ec27bf",
|
47
|
+
"@react-types/shared": "3.0.0-nightly.2534+403ec27bf",
|
48
48
|
"@swc/helpers": "^0.5.0"
|
49
49
|
},
|
50
50
|
"devDependencies": {
|
51
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
51
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.2534+403ec27bf"
|
52
52
|
},
|
53
53
|
"peerDependencies": {
|
54
54
|
"@react-spectrum/provider": "^3.0.0",
|
@@ -57,5 +57,5 @@
|
|
57
57
|
"publishConfig": {
|
58
58
|
"access": "public"
|
59
59
|
},
|
60
|
-
"gitHead": "
|
60
|
+
"gitHead": "403ec27bf8f5af6e19529b78782526f680c171ca"
|
61
61
|
}
|
package/src/RadioGroup.tsx
CHANGED
@@ -33,16 +33,14 @@ function RadioGroup(props: SpectrumRadioGroupProps, ref: DOMRef<HTMLElement>) {
|
|
33
33
|
|
34
34
|
let domRef = useDOMRef(ref);
|
35
35
|
let state = useRadioGroupState(props);
|
36
|
-
let {radioGroupProps,
|
36
|
+
let {radioGroupProps, ...otherProps} = useRadioGroup(props, state);
|
37
37
|
|
38
38
|
return (
|
39
39
|
<Field
|
40
40
|
{...props}
|
41
|
+
{...otherProps}
|
41
42
|
ref={domRef}
|
42
43
|
wrapperClassName={classNames(styles, 'spectrum-FieldGroup')}
|
43
|
-
labelProps={labelProps}
|
44
|
-
descriptionProps={descriptionProps}
|
45
|
-
errorMessageProps={errorMessageProps}
|
46
44
|
elementType="span">
|
47
45
|
<div
|
48
46
|
{...radioGroupProps}
|