@react-aria/checkbox 3.2.3 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,149 +1,115 @@
1
- var {
2
- useToggleState
3
- } = require("@react-stately/toggle");
1
+ var $csc5b$react = require("react");
2
+ var $csc5b$reactariatoggle = require("@react-aria/toggle");
3
+ var $csc5b$reactariautils = require("@react-aria/utils");
4
+ var $csc5b$reactarialabel = require("@react-aria/label");
5
+ var $csc5b$reactstatelytoggle = require("@react-stately/toggle");
6
+
7
+ function $parcel$exportWildcard(dest, source) {
8
+ Object.keys(source).forEach(function(key) {
9
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
10
+ return;
11
+ }
4
12
 
5
- var {
6
- useLabel
7
- } = require("@react-aria/label");
13
+ Object.defineProperty(dest, key, {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return source[key];
17
+ }
18
+ });
19
+ });
8
20
 
9
- var {
10
- filterDOMProps,
11
- mergeProps
12
- } = require("@react-aria/utils");
21
+ return dest;
22
+ }
23
+ function $parcel$export(e, n, v, s) {
24
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
25
+ }
26
+ var $8e3a8695775dae64$exports = {};
27
+
28
+ $parcel$export($8e3a8695775dae64$exports, "useCheckbox", () => $8e3a8695775dae64$export$e375f10ce42261c5);
29
+
30
+
31
+ function $8e3a8695775dae64$export$e375f10ce42261c5(props, state, inputRef) {
32
+ let { inputProps: inputProps } = $csc5b$reactariatoggle.useToggle(props, state, inputRef);
33
+ let { isSelected: isSelected } = state;
34
+ let { isIndeterminate: isIndeterminate } = props;
35
+ $csc5b$react.useEffect(()=>{
36
+ // indeterminate is a property, but it can only be set via javascript
37
+ // https://css-tricks.com/indeterminate-checkboxes/
38
+ if (inputRef.current) inputRef.current.indeterminate = isIndeterminate;
39
+ });
40
+ return {
41
+ inputProps: {
42
+ ...inputProps,
43
+ checked: isSelected,
44
+ 'aria-checked': isIndeterminate ? 'mixed' : isSelected
45
+ }
46
+ };
47
+ }
13
48
 
14
- var {
15
- useToggle
16
- } = require("@react-aria/toggle");
17
49
 
18
- var {
19
- useEffect
20
- } = require("react");
50
+ var $236317cbe6d4d104$exports = {};
51
+
52
+ $parcel$export($236317cbe6d4d104$exports, "useCheckboxGroup", () => $236317cbe6d4d104$export$49ff6f28c54f1cbe);
53
+ const $494dde44f66cf558$export$31440636951aa68c = new WeakMap();
21
54
 
22
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
23
55
 
24
- function $parcel$interopDefault(a) {
25
- return a && a.__esModule ? a.default : a;
26
- }
27
56
 
28
- /**
29
- * Provides the behavior and accessibility implementation for a checkbox component.
30
- * Checkboxes allow users to select multiple items from a list of individual items, or
31
- * to mark one individual item as selected.
32
- * @param props - Props for the checkbox.
33
- * @param state - State for the checkbox, as returned by `useToggleState`.
34
- * @param inputRef - A ref for the HTML input element.
35
- */
36
- function useCheckbox(props, state, inputRef) {
37
- let {
38
- inputProps
39
- } = useToggle(props, state, inputRef);
40
- let {
41
- isSelected
42
- } = state;
43
- let {
44
- isIndeterminate
45
- } = props;
46
- useEffect(() => {
47
- // indeterminate is a property, but it can only be set via javascript
48
- // https://css-tricks.com/indeterminate-checkboxes/
49
- if (inputRef.current) {
50
- inputRef.current.indeterminate = isIndeterminate;
51
- }
52
- });
53
- return {
54
- inputProps: _babelRuntimeHelpersExtends({}, inputProps, {
55
- checked: isSelected,
56
- 'aria-checked': isIndeterminate ? 'mixed' : isSelected
57
- })
58
- };
59
- }
60
57
 
61
- exports.useCheckbox = useCheckbox;
62
-
63
- /*
64
- * Copyright 2020 Adobe. All rights reserved.
65
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
66
- * you may not use this file except in compliance with the License. You may obtain a copy
67
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
68
- *
69
- * Unless required by applicable law or agreed to in writing, software distributed under
70
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
71
- * OF ANY KIND, either express or implied. See the License for the specific language
72
- * governing permissions and limitations under the License.
73
- */
74
- const $f32b30d8fc9d5c8adba5193c65e11d$export$checkboxGroupNames = new WeakMap();
75
-
76
- /**
77
- * Provides the behavior and accessibility implementation for a checkbox group component.
78
- * Checkbox groups allow users to select multiple items from a list of options.
79
- * @param props - Props for the checkbox group.
80
- * @param state - State for the checkbox group, as returned by `useCheckboxGroupState`.
81
- */
82
- function useCheckboxGroup(props, state) {
83
- let {
84
- isDisabled,
85
- name
86
- } = props;
87
- let {
88
- labelProps,
89
- fieldProps
90
- } = useLabel(_babelRuntimeHelpersExtends({}, props, {
91
- // Checkbox group is not an HTML input element so it
92
- // shouldn't be labeled by a <label> element.
93
- labelElementType: 'span'
94
- }));
95
- let domProps = filterDOMProps(props, {
96
- labelable: true
97
- }); // Pass name prop from group to all items by attaching to the state.
98
-
99
- $f32b30d8fc9d5c8adba5193c65e11d$export$checkboxGroupNames.set(state, name);
100
- return {
101
- groupProps: mergeProps(domProps, _babelRuntimeHelpersExtends({
102
- role: 'group',
103
- 'aria-disabled': isDisabled || undefined
104
- }, fieldProps)),
105
- labelProps
106
- };
58
+ function $236317cbe6d4d104$export$49ff6f28c54f1cbe(props, state) {
59
+ let { isDisabled: isDisabled , name: name } = props;
60
+ let { labelProps: labelProps , fieldProps: fieldProps } = $csc5b$reactarialabel.useLabel({
61
+ ...props,
62
+ // Checkbox group is not an HTML input element so it
63
+ // shouldn't be labeled by a <label> element.
64
+ labelElementType: 'span'
65
+ });
66
+ let domProps = $csc5b$reactariautils.filterDOMProps(props, {
67
+ labelable: true
68
+ });
69
+ // Pass name prop from group to all items by attaching to the state.
70
+ $494dde44f66cf558$export$31440636951aa68c.set(state, name);
71
+ return {
72
+ groupProps: $csc5b$reactariautils.mergeProps(domProps, {
73
+ role: 'group',
74
+ 'aria-disabled': isDisabled || undefined,
75
+ ...fieldProps
76
+ }),
77
+ labelProps: labelProps
78
+ };
107
79
  }
108
80
 
109
- exports.useCheckboxGroup = useCheckboxGroup;
110
-
111
- /**
112
- * Provides the behavior and accessibility implementation for a checkbox component contained within a checkbox group.
113
- * Checkbox groups allow users to select multiple items from a list of options.
114
- * @param props - Props for the checkbox.
115
- * @param state - State for the checkbox, as returned by `useCheckboxGroupState`.
116
- * @param inputRef - A ref for the HTML input element.
117
- */
118
- function useCheckboxGroupItem(props, state, inputRef) {
119
- const toggleState = useToggleState({
120
- isReadOnly: props.isReadOnly || state.isReadOnly,
121
- isSelected: state.isSelected(props.value),
122
-
123
- onChange(isSelected) {
124
- if (isSelected) {
125
- state.addValue(props.value);
126
- } else {
127
- state.removeValue(props.value);
128
- }
129
81
 
130
- if (props.onChange) {
131
- props.onChange(isSelected);
132
- }
133
- }
82
+ var $40670ca1adde6ca2$exports = {};
134
83
 
135
- });
136
- let {
137
- inputProps
138
- } = useCheckbox(_babelRuntimeHelpersExtends({}, props, {
139
- isReadOnly: props.isReadOnly || state.isReadOnly,
140
- isDisabled: props.isDisabled || state.isDisabled,
141
- name: props.name || $f32b30d8fc9d5c8adba5193c65e11d$export$checkboxGroupNames.get(state)
142
- }), toggleState, inputRef);
143
- return {
144
- inputProps
145
- };
84
+ $parcel$export($40670ca1adde6ca2$exports, "useCheckboxGroupItem", () => $40670ca1adde6ca2$export$353b32fc6898d37d);
85
+
86
+
87
+
88
+ function $40670ca1adde6ca2$export$353b32fc6898d37d(props, state, inputRef) {
89
+ const toggleState = $csc5b$reactstatelytoggle.useToggleState({
90
+ isReadOnly: props.isReadOnly || state.isReadOnly,
91
+ isSelected: state.isSelected(props.value),
92
+ onChange (isSelected) {
93
+ if (isSelected) state.addValue(props.value);
94
+ else state.removeValue(props.value);
95
+ if (props.onChange) props.onChange(isSelected);
96
+ }
97
+ });
98
+ let { inputProps: inputProps } = $8e3a8695775dae64$export$e375f10ce42261c5({
99
+ ...props,
100
+ isReadOnly: props.isReadOnly || state.isReadOnly,
101
+ isDisabled: props.isDisabled || state.isDisabled,
102
+ name: props.name || $494dde44f66cf558$export$31440636951aa68c.get(state)
103
+ }, toggleState, inputRef);
104
+ return {
105
+ inputProps: inputProps
106
+ };
146
107
  }
147
108
 
148
- exports.useCheckboxGroupItem = useCheckboxGroupItem;
109
+
110
+ $parcel$exportWildcard(module.exports, $8e3a8695775dae64$exports);
111
+ $parcel$exportWildcard(module.exports, $236317cbe6d4d104$exports);
112
+ $parcel$exportWildcard(module.exports, $40670ca1adde6ca2$exports);
113
+
114
+
149
115
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;ACoBD;;;;;;;;AAQO,SAASG,WAAT,CAAqBC,KAArB,EAA+CC,KAA/C,EAAmEC,QAAnE,EAAwH;AAC7H,MAAI;AAACC,IAAAA;AAAD,MAAeC,SAAS,CAACJ,KAAD,EAAQC,KAAR,EAAeC,QAAf,CAA5B;AACA,MAAI;AAACG,IAAAA;AAAD,MAAeJ,KAAnB;AAEA,MAAI;AAACK,IAAAA;AAAD,MAAoBN,KAAxB;AACAO,EAAAA,SAAS,CAAC,MAAM;AACd;AACA;AACA,QAAIL,QAAQ,CAACM,OAAb,EAAsB;AACpBN,MAAAA,QAAQ,CAACM,OAAT,CAAiBC,aAAjB,GAAiCH,eAAjC;AACD;AACF,GANQ,CAAT;AAQA,SAAO;AACLH,IAAAA,UAAU,kCACLA,UADK;AAERO,MAAAA,OAAO,EAAEL,UAFD;AAGR,sBAAgBC,eAAe,GAAG,OAAH,GAAaD;AAHpC;AADL,GAAP;AAOD;;;;AClDD;;;;;;;;;;;AAcO,MAAMM,yDAAkB,GAAG,IAAIC,OAAJ,EAA3B;;ACYP;;;;;;A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AbgC,GAAD,CAAlC;AAgBA,MAAI;AAACF,IAAAA;AAAD,MAAe,4CACdH,KADc;AAEjB+B,IAAAA,UAAU,EAAE/B,KAAK,CAAC+B,UAAN,IAAoB9B,KAAK,CAAC8B,UAFrB;AAGjBjB,IAAAA,UAAU,EAAEd,KAAK,CAACc,UAAN,IAAoBb,KAAK,CAACa,UAHrB;AAIjBC,IAAAA,IAAI,EAAEf,KAAK,CAACe,IAAN,IAAc,0DAAmBqB,GAAnB,CAAuBnC,KAAvB;AAJH,MAKhB4B,WALgB,EAKH3B,QALG,CAAnB;AAOA,SAAO;AAACC,IAAAA;AAAD,GAAP;AACD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/@react-aria/checkbox/src/useCheckbox.ts","./packages/@react-aria/checkbox/src/utils.ts","./packages/@react-aria/checkbox/src/useCheckboxGroup.ts","./packages/@react-aria/checkbox/src/useCheckboxGroupItem.ts"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaCheckboxProps} from '@react-types/checkbox';\nimport {InputHTMLAttributes, RefObject, useEffect} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface CheckboxAria {\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useToggleState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckbox(props: AriaCheckboxProps, state: ToggleState, inputRef: RefObject<HTMLInputElement>): CheckboxAria {\n let {inputProps} = useToggle(props, state, inputRef);\n let {isSelected} = state;\n\n let {isIndeterminate} = props;\n useEffect(() => {\n // indeterminate is a property, but it can only be set via javascript\n // https://css-tricks.com/indeterminate-checkboxes/\n if (inputRef.current) {\n inputRef.current.indeterminate = isIndeterminate;\n }\n });\n\n return {\n inputProps: {\n ...inputProps,\n checked: isSelected,\n 'aria-checked': isIndeterminate ? 'mixed' : isSelected\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CheckboxGroupState} from '@react-stately/checkbox';\n\nexport const checkboxGroupNames = new WeakMap<CheckboxGroupState, string>();\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 {AriaCheckboxGroupProps} from '@react-types/checkbox';\nimport {checkboxGroupNames} from './utils';\nimport {CheckboxGroupState} from '@react-stately/checkbox';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\nimport {useLabel} from '@react-aria/label';\n\ninterface CheckboxGroupAria {\n /** Props for the checkbox group wrapper element. */\n groupProps: HTMLAttributes<HTMLElement>,\n /** Props for the checkbox group's visible label (if any). */\n labelProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox group component.\n * Checkbox groups allow users to select multiple items from a list of options.\n * @param props - Props for the checkbox group.\n * @param state - State for the checkbox group, as returned by `useCheckboxGroupState`.\n */\nexport function useCheckboxGroup(props: AriaCheckboxGroupProps, state: CheckboxGroupState): CheckboxGroupAria {\n let {isDisabled, name} = props;\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n // Checkbox group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n\n // Pass name prop from group to all items by attaching to the state.\n checkboxGroupNames.set(state, name);\n\n return {\n groupProps: mergeProps(domProps, {\n role: 'group',\n 'aria-disabled': isDisabled || undefined,\n ...fieldProps\n }),\n labelProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaCheckboxGroupItemProps} from '@react-types/checkbox';\nimport {CheckboxAria, useCheckbox} from './useCheckbox';\nimport {checkboxGroupNames} from './utils';\nimport {CheckboxGroupState} from '@react-stately/checkbox';\nimport {RefObject} from 'react';\nimport {useToggleState} from '@react-stately/toggle';\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component contained within a checkbox group.\n * Checkbox groups allow users to select multiple items from a list of options.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useCheckboxGroupState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckboxGroupItem(props: AriaCheckboxGroupItemProps, state: CheckboxGroupState, inputRef: RefObject<HTMLInputElement>): CheckboxAria {\n const toggleState = useToggleState({\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isSelected: state.isSelected(props.value),\n onChange(isSelected) {\n if (isSelected) {\n state.addValue(props.value);\n } else {\n state.removeValue(props.value);\n }\n\n if (props.onChange) {\n props.onChange(isSelected);\n }\n }\n });\n\n let {inputProps} = useCheckbox({\n ...props,\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isDisabled: props.isDisabled || state.isDisabled,\n name: props.name || checkboxGroupNames.get(state)\n }, toggleState, inputRef);\n\n return {inputProps};\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","useCheckbox","props","state","inputRef","inputProps","useToggle","isSelected","isIndeterminate","useEffect","current","indeterminate","checked","checkboxGroupNames","WeakMap","useCheckboxGroup","isDisabled","name","labelProps","fieldProps","useLabel","labelElementType","domProps","filterDOMProps","labelable","set","groupProps","mergeProps","role","undefined","useCheckboxGroupItem","toggleState","useToggleState","isReadOnly","value","onChange","addValue","removeValue","get"],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SC8BgB,yCAAW,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AAC,QAAQ,EAAE,CAAC;YAChC,IAAI,EAAE,CAAO;YACb,CAAe,gBAAE,UAAU,IAAI,SAAS;eACrC,UAAU;QACf,CAAC;oBACD,UAAU;IACZ,CAAC;AACH,CAAC;;;;;;;;;SE7Be,yCAAoB,CAAC,KAAiC,EAAE,KAAyB,EAAE,QAAqC,EAAgB,CAAC;IACvJ,KAAK,CAAC,WAAW,GAAG,wCAAc,CAAC,CAAC;QAClC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU;QAChD,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK;QACxC,QAAQ,EAAC,UAAU,EAAE,CAAC;YACpB,EAAE,EAAE,UAAU,EACZ,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK;iBAE1B,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK;YAG/B,EAAE,EAAE,KAAK,CAAC,QAAQ,EAChB,KAAK,CAAC,QAAQ,CAAC,UAAU;QAE7B,CAAC;IACH,CAAC;IAED,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,yCAAW,CAAC,CAAC;WAC3B,KAAK;QACR,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU;QAChD,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU;QAChD,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,yCAAkB,CAAC,GAAG,CAAC,KAAK;IAClD,CAAC,EAAE,WAAW,EAAE,QAAQ;IAExB,MAAM,CAAC,CAAC;oBAAA,UAAU;IAAA,CAAC;AACrB,CAAC;","sources":["packages/@react-aria/checkbox/src/index.ts","packages/@react-aria/checkbox/src/useCheckbox.ts","packages/@react-aria/checkbox/src/useCheckboxGroup.ts","packages/@react-aria/checkbox/src/utils.ts","packages/@react-aria/checkbox/src/useCheckboxGroupItem.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\nexport * from './useCheckbox';\nexport * from './useCheckboxGroup';\nexport * from './useCheckboxGroupItem';\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 {AriaCheckboxProps} from '@react-types/checkbox';\nimport {InputHTMLAttributes, RefObject, useEffect} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface CheckboxAria {\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useToggleState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckbox(props: AriaCheckboxProps, state: ToggleState, inputRef: RefObject<HTMLInputElement>): CheckboxAria {\n let {inputProps} = useToggle(props, state, inputRef);\n let {isSelected} = state;\n\n let {isIndeterminate} = props;\n useEffect(() => {\n // indeterminate is a property, but it can only be set via javascript\n // https://css-tricks.com/indeterminate-checkboxes/\n if (inputRef.current) {\n inputRef.current.indeterminate = isIndeterminate;\n }\n });\n\n return {\n inputProps: {\n ...inputProps,\n checked: isSelected,\n 'aria-checked': isIndeterminate ? 'mixed' : isSelected\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaCheckboxGroupProps} from '@react-types/checkbox';\nimport {checkboxGroupNames} from './utils';\nimport {CheckboxGroupState} from '@react-stately/checkbox';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\nimport {useLabel} from '@react-aria/label';\n\ninterface CheckboxGroupAria {\n /** Props for the checkbox group wrapper element. */\n groupProps: HTMLAttributes<HTMLElement>,\n /** Props for the checkbox group's visible label (if any). */\n labelProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox group component.\n * Checkbox groups allow users to select multiple items from a list of options.\n * @param props - Props for the checkbox group.\n * @param state - State for the checkbox group, as returned by `useCheckboxGroupState`.\n */\nexport function useCheckboxGroup(props: AriaCheckboxGroupProps, state: CheckboxGroupState): CheckboxGroupAria {\n let {isDisabled, name} = props;\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n // Checkbox group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n\n // Pass name prop from group to all items by attaching to the state.\n checkboxGroupNames.set(state, name);\n\n return {\n groupProps: mergeProps(domProps, {\n role: 'group',\n 'aria-disabled': isDisabled || undefined,\n ...fieldProps\n }),\n labelProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CheckboxGroupState} from '@react-stately/checkbox';\n\nexport const checkboxGroupNames = new WeakMap<CheckboxGroupState, string>();\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 {AriaCheckboxGroupItemProps} from '@react-types/checkbox';\nimport {CheckboxAria, useCheckbox} from './useCheckbox';\nimport {checkboxGroupNames} from './utils';\nimport {CheckboxGroupState} from '@react-stately/checkbox';\nimport {RefObject} from 'react';\nimport {useToggleState} from '@react-stately/toggle';\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component contained within a checkbox group.\n * Checkbox groups allow users to select multiple items from a list of options.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useCheckboxGroupState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckboxGroupItem(props: AriaCheckboxGroupItemProps, state: CheckboxGroupState, inputRef: RefObject<HTMLInputElement>): CheckboxAria {\n const toggleState = useToggleState({\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isSelected: state.isSelected(props.value),\n onChange(isSelected) {\n if (isSelected) {\n state.addValue(props.value);\n } else {\n state.removeValue(props.value);\n }\n\n if (props.onChange) {\n props.onChange(isSelected);\n }\n }\n });\n\n let {inputProps} = useCheckbox({\n ...props,\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isDisabled: props.isDisabled || state.isDisabled,\n name: props.name || checkboxGroupNames.get(state)\n }, toggleState, inputRef);\n\n return {inputProps};\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,123 +1,97 @@
1
- import { useToggleState } from "@react-stately/toggle";
2
- import { useLabel } from "@react-aria/label";
3
- import { filterDOMProps, mergeProps } from "@react-aria/utils";
4
- import { useToggle } from "@react-aria/toggle";
5
- import { useEffect } from "react";
6
- import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
7
-
8
- /**
9
- * Provides the behavior and accessibility implementation for a checkbox component.
10
- * Checkboxes allow users to select multiple items from a list of individual items, or
11
- * to mark one individual item as selected.
12
- * @param props - Props for the checkbox.
13
- * @param state - State for the checkbox, as returned by `useToggleState`.
14
- * @param inputRef - A ref for the HTML input element.
15
- */
16
- export function useCheckbox(props, state, inputRef) {
17
- let {
18
- inputProps
19
- } = useToggle(props, state, inputRef);
20
- let {
21
- isSelected
22
- } = state;
23
- let {
24
- isIndeterminate
25
- } = props;
26
- useEffect(() => {
27
- // indeterminate is a property, but it can only be set via javascript
28
- // https://css-tricks.com/indeterminate-checkboxes/
29
- if (inputRef.current) {
30
- inputRef.current.indeterminate = isIndeterminate;
31
- }
32
- });
33
- return {
34
- inputProps: _babelRuntimeHelpersEsmExtends({}, inputProps, {
35
- checked: isSelected,
36
- 'aria-checked': isIndeterminate ? 'mixed' : isSelected
37
- })
38
- };
1
+ import {useEffect as $lS2ep$useEffect} from "react";
2
+ import {useToggle as $lS2ep$useToggle} from "@react-aria/toggle";
3
+ import {filterDOMProps as $lS2ep$filterDOMProps, mergeProps as $lS2ep$mergeProps} from "@react-aria/utils";
4
+ import {useLabel as $lS2ep$useLabel} from "@react-aria/label";
5
+ import {useToggleState as $lS2ep$useToggleState} from "@react-stately/toggle";
6
+
7
+ function $parcel$export(e, n, v, s) {
8
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
9
+ }
10
+ var $6fc5544ca1b3ab2a$exports = {};
11
+
12
+ $parcel$export($6fc5544ca1b3ab2a$exports, "useCheckbox", () => $6fc5544ca1b3ab2a$export$e375f10ce42261c5);
13
+
14
+
15
+ function $6fc5544ca1b3ab2a$export$e375f10ce42261c5(props, state, inputRef) {
16
+ let { inputProps: inputProps } = $lS2ep$useToggle(props, state, inputRef);
17
+ let { isSelected: isSelected } = state;
18
+ let { isIndeterminate: isIndeterminate } = props;
19
+ $lS2ep$useEffect(()=>{
20
+ // indeterminate is a property, but it can only be set via javascript
21
+ // https://css-tricks.com/indeterminate-checkboxes/
22
+ if (inputRef.current) inputRef.current.indeterminate = isIndeterminate;
23
+ });
24
+ return {
25
+ inputProps: {
26
+ ...inputProps,
27
+ checked: isSelected,
28
+ 'aria-checked': isIndeterminate ? 'mixed' : isSelected
29
+ }
30
+ };
39
31
  }
40
32
 
41
- /*
42
- * Copyright 2020 Adobe. All rights reserved.
43
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
44
- * you may not use this file except in compliance with the License. You may obtain a copy
45
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
46
- *
47
- * Unless required by applicable law or agreed to in writing, software distributed under
48
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
49
- * OF ANY KIND, either express or implied. See the License for the specific language
50
- * governing permissions and limitations under the License.
51
- */
52
- const $c1125120fa765e2757aafb57a69ea88$export$checkboxGroupNames = new WeakMap();
53
-
54
- /**
55
- * Provides the behavior and accessibility implementation for a checkbox group component.
56
- * Checkbox groups allow users to select multiple items from a list of options.
57
- * @param props - Props for the checkbox group.
58
- * @param state - State for the checkbox group, as returned by `useCheckboxGroupState`.
59
- */
60
- export function useCheckboxGroup(props, state) {
61
- let {
62
- isDisabled,
63
- name
64
- } = props;
65
- let {
66
- labelProps,
67
- fieldProps
68
- } = useLabel(_babelRuntimeHelpersEsmExtends({}, props, {
69
- // Checkbox group is not an HTML input element so it
70
- // shouldn't be labeled by a <label> element.
71
- labelElementType: 'span'
72
- }));
73
- let domProps = filterDOMProps(props, {
74
- labelable: true
75
- }); // Pass name prop from group to all items by attaching to the state.
76
-
77
- $c1125120fa765e2757aafb57a69ea88$export$checkboxGroupNames.set(state, name);
78
- return {
79
- groupProps: mergeProps(domProps, _babelRuntimeHelpersEsmExtends({
80
- role: 'group',
81
- 'aria-disabled': isDisabled || undefined
82
- }, fieldProps)),
83
- labelProps
84
- };
33
+
34
+ var $9c576869c2451f7f$exports = {};
35
+
36
+ $parcel$export($9c576869c2451f7f$exports, "useCheckboxGroup", () => $9c576869c2451f7f$export$49ff6f28c54f1cbe);
37
+ const $46cd8c3ac90d2083$export$31440636951aa68c = new WeakMap();
38
+
39
+
40
+
41
+
42
+ function $9c576869c2451f7f$export$49ff6f28c54f1cbe(props, state) {
43
+ let { isDisabled: isDisabled , name: name } = props;
44
+ let { labelProps: labelProps , fieldProps: fieldProps } = $lS2ep$useLabel({
45
+ ...props,
46
+ // Checkbox group is not an HTML input element so it
47
+ // shouldn't be labeled by a <label> element.
48
+ labelElementType: 'span'
49
+ });
50
+ let domProps = $lS2ep$filterDOMProps(props, {
51
+ labelable: true
52
+ });
53
+ // Pass name prop from group to all items by attaching to the state.
54
+ $46cd8c3ac90d2083$export$31440636951aa68c.set(state, name);
55
+ return {
56
+ groupProps: $lS2ep$mergeProps(domProps, {
57
+ role: 'group',
58
+ 'aria-disabled': isDisabled || undefined,
59
+ ...fieldProps
60
+ }),
61
+ labelProps: labelProps
62
+ };
85
63
  }
86
64
 
87
- /**
88
- * Provides the behavior and accessibility implementation for a checkbox component contained within a checkbox group.
89
- * Checkbox groups allow users to select multiple items from a list of options.
90
- * @param props - Props for the checkbox.
91
- * @param state - State for the checkbox, as returned by `useCheckboxGroupState`.
92
- * @param inputRef - A ref for the HTML input element.
93
- */
94
- export function useCheckboxGroupItem(props, state, inputRef) {
95
- const toggleState = useToggleState({
96
- isReadOnly: props.isReadOnly || state.isReadOnly,
97
- isSelected: state.isSelected(props.value),
98
-
99
- onChange(isSelected) {
100
- if (isSelected) {
101
- state.addValue(props.value);
102
- } else {
103
- state.removeValue(props.value);
104
- }
105
-
106
- if (props.onChange) {
107
- props.onChange(isSelected);
108
- }
109
- }
110
-
111
- });
112
- let {
113
- inputProps
114
- } = useCheckbox(_babelRuntimeHelpersEsmExtends({}, props, {
115
- isReadOnly: props.isReadOnly || state.isReadOnly,
116
- isDisabled: props.isDisabled || state.isDisabled,
117
- name: props.name || $c1125120fa765e2757aafb57a69ea88$export$checkboxGroupNames.get(state)
118
- }), toggleState, inputRef);
119
- return {
120
- inputProps
121
- };
65
+
66
+ var $1e517f900339691c$exports = {};
67
+
68
+ $parcel$export($1e517f900339691c$exports, "useCheckboxGroupItem", () => $1e517f900339691c$export$353b32fc6898d37d);
69
+
70
+
71
+
72
+ function $1e517f900339691c$export$353b32fc6898d37d(props, state, inputRef) {
73
+ const toggleState = $lS2ep$useToggleState({
74
+ isReadOnly: props.isReadOnly || state.isReadOnly,
75
+ isSelected: state.isSelected(props.value),
76
+ onChange (isSelected) {
77
+ if (isSelected) state.addValue(props.value);
78
+ else state.removeValue(props.value);
79
+ if (props.onChange) props.onChange(isSelected);
80
+ }
81
+ });
82
+ let { inputProps: inputProps } = $6fc5544ca1b3ab2a$export$e375f10ce42261c5({
83
+ ...props,
84
+ isReadOnly: props.isReadOnly || state.isReadOnly,
85
+ isDisabled: props.isDisabled || state.isDisabled,
86
+ name: props.name || $46cd8c3ac90d2083$export$31440636951aa68c.get(state)
87
+ }, toggleState, inputRef);
88
+ return {
89
+ inputProps: inputProps
90
+ };
122
91
  }
92
+
93
+
94
+
95
+
96
+ export {$6fc5544ca1b3ab2a$export$e375f10ce42261c5 as useCheckbox, $9c576869c2451f7f$export$49ff6f28c54f1cbe as useCheckboxGroup, $1e517f900339691c$export$353b32fc6898d37d as useCheckboxGroupItem};
123
97
  //# sourceMappingURL=module.js.map
@@ -1 +1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,IAAIa;AAFX,OAGjBV,UAHiB,EADjB;AAMLD,IAAAA;AANK,GAAP;AAQD;;ACpCD;;;;;;;OAOO,SAASY,oBAAT,CAA8B5B,KAA9B,EAAiEC,KAAjE,EAA4FC,QAA5F,EAAiJ;AACtJ,QAAM2B,WAAW,GAAGC,cAAc,CAAC;AACjCC,IAAAA,UAAU,EAAE/B,KAAK,CAAC+B,UAAN,IAAoB9B,KAAK,CAAC8B,UADL;AAEjC1B,IAAAA,UAAU,EAAEJ,KAAK,CAACI,UAAN,CAAiBL,KAAK,CAACgC,KAAvB,CAFqB;;AAGjCC,IAAAA,QAAQ,CAAC5B,UAAD,EAAa;AACnB,UAAIA,UAAJ,EAAgB;AACdJ,QAAAA,KAAK,CAACiC,QAAN,CAAelC,KAAK,CAACgC,KAArB;AACD,OAFD,MAEO;AACL/B,QAAAA,KAAK,CAACkC,WAAN,CAAkBnC,KAAK,CAACgC,KAAxB;AACD;;AAED,UAAIhC,KAAK,CAACiC,QAAV,EAAoB;AAClBjC,QAAAA,KAAK,CAACiC,QAAN,CAAe5B,UAAf;AACD;AACF;;AAbgC,GAAD,CAAlC;AAgBA,MAAI;AAACF,IAAAA;AAAD,MAAe,+CACdH,KADc;AAEjB+B,IAAAA,UAAU,EAAE/B,KAAK,CAAC+B,UAAN,IAAoB9B,KAAK,CAAC8B,UAFrB;AAGjBjB,IAAAA,UAAU,EAAEd,KAAK,CAACc,UAAN,IAAoBb,KAAK,CAACa,UAHrB;AAIjBC,IAAAA,IAAI,EAAEf,KAAK,CAACe,IAAN,IAAc,2DAAmBqB,GAAnB,CAAuBnC,KAAvB;AAJH,MAKhB4B,WALgB,EAKH3B,QALG,CAAnB;AAOA,SAAO;AAACC,IAAAA;AAAD,GAAP;AACD","sources":["./packages/@react-aria/checkbox/src/useCheckbox.ts","./packages/@react-aria/checkbox/src/utils.ts","./packages/@react-aria/checkbox/src/useCheckboxGroup.ts","./packages/@react-aria/checkbox/src/useCheckboxGroupItem.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\nimport {AriaCheckboxProps} from '@react-types/checkbox';\nimport {InputHTMLAttributes, RefObject, useEffect} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface CheckboxAria {\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useToggleState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckbox(props: AriaCheckboxProps, state: ToggleState, inputRef: RefObject<HTMLInputElement>): CheckboxAria {\n let {inputProps} = useToggle(props, state, inputRef);\n let {isSelected} = state;\n\n let {isIndeterminate} = props;\n useEffect(() => {\n // indeterminate is a property, but it can only be set via javascript\n // https://css-tricks.com/indeterminate-checkboxes/\n if (inputRef.current) {\n inputRef.current.indeterminate = isIndeterminate;\n }\n });\n\n return {\n inputProps: {\n ...inputProps,\n checked: isSelected,\n 'aria-checked': isIndeterminate ? 'mixed' : isSelected\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CheckboxGroupState} from '@react-stately/checkbox';\n\nexport const checkboxGroupNames = new WeakMap<CheckboxGroupState, string>();\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 {AriaCheckboxGroupProps} from '@react-types/checkbox';\nimport {checkboxGroupNames} from './utils';\nimport {CheckboxGroupState} from '@react-stately/checkbox';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\nimport {useLabel} from '@react-aria/label';\n\ninterface CheckboxGroupAria {\n /** Props for the checkbox group wrapper element. */\n groupProps: HTMLAttributes<HTMLElement>,\n /** Props for the checkbox group's visible label (if any). */\n labelProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox group component.\n * Checkbox groups allow users to select multiple items from a list of options.\n * @param props - Props for the checkbox group.\n * @param state - State for the checkbox group, as returned by `useCheckboxGroupState`.\n */\nexport function useCheckboxGroup(props: AriaCheckboxGroupProps, state: CheckboxGroupState): CheckboxGroupAria {\n let {isDisabled, name} = props;\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n // Checkbox group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n\n // Pass name prop from group to all items by attaching to the state.\n checkboxGroupNames.set(state, name);\n\n return {\n groupProps: mergeProps(domProps, {\n role: 'group',\n 'aria-disabled': isDisabled || undefined,\n ...fieldProps\n }),\n labelProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaCheckboxGroupItemProps} from '@react-types/checkbox';\nimport {CheckboxAria, useCheckbox} from './useCheckbox';\nimport {checkboxGroupNames} from './utils';\nimport {CheckboxGroupState} from '@react-stately/checkbox';\nimport {RefObject} from 'react';\nimport {useToggleState} from '@react-stately/toggle';\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component contained within a checkbox group.\n * Checkbox groups allow users to select multiple items from a list of options.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useCheckboxGroupState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckboxGroupItem(props: AriaCheckboxGroupItemProps, state: CheckboxGroupState, inputRef: RefObject<HTMLInputElement>): CheckboxAria {\n const toggleState = useToggleState({\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isSelected: state.isSelected(props.value),\n onChange(isSelected) {\n if (isSelected) {\n state.addValue(props.value);\n } else {\n state.removeValue(props.value);\n }\n\n if (props.onChange) {\n props.onChange(isSelected);\n }\n }\n });\n\n let {inputProps} = useCheckbox({\n ...props,\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isDisabled: props.isDisabled || state.isDisabled,\n name: props.name || checkboxGroupNames.get(state)\n }, toggleState, inputRef);\n\n return {inputProps};\n}\n"],"names":["useCheckbox","props","state","inputRef","inputProps","useToggle","isSelected","isIndeterminate","useEffect","current","indeterminate","checked","checkboxGroupNames","WeakMap","useCheckboxGroup","isDisabled","name","labelProps","fieldProps","useLabel","labelElementType","domProps","filterDOMProps","labelable","set","groupProps","mergeProps","role","undefined","useCheckboxGroupItem","toggleState","useToggleState","isReadOnly","value","onChange","addValue","removeValue","get"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;SC8BgB,yCAAW,CAAC,KAAwB,EAAE,KAAkB,EAAE,QAAqC,EAAgB,CAAC;IAC9H,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,gBAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ;IACnD,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,KAAK;IAExB,GAAG,CAAC,CAAC,kBAAA,eAAe,EAAA,CAAC,GAAG,KAAK;IAC7B,gBAAS,KAAO,CAAC;QACf,EAAqE,AAArE,mEAAqE;QACrE,EAAmD,AAAnD,iDAAmD;QACnD,EAAE,EAAE,QAAQ,CAAC,OAAO,EAClB,QAAQ,CAAC,OAAO,CAAC,aAAa,GAAG,eAAe;IAEpD,CAAC;IAED,MAAM,CAAC,CAAC;QACN,UAAU,EAAE,CAAC;eACR,UAAU;YACb,OAAO,EAAE,UAAU;YACnB,CAAc,eAAE,eAAe,GAAG,CAAO,SAAG,UAAU;QACxD,CAAC;IACH,CAAC;AACH,CAAC;;;;;;AEpCM,KAAK,CAAC,yCAAkB,GAAG,GAAG,CAAC,OAAO;;;;;SDkB7B,yCAAgB,CAAC,KAA6B,EAAE,KAAyB,EAAqB,CAAC;IAC7G,GAAG,CAAC,CAAC,aAAA,UAAU,SAAE,IAAI,EAAA,CAAC,GAAG,KAAK;IAE9B,GAAG,CAAC,CAAC,aAAA,UAAU,eAAE,UAAU,EAAA,CAAC,GAAG,eAAQ,CAAC,CAAC;WACpC,KAAK;QACR,EAAoD,AAApD,kDAAoD;QACpD,EAA6C,AAA7C,2CAA6C;QAC7C,gBAAgB,EAAE,CAAM;IAC1B,CAAC;IAED,GAAG,CAAC,QAAQ,GAAG,qBAAc,CAAC,KAAK,EAAE,CAAC;QAAA,SAAS,EAAE,IAAI;IAAA,CAAC;IAEtD,EAAoE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boxGroup.ts","packages/@react-aria/checkbox/src/utils.ts","packages/@react-aria/checkbox/src/useCheckboxGroupItem.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\nexport * from './useCheckbox';\nexport * from './useCheckboxGroup';\nexport * from './useCheckboxGroupItem';\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 {AriaCheckboxProps} from '@react-types/checkbox';\nimport {InputHTMLAttributes, RefObject, useEffect} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface CheckboxAria {\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useToggleState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckbox(props: AriaCheckboxProps, state: ToggleState, inputRef: RefObject<HTMLInputElement>): CheckboxAria {\n let {inputProps} = useToggle(props, state, inputRef);\n let {isSelected} = state;\n\n let {isIndeterminate} = props;\n useEffect(() => {\n // indeterminate is a property, but it can only be set via javascript\n // https://css-tricks.com/indeterminate-checkboxes/\n if (inputRef.current) {\n inputRef.current.indeterminate = isIndeterminate;\n }\n });\n\n return {\n inputProps: {\n ...inputProps,\n checked: isSelected,\n 'aria-checked': isIndeterminate ? 'mixed' : isSelected\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaCheckboxGroupProps} from '@react-types/checkbox';\nimport {checkboxGroupNames} from './utils';\nimport {CheckboxGroupState} from '@react-stately/checkbox';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\nimport {useLabel} from '@react-aria/label';\n\ninterface CheckboxGroupAria {\n /** Props for the checkbox group wrapper element. */\n groupProps: HTMLAttributes<HTMLElement>,\n /** Props for the checkbox group's visible label (if any). */\n labelProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox group component.\n * Checkbox groups allow users to select multiple items from a list of options.\n * @param props - Props for the checkbox group.\n * @param state - State for the checkbox group, as returned by `useCheckboxGroupState`.\n */\nexport function useCheckboxGroup(props: AriaCheckboxGroupProps, state: CheckboxGroupState): CheckboxGroupAria {\n let {isDisabled, name} = props;\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n // Checkbox group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n\n // Pass name prop from group to all items by attaching to the state.\n checkboxGroupNames.set(state, name);\n\n return {\n groupProps: mergeProps(domProps, {\n role: 'group',\n 'aria-disabled': isDisabled || undefined,\n ...fieldProps\n }),\n labelProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CheckboxGroupState} from '@react-stately/checkbox';\n\nexport const checkboxGroupNames = new WeakMap<CheckboxGroupState, string>();\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 {AriaCheckboxGroupItemProps} from '@react-types/checkbox';\nimport {CheckboxAria, useCheckbox} from './useCheckbox';\nimport {checkboxGroupNames} from './utils';\nimport {CheckboxGroupState} from '@react-stately/checkbox';\nimport {RefObject} from 'react';\nimport {useToggleState} from '@react-stately/toggle';\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component contained within a checkbox group.\n * Checkbox groups allow users to select multiple items from a list of options.\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `useCheckboxGroupState`.\n * @param inputRef - A ref for the HTML input element.\n */\nexport function useCheckboxGroupItem(props: AriaCheckboxGroupItemProps, state: CheckboxGroupState, inputRef: RefObject<HTMLInputElement>): CheckboxAria {\n const toggleState = useToggleState({\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isSelected: state.isSelected(props.value),\n onChange(isSelected) {\n if (isSelected) {\n state.addValue(props.value);\n } else {\n state.removeValue(props.value);\n }\n\n if (props.onChange) {\n props.onChange(isSelected);\n }\n }\n });\n\n let {inputProps} = useCheckbox({\n ...props,\n isReadOnly: props.isReadOnly || state.isReadOnly,\n isDisabled: props.isDisabled || state.isDisabled,\n name: props.name || checkboxGroupNames.get(state)\n }, toggleState, inputRef);\n\n return {inputProps};\n}\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":"A;A;A;A;AAiBA;IACE,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAA;CAClD;AAED;A;A;A;A;A;A;GAOG;AACH,4BAA4B,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,gBAAgB,CAAC,GAAG,YAAY,CAoB7H;AE/BD;IACE,oDAAoD;IACpD,UAAU,EAAE,eAAe,WAAW,CAAC,CAAC;IACxC,6DAA6D;IAC7D,UAAU,EAAE,eAAe,WAAW,CAAC,CAAA;CACxC;AAED;A;A;A;A;GAKG;AACH,iCAAiC,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,kBAAkB,GAAG,iBAAiB,CAuB5G;ACpCD;A;A;A;A;A;GAMG;AACH,qCAAqC,KAAK,EAAE,0BAA0B,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,gBAAgB,CAAC,GAAG,YAAY,CAyBtJ","sources":["./packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/useCheckbox.ts","./packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/utils.ts","./packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/useCheckboxGroup.ts","./packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/useCheckboxGroupItem.ts","./packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/index.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;;AAiBA;IACE,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAA;CAClD;AAED;;;;;;;GAOG;AACH,4BAA4B,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,gBAAgB,CAAC,GAAG,YAAY,CAoB7H;AE/BD;IACE,oDAAoD;IACpD,UAAU,EAAE,eAAe,WAAW,CAAC,CAAC;IACxC,6DAA6D;IAC7D,UAAU,EAAE,eAAe,WAAW,CAAC,CAAA;CACxC;AAED;;;;;GAKG;AACH,iCAAiC,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,kBAAkB,GAAG,iBAAiB,CAuB5G;ACpCD;;;;;;GAMG;AACH,qCAAqC,KAAK,EAAE,0BAA0B,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,gBAAgB,CAAC,GAAG,YAAY,CAyBtJ","sources":["packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/useCheckbox.ts","packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/utils.ts","packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/useCheckboxGroup.ts","packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/useCheckboxGroupItem.ts","packages/@react-aria/checkbox/src/packages/@react-aria/checkbox/src/index.ts","packages/@react-aria/checkbox/src/index.ts"],"sourcesContent":[null,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\nexport * from './useCheckbox';\nexport * from './useCheckboxGroup';\nexport * from './useCheckboxGroupItem';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/checkbox",
3
- "version": "3.2.3",
3
+ "version": "3.3.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,12 +18,12 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-aria/label": "^3.1.3",
22
- "@react-aria/toggle": "^3.1.4",
23
- "@react-aria/utils": "^3.8.2",
24
- "@react-stately/checkbox": "^3.0.3",
25
- "@react-stately/toggle": "^3.2.3",
26
- "@react-types/checkbox": "^3.2.3"
21
+ "@react-aria/label": "^3.2.2",
22
+ "@react-aria/toggle": "^3.2.0",
23
+ "@react-aria/utils": "^3.11.1",
24
+ "@react-stately/checkbox": "^3.0.4",
25
+ "@react-stately/toggle": "^3.2.4",
26
+ "@react-types/checkbox": "^3.2.4"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "^16.8.0 || ^17.0.0-rc.1"
@@ -31,5 +31,5 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "9204e1b8cb61dac767e91087fb16203611dc67c5"
34
+ "gitHead": "54c2366c4f31bd4bf619126131cd583c12972acc"
35
35
  }