@react-aria/listbox 3.12.1-nightly.4623 → 3.12.1

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.
@@ -30,12 +30,12 @@ function $a3ce5bb3074610af$export$50eacbbf140a3141(props, state, ref) {
30
30
  labelable: true
31
31
  });
32
32
  // Use props instead of state here. We don't want this to change due to long press.
33
- let selectionBehavior = props.selectionBehavior || "toggle";
34
- let linkBehavior = props.linkBehavior || (selectionBehavior === "replace" ? "action" : "override");
35
- if (selectionBehavior === "toggle" && linkBehavior === "action") // linkBehavior="action" does not work with selectionBehavior="toggle" because there is no way
33
+ let selectionBehavior = props.selectionBehavior || 'toggle';
34
+ let linkBehavior = props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');
35
+ if (selectionBehavior === 'toggle' && linkBehavior === 'action') // linkBehavior="action" does not work with selectionBehavior="toggle" because there is no way
36
36
  // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be
37
37
  // selectable in this configuration.
38
- linkBehavior = "override";
38
+ linkBehavior = 'override';
39
39
  let { listProps: listProps } = (0, $eCULP$reactariaselection.useSelectableList)({
40
40
  ...props,
41
41
  ref: ref,
@@ -65,14 +65,14 @@ function $a3ce5bb3074610af$export$50eacbbf140a3141(props, state, ref) {
65
65
  id: id,
66
66
  // listbox is not an HTML input element so it
67
67
  // shouldn't be labeled by a <label> element.
68
- labelElementType: "span"
68
+ labelElementType: 'span'
69
69
  });
70
70
  return {
71
71
  labelProps: labelProps,
72
- listBoxProps: (0, $eCULP$reactariautils.mergeProps)(domProps, focusWithinProps, state.selectionManager.selectionMode === "multiple" ? {
73
- "aria-multiselectable": "true"
72
+ listBoxProps: (0, $eCULP$reactariautils.mergeProps)(domProps, focusWithinProps, state.selectionManager.selectionMode === 'multiple' ? {
73
+ 'aria-multiselectable': 'true'
74
74
  } : {}, {
75
- role: "listbox",
75
+ role: 'listbox',
76
76
  ...(0, $eCULP$reactariautils.mergeProps)(fieldProps, listProps)
77
77
  })
78
78
  };
@@ -24,12 +24,12 @@ function $c132121280ec012d$export$50eacbbf140a3141(props, state, ref) {
24
24
  labelable: true
25
25
  });
26
26
  // Use props instead of state here. We don't want this to change due to long press.
27
- let selectionBehavior = props.selectionBehavior || "toggle";
28
- let linkBehavior = props.linkBehavior || (selectionBehavior === "replace" ? "action" : "override");
29
- if (selectionBehavior === "toggle" && linkBehavior === "action") // linkBehavior="action" does not work with selectionBehavior="toggle" because there is no way
27
+ let selectionBehavior = props.selectionBehavior || 'toggle';
28
+ let linkBehavior = props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');
29
+ if (selectionBehavior === 'toggle' && linkBehavior === 'action') // linkBehavior="action" does not work with selectionBehavior="toggle" because there is no way
30
30
  // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be
31
31
  // selectable in this configuration.
32
- linkBehavior = "override";
32
+ linkBehavior = 'override';
33
33
  let { listProps: listProps } = (0, $by1yQ$useSelectableList)({
34
34
  ...props,
35
35
  ref: ref,
@@ -59,14 +59,14 @@ function $c132121280ec012d$export$50eacbbf140a3141(props, state, ref) {
59
59
  id: id,
60
60
  // listbox is not an HTML input element so it
61
61
  // shouldn't be labeled by a <label> element.
62
- labelElementType: "span"
62
+ labelElementType: 'span'
63
63
  });
64
64
  return {
65
65
  labelProps: labelProps,
66
- listBoxProps: (0, $by1yQ$mergeProps)(domProps, focusWithinProps, state.selectionManager.selectionMode === "multiple" ? {
67
- "aria-multiselectable": "true"
66
+ listBoxProps: (0, $by1yQ$mergeProps)(domProps, focusWithinProps, state.selectionManager.selectionMode === 'multiple' ? {
67
+ 'aria-multiselectable': 'true'
68
68
  } : {}, {
69
- role: "listbox",
69
+ role: 'listbox',
70
70
  ...(0, $by1yQ$mergeProps)(fieldProps, listProps)
71
71
  })
72
72
  };
@@ -24,12 +24,12 @@ function $c132121280ec012d$export$50eacbbf140a3141(props, state, ref) {
24
24
  labelable: true
25
25
  });
26
26
  // Use props instead of state here. We don't want this to change due to long press.
27
- let selectionBehavior = props.selectionBehavior || "toggle";
28
- let linkBehavior = props.linkBehavior || (selectionBehavior === "replace" ? "action" : "override");
29
- if (selectionBehavior === "toggle" && linkBehavior === "action") // linkBehavior="action" does not work with selectionBehavior="toggle" because there is no way
27
+ let selectionBehavior = props.selectionBehavior || 'toggle';
28
+ let linkBehavior = props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');
29
+ if (selectionBehavior === 'toggle' && linkBehavior === 'action') // linkBehavior="action" does not work with selectionBehavior="toggle" because there is no way
30
30
  // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be
31
31
  // selectable in this configuration.
32
- linkBehavior = "override";
32
+ linkBehavior = 'override';
33
33
  let { listProps: listProps } = (0, $by1yQ$useSelectableList)({
34
34
  ...props,
35
35
  ref: ref,
@@ -59,14 +59,14 @@ function $c132121280ec012d$export$50eacbbf140a3141(props, state, ref) {
59
59
  id: id,
60
60
  // listbox is not an HTML input element so it
61
61
  // shouldn't be labeled by a <label> element.
62
- labelElementType: "span"
62
+ labelElementType: 'span'
63
63
  });
64
64
  return {
65
65
  labelProps: labelProps,
66
- listBoxProps: (0, $by1yQ$mergeProps)(domProps, focusWithinProps, state.selectionManager.selectionMode === "multiple" ? {
67
- "aria-multiselectable": "true"
66
+ listBoxProps: (0, $by1yQ$mergeProps)(domProps, focusWithinProps, state.selectionManager.selectionMode === 'multiple' ? {
67
+ 'aria-multiselectable': 'true'
68
68
  } : {}, {
69
- role: "listbox",
69
+ role: 'listbox',
70
70
  ...(0, $by1yQ$mergeProps)(fieldProps, listProps)
71
71
  })
72
72
  };
@@ -18,23 +18,23 @@ $parcel$export(module.exports, "useListBoxSection", () => $f32afd5f225c3320$expo
18
18
  * governing permissions and limitations under the License.
19
19
  */
20
20
  function $f32afd5f225c3320$export$c3f9f39876e4bc7(props) {
21
- let { heading: heading, "aria-label": ariaLabel } = props;
21
+ let { heading: heading, 'aria-label': ariaLabel } = props;
22
22
  let headingId = (0, $bAsD1$reactariautils.useId)();
23
23
  return {
24
24
  itemProps: {
25
- role: "presentation"
25
+ role: 'presentation'
26
26
  },
27
27
  headingProps: heading ? {
28
28
  // Techincally, listbox cannot contain headings according to ARIA.
29
29
  // We hide the heading from assistive technology, using role="presentation",
30
30
  // and only use it as a visual label for the nested group.
31
31
  id: headingId,
32
- role: "presentation"
32
+ role: 'presentation'
33
33
  } : {},
34
34
  groupProps: {
35
- role: "group",
36
- "aria-label": ariaLabel,
37
- "aria-labelledby": heading ? headingId : undefined
35
+ role: 'group',
36
+ 'aria-label': ariaLabel,
37
+ 'aria-labelledby': heading ? headingId : undefined
38
38
  }
39
39
  };
40
40
  }
@@ -12,23 +12,23 @@ import {useId as $8pE4M$useId} from "@react-aria/utils";
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
  function $af383d3bef1cfdc9$export$c3f9f39876e4bc7(props) {
15
- let { heading: heading, "aria-label": ariaLabel } = props;
15
+ let { heading: heading, 'aria-label': ariaLabel } = props;
16
16
  let headingId = (0, $8pE4M$useId)();
17
17
  return {
18
18
  itemProps: {
19
- role: "presentation"
19
+ role: 'presentation'
20
20
  },
21
21
  headingProps: heading ? {
22
22
  // Techincally, listbox cannot contain headings according to ARIA.
23
23
  // We hide the heading from assistive technology, using role="presentation",
24
24
  // and only use it as a visual label for the nested group.
25
25
  id: headingId,
26
- role: "presentation"
26
+ role: 'presentation'
27
27
  } : {},
28
28
  groupProps: {
29
- role: "group",
30
- "aria-label": ariaLabel,
31
- "aria-labelledby": heading ? headingId : undefined
29
+ role: 'group',
30
+ 'aria-label': ariaLabel,
31
+ 'aria-labelledby': heading ? headingId : undefined
32
32
  }
33
33
  };
34
34
  }
@@ -12,23 +12,23 @@ import {useId as $8pE4M$useId} from "@react-aria/utils";
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
  function $af383d3bef1cfdc9$export$c3f9f39876e4bc7(props) {
15
- let { heading: heading, "aria-label": ariaLabel } = props;
15
+ let { heading: heading, 'aria-label': ariaLabel } = props;
16
16
  let headingId = (0, $8pE4M$useId)();
17
17
  return {
18
18
  itemProps: {
19
- role: "presentation"
19
+ role: 'presentation'
20
20
  },
21
21
  headingProps: heading ? {
22
22
  // Techincally, listbox cannot contain headings according to ARIA.
23
23
  // We hide the heading from assistive technology, using role="presentation",
24
24
  // and only use it as a visual label for the nested group.
25
25
  id: headingId,
26
- role: "presentation"
26
+ role: 'presentation'
27
27
  } : {},
28
28
  groupProps: {
29
- role: "group",
30
- "aria-label": ariaLabel,
31
- "aria-labelledby": heading ? headingId : undefined
29
+ role: 'group',
30
+ 'aria-label': ariaLabel,
31
+ 'aria-labelledby': heading ? headingId : undefined
32
32
  }
33
33
  };
34
34
  }
@@ -44,23 +44,23 @@ function $c164f9f79f4cef2d$export$497855f14858aa34(props, state, ref) {
44
44
  let labelId = (0, $bOFHO$reactariautils.useSlotId)();
45
45
  let descriptionId = (0, $bOFHO$reactariautils.useSlotId)();
46
46
  let optionProps = {
47
- role: "option",
48
- "aria-disabled": isDisabled || undefined,
49
- "aria-selected": state.selectionManager.selectionMode !== "none" ? isSelected : undefined
47
+ role: 'option',
48
+ 'aria-disabled': isDisabled || undefined,
49
+ 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined
50
50
  };
51
51
  // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply "text".
52
52
  // We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent.
53
53
  // https://bugs.webkit.org/show_bug.cgi?id=209279
54
54
  if (!((0, $bOFHO$reactariautils.isMac)() && (0, $bOFHO$reactariautils.isWebKit)())) {
55
- optionProps["aria-label"] = props["aria-label"];
56
- optionProps["aria-labelledby"] = labelId;
57
- optionProps["aria-describedby"] = descriptionId;
55
+ optionProps['aria-label'] = props['aria-label'];
56
+ optionProps['aria-labelledby'] = labelId;
57
+ optionProps['aria-describedby'] = descriptionId;
58
58
  }
59
59
  let item = state.collection.getItem(key);
60
60
  if (isVirtualized) {
61
61
  let index = Number(item === null || item === void 0 ? void 0 : item.index);
62
- optionProps["aria-posinset"] = Number.isNaN(index) ? undefined : index + 1;
63
- optionProps["aria-setsize"] = (0, $bOFHO$reactstatelycollections.getItemCount)(state.collection);
62
+ optionProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;
63
+ optionProps['aria-setsize'] = (0, $bOFHO$reactstatelycollections.getItemCount)(state.collection);
64
64
  }
65
65
  let onAction = (data === null || data === void 0 ? void 0 : data.onAction) ? ()=>{
66
66
  var _data_onAction;
@@ -38,23 +38,23 @@ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
38
38
  let labelId = (0, $fcwmx$useSlotId)();
39
39
  let descriptionId = (0, $fcwmx$useSlotId)();
40
40
  let optionProps = {
41
- role: "option",
42
- "aria-disabled": isDisabled || undefined,
43
- "aria-selected": state.selectionManager.selectionMode !== "none" ? isSelected : undefined
41
+ role: 'option',
42
+ 'aria-disabled': isDisabled || undefined,
43
+ 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined
44
44
  };
45
45
  // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply "text".
46
46
  // We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent.
47
47
  // https://bugs.webkit.org/show_bug.cgi?id=209279
48
48
  if (!((0, $fcwmx$isMac)() && (0, $fcwmx$isWebKit)())) {
49
- optionProps["aria-label"] = props["aria-label"];
50
- optionProps["aria-labelledby"] = labelId;
51
- optionProps["aria-describedby"] = descriptionId;
49
+ optionProps['aria-label'] = props['aria-label'];
50
+ optionProps['aria-labelledby'] = labelId;
51
+ optionProps['aria-describedby'] = descriptionId;
52
52
  }
53
53
  let item = state.collection.getItem(key);
54
54
  if (isVirtualized) {
55
55
  let index = Number(item === null || item === void 0 ? void 0 : item.index);
56
- optionProps["aria-posinset"] = Number.isNaN(index) ? undefined : index + 1;
57
- optionProps["aria-setsize"] = (0, $fcwmx$getItemCount)(state.collection);
56
+ optionProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;
57
+ optionProps['aria-setsize'] = (0, $fcwmx$getItemCount)(state.collection);
58
58
  }
59
59
  let onAction = (data === null || data === void 0 ? void 0 : data.onAction) ? ()=>{
60
60
  var _data_onAction;
@@ -38,23 +38,23 @@ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
38
38
  let labelId = (0, $fcwmx$useSlotId)();
39
39
  let descriptionId = (0, $fcwmx$useSlotId)();
40
40
  let optionProps = {
41
- role: "option",
42
- "aria-disabled": isDisabled || undefined,
43
- "aria-selected": state.selectionManager.selectionMode !== "none" ? isSelected : undefined
41
+ role: 'option',
42
+ 'aria-disabled': isDisabled || undefined,
43
+ 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined
44
44
  };
45
45
  // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply "text".
46
46
  // We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent.
47
47
  // https://bugs.webkit.org/show_bug.cgi?id=209279
48
48
  if (!((0, $fcwmx$isMac)() && (0, $fcwmx$isWebKit)())) {
49
- optionProps["aria-label"] = props["aria-label"];
50
- optionProps["aria-labelledby"] = labelId;
51
- optionProps["aria-describedby"] = descriptionId;
49
+ optionProps['aria-label'] = props['aria-label'];
50
+ optionProps['aria-labelledby'] = labelId;
51
+ optionProps['aria-describedby'] = descriptionId;
52
52
  }
53
53
  let item = state.collection.getItem(key);
54
54
  if (isVirtualized) {
55
55
  let index = Number(item === null || item === void 0 ? void 0 : item.index);
56
- optionProps["aria-posinset"] = Number.isNaN(index) ? undefined : index + 1;
57
- optionProps["aria-setsize"] = (0, $fcwmx$getItemCount)(state.collection);
56
+ optionProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;
57
+ optionProps['aria-setsize'] = (0, $fcwmx$getItemCount)(state.collection);
58
58
  }
59
59
  let onAction = (data === null || data === void 0 ? void 0 : data.onAction) ? ()=>{
60
60
  var _data_onAction;
@@ -17,12 +17,12 @@ $parcel$export(module.exports, "getItemId", () => $87beb89ab4a308fd$export$91459
17
17
  * governing permissions and limitations under the License.
18
18
  */ const $87beb89ab4a308fd$export$3585ede4d035bf14 = new WeakMap();
19
19
  function $87beb89ab4a308fd$var$normalizeKey(key) {
20
- if (typeof key === "string") return key.replace(/\s*/g, "");
21
- return "" + key;
20
+ if (typeof key === 'string') return key.replace(/\s*/g, '');
21
+ return '' + key;
22
22
  }
23
23
  function $87beb89ab4a308fd$export$9145995848b05025(state, itemKey) {
24
24
  let data = $87beb89ab4a308fd$export$3585ede4d035bf14.get(state);
25
- if (!data) throw new Error("Unknown list");
25
+ if (!data) throw new Error('Unknown list');
26
26
  return `${data.id}-option-${$87beb89ab4a308fd$var$normalizeKey(itemKey)}`;
27
27
  }
28
28
 
package/dist/utils.mjs CHANGED
@@ -10,12 +10,12 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */ const $b1f0cad8af73213b$export$3585ede4d035bf14 = new WeakMap();
12
12
  function $b1f0cad8af73213b$var$normalizeKey(key) {
13
- if (typeof key === "string") return key.replace(/\s*/g, "");
14
- return "" + key;
13
+ if (typeof key === 'string') return key.replace(/\s*/g, '');
14
+ return '' + key;
15
15
  }
16
16
  function $b1f0cad8af73213b$export$9145995848b05025(state, itemKey) {
17
17
  let data = $b1f0cad8af73213b$export$3585ede4d035bf14.get(state);
18
- if (!data) throw new Error("Unknown list");
18
+ if (!data) throw new Error('Unknown list');
19
19
  return `${data.id}-option-${$b1f0cad8af73213b$var$normalizeKey(itemKey)}`;
20
20
  }
21
21
 
@@ -10,12 +10,12 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */ const $b1f0cad8af73213b$export$3585ede4d035bf14 = new WeakMap();
12
12
  function $b1f0cad8af73213b$var$normalizeKey(key) {
13
- if (typeof key === "string") return key.replace(/\s*/g, "");
14
- return "" + key;
13
+ if (typeof key === 'string') return key.replace(/\s*/g, '');
14
+ return '' + key;
15
15
  }
16
16
  function $b1f0cad8af73213b$export$9145995848b05025(state, itemKey) {
17
17
  let data = $b1f0cad8af73213b$export$3585ede4d035bf14.get(state);
18
- if (!data) throw new Error("Unknown list");
18
+ if (!data) throw new Error('Unknown list');
19
19
  return `${data.id}-option-${$b1f0cad8af73213b$var$normalizeKey(itemKey)}`;
20
20
  }
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/listbox",
3
- "version": "3.12.1-nightly.4623+b294de874",
3
+ "version": "3.12.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,14 +22,14 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-aria/interactions": "3.0.0-nightly.2911+b294de874",
26
- "@react-aria/label": "3.0.0-nightly.2911+b294de874",
27
- "@react-aria/selection": "3.0.0-nightly.2911+b294de874",
28
- "@react-aria/utils": "3.0.0-nightly.2911+b294de874",
29
- "@react-stately/collections": "3.0.0-nightly.2911+b294de874",
30
- "@react-stately/list": "3.10.5-nightly.4623+b294de874",
31
- "@react-types/listbox": "3.4.9-nightly.4623+b294de874",
32
- "@react-types/shared": "3.0.0-nightly.2911+b294de874",
25
+ "@react-aria/interactions": "^3.21.3",
26
+ "@react-aria/label": "^3.7.8",
27
+ "@react-aria/selection": "^3.18.1",
28
+ "@react-aria/utils": "^3.24.1",
29
+ "@react-stately/collections": "^3.10.7",
30
+ "@react-stately/list": "^3.10.5",
31
+ "@react-types/listbox": "^3.4.9",
32
+ "@react-types/shared": "^3.23.1",
33
33
  "@swc/helpers": "^0.5.0"
34
34
  },
35
35
  "peerDependencies": {
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "b294de874c16fad64bc4b930ccee1c9ffeb1c20f"
42
+ "gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
43
43
  }