@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
@@ -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, 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 { IconMiniArrowUpLine, IconMiniArrowDownLine, IconMiniArrowDoubleLine } from '@instructure/ui-icons';
@@ -30,89 +7,87 @@ import { withStyle } from '@instructure/emotion';
30
7
  import generateStyle from './styles.js';
31
8
  import generateComponentTheme from './theme.js';
32
9
  import { allowedProps } from './props.js';
33
-
34
- /**
35
- ---
36
- parent: Table
37
- id: Table.ColHeader
38
- ---
39
- **/
40
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
41
- let ColHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ColHeader extends Component {
42
- static displayName = 'ColHeader';
43
- static componentId = 'Table.ColHeader';
44
- static allowedProps = allowedProps;
45
- static defaultProps = {
46
- textAlign: 'start',
47
- sortDirection: 'none',
48
- children: null,
49
- scope: 'col'
50
- };
51
- componentDidMount() {
52
- this.props.makeStyles?.();
53
- }
54
- componentDidUpdate() {
55
- this.props.makeStyles?.();
56
- }
57
- handleClick = event => {
58
- const {
59
- id,
60
- onRequestSort
61
- } = this.props;
62
- onRequestSort && onRequestSort(event, {
63
- id
64
- });
65
- };
66
- renderSortArrow() {
67
- const {
68
- sortDirection,
69
- onRequestSort,
70
- styles
71
- } = this.props;
72
- if (sortDirection === 'ascending') {
73
- return _jsx(IconMiniArrowUpLine, {
74
- css: styles?.sortedIconColor
75
- });
10
+ class ColHeader extends Component {
11
+ static{
12
+ this.displayName = 'ColHeader';
13
+ }
14
+ static{
15
+ this.componentId = 'Table.ColHeader';
16
+ }
17
+ static{
18
+ this.allowedProps = allowedProps;
19
+ }
20
+ static{
21
+ this.defaultProps = {
22
+ textAlign: 'start',
23
+ sortDirection: 'none',
24
+ children: null,
25
+ scope: 'col'
26
+ };
27
+ }
28
+ componentDidMount() {
29
+ this.props.makeStyles?.();
30
+ }
31
+ componentDidUpdate() {
32
+ this.props.makeStyles?.();
33
+ }
34
+ renderSortArrow() {
35
+ const { sortDirection, onRequestSort, styles } = this.props;
36
+ if (sortDirection === 'ascending') {
37
+ return /*#__PURE__*/ _jsx(IconMiniArrowUpLine, {
38
+ css: styles?.sortedIconColor
39
+ });
40
+ }
41
+ if (sortDirection === 'descending') {
42
+ return /*#__PURE__*/ _jsx(IconMiniArrowDownLine, {
43
+ css: styles?.sortedIconColor
44
+ });
45
+ }
46
+ if (onRequestSort) {
47
+ return /*#__PURE__*/ _jsx(IconMiniArrowDoubleLine, {
48
+ css: styles?.unSortedIconColor
49
+ });
50
+ }
51
+ return undefined;
76
52
  }
77
- if (sortDirection === 'descending') {
78
- return _jsx(IconMiniArrowDownLine, {
79
- css: styles?.sortedIconColor
80
- });
53
+ render() {
54
+ const { onRequestSort, width, children, sortDirection, scope, styles } = this.props;
55
+ return /*#__PURE__*/ _jsxs("th", {
56
+ ...omitProps(this.props, ColHeader.allowedProps),
57
+ css: styles?.colHeader,
58
+ style: {
59
+ width
60
+ },
61
+ scope: scope,
62
+ "aria-sort": sortDirection,
63
+ children: [
64
+ onRequestSort && /*#__PURE__*/ _jsx("button", {
65
+ onClick: this.handleClick,
66
+ css: styles?.button,
67
+ children: /*#__PURE__*/ _jsxs("div", {
68
+ css: styles?.buttonContent,
69
+ children: [
70
+ callRenderProp(children),
71
+ this.renderSortArrow()
72
+ ]
73
+ })
74
+ }),
75
+ !onRequestSort && children,
76
+ !onRequestSort && this.renderSortArrow()
77
+ ]
78
+ });
81
79
  }
82
- if (onRequestSort) {
83
- return _jsx(IconMiniArrowDoubleLine, {
84
- css: styles?.unSortedIconColor
85
- });
80
+ constructor(...args){
81
+ super(...args), this.handleClick = (event)=>{
82
+ const { id, onRequestSort } = this.props;
83
+ onRequestSort && onRequestSort(event, {
84
+ id
85
+ });
86
+ };
86
87
  }
87
- return undefined;
88
- }
89
- render() {
90
- const {
91
- onRequestSort,
92
- width,
93
- children,
94
- sortDirection,
95
- scope,
96
- styles
97
- } = this.props;
98
- return _jsxs("th", {
99
- ...omitProps(this.props, ColHeader.allowedProps),
100
- css: styles?.colHeader,
101
- style: {
102
- width
103
- },
104
- scope: scope,
105
- "aria-sort": sortDirection,
106
- children: [onRequestSort && _jsx("button", {
107
- onClick: this.handleClick,
108
- css: styles?.button,
109
- children: _jsxs("div", {
110
- css: styles?.buttonContent,
111
- children: [callRenderProp(children), this.renderSortArrow()]
112
- })
113
- }), !onRequestSort && children, !onRequestSort && this.renderSortArrow()]
114
- });
115
- }
116
- }) || _class);
88
+ }
89
+ ColHeader = _ts_decorate([
90
+ withStyle(generateStyle, generateComponentTheme)
91
+ ], ColHeader);
117
92
  export default ColHeader;
118
- export { ColHeader };
93
+ export { ColHeader };
@@ -1,26 +1,11 @@
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 = ['id', 'stackedSortByLabel', 'children', 'width', 'textAlign', 'sortDirection', 'onRequestSort', 'scope'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'id',
3
+ 'stackedSortByLabel',
4
+ 'children',
5
+ 'width',
6
+ 'textAlign',
7
+ 'sortDirection',
8
+ 'onRequestSort',
9
+ 'scope'
10
+ ];
11
+ export { allowedProps };
@@ -1,102 +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
- * @return {Object} The final style object, which will be used in the component
33
- */
34
- const generateStyle = (componentTheme, props) => {
35
- const {
36
- onRequestSort,
37
- textAlign
38
- } = props;
39
- const headerStyle = {
40
- color: componentTheme.color,
41
- fontSize: componentTheme.fontSize,
42
- fontFamily: componentTheme.fontFamily,
43
- fontWeight: 'bold',
44
- lineHeight: componentTheme.lineHeight,
45
- padding: componentTheme.padding
46
- };
47
- const buttonTextAlignVariants = {
48
- start: {
49
- flexDirection: 'row'
50
- },
51
- center: {
52
- justifyContent: 'center'
53
- },
54
- end: {
55
- flexDirection: 'row-reverse'
56
- }
57
- };
58
- return {
59
- colHeader: {
60
- label: 'colHeader',
61
- background: componentTheme.background,
62
- verticalAlign: 'middle',
63
- boxSizing: 'border-box',
64
- ...(!onRequestSort && headerStyle),
65
- textAlign
66
- },
67
- button: {
68
- label: 'colHeader__button',
69
- ...headerStyle,
70
- display: 'flex',
71
- alignItems: 'center',
72
- boxSizing: 'border-box',
73
- border: 'none',
74
- width: '100%',
75
- height: '100%',
76
- background: 'transparent',
77
- cursor: 'pointer',
78
- outline: 'none',
79
- '&::-moz-focus-inner': {
80
- border: 0
81
- },
82
- '&:focus': {
83
- outline: `${componentTheme.focusOutlineWidth} ${componentTheme.focusOutlineStyle} ${componentTheme.focusOutlineColor}`
84
- },
85
- ...buttonTextAlignVariants[textAlign]
86
- },
87
- buttonContent: {
88
- label: 'colHeader__buttonContent',
89
- display: 'flex',
90
- alignItems: 'center'
91
- },
92
- unSortedIconColor: {
93
- label: 'colHeader__unSortedIconColor',
94
- color: componentTheme.unSortedIconColor
95
- },
96
- sortedIconColor: {
97
- label: 'colHeader__sortedIconColor',
98
- color: componentTheme.sortedIconColor
99
- }
100
- };
1
+ const generateStyle = (componentTheme, props)=>{
2
+ const { onRequestSort, textAlign } = props;
3
+ const headerStyle = {
4
+ color: componentTheme.color,
5
+ fontSize: componentTheme.fontSize,
6
+ fontFamily: componentTheme.fontFamily,
7
+ fontWeight: 'bold',
8
+ lineHeight: componentTheme.lineHeight,
9
+ padding: componentTheme.padding
10
+ };
11
+ const buttonTextAlignVariants = {
12
+ start: {
13
+ flexDirection: 'row'
14
+ },
15
+ center: {
16
+ justifyContent: 'center'
17
+ },
18
+ end: {
19
+ flexDirection: 'row-reverse'
20
+ }
21
+ };
22
+ return {
23
+ colHeader: {
24
+ label: 'colHeader',
25
+ background: componentTheme.background,
26
+ verticalAlign: 'middle',
27
+ boxSizing: 'border-box',
28
+ ...!onRequestSort && headerStyle,
29
+ textAlign
30
+ },
31
+ button: {
32
+ label: 'colHeader__button',
33
+ ...headerStyle,
34
+ display: 'flex',
35
+ alignItems: 'center',
36
+ boxSizing: 'border-box',
37
+ border: 'none',
38
+ width: '100%',
39
+ height: '100%',
40
+ background: 'transparent',
41
+ cursor: 'pointer',
42
+ outline: 'none',
43
+ '&::-moz-focus-inner': {
44
+ border: 0
45
+ },
46
+ '&:focus': {
47
+ outline: `${componentTheme.focusOutlineWidth} ${componentTheme.focusOutlineStyle} ${componentTheme.focusOutlineColor}`
48
+ },
49
+ ...buttonTextAlignVariants[textAlign]
50
+ },
51
+ buttonContent: {
52
+ label: 'colHeader__buttonContent',
53
+ display: 'flex',
54
+ alignItems: 'center'
55
+ },
56
+ unSortedIconColor: {
57
+ label: 'colHeader__unSortedIconColor',
58
+ color: componentTheme.unSortedIconColor
59
+ },
60
+ sortedIconColor: {
61
+ label: 'colHeader__sortedIconColor',
62
+ color: componentTheme.sortedIconColor
63
+ }
64
+ };
101
65
  };
102
- export default generateStyle;
66
+ export default generateStyle;
@@ -1,63 +1,28 @@
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
- typography,
33
- colors,
34
- borders,
35
- spacing,
36
- key: themeName
37
- } = theme;
38
- const themeSpecificStyle = {
39
- canvas: {
40
- focusOutlineColor: theme['ic-brand-primary'],
41
- sortedIconColor: theme['ic-brand-primary']
42
- }
43
- };
44
- const componentVariables = {
45
- fontSize: typography?.fontSizeMedium,
46
- fontFamily: typography?.fontFamily,
47
- color: colors?.contrasts?.grey125125,
48
- background: colors?.contrasts?.white1010,
49
- borderColor: colors?.contrasts?.grey1214,
50
- lineHeight: typography?.lineHeightCondensed,
51
- padding: `${spacing?.xSmall} ${spacing?.small}`,
52
- focusOutlineColor: colors?.contrasts?.blue4570,
53
- focusOutlineWidth: borders?.widthMedium,
54
- focusOutlineStyle: borders?.style,
55
- unSortedIconColor: colors?.contrasts?.grey3045,
56
- sortedIconColor: colors?.contrasts?.blue4570
57
- };
58
- return {
59
- ...componentVariables,
60
- ...themeSpecificStyle[themeName]
61
- };
1
+ const generateComponentTheme = (theme)=>{
2
+ const { typography, colors, borders, spacing, key: themeName } = theme;
3
+ const themeSpecificStyle = {
4
+ canvas: {
5
+ focusOutlineColor: theme['ic-brand-primary'],
6
+ sortedIconColor: theme['ic-brand-primary']
7
+ }
8
+ };
9
+ const componentVariables = {
10
+ fontSize: typography?.fontSizeMedium,
11
+ fontFamily: typography?.fontFamily,
12
+ color: colors?.contrasts?.grey125125,
13
+ background: colors?.contrasts?.white1010,
14
+ borderColor: colors?.contrasts?.grey1214,
15
+ lineHeight: typography?.lineHeightCondensed,
16
+ padding: `${spacing?.xSmall} ${spacing?.small}`,
17
+ focusOutlineColor: colors?.contrasts?.blue4570,
18
+ focusOutlineWidth: borders?.widthMedium,
19
+ focusOutlineStyle: borders?.style,
20
+ unSortedIconColor: colors?.contrasts?.grey3045,
21
+ sortedIconColor: colors?.contrasts?.blue4570
22
+ };
23
+ return {
24
+ ...componentVariables,
25
+ ...themeSpecificStyle[themeName]
26
+ };
62
27
  };
63
- export default generateComponentTheme;
28
+ export default generateComponentTheme;