@instructure/ui-list 11.6.0 → 11.6.1-snapshot-129

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.
Files changed (159) hide show
  1. package/CHANGELOG.md +38 -288
  2. package/es/InlineList/{InlineListItem → v1/InlineListItem}/index.js +2 -2
  3. package/es/InlineList/{index.js → v1/index.js} +1 -1
  4. package/es/InlineList/v2/InlineListItem/index.js +97 -0
  5. package/es/InlineList/v2/InlineListItem/styles.js +143 -0
  6. package/es/InlineList/v2/index.js +93 -0
  7. package/es/{index.js → InlineList/v2/props.js} +3 -3
  8. package/es/List/{ListItem → v1/ListItem}/index.js +2 -2
  9. package/es/List/v1/ListItem/props.js +28 -0
  10. package/es/List/{index.js → v1/index.js} +2 -2
  11. package/es/List/v2/ListItem/index.js +91 -0
  12. package/es/List/v2/ListItem/props.js +28 -0
  13. package/es/List/v2/ListItem/styles.js +131 -0
  14. package/es/List/v2/index.js +100 -0
  15. package/es/List/v2/props.js +26 -0
  16. package/es/List/v2/styles.js +66 -0
  17. package/es/exports/a.js +26 -0
  18. package/es/exports/b.js +26 -0
  19. package/lib/InlineList/{InlineListItem → v1/InlineListItem}/index.js +3 -3
  20. package/lib/InlineList/{index.js → v1/index.js} +2 -2
  21. package/lib/InlineList/v2/InlineListItem/index.js +102 -0
  22. package/lib/InlineList/v2/InlineListItem/styles.js +149 -0
  23. package/lib/InlineList/v2/index.js +101 -0
  24. package/lib/InlineList/v2/props.js +31 -0
  25. package/lib/List/{ListItem → v1/ListItem}/index.js +3 -3
  26. package/lib/List/v1/ListItem/props.js +33 -0
  27. package/lib/List/v1/index.js +114 -0
  28. package/lib/List/v2/ListItem/index.js +96 -0
  29. package/lib/List/v2/ListItem/props.js +33 -0
  30. package/lib/List/v2/ListItem/styles.js +137 -0
  31. package/lib/List/{index.js → v2/index.js} +4 -5
  32. package/lib/List/v2/props.js +31 -0
  33. package/lib/List/v2/styles.js +72 -0
  34. package/lib/{index.js → exports/a.js} +6 -6
  35. package/lib/exports/b.js +32 -0
  36. package/package.json +39 -17
  37. package/src/InlineList/{InlineListItem → v1/InlineListItem}/index.tsx +2 -2
  38. package/src/InlineList/{index.tsx → v1/index.tsx} +1 -1
  39. package/src/InlineList/v2/InlineListItem/index.tsx +110 -0
  40. package/src/InlineList/v2/InlineListItem/props.ts +99 -0
  41. package/src/InlineList/v2/InlineListItem/styles.ts +142 -0
  42. package/src/InlineList/v2/README.md +146 -0
  43. package/src/InlineList/v2/index.tsx +102 -0
  44. package/src/InlineList/v2/props.ts +80 -0
  45. package/src/List/{ListItem → v1/ListItem}/index.tsx +2 -2
  46. package/src/List/{index.tsx → v1/index.tsx} +2 -2
  47. package/src/List/v2/ListItem/index.tsx +104 -0
  48. package/src/List/v2/ListItem/props.ts +94 -0
  49. package/src/List/v2/ListItem/styles.ts +136 -0
  50. package/src/List/v2/README.md +142 -0
  51. package/src/List/v2/index.tsx +109 -0
  52. package/src/List/v2/props.ts +95 -0
  53. package/src/List/v2/styles.ts +77 -0
  54. package/src/exports/a.ts +32 -0
  55. package/src/exports/b.ts +32 -0
  56. package/tsconfig.build.tsbuildinfo +1 -1
  57. package/types/InlineList/v1/InlineListItem/index.d.ts.map +1 -0
  58. package/types/InlineList/v1/InlineListItem/props.d.ts.map +1 -0
  59. package/types/InlineList/v1/InlineListItem/styles.d.ts.map +1 -0
  60. package/types/InlineList/v1/InlineListItem/theme.d.ts.map +1 -0
  61. package/types/InlineList/v1/index.d.ts.map +1 -0
  62. package/types/InlineList/v1/props.d.ts.map +1 -0
  63. package/types/InlineList/v2/InlineListItem/index.d.ts +27 -0
  64. package/types/InlineList/v2/InlineListItem/index.d.ts.map +1 -0
  65. package/types/InlineList/v2/InlineListItem/props.d.ts +42 -0
  66. package/types/InlineList/v2/InlineListItem/props.d.ts.map +1 -0
  67. package/types/InlineList/v2/InlineListItem/styles.d.ts +14 -0
  68. package/types/InlineList/v2/InlineListItem/styles.d.ts.map +1 -0
  69. package/types/InlineList/v2/index.d.ts +35 -0
  70. package/types/InlineList/v2/index.d.ts.map +1 -0
  71. package/types/InlineList/v2/props.d.ts +33 -0
  72. package/types/InlineList/v2/props.d.ts.map +1 -0
  73. package/types/List/v1/ListItem/index.d.ts.map +1 -0
  74. package/types/List/v1/ListItem/props.d.ts.map +1 -0
  75. package/types/List/v1/ListItem/styles.d.ts.map +1 -0
  76. package/types/List/v1/ListItem/theme.d.ts.map +1 -0
  77. package/types/List/v1/index.d.ts.map +1 -0
  78. package/types/List/v1/props.d.ts.map +1 -0
  79. package/types/List/v1/styles.d.ts.map +1 -0
  80. package/types/List/v1/theme.d.ts.map +1 -0
  81. package/types/List/v2/ListItem/index.d.ts +26 -0
  82. package/types/List/v2/ListItem/index.d.ts.map +1 -0
  83. package/types/List/v2/ListItem/props.d.ts +38 -0
  84. package/types/List/v2/ListItem/props.d.ts.map +1 -0
  85. package/types/List/v2/ListItem/styles.d.ts +14 -0
  86. package/types/List/v2/ListItem/styles.d.ts.map +1 -0
  87. package/types/List/v2/index.d.ts +38 -0
  88. package/types/List/v2/index.d.ts.map +1 -0
  89. package/types/List/v2/props.d.ts +41 -0
  90. package/types/List/v2/props.d.ts.map +1 -0
  91. package/types/List/v2/styles.d.ts +15 -0
  92. package/types/List/v2/styles.d.ts.map +1 -0
  93. package/types/exports/a.d.ts +8 -0
  94. package/types/exports/a.d.ts.map +1 -0
  95. package/types/exports/b.d.ts +8 -0
  96. package/types/exports/b.d.ts.map +1 -0
  97. package/src/index.ts +0 -32
  98. package/types/InlineList/InlineListItem/index.d.ts.map +0 -1
  99. package/types/InlineList/InlineListItem/props.d.ts.map +0 -1
  100. package/types/InlineList/InlineListItem/styles.d.ts.map +0 -1
  101. package/types/InlineList/InlineListItem/theme.d.ts.map +0 -1
  102. package/types/InlineList/index.d.ts.map +0 -1
  103. package/types/InlineList/props.d.ts.map +0 -1
  104. package/types/List/ListItem/index.d.ts.map +0 -1
  105. package/types/List/ListItem/props.d.ts.map +0 -1
  106. package/types/List/ListItem/styles.d.ts.map +0 -1
  107. package/types/List/ListItem/theme.d.ts.map +0 -1
  108. package/types/List/index.d.ts.map +0 -1
  109. package/types/List/props.d.ts.map +0 -1
  110. package/types/List/styles.d.ts.map +0 -1
  111. package/types/List/theme.d.ts.map +0 -1
  112. package/types/index.d.ts +0 -8
  113. package/types/index.d.ts.map +0 -1
  114. /package/es/InlineList/{InlineListItem → v1/InlineListItem}/props.js +0 -0
  115. /package/es/InlineList/{InlineListItem → v1/InlineListItem}/styles.js +0 -0
  116. /package/es/InlineList/{InlineListItem → v1/InlineListItem}/theme.js +0 -0
  117. /package/es/InlineList/{props.js → v1/props.js} +0 -0
  118. /package/es/{List/ListItem → InlineList/v2/InlineListItem}/props.js +0 -0
  119. /package/es/List/{ListItem → v1/ListItem}/styles.js +0 -0
  120. /package/es/List/{ListItem → v1/ListItem}/theme.js +0 -0
  121. /package/es/List/{props.js → v1/props.js} +0 -0
  122. /package/es/List/{styles.js → v1/styles.js} +0 -0
  123. /package/es/List/{theme.js → v1/theme.js} +0 -0
  124. /package/lib/InlineList/{InlineListItem → v1/InlineListItem}/props.js +0 -0
  125. /package/lib/InlineList/{InlineListItem → v1/InlineListItem}/styles.js +0 -0
  126. /package/lib/InlineList/{InlineListItem → v1/InlineListItem}/theme.js +0 -0
  127. /package/lib/InlineList/{props.js → v1/props.js} +0 -0
  128. /package/lib/{List/ListItem → InlineList/v2/InlineListItem}/props.js +0 -0
  129. /package/lib/List/{ListItem → v1/ListItem}/styles.js +0 -0
  130. /package/lib/List/{ListItem → v1/ListItem}/theme.js +0 -0
  131. /package/lib/List/{props.js → v1/props.js} +0 -0
  132. /package/lib/List/{styles.js → v1/styles.js} +0 -0
  133. /package/lib/List/{theme.js → v1/theme.js} +0 -0
  134. /package/src/InlineList/{InlineListItem → v1/InlineListItem}/props.ts +0 -0
  135. /package/src/InlineList/{InlineListItem → v1/InlineListItem}/styles.ts +0 -0
  136. /package/src/InlineList/{InlineListItem → v1/InlineListItem}/theme.ts +0 -0
  137. /package/src/InlineList/{README.md → v1/README.md} +0 -0
  138. /package/src/InlineList/{props.ts → v1/props.ts} +0 -0
  139. /package/src/List/{ListItem → v1/ListItem}/props.ts +0 -0
  140. /package/src/List/{ListItem → v1/ListItem}/styles.ts +0 -0
  141. /package/src/List/{ListItem → v1/ListItem}/theme.ts +0 -0
  142. /package/src/List/{README.md → v1/README.md} +0 -0
  143. /package/src/List/{props.ts → v1/props.ts} +0 -0
  144. /package/src/List/{styles.ts → v1/styles.ts} +0 -0
  145. /package/src/List/{theme.ts → v1/theme.ts} +0 -0
  146. /package/types/InlineList/{InlineListItem → v1/InlineListItem}/index.d.ts +0 -0
  147. /package/types/InlineList/{InlineListItem → v1/InlineListItem}/props.d.ts +0 -0
  148. /package/types/InlineList/{InlineListItem → v1/InlineListItem}/styles.d.ts +0 -0
  149. /package/types/InlineList/{InlineListItem → v1/InlineListItem}/theme.d.ts +0 -0
  150. /package/types/InlineList/{index.d.ts → v1/index.d.ts} +0 -0
  151. /package/types/InlineList/{props.d.ts → v1/props.d.ts} +0 -0
  152. /package/types/List/{ListItem → v1/ListItem}/index.d.ts +0 -0
  153. /package/types/List/{ListItem → v1/ListItem}/props.d.ts +0 -0
  154. /package/types/List/{ListItem → v1/ListItem}/styles.d.ts +0 -0
  155. /package/types/List/{ListItem → v1/ListItem}/theme.d.ts +0 -0
  156. /package/types/List/{index.d.ts → v1/index.d.ts} +0 -0
  157. /package/types/List/{props.d.ts → v1/props.d.ts} +0 -0
  158. /package/types/List/{styles.d.ts → v1/styles.d.ts} +0 -0
  159. /package/types/List/{theme.d.ts → v1/theme.d.ts} +0 -0
@@ -0,0 +1,100 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ const _excluded = ["as", "margin", "isUnstyled", "elementRef", "styles"];
3
+ var _dec, _class, _List;
4
+ /*
5
+ * The MIT License (MIT)
6
+ *
7
+ * Copyright (c) 2015 - present Instructure, Inc.
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+
28
+ import { Children, Component } from 'react';
29
+ import { View } from '@instructure/ui-view/latest';
30
+ import { passthroughProps, safeCloneElement } from '@instructure/ui-react-utils';
31
+ import { withStyle } from '@instructure/emotion';
32
+ import { ListItem } from "./ListItem/index.js";
33
+ import generateStyle from "./styles.js";
34
+ import { allowedProps } from "./props.js";
35
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
36
+ /**
37
+ ---
38
+ category: components
39
+ ---
40
+ **/
41
+ let List = (_dec = withStyle(generateStyle), _dec(_class = (_List = class List extends Component {
42
+ constructor(...args) {
43
+ super(...args);
44
+ this.ref = null;
45
+ this.handleRef = el => {
46
+ const elementRef = this.props.elementRef;
47
+ this.ref = el;
48
+ if (typeof elementRef === 'function') {
49
+ elementRef(el);
50
+ }
51
+ };
52
+ }
53
+ componentDidMount() {
54
+ var _this$props$makeStyle, _this$props;
55
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
56
+ }
57
+ componentDidUpdate() {
58
+ var _this$props$makeStyle2, _this$props2;
59
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
60
+ }
61
+ renderChildren() {
62
+ return Children.map(this.props.children, child => {
63
+ if (!child) return; // ignore null, falsy children
64
+
65
+ return safeCloneElement(child, {
66
+ isUnstyled: this.props.isUnstyled,
67
+ delimiter: this.props.delimiter,
68
+ size: this.props.size,
69
+ spacing: this.props.itemSpacing
70
+ });
71
+ });
72
+ }
73
+ render() {
74
+ const _this$props3 = this.props,
75
+ as = _this$props3.as,
76
+ margin = _this$props3.margin,
77
+ isUnstyled = _this$props3.isUnstyled,
78
+ elementRef = _this$props3.elementRef,
79
+ styles = _this$props3.styles,
80
+ rest = _objectWithoutProperties(_this$props3, _excluded);
81
+ return _jsx(View, {
82
+ ...passthroughProps(rest),
83
+ css: styles === null || styles === void 0 ? void 0 : styles.list,
84
+ as: as,
85
+ margin: margin,
86
+ elementRef: this.handleRef,
87
+ display: "block",
88
+ "data-cid": "List",
89
+ children: this.renderChildren()
90
+ });
91
+ }
92
+ }, _List.displayName = "List", _List.componentId = 'List', _List.allowedProps = allowedProps, _List.defaultProps = {
93
+ as: 'ul',
94
+ delimiter: 'none',
95
+ isUnstyled: false,
96
+ size: 'medium',
97
+ itemSpacing: 'none'
98
+ }, _List.Item = ListItem, _List)) || _class);
99
+ export default List;
100
+ export { List, ListItem };
@@ -0,0 +1,26 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ const allowedProps = ['children', 'as', 'delimiter', 'isUnstyled', 'margin', 'size', 'itemSpacing', 'elementRef'];
26
+ export { allowedProps };
@@ -0,0 +1,66 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ /**
26
+ * ---
27
+ * private: true
28
+ * ---
29
+ * Generates the style object from the theme and provided additional information
30
+ * @param {Object} componentTheme The theme variable object.
31
+ * @param {Object} props the props of the component, the style is applied to
32
+ * @param {Object} state the state of the component, the style is applied to
33
+ * @return {Object} The final style object, which will be used in the component
34
+ */
35
+ const generateStyle = (componentTheme, props) => {
36
+ const isUnstyled = props.isUnstyled,
37
+ as = props.as;
38
+ const ordered = as === 'ol';
39
+ return {
40
+ list: {
41
+ label: 'list',
42
+ paddingInlineStart: componentTheme.listPadding,
43
+ paddingInlineEnd: 0,
44
+ ...(ordered && {
45
+ listStyleType: 'none',
46
+ // 1.3 rem is removed to have the ordered list start at the same point
47
+ // as the unordered vertically
48
+ paddingInlineStart: `calc(${componentTheme.listPadding} - 1.3rem)`,
49
+ paddingInlineEnd: 0,
50
+ counterReset: 'ol-counter',
51
+ '&>li::before': {
52
+ fontWeight: componentTheme.orderedNumberFontWeight,
53
+ counterIncrement: 'ol-counter',
54
+ content: 'counters(ol-counter, ".") "."',
55
+ marginInlineEnd: componentTheme.orderedNumberMargin,
56
+ marginInlineStart: 0
57
+ }
58
+ }),
59
+ ...(isUnstyled && {
60
+ listStyleType: 'none',
61
+ paddingInlineStart: 0
62
+ })
63
+ }
64
+ };
65
+ };
66
+ export default generateStyle;
@@ -0,0 +1,26 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ export { InlineList } from "../InlineList/v1/index.js";
25
+ export { List, ListItem } from "../List/v1/index.js";
26
+ export { InlineListItem } from "../InlineList/v1/InlineListItem/index.js";
@@ -0,0 +1,26 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ export { InlineList } from "../InlineList/v2/index.js";
25
+ export { List, ListItem } from "../List/v2/index.js";
26
+ export { InlineListItem } from "../InlineList/v2/InlineListItem/index.js";
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = exports.InlineListItem = void 0;
8
8
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
9
  var _react = require("react");
10
- var _View = require("@instructure/ui-view/lib/View");
10
+ var _v11_ = require("@instructure/ui-view/v11_6");
11
11
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
12
12
  var _emotion = require("@instructure/emotion");
13
13
  var _styles = _interopRequireDefault(require("./styles"));
@@ -45,7 +45,7 @@ parent: InlineList
45
45
  id: InlineList.Item
46
46
  ---
47
47
  **/
48
- let InlineListItem = exports.InlineListItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_InlineListItem = class InlineListItem extends _react.Component {
48
+ let InlineListItem = exports.InlineListItem = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_InlineListItem = class InlineListItem extends _react.Component {
49
49
  constructor(...args) {
50
50
  super(...args);
51
51
  this.ref = null;
@@ -77,7 +77,7 @@ let InlineListItem = exports.InlineListItem = (_dec = (0, _emotion.withStyle)(_s
77
77
  styles = _this$props3.styles,
78
78
  lastPlaceholder = _this$props3.lastPlaceholder,
79
79
  rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
80
- return (0, _jsxRuntime.jsxs)(_View.View, {
80
+ return (0, _jsxRuntime.jsxs)(_v11_.View, {
81
81
  ...(0, _passthroughProps.passthroughProps)(rest),
82
82
  css: styles === null || styles === void 0 ? void 0 : styles.inlineListItem,
83
83
  as: "li",
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = exports.InlineList = void 0;
8
8
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
9
  var _react = require("react");
10
- var _View = require("@instructure/ui-view/lib/View");
10
+ var _v11_ = require("@instructure/ui-view/v11_6");
11
11
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
12
12
  var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
13
13
  var _InlineListItem = require("./InlineListItem");
@@ -75,7 +75,7 @@ class InlineList extends _react.Component {
75
75
  margin = _this$props.margin,
76
76
  elementRef = _this$props.elementRef,
77
77
  rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
78
- return (0, _jsxRuntime.jsx)(_View.View, {
78
+ return (0, _jsxRuntime.jsx)(_v11_.View, {
79
79
  ...(0, _passthroughProps.passthroughProps)(rest),
80
80
  as: as,
81
81
  margin: margin,
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.InlineListItem = void 0;
8
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
+ var _react = require("react");
10
+ var _latest = require("@instructure/ui-view/latest");
11
+ var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
12
+ var _emotion = require("@instructure/emotion");
13
+ var _styles = _interopRequireDefault(require("./styles"));
14
+ var _props = require("./props");
15
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
16
+ const _excluded = ["delimiter", "size", "margin", "padding", "elementRef", "children", "spacing", "styles", "lastPlaceholder"];
17
+ var _dec, _class, _InlineListItem;
18
+ /*
19
+ * The MIT License (MIT)
20
+ *
21
+ * Copyright (c) 2015 - present Instructure, Inc.
22
+ *
23
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ * of this software and associated documentation files (the "Software"), to deal
25
+ * in the Software without restriction, including without limitation the rights
26
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ * copies of the Software, and to permit persons to whom the Software is
28
+ * furnished to do so, subject to the following conditions:
29
+ *
30
+ * The above copyright notice and this permission notice shall be included in all
31
+ * copies or substantial portions of the Software.
32
+ *
33
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39
+ * SOFTWARE.
40
+ */
41
+ /**
42
+ ---
43
+ parent: InlineList
44
+ id: InlineList.Item
45
+ ---
46
+ **/
47
+ let InlineListItem = exports.InlineListItem = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_InlineListItem = class InlineListItem extends _react.Component {
48
+ constructor(...args) {
49
+ super(...args);
50
+ this.ref = null;
51
+ this.handleRef = el => {
52
+ const elementRef = this.props.elementRef;
53
+ this.ref = el;
54
+ if (typeof elementRef === 'function') {
55
+ elementRef(el);
56
+ }
57
+ };
58
+ }
59
+ componentDidMount() {
60
+ var _this$props$makeStyle, _this$props;
61
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
62
+ }
63
+ componentDidUpdate() {
64
+ var _this$props$makeStyle2, _this$props2;
65
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
66
+ }
67
+ render() {
68
+ const _this$props3 = this.props,
69
+ delimiter = _this$props3.delimiter,
70
+ size = _this$props3.size,
71
+ margin = _this$props3.margin,
72
+ padding = _this$props3.padding,
73
+ elementRef = _this$props3.elementRef,
74
+ children = _this$props3.children,
75
+ spacing = _this$props3.spacing,
76
+ styles = _this$props3.styles,
77
+ lastPlaceholder = _this$props3.lastPlaceholder,
78
+ rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
79
+ return (0, _jsxRuntime.jsxs)(_latest.View, {
80
+ ...(0, _passthroughProps.passthroughProps)(rest),
81
+ css: styles === null || styles === void 0 ? void 0 : styles.inlineListItem,
82
+ as: "li",
83
+ margin: margin,
84
+ padding: padding,
85
+ display: "inline-block",
86
+ maxWidth: "100%",
87
+ elementRef: this.handleRef,
88
+ "data-cid": "InlineListItem",
89
+ children: [children, !lastPlaceholder && (0, _jsxRuntime.jsx)("span", {
90
+ css: styles === null || styles === void 0 ? void 0 : styles.delimiter,
91
+ "aria-hidden": "true"
92
+ })]
93
+ });
94
+ }
95
+ }, _InlineListItem.displayName = "InlineListItem", _InlineListItem.componentId = 'InlineList.Item', _InlineListItem.allowedProps = _props.allowedProps, _InlineListItem.defaultProps = {
96
+ padding: 'none',
97
+ spacing: 'none',
98
+ delimiter: 'none',
99
+ size: 'medium',
100
+ lastPlaceholder: false
101
+ }, _InlineListItem)) || _class);
102
+ var _default = exports.default = InlineListItem;
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _console = require("@instructure/console");
8
+ /*
9
+ * The MIT License (MIT)
10
+ *
11
+ * Copyright (c) 2015 - present Instructure, Inc.
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ * copies of the Software, and to permit persons to whom the Software is
18
+ * furnished to do so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all
21
+ * copies or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ * SOFTWARE.
30
+ */
31
+
32
+ /**
33
+ * ---
34
+ * private: true
35
+ * ---
36
+ * Generates the style object from the theme and provided additional information
37
+ * @param {Object} componentTheme The theme variable object.
38
+ * @param {Object} props the props of the component, the style is applied to
39
+ * @return {Object} The final style object, which will be used in the component
40
+ */
41
+ const generateStyle = (componentTheme, props) => {
42
+ const size = props.size,
43
+ delimiter = props.delimiter,
44
+ spacing = props.spacing;
45
+ const withDelimiter = delimiter !== 'none';
46
+ const withSpacing = spacing !== 'none';
47
+ (0, _console.logError)(!(withDelimiter && withSpacing), `[InlineList] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`);
48
+ const sizeVariants = {
49
+ small: {
50
+ fontSize: componentTheme.fontSizeSmall
51
+ },
52
+ medium: {
53
+ fontSize: componentTheme.fontSizeMedium
54
+ },
55
+ large: {
56
+ fontSize: componentTheme.fontSizeLarge
57
+ }
58
+ };
59
+ const spacingVariants = {
60
+ 'xxx-small': {
61
+ marginInlineStart: componentTheme.spacingXXXSmall,
62
+ marginInlineEnd: componentTheme.spacingXXXSmall
63
+ },
64
+ 'xx-small': {
65
+ marginInlineStart: componentTheme.spacingXXSmall,
66
+ marginInlineEnd: componentTheme.spacingXXSmall
67
+ },
68
+ 'x-small': {
69
+ marginInlineStart: componentTheme.spacingXSmall,
70
+ marginInlineEnd: componentTheme.spacingXSmall
71
+ },
72
+ small: {
73
+ marginInlineStart: componentTheme.spacingSmall,
74
+ marginInlineEnd: componentTheme.spacingSmall
75
+ },
76
+ medium: {
77
+ marginInlineStart: componentTheme.spacingMedium,
78
+ marginInlineEnd: componentTheme.spacingMedium
79
+ },
80
+ large: {
81
+ marginInlineStart: componentTheme.spacingLarge,
82
+ marginInlineEnd: componentTheme.spacingLarge
83
+ },
84
+ 'x-large': {
85
+ marginInlineStart: componentTheme.spacingXLarge,
86
+ marginInlineEnd: componentTheme.spacingXLarge
87
+ },
88
+ 'xx-large': {
89
+ marginInlineStart: componentTheme.spacingXXLarge,
90
+ marginInlineEnd: componentTheme.spacingXXLarge
91
+ },
92
+ none: {}
93
+ };
94
+ const delimiterVariants = {
95
+ none: {
96
+ marginInlineStart: componentTheme.noneSpacing,
97
+ marginInlineEnd: componentTheme.noneSpacing
98
+ },
99
+ pipe: {
100
+ marginInlineStart: componentTheme.pipeSpacing,
101
+ marginInlineEnd: componentTheme.pipeSpacing,
102
+ '&::after': {
103
+ content: '"\\007C"'
104
+ }
105
+ },
106
+ slash: {
107
+ marginInlineStart: componentTheme.slashSpacing,
108
+ marginInlineEnd: componentTheme.slashSpacing,
109
+ '&::after': {
110
+ content: '"\\002F"'
111
+ }
112
+ },
113
+ arrow: {
114
+ marginInlineStart: componentTheme.arrowSpacing,
115
+ marginInlineEnd: componentTheme.arrowSpacing,
116
+ '&::after': {
117
+ content: '"\\003E"'
118
+ }
119
+ }
120
+ };
121
+ return {
122
+ inlineListItem: {
123
+ label: 'inlineListItem',
124
+ fontWeight: componentTheme.fontWeight,
125
+ fontFamily: componentTheme.fontFamily,
126
+ verticalAlign: 'middle',
127
+ boxSizing: 'border-box',
128
+ lineHeight: componentTheme.lineHeight,
129
+ color: componentTheme.color,
130
+ ...(withSpacing && !withDelimiter && spacingVariants[spacing]),
131
+ ...sizeVariants[size],
132
+ '&:first-of-type': {
133
+ marginInlineStart: 0
134
+ },
135
+ '&:last-of-type': {
136
+ marginInlineEnd: 0
137
+ }
138
+ },
139
+ delimiter: {
140
+ label: 'inlineListItem__delimiter',
141
+ ...delimiterVariants[delimiter],
142
+ '[class$=-inlineListItem]:last-of-type > &:last-child::after': {
143
+ content: 'none'
144
+ },
145
+ color: componentTheme.delimiterColor
146
+ }
147
+ };
148
+ };
149
+ var _default = exports.default = generateStyle;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.InlineList = void 0;
8
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
+ var _react = require("react");
10
+ var _latest = require("@instructure/ui-view/latest");
11
+ var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
12
+ var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
13
+ var _InlineListItem = require("./InlineListItem");
14
+ var _props = require("./props");
15
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
16
+ const _excluded = ["as", "margin", "elementRef"];
17
+ /*
18
+ * The MIT License (MIT)
19
+ *
20
+ * Copyright (c) 2015 - present Instructure, Inc.
21
+ *
22
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
23
+ * of this software and associated documentation files (the "Software"), to deal
24
+ * in the Software without restriction, including without limitation the rights
25
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26
+ * copies of the Software, and to permit persons to whom the Software is
27
+ * furnished to do so, subject to the following conditions:
28
+ *
29
+ * The above copyright notice and this permission notice shall be included in all
30
+ * copies or substantial portions of the Software.
31
+ *
32
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38
+ * SOFTWARE.
39
+ */
40
+ /**
41
+ ---
42
+ category: components
43
+ ---
44
+
45
+ **/
46
+ class InlineList extends _react.Component {
47
+ constructor(...args) {
48
+ super(...args);
49
+ this.ref = null;
50
+ this.handleRef = el => {
51
+ const elementRef = this.props.elementRef;
52
+ this.ref = el;
53
+ if (typeof elementRef === 'function') {
54
+ elementRef(el);
55
+ }
56
+ };
57
+ }
58
+ renderChildren() {
59
+ const childrenArray = _react.Children.toArray(this.props.children);
60
+ const lastIndex = childrenArray.length - 1;
61
+ return childrenArray.map((child, index) => {
62
+ if (!child) return null;
63
+ const shouldRenderPlaceholder = index === lastIndex;
64
+ return (0, _safeCloneElement.safeCloneElement)(child, {
65
+ delimiter: this.props.delimiter,
66
+ size: this.props.size,
67
+ spacing: this.props.itemSpacing,
68
+ lastPlaceholder: shouldRenderPlaceholder
69
+ });
70
+ });
71
+ }
72
+ render() {
73
+ const _this$props = this.props,
74
+ as = _this$props.as,
75
+ margin = _this$props.margin,
76
+ elementRef = _this$props.elementRef,
77
+ rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
78
+ return (0, _jsxRuntime.jsx)(_latest.View, {
79
+ ...(0, _passthroughProps.passthroughProps)(rest),
80
+ as: as,
81
+ margin: margin,
82
+ padding: "0",
83
+ elementRef: this.handleRef,
84
+ display: "block",
85
+ "data-cid": "InlineList",
86
+ children: this.renderChildren()
87
+ });
88
+ }
89
+ }
90
+ 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
+ var _default = exports.default = InlineList;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.allowedProps = void 0;
7
+ /*
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2015 - present Instructure, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+
31
+ const allowedProps = exports.allowedProps = ['children', 'as', 'margin', 'size', 'delimiter', 'itemSpacing', 'elementRef'];