@instructure/ui-tree-browser 8.18.0 → 8.18.1-snapshot.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: The MIT License (MIT)
3
+ category: Getting Started
4
+ order: 9
5
+ ---
6
+
7
+ # The MIT License (MIT)
8
+
9
+ Copyright (c) 2015 Instructure, Inc.
10
+
11
+ **Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions.**
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
@@ -57,11 +57,15 @@ let TreeButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
57
57
  }
58
58
 
59
59
  componentDidMount() {
60
- this.props.makeStyles?.();
60
+ var _this$props$makeStyle, _this$props;
61
+
62
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
61
63
  }
62
64
 
63
65
  componentDidUpdate() {
64
- this.props.makeStyles?.();
66
+ var _this$props$makeStyle2, _this$props2;
67
+
68
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
65
69
  }
66
70
 
67
71
  defaultContentRenderer(props) {
@@ -98,15 +102,15 @@ let TreeButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
98
102
  }
99
103
 
100
104
  renderCollectionIcon() {
101
- const _this$props = this.props,
102
- expanded = _this$props.expanded,
103
- collectionIcon = _this$props.collectionIcon,
104
- collectionIconExpanded = _this$props.collectionIconExpanded,
105
- styles = _this$props.styles;
105
+ const _this$props3 = this.props,
106
+ expanded = _this$props3.expanded,
107
+ collectionIcon = _this$props3.collectionIcon,
108
+ collectionIconExpanded = _this$props3.collectionIconExpanded,
109
+ styles = _this$props3.styles;
106
110
 
107
111
  if (collectionIcon || collectionIconExpanded) {
108
112
  return jsx("div", {
109
- css: styles?.icon
113
+ css: styles === null || styles === void 0 ? void 0 : styles.icon
110
114
  }, callRenderProp(expanded ? collectionIconExpanded : collectionIcon));
111
115
  }
112
116
 
@@ -116,14 +120,14 @@ let TreeButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
116
120
  renderItemImage() {
117
121
  var _Img;
118
122
 
119
- const _this$props2 = this.props,
120
- thumbnail = _this$props2.thumbnail,
121
- itemIcon = _this$props2.itemIcon,
122
- styles = _this$props2.styles;
123
+ const _this$props4 = this.props,
124
+ thumbnail = _this$props4.thumbnail,
125
+ itemIcon = _this$props4.itemIcon,
126
+ styles = _this$props4.styles;
123
127
 
124
128
  if (thumbnail) {
125
129
  return jsx("div", {
126
- css: styles?.thumbnail
130
+ css: styles === null || styles === void 0 ? void 0 : styles.thumbnail
127
131
  }, _Img || (_Img = jsx(Img, {
128
132
  src: thumbnail,
129
133
  constrain: "cover",
@@ -133,7 +137,7 @@ let TreeButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
133
137
 
134
138
  if (itemIcon) {
135
139
  return jsx("div", {
136
- css: styles?.icon
140
+ css: styles === null || styles === void 0 ? void 0 : styles.icon
137
141
  }, callRenderProp(itemIcon));
138
142
  }
139
143
 
@@ -141,16 +145,16 @@ let TreeButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
141
145
  }
142
146
 
143
147
  render() {
144
- const _this$props3 = this.props,
145
- styles = _this$props3.styles,
146
- renderContent = _this$props3.renderContent;
148
+ const _this$props5 = this.props,
149
+ styles = _this$props5.styles,
150
+ renderContent = _this$props5.renderContent;
147
151
  const buttonContent = renderContent ? renderContent(this.props) : this.defaultContentRenderer(this.props); // VoiceOver can't navigate without the buttons, even though they don't do anything
148
152
 
149
153
  return jsx("button", {
150
154
  ref: this.handleRef,
151
155
  tabIndex: -1,
152
156
  type: "button",
153
- css: styles?.treeButton
157
+ css: styles === null || styles === void 0 ? void 0 : styles.treeButton
154
158
  }, buttonContent);
155
159
  }
156
160
 
@@ -43,32 +43,32 @@ const generateComponentTheme = theme => {
43
43
  }
44
44
  };
45
45
  const componentVariables = {
46
- hoverBackgroundColor: colors?.backgroundBrand,
47
- hoverTextColor: colors?.textLightest,
48
- focusOutlineWidth: borders?.widthMedium,
49
- focusOutlineColor: colors?.borderBrand,
50
- focusOutlineStyle: borders?.style,
51
- iconColor: colors?.textDarkest,
52
- iconsMarginRight: spacing?.xSmall,
53
- descriptorMarginTop: spacing?.xxxSmall,
54
- descriptorTextColor: colors?.textDarkest,
55
- descriptorFontSizeSmall: typography?.fontSizeXSmall,
56
- descriptorFontSizeMedium: typography?.fontSizeXSmall,
57
- descriptorFontSizeLarge: typography?.fontSizeSmall,
58
- nameTextColor: colors?.textBrand,
59
- nameFontSizeSmall: typography?.fontSizeXSmall,
60
- nameFontSizeMedium: typography?.fontSizeSmall,
61
- nameFontSizeLarge: typography?.fontSizeMedium,
62
- baseSpacingSmall: spacing?.xSmall,
63
- baseSpacingMedium: spacing?.small,
46
+ hoverBackgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundBrand,
47
+ hoverTextColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
48
+ focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
49
+ focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
50
+ focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style,
51
+ iconColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
52
+ iconsMarginRight: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
53
+ descriptorMarginTop: spacing === null || spacing === void 0 ? void 0 : spacing.xxxSmall,
54
+ descriptorTextColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
55
+ descriptorFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
56
+ descriptorFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
57
+ descriptorFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
58
+ nameTextColor: colors === null || colors === void 0 ? void 0 : colors.textBrand,
59
+ nameFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
60
+ nameFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
61
+ nameFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
62
+ baseSpacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
63
+ baseSpacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.small,
64
64
  baseSpacingLarge: '1rem',
65
- borderWidth: borders?.widthSmall,
66
- borderRadius: borders?.radiusMedium,
67
- borderColor: colors?.borderDark,
68
- textLineHeight: typography?.lineHeightCondensed,
69
- selectedTextColor: colors?.textLightest,
70
- selectedBackgroundColor: colors?.backgroundDark,
71
- selectedOutlineWidth: borders?.widthLarge
65
+ borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
66
+ borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
67
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderDark,
68
+ textLineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
69
+ selectedTextColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
70
+ selectedBackgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundDark,
71
+ selectedOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthLarge
72
72
  };
73
73
  return { ...componentVariables,
74
74
  ...themeSpecificStyles[themeName]
@@ -101,17 +101,21 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
101
101
  }
102
102
 
103
103
  componentDidMount() {
104
- this.props.makeStyles?.();
104
+ var _this$props$makeStyle, _this$props3;
105
+
106
+ (_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
105
107
  }
106
108
 
107
109
  componentDidUpdate() {
108
- this.props.makeStyles?.();
110
+ var _this$props$makeStyle2, _this$props4;
111
+
112
+ (_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
109
113
  }
110
114
 
111
115
  get itemsLevel() {
112
- const _this$props3 = this.props,
113
- level = _this$props3.level,
114
- isCollectionFlattened = _this$props3.isCollectionFlattened;
116
+ const _this$props5 = this.props,
117
+ level = _this$props5.level,
118
+ isCollectionFlattened = _this$props5.isCollectionFlattened;
115
119
  return isCollectionFlattened ? level : level + 1;
116
120
  }
117
121
 
@@ -130,12 +134,12 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
130
134
  }
131
135
 
132
136
  renderChildren() {
133
- const _this$props4 = this.props,
134
- collections = _this$props4.collections,
135
- items = _this$props4.items,
136
- id = _this$props4.id,
137
- renderBeforeItems = _this$props4.renderBeforeItems,
138
- renderAfterItems = _this$props4.renderAfterItems;
137
+ const _this$props6 = this.props,
138
+ collections = _this$props6.collections,
139
+ items = _this$props6.items,
140
+ id = _this$props6.id,
141
+ renderBeforeItems = _this$props6.renderBeforeItems,
142
+ renderAfterItems = _this$props6.renderAfterItems;
139
143
  let position = 1;
140
144
  return jsx(React.Fragment, null, renderBeforeItems && this.renderCollectionChildren(id, renderBeforeItems, position++, 'before'), collections.map(collection => {
141
145
  return this.renderCollectionNode(collection, position++);
@@ -145,11 +149,11 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
145
149
  }
146
150
 
147
151
  renderCollectionChildren(collectionId, child, position, keyword) {
148
- const _this$props5 = this.props,
149
- selection = _this$props5.selection,
150
- onKeyDown = _this$props5.onKeyDown,
151
- getItemProps = _this$props5.getItemProps,
152
- styles = _this$props5.styles;
152
+ const _this$props7 = this.props,
153
+ selection = _this$props7.selection,
154
+ onKeyDown = _this$props7.onKeyDown,
155
+ getItemProps = _this$props7.getItemProps,
156
+ styles = _this$props7.styles;
153
157
  const key = `${collectionId}_${keyword}`;
154
158
  const ariaSelected = {};
155
159
 
@@ -170,7 +174,7 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
170
174
  return jsx("li", Object.assign({
171
175
  id: key,
172
176
  role: "treeitem",
173
- css: styles?.item,
177
+ css: styles === null || styles === void 0 ? void 0 : styles.item,
174
178
  tabIndex: -1,
175
179
  key: key,
176
180
  "aria-posinset": position,
@@ -191,7 +195,7 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
191
195
  if (typeof child.props.onKeyDown === 'function') {
192
196
  child.props.onKeyDown(e, n);
193
197
  } else {
194
- onKeyDown?.(e, itemHash);
198
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, itemHash);
195
199
  }
196
200
  },
197
201
  onBlur: e => this.handleBlur(e, itemHash)
@@ -219,12 +223,12 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
219
223
  }
220
224
 
221
225
  renderItemNode(item, position) {
222
- const _this$props6 = this.props,
223
- selection = _this$props6.selection,
224
- onItemClick = _this$props6.onItemClick,
225
- onKeyDown = _this$props6.onKeyDown,
226
- getItemProps = _this$props6.getItemProps,
227
- styles = _this$props6.styles;
226
+ const _this$props8 = this.props,
227
+ selection = _this$props8.selection,
228
+ onItemClick = _this$props8.onItemClick,
229
+ onKeyDown = _this$props8.onKeyDown,
230
+ getItemProps = _this$props8.getItemProps,
231
+ styles = _this$props8.styles;
228
232
  const ariaSelected = {};
229
233
 
230
234
  if (selection) {
@@ -249,12 +253,12 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
249
253
  tabIndex: -1,
250
254
  role: "treeitem",
251
255
  "aria-label": item.name,
252
- css: styles?.item,
256
+ css: styles === null || styles === void 0 ? void 0 : styles.item,
253
257
  "aria-level": this.itemsLevel,
254
258
  "aria-posinset": position,
255
259
  "aria-setsize": this.childCount,
256
- onClick: e => onItemClick?.(e, itemHash),
257
- onKeyDown: e => onKeyDown?.(e, itemHash),
260
+ onClick: e => onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(e, itemHash),
261
+ onKeyDown: e => onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, itemHash),
258
262
  onFocus: e => this.handleFocus(e, itemHash),
259
263
  onBlur: e => this.handleBlur(e, itemHash)
260
264
  }, ariaSelected), jsx(TreeButton, itemProps));
@@ -274,17 +278,17 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
274
278
  }
275
279
 
276
280
  render() {
277
- const _this$props7 = this.props,
278
- id = _this$props7.id,
279
- name = _this$props7.name,
280
- expanded = _this$props7.expanded,
281
- collectionIcon = _this$props7.collectionIcon,
282
- collectionIconExpanded = _this$props7.collectionIconExpanded,
283
- isCollectionFlattened = _this$props7.isCollectionFlattened,
284
- getCollectionProps = _this$props7.getCollectionProps,
285
- level = _this$props7.level,
286
- position = _this$props7.position,
287
- styles = _this$props7.styles;
281
+ const _this$props9 = this.props,
282
+ id = _this$props9.id,
283
+ name = _this$props9.name,
284
+ expanded = _this$props9.expanded,
285
+ collectionIcon = _this$props9.collectionIcon,
286
+ collectionIconExpanded = _this$props9.collectionIconExpanded,
287
+ isCollectionFlattened = _this$props9.isCollectionFlattened,
288
+ getCollectionProps = _this$props9.getCollectionProps,
289
+ level = _this$props9.level,
290
+ position = _this$props9.position,
291
+ styles = _this$props9.styles;
288
292
  const collectionProps = getCollectionProps({ ...this.getCommonButtonProps(),
289
293
  expanded: expanded,
290
294
  collectionIcon: collectionIcon,
@@ -301,7 +305,7 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
301
305
  ref: el => {
302
306
  this.ref = el;
303
307
  },
304
- css: styles?.treeCollection,
308
+ css: styles === null || styles === void 0 ? void 0 : styles.treeCollection,
305
309
  tabIndex: -1,
306
310
  role: "treeitem",
307
311
  "aria-label": this.props.name,
@@ -321,7 +325,7 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
321
325
  })
322
326
  }, ariaSelected), jsx(TreeButton, collectionProps), expanded && this.childCount > 0 && jsx("ul", {
323
327
  "aria-label": name,
324
- css: styles?.list,
328
+ css: styles === null || styles === void 0 ? void 0 : styles.list,
325
329
  role: "group"
326
330
  }, this.renderChildren()));
327
331
  }
@@ -33,12 +33,12 @@ const generateComponentTheme = theme => {
33
33
  typography = theme.typography,
34
34
  borders = theme.borders;
35
35
  const componentVariables = {
36
- fontFamily: typography?.fontFamily,
37
- baseSpacingSmall: spacing?.xSmall,
38
- baseSpacingMedium: spacing?.small,
36
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
37
+ baseSpacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
38
+ baseSpacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.small,
39
39
  baseSpacingLarge: '1rem',
40
- borderWidth: borders?.widthSmall,
41
- borderColor: colors?.borderDark
40
+ borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
41
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderDark
42
42
  };
43
43
  return { ...componentVariables
44
44
  };
@@ -60,24 +60,28 @@ let TreeNode = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2
60
60
  }
61
61
 
62
62
  componentDidMount() {
63
- this.props.makeStyles?.();
63
+ var _this$props$makeStyle, _this$props;
64
+
65
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
64
66
  }
65
67
 
66
68
  componentDidUpdate() {
67
- this.props.makeStyles?.();
69
+ var _this$props$makeStyle2, _this$props2;
70
+
71
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
68
72
  }
69
73
 
70
74
  renderItemImage() {
71
75
  var _Img;
72
76
 
73
- const _this$props = this.props,
74
- thumbnail = _this$props.thumbnail,
75
- itemIcon = _this$props.itemIcon,
76
- styles = _this$props.styles;
77
+ const _this$props3 = this.props,
78
+ thumbnail = _this$props3.thumbnail,
79
+ itemIcon = _this$props3.itemIcon,
80
+ styles = _this$props3.styles;
77
81
 
78
82
  if (thumbnail) {
79
83
  return jsx("div", {
80
- css: styles?.thumbnail
84
+ css: styles === null || styles === void 0 ? void 0 : styles.thumbnail
81
85
  }, _Img || (_Img = jsx(Img, {
82
86
  src: thumbnail,
83
87
  constrain: "cover",
@@ -87,7 +91,7 @@ let TreeNode = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2
87
91
 
88
92
  if (itemIcon) {
89
93
  return jsx("div", {
90
- css: styles?.icon
94
+ css: styles === null || styles === void 0 ? void 0 : styles.icon
91
95
  }, callRenderProp(itemIcon));
92
96
  }
93
97
 
@@ -95,17 +99,17 @@ let TreeNode = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2
95
99
  }
96
100
 
97
101
  render() {
98
- const _this$props2 = this.props,
99
- children = _this$props2.children,
100
- styles = _this$props2.styles;
102
+ const _this$props4 = this.props,
103
+ children = _this$props4.children,
104
+ styles = _this$props4.styles;
101
105
  return jsx("div", {
102
106
  ref: this.handleRef,
103
107
  tabIndex: -1,
104
- css: styles?.treeButton
108
+ css: styles === null || styles === void 0 ? void 0 : styles.treeButton
105
109
  }, jsx("span", {
106
- css: styles?.layout
110
+ css: styles === null || styles === void 0 ? void 0 : styles.layout
107
111
  }, this.renderItemImage(), jsx("span", {
108
- css: styles?.node
112
+ css: styles === null || styles === void 0 ? void 0 : styles.node
109
113
  }, children)));
110
114
  }
111
115
 
@@ -57,14 +57,16 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
57
57
  e.stopPropagation();
58
58
  const onCollectionClick = _this.props.onCollectionClick;
59
59
  if (expand) _this.expandOrCollapseNode(collection);
60
- onCollectionClick?.(collection.id, collection); // TODO: this should pass the event as the first arg
60
+ onCollectionClick === null || onCollectionClick === void 0 ? void 0 : onCollectionClick(collection.id, collection); // TODO: this should pass the event as the first arg
61
61
 
62
62
  _this.handleSelection(collection.id, 'collection');
63
63
  };
64
64
 
65
65
  this.handleItemClick = (e, item) => {
66
+ var _this$props$onItemCli, _this$props;
67
+
66
68
  e.stopPropagation();
67
- this.props.onItemClick?.(item);
69
+ (_this$props$onItemCli = (_this$props = this.props).onItemClick) === null || _this$props$onItemCli === void 0 ? void 0 : _this$props$onItemCli.call(_this$props, item);
68
70
  this.handleSelection(item.id, 'item');
69
71
  };
70
72
 
@@ -105,9 +107,9 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
105
107
  };
106
108
 
107
109
  this.getIsFlattened = collection => {
108
- const _this$props = this.props,
109
- rootId = _this$props.rootId,
110
- showRootCollection = _this$props.showRootCollection;
110
+ const _this$props2 = this.props,
111
+ rootId = _this$props2.rootId,
112
+ showRootCollection = _this$props2.showRootCollection;
111
113
  return !showRootCollection && typeof rootId !== 'undefined' && collection.id === rootId;
112
114
  };
113
115
 
@@ -124,11 +126,15 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
124
126
  }
125
127
 
126
128
  componentDidMount() {
127
- this.props.makeStyles?.();
129
+ var _this$props$makeStyle, _this$props3;
130
+
131
+ (_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
128
132
  }
129
133
 
130
134
  componentDidUpdate() {
131
- this.props.makeStyles?.();
135
+ var _this$props$makeStyle2, _this$props4;
136
+
137
+ (_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
132
138
  }
133
139
 
134
140
  get _root() {
@@ -136,9 +142,9 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
136
142
  }
137
143
 
138
144
  get collections() {
139
- const _this$props2 = this.props,
140
- collections = _this$props2.collections,
141
- rootId = _this$props2.rootId;
145
+ const _this$props5 = this.props,
146
+ collections = _this$props5.collections,
147
+ rootId = _this$props5.rootId;
142
148
 
143
149
  if (typeof rootId !== 'undefined') {
144
150
  return [collections[rootId]];
@@ -156,7 +162,9 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
156
162
  }
157
163
 
158
164
  expandOrCollapseNode(collection) {
159
- this.props.onCollectionToggle?.(collection);
165
+ var _this$props$onCollect, _this$props6;
166
+
167
+ (_this$props$onCollect = (_this$props6 = this.props).onCollectionToggle) === null || _this$props$onCollect === void 0 ? void 0 : _this$props$onCollect.call(_this$props6, collection);
160
168
 
161
169
  if (typeof this.props.expanded === 'undefined') {
162
170
  this.setState((state, props) => {
@@ -314,7 +322,7 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
314
322
  render() {
315
323
  const styles = this.props.styles;
316
324
  return jsx("ul", {
317
- css: styles?.treeBrowser,
325
+ css: styles === null || styles === void 0 ? void 0 : styles.treeBrowser,
318
326
  tabIndex: 0,
319
327
  role: "tree",
320
328
  onKeyDown: this.handleKeyDown,
@@ -31,10 +31,10 @@ const generateComponentTheme = theme => {
31
31
  const colors = theme.colors,
32
32
  borders = theme.borders;
33
33
  const componentVariables = {
34
- borderRadius: borders?.radiusMedium,
35
- focusOutlineWidth: borders?.widthMedium,
36
- focusOutlineColor: colors?.borderBrand,
37
- focusOutlineStyle: borders?.style
34
+ borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
35
+ focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
36
+ focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
37
+ focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style
38
38
  };
39
39
  return { ...componentVariables
40
40
  };
@@ -49,11 +49,15 @@ let TreeButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
49
49
  }
50
50
 
51
51
  componentDidMount() {
52
- this.props.makeStyles?.();
52
+ var _this$props$makeStyle, _this$props;
53
+
54
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
53
55
  }
54
56
 
55
57
  componentDidUpdate() {
56
- this.props.makeStyles?.();
58
+ var _this$props$makeStyle2, _this$props2;
59
+
60
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
57
61
  }
58
62
 
59
63
  defaultContentRenderer(props) {
@@ -90,15 +94,15 @@ let TreeButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
90
94
  }
91
95
 
92
96
  renderCollectionIcon() {
93
- const _this$props = this.props,
94
- expanded = _this$props.expanded,
95
- collectionIcon = _this$props.collectionIcon,
96
- collectionIconExpanded = _this$props.collectionIconExpanded,
97
- styles = _this$props.styles;
97
+ const _this$props3 = this.props,
98
+ expanded = _this$props3.expanded,
99
+ collectionIcon = _this$props3.collectionIcon,
100
+ collectionIconExpanded = _this$props3.collectionIconExpanded,
101
+ styles = _this$props3.styles;
98
102
 
99
103
  if (collectionIcon || collectionIconExpanded) {
100
104
  return (0, _emotion.jsx)("div", {
101
- css: styles?.icon
105
+ css: styles === null || styles === void 0 ? void 0 : styles.icon
102
106
  }, (0, _callRenderProp.callRenderProp)(expanded ? collectionIconExpanded : collectionIcon));
103
107
  }
104
108
 
@@ -108,14 +112,14 @@ let TreeButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
108
112
  renderItemImage() {
109
113
  var _Img;
110
114
 
111
- const _this$props2 = this.props,
112
- thumbnail = _this$props2.thumbnail,
113
- itemIcon = _this$props2.itemIcon,
114
- styles = _this$props2.styles;
115
+ const _this$props4 = this.props,
116
+ thumbnail = _this$props4.thumbnail,
117
+ itemIcon = _this$props4.itemIcon,
118
+ styles = _this$props4.styles;
115
119
 
116
120
  if (thumbnail) {
117
121
  return (0, _emotion.jsx)("div", {
118
- css: styles?.thumbnail
122
+ css: styles === null || styles === void 0 ? void 0 : styles.thumbnail
119
123
  }, _Img || (_Img = (0, _emotion.jsx)(_Img2.Img, {
120
124
  src: thumbnail,
121
125
  constrain: "cover",
@@ -125,7 +129,7 @@ let TreeButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
125
129
 
126
130
  if (itemIcon) {
127
131
  return (0, _emotion.jsx)("div", {
128
- css: styles?.icon
132
+ css: styles === null || styles === void 0 ? void 0 : styles.icon
129
133
  }, (0, _callRenderProp.callRenderProp)(itemIcon));
130
134
  }
131
135
 
@@ -133,16 +137,16 @@ let TreeButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
133
137
  }
134
138
 
135
139
  render() {
136
- const _this$props3 = this.props,
137
- styles = _this$props3.styles,
138
- renderContent = _this$props3.renderContent;
140
+ const _this$props5 = this.props,
141
+ styles = _this$props5.styles,
142
+ renderContent = _this$props5.renderContent;
139
143
  const buttonContent = renderContent ? renderContent(this.props) : this.defaultContentRenderer(this.props); // VoiceOver can't navigate without the buttons, even though they don't do anything
140
144
 
141
145
  return (0, _emotion.jsx)("button", {
142
146
  ref: this.handleRef,
143
147
  tabIndex: -1,
144
148
  type: "button",
145
- css: styles?.treeButton
149
+ css: styles === null || styles === void 0 ? void 0 : styles.treeButton
146
150
  }, buttonContent);
147
151
  }
148
152
 
@@ -50,32 +50,32 @@ const generateComponentTheme = theme => {
50
50
  }
51
51
  };
52
52
  const componentVariables = {
53
- hoverBackgroundColor: colors?.backgroundBrand,
54
- hoverTextColor: colors?.textLightest,
55
- focusOutlineWidth: borders?.widthMedium,
56
- focusOutlineColor: colors?.borderBrand,
57
- focusOutlineStyle: borders?.style,
58
- iconColor: colors?.textDarkest,
59
- iconsMarginRight: spacing?.xSmall,
60
- descriptorMarginTop: spacing?.xxxSmall,
61
- descriptorTextColor: colors?.textDarkest,
62
- descriptorFontSizeSmall: typography?.fontSizeXSmall,
63
- descriptorFontSizeMedium: typography?.fontSizeXSmall,
64
- descriptorFontSizeLarge: typography?.fontSizeSmall,
65
- nameTextColor: colors?.textBrand,
66
- nameFontSizeSmall: typography?.fontSizeXSmall,
67
- nameFontSizeMedium: typography?.fontSizeSmall,
68
- nameFontSizeLarge: typography?.fontSizeMedium,
69
- baseSpacingSmall: spacing?.xSmall,
70
- baseSpacingMedium: spacing?.small,
53
+ hoverBackgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundBrand,
54
+ hoverTextColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
55
+ focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
56
+ focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
57
+ focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style,
58
+ iconColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
59
+ iconsMarginRight: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
60
+ descriptorMarginTop: spacing === null || spacing === void 0 ? void 0 : spacing.xxxSmall,
61
+ descriptorTextColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
62
+ descriptorFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
63
+ descriptorFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
64
+ descriptorFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
65
+ nameTextColor: colors === null || colors === void 0 ? void 0 : colors.textBrand,
66
+ nameFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
67
+ nameFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
68
+ nameFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
69
+ baseSpacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
70
+ baseSpacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.small,
71
71
  baseSpacingLarge: '1rem',
72
- borderWidth: borders?.widthSmall,
73
- borderRadius: borders?.radiusMedium,
74
- borderColor: colors?.borderDark,
75
- textLineHeight: typography?.lineHeightCondensed,
76
- selectedTextColor: colors?.textLightest,
77
- selectedBackgroundColor: colors?.backgroundDark,
78
- selectedOutlineWidth: borders?.widthLarge
72
+ borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
73
+ borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
74
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderDark,
75
+ textLineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
76
+ selectedTextColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
77
+ selectedBackgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundDark,
78
+ selectedOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthLarge
79
79
  };
80
80
  return { ...componentVariables,
81
81
  ...themeSpecificStyles[themeName]
@@ -91,17 +91,21 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
91
91
  }
92
92
 
93
93
  componentDidMount() {
94
- this.props.makeStyles?.();
94
+ var _this$props$makeStyle, _this$props3;
95
+
96
+ (_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
95
97
  }
96
98
 
97
99
  componentDidUpdate() {
98
- this.props.makeStyles?.();
100
+ var _this$props$makeStyle2, _this$props4;
101
+
102
+ (_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
99
103
  }
100
104
 
101
105
  get itemsLevel() {
102
- const _this$props3 = this.props,
103
- level = _this$props3.level,
104
- isCollectionFlattened = _this$props3.isCollectionFlattened;
106
+ const _this$props5 = this.props,
107
+ level = _this$props5.level,
108
+ isCollectionFlattened = _this$props5.isCollectionFlattened;
105
109
  return isCollectionFlattened ? level : level + 1;
106
110
  }
107
111
 
@@ -120,12 +124,12 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
120
124
  }
121
125
 
122
126
  renderChildren() {
123
- const _this$props4 = this.props,
124
- collections = _this$props4.collections,
125
- items = _this$props4.items,
126
- id = _this$props4.id,
127
- renderBeforeItems = _this$props4.renderBeforeItems,
128
- renderAfterItems = _this$props4.renderAfterItems;
127
+ const _this$props6 = this.props,
128
+ collections = _this$props6.collections,
129
+ items = _this$props6.items,
130
+ id = _this$props6.id,
131
+ renderBeforeItems = _this$props6.renderBeforeItems,
132
+ renderAfterItems = _this$props6.renderAfterItems;
129
133
  let position = 1;
130
134
  return (0, _emotion.jsx)(_react.default.Fragment, null, renderBeforeItems && this.renderCollectionChildren(id, renderBeforeItems, position++, 'before'), collections.map(collection => {
131
135
  return this.renderCollectionNode(collection, position++);
@@ -135,11 +139,11 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
135
139
  }
136
140
 
137
141
  renderCollectionChildren(collectionId, child, position, keyword) {
138
- const _this$props5 = this.props,
139
- selection = _this$props5.selection,
140
- onKeyDown = _this$props5.onKeyDown,
141
- getItemProps = _this$props5.getItemProps,
142
- styles = _this$props5.styles;
142
+ const _this$props7 = this.props,
143
+ selection = _this$props7.selection,
144
+ onKeyDown = _this$props7.onKeyDown,
145
+ getItemProps = _this$props7.getItemProps,
146
+ styles = _this$props7.styles;
143
147
  const key = `${collectionId}_${keyword}`;
144
148
  const ariaSelected = {};
145
149
 
@@ -160,7 +164,7 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
160
164
  return (0, _emotion.jsx)("li", Object.assign({
161
165
  id: key,
162
166
  role: "treeitem",
163
- css: styles?.item,
167
+ css: styles === null || styles === void 0 ? void 0 : styles.item,
164
168
  tabIndex: -1,
165
169
  key: key,
166
170
  "aria-posinset": position,
@@ -181,7 +185,7 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
181
185
  if (typeof child.props.onKeyDown === 'function') {
182
186
  child.props.onKeyDown(e, n);
183
187
  } else {
184
- onKeyDown?.(e, itemHash);
188
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, itemHash);
185
189
  }
186
190
  },
187
191
  onBlur: e => this.handleBlur(e, itemHash)
@@ -209,12 +213,12 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
209
213
  }
210
214
 
211
215
  renderItemNode(item, position) {
212
- const _this$props6 = this.props,
213
- selection = _this$props6.selection,
214
- onItemClick = _this$props6.onItemClick,
215
- onKeyDown = _this$props6.onKeyDown,
216
- getItemProps = _this$props6.getItemProps,
217
- styles = _this$props6.styles;
216
+ const _this$props8 = this.props,
217
+ selection = _this$props8.selection,
218
+ onItemClick = _this$props8.onItemClick,
219
+ onKeyDown = _this$props8.onKeyDown,
220
+ getItemProps = _this$props8.getItemProps,
221
+ styles = _this$props8.styles;
218
222
  const ariaSelected = {};
219
223
 
220
224
  if (selection) {
@@ -239,12 +243,12 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
239
243
  tabIndex: -1,
240
244
  role: "treeitem",
241
245
  "aria-label": item.name,
242
- css: styles?.item,
246
+ css: styles === null || styles === void 0 ? void 0 : styles.item,
243
247
  "aria-level": this.itemsLevel,
244
248
  "aria-posinset": position,
245
249
  "aria-setsize": this.childCount,
246
- onClick: e => onItemClick?.(e, itemHash),
247
- onKeyDown: e => onKeyDown?.(e, itemHash),
250
+ onClick: e => onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(e, itemHash),
251
+ onKeyDown: e => onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, itemHash),
248
252
  onFocus: e => this.handleFocus(e, itemHash),
249
253
  onBlur: e => this.handleBlur(e, itemHash)
250
254
  }, ariaSelected), (0, _emotion.jsx)(_TreeButton.TreeButton, itemProps));
@@ -264,17 +268,17 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
264
268
  }
265
269
 
266
270
  render() {
267
- const _this$props7 = this.props,
268
- id = _this$props7.id,
269
- name = _this$props7.name,
270
- expanded = _this$props7.expanded,
271
- collectionIcon = _this$props7.collectionIcon,
272
- collectionIconExpanded = _this$props7.collectionIconExpanded,
273
- isCollectionFlattened = _this$props7.isCollectionFlattened,
274
- getCollectionProps = _this$props7.getCollectionProps,
275
- level = _this$props7.level,
276
- position = _this$props7.position,
277
- styles = _this$props7.styles;
271
+ const _this$props9 = this.props,
272
+ id = _this$props9.id,
273
+ name = _this$props9.name,
274
+ expanded = _this$props9.expanded,
275
+ collectionIcon = _this$props9.collectionIcon,
276
+ collectionIconExpanded = _this$props9.collectionIconExpanded,
277
+ isCollectionFlattened = _this$props9.isCollectionFlattened,
278
+ getCollectionProps = _this$props9.getCollectionProps,
279
+ level = _this$props9.level,
280
+ position = _this$props9.position,
281
+ styles = _this$props9.styles;
278
282
  const collectionProps = getCollectionProps({ ...this.getCommonButtonProps(),
279
283
  expanded: expanded,
280
284
  collectionIcon: collectionIcon,
@@ -291,7 +295,7 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
291
295
  ref: el => {
292
296
  this.ref = el;
293
297
  },
294
- css: styles?.treeCollection,
298
+ css: styles === null || styles === void 0 ? void 0 : styles.treeCollection,
295
299
  tabIndex: -1,
296
300
  role: "treeitem",
297
301
  "aria-label": this.props.name,
@@ -311,7 +315,7 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
311
315
  })
312
316
  }, ariaSelected), (0, _emotion.jsx)(_TreeButton.TreeButton, collectionProps), expanded && this.childCount > 0 && (0, _emotion.jsx)("ul", {
313
317
  "aria-label": name,
314
- css: styles?.list,
318
+ css: styles === null || styles === void 0 ? void 0 : styles.list,
315
319
  role: "group"
316
320
  }, this.renderChildren()));
317
321
  }
@@ -40,12 +40,12 @@ const generateComponentTheme = theme => {
40
40
  typography = theme.typography,
41
41
  borders = theme.borders;
42
42
  const componentVariables = {
43
- fontFamily: typography?.fontFamily,
44
- baseSpacingSmall: spacing?.xSmall,
45
- baseSpacingMedium: spacing?.small,
43
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
44
+ baseSpacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
45
+ baseSpacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.small,
46
46
  baseSpacingLarge: '1rem',
47
- borderWidth: borders?.widthSmall,
48
- borderColor: colors?.borderDark
47
+ borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
48
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderDark
49
49
  };
50
50
  return { ...componentVariables
51
51
  };
@@ -51,24 +51,28 @@ let TreeNode = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
51
51
  }
52
52
 
53
53
  componentDidMount() {
54
- this.props.makeStyles?.();
54
+ var _this$props$makeStyle, _this$props;
55
+
56
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
55
57
  }
56
58
 
57
59
  componentDidUpdate() {
58
- this.props.makeStyles?.();
60
+ var _this$props$makeStyle2, _this$props2;
61
+
62
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
59
63
  }
60
64
 
61
65
  renderItemImage() {
62
66
  var _Img;
63
67
 
64
- const _this$props = this.props,
65
- thumbnail = _this$props.thumbnail,
66
- itemIcon = _this$props.itemIcon,
67
- styles = _this$props.styles;
68
+ const _this$props3 = this.props,
69
+ thumbnail = _this$props3.thumbnail,
70
+ itemIcon = _this$props3.itemIcon,
71
+ styles = _this$props3.styles;
68
72
 
69
73
  if (thumbnail) {
70
74
  return (0, _emotion.jsx)("div", {
71
- css: styles?.thumbnail
75
+ css: styles === null || styles === void 0 ? void 0 : styles.thumbnail
72
76
  }, _Img || (_Img = (0, _emotion.jsx)(_Img2.Img, {
73
77
  src: thumbnail,
74
78
  constrain: "cover",
@@ -78,7 +82,7 @@ let TreeNode = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
78
82
 
79
83
  if (itemIcon) {
80
84
  return (0, _emotion.jsx)("div", {
81
- css: styles?.icon
85
+ css: styles === null || styles === void 0 ? void 0 : styles.icon
82
86
  }, (0, _callRenderProp.callRenderProp)(itemIcon));
83
87
  }
84
88
 
@@ -86,17 +90,17 @@ let TreeNode = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
86
90
  }
87
91
 
88
92
  render() {
89
- const _this$props2 = this.props,
90
- children = _this$props2.children,
91
- styles = _this$props2.styles;
93
+ const _this$props4 = this.props,
94
+ children = _this$props4.children,
95
+ styles = _this$props4.styles;
92
96
  return (0, _emotion.jsx)("div", {
93
97
  ref: this.handleRef,
94
98
  tabIndex: -1,
95
- css: styles?.treeButton
99
+ css: styles === null || styles === void 0 ? void 0 : styles.treeButton
96
100
  }, (0, _emotion.jsx)("span", {
97
- css: styles?.layout
101
+ css: styles === null || styles === void 0 ? void 0 : styles.layout
98
102
  }, this.renderItemImage(), (0, _emotion.jsx)("span", {
99
- css: styles?.node
103
+ css: styles === null || styles === void 0 ? void 0 : styles.node
100
104
  }, children)));
101
105
  }
102
106
 
@@ -56,14 +56,16 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
56
56
  e.stopPropagation();
57
57
  const onCollectionClick = _this.props.onCollectionClick;
58
58
  if (expand) _this.expandOrCollapseNode(collection);
59
- onCollectionClick?.(collection.id, collection); // TODO: this should pass the event as the first arg
59
+ onCollectionClick === null || onCollectionClick === void 0 ? void 0 : onCollectionClick(collection.id, collection); // TODO: this should pass the event as the first arg
60
60
 
61
61
  _this.handleSelection(collection.id, 'collection');
62
62
  };
63
63
 
64
64
  this.handleItemClick = (e, item) => {
65
+ var _this$props$onItemCli, _this$props;
66
+
65
67
  e.stopPropagation();
66
- this.props.onItemClick?.(item);
68
+ (_this$props$onItemCli = (_this$props = this.props).onItemClick) === null || _this$props$onItemCli === void 0 ? void 0 : _this$props$onItemCli.call(_this$props, item);
67
69
  this.handleSelection(item.id, 'item');
68
70
  };
69
71
 
@@ -104,9 +106,9 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
104
106
  };
105
107
 
106
108
  this.getIsFlattened = collection => {
107
- const _this$props = this.props,
108
- rootId = _this$props.rootId,
109
- showRootCollection = _this$props.showRootCollection;
109
+ const _this$props2 = this.props,
110
+ rootId = _this$props2.rootId,
111
+ showRootCollection = _this$props2.showRootCollection;
110
112
  return !showRootCollection && typeof rootId !== 'undefined' && collection.id === rootId;
111
113
  };
112
114
 
@@ -123,11 +125,15 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
123
125
  }
124
126
 
125
127
  componentDidMount() {
126
- this.props.makeStyles?.();
128
+ var _this$props$makeStyle, _this$props3;
129
+
130
+ (_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
127
131
  }
128
132
 
129
133
  componentDidUpdate() {
130
- this.props.makeStyles?.();
134
+ var _this$props$makeStyle2, _this$props4;
135
+
136
+ (_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
131
137
  }
132
138
 
133
139
  get _root() {
@@ -135,9 +141,9 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
135
141
  }
136
142
 
137
143
  get collections() {
138
- const _this$props2 = this.props,
139
- collections = _this$props2.collections,
140
- rootId = _this$props2.rootId;
144
+ const _this$props5 = this.props,
145
+ collections = _this$props5.collections,
146
+ rootId = _this$props5.rootId;
141
147
 
142
148
  if (typeof rootId !== 'undefined') {
143
149
  return [collections[rootId]];
@@ -155,7 +161,9 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
155
161
  }
156
162
 
157
163
  expandOrCollapseNode(collection) {
158
- this.props.onCollectionToggle?.(collection);
164
+ var _this$props$onCollect, _this$props6;
165
+
166
+ (_this$props$onCollect = (_this$props6 = this.props).onCollectionToggle) === null || _this$props$onCollect === void 0 ? void 0 : _this$props$onCollect.call(_this$props6, collection);
159
167
 
160
168
  if (typeof this.props.expanded === 'undefined') {
161
169
  this.setState((state, props) => {
@@ -313,7 +321,7 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
313
321
  render() {
314
322
  const styles = this.props.styles;
315
323
  return (0, _emotion.jsx)("ul", {
316
- css: styles?.treeBrowser,
324
+ css: styles === null || styles === void 0 ? void 0 : styles.treeBrowser,
317
325
  tabIndex: 0,
318
326
  role: "tree",
319
327
  onKeyDown: this.handleKeyDown,
@@ -38,10 +38,10 @@ const generateComponentTheme = theme => {
38
38
  const colors = theme.colors,
39
39
  borders = theme.borders;
40
40
  const componentVariables = {
41
- borderRadius: borders?.radiusMedium,
42
- focusOutlineWidth: borders?.widthMedium,
43
- focusOutlineColor: colors?.borderBrand,
44
- focusOutlineStyle: borders?.style
41
+ borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
42
+ focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
43
+ focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
44
+ focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style
45
45
  };
46
46
  return { ...componentVariables
47
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-tree-browser",
3
- "version": "8.18.0",
3
+ "version": "8.18.1-snapshot.0+435c9ae79",
4
4
  "description": "A component for displaying a hierarchical view of information",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,22 +23,22 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.18.0",
27
- "@instructure/ui-color-utils": "8.18.0",
28
- "@instructure/ui-test-locator": "8.18.0",
29
- "@instructure/ui-test-utils": "8.18.0",
30
- "@instructure/ui-themes": "8.18.0"
26
+ "@instructure/ui-babel-preset": "8.18.1-snapshot.0+435c9ae79",
27
+ "@instructure/ui-color-utils": "8.18.1-snapshot.0+435c9ae79",
28
+ "@instructure/ui-test-locator": "8.18.1-snapshot.0+435c9ae79",
29
+ "@instructure/ui-test-utils": "8.18.1-snapshot.0+435c9ae79",
30
+ "@instructure/ui-themes": "8.18.1-snapshot.0+435c9ae79"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/emotion": "8.18.0",
35
- "@instructure/shared-types": "8.18.0",
36
- "@instructure/ui-icons": "8.18.0",
37
- "@instructure/ui-img": "8.18.0",
38
- "@instructure/ui-prop-types": "8.18.0",
39
- "@instructure/ui-react-utils": "8.18.0",
40
- "@instructure/ui-testable": "8.18.0",
41
- "@instructure/ui-utils": "8.18.0",
34
+ "@instructure/emotion": "8.18.1-snapshot.0+435c9ae79",
35
+ "@instructure/shared-types": "8.18.1-snapshot.0+435c9ae79",
36
+ "@instructure/ui-icons": "8.18.1-snapshot.0+435c9ae79",
37
+ "@instructure/ui-img": "8.18.1-snapshot.0+435c9ae79",
38
+ "@instructure/ui-prop-types": "8.18.1-snapshot.0+435c9ae79",
39
+ "@instructure/ui-react-utils": "8.18.1-snapshot.0+435c9ae79",
40
+ "@instructure/ui-testable": "8.18.1-snapshot.0+435c9ae79",
41
+ "@instructure/ui-utils": "8.18.1-snapshot.0+435c9ae79",
42
42
  "keycode": "^2",
43
43
  "prop-types": "^15"
44
44
  },
@@ -48,5 +48,6 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "sideEffects": false
51
+ "sideEffects": false,
52
+ "gitHead": "435c9ae794c15e2bd103f700f8c4e946d91c1b59"
52
53
  }