@react-spectrum/checkbox 3.9.10 → 3.9.12
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 +3 -7
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +4 -8
- package/dist/Checkbox.module.js +4 -8
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/CheckboxGroup.main.js +2 -5
- package/dist/CheckboxGroup.main.js.map +1 -1
- package/dist/CheckboxGroup.mjs +2 -5
- package/dist/CheckboxGroup.module.js +2 -5
- package/dist/CheckboxGroup.module.js.map +1 -1
- package/dist/checkbox_vars_css.main.js.map +1 -1
- package/dist/checkbox_vars_css.module.js.map +1 -1
- package/dist/fieldgroup_vars_css.main.js.map +1 -1
- package/dist/fieldgroup_vars_css.module.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/{vars.a2ced2df.css → vars.b0b62fb7.css} +2 -2
- package/dist/{vars.a2ced2df.css.map → vars.b0b62fb7.css.map} +1 -1
- package/package.json +15 -15
- package/src/Checkbox.tsx +6 -8
- package/src/CheckboxGroup.tsx +5 -8
package/dist/Checkbox.main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var $bdf3bf7fe71fe120$exports = require("./context.main.js");
|
|
2
|
-
require("./vars.
|
|
2
|
+
require("./vars.b0b62fb7.css");
|
|
3
3
|
var $591f3ccba6339bdb$exports = require("./checkbox_vars_css.main.js");
|
|
4
4
|
var $lfSyy$reactariacomponents = require("react-aria-components");
|
|
5
5
|
var $lfSyy$spectrumiconsuiCheckmarkSmall = require("@spectrum-icons/ui/CheckmarkSmall");
|
|
@@ -46,7 +46,7 @@ $parcel$export(module.exports, "Checkbox", () => $096ccd12d23dd6cc$export$48513f
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
const $096ccd12d23dd6cc$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $lfSyy$react.forwardRef)(function Checkbox(props, ref) {
|
|
50
50
|
let originalProps = props;
|
|
51
51
|
let inputRef = (0, $lfSyy$react.useRef)(null);
|
|
52
52
|
let domRef = (0, $lfSyy$reactspectrumutils.useFocusableRef)(ref, inputRef);
|
|
@@ -111,11 +111,7 @@ function $096ccd12d23dd6cc$var$Checkbox(props, ref) {
|
|
|
111
111
|
}, markIcon), children && /*#__PURE__*/ (0, ($parcel$interopDefault($lfSyy$react))).createElement("span", {
|
|
112
112
|
className: (0, $lfSyy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($591f3ccba6339bdb$exports))), 'spectrum-Checkbox-label')
|
|
113
113
|
}, children));
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Checkboxes allow users to select multiple items from a list of individual items,
|
|
117
|
-
* or to mark one individual item as selected.
|
|
118
|
-
*/ let $096ccd12d23dd6cc$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $lfSyy$react.forwardRef)($096ccd12d23dd6cc$var$Checkbox);
|
|
114
|
+
});
|
|
119
115
|
|
|
120
116
|
|
|
121
117
|
//# sourceMappingURL=Checkbox.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;
|
|
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,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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) {\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
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {CheckboxGroupContext as $8c8ab388b155237e$export$baf37c4be89255b8} from "./context.mjs";
|
|
2
|
-
import "./vars.
|
|
2
|
+
import "./vars.b0b62fb7.css";
|
|
3
3
|
import $cvQES$checkbox_vars_cssmodulejs from "./checkbox_vars_css.mjs";
|
|
4
4
|
import {useContextProps as $cvQES$useContextProps, CheckboxContext as $cvQES$CheckboxContext} from "react-aria-components";
|
|
5
5
|
import $cvQES$spectrumiconsuiCheckmarkSmall from "@spectrum-icons/ui/CheckmarkSmall";
|
|
6
6
|
import {useFocusableRef as $cvQES$useFocusableRef, useStyleProps as $cvQES$useStyleProps, classNames as $cvQES$classNames} from "@react-spectrum/utils";
|
|
7
7
|
import $cvQES$spectrumiconsuiDashSmall from "@spectrum-icons/ui/DashSmall";
|
|
8
8
|
import {FocusRing as $cvQES$FocusRing} from "@react-aria/focus";
|
|
9
|
-
import $cvQES$react, {
|
|
9
|
+
import $cvQES$react, {forwardRef as $cvQES$forwardRef, useRef as $cvQES$useRef, useContext as $cvQES$useContext} from "react";
|
|
10
10
|
import {useCheckboxGroupItem as $cvQES$useCheckboxGroupItem, useCheckbox as $cvQES$useCheckbox} from "@react-aria/checkbox";
|
|
11
11
|
import {useFormProps as $cvQES$useFormProps} from "@react-spectrum/form";
|
|
12
12
|
import {useHover as $cvQES$useHover} from "@react-aria/interactions";
|
|
@@ -40,7 +40,7 @@ function $parcel$interopDefault(a) {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
const $25b6292d81af2844$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $cvQES$forwardRef)(function Checkbox(props, ref) {
|
|
44
44
|
let originalProps = props;
|
|
45
45
|
let inputRef = (0, $cvQES$useRef)(null);
|
|
46
46
|
let domRef = (0, $cvQES$useFocusableRef)(ref, inputRef);
|
|
@@ -105,11 +105,7 @@ function $25b6292d81af2844$var$Checkbox(props, ref) {
|
|
|
105
105
|
}, markIcon), children && /*#__PURE__*/ (0, $cvQES$react).createElement("span", {
|
|
106
106
|
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-label')
|
|
107
107
|
}, children));
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Checkboxes allow users to select multiple items from a list of individual items,
|
|
111
|
-
* or to mark one individual item as selected.
|
|
112
|
-
*/ let $25b6292d81af2844$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $cvQES$forwardRef)($25b6292d81af2844$var$Checkbox);
|
|
108
|
+
});
|
|
113
109
|
|
|
114
110
|
|
|
115
111
|
export {$25b6292d81af2844$export$48513f6b9f8ce62d as Checkbox};
|
package/dist/Checkbox.module.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {CheckboxGroupContext as $8c8ab388b155237e$export$baf37c4be89255b8} from "./context.module.js";
|
|
2
|
-
import "./vars.
|
|
2
|
+
import "./vars.b0b62fb7.css";
|
|
3
3
|
import $cvQES$checkbox_vars_cssmodulejs from "./checkbox_vars_css.module.js";
|
|
4
4
|
import {useContextProps as $cvQES$useContextProps, CheckboxContext as $cvQES$CheckboxContext} from "react-aria-components";
|
|
5
5
|
import $cvQES$spectrumiconsuiCheckmarkSmall from "@spectrum-icons/ui/CheckmarkSmall";
|
|
6
6
|
import {useFocusableRef as $cvQES$useFocusableRef, useStyleProps as $cvQES$useStyleProps, classNames as $cvQES$classNames} from "@react-spectrum/utils";
|
|
7
7
|
import $cvQES$spectrumiconsuiDashSmall from "@spectrum-icons/ui/DashSmall";
|
|
8
8
|
import {FocusRing as $cvQES$FocusRing} from "@react-aria/focus";
|
|
9
|
-
import $cvQES$react, {
|
|
9
|
+
import $cvQES$react, {forwardRef as $cvQES$forwardRef, useRef as $cvQES$useRef, useContext as $cvQES$useContext} from "react";
|
|
10
10
|
import {useCheckboxGroupItem as $cvQES$useCheckboxGroupItem, useCheckbox as $cvQES$useCheckbox} from "@react-aria/checkbox";
|
|
11
11
|
import {useFormProps as $cvQES$useFormProps} from "@react-spectrum/form";
|
|
12
12
|
import {useHover as $cvQES$useHover} from "@react-aria/interactions";
|
|
@@ -40,7 +40,7 @@ function $parcel$interopDefault(a) {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
const $25b6292d81af2844$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $cvQES$forwardRef)(function Checkbox(props, ref) {
|
|
44
44
|
let originalProps = props;
|
|
45
45
|
let inputRef = (0, $cvQES$useRef)(null);
|
|
46
46
|
let domRef = (0, $cvQES$useFocusableRef)(ref, inputRef);
|
|
@@ -105,11 +105,7 @@ function $25b6292d81af2844$var$Checkbox(props, ref) {
|
|
|
105
105
|
}, markIcon), children && /*#__PURE__*/ (0, $cvQES$react).createElement("span", {
|
|
106
106
|
className: (0, $cvQES$classNames)((0, ($parcel$interopDefault($cvQES$checkbox_vars_cssmodulejs))), 'spectrum-Checkbox-label')
|
|
107
107
|
}, children));
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Checkboxes allow users to select multiple items from a list of individual items,
|
|
111
|
-
* or to mark one individual item as selected.
|
|
112
|
-
*/ let $25b6292d81af2844$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $cvQES$forwardRef)($25b6292d81af2844$var$Checkbox);
|
|
108
|
+
});
|
|
113
109
|
|
|
114
110
|
|
|
115
111
|
export {$25b6292d81af2844$export$48513f6b9f8ce62d as Checkbox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;
|
|
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;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C,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) {\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"}
|
|
@@ -38,7 +38,7 @@ $parcel$export(module.exports, "CheckboxGroup", () => $1151290755e16c44$export$4
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const $1151290755e16c44$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, ($parcel$interopDefault($5yQLk$react))).forwardRef(function CheckboxGroup(props, ref) {
|
|
42
42
|
props = (0, $5yQLk$reactspectrumprovider.useProviderProps)(props);
|
|
43
43
|
props = (0, $5yQLk$reactspectrumform.useFormProps)(props);
|
|
44
44
|
let { isEmphasized: isEmphasized, children: children, orientation: orientation = 'vertical' } = props;
|
|
@@ -62,10 +62,7 @@ function $1151290755e16c44$var$CheckboxGroup(props, ref) {
|
|
|
62
62
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5yQLk$react))).createElement((0, $bdf3bf7fe71fe120$exports.CheckboxGroupContext).Provider, {
|
|
63
63
|
value: state
|
|
64
64
|
}, children))));
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* A CheckboxGroup allows users to select one or more items from a list of choices.
|
|
68
|
-
*/ const $1151290755e16c44$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, ($parcel$interopDefault($5yQLk$react))).forwardRef($1151290755e16c44$var$CheckboxGroup);
|
|
65
|
+
});
|
|
69
66
|
|
|
70
67
|
|
|
71
68
|
//# sourceMappingURL=CheckboxGroup.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;
|
|
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"}
|
package/dist/CheckboxGroup.mjs
CHANGED
|
@@ -32,7 +32,7 @@ function $parcel$interopDefault(a) {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
const $73f43ce9d441cc69$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, $8sUxO$react).forwardRef(function CheckboxGroup(props, ref) {
|
|
36
36
|
props = (0, $8sUxO$useProviderProps)(props);
|
|
37
37
|
props = (0, $8sUxO$useFormProps)(props);
|
|
38
38
|
let { isEmphasized: isEmphasized, children: children, orientation: orientation = 'vertical' } = props;
|
|
@@ -56,10 +56,7 @@ function $73f43ce9d441cc69$var$CheckboxGroup(props, ref) {
|
|
|
56
56
|
}, /*#__PURE__*/ (0, $8sUxO$react).createElement((0, $8c8ab388b155237e$export$baf37c4be89255b8).Provider, {
|
|
57
57
|
value: state
|
|
58
58
|
}, children))));
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* A CheckboxGroup allows users to select one or more items from a list of choices.
|
|
62
|
-
*/ const $73f43ce9d441cc69$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, $8sUxO$react).forwardRef($73f43ce9d441cc69$var$CheckboxGroup);
|
|
59
|
+
});
|
|
63
60
|
|
|
64
61
|
|
|
65
62
|
export {$73f43ce9d441cc69$export$4aa08d5625cb8ead as CheckboxGroup};
|
|
@@ -32,7 +32,7 @@ function $parcel$interopDefault(a) {
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
const $73f43ce9d441cc69$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, $8sUxO$react).forwardRef(function CheckboxGroup(props, ref) {
|
|
36
36
|
props = (0, $8sUxO$useProviderProps)(props);
|
|
37
37
|
props = (0, $8sUxO$useFormProps)(props);
|
|
38
38
|
let { isEmphasized: isEmphasized, children: children, orientation: orientation = 'vertical' } = props;
|
|
@@ -56,10 +56,7 @@ function $73f43ce9d441cc69$var$CheckboxGroup(props, ref) {
|
|
|
56
56
|
}, /*#__PURE__*/ (0, $8sUxO$react).createElement((0, $8c8ab388b155237e$export$baf37c4be89255b8).Provider, {
|
|
57
57
|
value: state
|
|
58
58
|
}, children))));
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* A CheckboxGroup allows users to select one or more items from a list of choices.
|
|
62
|
-
*/ const $73f43ce9d441cc69$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, $8sUxO$react).forwardRef($73f43ce9d441cc69$var$CheckboxGroup);
|
|
59
|
+
});
|
|
63
60
|
|
|
64
61
|
|
|
65
62
|
export {$73f43ce9d441cc69$export$4aa08d5625cb8ead as CheckboxGroup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,cAAc,KAAiC,EAAE,GAA2B;IACjI,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,gBACF,YAAY,YACZ,QAAQ,eACR,cAAc,YACf,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,QAAQ,CAAA,GAAA,4BAAoB,EAAE;IAClC,IAAI,cAAC,UAAU,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,uBAAe,EAAE,OAAO;IAE1D,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACR,GAAG,UAAU;QACd,KAAK;QACL,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAK,GAAG;QACrC,aAAY;QACZ,8CAAA;qBACA,gCAAC;QACE,GAAG,UAAU;QACd,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,4DAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,gCAAC,CAAA,GAAA,eAAO;QAAE,cAAc;qBACtB,gCAAC,CAAA,GAAA,yCAAmB,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.module.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,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,kBAAkB,CAAC;AACnD,4CAAmC,CAAC,sBAAsB,CAAC;AAC3D,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,4CAAgC,CAAC,mBAAmB,CAAC;AACrD,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,2CAAqC,CAAC,wBAAwB,CAAC;AAC/D,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,4CAAsC,CAAC,yBAAyB,CAAC;AACjE,4CAA6C,CAAC,gCAAgC,CAAC;AAC/E,4CAA0C,CAAC,6BAA6B,CAAC;AACzE,4CAAgD,CAAC,mCAAmC,CAAC;AACrF,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAAuD,CAAC,0CAA0C,CAAC;AACnG,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAAuC,CAAC,2BAA2B,EAAE,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,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,kBAAkB,CAAC;AACnD,4CAAmC,CAAC,sBAAsB,CAAC;AAC3D,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,4CAAgC,CAAC,mBAAmB,CAAC;AACrD,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,2CAAqC,CAAC,wBAAwB,CAAC;AAC/D,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,4CAAsC,CAAC,yBAAyB,CAAC;AACjE,4CAA6C,CAAC,gCAAgC,CAAC;AAC/E,4CAA0C,CAAC,6BAA6B,CAAC;AACzE,4CAAgD,CAAC,mCAAmC,CAAC;AACrF,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAAuD,CAAC,0CAA0C,CAAC;AACnG,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAAuC,CAAC,2BAA2B,EAAE,2CAA2C;AAChH,4CAA8C,CAAC,iCAAiC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/checkbox/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"checkbox_vars_css.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA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AC;AACjE,4CAA6C,CAAC,gCAAgC,CAAC;AAC/E,4CAA0C,CAAC,6BAA6B,CAAC;AACzE,4CAAgD,CAAC,mCAAmC,CAAC;AACrF,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAAuD,CAAC,0CAA0C,CAAC;AACnG,4CAA4C,CAAC,+BAA+B,CAAC;AAC7E,4CAAuC,CAAC,2BAA2B,EAAE,2CAA2C;AAChH,4CAA8C,CAAC,iCAAiC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/checkbox/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"checkbox_vars_css.module.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAPA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAwC,CAAC,0BAA0B,CAAC;AACpE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0D,CAAC,4CAA4C,CAAC;AACxG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAPA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAwC,CAAC,0BAA0B,CAAC;AACpE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0D,CAAC,4CAA4C,CAAC;AACxG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/fieldgroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n"],"names":[],"version":3,"file":"fieldgroup_vars_css.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAPA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAwC,CAAC,0BAA0B,CAAC;AACpE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0D,CAAC,4CAA4C,CAAC;AACxG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAPA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAwC,CAAC,0BAA0B,CAAC;AACpE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0D,CAAC,4CAA4C,CAAC;AACxG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/fieldgroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n"],"names":[],"version":3,"file":"fieldgroup_vars_css.module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { FocusableRefValue, DOMRefValue } from "@react-types/shared";
|
|
|
5
5
|
* Checkboxes allow users to select multiple items from a list of individual items,
|
|
6
6
|
* or to mark one individual item as selected.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export const Checkbox: React.ForwardRefExoticComponent<SpectrumCheckboxProps & React.RefAttributes<FocusableRefValue<HTMLLabelElement, HTMLLabelElement>>>;
|
|
9
9
|
/**
|
|
10
10
|
* A CheckboxGroup allows users to select one or more items from a list of choices.
|
|
11
11
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;
|
|
1
|
+
{"mappings":";;;AC4BA;;;GAGG;AACH,OAAO,MAAM,6IAyFX,CAAC;ACjGH;;GAEG;AACH,OAAO,MAAM,6HAuCX,CAAC;ACpDH,YAAY,EAAC,qBAAqB,EAAE,0BAA0B,EAAC,MAAM,uBAAuB,CAAC","sources":["packages/@react-spectrum/checkbox/src/packages/@react-spectrum/checkbox/src/context.ts","packages/@react-spectrum/checkbox/src/packages/@react-spectrum/checkbox/src/Checkbox.tsx","packages/@react-spectrum/checkbox/src/packages/@react-spectrum/checkbox/src/CheckboxGroup.tsx","packages/@react-spectrum/checkbox/src/packages/@react-spectrum/checkbox/src/index.ts","packages/@react-spectrum/checkbox/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/// <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":"types.d.ts.map"}
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
min-block-size: var(--spectrum-checkbox-height, var(--spectrum-global-dimension-size-400));
|
|
84
84
|
vertical-align: top;
|
|
85
85
|
isolation: isolate;
|
|
86
|
-
align-items: flex-start;
|
|
87
86
|
max-inline-size: 100%;
|
|
87
|
+
align-items: flex-start;
|
|
88
88
|
padding-inline-end: calc(var(--spectrum-checkbox-cursor-hit-x, var(--spectrum-global-dimension-size-100)) * 2);
|
|
89
89
|
display: inline-flex;
|
|
90
90
|
position: relative;
|
|
@@ -484,4 +484,4 @@
|
|
|
484
484
|
--spectrum-alias-toggle-color-selected: ButtonText;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
/*# sourceMappingURL=vars.
|
|
487
|
+
/*# sourceMappingURL=vars.b0b62fb7.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;;;;AAiBA;;;;;;;;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AA8BE;;;;AAMI;;;;AASF;;;;AAIA;;;;AAIA;;;;;;AAWA;;;;AAKA;;;;;AAOJ;;;;;;;;;AASA;;;;;;;;;;AAaE;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;AAiBF;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAeA;;;;AAgBA;;;;;;;;;;;;;;;;;;;;AAyBE;;;;AAME;;;;;AAMF;;;;AAQI;;;;AAQA;;;;AAIF;;;;AAKE;;;;AAQA;;;;AAIF;;;;AAKE;;;;AAUA;;;;;AAMF;;;;AANE;;;;;AAMF;;;;AAWI;;;;;AAMF;;;;AANE;;;;;AAMF;;;;AASE;;;;;AAKF;;;;AALE;;;;;AAKF;;;;AAWA;;;;;AAMA;;;;AAGA;;;;AAME;;;;AAKJ;;;;AAQI;;;;AAWF;;;;AAQE;;;;AASA;;;;AAcF;;;;AAKF;;;;AAOI;;;;AAKF;;;;AALE;;;;AAKF;;;;AASE;;;;AAKF;;;;AAQE;;;;AAKF;;;;AAON;EACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CE","sources":["packages/@adobe/spectrum-css-temp/components/checkbox/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.
|
|
1
|
+
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;;;;AAiBA;;;;;;;;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AA8BE;;;;AAMI;;;;AASF;;;;AAIA;;;;AAIA;;;;;;AAWA;;;;AAKA;;;;;AAOJ;;;;;;;;;AASA;;;;;;;;;;AAaE;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;AAiBF;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAeA;;;;AAgBA;;;;;;;;;;;;;;;;;;;;AAyBE;;;;AAME;;;;;AAMF;;;;AAQI;;;;AAQA;;;;AAIF;;;;AAKE;;;;AAQA;;;;AAIF;;;;AAKE;;;;AAUA;;;;;AAMF;;;;AANE;;;;;AAMF;;;;AAWI;;;;;AAMF;;;;AANE;;;;;AAMF;;;;AASE;;;;;AAKF;;;;AALE;;;;;AAKF;;;;AAWA;;;;;AAMA;;;;AAGA;;;;AAME;;;;AAKJ;;;;AAQI;;;;AAWF;;;;AAQE;;;;AASA;;;;AAcF;;;;AAKF;;;;AAOI;;;;AAKF;;;;AALE;;;;AAKF;;;;AASE;;;;AAKF;;;;AAQE;;;;AAKF;;;;AAON;EACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CE","sources":["packages/@adobe/spectrum-css-temp/components/checkbox/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.b0b62fb7.css.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/checkbox",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.12",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/checkbox": "^3.
|
|
40
|
-
"@react-aria/focus": "^3.
|
|
41
|
-
"@react-aria/interactions": "^3.
|
|
42
|
-
"@react-spectrum/form": "^3.7.
|
|
43
|
-
"@react-spectrum/label": "^3.16.
|
|
44
|
-
"@react-spectrum/utils": "^3.
|
|
45
|
-
"@react-stately/checkbox": "^3.6.
|
|
46
|
-
"@react-stately/toggle": "^3.
|
|
47
|
-
"@react-types/checkbox": "^3.
|
|
48
|
-
"@react-types/shared": "^3.
|
|
49
|
-
"@spectrum-icons/ui": "^3.6.
|
|
39
|
+
"@react-aria/checkbox": "^3.15.1",
|
|
40
|
+
"@react-aria/focus": "^3.19.1",
|
|
41
|
+
"@react-aria/interactions": "^3.23.0",
|
|
42
|
+
"@react-spectrum/form": "^3.7.11",
|
|
43
|
+
"@react-spectrum/label": "^3.16.11",
|
|
44
|
+
"@react-spectrum/utils": "^3.12.1",
|
|
45
|
+
"@react-stately/checkbox": "^3.6.11",
|
|
46
|
+
"@react-stately/toggle": "^3.8.1",
|
|
47
|
+
"@react-types/checkbox": "^3.9.1",
|
|
48
|
+
"@react-types/shared": "^3.27.0",
|
|
49
|
+
"@spectrum-icons/ui": "^3.6.12",
|
|
50
50
|
"@swc/helpers": "^0.5.0",
|
|
51
|
-
"react-aria-components": "^1.
|
|
51
|
+
"react-aria-components": "^1.6.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@react-spectrum/provider": "^3.0.0",
|
|
59
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
59
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
|
|
65
65
|
}
|
package/src/Checkbox.tsx
CHANGED
|
@@ -26,7 +26,11 @@ import {useHover} from '@react-aria/interactions';
|
|
|
26
26
|
import {useProviderProps} from '@react-spectrum/provider';
|
|
27
27
|
import {useToggleState} from '@react-stately/toggle';
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Checkboxes allow users to select multiple items from a list of individual items,
|
|
31
|
+
* or to mark one individual item as selected.
|
|
32
|
+
*/
|
|
33
|
+
export const Checkbox = forwardRef(function Checkbox(props: SpectrumCheckboxProps, ref: FocusableRef<HTMLLabelElement>) {
|
|
30
34
|
let originalProps = props;
|
|
31
35
|
let inputRef = useRef<HTMLInputElement>(null);
|
|
32
36
|
let domRef = useFocusableRef(ref, inputRef);
|
|
@@ -115,10 +119,4 @@ function Checkbox(props: SpectrumCheckboxProps, ref: FocusableRef<HTMLLabelEleme
|
|
|
115
119
|
)}
|
|
116
120
|
</label>
|
|
117
121
|
);
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Checkboxes allow users to select multiple items from a list of individual items,
|
|
121
|
-
* or to mark one individual item as selected.
|
|
122
|
-
*/
|
|
123
|
-
let _Checkbox = forwardRef(Checkbox);
|
|
124
|
-
export {_Checkbox as Checkbox};
|
|
122
|
+
});
|
package/src/CheckboxGroup.tsx
CHANGED
|
@@ -22,7 +22,10 @@ import {useCheckboxGroup} from '@react-aria/checkbox';
|
|
|
22
22
|
import {useCheckboxGroupState} from '@react-stately/checkbox';
|
|
23
23
|
import {useFormProps} from '@react-spectrum/form';
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* A CheckboxGroup allows users to select one or more items from a list of choices.
|
|
27
|
+
*/
|
|
28
|
+
export const CheckboxGroup = React.forwardRef(function CheckboxGroup(props: SpectrumCheckboxGroupProps, ref: DOMRef<HTMLDivElement>) {
|
|
26
29
|
props = useProviderProps(props);
|
|
27
30
|
props = useFormProps(props);
|
|
28
31
|
let {
|
|
@@ -61,10 +64,4 @@ function CheckboxGroup(props: SpectrumCheckboxGroupProps, ref: DOMRef<HTMLDivEle
|
|
|
61
64
|
</div>
|
|
62
65
|
</Field>
|
|
63
66
|
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* A CheckboxGroup allows users to select one or more items from a list of choices.
|
|
68
|
-
*/
|
|
69
|
-
const _CheckboxGroup = React.forwardRef(CheckboxGroup);
|
|
70
|
-
export {_CheckboxGroup as CheckboxGroup};
|
|
67
|
+
});
|