@instructure/ui-list 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 +5 -2
- package/es/InlineList/v1/InlineListItem/index.js +39 -39
- package/es/InlineList/v1/InlineListItem/styles.js +5 -3
- package/es/InlineList/v1/InlineListItem/theme.js +27 -26
- package/es/InlineList/v1/index.js +26 -28
- package/es/InlineList/v2/InlineListItem/index.js +39 -39
- package/es/InlineList/v2/InlineListItem/styles.js +5 -3
- package/es/InlineList/v2/index.js +26 -28
- package/es/List/v1/ListItem/index.js +36 -36
- package/es/List/v1/ListItem/styles.js +5 -3
- package/es/List/v1/ListItem/theme.js +24 -23
- package/es/List/v1/index.js +35 -34
- package/es/List/v1/styles.js +4 -2
- package/es/List/v1/theme.js +7 -5
- package/es/List/v2/ListItem/index.js +36 -36
- package/es/List/v2/ListItem/styles.js +5 -3
- package/es/List/v2/index.js +35 -34
- package/es/List/v2/styles.js +4 -2
- package/lib/InlineList/v1/InlineListItem/index.js +39 -39
- package/lib/InlineList/v1/InlineListItem/styles.js +5 -3
- package/lib/InlineList/v1/InlineListItem/theme.js +27 -26
- package/lib/InlineList/v1/index.js +27 -29
- package/lib/InlineList/v2/InlineListItem/index.js +39 -39
- package/lib/InlineList/v2/InlineListItem/styles.js +5 -3
- package/lib/InlineList/v2/index.js +27 -29
- package/lib/List/v1/ListItem/index.js +36 -36
- package/lib/List/v1/ListItem/styles.js +5 -3
- package/lib/List/v1/ListItem/theme.js +24 -23
- package/lib/List/v1/index.js +35 -34
- package/lib/List/v1/styles.js +4 -2
- package/lib/List/v1/theme.js +7 -5
- package/lib/List/v2/ListItem/index.js +36 -36
- package/lib/List/v2/ListItem/styles.js +5 -3
- package/lib/List/v2/index.js +35 -34
- package/lib/List/v2/styles.js +4 -2
- package/package.json +11 -11
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [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
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["delimiter", "size", "margin", "padding", "elementRef", "children", "spacing", "styles", "lastPlaceholder"];
|
|
3
|
-
var _dec, _class, _InlineListItem;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -39,41 +37,49 @@ parent: InlineList
|
|
|
39
37
|
id: InlineList.Item
|
|
40
38
|
---
|
|
41
39
|
**/
|
|
42
|
-
let InlineListItem = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
let InlineListItem = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class InlineListItem extends Component {
|
|
41
|
+
static displayName = "InlineListItem";
|
|
42
|
+
static componentId = 'InlineList.Item';
|
|
43
|
+
static allowedProps = allowedProps;
|
|
44
|
+
static defaultProps = {
|
|
45
|
+
padding: 'none',
|
|
46
|
+
spacing: 'none',
|
|
47
|
+
delimiter: 'none',
|
|
48
|
+
size: 'medium',
|
|
49
|
+
lastPlaceholder: false
|
|
50
|
+
};
|
|
51
|
+
ref = null;
|
|
52
|
+
handleRef = el => {
|
|
53
|
+
const {
|
|
54
|
+
elementRef
|
|
55
|
+
} = this.props;
|
|
56
|
+
this.ref = el;
|
|
57
|
+
if (typeof elementRef === 'function') {
|
|
58
|
+
elementRef(el);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
54
61
|
componentDidMount() {
|
|
55
|
-
|
|
56
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
62
|
+
this.props.makeStyles?.();
|
|
57
63
|
}
|
|
58
64
|
componentDidUpdate() {
|
|
59
|
-
|
|
60
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
65
|
+
this.props.makeStyles?.();
|
|
61
66
|
}
|
|
62
67
|
render() {
|
|
63
|
-
const
|
|
64
|
-
delimiter
|
|
65
|
-
size
|
|
66
|
-
margin
|
|
67
|
-
padding
|
|
68
|
-
elementRef
|
|
69
|
-
children
|
|
70
|
-
spacing
|
|
71
|
-
styles
|
|
72
|
-
lastPlaceholder
|
|
73
|
-
rest
|
|
68
|
+
const {
|
|
69
|
+
delimiter,
|
|
70
|
+
size,
|
|
71
|
+
margin,
|
|
72
|
+
padding,
|
|
73
|
+
elementRef,
|
|
74
|
+
children,
|
|
75
|
+
spacing,
|
|
76
|
+
styles,
|
|
77
|
+
lastPlaceholder,
|
|
78
|
+
...rest
|
|
79
|
+
} = this.props;
|
|
74
80
|
return _jsxs(View, {
|
|
75
81
|
...passthroughProps(rest),
|
|
76
|
-
css: styles
|
|
82
|
+
css: styles?.inlineListItem,
|
|
77
83
|
as: "li",
|
|
78
84
|
margin: margin,
|
|
79
85
|
padding: padding,
|
|
@@ -82,17 +88,11 @@ let InlineListItem = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
82
88
|
elementRef: this.handleRef,
|
|
83
89
|
"data-cid": "InlineListItem",
|
|
84
90
|
children: [children, !lastPlaceholder && _jsx("span", {
|
|
85
|
-
css: styles
|
|
91
|
+
css: styles?.delimiter,
|
|
86
92
|
"aria-hidden": "true"
|
|
87
93
|
})]
|
|
88
94
|
});
|
|
89
95
|
}
|
|
90
|
-
}
|
|
91
|
-
padding: 'none',
|
|
92
|
-
spacing: 'none',
|
|
93
|
-
delimiter: 'none',
|
|
94
|
-
size: 'medium',
|
|
95
|
-
lastPlaceholder: false
|
|
96
|
-
}, _InlineListItem)) || _class);
|
|
96
|
+
}) || _class);
|
|
97
97
|
export default InlineListItem;
|
|
98
98
|
export { InlineListItem };
|
|
@@ -36,9 +36,11 @@ import { logError as error } from '@instructure/console';
|
|
|
36
36
|
* @return {Object} The final style object, which will be used in the component
|
|
37
37
|
*/
|
|
38
38
|
const generateStyle = (componentTheme, props) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const {
|
|
40
|
+
size,
|
|
41
|
+
delimiter,
|
|
42
|
+
spacing
|
|
43
|
+
} = props;
|
|
42
44
|
const withDelimiter = delimiter !== 'none';
|
|
43
45
|
const withSpacing = spacing !== 'none';
|
|
44
46
|
error(!(withDelimiter && withSpacing), `[InlineList] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`);
|
|
@@ -28,38 +28,39 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
spacing
|
|
34
|
-
typography
|
|
35
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
colors,
|
|
33
|
+
spacing,
|
|
34
|
+
typography,
|
|
35
|
+
key: themeName
|
|
36
|
+
} = theme;
|
|
36
37
|
const themeSpecificStyle = {
|
|
37
38
|
canvas: {
|
|
38
39
|
color: theme['ic-brand-font-color-dark']
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
const componentVariables = {
|
|
42
|
-
fontFamily: typography
|
|
43
|
-
fontWeight: typography
|
|
44
|
-
fontSizeSmall: typography
|
|
45
|
-
fontSizeMedium: typography
|
|
46
|
-
fontSizeLarge: typography
|
|
47
|
-
color: colors
|
|
48
|
-
delimiterColor: colors
|
|
49
|
-
lineHeight: typography
|
|
50
|
-
noneSpacing: spacing
|
|
51
|
-
pipeSpacing: spacing
|
|
52
|
-
slashSpacing: spacing
|
|
53
|
-
arrowSpacing: spacing
|
|
54
|
-
marginBottomDefault: spacing
|
|
55
|
-
spacingXXXSmall: spacing
|
|
56
|
-
spacingXXSmall: spacing
|
|
57
|
-
spacingXSmall: spacing
|
|
58
|
-
spacingSmall: spacing
|
|
59
|
-
spacingMedium: spacing
|
|
60
|
-
spacingLarge: spacing
|
|
61
|
-
spacingXLarge: spacing
|
|
62
|
-
spacingXXLarge: spacing
|
|
43
|
+
fontFamily: typography?.fontFamily,
|
|
44
|
+
fontWeight: typography?.fontWeightNormal,
|
|
45
|
+
fontSizeSmall: typography?.fontSizeSmall,
|
|
46
|
+
fontSizeMedium: typography?.fontSizeMedium,
|
|
47
|
+
fontSizeLarge: typography?.fontSizeLarge,
|
|
48
|
+
color: colors?.contrasts?.grey4570,
|
|
49
|
+
delimiterColor: colors?.contrasts?.grey125125,
|
|
50
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
51
|
+
noneSpacing: spacing?.xSmall,
|
|
52
|
+
pipeSpacing: spacing?.xSmall,
|
|
53
|
+
slashSpacing: spacing?.xSmall,
|
|
54
|
+
arrowSpacing: spacing?.xSmall,
|
|
55
|
+
marginBottomDefault: spacing?.xxxSmall,
|
|
56
|
+
spacingXXXSmall: spacing?.xxxSmall,
|
|
57
|
+
spacingXXSmall: spacing?.xxSmall,
|
|
58
|
+
spacingXSmall: spacing?.xSmall,
|
|
59
|
+
spacingSmall: spacing?.small,
|
|
60
|
+
spacingMedium: spacing?.medium,
|
|
61
|
+
spacingLarge: spacing?.large,
|
|
62
|
+
spacingXLarge: spacing?.xLarge,
|
|
63
|
+
spacingXXLarge: spacing?.xxLarge
|
|
63
64
|
};
|
|
64
65
|
return {
|
|
65
66
|
...componentVariables,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
const _excluded = ["as", "margin", "elementRef"];
|
|
3
1
|
/*
|
|
4
2
|
* The MIT License (MIT)
|
|
5
3
|
*
|
|
@@ -36,17 +34,26 @@ category: components
|
|
|
36
34
|
|
|
37
35
|
**/
|
|
38
36
|
class InlineList extends Component {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
static displayName = "InlineList";
|
|
38
|
+
static allowedProps = allowedProps;
|
|
39
|
+
static defaultProps = {
|
|
40
|
+
itemSpacing: 'none',
|
|
41
|
+
as: 'ul',
|
|
42
|
+
margin: 'none',
|
|
43
|
+
delimiter: 'none',
|
|
44
|
+
size: 'medium'
|
|
45
|
+
};
|
|
46
|
+
static Item = InlineListItem;
|
|
47
|
+
ref = null;
|
|
48
|
+
handleRef = el => {
|
|
49
|
+
const {
|
|
50
|
+
elementRef
|
|
51
|
+
} = this.props;
|
|
52
|
+
this.ref = el;
|
|
53
|
+
if (typeof elementRef === 'function') {
|
|
54
|
+
elementRef(el);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
50
57
|
renderChildren() {
|
|
51
58
|
const childrenArray = Children.toArray(this.props.children);
|
|
52
59
|
const lastIndex = childrenArray.length - 1;
|
|
@@ -62,11 +69,12 @@ class InlineList extends Component {
|
|
|
62
69
|
});
|
|
63
70
|
}
|
|
64
71
|
render() {
|
|
65
|
-
const
|
|
66
|
-
as
|
|
67
|
-
margin
|
|
68
|
-
elementRef
|
|
69
|
-
rest
|
|
72
|
+
const {
|
|
73
|
+
as,
|
|
74
|
+
margin,
|
|
75
|
+
elementRef,
|
|
76
|
+
...rest
|
|
77
|
+
} = this.props;
|
|
70
78
|
return _jsx(View, {
|
|
71
79
|
...passthroughProps(rest),
|
|
72
80
|
as: as,
|
|
@@ -79,15 +87,5 @@ class InlineList extends Component {
|
|
|
79
87
|
});
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
|
-
InlineList.displayName = "InlineList";
|
|
83
|
-
InlineList.allowedProps = allowedProps;
|
|
84
|
-
InlineList.defaultProps = {
|
|
85
|
-
itemSpacing: 'none',
|
|
86
|
-
as: 'ul',
|
|
87
|
-
margin: 'none',
|
|
88
|
-
delimiter: 'none',
|
|
89
|
-
size: 'medium'
|
|
90
|
-
};
|
|
91
|
-
InlineList.Item = InlineListItem;
|
|
92
90
|
export default InlineList;
|
|
93
91
|
export { InlineList };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["delimiter", "size", "margin", "padding", "elementRef", "children", "spacing", "styles", "lastPlaceholder"];
|
|
3
|
-
var _dec, _class, _InlineListItem;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -38,41 +36,49 @@ parent: InlineList
|
|
|
38
36
|
id: InlineList.Item
|
|
39
37
|
---
|
|
40
38
|
**/
|
|
41
|
-
let InlineListItem = (_dec = withStyle(generateStyle), _dec(_class =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
let InlineListItem = (_dec = withStyle(generateStyle), _dec(_class = class InlineListItem extends Component {
|
|
40
|
+
static displayName = "InlineListItem";
|
|
41
|
+
static componentId = 'InlineList.Item';
|
|
42
|
+
static allowedProps = allowedProps;
|
|
43
|
+
static defaultProps = {
|
|
44
|
+
padding: 'none',
|
|
45
|
+
spacing: 'none',
|
|
46
|
+
delimiter: 'none',
|
|
47
|
+
size: 'medium',
|
|
48
|
+
lastPlaceholder: false
|
|
49
|
+
};
|
|
50
|
+
ref = null;
|
|
51
|
+
handleRef = el => {
|
|
52
|
+
const {
|
|
53
|
+
elementRef
|
|
54
|
+
} = this.props;
|
|
55
|
+
this.ref = el;
|
|
56
|
+
if (typeof elementRef === 'function') {
|
|
57
|
+
elementRef(el);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
53
60
|
componentDidMount() {
|
|
54
|
-
|
|
55
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
61
|
+
this.props.makeStyles?.();
|
|
56
62
|
}
|
|
57
63
|
componentDidUpdate() {
|
|
58
|
-
|
|
59
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
64
|
+
this.props.makeStyles?.();
|
|
60
65
|
}
|
|
61
66
|
render() {
|
|
62
|
-
const
|
|
63
|
-
delimiter
|
|
64
|
-
size
|
|
65
|
-
margin
|
|
66
|
-
padding
|
|
67
|
-
elementRef
|
|
68
|
-
children
|
|
69
|
-
spacing
|
|
70
|
-
styles
|
|
71
|
-
lastPlaceholder
|
|
72
|
-
rest
|
|
67
|
+
const {
|
|
68
|
+
delimiter,
|
|
69
|
+
size,
|
|
70
|
+
margin,
|
|
71
|
+
padding,
|
|
72
|
+
elementRef,
|
|
73
|
+
children,
|
|
74
|
+
spacing,
|
|
75
|
+
styles,
|
|
76
|
+
lastPlaceholder,
|
|
77
|
+
...rest
|
|
78
|
+
} = this.props;
|
|
73
79
|
return _jsxs(View, {
|
|
74
80
|
...passthroughProps(rest),
|
|
75
|
-
css: styles
|
|
81
|
+
css: styles?.inlineListItem,
|
|
76
82
|
as: "li",
|
|
77
83
|
margin: margin,
|
|
78
84
|
padding: padding,
|
|
@@ -81,17 +87,11 @@ let InlineListItem = (_dec = withStyle(generateStyle), _dec(_class = (_InlineLis
|
|
|
81
87
|
elementRef: this.handleRef,
|
|
82
88
|
"data-cid": "InlineListItem",
|
|
83
89
|
children: [children, !lastPlaceholder && _jsx("span", {
|
|
84
|
-
css: styles
|
|
90
|
+
css: styles?.delimiter,
|
|
85
91
|
"aria-hidden": "true"
|
|
86
92
|
})]
|
|
87
93
|
});
|
|
88
94
|
}
|
|
89
|
-
}
|
|
90
|
-
padding: 'none',
|
|
91
|
-
spacing: 'none',
|
|
92
|
-
delimiter: 'none',
|
|
93
|
-
size: 'medium',
|
|
94
|
-
lastPlaceholder: false
|
|
95
|
-
}, _InlineListItem)) || _class);
|
|
95
|
+
}) || _class);
|
|
96
96
|
export default InlineListItem;
|
|
97
97
|
export { InlineListItem };
|
|
@@ -33,9 +33,11 @@ import { logError as error } from '@instructure/console';
|
|
|
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
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const {
|
|
37
|
+
size,
|
|
38
|
+
delimiter,
|
|
39
|
+
spacing
|
|
40
|
+
} = props;
|
|
39
41
|
const withDelimiter = delimiter !== 'none';
|
|
40
42
|
const withSpacing = spacing !== 'none';
|
|
41
43
|
error(!(withDelimiter && withSpacing), `[InlineList] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
const _excluded = ["as", "margin", "elementRef"];
|
|
3
1
|
/*
|
|
4
2
|
* The MIT License (MIT)
|
|
5
3
|
*
|
|
@@ -36,17 +34,26 @@ category: components
|
|
|
36
34
|
|
|
37
35
|
**/
|
|
38
36
|
class InlineList extends Component {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
static displayName = "InlineList";
|
|
38
|
+
static allowedProps = allowedProps;
|
|
39
|
+
static defaultProps = {
|
|
40
|
+
itemSpacing: 'none',
|
|
41
|
+
as: 'ul',
|
|
42
|
+
margin: 'none',
|
|
43
|
+
delimiter: 'none',
|
|
44
|
+
size: 'medium'
|
|
45
|
+
};
|
|
46
|
+
static Item = InlineListItem;
|
|
47
|
+
ref = null;
|
|
48
|
+
handleRef = el => {
|
|
49
|
+
const {
|
|
50
|
+
elementRef
|
|
51
|
+
} = this.props;
|
|
52
|
+
this.ref = el;
|
|
53
|
+
if (typeof elementRef === 'function') {
|
|
54
|
+
elementRef(el);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
50
57
|
renderChildren() {
|
|
51
58
|
const childrenArray = Children.toArray(this.props.children);
|
|
52
59
|
const lastIndex = childrenArray.length - 1;
|
|
@@ -62,11 +69,12 @@ class InlineList extends Component {
|
|
|
62
69
|
});
|
|
63
70
|
}
|
|
64
71
|
render() {
|
|
65
|
-
const
|
|
66
|
-
as
|
|
67
|
-
margin
|
|
68
|
-
elementRef
|
|
69
|
-
rest
|
|
72
|
+
const {
|
|
73
|
+
as,
|
|
74
|
+
margin,
|
|
75
|
+
elementRef,
|
|
76
|
+
...rest
|
|
77
|
+
} = this.props;
|
|
70
78
|
return _jsx(View, {
|
|
71
79
|
...passthroughProps(rest),
|
|
72
80
|
as: as,
|
|
@@ -79,15 +87,5 @@ class InlineList extends Component {
|
|
|
79
87
|
});
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
|
-
InlineList.displayName = "InlineList";
|
|
83
|
-
InlineList.allowedProps = allowedProps;
|
|
84
|
-
InlineList.defaultProps = {
|
|
85
|
-
itemSpacing: 'none',
|
|
86
|
-
as: 'ul',
|
|
87
|
-
margin: 'none',
|
|
88
|
-
delimiter: 'none',
|
|
89
|
-
size: 'medium'
|
|
90
|
-
};
|
|
91
|
-
InlineList.Item = InlineListItem;
|
|
92
90
|
export default InlineList;
|
|
93
91
|
export { InlineList };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["delimiter", "spacing", "size", "margin", "padding", "elementRef", "children", "styles"];
|
|
3
|
-
var _dec, _class, _ListItem;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -39,40 +37,47 @@ parent: List
|
|
|
39
37
|
id: List.Item
|
|
40
38
|
---
|
|
41
39
|
**/
|
|
42
|
-
let ListItem = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
let ListItem = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ListItem extends Component {
|
|
41
|
+
static displayName = "ListItem";
|
|
42
|
+
static componentId = 'List.Item';
|
|
43
|
+
static allowedProps = allowedProps;
|
|
44
|
+
static defaultProps = {
|
|
45
|
+
padding: 'none',
|
|
46
|
+
spacing: 'none',
|
|
47
|
+
delimiter: 'none',
|
|
48
|
+
size: 'medium'
|
|
49
|
+
};
|
|
50
|
+
ref = null;
|
|
51
|
+
handleRef = el => {
|
|
52
|
+
const {
|
|
53
|
+
elementRef
|
|
54
|
+
} = this.props;
|
|
55
|
+
this.ref = el;
|
|
56
|
+
if (typeof elementRef === 'function') {
|
|
57
|
+
elementRef(el);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
54
60
|
componentDidMount() {
|
|
55
|
-
|
|
56
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
61
|
+
this.props.makeStyles?.();
|
|
57
62
|
}
|
|
58
63
|
componentDidUpdate() {
|
|
59
|
-
|
|
60
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
64
|
+
this.props.makeStyles?.();
|
|
61
65
|
}
|
|
62
66
|
render() {
|
|
63
|
-
const
|
|
64
|
-
delimiter
|
|
65
|
-
spacing
|
|
66
|
-
size
|
|
67
|
-
margin
|
|
68
|
-
padding
|
|
69
|
-
elementRef
|
|
70
|
-
children
|
|
71
|
-
styles
|
|
72
|
-
rest
|
|
67
|
+
const {
|
|
68
|
+
delimiter,
|
|
69
|
+
spacing,
|
|
70
|
+
size,
|
|
71
|
+
margin,
|
|
72
|
+
padding,
|
|
73
|
+
elementRef,
|
|
74
|
+
children,
|
|
75
|
+
styles,
|
|
76
|
+
...rest
|
|
77
|
+
} = this.props;
|
|
73
78
|
return _jsx(View, {
|
|
74
79
|
...passthroughProps(rest),
|
|
75
|
-
css: styles
|
|
80
|
+
css: styles?.listItem,
|
|
76
81
|
as: "li",
|
|
77
82
|
margin: margin,
|
|
78
83
|
padding: padding,
|
|
@@ -82,11 +87,6 @@ let ListItem = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_c
|
|
|
82
87
|
children: children
|
|
83
88
|
});
|
|
84
89
|
}
|
|
85
|
-
}
|
|
86
|
-
padding: 'none',
|
|
87
|
-
spacing: 'none',
|
|
88
|
-
delimiter: 'none',
|
|
89
|
-
size: 'medium'
|
|
90
|
-
}, _ListItem)) || _class);
|
|
90
|
+
}) || _class);
|
|
91
91
|
export default ListItem;
|
|
92
92
|
export { ListItem };
|
|
@@ -36,9 +36,11 @@ import { logError as error } from '@instructure/console';
|
|
|
36
36
|
* @return {Object} The final style object, which will be used in the component
|
|
37
37
|
*/
|
|
38
38
|
const generateStyle = (componentTheme, props) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const {
|
|
40
|
+
size,
|
|
41
|
+
delimiter,
|
|
42
|
+
spacing
|
|
43
|
+
} = props;
|
|
42
44
|
const withDelimiter = delimiter !== 'none';
|
|
43
45
|
const withSpacing = spacing !== 'none';
|
|
44
46
|
error(!(withDelimiter && withSpacing), `[List] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`);
|
|
@@ -28,35 +28,36 @@
|
|
|
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
|
-
spacing
|
|
35
|
-
typography
|
|
36
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
borders,
|
|
33
|
+
colors,
|
|
34
|
+
spacing,
|
|
35
|
+
typography,
|
|
36
|
+
key: themeName
|
|
37
|
+
} = theme;
|
|
37
38
|
const themeSpecificStyle = {
|
|
38
39
|
canvas: {
|
|
39
40
|
color: theme['ic-brand-font-color-dark']
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
const componentVariables = {
|
|
43
|
-
fontFamily: typography
|
|
44
|
-
fontWeight: typography
|
|
45
|
-
lineHeight: typography
|
|
46
|
-
fontSizeSmall: typography
|
|
47
|
-
fontSizeMedium: typography
|
|
48
|
-
fontSizeLarge: typography
|
|
49
|
-
color: colors
|
|
50
|
-
spacingXXXSmall: spacing
|
|
51
|
-
spacingXXSmall: spacing
|
|
52
|
-
spacingXSmall: spacing
|
|
53
|
-
spacingSmall: spacing
|
|
54
|
-
spacingMedium: spacing
|
|
55
|
-
spacingLarge: spacing
|
|
56
|
-
spacingXLarge: spacing
|
|
57
|
-
spacingXXLarge: spacing
|
|
58
|
-
delimiterDashedBorder: `${borders
|
|
59
|
-
delimiterSolidBorder: `${borders
|
|
44
|
+
fontFamily: typography?.fontFamily,
|
|
45
|
+
fontWeight: typography?.fontWeightNormal,
|
|
46
|
+
lineHeight: typography?.lineHeight,
|
|
47
|
+
fontSizeSmall: typography?.fontSizeSmall,
|
|
48
|
+
fontSizeMedium: typography?.fontSizeMedium,
|
|
49
|
+
fontSizeLarge: typography?.fontSizeLarge,
|
|
50
|
+
color: colors?.contrasts?.grey125125,
|
|
51
|
+
spacingXXXSmall: spacing?.xxxSmall,
|
|
52
|
+
spacingXXSmall: spacing?.xxSmall,
|
|
53
|
+
spacingXSmall: spacing?.xSmall,
|
|
54
|
+
spacingSmall: spacing?.small,
|
|
55
|
+
spacingMedium: spacing?.medium,
|
|
56
|
+
spacingLarge: spacing?.large,
|
|
57
|
+
spacingXLarge: spacing?.xLarge,
|
|
58
|
+
spacingXXLarge: spacing?.xxLarge,
|
|
59
|
+
delimiterDashedBorder: `${borders?.widthSmall} dashed ${colors?.contrasts?.grey1214}`,
|
|
60
|
+
delimiterSolidBorder: `${borders?.widthSmall} solid ${colors?.contrasts?.grey1214}`
|
|
60
61
|
};
|
|
61
62
|
return {
|
|
62
63
|
...componentVariables,
|