@react-spectrum/checkbox 3.10.7 → 3.11.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.
- package/dist/import.mjs +3 -3
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +3 -3
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +4 -0
- package/package.json +13 -35
- package/src/index.ts +5 -3
- package/dist/Checkbox.main.js +0 -117
- package/dist/Checkbox.main.js.map +0 -1
- package/dist/Checkbox.mjs +0 -112
- package/dist/Checkbox.module.js +0 -112
- package/dist/Checkbox.module.js.map +0 -1
- package/dist/CheckboxGroup.main.js +0 -68
- package/dist/CheckboxGroup.main.js.map +0 -1
- package/dist/CheckboxGroup.mjs +0 -63
- package/dist/CheckboxGroup.module.js +0 -63
- package/dist/CheckboxGroup.module.js.map +0 -1
- package/dist/checkbox.155bd254.css +0 -488
- package/dist/checkbox.155bd254.css.map +0 -1
- package/dist/checkbox.f39d58be.css +0 -94
- package/dist/checkbox.f39d58be.css.map +0 -1
- package/dist/checkbox_vars_css.main.js +0 -59
- package/dist/checkbox_vars_css.main.js.map +0 -1
- package/dist/checkbox_vars_css.mjs +0 -61
- package/dist/checkbox_vars_css.module.js +0 -61
- package/dist/checkbox_vars_css.module.js.map +0 -1
- package/dist/context.main.js +0 -27
- package/dist/context.main.js.map +0 -1
- package/dist/context.mjs +0 -18
- package/dist/context.module.js +0 -18
- package/dist/context.module.js.map +0 -1
- package/dist/fieldgroup_vars_css.main.js +0 -32
- package/dist/fieldgroup_vars_css.main.js.map +0 -1
- package/dist/fieldgroup_vars_css.mjs +0 -34
- package/dist/fieldgroup_vars_css.module.js +0 -34
- package/dist/fieldgroup_vars_css.module.js.map +0 -1
- package/dist/types.d.ts +0 -15
- package/dist/types.d.ts.map +0 -1
- package/src/Checkbox.tsx +0 -122
- package/src/CheckboxGroup.tsx +0 -67
- package/src/context.ts +0 -16
package/dist/import.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {Checkbox as $
|
|
2
|
-
import {CheckboxGroup as $
|
|
1
|
+
import {Checkbox as $9b633ce7eb6ebbee$re_export$Checkbox} from "@adobe/react-spectrum/Checkbox";
|
|
2
|
+
import {CheckboxGroup as $9b633ce7eb6ebbee$re_export$CheckboxGroup} from "@adobe/react-spectrum/CheckboxGroup";
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -16,5 +16,5 @@ import {CheckboxGroup as $73f43ce9d441cc69$export$4aa08d5625cb8ead} from "./Chec
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
export {$
|
|
19
|
+
export {$9b633ce7eb6ebbee$re_export$Checkbox as Checkbox, $9b633ce7eb6ebbee$re_export$CheckboxGroup as CheckboxGroup};
|
|
20
20
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
1
|
+
var $br9Kj$adobereactspectrumCheckbox = require("@adobe/react-spectrum/Checkbox");
|
|
2
|
+
var $br9Kj$adobereactspectrumCheckboxGroup = require("@adobe/react-spectrum/CheckboxGroup");
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
function $parcel$export(e, n, v, s) {
|
|
6
6
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
$parcel$export(module.exports, "Checkbox", ()
|
|
10
|
-
$parcel$export(module.exports, "CheckboxGroup", ()
|
|
9
|
+
$parcel$export(module.exports, "Checkbox", function () { return $br9Kj$adobereactspectrumCheckbox.Checkbox; });
|
|
10
|
+
$parcel$export(module.exports, "CheckboxGroup", function () { return $br9Kj$adobereactspectrumCheckboxGroup.CheckboxGroup; });
|
|
11
11
|
/*
|
|
12
12
|
* Copyright 2020 Adobe. All rights reserved.
|
|
13
13
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/checkbox/src/index.ts"],"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/// <reference types=\"css-module-types\" />\nexport {Checkbox} from '
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/checkbox/src/index.ts"],"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/// <reference types=\"css-module-types\" />\nexport {Checkbox} from '@adobe/react-spectrum/Checkbox';\n\nexport {CheckboxGroup} from '@adobe/react-spectrum/CheckboxGroup';\nexport type {SpectrumCheckboxProps} from '@adobe/react-spectrum/Checkbox';\nexport type {SpectrumCheckboxGroupProps} from '@adobe/react-spectrum/CheckboxGroup';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {Checkbox as $
|
|
2
|
-
import {CheckboxGroup as $
|
|
1
|
+
import {Checkbox as $9b633ce7eb6ebbee$re_export$Checkbox} from "@adobe/react-spectrum/Checkbox";
|
|
2
|
+
import {CheckboxGroup as $9b633ce7eb6ebbee$re_export$CheckboxGroup} from "@adobe/react-spectrum/CheckboxGroup";
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -16,5 +16,5 @@ import {CheckboxGroup as $73f43ce9d441cc69$export$4aa08d5625cb8ead} from "./Chec
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
export {$
|
|
19
|
+
export {$9b633ce7eb6ebbee$re_export$Checkbox as Checkbox, $9b633ce7eb6ebbee$re_export$CheckboxGroup as CheckboxGroup};
|
|
20
20
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/checkbox/src/index.ts"],"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/// <reference types=\"css-module-types\" />\nexport {Checkbox} from '
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/checkbox/src/index.ts"],"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/// <reference types=\"css-module-types\" />\nexport {Checkbox} from '@adobe/react-spectrum/Checkbox';\n\nexport {CheckboxGroup} from '@adobe/react-spectrum/CheckboxGroup';\nexport type {SpectrumCheckboxProps} from '@adobe/react-spectrum/Checkbox';\nexport type {SpectrumCheckboxGroupProps} from '@adobe/react-spectrum/CheckboxGroup';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Checkbox } from '@adobe/react-spectrum/Checkbox';
|
|
2
|
+
export { CheckboxGroup } from '@adobe/react-spectrum/CheckboxGroup';
|
|
3
|
+
export type { SpectrumCheckboxProps } from '@adobe/react-spectrum/Checkbox';
|
|
4
|
+
export type { SpectrumCheckboxGroupProps } from '@adobe/react-spectrum/CheckboxGroup';
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/checkbox",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.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
8
|
"exports": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"./dist/types.d.ts",
|
|
12
|
-
"./
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
9
|
+
".": {
|
|
10
|
+
"source": "./src/index.ts",
|
|
11
|
+
"types": "./dist/types/src/index.d.ts",
|
|
12
|
+
"import": "./dist/import.mjs",
|
|
13
|
+
"require": "./dist/main.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
16
|
},
|
|
17
|
-
"types": "dist/types.d.ts",
|
|
17
|
+
"types": "dist/types/src/index.d.ts",
|
|
18
18
|
"source": "src/index.ts",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
@@ -24,47 +24,25 @@
|
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
26
|
"targets": {
|
|
27
|
-
"
|
|
28
|
-
"includeNodeModules": [
|
|
29
|
-
"@adobe/spectrum-css-temp"
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"module": {
|
|
33
|
-
"includeNodeModules": [
|
|
34
|
-
"@adobe/spectrum-css-temp"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
27
|
+
"types": false
|
|
37
28
|
},
|
|
38
29
|
"repository": {
|
|
39
30
|
"type": "git",
|
|
40
31
|
"url": "https://github.com/adobe/react-spectrum"
|
|
41
32
|
},
|
|
42
33
|
"dependencies": {
|
|
43
|
-
"@react-
|
|
44
|
-
"@
|
|
45
|
-
"@react-aria/interactions": "^3.27.1",
|
|
46
|
-
"@react-spectrum/form": "^3.7.22",
|
|
47
|
-
"@react-spectrum/label": "^3.16.22",
|
|
48
|
-
"@react-spectrum/utils": "^3.12.12",
|
|
49
|
-
"@react-stately/checkbox": "^3.7.5",
|
|
50
|
-
"@react-stately/toggle": "^3.9.5",
|
|
51
|
-
"@react-types/checkbox": "^3.10.4",
|
|
52
|
-
"@react-types/shared": "^3.33.1",
|
|
53
|
-
"@spectrum-icons/ui": "^3.6.23",
|
|
54
|
-
"@swc/helpers": "^0.5.0",
|
|
55
|
-
"react-aria-components": "^1.16.0"
|
|
34
|
+
"@adobe/react-spectrum": "3.47.0",
|
|
35
|
+
"@swc/helpers": "^0.5.0"
|
|
56
36
|
},
|
|
57
37
|
"devDependencies": {
|
|
58
|
-
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
|
|
59
38
|
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
60
39
|
},
|
|
61
40
|
"peerDependencies": {
|
|
62
|
-
"@react-spectrum/provider": "^3.0.0",
|
|
63
41
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
64
42
|
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
65
43
|
},
|
|
66
44
|
"publishConfig": {
|
|
67
45
|
"access": "public"
|
|
68
46
|
},
|
|
69
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
70
48
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
/// <reference types="css-module-types" />
|
|
13
|
-
export {Checkbox} from '
|
|
14
|
-
|
|
15
|
-
export
|
|
13
|
+
export {Checkbox} from '@adobe/react-spectrum/Checkbox';
|
|
14
|
+
|
|
15
|
+
export {CheckboxGroup} from '@adobe/react-spectrum/CheckboxGroup';
|
|
16
|
+
export type {SpectrumCheckboxProps} from '@adobe/react-spectrum/Checkbox';
|
|
17
|
+
export type {SpectrumCheckboxGroupProps} from '@adobe/react-spectrum/CheckboxGroup';
|
package/dist/Checkbox.main.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
var $bdf3bf7fe71fe120$exports = require("./context.main.js");
|
|
2
|
-
require("./checkbox.155bd254.css");
|
|
3
|
-
var $591f3ccba6339bdb$exports = require("./checkbox_vars_css.main.js");
|
|
4
|
-
var $lfSyy$reactariacomponents = require("react-aria-components");
|
|
5
|
-
var $lfSyy$spectrumiconsuiCheckmarkSmall = require("@spectrum-icons/ui/CheckmarkSmall");
|
|
6
|
-
var $lfSyy$reactspectrumutils = require("@react-spectrum/utils");
|
|
7
|
-
var $lfSyy$spectrumiconsuiDashSmall = require("@spectrum-icons/ui/DashSmall");
|
|
8
|
-
var $lfSyy$reactariafocus = require("@react-aria/focus");
|
|
9
|
-
var $lfSyy$react = require("react");
|
|
10
|
-
var $lfSyy$reactariacheckbox = require("@react-aria/checkbox");
|
|
11
|
-
var $lfSyy$reactspectrumform = require("@react-spectrum/form");
|
|
12
|
-
var $lfSyy$reactariainteractions = require("@react-aria/interactions");
|
|
13
|
-
var $lfSyy$reactspectrumprovider = require("@react-spectrum/provider");
|
|
14
|
-
var $lfSyy$reactstatelytoggle = require("@react-stately/toggle");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function $parcel$interopDefault(a) {
|
|
18
|
-
return a && a.__esModule ? a.default : a;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function $parcel$export(e, n, v, s) {
|
|
22
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
$parcel$export(module.exports, "Checkbox", () => $096ccd12d23dd6cc$export$48513f6b9f8ce62d);
|
|
26
|
-
/*
|
|
27
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
28
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
29
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
30
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
31
|
-
*
|
|
32
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
33
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
34
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
35
|
-
* governing permissions and limitations under the License.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const $096ccd12d23dd6cc$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $lfSyy$react.forwardRef)(function Checkbox(props, ref) {
|
|
50
|
-
let originalProps = props;
|
|
51
|
-
let inputRef = (0, $lfSyy$react.useRef)(null);
|
|
52
|
-
let domRef = (0, $lfSyy$reactspectrumutils.useFocusableRef)(ref, inputRef);
|
|
53
|
-
[props, domRef] = (0, $lfSyy$reactariacomponents.useContextProps)(props, domRef, (0, $lfSyy$reactariacomponents.CheckboxContext));
|
|
54
|
-
props = (0, $lfSyy$reactspectrumprovider.useProviderProps)(props);
|
|
55
|
-
props = (0, $lfSyy$reactspectrumform.useFormProps)(props);
|
|
56
|
-
let { isIndeterminate: isIndeterminate = false, isEmphasized: isEmphasized = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
|
|
57
|
-
let { styleProps: styleProps } = (0, $lfSyy$reactspectrumutils.useStyleProps)(otherProps);
|
|
58
|
-
// Swap hooks depending on whether this checkbox is inside a CheckboxGroup.
|
|
59
|
-
// This is a bit unorthodox. Typically, hooks cannot be called in a conditional,
|
|
60
|
-
// but since the checkbox won't move in and out of a group, it should be safe.
|
|
61
|
-
let groupState = (0, $lfSyy$react.useContext)((0, $bdf3bf7fe71fe120$exports.CheckboxGroupContext));
|
|
62
|
-
let { inputProps: inputProps, isInvalid: isInvalid, isDisabled: isDisabled } = groupState ? (0, $lfSyy$reactariacheckbox.useCheckboxGroupItem)({
|
|
63
|
-
...props,
|
|
64
|
-
// Value is optional for standalone checkboxes, but required for CheckboxGroup items;
|
|
65
|
-
// it's passed explicitly here to avoid typescript error (requires ignore).
|
|
66
|
-
// @ts-ignore
|
|
67
|
-
value: props.value,
|
|
68
|
-
// Only pass isRequired and validationState to react-aria if they came from
|
|
69
|
-
// the props for this individual checkbox, and not from the group via context.
|
|
70
|
-
isRequired: originalProps.isRequired,
|
|
71
|
-
validationState: originalProps.validationState,
|
|
72
|
-
isInvalid: originalProps.isInvalid
|
|
73
|
-
}, groupState, inputRef) : (0, $lfSyy$reactariacheckbox.useCheckbox)(props, (0, $lfSyy$reactstatelytoggle.useToggleState)(props), inputRef);
|
|
74
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $lfSyy$reactariainteractions.useHover)({
|
|
75
|
-
isDisabled: isDisabled
|
|
76
|
-
});
|
|
77
|
-
let markIcon = isIndeterminate ? /*#__PURE__*/ (0, ($parcel$interopDefault($lfSyy$react))).createElement((0, ($parcel$interopDefault($lfSyy$spectrumiconsuiDashSmall))), {
|
|
78
|
-
UNSAFE_className: (0, $lfSyy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($591f3ccba6339bdb$exports))), 'spectrum-Checkbox-partialCheckmark')
|
|
79
|
-
}) : /*#__PURE__*/ (0, ($parcel$interopDefault($lfSyy$react))).createElement((0, ($parcel$interopDefault($lfSyy$spectrumiconsuiCheckmarkSmall))), {
|
|
80
|
-
UNSAFE_className: (0, $lfSyy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($591f3ccba6339bdb$exports))), 'spectrum-Checkbox-checkmark')
|
|
81
|
-
});
|
|
82
|
-
if (groupState && process.env.NODE_ENV !== 'production') {
|
|
83
|
-
for (let key of [
|
|
84
|
-
'isSelected',
|
|
85
|
-
'defaultSelected',
|
|
86
|
-
'isEmphasized'
|
|
87
|
-
])if (originalProps[key] != null) console.warn(`${key} is unsupported on individual <Checkbox> elements within a <CheckboxGroup>. Please apply these props to the group instead.`);
|
|
88
|
-
if (props.value == null) console.warn('A <Checkbox> element within a <CheckboxGroup> requires a `value` property.');
|
|
89
|
-
}
|
|
90
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($lfSyy$react))).createElement("label", {
|
|
91
|
-
...styleProps,
|
|
92
|
-
...hoverProps,
|
|
93
|
-
ref: domRef,
|
|
94
|
-
className: (0, $lfSyy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($591f3ccba6339bdb$exports))), 'spectrum-Checkbox', {
|
|
95
|
-
'is-checked': inputProps.checked,
|
|
96
|
-
'is-indeterminate': isIndeterminate,
|
|
97
|
-
'spectrum-Checkbox--quiet': !isEmphasized,
|
|
98
|
-
'is-invalid': isInvalid,
|
|
99
|
-
'is-disabled': isDisabled,
|
|
100
|
-
'is-hovered': isHovered
|
|
101
|
-
}, styleProps.className)
|
|
102
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($lfSyy$react))).createElement((0, $lfSyy$reactariafocus.FocusRing), {
|
|
103
|
-
focusRingClass: (0, $lfSyy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($591f3ccba6339bdb$exports))), 'focus-ring'),
|
|
104
|
-
autoFocus: autoFocus
|
|
105
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($lfSyy$react))).createElement("input", {
|
|
106
|
-
...inputProps,
|
|
107
|
-
ref: inputRef,
|
|
108
|
-
className: (0, $lfSyy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($591f3ccba6339bdb$exports))), 'spectrum-Checkbox-input')
|
|
109
|
-
})), /*#__PURE__*/ (0, ($parcel$interopDefault($lfSyy$react))).createElement("span", {
|
|
110
|
-
className: (0, $lfSyy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($591f3ccba6339bdb$exports))), 'spectrum-Checkbox-box')
|
|
111
|
-
}, markIcon), children && /*#__PURE__*/ (0, ($parcel$interopDefault($lfSyy$react))).createElement("span", {
|
|
112
|
-
className: (0, $lfSyy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($591f3ccba6339bdb$exports))), 'spectrum-Checkbox-label')
|
|
113
|
-
}, children));
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
//# sourceMappingURL=Checkbox.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AAsBM,MAAM,0DAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAAS,KAA4B,EAAE,GAAmC;IACpH,IAAI,gBAAgB;IACpB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAElC,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,0CAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,0CAAc;IAC/D,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,mBACF,kBAAkB,qBAClB,eAAe,kBACf,SAAS,YACT,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,2EAA2E;IAC3E,gFAAgF;IAChF,8EAA8E;IAC9E,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,8CAAmB;IAC/C,IAAI,cAAC,UAAU,aAAE,SAAS,cAAE,UAAU,EAAC,GAAG,aAEtC,CAAA,GAAA,6CAAmB,EAAE;QACrB,GAAG,KAAK;QACR,qFAAqF;QACrF,2EAA2E;QAC3E,aAAa;QACb,OAAO,MAAM,KAAK;QAClB,2EAA2E;QAC3E,8EAA8E;QAC9E,YAAY,cAAc,UAAU;QACpC,iBAAiB,cAAc,eAAe;QAC9C,WAAW,cAAc,SAAS;IACpC,GAAG,YAAY,YAEb,CAAA,GAAA,oCAAU,EAAE,OAAO,CAAA,GAAA,wCAAa,EAAE,QAAQ;IAE9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;oBAAC;IAAU;IAElD,IAAI,WAAW,gCACX,0DAAC,CAAA,GAAA,yDAAQ;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;uBAChD,0DAAC,CAAA,GAAA,8DAAa;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;IAEzD,IAAI,cAAc,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;QACvD,KAAK,IAAI,OAAO;YAAC;YAAc;YAAmB;SAAe,CAC/D,IAAI,aAAa,CAAC,IAAI,IAAI,MACxB,QAAQ,IAAI,CAAC,GAAG,IAAI,0HAA0H,CAAC;QAGnJ,IAAI,MAAM,KAAK,IAAI,MACjB,QAAQ,IAAI,CAAC;IAEjB;IAEA,qBACE,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,qBACA;YACE,cAAc,WAAW,OAAO;YAChC,oBAAoB;YACpB,4BAA4B,CAAC;YAC7B,cAAc;YACd,eAAe;YACf,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;OAA2B,WAC9D,0BACC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OACjC;AAKX","sources":["packages/@react-spectrum/checkbox/src/Checkbox.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 {CheckboxContext, useContextProps} from 'react-aria-components';\nimport {CheckboxGroupContext} from './context';\nimport CheckmarkSmall from '@spectrum-icons/ui/CheckmarkSmall';\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport DashSmall from '@spectrum-icons/ui/DashSmall';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useContext, useRef} from 'react';\nimport {SpectrumCheckboxProps} from '@react-types/checkbox';\nimport styles from '@adobe/spectrum-css-temp/components/checkbox/vars.css';\nimport {useCheckbox, useCheckboxGroupItem} from '@react-aria/checkbox';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useToggleState} from '@react-stately/toggle';\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox(props: SpectrumCheckboxProps, ref: FocusableRef<HTMLLabelElement>) {\n let originalProps = props;\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n [props, domRef] = useContextProps(props, domRef, CheckboxContext);\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isIndeterminate = false,\n isEmphasized = false,\n autoFocus,\n children,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n\n // Swap hooks depending on whether this checkbox is inside a CheckboxGroup.\n // This is a bit unorthodox. Typically, hooks cannot be called in a conditional,\n // but since the checkbox won't move in and out of a group, it should be safe.\n let groupState = useContext(CheckboxGroupContext);\n let {inputProps, isInvalid, isDisabled} = groupState\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useCheckboxGroupItem({\n ...props,\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // Only pass isRequired and validationState to react-aria if they came from\n // the props for this individual checkbox, and not from the group via context.\n isRequired: originalProps.isRequired,\n validationState: originalProps.validationState,\n isInvalid: originalProps.isInvalid\n }, groupState, inputRef)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useCheckbox(props, useToggleState(props), inputRef);\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let markIcon = isIndeterminate\n ? <DashSmall UNSAFE_className={classNames(styles, 'spectrum-Checkbox-partialCheckmark')} />\n : <CheckmarkSmall UNSAFE_className={classNames(styles, 'spectrum-Checkbox-checkmark')} />;\n\n if (groupState && process.env.NODE_ENV !== 'production') {\n for (let key of ['isSelected', 'defaultSelected', 'isEmphasized']) {\n if (originalProps[key] != null) {\n console.warn(`${key} is unsupported on individual <Checkbox> elements within a <CheckboxGroup>. Please apply these props to the group instead.`);\n }\n }\n if (props.value == null) {\n console.warn('A <Checkbox> element within a <CheckboxGroup> requires a `value` property.');\n }\n }\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Checkbox',\n {\n 'is-checked': inputProps.checked,\n 'is-indeterminate': isIndeterminate,\n 'spectrum-Checkbox--quiet': !isEmphasized,\n 'is-invalid': isInvalid,\n 'is-disabled': isDisabled,\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-Checkbox-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Checkbox-box')}>{markIcon}</span>\n {children && (\n <span className={classNames(styles, 'spectrum-Checkbox-label')}>\n {children}\n </span>\n )}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.main.js.map"}
|
package/dist/Checkbox.mjs
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import {CheckboxGroupContext as $8c8ab388b155237e$export$baf37c4be89255b8} from "./context.mjs";
|
|
2
|
-
import "./checkbox.155bd254.css";
|
|
3
|
-
import $cvQES$checkbox_vars_cssmodulejs from "./checkbox_vars_css.mjs";
|
|
4
|
-
import {useContextProps as $cvQES$useContextProps, CheckboxContext as $cvQES$CheckboxContext} from "react-aria-components";
|
|
5
|
-
import $cvQES$spectrumiconsuiCheckmarkSmall from "@spectrum-icons/ui/CheckmarkSmall";
|
|
6
|
-
import {useFocusableRef as $cvQES$useFocusableRef, useStyleProps as $cvQES$useStyleProps, classNames as $cvQES$classNames} from "@react-spectrum/utils";
|
|
7
|
-
import $cvQES$spectrumiconsuiDashSmall from "@spectrum-icons/ui/DashSmall";
|
|
8
|
-
import {FocusRing as $cvQES$FocusRing} from "@react-aria/focus";
|
|
9
|
-
import $cvQES$react, {forwardRef as $cvQES$forwardRef, useRef as $cvQES$useRef, useContext as $cvQES$useContext} from "react";
|
|
10
|
-
import {useCheckboxGroupItem as $cvQES$useCheckboxGroupItem, useCheckbox as $cvQES$useCheckbox} from "@react-aria/checkbox";
|
|
11
|
-
import {useFormProps as $cvQES$useFormProps} from "@react-spectrum/form";
|
|
12
|
-
import {useHover as $cvQES$useHover} from "@react-aria/interactions";
|
|
13
|
-
import {useProviderProps as $cvQES$useProviderProps} from "@react-spectrum/provider";
|
|
14
|
-
import {useToggleState as $cvQES$useToggleState} from "@react-stately/toggle";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function $parcel$interopDefault(a) {
|
|
18
|
-
return a && a.__esModule ? a.default : a;
|
|
19
|
-
}
|
|
20
|
-
/*
|
|
21
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
22
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
23
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
24
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
-
*
|
|
26
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
27
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
28
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
29
|
-
* governing permissions and limitations under the License.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const $25b6292d81af2844$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $cvQES$forwardRef)(function Checkbox(props, ref) {
|
|
44
|
-
let originalProps = props;
|
|
45
|
-
let inputRef = (0, $cvQES$useRef)(null);
|
|
46
|
-
let domRef = (0, $cvQES$useFocusableRef)(ref, inputRef);
|
|
47
|
-
[props, domRef] = (0, $cvQES$useContextProps)(props, domRef, (0, $cvQES$CheckboxContext));
|
|
48
|
-
props = (0, $cvQES$useProviderProps)(props);
|
|
49
|
-
props = (0, $cvQES$useFormProps)(props);
|
|
50
|
-
let { isIndeterminate: isIndeterminate = false, isEmphasized: isEmphasized = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
|
|
51
|
-
let { styleProps: styleProps } = (0, $cvQES$useStyleProps)(otherProps);
|
|
52
|
-
// Swap hooks depending on whether this checkbox is inside a CheckboxGroup.
|
|
53
|
-
// This is a bit unorthodox. Typically, hooks cannot be called in a conditional,
|
|
54
|
-
// but since the checkbox won't move in and out of a group, it should be safe.
|
|
55
|
-
let groupState = (0, $cvQES$useContext)((0, $8c8ab388b155237e$export$baf37c4be89255b8));
|
|
56
|
-
let { inputProps: inputProps, isInvalid: isInvalid, isDisabled: isDisabled } = groupState ? (0, $cvQES$useCheckboxGroupItem)({
|
|
57
|
-
...props,
|
|
58
|
-
// Value is optional for standalone checkboxes, but required for CheckboxGroup items;
|
|
59
|
-
// it's passed explicitly here to avoid typescript error (requires ignore).
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
value: props.value,
|
|
62
|
-
// Only pass isRequired and validationState to react-aria if they came from
|
|
63
|
-
// the props for this individual checkbox, and not from the group via context.
|
|
64
|
-
isRequired: originalProps.isRequired,
|
|
65
|
-
validationState: originalProps.validationState,
|
|
66
|
-
isInvalid: originalProps.isInvalid
|
|
67
|
-
}, groupState, inputRef) : (0, $cvQES$useCheckbox)(props, (0, $cvQES$useToggleState)(props), inputRef);
|
|
68
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $cvQES$useHover)({
|
|
69
|
-
isDisabled: isDisabled
|
|
70
|
-
});
|
|
71
|
-
let markIcon = isIndeterminate ? /*#__PURE__*/ (0, $cvQES$react).createElement((0, $cvQES$spectrumiconsuiDashSmall), {
|
|
72
|
-
UNSAFE_className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-partialCheckmark')
|
|
73
|
-
}) : /*#__PURE__*/ (0, $cvQES$react).createElement((0, $cvQES$spectrumiconsuiCheckmarkSmall), {
|
|
74
|
-
UNSAFE_className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-checkmark')
|
|
75
|
-
});
|
|
76
|
-
if (groupState && process.env.NODE_ENV !== 'production') {
|
|
77
|
-
for (let key of [
|
|
78
|
-
'isSelected',
|
|
79
|
-
'defaultSelected',
|
|
80
|
-
'isEmphasized'
|
|
81
|
-
])if (originalProps[key] != null) console.warn(`${key} is unsupported on individual <Checkbox> elements within a <CheckboxGroup>. Please apply these props to the group instead.`);
|
|
82
|
-
if (props.value == null) console.warn('A <Checkbox> element within a <CheckboxGroup> requires a `value` property.');
|
|
83
|
-
}
|
|
84
|
-
return /*#__PURE__*/ (0, $cvQES$react).createElement("label", {
|
|
85
|
-
...styleProps,
|
|
86
|
-
...hoverProps,
|
|
87
|
-
ref: domRef,
|
|
88
|
-
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox', {
|
|
89
|
-
'is-checked': inputProps.checked,
|
|
90
|
-
'is-indeterminate': isIndeterminate,
|
|
91
|
-
'spectrum-Checkbox--quiet': !isEmphasized,
|
|
92
|
-
'is-invalid': isInvalid,
|
|
93
|
-
'is-disabled': isDisabled,
|
|
94
|
-
'is-hovered': isHovered
|
|
95
|
-
}, styleProps.className)
|
|
96
|
-
}, /*#__PURE__*/ (0, $cvQES$react).createElement((0, $cvQES$FocusRing), {
|
|
97
|
-
focusRingClass: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'focus-ring'),
|
|
98
|
-
autoFocus: autoFocus
|
|
99
|
-
}, /*#__PURE__*/ (0, $cvQES$react).createElement("input", {
|
|
100
|
-
...inputProps,
|
|
101
|
-
ref: inputRef,
|
|
102
|
-
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-input')
|
|
103
|
-
})), /*#__PURE__*/ (0, $cvQES$react).createElement("span", {
|
|
104
|
-
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-box')
|
|
105
|
-
}, markIcon), children && /*#__PURE__*/ (0, $cvQES$react).createElement("span", {
|
|
106
|
-
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-label')
|
|
107
|
-
}, children));
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
export {$25b6292d81af2844$export$48513f6b9f8ce62d as Checkbox};
|
|
112
|
-
//# sourceMappingURL=Checkbox.module.js.map
|
package/dist/Checkbox.module.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import {CheckboxGroupContext as $8c8ab388b155237e$export$baf37c4be89255b8} from "./context.module.js";
|
|
2
|
-
import "./checkbox.155bd254.css";
|
|
3
|
-
import $cvQES$checkbox_vars_cssmodulejs from "./checkbox_vars_css.module.js";
|
|
4
|
-
import {useContextProps as $cvQES$useContextProps, CheckboxContext as $cvQES$CheckboxContext} from "react-aria-components";
|
|
5
|
-
import $cvQES$spectrumiconsuiCheckmarkSmall from "@spectrum-icons/ui/CheckmarkSmall";
|
|
6
|
-
import {useFocusableRef as $cvQES$useFocusableRef, useStyleProps as $cvQES$useStyleProps, classNames as $cvQES$classNames} from "@react-spectrum/utils";
|
|
7
|
-
import $cvQES$spectrumiconsuiDashSmall from "@spectrum-icons/ui/DashSmall";
|
|
8
|
-
import {FocusRing as $cvQES$FocusRing} from "@react-aria/focus";
|
|
9
|
-
import $cvQES$react, {forwardRef as $cvQES$forwardRef, useRef as $cvQES$useRef, useContext as $cvQES$useContext} from "react";
|
|
10
|
-
import {useCheckboxGroupItem as $cvQES$useCheckboxGroupItem, useCheckbox as $cvQES$useCheckbox} from "@react-aria/checkbox";
|
|
11
|
-
import {useFormProps as $cvQES$useFormProps} from "@react-spectrum/form";
|
|
12
|
-
import {useHover as $cvQES$useHover} from "@react-aria/interactions";
|
|
13
|
-
import {useProviderProps as $cvQES$useProviderProps} from "@react-spectrum/provider";
|
|
14
|
-
import {useToggleState as $cvQES$useToggleState} from "@react-stately/toggle";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function $parcel$interopDefault(a) {
|
|
18
|
-
return a && a.__esModule ? a.default : a;
|
|
19
|
-
}
|
|
20
|
-
/*
|
|
21
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
22
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
23
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
24
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
-
*
|
|
26
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
27
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
28
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
29
|
-
* governing permissions and limitations under the License.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const $25b6292d81af2844$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $cvQES$forwardRef)(function Checkbox(props, ref) {
|
|
44
|
-
let originalProps = props;
|
|
45
|
-
let inputRef = (0, $cvQES$useRef)(null);
|
|
46
|
-
let domRef = (0, $cvQES$useFocusableRef)(ref, inputRef);
|
|
47
|
-
[props, domRef] = (0, $cvQES$useContextProps)(props, domRef, (0, $cvQES$CheckboxContext));
|
|
48
|
-
props = (0, $cvQES$useProviderProps)(props);
|
|
49
|
-
props = (0, $cvQES$useFormProps)(props);
|
|
50
|
-
let { isIndeterminate: isIndeterminate = false, isEmphasized: isEmphasized = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
|
|
51
|
-
let { styleProps: styleProps } = (0, $cvQES$useStyleProps)(otherProps);
|
|
52
|
-
// Swap hooks depending on whether this checkbox is inside a CheckboxGroup.
|
|
53
|
-
// This is a bit unorthodox. Typically, hooks cannot be called in a conditional,
|
|
54
|
-
// but since the checkbox won't move in and out of a group, it should be safe.
|
|
55
|
-
let groupState = (0, $cvQES$useContext)((0, $8c8ab388b155237e$export$baf37c4be89255b8));
|
|
56
|
-
let { inputProps: inputProps, isInvalid: isInvalid, isDisabled: isDisabled } = groupState ? (0, $cvQES$useCheckboxGroupItem)({
|
|
57
|
-
...props,
|
|
58
|
-
// Value is optional for standalone checkboxes, but required for CheckboxGroup items;
|
|
59
|
-
// it's passed explicitly here to avoid typescript error (requires ignore).
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
value: props.value,
|
|
62
|
-
// Only pass isRequired and validationState to react-aria if they came from
|
|
63
|
-
// the props for this individual checkbox, and not from the group via context.
|
|
64
|
-
isRequired: originalProps.isRequired,
|
|
65
|
-
validationState: originalProps.validationState,
|
|
66
|
-
isInvalid: originalProps.isInvalid
|
|
67
|
-
}, groupState, inputRef) : (0, $cvQES$useCheckbox)(props, (0, $cvQES$useToggleState)(props), inputRef);
|
|
68
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $cvQES$useHover)({
|
|
69
|
-
isDisabled: isDisabled
|
|
70
|
-
});
|
|
71
|
-
let markIcon = isIndeterminate ? /*#__PURE__*/ (0, $cvQES$react).createElement((0, $cvQES$spectrumiconsuiDashSmall), {
|
|
72
|
-
UNSAFE_className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-partialCheckmark')
|
|
73
|
-
}) : /*#__PURE__*/ (0, $cvQES$react).createElement((0, $cvQES$spectrumiconsuiCheckmarkSmall), {
|
|
74
|
-
UNSAFE_className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-checkmark')
|
|
75
|
-
});
|
|
76
|
-
if (groupState && process.env.NODE_ENV !== 'production') {
|
|
77
|
-
for (let key of [
|
|
78
|
-
'isSelected',
|
|
79
|
-
'defaultSelected',
|
|
80
|
-
'isEmphasized'
|
|
81
|
-
])if (originalProps[key] != null) console.warn(`${key} is unsupported on individual <Checkbox> elements within a <CheckboxGroup>. Please apply these props to the group instead.`);
|
|
82
|
-
if (props.value == null) console.warn('A <Checkbox> element within a <CheckboxGroup> requires a `value` property.');
|
|
83
|
-
}
|
|
84
|
-
return /*#__PURE__*/ (0, $cvQES$react).createElement("label", {
|
|
85
|
-
...styleProps,
|
|
86
|
-
...hoverProps,
|
|
87
|
-
ref: domRef,
|
|
88
|
-
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox', {
|
|
89
|
-
'is-checked': inputProps.checked,
|
|
90
|
-
'is-indeterminate': isIndeterminate,
|
|
91
|
-
'spectrum-Checkbox--quiet': !isEmphasized,
|
|
92
|
-
'is-invalid': isInvalid,
|
|
93
|
-
'is-disabled': isDisabled,
|
|
94
|
-
'is-hovered': isHovered
|
|
95
|
-
}, styleProps.className)
|
|
96
|
-
}, /*#__PURE__*/ (0, $cvQES$react).createElement((0, $cvQES$FocusRing), {
|
|
97
|
-
focusRingClass: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'focus-ring'),
|
|
98
|
-
autoFocus: autoFocus
|
|
99
|
-
}, /*#__PURE__*/ (0, $cvQES$react).createElement("input", {
|
|
100
|
-
...inputProps,
|
|
101
|
-
ref: inputRef,
|
|
102
|
-
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-input')
|
|
103
|
-
})), /*#__PURE__*/ (0, $cvQES$react).createElement("span", {
|
|
104
|
-
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-box')
|
|
105
|
-
}, markIcon), children && /*#__PURE__*/ (0, $cvQES$react).createElement("span", {
|
|
106
|
-
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-label')
|
|
107
|
-
}, children));
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
export {$25b6292d81af2844$export$48513f6b9f8ce62d as Checkbox};
|
|
112
|
-
//# sourceMappingURL=Checkbox.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AAsBM,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAAS,KAA4B,EAAE,GAAmC;IACpH,IAAI,gBAAgB;IACpB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE,KAAK;IAElC,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,sBAAc;IAC/D,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,mBACF,kBAAkB,qBAClB,eAAe,kBACf,SAAS,YACT,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAEjC,2EAA2E;IAC3E,gFAAgF;IAChF,8EAA8E;IAC9E,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAmB;IAC/C,IAAI,cAAC,UAAU,aAAE,SAAS,cAAE,UAAU,EAAC,GAAG,aAEtC,CAAA,GAAA,2BAAmB,EAAE;QACrB,GAAG,KAAK;QACR,qFAAqF;QACrF,2EAA2E;QAC3E,aAAa;QACb,OAAO,MAAM,KAAK;QAClB,2EAA2E;QAC3E,8EAA8E;QAC9E,YAAY,cAAc,UAAU;QACpC,iBAAiB,cAAc,eAAe;QAC9C,WAAW,cAAc,SAAS;IACpC,GAAG,YAAY,YAEb,CAAA,GAAA,kBAAU,EAAE,OAAO,CAAA,GAAA,qBAAa,EAAE,QAAQ;IAE9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAElD,IAAI,WAAW,gCACX,gCAAC,CAAA,GAAA,+BAAQ;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;uBAChD,gCAAC,CAAA,GAAA,oCAAa;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;;IAEzD,IAAI,cAAc,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;QACvD,KAAK,IAAI,OAAO;YAAC;YAAc;YAAmB;SAAe,CAC/D,IAAI,aAAa,CAAC,IAAI,IAAI,MACxB,QAAQ,IAAI,CAAC,GAAG,IAAI,0HAA0H,CAAC;QAGnJ,IAAI,MAAM,KAAK,IAAI,MACjB,QAAQ,IAAI,CAAC;IAEjB;IAEA,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,0DAAK,GACL,qBACA;YACE,cAAc,WAAW,OAAO;YAChC,oBAAoB;YACpB,4BAA4B,CAAC;YAC7B,cAAc;YACd,eAAe;YACf,cAAc;QAChB,GACA,WAAW,SAAS;qBAGxB,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;QAAe,WAAW;qBACtE,gCAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;uBAElC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;OAA2B,WAC9D,0BACC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;OACjC;AAKX","sources":["packages/@react-spectrum/checkbox/src/Checkbox.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 {CheckboxContext, useContextProps} from 'react-aria-components';\nimport {CheckboxGroupContext} from './context';\nimport CheckmarkSmall from '@spectrum-icons/ui/CheckmarkSmall';\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport DashSmall from '@spectrum-icons/ui/DashSmall';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useContext, useRef} from 'react';\nimport {SpectrumCheckboxProps} from '@react-types/checkbox';\nimport styles from '@adobe/spectrum-css-temp/components/checkbox/vars.css';\nimport {useCheckbox, useCheckboxGroupItem} from '@react-aria/checkbox';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useToggleState} from '@react-stately/toggle';\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox(props: SpectrumCheckboxProps, ref: FocusableRef<HTMLLabelElement>) {\n let originalProps = props;\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n [props, domRef] = useContextProps(props, domRef, CheckboxContext);\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isIndeterminate = false,\n isEmphasized = false,\n autoFocus,\n children,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n\n // Swap hooks depending on whether this checkbox is inside a CheckboxGroup.\n // This is a bit unorthodox. Typically, hooks cannot be called in a conditional,\n // but since the checkbox won't move in and out of a group, it should be safe.\n let groupState = useContext(CheckboxGroupContext);\n let {inputProps, isInvalid, isDisabled} = groupState\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useCheckboxGroupItem({\n ...props,\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // Only pass isRequired and validationState to react-aria if they came from\n // the props for this individual checkbox, and not from the group via context.\n isRequired: originalProps.isRequired,\n validationState: originalProps.validationState,\n isInvalid: originalProps.isInvalid\n }, groupState, inputRef)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useCheckbox(props, useToggleState(props), inputRef);\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let markIcon = isIndeterminate\n ? <DashSmall UNSAFE_className={classNames(styles, 'spectrum-Checkbox-partialCheckmark')} />\n : <CheckmarkSmall UNSAFE_className={classNames(styles, 'spectrum-Checkbox-checkmark')} />;\n\n if (groupState && process.env.NODE_ENV !== 'production') {\n for (let key of ['isSelected', 'defaultSelected', 'isEmphasized']) {\n if (originalProps[key] != null) {\n console.warn(`${key} is unsupported on individual <Checkbox> elements within a <CheckboxGroup>. Please apply these props to the group instead.`);\n }\n }\n if (props.value == null) {\n console.warn('A <Checkbox> element within a <CheckboxGroup> requires a `value` property.');\n }\n }\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Checkbox',\n {\n 'is-checked': inputProps.checked,\n 'is-indeterminate': isIndeterminate,\n 'spectrum-Checkbox--quiet': !isEmphasized,\n 'is-invalid': isInvalid,\n 'is-disabled': isDisabled,\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-Checkbox-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-Checkbox-box')}>{markIcon}</span>\n {children && (\n <span className={classNames(styles, 'spectrum-Checkbox-label')}>\n {children}\n </span>\n )}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.module.js.map"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
var $bdf3bf7fe71fe120$exports = require("./context.main.js");
|
|
2
|
-
require("./checkbox.f39d58be.css");
|
|
3
|
-
var $53124a3a0fd56fca$exports = require("./fieldgroup_vars_css.main.js");
|
|
4
|
-
var $5yQLk$reactspectrumutils = require("@react-spectrum/utils");
|
|
5
|
-
var $5yQLk$reactspectrumlabel = require("@react-spectrum/label");
|
|
6
|
-
var $5yQLk$reactspectrumprovider = require("@react-spectrum/provider");
|
|
7
|
-
var $5yQLk$react = require("react");
|
|
8
|
-
var $5yQLk$reactariacheckbox = require("@react-aria/checkbox");
|
|
9
|
-
var $5yQLk$reactstatelycheckbox = require("@react-stately/checkbox");
|
|
10
|
-
var $5yQLk$reactspectrumform = require("@react-spectrum/form");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function $parcel$interopDefault(a) {
|
|
14
|
-
return a && a.__esModule ? a.default : a;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function $parcel$export(e, n, v, s) {
|
|
18
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
$parcel$export(module.exports, "CheckboxGroup", () => $1151290755e16c44$export$4aa08d5625cb8ead);
|
|
22
|
-
/*
|
|
23
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
24
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
25
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
26
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
-
*
|
|
28
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
29
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
30
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
31
|
-
* governing permissions and limitations under the License.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const $1151290755e16c44$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, ($parcel$interopDefault($5yQLk$react))).forwardRef(function CheckboxGroup(props, ref) {
|
|
42
|
-
props = (0, $5yQLk$reactspectrumprovider.useProviderProps)(props);
|
|
43
|
-
props = (0, $5yQLk$reactspectrumform.useFormProps)(props);
|
|
44
|
-
let { isEmphasized: isEmphasized, children: children, orientation: orientation = 'vertical' } = props;
|
|
45
|
-
let domRef = (0, $5yQLk$reactspectrumutils.useDOMRef)(ref);
|
|
46
|
-
let state = (0, $5yQLk$reactstatelycheckbox.useCheckboxGroupState)(props);
|
|
47
|
-
let { groupProps: groupProps, ...otherProps } = (0, $5yQLk$reactariacheckbox.useCheckboxGroup)(props, state);
|
|
48
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($5yQLk$react))).createElement((0, $5yQLk$reactspectrumlabel.Field), {
|
|
49
|
-
...props,
|
|
50
|
-
...otherProps,
|
|
51
|
-
ref: domRef,
|
|
52
|
-
wrapperClassName: (0, $5yQLk$reactspectrumutils.classNames)((0, ($parcel$interopDefault($53124a3a0fd56fca$exports))), 'spectrum-FieldGroup'),
|
|
53
|
-
elementType: "span",
|
|
54
|
-
includeNecessityIndicatorInAccessibilityName: true
|
|
55
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5yQLk$react))).createElement("div", {
|
|
56
|
-
...groupProps,
|
|
57
|
-
className: (0, $5yQLk$reactspectrumutils.classNames)((0, ($parcel$interopDefault($53124a3a0fd56fca$exports))), 'spectrum-FieldGroup-group', {
|
|
58
|
-
'spectrum-FieldGroup-group--horizontal': orientation === 'horizontal'
|
|
59
|
-
})
|
|
60
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5yQLk$react))).createElement((0, $5yQLk$reactspectrumprovider.Provider), {
|
|
61
|
-
isEmphasized: isEmphasized
|
|
62
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5yQLk$react))).createElement((0, $bdf3bf7fe71fe120$exports.CheckboxGroupContext).Provider, {
|
|
63
|
-
value: state
|
|
64
|
-
}, children))));
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//# sourceMappingURL=CheckboxGroup.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,cAAc,KAAiC,EAAE,GAA2B;IACjI,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,gBACF,YAAY,YACZ,QAAQ,eACR,cAAc,YACf,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,QAAQ,CAAA,GAAA,iDAAoB,EAAE;IAClC,IAAI,cAAC,UAAU,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,yCAAe,EAAE,OAAO;IAE1D,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;QACZ,8CAAA;qBACA,0DAAC;QACE,GAAG,UAAU;QACd,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,0DAAC,CAAA,GAAA,qCAAO;QAAE,cAAc;qBACtB,0DAAC,CAAA,GAAA,8CAAmB,EAAE,QAAQ;QAAC,OAAO;OACnC;AAMb","sources":["packages/@react-spectrum/checkbox/src/CheckboxGroup.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 {CheckboxGroupContext} from './context';\nimport {classNames, useDOMRef} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React from 'react';\nimport {SpectrumCheckboxGroupProps} from '@react-types/checkbox';\nimport styles from '@adobe/spectrum-css-temp/components/fieldgroup/vars.css';\nimport {useCheckboxGroup} from '@react-aria/checkbox';\nimport {useCheckboxGroupState} from '@react-stately/checkbox';\nimport {useFormProps} from '@react-spectrum/form';\n\n/**\n * A CheckboxGroup allows users to select one or more items from a list of choices.\n */\nexport const CheckboxGroup = React.forwardRef(function CheckboxGroup(props: SpectrumCheckboxGroupProps, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isEmphasized,\n children,\n orientation = 'vertical'\n } = props;\n let domRef = useDOMRef(ref);\n let state = useCheckboxGroupState(props);\n let {groupProps, ...otherProps} = useCheckboxGroup(props, state);\n\n return (\n <Field\n {...props}\n {...otherProps}\n ref={domRef}\n wrapperClassName={classNames(styles, 'spectrum-FieldGroup')}\n elementType=\"span\"\n includeNecessityIndicatorInAccessibilityName>\n <div\n {...groupProps}\n className={\n classNames(\n styles,\n 'spectrum-FieldGroup-group',\n {\n 'spectrum-FieldGroup-group--horizontal': orientation === 'horizontal'\n }\n )\n }>\n <Provider isEmphasized={isEmphasized}>\n <CheckboxGroupContext.Provider value={state}>\n {children}\n </CheckboxGroupContext.Provider>\n </Provider>\n </div>\n </Field>\n );\n});\n"],"names":[],"version":3,"file":"CheckboxGroup.main.js.map"}
|