@instructure/ui-tabs 8.9.2-snapshot.7 → 8.10.1-snapshot.8
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 +10 -0
- package/es/Tabs/Panel/styles.js +11 -2
- package/es/Tabs/index.js +8 -4
- package/es/Tabs/props.js +2 -1
- package/es/Tabs/styles.js +19 -1
- package/lib/Tabs/Panel/styles.js +11 -2
- package/lib/Tabs/index.js +8 -4
- package/lib/Tabs/props.js +2 -1
- package/lib/Tabs/styles.js +19 -1
- package/package.json +21 -21
- package/src/Tabs/Panel/props.ts +11 -4
- package/src/Tabs/Panel/styles.ts +13 -5
- package/src/Tabs/README.md +101 -3
- package/src/Tabs/Tab/props.ts +7 -4
- package/src/Tabs/Tab/styles.ts +4 -3
- package/src/Tabs/index.tsx +12 -4
- package/src/Tabs/props.ts +25 -5
- package/src/Tabs/styles.ts +26 -4
- package/types/Tabs/Panel/props.d.ts +5 -4
- package/types/Tabs/Panel/props.d.ts.map +1 -1
- package/types/Tabs/Panel/styles.d.ts +3 -26
- package/types/Tabs/Panel/styles.d.ts.map +1 -1
- package/types/Tabs/Tab/index.d.ts +12 -0
- package/types/Tabs/Tab/index.d.ts.map +1 -1
- package/types/Tabs/Tab/props.d.ts +5 -4
- package/types/Tabs/Tab/props.d.ts.map +1 -1
- package/types/Tabs/Tab/styles.d.ts +3 -3
- package/types/Tabs/Tab/styles.d.ts.map +1 -1
- package/types/Tabs/index.d.ts +2 -0
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/Tabs/props.d.ts +6 -4
- package/types/Tabs/props.d.ts.map +1 -1
- package/types/Tabs/styles.d.ts +3 -71
- package/types/Tabs/styles.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
# [8.10.0](https://github.com/instructure/instructure-ui/compare/v8.9.1...v8.10.0) (2021-09-28)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **ui-tabs:** Fix small typo in ui-tabs readme ([6a2a770](https://github.com/instructure/instructure-ui/commit/6a2a7703791c742cbc3ea00dc66ccec21f2810d6))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **ui-tabs:** add 'fixHeight' prop to Tabs ([b63e6e7](https://github.com/instructure/instructure-ui/commit/b63e6e71705efa7880195ea1e40b3eac67db06b9))
|
|
15
|
+
|
|
6
16
|
## [8.9.1](https://github.com/instructure/instructure-ui/compare/v8.9.0...v8.9.1) (2021-09-16)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @instructure/ui-tabs
|
package/es/Tabs/Panel/styles.js
CHANGED
|
@@ -33,20 +33,28 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props) => {
|
|
36
|
-
const maxHeight = props.maxHeight
|
|
36
|
+
const maxHeight = props.maxHeight,
|
|
37
|
+
isSelected = props.isSelected;
|
|
37
38
|
return {
|
|
38
39
|
panel: {
|
|
39
40
|
label: 'panel',
|
|
40
41
|
boxSizing: 'border-box',
|
|
42
|
+
flexShrink: 0,
|
|
43
|
+
flexGrow: 0,
|
|
41
44
|
fontFamily: componentTheme.fontFamily,
|
|
42
45
|
fontWeight: componentTheme.fontWeight,
|
|
43
46
|
lineHeight: componentTheme.lineHeight,
|
|
44
|
-
fontSize: componentTheme.fontSize
|
|
47
|
+
fontSize: componentTheme.fontSize,
|
|
48
|
+
...(isSelected && {
|
|
49
|
+
flexGrow: 1,
|
|
50
|
+
height: '100%'
|
|
51
|
+
})
|
|
45
52
|
},
|
|
46
53
|
content: {
|
|
47
54
|
label: 'panel__content',
|
|
48
55
|
boxSizing: 'border-box',
|
|
49
56
|
width: '100%',
|
|
57
|
+
height: '100%',
|
|
50
58
|
borderWidth: componentTheme.borderWidth,
|
|
51
59
|
borderStyle: componentTheme.borderStyle,
|
|
52
60
|
background: componentTheme.background,
|
|
@@ -55,6 +63,7 @@ const generateStyle = (componentTheme, props) => {
|
|
|
55
63
|
borderLeft: 'none',
|
|
56
64
|
borderRight: 'none',
|
|
57
65
|
borderBottom: 'none',
|
|
66
|
+
overflowY: 'auto',
|
|
58
67
|
...(maxHeight && {
|
|
59
68
|
overflow: 'auto'
|
|
60
69
|
})
|
package/es/Tabs/index.js
CHANGED
|
@@ -284,7 +284,9 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = bid
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
clonePanel(index, generatedId, selected, panel) {
|
|
287
|
-
const id = panel.props.id || generatedId;
|
|
287
|
+
const id = panel.props.id || generatedId; // fixHeight can be 0, so simply `fixheight` could return falsy value
|
|
288
|
+
|
|
289
|
+
const hasFixedHeight = typeof this.props.fixHeight !== 'undefined';
|
|
288
290
|
return safeCloneElement(panel, {
|
|
289
291
|
id: panel.props.id || `panel-${id}`,
|
|
290
292
|
labelledBy: `tab-${id}`,
|
|
@@ -293,8 +295,8 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = bid
|
|
|
293
295
|
variant: this.props.variant,
|
|
294
296
|
padding: panel.props.padding || this.props.padding,
|
|
295
297
|
textAlign: panel.props.textAlign || this.props.textAlign,
|
|
296
|
-
maxHeight: panel.maxHeight || this.props.maxHeight,
|
|
297
|
-
minHeight: panel.minHeight || this.props.minHeight
|
|
298
|
+
maxHeight: panel.maxHeight || (!hasFixedHeight ? this.props.maxHeight : void 0),
|
|
299
|
+
minHeight: panel.minHeight || (!hasFixedHeight ? this.props.minHeight : '100%')
|
|
298
300
|
});
|
|
299
301
|
}
|
|
300
302
|
|
|
@@ -366,7 +368,9 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = bid
|
|
|
366
368
|
css: styles === null || styles === void 0 ? void 0 : styles.tabList,
|
|
367
369
|
"aria-label": screenReaderLabel,
|
|
368
370
|
elementRef: this.handleTabListRef
|
|
369
|
-
}, tabs, withScrollFade && scrollFadeEls))),
|
|
371
|
+
}, tabs, withScrollFade && scrollFadeEls))), jsx("div", {
|
|
372
|
+
css: styles === null || styles === void 0 ? void 0 : styles.panelsContainer
|
|
373
|
+
}, panels));
|
|
370
374
|
}
|
|
371
375
|
|
|
372
376
|
}, _class2.displayName = "Tabs", _class2.componentId = 'Tabs', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
|
package/es/Tabs/props.js
CHANGED
|
@@ -44,6 +44,7 @@ const propTypes = {
|
|
|
44
44
|
maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
45
45
|
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
46
46
|
minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
47
|
+
fixHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
@@ -68,5 +69,5 @@ const propTypes = {
|
|
|
68
69
|
tabOverflow: PropTypes.oneOf(['stack', 'scroll']),
|
|
69
70
|
shouldFocusOnRender: PropTypes.bool
|
|
70
71
|
};
|
|
71
|
-
const allowedProps = ['children', 'variant', 'screenReaderLabel', 'onRequestTabChange', 'maxWidth', 'maxHeight', 'minHeight', 'margin', 'padding', 'textAlign', 'elementRef', 'tabOverflow', 'shouldFocusOnRender'];
|
|
72
|
+
const allowedProps = ['children', 'variant', 'screenReaderLabel', 'onRequestTabChange', 'maxWidth', 'maxHeight', 'minHeight', 'fixHeight', 'margin', 'padding', 'textAlign', 'elementRef', 'tabOverflow', 'shouldFocusOnRender'];
|
|
72
73
|
export { propTypes, allowedProps };
|
package/es/Tabs/styles.js
CHANGED
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props) => {
|
|
36
36
|
const variant = props.variant,
|
|
37
|
-
tabOverflow = props.tabOverflow
|
|
37
|
+
tabOverflow = props.tabOverflow,
|
|
38
|
+
fixHeight = props.fixHeight; // fixHeight can be 0, so simply `fixheight` could return falsy value
|
|
39
|
+
|
|
40
|
+
const hasFixedHeight = typeof fixHeight !== 'undefined';
|
|
38
41
|
const variants = {
|
|
39
42
|
default: {
|
|
40
43
|
container: {
|
|
@@ -84,10 +87,15 @@ const generateStyle = (componentTheme, props) => {
|
|
|
84
87
|
return {
|
|
85
88
|
tabs: {
|
|
86
89
|
label: 'tabs',
|
|
90
|
+
flexShrink: 0,
|
|
91
|
+
flexGrow: 0,
|
|
87
92
|
...variants[variant].tabs
|
|
88
93
|
},
|
|
89
94
|
container: {
|
|
90
95
|
label: 'tabs__container',
|
|
96
|
+
display: 'flex',
|
|
97
|
+
flexDirection: 'column',
|
|
98
|
+
height: fixHeight,
|
|
91
99
|
...variants[variant].container
|
|
92
100
|
},
|
|
93
101
|
tabList: {
|
|
@@ -96,6 +104,16 @@ const generateStyle = (componentTheme, props) => {
|
|
|
96
104
|
width: '100%',
|
|
97
105
|
...tabOverflowVariants[tabOverflow]
|
|
98
106
|
},
|
|
107
|
+
panelsContainer: {
|
|
108
|
+
label: 'tabs__panelsContainer',
|
|
109
|
+
flexShrink: 1,
|
|
110
|
+
flexGrow: 1,
|
|
111
|
+
display: 'flex',
|
|
112
|
+
flexDirection: 'column',
|
|
113
|
+
...(hasFixedHeight && {
|
|
114
|
+
overflowY: 'hidden'
|
|
115
|
+
})
|
|
116
|
+
},
|
|
99
117
|
scrollOverlay: {
|
|
100
118
|
label: 'tabs__scrollOverlay',
|
|
101
119
|
height: `calc(100% - (${componentTheme.tabVerticalOffset} + 0.25rem))`,
|
package/lib/Tabs/Panel/styles.js
CHANGED
|
@@ -40,20 +40,28 @@ exports.default = void 0;
|
|
|
40
40
|
* @return {Object} The final style object, which will be used in the component
|
|
41
41
|
*/
|
|
42
42
|
const generateStyle = (componentTheme, props) => {
|
|
43
|
-
const maxHeight = props.maxHeight
|
|
43
|
+
const maxHeight = props.maxHeight,
|
|
44
|
+
isSelected = props.isSelected;
|
|
44
45
|
return {
|
|
45
46
|
panel: {
|
|
46
47
|
label: 'panel',
|
|
47
48
|
boxSizing: 'border-box',
|
|
49
|
+
flexShrink: 0,
|
|
50
|
+
flexGrow: 0,
|
|
48
51
|
fontFamily: componentTheme.fontFamily,
|
|
49
52
|
fontWeight: componentTheme.fontWeight,
|
|
50
53
|
lineHeight: componentTheme.lineHeight,
|
|
51
|
-
fontSize: componentTheme.fontSize
|
|
54
|
+
fontSize: componentTheme.fontSize,
|
|
55
|
+
...(isSelected && {
|
|
56
|
+
flexGrow: 1,
|
|
57
|
+
height: '100%'
|
|
58
|
+
})
|
|
52
59
|
},
|
|
53
60
|
content: {
|
|
54
61
|
label: 'panel__content',
|
|
55
62
|
boxSizing: 'border-box',
|
|
56
63
|
width: '100%',
|
|
64
|
+
height: '100%',
|
|
57
65
|
borderWidth: componentTheme.borderWidth,
|
|
58
66
|
borderStyle: componentTheme.borderStyle,
|
|
59
67
|
background: componentTheme.background,
|
|
@@ -62,6 +70,7 @@ const generateStyle = (componentTheme, props) => {
|
|
|
62
70
|
borderLeft: 'none',
|
|
63
71
|
borderRight: 'none',
|
|
64
72
|
borderBottom: 'none',
|
|
73
|
+
overflowY: 'auto',
|
|
65
74
|
...(maxHeight && {
|
|
66
75
|
overflow: 'auto'
|
|
67
76
|
})
|
package/lib/Tabs/index.js
CHANGED
|
@@ -299,7 +299,9 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
clonePanel(index, generatedId, selected, panel) {
|
|
302
|
-
const id = panel.props.id || generatedId;
|
|
302
|
+
const id = panel.props.id || generatedId; // fixHeight can be 0, so simply `fixheight` could return falsy value
|
|
303
|
+
|
|
304
|
+
const hasFixedHeight = typeof this.props.fixHeight !== 'undefined';
|
|
303
305
|
return (0, _safeCloneElement.safeCloneElement)(panel, {
|
|
304
306
|
id: panel.props.id || `panel-${id}`,
|
|
305
307
|
labelledBy: `tab-${id}`,
|
|
@@ -308,8 +310,8 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
308
310
|
variant: this.props.variant,
|
|
309
311
|
padding: panel.props.padding || this.props.padding,
|
|
310
312
|
textAlign: panel.props.textAlign || this.props.textAlign,
|
|
311
|
-
maxHeight: panel.maxHeight || this.props.maxHeight,
|
|
312
|
-
minHeight: panel.minHeight || this.props.minHeight
|
|
313
|
+
maxHeight: panel.maxHeight || (!hasFixedHeight ? this.props.maxHeight : void 0),
|
|
314
|
+
minHeight: panel.minHeight || (!hasFixedHeight ? this.props.minHeight : '100%')
|
|
313
315
|
});
|
|
314
316
|
}
|
|
315
317
|
|
|
@@ -383,7 +385,9 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
383
385
|
css: styles === null || styles === void 0 ? void 0 : styles.tabList,
|
|
384
386
|
"aria-label": screenReaderLabel,
|
|
385
387
|
elementRef: this.handleTabListRef
|
|
386
|
-
}, tabs, withScrollFade && scrollFadeEls))),
|
|
388
|
+
}, tabs, withScrollFade && scrollFadeEls))), (0, _emotion.jsx)("div", {
|
|
389
|
+
css: styles === null || styles === void 0 ? void 0 : styles.panelsContainer
|
|
390
|
+
}, panels));
|
|
387
391
|
}
|
|
388
392
|
|
|
389
393
|
}, _class2.displayName = "Tabs", _class2.componentId = 'Tabs', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
package/lib/Tabs/props.js
CHANGED
|
@@ -57,6 +57,7 @@ const propTypes = {
|
|
|
57
57
|
maxWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
58
58
|
maxHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
59
59
|
minHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
60
|
+
fixHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
60
61
|
|
|
61
62
|
/**
|
|
62
63
|
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
@@ -82,5 +83,5 @@ const propTypes = {
|
|
|
82
83
|
shouldFocusOnRender: _propTypes.default.bool
|
|
83
84
|
};
|
|
84
85
|
exports.propTypes = propTypes;
|
|
85
|
-
const allowedProps = ['children', 'variant', 'screenReaderLabel', 'onRequestTabChange', 'maxWidth', 'maxHeight', 'minHeight', 'margin', 'padding', 'textAlign', 'elementRef', 'tabOverflow', 'shouldFocusOnRender'];
|
|
86
|
+
const allowedProps = ['children', 'variant', 'screenReaderLabel', 'onRequestTabChange', 'maxWidth', 'maxHeight', 'minHeight', 'fixHeight', 'margin', 'padding', 'textAlign', 'elementRef', 'tabOverflow', 'shouldFocusOnRender'];
|
|
86
87
|
exports.allowedProps = allowedProps;
|
package/lib/Tabs/styles.js
CHANGED
|
@@ -41,7 +41,10 @@ exports.default = void 0;
|
|
|
41
41
|
*/
|
|
42
42
|
const generateStyle = (componentTheme, props) => {
|
|
43
43
|
const variant = props.variant,
|
|
44
|
-
tabOverflow = props.tabOverflow
|
|
44
|
+
tabOverflow = props.tabOverflow,
|
|
45
|
+
fixHeight = props.fixHeight; // fixHeight can be 0, so simply `fixheight` could return falsy value
|
|
46
|
+
|
|
47
|
+
const hasFixedHeight = typeof fixHeight !== 'undefined';
|
|
45
48
|
const variants = {
|
|
46
49
|
default: {
|
|
47
50
|
container: {
|
|
@@ -91,10 +94,15 @@ const generateStyle = (componentTheme, props) => {
|
|
|
91
94
|
return {
|
|
92
95
|
tabs: {
|
|
93
96
|
label: 'tabs',
|
|
97
|
+
flexShrink: 0,
|
|
98
|
+
flexGrow: 0,
|
|
94
99
|
...variants[variant].tabs
|
|
95
100
|
},
|
|
96
101
|
container: {
|
|
97
102
|
label: 'tabs__container',
|
|
103
|
+
display: 'flex',
|
|
104
|
+
flexDirection: 'column',
|
|
105
|
+
height: fixHeight,
|
|
98
106
|
...variants[variant].container
|
|
99
107
|
},
|
|
100
108
|
tabList: {
|
|
@@ -103,6 +111,16 @@ const generateStyle = (componentTheme, props) => {
|
|
|
103
111
|
width: '100%',
|
|
104
112
|
...tabOverflowVariants[tabOverflow]
|
|
105
113
|
},
|
|
114
|
+
panelsContainer: {
|
|
115
|
+
label: 'tabs__panelsContainer',
|
|
116
|
+
flexShrink: 1,
|
|
117
|
+
flexGrow: 1,
|
|
118
|
+
display: 'flex',
|
|
119
|
+
flexDirection: 'column',
|
|
120
|
+
...(hasFixedHeight && {
|
|
121
|
+
overflowY: 'hidden'
|
|
122
|
+
})
|
|
123
|
+
},
|
|
106
124
|
scrollOverlay: {
|
|
107
125
|
label: 'tabs__scrollOverlay',
|
|
108
126
|
height: `calc(100% - (${componentTheme.tabVerticalOffset} + 0.25rem))`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tabs",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.1-snapshot.8+21f46f4e3",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -24,28 +24,28 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@instructure/ui-babel-preset": "8.
|
|
28
|
-
"@instructure/ui-color-utils": "8.
|
|
29
|
-
"@instructure/ui-test-locator": "8.
|
|
30
|
-
"@instructure/ui-test-utils": "8.
|
|
31
|
-
"@instructure/ui-themes": "8.
|
|
27
|
+
"@instructure/ui-babel-preset": "8.10.1-snapshot.8+21f46f4e3",
|
|
28
|
+
"@instructure/ui-color-utils": "8.10.1-snapshot.8+21f46f4e3",
|
|
29
|
+
"@instructure/ui-test-locator": "8.10.1-snapshot.8+21f46f4e3",
|
|
30
|
+
"@instructure/ui-test-utils": "8.10.1-snapshot.8+21f46f4e3",
|
|
31
|
+
"@instructure/ui-themes": "8.10.1-snapshot.8+21f46f4e3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.13.10",
|
|
35
|
-
"@instructure/console": "8.
|
|
36
|
-
"@instructure/debounce": "8.
|
|
37
|
-
"@instructure/emotion": "8.
|
|
38
|
-
"@instructure/shared-types": "8.
|
|
39
|
-
"@instructure/ui-dom-utils": "8.
|
|
40
|
-
"@instructure/ui-focusable": "8.
|
|
41
|
-
"@instructure/ui-i18n": "8.
|
|
42
|
-
"@instructure/ui-motion": "8.
|
|
43
|
-
"@instructure/ui-prop-types": "8.
|
|
44
|
-
"@instructure/ui-react-utils": "8.
|
|
45
|
-
"@instructure/ui-testable": "8.
|
|
46
|
-
"@instructure/ui-utils": "8.
|
|
47
|
-
"@instructure/ui-view": "8.
|
|
48
|
-
"@instructure/uid": "8.
|
|
35
|
+
"@instructure/console": "8.10.1-snapshot.8+21f46f4e3",
|
|
36
|
+
"@instructure/debounce": "8.10.1-snapshot.8+21f46f4e3",
|
|
37
|
+
"@instructure/emotion": "8.10.1-snapshot.8+21f46f4e3",
|
|
38
|
+
"@instructure/shared-types": "8.10.1-snapshot.8+21f46f4e3",
|
|
39
|
+
"@instructure/ui-dom-utils": "8.10.1-snapshot.8+21f46f4e3",
|
|
40
|
+
"@instructure/ui-focusable": "8.10.1-snapshot.8+21f46f4e3",
|
|
41
|
+
"@instructure/ui-i18n": "8.10.1-snapshot.8+21f46f4e3",
|
|
42
|
+
"@instructure/ui-motion": "8.10.1-snapshot.8+21f46f4e3",
|
|
43
|
+
"@instructure/ui-prop-types": "8.10.1-snapshot.8+21f46f4e3",
|
|
44
|
+
"@instructure/ui-react-utils": "8.10.1-snapshot.8+21f46f4e3",
|
|
45
|
+
"@instructure/ui-testable": "8.10.1-snapshot.8+21f46f4e3",
|
|
46
|
+
"@instructure/ui-utils": "8.10.1-snapshot.8+21f46f4e3",
|
|
47
|
+
"@instructure/ui-view": "8.10.1-snapshot.8+21f46f4e3",
|
|
48
|
+
"@instructure/uid": "8.10.1-snapshot.8+21f46f4e3",
|
|
49
49
|
"keycode": "^2",
|
|
50
50
|
"prop-types": "^15"
|
|
51
51
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"sideEffects": false,
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "21f46f4e342898b019ab943a7e69a455621d9576"
|
|
60
60
|
}
|
package/src/Tabs/Panel/props.ts
CHANGED
|
@@ -27,8 +27,12 @@ import PropTypes from 'prop-types'
|
|
|
27
27
|
|
|
28
28
|
import { ThemeablePropTypes } from '@instructure/emotion'
|
|
29
29
|
|
|
30
|
-
import type {
|
|
31
|
-
|
|
30
|
+
import type {
|
|
31
|
+
Spacing,
|
|
32
|
+
WithStyleProps,
|
|
33
|
+
ComponentStyle
|
|
34
|
+
} from '@instructure/emotion'
|
|
35
|
+
import type { PropValidators, TabsPanelTheme } from '@instructure/shared-types'
|
|
32
36
|
|
|
33
37
|
type TabsPanelOwnProps = {
|
|
34
38
|
renderTitle: React.ReactNode | ((...args: any[]) => any)
|
|
@@ -49,7 +53,10 @@ type PropKeys = keyof TabsPanelOwnProps
|
|
|
49
53
|
|
|
50
54
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
51
55
|
|
|
52
|
-
type TabsPanelProps = TabsPanelOwnProps &
|
|
56
|
+
type TabsPanelProps = TabsPanelOwnProps &
|
|
57
|
+
WithStyleProps<TabsPanelTheme, TabsPanelStyle>
|
|
58
|
+
|
|
59
|
+
type TabsPanelStyle = ComponentStyle<'panel' | 'content'>
|
|
53
60
|
|
|
54
61
|
const propTypes: PropValidators<PropKeys> = {
|
|
55
62
|
/**
|
|
@@ -85,5 +92,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
85
92
|
'elementRef'
|
|
86
93
|
]
|
|
87
94
|
|
|
88
|
-
export type { TabsPanelProps }
|
|
95
|
+
export type { TabsPanelProps, TabsPanelStyle }
|
|
89
96
|
export { propTypes, allowedProps }
|
package/src/Tabs/Panel/styles.ts
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { TabsPanelTheme } from '@instructure/shared-types'
|
|
26
|
-
import { TabsPanelProps } from './props'
|
|
25
|
+
import type { TabsPanelTheme } from '@instructure/shared-types'
|
|
26
|
+
import type { TabsPanelProps, TabsPanelStyle } from './props'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* ---
|
|
@@ -38,22 +38,29 @@ import { TabsPanelProps } from './props'
|
|
|
38
38
|
const generateStyle = (
|
|
39
39
|
componentTheme: TabsPanelTheme,
|
|
40
40
|
props: TabsPanelProps
|
|
41
|
-
) => {
|
|
42
|
-
const { maxHeight } = props
|
|
41
|
+
): TabsPanelStyle => {
|
|
42
|
+
const { maxHeight, isSelected } = props
|
|
43
43
|
|
|
44
44
|
return {
|
|
45
45
|
panel: {
|
|
46
46
|
label: 'panel',
|
|
47
47
|
boxSizing: 'border-box',
|
|
48
|
+
flexShrink: 0,
|
|
49
|
+
flexGrow: 0,
|
|
48
50
|
fontFamily: componentTheme.fontFamily,
|
|
49
51
|
fontWeight: componentTheme.fontWeight,
|
|
50
52
|
lineHeight: componentTheme.lineHeight,
|
|
51
|
-
fontSize: componentTheme.fontSize
|
|
53
|
+
fontSize: componentTheme.fontSize,
|
|
54
|
+
...(isSelected && {
|
|
55
|
+
flexGrow: 1,
|
|
56
|
+
height: '100%'
|
|
57
|
+
})
|
|
52
58
|
},
|
|
53
59
|
content: {
|
|
54
60
|
label: 'panel__content',
|
|
55
61
|
boxSizing: 'border-box',
|
|
56
62
|
width: '100%',
|
|
63
|
+
height: '100%',
|
|
57
64
|
borderWidth: componentTheme.borderWidth,
|
|
58
65
|
borderStyle: componentTheme.borderStyle,
|
|
59
66
|
background: componentTheme.background,
|
|
@@ -62,6 +69,7 @@ const generateStyle = (
|
|
|
62
69
|
borderLeft: 'none',
|
|
63
70
|
borderRight: 'none',
|
|
64
71
|
borderBottom: 'none',
|
|
72
|
+
overflowY: 'auto',
|
|
65
73
|
...(maxHeight && { overflow: 'auto' })
|
|
66
74
|
}
|
|
67
75
|
}
|
package/src/Tabs/README.md
CHANGED
|
@@ -4,8 +4,6 @@ describes: Tabs
|
|
|
4
4
|
|
|
5
5
|
`<Tabs />` is an accessible tabbed navigation component. Use the TAB key to focus the component and arrow keys to navigate between panels of content. To set a default panel that should be selected on initial render, set the `selected` prop on that `<Tabs.Panel>`.
|
|
6
6
|
|
|
7
|
-
To restrict the width of `<Tabs />`, use the `maxWidth` prop. Add space around the entire component using the `margin` prop. Adjust the padding around the panel content via `padding` (default is `small`) on each `<Tabs.Panel>`. Restrict the height of the panel using `minHeight` or `maxHeight`. Finally, switch the text alignment of the panel content with `textAlign`.
|
|
8
|
-
|
|
9
7
|
```js
|
|
10
8
|
---
|
|
11
9
|
example: true
|
|
@@ -33,7 +31,7 @@ class Example extends React.Component {
|
|
|
33
31
|
renderTitle="Tab A"
|
|
34
32
|
textAlign="center"
|
|
35
33
|
padding="large"
|
|
36
|
-
|
|
34
|
+
isSelected={selectedIndex === 0}
|
|
37
35
|
>
|
|
38
36
|
<Button>Focus Me</Button>
|
|
39
37
|
</Tabs.Panel>
|
|
@@ -158,6 +156,106 @@ class Example extends React.Component {
|
|
|
158
156
|
render(<Example />)
|
|
159
157
|
```
|
|
160
158
|
|
|
159
|
+
### Controlling the size and the spacing
|
|
160
|
+
|
|
161
|
+
To restrict the width of `<Tabs />`, use the `maxWidth` prop. Add space around the entire component using the `margin` prop. Adjust the padding around the panel content via `padding` (default is `small`) on each `<Tabs.Panel>`.
|
|
162
|
+
|
|
163
|
+
Set the height of the Tabs component with the `fixHeight` property (set to '100%' to fill out it's parent element). You can also restrict the height of the **panels** using the `minHeight` and `maxHeight` properties (they don't work if you set `fixHeight` on the whole Tabs component).
|
|
164
|
+
|
|
165
|
+
Finally, switch the text alignment of the panel content with `textAlign`.
|
|
166
|
+
|
|
167
|
+
```js
|
|
168
|
+
---
|
|
169
|
+
example: true
|
|
170
|
+
render: false
|
|
171
|
+
---
|
|
172
|
+
class Example extends React.Component {
|
|
173
|
+
constructor (props) {
|
|
174
|
+
super(props)
|
|
175
|
+
this.state = {
|
|
176
|
+
selectedIndex: 0,
|
|
177
|
+
heightOption: 'fixHeight: 100%'
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
this.heightOptions = {
|
|
181
|
+
['fixHeight: 100%']: { fixHeight: '100%' },
|
|
182
|
+
['fixHeight: 15rem']: { fixHeight: '15rem' },
|
|
183
|
+
['minHeight: 17rem']: { minHeight: '17rem' },
|
|
184
|
+
['maxHeight: 10rem']: { maxHeight: '10rem' }
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
handleTabChange = (event, { index, id }) => {
|
|
189
|
+
this.setState({
|
|
190
|
+
selectedIndex: index
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
handleHeightOptionSelect = (e, heightOption) => {
|
|
195
|
+
this.setState({ heightOption })
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
render () {
|
|
199
|
+
const { selectedIndex, heightOption } = this.state
|
|
200
|
+
const { heightOptions } = this
|
|
201
|
+
|
|
202
|
+
const containerProps = {
|
|
203
|
+
as: 'div',
|
|
204
|
+
...(heightOption.includes('fixHeight') && {
|
|
205
|
+
height: "22rem",
|
|
206
|
+
withVisualDebug: true
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<>
|
|
212
|
+
<View display="block" margin="none none medium">
|
|
213
|
+
<RadioInputGroup
|
|
214
|
+
name="tabsHeightOptions"
|
|
215
|
+
defaultValue="fixHeight: 100%"
|
|
216
|
+
description={<ScreenReaderContent>Tabs height selector</ScreenReaderContent>}
|
|
217
|
+
variant="toggle"
|
|
218
|
+
onChange={this.handleHeightOptionSelect}
|
|
219
|
+
>
|
|
220
|
+
{Object.keys(heightOptions).map((heightOption) => <RadioInput key={heightOption} label={heightOption} value={heightOption} />)}
|
|
221
|
+
</RadioInputGroup>
|
|
222
|
+
</View>
|
|
223
|
+
|
|
224
|
+
<View {...containerProps}>
|
|
225
|
+
<Tabs
|
|
226
|
+
margin="large auto"
|
|
227
|
+
padding="medium"
|
|
228
|
+
onRequestTabChange={this.handleTabChange}
|
|
229
|
+
{...heightOptions[heightOption]}
|
|
230
|
+
>
|
|
231
|
+
<Tabs.Panel
|
|
232
|
+
id="tabA"
|
|
233
|
+
renderTitle="Tab A"
|
|
234
|
+
textAlign="center"
|
|
235
|
+
padding="large"
|
|
236
|
+
iSelected={selectedIndex === 0}
|
|
237
|
+
>
|
|
238
|
+
<Button>Focus Me</Button>
|
|
239
|
+
</Tabs.Panel>
|
|
240
|
+
<Tabs.Panel id="tabB" renderTitle="Disabled Tab" isDisabled>
|
|
241
|
+
{lorem.paragraphs()}
|
|
242
|
+
</Tabs.Panel>
|
|
243
|
+
<Tabs.Panel id="tabC" renderTitle="Tab C" isSelected={selectedIndex === 2}>
|
|
244
|
+
{lorem.paragraphs()}
|
|
245
|
+
</Tabs.Panel>
|
|
246
|
+
<Tabs.Panel id="tabD" renderTitle="Tab D" isSelected={selectedIndex === 3}>
|
|
247
|
+
{lorem.paragraphs()}
|
|
248
|
+
</Tabs.Panel>
|
|
249
|
+
</Tabs>
|
|
250
|
+
</View>
|
|
251
|
+
</>
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
render(<Example />)
|
|
257
|
+
```
|
|
258
|
+
|
|
161
259
|
### Guidelines
|
|
162
260
|
|
|
163
261
|
```js
|
package/src/Tabs/Tab/props.ts
CHANGED
|
@@ -21,11 +21,12 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
+
|
|
24
25
|
import React from 'react'
|
|
25
26
|
import PropTypes from 'prop-types'
|
|
26
27
|
|
|
27
|
-
import type { PropValidators } from '@instructure/shared-types'
|
|
28
|
-
import type { WithStyleProps } from '@instructure/emotion'
|
|
28
|
+
import type { PropValidators, TabsTabTheme } from '@instructure/shared-types'
|
|
29
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
29
30
|
|
|
30
31
|
type TabsTabOwnProps = {
|
|
31
32
|
variant?: 'default' | 'secondary'
|
|
@@ -43,7 +44,9 @@ type PropKeys = keyof TabsTabOwnProps
|
|
|
43
44
|
|
|
44
45
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
45
46
|
|
|
46
|
-
type TabsTabProps = TabsTabOwnProps & WithStyleProps
|
|
47
|
+
type TabsTabProps = TabsTabOwnProps & WithStyleProps<TabsTabTheme, TabsTabStyle>
|
|
48
|
+
|
|
49
|
+
type TabsTabStyle = ComponentStyle<'tab'>
|
|
47
50
|
|
|
48
51
|
const propTypes: PropValidators<PropKeys> = {
|
|
49
52
|
variant: PropTypes.oneOf(['default', 'secondary']),
|
|
@@ -69,5 +72,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
69
72
|
'children'
|
|
70
73
|
]
|
|
71
74
|
|
|
72
|
-
export type { TabsTabProps }
|
|
75
|
+
export type { TabsTabProps, TabsTabStyle }
|
|
73
76
|
export { propTypes, allowedProps }
|
package/src/Tabs/Tab/styles.ts
CHANGED
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { keyframes } from '@instructure/emotion'
|
|
26
|
-
|
|
27
|
-
import {
|
|
26
|
+
|
|
27
|
+
import type { TabsTabTheme } from '@instructure/shared-types'
|
|
28
|
+
import type { TabsTabProps, TabsTabStyle } from './props'
|
|
28
29
|
|
|
29
30
|
// keyframes have to be outside of 'generateStyle',
|
|
30
31
|
// since it is causing problems in style recalculation
|
|
@@ -47,7 +48,7 @@ const selectedTab = keyframes`
|
|
|
47
48
|
const generateStyle = (
|
|
48
49
|
componentTheme: TabsTabTheme,
|
|
49
50
|
props: TabsTabProps
|
|
50
|
-
):
|
|
51
|
+
): TabsTabStyle => {
|
|
51
52
|
const { variant, isSelected, isDisabled } = props
|
|
52
53
|
|
|
53
54
|
const variants = {
|
package/src/Tabs/index.tsx
CHANGED
|
@@ -365,6 +365,9 @@ class Tabs extends Component<TabsProps> {
|
|
|
365
365
|
clonePanel(index, generatedId, selected, panel) {
|
|
366
366
|
const id = panel.props.id || generatedId
|
|
367
367
|
|
|
368
|
+
// fixHeight can be 0, so simply `fixheight` could return falsy value
|
|
369
|
+
const hasFixedHeight = typeof this.props.fixHeight !== 'undefined'
|
|
370
|
+
|
|
368
371
|
return safeCloneElement(panel, {
|
|
369
372
|
id: panel.props.id || `panel-${id}`,
|
|
370
373
|
labelledBy: `tab-${id}`,
|
|
@@ -373,8 +376,10 @@ class Tabs extends Component<TabsProps> {
|
|
|
373
376
|
variant: this.props.variant,
|
|
374
377
|
padding: panel.props.padding || this.props.padding,
|
|
375
378
|
textAlign: panel.props.textAlign || this.props.textAlign,
|
|
376
|
-
maxHeight:
|
|
377
|
-
|
|
379
|
+
maxHeight:
|
|
380
|
+
panel.maxHeight || (!hasFixedHeight ? this.props.maxHeight : undefined),
|
|
381
|
+
minHeight:
|
|
382
|
+
panel.minHeight || (!hasFixedHeight ? this.props.minHeight : '100%')
|
|
378
383
|
})
|
|
379
384
|
}
|
|
380
385
|
|
|
@@ -492,8 +497,11 @@ class Tabs extends Component<TabsProps> {
|
|
|
492
497
|
</View>
|
|
493
498
|
)}
|
|
494
499
|
</Focusable>
|
|
495
|
-
|
|
496
|
-
{
|
|
500
|
+
|
|
501
|
+
<div css={styles?.panelsContainer}>
|
|
502
|
+
{/* @ts-expect-error ts-migrate(7005) FIXME: Variable 'panels' implicitly has an 'any[]' type. */}
|
|
503
|
+
{panels}
|
|
504
|
+
</div>
|
|
497
505
|
</View>
|
|
498
506
|
)
|
|
499
507
|
}
|
package/src/Tabs/props.ts
CHANGED
|
@@ -29,8 +29,12 @@ import { ThemeablePropTypes } from '@instructure/emotion'
|
|
|
29
29
|
|
|
30
30
|
import { Panel } from './Panel'
|
|
31
31
|
|
|
32
|
-
import type {
|
|
33
|
-
|
|
32
|
+
import type {
|
|
33
|
+
Spacing,
|
|
34
|
+
WithStyleProps,
|
|
35
|
+
ComponentStyle
|
|
36
|
+
} from '@instructure/emotion'
|
|
37
|
+
import type { PropValidators, TabsTheme } from '@instructure/shared-types'
|
|
34
38
|
import type { BidirectionalProps } from '@instructure/ui-i18n'
|
|
35
39
|
|
|
36
40
|
type TabsOwnProps = {
|
|
@@ -40,6 +44,7 @@ type TabsOwnProps = {
|
|
|
40
44
|
maxWidth?: string | number
|
|
41
45
|
maxHeight?: string | number
|
|
42
46
|
minHeight?: string | number
|
|
47
|
+
fixHeight?: string | number
|
|
43
48
|
margin?: Spacing
|
|
44
49
|
padding?: Spacing
|
|
45
50
|
textAlign?: 'start' | 'center' | 'end'
|
|
@@ -49,12 +54,25 @@ type TabsOwnProps = {
|
|
|
49
54
|
children?: React.ReactNode // TODO: oneOf([Panel, null])
|
|
50
55
|
}
|
|
51
56
|
|
|
52
|
-
type TabsProps = TabsOwnProps & BidirectionalProps & WithStyleProps
|
|
53
|
-
|
|
54
57
|
type PropKeys = keyof TabsOwnProps
|
|
55
58
|
|
|
56
59
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
57
60
|
|
|
61
|
+
type TabsProps = TabsOwnProps &
|
|
62
|
+
BidirectionalProps &
|
|
63
|
+
WithStyleProps<TabsTheme, TabsStyle>
|
|
64
|
+
|
|
65
|
+
type TabsStyle = ComponentStyle<
|
|
66
|
+
| 'tabs'
|
|
67
|
+
| 'container'
|
|
68
|
+
| 'tabList'
|
|
69
|
+
| 'panelsContainer'
|
|
70
|
+
| 'scrollOverlay'
|
|
71
|
+
| 'scrollSpacer'
|
|
72
|
+
| 'scrollOverlayWidthDefault'
|
|
73
|
+
| 'scrollOverlayWidthSecondary'
|
|
74
|
+
>
|
|
75
|
+
|
|
58
76
|
const propTypes: PropValidators<PropKeys> = {
|
|
59
77
|
/**
|
|
60
78
|
* children of type `Tabs.Panel`
|
|
@@ -72,6 +90,7 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
72
90
|
maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
73
91
|
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
74
92
|
minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
93
|
+
fixHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
75
94
|
/**
|
|
76
95
|
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
77
96
|
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
@@ -102,6 +121,7 @@ const allowedProps: AllowedPropKeys = [
|
|
|
102
121
|
'maxWidth',
|
|
103
122
|
'maxHeight',
|
|
104
123
|
'minHeight',
|
|
124
|
+
'fixHeight',
|
|
105
125
|
'margin',
|
|
106
126
|
'padding',
|
|
107
127
|
'textAlign',
|
|
@@ -110,5 +130,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
110
130
|
'shouldFocusOnRender'
|
|
111
131
|
]
|
|
112
132
|
|
|
113
|
-
export type { TabsProps }
|
|
133
|
+
export type { TabsProps, TabsStyle }
|
|
114
134
|
export { propTypes, allowedProps }
|
package/src/Tabs/styles.ts
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { TabsTheme } from '@instructure/shared-types'
|
|
26
|
-
import { TabsProps } from './props'
|
|
25
|
+
import type { TabsTheme } from '@instructure/shared-types'
|
|
26
|
+
import type { TabsProps, TabsStyle } from './props'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* ---
|
|
@@ -35,8 +35,14 @@ import { TabsProps } from './props'
|
|
|
35
35
|
* @param {Object} state the state of the component, the style is applied to
|
|
36
36
|
* @return {Object} The final style object, which will be used in the component
|
|
37
37
|
*/
|
|
38
|
-
const generateStyle = (
|
|
39
|
-
|
|
38
|
+
const generateStyle = (
|
|
39
|
+
componentTheme: TabsTheme,
|
|
40
|
+
props: TabsProps
|
|
41
|
+
): TabsStyle => {
|
|
42
|
+
const { variant, tabOverflow, fixHeight } = props
|
|
43
|
+
|
|
44
|
+
// fixHeight can be 0, so simply `fixheight` could return falsy value
|
|
45
|
+
const hasFixedHeight = typeof fixHeight !== 'undefined'
|
|
40
46
|
|
|
41
47
|
const variants = {
|
|
42
48
|
default: {
|
|
@@ -79,11 +85,16 @@ const generateStyle = (componentTheme: TabsTheme, props: TabsProps) => {
|
|
|
79
85
|
return {
|
|
80
86
|
tabs: {
|
|
81
87
|
label: 'tabs',
|
|
88
|
+
flexShrink: 0,
|
|
89
|
+
flexGrow: 0,
|
|
82
90
|
...variants[variant!].tabs
|
|
83
91
|
},
|
|
84
92
|
|
|
85
93
|
container: {
|
|
86
94
|
label: 'tabs__container',
|
|
95
|
+
display: 'flex',
|
|
96
|
+
flexDirection: 'column',
|
|
97
|
+
height: fixHeight,
|
|
87
98
|
...variants[variant!].container
|
|
88
99
|
},
|
|
89
100
|
|
|
@@ -94,6 +105,17 @@ const generateStyle = (componentTheme: TabsTheme, props: TabsProps) => {
|
|
|
94
105
|
...tabOverflowVariants[tabOverflow!]
|
|
95
106
|
},
|
|
96
107
|
|
|
108
|
+
panelsContainer: {
|
|
109
|
+
label: 'tabs__panelsContainer',
|
|
110
|
+
flexShrink: 1,
|
|
111
|
+
flexGrow: 1,
|
|
112
|
+
display: 'flex',
|
|
113
|
+
flexDirection: 'column',
|
|
114
|
+
...(hasFixedHeight && {
|
|
115
|
+
overflowY: 'hidden'
|
|
116
|
+
})
|
|
117
|
+
},
|
|
118
|
+
|
|
97
119
|
scrollOverlay: {
|
|
98
120
|
label: 'tabs__scrollOverlay',
|
|
99
121
|
height: `calc(100% - (${componentTheme.tabVerticalOffset} + 0.25rem))`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Spacing, WithStyleProps } from '@instructure/emotion';
|
|
3
|
-
import type { PropValidators } from '@instructure/shared-types';
|
|
2
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
3
|
+
import type { PropValidators, TabsPanelTheme } from '@instructure/shared-types';
|
|
4
4
|
declare type TabsPanelOwnProps = {
|
|
5
5
|
renderTitle: React.ReactNode | ((...args: any[]) => any);
|
|
6
6
|
variant?: 'default' | 'secondary';
|
|
@@ -17,9 +17,10 @@ declare type TabsPanelOwnProps = {
|
|
|
17
17
|
};
|
|
18
18
|
declare type PropKeys = keyof TabsPanelOwnProps;
|
|
19
19
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
20
|
-
declare type TabsPanelProps = TabsPanelOwnProps & WithStyleProps
|
|
20
|
+
declare type TabsPanelProps = TabsPanelOwnProps & WithStyleProps<TabsPanelTheme, TabsPanelStyle>;
|
|
21
|
+
declare type TabsPanelStyle = ComponentStyle<'panel' | 'content'>;
|
|
21
22
|
declare const propTypes: PropValidators<PropKeys>;
|
|
22
23
|
declare const allowedProps: AllowedPropKeys;
|
|
23
|
-
export type { TabsPanelProps };
|
|
24
|
+
export type { TabsPanelProps, TabsPanelStyle };
|
|
24
25
|
export { propTypes, allowedProps };
|
|
25
26
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Panel/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Panel/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/E,aAAK,iBAAiB,GAAG;IACvB,WAAW,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACxD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,cAAc,GAAG,iBAAiB,GACrC,cAAc,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;AAEhD,aAAK,cAAc,GAAG,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;AAEzD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAiBvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAanB,CAAA;AAED,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TabsPanelTheme } from '@instructure/shared-types';
|
|
2
|
-
import { TabsPanelProps } from './props';
|
|
1
|
+
import type { TabsPanelTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { TabsPanelProps, TabsPanelStyle } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* ---
|
|
5
5
|
* private: true
|
|
@@ -10,29 +10,6 @@ import { TabsPanelProps } from './props';
|
|
|
10
10
|
* @param {Object} state the state of the component, the style is applied to
|
|
11
11
|
* @return {Object} The final style object, which will be used in the component
|
|
12
12
|
*/
|
|
13
|
-
declare const generateStyle: (componentTheme: TabsPanelTheme, props: TabsPanelProps) =>
|
|
14
|
-
panel: {
|
|
15
|
-
label: string;
|
|
16
|
-
boxSizing: string;
|
|
17
|
-
fontFamily: string;
|
|
18
|
-
fontWeight: number;
|
|
19
|
-
lineHeight: string | number;
|
|
20
|
-
fontSize: string | 0;
|
|
21
|
-
};
|
|
22
|
-
content: {
|
|
23
|
-
overflow?: string | undefined;
|
|
24
|
-
label: string;
|
|
25
|
-
boxSizing: string;
|
|
26
|
-
width: string;
|
|
27
|
-
borderWidth: string | 0;
|
|
28
|
-
borderStyle: string;
|
|
29
|
-
background: string;
|
|
30
|
-
borderColor: string;
|
|
31
|
-
color: string;
|
|
32
|
-
borderLeft: string;
|
|
33
|
-
borderRight: string;
|
|
34
|
-
borderBottom: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
13
|
+
declare const generateStyle: (componentTheme: TabsPanelTheme, props: TabsPanelProps) => TabsPanelStyle;
|
|
37
14
|
export default generateStyle;
|
|
38
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Panel/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Panel/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7D;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,cAAc,SACvB,cAAc,KACpB,cAmCF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -18,6 +18,12 @@ declare class Tab extends Component<TabsTabProps> {
|
|
|
18
18
|
isDisabled?: boolean | undefined;
|
|
19
19
|
isSelected?: boolean | undefined;
|
|
20
20
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
21
|
+
/**
|
|
22
|
+
---
|
|
23
|
+
parent: Tabs
|
|
24
|
+
id: Tabs.Tab
|
|
25
|
+
---
|
|
26
|
+
**/
|
|
21
27
|
onKeyDown?: ((...args: any[]) => any) | undefined;
|
|
22
28
|
children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
|
|
23
29
|
})[];
|
|
@@ -29,6 +35,12 @@ declare class Tab extends Component<TabsTabProps> {
|
|
|
29
35
|
isDisabled?: boolean | undefined;
|
|
30
36
|
isSelected?: boolean | undefined;
|
|
31
37
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
38
|
+
/**
|
|
39
|
+
---
|
|
40
|
+
parent: Tabs
|
|
41
|
+
id: Tabs.Tab
|
|
42
|
+
---
|
|
43
|
+
**/
|
|
32
44
|
onKeyDown?: ((...args: any[]) => any) | undefined;
|
|
33
45
|
children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
|
|
34
46
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tab/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C;;;;;GAKG;AACH,cACM,GAAI,SAAQ,SAAS,CAAC,YAAY,CAAC;IACvC,MAAM,CAAC,QAAQ,CAAC,WAAW,cAAa;IAExC,MAAM,CAAC,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tab/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C;;;;;GAKG;AACH,cACM,GAAI,SAAQ,SAAS,CAAC,YAAY,CAAC;IACvC,MAAM,CAAC,QAAQ,CAAC,WAAW,cAAa;IAExC,MAAM,CAAC,YAAY;;;;;;;;QAVrB;;;;;WAKG;;;SAKiC;IAClC,MAAM,CAAC,SAAS;;;;;;;;QAXlB;;;;;WAKG;;;OAM2B;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;MASlB;IAED,iBAAiB;IAKjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,WAAW,uBASV;IAGD,aAAa,uBASZ;IAED,MAAM;CA+BP;AAED,eAAe,GAAG,CAAA;AAClB,OAAO,EAAE,GAAG,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropValidators } from '@instructure/shared-types';
|
|
3
|
-
import type { WithStyleProps } from '@instructure/emotion';
|
|
2
|
+
import type { PropValidators, TabsTabTheme } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
declare type TabsTabOwnProps = {
|
|
5
5
|
variant?: 'default' | 'secondary';
|
|
6
6
|
id: string;
|
|
@@ -14,9 +14,10 @@ declare type TabsTabOwnProps = {
|
|
|
14
14
|
};
|
|
15
15
|
declare type PropKeys = keyof TabsTabOwnProps;
|
|
16
16
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
17
|
-
declare type TabsTabProps = TabsTabOwnProps & WithStyleProps
|
|
17
|
+
declare type TabsTabProps = TabsTabOwnProps & WithStyleProps<TabsTabTheme, TabsTabStyle>;
|
|
18
|
+
declare type TabsTabStyle = ComponentStyle<'tab'>;
|
|
18
19
|
declare const propTypes: PropValidators<PropKeys>;
|
|
19
20
|
declare const allowedProps: AllowedPropKeys;
|
|
20
|
-
export type { TabsTabProps };
|
|
21
|
+
export type { TabsTabProps, TabsTabStyle };
|
|
21
22
|
export { propTypes, allowedProps };
|
|
22
23
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tab/props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tab/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;CACnE,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,eAAe,CAAA;AAErC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,YAAY,GAAG,eAAe,GAAG,cAAc,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;AAEhF,aAAK,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;AAEzC,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAUvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAUnB,CAAA;AAED,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TabsTabTheme } from '@instructure/shared-types';
|
|
2
|
-
import { TabsTabProps } from './props';
|
|
1
|
+
import type { TabsTabTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { TabsTabProps, TabsTabStyle } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* ---
|
|
5
5
|
* private: true
|
|
@@ -10,6 +10,6 @@ import { TabsTabProps } from './props';
|
|
|
10
10
|
* @param {Object} state the state of the component, the style is applied to
|
|
11
11
|
* @return {Object} The final style object, which will be used in the component
|
|
12
12
|
*/
|
|
13
|
-
declare const generateStyle: (componentTheme: TabsTabTheme, props: TabsTabProps) =>
|
|
13
|
+
declare const generateStyle: (componentTheme: TabsTabTheme, props: TabsTabProps) => TabsTabStyle;
|
|
14
14
|
export default generateStyle;
|
|
15
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tab/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tab/styles.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAUzD;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,YAAY,SACrB,YAAY,KAClB,YAsFF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
package/types/Tabs/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ declare class Tabs extends Component<TabsProps> {
|
|
|
18
18
|
maxWidth?: string | number | undefined;
|
|
19
19
|
maxHeight?: string | number | undefined;
|
|
20
20
|
minHeight?: string | number | undefined;
|
|
21
|
+
fixHeight?: string | number | undefined;
|
|
21
22
|
margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
22
23
|
padding?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
23
24
|
textAlign?: "start" | "center" | "end" | undefined;
|
|
@@ -33,6 +34,7 @@ declare class Tabs extends Component<TabsProps> {
|
|
|
33
34
|
maxWidth?: string | number | undefined;
|
|
34
35
|
maxHeight?: string | number | undefined;
|
|
35
36
|
minHeight?: string | number | undefined;
|
|
37
|
+
fixHeight?: string | number | undefined;
|
|
36
38
|
margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
37
39
|
padding?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
38
40
|
textAlign?: "start" | "center" | "end" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Tabs/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAAiB,MAAM,OAAO,CAAA;AAmBvD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGxC;;;;GAIG;AACH,cAGM,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Tabs/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAAiB,MAAM,OAAO,CAAA;AAmBvD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGxC;;;;GAIG;AACH,cAGM,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;MAQlB;IAED,MAAM,CAAC,KAAK,eAAQ;IACpB,MAAM,CAAC,GAAG,aAAM;gBAGJ,KAAK,KAAA;IAajB,iBAAiB;IAcjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IA+CjD,oBAAoB;IAIpB,mBAAmB;IA2BnB,oBAAoB;IAepB,eAAe;IAaf,wBAAwB,CAAC,WAAW,KAAA;IAiDpC,cAAc;;;eAGb;IAGD,gBAAgB;;eAoBf;IAED,YAAY,aAQX;IAGD,UAAU,CAAC,UAAU,KAAA,EAAE,IAAI,KAAA;;;;IA8B3B,YAAY,CAAC,KAAK,KAAA,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;;;KAAA;IAYjC,SAAS,CAAC,KAAK,KAAA,EAAE,WAAW,KAAA,EAAE,QAAQ,KAAA,EAAE,KAAK,KAAA;IAmB7C,UAAU,CAAC,KAAK,KAAA,EAAE,WAAW,KAAA,EAAE,QAAQ,KAAA,EAAE,KAAK,KAAA;;;;;;;;;;;IAsB9C,kBAAkB,oBAGjB;IAGD,gBAAgB,oBAGf;IAED,KAAK;IASL,MAAM;CAqGP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA"}
|
package/types/Tabs/props.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Spacing, WithStyleProps } from '@instructure/emotion';
|
|
3
|
-
import type { PropValidators } from '@instructure/shared-types';
|
|
2
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
3
|
+
import type { PropValidators, TabsTheme } from '@instructure/shared-types';
|
|
4
4
|
import type { BidirectionalProps } from '@instructure/ui-i18n';
|
|
5
5
|
declare type TabsOwnProps = {
|
|
6
6
|
variant?: 'default' | 'secondary';
|
|
@@ -9,6 +9,7 @@ declare type TabsOwnProps = {
|
|
|
9
9
|
maxWidth?: string | number;
|
|
10
10
|
maxHeight?: string | number;
|
|
11
11
|
minHeight?: string | number;
|
|
12
|
+
fixHeight?: string | number;
|
|
12
13
|
margin?: Spacing;
|
|
13
14
|
padding?: Spacing;
|
|
14
15
|
textAlign?: 'start' | 'center' | 'end';
|
|
@@ -17,11 +18,12 @@ declare type TabsOwnProps = {
|
|
|
17
18
|
shouldFocusOnRender?: boolean;
|
|
18
19
|
children?: React.ReactNode;
|
|
19
20
|
};
|
|
20
|
-
declare type TabsProps = TabsOwnProps & BidirectionalProps & WithStyleProps;
|
|
21
21
|
declare type PropKeys = keyof TabsOwnProps;
|
|
22
22
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
23
|
+
declare type TabsProps = TabsOwnProps & BidirectionalProps & WithStyleProps<TabsTheme, TabsStyle>;
|
|
24
|
+
declare type TabsStyle = ComponentStyle<'tabs' | 'container' | 'tabList' | 'panelsContainer' | 'scrollOverlay' | 'scrollSpacer' | 'scrollOverlayWidthDefault' | 'scrollOverlayWidthSecondary'>;
|
|
23
25
|
declare const propTypes: PropValidators<PropKeys>;
|
|
24
26
|
declare const allowedProps: AllowedPropKeys;
|
|
25
|
-
export type { TabsProps };
|
|
27
|
+
export type { TabsProps, TabsStyle };
|
|
26
28
|
export { propTypes, allowedProps };
|
|
27
29
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Tabs/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Tabs/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D,aAAK,YAAY,GAAG;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAC5C,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,WAAW,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAChC,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,YAAY,CAAA;AAElC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,SAAS,GAAG,YAAY,GAC3B,kBAAkB,GAClB,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAEtC,aAAK,SAAS,GAAG,cAAc,CAC3B,MAAM,GACN,WAAW,GACX,SAAS,GACT,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,2BAA2B,GAC3B,6BAA6B,CAChC,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAsCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAenB,CAAA;AAED,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/Tabs/styles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TabsTheme } from '@instructure/shared-types';
|
|
2
|
-
import { TabsProps } from './props';
|
|
1
|
+
import type { TabsTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { TabsProps, TabsStyle } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* ---
|
|
5
5
|
* private: true
|
|
@@ -10,74 +10,6 @@ import { TabsProps } from './props';
|
|
|
10
10
|
* @param {Object} state the state of the component, the style is applied to
|
|
11
11
|
* @return {Object} The final style object, which will be used in the component
|
|
12
12
|
*/
|
|
13
|
-
declare const generateStyle: (componentTheme: TabsTheme, props: TabsProps) =>
|
|
14
|
-
tabs: {
|
|
15
|
-
marginBottom?: string | undefined;
|
|
16
|
-
label: string;
|
|
17
|
-
};
|
|
18
|
-
container: {
|
|
19
|
-
background?: string | undefined;
|
|
20
|
-
label: string;
|
|
21
|
-
};
|
|
22
|
-
tabList: {
|
|
23
|
-
flexFlow: string;
|
|
24
|
-
label: string;
|
|
25
|
-
display: string;
|
|
26
|
-
width: string;
|
|
27
|
-
} | {
|
|
28
|
-
'&::-webkit-scrollbar-track'?: {
|
|
29
|
-
backgroundColor: string;
|
|
30
|
-
} | undefined;
|
|
31
|
-
'&::-webkit-scrollbar'?: {
|
|
32
|
-
height: string;
|
|
33
|
-
backgroundColor: string;
|
|
34
|
-
} | undefined;
|
|
35
|
-
'&::-webkit-scrollbar-thumb'?: {
|
|
36
|
-
backgroundColor: string;
|
|
37
|
-
} | undefined;
|
|
38
|
-
overflowX: string;
|
|
39
|
-
label: string;
|
|
40
|
-
display: string;
|
|
41
|
-
width: string;
|
|
42
|
-
};
|
|
43
|
-
scrollOverlay: {
|
|
44
|
-
'[dir="rtl"] &': {
|
|
45
|
-
background: string;
|
|
46
|
-
};
|
|
47
|
-
width: string;
|
|
48
|
-
label: string;
|
|
49
|
-
height: string;
|
|
50
|
-
position: string;
|
|
51
|
-
zIndex: number;
|
|
52
|
-
top: string;
|
|
53
|
-
insetInlineEnd: string;
|
|
54
|
-
background: string;
|
|
55
|
-
pointerEvents: string;
|
|
56
|
-
} | {
|
|
57
|
-
'[dir="rtl"] &': {
|
|
58
|
-
background: string;
|
|
59
|
-
};
|
|
60
|
-
width: string;
|
|
61
|
-
label: string;
|
|
62
|
-
height: string;
|
|
63
|
-
position: string;
|
|
64
|
-
zIndex: number;
|
|
65
|
-
top: string;
|
|
66
|
-
insetInlineEnd: string;
|
|
67
|
-
background: string;
|
|
68
|
-
pointerEvents: string;
|
|
69
|
-
};
|
|
70
|
-
scrollSpacer: {
|
|
71
|
-
flexBasis: string;
|
|
72
|
-
label: string;
|
|
73
|
-
flexShrink: number;
|
|
74
|
-
} | {
|
|
75
|
-
flexBasis: string;
|
|
76
|
-
label: string;
|
|
77
|
-
flexShrink: number;
|
|
78
|
-
};
|
|
79
|
-
scrollOverlayWidthDefault: string;
|
|
80
|
-
scrollOverlayWidthSecondary: string;
|
|
81
|
-
};
|
|
13
|
+
declare const generateStyle: (componentTheme: TabsTheme, props: TabsProps) => TabsStyle;
|
|
82
14
|
export default generateStyle;
|
|
83
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Tabs/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Tabs/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnD;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,SAAS,SAClB,SAAS,KACf,SAuGF,CAAA;AAED,eAAe,aAAa,CAAA"}
|