@instructure/ui-tabs 10.26.1 → 11.0.1-snapshot-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -1
- package/es/Tabs/Panel/index.js +2 -2
- package/es/Tabs/Panel/props.js +1 -18
- package/es/Tabs/Tab/index.js +2 -2
- package/es/Tabs/Tab/props.js +1 -14
- package/es/Tabs/index.js +6 -6
- package/es/Tabs/props.js +1 -20
- package/lib/Tabs/Panel/index.js +1 -1
- package/lib/Tabs/Panel/props.js +1 -19
- package/lib/Tabs/Tab/index.js +1 -1
- package/lib/Tabs/Tab/props.js +1 -15
- package/lib/Tabs/index.js +5 -5
- package/lib/Tabs/props.js +1 -21
- package/package.json +20 -23
- package/src/Tabs/Panel/index.tsx +1 -2
- package/src/Tabs/Panel/props.ts +1 -22
- package/src/Tabs/Tab/index.tsx +1 -2
- package/src/Tabs/Tab/props.ts +1 -17
- package/src/Tabs/index.tsx +3 -5
- package/src/Tabs/props.ts +2 -30
- package/tsconfig.build.json +0 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Tabs/Panel/index.d.ts +0 -16
- package/types/Tabs/Panel/index.d.ts.map +1 -1
- package/types/Tabs/Panel/props.d.ts +2 -3
- package/types/Tabs/Panel/props.d.ts.map +1 -1
- package/types/Tabs/Tab/index.d.ts +0 -18
- package/types/Tabs/Tab/index.d.ts.map +1 -1
- package/types/Tabs/Tab/props.d.ts +2 -3
- package/types/Tabs/Tab/props.d.ts.map +1 -1
- package/types/Tabs/index.d.ts +0 -19
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/Tabs/props.d.ts +2 -3
- package/types/Tabs/props.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
|
-
## [
|
|
6
|
+
## [11.0.1-snapshot-0](https://github.com/instructure/instructure-ui/compare/v11.0.0...v11.0.1-snapshot-0) (2025-10-07)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-tabs
|
|
9
9
|
|
|
@@ -11,6 +11,35 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
# [11.0.0](https://github.com/instructure/instructure-ui/compare/v10.26.0...v11.0.0) (2025-10-06)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* **many:** InstUI v11 contains the following breaking changes:
|
|
25
|
+
- React 16 and 17 are no longer supported
|
|
26
|
+
- remove `PropTypes` from all packages
|
|
27
|
+
- remove `CodeEditor` component
|
|
28
|
+
- remove `@instui/theme-registry` package
|
|
29
|
+
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
30
|
+
- InstUISettingsProvider's `as` prop is removed
|
|
31
|
+
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
32
|
+
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
33
|
+
- `variables` field on theme objects are removed
|
|
34
|
+
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
35
|
+
`isStacked`, `hover`, and `headers`
|
|
36
|
+
- `Table`'s `caption` prop is now required
|
|
37
|
+
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
14
43
|
# [10.26.0](https://github.com/instructure/instructure-ui/compare/v10.25.0...v10.26.0) (2025-10-01)
|
|
15
44
|
|
|
16
45
|
**Note:** Version bump only for package @instructure/ui-tabs
|
package/es/Tabs/Panel/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import { Transition } from '@instructure/ui-motion';
|
|
|
32
32
|
import { withStyle } from '@instructure/emotion';
|
|
33
33
|
import generateStyle from './styles';
|
|
34
34
|
import generateComponentTheme from './theme';
|
|
35
|
-
import { allowedProps
|
|
35
|
+
import { allowedProps } from './props';
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
---
|
|
@@ -114,7 +114,7 @@ let Panel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
|
114
114
|
})
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
}, _Panel.displayName = "Panel", _Panel.componentId = 'Tabs.Panel', _Panel.allowedProps = allowedProps, _Panel.
|
|
117
|
+
}, _Panel.displayName = "Panel", _Panel.componentId = 'Tabs.Panel', _Panel.allowedProps = allowedProps, _Panel.defaultProps = {
|
|
118
118
|
isDisabled: false,
|
|
119
119
|
textAlign: 'start',
|
|
120
120
|
variant: 'default',
|
package/es/Tabs/Panel/props.js
CHANGED
|
@@ -22,22 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
const propTypes = {
|
|
27
|
-
renderTitle: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
28
|
-
children: PropTypes.node,
|
|
29
|
-
variant: PropTypes.oneOf(['default', 'secondary']),
|
|
30
|
-
isSelected: PropTypes.bool,
|
|
31
|
-
isDisabled: PropTypes.bool,
|
|
32
|
-
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
33
|
-
minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
34
|
-
id: PropTypes.string,
|
|
35
|
-
labelledBy: PropTypes.string,
|
|
36
|
-
padding: PropTypes.string,
|
|
37
|
-
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
38
|
-
elementRef: PropTypes.func,
|
|
39
|
-
active: PropTypes.bool,
|
|
40
|
-
unmountOnExit: PropTypes.bool
|
|
41
|
-
};
|
|
42
25
|
const allowedProps = ['renderTitle', 'children', 'variant', 'isSelected', 'isDisabled', 'maxHeight', 'minHeight', 'id', 'labelledBy', 'padding', 'textAlign', 'elementRef', 'active', 'unmountOnExit'];
|
|
43
|
-
export {
|
|
26
|
+
export { allowedProps };
|
package/es/Tabs/Tab/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import { View } from '@instructure/ui-view';
|
|
|
31
31
|
import { withStyle } from '@instructure/emotion';
|
|
32
32
|
import generateStyle from './styles';
|
|
33
33
|
import generateComponentTheme from './theme';
|
|
34
|
-
import { allowedProps
|
|
34
|
+
import { allowedProps } from './props';
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
---
|
|
@@ -110,7 +110,7 @@ let Tab = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
110
110
|
children: callRenderProp(children)
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
}, _Tab.displayName = "Tab", _Tab.componentId = 'Tabs.Tab', _Tab.allowedProps = allowedProps, _Tab.
|
|
113
|
+
}, _Tab.displayName = "Tab", _Tab.componentId = 'Tabs.Tab', _Tab.allowedProps = allowedProps, _Tab.defaultProps = {
|
|
114
114
|
variant: 'default',
|
|
115
115
|
isDisabled: false,
|
|
116
116
|
isSelected: false
|
package/es/Tabs/Tab/props.js
CHANGED
|
@@ -22,18 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
const propTypes = {
|
|
27
|
-
variant: PropTypes.oneOf(['default', 'secondary']),
|
|
28
|
-
id: PropTypes.string.isRequired,
|
|
29
|
-
index: PropTypes.number.isRequired,
|
|
30
|
-
controls: PropTypes.string.isRequired,
|
|
31
|
-
isDisabled: PropTypes.bool,
|
|
32
|
-
isSelected: PropTypes.bool,
|
|
33
|
-
onClick: PropTypes.func,
|
|
34
|
-
onKeyDown: PropTypes.func,
|
|
35
|
-
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
36
|
-
isOverflowScroll: PropTypes.bool
|
|
37
|
-
};
|
|
38
25
|
const allowedProps = ['variant', 'id', 'index', 'controls', 'isDisabled', 'isSelected', 'onClick', 'onKeyDown', 'children', 'isOverflowScroll'];
|
|
39
|
-
export {
|
|
26
|
+
export { allowedProps };
|
package/es/Tabs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["children", "elementRef", "maxWidth", "variant", "margin", "screenReaderLabel", "onRequestTabChange", "tabOverflow", "styles"];
|
|
3
|
-
var _dec,
|
|
3
|
+
var _dec, _class, _Tabs;
|
|
4
4
|
/*
|
|
5
5
|
* The MIT License (MIT)
|
|
6
6
|
*
|
|
@@ -31,7 +31,6 @@ import { View } from '@instructure/ui-view';
|
|
|
31
31
|
import { matchComponentTypes, safeCloneElement, passthroughProps } from '@instructure/ui-react-utils';
|
|
32
32
|
import { logError as error } from '@instructure/console';
|
|
33
33
|
import { uid } from '@instructure/uid';
|
|
34
|
-
import { testable } from '@instructure/ui-testable';
|
|
35
34
|
import { Focusable } from '@instructure/ui-focusable';
|
|
36
35
|
import { getBoundingClientRect } from '@instructure/ui-dom-utils';
|
|
37
36
|
import { debounce } from '@instructure/debounce';
|
|
@@ -41,14 +40,14 @@ import generateStyle from './styles';
|
|
|
41
40
|
import generateComponentTheme from './theme';
|
|
42
41
|
import { Tab } from './Tab';
|
|
43
42
|
import { Panel } from './Panel';
|
|
44
|
-
import { allowedProps
|
|
43
|
+
import { allowedProps } from './props';
|
|
45
44
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
46
45
|
/**
|
|
47
46
|
---
|
|
48
47
|
category: components
|
|
49
48
|
---
|
|
50
49
|
**/
|
|
51
|
-
let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
50
|
+
let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_Tabs = class Tabs extends Component {
|
|
52
51
|
constructor(props) {
|
|
53
52
|
super(props);
|
|
54
53
|
this._tabList = null;
|
|
@@ -364,6 +363,7 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
|
|
|
364
363
|
margin: margin,
|
|
365
364
|
as: "div",
|
|
366
365
|
css: styles === null || styles === void 0 ? void 0 : styles.container,
|
|
366
|
+
"data-cid": "Tabs",
|
|
367
367
|
children: [_jsx(Focusable, {
|
|
368
368
|
ref: this.handleFocusableRef,
|
|
369
369
|
children: () => _jsx(View, {
|
|
@@ -388,10 +388,10 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
|
|
|
388
388
|
})]
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
}, _Tabs.displayName = "Tabs", _Tabs.componentId = 'Tabs', _Tabs.allowedProps = allowedProps, _Tabs.
|
|
391
|
+
}, _Tabs.displayName = "Tabs", _Tabs.componentId = 'Tabs', _Tabs.allowedProps = allowedProps, _Tabs.defaultProps = {
|
|
392
392
|
variant: 'default',
|
|
393
393
|
shouldFocusOnRender: false,
|
|
394
394
|
tabOverflow: 'stack'
|
|
395
|
-
}, _Tabs.Panel = Panel, _Tabs.Tab = Tab, _Tabs)) || _class)
|
|
395
|
+
}, _Tabs.Panel = Panel, _Tabs.Tab = Tab, _Tabs)) || _class);
|
|
396
396
|
export default Tabs;
|
|
397
397
|
export { Tabs, Panel };
|
package/es/Tabs/props.js
CHANGED
|
@@ -22,24 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { Children } from '@instructure/ui-prop-types';
|
|
27
|
-
import { Panel } from './Panel';
|
|
28
|
-
const propTypes = {
|
|
29
|
-
children: Children.oneOf([Panel, null]),
|
|
30
|
-
variant: PropTypes.oneOf(['default', 'secondary']),
|
|
31
|
-
screenReaderLabel: PropTypes.string,
|
|
32
|
-
onRequestTabChange: PropTypes.func,
|
|
33
|
-
maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
34
|
-
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
35
|
-
minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
36
|
-
fixHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
37
|
-
margin: PropTypes.string,
|
|
38
|
-
padding: PropTypes.string,
|
|
39
|
-
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
40
|
-
elementRef: PropTypes.func,
|
|
41
|
-
tabOverflow: PropTypes.oneOf(['stack', 'scroll']),
|
|
42
|
-
shouldFocusOnRender: PropTypes.bool
|
|
43
|
-
};
|
|
44
25
|
const allowedProps = ['children', 'variant', 'screenReaderLabel', 'onRequestTabChange', 'maxWidth', 'maxHeight', 'minHeight', 'fixHeight', 'margin', 'padding', 'textAlign', 'elementRef', 'tabOverflow', 'shouldFocusOnRender'];
|
|
45
|
-
export {
|
|
26
|
+
export { allowedProps };
|
package/lib/Tabs/Panel/index.js
CHANGED
|
@@ -119,7 +119,7 @@ let Panel = exports.Panel = (_dec = (0, _emotion.withStyle)(_styles.default, _th
|
|
|
119
119
|
})
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
}, _Panel.displayName = "Panel", _Panel.componentId = 'Tabs.Panel', _Panel.allowedProps = _props.allowedProps, _Panel.
|
|
122
|
+
}, _Panel.displayName = "Panel", _Panel.componentId = 'Tabs.Panel', _Panel.allowedProps = _props.allowedProps, _Panel.defaultProps = {
|
|
123
123
|
isDisabled: false,
|
|
124
124
|
textAlign: 'start',
|
|
125
125
|
variant: 'default',
|
package/lib/Tabs/Panel/props.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,20 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
renderTitle: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
|
|
35
|
-
children: _propTypes.default.node,
|
|
36
|
-
variant: _propTypes.default.oneOf(['default', 'secondary']),
|
|
37
|
-
isSelected: _propTypes.default.bool,
|
|
38
|
-
isDisabled: _propTypes.default.bool,
|
|
39
|
-
maxHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
40
|
-
minHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
41
|
-
id: _propTypes.default.string,
|
|
42
|
-
labelledBy: _propTypes.default.string,
|
|
43
|
-
padding: _propTypes.default.string,
|
|
44
|
-
textAlign: _propTypes.default.oneOf(['start', 'center', 'end']),
|
|
45
|
-
elementRef: _propTypes.default.func,
|
|
46
|
-
active: _propTypes.default.bool,
|
|
47
|
-
unmountOnExit: _propTypes.default.bool
|
|
48
|
-
};
|
|
49
31
|
const allowedProps = exports.allowedProps = ['renderTitle', 'children', 'variant', 'isSelected', 'isDisabled', 'maxHeight', 'minHeight', 'id', 'labelledBy', 'padding', 'textAlign', 'elementRef', 'active', 'unmountOnExit'];
|
package/lib/Tabs/Tab/index.js
CHANGED
|
@@ -116,7 +116,7 @@ let Tab = exports.Tab = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.
|
|
|
116
116
|
children: (0, _callRenderProp.callRenderProp)(children)
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
}, _Tab.displayName = "Tab", _Tab.componentId = 'Tabs.Tab', _Tab.allowedProps = _props.allowedProps, _Tab.
|
|
119
|
+
}, _Tab.displayName = "Tab", _Tab.componentId = 'Tabs.Tab', _Tab.allowedProps = _props.allowedProps, _Tab.defaultProps = {
|
|
120
120
|
variant: 'default',
|
|
121
121
|
isDisabled: false,
|
|
122
122
|
isSelected: false
|
package/lib/Tabs/Tab/props.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,16 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
variant: _propTypes.default.oneOf(['default', 'secondary']),
|
|
35
|
-
id: _propTypes.default.string.isRequired,
|
|
36
|
-
index: _propTypes.default.number.isRequired,
|
|
37
|
-
controls: _propTypes.default.string.isRequired,
|
|
38
|
-
isDisabled: _propTypes.default.bool,
|
|
39
|
-
isSelected: _propTypes.default.bool,
|
|
40
|
-
onClick: _propTypes.default.func,
|
|
41
|
-
onKeyDown: _propTypes.default.func,
|
|
42
|
-
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
43
|
-
isOverflowScroll: _propTypes.default.bool
|
|
44
|
-
};
|
|
45
31
|
const allowedProps = exports.allowedProps = ['variant', 'id', 'index', 'controls', 'isDisabled', 'isSelected', 'onClick', 'onKeyDown', 'children', 'isOverflowScroll'];
|
package/lib/Tabs/index.js
CHANGED
|
@@ -20,7 +20,6 @@ var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElemen
|
|
|
20
20
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
21
21
|
var _console = require("@instructure/console");
|
|
22
22
|
var _uid = require("@instructure/uid");
|
|
23
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
24
23
|
var _Focusable = require("@instructure/ui-focusable/lib/Focusable");
|
|
25
24
|
var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingClientRect.js");
|
|
26
25
|
var _debounce = require("@instructure/debounce");
|
|
@@ -33,7 +32,7 @@ var _Panel = require("./Panel");
|
|
|
33
32
|
var _props = require("./props");
|
|
34
33
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
35
34
|
const _excluded = ["children", "elementRef", "maxWidth", "variant", "margin", "screenReaderLabel", "onRequestTabChange", "tabOverflow", "styles"];
|
|
36
|
-
var _dec,
|
|
35
|
+
var _dec, _class, _Tabs;
|
|
37
36
|
/*
|
|
38
37
|
* The MIT License (MIT)
|
|
39
38
|
*
|
|
@@ -62,7 +61,7 @@ var _dec, _dec2, _class, _Tabs;
|
|
|
62
61
|
category: components
|
|
63
62
|
---
|
|
64
63
|
**/
|
|
65
|
-
let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
64
|
+
let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_Tabs = class Tabs extends _react.Component {
|
|
66
65
|
constructor(props) {
|
|
67
66
|
super(props);
|
|
68
67
|
this._tabList = null;
|
|
@@ -378,6 +377,7 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
378
377
|
margin: margin,
|
|
379
378
|
as: "div",
|
|
380
379
|
css: styles === null || styles === void 0 ? void 0 : styles.container,
|
|
380
|
+
"data-cid": "Tabs",
|
|
381
381
|
children: [(0, _jsxRuntime.jsx)(_Focusable.Focusable, {
|
|
382
382
|
ref: this.handleFocusableRef,
|
|
383
383
|
children: () => (0, _jsxRuntime.jsx)(_View.View, {
|
|
@@ -402,9 +402,9 @@ let Tabs = exports.Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
402
402
|
})]
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
|
-
}, _Tabs.displayName = "Tabs", _Tabs.componentId = 'Tabs', _Tabs.allowedProps = _props.allowedProps, _Tabs.
|
|
405
|
+
}, _Tabs.displayName = "Tabs", _Tabs.componentId = 'Tabs', _Tabs.allowedProps = _props.allowedProps, _Tabs.defaultProps = {
|
|
406
406
|
variant: 'default',
|
|
407
407
|
shouldFocusOnRender: false,
|
|
408
408
|
tabOverflow: 'stack'
|
|
409
|
-
}, _Tabs.Panel = _Panel.Panel, _Tabs.Tab = _Tab.Tab, _Tabs)) || _class)
|
|
409
|
+
}, _Tabs.Panel = _Panel.Panel, _Tabs.Tab = _Tab.Tab, _Tabs)) || _class);
|
|
410
410
|
var _default = exports.default = Tabs;
|
package/lib/Tabs/props.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
10
|
-
var _Panel = require("./Panel");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
11
7
|
/*
|
|
12
8
|
* The MIT License (MIT)
|
|
13
9
|
*
|
|
@@ -32,20 +28,4 @@ var _Panel = require("./Panel");
|
|
|
32
28
|
* SOFTWARE.
|
|
33
29
|
*/
|
|
34
30
|
|
|
35
|
-
const propTypes = exports.propTypes = {
|
|
36
|
-
children: _Children.Children.oneOf([_Panel.Panel, null]),
|
|
37
|
-
variant: _propTypes.default.oneOf(['default', 'secondary']),
|
|
38
|
-
screenReaderLabel: _propTypes.default.string,
|
|
39
|
-
onRequestTabChange: _propTypes.default.func,
|
|
40
|
-
maxWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
41
|
-
maxHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
42
|
-
minHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
43
|
-
fixHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
44
|
-
margin: _propTypes.default.string,
|
|
45
|
-
padding: _propTypes.default.string,
|
|
46
|
-
textAlign: _propTypes.default.oneOf(['start', 'center', 'end']),
|
|
47
|
-
elementRef: _propTypes.default.func,
|
|
48
|
-
tabOverflow: _propTypes.default.oneOf(['stack', 'scroll']),
|
|
49
|
-
shouldFocusOnRender: _propTypes.default.bool
|
|
50
|
-
};
|
|
51
31
|
const allowedProps = exports.allowedProps = ['children', 'variant', 'screenReaderLabel', 'onRequestTabChange', 'maxWidth', 'maxHeight', 'minHeight', 'fixHeight', 'margin', 'padding', 'textAlign', 'elementRef', 'tabOverflow', 'shouldFocusOnRender'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tabs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1-snapshot-0",
|
|
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,36 +23,33 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "
|
|
27
|
-
"@instructure/ui-babel-preset": "
|
|
28
|
-
"@instructure/ui-color-utils": "
|
|
29
|
-
"@instructure/ui-themes": "
|
|
26
|
+
"@instructure/ui-axe-check": "11.0.1-snapshot-0",
|
|
27
|
+
"@instructure/ui-babel-preset": "11.0.1-snapshot-0",
|
|
28
|
+
"@instructure/ui-color-utils": "11.0.1-snapshot-0",
|
|
29
|
+
"@instructure/ui-themes": "11.0.1-snapshot-0",
|
|
30
30
|
"@testing-library/jest-dom": "^6.6.3",
|
|
31
|
-
"@testing-library/react": "
|
|
31
|
+
"@testing-library/react": "15.0.7",
|
|
32
32
|
"@testing-library/user-event": "^14.6.1",
|
|
33
33
|
"vitest": "^3.2.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.27.6",
|
|
37
|
-
"@instructure/console": "
|
|
38
|
-
"@instructure/debounce": "
|
|
39
|
-
"@instructure/emotion": "
|
|
40
|
-
"@instructure/shared-types": "
|
|
41
|
-
"@instructure/ui-dom-utils": "
|
|
42
|
-
"@instructure/ui-focusable": "
|
|
43
|
-
"@instructure/ui-i18n": "
|
|
44
|
-
"@instructure/ui-motion": "
|
|
45
|
-
"@instructure/ui-
|
|
46
|
-
"@instructure/ui-
|
|
47
|
-
"@instructure/ui-
|
|
48
|
-
"@instructure/
|
|
49
|
-
"
|
|
50
|
-
"@instructure/uid": "10.26.1",
|
|
51
|
-
"keycode": "^2",
|
|
52
|
-
"prop-types": "^15.8.1"
|
|
37
|
+
"@instructure/console": "11.0.1-snapshot-0",
|
|
38
|
+
"@instructure/debounce": "11.0.1-snapshot-0",
|
|
39
|
+
"@instructure/emotion": "11.0.1-snapshot-0",
|
|
40
|
+
"@instructure/shared-types": "11.0.1-snapshot-0",
|
|
41
|
+
"@instructure/ui-dom-utils": "11.0.1-snapshot-0",
|
|
42
|
+
"@instructure/ui-focusable": "11.0.1-snapshot-0",
|
|
43
|
+
"@instructure/ui-i18n": "11.0.1-snapshot-0",
|
|
44
|
+
"@instructure/ui-motion": "11.0.1-snapshot-0",
|
|
45
|
+
"@instructure/ui-react-utils": "11.0.1-snapshot-0",
|
|
46
|
+
"@instructure/ui-utils": "11.0.1-snapshot-0",
|
|
47
|
+
"@instructure/ui-view": "11.0.1-snapshot-0",
|
|
48
|
+
"@instructure/uid": "11.0.1-snapshot-0",
|
|
49
|
+
"keycode": "^2"
|
|
53
50
|
},
|
|
54
51
|
"peerDependencies": {
|
|
55
|
-
"react": ">=
|
|
52
|
+
"react": ">=18 <=19"
|
|
56
53
|
},
|
|
57
54
|
"publishConfig": {
|
|
58
55
|
"access": "public"
|
package/src/Tabs/Panel/index.tsx
CHANGED
|
@@ -33,7 +33,7 @@ import { withStyle } from '@instructure/emotion'
|
|
|
33
33
|
import generateStyle from './styles'
|
|
34
34
|
import generateComponentTheme from './theme'
|
|
35
35
|
import type { TabsPanelProps } from './props'
|
|
36
|
-
import { allowedProps
|
|
36
|
+
import { allowedProps } from './props'
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
---
|
|
@@ -46,7 +46,6 @@ class Panel extends Component<TabsPanelProps> {
|
|
|
46
46
|
static readonly componentId = 'Tabs.Panel'
|
|
47
47
|
|
|
48
48
|
static allowedProps = allowedProps
|
|
49
|
-
static propTypes = propTypes
|
|
50
49
|
|
|
51
50
|
static defaultProps = {
|
|
52
51
|
isDisabled: false,
|
package/src/Tabs/Panel/props.ts
CHANGED
|
@@ -23,8 +23,6 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
-
import PropTypes from 'prop-types'
|
|
27
|
-
|
|
28
26
|
import type {
|
|
29
27
|
Spacing,
|
|
30
28
|
WithStyleProps,
|
|
@@ -32,7 +30,6 @@ import type {
|
|
|
32
30
|
} from '@instructure/emotion'
|
|
33
31
|
import type {
|
|
34
32
|
OtherHTMLAttributes,
|
|
35
|
-
PropValidators,
|
|
36
33
|
TabsPanelTheme
|
|
37
34
|
} from '@instructure/shared-types'
|
|
38
35
|
|
|
@@ -76,24 +73,6 @@ type TabsPanelProps = TabsPanelOwnProps &
|
|
|
76
73
|
OtherHTMLAttributes<TabsPanelOwnProps>
|
|
77
74
|
|
|
78
75
|
type TabsPanelStyle = ComponentStyle<'panel' | 'content'>
|
|
79
|
-
|
|
80
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
81
|
-
renderTitle: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
82
|
-
children: PropTypes.node,
|
|
83
|
-
variant: PropTypes.oneOf(['default', 'secondary']),
|
|
84
|
-
isSelected: PropTypes.bool,
|
|
85
|
-
isDisabled: PropTypes.bool,
|
|
86
|
-
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
87
|
-
minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
88
|
-
id: PropTypes.string,
|
|
89
|
-
labelledBy: PropTypes.string,
|
|
90
|
-
padding: PropTypes.string,
|
|
91
|
-
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
92
|
-
elementRef: PropTypes.func,
|
|
93
|
-
active: PropTypes.bool,
|
|
94
|
-
unmountOnExit: PropTypes.bool
|
|
95
|
-
}
|
|
96
|
-
|
|
97
76
|
const allowedProps: AllowedPropKeys = [
|
|
98
77
|
'renderTitle',
|
|
99
78
|
'children',
|
|
@@ -112,4 +91,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
112
91
|
]
|
|
113
92
|
|
|
114
93
|
export type { TabsPanelProps, TabsPanelStyle }
|
|
115
|
-
export {
|
|
94
|
+
export { allowedProps }
|
package/src/Tabs/Tab/index.tsx
CHANGED
|
@@ -34,7 +34,7 @@ import generateStyle from './styles'
|
|
|
34
34
|
import generateComponentTheme from './theme'
|
|
35
35
|
|
|
36
36
|
import type { TabsTabProps } from './props'
|
|
37
|
-
import { allowedProps
|
|
37
|
+
import { allowedProps } from './props'
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
---
|
|
@@ -46,7 +46,6 @@ class Tab extends Component<TabsTabProps> {
|
|
|
46
46
|
static readonly componentId = 'Tabs.Tab'
|
|
47
47
|
|
|
48
48
|
static allowedProps = allowedProps
|
|
49
|
-
static propTypes = propTypes
|
|
50
49
|
|
|
51
50
|
static defaultProps = {
|
|
52
51
|
variant: 'default',
|
package/src/Tabs/Tab/props.ts
CHANGED
|
@@ -23,11 +23,8 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
-
import PropTypes from 'prop-types'
|
|
27
|
-
|
|
28
26
|
import type {
|
|
29
27
|
OtherHTMLAttributes,
|
|
30
|
-
PropValidators,
|
|
31
28
|
Renderable,
|
|
32
29
|
TabsTabTheme
|
|
33
30
|
} from '@instructure/shared-types'
|
|
@@ -66,19 +63,6 @@ type TabsTabProps = TabsTabOwnProps &
|
|
|
66
63
|
|
|
67
64
|
type TabsTabStyle = ComponentStyle<'tab'>
|
|
68
65
|
|
|
69
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
70
|
-
variant: PropTypes.oneOf(['default', 'secondary']),
|
|
71
|
-
id: PropTypes.string.isRequired,
|
|
72
|
-
index: PropTypes.number.isRequired,
|
|
73
|
-
controls: PropTypes.string.isRequired,
|
|
74
|
-
isDisabled: PropTypes.bool,
|
|
75
|
-
isSelected: PropTypes.bool,
|
|
76
|
-
onClick: PropTypes.func,
|
|
77
|
-
onKeyDown: PropTypes.func,
|
|
78
|
-
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
79
|
-
isOverflowScroll: PropTypes.bool
|
|
80
|
-
}
|
|
81
|
-
|
|
82
66
|
const allowedProps: AllowedPropKeys = [
|
|
83
67
|
'variant',
|
|
84
68
|
'id',
|
|
@@ -93,4 +77,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
93
77
|
]
|
|
94
78
|
|
|
95
79
|
export type { TabsTabProps, TabsTabStyle }
|
|
96
|
-
export {
|
|
80
|
+
export { allowedProps }
|
package/src/Tabs/index.tsx
CHANGED
|
@@ -41,7 +41,6 @@ import {
|
|
|
41
41
|
} from '@instructure/ui-react-utils'
|
|
42
42
|
import { logError as error } from '@instructure/console'
|
|
43
43
|
import { uid } from '@instructure/uid'
|
|
44
|
-
import { testable } from '@instructure/ui-testable'
|
|
45
44
|
import { Focusable } from '@instructure/ui-focusable'
|
|
46
45
|
import { getBoundingClientRect } from '@instructure/ui-dom-utils'
|
|
47
46
|
import type { RectType } from '@instructure/ui-dom-utils'
|
|
@@ -57,7 +56,7 @@ import generateComponentTheme from './theme'
|
|
|
57
56
|
import { Tab } from './Tab'
|
|
58
57
|
import { Panel } from './Panel'
|
|
59
58
|
|
|
60
|
-
import { allowedProps
|
|
59
|
+
import { allowedProps } from './props'
|
|
61
60
|
import type { TabsProps, TabsState } from './props'
|
|
62
61
|
|
|
63
62
|
import type { TabsTabProps } from './Tab/props'
|
|
@@ -72,12 +71,10 @@ category: components
|
|
|
72
71
|
---
|
|
73
72
|
**/
|
|
74
73
|
@withStyle(generateStyle, generateComponentTheme)
|
|
75
|
-
@testable()
|
|
76
74
|
class Tabs extends Component<TabsProps, TabsState> {
|
|
77
75
|
static readonly componentId = 'Tabs'
|
|
78
76
|
|
|
79
77
|
static allowedProps = allowedProps
|
|
80
|
-
static propTypes = propTypes
|
|
81
78
|
|
|
82
79
|
static defaultProps = {
|
|
83
80
|
variant: 'default',
|
|
@@ -391,7 +388,7 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
391
388
|
if (activePanel !== undefined) {
|
|
392
389
|
// cloning active panel with a proper custom key as a workaround because
|
|
393
390
|
// safeCloneElement overwrites it with the key from the original element
|
|
394
|
-
activePanelClone = cloneElement(activePanel as ReactElement
|
|
391
|
+
activePanelClone = cloneElement(activePanel as ReactElement<any>, {
|
|
395
392
|
key: `panel-${index}`
|
|
396
393
|
})
|
|
397
394
|
|
|
@@ -514,6 +511,7 @@ class Tabs extends Component<TabsProps, TabsState> {
|
|
|
514
511
|
margin={margin}
|
|
515
512
|
as="div"
|
|
516
513
|
css={styles?.container}
|
|
514
|
+
data-cid="Tabs"
|
|
517
515
|
>
|
|
518
516
|
<Focusable ref={this.handleFocusableRef}>
|
|
519
517
|
{() => (
|