@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/es/List/v1/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["as", "margin", "isUnstyled", "elementRef", "styles"];
|
|
3
|
-
var _dec, _class, _List;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -39,25 +37,33 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
|
39
37
|
category: components
|
|
40
38
|
---
|
|
41
39
|
**/
|
|
42
|
-
let List = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
let List = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class List extends Component {
|
|
41
|
+
static displayName = "List";
|
|
42
|
+
static componentId = 'List';
|
|
43
|
+
static allowedProps = allowedProps;
|
|
44
|
+
static defaultProps = {
|
|
45
|
+
as: 'ul',
|
|
46
|
+
delimiter: 'none',
|
|
47
|
+
isUnstyled: false,
|
|
48
|
+
size: 'medium',
|
|
49
|
+
itemSpacing: 'none'
|
|
50
|
+
};
|
|
51
|
+
static Item = ListItem;
|
|
52
|
+
ref = null;
|
|
53
|
+
handleRef = el => {
|
|
54
|
+
const {
|
|
55
|
+
elementRef
|
|
56
|
+
} = this.props;
|
|
57
|
+
this.ref = el;
|
|
58
|
+
if (typeof elementRef === 'function') {
|
|
59
|
+
elementRef(el);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
54
62
|
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);
|
|
63
|
+
this.props.makeStyles?.();
|
|
57
64
|
}
|
|
58
65
|
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);
|
|
66
|
+
this.props.makeStyles?.();
|
|
61
67
|
}
|
|
62
68
|
renderChildren() {
|
|
63
69
|
return Children.map(this.props.children, child => {
|
|
@@ -72,16 +78,17 @@ let List = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
72
78
|
});
|
|
73
79
|
}
|
|
74
80
|
render() {
|
|
75
|
-
const
|
|
76
|
-
as
|
|
77
|
-
margin
|
|
78
|
-
isUnstyled
|
|
79
|
-
elementRef
|
|
80
|
-
styles
|
|
81
|
-
rest
|
|
81
|
+
const {
|
|
82
|
+
as,
|
|
83
|
+
margin,
|
|
84
|
+
isUnstyled,
|
|
85
|
+
elementRef,
|
|
86
|
+
styles,
|
|
87
|
+
...rest
|
|
88
|
+
} = this.props;
|
|
82
89
|
return _jsx(View, {
|
|
83
90
|
...passthroughProps(rest),
|
|
84
|
-
css: styles
|
|
91
|
+
css: styles?.list,
|
|
85
92
|
as: as,
|
|
86
93
|
margin: margin,
|
|
87
94
|
elementRef: this.handleRef,
|
|
@@ -90,12 +97,6 @@ let List = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
90
97
|
children: this.renderChildren()
|
|
91
98
|
});
|
|
92
99
|
}
|
|
93
|
-
}
|
|
94
|
-
as: 'ul',
|
|
95
|
-
delimiter: 'none',
|
|
96
|
-
isUnstyled: false,
|
|
97
|
-
size: 'medium',
|
|
98
|
-
itemSpacing: 'none'
|
|
99
|
-
}, _List.Item = ListItem, _List)) || _class);
|
|
100
|
+
}) || _class);
|
|
100
101
|
export default List;
|
|
101
102
|
export { List, ListItem };
|
package/es/List/v1/styles.js
CHANGED
|
@@ -33,8 +33,10 @@
|
|
|
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
|
-
|
|
36
|
+
const {
|
|
37
|
+
isUnstyled,
|
|
38
|
+
as
|
|
39
|
+
} = props;
|
|
38
40
|
const ordered = as === 'ol';
|
|
39
41
|
return {
|
|
40
42
|
list: {
|
package/es/List/v1/theme.js
CHANGED
|
@@ -28,12 +28,14 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const {
|
|
32
|
+
spacing,
|
|
33
|
+
typography
|
|
34
|
+
} = theme;
|
|
33
35
|
const componentVariables = {
|
|
34
|
-
listPadding: spacing
|
|
35
|
-
orderedNumberFontWeight: typography
|
|
36
|
-
orderedNumberMargin: spacing
|
|
36
|
+
listPadding: spacing?.large,
|
|
37
|
+
orderedNumberFontWeight: typography?.fontWeightBold,
|
|
38
|
+
orderedNumberMargin: spacing?.xSmall
|
|
37
39
|
};
|
|
38
40
|
return {
|
|
39
41
|
...componentVariables
|
|
@@ -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
|
*
|
|
@@ -38,40 +36,47 @@ parent: List
|
|
|
38
36
|
id: List.Item
|
|
39
37
|
---
|
|
40
38
|
**/
|
|
41
|
-
let ListItem = (_dec = withStyle(generateStyle), _dec(_class =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
let ListItem = (_dec = withStyle(generateStyle), _dec(_class = class ListItem extends Component {
|
|
40
|
+
static displayName = "ListItem";
|
|
41
|
+
static componentId = 'List.Item';
|
|
42
|
+
static allowedProps = allowedProps;
|
|
43
|
+
static defaultProps = {
|
|
44
|
+
padding: 'none',
|
|
45
|
+
spacing: 'none',
|
|
46
|
+
delimiter: 'none',
|
|
47
|
+
size: 'medium'
|
|
48
|
+
};
|
|
49
|
+
ref = null;
|
|
50
|
+
handleRef = el => {
|
|
51
|
+
const {
|
|
52
|
+
elementRef
|
|
53
|
+
} = this.props;
|
|
54
|
+
this.ref = el;
|
|
55
|
+
if (typeof elementRef === 'function') {
|
|
56
|
+
elementRef(el);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
53
59
|
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);
|
|
60
|
+
this.props.makeStyles?.();
|
|
56
61
|
}
|
|
57
62
|
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);
|
|
63
|
+
this.props.makeStyles?.();
|
|
60
64
|
}
|
|
61
65
|
render() {
|
|
62
|
-
const
|
|
63
|
-
delimiter
|
|
64
|
-
spacing
|
|
65
|
-
size
|
|
66
|
-
margin
|
|
67
|
-
padding
|
|
68
|
-
elementRef
|
|
69
|
-
children
|
|
70
|
-
styles
|
|
71
|
-
rest
|
|
66
|
+
const {
|
|
67
|
+
delimiter,
|
|
68
|
+
spacing,
|
|
69
|
+
size,
|
|
70
|
+
margin,
|
|
71
|
+
padding,
|
|
72
|
+
elementRef,
|
|
73
|
+
children,
|
|
74
|
+
styles,
|
|
75
|
+
...rest
|
|
76
|
+
} = this.props;
|
|
72
77
|
return _jsx(View, {
|
|
73
78
|
...passthroughProps(rest),
|
|
74
|
-
css: styles
|
|
79
|
+
css: styles?.listItem,
|
|
75
80
|
as: "li",
|
|
76
81
|
margin: margin,
|
|
77
82
|
padding: padding,
|
|
@@ -81,11 +86,6 @@ let ListItem = (_dec = withStyle(generateStyle), _dec(_class = (_ListItem = clas
|
|
|
81
86
|
children: children
|
|
82
87
|
});
|
|
83
88
|
}
|
|
84
|
-
}
|
|
85
|
-
padding: 'none',
|
|
86
|
-
spacing: 'none',
|
|
87
|
-
delimiter: 'none',
|
|
88
|
-
size: 'medium'
|
|
89
|
-
}, _ListItem)) || _class);
|
|
89
|
+
}) || _class);
|
|
90
90
|
export default ListItem;
|
|
91
91
|
export { ListItem };
|
|
@@ -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), `[List] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`);
|
package/es/List/v2/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["as", "margin", "isUnstyled", "elementRef", "styles"];
|
|
3
|
-
var _dec, _class, _List;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -38,25 +36,33 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
|
38
36
|
category: components
|
|
39
37
|
---
|
|
40
38
|
**/
|
|
41
|
-
let List = (_dec = withStyle(generateStyle), _dec(_class =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
let List = (_dec = withStyle(generateStyle), _dec(_class = class List extends Component {
|
|
40
|
+
static displayName = "List";
|
|
41
|
+
static componentId = 'List';
|
|
42
|
+
static allowedProps = allowedProps;
|
|
43
|
+
static defaultProps = {
|
|
44
|
+
as: 'ul',
|
|
45
|
+
delimiter: 'none',
|
|
46
|
+
isUnstyled: false,
|
|
47
|
+
size: 'medium',
|
|
48
|
+
itemSpacing: 'none'
|
|
49
|
+
};
|
|
50
|
+
static Item = ListItem;
|
|
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
|
+
};
|
|
53
61
|
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);
|
|
62
|
+
this.props.makeStyles?.();
|
|
56
63
|
}
|
|
57
64
|
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);
|
|
65
|
+
this.props.makeStyles?.();
|
|
60
66
|
}
|
|
61
67
|
renderChildren() {
|
|
62
68
|
return Children.map(this.props.children, child => {
|
|
@@ -71,16 +77,17 @@ let List = (_dec = withStyle(generateStyle), _dec(_class = (_List = class List e
|
|
|
71
77
|
});
|
|
72
78
|
}
|
|
73
79
|
render() {
|
|
74
|
-
const
|
|
75
|
-
as
|
|
76
|
-
margin
|
|
77
|
-
isUnstyled
|
|
78
|
-
elementRef
|
|
79
|
-
styles
|
|
80
|
-
rest
|
|
80
|
+
const {
|
|
81
|
+
as,
|
|
82
|
+
margin,
|
|
83
|
+
isUnstyled,
|
|
84
|
+
elementRef,
|
|
85
|
+
styles,
|
|
86
|
+
...rest
|
|
87
|
+
} = this.props;
|
|
81
88
|
return _jsx(View, {
|
|
82
89
|
...passthroughProps(rest),
|
|
83
|
-
css: styles
|
|
90
|
+
css: styles?.list,
|
|
84
91
|
as: as,
|
|
85
92
|
margin: margin,
|
|
86
93
|
elementRef: this.handleRef,
|
|
@@ -89,12 +96,6 @@ let List = (_dec = withStyle(generateStyle), _dec(_class = (_List = class List e
|
|
|
89
96
|
children: this.renderChildren()
|
|
90
97
|
});
|
|
91
98
|
}
|
|
92
|
-
}
|
|
93
|
-
as: 'ul',
|
|
94
|
-
delimiter: 'none',
|
|
95
|
-
isUnstyled: false,
|
|
96
|
-
size: 'medium',
|
|
97
|
-
itemSpacing: 'none'
|
|
98
|
-
}, _List.Item = ListItem, _List)) || _class);
|
|
99
|
+
}) || _class);
|
|
99
100
|
export default List;
|
|
100
101
|
export { List, ListItem };
|
package/es/List/v2/styles.js
CHANGED
|
@@ -33,8 +33,10 @@
|
|
|
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
|
-
|
|
36
|
+
const {
|
|
37
|
+
isUnstyled,
|
|
38
|
+
as
|
|
39
|
+
} = props;
|
|
38
40
|
const ordered = as === 'ol';
|
|
39
41
|
return {
|
|
40
42
|
list: {
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.InlineListItem = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _v11_ = require("@instructure/ui-view/v11_6");
|
|
11
10
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
@@ -14,8 +13,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
14
13
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
15
14
|
var _props = require("./props");
|
|
16
15
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
-
|
|
18
|
-
var _dec, _class, _InlineListItem;
|
|
16
|
+
var _dec, _class;
|
|
19
17
|
/*
|
|
20
18
|
* The MIT License (MIT)
|
|
21
19
|
*
|
|
@@ -45,41 +43,49 @@ parent: InlineList
|
|
|
45
43
|
id: InlineList.Item
|
|
46
44
|
---
|
|
47
45
|
**/
|
|
48
|
-
let InlineListItem = exports.InlineListItem = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
let InlineListItem = exports.InlineListItem = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class InlineListItem extends _react.Component {
|
|
47
|
+
static displayName = "InlineListItem";
|
|
48
|
+
static componentId = 'InlineList.Item';
|
|
49
|
+
static allowedProps = _props.allowedProps;
|
|
50
|
+
static defaultProps = {
|
|
51
|
+
padding: 'none',
|
|
52
|
+
spacing: 'none',
|
|
53
|
+
delimiter: 'none',
|
|
54
|
+
size: 'medium',
|
|
55
|
+
lastPlaceholder: false
|
|
56
|
+
};
|
|
57
|
+
ref = null;
|
|
58
|
+
handleRef = el => {
|
|
59
|
+
const {
|
|
60
|
+
elementRef
|
|
61
|
+
} = this.props;
|
|
62
|
+
this.ref = el;
|
|
63
|
+
if (typeof elementRef === 'function') {
|
|
64
|
+
elementRef(el);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
60
67
|
componentDidMount() {
|
|
61
|
-
|
|
62
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
68
|
+
this.props.makeStyles?.();
|
|
63
69
|
}
|
|
64
70
|
componentDidUpdate() {
|
|
65
|
-
|
|
66
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
71
|
+
this.props.makeStyles?.();
|
|
67
72
|
}
|
|
68
73
|
render() {
|
|
69
|
-
const
|
|
70
|
-
delimiter
|
|
71
|
-
size
|
|
72
|
-
margin
|
|
73
|
-
padding
|
|
74
|
-
elementRef
|
|
75
|
-
children
|
|
76
|
-
spacing
|
|
77
|
-
styles
|
|
78
|
-
lastPlaceholder
|
|
79
|
-
rest
|
|
74
|
+
const {
|
|
75
|
+
delimiter,
|
|
76
|
+
size,
|
|
77
|
+
margin,
|
|
78
|
+
padding,
|
|
79
|
+
elementRef,
|
|
80
|
+
children,
|
|
81
|
+
spacing,
|
|
82
|
+
styles,
|
|
83
|
+
lastPlaceholder,
|
|
84
|
+
...rest
|
|
85
|
+
} = this.props;
|
|
80
86
|
return (0, _jsxRuntime.jsxs)(_v11_.View, {
|
|
81
87
|
...(0, _passthroughProps.passthroughProps)(rest),
|
|
82
|
-
css: styles
|
|
88
|
+
css: styles?.inlineListItem,
|
|
83
89
|
as: "li",
|
|
84
90
|
margin: margin,
|
|
85
91
|
padding: padding,
|
|
@@ -88,16 +94,10 @@ let InlineListItem = exports.InlineListItem = (_dec = (0, _emotion.withStyleLega
|
|
|
88
94
|
elementRef: this.handleRef,
|
|
89
95
|
"data-cid": "InlineListItem",
|
|
90
96
|
children: [children, !lastPlaceholder && (0, _jsxRuntime.jsx)("span", {
|
|
91
|
-
css: styles
|
|
97
|
+
css: styles?.delimiter,
|
|
92
98
|
"aria-hidden": "true"
|
|
93
99
|
})]
|
|
94
100
|
});
|
|
95
101
|
}
|
|
96
|
-
}
|
|
97
|
-
padding: 'none',
|
|
98
|
-
spacing: 'none',
|
|
99
|
-
delimiter: 'none',
|
|
100
|
-
size: 'medium',
|
|
101
|
-
lastPlaceholder: false
|
|
102
|
-
}, _InlineListItem)) || _class);
|
|
102
|
+
}) || _class);
|
|
103
103
|
var _default = exports.default = InlineListItem;
|
|
@@ -42,9 +42,11 @@ var _console = require("@instructure/console");
|
|
|
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
|
-
|
|
45
|
+
const {
|
|
46
|
+
size,
|
|
47
|
+
delimiter,
|
|
48
|
+
spacing
|
|
49
|
+
} = props;
|
|
48
50
|
const withDelimiter = delimiter !== 'none';
|
|
49
51
|
const withSpacing = spacing !== 'none';
|
|
50
52
|
(0, _console.logError)(!(withDelimiter && withSpacing), `[InlineList] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`);
|
|
@@ -34,38 +34,39 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
spacing
|
|
40
|
-
typography
|
|
41
|
-
themeName
|
|
37
|
+
const {
|
|
38
|
+
colors,
|
|
39
|
+
spacing,
|
|
40
|
+
typography,
|
|
41
|
+
key: themeName
|
|
42
|
+
} = theme;
|
|
42
43
|
const themeSpecificStyle = {
|
|
43
44
|
canvas: {
|
|
44
45
|
color: theme['ic-brand-font-color-dark']
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
const componentVariables = {
|
|
48
|
-
fontFamily: typography
|
|
49
|
-
fontWeight: typography
|
|
50
|
-
fontSizeSmall: typography
|
|
51
|
-
fontSizeMedium: typography
|
|
52
|
-
fontSizeLarge: typography
|
|
53
|
-
color: colors
|
|
54
|
-
delimiterColor: colors
|
|
55
|
-
lineHeight: typography
|
|
56
|
-
noneSpacing: spacing
|
|
57
|
-
pipeSpacing: spacing
|
|
58
|
-
slashSpacing: spacing
|
|
59
|
-
arrowSpacing: spacing
|
|
60
|
-
marginBottomDefault: spacing
|
|
61
|
-
spacingXXXSmall: spacing
|
|
62
|
-
spacingXXSmall: spacing
|
|
63
|
-
spacingXSmall: spacing
|
|
64
|
-
spacingSmall: spacing
|
|
65
|
-
spacingMedium: spacing
|
|
66
|
-
spacingLarge: spacing
|
|
67
|
-
spacingXLarge: spacing
|
|
68
|
-
spacingXXLarge: spacing
|
|
49
|
+
fontFamily: typography?.fontFamily,
|
|
50
|
+
fontWeight: typography?.fontWeightNormal,
|
|
51
|
+
fontSizeSmall: typography?.fontSizeSmall,
|
|
52
|
+
fontSizeMedium: typography?.fontSizeMedium,
|
|
53
|
+
fontSizeLarge: typography?.fontSizeLarge,
|
|
54
|
+
color: colors?.contrasts?.grey4570,
|
|
55
|
+
delimiterColor: colors?.contrasts?.grey125125,
|
|
56
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
57
|
+
noneSpacing: spacing?.xSmall,
|
|
58
|
+
pipeSpacing: spacing?.xSmall,
|
|
59
|
+
slashSpacing: spacing?.xSmall,
|
|
60
|
+
arrowSpacing: spacing?.xSmall,
|
|
61
|
+
marginBottomDefault: spacing?.xxxSmall,
|
|
62
|
+
spacingXXXSmall: spacing?.xxxSmall,
|
|
63
|
+
spacingXXSmall: spacing?.xxSmall,
|
|
64
|
+
spacingXSmall: spacing?.xSmall,
|
|
65
|
+
spacingSmall: spacing?.small,
|
|
66
|
+
spacingMedium: spacing?.medium,
|
|
67
|
+
spacingLarge: spacing?.large,
|
|
68
|
+
spacingXLarge: spacing?.xLarge,
|
|
69
|
+
spacingXXLarge: spacing?.xxLarge
|
|
69
70
|
};
|
|
70
71
|
return {
|
|
71
72
|
...componentVariables,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = exports.InlineList = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
7
|
var _react = require("react");
|
|
10
8
|
var _v11_ = require("@instructure/ui-view/v11_6");
|
|
11
9
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
@@ -13,7 +11,6 @@ var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElemen
|
|
|
13
11
|
var _InlineListItem = require("./InlineListItem");
|
|
14
12
|
var _props = require("./props");
|
|
15
13
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
16
|
-
const _excluded = ["as", "margin", "elementRef"];
|
|
17
14
|
/*
|
|
18
15
|
* The MIT License (MIT)
|
|
19
16
|
*
|
|
@@ -37,6 +34,7 @@ const _excluded = ["as", "margin", "elementRef"];
|
|
|
37
34
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
38
35
|
* SOFTWARE.
|
|
39
36
|
*/
|
|
37
|
+
|
|
40
38
|
/**
|
|
41
39
|
---
|
|
42
40
|
category: components
|
|
@@ -44,17 +42,26 @@ category: components
|
|
|
44
42
|
|
|
45
43
|
**/
|
|
46
44
|
class InlineList extends _react.Component {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
static displayName = "InlineList";
|
|
46
|
+
static allowedProps = _props.allowedProps;
|
|
47
|
+
static defaultProps = {
|
|
48
|
+
itemSpacing: 'none',
|
|
49
|
+
as: 'ul',
|
|
50
|
+
margin: 'none',
|
|
51
|
+
delimiter: 'none',
|
|
52
|
+
size: 'medium'
|
|
53
|
+
};
|
|
54
|
+
static Item = _InlineListItem.InlineListItem;
|
|
55
|
+
ref = null;
|
|
56
|
+
handleRef = el => {
|
|
57
|
+
const {
|
|
58
|
+
elementRef
|
|
59
|
+
} = this.props;
|
|
60
|
+
this.ref = el;
|
|
61
|
+
if (typeof elementRef === 'function') {
|
|
62
|
+
elementRef(el);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
58
65
|
renderChildren() {
|
|
59
66
|
const childrenArray = _react.Children.toArray(this.props.children);
|
|
60
67
|
const lastIndex = childrenArray.length - 1;
|
|
@@ -70,11 +77,12 @@ class InlineList extends _react.Component {
|
|
|
70
77
|
});
|
|
71
78
|
}
|
|
72
79
|
render() {
|
|
73
|
-
const
|
|
74
|
-
as
|
|
75
|
-
margin
|
|
76
|
-
elementRef
|
|
77
|
-
rest
|
|
80
|
+
const {
|
|
81
|
+
as,
|
|
82
|
+
margin,
|
|
83
|
+
elementRef,
|
|
84
|
+
...rest
|
|
85
|
+
} = this.props;
|
|
78
86
|
return (0, _jsxRuntime.jsx)(_v11_.View, {
|
|
79
87
|
...(0, _passthroughProps.passthroughProps)(rest),
|
|
80
88
|
as: as,
|
|
@@ -88,14 +96,4 @@ class InlineList extends _react.Component {
|
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
98
|
exports.InlineList = InlineList;
|
|
91
|
-
InlineList.displayName = "InlineList";
|
|
92
|
-
InlineList.allowedProps = _props.allowedProps;
|
|
93
|
-
InlineList.defaultProps = {
|
|
94
|
-
itemSpacing: 'none',
|
|
95
|
-
as: 'ul',
|
|
96
|
-
margin: 'none',
|
|
97
|
-
delimiter: 'none',
|
|
98
|
-
size: 'medium'
|
|
99
|
-
};
|
|
100
|
-
InlineList.Item = _InlineListItem.InlineListItem;
|
|
101
99
|
var _default = exports.default = InlineList;
|