@react-spectrum/breadcrumbs 3.2.5 → 3.2.6

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,17 +1,17 @@
1
1
  require("./main.css");
2
- var $mvOWt$reactstatelycollections = require("@react-stately/collections");
3
- var $mvOWt$reactspectrumbutton = require("@react-spectrum/button");
4
- var $mvOWt$reactspectrumutils = require("@react-spectrum/utils");
5
- var $mvOWt$spectrumiconsuiFolderBreadcrumb = require("@spectrum-icons/ui/FolderBreadcrumb");
6
- var $mvOWt$reactspectrummenu = require("@react-spectrum/menu");
7
- var $mvOWt$react = require("react");
8
- var $mvOWt$reactariabreadcrumbs = require("@react-aria/breadcrumbs");
9
- var $mvOWt$reactariautils = require("@react-aria/utils");
10
- var $mvOWt$reactspectrumprovider = require("@react-spectrum/provider");
11
- var $mvOWt$spectrumiconsuiChevronRightSmall = require("@spectrum-icons/ui/ChevronRightSmall");
12
- var $mvOWt$reactariafocus = require("@react-aria/focus");
13
- var $mvOWt$reactariainteractions = require("@react-aria/interactions");
14
- var $mvOWt$reactariai18n = require("@react-aria/i18n");
2
+ var $6zINN$reactstatelycollections = require("@react-stately/collections");
3
+ var $6zINN$reactspectrumbutton = require("@react-spectrum/button");
4
+ var $6zINN$reactspectrumutils = require("@react-spectrum/utils");
5
+ var $6zINN$spectrumiconsuiFolderBreadcrumb = require("@spectrum-icons/ui/FolderBreadcrumb");
6
+ var $6zINN$reactspectrummenu = require("@react-spectrum/menu");
7
+ var $6zINN$react = require("react");
8
+ var $6zINN$reactariabreadcrumbs = require("@react-aria/breadcrumbs");
9
+ var $6zINN$reactariautils = require("@react-aria/utils");
10
+ var $6zINN$reactspectrumprovider = require("@react-spectrum/provider");
11
+ var $6zINN$spectrumiconsuiChevronRightSmall = require("@spectrum-icons/ui/ChevronRightSmall");
12
+ var $6zINN$reactariafocus = require("@react-aria/focus");
13
+ var $6zINN$reactariainteractions = require("@react-aria/interactions");
14
+ var $6zINN$reactariai18n = require("@react-aria/i18n");
15
15
 
16
16
  function $parcel$export(e, n, v, s) {
17
17
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
@@ -36,92 +36,92 @@ function $parcel$interopDefault(a) {
36
36
  return a && a.__esModule ? a.default : a;
37
37
  }
38
38
 
39
- $parcel$export(module.exports, "Item", () => $mvOWt$reactstatelycollections.Item);
40
- var $e4fb3abd98f85208$exports = {};
41
-
42
- $parcel$export($e4fb3abd98f85208$exports, "Breadcrumbs", () => $e4fb3abd98f85208$export$2dc68d50d56fbbd);
43
-
44
-
45
-
46
-
47
-
48
-
49
- var $e406fe8ae3922b89$exports = {};
50
-
51
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-Breadcrumbs", () => $e406fe8ae3922b89$export$8c6320d2db82081f, (v) => $e406fe8ae3922b89$export$8c6320d2db82081f = v);
52
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-Breadcrumbs-itemSeparator", () => $e406fe8ae3922b89$export$f72910e36cd91d1e, (v) => $e406fe8ae3922b89$export$f72910e36cd91d1e = v);
53
- $parcel$export($e406fe8ae3922b89$exports, "is-reversed", () => $e406fe8ae3922b89$export$a4561bd665abb5db, (v) => $e406fe8ae3922b89$export$a4561bd665abb5db = v);
54
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-Breadcrumbs-item", () => $e406fe8ae3922b89$export$492a5983c5fbf603, (v) => $e406fe8ae3922b89$export$492a5983c5fbf603 = v);
55
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-ActionButton", () => $e406fe8ae3922b89$export$53da69f51b770d3, (v) => $e406fe8ae3922b89$export$53da69f51b770d3 = v);
56
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-Breadcrumbs-itemLink", () => $e406fe8ae3922b89$export$5af6a1bcd207d9f6, (v) => $e406fe8ae3922b89$export$5af6a1bcd207d9f6 = v);
57
- $parcel$export($e406fe8ae3922b89$exports, "is-hovered", () => $e406fe8ae3922b89$export$b8813cd5d7824ce7, (v) => $e406fe8ae3922b89$export$b8813cd5d7824ce7 = v);
58
- $parcel$export($e406fe8ae3922b89$exports, "focus-ring", () => $e406fe8ae3922b89$export$f39a09f249340e2a, (v) => $e406fe8ae3922b89$export$f39a09f249340e2a = v);
59
- $parcel$export($e406fe8ae3922b89$exports, "is-dragged", () => $e406fe8ae3922b89$export$8778c911bed6c759, (v) => $e406fe8ae3922b89$export$8778c911bed6c759 = v);
60
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-Breadcrumbs--small", () => $e406fe8ae3922b89$export$e01337e7944312f6, (v) => $e406fe8ae3922b89$export$e01337e7944312f6 = v);
61
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-Breadcrumbs--medium", () => $e406fe8ae3922b89$export$19f957201d941895, (v) => $e406fe8ae3922b89$export$19f957201d941895 = v);
62
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-Breadcrumbs--multiline", () => $e406fe8ae3922b89$export$713961e8e432825b, (v) => $e406fe8ae3922b89$export$713961e8e432825b = v);
63
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-Heading--pageTitle", () => $e406fe8ae3922b89$export$63e9e087a73f808b, (v) => $e406fe8ae3922b89$export$63e9e087a73f808b = v);
64
- $parcel$export($e406fe8ae3922b89$exports, "is-disabled", () => $e406fe8ae3922b89$export$d35bc1e505d1ebbf, (v) => $e406fe8ae3922b89$export$d35bc1e505d1ebbf = v);
65
- $parcel$export($e406fe8ae3922b89$exports, "is-selected", () => $e406fe8ae3922b89$export$1e0fb04f31d3c22a, (v) => $e406fe8ae3922b89$export$1e0fb04f31d3c22a = v);
66
- $parcel$export($e406fe8ae3922b89$exports, "spectrum-Breadcrumb", () => $e406fe8ae3922b89$export$45a5316056cfac3c, (v) => $e406fe8ae3922b89$export$45a5316056cfac3c = v);
67
- var $e406fe8ae3922b89$export$8c6320d2db82081f;
68
- var $e406fe8ae3922b89$export$f72910e36cd91d1e;
69
- var $e406fe8ae3922b89$export$a4561bd665abb5db;
70
- var $e406fe8ae3922b89$export$492a5983c5fbf603;
71
- var $e406fe8ae3922b89$export$53da69f51b770d3;
72
- var $e406fe8ae3922b89$export$5af6a1bcd207d9f6;
73
- var $e406fe8ae3922b89$export$b8813cd5d7824ce7;
74
- var $e406fe8ae3922b89$export$f39a09f249340e2a;
75
- var $e406fe8ae3922b89$export$8778c911bed6c759;
76
- var $e406fe8ae3922b89$export$e01337e7944312f6;
77
- var $e406fe8ae3922b89$export$19f957201d941895;
78
- var $e406fe8ae3922b89$export$713961e8e432825b;
79
- var $e406fe8ae3922b89$export$63e9e087a73f808b;
80
- var $e406fe8ae3922b89$export$d35bc1e505d1ebbf;
81
- var $e406fe8ae3922b89$export$1e0fb04f31d3c22a;
82
- var $e406fe8ae3922b89$export$45a5316056cfac3c;
83
- $e406fe8ae3922b89$export$8c6320d2db82081f = "spectrum-Breadcrumbs_3fe6e8";
84
- $e406fe8ae3922b89$export$f72910e36cd91d1e = "spectrum-Breadcrumbs-itemSeparator_3fe6e8";
85
- $e406fe8ae3922b89$export$a4561bd665abb5db = "is-reversed_3fe6e8";
86
- $e406fe8ae3922b89$export$492a5983c5fbf603 = "spectrum-Breadcrumbs-item_3fe6e8";
87
- $e406fe8ae3922b89$export$53da69f51b770d3 = "spectrum-ActionButton_3fe6e8";
88
- $e406fe8ae3922b89$export$5af6a1bcd207d9f6 = "spectrum-Breadcrumbs-itemLink_3fe6e8";
89
- $e406fe8ae3922b89$export$b8813cd5d7824ce7 = "is-hovered_3fe6e8";
90
- $e406fe8ae3922b89$export$f39a09f249340e2a = "focus-ring_3fe6e8";
91
- $e406fe8ae3922b89$export$8778c911bed6c759 = "is-dragged_3fe6e8";
92
- $e406fe8ae3922b89$export$e01337e7944312f6 = "spectrum-Breadcrumbs--small_3fe6e8";
93
- $e406fe8ae3922b89$export$19f957201d941895 = "spectrum-Breadcrumbs--medium_3fe6e8";
94
- $e406fe8ae3922b89$export$713961e8e432825b = "spectrum-Breadcrumbs--multiline_3fe6e8";
95
- $e406fe8ae3922b89$export$63e9e087a73f808b = "spectrum-Heading--pageTitle_3fe6e8";
96
- $e406fe8ae3922b89$export$d35bc1e505d1ebbf = "is-disabled_3fe6e8";
97
- $e406fe8ae3922b89$export$1e0fb04f31d3c22a = "is-selected_3fe6e8";
98
- $e406fe8ae3922b89$export$45a5316056cfac3c = "spectrum-Breadcrumb_3fe6e8";
99
-
100
-
101
-
102
-
103
-
104
- function $b3ff5736da6bbffa$export$c13f210c706eb549(props) {
39
+ $parcel$export(module.exports, "Item", () => $6zINN$reactstatelycollections.Item);
40
+ var $ce45029bf0c8e0f0$exports = {};
41
+
42
+ $parcel$export($ce45029bf0c8e0f0$exports, "Breadcrumbs", () => $ce45029bf0c8e0f0$export$2dc68d50d56fbbd);
43
+
44
+
45
+
46
+
47
+
48
+
49
+ var $7d405af0aae01906$exports = {};
50
+
51
+ $parcel$export($7d405af0aae01906$exports, "spectrum-Breadcrumbs", () => $7d405af0aae01906$export$8c6320d2db82081f, (v) => $7d405af0aae01906$export$8c6320d2db82081f = v);
52
+ $parcel$export($7d405af0aae01906$exports, "spectrum-Breadcrumbs-itemSeparator", () => $7d405af0aae01906$export$f72910e36cd91d1e, (v) => $7d405af0aae01906$export$f72910e36cd91d1e = v);
53
+ $parcel$export($7d405af0aae01906$exports, "is-reversed", () => $7d405af0aae01906$export$a4561bd665abb5db, (v) => $7d405af0aae01906$export$a4561bd665abb5db = v);
54
+ $parcel$export($7d405af0aae01906$exports, "spectrum-Breadcrumbs-item", () => $7d405af0aae01906$export$492a5983c5fbf603, (v) => $7d405af0aae01906$export$492a5983c5fbf603 = v);
55
+ $parcel$export($7d405af0aae01906$exports, "spectrum-ActionButton", () => $7d405af0aae01906$export$53da69f51b770d3, (v) => $7d405af0aae01906$export$53da69f51b770d3 = v);
56
+ $parcel$export($7d405af0aae01906$exports, "spectrum-Breadcrumbs-itemLink", () => $7d405af0aae01906$export$5af6a1bcd207d9f6, (v) => $7d405af0aae01906$export$5af6a1bcd207d9f6 = v);
57
+ $parcel$export($7d405af0aae01906$exports, "is-hovered", () => $7d405af0aae01906$export$b8813cd5d7824ce7, (v) => $7d405af0aae01906$export$b8813cd5d7824ce7 = v);
58
+ $parcel$export($7d405af0aae01906$exports, "focus-ring", () => $7d405af0aae01906$export$f39a09f249340e2a, (v) => $7d405af0aae01906$export$f39a09f249340e2a = v);
59
+ $parcel$export($7d405af0aae01906$exports, "is-dragged", () => $7d405af0aae01906$export$8778c911bed6c759, (v) => $7d405af0aae01906$export$8778c911bed6c759 = v);
60
+ $parcel$export($7d405af0aae01906$exports, "spectrum-Breadcrumbs--small", () => $7d405af0aae01906$export$e01337e7944312f6, (v) => $7d405af0aae01906$export$e01337e7944312f6 = v);
61
+ $parcel$export($7d405af0aae01906$exports, "spectrum-Breadcrumbs--medium", () => $7d405af0aae01906$export$19f957201d941895, (v) => $7d405af0aae01906$export$19f957201d941895 = v);
62
+ $parcel$export($7d405af0aae01906$exports, "spectrum-Breadcrumbs--multiline", () => $7d405af0aae01906$export$713961e8e432825b, (v) => $7d405af0aae01906$export$713961e8e432825b = v);
63
+ $parcel$export($7d405af0aae01906$exports, "spectrum-Heading--pageTitle", () => $7d405af0aae01906$export$63e9e087a73f808b, (v) => $7d405af0aae01906$export$63e9e087a73f808b = v);
64
+ $parcel$export($7d405af0aae01906$exports, "is-disabled", () => $7d405af0aae01906$export$d35bc1e505d1ebbf, (v) => $7d405af0aae01906$export$d35bc1e505d1ebbf = v);
65
+ $parcel$export($7d405af0aae01906$exports, "is-selected", () => $7d405af0aae01906$export$1e0fb04f31d3c22a, (v) => $7d405af0aae01906$export$1e0fb04f31d3c22a = v);
66
+ $parcel$export($7d405af0aae01906$exports, "spectrum-Breadcrumb", () => $7d405af0aae01906$export$45a5316056cfac3c, (v) => $7d405af0aae01906$export$45a5316056cfac3c = v);
67
+ var $7d405af0aae01906$export$8c6320d2db82081f;
68
+ var $7d405af0aae01906$export$f72910e36cd91d1e;
69
+ var $7d405af0aae01906$export$a4561bd665abb5db;
70
+ var $7d405af0aae01906$export$492a5983c5fbf603;
71
+ var $7d405af0aae01906$export$53da69f51b770d3;
72
+ var $7d405af0aae01906$export$5af6a1bcd207d9f6;
73
+ var $7d405af0aae01906$export$b8813cd5d7824ce7;
74
+ var $7d405af0aae01906$export$f39a09f249340e2a;
75
+ var $7d405af0aae01906$export$8778c911bed6c759;
76
+ var $7d405af0aae01906$export$e01337e7944312f6;
77
+ var $7d405af0aae01906$export$19f957201d941895;
78
+ var $7d405af0aae01906$export$713961e8e432825b;
79
+ var $7d405af0aae01906$export$63e9e087a73f808b;
80
+ var $7d405af0aae01906$export$d35bc1e505d1ebbf;
81
+ var $7d405af0aae01906$export$1e0fb04f31d3c22a;
82
+ var $7d405af0aae01906$export$45a5316056cfac3c;
83
+ $7d405af0aae01906$export$8c6320d2db82081f = "spectrum-Breadcrumbs_3fe6e8";
84
+ $7d405af0aae01906$export$f72910e36cd91d1e = "spectrum-Breadcrumbs-itemSeparator_3fe6e8";
85
+ $7d405af0aae01906$export$a4561bd665abb5db = "is-reversed_3fe6e8";
86
+ $7d405af0aae01906$export$492a5983c5fbf603 = "spectrum-Breadcrumbs-item_3fe6e8";
87
+ $7d405af0aae01906$export$53da69f51b770d3 = "spectrum-ActionButton_3fe6e8";
88
+ $7d405af0aae01906$export$5af6a1bcd207d9f6 = "spectrum-Breadcrumbs-itemLink_3fe6e8";
89
+ $7d405af0aae01906$export$b8813cd5d7824ce7 = "is-hovered_3fe6e8";
90
+ $7d405af0aae01906$export$f39a09f249340e2a = "focus-ring_3fe6e8";
91
+ $7d405af0aae01906$export$8778c911bed6c759 = "is-dragged_3fe6e8";
92
+ $7d405af0aae01906$export$e01337e7944312f6 = "spectrum-Breadcrumbs--small_3fe6e8";
93
+ $7d405af0aae01906$export$19f957201d941895 = "spectrum-Breadcrumbs--medium_3fe6e8";
94
+ $7d405af0aae01906$export$713961e8e432825b = "spectrum-Breadcrumbs--multiline_3fe6e8";
95
+ $7d405af0aae01906$export$63e9e087a73f808b = "spectrum-Heading--pageTitle_3fe6e8";
96
+ $7d405af0aae01906$export$d35bc1e505d1ebbf = "is-disabled_3fe6e8";
97
+ $7d405af0aae01906$export$1e0fb04f31d3c22a = "is-selected_3fe6e8";
98
+ $7d405af0aae01906$export$45a5316056cfac3c = "spectrum-Breadcrumb_3fe6e8";
99
+
100
+
101
+
102
+
103
+
104
+ function $01a6adf6454cb0d0$export$c13f210c706eb549(props) {
105
105
  let { children: children , isCurrent: isCurrent , isDisabled: isDisabled } = props;
106
- let { direction: direction } = $mvOWt$reactariai18n.useLocale();
107
- let ref = $mvOWt$react.useRef();
108
- let { itemProps: itemProps } = $mvOWt$reactariabreadcrumbs.useBreadcrumbItem({
106
+ let { direction: direction } = $6zINN$reactariai18n.useLocale();
107
+ let ref = $6zINN$react.useRef();
108
+ let { itemProps: itemProps } = $6zINN$reactariabreadcrumbs.useBreadcrumbItem({
109
109
  ...props,
110
110
  elementType: typeof children === 'string' ? 'span' : 'a'
111
111
  }, ref);
112
- let { hoverProps: hoverProps , isHovered: isHovered } = $mvOWt$reactariainteractions.useHover(props);
113
- let element = /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).cloneElement($mvOWt$reactspectrumutils.getWrappedElement(children), {
114
- ...$mvOWt$reactariautils.mergeProps(itemProps, hoverProps),
112
+ let { hoverProps: hoverProps , isHovered: isHovered } = $6zINN$reactariainteractions.useHover(props);
113
+ let element = /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).cloneElement($6zINN$reactspectrumutils.getWrappedElement(children), {
114
+ ...$6zINN$reactariautils.mergeProps(itemProps, hoverProps),
115
115
  ref: ref,
116
- className: $mvOWt$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($e406fe8ae3922b89$exports)), 'spectrum-Breadcrumbs-itemLink', {
116
+ className: $6zINN$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($7d405af0aae01906$exports)), 'spectrum-Breadcrumbs-itemLink', {
117
117
  'is-disabled': !isCurrent && isDisabled,
118
118
  'is-hovered': isHovered
119
119
  })
120
120
  });
121
- return(/*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement($mvOWt$react.Fragment, null, /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement($mvOWt$reactariafocus.FocusRing, {
122
- focusRingClass: $mvOWt$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($e406fe8ae3922b89$exports)), 'focus-ring')
123
- }, element), isCurrent === false && /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement(($parcel$interopDefault($mvOWt$spectrumiconsuiChevronRightSmall)), {
124
- UNSAFE_className: $mvOWt$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($e406fe8ae3922b89$exports)), 'spectrum-Breadcrumbs-itemSeparator', {
121
+ return(/*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement($6zINN$react.Fragment, null, /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement($6zINN$reactariafocus.FocusRing, {
122
+ focusRingClass: $6zINN$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($7d405af0aae01906$exports)), 'focus-ring')
123
+ }, element), isCurrent === false && /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement(($parcel$interopDefault($6zINN$spectrumiconsuiChevronRightSmall)), {
124
+ UNSAFE_className: $6zINN$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($7d405af0aae01906$exports)), 'spectrum-Breadcrumbs-itemSeparator', {
125
125
  'is-reversed': direction === 'rtl'
126
126
  })
127
127
  })));
@@ -137,22 +137,22 @@ function $b3ff5736da6bbffa$export$c13f210c706eb549(props) {
137
137
 
138
138
 
139
139
 
140
- const $e4fb3abd98f85208$var$MIN_VISIBLE_ITEMS = 1;
141
- const $e4fb3abd98f85208$var$MAX_VISIBLE_ITEMS = 4;
142
- function $e4fb3abd98f85208$var$Breadcrumbs(props, ref) {
143
- props = $mvOWt$reactspectrumprovider.useProviderProps(props);
140
+ const $ce45029bf0c8e0f0$var$MIN_VISIBLE_ITEMS = 1;
141
+ const $ce45029bf0c8e0f0$var$MAX_VISIBLE_ITEMS = 4;
142
+ function $ce45029bf0c8e0f0$var$Breadcrumbs(props, ref) {
143
+ props = $6zINN$reactspectrumprovider.useProviderProps(props);
144
144
  let { size: size = 'L' , isMultiline: isMultiline , children: children , showRoot: showRoot , isDisabled: isDisabled , onAction: onAction , ...otherProps } = props;
145
145
  // Not using React.Children.toArray because it mutates the key prop.
146
146
  let childArray = [];
147
- ($parcel$interopDefault($mvOWt$react)).Children.forEach(children, (child)=>{
148
- if (/*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).isValidElement(child)) childArray.push(child);
147
+ ($parcel$interopDefault($6zINN$react)).Children.forEach(children, (child)=>{
148
+ if (/*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).isValidElement(child)) childArray.push(child);
149
149
  });
150
- let domRef = $mvOWt$reactspectrumutils.useDOMRef(ref);
151
- let listRef = $mvOWt$react.useRef(null);
152
- let [visibleItems1, setVisibleItems] = $mvOWt$reactariautils.useValueEffect(childArray.length);
153
- let { navProps: navProps } = $mvOWt$reactariabreadcrumbs.useBreadcrumbs(props);
154
- let { styleProps: styleProps } = $mvOWt$reactspectrumutils.useStyleProps(otherProps);
155
- let updateOverflow = $mvOWt$react.useCallback(()=>{
150
+ let domRef = $6zINN$reactspectrumutils.useDOMRef(ref);
151
+ let listRef = $6zINN$react.useRef(null);
152
+ let [visibleItems1, setVisibleItems] = $6zINN$reactariautils.useValueEffect(childArray.length);
153
+ let { navProps: navProps } = $6zINN$reactariabreadcrumbs.useBreadcrumbs(props);
154
+ let { styleProps: styleProps } = $6zINN$reactspectrumutils.useStyleProps(otherProps);
155
+ let updateOverflow = $6zINN$react.useCallback(()=>{
156
156
  let computeVisibleItems = (visibleItems)=>{
157
157
  // Refs can be null at runtime.
158
158
  let currListRef = listRef.current;
@@ -162,7 +162,7 @@ function $e4fb3abd98f85208$var$Breadcrumbs(props, ref) {
162
162
  let isShowingMenu = childArray.length > visibleItems;
163
163
  let calculatedWidth = 0;
164
164
  let newVisibleItems = 0;
165
- let maxVisibleItems = $e4fb3abd98f85208$var$MAX_VISIBLE_ITEMS;
165
+ let maxVisibleItems = $ce45029bf0c8e0f0$var$MAX_VISIBLE_ITEMS;
166
166
  if (showRoot) {
167
167
  calculatedWidth += listItems.shift().offsetWidth;
168
168
  newVisibleItems++;
@@ -188,7 +188,7 @@ function $e4fb3abd98f85208$var$Breadcrumbs(props, ref) {
188
188
  calculatedWidth += breadcrumb.offsetWidth;
189
189
  if (calculatedWidth < containerWidth) newVisibleItems++;
190
190
  }
191
- return Math.max($e4fb3abd98f85208$var$MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems));
191
+ return Math.max($ce45029bf0c8e0f0$var$MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems));
192
192
  };
193
193
  setVisibleItems(function*() {
194
194
  // Update to show all items.
@@ -207,28 +207,29 @@ function $e4fb3abd98f85208$var$Breadcrumbs(props, ref) {
207
207
  showRoot,
208
208
  isMultiline
209
209
  ]);
210
- $mvOWt$reactariautils.useResizeObserver({
210
+ $6zINN$reactariautils.useResizeObserver({
211
211
  ref: domRef,
212
212
  onResize: updateOverflow
213
213
  });
214
- $mvOWt$reactariautils.useLayoutEffect(updateOverflow, [
214
+ $6zINN$reactariautils.useLayoutEffect(updateOverflow, [
215
215
  children
216
216
  ]);
217
217
  let contents = childArray;
218
218
  if (childArray.length > visibleItems1) {
219
219
  let selectedItem = childArray[childArray.length - 1];
220
- let selectedKey = selectedItem.key ?? childArray.length - 1;
220
+ var _key;
221
+ let selectedKey = (_key = selectedItem.key) !== null && _key !== void 0 ? _key : childArray.length - 1;
221
222
  let onMenuAction = (key)=>{
222
223
  // Don't fire onAction when clicking on the last item
223
224
  if (key !== selectedKey && onAction) onAction(key);
224
225
  };
225
- let menuItem = /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement($b3ff5736da6bbffa$export$c13f210c706eb549, {
226
+ let menuItem = /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement($01a6adf6454cb0d0$export$c13f210c706eb549, {
226
227
  key: "menu"
227
- }, /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement($mvOWt$reactspectrummenu.MenuTrigger, null, /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement($mvOWt$reactspectrumbutton.ActionButton, {
228
+ }, /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement($6zINN$reactspectrummenu.MenuTrigger, null, /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement($6zINN$reactspectrumbutton.ActionButton, {
228
229
  "aria-label": "…",
229
230
  isQuiet: true,
230
231
  isDisabled: isDisabled
231
- }, /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement(($parcel$interopDefault($mvOWt$spectrumiconsuiFolderBreadcrumb)), null)), /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement($mvOWt$reactspectrummenu.Menu, {
232
+ }, /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement(($parcel$interopDefault($6zINN$spectrumiconsuiFolderBreadcrumb)), null)), /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement($6zINN$reactspectrummenu.Menu, {
232
233
  selectionMode: "single",
233
234
  selectedKeys: [
234
235
  selectedKey
@@ -251,26 +252,27 @@ function $e4fb3abd98f85208$var$Breadcrumbs(props, ref) {
251
252
  let lastIndex = contents.length - 1;
252
253
  let breadcrumbItems = contents.map((child, index)=>{
253
254
  let isCurrent = index === lastIndex;
254
- let key = child.key ?? index;
255
+ var _key;
256
+ let key = (_key = child.key) !== null && _key !== void 0 ? _key : index;
255
257
  let onPress = ()=>{
256
258
  if (onAction) onAction(key);
257
259
  };
258
- return(/*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement("li", {
260
+ return(/*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement("li", {
259
261
  key: key,
260
- className: $mvOWt$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($e406fe8ae3922b89$exports)), 'spectrum-Breadcrumbs-item')
261
- }, /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement($b3ff5736da6bbffa$export$c13f210c706eb549, {
262
+ className: $6zINN$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($7d405af0aae01906$exports)), 'spectrum-Breadcrumbs-item')
263
+ }, /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement($01a6adf6454cb0d0$export$c13f210c706eb549, {
262
264
  isCurrent: isCurrent,
263
265
  isDisabled: isDisabled,
264
266
  onPress: onPress
265
267
  }, child.props.children)));
266
268
  });
267
- return(/*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement("nav", {
269
+ return(/*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement("nav", {
268
270
  ...styleProps,
269
271
  ...navProps,
270
272
  ref: domRef
271
- }, /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).createElement("ul", {
273
+ }, /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).createElement("ul", {
272
274
  ref: listRef,
273
- className: $mvOWt$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($e406fe8ae3922b89$exports)), 'spectrum-Breadcrumbs', {
275
+ className: $6zINN$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($7d405af0aae01906$exports)), 'spectrum-Breadcrumbs', {
274
276
  'spectrum-Breadcrumbs--small': size === 'S',
275
277
  'spectrum-Breadcrumbs--medium': size === 'M',
276
278
  'spectrum-Breadcrumbs--multiline': isMultiline,
@@ -281,11 +283,11 @@ function $e4fb3abd98f85208$var$Breadcrumbs(props, ref) {
281
283
  }
282
284
  /**
283
285
  * Breadcrumbs show hierarchy and navigational context for a user’s location within an application.
284
- */ let $e4fb3abd98f85208$export$2dc68d50d56fbbd = /*#__PURE__*/ ($parcel$interopDefault($mvOWt$react)).forwardRef($e4fb3abd98f85208$var$Breadcrumbs);
286
+ */ let $ce45029bf0c8e0f0$export$2dc68d50d56fbbd = /*#__PURE__*/ ($parcel$interopDefault($6zINN$react)).forwardRef($ce45029bf0c8e0f0$var$Breadcrumbs);
285
287
 
286
288
 
287
289
 
288
- $parcel$exportWildcard(module.exports, $e4fb3abd98f85208$exports);
290
+ $parcel$exportWildcard(module.exports, $ce45029bf0c8e0f0$exports);
289
291
 
290
292
 
291
293
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGAA,GAAsC;AACtC,GAAoD;AACpD,GAA6B;AAC7B,GAA2C;AAC3C,GAAuC;AACvC,GAA+C;AAC/C,GAA4B;AAC5B,GAA4B;AAC5B,GAA4B;AAC5B,GAA6C;AAC7C,GAA8C;AAC9C,GAAiD;AACjD,GAA6C;AAC7C,GAA6B;AAC7B,GAA6B;AAC7B,GAAqC;AAfrC,yCAAsC,GAAG,CAA6B;AACtE,yCAAoD,GAAG,CAA2C;AAClG,yCAA6B,GAAG,CAAoB;AACpD,yCAA2C,GAAG,CAAkC;AAChF,wCAAuC,GAAG,CAA8B;AACxE,yCAA+C,GAAG,CAAsC;AACxF,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;AAClD,yCAA6C,GAAG,CAAoC;AACpF,yCAA8C,GAAG,CAAqC;AACtF,yCAAiD,GAAG,CAAwC;AAC5F,yCAA6C,GAAG,CAAoC;AACpF,yCAA6B,GAAG,CAAoB;AACpD,yCAA6B,GAAG,CAAoB;AACpD,yCAAqC,GAAG,CAA4B;;;;;;SDQpD,yCAAc,CAAC,KAA0B,EAAE,CAAC;IAC1D,GAAG,CAAC,CAAC,WACH,QAAQ,cACR,SAAS,eACT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src/Breadcrumbs.tsx","packages/@react-spectrum/breadcrumbs/src/BreadcrumbItem.tsx","packages/@adobe/spectrum-css-temp/components/breadcrumb/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport * from './Breadcrumbs';\nexport {Item} from '@react-stately/collections';\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 */\nimport {ActionButton} from '@react-spectrum/button';\nimport {BreadcrumbItem} from './BreadcrumbItem';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport FolderBreadcrumb from '@spectrum-icons/ui/FolderBreadcrumb';\nimport {Menu, MenuTrigger} from '@react-spectrum/menu';\nimport React, {Key, ReactElement, useCallback, useRef} from 'react';\nimport {SpectrumBreadcrumbsProps} from '@react-types/breadcrumbs';\nimport styles from '@adobe/spectrum-css-temp/components/breadcrumb/vars.css';\nimport {useBreadcrumbs} from '@react-aria/breadcrumbs';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useResizeObserver} from '@react-aria/utils';\n\nconst MIN_VISIBLE_ITEMS = 1;\nconst MAX_VISIBLE_ITEMS = 4;\n\nfunction Breadcrumbs<T>(props: SpectrumBreadcrumbsProps<T>, ref: DOMRef) {\n props = useProviderProps(props);\n let {\n size = 'L',\n isMultiline,\n children,\n showRoot,\n isDisabled,\n onAction,\n ...otherProps\n } = props;\n\n // Not using React.Children.toArray because it mutates the key prop.\n let childArray: ReactElement[] = [];\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n childArray.push(child);\n }\n });\n\n let domRef = useDOMRef(ref);\n let listRef = useRef<HTMLUListElement>(null);\n\n let [visibleItems, setVisibleItems] = useValueEffect(childArray.length);\n\n let {navProps} = useBreadcrumbs(props);\n let {styleProps} = useStyleProps(otherProps);\n\n let updateOverflow = useCallback(() => {\n let computeVisibleItems = (visibleItems: number) => {\n // Refs can be null at runtime.\n let currListRef: HTMLUListElement | null = listRef.current;\n if (!currListRef) {\n return;\n }\n\n let listItems = Array.from(currListRef.children) as HTMLLIElement[];\n let containerWidth = currListRef.offsetWidth;\n let isShowingMenu = childArray.length > visibleItems;\n let calculatedWidth = 0;\n let newVisibleItems = 0;\n let maxVisibleItems = MAX_VISIBLE_ITEMS;\n\n if (showRoot) {\n calculatedWidth += listItems.shift().offsetWidth;\n newVisibleItems++;\n }\n\n if (isShowingMenu) {\n calculatedWidth += listItems.shift().offsetWidth;\n maxVisibleItems--;\n }\n\n if (showRoot && calculatedWidth >= containerWidth) {\n newVisibleItems--;\n }\n\n // TODO: what if multiline and only one breadcrumb??\n if (isMultiline) {\n listItems.pop();\n newVisibleItems++;\n } else {\n // Ensure the last breadcrumb isn't truncated when we measure it.\n let last = listItems.pop();\n last.style.overflow = 'visible';\n\n calculatedWidth += last.offsetWidth;\n if (calculatedWidth < containerWidth) {\n newVisibleItems++;\n }\n\n last.style.overflow = '';\n }\n\n for (let breadcrumb of listItems.reverse()) {\n calculatedWidth += breadcrumb.offsetWidth;\n if (calculatedWidth < containerWidth) {\n newVisibleItems++;\n }\n }\n\n return Math.max(MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems));\n };\n\n setVisibleItems(function *() {\n // Update to show all items.\n yield childArray.length;\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(childArray.length);\n yield newVisibleItems;\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (newVisibleItems < childArray.length && newVisibleItems > 1) {\n yield computeVisibleItems(newVisibleItems);\n }\n });\n }, [listRef, children, setVisibleItems, showRoot, isMultiline]);\n\n useResizeObserver({ref: domRef, onResize: updateOverflow});\n\n useLayoutEffect(updateOverflow, [children]);\n\n let contents = childArray;\n if (childArray.length > visibleItems) {\n let selectedItem = childArray[childArray.length - 1];\n let selectedKey = selectedItem.key ?? childArray.length - 1;\n let onMenuAction = (key: Key) => {\n // Don't fire onAction when clicking on the last item\n if (key !== selectedKey && onAction) {\n onAction(key);\n }\n };\n\n let menuItem = (\n <BreadcrumbItem key=\"menu\">\n <MenuTrigger>\n <ActionButton\n aria-label=\"…\"\n isQuiet\n isDisabled={isDisabled}>\n <FolderBreadcrumb />\n </ActionButton>\n <Menu selectionMode=\"single\" selectedKeys={[selectedKey]} onAction={onMenuAction}>\n {childArray}\n </Menu>\n </MenuTrigger>\n </BreadcrumbItem>\n );\n\n contents = [menuItem];\n let breadcrumbs = [...childArray];\n let endItems = visibleItems;\n if (showRoot && visibleItems > 1) {\n contents.unshift(breadcrumbs.shift());\n endItems--;\n }\n contents.push(...breadcrumbs.slice(-endItems));\n }\n\n let lastIndex = contents.length - 1;\n let breadcrumbItems = contents.map((child, index) => {\n let isCurrent = index === lastIndex;\n let key = child.key ?? index;\n let onPress = () => {\n if (onAction) {\n onAction(key);\n }\n };\n\n return (\n <li\n key={key}\n className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs-item'\n )\n }>\n <BreadcrumbItem\n isCurrent={isCurrent}\n isDisabled={isDisabled}\n onPress={onPress}>\n {child.props.children}\n </BreadcrumbItem>\n </li>\n );\n });\n\n return (\n <nav\n {...styleProps}\n {...navProps}\n ref={domRef}>\n <ul\n ref={listRef}\n className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs',\n {\n 'spectrum-Breadcrumbs--small': size === 'S',\n 'spectrum-Breadcrumbs--medium': size === 'M',\n 'spectrum-Breadcrumbs--multiline': isMultiline,\n 'spectrum-Breadcrumbs--showRoot': showRoot,\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }>\n {breadcrumbItems}\n </ul>\n </nav>\n );\n}\n\n/**\n * Breadcrumbs show hierarchy and navigational context for a user’s location within an application.\n */\nlet _Breadcrumbs = React.forwardRef(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\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 {BreadcrumbItemProps} from '@react-types/breadcrumbs';\nimport ChevronRightSmall from '@spectrum-icons/ui/ChevronRightSmall';\nimport {classNames, getWrappedElement} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {Fragment, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/breadcrumb/vars.css';\nimport {useBreadcrumbItem} from '@react-aria/breadcrumbs';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\n\nexport function BreadcrumbItem(props: BreadcrumbItemProps) {\n let {\n children,\n isCurrent,\n isDisabled\n } = props;\n\n let {direction} = useLocale();\n let ref = useRef();\n let {itemProps} = useBreadcrumbItem({\n ...props,\n elementType: typeof children === 'string' ? 'span' : 'a'\n }, ref);\n let {hoverProps, isHovered} = useHover(props);\n\n let element = React.cloneElement(\n getWrappedElement(children),\n {\n ...mergeProps(itemProps, hoverProps),\n ref,\n className:\n classNames(\n styles,\n 'spectrum-Breadcrumbs-itemLink',\n {\n 'is-disabled': !isCurrent && isDisabled,\n 'is-hovered': isHovered\n }\n )\n }\n );\n\n return (\n <Fragment>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {element}\n </FocusRing>\n {isCurrent === false &&\n <ChevronRightSmall\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs-itemSeparator',\n {\n 'is-reversed': direction === 'rtl'\n }\n )\n } />\n }\n </Fragment>\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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGAA,GAAsC;AACtC,GAAoD;AACpD,GAA6B;AAC7B,GAA2C;AAC3C,GAAuC;AACvC,GAA+C;AAC/C,GAA4B;AAC5B,GAA4B;AAC5B,GAA4B;AAC5B,GAA6C;AAC7C,GAA8C;AAC9C,GAAiD;AACjD,GAA6C;AAC7C,GAA6B;AAC7B,GAA6B;AAC7B,GAAqC;AAfrC,yCAAsC,GAAG,CAA6B;AACtE,yCAAoD,GAAG,CAA2C;AAClG,yCAA6B,GAAG,CAAoB;AACpD,yCAA2C,GAAG,CAAkC;AAChF,wCAAuC,GAAG,CAA8B;AACxE,yCAA+C,GAAG,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,EAAE,MAAM;0EACV,CAAE;QACD,GAAG,EAAE,OAAO;QACZ,SAAS,EACP,oCAAU,CACR,gEAAM,EACN,CAAsB,uBACtB,CAAC;YACC,CAA6B,8BAAE,IAAI,KAAK,CAAG;YAC3C,CAA8B,+BAAE,IAAI,KAAK,CAAG;YAC5C,CAAiC,kCAAE,WAAW;YAC9C,CAAgC,iCAAE,QAAQ;YAC1C,CAAa,cAAE,UAAU;QAC3B,CAAC,EACD,UAAU,CAAC,SAAS;OAGvB,eAAe;AAIxB,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,wCAAY,iBAAG,sCAAK,CAAC,UAAU,CAAC,iCAAW","sources":["packages/@react-spectrum/breadcrumbs/src/index.ts","packages/@react-spectrum/breadcrumbs/src/Breadcrumbs.tsx","packages/@react-spectrum/breadcrumbs/src/BreadcrumbItem.tsx","packages/@adobe/spectrum-css-temp/components/breadcrumb/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport * from './Breadcrumbs';\nexport {Item} from '@react-stately/collections';\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 */\nimport {ActionButton} from '@react-spectrum/button';\nimport {BreadcrumbItem} from './BreadcrumbItem';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport FolderBreadcrumb from '@spectrum-icons/ui/FolderBreadcrumb';\nimport {Menu, MenuTrigger} from '@react-spectrum/menu';\nimport React, {Key, ReactElement, useCallback, useRef} from 'react';\nimport {SpectrumBreadcrumbsProps} from '@react-types/breadcrumbs';\nimport styles from '@adobe/spectrum-css-temp/components/breadcrumb/vars.css';\nimport {useBreadcrumbs} from '@react-aria/breadcrumbs';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useResizeObserver} from '@react-aria/utils';\n\nconst MIN_VISIBLE_ITEMS = 1;\nconst MAX_VISIBLE_ITEMS = 4;\n\nfunction Breadcrumbs<T>(props: SpectrumBreadcrumbsProps<T>, ref: DOMRef) {\n props = useProviderProps(props);\n let {\n size = 'L',\n isMultiline,\n children,\n showRoot,\n isDisabled,\n onAction,\n ...otherProps\n } = props;\n\n // Not using React.Children.toArray because it mutates the key prop.\n let childArray: ReactElement[] = [];\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n childArray.push(child);\n }\n });\n\n let domRef = useDOMRef(ref);\n let listRef = useRef<HTMLUListElement>(null);\n\n let [visibleItems, setVisibleItems] = useValueEffect(childArray.length);\n\n let {navProps} = useBreadcrumbs(props);\n let {styleProps} = useStyleProps(otherProps);\n\n let updateOverflow = useCallback(() => {\n let computeVisibleItems = (visibleItems: number) => {\n // Refs can be null at runtime.\n let currListRef: HTMLUListElement | null = listRef.current;\n if (!currListRef) {\n return;\n }\n\n let listItems = Array.from(currListRef.children) as HTMLLIElement[];\n let containerWidth = currListRef.offsetWidth;\n let isShowingMenu = childArray.length > visibleItems;\n let calculatedWidth = 0;\n let newVisibleItems = 0;\n let maxVisibleItems = MAX_VISIBLE_ITEMS;\n\n if (showRoot) {\n calculatedWidth += listItems.shift().offsetWidth;\n newVisibleItems++;\n }\n\n if (isShowingMenu) {\n calculatedWidth += listItems.shift().offsetWidth;\n maxVisibleItems--;\n }\n\n if (showRoot && calculatedWidth >= containerWidth) {\n newVisibleItems--;\n }\n\n // TODO: what if multiline and only one breadcrumb??\n if (isMultiline) {\n listItems.pop();\n newVisibleItems++;\n } else {\n // Ensure the last breadcrumb isn't truncated when we measure it.\n let last = listItems.pop();\n last.style.overflow = 'visible';\n\n calculatedWidth += last.offsetWidth;\n if (calculatedWidth < containerWidth) {\n newVisibleItems++;\n }\n\n last.style.overflow = '';\n }\n\n for (let breadcrumb of listItems.reverse()) {\n calculatedWidth += breadcrumb.offsetWidth;\n if (calculatedWidth < containerWidth) {\n newVisibleItems++;\n }\n }\n\n return Math.max(MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems));\n };\n\n setVisibleItems(function *() {\n // Update to show all items.\n yield childArray.length;\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(childArray.length);\n yield newVisibleItems;\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (newVisibleItems < childArray.length && newVisibleItems > 1) {\n yield computeVisibleItems(newVisibleItems);\n }\n });\n }, [listRef, children, setVisibleItems, showRoot, isMultiline]);\n\n useResizeObserver({ref: domRef, onResize: updateOverflow});\n\n useLayoutEffect(updateOverflow, [children]);\n\n let contents = childArray;\n if (childArray.length > visibleItems) {\n let selectedItem = childArray[childArray.length - 1];\n let selectedKey = selectedItem.key ?? childArray.length - 1;\n let onMenuAction = (key: Key) => {\n // Don't fire onAction when clicking on the last item\n if (key !== selectedKey && onAction) {\n onAction(key);\n }\n };\n\n let menuItem = (\n <BreadcrumbItem key=\"menu\">\n <MenuTrigger>\n <ActionButton\n aria-label=\"…\"\n isQuiet\n isDisabled={isDisabled}>\n <FolderBreadcrumb />\n </ActionButton>\n <Menu selectionMode=\"single\" selectedKeys={[selectedKey]} onAction={onMenuAction}>\n {childArray}\n </Menu>\n </MenuTrigger>\n </BreadcrumbItem>\n );\n\n contents = [menuItem];\n let breadcrumbs = [...childArray];\n let endItems = visibleItems;\n if (showRoot && visibleItems > 1) {\n contents.unshift(breadcrumbs.shift());\n endItems--;\n }\n contents.push(...breadcrumbs.slice(-endItems));\n }\n\n let lastIndex = contents.length - 1;\n let breadcrumbItems = contents.map((child, index) => {\n let isCurrent = index === lastIndex;\n let key = child.key ?? index;\n let onPress = () => {\n if (onAction) {\n onAction(key);\n }\n };\n\n return (\n <li\n key={key}\n className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs-item'\n )\n }>\n <BreadcrumbItem\n isCurrent={isCurrent}\n isDisabled={isDisabled}\n onPress={onPress}>\n {child.props.children}\n </BreadcrumbItem>\n </li>\n );\n });\n\n return (\n <nav\n {...styleProps}\n {...navProps}\n ref={domRef}>\n <ul\n ref={listRef}\n className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs',\n {\n 'spectrum-Breadcrumbs--small': size === 'S',\n 'spectrum-Breadcrumbs--medium': size === 'M',\n 'spectrum-Breadcrumbs--multiline': isMultiline,\n 'spectrum-Breadcrumbs--showRoot': showRoot,\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }>\n {breadcrumbItems}\n </ul>\n </nav>\n );\n}\n\n/**\n * Breadcrumbs show hierarchy and navigational context for a user’s location within an application.\n */\nlet _Breadcrumbs = React.forwardRef(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\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 {BreadcrumbItemProps} from '@react-types/breadcrumbs';\nimport ChevronRightSmall from '@spectrum-icons/ui/ChevronRightSmall';\nimport {classNames, getWrappedElement} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {Fragment, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/breadcrumb/vars.css';\nimport {useBreadcrumbItem} from '@react-aria/breadcrumbs';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\n\nexport function BreadcrumbItem(props: BreadcrumbItemProps) {\n let {\n children,\n isCurrent,\n isDisabled\n } = props;\n\n let {direction} = useLocale();\n let ref = useRef();\n let {itemProps} = useBreadcrumbItem({\n ...props,\n elementType: typeof children === 'string' ? 'span' : 'a'\n }, ref);\n let {hoverProps, isHovered} = useHover(props);\n\n let element = React.cloneElement(\n getWrappedElement(children),\n {\n ...mergeProps(itemProps, hoverProps),\n ref,\n className:\n classNames(\n styles,\n 'spectrum-Breadcrumbs-itemLink',\n {\n 'is-disabled': !isCurrent && isDisabled,\n 'is-hovered': isHovered\n }\n )\n }\n );\n\n return (\n <Fragment>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {element}\n </FocusRing>\n {isCurrent === false &&\n <ChevronRightSmall\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs-itemSeparator',\n {\n 'is-reversed': direction === 'rtl'\n }\n )\n } />\n }\n </Fragment>\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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import "./main.css";
2
- import {Item as $b77823a1e69091fb$re_export$Item} from "@react-stately/collections";
3
- import {ActionButton as $2OMIA$ActionButton} from "@react-spectrum/button";
4
- import {useDOMRef as $2OMIA$useDOMRef, useStyleProps as $2OMIA$useStyleProps, classNames as $2OMIA$classNames, getWrappedElement as $2OMIA$getWrappedElement} from "@react-spectrum/utils";
5
- import $2OMIA$spectrumiconsuiFolderBreadcrumb from "@spectrum-icons/ui/FolderBreadcrumb";
6
- import {MenuTrigger as $2OMIA$MenuTrigger, Menu as $2OMIA$Menu} from "@react-spectrum/menu";
7
- import $2OMIA$react, {useRef as $2OMIA$useRef, useCallback as $2OMIA$useCallback, Fragment as $2OMIA$Fragment} from "react";
8
- import {useBreadcrumbs as $2OMIA$useBreadcrumbs, useBreadcrumbItem as $2OMIA$useBreadcrumbItem} from "@react-aria/breadcrumbs";
9
- import {useValueEffect as $2OMIA$useValueEffect, useResizeObserver as $2OMIA$useResizeObserver, useLayoutEffect as $2OMIA$useLayoutEffect, mergeProps as $2OMIA$mergeProps} from "@react-aria/utils";
10
- import {useProviderProps as $2OMIA$useProviderProps} from "@react-spectrum/provider";
11
- import $2OMIA$spectrumiconsuiChevronRightSmall from "@spectrum-icons/ui/ChevronRightSmall";
12
- import {FocusRing as $2OMIA$FocusRing} from "@react-aria/focus";
13
- import {useHover as $2OMIA$useHover} from "@react-aria/interactions";
14
- import {useLocale as $2OMIA$useLocale} from "@react-aria/i18n";
2
+ import {Item as $7affa7233923f57e$re_export$Item} from "@react-stately/collections";
3
+ import {ActionButton as $5Ji3d$ActionButton} from "@react-spectrum/button";
4
+ import {useDOMRef as $5Ji3d$useDOMRef, useStyleProps as $5Ji3d$useStyleProps, classNames as $5Ji3d$classNames, getWrappedElement as $5Ji3d$getWrappedElement} from "@react-spectrum/utils";
5
+ import $5Ji3d$spectrumiconsuiFolderBreadcrumb from "@spectrum-icons/ui/FolderBreadcrumb";
6
+ import {MenuTrigger as $5Ji3d$MenuTrigger, Menu as $5Ji3d$Menu} from "@react-spectrum/menu";
7
+ import $5Ji3d$react, {useRef as $5Ji3d$useRef, useCallback as $5Ji3d$useCallback, Fragment as $5Ji3d$Fragment} from "react";
8
+ import {useBreadcrumbs as $5Ji3d$useBreadcrumbs, useBreadcrumbItem as $5Ji3d$useBreadcrumbItem} from "@react-aria/breadcrumbs";
9
+ import {useValueEffect as $5Ji3d$useValueEffect, useResizeObserver as $5Ji3d$useResizeObserver, useLayoutEffect as $5Ji3d$useLayoutEffect, mergeProps as $5Ji3d$mergeProps} from "@react-aria/utils";
10
+ import {useProviderProps as $5Ji3d$useProviderProps} from "@react-spectrum/provider";
11
+ import $5Ji3d$spectrumiconsuiChevronRightSmall from "@spectrum-icons/ui/ChevronRightSmall";
12
+ import {FocusRing as $5Ji3d$FocusRing} from "@react-aria/focus";
13
+ import {useHover as $5Ji3d$useHover} from "@react-aria/interactions";
14
+ import {useLocale as $5Ji3d$useLocale} from "@react-aria/i18n";
15
15
 
16
16
  function $parcel$interopDefault(a) {
17
17
  return a && a.__esModule ? a.default : a;
@@ -19,91 +19,91 @@ function $parcel$interopDefault(a) {
19
19
  function $parcel$export(e, n, v, s) {
20
20
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
21
21
  }
22
- var $ad142e6c7f8dd846$exports = {};
22
+ var $017653b257c6ca18$exports = {};
23
23
 
24
- $parcel$export($ad142e6c7f8dd846$exports, "Breadcrumbs", () => $ad142e6c7f8dd846$export$2dc68d50d56fbbd);
24
+ $parcel$export($017653b257c6ca18$exports, "Breadcrumbs", () => $017653b257c6ca18$export$2dc68d50d56fbbd);
25
25
 
26
26
 
27
27
 
28
28
 
29
29
 
30
30
 
31
- var $031ef6a0f075eadb$exports = {};
31
+ var $2512255f54f395b7$exports = {};
32
32
 
33
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-Breadcrumbs", () => $031ef6a0f075eadb$export$8c6320d2db82081f, (v) => $031ef6a0f075eadb$export$8c6320d2db82081f = v);
34
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-Breadcrumbs-itemSeparator", () => $031ef6a0f075eadb$export$f72910e36cd91d1e, (v) => $031ef6a0f075eadb$export$f72910e36cd91d1e = v);
35
- $parcel$export($031ef6a0f075eadb$exports, "is-reversed", () => $031ef6a0f075eadb$export$a4561bd665abb5db, (v) => $031ef6a0f075eadb$export$a4561bd665abb5db = v);
36
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-Breadcrumbs-item", () => $031ef6a0f075eadb$export$492a5983c5fbf603, (v) => $031ef6a0f075eadb$export$492a5983c5fbf603 = v);
37
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-ActionButton", () => $031ef6a0f075eadb$export$53da69f51b770d3, (v) => $031ef6a0f075eadb$export$53da69f51b770d3 = v);
38
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-Breadcrumbs-itemLink", () => $031ef6a0f075eadb$export$5af6a1bcd207d9f6, (v) => $031ef6a0f075eadb$export$5af6a1bcd207d9f6 = v);
39
- $parcel$export($031ef6a0f075eadb$exports, "is-hovered", () => $031ef6a0f075eadb$export$b8813cd5d7824ce7, (v) => $031ef6a0f075eadb$export$b8813cd5d7824ce7 = v);
40
- $parcel$export($031ef6a0f075eadb$exports, "focus-ring", () => $031ef6a0f075eadb$export$f39a09f249340e2a, (v) => $031ef6a0f075eadb$export$f39a09f249340e2a = v);
41
- $parcel$export($031ef6a0f075eadb$exports, "is-dragged", () => $031ef6a0f075eadb$export$8778c911bed6c759, (v) => $031ef6a0f075eadb$export$8778c911bed6c759 = v);
42
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-Breadcrumbs--small", () => $031ef6a0f075eadb$export$e01337e7944312f6, (v) => $031ef6a0f075eadb$export$e01337e7944312f6 = v);
43
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-Breadcrumbs--medium", () => $031ef6a0f075eadb$export$19f957201d941895, (v) => $031ef6a0f075eadb$export$19f957201d941895 = v);
44
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-Breadcrumbs--multiline", () => $031ef6a0f075eadb$export$713961e8e432825b, (v) => $031ef6a0f075eadb$export$713961e8e432825b = v);
45
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-Heading--pageTitle", () => $031ef6a0f075eadb$export$63e9e087a73f808b, (v) => $031ef6a0f075eadb$export$63e9e087a73f808b = v);
46
- $parcel$export($031ef6a0f075eadb$exports, "is-disabled", () => $031ef6a0f075eadb$export$d35bc1e505d1ebbf, (v) => $031ef6a0f075eadb$export$d35bc1e505d1ebbf = v);
47
- $parcel$export($031ef6a0f075eadb$exports, "is-selected", () => $031ef6a0f075eadb$export$1e0fb04f31d3c22a, (v) => $031ef6a0f075eadb$export$1e0fb04f31d3c22a = v);
48
- $parcel$export($031ef6a0f075eadb$exports, "spectrum-Breadcrumb", () => $031ef6a0f075eadb$export$45a5316056cfac3c, (v) => $031ef6a0f075eadb$export$45a5316056cfac3c = v);
49
- var $031ef6a0f075eadb$export$8c6320d2db82081f;
50
- var $031ef6a0f075eadb$export$f72910e36cd91d1e;
51
- var $031ef6a0f075eadb$export$a4561bd665abb5db;
52
- var $031ef6a0f075eadb$export$492a5983c5fbf603;
53
- var $031ef6a0f075eadb$export$53da69f51b770d3;
54
- var $031ef6a0f075eadb$export$5af6a1bcd207d9f6;
55
- var $031ef6a0f075eadb$export$b8813cd5d7824ce7;
56
- var $031ef6a0f075eadb$export$f39a09f249340e2a;
57
- var $031ef6a0f075eadb$export$8778c911bed6c759;
58
- var $031ef6a0f075eadb$export$e01337e7944312f6;
59
- var $031ef6a0f075eadb$export$19f957201d941895;
60
- var $031ef6a0f075eadb$export$713961e8e432825b;
61
- var $031ef6a0f075eadb$export$63e9e087a73f808b;
62
- var $031ef6a0f075eadb$export$d35bc1e505d1ebbf;
63
- var $031ef6a0f075eadb$export$1e0fb04f31d3c22a;
64
- var $031ef6a0f075eadb$export$45a5316056cfac3c;
65
- $031ef6a0f075eadb$export$8c6320d2db82081f = "spectrum-Breadcrumbs_3fe6e8";
66
- $031ef6a0f075eadb$export$f72910e36cd91d1e = "spectrum-Breadcrumbs-itemSeparator_3fe6e8";
67
- $031ef6a0f075eadb$export$a4561bd665abb5db = "is-reversed_3fe6e8";
68
- $031ef6a0f075eadb$export$492a5983c5fbf603 = "spectrum-Breadcrumbs-item_3fe6e8";
69
- $031ef6a0f075eadb$export$53da69f51b770d3 = "spectrum-ActionButton_3fe6e8";
70
- $031ef6a0f075eadb$export$5af6a1bcd207d9f6 = "spectrum-Breadcrumbs-itemLink_3fe6e8";
71
- $031ef6a0f075eadb$export$b8813cd5d7824ce7 = "is-hovered_3fe6e8";
72
- $031ef6a0f075eadb$export$f39a09f249340e2a = "focus-ring_3fe6e8";
73
- $031ef6a0f075eadb$export$8778c911bed6c759 = "is-dragged_3fe6e8";
74
- $031ef6a0f075eadb$export$e01337e7944312f6 = "spectrum-Breadcrumbs--small_3fe6e8";
75
- $031ef6a0f075eadb$export$19f957201d941895 = "spectrum-Breadcrumbs--medium_3fe6e8";
76
- $031ef6a0f075eadb$export$713961e8e432825b = "spectrum-Breadcrumbs--multiline_3fe6e8";
77
- $031ef6a0f075eadb$export$63e9e087a73f808b = "spectrum-Heading--pageTitle_3fe6e8";
78
- $031ef6a0f075eadb$export$d35bc1e505d1ebbf = "is-disabled_3fe6e8";
79
- $031ef6a0f075eadb$export$1e0fb04f31d3c22a = "is-selected_3fe6e8";
80
- $031ef6a0f075eadb$export$45a5316056cfac3c = "spectrum-Breadcrumb_3fe6e8";
33
+ $parcel$export($2512255f54f395b7$exports, "spectrum-Breadcrumbs", () => $2512255f54f395b7$export$8c6320d2db82081f, (v) => $2512255f54f395b7$export$8c6320d2db82081f = v);
34
+ $parcel$export($2512255f54f395b7$exports, "spectrum-Breadcrumbs-itemSeparator", () => $2512255f54f395b7$export$f72910e36cd91d1e, (v) => $2512255f54f395b7$export$f72910e36cd91d1e = v);
35
+ $parcel$export($2512255f54f395b7$exports, "is-reversed", () => $2512255f54f395b7$export$a4561bd665abb5db, (v) => $2512255f54f395b7$export$a4561bd665abb5db = v);
36
+ $parcel$export($2512255f54f395b7$exports, "spectrum-Breadcrumbs-item", () => $2512255f54f395b7$export$492a5983c5fbf603, (v) => $2512255f54f395b7$export$492a5983c5fbf603 = v);
37
+ $parcel$export($2512255f54f395b7$exports, "spectrum-ActionButton", () => $2512255f54f395b7$export$53da69f51b770d3, (v) => $2512255f54f395b7$export$53da69f51b770d3 = v);
38
+ $parcel$export($2512255f54f395b7$exports, "spectrum-Breadcrumbs-itemLink", () => $2512255f54f395b7$export$5af6a1bcd207d9f6, (v) => $2512255f54f395b7$export$5af6a1bcd207d9f6 = v);
39
+ $parcel$export($2512255f54f395b7$exports, "is-hovered", () => $2512255f54f395b7$export$b8813cd5d7824ce7, (v) => $2512255f54f395b7$export$b8813cd5d7824ce7 = v);
40
+ $parcel$export($2512255f54f395b7$exports, "focus-ring", () => $2512255f54f395b7$export$f39a09f249340e2a, (v) => $2512255f54f395b7$export$f39a09f249340e2a = v);
41
+ $parcel$export($2512255f54f395b7$exports, "is-dragged", () => $2512255f54f395b7$export$8778c911bed6c759, (v) => $2512255f54f395b7$export$8778c911bed6c759 = v);
42
+ $parcel$export($2512255f54f395b7$exports, "spectrum-Breadcrumbs--small", () => $2512255f54f395b7$export$e01337e7944312f6, (v) => $2512255f54f395b7$export$e01337e7944312f6 = v);
43
+ $parcel$export($2512255f54f395b7$exports, "spectrum-Breadcrumbs--medium", () => $2512255f54f395b7$export$19f957201d941895, (v) => $2512255f54f395b7$export$19f957201d941895 = v);
44
+ $parcel$export($2512255f54f395b7$exports, "spectrum-Breadcrumbs--multiline", () => $2512255f54f395b7$export$713961e8e432825b, (v) => $2512255f54f395b7$export$713961e8e432825b = v);
45
+ $parcel$export($2512255f54f395b7$exports, "spectrum-Heading--pageTitle", () => $2512255f54f395b7$export$63e9e087a73f808b, (v) => $2512255f54f395b7$export$63e9e087a73f808b = v);
46
+ $parcel$export($2512255f54f395b7$exports, "is-disabled", () => $2512255f54f395b7$export$d35bc1e505d1ebbf, (v) => $2512255f54f395b7$export$d35bc1e505d1ebbf = v);
47
+ $parcel$export($2512255f54f395b7$exports, "is-selected", () => $2512255f54f395b7$export$1e0fb04f31d3c22a, (v) => $2512255f54f395b7$export$1e0fb04f31d3c22a = v);
48
+ $parcel$export($2512255f54f395b7$exports, "spectrum-Breadcrumb", () => $2512255f54f395b7$export$45a5316056cfac3c, (v) => $2512255f54f395b7$export$45a5316056cfac3c = v);
49
+ var $2512255f54f395b7$export$8c6320d2db82081f;
50
+ var $2512255f54f395b7$export$f72910e36cd91d1e;
51
+ var $2512255f54f395b7$export$a4561bd665abb5db;
52
+ var $2512255f54f395b7$export$492a5983c5fbf603;
53
+ var $2512255f54f395b7$export$53da69f51b770d3;
54
+ var $2512255f54f395b7$export$5af6a1bcd207d9f6;
55
+ var $2512255f54f395b7$export$b8813cd5d7824ce7;
56
+ var $2512255f54f395b7$export$f39a09f249340e2a;
57
+ var $2512255f54f395b7$export$8778c911bed6c759;
58
+ var $2512255f54f395b7$export$e01337e7944312f6;
59
+ var $2512255f54f395b7$export$19f957201d941895;
60
+ var $2512255f54f395b7$export$713961e8e432825b;
61
+ var $2512255f54f395b7$export$63e9e087a73f808b;
62
+ var $2512255f54f395b7$export$d35bc1e505d1ebbf;
63
+ var $2512255f54f395b7$export$1e0fb04f31d3c22a;
64
+ var $2512255f54f395b7$export$45a5316056cfac3c;
65
+ $2512255f54f395b7$export$8c6320d2db82081f = "spectrum-Breadcrumbs_3fe6e8";
66
+ $2512255f54f395b7$export$f72910e36cd91d1e = "spectrum-Breadcrumbs-itemSeparator_3fe6e8";
67
+ $2512255f54f395b7$export$a4561bd665abb5db = "is-reversed_3fe6e8";
68
+ $2512255f54f395b7$export$492a5983c5fbf603 = "spectrum-Breadcrumbs-item_3fe6e8";
69
+ $2512255f54f395b7$export$53da69f51b770d3 = "spectrum-ActionButton_3fe6e8";
70
+ $2512255f54f395b7$export$5af6a1bcd207d9f6 = "spectrum-Breadcrumbs-itemLink_3fe6e8";
71
+ $2512255f54f395b7$export$b8813cd5d7824ce7 = "is-hovered_3fe6e8";
72
+ $2512255f54f395b7$export$f39a09f249340e2a = "focus-ring_3fe6e8";
73
+ $2512255f54f395b7$export$8778c911bed6c759 = "is-dragged_3fe6e8";
74
+ $2512255f54f395b7$export$e01337e7944312f6 = "spectrum-Breadcrumbs--small_3fe6e8";
75
+ $2512255f54f395b7$export$19f957201d941895 = "spectrum-Breadcrumbs--medium_3fe6e8";
76
+ $2512255f54f395b7$export$713961e8e432825b = "spectrum-Breadcrumbs--multiline_3fe6e8";
77
+ $2512255f54f395b7$export$63e9e087a73f808b = "spectrum-Heading--pageTitle_3fe6e8";
78
+ $2512255f54f395b7$export$d35bc1e505d1ebbf = "is-disabled_3fe6e8";
79
+ $2512255f54f395b7$export$1e0fb04f31d3c22a = "is-selected_3fe6e8";
80
+ $2512255f54f395b7$export$45a5316056cfac3c = "spectrum-Breadcrumb_3fe6e8";
81
81
 
82
82
 
83
83
 
84
84
 
85
85
 
86
- function $5c319d6d9e7d47c6$export$c13f210c706eb549(props) {
86
+ function $0a7d4924239a1c00$export$c13f210c706eb549(props) {
87
87
  let { children: children , isCurrent: isCurrent , isDisabled: isDisabled } = props;
88
- let { direction: direction } = $2OMIA$useLocale();
89
- let ref = $2OMIA$useRef();
90
- let { itemProps: itemProps } = $2OMIA$useBreadcrumbItem({
88
+ let { direction: direction } = $5Ji3d$useLocale();
89
+ let ref = $5Ji3d$useRef();
90
+ let { itemProps: itemProps } = $5Ji3d$useBreadcrumbItem({
91
91
  ...props,
92
92
  elementType: typeof children === 'string' ? 'span' : 'a'
93
93
  }, ref);
94
- let { hoverProps: hoverProps , isHovered: isHovered } = $2OMIA$useHover(props);
95
- let element = /*#__PURE__*/ $2OMIA$react.cloneElement($2OMIA$getWrappedElement(children), {
96
- ...$2OMIA$mergeProps(itemProps, hoverProps),
94
+ let { hoverProps: hoverProps , isHovered: isHovered } = $5Ji3d$useHover(props);
95
+ let element = /*#__PURE__*/ $5Ji3d$react.cloneElement($5Ji3d$getWrappedElement(children), {
96
+ ...$5Ji3d$mergeProps(itemProps, hoverProps),
97
97
  ref: ref,
98
- className: $2OMIA$classNames((/*@__PURE__*/$parcel$interopDefault($031ef6a0f075eadb$exports)), 'spectrum-Breadcrumbs-itemLink', {
98
+ className: $5Ji3d$classNames((/*@__PURE__*/$parcel$interopDefault($2512255f54f395b7$exports)), 'spectrum-Breadcrumbs-itemLink', {
99
99
  'is-disabled': !isCurrent && isDisabled,
100
100
  'is-hovered': isHovered
101
101
  })
102
102
  });
103
- return(/*#__PURE__*/ $2OMIA$react.createElement($2OMIA$Fragment, null, /*#__PURE__*/ $2OMIA$react.createElement($2OMIA$FocusRing, {
104
- focusRingClass: $2OMIA$classNames((/*@__PURE__*/$parcel$interopDefault($031ef6a0f075eadb$exports)), 'focus-ring')
105
- }, element), isCurrent === false && /*#__PURE__*/ $2OMIA$react.createElement($2OMIA$spectrumiconsuiChevronRightSmall, {
106
- UNSAFE_className: $2OMIA$classNames((/*@__PURE__*/$parcel$interopDefault($031ef6a0f075eadb$exports)), 'spectrum-Breadcrumbs-itemSeparator', {
103
+ return(/*#__PURE__*/ $5Ji3d$react.createElement($5Ji3d$Fragment, null, /*#__PURE__*/ $5Ji3d$react.createElement($5Ji3d$FocusRing, {
104
+ focusRingClass: $5Ji3d$classNames((/*@__PURE__*/$parcel$interopDefault($2512255f54f395b7$exports)), 'focus-ring')
105
+ }, element), isCurrent === false && /*#__PURE__*/ $5Ji3d$react.createElement($5Ji3d$spectrumiconsuiChevronRightSmall, {
106
+ UNSAFE_className: $5Ji3d$classNames((/*@__PURE__*/$parcel$interopDefault($2512255f54f395b7$exports)), 'spectrum-Breadcrumbs-itemSeparator', {
107
107
  'is-reversed': direction === 'rtl'
108
108
  })
109
109
  })));
@@ -119,22 +119,22 @@ function $5c319d6d9e7d47c6$export$c13f210c706eb549(props) {
119
119
 
120
120
 
121
121
 
122
- const $ad142e6c7f8dd846$var$MIN_VISIBLE_ITEMS = 1;
123
- const $ad142e6c7f8dd846$var$MAX_VISIBLE_ITEMS = 4;
124
- function $ad142e6c7f8dd846$var$Breadcrumbs(props, ref) {
125
- props = $2OMIA$useProviderProps(props);
122
+ const $017653b257c6ca18$var$MIN_VISIBLE_ITEMS = 1;
123
+ const $017653b257c6ca18$var$MAX_VISIBLE_ITEMS = 4;
124
+ function $017653b257c6ca18$var$Breadcrumbs(props, ref) {
125
+ props = $5Ji3d$useProviderProps(props);
126
126
  let { size: size = 'L' , isMultiline: isMultiline , children: children , showRoot: showRoot , isDisabled: isDisabled , onAction: onAction , ...otherProps } = props;
127
127
  // Not using React.Children.toArray because it mutates the key prop.
128
128
  let childArray = [];
129
- $2OMIA$react.Children.forEach(children, (child)=>{
130
- if (/*#__PURE__*/ $2OMIA$react.isValidElement(child)) childArray.push(child);
129
+ $5Ji3d$react.Children.forEach(children, (child)=>{
130
+ if (/*#__PURE__*/ $5Ji3d$react.isValidElement(child)) childArray.push(child);
131
131
  });
132
- let domRef = $2OMIA$useDOMRef(ref);
133
- let listRef = $2OMIA$useRef(null);
134
- let [visibleItems1, setVisibleItems] = $2OMIA$useValueEffect(childArray.length);
135
- let { navProps: navProps } = $2OMIA$useBreadcrumbs(props);
136
- let { styleProps: styleProps } = $2OMIA$useStyleProps(otherProps);
137
- let updateOverflow = $2OMIA$useCallback(()=>{
132
+ let domRef = $5Ji3d$useDOMRef(ref);
133
+ let listRef = $5Ji3d$useRef(null);
134
+ let [visibleItems1, setVisibleItems] = $5Ji3d$useValueEffect(childArray.length);
135
+ let { navProps: navProps } = $5Ji3d$useBreadcrumbs(props);
136
+ let { styleProps: styleProps } = $5Ji3d$useStyleProps(otherProps);
137
+ let updateOverflow = $5Ji3d$useCallback(()=>{
138
138
  let computeVisibleItems = (visibleItems)=>{
139
139
  // Refs can be null at runtime.
140
140
  let currListRef = listRef.current;
@@ -144,7 +144,7 @@ function $ad142e6c7f8dd846$var$Breadcrumbs(props, ref) {
144
144
  let isShowingMenu = childArray.length > visibleItems;
145
145
  let calculatedWidth = 0;
146
146
  let newVisibleItems = 0;
147
- let maxVisibleItems = $ad142e6c7f8dd846$var$MAX_VISIBLE_ITEMS;
147
+ let maxVisibleItems = $017653b257c6ca18$var$MAX_VISIBLE_ITEMS;
148
148
  if (showRoot) {
149
149
  calculatedWidth += listItems.shift().offsetWidth;
150
150
  newVisibleItems++;
@@ -170,7 +170,7 @@ function $ad142e6c7f8dd846$var$Breadcrumbs(props, ref) {
170
170
  calculatedWidth += breadcrumb.offsetWidth;
171
171
  if (calculatedWidth < containerWidth) newVisibleItems++;
172
172
  }
173
- return Math.max($ad142e6c7f8dd846$var$MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems));
173
+ return Math.max($017653b257c6ca18$var$MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems));
174
174
  };
175
175
  setVisibleItems(function*() {
176
176
  // Update to show all items.
@@ -189,28 +189,29 @@ function $ad142e6c7f8dd846$var$Breadcrumbs(props, ref) {
189
189
  showRoot,
190
190
  isMultiline
191
191
  ]);
192
- $2OMIA$useResizeObserver({
192
+ $5Ji3d$useResizeObserver({
193
193
  ref: domRef,
194
194
  onResize: updateOverflow
195
195
  });
196
- $2OMIA$useLayoutEffect(updateOverflow, [
196
+ $5Ji3d$useLayoutEffect(updateOverflow, [
197
197
  children
198
198
  ]);
199
199
  let contents = childArray;
200
200
  if (childArray.length > visibleItems1) {
201
201
  let selectedItem = childArray[childArray.length - 1];
202
- let selectedKey = selectedItem.key ?? childArray.length - 1;
202
+ var _key;
203
+ let selectedKey = (_key = selectedItem.key) !== null && _key !== void 0 ? _key : childArray.length - 1;
203
204
  let onMenuAction = (key)=>{
204
205
  // Don't fire onAction when clicking on the last item
205
206
  if (key !== selectedKey && onAction) onAction(key);
206
207
  };
207
- let menuItem = /*#__PURE__*/ $2OMIA$react.createElement($5c319d6d9e7d47c6$export$c13f210c706eb549, {
208
+ let menuItem = /*#__PURE__*/ $5Ji3d$react.createElement($0a7d4924239a1c00$export$c13f210c706eb549, {
208
209
  key: "menu"
209
- }, /*#__PURE__*/ $2OMIA$react.createElement($2OMIA$MenuTrigger, null, /*#__PURE__*/ $2OMIA$react.createElement($2OMIA$ActionButton, {
210
+ }, /*#__PURE__*/ $5Ji3d$react.createElement($5Ji3d$MenuTrigger, null, /*#__PURE__*/ $5Ji3d$react.createElement($5Ji3d$ActionButton, {
210
211
  "aria-label": "…",
211
212
  isQuiet: true,
212
213
  isDisabled: isDisabled
213
- }, /*#__PURE__*/ $2OMIA$react.createElement($2OMIA$spectrumiconsuiFolderBreadcrumb, null)), /*#__PURE__*/ $2OMIA$react.createElement($2OMIA$Menu, {
214
+ }, /*#__PURE__*/ $5Ji3d$react.createElement($5Ji3d$spectrumiconsuiFolderBreadcrumb, null)), /*#__PURE__*/ $5Ji3d$react.createElement($5Ji3d$Menu, {
214
215
  selectionMode: "single",
215
216
  selectedKeys: [
216
217
  selectedKey
@@ -233,26 +234,27 @@ function $ad142e6c7f8dd846$var$Breadcrumbs(props, ref) {
233
234
  let lastIndex = contents.length - 1;
234
235
  let breadcrumbItems = contents.map((child, index)=>{
235
236
  let isCurrent = index === lastIndex;
236
- let key = child.key ?? index;
237
+ var _key;
238
+ let key = (_key = child.key) !== null && _key !== void 0 ? _key : index;
237
239
  let onPress = ()=>{
238
240
  if (onAction) onAction(key);
239
241
  };
240
- return(/*#__PURE__*/ $2OMIA$react.createElement("li", {
242
+ return(/*#__PURE__*/ $5Ji3d$react.createElement("li", {
241
243
  key: key,
242
- className: $2OMIA$classNames((/*@__PURE__*/$parcel$interopDefault($031ef6a0f075eadb$exports)), 'spectrum-Breadcrumbs-item')
243
- }, /*#__PURE__*/ $2OMIA$react.createElement($5c319d6d9e7d47c6$export$c13f210c706eb549, {
244
+ className: $5Ji3d$classNames((/*@__PURE__*/$parcel$interopDefault($2512255f54f395b7$exports)), 'spectrum-Breadcrumbs-item')
245
+ }, /*#__PURE__*/ $5Ji3d$react.createElement($0a7d4924239a1c00$export$c13f210c706eb549, {
244
246
  isCurrent: isCurrent,
245
247
  isDisabled: isDisabled,
246
248
  onPress: onPress
247
249
  }, child.props.children)));
248
250
  });
249
- return(/*#__PURE__*/ $2OMIA$react.createElement("nav", {
251
+ return(/*#__PURE__*/ $5Ji3d$react.createElement("nav", {
250
252
  ...styleProps,
251
253
  ...navProps,
252
254
  ref: domRef
253
- }, /*#__PURE__*/ $2OMIA$react.createElement("ul", {
255
+ }, /*#__PURE__*/ $5Ji3d$react.createElement("ul", {
254
256
  ref: listRef,
255
- className: $2OMIA$classNames((/*@__PURE__*/$parcel$interopDefault($031ef6a0f075eadb$exports)), 'spectrum-Breadcrumbs', {
257
+ className: $5Ji3d$classNames((/*@__PURE__*/$parcel$interopDefault($2512255f54f395b7$exports)), 'spectrum-Breadcrumbs', {
256
258
  'spectrum-Breadcrumbs--small': size === 'S',
257
259
  'spectrum-Breadcrumbs--medium': size === 'M',
258
260
  'spectrum-Breadcrumbs--multiline': isMultiline,
@@ -263,11 +265,11 @@ function $ad142e6c7f8dd846$var$Breadcrumbs(props, ref) {
263
265
  }
264
266
  /**
265
267
  * Breadcrumbs show hierarchy and navigational context for a user’s location within an application.
266
- */ let $ad142e6c7f8dd846$export$2dc68d50d56fbbd = /*#__PURE__*/ $2OMIA$react.forwardRef($ad142e6c7f8dd846$var$Breadcrumbs);
268
+ */ let $017653b257c6ca18$export$2dc68d50d56fbbd = /*#__PURE__*/ $5Ji3d$react.forwardRef($017653b257c6ca18$var$Breadcrumbs);
267
269
 
268
270
 
269
271
 
270
272
 
271
273
 
272
- export {$b77823a1e69091fb$re_export$Item as Item, $ad142e6c7f8dd846$export$2dc68d50d56fbbd as Breadcrumbs};
274
+ export {$7affa7233923f57e$re_export$Item as Item, $017653b257c6ca18$export$2dc68d50d56fbbd as Breadcrumbs};
273
275
  //# sourceMappingURL=module.js.map
@@ -1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nB,EAAE,EAAE,QAAQ,EACV,QAAQ,CAAC,GAAG;QAEhB,CAAC;QAED,MAAM,0CACH,CAAE;YACD,GAAG,EAAE,GAAG;YACR,SAAS,EACP,iBAAU,CACR,gEAAM,EACN,CAA2B;oDAG9B,yCAAc;YACb,SAAS,EAAE,SAAS;YACpB,UAAU,EAAE,UAAU;YACtB,OAAO,EAAE,OAAO;WACf,KAAK,CAAC,KAAK,CAAC,QAAQ;IAI7B,CAAC;IAED,MAAM,0CACH,CAAG;WACE,UAAU;WACV,QAAQ;QACZ,GAAG,EAAE,MAAM;gDACV,CAAE;QACD,GAAG,EAAE,OAAO;QACZ,SAAS,EACP,iBAAU,CACR,gEAAM,EACN,CAAsB,uBACtB,CAAC;YACC,CAA6B,8BAAE,IAAI,KAAK,CAAG;YAC3C,CAA8B,+BAAE,IAAI,KAAK,CAAG;YAC5C,CAAiC,kCAAE,WAAW;YAC9C,CAAgC,iCAAE,QAAQ;YAC1C,CAAa,cAAE,UAAU;QAC3B,CAAC,EACD,UAAU,CAAC,SAAS;OAGvB,eAAe;AAIxB,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,wCAAY,iBAAG,YAAK,CAAC,UAAU,CAAC,iCAAW","sources":["packages/@react-spectrum/breadcrumbs/src/index.ts","packages/@react-spectrum/breadcrumbs/src/Breadcrumbs.tsx","packages/@react-spectrum/breadcrumbs/src/BreadcrumbItem.tsx","packages/@adobe/spectrum-css-temp/components/breadcrumb/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport * from './Breadcrumbs';\nexport {Item} from '@react-stately/collections';\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 */\nimport {ActionButton} from '@react-spectrum/button';\nimport {BreadcrumbItem} from './BreadcrumbItem';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport FolderBreadcrumb from '@spectrum-icons/ui/FolderBreadcrumb';\nimport {Menu, MenuTrigger} from '@react-spectrum/menu';\nimport React, {Key, ReactElement, useCallback, useRef} from 'react';\nimport {SpectrumBreadcrumbsProps} from '@react-types/breadcrumbs';\nimport styles from '@adobe/spectrum-css-temp/components/breadcrumb/vars.css';\nimport {useBreadcrumbs} from '@react-aria/breadcrumbs';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useResizeObserver} from '@react-aria/utils';\n\nconst MIN_VISIBLE_ITEMS = 1;\nconst MAX_VISIBLE_ITEMS = 4;\n\nfunction Breadcrumbs<T>(props: SpectrumBreadcrumbsProps<T>, ref: DOMRef) {\n props = useProviderProps(props);\n let {\n size = 'L',\n isMultiline,\n children,\n showRoot,\n isDisabled,\n onAction,\n ...otherProps\n } = props;\n\n // Not using React.Children.toArray because it mutates the key prop.\n let childArray: ReactElement[] = [];\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n childArray.push(child);\n }\n });\n\n let domRef = useDOMRef(ref);\n let listRef = useRef<HTMLUListElement>(null);\n\n let [visibleItems, setVisibleItems] = useValueEffect(childArray.length);\n\n let {navProps} = useBreadcrumbs(props);\n let {styleProps} = useStyleProps(otherProps);\n\n let updateOverflow = useCallback(() => {\n let computeVisibleItems = (visibleItems: number) => {\n // Refs can be null at runtime.\n let currListRef: HTMLUListElement | null = listRef.current;\n if (!currListRef) {\n return;\n }\n\n let listItems = Array.from(currListRef.children) as HTMLLIElement[];\n let containerWidth = currListRef.offsetWidth;\n let isShowingMenu = childArray.length > visibleItems;\n let calculatedWidth = 0;\n let newVisibleItems = 0;\n let maxVisibleItems = MAX_VISIBLE_ITEMS;\n\n if (showRoot) {\n calculatedWidth += listItems.shift().offsetWidth;\n newVisibleItems++;\n }\n\n if (isShowingMenu) {\n calculatedWidth += listItems.shift().offsetWidth;\n maxVisibleItems--;\n }\n\n if (showRoot && calculatedWidth >= containerWidth) {\n newVisibleItems--;\n }\n\n // TODO: what if multiline and only one breadcrumb??\n if (isMultiline) {\n listItems.pop();\n newVisibleItems++;\n } else {\n // Ensure the last breadcrumb isn't truncated when we measure it.\n let last = listItems.pop();\n last.style.overflow = 'visible';\n\n calculatedWidth += last.offsetWidth;\n if (calculatedWidth < containerWidth) {\n newVisibleItems++;\n }\n\n last.style.overflow = '';\n }\n\n for (let breadcrumb of listItems.reverse()) {\n calculatedWidth += breadcrumb.offsetWidth;\n if (calculatedWidth < containerWidth) {\n newVisibleItems++;\n }\n }\n\n return Math.max(MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems));\n };\n\n setVisibleItems(function *() {\n // Update to show all items.\n yield childArray.length;\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(childArray.length);\n yield newVisibleItems;\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (newVisibleItems < childArray.length && newVisibleItems > 1) {\n yield computeVisibleItems(newVisibleItems);\n }\n });\n }, [listRef, children, setVisibleItems, showRoot, isMultiline]);\n\n useResizeObserver({ref: domRef, onResize: updateOverflow});\n\n useLayoutEffect(updateOverflow, [children]);\n\n let contents = childArray;\n if (childArray.length > visibleItems) {\n let selectedItem = childArray[childArray.length - 1];\n let selectedKey = selectedItem.key ?? childArray.length - 1;\n let onMenuAction = (key: Key) => {\n // Don't fire onAction when clicking on the last item\n if (key !== selectedKey && onAction) {\n onAction(key);\n }\n };\n\n let menuItem = (\n <BreadcrumbItem key=\"menu\">\n <MenuTrigger>\n <ActionButton\n aria-label=\"…\"\n isQuiet\n isDisabled={isDisabled}>\n <FolderBreadcrumb />\n </ActionButton>\n <Menu selectionMode=\"single\" selectedKeys={[selectedKey]} onAction={onMenuAction}>\n {childArray}\n </Menu>\n </MenuTrigger>\n </BreadcrumbItem>\n );\n\n contents = [menuItem];\n let breadcrumbs = [...childArray];\n let endItems = visibleItems;\n if (showRoot && visibleItems > 1) {\n contents.unshift(breadcrumbs.shift());\n endItems--;\n }\n contents.push(...breadcrumbs.slice(-endItems));\n }\n\n let lastIndex = contents.length - 1;\n let breadcrumbItems = contents.map((child, index) => {\n let isCurrent = index === lastIndex;\n let key = child.key ?? index;\n let onPress = () => {\n if (onAction) {\n onAction(key);\n }\n };\n\n return (\n <li\n key={key}\n className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs-item'\n )\n }>\n <BreadcrumbItem\n isCurrent={isCurrent}\n isDisabled={isDisabled}\n onPress={onPress}>\n {child.props.children}\n </BreadcrumbItem>\n </li>\n );\n });\n\n return (\n <nav\n {...styleProps}\n {...navProps}\n ref={domRef}>\n <ul\n ref={listRef}\n className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs',\n {\n 'spectrum-Breadcrumbs--small': size === 'S',\n 'spectrum-Breadcrumbs--medium': size === 'M',\n 'spectrum-Breadcrumbs--multiline': isMultiline,\n 'spectrum-Breadcrumbs--showRoot': showRoot,\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }>\n {breadcrumbItems}\n </ul>\n </nav>\n );\n}\n\n/**\n * Breadcrumbs show hierarchy and navigational context for a user’s location within an application.\n */\nlet _Breadcrumbs = React.forwardRef(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\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 {BreadcrumbItemProps} from '@react-types/breadcrumbs';\nimport ChevronRightSmall from '@spectrum-icons/ui/ChevronRightSmall';\nimport {classNames, getWrappedElement} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {Fragment, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/breadcrumb/vars.css';\nimport {useBreadcrumbItem} from '@react-aria/breadcrumbs';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\n\nexport function BreadcrumbItem(props: BreadcrumbItemProps) {\n let {\n children,\n isCurrent,\n isDisabled\n } = props;\n\n let {direction} = useLocale();\n let ref = useRef();\n let {itemProps} = useBreadcrumbItem({\n ...props,\n elementType: typeof children === 'string' ? 'span' : 'a'\n }, ref);\n let {hoverProps, isHovered} = useHover(props);\n\n let element = React.cloneElement(\n getWrappedElement(children),\n {\n ...mergeProps(itemProps, hoverProps),\n ref,\n className:\n classNames(\n styles,\n 'spectrum-Breadcrumbs-itemLink',\n {\n 'is-disabled': !isCurrent && isDisabled,\n 'is-hovered': isHovered\n }\n )\n }\n );\n\n return (\n <Fragment>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {element}\n </FocusRing>\n {isCurrent === false &&\n <ChevronRightSmall\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs-itemSeparator',\n {\n 'is-reversed': direction === 'rtl'\n }\n )\n } />\n }\n </Fragment>\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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGAA,GAAsC;AACtC,GAAoD;AACpD,GAA6B;AAC7B,GAA2C;AAC3C,GAAuC;AACvC,GAA+C;AAC/C,GAA4B;AAC5B,GAA4B;AAC5B,GAA4B;AAC5B,GAA6C;AAC7C,GAA8C;AAC9C,GAAiD;AACjD,GAA6C;AAC7C,GAA6B;AAC7B,GAA6B;AAC7B,GAAqC;AAfrC,yCAAsC,GAAG,CAA6B;AACtE,yCAAoD,GAAG,CAA2C;AAClG,yCAA6B,GAAG,CAAoB;AACpD,yCAA2C,GAAG,CAAkC;AAChF,wCAAuC,GAAG,CAA8B;AACxE,yCAA+C,GAAG,CAAsC;AACxF,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;AAClD,yCAA6C,GAAG,CAAoC;AACpF,yCAA8C,GAAG,CAAqC;AACtF,yCAAiD,GAAG,CAAwC;AAC5F,yCAA6C,GAAG,CAAoC;AACpF,yCAA6B,GAAG,CAAoB;AACpD,yCAA6B,GAAG,CAAoB;AACpD,yCAAqC,GAAG,CAA4B;;;;;;SDQpD,yCAAc,CAAC,KAA0B,EAAE,CAAC;IAC1D,GAAG,CAAC,CAAC,WACH,QAAQ,cACR,SAAS,eACT,UAAU,EACZ,CAAC,GAAG,KAAK;IAET,G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sources":["packages/@react-spectrum/breadcrumbs/src/index.ts","packages/@react-spectrum/breadcrumbs/src/Breadcrumbs.tsx","packages/@react-spectrum/breadcrumbs/src/BreadcrumbItem.tsx","packages/@adobe/spectrum-css-temp/components/breadcrumb/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport * from './Breadcrumbs';\nexport {Item} from '@react-stately/collections';\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 */\nimport {ActionButton} from '@react-spectrum/button';\nimport {BreadcrumbItem} from './BreadcrumbItem';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport FolderBreadcrumb from '@spectrum-icons/ui/FolderBreadcrumb';\nimport {Menu, MenuTrigger} from '@react-spectrum/menu';\nimport React, {Key, ReactElement, useCallback, useRef} from 'react';\nimport {SpectrumBreadcrumbsProps} from '@react-types/breadcrumbs';\nimport styles from '@adobe/spectrum-css-temp/components/breadcrumb/vars.css';\nimport {useBreadcrumbs} from '@react-aria/breadcrumbs';\nimport {useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useResizeObserver} from '@react-aria/utils';\n\nconst MIN_VISIBLE_ITEMS = 1;\nconst MAX_VISIBLE_ITEMS = 4;\n\nfunction Breadcrumbs<T>(props: SpectrumBreadcrumbsProps<T>, ref: DOMRef) {\n props = useProviderProps(props);\n let {\n size = 'L',\n isMultiline,\n children,\n showRoot,\n isDisabled,\n onAction,\n ...otherProps\n } = props;\n\n // Not using React.Children.toArray because it mutates the key prop.\n let childArray: ReactElement[] = [];\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n childArray.push(child);\n }\n });\n\n let domRef = useDOMRef(ref);\n let listRef = useRef<HTMLUListElement>(null);\n\n let [visibleItems, setVisibleItems] = useValueEffect(childArray.length);\n\n let {navProps} = useBreadcrumbs(props);\n let {styleProps} = useStyleProps(otherProps);\n\n let updateOverflow = useCallback(() => {\n let computeVisibleItems = (visibleItems: number) => {\n // Refs can be null at runtime.\n let currListRef: HTMLUListElement | null = listRef.current;\n if (!currListRef) {\n return;\n }\n\n let listItems = Array.from(currListRef.children) as HTMLLIElement[];\n let containerWidth = currListRef.offsetWidth;\n let isShowingMenu = childArray.length > visibleItems;\n let calculatedWidth = 0;\n let newVisibleItems = 0;\n let maxVisibleItems = MAX_VISIBLE_ITEMS;\n\n if (showRoot) {\n calculatedWidth += listItems.shift().offsetWidth;\n newVisibleItems++;\n }\n\n if (isShowingMenu) {\n calculatedWidth += listItems.shift().offsetWidth;\n maxVisibleItems--;\n }\n\n if (showRoot && calculatedWidth >= containerWidth) {\n newVisibleItems--;\n }\n\n // TODO: what if multiline and only one breadcrumb??\n if (isMultiline) {\n listItems.pop();\n newVisibleItems++;\n } else {\n // Ensure the last breadcrumb isn't truncated when we measure it.\n let last = listItems.pop();\n last.style.overflow = 'visible';\n\n calculatedWidth += last.offsetWidth;\n if (calculatedWidth < containerWidth) {\n newVisibleItems++;\n }\n\n last.style.overflow = '';\n }\n\n for (let breadcrumb of listItems.reverse()) {\n calculatedWidth += breadcrumb.offsetWidth;\n if (calculatedWidth < containerWidth) {\n newVisibleItems++;\n }\n }\n\n return Math.max(MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems));\n };\n\n setVisibleItems(function *() {\n // Update to show all items.\n yield childArray.length;\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(childArray.length);\n yield newVisibleItems;\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (newVisibleItems < childArray.length && newVisibleItems > 1) {\n yield computeVisibleItems(newVisibleItems);\n }\n });\n }, [listRef, children, setVisibleItems, showRoot, isMultiline]);\n\n useResizeObserver({ref: domRef, onResize: updateOverflow});\n\n useLayoutEffect(updateOverflow, [children]);\n\n let contents = childArray;\n if (childArray.length > visibleItems) {\n let selectedItem = childArray[childArray.length - 1];\n let selectedKey = selectedItem.key ?? childArray.length - 1;\n let onMenuAction = (key: Key) => {\n // Don't fire onAction when clicking on the last item\n if (key !== selectedKey && onAction) {\n onAction(key);\n }\n };\n\n let menuItem = (\n <BreadcrumbItem key=\"menu\">\n <MenuTrigger>\n <ActionButton\n aria-label=\"…\"\n isQuiet\n isDisabled={isDisabled}>\n <FolderBreadcrumb />\n </ActionButton>\n <Menu selectionMode=\"single\" selectedKeys={[selectedKey]} onAction={onMenuAction}>\n {childArray}\n </Menu>\n </MenuTrigger>\n </BreadcrumbItem>\n );\n\n contents = [menuItem];\n let breadcrumbs = [...childArray];\n let endItems = visibleItems;\n if (showRoot && visibleItems > 1) {\n contents.unshift(breadcrumbs.shift());\n endItems--;\n }\n contents.push(...breadcrumbs.slice(-endItems));\n }\n\n let lastIndex = contents.length - 1;\n let breadcrumbItems = contents.map((child, index) => {\n let isCurrent = index === lastIndex;\n let key = child.key ?? index;\n let onPress = () => {\n if (onAction) {\n onAction(key);\n }\n };\n\n return (\n <li\n key={key}\n className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs-item'\n )\n }>\n <BreadcrumbItem\n isCurrent={isCurrent}\n isDisabled={isDisabled}\n onPress={onPress}>\n {child.props.children}\n </BreadcrumbItem>\n </li>\n );\n });\n\n return (\n <nav\n {...styleProps}\n {...navProps}\n ref={domRef}>\n <ul\n ref={listRef}\n className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs',\n {\n 'spectrum-Breadcrumbs--small': size === 'S',\n 'spectrum-Breadcrumbs--medium': size === 'M',\n 'spectrum-Breadcrumbs--multiline': isMultiline,\n 'spectrum-Breadcrumbs--showRoot': showRoot,\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }>\n {breadcrumbItems}\n </ul>\n </nav>\n );\n}\n\n/**\n * Breadcrumbs show hierarchy and navigational context for a user’s location within an application.\n */\nlet _Breadcrumbs = React.forwardRef(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\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 {BreadcrumbItemProps} from '@react-types/breadcrumbs';\nimport ChevronRightSmall from '@spectrum-icons/ui/ChevronRightSmall';\nimport {classNames, getWrappedElement} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {Fragment, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/breadcrumb/vars.css';\nimport {useBreadcrumbItem} from '@react-aria/breadcrumbs';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\n\nexport function BreadcrumbItem(props: BreadcrumbItemProps) {\n let {\n children,\n isCurrent,\n isDisabled\n } = props;\n\n let {direction} = useLocale();\n let ref = useRef();\n let {itemProps} = useBreadcrumbItem({\n ...props,\n elementType: typeof children === 'string' ? 'span' : 'a'\n }, ref);\n let {hoverProps, isHovered} = useHover(props);\n\n let element = React.cloneElement(\n getWrappedElement(children),\n {\n ...mergeProps(itemProps, hoverProps),\n ref,\n className:\n classNames(\n styles,\n 'spectrum-Breadcrumbs-itemLink',\n {\n 'is-disabled': !isCurrent && isDisabled,\n 'is-hovered': isHovered\n }\n )\n }\n );\n\n return (\n <Fragment>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {element}\n </FocusRing>\n {isCurrent === false &&\n <ChevronRightSmall\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Breadcrumbs-itemSeparator',\n {\n 'is-reversed': direction === 'rtl'\n }\n )\n } />\n }\n </Fragment>\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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/breadcrumbs",
3
- "version": "3.2.5",
3
+ "version": "3.2.6",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -32,18 +32,18 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.6.2",
35
- "@react-aria/breadcrumbs": "^3.1.6",
36
- "@react-aria/focus": "^3.5.1",
37
- "@react-aria/i18n": "^3.3.5",
38
- "@react-aria/interactions": "^3.8.0",
39
- "@react-aria/utils": "^3.11.1",
40
- "@react-spectrum/button": "^3.7.0",
41
- "@react-spectrum/menu": "^3.6.0",
42
- "@react-spectrum/utils": "^3.6.4",
43
- "@react-stately/collections": "^3.3.5",
44
- "@react-types/breadcrumbs": "^3.2.2",
45
- "@react-types/shared": "^3.11.0",
46
- "@spectrum-icons/ui": "^3.2.2"
35
+ "@react-aria/breadcrumbs": "^3.1.7",
36
+ "@react-aria/focus": "^3.5.2",
37
+ "@react-aria/i18n": "^3.3.6",
38
+ "@react-aria/interactions": "^3.8.1",
39
+ "@react-aria/utils": "^3.11.2",
40
+ "@react-spectrum/button": "^3.7.1",
41
+ "@react-spectrum/menu": "^3.6.1",
42
+ "@react-spectrum/utils": "^3.6.5",
43
+ "@react-stately/collections": "^3.3.6",
44
+ "@react-types/breadcrumbs": "^3.2.3",
45
+ "@react-types/shared": "^3.11.1",
46
+ "@spectrum-icons/ui": "^3.2.3"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "54c2366c4f31bd4bf619126131cd583c12972acc"
59
+ "gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
60
60
  }