@instructure/ui-heading 11.7.3-snapshot-7 → 11.7.3-snapshot-26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -2
- package/es/Heading/v1/index.js +66 -70
- package/es/Heading/v1/styles.js +7 -5
- package/es/Heading/v1/theme.js +36 -35
- package/es/Heading/v2/index.js +66 -66
- package/es/Heading/v2/styles.js +8 -5
- package/lib/Heading/v1/index.js +67 -71
- package/lib/Heading/v1/styles.js +7 -5
- package/lib/Heading/v1/theme.js +36 -35
- package/lib/Heading/v2/index.js +66 -66
- package/lib/Heading/v2/styles.js +8 -5
- package/package.json +11 -11
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
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.3-snapshot-
|
|
6
|
+
## [11.7.3-snapshot-26](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-26) (2026-05-05)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
package/es/Heading/v1/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["border", "children", "color", "level", "margin", "elementRef", "makeStyles", "variant"];
|
|
3
|
-
var _dec, _class, _Heading, _IconAiColoredSolid, _IconAiColoredSolid2, _IconAiColoredSolid3, _IconAiColoredSolid4, _IconAiColoredSolid5, _IconAiColoredSolid6;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -52,106 +50,107 @@ const variantLevels = {
|
|
|
52
50
|
category: components
|
|
53
51
|
---
|
|
54
52
|
**/
|
|
55
|
-
let Heading = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
let Heading = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Heading extends Component {
|
|
54
|
+
static displayName = "Heading";
|
|
55
|
+
static componentId = 'Heading';
|
|
56
|
+
static allowedProps = allowedProps;
|
|
57
|
+
static defaultProps = {
|
|
58
|
+
children: null,
|
|
59
|
+
border: 'none',
|
|
60
|
+
color: 'inherit'
|
|
61
|
+
};
|
|
62
|
+
ref = null;
|
|
63
|
+
handleRef = el => {
|
|
64
|
+
const {
|
|
65
|
+
elementRef
|
|
66
|
+
} = this.props;
|
|
67
|
+
this.ref = el;
|
|
68
|
+
if (typeof elementRef === 'function') {
|
|
69
|
+
elementRef(el);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
67
72
|
checkProps() {
|
|
68
|
-
const
|
|
69
|
-
variant
|
|
70
|
-
as
|
|
73
|
+
const {
|
|
74
|
+
variant,
|
|
75
|
+
as
|
|
76
|
+
} = this.props;
|
|
71
77
|
if (variant) {
|
|
72
78
|
if (as) {}
|
|
73
79
|
}
|
|
74
80
|
}
|
|
75
81
|
componentDidMount() {
|
|
76
|
-
|
|
77
|
-
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
|
|
82
|
+
this.props.makeStyles?.();
|
|
78
83
|
this.checkProps();
|
|
79
84
|
}
|
|
80
85
|
componentDidUpdate() {
|
|
81
|
-
|
|
82
|
-
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
|
86
|
+
this.props.makeStyles?.();
|
|
83
87
|
this.checkProps();
|
|
84
88
|
}
|
|
85
89
|
renderContent() {
|
|
86
|
-
const
|
|
87
|
-
children
|
|
88
|
-
renderIcon
|
|
89
|
-
aiVariant
|
|
90
|
+
const {
|
|
91
|
+
children,
|
|
92
|
+
renderIcon,
|
|
93
|
+
aiVariant
|
|
94
|
+
} = this.props;
|
|
90
95
|
if (renderIcon && !aiVariant) {
|
|
91
|
-
var _this$props$styles;
|
|
92
96
|
return _jsxs("span", {
|
|
93
|
-
css: [
|
|
97
|
+
css: [this.props.styles?.withIcon],
|
|
94
98
|
"aria-hidden": "true",
|
|
95
99
|
children: [callRenderProp(renderIcon), "\xA0", children]
|
|
96
100
|
});
|
|
97
101
|
}
|
|
98
102
|
if (aiVariant === 'stacked') {
|
|
99
|
-
var _this$props$styles2, _this$props$styles3, _this$props$styles4;
|
|
100
103
|
return _jsxs("span", {
|
|
101
|
-
css: [
|
|
104
|
+
css: [this.props.styles?.withIcon],
|
|
102
105
|
"aria-hidden": "true",
|
|
103
106
|
children: [_jsxs("span", {
|
|
104
|
-
css:
|
|
105
|
-
children: [
|
|
106
|
-
css:
|
|
107
|
+
css: this.props.styles?.igniteAIStacked,
|
|
108
|
+
children: [_jsx(IconAiColoredSolid, {}), _jsx("span", {
|
|
109
|
+
css: this.props.styles?.igniteAI,
|
|
107
110
|
children: "IgniteAI"
|
|
108
111
|
})]
|
|
109
112
|
}), children]
|
|
110
113
|
});
|
|
111
114
|
}
|
|
112
115
|
if (aiVariant === 'horizontal') {
|
|
113
|
-
var _this$props$styles5, _this$props$styles6;
|
|
114
116
|
return _jsxs("span", {
|
|
115
|
-
css:
|
|
117
|
+
css: this.props.styles?.withIcon,
|
|
116
118
|
"aria-hidden": "true",
|
|
117
|
-
children: [
|
|
118
|
-
css:
|
|
119
|
+
children: [_jsx(IconAiColoredSolid, {}), _jsx("span", {
|
|
120
|
+
css: this.props.styles?.igniteAI,
|
|
119
121
|
children: "IgniteAI"
|
|
120
122
|
}), children]
|
|
121
123
|
});
|
|
122
124
|
}
|
|
123
125
|
if (aiVariant === 'iconOnly') {
|
|
124
|
-
var _this$props$styles7;
|
|
125
126
|
return _jsxs("span", {
|
|
126
|
-
css:
|
|
127
|
+
css: this.props.styles?.withIcon,
|
|
127
128
|
"aria-hidden": "true",
|
|
128
|
-
children: [
|
|
129
|
+
children: [_jsx(IconAiColoredSolid, {}), "\xA0", children]
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
132
|
if (aiVariant === 'stacked') {
|
|
132
|
-
var _this$props$styles8, _this$props$styles9;
|
|
133
133
|
return _jsxs(_Fragment, {
|
|
134
134
|
children: [_jsxs("span", {
|
|
135
|
-
css:
|
|
136
|
-
children: [
|
|
137
|
-
css:
|
|
135
|
+
css: this.props.styles?.igniteAIStacked,
|
|
136
|
+
children: [_jsx(IconAiColoredSolid, {}), _jsx("span", {
|
|
137
|
+
css: this.props.styles?.igniteAI,
|
|
138
138
|
children: "IgniteAI"
|
|
139
139
|
})]
|
|
140
140
|
}), children]
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
if (aiVariant === 'horizontal') {
|
|
144
|
-
var _this$props$styles0;
|
|
145
144
|
return _jsxs(_Fragment, {
|
|
146
|
-
children: [
|
|
147
|
-
css:
|
|
145
|
+
children: [_jsx(IconAiColoredSolid, {}), _jsx("span", {
|
|
146
|
+
css: this.props.styles?.igniteAI,
|
|
148
147
|
children: "IgniteAI"
|
|
149
148
|
}), children]
|
|
150
149
|
});
|
|
151
150
|
}
|
|
152
151
|
if (aiVariant === 'iconOnly') {
|
|
153
152
|
return _jsxs(_Fragment, {
|
|
154
|
-
children: [
|
|
153
|
+
children: [_jsx(IconAiColoredSolid, {}), "\xA0", children]
|
|
155
154
|
});
|
|
156
155
|
}
|
|
157
156
|
return children;
|
|
@@ -159,30 +158,31 @@ let Heading = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
159
158
|
|
|
160
159
|
//overriding default screen reader functionality is needed to read spans in h tags correctly
|
|
161
160
|
getAriaLabel() {
|
|
162
|
-
const
|
|
163
|
-
aiVariant
|
|
164
|
-
children
|
|
165
|
-
renderIcon
|
|
161
|
+
const {
|
|
162
|
+
aiVariant,
|
|
163
|
+
children,
|
|
164
|
+
renderIcon
|
|
165
|
+
} = this.props;
|
|
166
166
|
if (aiVariant === 'stacked' || aiVariant === 'horizontal') {
|
|
167
167
|
return `IgniteAI, ${children}`;
|
|
168
168
|
}
|
|
169
169
|
if (aiVariant === 'iconOnly' || renderIcon) {
|
|
170
170
|
return `${children}`;
|
|
171
171
|
}
|
|
172
|
-
return
|
|
172
|
+
return undefined;
|
|
173
173
|
}
|
|
174
174
|
render() {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
175
|
+
const {
|
|
176
|
+
border,
|
|
177
|
+
children,
|
|
178
|
+
color,
|
|
179
|
+
level,
|
|
180
|
+
margin,
|
|
181
|
+
elementRef,
|
|
182
|
+
makeStyles,
|
|
183
|
+
variant,
|
|
184
|
+
...props
|
|
185
|
+
} = this.props;
|
|
186
186
|
let ElementType = 'h2';
|
|
187
187
|
if (variant) {
|
|
188
188
|
// TODO deprecated, remove. `variant` should not set DOM level
|
|
@@ -207,7 +207,7 @@ let Heading = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
207
207
|
return _jsx(View, {
|
|
208
208
|
"aria-label": this.getAriaLabel(),
|
|
209
209
|
...passthroughProps(props),
|
|
210
|
-
css:
|
|
210
|
+
css: this.props.styles?.heading,
|
|
211
211
|
as: ElementType,
|
|
212
212
|
elementRef: this.handleRef,
|
|
213
213
|
margin: margin,
|
|
@@ -215,10 +215,6 @@ let Heading = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
215
215
|
children: this.renderContent()
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
}
|
|
219
|
-
children: null,
|
|
220
|
-
border: 'none',
|
|
221
|
-
color: 'inherit'
|
|
222
|
-
}, _Heading)) || _class);
|
|
218
|
+
}) || _class);
|
|
223
219
|
export default Heading;
|
|
224
220
|
export { Heading };
|
package/es/Heading/v1/styles.js
CHANGED
|
@@ -33,11 +33,13 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const {
|
|
37
|
+
level,
|
|
38
|
+
color,
|
|
39
|
+
border,
|
|
40
|
+
variant,
|
|
41
|
+
aiVariant
|
|
42
|
+
} = props;
|
|
41
43
|
const variants = {
|
|
42
44
|
titlePageDesktop: {
|
|
43
45
|
fontStyle: 'normal',
|
package/es/Heading/v1/theme.js
CHANGED
|
@@ -28,12 +28,13 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
colors
|
|
34
|
-
spacing
|
|
35
|
-
borders
|
|
36
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
typography,
|
|
33
|
+
colors,
|
|
34
|
+
spacing,
|
|
35
|
+
borders,
|
|
36
|
+
key: themeName
|
|
37
|
+
} = theme;
|
|
37
38
|
const themeSpecificStyle = {
|
|
38
39
|
canvas: {
|
|
39
40
|
primaryColor: theme['ic-brand-font-color-dark']
|
|
@@ -41,35 +42,35 @@ const generateComponentTheme = theme => {
|
|
|
41
42
|
};
|
|
42
43
|
const componentVariables = {
|
|
43
44
|
...typography,
|
|
44
|
-
lineHeight: typography
|
|
45
|
-
h1FontSize: typography
|
|
46
|
-
h1FontWeight: typography
|
|
47
|
-
h1FontFamily: typography
|
|
48
|
-
h2FontSize: typography
|
|
49
|
-
h2FontWeight: typography
|
|
50
|
-
h2FontFamily: typography
|
|
51
|
-
h3FontSize: typography
|
|
52
|
-
h3FontWeight: typography
|
|
53
|
-
h3FontFamily: typography
|
|
54
|
-
h4FontSize: typography
|
|
55
|
-
h4FontWeight: typography
|
|
56
|
-
h4FontFamily: typography
|
|
57
|
-
h5FontSize: typography
|
|
58
|
-
h5FontWeight: typography
|
|
59
|
-
h5FontFamily: typography
|
|
60
|
-
h6FontSize: typography
|
|
61
|
-
h6FontWeight: typography
|
|
62
|
-
h6FontFamily: typography
|
|
63
|
-
primaryInverseColor: colors
|
|
64
|
-
primaryColor: colors
|
|
65
|
-
secondaryColor: colors
|
|
66
|
-
secondaryInverseColor: colors
|
|
67
|
-
borderPadding: spacing
|
|
68
|
-
borderColor: colors
|
|
69
|
-
borderWidth: borders
|
|
70
|
-
borderStyle: borders
|
|
71
|
-
aiTextTopGradientColor: colors
|
|
72
|
-
aiTextBottomGradientColor: colors
|
|
45
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
46
|
+
h1FontSize: typography?.fontSizeXXLarge,
|
|
47
|
+
h1FontWeight: typography?.fontWeightBold,
|
|
48
|
+
h1FontFamily: typography?.fontFamily,
|
|
49
|
+
h2FontSize: typography?.fontSizeXLarge,
|
|
50
|
+
h2FontWeight: typography?.fontWeightNormal,
|
|
51
|
+
h2FontFamily: typography?.fontFamily,
|
|
52
|
+
h3FontSize: typography?.fontSizeLarge,
|
|
53
|
+
h3FontWeight: typography?.fontWeightBold,
|
|
54
|
+
h3FontFamily: typography?.fontFamily,
|
|
55
|
+
h4FontSize: typography?.fontSizeMedium,
|
|
56
|
+
h4FontWeight: typography?.fontWeightBold,
|
|
57
|
+
h4FontFamily: typography?.fontFamily,
|
|
58
|
+
h5FontSize: typography?.fontSizeSmall,
|
|
59
|
+
h5FontWeight: typography?.fontWeightNormal,
|
|
60
|
+
h5FontFamily: typography?.fontFamily,
|
|
61
|
+
h6FontSize: typography?.fontSizeXSmall,
|
|
62
|
+
h6FontWeight: typography?.fontWeightNormal,
|
|
63
|
+
h6FontFamily: typography?.fontFamily,
|
|
64
|
+
primaryInverseColor: colors?.contrasts?.white1010,
|
|
65
|
+
primaryColor: colors?.contrasts?.grey125125,
|
|
66
|
+
secondaryColor: colors?.contrasts?.grey4570,
|
|
67
|
+
secondaryInverseColor: colors?.contrasts?.grey1111,
|
|
68
|
+
borderPadding: spacing?.xxxSmall,
|
|
69
|
+
borderColor: colors?.contrasts?.grey3045,
|
|
70
|
+
borderWidth: borders?.widthSmall,
|
|
71
|
+
borderStyle: borders?.style,
|
|
72
|
+
aiTextTopGradientColor: colors?.contrasts?.violet4570,
|
|
73
|
+
aiTextBottomGradientColor: colors?.contrasts?.sea4570
|
|
73
74
|
};
|
|
74
75
|
return {
|
|
75
76
|
...componentVariables,
|
package/es/Heading/v2/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _dec, _class, _Heading, _IgniteaiLogoInstUIIc;
|
|
1
|
+
var _dec, _class;
|
|
2
|
+
import "core-js/modules/es.array.includes.js";
|
|
4
3
|
/*
|
|
5
4
|
* The MIT License (MIT)
|
|
6
5
|
*
|
|
@@ -91,41 +90,48 @@ const levelToAIHorizontalIconSize = {
|
|
|
91
90
|
category: components
|
|
92
91
|
---
|
|
93
92
|
**/
|
|
94
|
-
let Heading = (_dec = withStyle(generateStyle), _dec(_class =
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
93
|
+
let Heading = (_dec = withStyle(generateStyle), _dec(_class = class Heading extends Component {
|
|
94
|
+
static displayName = "Heading";
|
|
95
|
+
static componentId = 'Heading';
|
|
96
|
+
static allowedProps = allowedProps;
|
|
97
|
+
static defaultProps = {
|
|
98
|
+
children: null,
|
|
99
|
+
border: 'none',
|
|
100
|
+
color: 'primary'
|
|
101
|
+
};
|
|
102
|
+
ref = null;
|
|
103
|
+
handleRef = el => {
|
|
104
|
+
const {
|
|
105
|
+
elementRef
|
|
106
|
+
} = this.props;
|
|
107
|
+
this.ref = el;
|
|
108
|
+
if (typeof elementRef === 'function') {
|
|
109
|
+
elementRef(el);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
106
112
|
checkProps() {
|
|
107
|
-
const
|
|
108
|
-
variant
|
|
109
|
-
as
|
|
113
|
+
const {
|
|
114
|
+
variant,
|
|
115
|
+
as
|
|
116
|
+
} = this.props;
|
|
110
117
|
if (variant) {
|
|
111
118
|
if (as) {}
|
|
112
119
|
}
|
|
113
120
|
}
|
|
114
121
|
componentDidMount() {
|
|
115
|
-
|
|
116
|
-
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
|
|
122
|
+
this.props.makeStyles?.();
|
|
117
123
|
this.checkProps();
|
|
118
124
|
}
|
|
119
125
|
componentDidUpdate() {
|
|
120
|
-
|
|
121
|
-
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
|
126
|
+
this.props.makeStyles?.();
|
|
122
127
|
this.checkProps();
|
|
123
128
|
}
|
|
124
129
|
getIconSize(forAIHorizontal = false) {
|
|
125
|
-
const
|
|
126
|
-
variant
|
|
127
|
-
level
|
|
128
|
-
as
|
|
130
|
+
const {
|
|
131
|
+
variant,
|
|
132
|
+
level,
|
|
133
|
+
as
|
|
134
|
+
} = this.props;
|
|
129
135
|
if (variant) {
|
|
130
136
|
return forAIHorizontal ? variantToAIHorizontalIconSize[variant] : variantToIconSize[variant];
|
|
131
137
|
}
|
|
@@ -139,56 +145,53 @@ let Heading = (_dec = withStyle(generateStyle), _dec(_class = (_Heading = class
|
|
|
139
145
|
return 'md';
|
|
140
146
|
}
|
|
141
147
|
renderContent() {
|
|
142
|
-
const
|
|
143
|
-
children
|
|
144
|
-
renderIcon
|
|
145
|
-
aiVariant
|
|
148
|
+
const {
|
|
149
|
+
children,
|
|
150
|
+
renderIcon,
|
|
151
|
+
aiVariant
|
|
152
|
+
} = this.props;
|
|
146
153
|
if (renderIcon && !aiVariant) {
|
|
147
|
-
var _this$props$styles;
|
|
148
154
|
return _jsxs("span", {
|
|
149
|
-
css: [
|
|
155
|
+
css: [this.props.styles?.withIcon],
|
|
150
156
|
"aria-hidden": "true",
|
|
151
157
|
children: [renderIconWithProps(renderIcon, this.getIconSize(), 'inherit'), children]
|
|
152
158
|
});
|
|
153
159
|
}
|
|
154
160
|
if (aiVariant === 'stacked') {
|
|
155
|
-
var _this$props$styles2, _this$props$styles3, _this$props$styles4;
|
|
156
161
|
return _jsxs("span", {
|
|
157
|
-
css: [
|
|
162
|
+
css: [this.props.styles?.withIcon],
|
|
158
163
|
"aria-hidden": "true",
|
|
159
164
|
children: [_jsxs("span", {
|
|
160
|
-
css:
|
|
161
|
-
children: [
|
|
165
|
+
css: this.props.styles?.igniteAIStacked,
|
|
166
|
+
children: [_jsx(IgniteaiLogoInstUIIcon, {
|
|
162
167
|
color: "ai",
|
|
163
168
|
size: "sm"
|
|
164
|
-
})
|
|
165
|
-
css:
|
|
169
|
+
}), _jsx("span", {
|
|
170
|
+
css: this.props.styles?.igniteAI,
|
|
166
171
|
children: "IgniteAI"
|
|
167
172
|
})]
|
|
168
173
|
}), children]
|
|
169
174
|
});
|
|
170
175
|
}
|
|
171
176
|
if (aiVariant === 'horizontal') {
|
|
172
|
-
var _this$props$styles5, _this$props$styles6, _this$props$styles7;
|
|
173
177
|
return _jsxs("span", {
|
|
174
|
-
css:
|
|
178
|
+
css: this.props.styles?.withIcon,
|
|
175
179
|
"aria-hidden": "true",
|
|
176
180
|
children: [_jsxs("span", {
|
|
177
|
-
css:
|
|
181
|
+
css: this.props.styles?.igniteAIHorizontal,
|
|
178
182
|
children: [_jsx(IgniteaiLogoInstUIIcon, {
|
|
179
183
|
color: "ai",
|
|
180
184
|
size: this.getIconSize(true)
|
|
181
185
|
}), _jsx("span", {
|
|
182
|
-
css:
|
|
186
|
+
css: this.props.styles?.igniteAI,
|
|
183
187
|
children: "IgniteAI"
|
|
184
188
|
})]
|
|
185
189
|
}), children]
|
|
186
190
|
});
|
|
187
191
|
}
|
|
188
192
|
if (aiVariant === 'iconOnly') {
|
|
189
|
-
var _this$props$styles8;
|
|
190
193
|
return _jsxs("span", {
|
|
191
|
-
css:
|
|
194
|
+
css: this.props.styles?.withIcon,
|
|
192
195
|
"aria-hidden": "true",
|
|
193
196
|
children: [_jsx(IgniteaiLogoInstUIIcon, {
|
|
194
197
|
color: "ai",
|
|
@@ -201,30 +204,31 @@ let Heading = (_dec = withStyle(generateStyle), _dec(_class = (_Heading = class
|
|
|
201
204
|
|
|
202
205
|
//overriding default screen reader functionality is needed to read spans in h tags correctly
|
|
203
206
|
getAriaLabel() {
|
|
204
|
-
const
|
|
205
|
-
aiVariant
|
|
206
|
-
children
|
|
207
|
-
renderIcon
|
|
207
|
+
const {
|
|
208
|
+
aiVariant,
|
|
209
|
+
children,
|
|
210
|
+
renderIcon
|
|
211
|
+
} = this.props;
|
|
208
212
|
if (aiVariant === 'stacked' || aiVariant === 'horizontal') {
|
|
209
213
|
return `IgniteAI, ${children}`;
|
|
210
214
|
}
|
|
211
215
|
if (aiVariant === 'iconOnly' || renderIcon) {
|
|
212
216
|
return `${children}`;
|
|
213
217
|
}
|
|
214
|
-
return
|
|
218
|
+
return undefined;
|
|
215
219
|
}
|
|
216
220
|
render() {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
221
|
+
const {
|
|
222
|
+
border,
|
|
223
|
+
children,
|
|
224
|
+
color,
|
|
225
|
+
level,
|
|
226
|
+
margin,
|
|
227
|
+
elementRef,
|
|
228
|
+
makeStyles,
|
|
229
|
+
variant,
|
|
230
|
+
...props
|
|
231
|
+
} = this.props;
|
|
228
232
|
let ElementType = 'h2';
|
|
229
233
|
if (variant) {
|
|
230
234
|
// TODO deprecated, remove. `variant` should not set DOM level
|
|
@@ -249,7 +253,7 @@ let Heading = (_dec = withStyle(generateStyle), _dec(_class = (_Heading = class
|
|
|
249
253
|
return _jsx(View, {
|
|
250
254
|
"aria-label": this.getAriaLabel(),
|
|
251
255
|
...passthroughProps(props),
|
|
252
|
-
css:
|
|
256
|
+
css: this.props.styles?.heading,
|
|
253
257
|
as: ElementType,
|
|
254
258
|
elementRef: this.handleRef,
|
|
255
259
|
margin: margin,
|
|
@@ -257,10 +261,6 @@ let Heading = (_dec = withStyle(generateStyle), _dec(_class = (_Heading = class
|
|
|
257
261
|
children: this.renderContent()
|
|
258
262
|
});
|
|
259
263
|
}
|
|
260
|
-
}
|
|
261
|
-
children: null,
|
|
262
|
-
border: 'none',
|
|
263
|
-
color: 'primary'
|
|
264
|
-
}, _Heading)) || _class);
|
|
264
|
+
}) || _class);
|
|
265
265
|
export default Heading;
|
|
266
266
|
export { Heading };
|
package/es/Heading/v2/styles.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "core-js/modules/es.array.includes.js";
|
|
1
2
|
/*
|
|
2
3
|
* The MIT License (MIT)
|
|
3
4
|
*
|
|
@@ -32,11 +33,13 @@
|
|
|
32
33
|
* @return {Object} The final style object, which will be used in the component
|
|
33
34
|
*/
|
|
34
35
|
const generateStyle = (componentTheme, props) => {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const {
|
|
37
|
+
level,
|
|
38
|
+
color,
|
|
39
|
+
border,
|
|
40
|
+
variant,
|
|
41
|
+
aiVariant
|
|
42
|
+
} = props;
|
|
40
43
|
const variants = {
|
|
41
44
|
titlePageDesktop: {
|
|
42
45
|
fontStyle: 'normal',
|