@react-spectrum/checkbox 3.9.4 → 3.9.5
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/Checkbox.main.js +121 -0
- package/dist/Checkbox.main.js.map +1 -0
- package/dist/Checkbox.mjs +116 -0
- package/dist/Checkbox.module.js +116 -0
- package/dist/Checkbox.module.js.map +1 -0
- package/dist/CheckboxGroup.main.js +71 -0
- package/dist/CheckboxGroup.main.js.map +1 -0
- package/dist/CheckboxGroup.mjs +66 -0
- package/dist/CheckboxGroup.module.js +66 -0
- package/dist/CheckboxGroup.module.js.map +1 -0
- package/dist/checkbox_vars_css.main.js +59 -0
- package/dist/checkbox_vars_css.main.js.map +1 -0
- package/dist/checkbox_vars_css.mjs +61 -0
- package/dist/checkbox_vars_css.module.js +61 -0
- package/dist/checkbox_vars_css.module.js.map +1 -0
- package/dist/context.main.js +27 -0
- package/dist/context.main.js.map +1 -0
- package/dist/context.mjs +18 -0
- package/dist/context.module.js +18 -0
- package/dist/context.module.js.map +1 -0
- package/dist/fieldgroup_vars_css.main.js +32 -0
- package/dist/fieldgroup_vars_css.main.js.map +1 -0
- package/dist/fieldgroup_vars_css.mjs +34 -0
- package/dist/fieldgroup_vars_css.module.js +34 -0
- package/dist/fieldgroup_vars_css.module.js.map +1 -0
- package/dist/import.mjs +2 -255
- package/dist/main.js +4 -253
- package/dist/main.js.map +1 -1
- package/dist/module.js +2 -255
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/vars.880c6573.css +94 -0
- package/dist/vars.880c6573.css.map +1 -0
- package/dist/{main.css → vars.fe746eae.css} +36 -238
- package/dist/vars.fe746eae.css.map +1 -0
- package/package.json +15 -14
- package/src/Checkbox.tsx +5 -3
- package/dist/main.css.map +0 -1
package/dist/import.mjs
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import $
|
|
3
|
-
import {useStyleProps as $gpy1V$useStyleProps, useFocusableRef as $gpy1V$useFocusableRef, classNames as $gpy1V$classNames, useDOMRef as $gpy1V$useDOMRef} from "@react-spectrum/utils";
|
|
4
|
-
import $gpy1V$spectrumiconsuiDashSmall from "@spectrum-icons/ui/DashSmall";
|
|
5
|
-
import {FocusRing as $gpy1V$FocusRing} from "@react-aria/focus";
|
|
6
|
-
import $gpy1V$react, {useRef as $gpy1V$useRef, useContext as $gpy1V$useContext, forwardRef as $gpy1V$forwardRef} from "react";
|
|
7
|
-
import {useCheckboxGroupItem as $gpy1V$useCheckboxGroupItem, useCheckbox as $gpy1V$useCheckbox, useCheckboxGroup as $gpy1V$useCheckboxGroup} from "@react-aria/checkbox";
|
|
8
|
-
import {useFormProps as $gpy1V$useFormProps} from "@react-spectrum/form";
|
|
9
|
-
import {useHover as $gpy1V$useHover} from "@react-aria/interactions";
|
|
10
|
-
import {useProviderProps as $gpy1V$useProviderProps, Provider as $gpy1V$Provider} from "@react-spectrum/provider";
|
|
11
|
-
import {useToggleState as $gpy1V$useToggleState} from "@react-stately/toggle";
|
|
12
|
-
import {Field as $gpy1V$Field} from "@react-spectrum/label";
|
|
13
|
-
import {useCheckboxGroupState as $gpy1V$useCheckboxGroupState} from "@react-stately/checkbox";
|
|
1
|
+
import {Checkbox as $25b6292d81af2844$export$48513f6b9f8ce62d} from "./Checkbox.mjs";
|
|
2
|
+
import {CheckboxGroup as $73f43ce9d441cc69$export$4aa08d5625cb8ead} from "./CheckboxGroup.mjs";
|
|
14
3
|
|
|
15
|
-
|
|
16
|
-
function $parcel$interopDefault(a) {
|
|
17
|
-
return a && a.__esModule ? a.default : a;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function $parcel$export(e, n, v, s) {
|
|
21
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
22
|
-
}
|
|
23
4
|
/*
|
|
24
5
|
* Copyright 2020 Adobe. All rights reserved.
|
|
25
6
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -31,240 +12,6 @@ function $parcel$export(e, n, v, s) {
|
|
|
31
12
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
32
13
|
* governing permissions and limitations under the License.
|
|
33
14
|
*/ /// <reference types="css-module-types" />
|
|
34
|
-
/*
|
|
35
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
36
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
37
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
38
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
39
|
-
*
|
|
40
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
41
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
42
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
43
|
-
* governing permissions and limitations under the License.
|
|
44
|
-
*/ /*
|
|
45
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
46
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
47
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
48
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
49
|
-
*
|
|
50
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
51
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
52
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
53
|
-
* governing permissions and limitations under the License.
|
|
54
|
-
*/
|
|
55
|
-
const $8c8ab388b155237e$export$baf37c4be89255b8 = (0, $gpy1V$react).createContext(null);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var $fe1a56c62936037c$exports = {};
|
|
64
|
-
|
|
65
|
-
$parcel$export($fe1a56c62936037c$exports, "focus-ring", () => $fe1a56c62936037c$export$f39a09f249340e2a, (v) => $fe1a56c62936037c$export$f39a09f249340e2a = v);
|
|
66
|
-
$parcel$export($fe1a56c62936037c$exports, "i18nFontFamily", () => $fe1a56c62936037c$export$8c4ee2c50c22c514, (v) => $fe1a56c62936037c$export$8c4ee2c50c22c514 = v);
|
|
67
|
-
$parcel$export($fe1a56c62936037c$exports, "is-checked", () => $fe1a56c62936037c$export$3f46c891456641e7, (v) => $fe1a56c62936037c$export$3f46c891456641e7 = v);
|
|
68
|
-
$parcel$export($fe1a56c62936037c$exports, "is-disabled", () => $fe1a56c62936037c$export$d35bc1e505d1ebbf, (v) => $fe1a56c62936037c$export$d35bc1e505d1ebbf = v);
|
|
69
|
-
$parcel$export($fe1a56c62936037c$exports, "is-hovered", () => $fe1a56c62936037c$export$b8813cd5d7824ce7, (v) => $fe1a56c62936037c$export$b8813cd5d7824ce7 = v);
|
|
70
|
-
$parcel$export($fe1a56c62936037c$exports, "is-indeterminate", () => $fe1a56c62936037c$export$682c8615600f6ee, (v) => $fe1a56c62936037c$export$682c8615600f6ee = v);
|
|
71
|
-
$parcel$export($fe1a56c62936037c$exports, "is-invalid", () => $fe1a56c62936037c$export$14a30de2866685fa, (v) => $fe1a56c62936037c$export$14a30de2866685fa = v);
|
|
72
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-Checkbox", () => $fe1a56c62936037c$export$f8ee3e99d637ccac, (v) => $fe1a56c62936037c$export$f8ee3e99d637ccac = v);
|
|
73
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-Checkbox--quiet", () => $fe1a56c62936037c$export$3a2eb50fe5450439, (v) => $fe1a56c62936037c$export$3a2eb50fe5450439 = v);
|
|
74
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-Checkbox-box", () => $fe1a56c62936037c$export$b07bd551df410935, (v) => $fe1a56c62936037c$export$b07bd551df410935 = v);
|
|
75
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-Checkbox-checkmark", () => $fe1a56c62936037c$export$e152b25f70350d85, (v) => $fe1a56c62936037c$export$e152b25f70350d85 = v);
|
|
76
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-Checkbox-input", () => $fe1a56c62936037c$export$fbf255e91152b086, (v) => $fe1a56c62936037c$export$fbf255e91152b086 = v);
|
|
77
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-Checkbox-label", () => $fe1a56c62936037c$export$9244b14cfa532d4f, (v) => $fe1a56c62936037c$export$9244b14cfa532d4f = v);
|
|
78
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-Checkbox-partialCheckmark", () => $fe1a56c62936037c$export$7f6ea68ad4b1fa69, (v) => $fe1a56c62936037c$export$7f6ea68ad4b1fa69 = v);
|
|
79
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-FocusRing-ring", () => $fe1a56c62936037c$export$4109102f950813a6, (v) => $fe1a56c62936037c$export$4109102f950813a6 = v);
|
|
80
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-FocusRing", () => $fe1a56c62936037c$export$24c7f46a6e3605dd, (v) => $fe1a56c62936037c$export$24c7f46a6e3605dd = v);
|
|
81
|
-
$parcel$export($fe1a56c62936037c$exports, "spectrum-FocusRing--quiet", () => $fe1a56c62936037c$export$2927016961429360, (v) => $fe1a56c62936037c$export$2927016961429360 = v);
|
|
82
|
-
var $fe1a56c62936037c$export$f39a09f249340e2a;
|
|
83
|
-
var $fe1a56c62936037c$export$8c4ee2c50c22c514;
|
|
84
|
-
var $fe1a56c62936037c$export$3f46c891456641e7;
|
|
85
|
-
var $fe1a56c62936037c$export$d35bc1e505d1ebbf;
|
|
86
|
-
var $fe1a56c62936037c$export$b8813cd5d7824ce7;
|
|
87
|
-
var $fe1a56c62936037c$export$682c8615600f6ee;
|
|
88
|
-
var $fe1a56c62936037c$export$14a30de2866685fa;
|
|
89
|
-
var $fe1a56c62936037c$export$f8ee3e99d637ccac;
|
|
90
|
-
var $fe1a56c62936037c$export$3a2eb50fe5450439;
|
|
91
|
-
var $fe1a56c62936037c$export$b07bd551df410935;
|
|
92
|
-
var $fe1a56c62936037c$export$e152b25f70350d85;
|
|
93
|
-
var $fe1a56c62936037c$export$fbf255e91152b086;
|
|
94
|
-
var $fe1a56c62936037c$export$9244b14cfa532d4f;
|
|
95
|
-
var $fe1a56c62936037c$export$7f6ea68ad4b1fa69;
|
|
96
|
-
var $fe1a56c62936037c$export$4109102f950813a6;
|
|
97
|
-
var $fe1a56c62936037c$export$24c7f46a6e3605dd;
|
|
98
|
-
var $fe1a56c62936037c$export$2927016961429360;
|
|
99
|
-
$fe1a56c62936037c$export$f39a09f249340e2a = `ISsn1a_focus-ring`;
|
|
100
|
-
$fe1a56c62936037c$export$8c4ee2c50c22c514 = `ISsn1a_i18nFontFamily`;
|
|
101
|
-
$fe1a56c62936037c$export$3f46c891456641e7 = `ISsn1a_is-checked`;
|
|
102
|
-
$fe1a56c62936037c$export$d35bc1e505d1ebbf = `ISsn1a_is-disabled`;
|
|
103
|
-
$fe1a56c62936037c$export$b8813cd5d7824ce7 = `ISsn1a_is-hovered`;
|
|
104
|
-
$fe1a56c62936037c$export$682c8615600f6ee = `ISsn1a_is-indeterminate`;
|
|
105
|
-
$fe1a56c62936037c$export$14a30de2866685fa = `ISsn1a_is-invalid`;
|
|
106
|
-
$fe1a56c62936037c$export$f8ee3e99d637ccac = `ISsn1a_spectrum-Checkbox`;
|
|
107
|
-
$fe1a56c62936037c$export$3a2eb50fe5450439 = `ISsn1a_spectrum-Checkbox--quiet`;
|
|
108
|
-
$fe1a56c62936037c$export$b07bd551df410935 = `ISsn1a_spectrum-Checkbox-box`;
|
|
109
|
-
$fe1a56c62936037c$export$e152b25f70350d85 = `ISsn1a_spectrum-Checkbox-checkmark`;
|
|
110
|
-
$fe1a56c62936037c$export$fbf255e91152b086 = `ISsn1a_spectrum-Checkbox-input`;
|
|
111
|
-
$fe1a56c62936037c$export$9244b14cfa532d4f = `ISsn1a_spectrum-Checkbox-label`;
|
|
112
|
-
$fe1a56c62936037c$export$7f6ea68ad4b1fa69 = `ISsn1a_spectrum-Checkbox-partialCheckmark`;
|
|
113
|
-
$fe1a56c62936037c$export$4109102f950813a6 = `ISsn1a_spectrum-FocusRing-ring`;
|
|
114
|
-
$fe1a56c62936037c$export$24c7f46a6e3605dd = `ISsn1a_spectrum-FocusRing ${$fe1a56c62936037c$export$4109102f950813a6}`;
|
|
115
|
-
$fe1a56c62936037c$export$2927016961429360 = `ISsn1a_spectrum-FocusRing--quiet`;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
function $25b6292d81af2844$var$Checkbox(props, ref) {
|
|
124
|
-
let originalProps = props;
|
|
125
|
-
props = (0, $gpy1V$useProviderProps)(props);
|
|
126
|
-
props = (0, $gpy1V$useFormProps)(props);
|
|
127
|
-
let { isIndeterminate: isIndeterminate = false, isEmphasized: isEmphasized = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
|
|
128
|
-
let { styleProps: styleProps } = (0, $gpy1V$useStyleProps)(otherProps);
|
|
129
|
-
let inputRef = (0, $gpy1V$useRef)(null);
|
|
130
|
-
let domRef = (0, $gpy1V$useFocusableRef)(ref, inputRef);
|
|
131
|
-
// Swap hooks depending on whether this checkbox is inside a CheckboxGroup.
|
|
132
|
-
// This is a bit unorthodox. Typically, hooks cannot be called in a conditional,
|
|
133
|
-
// but since the checkbox won't move in and out of a group, it should be safe.
|
|
134
|
-
let groupState = (0, $gpy1V$useContext)((0, $8c8ab388b155237e$export$baf37c4be89255b8));
|
|
135
|
-
let { inputProps: inputProps, isInvalid: isInvalid, isDisabled: isDisabled } = groupState ? (0, $gpy1V$useCheckboxGroupItem)({
|
|
136
|
-
...props,
|
|
137
|
-
// Value is optional for standalone checkboxes, but required for CheckboxGroup items;
|
|
138
|
-
// it's passed explicitly here to avoid typescript error (requires ignore).
|
|
139
|
-
// @ts-ignore
|
|
140
|
-
value: props.value,
|
|
141
|
-
// Only pass isRequired and validationState to react-aria if they came from
|
|
142
|
-
// the props for this individual checkbox, and not from the group via context.
|
|
143
|
-
isRequired: originalProps.isRequired,
|
|
144
|
-
validationState: originalProps.validationState,
|
|
145
|
-
isInvalid: originalProps.isInvalid
|
|
146
|
-
}, groupState, inputRef) : (0, $gpy1V$useCheckbox)(props, (0, $gpy1V$useToggleState)(props), inputRef);
|
|
147
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $gpy1V$useHover)({
|
|
148
|
-
isDisabled: isDisabled
|
|
149
|
-
});
|
|
150
|
-
let markIcon = isIndeterminate ? /*#__PURE__*/ (0, $gpy1V$react).createElement((0, $gpy1V$spectrumiconsuiDashSmall), {
|
|
151
|
-
UNSAFE_className: (0, $gpy1V$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fe1a56c62936037c$exports))), "spectrum-Checkbox-partialCheckmark")
|
|
152
|
-
}) : /*#__PURE__*/ (0, $gpy1V$react).createElement((0, $gpy1V$spectrumiconsuiCheckmarkSmall), {
|
|
153
|
-
UNSAFE_className: (0, $gpy1V$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fe1a56c62936037c$exports))), "spectrum-Checkbox-checkmark")
|
|
154
|
-
});
|
|
155
|
-
if (groupState) {
|
|
156
|
-
for (let key of [
|
|
157
|
-
"isSelected",
|
|
158
|
-
"defaultSelected",
|
|
159
|
-
"isEmphasized"
|
|
160
|
-
])if (originalProps[key] != null) console.warn(`${key} is unsupported on individual <Checkbox> elements within a <CheckboxGroup>. Please apply these props to the group instead.`);
|
|
161
|
-
if (props.value == null) console.warn("A <Checkbox> element within a <CheckboxGroup> requires a `value` property.");
|
|
162
|
-
}
|
|
163
|
-
return /*#__PURE__*/ (0, $gpy1V$react).createElement("label", {
|
|
164
|
-
...styleProps,
|
|
165
|
-
...hoverProps,
|
|
166
|
-
ref: domRef,
|
|
167
|
-
className: (0, $gpy1V$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fe1a56c62936037c$exports))), "spectrum-Checkbox", {
|
|
168
|
-
"is-checked": inputProps.checked,
|
|
169
|
-
"is-indeterminate": isIndeterminate,
|
|
170
|
-
"spectrum-Checkbox--quiet": !isEmphasized,
|
|
171
|
-
"is-invalid": isInvalid,
|
|
172
|
-
"is-disabled": isDisabled,
|
|
173
|
-
"is-hovered": isHovered
|
|
174
|
-
}, styleProps.className)
|
|
175
|
-
}, /*#__PURE__*/ (0, $gpy1V$react).createElement((0, $gpy1V$FocusRing), {
|
|
176
|
-
focusRingClass: (0, $gpy1V$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fe1a56c62936037c$exports))), "focus-ring"),
|
|
177
|
-
autoFocus: autoFocus
|
|
178
|
-
}, /*#__PURE__*/ (0, $gpy1V$react).createElement("input", {
|
|
179
|
-
...inputProps,
|
|
180
|
-
ref: inputRef,
|
|
181
|
-
className: (0, $gpy1V$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fe1a56c62936037c$exports))), "spectrum-Checkbox-input")
|
|
182
|
-
})), /*#__PURE__*/ (0, $gpy1V$react).createElement("span", {
|
|
183
|
-
className: (0, $gpy1V$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fe1a56c62936037c$exports))), "spectrum-Checkbox-box")
|
|
184
|
-
}, markIcon), children && /*#__PURE__*/ (0, $gpy1V$react).createElement("span", {
|
|
185
|
-
className: (0, $gpy1V$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fe1a56c62936037c$exports))), "spectrum-Checkbox-label")
|
|
186
|
-
}, children));
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Checkboxes allow users to select multiple items from a list of individual items,
|
|
190
|
-
* or to mark one individual item as selected.
|
|
191
|
-
*/ let $25b6292d81af2844$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $gpy1V$forwardRef)($25b6292d81af2844$var$Checkbox);
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
/*
|
|
195
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
196
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
197
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
198
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
199
|
-
*
|
|
200
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
201
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
202
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
203
|
-
* governing permissions and limitations under the License.
|
|
204
|
-
*/
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
var $4cb2b26710154c56$exports = {};
|
|
210
|
-
|
|
211
|
-
$parcel$export($4cb2b26710154c56$exports, "focus-ring", () => $4cb2b26710154c56$export$f39a09f249340e2a, (v) => $4cb2b26710154c56$export$f39a09f249340e2a = v);
|
|
212
|
-
$parcel$export($4cb2b26710154c56$exports, "i18nFontFamily", () => $4cb2b26710154c56$export$8c4ee2c50c22c514, (v) => $4cb2b26710154c56$export$8c4ee2c50c22c514 = v);
|
|
213
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup", () => $4cb2b26710154c56$export$75eb16cbfc18279c, (v) => $4cb2b26710154c56$export$75eb16cbfc18279c = v);
|
|
214
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup-group", () => $4cb2b26710154c56$export$984c7bbbfc7ddffc, (v) => $4cb2b26710154c56$export$984c7bbbfc7ddffc = v);
|
|
215
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FieldGroup-group--horizontal", () => $4cb2b26710154c56$export$1ad8646bcba21c0e, (v) => $4cb2b26710154c56$export$1ad8646bcba21c0e = v);
|
|
216
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FocusRing-ring", () => $4cb2b26710154c56$export$4109102f950813a6, (v) => $4cb2b26710154c56$export$4109102f950813a6 = v);
|
|
217
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FocusRing", () => $4cb2b26710154c56$export$24c7f46a6e3605dd, (v) => $4cb2b26710154c56$export$24c7f46a6e3605dd = v);
|
|
218
|
-
$parcel$export($4cb2b26710154c56$exports, "spectrum-FocusRing--quiet", () => $4cb2b26710154c56$export$2927016961429360, (v) => $4cb2b26710154c56$export$2927016961429360 = v);
|
|
219
|
-
var $4cb2b26710154c56$export$f39a09f249340e2a;
|
|
220
|
-
var $4cb2b26710154c56$export$8c4ee2c50c22c514;
|
|
221
|
-
var $4cb2b26710154c56$export$75eb16cbfc18279c;
|
|
222
|
-
var $4cb2b26710154c56$export$984c7bbbfc7ddffc;
|
|
223
|
-
var $4cb2b26710154c56$export$1ad8646bcba21c0e;
|
|
224
|
-
var $4cb2b26710154c56$export$4109102f950813a6;
|
|
225
|
-
var $4cb2b26710154c56$export$24c7f46a6e3605dd;
|
|
226
|
-
var $4cb2b26710154c56$export$2927016961429360;
|
|
227
|
-
$4cb2b26710154c56$export$f39a09f249340e2a = `hyn22G_focus-ring`;
|
|
228
|
-
$4cb2b26710154c56$export$8c4ee2c50c22c514 = `hyn22G_i18nFontFamily`;
|
|
229
|
-
$4cb2b26710154c56$export$75eb16cbfc18279c = `hyn22G_spectrum-FieldGroup`;
|
|
230
|
-
$4cb2b26710154c56$export$984c7bbbfc7ddffc = `hyn22G_spectrum-FieldGroup-group`;
|
|
231
|
-
$4cb2b26710154c56$export$1ad8646bcba21c0e = `hyn22G_spectrum-FieldGroup-group--horizontal`;
|
|
232
|
-
$4cb2b26710154c56$export$4109102f950813a6 = `hyn22G_spectrum-FocusRing-ring`;
|
|
233
|
-
$4cb2b26710154c56$export$24c7f46a6e3605dd = `hyn22G_spectrum-FocusRing ${$4cb2b26710154c56$export$4109102f950813a6}`;
|
|
234
|
-
$4cb2b26710154c56$export$2927016961429360 = `hyn22G_spectrum-FocusRing--quiet`;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
function $73f43ce9d441cc69$var$CheckboxGroup(props, ref) {
|
|
241
|
-
props = (0, $gpy1V$useProviderProps)(props);
|
|
242
|
-
props = (0, $gpy1V$useFormProps)(props);
|
|
243
|
-
let { isEmphasized: isEmphasized, children: children, orientation: orientation = "vertical" } = props;
|
|
244
|
-
let domRef = (0, $gpy1V$useDOMRef)(ref);
|
|
245
|
-
let state = (0, $gpy1V$useCheckboxGroupState)(props);
|
|
246
|
-
let { groupProps: groupProps, ...otherProps } = (0, $gpy1V$useCheckboxGroup)(props, state);
|
|
247
|
-
return /*#__PURE__*/ (0, $gpy1V$react).createElement((0, $gpy1V$Field), {
|
|
248
|
-
...props,
|
|
249
|
-
...otherProps,
|
|
250
|
-
ref: domRef,
|
|
251
|
-
wrapperClassName: (0, $gpy1V$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($4cb2b26710154c56$exports))), "spectrum-FieldGroup"),
|
|
252
|
-
elementType: "span",
|
|
253
|
-
includeNecessityIndicatorInAccessibilityName: true
|
|
254
|
-
}, /*#__PURE__*/ (0, $gpy1V$react).createElement("div", {
|
|
255
|
-
...groupProps,
|
|
256
|
-
className: (0, $gpy1V$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($4cb2b26710154c56$exports))), "spectrum-FieldGroup-group", {
|
|
257
|
-
"spectrum-FieldGroup-group--horizontal": orientation === "horizontal"
|
|
258
|
-
})
|
|
259
|
-
}, /*#__PURE__*/ (0, $gpy1V$react).createElement((0, $gpy1V$Provider), {
|
|
260
|
-
isEmphasized: isEmphasized
|
|
261
|
-
}, /*#__PURE__*/ (0, $gpy1V$react).createElement((0, $8c8ab388b155237e$export$baf37c4be89255b8).Provider, {
|
|
262
|
-
value: state
|
|
263
|
-
}, children))));
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* A CheckboxGroup allows users to select one or more items from a list of choices.
|
|
267
|
-
*/ const $73f43ce9d441cc69$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, $gpy1V$react).forwardRef($73f43ce9d441cc69$var$CheckboxGroup);
|
|
268
15
|
|
|
269
16
|
|
|
270
17
|
|
package/dist/main.js
CHANGED
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
require("./main.
|
|
2
|
-
var $
|
|
3
|
-
var $5Ft2u$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
|
-
var $5Ft2u$spectrumiconsuiDashSmall = require("@spectrum-icons/ui/DashSmall");
|
|
5
|
-
var $5Ft2u$reactariafocus = require("@react-aria/focus");
|
|
6
|
-
var $5Ft2u$react = require("react");
|
|
7
|
-
var $5Ft2u$reactariacheckbox = require("@react-aria/checkbox");
|
|
8
|
-
var $5Ft2u$reactspectrumform = require("@react-spectrum/form");
|
|
9
|
-
var $5Ft2u$reactariainteractions = require("@react-aria/interactions");
|
|
10
|
-
var $5Ft2u$reactspectrumprovider = require("@react-spectrum/provider");
|
|
11
|
-
var $5Ft2u$reactstatelytoggle = require("@react-stately/toggle");
|
|
12
|
-
var $5Ft2u$reactspectrumlabel = require("@react-spectrum/label");
|
|
13
|
-
var $5Ft2u$reactstatelycheckbox = require("@react-stately/checkbox");
|
|
1
|
+
var $096ccd12d23dd6cc$exports = require("./Checkbox.main.js");
|
|
2
|
+
var $1151290755e16c44$exports = require("./CheckboxGroup.main.js");
|
|
14
3
|
|
|
15
4
|
|
|
16
5
|
function $parcel$export(e, n, v, s) {
|
|
17
6
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
18
7
|
}
|
|
19
8
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
$parcel$export(module.exports, "Checkbox", () => $096ccd12d23dd6cc$export$48513f6b9f8ce62d);
|
|
25
|
-
$parcel$export(module.exports, "CheckboxGroup", () => $1151290755e16c44$export$4aa08d5625cb8ead);
|
|
9
|
+
$parcel$export(module.exports, "Checkbox", () => $096ccd12d23dd6cc$exports.Checkbox);
|
|
10
|
+
$parcel$export(module.exports, "CheckboxGroup", () => $1151290755e16c44$exports.CheckboxGroup);
|
|
26
11
|
/*
|
|
27
12
|
* Copyright 2020 Adobe. All rights reserved.
|
|
28
13
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -34,240 +19,6 @@ $parcel$export(module.exports, "CheckboxGroup", () => $1151290755e16c44$export$4
|
|
|
34
19
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
35
20
|
* governing permissions and limitations under the License.
|
|
36
21
|
*/ /// <reference types="css-module-types" />
|
|
37
|
-
/*
|
|
38
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
39
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
40
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
41
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
42
|
-
*
|
|
43
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
44
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
45
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
46
|
-
* governing permissions and limitations under the License.
|
|
47
|
-
*/ /*
|
|
48
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
49
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
50
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
51
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
52
|
-
*
|
|
53
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
54
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
55
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
56
|
-
* governing permissions and limitations under the License.
|
|
57
|
-
*/
|
|
58
|
-
const $bdf3bf7fe71fe120$export$baf37c4be89255b8 = (0, ($parcel$interopDefault($5Ft2u$react))).createContext(null);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var $591f3ccba6339bdb$exports = {};
|
|
67
|
-
|
|
68
|
-
$parcel$export($591f3ccba6339bdb$exports, "focus-ring", () => $591f3ccba6339bdb$export$f39a09f249340e2a, (v) => $591f3ccba6339bdb$export$f39a09f249340e2a = v);
|
|
69
|
-
$parcel$export($591f3ccba6339bdb$exports, "i18nFontFamily", () => $591f3ccba6339bdb$export$8c4ee2c50c22c514, (v) => $591f3ccba6339bdb$export$8c4ee2c50c22c514 = v);
|
|
70
|
-
$parcel$export($591f3ccba6339bdb$exports, "is-checked", () => $591f3ccba6339bdb$export$3f46c891456641e7, (v) => $591f3ccba6339bdb$export$3f46c891456641e7 = v);
|
|
71
|
-
$parcel$export($591f3ccba6339bdb$exports, "is-disabled", () => $591f3ccba6339bdb$export$d35bc1e505d1ebbf, (v) => $591f3ccba6339bdb$export$d35bc1e505d1ebbf = v);
|
|
72
|
-
$parcel$export($591f3ccba6339bdb$exports, "is-hovered", () => $591f3ccba6339bdb$export$b8813cd5d7824ce7, (v) => $591f3ccba6339bdb$export$b8813cd5d7824ce7 = v);
|
|
73
|
-
$parcel$export($591f3ccba6339bdb$exports, "is-indeterminate", () => $591f3ccba6339bdb$export$682c8615600f6ee, (v) => $591f3ccba6339bdb$export$682c8615600f6ee = v);
|
|
74
|
-
$parcel$export($591f3ccba6339bdb$exports, "is-invalid", () => $591f3ccba6339bdb$export$14a30de2866685fa, (v) => $591f3ccba6339bdb$export$14a30de2866685fa = v);
|
|
75
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-Checkbox", () => $591f3ccba6339bdb$export$f8ee3e99d637ccac, (v) => $591f3ccba6339bdb$export$f8ee3e99d637ccac = v);
|
|
76
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-Checkbox--quiet", () => $591f3ccba6339bdb$export$3a2eb50fe5450439, (v) => $591f3ccba6339bdb$export$3a2eb50fe5450439 = v);
|
|
77
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-Checkbox-box", () => $591f3ccba6339bdb$export$b07bd551df410935, (v) => $591f3ccba6339bdb$export$b07bd551df410935 = v);
|
|
78
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-Checkbox-checkmark", () => $591f3ccba6339bdb$export$e152b25f70350d85, (v) => $591f3ccba6339bdb$export$e152b25f70350d85 = v);
|
|
79
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-Checkbox-input", () => $591f3ccba6339bdb$export$fbf255e91152b086, (v) => $591f3ccba6339bdb$export$fbf255e91152b086 = v);
|
|
80
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-Checkbox-label", () => $591f3ccba6339bdb$export$9244b14cfa532d4f, (v) => $591f3ccba6339bdb$export$9244b14cfa532d4f = v);
|
|
81
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-Checkbox-partialCheckmark", () => $591f3ccba6339bdb$export$7f6ea68ad4b1fa69, (v) => $591f3ccba6339bdb$export$7f6ea68ad4b1fa69 = v);
|
|
82
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-FocusRing-ring", () => $591f3ccba6339bdb$export$4109102f950813a6, (v) => $591f3ccba6339bdb$export$4109102f950813a6 = v);
|
|
83
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-FocusRing", () => $591f3ccba6339bdb$export$24c7f46a6e3605dd, (v) => $591f3ccba6339bdb$export$24c7f46a6e3605dd = v);
|
|
84
|
-
$parcel$export($591f3ccba6339bdb$exports, "spectrum-FocusRing--quiet", () => $591f3ccba6339bdb$export$2927016961429360, (v) => $591f3ccba6339bdb$export$2927016961429360 = v);
|
|
85
|
-
var $591f3ccba6339bdb$export$f39a09f249340e2a;
|
|
86
|
-
var $591f3ccba6339bdb$export$8c4ee2c50c22c514;
|
|
87
|
-
var $591f3ccba6339bdb$export$3f46c891456641e7;
|
|
88
|
-
var $591f3ccba6339bdb$export$d35bc1e505d1ebbf;
|
|
89
|
-
var $591f3ccba6339bdb$export$b8813cd5d7824ce7;
|
|
90
|
-
var $591f3ccba6339bdb$export$682c8615600f6ee;
|
|
91
|
-
var $591f3ccba6339bdb$export$14a30de2866685fa;
|
|
92
|
-
var $591f3ccba6339bdb$export$f8ee3e99d637ccac;
|
|
93
|
-
var $591f3ccba6339bdb$export$3a2eb50fe5450439;
|
|
94
|
-
var $591f3ccba6339bdb$export$b07bd551df410935;
|
|
95
|
-
var $591f3ccba6339bdb$export$e152b25f70350d85;
|
|
96
|
-
var $591f3ccba6339bdb$export$fbf255e91152b086;
|
|
97
|
-
var $591f3ccba6339bdb$export$9244b14cfa532d4f;
|
|
98
|
-
var $591f3ccba6339bdb$export$7f6ea68ad4b1fa69;
|
|
99
|
-
var $591f3ccba6339bdb$export$4109102f950813a6;
|
|
100
|
-
var $591f3ccba6339bdb$export$24c7f46a6e3605dd;
|
|
101
|
-
var $591f3ccba6339bdb$export$2927016961429360;
|
|
102
|
-
$591f3ccba6339bdb$export$f39a09f249340e2a = `ISsn1a_focus-ring`;
|
|
103
|
-
$591f3ccba6339bdb$export$8c4ee2c50c22c514 = `ISsn1a_i18nFontFamily`;
|
|
104
|
-
$591f3ccba6339bdb$export$3f46c891456641e7 = `ISsn1a_is-checked`;
|
|
105
|
-
$591f3ccba6339bdb$export$d35bc1e505d1ebbf = `ISsn1a_is-disabled`;
|
|
106
|
-
$591f3ccba6339bdb$export$b8813cd5d7824ce7 = `ISsn1a_is-hovered`;
|
|
107
|
-
$591f3ccba6339bdb$export$682c8615600f6ee = `ISsn1a_is-indeterminate`;
|
|
108
|
-
$591f3ccba6339bdb$export$14a30de2866685fa = `ISsn1a_is-invalid`;
|
|
109
|
-
$591f3ccba6339bdb$export$f8ee3e99d637ccac = `ISsn1a_spectrum-Checkbox`;
|
|
110
|
-
$591f3ccba6339bdb$export$3a2eb50fe5450439 = `ISsn1a_spectrum-Checkbox--quiet`;
|
|
111
|
-
$591f3ccba6339bdb$export$b07bd551df410935 = `ISsn1a_spectrum-Checkbox-box`;
|
|
112
|
-
$591f3ccba6339bdb$export$e152b25f70350d85 = `ISsn1a_spectrum-Checkbox-checkmark`;
|
|
113
|
-
$591f3ccba6339bdb$export$fbf255e91152b086 = `ISsn1a_spectrum-Checkbox-input`;
|
|
114
|
-
$591f3ccba6339bdb$export$9244b14cfa532d4f = `ISsn1a_spectrum-Checkbox-label`;
|
|
115
|
-
$591f3ccba6339bdb$export$7f6ea68ad4b1fa69 = `ISsn1a_spectrum-Checkbox-partialCheckmark`;
|
|
116
|
-
$591f3ccba6339bdb$export$4109102f950813a6 = `ISsn1a_spectrum-FocusRing-ring`;
|
|
117
|
-
$591f3ccba6339bdb$export$24c7f46a6e3605dd = `ISsn1a_spectrum-FocusRing ${$591f3ccba6339bdb$export$4109102f950813a6}`;
|
|
118
|
-
$591f3ccba6339bdb$export$2927016961429360 = `ISsn1a_spectrum-FocusRing--quiet`;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
function $096ccd12d23dd6cc$var$Checkbox(props, ref) {
|
|
127
|
-
let originalProps = props;
|
|
128
|
-
props = (0, $5Ft2u$reactspectrumprovider.useProviderProps)(props);
|
|
129
|
-
props = (0, $5Ft2u$reactspectrumform.useFormProps)(props);
|
|
130
|
-
let { isIndeterminate: isIndeterminate = false, isEmphasized: isEmphasized = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
|
|
131
|
-
let { styleProps: styleProps } = (0, $5Ft2u$reactspectrumutils.useStyleProps)(otherProps);
|
|
132
|
-
let inputRef = (0, $5Ft2u$react.useRef)(null);
|
|
133
|
-
let domRef = (0, $5Ft2u$reactspectrumutils.useFocusableRef)(ref, inputRef);
|
|
134
|
-
// Swap hooks depending on whether this checkbox is inside a CheckboxGroup.
|
|
135
|
-
// This is a bit unorthodox. Typically, hooks cannot be called in a conditional,
|
|
136
|
-
// but since the checkbox won't move in and out of a group, it should be safe.
|
|
137
|
-
let groupState = (0, $5Ft2u$react.useContext)((0, $bdf3bf7fe71fe120$export$baf37c4be89255b8));
|
|
138
|
-
let { inputProps: inputProps, isInvalid: isInvalid, isDisabled: isDisabled } = groupState ? (0, $5Ft2u$reactariacheckbox.useCheckboxGroupItem)({
|
|
139
|
-
...props,
|
|
140
|
-
// Value is optional for standalone checkboxes, but required for CheckboxGroup items;
|
|
141
|
-
// it's passed explicitly here to avoid typescript error (requires ignore).
|
|
142
|
-
// @ts-ignore
|
|
143
|
-
value: props.value,
|
|
144
|
-
// Only pass isRequired and validationState to react-aria if they came from
|
|
145
|
-
// the props for this individual checkbox, and not from the group via context.
|
|
146
|
-
isRequired: originalProps.isRequired,
|
|
147
|
-
validationState: originalProps.validationState,
|
|
148
|
-
isInvalid: originalProps.isInvalid
|
|
149
|
-
}, groupState, inputRef) : (0, $5Ft2u$reactariacheckbox.useCheckbox)(props, (0, $5Ft2u$reactstatelytoggle.useToggleState)(props), inputRef);
|
|
150
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $5Ft2u$reactariainteractions.useHover)({
|
|
151
|
-
isDisabled: isDisabled
|
|
152
|
-
});
|
|
153
|
-
let markIcon = isIndeterminate ? /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement((0, ($parcel$interopDefault($5Ft2u$spectrumiconsuiDashSmall))), {
|
|
154
|
-
UNSAFE_className: (0, $5Ft2u$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($591f3ccba6339bdb$exports))), "spectrum-Checkbox-partialCheckmark")
|
|
155
|
-
}) : /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement((0, ($parcel$interopDefault($5Ft2u$spectrumiconsuiCheckmarkSmall))), {
|
|
156
|
-
UNSAFE_className: (0, $5Ft2u$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($591f3ccba6339bdb$exports))), "spectrum-Checkbox-checkmark")
|
|
157
|
-
});
|
|
158
|
-
if (groupState) {
|
|
159
|
-
for (let key of [
|
|
160
|
-
"isSelected",
|
|
161
|
-
"defaultSelected",
|
|
162
|
-
"isEmphasized"
|
|
163
|
-
])if (originalProps[key] != null) console.warn(`${key} is unsupported on individual <Checkbox> elements within a <CheckboxGroup>. Please apply these props to the group instead.`);
|
|
164
|
-
if (props.value == null) console.warn("A <Checkbox> element within a <CheckboxGroup> requires a `value` property.");
|
|
165
|
-
}
|
|
166
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement("label", {
|
|
167
|
-
...styleProps,
|
|
168
|
-
...hoverProps,
|
|
169
|
-
ref: domRef,
|
|
170
|
-
className: (0, $5Ft2u$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($591f3ccba6339bdb$exports))), "spectrum-Checkbox", {
|
|
171
|
-
"is-checked": inputProps.checked,
|
|
172
|
-
"is-indeterminate": isIndeterminate,
|
|
173
|
-
"spectrum-Checkbox--quiet": !isEmphasized,
|
|
174
|
-
"is-invalid": isInvalid,
|
|
175
|
-
"is-disabled": isDisabled,
|
|
176
|
-
"is-hovered": isHovered
|
|
177
|
-
}, styleProps.className)
|
|
178
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement((0, $5Ft2u$reactariafocus.FocusRing), {
|
|
179
|
-
focusRingClass: (0, $5Ft2u$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($591f3ccba6339bdb$exports))), "focus-ring"),
|
|
180
|
-
autoFocus: autoFocus
|
|
181
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement("input", {
|
|
182
|
-
...inputProps,
|
|
183
|
-
ref: inputRef,
|
|
184
|
-
className: (0, $5Ft2u$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($591f3ccba6339bdb$exports))), "spectrum-Checkbox-input")
|
|
185
|
-
})), /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement("span", {
|
|
186
|
-
className: (0, $5Ft2u$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($591f3ccba6339bdb$exports))), "spectrum-Checkbox-box")
|
|
187
|
-
}, markIcon), children && /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement("span", {
|
|
188
|
-
className: (0, $5Ft2u$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($591f3ccba6339bdb$exports))), "spectrum-Checkbox-label")
|
|
189
|
-
}, children));
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Checkboxes allow users to select multiple items from a list of individual items,
|
|
193
|
-
* or to mark one individual item as selected.
|
|
194
|
-
*/ let $096ccd12d23dd6cc$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $5Ft2u$react.forwardRef)($096ccd12d23dd6cc$var$Checkbox);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
/*
|
|
198
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
199
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
200
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
201
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
202
|
-
*
|
|
203
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
204
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
205
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
206
|
-
* governing permissions and limitations under the License.
|
|
207
|
-
*/
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
var $53124a3a0fd56fca$exports = {};
|
|
213
|
-
|
|
214
|
-
$parcel$export($53124a3a0fd56fca$exports, "focus-ring", () => $53124a3a0fd56fca$export$f39a09f249340e2a, (v) => $53124a3a0fd56fca$export$f39a09f249340e2a = v);
|
|
215
|
-
$parcel$export($53124a3a0fd56fca$exports, "i18nFontFamily", () => $53124a3a0fd56fca$export$8c4ee2c50c22c514, (v) => $53124a3a0fd56fca$export$8c4ee2c50c22c514 = v);
|
|
216
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FieldGroup", () => $53124a3a0fd56fca$export$75eb16cbfc18279c, (v) => $53124a3a0fd56fca$export$75eb16cbfc18279c = v);
|
|
217
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FieldGroup-group", () => $53124a3a0fd56fca$export$984c7bbbfc7ddffc, (v) => $53124a3a0fd56fca$export$984c7bbbfc7ddffc = v);
|
|
218
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FieldGroup-group--horizontal", () => $53124a3a0fd56fca$export$1ad8646bcba21c0e, (v) => $53124a3a0fd56fca$export$1ad8646bcba21c0e = v);
|
|
219
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FocusRing-ring", () => $53124a3a0fd56fca$export$4109102f950813a6, (v) => $53124a3a0fd56fca$export$4109102f950813a6 = v);
|
|
220
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FocusRing", () => $53124a3a0fd56fca$export$24c7f46a6e3605dd, (v) => $53124a3a0fd56fca$export$24c7f46a6e3605dd = v);
|
|
221
|
-
$parcel$export($53124a3a0fd56fca$exports, "spectrum-FocusRing--quiet", () => $53124a3a0fd56fca$export$2927016961429360, (v) => $53124a3a0fd56fca$export$2927016961429360 = v);
|
|
222
|
-
var $53124a3a0fd56fca$export$f39a09f249340e2a;
|
|
223
|
-
var $53124a3a0fd56fca$export$8c4ee2c50c22c514;
|
|
224
|
-
var $53124a3a0fd56fca$export$75eb16cbfc18279c;
|
|
225
|
-
var $53124a3a0fd56fca$export$984c7bbbfc7ddffc;
|
|
226
|
-
var $53124a3a0fd56fca$export$1ad8646bcba21c0e;
|
|
227
|
-
var $53124a3a0fd56fca$export$4109102f950813a6;
|
|
228
|
-
var $53124a3a0fd56fca$export$24c7f46a6e3605dd;
|
|
229
|
-
var $53124a3a0fd56fca$export$2927016961429360;
|
|
230
|
-
$53124a3a0fd56fca$export$f39a09f249340e2a = `hyn22G_focus-ring`;
|
|
231
|
-
$53124a3a0fd56fca$export$8c4ee2c50c22c514 = `hyn22G_i18nFontFamily`;
|
|
232
|
-
$53124a3a0fd56fca$export$75eb16cbfc18279c = `hyn22G_spectrum-FieldGroup`;
|
|
233
|
-
$53124a3a0fd56fca$export$984c7bbbfc7ddffc = `hyn22G_spectrum-FieldGroup-group`;
|
|
234
|
-
$53124a3a0fd56fca$export$1ad8646bcba21c0e = `hyn22G_spectrum-FieldGroup-group--horizontal`;
|
|
235
|
-
$53124a3a0fd56fca$export$4109102f950813a6 = `hyn22G_spectrum-FocusRing-ring`;
|
|
236
|
-
$53124a3a0fd56fca$export$24c7f46a6e3605dd = `hyn22G_spectrum-FocusRing ${$53124a3a0fd56fca$export$4109102f950813a6}`;
|
|
237
|
-
$53124a3a0fd56fca$export$2927016961429360 = `hyn22G_spectrum-FocusRing--quiet`;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
function $1151290755e16c44$var$CheckboxGroup(props, ref) {
|
|
244
|
-
props = (0, $5Ft2u$reactspectrumprovider.useProviderProps)(props);
|
|
245
|
-
props = (0, $5Ft2u$reactspectrumform.useFormProps)(props);
|
|
246
|
-
let { isEmphasized: isEmphasized, children: children, orientation: orientation = "vertical" } = props;
|
|
247
|
-
let domRef = (0, $5Ft2u$reactspectrumutils.useDOMRef)(ref);
|
|
248
|
-
let state = (0, $5Ft2u$reactstatelycheckbox.useCheckboxGroupState)(props);
|
|
249
|
-
let { groupProps: groupProps, ...otherProps } = (0, $5Ft2u$reactariacheckbox.useCheckboxGroup)(props, state);
|
|
250
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement((0, $5Ft2u$reactspectrumlabel.Field), {
|
|
251
|
-
...props,
|
|
252
|
-
...otherProps,
|
|
253
|
-
ref: domRef,
|
|
254
|
-
wrapperClassName: (0, $5Ft2u$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($53124a3a0fd56fca$exports))), "spectrum-FieldGroup"),
|
|
255
|
-
elementType: "span",
|
|
256
|
-
includeNecessityIndicatorInAccessibilityName: true
|
|
257
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement("div", {
|
|
258
|
-
...groupProps,
|
|
259
|
-
className: (0, $5Ft2u$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($53124a3a0fd56fca$exports))), "spectrum-FieldGroup-group", {
|
|
260
|
-
"spectrum-FieldGroup-group--horizontal": orientation === "horizontal"
|
|
261
|
-
})
|
|
262
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement((0, $5Ft2u$reactspectrumprovider.Provider), {
|
|
263
|
-
isEmphasized: isEmphasized
|
|
264
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).createElement((0, $bdf3bf7fe71fe120$export$baf37c4be89255b8).Provider, {
|
|
265
|
-
value: state
|
|
266
|
-
}, children))));
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* A CheckboxGroup allows users to select one or more items from a list of choices.
|
|
270
|
-
*/ const $1151290755e16c44$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, ($parcel$interopDefault($5Ft2u$react))).forwardRef($1151290755e16c44$var$CheckboxGroup);
|
|
271
22
|
|
|
272
23
|
|
|
273
24
|
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C;ACX1C;;;;;;;;;;ACAA;;;;;;;;;;CAUC;AAKM,MAAM,4CAAuB,CAAA,GAAA,sCAAI,EAAE,aAAa,CAA4B;;CDLlF;;;;;;;;;;;;;;;;;;;;;;;;;AEVD,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;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAhBA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,2CAAqC,CAAC,uBAAuB,CAAC;AAC9D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAsC,CAAC,wBAAwB,CAAC;AAChE,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuD,CAAC,yCAAyC,CAAC;AAClG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;;;;;;;;AFWhF,SAAS,+BAAS,KAA4B,EAAE,GAAmC;IACjF,IAAI,gBAAgB;IACpB,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,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAElC,2EAA2E;IAC3E,gFAAgF;IAChF,8EAA8E;IAC9E,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,yCAAmB;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,gEAAK,GAAG;uBAChD,0DAAC,CAAA,GAAA,8DAAa;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;;IAEzD,IAAI,YAAY;QACd,KAAK,IAAI,OAAO;YAAC;YAAc;YAAmB;SAAe,CAC/D,IAAI,aAAa,CAAC,IAAI,IAAI,MACxB,QAAQ,IAAI,CAAC,CAAC,EAAE,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,gEAAK,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,gEAAK,GAAG;QAAe,WAAW;qBACtE,0DAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;uBAElC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;OAA2B,WAC9D,0BACC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;OACjC;AAKX;AACA;;;CAGC,GACD,IAAI,0DAAY,CAAA,GAAA,uBAAS,EAAE;;;AGxH3B;;;;;;;;;;CAUC;;;;;;;;;;;;;;;ACVD,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;;;;;;ADiBhF,SAAS,oCAAc,KAAiC,EAAE,GAA2B;IACnF,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,gEAAK,GAAG;QACrC,aAAY;QACZ,8CAAA;qBACA,0DAAC;QACE,GAAG,UAAU;QACd,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,gEAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,0DAAC,CAAA,GAAA,qCAAO;QAAE,cAAc;qBACtB,0DAAC,CAAA,GAAA,yCAAmB,EAAE,QAAQ;QAAC,OAAO;OACnC;AAMb;AAEA;;CAEC,GACD,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;;","sources":["packages/@react-spectrum/checkbox/src/index.ts","packages/@react-spectrum/checkbox/src/Checkbox.tsx","packages/@react-spectrum/checkbox/src/context.ts","packages/@adobe/spectrum-css-temp/components/checkbox/vars.css","packages/@react-spectrum/checkbox/src/CheckboxGroup.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/// <reference types=\"css-module-types\" />\nexport {Checkbox} from './Checkbox';\nexport {CheckboxGroup} from './CheckboxGroup';\nexport type {SpectrumCheckboxProps, SpectrumCheckboxGroupProps} from '@react-types/checkbox';\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 {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\nfunction Checkbox(props: SpectrumCheckboxProps, ref: FocusableRef<HTMLLabelElement>) {\n let originalProps = props;\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 let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\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) {\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/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nlet _Checkbox = forwardRef(Checkbox);\nexport {_Checkbox as Checkbox};\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 {CheckboxGroupState} from '@react-stately/checkbox';\nimport React from 'react';\n\nexport const CheckboxGroupContext = React.createContext<CheckboxGroupState | null>(null);\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 {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\nfunction 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\n/**\n * A CheckboxGroup allows users to select one or more items from a list of choices.\n */\nconst _CheckboxGroup = React.forwardRef(CheckboxGroup);\nexport {_CheckboxGroup as CheckboxGroup};\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;;;;;;;;;;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 './Checkbox';\nexport {CheckboxGroup} from './CheckboxGroup';\nexport type {SpectrumCheckboxProps, SpectrumCheckboxGroupProps} from '@react-types/checkbox';\n"],"names":[],"version":3,"file":"main.js.map"}
|