@instructure/ui-tabs 11.7.3-snapshot-7 → 11.7.3-snapshot-26
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 +2 -1
- package/es/Tabs/v1/Panel/index.js +53 -52
- package/es/Tabs/v1/Panel/styles.js +7 -3
- package/es/Tabs/v1/Panel/theme.js +15 -14
- package/es/Tabs/v1/Tab/index.js +61 -61
- package/es/Tabs/v1/Tab/styles.js +6 -4
- package/es/Tabs/v1/Tab/theme.js +17 -16
- package/es/Tabs/v1/index.js +108 -101
- package/es/Tabs/v1/styles.js +5 -3
- package/es/Tabs/v1/theme.js +9 -8
- package/es/Tabs/v2/Panel/index.js +53 -52
- package/es/Tabs/v2/Panel/styles.js +7 -3
- package/es/Tabs/v2/Tab/index.js +61 -61
- package/es/Tabs/v2/Tab/styles.js +6 -4
- package/es/Tabs/v2/index.js +108 -101
- package/es/Tabs/v2/styles.js +5 -3
- package/lib/Tabs/v1/Panel/index.js +53 -52
- package/lib/Tabs/v1/Panel/styles.js +7 -3
- package/lib/Tabs/v1/Panel/theme.js +15 -14
- package/lib/Tabs/v1/Tab/index.js +61 -61
- package/lib/Tabs/v1/Tab/styles.js +6 -4
- package/lib/Tabs/v1/Tab/theme.js +17 -16
- package/lib/Tabs/v1/index.js +108 -101
- package/lib/Tabs/v1/styles.js +5 -3
- package/lib/Tabs/v1/theme.js +9 -8
- package/lib/Tabs/v2/Panel/index.js +53 -52
- package/lib/Tabs/v2/Panel/styles.js +7 -3
- package/lib/Tabs/v2/Tab/index.js +61 -61
- package/lib/Tabs/v2/Tab/styles.js +6 -4
- package/lib/Tabs/v2/index.js +108 -101
- package/lib/Tabs/v2/styles.js +5 -3
- package/package.json +18 -18
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +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
|
-
## [11.7.3-snapshot-
|
|
6
|
+
## [11.7.3-snapshot-26](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-26) (2026-05-05)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
10
10
|
|
|
11
|
+
* **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
|
|
11
12
|
* **ui-tabs:** fix tabs panel layout when unmountOnExit is false ([826ff62](https://github.com/instructure/instructure-ui/commit/826ff62fba56bc0cadd6995b366e3ca505b1b6c1))
|
|
12
13
|
|
|
13
14
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["labelledBy", "variant", "id", "maxHeight", "minHeight", "padding", "textAlign", "children", "elementRef", "isDisabled", "isSelected", "styles", "active", "unmountOnExit", "tabIndex"];
|
|
3
|
-
var _dec, _class, _Panel;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -40,62 +38,73 @@ id: Tabs.Panel
|
|
|
40
38
|
---
|
|
41
39
|
**/
|
|
42
40
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
43
|
-
let Panel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
let Panel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Panel extends Component {
|
|
42
|
+
static displayName = "Panel";
|
|
43
|
+
static componentId = 'Tabs.Panel';
|
|
44
|
+
static allowedProps = allowedProps;
|
|
45
|
+
static defaultProps = {
|
|
46
|
+
isDisabled: false,
|
|
47
|
+
textAlign: 'start',
|
|
48
|
+
variant: 'default',
|
|
49
|
+
isSelected: false,
|
|
50
|
+
padding: 'small',
|
|
51
|
+
active: false,
|
|
52
|
+
unmountOnExit: true
|
|
53
|
+
};
|
|
55
54
|
componentDidMount() {
|
|
56
|
-
|
|
57
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, {
|
|
55
|
+
this.props.makeStyles?.({
|
|
58
56
|
isHidden: this.isHidden
|
|
59
57
|
});
|
|
60
58
|
}
|
|
61
59
|
componentDidUpdate() {
|
|
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
|
+
this.props.makeStyles?.({
|
|
64
61
|
isHidden: this.isHidden
|
|
65
62
|
});
|
|
66
63
|
}
|
|
64
|
+
ref = null;
|
|
67
65
|
get isHidden() {
|
|
68
|
-
const
|
|
69
|
-
isDisabled
|
|
70
|
-
isSelected
|
|
66
|
+
const {
|
|
67
|
+
isDisabled,
|
|
68
|
+
isSelected
|
|
69
|
+
} = this.props;
|
|
71
70
|
return !isSelected || !!isDisabled;
|
|
72
71
|
}
|
|
72
|
+
handleRef = el => {
|
|
73
|
+
const {
|
|
74
|
+
elementRef
|
|
75
|
+
} = this.props;
|
|
76
|
+
this.ref = el;
|
|
77
|
+
if (typeof elementRef === 'function') {
|
|
78
|
+
elementRef(el);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
73
81
|
render() {
|
|
74
|
-
const
|
|
75
|
-
labelledBy
|
|
76
|
-
variant
|
|
77
|
-
id
|
|
78
|
-
maxHeight
|
|
79
|
-
minHeight
|
|
80
|
-
padding
|
|
81
|
-
textAlign
|
|
82
|
-
children
|
|
83
|
-
elementRef
|
|
84
|
-
isDisabled
|
|
85
|
-
isSelected
|
|
86
|
-
styles
|
|
87
|
-
active
|
|
88
|
-
unmountOnExit
|
|
89
|
-
tabIndex
|
|
90
|
-
props
|
|
82
|
+
const {
|
|
83
|
+
labelledBy,
|
|
84
|
+
variant,
|
|
85
|
+
id,
|
|
86
|
+
maxHeight,
|
|
87
|
+
minHeight,
|
|
88
|
+
padding,
|
|
89
|
+
textAlign,
|
|
90
|
+
children,
|
|
91
|
+
elementRef,
|
|
92
|
+
isDisabled,
|
|
93
|
+
isSelected,
|
|
94
|
+
styles,
|
|
95
|
+
active,
|
|
96
|
+
unmountOnExit,
|
|
97
|
+
tabIndex,
|
|
98
|
+
...props
|
|
99
|
+
} = this.props;
|
|
91
100
|
return _jsx("div", {
|
|
92
101
|
...passthroughProps(props),
|
|
93
|
-
css: styles
|
|
102
|
+
css: styles?.panel,
|
|
94
103
|
role: "tabpanel",
|
|
95
104
|
id: id,
|
|
96
105
|
"aria-labelledby": labelledBy,
|
|
97
|
-
"aria-hidden": this.isHidden ? 'true' :
|
|
98
|
-
tabIndex: this.isHidden ?
|
|
106
|
+
"aria-hidden": this.isHidden ? 'true' : undefined,
|
|
107
|
+
tabIndex: this.isHidden ? undefined : tabIndex,
|
|
99
108
|
ref: this.handleRef,
|
|
100
109
|
children: _jsx(Transition, {
|
|
101
110
|
type: "fade",
|
|
@@ -103,7 +112,7 @@ let Panel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
|
103
112
|
unmountOnExit: unmountOnExit,
|
|
104
113
|
transitionExit: false,
|
|
105
114
|
children: _jsx(View, {
|
|
106
|
-
css: styles
|
|
115
|
+
css: styles?.content,
|
|
107
116
|
maxHeight: maxHeight,
|
|
108
117
|
minHeight: minHeight,
|
|
109
118
|
as: "div",
|
|
@@ -114,14 +123,6 @@ let Panel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
|
114
123
|
})
|
|
115
124
|
});
|
|
116
125
|
}
|
|
117
|
-
}
|
|
118
|
-
isDisabled: false,
|
|
119
|
-
textAlign: 'start',
|
|
120
|
-
variant: 'default',
|
|
121
|
-
isSelected: false,
|
|
122
|
-
padding: 'small',
|
|
123
|
-
active: false,
|
|
124
|
-
unmountOnExit: true
|
|
125
|
-
}, _Panel)) || _class);
|
|
126
|
+
}) || _class);
|
|
126
127
|
export default Panel;
|
|
127
128
|
export { Panel };
|
|
@@ -33,9 +33,13 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props, state) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const {
|
|
37
|
+
maxHeight,
|
|
38
|
+
isSelected
|
|
39
|
+
} = props;
|
|
40
|
+
const {
|
|
41
|
+
isHidden
|
|
42
|
+
} = state;
|
|
39
43
|
return {
|
|
40
44
|
panel: {
|
|
41
45
|
label: 'panel',
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
colors
|
|
34
|
-
borders
|
|
35
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
typography,
|
|
33
|
+
colors,
|
|
34
|
+
borders,
|
|
35
|
+
key: themeName
|
|
36
|
+
} = theme;
|
|
36
37
|
const themeSpecificStyle = {
|
|
37
38
|
canvas: {
|
|
38
39
|
color: theme['ic-brand-font-color-dark'],
|
|
@@ -40,15 +41,15 @@ const generateComponentTheme = theme => {
|
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
const componentVariables = {
|
|
43
|
-
fontSize: typography
|
|
44
|
-
fontFamily: typography
|
|
45
|
-
fontWeight: typography
|
|
46
|
-
lineHeight: typography
|
|
47
|
-
color: colors
|
|
48
|
-
background: colors
|
|
49
|
-
borderColor: colors
|
|
50
|
-
borderWidth: borders
|
|
51
|
-
borderStyle: borders
|
|
44
|
+
fontSize: typography?.fontSizeMedium,
|
|
45
|
+
fontFamily: typography?.fontFamily,
|
|
46
|
+
fontWeight: typography?.fontWeightNormal,
|
|
47
|
+
lineHeight: typography?.lineHeight,
|
|
48
|
+
color: colors?.contrasts?.grey125125,
|
|
49
|
+
background: colors?.contrasts?.white1010,
|
|
50
|
+
borderColor: colors?.contrasts?.grey3045,
|
|
51
|
+
borderWidth: borders?.widthSmall,
|
|
52
|
+
borderStyle: borders?.style,
|
|
52
53
|
defaultOverflowY: 'auto',
|
|
53
54
|
focusOutlineColor: colors.contrasts.blue4570
|
|
54
55
|
};
|
package/es/Tabs/v1/Tab/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["id", "variant", "isSelected", "isDisabled", "controls", "children", "styles"];
|
|
3
|
-
var _dec, _class, _Tab;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -39,60 +37,66 @@ id: Tabs.Tab
|
|
|
39
37
|
---
|
|
40
38
|
**/
|
|
41
39
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
42
|
-
let Tab = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (isDisabled) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (typeof onClick === 'function') {
|
|
55
|
-
onClick(event, {
|
|
56
|
-
index,
|
|
57
|
-
id
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
this.handleKeyDown = event => {
|
|
62
|
-
const _this$props2 = this.props,
|
|
63
|
-
onKeyDown = _this$props2.onKeyDown,
|
|
64
|
-
index = _this$props2.index,
|
|
65
|
-
id = _this$props2.id,
|
|
66
|
-
isDisabled = _this$props2.isDisabled;
|
|
67
|
-
if (isDisabled) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (typeof onKeyDown === 'function') {
|
|
71
|
-
onKeyDown(event, {
|
|
72
|
-
index,
|
|
73
|
-
id
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
40
|
+
let Tab = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Tab extends Component {
|
|
41
|
+
static displayName = "Tab";
|
|
42
|
+
static componentId = 'Tabs.Tab';
|
|
43
|
+
static allowedProps = allowedProps;
|
|
44
|
+
static defaultProps = {
|
|
45
|
+
variant: 'default',
|
|
46
|
+
isDisabled: false,
|
|
47
|
+
isSelected: false
|
|
48
|
+
};
|
|
78
49
|
componentDidMount() {
|
|
79
|
-
|
|
80
|
-
(_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
|
|
50
|
+
this.props.makeStyles?.();
|
|
81
51
|
}
|
|
82
52
|
componentDidUpdate() {
|
|
83
|
-
|
|
84
|
-
(_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
|
|
53
|
+
this.props.makeStyles?.();
|
|
85
54
|
}
|
|
55
|
+
handleClick = event => {
|
|
56
|
+
const {
|
|
57
|
+
onClick,
|
|
58
|
+
index,
|
|
59
|
+
id,
|
|
60
|
+
isDisabled
|
|
61
|
+
} = this.props;
|
|
62
|
+
if (isDisabled) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (typeof onClick === 'function') {
|
|
66
|
+
onClick(event, {
|
|
67
|
+
index,
|
|
68
|
+
id
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
handleKeyDown = event => {
|
|
73
|
+
const {
|
|
74
|
+
onKeyDown,
|
|
75
|
+
index,
|
|
76
|
+
id,
|
|
77
|
+
isDisabled
|
|
78
|
+
} = this.props;
|
|
79
|
+
if (isDisabled) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (typeof onKeyDown === 'function') {
|
|
83
|
+
onKeyDown(event, {
|
|
84
|
+
index,
|
|
85
|
+
id
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
86
89
|
render() {
|
|
87
|
-
const
|
|
88
|
-
id
|
|
89
|
-
variant
|
|
90
|
-
isSelected
|
|
91
|
-
isDisabled
|
|
92
|
-
controls
|
|
93
|
-
children
|
|
94
|
-
styles
|
|
95
|
-
props
|
|
90
|
+
const {
|
|
91
|
+
id,
|
|
92
|
+
variant,
|
|
93
|
+
isSelected,
|
|
94
|
+
isDisabled,
|
|
95
|
+
controls,
|
|
96
|
+
children,
|
|
97
|
+
styles,
|
|
98
|
+
...props
|
|
99
|
+
} = this.props;
|
|
96
100
|
return _jsx(View, {
|
|
97
101
|
...passthroughProps(props),
|
|
98
102
|
as: "div",
|
|
@@ -100,20 +104,16 @@ let Tab = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
100
104
|
id: id,
|
|
101
105
|
onClick: this.handleClick,
|
|
102
106
|
onKeyDown: this.handleKeyDown,
|
|
103
|
-
css: styles
|
|
104
|
-
"aria-selected": isSelected ? 'true' :
|
|
105
|
-
"aria-disabled": isDisabled ? 'true' :
|
|
107
|
+
css: styles?.tab,
|
|
108
|
+
"aria-selected": isSelected ? 'true' : undefined,
|
|
109
|
+
"aria-disabled": isDisabled ? 'true' : undefined,
|
|
106
110
|
"aria-controls": controls,
|
|
107
|
-
tabIndex: isSelected && !isDisabled ? 0 :
|
|
111
|
+
tabIndex: isSelected && !isDisabled ? 0 : undefined,
|
|
108
112
|
position: "relative",
|
|
109
113
|
focusPosition: "inset",
|
|
110
114
|
children: callRenderProp(children)
|
|
111
115
|
});
|
|
112
116
|
}
|
|
113
|
-
}
|
|
114
|
-
variant: 'default',
|
|
115
|
-
isDisabled: false,
|
|
116
|
-
isSelected: false
|
|
117
|
-
}, _Tab)) || _class);
|
|
117
|
+
}) || _class);
|
|
118
118
|
export default Tab;
|
|
119
119
|
export { Tab };
|
package/es/Tabs/v1/Tab/styles.js
CHANGED
|
@@ -42,10 +42,12 @@ const selectedTab = keyframes`
|
|
|
42
42
|
* @return {Object} The final style object, which will be used in the component
|
|
43
43
|
*/
|
|
44
44
|
const generateStyle = (componentTheme, props) => {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
const {
|
|
46
|
+
variant,
|
|
47
|
+
isSelected,
|
|
48
|
+
isDisabled,
|
|
49
|
+
isOverflowScroll
|
|
50
|
+
} = props;
|
|
49
51
|
const variants = {
|
|
50
52
|
default: {
|
|
51
53
|
padding: '1rem 1.25rem',
|
package/es/Tabs/v1/Tab/theme.js
CHANGED
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
typography
|
|
34
|
-
stacking
|
|
35
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
colors,
|
|
33
|
+
typography,
|
|
34
|
+
stacking,
|
|
35
|
+
key: themeName
|
|
36
|
+
} = theme;
|
|
36
37
|
const themeSpecificStyle = {
|
|
37
38
|
canvas: {
|
|
38
39
|
defaultColor: theme['ic-brand-font-color-dark'],
|
|
@@ -41,17 +42,17 @@ const generateComponentTheme = theme => {
|
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
const componentVariables = {
|
|
44
|
-
fontFamily: typography
|
|
45
|
-
fontWeight: typography
|
|
46
|
-
lineHeight: typography
|
|
47
|
-
fontSize: typography
|
|
48
|
-
defaultColor: colors
|
|
49
|
-
defaultHoverBorderColor: colors
|
|
50
|
-
defaultSelectedBorderColor: colors
|
|
51
|
-
secondaryColor: colors
|
|
52
|
-
secondarySelectedBackground: colors
|
|
53
|
-
secondarySelectedBorderColor: colors
|
|
54
|
-
zIndex: stacking
|
|
45
|
+
fontFamily: typography?.fontFamily,
|
|
46
|
+
fontWeight: typography?.fontWeightNormal,
|
|
47
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
48
|
+
fontSize: typography?.fontSizeMedium,
|
|
49
|
+
defaultColor: colors?.contrasts?.grey125125,
|
|
50
|
+
defaultHoverBorderColor: colors?.contrasts?.grey1214,
|
|
51
|
+
defaultSelectedBorderColor: colors?.contrasts?.blue4570,
|
|
52
|
+
secondaryColor: colors?.contrasts?.grey125125,
|
|
53
|
+
secondarySelectedBackground: colors?.contrasts?.white1010,
|
|
54
|
+
secondarySelectedBorderColor: colors?.contrasts?.grey3045,
|
|
55
|
+
zIndex: stacking?.above
|
|
55
56
|
};
|
|
56
57
|
return {
|
|
57
58
|
...componentVariables,
|