@instructure/ui-tabs 8.18.0 → 8.18.1-snapshot.12

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.
@@ -60,32 +60,36 @@ let Panel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
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
  render() {
71
- const _this$props = this.props,
72
- labelledBy = _this$props.labelledBy,
73
- variant = _this$props.variant,
74
- id = _this$props.id,
75
- maxHeight = _this$props.maxHeight,
76
- minHeight = _this$props.minHeight,
77
- padding = _this$props.padding,
78
- textAlign = _this$props.textAlign,
79
- children = _this$props.children,
80
- elementRef = _this$props.elementRef,
81
- isDisabled = _this$props.isDisabled,
82
- isSelected = _this$props.isSelected,
83
- styles = _this$props.styles,
84
- props = _objectWithoutProperties(_this$props, _excluded);
75
+ const _this$props3 = this.props,
76
+ labelledBy = _this$props3.labelledBy,
77
+ variant = _this$props3.variant,
78
+ id = _this$props3.id,
79
+ maxHeight = _this$props3.maxHeight,
80
+ minHeight = _this$props3.minHeight,
81
+ padding = _this$props3.padding,
82
+ textAlign = _this$props3.textAlign,
83
+ children = _this$props3.children,
84
+ elementRef = _this$props3.elementRef,
85
+ isDisabled = _this$props3.isDisabled,
86
+ isSelected = _this$props3.isSelected,
87
+ styles = _this$props3.styles,
88
+ props = _objectWithoutProperties(_this$props3, _excluded);
85
89
 
86
90
  const isHidden = !isSelected || !!isDisabled;
87
91
  return jsx("div", Object.assign({}, passthroughProps(props), {
88
- css: styles?.panel,
92
+ css: styles === null || styles === void 0 ? void 0 : styles.panel,
89
93
  role: "tabpanel",
90
94
  id: id,
91
95
  "aria-labelledby": labelledBy,
@@ -97,7 +101,7 @@ let Panel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
97
101
  unmountOnExit: true,
98
102
  transitionExit: false
99
103
  }, jsx(View, {
100
- css: styles?.content,
104
+ css: styles === null || styles === void 0 ? void 0 : styles.content,
101
105
  maxHeight: maxHeight,
102
106
  minHeight: minHeight,
103
107
  as: "div",
@@ -38,15 +38,15 @@ const generateComponentTheme = theme => {
38
38
  }
39
39
  };
40
40
  const componentVariables = {
41
- fontSize: typography?.fontSizeMedium,
42
- fontFamily: typography?.fontFamily,
43
- fontWeight: typography?.fontWeightNormal,
44
- lineHeight: typography?.lineHeight,
45
- color: colors?.textDarkest,
46
- background: colors?.backgroundLightest,
47
- borderColor: colors?.borderMedium,
48
- borderWidth: borders?.widthSmall,
49
- borderStyle: borders?.style
41
+ fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
42
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
43
+ fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
44
+ lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeight,
45
+ color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
46
+ background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
47
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
48
+ borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
49
+ borderStyle: borders === null || borders === void 0 ? void 0 : borders.style
50
50
  };
51
51
  return { ...componentVariables,
52
52
  ...themeSpecificStyle[themeName]
@@ -87,23 +87,27 @@ let Tab = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
87
87
  }
88
88
 
89
89
  componentDidMount() {
90
- this.props.makeStyles?.();
90
+ var _this$props$makeStyle, _this$props3;
91
+
92
+ (_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
91
93
  }
92
94
 
93
95
  componentDidUpdate() {
94
- this.props.makeStyles?.();
96
+ var _this$props$makeStyle2, _this$props4;
97
+
98
+ (_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
95
99
  }
96
100
 
97
101
  render() {
98
- const _this$props3 = this.props,
99
- id = _this$props3.id,
100
- variant = _this$props3.variant,
101
- isSelected = _this$props3.isSelected,
102
- isDisabled = _this$props3.isDisabled,
103
- controls = _this$props3.controls,
104
- children = _this$props3.children,
105
- styles = _this$props3.styles,
106
- props = _objectWithoutProperties(_this$props3, _excluded);
102
+ const _this$props5 = this.props,
103
+ id = _this$props5.id,
104
+ variant = _this$props5.variant,
105
+ isSelected = _this$props5.isSelected,
106
+ isDisabled = _this$props5.isDisabled,
107
+ controls = _this$props5.controls,
108
+ children = _this$props5.children,
109
+ styles = _this$props5.styles,
110
+ props = _objectWithoutProperties(_this$props5, _excluded);
107
111
 
108
112
  return jsx(View, Object.assign({}, passthroughProps(props), {
109
113
  as: "div",
@@ -111,7 +115,7 @@ let Tab = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
111
115
  id: id,
112
116
  onClick: this.handleClick,
113
117
  onKeyDown: this.handleKeyDown,
114
- css: styles?.tab,
118
+ css: styles === null || styles === void 0 ? void 0 : styles.tab,
115
119
  "aria-selected": isSelected ? 'true' : void 0,
116
120
  "aria-disabled": isDisabled ? 'true' : void 0,
117
121
  "aria-controls": controls,
@@ -40,17 +40,17 @@ const generateComponentTheme = theme => {
40
40
  }
41
41
  };
42
42
  const componentVariables = {
43
- fontFamily: typography?.fontFamily,
44
- fontWeight: typography?.fontWeightNormal,
45
- lineHeight: typography?.lineHeightCondensed,
46
- fontSize: typography?.fontSizeMedium,
47
- defaultColor: colors?.textDarkest,
48
- defaultHoverBorderColor: colors?.borderMedium,
49
- defaultSelectedBorderColor: colors?.borderBrand,
50
- secondaryColor: colors?.textDarkest,
51
- secondarySelectedBackground: colors?.backgroundLightest,
52
- secondarySelectedBorderColor: colors?.borderMedium,
53
- zIndex: stacking?.above
43
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
44
+ fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
45
+ lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
46
+ fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
47
+ defaultColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
48
+ defaultHoverBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
49
+ defaultSelectedBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
50
+ secondaryColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
51
+ secondarySelectedBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
52
+ secondarySelectedBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
53
+ zIndex: stacking === null || stacking === void 0 ? void 0 : stacking.above
54
54
  };
55
55
  return { ...componentVariables,
56
56
  ...themeSpecificStyle[themeName]
package/es/Tabs/index.js CHANGED
@@ -117,6 +117,8 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
117
117
  }
118
118
 
119
119
  componentDidMount() {
120
+ var _this$props$makeStyle, _this$props;
121
+
120
122
  if (this.props.tabOverflow === 'scroll' && this._tabList) {
121
123
  this.startScrollOverflow();
122
124
  }
@@ -125,10 +127,12 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
125
127
  this.focus();
126
128
  }
127
129
 
128
- this.props.makeStyles?.();
130
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
129
131
  }
130
132
 
131
133
  componentDidUpdate(prevProps, prevState) {
134
+ var _this$props$makeStyle2, _this$props2;
135
+
132
136
  if (this.props.shouldFocusOnRender && !prevProps.shouldFocusOnRender) {
133
137
  this.focus();
134
138
  } // start event listeners for scroll overflow
@@ -156,7 +160,7 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
156
160
  this.showActiveTabIfOverlayed(activeTabEl);
157
161
  }
158
162
 
159
- this.props.makeStyles?.();
163
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
160
164
  }
161
165
 
162
166
  componentWillUnmount() {
@@ -175,7 +179,9 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
175
179
  const newWidth = entry.contentRect.width;
176
180
 
177
181
  if (this._tabListPosition.width !== newWidth) {
178
- this._debounced?.();
182
+ var _this$_debounced;
183
+
184
+ (_this$_debounced = this._debounced) === null || _this$_debounced === void 0 ? void 0 : _this$_debounced.call(this);
179
185
  }
180
186
  }
181
187
  });
@@ -194,16 +200,16 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
194
200
  }
195
201
 
196
202
  getOverlayWidth() {
197
- const _this$props = this.props,
198
- variant = _this$props.variant,
199
- tabOverflow = _this$props.tabOverflow,
200
- styles = _this$props.styles;
203
+ const _this$props3 = this.props,
204
+ variant = _this$props3.variant,
205
+ tabOverflow = _this$props3.tabOverflow,
206
+ styles = _this$props3.styles;
201
207
 
202
208
  if (styles && tabOverflow === 'scroll') {
203
209
  if (variant === 'default') {
204
- return px(styles?.scrollOverlayWidthDefault);
210
+ return px(styles === null || styles === void 0 ? void 0 : styles.scrollOverlayWidthDefault);
205
211
  } else {
206
- return px(styles?.scrollOverlayWidthSecondary);
212
+ return px(styles === null || styles === void 0 ? void 0 : styles.scrollOverlayWidthSecondary);
207
213
  }
208
214
  }
209
215
 
@@ -317,17 +323,17 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
317
323
  const panels = [];
318
324
  const tabs = [];
319
325
 
320
- const _this$props2 = this.props,
321
- children = _this$props2.children,
322
- elementRef = _this$props2.elementRef,
323
- maxWidth = _this$props2.maxWidth,
324
- variant = _this$props2.variant,
325
- margin = _this$props2.margin,
326
- screenReaderLabel = _this$props2.screenReaderLabel,
327
- onRequestTabChange = _this$props2.onRequestTabChange,
328
- tabOverflow = _this$props2.tabOverflow,
329
- styles = _this$props2.styles,
330
- props = _objectWithoutProperties(_this$props2, _excluded);
326
+ const _this$props4 = this.props,
327
+ children = _this$props4.children,
328
+ elementRef = _this$props4.elementRef,
329
+ maxWidth = _this$props4.maxWidth,
330
+ variant = _this$props4.variant,
331
+ margin = _this$props4.margin,
332
+ screenReaderLabel = _this$props4.screenReaderLabel,
333
+ onRequestTabChange = _this$props4.onRequestTabChange,
334
+ tabOverflow = _this$props4.tabOverflow,
335
+ styles = _this$props4.styles,
336
+ props = _objectWithoutProperties(_this$props4, _excluded);
331
337
 
332
338
  const selectedChildIndex = React.Children.toArray(children).filter(child => matchComponentTypes(child, [Panel])).findIndex(child => child.props.isSelected && !child.props.isDisabled);
333
339
  let index = 0;
@@ -347,19 +353,19 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
347
353
 
348
354
  const scrollOverlay = selectedIndex !== React.Children.count(children) - 1 ? jsx("span", {
349
355
  key: "overlay",
350
- css: styles?.scrollOverlay
356
+ css: styles === null || styles === void 0 ? void 0 : styles.scrollOverlay
351
357
  }) : null;
352
358
  const scrollFadeEls = [// spacer element prevents final Tab from being obscured by scroll overflow gradient
353
359
  jsx("span", {
354
360
  key: "spacer",
355
- css: styles?.scrollSpacer
361
+ css: styles === null || styles === void 0 ? void 0 : styles.scrollSpacer
356
362
  }), scrollOverlay];
357
363
  return jsx(View, Object.assign({}, passthroughProps(props), {
358
364
  elementRef: this.handleRef,
359
365
  maxWidth: maxWidth,
360
366
  margin: margin,
361
367
  as: "div",
362
- css: styles?.container
368
+ css: styles === null || styles === void 0 ? void 0 : styles.container
363
369
  }), jsx(Focusable, {
364
370
  ref: this.handleFocusableRef
365
371
  }, () => jsx(View, {
@@ -367,15 +373,15 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
367
373
  position: "relative",
368
374
  borderRadius: "medium",
369
375
  shouldAnimateFocus: false,
370
- css: styles?.tabs
376
+ css: styles === null || styles === void 0 ? void 0 : styles.tabs
371
377
  }, jsx(View, {
372
378
  as: "div",
373
379
  role: "tablist",
374
- css: styles?.tabList,
380
+ css: styles === null || styles === void 0 ? void 0 : styles.tabList,
375
381
  "aria-label": screenReaderLabel,
376
382
  elementRef: this.handleTabListRef
377
383
  }, tabs, withScrollFade && scrollFadeEls))), jsx("div", {
378
- css: styles?.panelsContainer
384
+ css: styles === null || styles === void 0 ? void 0 : styles.panelsContainer
379
385
  }, panels));
380
386
  }
381
387
 
package/es/Tabs/theme.js CHANGED
@@ -32,11 +32,11 @@ const generateComponentTheme = theme => {
32
32
  colors = theme.colors,
33
33
  stacking = theme.stacking;
34
34
  const componentVariables = {
35
- defaultBackground: colors?.backgroundLightest,
36
- scrollFadeColor: colors?.backgroundLightest,
37
- tabVerticalOffset: borders?.widthSmall,
35
+ defaultBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
36
+ scrollFadeColor: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
37
+ tabVerticalOffset: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
38
38
  // gives effect of selected tab "bar" overlaying bottom border
39
- zIndex: stacking?.above,
39
+ zIndex: stacking === null || stacking === void 0 ? void 0 : stacking.above,
40
40
  scrollOverlayWidthDefault: '5rem',
41
41
  // has to be 4 times the horizontal padding of the default style tab
42
42
  scrollOverlayWidthSecondary: '3rem' // has to be 3 times the horizontal padding of the secondary style tab
@@ -52,31 +52,35 @@ let Panel = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
52
52
  }
53
53
 
54
54
  componentDidMount() {
55
- this.props.makeStyles?.();
55
+ var _this$props$makeStyle, _this$props;
56
+
57
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
56
58
  }
57
59
 
58
60
  componentDidUpdate() {
59
- this.props.makeStyles?.();
61
+ var _this$props$makeStyle2, _this$props2;
62
+
63
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
60
64
  }
61
65
 
62
66
  render() {
63
- const _this$props = this.props,
64
- labelledBy = _this$props.labelledBy,
65
- variant = _this$props.variant,
66
- id = _this$props.id,
67
- maxHeight = _this$props.maxHeight,
68
- minHeight = _this$props.minHeight,
69
- padding = _this$props.padding,
70
- textAlign = _this$props.textAlign,
71
- children = _this$props.children,
72
- elementRef = _this$props.elementRef,
73
- isDisabled = _this$props.isDisabled,
74
- isSelected = _this$props.isSelected,
75
- styles = _this$props.styles,
76
- props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
67
+ const _this$props3 = this.props,
68
+ labelledBy = _this$props3.labelledBy,
69
+ variant = _this$props3.variant,
70
+ id = _this$props3.id,
71
+ maxHeight = _this$props3.maxHeight,
72
+ minHeight = _this$props3.minHeight,
73
+ padding = _this$props3.padding,
74
+ textAlign = _this$props3.textAlign,
75
+ children = _this$props3.children,
76
+ elementRef = _this$props3.elementRef,
77
+ isDisabled = _this$props3.isDisabled,
78
+ isSelected = _this$props3.isSelected,
79
+ styles = _this$props3.styles,
80
+ props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
77
81
  const isHidden = !isSelected || !!isDisabled;
78
82
  return (0, _emotion.jsx)("div", Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
79
- css: styles?.panel,
83
+ css: styles === null || styles === void 0 ? void 0 : styles.panel,
80
84
  role: "tabpanel",
81
85
  id: id,
82
86
  "aria-labelledby": labelledBy,
@@ -88,7 +92,7 @@ let Panel = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
88
92
  unmountOnExit: true,
89
93
  transitionExit: false
90
94
  }, (0, _emotion.jsx)(_View.View, {
91
- css: styles?.content,
95
+ css: styles === null || styles === void 0 ? void 0 : styles.content,
92
96
  maxHeight: maxHeight,
93
97
  minHeight: minHeight,
94
98
  as: "div",
@@ -45,15 +45,15 @@ const generateComponentTheme = theme => {
45
45
  }
46
46
  };
47
47
  const componentVariables = {
48
- fontSize: typography?.fontSizeMedium,
49
- fontFamily: typography?.fontFamily,
50
- fontWeight: typography?.fontWeightNormal,
51
- lineHeight: typography?.lineHeight,
52
- color: colors?.textDarkest,
53
- background: colors?.backgroundLightest,
54
- borderColor: colors?.borderMedium,
55
- borderWidth: borders?.widthSmall,
56
- borderStyle: borders?.style
48
+ fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
49
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
50
+ fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
51
+ lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeight,
52
+ color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
53
+ background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
54
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
55
+ borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
56
+ borderStyle: borders === null || borders === void 0 ? void 0 : borders.style
57
57
  };
58
58
  return { ...componentVariables,
59
59
  ...themeSpecificStyle[themeName]
@@ -82,30 +82,34 @@ let Tab = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec
82
82
  }
83
83
 
84
84
  componentDidMount() {
85
- this.props.makeStyles?.();
85
+ var _this$props$makeStyle, _this$props3;
86
+
87
+ (_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
86
88
  }
87
89
 
88
90
  componentDidUpdate() {
89
- this.props.makeStyles?.();
91
+ var _this$props$makeStyle2, _this$props4;
92
+
93
+ (_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
90
94
  }
91
95
 
92
96
  render() {
93
- const _this$props3 = this.props,
94
- id = _this$props3.id,
95
- variant = _this$props3.variant,
96
- isSelected = _this$props3.isSelected,
97
- isDisabled = _this$props3.isDisabled,
98
- controls = _this$props3.controls,
99
- children = _this$props3.children,
100
- styles = _this$props3.styles,
101
- props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
97
+ const _this$props5 = this.props,
98
+ id = _this$props5.id,
99
+ variant = _this$props5.variant,
100
+ isSelected = _this$props5.isSelected,
101
+ isDisabled = _this$props5.isDisabled,
102
+ controls = _this$props5.controls,
103
+ children = _this$props5.children,
104
+ styles = _this$props5.styles,
105
+ props = (0, _objectWithoutProperties2.default)(_this$props5, _excluded);
102
106
  return (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
103
107
  as: "div",
104
108
  role: "tab",
105
109
  id: id,
106
110
  onClick: this.handleClick,
107
111
  onKeyDown: this.handleKeyDown,
108
- css: styles?.tab,
112
+ css: styles === null || styles === void 0 ? void 0 : styles.tab,
109
113
  "aria-selected": isSelected ? 'true' : void 0,
110
114
  "aria-disabled": isDisabled ? 'true' : void 0,
111
115
  "aria-controls": controls,
@@ -47,17 +47,17 @@ const generateComponentTheme = theme => {
47
47
  }
48
48
  };
49
49
  const componentVariables = {
50
- fontFamily: typography?.fontFamily,
51
- fontWeight: typography?.fontWeightNormal,
52
- lineHeight: typography?.lineHeightCondensed,
53
- fontSize: typography?.fontSizeMedium,
54
- defaultColor: colors?.textDarkest,
55
- defaultHoverBorderColor: colors?.borderMedium,
56
- defaultSelectedBorderColor: colors?.borderBrand,
57
- secondaryColor: colors?.textDarkest,
58
- secondarySelectedBackground: colors?.backgroundLightest,
59
- secondarySelectedBorderColor: colors?.borderMedium,
60
- zIndex: stacking?.above
50
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
51
+ fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
52
+ lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
53
+ fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
54
+ defaultColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
55
+ defaultHoverBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
56
+ defaultSelectedBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
57
+ secondaryColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
58
+ secondarySelectedBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
59
+ secondarySelectedBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
60
+ zIndex: stacking === null || stacking === void 0 ? void 0 : stacking.above
61
61
  };
62
62
  return { ...componentVariables,
63
63
  ...themeSpecificStyle[themeName]
package/lib/Tabs/index.js CHANGED
@@ -131,6 +131,8 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
131
131
  }
132
132
 
133
133
  componentDidMount() {
134
+ var _this$props$makeStyle, _this$props;
135
+
134
136
  if (this.props.tabOverflow === 'scroll' && this._tabList) {
135
137
  this.startScrollOverflow();
136
138
  }
@@ -139,10 +141,12 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
139
141
  this.focus();
140
142
  }
141
143
 
142
- this.props.makeStyles?.();
144
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
143
145
  }
144
146
 
145
147
  componentDidUpdate(prevProps, prevState) {
148
+ var _this$props$makeStyle2, _this$props2;
149
+
146
150
  if (this.props.shouldFocusOnRender && !prevProps.shouldFocusOnRender) {
147
151
  this.focus();
148
152
  } // start event listeners for scroll overflow
@@ -170,7 +174,7 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
170
174
  this.showActiveTabIfOverlayed(activeTabEl);
171
175
  }
172
176
 
173
- this.props.makeStyles?.();
177
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
174
178
  }
175
179
 
176
180
  componentWillUnmount() {
@@ -189,7 +193,9 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
189
193
  const newWidth = entry.contentRect.width;
190
194
 
191
195
  if (this._tabListPosition.width !== newWidth) {
192
- this._debounced?.();
196
+ var _this$_debounced;
197
+
198
+ (_this$_debounced = this._debounced) === null || _this$_debounced === void 0 ? void 0 : _this$_debounced.call(this);
193
199
  }
194
200
  }
195
201
  });
@@ -208,16 +214,16 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
208
214
  }
209
215
 
210
216
  getOverlayWidth() {
211
- const _this$props = this.props,
212
- variant = _this$props.variant,
213
- tabOverflow = _this$props.tabOverflow,
214
- styles = _this$props.styles;
217
+ const _this$props3 = this.props,
218
+ variant = _this$props3.variant,
219
+ tabOverflow = _this$props3.tabOverflow,
220
+ styles = _this$props3.styles;
215
221
 
216
222
  if (styles && tabOverflow === 'scroll') {
217
223
  if (variant === 'default') {
218
- return (0, _px.px)(styles?.scrollOverlayWidthDefault);
224
+ return (0, _px.px)(styles === null || styles === void 0 ? void 0 : styles.scrollOverlayWidthDefault);
219
225
  } else {
220
- return (0, _px.px)(styles?.scrollOverlayWidthSecondary);
226
+ return (0, _px.px)(styles === null || styles === void 0 ? void 0 : styles.scrollOverlayWidthSecondary);
221
227
  }
222
228
  }
223
229
 
@@ -331,17 +337,17 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
331
337
  render() {
332
338
  const panels = [];
333
339
  const tabs = [];
334
- const _this$props2 = this.props,
335
- children = _this$props2.children,
336
- elementRef = _this$props2.elementRef,
337
- maxWidth = _this$props2.maxWidth,
338
- variant = _this$props2.variant,
339
- margin = _this$props2.margin,
340
- screenReaderLabel = _this$props2.screenReaderLabel,
341
- onRequestTabChange = _this$props2.onRequestTabChange,
342
- tabOverflow = _this$props2.tabOverflow,
343
- styles = _this$props2.styles,
344
- props = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
340
+ const _this$props4 = this.props,
341
+ children = _this$props4.children,
342
+ elementRef = _this$props4.elementRef,
343
+ maxWidth = _this$props4.maxWidth,
344
+ variant = _this$props4.variant,
345
+ margin = _this$props4.margin,
346
+ screenReaderLabel = _this$props4.screenReaderLabel,
347
+ onRequestTabChange = _this$props4.onRequestTabChange,
348
+ tabOverflow = _this$props4.tabOverflow,
349
+ styles = _this$props4.styles,
350
+ props = (0, _objectWithoutProperties2.default)(_this$props4, _excluded);
345
351
 
346
352
  const selectedChildIndex = _react.default.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_Panel.Panel])).findIndex(child => child.props.isSelected && !child.props.isDisabled);
347
353
 
@@ -364,19 +370,19 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
364
370
 
365
371
  const scrollOverlay = selectedIndex !== _react.default.Children.count(children) - 1 ? (0, _emotion.jsx)("span", {
366
372
  key: "overlay",
367
- css: styles?.scrollOverlay
373
+ css: styles === null || styles === void 0 ? void 0 : styles.scrollOverlay
368
374
  }) : null;
369
375
  const scrollFadeEls = [// spacer element prevents final Tab from being obscured by scroll overflow gradient
370
376
  (0, _emotion.jsx)("span", {
371
377
  key: "spacer",
372
- css: styles?.scrollSpacer
378
+ css: styles === null || styles === void 0 ? void 0 : styles.scrollSpacer
373
379
  }), scrollOverlay];
374
380
  return (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
375
381
  elementRef: this.handleRef,
376
382
  maxWidth: maxWidth,
377
383
  margin: margin,
378
384
  as: "div",
379
- css: styles?.container
385
+ css: styles === null || styles === void 0 ? void 0 : styles.container
380
386
  }), (0, _emotion.jsx)(_Focusable.Focusable, {
381
387
  ref: this.handleFocusableRef
382
388
  }, () => (0, _emotion.jsx)(_View.View, {
@@ -384,15 +390,15 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
384
390
  position: "relative",
385
391
  borderRadius: "medium",
386
392
  shouldAnimateFocus: false,
387
- css: styles?.tabs
393
+ css: styles === null || styles === void 0 ? void 0 : styles.tabs
388
394
  }, (0, _emotion.jsx)(_View.View, {
389
395
  as: "div",
390
396
  role: "tablist",
391
- css: styles?.tabList,
397
+ css: styles === null || styles === void 0 ? void 0 : styles.tabList,
392
398
  "aria-label": screenReaderLabel,
393
399
  elementRef: this.handleTabListRef
394
400
  }, tabs, withScrollFade && scrollFadeEls))), (0, _emotion.jsx)("div", {
395
- css: styles?.panelsContainer
401
+ css: styles === null || styles === void 0 ? void 0 : styles.panelsContainer
396
402
  }, panels));
397
403
  }
398
404
 
package/lib/Tabs/theme.js CHANGED
@@ -39,11 +39,11 @@ const generateComponentTheme = theme => {
39
39
  colors = theme.colors,
40
40
  stacking = theme.stacking;
41
41
  const componentVariables = {
42
- defaultBackground: colors?.backgroundLightest,
43
- scrollFadeColor: colors?.backgroundLightest,
44
- tabVerticalOffset: borders?.widthSmall,
42
+ defaultBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
43
+ scrollFadeColor: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
44
+ tabVerticalOffset: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
45
45
  // gives effect of selected tab "bar" overlaying bottom border
46
- zIndex: stacking?.above,
46
+ zIndex: stacking === null || stacking === void 0 ? void 0 : stacking.above,
47
47
  scrollOverlayWidthDefault: '5rem',
48
48
  // has to be 4 times the horizontal padding of the default style tab
49
49
  scrollOverlayWidthSecondary: '3rem' // has to be 3 times the horizontal padding of the secondary style tab
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-tabs",
3
- "version": "8.18.0",
3
+ "version": "8.18.1-snapshot.12+ca14b3dc8",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,28 +23,28 @@
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.12+ca14b3dc8",
27
+ "@instructure/ui-color-utils": "8.18.1-snapshot.12+ca14b3dc8",
28
+ "@instructure/ui-test-locator": "8.18.1-snapshot.12+ca14b3dc8",
29
+ "@instructure/ui-test-utils": "8.18.1-snapshot.12+ca14b3dc8",
30
+ "@instructure/ui-themes": "8.18.1-snapshot.12+ca14b3dc8"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/console": "8.18.0",
35
- "@instructure/debounce": "8.18.0",
36
- "@instructure/emotion": "8.18.0",
37
- "@instructure/shared-types": "8.18.0",
38
- "@instructure/ui-dom-utils": "8.18.0",
39
- "@instructure/ui-focusable": "8.18.0",
40
- "@instructure/ui-i18n": "8.18.0",
41
- "@instructure/ui-motion": "8.18.0",
42
- "@instructure/ui-prop-types": "8.18.0",
43
- "@instructure/ui-react-utils": "8.18.0",
44
- "@instructure/ui-testable": "8.18.0",
45
- "@instructure/ui-utils": "8.18.0",
46
- "@instructure/ui-view": "8.18.0",
47
- "@instructure/uid": "8.18.0",
34
+ "@instructure/console": "8.18.1-snapshot.12+ca14b3dc8",
35
+ "@instructure/debounce": "8.18.1-snapshot.12+ca14b3dc8",
36
+ "@instructure/emotion": "8.18.1-snapshot.12+ca14b3dc8",
37
+ "@instructure/shared-types": "8.18.1-snapshot.12+ca14b3dc8",
38
+ "@instructure/ui-dom-utils": "8.18.1-snapshot.12+ca14b3dc8",
39
+ "@instructure/ui-focusable": "8.18.1-snapshot.12+ca14b3dc8",
40
+ "@instructure/ui-i18n": "8.18.1-snapshot.12+ca14b3dc8",
41
+ "@instructure/ui-motion": "8.18.1-snapshot.12+ca14b3dc8",
42
+ "@instructure/ui-prop-types": "8.18.1-snapshot.12+ca14b3dc8",
43
+ "@instructure/ui-react-utils": "8.18.1-snapshot.12+ca14b3dc8",
44
+ "@instructure/ui-testable": "8.18.1-snapshot.12+ca14b3dc8",
45
+ "@instructure/ui-utils": "8.18.1-snapshot.12+ca14b3dc8",
46
+ "@instructure/ui-view": "8.18.1-snapshot.12+ca14b3dc8",
47
+ "@instructure/uid": "8.18.1-snapshot.12+ca14b3dc8",
48
48
  "keycode": "^2",
49
49
  "prop-types": "^15"
50
50
  },
@@ -54,5 +54,6 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "sideEffects": false
57
+ "sideEffects": false,
58
+ "gitHead": "ca14b3dc8f0315daef7b86aa05f711e6d6684c58"
58
59
  }