@instructure/ui-tabs 9.0.2-snapshot-3 → 9.0.2-snapshot-5

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,9 +3,12 @@
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
- ## [9.0.2-snapshot-3](https://github.com/instructure/instructure-ui/compare/v9.0.1...v9.0.2-snapshot-3) (2024-05-28)
6
+ ## [9.0.2-snapshot-5](https://github.com/instructure/instructure-ui/compare/v9.0.1...v9.0.2-snapshot-5) (2024-06-06)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-tabs
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui-tabs:** fix id generation when null is present as children ([85765ae](https://github.com/instructure/instructure-ui/commit/85765ae3183ac121714cd814a322dcc012ed2f72))
9
12
 
10
13
 
11
14
 
package/es/Tabs/index.js CHANGED
@@ -326,7 +326,7 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
326
326
  }
327
327
  const selectedChildIndex = React.Children.toArray(children).filter(child => matchComponentTypes(child, [Panel])).findIndex(child => child.props.isSelected && !child.props.isDisabled);
328
328
  const selectedIndex = selectedChildIndex >= 0 ? selectedChildIndex : 0;
329
- React.Children.forEach(children, (child, index) => {
329
+ React.Children.toArray(children).map((child, index) => {
330
330
  if (matchComponentTypes(child, [Panel])) {
331
331
  const selected = !child.props.isDisabled && (child.props.isSelected || selectedIndex === index);
332
332
  const id = uid();
package/lib/Tabs/index.js CHANGED
@@ -341,7 +341,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
341
341
  }
342
342
  const selectedChildIndex = _react.default.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_Panel.Panel])).findIndex(child => child.props.isSelected && !child.props.isDisabled);
343
343
  const selectedIndex = selectedChildIndex >= 0 ? selectedChildIndex : 0;
344
- _react.default.Children.forEach(children, (child, index) => {
344
+ _react.default.Children.toArray(children).map((child, index) => {
345
345
  if ((0, _matchComponentTypes.matchComponentTypes)(child, [_Panel.Panel])) {
346
346
  const selected = !child.props.isDisabled && (child.props.isSelected || selectedIndex === index);
347
347
  const id = (0, _uid.uid)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-tabs",
3
- "version": "9.0.2-snapshot-3",
3
+ "version": "9.0.2-snapshot-5",
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,30 +23,30 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "9.0.2-snapshot-3",
27
- "@instructure/ui-color-utils": "9.0.2-snapshot-3",
28
- "@instructure/ui-test-locator": "9.0.2-snapshot-3",
29
- "@instructure/ui-test-utils": "9.0.2-snapshot-3",
30
- "@instructure/ui-themes": "9.0.2-snapshot-3",
26
+ "@instructure/ui-babel-preset": "9.0.2-snapshot-5",
27
+ "@instructure/ui-color-utils": "9.0.2-snapshot-5",
28
+ "@instructure/ui-test-locator": "9.0.2-snapshot-5",
29
+ "@instructure/ui-test-utils": "9.0.2-snapshot-5",
30
+ "@instructure/ui-themes": "9.0.2-snapshot-5",
31
31
  "@testing-library/jest-dom": "^6.4.5",
32
32
  "@testing-library/react": "^15.0.7"
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.24.5",
36
- "@instructure/console": "9.0.2-snapshot-3",
37
- "@instructure/debounce": "9.0.2-snapshot-3",
38
- "@instructure/emotion": "9.0.2-snapshot-3",
39
- "@instructure/shared-types": "9.0.2-snapshot-3",
40
- "@instructure/ui-dom-utils": "9.0.2-snapshot-3",
41
- "@instructure/ui-focusable": "9.0.2-snapshot-3",
42
- "@instructure/ui-i18n": "9.0.2-snapshot-3",
43
- "@instructure/ui-motion": "9.0.2-snapshot-3",
44
- "@instructure/ui-prop-types": "9.0.2-snapshot-3",
45
- "@instructure/ui-react-utils": "9.0.2-snapshot-3",
46
- "@instructure/ui-testable": "9.0.2-snapshot-3",
47
- "@instructure/ui-utils": "9.0.2-snapshot-3",
48
- "@instructure/ui-view": "9.0.2-snapshot-3",
49
- "@instructure/uid": "9.0.2-snapshot-3",
36
+ "@instructure/console": "9.0.2-snapshot-5",
37
+ "@instructure/debounce": "9.0.2-snapshot-5",
38
+ "@instructure/emotion": "9.0.2-snapshot-5",
39
+ "@instructure/shared-types": "9.0.2-snapshot-5",
40
+ "@instructure/ui-dom-utils": "9.0.2-snapshot-5",
41
+ "@instructure/ui-focusable": "9.0.2-snapshot-5",
42
+ "@instructure/ui-i18n": "9.0.2-snapshot-5",
43
+ "@instructure/ui-motion": "9.0.2-snapshot-5",
44
+ "@instructure/ui-prop-types": "9.0.2-snapshot-5",
45
+ "@instructure/ui-react-utils": "9.0.2-snapshot-5",
46
+ "@instructure/ui-testable": "9.0.2-snapshot-5",
47
+ "@instructure/ui-utils": "9.0.2-snapshot-5",
48
+ "@instructure/ui-view": "9.0.2-snapshot-5",
49
+ "@instructure/uid": "9.0.2-snapshot-5",
50
50
  "keycode": "^2.2.1",
51
51
  "prop-types": "^15.8.1"
52
52
  },
@@ -465,8 +465,7 @@ class Tabs extends Component<TabsProps, TabsState> {
465
465
  .findIndex((child) => child.props.isSelected && !child.props.isDisabled)
466
466
 
467
467
  const selectedIndex = selectedChildIndex >= 0 ? selectedChildIndex : 0
468
-
469
- React.Children.forEach(children as PanelChild[], (child, index) => {
468
+ React.Children.toArray(children).map((child, index) => {
470
469
  if (matchComponentTypes<PanelChild>(child, [Panel])) {
471
470
  const selected =
472
471
  !child.props.isDisabled &&
@@ -482,7 +481,7 @@ class Tabs extends Component<TabsProps, TabsState> {
482
481
  panels.push(this.clonePanel(index, id, selected, child))
483
482
  }
484
483
  } else {
485
- panels.push(child)
484
+ panels.push(child as PanelChild)
486
485
  }
487
486
  })
488
487