@instructure/ui-tabs 11.7.4-snapshot-14 → 11.7.4-snapshot-49
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 +1 -1
- package/LICENSE.md +1 -0
- package/es/Tabs/v1/Panel/index.js +5 -4
- package/es/Tabs/v1/Tab/index.js +5 -4
- package/es/Tabs/v1/index.js +6 -6
- package/es/Tabs/v2/Panel/index.js +4 -3
- package/es/Tabs/v2/Tab/index.js +4 -3
- package/es/Tabs/v2/index.js +5 -5
- package/es/exports/a.js +4 -3
- package/es/exports/b.js +4 -3
- package/lib/Tabs/v1/Panel/index.js +4 -4
- package/lib/Tabs/v1/Tab/index.js +4 -4
- package/lib/Tabs/v1/index.js +14 -14
- package/lib/Tabs/v2/Panel/index.js +3 -3
- package/lib/Tabs/v2/Tab/index.js +3 -3
- package/lib/Tabs/v2/index.js +13 -13
- package/lib/exports/a.js +6 -6
- package/lib/exports/b.js +6 -6
- package/package.json +17 -17
- package/src/Tabs/v1/Panel/index.tsx +4 -3
- package/src/Tabs/v1/Tab/index.tsx +4 -3
- package/src/Tabs/v1/index.tsx +6 -5
- package/src/Tabs/v2/Panel/index.tsx +3 -2
- package/src/Tabs/v2/Tab/index.tsx +3 -2
- package/src/Tabs/v2/index.tsx +5 -4
- package/src/exports/a.ts +3 -3
- package/src/exports/b.ts +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Tabs/v1/Panel/index.d.ts +1 -0
- package/types/Tabs/v1/Panel/index.d.ts.map +1 -1
- package/types/Tabs/v1/Tab/index.d.ts +1 -0
- package/types/Tabs/v1/Tab/index.d.ts.map +1 -1
- package/types/Tabs/v1/index.d.ts +3 -2
- package/types/Tabs/v1/index.d.ts.map +1 -1
- package/types/Tabs/v2/Panel/index.d.ts +1 -0
- package/types/Tabs/v2/Panel/index.d.ts.map +1 -1
- package/types/Tabs/v2/Tab/index.d.ts +1 -0
- package/types/Tabs/v2/Tab/index.d.ts.map +1 -1
- package/types/Tabs/v2/index.d.ts +3 -2
- package/types/Tabs/v2/index.d.ts.map +1 -1
- package/types/exports/a.d.ts +3 -3
- package/types/exports/a.d.ts.map +1 -1
- package/types/exports/b.d.ts +3 -3
- package/types/exports/b.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
-
## [11.7.4-snapshot-
|
|
6
|
+
## [11.7.4-snapshot-49](https://github.com/instructure/instructure-ui/compare/v11.7.3...v11.7.4-snapshot-49) (2026-06-17)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-tabs
|
|
9
9
|
|
package/LICENSE.md
CHANGED
|
@@ -28,9 +28,10 @@ import { View } from '@instructure/ui-view/v11_6';
|
|
|
28
28
|
import { passthroughProps } from '@instructure/ui-react-utils';
|
|
29
29
|
import { Transition } from '@instructure/ui-motion';
|
|
30
30
|
import { withStyle } from '@instructure/emotion';
|
|
31
|
-
import generateStyle from
|
|
32
|
-
import generateComponentTheme from
|
|
33
|
-
import { allowedProps } from
|
|
31
|
+
import generateStyle from './styles.js';
|
|
32
|
+
import generateComponentTheme from './theme.js';
|
|
33
|
+
import { allowedProps } from './props.js';
|
|
34
|
+
|
|
34
35
|
/**
|
|
35
36
|
---
|
|
36
37
|
parent: Tabs
|
|
@@ -39,7 +40,7 @@ id: Tabs.Panel
|
|
|
39
40
|
**/
|
|
40
41
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
41
42
|
let Panel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Panel extends Component {
|
|
42
|
-
static displayName =
|
|
43
|
+
static displayName = 'Panel';
|
|
43
44
|
static componentId = 'Tabs.Panel';
|
|
44
45
|
static allowedProps = allowedProps;
|
|
45
46
|
static defaultProps = {
|
package/es/Tabs/v1/Tab/index.js
CHANGED
|
@@ -27,9 +27,10 @@ import { Component } from 'react';
|
|
|
27
27
|
import { passthroughProps, callRenderProp } from '@instructure/ui-react-utils';
|
|
28
28
|
import { View } from '@instructure/ui-view/v11_6';
|
|
29
29
|
import { withStyle } from '@instructure/emotion';
|
|
30
|
-
import generateStyle from
|
|
31
|
-
import generateComponentTheme from
|
|
32
|
-
import { allowedProps } from
|
|
30
|
+
import generateStyle from './styles.js';
|
|
31
|
+
import generateComponentTheme from './theme.js';
|
|
32
|
+
import { allowedProps } from './props.js';
|
|
33
|
+
|
|
33
34
|
/**
|
|
34
35
|
---
|
|
35
36
|
parent: Tabs
|
|
@@ -38,7 +39,7 @@ id: Tabs.Tab
|
|
|
38
39
|
**/
|
|
39
40
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
40
41
|
let Tab = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Tab extends Component {
|
|
41
|
-
static displayName =
|
|
42
|
+
static displayName = 'Tab';
|
|
42
43
|
static componentId = 'Tabs.Tab';
|
|
43
44
|
static allowedProps = allowedProps;
|
|
44
45
|
static defaultProps = {
|
package/es/Tabs/v1/index.js
CHANGED
|
@@ -34,11 +34,11 @@ import { getBoundingClientRect } from '@instructure/ui-dom-utils';
|
|
|
34
34
|
import { debounce } from '@instructure/debounce';
|
|
35
35
|
import { px } from '@instructure/ui-utils';
|
|
36
36
|
import { withStyle } from '@instructure/emotion';
|
|
37
|
-
import generateStyle from
|
|
38
|
-
import generateComponentTheme from
|
|
39
|
-
import { Tab } from
|
|
40
|
-
import { Panel } from
|
|
41
|
-
import { allowedProps } from
|
|
37
|
+
import generateStyle from './styles.js';
|
|
38
|
+
import generateComponentTheme from './theme.js';
|
|
39
|
+
import { Tab } from './Tab/index.js';
|
|
40
|
+
import { Panel } from './Panel/index.js';
|
|
41
|
+
import { allowedProps } from './props.js';
|
|
42
42
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
43
43
|
/**
|
|
44
44
|
---
|
|
@@ -46,7 +46,7 @@ category: components
|
|
|
46
46
|
---
|
|
47
47
|
**/
|
|
48
48
|
let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Tabs extends Component {
|
|
49
|
-
static displayName =
|
|
49
|
+
static displayName = 'Tabs';
|
|
50
50
|
static componentId = 'Tabs';
|
|
51
51
|
static allowedProps = allowedProps;
|
|
52
52
|
static defaultProps = {
|
|
@@ -28,8 +28,9 @@ import { View } from '@instructure/ui-view/latest';
|
|
|
28
28
|
import { passthroughProps } from '@instructure/ui-react-utils';
|
|
29
29
|
import { Transition } from '@instructure/ui-motion';
|
|
30
30
|
import { withStyleNew } from '@instructure/emotion';
|
|
31
|
-
import generateStyle from
|
|
32
|
-
import { allowedProps } from
|
|
31
|
+
import generateStyle from './styles.js';
|
|
32
|
+
import { allowedProps } from './props.js';
|
|
33
|
+
|
|
33
34
|
/**
|
|
34
35
|
---
|
|
35
36
|
parent: Tabs
|
|
@@ -38,7 +39,7 @@ id: Tabs.Panel
|
|
|
38
39
|
**/
|
|
39
40
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
40
41
|
let Panel = (_dec = withStyleNew(generateStyle), _dec(_class = class Panel extends Component {
|
|
41
|
-
static displayName =
|
|
42
|
+
static displayName = 'Panel';
|
|
42
43
|
static componentId = 'Tabs.Panel';
|
|
43
44
|
static allowedProps = allowedProps;
|
|
44
45
|
static defaultProps = {
|
package/es/Tabs/v2/Tab/index.js
CHANGED
|
@@ -27,8 +27,9 @@ import { Component } from 'react';
|
|
|
27
27
|
import { passthroughProps, callRenderProp } from '@instructure/ui-react-utils';
|
|
28
28
|
import { View } from '@instructure/ui-view/latest';
|
|
29
29
|
import { withStyleNew } from '@instructure/emotion';
|
|
30
|
-
import generateStyle from
|
|
31
|
-
import { allowedProps } from
|
|
30
|
+
import generateStyle from './styles.js';
|
|
31
|
+
import { allowedProps } from './props.js';
|
|
32
|
+
|
|
32
33
|
/**
|
|
33
34
|
---
|
|
34
35
|
parent: Tabs
|
|
@@ -37,7 +38,7 @@ id: Tabs.Tab
|
|
|
37
38
|
**/
|
|
38
39
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
39
40
|
let Tab = (_dec = withStyleNew(generateStyle), _dec(_class = class Tab extends Component {
|
|
40
|
-
static displayName =
|
|
41
|
+
static displayName = 'Tab';
|
|
41
42
|
static componentId = 'Tabs.Tab';
|
|
42
43
|
static allowedProps = allowedProps;
|
|
43
44
|
static defaultProps = {
|
package/es/Tabs/v2/index.js
CHANGED
|
@@ -34,10 +34,10 @@ import { getBoundingClientRect } from '@instructure/ui-dom-utils';
|
|
|
34
34
|
import { debounce } from '@instructure/debounce';
|
|
35
35
|
import { px } from '@instructure/ui-utils';
|
|
36
36
|
import { withStyleNew } from '@instructure/emotion';
|
|
37
|
-
import generateStyle from
|
|
38
|
-
import { Tab } from
|
|
39
|
-
import { Panel } from
|
|
40
|
-
import { allowedProps } from
|
|
37
|
+
import generateStyle from './styles.js';
|
|
38
|
+
import { Tab } from './Tab/index.js';
|
|
39
|
+
import { Panel } from './Panel/index.js';
|
|
40
|
+
import { allowedProps } from './props.js';
|
|
41
41
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
42
42
|
/**
|
|
43
43
|
---
|
|
@@ -45,7 +45,7 @@ category: components
|
|
|
45
45
|
---
|
|
46
46
|
**/
|
|
47
47
|
let Tabs = (_dec = withStyleNew(generateStyle), _dec(_class = class Tabs extends Component {
|
|
48
|
-
static displayName =
|
|
48
|
+
static displayName = 'Tabs';
|
|
49
49
|
static componentId = 'Tabs';
|
|
50
50
|
static allowedProps = allowedProps;
|
|
51
51
|
static defaultProps = {
|
package/es/exports/a.js
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
24
|
+
|
|
25
|
+
export { Tabs } from '../Tabs/v1/index.js';
|
|
26
|
+
export { Panel as TabsPanel } from '../Tabs/v1/Panel/index.js';
|
|
27
|
+
export { Tab as TabsTab } from '../Tabs/v1/Tab/index.js';
|
package/es/exports/b.js
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
24
|
+
|
|
25
|
+
export { Tabs } from '../Tabs/v2/index.js';
|
|
26
|
+
export { Panel as TabsPanel } from '../Tabs/v2/Panel/index.js';
|
|
27
|
+
export { Tab as TabsTab } from '../Tabs/v2/Tab/index.js';
|
|
@@ -10,9 +10,9 @@ var _v11_ = require("@instructure/ui-view/v11_6");
|
|
|
10
10
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
11
11
|
var _Transition = require("@instructure/ui-motion/lib/Transition");
|
|
12
12
|
var _emotion = require("@instructure/emotion");
|
|
13
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
14
|
-
var _theme = _interopRequireDefault(require("./theme"));
|
|
15
|
-
var _props = require("./props");
|
|
13
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
14
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
15
|
+
var _props = require("./props.js");
|
|
16
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
17
|
var _dec, _class;
|
|
18
18
|
/*
|
|
@@ -45,7 +45,7 @@ id: Tabs.Panel
|
|
|
45
45
|
---
|
|
46
46
|
**/
|
|
47
47
|
let Panel = exports.Panel = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = class Panel extends _react.Component {
|
|
48
|
-
static displayName =
|
|
48
|
+
static displayName = 'Panel';
|
|
49
49
|
static componentId = 'Tabs.Panel';
|
|
50
50
|
static allowedProps = _props.allowedProps;
|
|
51
51
|
static defaultProps = {
|
package/lib/Tabs/v1/Tab/index.js
CHANGED
|
@@ -10,9 +10,9 @@ var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProp
|
|
|
10
10
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
11
11
|
var _v11_ = require("@instructure/ui-view/v11_6");
|
|
12
12
|
var _emotion = require("@instructure/emotion");
|
|
13
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
14
|
-
var _theme = _interopRequireDefault(require("./theme"));
|
|
15
|
-
var _props = require("./props");
|
|
13
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
14
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
15
|
+
var _props = require("./props.js");
|
|
16
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
17
|
var _dec, _class;
|
|
18
18
|
/*
|
|
@@ -45,7 +45,7 @@ id: Tabs.Tab
|
|
|
45
45
|
---
|
|
46
46
|
**/
|
|
47
47
|
let Tab = exports.Tab = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = class Tab extends _react.Component {
|
|
48
|
-
static displayName =
|
|
48
|
+
static displayName = 'Tab';
|
|
49
49
|
static componentId = 'Tabs.Tab';
|
|
50
50
|
static allowedProps = _props.allowedProps;
|
|
51
51
|
static defaultProps = {
|
package/lib/Tabs/v1/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
Object.defineProperty(exports, "Panel", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () {
|
|
10
|
-
return
|
|
10
|
+
return _index2.Panel;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
exports.default = exports.Tabs = void 0;
|
|
@@ -24,11 +24,11 @@ var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingC
|
|
|
24
24
|
var _debounce = require("@instructure/debounce");
|
|
25
25
|
var _px = require("@instructure/ui-utils/lib/px.js");
|
|
26
26
|
var _emotion = require("@instructure/emotion");
|
|
27
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
28
|
-
var _theme = _interopRequireDefault(require("./theme"));
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var _props = require("./props");
|
|
27
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
28
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
29
|
+
var _index = require("./Tab/index.js");
|
|
30
|
+
var _index2 = require("./Panel/index.js");
|
|
31
|
+
var _props = require("./props.js");
|
|
32
32
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
33
33
|
var _dec, _class;
|
|
34
34
|
/*
|
|
@@ -60,7 +60,7 @@ category: components
|
|
|
60
60
|
---
|
|
61
61
|
**/
|
|
62
62
|
let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = class Tabs extends _react.Component {
|
|
63
|
-
static displayName =
|
|
63
|
+
static displayName = 'Tabs';
|
|
64
64
|
static componentId = 'Tabs';
|
|
65
65
|
static allowedProps = _props.allowedProps;
|
|
66
66
|
static defaultProps = {
|
|
@@ -68,8 +68,8 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
68
68
|
shouldFocusOnRender: false,
|
|
69
69
|
tabOverflow: 'stack'
|
|
70
70
|
};
|
|
71
|
-
static Panel =
|
|
72
|
-
static Tab =
|
|
71
|
+
static Panel = _index2.Panel;
|
|
72
|
+
static Tab = _index.Tab;
|
|
73
73
|
_tabList = null;
|
|
74
74
|
_focusable = null;
|
|
75
75
|
_tabListPosition;
|
|
@@ -230,7 +230,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
230
230
|
this._tabListPosition = (0, _getBoundingClientRect.getBoundingClientRect)(this._tabList);
|
|
231
231
|
};
|
|
232
232
|
getNextTab(startIndex, step) {
|
|
233
|
-
const tabs = _react.Children.toArray(this.props.children).map(child => (0, _matchComponentTypes.matchComponentTypes)(child, [
|
|
233
|
+
const tabs = _react.Children.toArray(this.props.children).map(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_index2.Panel]) && child);
|
|
234
234
|
const count = tabs.length;
|
|
235
235
|
const change = step < 0 ? step + count : step;
|
|
236
236
|
(0, _console.logError)(startIndex >= 0 && startIndex < count, `[Tabs] Invalid tab index: '${startIndex}'.`);
|
|
@@ -268,7 +268,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
268
268
|
}
|
|
269
269
|
createTab(index, generatedId, selected, panel) {
|
|
270
270
|
const id = panel.props.id || generatedId;
|
|
271
|
-
return (0, _jsxRuntime.jsx)(
|
|
271
|
+
return (0, _jsxRuntime.jsx)(_index.Tab, {
|
|
272
272
|
variant: this.props.variant,
|
|
273
273
|
id: `tab-${id}`,
|
|
274
274
|
controls: panel.props.id || `panel-${id}`,
|
|
@@ -352,14 +352,14 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
352
352
|
styles,
|
|
353
353
|
...props
|
|
354
354
|
} = this.props;
|
|
355
|
-
const activePanels = _react.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [
|
|
355
|
+
const activePanels = _react.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_index2.Panel])).filter(child => child.props.active);
|
|
356
356
|
if (activePanels.length > 1) {
|
|
357
357
|
(0, _console.logError)(false, `[Tabs] Only one Panel can be marked as active.`);
|
|
358
358
|
}
|
|
359
|
-
const selectedChildIndex = _react.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [
|
|
359
|
+
const selectedChildIndex = _react.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_index2.Panel])).findIndex(child => child.props.isSelected && !child.props.isDisabled);
|
|
360
360
|
const selectedIndex = selectedChildIndex >= 0 ? selectedChildIndex : 0;
|
|
361
361
|
_react.Children.toArray(children).map((child, index) => {
|
|
362
|
-
if ((0, _matchComponentTypes.matchComponentTypes)(child, [
|
|
362
|
+
if ((0, _matchComponentTypes.matchComponentTypes)(child, [_index2.Panel])) {
|
|
363
363
|
const selected = !child.props.isDisabled && (child.props.isSelected || selectedIndex === index);
|
|
364
364
|
const id = (0, _uid.uid)();
|
|
365
365
|
tabs.push(this.createTab(index, id, selected, child));
|
|
@@ -10,8 +10,8 @@ var _latest = require("@instructure/ui-view/latest");
|
|
|
10
10
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
11
11
|
var _Transition = require("@instructure/ui-motion/lib/Transition");
|
|
12
12
|
var _emotion = require("@instructure/emotion");
|
|
13
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
14
|
-
var _props = require("./props");
|
|
13
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
14
|
+
var _props = require("./props.js");
|
|
15
15
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
16
16
|
var _dec, _class;
|
|
17
17
|
/*
|
|
@@ -44,7 +44,7 @@ id: Tabs.Panel
|
|
|
44
44
|
---
|
|
45
45
|
**/
|
|
46
46
|
let Panel = exports.Panel = (_dec = (0, _emotion.withStyleNew)(_styles.default), _dec(_class = class Panel extends _react.Component {
|
|
47
|
-
static displayName =
|
|
47
|
+
static displayName = 'Panel';
|
|
48
48
|
static componentId = 'Tabs.Panel';
|
|
49
49
|
static allowedProps = _props.allowedProps;
|
|
50
50
|
static defaultProps = {
|
package/lib/Tabs/v2/Tab/index.js
CHANGED
|
@@ -10,8 +10,8 @@ var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProp
|
|
|
10
10
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
11
11
|
var _latest = require("@instructure/ui-view/latest");
|
|
12
12
|
var _emotion = require("@instructure/emotion");
|
|
13
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
14
|
-
var _props = require("./props");
|
|
13
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
14
|
+
var _props = require("./props.js");
|
|
15
15
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
16
16
|
var _dec, _class;
|
|
17
17
|
/*
|
|
@@ -44,7 +44,7 @@ id: Tabs.Tab
|
|
|
44
44
|
---
|
|
45
45
|
**/
|
|
46
46
|
let Tab = exports.Tab = (_dec = (0, _emotion.withStyleNew)(_styles.default), _dec(_class = class Tab extends _react.Component {
|
|
47
|
-
static displayName =
|
|
47
|
+
static displayName = 'Tab';
|
|
48
48
|
static componentId = 'Tabs.Tab';
|
|
49
49
|
static allowedProps = _props.allowedProps;
|
|
50
50
|
static defaultProps = {
|
package/lib/Tabs/v2/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
Object.defineProperty(exports, "Panel", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () {
|
|
10
|
-
return
|
|
10
|
+
return _index2.Panel;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
exports.default = exports.Tabs = void 0;
|
|
@@ -24,10 +24,10 @@ var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingC
|
|
|
24
24
|
var _debounce = require("@instructure/debounce");
|
|
25
25
|
var _px = require("@instructure/ui-utils/lib/px.js");
|
|
26
26
|
var _emotion = require("@instructure/emotion");
|
|
27
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var _props = require("./props");
|
|
27
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
28
|
+
var _index = require("./Tab/index.js");
|
|
29
|
+
var _index2 = require("./Panel/index.js");
|
|
30
|
+
var _props = require("./props.js");
|
|
31
31
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
32
32
|
var _dec, _class;
|
|
33
33
|
/*
|
|
@@ -59,7 +59,7 @@ category: components
|
|
|
59
59
|
---
|
|
60
60
|
**/
|
|
61
61
|
let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyleNew)(_styles.default), _dec(_class = class Tabs extends _react.Component {
|
|
62
|
-
static displayName =
|
|
62
|
+
static displayName = 'Tabs';
|
|
63
63
|
static componentId = 'Tabs';
|
|
64
64
|
static allowedProps = _props.allowedProps;
|
|
65
65
|
static defaultProps = {
|
|
@@ -67,8 +67,8 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
67
67
|
shouldFocusOnRender: false,
|
|
68
68
|
tabOverflow: 'stack'
|
|
69
69
|
};
|
|
70
|
-
static Panel =
|
|
71
|
-
static Tab =
|
|
70
|
+
static Panel = _index2.Panel;
|
|
71
|
+
static Tab = _index.Tab;
|
|
72
72
|
_tabList = null;
|
|
73
73
|
_focusable = null;
|
|
74
74
|
_tabListPosition;
|
|
@@ -229,7 +229,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
229
229
|
this._tabListPosition = (0, _getBoundingClientRect.getBoundingClientRect)(this._tabList);
|
|
230
230
|
};
|
|
231
231
|
getNextTab(startIndex, step) {
|
|
232
|
-
const tabs = _react.Children.toArray(this.props.children).map(child => (0, _matchComponentTypes.matchComponentTypes)(child, [
|
|
232
|
+
const tabs = _react.Children.toArray(this.props.children).map(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_index2.Panel]) && child);
|
|
233
233
|
const count = tabs.length;
|
|
234
234
|
const change = step < 0 ? step + count : step;
|
|
235
235
|
(0, _console.logError)(startIndex >= 0 && startIndex < count, `[Tabs] Invalid tab index: '${startIndex}'.`);
|
|
@@ -267,7 +267,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
267
267
|
}
|
|
268
268
|
createTab(index, generatedId, selected, panel) {
|
|
269
269
|
const id = panel.props.id || generatedId;
|
|
270
|
-
return (0, _jsxRuntime.jsx)(
|
|
270
|
+
return (0, _jsxRuntime.jsx)(_index.Tab, {
|
|
271
271
|
variant: this.props.variant,
|
|
272
272
|
id: `tab-${id}`,
|
|
273
273
|
controls: panel.props.id || `panel-${id}`,
|
|
@@ -351,14 +351,14 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyleNew)(_styles.default), _
|
|
|
351
351
|
styles,
|
|
352
352
|
...props
|
|
353
353
|
} = this.props;
|
|
354
|
-
const activePanels = _react.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [
|
|
354
|
+
const activePanels = _react.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_index2.Panel])).filter(child => child.props.active);
|
|
355
355
|
if (activePanels.length > 1) {
|
|
356
356
|
(0, _console.logError)(false, `[Tabs] Only one Panel can be marked as active.`);
|
|
357
357
|
}
|
|
358
|
-
const selectedChildIndex = _react.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [
|
|
358
|
+
const selectedChildIndex = _react.Children.toArray(children).filter(child => (0, _matchComponentTypes.matchComponentTypes)(child, [_index2.Panel])).findIndex(child => child.props.isSelected && !child.props.isDisabled);
|
|
359
359
|
const selectedIndex = selectedChildIndex >= 0 ? selectedChildIndex : 0;
|
|
360
360
|
_react.Children.toArray(children).map((child, index) => {
|
|
361
|
-
if ((0, _matchComponentTypes.matchComponentTypes)(child, [
|
|
361
|
+
if ((0, _matchComponentTypes.matchComponentTypes)(child, [_index2.Panel])) {
|
|
362
362
|
const selected = !child.props.isDisabled && (child.props.isSelected || selectedIndex === index);
|
|
363
363
|
const id = (0, _uid.uid)();
|
|
364
364
|
tabs.push(this.createTab(index, id, selected, child));
|
package/lib/exports/a.js
CHANGED
|
@@ -6,21 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "Tabs", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _index.Tabs;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "TabsPanel", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _index2.Panel;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "TabsTab", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _index3.Tab;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
var _index = require("../Tabs/v1/index.js");
|
|
25
|
+
var _index2 = require("../Tabs/v1/Panel/index.js");
|
|
26
|
+
var _index3 = require("../Tabs/v1/Tab/index.js");
|
package/lib/exports/b.js
CHANGED
|
@@ -6,21 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "Tabs", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _index.Tabs;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "TabsPanel", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _index2.Panel;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "TabsTab", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _index3.Tab;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
var _index = require("../Tabs/v2/index.js");
|
|
25
|
+
var _index2 = require("../Tabs/v2/Panel/index.js");
|
|
26
|
+
var _index3 = require("../Tabs/v2/Tab/index.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tabs",
|
|
3
|
-
"version": "11.7.4-snapshot-
|
|
3
|
+
"version": "11.7.4-snapshot-49",
|
|
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",
|
|
@@ -16,28 +16,28 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.2",
|
|
18
18
|
"keycode": "^2",
|
|
19
|
-
"@instructure/console": "11.7.4-snapshot-
|
|
20
|
-
"@instructure/debounce": "11.7.4-snapshot-
|
|
21
|
-
"@instructure/emotion": "11.7.4-snapshot-
|
|
22
|
-
"@instructure/
|
|
23
|
-
"@instructure/
|
|
24
|
-
"@instructure/ui-focusable": "11.7.4-snapshot-
|
|
25
|
-
"@instructure/ui-
|
|
26
|
-
"@instructure/ui-
|
|
27
|
-
"@instructure/ui-
|
|
28
|
-
"@instructure/ui-
|
|
29
|
-
"@instructure/ui-
|
|
30
|
-
"@instructure/ui-
|
|
31
|
-
"@instructure/uid": "11.7.4-snapshot-
|
|
19
|
+
"@instructure/console": "11.7.4-snapshot-49",
|
|
20
|
+
"@instructure/debounce": "11.7.4-snapshot-49",
|
|
21
|
+
"@instructure/emotion": "11.7.4-snapshot-49",
|
|
22
|
+
"@instructure/shared-types": "11.7.4-snapshot-49",
|
|
23
|
+
"@instructure/ui-dom-utils": "11.7.4-snapshot-49",
|
|
24
|
+
"@instructure/ui-focusable": "11.7.4-snapshot-49",
|
|
25
|
+
"@instructure/ui-i18n": "11.7.4-snapshot-49",
|
|
26
|
+
"@instructure/ui-react-utils": "11.7.4-snapshot-49",
|
|
27
|
+
"@instructure/ui-motion": "11.7.4-snapshot-49",
|
|
28
|
+
"@instructure/ui-themes": "11.7.4-snapshot-49",
|
|
29
|
+
"@instructure/ui-view": "11.7.4-snapshot-49",
|
|
30
|
+
"@instructure/ui-utils": "11.7.4-snapshot-49",
|
|
31
|
+
"@instructure/uid": "11.7.4-snapshot-49"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@testing-library/jest-dom": "^6.6.3",
|
|
35
35
|
"@testing-library/react": "15.0.7",
|
|
36
36
|
"@testing-library/user-event": "^14.6.1",
|
|
37
37
|
"vitest": "^3.2.2",
|
|
38
|
-
"@instructure/ui-axe-check": "11.7.4-snapshot-
|
|
39
|
-
"@instructure/ui-babel-preset": "11.7.4-snapshot-
|
|
40
|
-
"@instructure/ui-color-utils": "11.7.4-snapshot-
|
|
38
|
+
"@instructure/ui-axe-check": "11.7.4-snapshot-49",
|
|
39
|
+
"@instructure/ui-babel-preset": "11.7.4-snapshot-49",
|
|
40
|
+
"@instructure/ui-color-utils": "11.7.4-snapshot-49"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": ">=18 <=19"
|
|
@@ -30,10 +30,10 @@ import { Transition } from '@instructure/ui-motion'
|
|
|
30
30
|
|
|
31
31
|
import { withStyle } from '@instructure/emotion'
|
|
32
32
|
|
|
33
|
-
import generateStyle from './styles'
|
|
34
|
-
import generateComponentTheme from './theme'
|
|
33
|
+
import generateStyle from './styles.js'
|
|
34
|
+
import generateComponentTheme from './theme.js'
|
|
35
35
|
import type { TabsPanelProps } from './props'
|
|
36
|
-
import { allowedProps } from './props'
|
|
36
|
+
import { allowedProps } from './props.js'
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
---
|
|
@@ -43,6 +43,7 @@ id: Tabs.Panel
|
|
|
43
43
|
**/
|
|
44
44
|
@withStyle(generateStyle, generateComponentTheme)
|
|
45
45
|
class Panel extends Component<TabsPanelProps> {
|
|
46
|
+
static displayName = 'Panel'
|
|
46
47
|
static readonly componentId = 'Tabs.Panel'
|
|
47
48
|
|
|
48
49
|
static allowedProps = allowedProps
|
|
@@ -30,11 +30,11 @@ import type { ViewOwnProps } from '@instructure/ui-view/v11_6'
|
|
|
30
30
|
|
|
31
31
|
import { withStyle } from '@instructure/emotion'
|
|
32
32
|
|
|
33
|
-
import generateStyle from './styles'
|
|
34
|
-
import generateComponentTheme from './theme'
|
|
33
|
+
import generateStyle from './styles.js'
|
|
34
|
+
import generateComponentTheme from './theme.js'
|
|
35
35
|
|
|
36
36
|
import type { TabsTabProps } from './props'
|
|
37
|
-
import { allowedProps } from './props'
|
|
37
|
+
import { allowedProps } from './props.js'
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
---
|
|
@@ -44,6 +44,7 @@ id: Tabs.Tab
|
|
|
44
44
|
**/
|
|
45
45
|
@withStyle(generateStyle, generateComponentTheme)
|
|
46
46
|
class Tab extends Component<TabsTabProps> {
|
|
47
|
+
static displayName = 'Tab'
|
|
47
48
|
static readonly componentId = 'Tabs.Tab'
|
|
48
49
|
|
|
49
50
|
static allowedProps = allowedProps
|
package/src/Tabs/v1/index.tsx
CHANGED
|
@@ -50,13 +50,13 @@ import { px } from '@instructure/ui-utils'
|
|
|
50
50
|
|
|
51
51
|
import { withStyle } from '@instructure/emotion'
|
|
52
52
|
|
|
53
|
-
import generateStyle from './styles'
|
|
54
|
-
import generateComponentTheme from './theme'
|
|
53
|
+
import generateStyle from './styles.js'
|
|
54
|
+
import generateComponentTheme from './theme.js'
|
|
55
55
|
|
|
56
|
-
import { Tab } from './Tab'
|
|
57
|
-
import { Panel } from './Panel'
|
|
56
|
+
import { Tab } from './Tab/index.js'
|
|
57
|
+
import { Panel } from './Panel/index.js'
|
|
58
58
|
|
|
59
|
-
import { allowedProps } from './props'
|
|
59
|
+
import { allowedProps } from './props.js'
|
|
60
60
|
import type { TabsProps, TabsState } from './props'
|
|
61
61
|
|
|
62
62
|
import type { TabsTabProps } from './Tab/props'
|
|
@@ -72,6 +72,7 @@ category: components
|
|
|
72
72
|
**/
|
|
73
73
|
@withStyle(generateStyle, generateComponentTheme)
|
|
74
74
|
class Tabs extends Component<TabsProps, TabsState> {
|
|
75
|
+
static displayName = 'Tabs'
|
|
75
76
|
static readonly componentId = 'Tabs'
|
|
76
77
|
|
|
77
78
|
static allowedProps = allowedProps
|
|
@@ -30,9 +30,9 @@ import { Transition } from '@instructure/ui-motion'
|
|
|
30
30
|
|
|
31
31
|
import { withStyleNew } from '@instructure/emotion'
|
|
32
32
|
|
|
33
|
-
import generateStyle from './styles'
|
|
33
|
+
import generateStyle from './styles.js'
|
|
34
34
|
import type { TabsPanelProps } from './props'
|
|
35
|
-
import { allowedProps } from './props'
|
|
35
|
+
import { allowedProps } from './props.js'
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
---
|
|
@@ -42,6 +42,7 @@ id: Tabs.Panel
|
|
|
42
42
|
**/
|
|
43
43
|
@withStyleNew(generateStyle)
|
|
44
44
|
class Panel extends Component<TabsPanelProps> {
|
|
45
|
+
static displayName = 'Panel'
|
|
45
46
|
static readonly componentId = 'Tabs.Panel'
|
|
46
47
|
|
|
47
48
|
static allowedProps = allowedProps
|