@react-aria/actiongroup 3.2.3-nightly.3111 → 3.2.3

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.
Files changed (3) hide show
  1. package/dist/main.js +22 -22
  2. package/dist/module.js +21 -21
  3. package/package.json +11 -11
package/dist/main.js CHANGED
@@ -1,7 +1,7 @@
1
- var $kJ39C$reactariafocus = require("@react-aria/focus");
2
- var $kJ39C$reactariautils = require("@react-aria/utils");
3
- var $kJ39C$reactariai18n = require("@react-aria/i18n");
4
- var $kJ39C$react = require("react");
1
+ var $i3cSM$reactariafocus = require("@react-aria/focus");
2
+ var $i3cSM$reactariautils = require("@react-aria/utils");
3
+ var $i3cSM$reactariai18n = require("@react-aria/i18n");
4
+ var $i3cSM$react = require("react");
5
5
 
6
6
  function $parcel$exportWildcard(dest, source) {
7
7
  Object.keys(source).forEach(function(key) {
@@ -22,26 +22,26 @@ function $parcel$exportWildcard(dest, source) {
22
22
  function $parcel$export(e, n, v, s) {
23
23
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
24
24
  }
25
- var $fa5d02ed092a1b45$exports = {};
25
+ var $beb108c754cce68d$exports = {};
26
26
 
27
- $parcel$export($fa5d02ed092a1b45$exports, "useActionGroup", () => $fa5d02ed092a1b45$export$f4bf8d43c16de704);
27
+ $parcel$export($beb108c754cce68d$exports, "useActionGroup", () => $beb108c754cce68d$export$f4bf8d43c16de704);
28
28
 
29
29
 
30
30
 
31
- const $fa5d02ed092a1b45$var$BUTTON_GROUP_ROLES = {
31
+ const $beb108c754cce68d$var$BUTTON_GROUP_ROLES = {
32
32
  'none': 'toolbar',
33
33
  'single': 'radiogroup',
34
34
  'multiple': 'toolbar'
35
35
  };
36
- function $fa5d02ed092a1b45$export$f4bf8d43c16de704(props, state, ref) {
36
+ function $beb108c754cce68d$export$f4bf8d43c16de704(props, state, ref) {
37
37
  let { isDisabled: isDisabled , orientation: orientation = 'horizontal' } = props;
38
38
  let allKeys = [
39
39
  ...state.collection.getKeys()
40
40
  ];
41
41
  if (!allKeys.some((key)=>!state.disabledKeys.has(key)
42
42
  )) isDisabled = true;
43
- let { direction: direction } = $kJ39C$reactariai18n.useLocale();
44
- let focusManager = $kJ39C$reactariafocus.createFocusManager(ref);
43
+ let { direction: direction } = $i3cSM$reactariai18n.useLocale();
44
+ let focusManager = $i3cSM$reactariafocus.createFocusManager(ref);
45
45
  let flipDirection = direction === 'rtl' && orientation === 'horizontal';
46
46
  let onKeyDown = (e)=>{
47
47
  if (!e.currentTarget.contains(e.target)) return;
@@ -70,10 +70,10 @@ function $fa5d02ed092a1b45$export$f4bf8d43c16de704(props, state, ref) {
70
70
  break;
71
71
  }
72
72
  };
73
- let role = $fa5d02ed092a1b45$var$BUTTON_GROUP_ROLES[state.selectionManager.selectionMode];
73
+ let role = $beb108c754cce68d$var$BUTTON_GROUP_ROLES[state.selectionManager.selectionMode];
74
74
  return {
75
75
  actionGroupProps: {
76
- ...$kJ39C$reactariautils.filterDOMProps(props, {
76
+ ...$i3cSM$reactariautils.filterDOMProps(props, {
77
77
  labelable: true
78
78
  }),
79
79
  role: role,
@@ -85,27 +85,27 @@ function $fa5d02ed092a1b45$export$f4bf8d43c16de704(props, state, ref) {
85
85
  }
86
86
 
87
87
 
88
- var $87e953933c683a6a$exports = {};
88
+ var $a9279da88ed3f26d$exports = {};
89
89
 
90
- $parcel$export($87e953933c683a6a$exports, "useActionGroupItem", () => $87e953933c683a6a$export$9597202bd3099a29);
90
+ $parcel$export($a9279da88ed3f26d$exports, "useActionGroupItem", () => $a9279da88ed3f26d$export$9597202bd3099a29);
91
91
 
92
92
 
93
- const $87e953933c683a6a$var$BUTTON_ROLES = {
93
+ const $a9279da88ed3f26d$var$BUTTON_ROLES = {
94
94
  'none': null,
95
95
  'single': 'radio',
96
96
  'multiple': 'checkbox'
97
97
  };
98
- function $87e953933c683a6a$export$9597202bd3099a29(props, state, ref) {
98
+ function $a9279da88ed3f26d$export$9597202bd3099a29(props, state, ref) {
99
99
  let selectionMode = state.selectionManager.selectionMode;
100
100
  let buttonProps = {
101
- role: $87e953933c683a6a$var$BUTTON_ROLES[selectionMode]
101
+ role: $a9279da88ed3f26d$var$BUTTON_ROLES[selectionMode]
102
102
  };
103
103
  if (selectionMode !== 'none') {
104
104
  let isSelected = state.selectionManager.isSelected(props.key);
105
105
  buttonProps['aria-checked'] = isSelected;
106
106
  }
107
107
  let isFocused = props.key === state.selectionManager.focusedKey;
108
- let lastRender = $kJ39C$react.useRef({
108
+ let lastRender = $i3cSM$react.useRef({
109
109
  isFocused: isFocused,
110
110
  state: state
111
111
  });
@@ -115,13 +115,13 @@ function $87e953933c683a6a$export$9597202bd3099a29(props, state, ref) {
115
115
  };
116
116
  // If the focused item is removed from the DOM, reset the focused key to null.
117
117
  // eslint-disable-next-line arrow-body-style
118
- $kJ39C$react.useEffect(()=>{
118
+ $i3cSM$react.useEffect(()=>{
119
119
  return ()=>{
120
120
  if (lastRender.current.isFocused) lastRender.current.state.selectionManager.setFocusedKey(null);
121
121
  };
122
122
  }, []);
123
123
  return {
124
- buttonProps: $kJ39C$reactariautils.mergeProps(buttonProps, {
124
+ buttonProps: $i3cSM$reactariautils.mergeProps(buttonProps, {
125
125
  tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
126
126
  onFocus () {
127
127
  state.selectionManager.setFocusedKey(props.key);
@@ -134,8 +134,8 @@ function $87e953933c683a6a$export$9597202bd3099a29(props, state, ref) {
134
134
  }
135
135
 
136
136
 
137
- $parcel$exportWildcard(module.exports, $fa5d02ed092a1b45$exports);
138
- $parcel$exportWildcard(module.exports, $87e953933c683a6a$exports);
137
+ $parcel$exportWildcard(module.exports, $beb108c754cce68d$exports);
138
+ $parcel$exportWildcard(module.exports, $a9279da88ed3f26d$exports);
139
139
 
140
140
 
141
141
  //# sourceMappingURL=main.js.map
package/dist/module.js CHANGED
@@ -1,31 +1,31 @@
1
- import {createFocusManager as $6m0tx$createFocusManager} from "@react-aria/focus";
2
- import {filterDOMProps as $6m0tx$filterDOMProps, mergeProps as $6m0tx$mergeProps} from "@react-aria/utils";
3
- import {useLocale as $6m0tx$useLocale} from "@react-aria/i18n";
4
- import {useRef as $6m0tx$useRef, useEffect as $6m0tx$useEffect} from "react";
1
+ import {createFocusManager as $guTId$createFocusManager} from "@react-aria/focus";
2
+ import {filterDOMProps as $guTId$filterDOMProps, mergeProps as $guTId$mergeProps} from "@react-aria/utils";
3
+ import {useLocale as $guTId$useLocale} from "@react-aria/i18n";
4
+ import {useRef as $guTId$useRef, useEffect as $guTId$useEffect} from "react";
5
5
 
6
6
  function $parcel$export(e, n, v, s) {
7
7
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
8
8
  }
9
- var $b3090da67b33a275$exports = {};
9
+ var $878c90050cf0d952$exports = {};
10
10
 
11
- $parcel$export($b3090da67b33a275$exports, "useActionGroup", () => $b3090da67b33a275$export$f4bf8d43c16de704);
11
+ $parcel$export($878c90050cf0d952$exports, "useActionGroup", () => $878c90050cf0d952$export$f4bf8d43c16de704);
12
12
 
13
13
 
14
14
 
15
- const $b3090da67b33a275$var$BUTTON_GROUP_ROLES = {
15
+ const $878c90050cf0d952$var$BUTTON_GROUP_ROLES = {
16
16
  'none': 'toolbar',
17
17
  'single': 'radiogroup',
18
18
  'multiple': 'toolbar'
19
19
  };
20
- function $b3090da67b33a275$export$f4bf8d43c16de704(props, state, ref) {
20
+ function $878c90050cf0d952$export$f4bf8d43c16de704(props, state, ref) {
21
21
  let { isDisabled: isDisabled , orientation: orientation = 'horizontal' } = props;
22
22
  let allKeys = [
23
23
  ...state.collection.getKeys()
24
24
  ];
25
25
  if (!allKeys.some((key)=>!state.disabledKeys.has(key)
26
26
  )) isDisabled = true;
27
- let { direction: direction } = $6m0tx$useLocale();
28
- let focusManager = $6m0tx$createFocusManager(ref);
27
+ let { direction: direction } = $guTId$useLocale();
28
+ let focusManager = $guTId$createFocusManager(ref);
29
29
  let flipDirection = direction === 'rtl' && orientation === 'horizontal';
30
30
  let onKeyDown = (e)=>{
31
31
  if (!e.currentTarget.contains(e.target)) return;
@@ -54,10 +54,10 @@ function $b3090da67b33a275$export$f4bf8d43c16de704(props, state, ref) {
54
54
  break;
55
55
  }
56
56
  };
57
- let role = $b3090da67b33a275$var$BUTTON_GROUP_ROLES[state.selectionManager.selectionMode];
57
+ let role = $878c90050cf0d952$var$BUTTON_GROUP_ROLES[state.selectionManager.selectionMode];
58
58
  return {
59
59
  actionGroupProps: {
60
- ...$6m0tx$filterDOMProps(props, {
60
+ ...$guTId$filterDOMProps(props, {
61
61
  labelable: true
62
62
  }),
63
63
  role: role,
@@ -69,27 +69,27 @@ function $b3090da67b33a275$export$f4bf8d43c16de704(props, state, ref) {
69
69
  }
70
70
 
71
71
 
72
- var $25a78002b200e341$exports = {};
72
+ var $1ffd55f520044688$exports = {};
73
73
 
74
- $parcel$export($25a78002b200e341$exports, "useActionGroupItem", () => $25a78002b200e341$export$9597202bd3099a29);
74
+ $parcel$export($1ffd55f520044688$exports, "useActionGroupItem", () => $1ffd55f520044688$export$9597202bd3099a29);
75
75
 
76
76
 
77
- const $25a78002b200e341$var$BUTTON_ROLES = {
77
+ const $1ffd55f520044688$var$BUTTON_ROLES = {
78
78
  'none': null,
79
79
  'single': 'radio',
80
80
  'multiple': 'checkbox'
81
81
  };
82
- function $25a78002b200e341$export$9597202bd3099a29(props, state, ref) {
82
+ function $1ffd55f520044688$export$9597202bd3099a29(props, state, ref) {
83
83
  let selectionMode = state.selectionManager.selectionMode;
84
84
  let buttonProps = {
85
- role: $25a78002b200e341$var$BUTTON_ROLES[selectionMode]
85
+ role: $1ffd55f520044688$var$BUTTON_ROLES[selectionMode]
86
86
  };
87
87
  if (selectionMode !== 'none') {
88
88
  let isSelected = state.selectionManager.isSelected(props.key);
89
89
  buttonProps['aria-checked'] = isSelected;
90
90
  }
91
91
  let isFocused = props.key === state.selectionManager.focusedKey;
92
- let lastRender = $6m0tx$useRef({
92
+ let lastRender = $guTId$useRef({
93
93
  isFocused: isFocused,
94
94
  state: state
95
95
  });
@@ -99,13 +99,13 @@ function $25a78002b200e341$export$9597202bd3099a29(props, state, ref) {
99
99
  };
100
100
  // If the focused item is removed from the DOM, reset the focused key to null.
101
101
  // eslint-disable-next-line arrow-body-style
102
- $6m0tx$useEffect(()=>{
102
+ $guTId$useEffect(()=>{
103
103
  return ()=>{
104
104
  if (lastRender.current.isFocused) lastRender.current.state.selectionManager.setFocusedKey(null);
105
105
  };
106
106
  }, []);
107
107
  return {
108
- buttonProps: $6m0tx$mergeProps(buttonProps, {
108
+ buttonProps: $guTId$mergeProps(buttonProps, {
109
109
  tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
110
110
  onFocus () {
111
111
  state.selectionManager.setFocusedKey(props.key);
@@ -120,5 +120,5 @@ function $25a78002b200e341$export$9597202bd3099a29(props, state, ref) {
120
120
 
121
121
 
122
122
 
123
- export {$b3090da67b33a275$export$f4bf8d43c16de704 as useActionGroup, $25a78002b200e341$export$9597202bd3099a29 as useActionGroupItem};
123
+ export {$878c90050cf0d952$export$f4bf8d43c16de704 as useActionGroup, $1ffd55f520044688$export$9597202bd3099a29 as useActionGroupItem};
124
124
  //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/actiongroup",
3
- "version": "3.2.3-nightly.3111+d6ded0736",
3
+ "version": "3.2.3",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,15 +18,15 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-aria/focus": "3.0.0-nightly.1415+d6ded0736",
22
- "@react-aria/i18n": "3.0.0-nightly.1415+d6ded0736",
23
- "@react-aria/interactions": "3.0.0-nightly.1415+d6ded0736",
24
- "@react-aria/selection": "3.0.0-nightly.1415+d6ded0736",
25
- "@react-aria/utils": "3.0.0-nightly.1415+d6ded0736",
26
- "@react-stately/collections": "3.0.0-nightly.1415+d6ded0736",
27
- "@react-stately/list": "3.4.3-nightly.3111+d6ded0736",
28
- "@react-types/actiongroup": "3.2.3-nightly.3111+d6ded0736",
29
- "@react-types/shared": "3.0.0-nightly.1415+d6ded0736"
21
+ "@react-aria/focus": "^3.5.2",
22
+ "@react-aria/i18n": "^3.3.6",
23
+ "@react-aria/interactions": "^3.8.1",
24
+ "@react-aria/selection": "^3.7.3",
25
+ "@react-aria/utils": "^3.11.2",
26
+ "@react-stately/collections": "^3.3.6",
27
+ "@react-stately/list": "^3.4.3",
28
+ "@react-types/actiongroup": "^3.2.3",
29
+ "@react-types/shared": "^3.11.1"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": "^16.8.0 || ^17.0.0-rc.1"
@@ -34,5 +34,5 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "gitHead": "d6ded0736edd4c36d0abeb1ae615cacfa90ea8ff"
37
+ "gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
38
38
  }