@instructure/ui-table 11.7.8 → 11.7.9-pr-snapshot-1792147648392

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 (111) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/es/Table/v1/Body/index.js +49 -72
  3. package/es/Table/v1/Body/props.js +4 -26
  4. package/es/Table/v1/Body/styles.js +12 -44
  5. package/es/Table/v1/Body/theme.js +13 -45
  6. package/es/Table/v1/Cell/index.js +47 -65
  7. package/es/Table/v1/Cell/props.js +6 -26
  8. package/es/Table/v1/Cell/styles.js +20 -56
  9. package/es/Table/v1/Cell/theme.js +16 -49
  10. package/es/Table/v1/ColHeader/index.js +82 -107
  11. package/es/Table/v1/ColHeader/props.js +11 -26
  12. package/es/Table/v1/ColHeader/styles.js +65 -101
  13. package/es/Table/v1/ColHeader/theme.js +27 -62
  14. package/es/Table/v1/Head/index.js +110 -154
  15. package/es/Table/v1/Head/props.js +5 -26
  16. package/es/Table/v1/Head/styles.js +12 -44
  17. package/es/Table/v1/Head/theme.js +13 -45
  18. package/es/Table/v1/Row/index.js +57 -79
  19. package/es/Table/v1/Row/props.js +5 -26
  20. package/es/Table/v1/Row/styles.js +31 -67
  21. package/es/Table/v1/Row/theme.js +22 -56
  22. package/es/Table/v1/RowHeader/index.js +44 -65
  23. package/es/Table/v1/RowHeader/props.js +5 -26
  24. package/es/Table/v1/RowHeader/styles.js +20 -56
  25. package/es/Table/v1/RowHeader/theme.js +16 -49
  26. package/es/Table/v1/TableContext.js +4 -43
  27. package/es/Table/v1/index.js +151 -186
  28. package/es/Table/v1/props.js +9 -26
  29. package/es/Table/v1/styles.js +31 -67
  30. package/es/Table/v1/theme.js +19 -52
  31. package/es/Table/v2/Body/index.js +49 -72
  32. package/es/Table/v2/Body/props.js +4 -26
  33. package/es/Table/v2/Body/styles.js +12 -44
  34. package/es/Table/v2/Cell/index.js +47 -65
  35. package/es/Table/v2/Cell/props.js +6 -26
  36. package/es/Table/v2/Cell/styles.js +20 -55
  37. package/es/Table/v2/ColHeader/index.js +85 -109
  38. package/es/Table/v2/ColHeader/props.js +11 -26
  39. package/es/Table/v2/ColHeader/styles.js +57 -94
  40. package/es/Table/v2/Head/index.js +111 -155
  41. package/es/Table/v2/Head/props.js +5 -26
  42. package/es/Table/v2/Head/styles.js +12 -44
  43. package/es/Table/v2/Row/index.js +40 -80
  44. package/es/Table/v2/Row/props.js +5 -26
  45. package/es/Table/v2/Row/styles.js +31 -68
  46. package/es/Table/v2/RowHeader/index.js +44 -65
  47. package/es/Table/v2/RowHeader/props.js +5 -26
  48. package/es/Table/v2/RowHeader/styles.js +20 -55
  49. package/es/Table/v2/TableContext.js +4 -43
  50. package/es/Table/v2/index.js +143 -168
  51. package/es/Table/v2/props.js +9 -26
  52. package/es/Table/v2/styles.js +31 -67
  53. package/es/exports/a.js +1 -24
  54. package/es/exports/b.js +1 -24
  55. package/package.json +16 -22
  56. package/tsconfig.build.json +0 -1
  57. package/tsconfig.build.tsbuildinfo +1 -1
  58. package/lib/Table/v1/Body/index.js +0 -86
  59. package/lib/Table/v1/Body/props.js +0 -31
  60. package/lib/Table/v1/Body/styles.js +0 -51
  61. package/lib/Table/v1/Body/theme.js +0 -52
  62. package/lib/Table/v1/Cell/index.js +0 -79
  63. package/lib/Table/v1/Cell/props.js +0 -31
  64. package/lib/Table/v1/Cell/styles.js +0 -63
  65. package/lib/Table/v1/Cell/theme.js +0 -56
  66. package/lib/Table/v1/ColHeader/index.js +0 -125
  67. package/lib/Table/v1/ColHeader/props.js +0 -31
  68. package/lib/Table/v1/ColHeader/styles.js +0 -108
  69. package/lib/Table/v1/ColHeader/theme.js +0 -69
  70. package/lib/Table/v1/Head/index.js +0 -179
  71. package/lib/Table/v1/Head/props.js +0 -31
  72. package/lib/Table/v1/Head/styles.js +0 -51
  73. package/lib/Table/v1/Head/theme.js +0 -52
  74. package/lib/Table/v1/Row/index.js +0 -93
  75. package/lib/Table/v1/Row/props.js +0 -31
  76. package/lib/Table/v1/Row/styles.js +0 -74
  77. package/lib/Table/v1/Row/theme.js +0 -63
  78. package/lib/Table/v1/RowHeader/index.js +0 -79
  79. package/lib/Table/v1/RowHeader/props.js +0 -31
  80. package/lib/Table/v1/RowHeader/styles.js +0 -63
  81. package/lib/Table/v1/RowHeader/theme.js +0 -56
  82. package/lib/Table/v1/TableContext.js +0 -51
  83. package/lib/Table/v1/index.js +0 -210
  84. package/lib/Table/v1/props.js +0 -31
  85. package/lib/Table/v1/styles.js +0 -74
  86. package/lib/Table/v1/theme.js +0 -59
  87. package/lib/Table/v2/Body/index.js +0 -85
  88. package/lib/Table/v2/Body/props.js +0 -31
  89. package/lib/Table/v2/Body/styles.js +0 -51
  90. package/lib/Table/v2/Cell/index.js +0 -78
  91. package/lib/Table/v2/Cell/props.js +0 -31
  92. package/lib/Table/v2/Cell/styles.js +0 -62
  93. package/lib/Table/v2/ColHeader/index.js +0 -124
  94. package/lib/Table/v2/ColHeader/props.js +0 -31
  95. package/lib/Table/v2/ColHeader/styles.js +0 -101
  96. package/lib/Table/v2/Head/index.js +0 -179
  97. package/lib/Table/v2/Head/props.js +0 -31
  98. package/lib/Table/v2/Head/styles.js +0 -51
  99. package/lib/Table/v2/Row/index.js +0 -95
  100. package/lib/Table/v2/Row/props.js +0 -31
  101. package/lib/Table/v2/Row/styles.js +0 -75
  102. package/lib/Table/v2/RowHeader/index.js +0 -78
  103. package/lib/Table/v2/RowHeader/props.js +0 -31
  104. package/lib/Table/v2/RowHeader/styles.js +0 -62
  105. package/lib/Table/v2/TableContext.js +0 -51
  106. package/lib/Table/v2/index.js +0 -191
  107. package/lib/Table/v2/props.js +0 -31
  108. package/lib/Table/v2/styles.js +0 -74
  109. package/lib/exports/a.js +0 -61
  110. package/lib/exports/b.js +0 -61
  111. package/lib/package.json +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.7.9-pr-snapshot-1792147648392](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-pr-snapshot-1792147648392) (2026-10-16)
7
+
8
+ ### Build System
9
+
10
+ * **many:** replace babel with swc ([7e36c54](https://github.com/instructure/instructure-ui/commit/7e36c54d240b4fa483801c03ab18e7f860f561e2))
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ * **many:** `@instructure/ui-babel-preset` and
15
+ `@instructure/browserslist-config-instui` are removed and will no longer be
16
+ published. Packages depend on `@swc/helpers` instead of `@babel/runtime`.
17
+
18
+
6
19
  ## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
7
20
 
8
21
  ### Bug Fixes
@@ -1,28 +1,5 @@
1
- var _dec, _class;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
1
+ import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
26
3
  import { Component, Children, isValidElement } from 'react';
27
4
  import { safeCloneElement, omitProps } from '@instructure/ui-react-utils';
28
5
  import { View } from '@instructure/ui-view/v11_6';
@@ -31,51 +8,51 @@ import generateStyle from './styles.js';
31
8
  import generateComponentTheme from './theme.js';
32
9
  import { allowedProps } from './props.js';
33
10
  import TableContext from '../TableContext.js';
34
-
35
- /**
36
- ---
37
- parent: Table
38
- id: Table.Body
39
- ---
40
- **/
41
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
42
- let Body = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Body extends Component {
43
- static displayName = 'Body';
44
- static componentId = 'Table.Body';
45
- static contextType = TableContext;
46
- static allowedProps = allowedProps;
47
- static defaultProps = {
48
- children: null
49
- };
50
- componentDidMount() {
51
- this.props.makeStyles?.();
52
- }
53
- componentDidUpdate() {
54
- this.props.makeStyles?.();
55
- }
56
- render() {
57
- const {
58
- children,
59
- styles
60
- } = this.props;
61
- const {
62
- isStacked
63
- } = this.context;
64
- return _jsx(View, {
65
- ...View.omitViewProps(omitProps(this.props, Body.allowedProps), Body),
66
- as: isStacked ? 'div' : 'tbody',
67
- css: styles?.body,
68
- role: isStacked ? 'rowgroup' : undefined,
69
- children: Children.map(children, child => {
70
- if (/*#__PURE__*/isValidElement(child)) {
71
- return safeCloneElement(child, {
72
- key: child.props.name
73
- });
74
- }
75
- return child;
76
- })
77
- });
78
- }
79
- }) || _class);
11
+ class Body extends Component {
12
+ static{
13
+ this.displayName = 'Body';
14
+ }
15
+ static{
16
+ this.componentId = 'Table.Body';
17
+ }
18
+ static{
19
+ this.contextType = TableContext;
20
+ }
21
+ static{
22
+ this.allowedProps = allowedProps;
23
+ }
24
+ static{
25
+ this.defaultProps = {
26
+ children: null
27
+ };
28
+ }
29
+ componentDidMount() {
30
+ this.props.makeStyles?.();
31
+ }
32
+ componentDidUpdate() {
33
+ this.props.makeStyles?.();
34
+ }
35
+ render() {
36
+ const { children, styles } = this.props;
37
+ const { isStacked } = this.context;
38
+ return /*#__PURE__*/ _jsx(View, {
39
+ ...View.omitViewProps(omitProps(this.props, Body.allowedProps), Body),
40
+ as: isStacked ? 'div' : 'tbody',
41
+ css: styles?.body,
42
+ role: isStacked ? 'rowgroup' : undefined,
43
+ children: Children.map(children, (child)=>{
44
+ if (/*#__PURE__*/ isValidElement(child)) {
45
+ return safeCloneElement(child, {
46
+ key: child.props.name
47
+ });
48
+ }
49
+ return child;
50
+ })
51
+ });
52
+ }
53
+ }
54
+ Body = _ts_decorate([
55
+ withStyle(generateStyle, generateComponentTheme)
56
+ ], Body);
80
57
  export default Body;
81
- export { Body };
58
+ export { Body };
@@ -1,26 +1,4 @@
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'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'children'
3
+ ];
4
+ export { allowedProps };
@@ -1,45 +1,13 @@
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
- * @return {Object} The final style object, which will be used in the component
32
- */
33
- const generateStyle = componentTheme => {
34
- return {
35
- body: {
36
- label: 'body',
37
- fontSize: componentTheme.fontSize,
38
- fontFamily: componentTheme.fontFamily,
39
- fontWeight: componentTheme.fontWeight,
40
- color: componentTheme.color,
41
- background: componentTheme.background
42
- }
43
- };
1
+ const generateStyle = (componentTheme)=>{
2
+ return {
3
+ body: {
4
+ label: 'body',
5
+ fontSize: componentTheme.fontSize,
6
+ fontFamily: componentTheme.fontFamily,
7
+ fontWeight: componentTheme.fontWeight,
8
+ color: componentTheme.color,
9
+ background: componentTheme.background
10
+ }
11
+ };
44
12
  };
45
- export default generateStyle;
13
+ export default generateStyle;
@@ -1,46 +1,14 @@
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
- * Generates the theme object for the component from the theme and provided additional information
27
- * @param {Object} theme The actual theme object.
28
- * @return {Object} The final theme object with the overrides and component variables
29
- */
30
- const generateComponentTheme = theme => {
31
- const {
32
- colors,
33
- typography
34
- } = theme;
35
- const componentVariables = {
36
- fontSize: typography?.fontSizeMedium,
37
- fontFamily: typography?.fontFamily,
38
- fontWeight: typography?.fontWeightNormal,
39
- color: colors?.contrasts?.grey125125,
40
- background: colors?.contrasts?.white1010
41
- };
42
- return {
43
- ...componentVariables
44
- };
1
+ const generateComponentTheme = (theme)=>{
2
+ const { colors, typography } = theme;
3
+ const componentVariables = {
4
+ fontSize: typography?.fontSizeMedium,
5
+ fontFamily: typography?.fontFamily,
6
+ fontWeight: typography?.fontWeightNormal,
7
+ color: colors?.contrasts?.grey125125,
8
+ background: colors?.contrasts?.white1010
9
+ };
10
+ return {
11
+ ...componentVariables
12
+ };
45
13
  };
46
- export default generateComponentTheme;
14
+ export default generateComponentTheme;
@@ -1,28 +1,5 @@
1
- var _dec, _class;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
1
+ import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
+ import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
26
3
  import { Component } from 'react';
27
4
  import { omitProps, callRenderProp } from '@instructure/ui-react-utils';
28
5
  import { View } from '@instructure/ui-view/v11_6';
@@ -31,44 +8,49 @@ import generateStyle from './styles.js';
31
8
  import generateComponentTheme from './theme.js';
32
9
  import { allowedProps } from './props.js';
33
10
  import TableContext from '../TableContext.js';
34
-
35
- /**
36
- ---
37
- parent: Table
38
- id: Table.Cell
39
- ---
40
- **/
41
- import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
42
- let Cell = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Cell extends Component {
43
- static displayName = 'Cell';
44
- static componentId = 'Table.Cell';
45
- static contextType = TableContext;
46
- static allowedProps = allowedProps;
47
- static defaultProps = {
48
- textAlign: 'start',
49
- children: null
50
- };
51
- componentDidMount() {
52
- this.props.makeStyles?.();
53
- }
54
- componentDidUpdate() {
55
- this.props.makeStyles?.();
56
- }
57
- render() {
58
- const {
59
- children,
60
- styles,
61
- header
62
- } = this.props;
63
- const isStacked = this.context.isStacked;
64
- return _jsxs(View, {
65
- ...View.omitViewProps(omitProps(this.props, Cell.allowedProps), Cell),
66
- as: isStacked ? 'div' : 'td',
67
- css: styles?.cell,
68
- role: isStacked ? 'cell' : undefined,
69
- children: [header && callRenderProp(header), header && ': ', callRenderProp(children)]
70
- });
71
- }
72
- }) || _class);
11
+ class Cell extends Component {
12
+ static{
13
+ this.displayName = 'Cell';
14
+ }
15
+ static{
16
+ this.componentId = 'Table.Cell';
17
+ }
18
+ static{
19
+ this.contextType = TableContext;
20
+ }
21
+ static{
22
+ this.allowedProps = allowedProps;
23
+ }
24
+ static{
25
+ this.defaultProps = {
26
+ textAlign: 'start',
27
+ children: null
28
+ };
29
+ }
30
+ componentDidMount() {
31
+ this.props.makeStyles?.();
32
+ }
33
+ componentDidUpdate() {
34
+ this.props.makeStyles?.();
35
+ }
36
+ render() {
37
+ const { children, styles, header } = this.props;
38
+ const isStacked = this.context.isStacked;
39
+ return /*#__PURE__*/ _jsxs(View, {
40
+ ...View.omitViewProps(omitProps(this.props, Cell.allowedProps), Cell),
41
+ as: isStacked ? 'div' : 'td',
42
+ css: styles?.cell,
43
+ role: isStacked ? 'cell' : undefined,
44
+ children: [
45
+ header && callRenderProp(header),
46
+ header && ': ',
47
+ callRenderProp(children)
48
+ ]
49
+ });
50
+ }
51
+ }
52
+ Cell = _ts_decorate([
53
+ withStyle(generateStyle, generateComponentTheme)
54
+ ], Cell);
73
55
  export default Cell;
74
- export { Cell };
56
+ export { Cell };
@@ -1,26 +1,6 @@
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', 'header', 'textAlign'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'children',
3
+ 'header',
4
+ 'textAlign'
5
+ ];
6
+ export { allowedProps };
@@ -1,57 +1,21 @@
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 {
37
- textAlign
38
- } = props;
39
- return {
40
- cell: {
41
- label: 'cell',
42
- fontSize: componentTheme.fontSize,
43
- fontFamily: componentTheme.fontFamily,
44
- fontWeight: componentTheme.fontWeight,
45
- color: componentTheme.color,
46
- background: componentTheme.background,
47
- boxSizing: 'border-box',
48
- verticalAlign: 'middle',
49
- lineHeight: componentTheme.lineHeight,
50
- padding: componentTheme.padding,
51
- ...(textAlign && {
52
- textAlign
53
- })
54
- }
55
- };
1
+ const generateStyle = (componentTheme, props)=>{
2
+ const { textAlign } = props;
3
+ return {
4
+ cell: {
5
+ label: 'cell',
6
+ fontSize: componentTheme.fontSize,
7
+ fontFamily: componentTheme.fontFamily,
8
+ fontWeight: componentTheme.fontWeight,
9
+ color: componentTheme.color,
10
+ background: componentTheme.background,
11
+ boxSizing: 'border-box',
12
+ verticalAlign: 'middle',
13
+ lineHeight: componentTheme.lineHeight,
14
+ padding: componentTheme.padding,
15
+ ...textAlign && {
16
+ textAlign
17
+ }
18
+ }
19
+ };
56
20
  };
57
- export default generateStyle;
21
+ export default generateStyle;
@@ -1,50 +1,17 @@
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
- * Generates the theme object for the component from the theme and provided additional information
27
- * @param {Object} theme The actual theme object.
28
- * @return {Object} The final theme object with the overrides and component variables
29
- */
30
- const generateComponentTheme = theme => {
31
- const {
32
- colors,
33
- typography,
34
- spacing
35
- } = theme;
36
- const componentVariables = {
37
- fontSize: typography?.fontSizeMedium,
38
- fontFamily: typography?.fontFamily,
39
- fontWeight: typography?.fontWeightNormal,
40
- color: colors?.contrasts?.grey125125,
41
- background: colors?.contrasts?.white1010,
42
- borderColor: colors?.contrasts?.grey3045,
43
- lineHeight: typography?.lineHeightCondensed,
44
- padding: `${spacing?.xSmall} ${spacing?.small}`
45
- };
46
- return {
47
- ...componentVariables
48
- };
1
+ const generateComponentTheme = (theme)=>{
2
+ const { colors, typography, spacing } = theme;
3
+ const componentVariables = {
4
+ fontSize: typography?.fontSizeMedium,
5
+ fontFamily: typography?.fontFamily,
6
+ fontWeight: typography?.fontWeightNormal,
7
+ color: colors?.contrasts?.grey125125,
8
+ background: colors?.contrasts?.white1010,
9
+ borderColor: colors?.contrasts?.grey3045,
10
+ lineHeight: typography?.lineHeightCondensed,
11
+ padding: `${spacing?.xSmall} ${spacing?.small}`
12
+ };
13
+ return {
14
+ ...componentVariables
15
+ };
49
16
  };
50
- export default generateComponentTheme;
17
+ export default generateComponentTheme;