@instructure/ui-tabs 10.13.0 → 10.13.1-pr-snapshot-1741357986437

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.13.1-pr-snapshot-1741357986437](https://github.com/instructure/instructure-ui/compare/v10.13.0...v10.13.1-pr-snapshot-1741357986437) (2025-03-07)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-tabs
9
+
10
+
11
+
12
+
13
+
6
14
  # [10.13.0](https://github.com/instructure/instructure-ui/compare/v10.12.0...v10.13.0) (2025-03-06)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-tabs
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = exports.Panel = void 0;
8
8
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
9
  var _react = require("react");
10
- var _View = require("@instructure/ui-view/lib/View");
11
- var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
12
- var _Transition = require("@instructure/ui-motion/lib/Transition");
10
+ var _uiView = require("@instructure/ui-view");
11
+ var _uiReactUtils = require("@instructure/ui-react-utils");
12
+ var _uiMotion = require("@instructure/ui-motion");
13
13
  var _emotion = require("@instructure/emotion");
14
14
  var _styles = _interopRequireDefault(require("./styles"));
15
15
  var _theme = _interopRequireDefault(require("./theme"));
@@ -93,7 +93,7 @@ let Panel = exports.Panel = (_dec = (0, _emotion.withStyle)(_styles.default, _th
93
93
  active = _this$props4.active,
94
94
  unmountOnExit = _this$props4.unmountOnExit,
95
95
  props = (0, _objectWithoutProperties2.default)(_this$props4, _excluded);
96
- return (0, _emotion.jsx)("div", Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
96
+ return (0, _emotion.jsx)("div", Object.assign({}, (0, _uiReactUtils.passthroughProps)(props), {
97
97
  css: styles === null || styles === void 0 ? void 0 : styles.panel,
98
98
  role: "tabpanel",
99
99
  tabIndex: 0,
@@ -101,12 +101,12 @@ let Panel = exports.Panel = (_dec = (0, _emotion.withStyle)(_styles.default, _th
101
101
  "aria-labelledby": labelledBy,
102
102
  "aria-hidden": this.isHidden ? 'true' : void 0,
103
103
  ref: this.handleRef
104
- }), (0, _emotion.jsx)(_Transition.Transition, {
104
+ }), (0, _emotion.jsx)(_uiMotion.Transition, {
105
105
  type: "fade",
106
106
  in: !this.isHidden,
107
107
  unmountOnExit: unmountOnExit,
108
108
  transitionExit: false
109
- }, (0, _emotion.jsx)(_View.View, {
109
+ }, (0, _emotion.jsx)(_uiView.View, {
110
110
  css: styles === null || styles === void 0 ? void 0 : styles.content,
111
111
  maxHeight: maxHeight,
112
112
  minHeight: minHeight,
@@ -8,9 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = exports.Tab = void 0;
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
- var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
12
- var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
13
- var _View = require("@instructure/ui-view/lib/View");
11
+ var _uiReactUtils = require("@instructure/ui-react-utils");
12
+ var _uiView = require("@instructure/ui-view");
14
13
  var _emotion = require("@instructure/emotion");
15
14
  var _styles = _interopRequireDefault(require("./styles"));
16
15
  var _theme = _interopRequireDefault(require("./theme"));
@@ -100,7 +99,7 @@ let Tab = exports.Tab = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
100
99
  children = _this$props5.children,
101
100
  styles = _this$props5.styles,
102
101
  props = (0, _objectWithoutProperties2.default)(_this$props5, _excluded);
103
- return (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
102
+ return (0, _emotion.jsx)(_uiView.View, Object.assign({}, (0, _uiReactUtils.passthroughProps)(props), {
104
103
  as: "div",
105
104
  role: "tab",
106
105
  id: id,
@@ -113,7 +112,7 @@ let Tab = exports.Tab = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
113
112
  tabIndex: isSelected && !isDisabled ? 0 : void 0,
114
113
  position: "relative",
115
114
  focusPosition: "inset"
116
- }), (0, _callRenderProp.callRenderProp)(children));
115
+ }), (0, _uiReactUtils.callRenderProp)(children));
117
116
  }
118
117
  }, _Tab.displayName = "Tab", _Tab.componentId = 'Tabs.Tab', _Tab.allowedProps = _props.allowedProps, _Tab.propTypes = _props.propTypes, _Tab.defaultProps = {
119
118
  variant: 'default',
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.TabsLocator = void 0;
7
- var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
7
+ var _uiTestLocator = require("@instructure/ui-test-locator");
8
8
  var _index = require("./index");
9
9
  /*
10
10
  * The MIT License (MIT)
@@ -30,12 +30,12 @@ var _index = require("./index");
30
30
  * SOFTWARE.
31
31
  */
32
32
 
33
- const TabLocator = (0, _locator.locator)('[role="tab"]');
34
- const PanelLocator = (0, _locator.locator)('[role="tabpanel"]');
35
- const SelectedTabLocator = (0, _locator.locator)('[role="tab"][aria-selected="true"]');
33
+ const TabLocator = (0, _uiTestLocator.locator)('[role="tab"]');
34
+ const PanelLocator = (0, _uiTestLocator.locator)('[role="tabpanel"]');
35
+ const SelectedTabLocator = (0, _uiTestLocator.locator)('[role="tab"][aria-selected="true"]');
36
36
 
37
37
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
38
- const TabsLocator = exports.TabsLocator = (0, _locator.locator)(_index.Tabs.selector, {
38
+ const TabsLocator = exports.TabsLocator = (0, _uiTestLocator.locator)(_index.Tabs.selector, {
39
39
  findTab: (...args) => {
40
40
  return TabLocator.find(...args);
41
41
  },
package/lib/Tabs/index.js CHANGED
@@ -15,17 +15,15 @@ exports.default = exports.Tabs = void 0;
15
15
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
16
16
  var _react = _interopRequireWildcard(require("react"));
17
17
  var _keycode = _interopRequireDefault(require("keycode"));
18
- var _View = require("@instructure/ui-view/lib/View");
19
- var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
20
- var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
21
- var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
18
+ var _uiView = require("@instructure/ui-view");
19
+ var _uiReactUtils = require("@instructure/ui-react-utils");
22
20
  var _console = require("@instructure/console");
23
21
  var _uid = require("@instructure/uid");
24
- var _testable = require("@instructure/ui-testable/lib/testable.js");
25
- var _Focusable = require("@instructure/ui-focusable/lib/Focusable");
26
- var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingClientRect.js");
22
+ var _uiTestable = require("@instructure/ui-testable");
23
+ var _uiFocusable = require("@instructure/ui-focusable");
24
+ var _uiDomUtils = require("@instructure/ui-dom-utils");
27
25
  var _debounce = require("@instructure/debounce");
28
- var _px = require("@instructure/ui-utils/lib/px.js");
26
+ var _uiUtils = require("@instructure/ui-utils");
29
27
  var _emotion = require("@instructure/emotion");
30
28
  var _styles = _interopRequireDefault(require("./styles"));
31
29
  var _theme = _interopRequireDefault(require("./theme"));
@@ -63,7 +61,7 @@ var _dec, _dec2, _class, _Tabs;
63
61
  category: components
64
62
  ---
65
63
  **/
66
- let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_Tabs = class Tabs extends _react.Component {
64
+ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = (_Tabs = class Tabs extends _react.Component {
67
65
  constructor(props) {
68
66
  super(props);
69
67
  this._tabList = null;
@@ -105,7 +103,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
105
103
  this.setState({
106
104
  withTabListOverflow: this._tabList.scrollWidth > this._tabList.offsetWidth
107
105
  });
108
- this._tabListPosition = (0, _getBoundingClientRect.getBoundingClientRect)(this._tabList);
106
+ this._tabListPosition = (0, _uiDomUtils.getBoundingClientRect)(this._tabList);
109
107
  };
110
108
  this.handleFocusableRef = el => {
111
109
  this._focusable = el;
@@ -119,7 +117,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
119
117
  return;
120
118
  }
121
119
  const tabList = event.currentTarget;
122
- const scrollLeftMax = Math.round(tabList.scrollWidth - (0, _getBoundingClientRect.getBoundingClientRect)(tabList).width);
120
+ const scrollLeftMax = Math.round(tabList.scrollWidth - (0, _uiDomUtils.getBoundingClientRect)(tabList).width);
123
121
  const scrollLeft = Math.floor(Math.abs(tabList.scrollLeft));
124
122
  this.setState({
125
123
  showStartOverLay: scrollLeft > 0,
@@ -180,7 +178,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
180
178
  leading: true,
181
179
  trailing: true
182
180
  });
183
- this._tabListPosition = (0, _getBoundingClientRect.getBoundingClientRect)(this._tabList);
181
+ this._tabListPosition = (0, _uiDomUtils.getBoundingClientRect)(this._tabList);
184
182
  this._resizeListener = new ResizeObserver(entries => {
185
183
  for (const entry of entries) {
186
184
  const newWidth = entry.contentRect.width;
@@ -207,9 +205,9 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
207
205
  styles = _this$props3.styles;
208
206
  if (styles && tabOverflow === 'scroll') {
209
207
  if (variant === 'default') {
210
- return (0, _px.px)(styles === null || styles === void 0 ? void 0 : styles.scrollOverlayWidthDefault);
208
+ return (0, _uiUtils.px)(styles === null || styles === void 0 ? void 0 : styles.scrollOverlayWidthDefault);
211
209
  } else {
212
- return (0, _px.px)(styles === null || styles === void 0 ? void 0 : styles.scrollOverlayWidthSecondary);
210
+ return (0, _uiUtils.px)(styles === null || styles === void 0 ? void 0 : styles.scrollOverlayWidthSecondary);
213
211
  }
214
212
  }
215
213
  return 0;
@@ -217,7 +215,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
217
215
  showActiveTabIfOverlayed(activeTabEl) {
218
216
  if (this._tabList && this._tabListPosition && typeof this._tabList.scrollTo === 'function' // test for scrollTo support
219
217
  ) {
220
- const tabPosition = (0, _getBoundingClientRect.getBoundingClientRect)(activeTabEl);
218
+ const tabPosition = (0, _uiDomUtils.getBoundingClientRect)(activeTabEl);
221
219
  const tabListPosition = this._tabListPosition;
222
220
  const tabListBoundStart = tabListPosition.left + this.getOverlayWidth();
223
221
  const tabListBoundEnd = tabListPosition.right + this.getOverlayWidth();
@@ -241,7 +239,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
241
239
  }
242
240
  }
243
241
  getNextTab(startIndex, step) {
244
- const tabs = _react.default.Children.toArray(this.props.children).map(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_Panel.Panel]) && child);
242
+ const tabs = _react.default.Children.toArray(this.props.children).map(child => (0, _uiReactUtils.matchComponentTypes)(child, [_Panel.Panel]) && child);
245
243
  const count = tabs.length;
246
244
  const change = step < 0 ? step + count : step;
247
245
  (0, _console.logError)(startIndex >= 0 && startIndex < count, `[Tabs] Invalid tab index: '${startIndex}'.`);
@@ -308,13 +306,13 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
308
306
  activePanelClone = /*#__PURE__*/_react.default.cloneElement(activePanel, {
309
307
  key: `panel-${index}`
310
308
  });
311
- return (0, _safeCloneElement.safeCloneElement)(activePanelClone, {
309
+ return (0, _uiReactUtils.safeCloneElement)(activePanelClone, {
312
310
  padding: activePanelClone.props.padding || this.props.padding,
313
311
  textAlign: activePanelClone.props.textAlign || this.props.textAlign,
314
312
  ...commonProps
315
313
  });
316
314
  } else {
317
- return (0, _safeCloneElement.safeCloneElement)(panel, {
315
+ return (0, _uiReactUtils.safeCloneElement)(panel, {
318
316
  key: `panel-${index}`,
319
317
  padding: panel.props.padding || this.props.padding,
320
318
  textAlign: panel.props.textAlign || this.props.textAlign,
@@ -339,14 +337,14 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
339
337
  tabOverflow = _this$props4.tabOverflow,
340
338
  styles = _this$props4.styles,
341
339
  props = (0, _objectWithoutProperties2.default)(_this$props4, _excluded);
342
- const activePanels = _react.default.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_Panel.Panel])).filter(child => child.props.active);
340
+ const activePanels = _react.default.Children.toArray(children).filter(child => (0, _uiReactUtils.matchComponentTypes)(child, [_Panel.Panel])).filter(child => child.props.active);
343
341
  if (activePanels.length > 1) {
344
342
  (0, _console.logError)(false, `[Tabs] Only one Panel can be marked as active.`);
345
343
  }
346
- const selectedChildIndex = _react.default.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_Panel.Panel])).findIndex(child => child.props.isSelected && !child.props.isDisabled);
344
+ const selectedChildIndex = _react.default.Children.toArray(children).filter(child => (0, _uiReactUtils.matchComponentTypes)(child, [_Panel.Panel])).findIndex(child => child.props.isSelected && !child.props.isDisabled);
347
345
  const selectedIndex = selectedChildIndex >= 0 ? selectedChildIndex : 0;
348
346
  _react.default.Children.toArray(children).map((child, index) => {
349
- if ((0, _matchComponentTypes.matchComponentTypes)(child, [_Panel.Panel])) {
347
+ if ((0, _uiReactUtils.matchComponentTypes)(child, [_Panel.Panel])) {
350
348
  const selected = !child.props.isDisabled && (child.props.isSelected || selectedIndex === index);
351
349
  const id = (0, _uid.uid)();
352
350
  tabs.push(this.createTab(index, id, selected, child));
@@ -370,21 +368,21 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
370
368
  key: "end-overlay",
371
369
  css: styles === null || styles === void 0 ? void 0 : styles.endScrollOverlay
372
370
  }) : null;
373
- return (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
371
+ return (0, _emotion.jsx)(_uiView.View, Object.assign({}, (0, _uiReactUtils.passthroughProps)(props), {
374
372
  elementRef: this.handleRef,
375
373
  maxWidth: maxWidth,
376
374
  margin: margin,
377
375
  as: "div",
378
376
  css: styles === null || styles === void 0 ? void 0 : styles.container
379
- }), (0, _emotion.jsx)(_Focusable.Focusable, {
377
+ }), (0, _emotion.jsx)(_uiFocusable.Focusable, {
380
378
  ref: this.handleFocusableRef
381
- }, () => (0, _emotion.jsx)(_View.View, {
379
+ }, () => (0, _emotion.jsx)(_uiView.View, {
382
380
  as: "div",
383
381
  position: "relative",
384
382
  borderRadius: "medium",
385
383
  shouldAnimateFocus: false,
386
384
  css: styles === null || styles === void 0 ? void 0 : styles.tabs
387
- }, (0, _emotion.jsx)(_View.View, {
385
+ }, (0, _emotion.jsx)(_uiView.View, {
388
386
  as: "div",
389
387
  role: "tablist",
390
388
  css: styles === null || styles === void 0 ? void 0 : styles.tabList,
package/lib/Tabs/props.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.propTypes = exports.allowedProps = void 0;
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _Children = require("@instructure/ui-prop-types/lib/Children.js");
9
+ var _uiPropTypes = require("@instructure/ui-prop-types");
10
10
  var _emotion = require("@instructure/emotion");
11
11
  var _Panel = require("./Panel");
12
12
  /*
@@ -34,7 +34,7 @@ var _Panel = require("./Panel");
34
34
  */
35
35
 
36
36
  const propTypes = exports.propTypes = {
37
- children: _Children.Children.oneOf([_Panel.Panel, null]),
37
+ children: _uiPropTypes.Children.oneOf([_Panel.Panel, null]),
38
38
  variant: _propTypes.default.oneOf(['default', 'secondary']),
39
39
  screenReaderLabel: _propTypes.default.string,
40
40
  onRequestTabChange: _propTypes.default.func,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-tabs",
3
- "version": "10.13.0",
3
+ "version": "10.13.1-pr-snapshot-1741357986437",
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,31 +23,31 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "10.13.0",
27
- "@instructure/ui-color-utils": "10.13.0",
28
- "@instructure/ui-test-locator": "10.13.0",
29
- "@instructure/ui-test-utils": "10.13.0",
30
- "@instructure/ui-themes": "10.13.0",
26
+ "@instructure/ui-babel-preset": "10.13.1-pr-snapshot-1741357986437",
27
+ "@instructure/ui-color-utils": "10.13.1-pr-snapshot-1741357986437",
28
+ "@instructure/ui-test-locator": "10.13.1-pr-snapshot-1741357986437",
29
+ "@instructure/ui-test-utils": "10.13.1-pr-snapshot-1741357986437",
30
+ "@instructure/ui-themes": "10.13.1-pr-snapshot-1741357986437",
31
31
  "@testing-library/jest-dom": "^6.6.3",
32
32
  "@testing-library/react": "^16.0.1",
33
33
  "vitest": "^2.1.8"
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.26.0",
37
- "@instructure/console": "10.13.0",
38
- "@instructure/debounce": "10.13.0",
39
- "@instructure/emotion": "10.13.0",
40
- "@instructure/shared-types": "10.13.0",
41
- "@instructure/ui-dom-utils": "10.13.0",
42
- "@instructure/ui-focusable": "10.13.0",
43
- "@instructure/ui-i18n": "10.13.0",
44
- "@instructure/ui-motion": "10.13.0",
45
- "@instructure/ui-prop-types": "10.13.0",
46
- "@instructure/ui-react-utils": "10.13.0",
47
- "@instructure/ui-testable": "10.13.0",
48
- "@instructure/ui-utils": "10.13.0",
49
- "@instructure/ui-view": "10.13.0",
50
- "@instructure/uid": "10.13.0",
37
+ "@instructure/console": "10.13.1-pr-snapshot-1741357986437",
38
+ "@instructure/debounce": "10.13.1-pr-snapshot-1741357986437",
39
+ "@instructure/emotion": "10.13.1-pr-snapshot-1741357986437",
40
+ "@instructure/shared-types": "10.13.1-pr-snapshot-1741357986437",
41
+ "@instructure/ui-dom-utils": "10.13.1-pr-snapshot-1741357986437",
42
+ "@instructure/ui-focusable": "10.13.1-pr-snapshot-1741357986437",
43
+ "@instructure/ui-i18n": "10.13.1-pr-snapshot-1741357986437",
44
+ "@instructure/ui-motion": "10.13.1-pr-snapshot-1741357986437",
45
+ "@instructure/ui-prop-types": "10.13.1-pr-snapshot-1741357986437",
46
+ "@instructure/ui-react-utils": "10.13.1-pr-snapshot-1741357986437",
47
+ "@instructure/ui-testable": "10.13.1-pr-snapshot-1741357986437",
48
+ "@instructure/ui-utils": "10.13.1-pr-snapshot-1741357986437",
49
+ "@instructure/ui-view": "10.13.1-pr-snapshot-1741357986437",
50
+ "@instructure/uid": "10.13.1-pr-snapshot-1741357986437",
51
51
  "keycode": "^2",
52
52
  "prop-types": "^15.8.1"
53
53
  },