@react-aria/actiongroup 3.7.20 → 3.7.22

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.
@@ -42,9 +42,7 @@ function $44b92e5de834b44e$export$9597202bd3099a29(props, state, ref) {
42
42
  return ()=>{
43
43
  onRemovedWithFocus();
44
44
  };
45
- }, [
46
- onRemovedWithFocus
47
- ]);
45
+ }, []);
48
46
  return {
49
47
  buttonProps: (0, $7WRxK$reactariautils.mergeProps)(buttonProps, {
50
48
  tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAgBD,MAAM,qCAAe;IACnB,QAAQ;IACR,UAAU;IACV,YAAY;AACd;AAGO,SAAS,0CAAsB,KAA+B,EAAE,KAAmB,EAAE,GAAwC;IAClI,IAAI,gBAAgB,MAAM,gBAAgB,CAAC,aAAa;IACxD,IAAI,cAAc;QAChB,MAAM,kCAAY,CAAC,cAAc;IACnC;IAEA,IAAI,kBAAkB,QAAQ;QAC5B,IAAI,aAAa,MAAM,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG;QAC5D,WAAW,CAAC,eAAe,GAAG;IAChC;IAEA,IAAI,YAAY,MAAM,GAAG,KAAK,MAAM,gBAAgB,CAAC,UAAU;IAC/D,IAAI,qBAAqB,CAAA,GAAA,oCAAa,EAAE;QACtC,IAAI,WACF,MAAM,gBAAgB,CAAC,aAAa,CAAC;IAEzC;IAEA,8EAA8E;IAC9E,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO;YACL;QACF;IACF,GAAG;QAAC;KAAmB;IAEvB,OAAO;QACL,aAAa,CAAA,GAAA,gCAAS,EAAE,aAAa;YACnC,UAAU,aAAa,MAAM,gBAAgB,CAAC,UAAU,IAAI,OAAO,IAAI;YACvE;gBACE,MAAM,gBAAgB,CAAC,aAAa,CAAC,MAAM,GAAG;YAChD;YACA;gBACE,MAAM,gBAAgB,CAAC,MAAM,CAAC,MAAM,GAAG;YACzC;QACF;IACF;AACF","sources":["packages/@react-aria/actiongroup/src/useActionGroupItem.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 {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {ListState} from '@react-stately/list';\nimport {mergeProps, useEffectEvent} from '@react-aria/utils';\nimport {PressProps} from '@react-aria/interactions';\nimport {useEffect} from 'react';\n\nexport interface AriaActionGroupItemProps {\n key: Key\n}\n\nexport interface ActionGroupItemAria {\n buttonProps: DOMAttributes & PressProps\n}\n\nconst BUTTON_ROLES = {\n 'none': undefined,\n 'single': 'radio',\n 'multiple': 'checkbox'\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useActionGroupItem<T>(props: AriaActionGroupItemProps, state: ListState<T>, ref?: RefObject<FocusableElement | null>): ActionGroupItemAria {\n let selectionMode = state.selectionManager.selectionMode;\n let buttonProps = {\n role: BUTTON_ROLES[selectionMode]\n };\n\n if (selectionMode !== 'none') {\n let isSelected = state.selectionManager.isSelected(props.key);\n buttonProps['aria-checked'] = isSelected;\n }\n\n let isFocused = props.key === state.selectionManager.focusedKey;\n let onRemovedWithFocus = useEffectEvent(() => {\n if (isFocused) {\n state.selectionManager.setFocusedKey(null);\n }\n });\n\n // If the focused item is removed from the DOM, reset the focused key to null.\n useEffect(() => {\n return () => {\n onRemovedWithFocus();\n };\n }, [onRemovedWithFocus]);\n\n return {\n buttonProps: mergeProps(buttonProps, {\n tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,\n onFocus() {\n state.selectionManager.setFocusedKey(props.key);\n },\n onPress() {\n state.selectionManager.select(props.key);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useActionGroupItem.main.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAgBD,MAAM,qCAAe;IACnB,QAAQ;IACR,UAAU;IACV,YAAY;AACd;AAGO,SAAS,0CAAsB,KAA+B,EAAE,KAAmB,EAAE,GAAwC;IAClI,IAAI,gBAAgB,MAAM,gBAAgB,CAAC,aAAa;IACxD,IAAI,cAAc;QAChB,MAAM,kCAAY,CAAC,cAAc;IACnC;IAEA,IAAI,kBAAkB,QAAQ;QAC5B,IAAI,aAAa,MAAM,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG;QAC5D,WAAW,CAAC,eAAe,GAAG;IAChC;IAEA,IAAI,YAAY,MAAM,GAAG,KAAK,MAAM,gBAAgB,CAAC,UAAU;IAC/D,IAAI,qBAAqB,CAAA,GAAA,oCAAa,EAAE;QACtC,IAAI,WACF,MAAM,gBAAgB,CAAC,aAAa,CAAC;IAEzC;IAEA,8EAA8E;IAC9E,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO;YACL;QACF;IACF,GAAG,EAAE;IAEL,OAAO;QACL,aAAa,CAAA,GAAA,gCAAS,EAAE,aAAa;YACnC,UAAU,aAAa,MAAM,gBAAgB,CAAC,UAAU,IAAI,OAAO,IAAI;YACvE;gBACE,MAAM,gBAAgB,CAAC,aAAa,CAAC,MAAM,GAAG;YAChD;YACA;gBACE,MAAM,gBAAgB,CAAC,MAAM,CAAC,MAAM,GAAG;YACzC;QACF;IACF;AACF","sources":["packages/@react-aria/actiongroup/src/useActionGroupItem.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 {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {ListState} from '@react-stately/list';\nimport {mergeProps, useEffectEvent} from '@react-aria/utils';\nimport {PressProps} from '@react-aria/interactions';\nimport {useEffect} from 'react';\n\nexport interface AriaActionGroupItemProps {\n key: Key\n}\n\nexport interface ActionGroupItemAria {\n buttonProps: DOMAttributes & PressProps\n}\n\nconst BUTTON_ROLES = {\n 'none': undefined,\n 'single': 'radio',\n 'multiple': 'checkbox'\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useActionGroupItem<T>(props: AriaActionGroupItemProps, state: ListState<T>, ref?: RefObject<FocusableElement | null>): ActionGroupItemAria {\n let selectionMode = state.selectionManager.selectionMode;\n let buttonProps = {\n role: BUTTON_ROLES[selectionMode]\n };\n\n if (selectionMode !== 'none') {\n let isSelected = state.selectionManager.isSelected(props.key);\n buttonProps['aria-checked'] = isSelected;\n }\n\n let isFocused = props.key === state.selectionManager.focusedKey;\n let onRemovedWithFocus = useEffectEvent(() => {\n if (isFocused) {\n state.selectionManager.setFocusedKey(null);\n }\n });\n\n // If the focused item is removed from the DOM, reset the focused key to null.\n useEffect(() => {\n return () => {\n onRemovedWithFocus();\n };\n }, []);\n\n return {\n buttonProps: mergeProps(buttonProps, {\n tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,\n onFocus() {\n state.selectionManager.setFocusedKey(props.key);\n },\n onPress() {\n state.selectionManager.select(props.key);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useActionGroupItem.main.js.map"}
@@ -36,9 +36,7 @@ function $f0ac0fb73c3ec062$export$9597202bd3099a29(props, state, ref) {
36
36
  return ()=>{
37
37
  onRemovedWithFocus();
38
38
  };
39
- }, [
40
- onRemovedWithFocus
41
- ]);
39
+ }, []);
42
40
  return {
43
41
  buttonProps: (0, $jllmK$mergeProps)(buttonProps, {
44
42
  tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
@@ -36,9 +36,7 @@ function $f0ac0fb73c3ec062$export$9597202bd3099a29(props, state, ref) {
36
36
  return ()=>{
37
37
  onRemovedWithFocus();
38
38
  };
39
- }, [
40
- onRemovedWithFocus
41
- ]);
39
+ }, []);
42
40
  return {
43
41
  buttonProps: (0, $jllmK$mergeProps)(buttonProps, {
44
42
  tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAgBD,MAAM,qCAAe;IACnB,QAAQ;IACR,UAAU;IACV,YAAY;AACd;AAGO,SAAS,0CAAsB,KAA+B,EAAE,KAAmB,EAAE,GAAwC;IAClI,IAAI,gBAAgB,MAAM,gBAAgB,CAAC,aAAa;IACxD,IAAI,cAAc;QAChB,MAAM,kCAAY,CAAC,cAAc;IACnC;IAEA,IAAI,kBAAkB,QAAQ;QAC5B,IAAI,aAAa,MAAM,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG;QAC5D,WAAW,CAAC,eAAe,GAAG;IAChC;IAEA,IAAI,YAAY,MAAM,GAAG,KAAK,MAAM,gBAAgB,CAAC,UAAU;IAC/D,IAAI,qBAAqB,CAAA,GAAA,qBAAa,EAAE;QACtC,IAAI,WACF,MAAM,gBAAgB,CAAC,aAAa,CAAC;IAEzC;IAEA,8EAA8E;IAC9E,CAAA,GAAA,gBAAQ,EAAE;QACR,OAAO;YACL;QACF;IACF,GAAG;QAAC;KAAmB;IAEvB,OAAO;QACL,aAAa,CAAA,GAAA,iBAAS,EAAE,aAAa;YACnC,UAAU,aAAa,MAAM,gBAAgB,CAAC,UAAU,IAAI,OAAO,IAAI;YACvE;gBACE,MAAM,gBAAgB,CAAC,aAAa,CAAC,MAAM,GAAG;YAChD;YACA;gBACE,MAAM,gBAAgB,CAAC,MAAM,CAAC,MAAM,GAAG;YACzC;QACF;IACF;AACF","sources":["packages/@react-aria/actiongroup/src/useActionGroupItem.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 {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {ListState} from '@react-stately/list';\nimport {mergeProps, useEffectEvent} from '@react-aria/utils';\nimport {PressProps} from '@react-aria/interactions';\nimport {useEffect} from 'react';\n\nexport interface AriaActionGroupItemProps {\n key: Key\n}\n\nexport interface ActionGroupItemAria {\n buttonProps: DOMAttributes & PressProps\n}\n\nconst BUTTON_ROLES = {\n 'none': undefined,\n 'single': 'radio',\n 'multiple': 'checkbox'\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useActionGroupItem<T>(props: AriaActionGroupItemProps, state: ListState<T>, ref?: RefObject<FocusableElement | null>): ActionGroupItemAria {\n let selectionMode = state.selectionManager.selectionMode;\n let buttonProps = {\n role: BUTTON_ROLES[selectionMode]\n };\n\n if (selectionMode !== 'none') {\n let isSelected = state.selectionManager.isSelected(props.key);\n buttonProps['aria-checked'] = isSelected;\n }\n\n let isFocused = props.key === state.selectionManager.focusedKey;\n let onRemovedWithFocus = useEffectEvent(() => {\n if (isFocused) {\n state.selectionManager.setFocusedKey(null);\n }\n });\n\n // If the focused item is removed from the DOM, reset the focused key to null.\n useEffect(() => {\n return () => {\n onRemovedWithFocus();\n };\n }, [onRemovedWithFocus]);\n\n return {\n buttonProps: mergeProps(buttonProps, {\n tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,\n onFocus() {\n state.selectionManager.setFocusedKey(props.key);\n },\n onPress() {\n state.selectionManager.select(props.key);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useActionGroupItem.module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAgBD,MAAM,qCAAe;IACnB,QAAQ;IACR,UAAU;IACV,YAAY;AACd;AAGO,SAAS,0CAAsB,KAA+B,EAAE,KAAmB,EAAE,GAAwC;IAClI,IAAI,gBAAgB,MAAM,gBAAgB,CAAC,aAAa;IACxD,IAAI,cAAc;QAChB,MAAM,kCAAY,CAAC,cAAc;IACnC;IAEA,IAAI,kBAAkB,QAAQ;QAC5B,IAAI,aAAa,MAAM,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG;QAC5D,WAAW,CAAC,eAAe,GAAG;IAChC;IAEA,IAAI,YAAY,MAAM,GAAG,KAAK,MAAM,gBAAgB,CAAC,UAAU;IAC/D,IAAI,qBAAqB,CAAA,GAAA,qBAAa,EAAE;QACtC,IAAI,WACF,MAAM,gBAAgB,CAAC,aAAa,CAAC;IAEzC;IAEA,8EAA8E;IAC9E,CAAA,GAAA,gBAAQ,EAAE;QACR,OAAO;YACL;QACF;IACF,GAAG,EAAE;IAEL,OAAO;QACL,aAAa,CAAA,GAAA,iBAAS,EAAE,aAAa;YACnC,UAAU,aAAa,MAAM,gBAAgB,CAAC,UAAU,IAAI,OAAO,IAAI;YACvE;gBACE,MAAM,gBAAgB,CAAC,aAAa,CAAC,MAAM,GAAG;YAChD;YACA;gBACE,MAAM,gBAAgB,CAAC,MAAM,CAAC,MAAM,GAAG;YACzC;QACF;IACF;AACF","sources":["packages/@react-aria/actiongroup/src/useActionGroupItem.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 {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {ListState} from '@react-stately/list';\nimport {mergeProps, useEffectEvent} from '@react-aria/utils';\nimport {PressProps} from '@react-aria/interactions';\nimport {useEffect} from 'react';\n\nexport interface AriaActionGroupItemProps {\n key: Key\n}\n\nexport interface ActionGroupItemAria {\n buttonProps: DOMAttributes & PressProps\n}\n\nconst BUTTON_ROLES = {\n 'none': undefined,\n 'single': 'radio',\n 'multiple': 'checkbox'\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useActionGroupItem<T>(props: AriaActionGroupItemProps, state: ListState<T>, ref?: RefObject<FocusableElement | null>): ActionGroupItemAria {\n let selectionMode = state.selectionManager.selectionMode;\n let buttonProps = {\n role: BUTTON_ROLES[selectionMode]\n };\n\n if (selectionMode !== 'none') {\n let isSelected = state.selectionManager.isSelected(props.key);\n buttonProps['aria-checked'] = isSelected;\n }\n\n let isFocused = props.key === state.selectionManager.focusedKey;\n let onRemovedWithFocus = useEffectEvent(() => {\n if (isFocused) {\n state.selectionManager.setFocusedKey(null);\n }\n });\n\n // If the focused item is removed from the DOM, reset the focused key to null.\n useEffect(() => {\n return () => {\n onRemovedWithFocus();\n };\n }, []);\n\n return {\n buttonProps: mergeProps(buttonProps, {\n tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,\n onFocus() {\n state.selectionManager.setFocusedKey(props.key);\n },\n onPress() {\n state.selectionManager.select(props.key);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useActionGroupItem.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/actiongroup",
3
- "version": "3.7.20",
3
+ "version": "3.7.22",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -26,13 +26,13 @@
26
26
  "url": "https://github.com/adobe/react-spectrum"
27
27
  },
28
28
  "dependencies": {
29
- "@react-aria/focus": "^3.21.1",
30
- "@react-aria/i18n": "^3.12.12",
31
- "@react-aria/interactions": "^3.25.5",
32
- "@react-aria/utils": "^3.30.1",
33
- "@react-stately/list": "^3.13.0",
34
- "@react-types/actiongroup": "^3.4.20",
35
- "@react-types/shared": "^3.32.0",
29
+ "@react-aria/focus": "^3.21.3",
30
+ "@react-aria/i18n": "^3.12.14",
31
+ "@react-aria/interactions": "^3.26.0",
32
+ "@react-aria/utils": "^3.32.0",
33
+ "@react-stately/list": "^3.13.2",
34
+ "@react-types/actiongroup": "^3.4.21",
35
+ "@react-types/shared": "^3.32.1",
36
36
  "@swc/helpers": "^0.5.0"
37
37
  },
38
38
  "peerDependencies": {
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "2c58ed3ddd9be9100af9b1d0cfd137fcdc95ba2d"
45
+ "gitHead": "4d838da5bfe36abb35aed166995a9ef63825370f"
46
46
  }
@@ -54,7 +54,7 @@ export function useActionGroupItem<T>(props: AriaActionGroupItemProps, state: Li
54
54
  return () => {
55
55
  onRemovedWithFocus();
56
56
  };
57
- }, [onRemovedWithFocus]);
57
+ }, []);
58
58
 
59
59
  return {
60
60
  buttonProps: mergeProps(buttonProps, {