@instructure/ui-list 11.6.0 → 11.6.1-pr-snapshot-1779894247159

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 CHANGED
@@ -3,6 +3,14 @@
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.6.1-pr-snapshot-1779894247159](https://github.com/instructure/instructure-ui/compare/v11.6.0...v11.6.1-pr-snapshot-1779894247159) (2026-05-27)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-list
9
+
10
+
11
+
12
+
13
+
6
14
  # [11.6.0](https://github.com/instructure/instructure-ui/compare/v11.5.0...v11.6.0) (2026-02-18)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-list
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowedProps = void 0;
7
1
  /*
8
2
  * The MIT License (MIT)
9
3
  *
@@ -28,4 +22,16 @@ exports.allowedProps = void 0;
28
22
  * SOFTWARE.
29
23
  */
30
24
 
31
- const allowedProps = exports.allowedProps = ['children', 'as', 'margin', 'size', 'delimiter', 'itemSpacing', 'elementRef'];
25
+ module.exports = {
26
+ presets: [
27
+ [
28
+ require('@instructure/ui-babel-preset'),
29
+ {
30
+ coverage: Boolean(process.env.COVERAGE),
31
+ esModules: Boolean(process.env.ES_MODULES),
32
+ removeConsole: process.env.NODE_ENV === 'production',
33
+ transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
34
+ }
35
+ ]
36
+ ]
37
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@instructure/ui-list",
3
- "version": "11.6.0",
3
+ "version": "11.6.1-pr-snapshot-1779894247159",
4
+ "type": "module",
4
5
  "description": "Components for displaying vertical or horizontal lists.",
5
6
  "author": "Instructure, Inc. Engineering and Product Design",
6
7
  "module": "./es/index.js",
7
- "main": "./lib/index.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "repository": {
10
10
  "type": "git",
@@ -15,20 +15,20 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
- "@instructure/shared-types": "11.6.0",
19
- "@instructure/emotion": "11.6.0",
20
- "@instructure/ui-react-utils": "11.6.0",
21
- "@instructure/ui-view": "11.6.0",
22
- "@instructure/console": "11.6.0"
18
+ "@instructure/console": "11.6.1-pr-snapshot-1779894247159",
19
+ "@instructure/shared-types": "11.6.1-pr-snapshot-1779894247159",
20
+ "@instructure/ui-react-utils": "11.6.1-pr-snapshot-1779894247159",
21
+ "@instructure/ui-view": "11.6.1-pr-snapshot-1779894247159",
22
+ "@instructure/emotion": "11.6.1-pr-snapshot-1779894247159"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@testing-library/jest-dom": "^6.6.3",
26
26
  "@testing-library/react": "15.0.7",
27
27
  "vitest": "^3.2.2",
28
- "@instructure/ui-axe-check": "11.6.0",
29
- "@instructure/ui-babel-preset": "11.6.0",
30
- "@instructure/ui-themes": "11.6.0",
31
- "@instructure/ui-color-utils": "11.6.0"
28
+ "@instructure/ui-axe-check": "11.6.1-pr-snapshot-1779894247159",
29
+ "@instructure/ui-babel-preset": "11.6.1-pr-snapshot-1779894247159",
30
+ "@instructure/ui-color-utils": "11.6.1-pr-snapshot-1779894247159",
31
+ "@instructure/ui-themes": "11.6.1-pr-snapshot-1779894247159"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=18 <=19"
@@ -41,10 +41,8 @@
41
41
  ".": {
42
42
  "types": "./types/index.d.ts",
43
43
  "import": "./es/index.js",
44
- "require": "./lib/index.js",
45
44
  "default": "./es/index.js"
46
45
  },
47
- "./lib/*": "./lib/*",
48
46
  "./es/*": "./es/*",
49
47
  "./types/*": "./types/*",
50
48
  "./package.json": "./package.json",
@@ -54,7 +52,7 @@
54
52
  "lint": "ui-scripts lint",
55
53
  "lint:fix": "ui-scripts lint --fix",
56
54
  "clean": "ui-scripts clean",
57
- "build": "ui-scripts build --modules es,cjs",
55
+ "build": "ui-scripts build",
58
56
  "build:watch": "pnpm run ts:check -- --watch & ui-scripts build --watch",
59
57
  "build:types": "tsc -p tsconfig.build.json",
60
58
  "ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
@@ -1,103 +0,0 @@
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 _View = require("@instructure/ui-view/lib/View");
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 _theme = _interopRequireDefault(require("./theme"));
15
- var _props = require("./props");
16
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
17
- const _excluded = ["delimiter", "size", "margin", "padding", "elementRef", "children", "spacing", "styles", "lastPlaceholder"];
18
- var _dec, _class, _InlineListItem;
19
- /*
20
- * The MIT License (MIT)
21
- *
22
- * Copyright (c) 2015 - present Instructure, Inc.
23
- *
24
- * Permission is hereby granted, free of charge, to any person obtaining a copy
25
- * of this software and associated documentation files (the "Software"), to deal
26
- * in the Software without restriction, including without limitation the rights
27
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28
- * copies of the Software, and to permit persons to whom the Software is
29
- * furnished to do so, subject to the following conditions:
30
- *
31
- * The above copyright notice and this permission notice shall be included in all
32
- * copies or substantial portions of the Software.
33
- *
34
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40
- * SOFTWARE.
41
- */
42
- /**
43
- ---
44
- parent: InlineList
45
- id: InlineList.Item
46
- ---
47
- **/
48
- let InlineListItem = exports.InlineListItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_InlineListItem = class InlineListItem extends _react.Component {
49
- constructor(...args) {
50
- super(...args);
51
- this.ref = null;
52
- this.handleRef = el => {
53
- const elementRef = this.props.elementRef;
54
- this.ref = el;
55
- if (typeof elementRef === 'function') {
56
- elementRef(el);
57
- }
58
- };
59
- }
60
- componentDidMount() {
61
- var _this$props$makeStyle, _this$props;
62
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
63
- }
64
- componentDidUpdate() {
65
- var _this$props$makeStyle2, _this$props2;
66
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
67
- }
68
- render() {
69
- const _this$props3 = this.props,
70
- delimiter = _this$props3.delimiter,
71
- size = _this$props3.size,
72
- margin = _this$props3.margin,
73
- padding = _this$props3.padding,
74
- elementRef = _this$props3.elementRef,
75
- children = _this$props3.children,
76
- spacing = _this$props3.spacing,
77
- styles = _this$props3.styles,
78
- lastPlaceholder = _this$props3.lastPlaceholder,
79
- rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
80
- return (0, _jsxRuntime.jsxs)(_View.View, {
81
- ...(0, _passthroughProps.passthroughProps)(rest),
82
- css: styles === null || styles === void 0 ? void 0 : styles.inlineListItem,
83
- as: "li",
84
- margin: margin,
85
- padding: padding,
86
- display: "inline-block",
87
- maxWidth: "100%",
88
- elementRef: this.handleRef,
89
- "data-cid": "InlineListItem",
90
- children: [children, !lastPlaceholder && (0, _jsxRuntime.jsx)("span", {
91
- css: styles === null || styles === void 0 ? void 0 : styles.delimiter,
92
- "aria-hidden": "true"
93
- })]
94
- });
95
- }
96
- }, _InlineListItem.displayName = "InlineListItem", _InlineListItem.componentId = 'InlineList.Item', _InlineListItem.allowedProps = _props.allowedProps, _InlineListItem.defaultProps = {
97
- padding: 'none',
98
- spacing: 'none',
99
- delimiter: 'none',
100
- size: 'medium',
101
- lastPlaceholder: false
102
- }, _InlineListItem)) || _class);
103
- var _default = exports.default = InlineListItem;
@@ -1,33 +0,0 @@
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
- // <unknown> is needed for React 17 compatibility
32
-
33
- const allowedProps = exports.allowedProps = ['children', 'delimiter', 'size', 'margin', 'padding', 'spacing', 'elementRef'];
@@ -1,152 +0,0 @@
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
- * @param {String} props.delimiter
40
- * @param {String} props.spacing
41
- * @param {Object} state the state of the component, the style is applied to
42
- * @return {Object} The final style object, which will be used in the component
43
- */
44
- const generateStyle = (componentTheme, props) => {
45
- const size = props.size,
46
- delimiter = props.delimiter,
47
- spacing = props.spacing;
48
- const withDelimiter = delimiter !== 'none';
49
- const withSpacing = spacing !== 'none';
50
- (0, _console.logError)(!(withDelimiter && withSpacing), `[InlineList] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`);
51
- const sizeVariants = {
52
- small: {
53
- fontSize: componentTheme.fontSizeSmall
54
- },
55
- medium: {
56
- fontSize: componentTheme.fontSizeMedium
57
- },
58
- large: {
59
- fontSize: componentTheme.fontSizeLarge
60
- }
61
- };
62
- const spacingVariants = {
63
- 'xxx-small': {
64
- marginInlineStart: componentTheme.spacingXXXSmall,
65
- marginInlineEnd: componentTheme.spacingXXXSmall
66
- },
67
- 'xx-small': {
68
- marginInlineStart: componentTheme.spacingXXSmall,
69
- marginInlineEnd: componentTheme.spacingXXSmall
70
- },
71
- 'x-small': {
72
- marginInlineStart: componentTheme.spacingXSmall,
73
- marginInlineEnd: componentTheme.spacingXSmall
74
- },
75
- small: {
76
- marginInlineStart: componentTheme.spacingSmall,
77
- marginInlineEnd: componentTheme.spacingSmall
78
- },
79
- medium: {
80
- marginInlineStart: componentTheme.spacingMedium,
81
- marginInlineEnd: componentTheme.spacingMedium
82
- },
83
- large: {
84
- marginInlineStart: componentTheme.spacingLarge,
85
- marginInlineEnd: componentTheme.spacingLarge
86
- },
87
- 'x-large': {
88
- marginInlineStart: componentTheme.spacingXLarge,
89
- marginInlineEnd: componentTheme.spacingXLarge
90
- },
91
- 'xx-large': {
92
- marginInlineStart: componentTheme.spacingXXLarge,
93
- marginInlineEnd: componentTheme.spacingXXLarge
94
- },
95
- none: {}
96
- };
97
- const delimiterVariants = {
98
- none: {
99
- marginInlineStart: componentTheme.noneSpacing,
100
- marginInlineEnd: componentTheme.noneSpacing
101
- },
102
- pipe: {
103
- marginInlineStart: componentTheme.pipeSpacing,
104
- marginInlineEnd: componentTheme.pipeSpacing,
105
- '&::after': {
106
- content: '"\\007C"'
107
- }
108
- },
109
- slash: {
110
- marginInlineStart: componentTheme.slashSpacing,
111
- marginInlineEnd: componentTheme.slashSpacing,
112
- '&::after': {
113
- content: '"\\002F"'
114
- }
115
- },
116
- arrow: {
117
- marginInlineStart: componentTheme.arrowSpacing,
118
- marginInlineEnd: componentTheme.arrowSpacing,
119
- '&::after': {
120
- content: '"\\003E"'
121
- }
122
- }
123
- };
124
- return {
125
- inlineListItem: {
126
- label: 'inlineListItem',
127
- fontWeight: componentTheme.fontWeight,
128
- fontFamily: componentTheme.fontFamily,
129
- verticalAlign: 'middle',
130
- boxSizing: 'border-box',
131
- lineHeight: componentTheme.lineHeight,
132
- color: componentTheme.color,
133
- ...(withSpacing && !withDelimiter && spacingVariants[spacing]),
134
- ...sizeVariants[size],
135
- '&:first-of-type': {
136
- marginInlineStart: 0
137
- },
138
- '&:last-of-type': {
139
- marginInlineEnd: 0
140
- }
141
- },
142
- delimiter: {
143
- label: 'inlineListItem__delimiter',
144
- ...delimiterVariants[delimiter],
145
- '[class$=-inlineListItem]:last-of-type > &:last-child::after': {
146
- content: 'none'
147
- },
148
- color: componentTheme.delimiterColor
149
- }
150
- };
151
- };
152
- var _default = exports.default = generateStyle;
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = 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
- /**
32
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- var _colors$contrasts, _colors$contrasts2;
38
- const colors = theme.colors,
39
- spacing = theme.spacing,
40
- typography = theme.typography,
41
- themeName = theme.key;
42
- const themeSpecificStyle = {
43
- canvas: {
44
- color: theme['ic-brand-font-color-dark']
45
- }
46
- };
47
- const componentVariables = {
48
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
49
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
50
- fontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
51
- fontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
52
- fontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeLarge,
53
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey4570,
54
- delimiterColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey125125,
55
- lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
56
- noneSpacing: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
57
- pipeSpacing: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
58
- slashSpacing: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
59
- arrowSpacing: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
60
- marginBottomDefault: spacing === null || spacing === void 0 ? void 0 : spacing.xxxSmall,
61
- spacingXXXSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xxxSmall,
62
- spacingXXSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xxSmall,
63
- spacingXSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
64
- spacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.small,
65
- spacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
66
- spacingLarge: spacing === null || spacing === void 0 ? void 0 : spacing.large,
67
- spacingXLarge: spacing === null || spacing === void 0 ? void 0 : spacing.xLarge,
68
- spacingXXLarge: spacing === null || spacing === void 0 ? void 0 : spacing.xxLarge
69
- };
70
- return {
71
- ...componentVariables,
72
- ...themeSpecificStyle[themeName]
73
- };
74
- };
75
- var _default = exports.default = generateComponentTheme;
@@ -1,101 +0,0 @@
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 _View = require("@instructure/ui-view/lib/View");
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)(_View.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;
@@ -1,97 +0,0 @@
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.ListItem = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
- var _react = require("react");
10
- var _View = require("@instructure/ui-view/lib/View");
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 _theme = _interopRequireDefault(require("./theme"));
15
- var _props = require("./props");
16
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
17
- const _excluded = ["delimiter", "spacing", "size", "margin", "padding", "elementRef", "children", "styles"];
18
- var _dec, _class, _ListItem;
19
- /*
20
- * The MIT License (MIT)
21
- *
22
- * Copyright (c) 2015 - present Instructure, Inc.
23
- *
24
- * Permission is hereby granted, free of charge, to any person obtaining a copy
25
- * of this software and associated documentation files (the "Software"), to deal
26
- * in the Software without restriction, including without limitation the rights
27
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28
- * copies of the Software, and to permit persons to whom the Software is
29
- * furnished to do so, subject to the following conditions:
30
- *
31
- * The above copyright notice and this permission notice shall be included in all
32
- * copies or substantial portions of the Software.
33
- *
34
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40
- * SOFTWARE.
41
- */
42
- /**
43
- ---
44
- parent: List
45
- id: List.Item
46
- ---
47
- **/
48
- let ListItem = exports.ListItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_ListItem = class ListItem extends _react.Component {
49
- constructor(...args) {
50
- super(...args);
51
- this.ref = null;
52
- this.handleRef = el => {
53
- const elementRef = this.props.elementRef;
54
- this.ref = el;
55
- if (typeof elementRef === 'function') {
56
- elementRef(el);
57
- }
58
- };
59
- }
60
- componentDidMount() {
61
- var _this$props$makeStyle, _this$props;
62
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
63
- }
64
- componentDidUpdate() {
65
- var _this$props$makeStyle2, _this$props2;
66
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
67
- }
68
- render() {
69
- const _this$props3 = this.props,
70
- delimiter = _this$props3.delimiter,
71
- spacing = _this$props3.spacing,
72
- size = _this$props3.size,
73
- margin = _this$props3.margin,
74
- padding = _this$props3.padding,
75
- elementRef = _this$props3.elementRef,
76
- children = _this$props3.children,
77
- styles = _this$props3.styles,
78
- rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
79
- return (0, _jsxRuntime.jsx)(_View.View, {
80
- ...(0, _passthroughProps.passthroughProps)(rest),
81
- css: styles === null || styles === void 0 ? void 0 : styles.listItem,
82
- as: "li",
83
- margin: margin,
84
- padding: padding,
85
- maxWidth: "100%",
86
- elementRef: this.handleRef,
87
- "data-cid": "ListItem",
88
- children: children
89
- });
90
- }
91
- }, _ListItem.displayName = "ListItem", _ListItem.componentId = 'List.Item', _ListItem.allowedProps = _props.allowedProps, _ListItem.defaultProps = {
92
- padding: 'none',
93
- spacing: 'none',
94
- delimiter: 'none',
95
- size: 'medium'
96
- }, _ListItem)) || _class);
97
- var _default = exports.default = ListItem;
@@ -1,33 +0,0 @@
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
- // <unknown> is needed for React 17 compatibility
32
-
33
- const allowedProps = exports.allowedProps = ['children', 'delimiter', 'size', 'margin', 'padding', 'spacing', 'elementRef'];
@@ -1,132 +0,0 @@
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
- * @param {String} props.delimiter
40
- * @param {String} props.spacing
41
- * @param {Object} state the state of the component, the style is applied to
42
- * @return {Object} The final style object, which will be used in the component
43
- */
44
- const generateStyle = (componentTheme, props) => {
45
- const size = props.size,
46
- delimiter = props.delimiter,
47
- spacing = props.spacing;
48
- const withDelimiter = delimiter !== 'none';
49
- const withSpacing = spacing !== 'none';
50
- (0, _console.logError)(!(withDelimiter && withSpacing), `[List] \`itemSpacing\` has no effect inside Lists with the \`delimiter\` prop set to anything other than \`none\`.`);
51
- const sizeVariants = {
52
- small: {
53
- fontSize: componentTheme.fontSizeSmall
54
- },
55
- medium: {
56
- fontSize: componentTheme.fontSizeMedium
57
- },
58
- large: {
59
- fontSize: componentTheme.fontSizeLarge
60
- }
61
- };
62
- const spacingVariants = {
63
- 'xxx-small': {
64
- marginTop: componentTheme.spacingXXXSmall,
65
- marginBottom: componentTheme.spacingXXXSmall
66
- },
67
- 'xx-small': {
68
- marginTop: componentTheme.spacingXXSmall,
69
- marginBottom: componentTheme.spacingXXSmall
70
- },
71
- 'x-small': {
72
- marginTop: componentTheme.spacingXSmall,
73
- marginBottom: componentTheme.spacingXSmall
74
- },
75
- small: {
76
- marginTop: componentTheme.spacingSmall,
77
- marginBottom: componentTheme.spacingSmall
78
- },
79
- medium: {
80
- marginTop: componentTheme.spacingMedium,
81
- marginBottom: componentTheme.spacingMedium
82
- },
83
- large: {
84
- marginTop: componentTheme.spacingLarge,
85
- marginBottom: componentTheme.spacingLarge
86
- },
87
- 'x-large': {
88
- marginTop: componentTheme.spacingXLarge,
89
- marginBottom: componentTheme.spacingXLarge
90
- },
91
- 'xx-large': {
92
- marginTop: componentTheme.spacingXXLarge,
93
- marginBottom: componentTheme.spacingXXLarge
94
- },
95
- none: {}
96
- };
97
- const delimiterVariants = {
98
- dashed: {
99
- listStylePosition: 'inside',
100
- '&:not(:first-of-type)': {
101
- borderTop: componentTheme.delimiterDashedBorder
102
- }
103
- },
104
- solid: {
105
- listStylePosition: 'inside',
106
- '&:not(:first-of-type)': {
107
- borderTop: componentTheme.delimiterSolidBorder
108
- }
109
- },
110
- none: {}
111
- };
112
- return {
113
- listItem: {
114
- label: 'listItem',
115
- fontWeight: componentTheme.fontWeight,
116
- fontFamily: componentTheme.fontFamily,
117
- lineHeight: componentTheme.lineHeight,
118
- color: componentTheme.color,
119
- padding: 0,
120
- ...sizeVariants[size],
121
- ...(withSpacing && !withDelimiter && spacingVariants[spacing]),
122
- ...(withDelimiter && delimiterVariants[delimiter]),
123
- '&:first-of-type': {
124
- marginTop: '0'
125
- },
126
- '&:last-of-type': {
127
- marginBottom: '0'
128
- }
129
- }
130
- };
131
- };
132
- var _default = exports.default = generateStyle;
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = 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
- /**
32
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- var _colors$contrasts, _colors$contrasts2, _colors$contrasts3;
38
- const borders = theme.borders,
39
- colors = theme.colors,
40
- spacing = theme.spacing,
41
- typography = theme.typography,
42
- themeName = theme.key;
43
- const themeSpecificStyle = {
44
- canvas: {
45
- color: theme['ic-brand-font-color-dark']
46
- }
47
- };
48
- const componentVariables = {
49
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
50
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
51
- lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeight,
52
- fontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
53
- fontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
54
- fontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeLarge,
55
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
56
- spacingXXXSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xxxSmall,
57
- spacingXXSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xxSmall,
58
- spacingXSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
59
- spacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.small,
60
- spacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
61
- spacingLarge: spacing === null || spacing === void 0 ? void 0 : spacing.large,
62
- spacingXLarge: spacing === null || spacing === void 0 ? void 0 : spacing.xLarge,
63
- spacingXXLarge: spacing === null || spacing === void 0 ? void 0 : spacing.xxLarge,
64
- delimiterDashedBorder: `${borders === null || borders === void 0 ? void 0 : borders.widthSmall} dashed ${colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey1214}`,
65
- delimiterSolidBorder: `${borders === null || borders === void 0 ? void 0 : borders.widthSmall} solid ${colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey1214}`
66
- };
67
- return {
68
- ...componentVariables,
69
- ...themeSpecificStyle[themeName]
70
- };
71
- };
72
- var _default = exports.default = generateComponentTheme;
package/lib/List/index.js DELETED
@@ -1,114 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.List = void 0;
8
- Object.defineProperty(exports, "ListItem", {
9
- enumerable: true,
10
- get: function () {
11
- return _ListItem.ListItem;
12
- }
13
- });
14
- exports.default = void 0;
15
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
16
- var _react = require("react");
17
- var _View = require("@instructure/ui-view/lib/View");
18
- var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
19
- var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
20
- var _ListItem = require("./ListItem");
21
- var _emotion = require("@instructure/emotion");
22
- var _styles = _interopRequireDefault(require("./styles"));
23
- var _theme = _interopRequireDefault(require("./theme"));
24
- var _props = require("./props");
25
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
26
- const _excluded = ["as", "margin", "isUnstyled", "elementRef", "styles"];
27
- var _dec, _class, _List;
28
- /*
29
- * The MIT License (MIT)
30
- *
31
- * Copyright (c) 2015 - present Instructure, Inc.
32
- *
33
- * Permission is hereby granted, free of charge, to any person obtaining a copy
34
- * of this software and associated documentation files (the "Software"), to deal
35
- * in the Software without restriction, including without limitation the rights
36
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37
- * copies of the Software, and to permit persons to whom the Software is
38
- * furnished to do so, subject to the following conditions:
39
- *
40
- * The above copyright notice and this permission notice shall be included in all
41
- * copies or substantial portions of the Software.
42
- *
43
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
49
- * SOFTWARE.
50
- */
51
- /**
52
- ---
53
- category: components
54
- ---
55
- **/
56
- let List = exports.List = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_List = class List extends _react.Component {
57
- constructor(...args) {
58
- super(...args);
59
- this.ref = null;
60
- this.handleRef = el => {
61
- const elementRef = this.props.elementRef;
62
- this.ref = el;
63
- if (typeof elementRef === 'function') {
64
- elementRef(el);
65
- }
66
- };
67
- }
68
- componentDidMount() {
69
- var _this$props$makeStyle, _this$props;
70
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
71
- }
72
- componentDidUpdate() {
73
- var _this$props$makeStyle2, _this$props2;
74
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
75
- }
76
- renderChildren() {
77
- return _react.Children.map(this.props.children, child => {
78
- if (!child) return; // ignore null, falsy children
79
-
80
- return (0, _safeCloneElement.safeCloneElement)(child, {
81
- isUnstyled: this.props.isUnstyled,
82
- delimiter: this.props.delimiter,
83
- size: this.props.size,
84
- spacing: this.props.itemSpacing
85
- });
86
- });
87
- }
88
- render() {
89
- const _this$props3 = this.props,
90
- as = _this$props3.as,
91
- margin = _this$props3.margin,
92
- isUnstyled = _this$props3.isUnstyled,
93
- elementRef = _this$props3.elementRef,
94
- styles = _this$props3.styles,
95
- rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
96
- return (0, _jsxRuntime.jsx)(_View.View, {
97
- ...(0, _passthroughProps.passthroughProps)(rest),
98
- css: styles === null || styles === void 0 ? void 0 : styles.list,
99
- as: as,
100
- margin: margin,
101
- elementRef: this.handleRef,
102
- display: "block",
103
- "data-cid": "List",
104
- children: this.renderChildren()
105
- });
106
- }
107
- }, _List.displayName = "List", _List.componentId = 'List', _List.allowedProps = _props.allowedProps, _List.defaultProps = {
108
- as: 'ul',
109
- delimiter: 'none',
110
- isUnstyled: false,
111
- size: 'medium',
112
- itemSpacing: 'none'
113
- }, _List.Item = _ListItem.ListItem, _List)) || _class);
114
- var _default = exports.default = List;
package/lib/List/props.js DELETED
@@ -1,31 +0,0 @@
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', 'delimiter', 'isUnstyled', 'margin', 'size', 'itemSpacing', 'elementRef'];
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = 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
- /**
32
- * ---
33
- * private: true
34
- * ---
35
- * Generates the style object from the theme and provided additional information
36
- * @param {Object} componentTheme The theme variable object.
37
- * @param {Object} props the props of the component, the style is applied to
38
- * @param {Object} state the state 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 isUnstyled = props.isUnstyled,
43
- as = props.as;
44
- const ordered = as === 'ol';
45
- return {
46
- list: {
47
- label: 'list',
48
- paddingInlineStart: componentTheme.listPadding,
49
- paddingInlineEnd: 0,
50
- ...(ordered && {
51
- listStyleType: 'none',
52
- // 1.3 rem is removed to have the ordered list start at the same point
53
- // as the unordered vertically
54
- paddingInlineStart: `calc(${componentTheme.listPadding} - 1.3rem)`,
55
- paddingInlineEnd: 0,
56
- counterReset: 'ol-counter',
57
- '&>li::before': {
58
- fontWeight: componentTheme.orderedNumberFontWeight,
59
- counterIncrement: 'ol-counter',
60
- content: 'counters(ol-counter, ".") "."',
61
- marginInlineEnd: componentTheme.orderedNumberMargin,
62
- marginInlineStart: 0
63
- }
64
- }),
65
- ...(isUnstyled && {
66
- listStyleType: 'none',
67
- paddingInlineStart: 0
68
- })
69
- }
70
- };
71
- };
72
- var _default = exports.default = generateStyle;
package/lib/List/theme.js DELETED
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = 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
- /**
32
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- const spacing = theme.spacing,
38
- typography = theme.typography;
39
- const componentVariables = {
40
- listPadding: spacing === null || spacing === void 0 ? void 0 : spacing.large,
41
- orderedNumberFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
42
- orderedNumberMargin: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall
43
- };
44
- return {
45
- ...componentVariables
46
- };
47
- };
48
- var _default = exports.default = generateComponentTheme;
package/lib/index.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "InlineList", {
7
- enumerable: true,
8
- get: function () {
9
- return _InlineList.InlineList;
10
- }
11
- });
12
- Object.defineProperty(exports, "InlineListItem", {
13
- enumerable: true,
14
- get: function () {
15
- return _InlineListItem.InlineListItem;
16
- }
17
- });
18
- Object.defineProperty(exports, "List", {
19
- enumerable: true,
20
- get: function () {
21
- return _List.List;
22
- }
23
- });
24
- Object.defineProperty(exports, "ListItem", {
25
- enumerable: true,
26
- get: function () {
27
- return _List.ListItem;
28
- }
29
- });
30
- var _InlineList = require("./InlineList");
31
- var _List = require("./List");
32
- var _InlineListItem = require("./InlineList/InlineListItem");
package/lib/package.json DELETED
@@ -1 +0,0 @@
1
- {"type":"commonjs"}