@instructure/ui-heading 11.7.3-snapshot-25 → 11.7.3-snapshot-27
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/lib/Heading/v1/index.js
CHANGED
|
@@ -5,19 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.Heading = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _v11_ = require("@instructure/ui-view/v11_6");
|
|
11
10
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
12
11
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
13
|
-
var
|
|
12
|
+
var _IconAiColoredSolid = require("@instructure/ui-icons/lib/generated/IconAiColoredSolid.js");
|
|
14
13
|
var _emotion = require("@instructure/emotion");
|
|
15
14
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
16
15
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
17
16
|
var _props = require("./props");
|
|
18
17
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
19
|
-
|
|
20
|
-
var _dec, _class, _Heading, _IconAiColoredSolid, _IconAiColoredSolid2, _IconAiColoredSolid3, _IconAiColoredSolid4, _IconAiColoredSolid5, _IconAiColoredSolid6;
|
|
18
|
+
var _dec, _class;
|
|
21
19
|
/*
|
|
22
20
|
* The MIT License (MIT)
|
|
23
21
|
*
|
|
@@ -59,106 +57,107 @@ const variantLevels = {
|
|
|
59
57
|
category: components
|
|
60
58
|
---
|
|
61
59
|
**/
|
|
62
|
-
let Heading = exports.Heading = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
let Heading = exports.Heading = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class Heading extends _react.Component {
|
|
61
|
+
static displayName = "Heading";
|
|
62
|
+
static componentId = 'Heading';
|
|
63
|
+
static allowedProps = _props.allowedProps;
|
|
64
|
+
static defaultProps = {
|
|
65
|
+
children: null,
|
|
66
|
+
border: 'none',
|
|
67
|
+
color: 'inherit'
|
|
68
|
+
};
|
|
69
|
+
ref = null;
|
|
70
|
+
handleRef = el => {
|
|
71
|
+
const {
|
|
72
|
+
elementRef
|
|
73
|
+
} = this.props;
|
|
74
|
+
this.ref = el;
|
|
75
|
+
if (typeof elementRef === 'function') {
|
|
76
|
+
elementRef(el);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
74
79
|
checkProps() {
|
|
75
|
-
const
|
|
76
|
-
variant
|
|
77
|
-
as
|
|
80
|
+
const {
|
|
81
|
+
variant,
|
|
82
|
+
as
|
|
83
|
+
} = this.props;
|
|
78
84
|
if (variant) {
|
|
79
85
|
if (as) {}
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
88
|
componentDidMount() {
|
|
83
|
-
|
|
84
|
-
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
|
|
89
|
+
this.props.makeStyles?.();
|
|
85
90
|
this.checkProps();
|
|
86
91
|
}
|
|
87
92
|
componentDidUpdate() {
|
|
88
|
-
|
|
89
|
-
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
|
93
|
+
this.props.makeStyles?.();
|
|
90
94
|
this.checkProps();
|
|
91
95
|
}
|
|
92
96
|
renderContent() {
|
|
93
|
-
const
|
|
94
|
-
children
|
|
95
|
-
renderIcon
|
|
96
|
-
aiVariant
|
|
97
|
+
const {
|
|
98
|
+
children,
|
|
99
|
+
renderIcon,
|
|
100
|
+
aiVariant
|
|
101
|
+
} = this.props;
|
|
97
102
|
if (renderIcon && !aiVariant) {
|
|
98
|
-
var _this$props$styles;
|
|
99
103
|
return (0, _jsxRuntime.jsxs)("span", {
|
|
100
|
-
css: [
|
|
104
|
+
css: [this.props.styles?.withIcon],
|
|
101
105
|
"aria-hidden": "true",
|
|
102
106
|
children: [(0, _callRenderProp.callRenderProp)(renderIcon), "\xA0", children]
|
|
103
107
|
});
|
|
104
108
|
}
|
|
105
109
|
if (aiVariant === 'stacked') {
|
|
106
|
-
var _this$props$styles2, _this$props$styles3, _this$props$styles4;
|
|
107
110
|
return (0, _jsxRuntime.jsxs)("span", {
|
|
108
|
-
css: [
|
|
111
|
+
css: [this.props.styles?.withIcon],
|
|
109
112
|
"aria-hidden": "true",
|
|
110
113
|
children: [(0, _jsxRuntime.jsxs)("span", {
|
|
111
|
-
css:
|
|
112
|
-
children: [
|
|
113
|
-
css:
|
|
114
|
+
css: this.props.styles?.igniteAIStacked,
|
|
115
|
+
children: [(0, _jsxRuntime.jsx)(_IconAiColoredSolid.IconAiColoredSolid, {}), (0, _jsxRuntime.jsx)("span", {
|
|
116
|
+
css: this.props.styles?.igniteAI,
|
|
114
117
|
children: "IgniteAI"
|
|
115
118
|
})]
|
|
116
119
|
}), children]
|
|
117
120
|
});
|
|
118
121
|
}
|
|
119
122
|
if (aiVariant === 'horizontal') {
|
|
120
|
-
var _this$props$styles5, _this$props$styles6;
|
|
121
123
|
return (0, _jsxRuntime.jsxs)("span", {
|
|
122
|
-
css:
|
|
124
|
+
css: this.props.styles?.withIcon,
|
|
123
125
|
"aria-hidden": "true",
|
|
124
|
-
children: [
|
|
125
|
-
css:
|
|
126
|
+
children: [(0, _jsxRuntime.jsx)(_IconAiColoredSolid.IconAiColoredSolid, {}), (0, _jsxRuntime.jsx)("span", {
|
|
127
|
+
css: this.props.styles?.igniteAI,
|
|
126
128
|
children: "IgniteAI"
|
|
127
129
|
}), children]
|
|
128
130
|
});
|
|
129
131
|
}
|
|
130
132
|
if (aiVariant === 'iconOnly') {
|
|
131
|
-
var _this$props$styles7;
|
|
132
133
|
return (0, _jsxRuntime.jsxs)("span", {
|
|
133
|
-
css:
|
|
134
|
+
css: this.props.styles?.withIcon,
|
|
134
135
|
"aria-hidden": "true",
|
|
135
|
-
children: [
|
|
136
|
+
children: [(0, _jsxRuntime.jsx)(_IconAiColoredSolid.IconAiColoredSolid, {}), "\xA0", children]
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
139
|
if (aiVariant === 'stacked') {
|
|
139
|
-
var _this$props$styles8, _this$props$styles9;
|
|
140
140
|
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
141
141
|
children: [(0, _jsxRuntime.jsxs)("span", {
|
|
142
|
-
css:
|
|
143
|
-
children: [
|
|
144
|
-
css:
|
|
142
|
+
css: this.props.styles?.igniteAIStacked,
|
|
143
|
+
children: [(0, _jsxRuntime.jsx)(_IconAiColoredSolid.IconAiColoredSolid, {}), (0, _jsxRuntime.jsx)("span", {
|
|
144
|
+
css: this.props.styles?.igniteAI,
|
|
145
145
|
children: "IgniteAI"
|
|
146
146
|
})]
|
|
147
147
|
}), children]
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
if (aiVariant === 'horizontal') {
|
|
151
|
-
var _this$props$styles0;
|
|
152
151
|
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
153
|
-
children: [
|
|
154
|
-
css:
|
|
152
|
+
children: [(0, _jsxRuntime.jsx)(_IconAiColoredSolid.IconAiColoredSolid, {}), (0, _jsxRuntime.jsx)("span", {
|
|
153
|
+
css: this.props.styles?.igniteAI,
|
|
155
154
|
children: "IgniteAI"
|
|
156
155
|
}), children]
|
|
157
156
|
});
|
|
158
157
|
}
|
|
159
158
|
if (aiVariant === 'iconOnly') {
|
|
160
159
|
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
161
|
-
children: [
|
|
160
|
+
children: [(0, _jsxRuntime.jsx)(_IconAiColoredSolid.IconAiColoredSolid, {}), "\xA0", children]
|
|
162
161
|
});
|
|
163
162
|
}
|
|
164
163
|
return children;
|
|
@@ -166,30 +165,31 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyleLegacy)(_styles.de
|
|
|
166
165
|
|
|
167
166
|
//overriding default screen reader functionality is needed to read spans in h tags correctly
|
|
168
167
|
getAriaLabel() {
|
|
169
|
-
const
|
|
170
|
-
aiVariant
|
|
171
|
-
children
|
|
172
|
-
renderIcon
|
|
168
|
+
const {
|
|
169
|
+
aiVariant,
|
|
170
|
+
children,
|
|
171
|
+
renderIcon
|
|
172
|
+
} = this.props;
|
|
173
173
|
if (aiVariant === 'stacked' || aiVariant === 'horizontal') {
|
|
174
174
|
return `IgniteAI, ${children}`;
|
|
175
175
|
}
|
|
176
176
|
if (aiVariant === 'iconOnly' || renderIcon) {
|
|
177
177
|
return `${children}`;
|
|
178
178
|
}
|
|
179
|
-
return
|
|
179
|
+
return undefined;
|
|
180
180
|
}
|
|
181
181
|
render() {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
182
|
+
const {
|
|
183
|
+
border,
|
|
184
|
+
children,
|
|
185
|
+
color,
|
|
186
|
+
level,
|
|
187
|
+
margin,
|
|
188
|
+
elementRef,
|
|
189
|
+
makeStyles,
|
|
190
|
+
variant,
|
|
191
|
+
...props
|
|
192
|
+
} = this.props;
|
|
193
193
|
let ElementType = 'h2';
|
|
194
194
|
if (variant) {
|
|
195
195
|
// TODO deprecated, remove. `variant` should not set DOM level
|
|
@@ -214,7 +214,7 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyleLegacy)(_styles.de
|
|
|
214
214
|
return (0, _jsxRuntime.jsx)(_v11_.View, {
|
|
215
215
|
"aria-label": this.getAriaLabel(),
|
|
216
216
|
...(0, _passthroughProps.passthroughProps)(props),
|
|
217
|
-
css:
|
|
217
|
+
css: this.props.styles?.heading,
|
|
218
218
|
as: ElementType,
|
|
219
219
|
elementRef: this.handleRef,
|
|
220
220
|
margin: margin,
|
|
@@ -222,9 +222,5 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyleLegacy)(_styles.de
|
|
|
222
222
|
children: this.renderContent()
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
|
-
}
|
|
226
|
-
children: null,
|
|
227
|
-
border: 'none',
|
|
228
|
-
color: 'inherit'
|
|
229
|
-
}, _Heading)) || _class);
|
|
225
|
+
}) || _class);
|
|
230
226
|
var _default = exports.default = Heading;
|
package/lib/Heading/v1/styles.js
CHANGED
|
@@ -39,11 +39,13 @@ exports.default = void 0;
|
|
|
39
39
|
* @return {Object} The final style object, which will be used in the component
|
|
40
40
|
*/
|
|
41
41
|
const generateStyle = (componentTheme, props) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
const {
|
|
43
|
+
level,
|
|
44
|
+
color,
|
|
45
|
+
border,
|
|
46
|
+
variant,
|
|
47
|
+
aiVariant
|
|
48
|
+
} = props;
|
|
47
49
|
const variants = {
|
|
48
50
|
titlePageDesktop: {
|
|
49
51
|
fontStyle: 'normal',
|
package/lib/Heading/v1/theme.js
CHANGED
|
@@ -34,12 +34,13 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
colors
|
|
40
|
-
spacing
|
|
41
|
-
borders
|
|
42
|
-
themeName
|
|
37
|
+
const {
|
|
38
|
+
typography,
|
|
39
|
+
colors,
|
|
40
|
+
spacing,
|
|
41
|
+
borders,
|
|
42
|
+
key: themeName
|
|
43
|
+
} = theme;
|
|
43
44
|
const themeSpecificStyle = {
|
|
44
45
|
canvas: {
|
|
45
46
|
primaryColor: theme['ic-brand-font-color-dark']
|
|
@@ -47,35 +48,35 @@ const generateComponentTheme = theme => {
|
|
|
47
48
|
};
|
|
48
49
|
const componentVariables = {
|
|
49
50
|
...typography,
|
|
50
|
-
lineHeight: typography
|
|
51
|
-
h1FontSize: typography
|
|
52
|
-
h1FontWeight: typography
|
|
53
|
-
h1FontFamily: typography
|
|
54
|
-
h2FontSize: typography
|
|
55
|
-
h2FontWeight: typography
|
|
56
|
-
h2FontFamily: typography
|
|
57
|
-
h3FontSize: typography
|
|
58
|
-
h3FontWeight: typography
|
|
59
|
-
h3FontFamily: typography
|
|
60
|
-
h4FontSize: typography
|
|
61
|
-
h4FontWeight: typography
|
|
62
|
-
h4FontFamily: typography
|
|
63
|
-
h5FontSize: typography
|
|
64
|
-
h5FontWeight: typography
|
|
65
|
-
h5FontFamily: typography
|
|
66
|
-
h6FontSize: typography
|
|
67
|
-
h6FontWeight: typography
|
|
68
|
-
h6FontFamily: typography
|
|
69
|
-
primaryInverseColor: colors
|
|
70
|
-
primaryColor: colors
|
|
71
|
-
secondaryColor: colors
|
|
72
|
-
secondaryInverseColor: colors
|
|
73
|
-
borderPadding: spacing
|
|
74
|
-
borderColor: colors
|
|
75
|
-
borderWidth: borders
|
|
76
|
-
borderStyle: borders
|
|
77
|
-
aiTextTopGradientColor: colors
|
|
78
|
-
aiTextBottomGradientColor: colors
|
|
51
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
52
|
+
h1FontSize: typography?.fontSizeXXLarge,
|
|
53
|
+
h1FontWeight: typography?.fontWeightBold,
|
|
54
|
+
h1FontFamily: typography?.fontFamily,
|
|
55
|
+
h2FontSize: typography?.fontSizeXLarge,
|
|
56
|
+
h2FontWeight: typography?.fontWeightNormal,
|
|
57
|
+
h2FontFamily: typography?.fontFamily,
|
|
58
|
+
h3FontSize: typography?.fontSizeLarge,
|
|
59
|
+
h3FontWeight: typography?.fontWeightBold,
|
|
60
|
+
h3FontFamily: typography?.fontFamily,
|
|
61
|
+
h4FontSize: typography?.fontSizeMedium,
|
|
62
|
+
h4FontWeight: typography?.fontWeightBold,
|
|
63
|
+
h4FontFamily: typography?.fontFamily,
|
|
64
|
+
h5FontSize: typography?.fontSizeSmall,
|
|
65
|
+
h5FontWeight: typography?.fontWeightNormal,
|
|
66
|
+
h5FontFamily: typography?.fontFamily,
|
|
67
|
+
h6FontSize: typography?.fontSizeXSmall,
|
|
68
|
+
h6FontWeight: typography?.fontWeightNormal,
|
|
69
|
+
h6FontFamily: typography?.fontFamily,
|
|
70
|
+
primaryInverseColor: colors?.contrasts?.white1010,
|
|
71
|
+
primaryColor: colors?.contrasts?.grey125125,
|
|
72
|
+
secondaryColor: colors?.contrasts?.grey4570,
|
|
73
|
+
secondaryInverseColor: colors?.contrasts?.grey1111,
|
|
74
|
+
borderPadding: spacing?.xxxSmall,
|
|
75
|
+
borderColor: colors?.contrasts?.grey3045,
|
|
76
|
+
borderWidth: borders?.widthSmall,
|
|
77
|
+
borderStyle: borders?.style,
|
|
78
|
+
aiTextTopGradientColor: colors?.contrasts?.violet4570,
|
|
79
|
+
aiTextBottomGradientColor: colors?.contrasts?.sea4570
|
|
79
80
|
};
|
|
80
81
|
return {
|
|
81
82
|
...componentVariables,
|
package/lib/Heading/v2/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.Heading = void 0;
|
|
8
|
-
|
|
8
|
+
require("core-js/modules/es.array.includes.js");
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _latest = require("@instructure/ui-view/latest");
|
|
11
11
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
@@ -14,8 +14,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
14
14
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
15
15
|
var _props = require("./props");
|
|
16
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
-
|
|
18
|
-
var _dec, _class, _Heading, _IgniteaiLogoInstUIIc;
|
|
17
|
+
var _dec, _class;
|
|
19
18
|
/*
|
|
20
19
|
* The MIT License (MIT)
|
|
21
20
|
*
|
|
@@ -97,41 +96,48 @@ const levelToAIHorizontalIconSize = {
|
|
|
97
96
|
category: components
|
|
98
97
|
---
|
|
99
98
|
**/
|
|
100
|
-
let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
99
|
+
let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = class Heading extends _react.Component {
|
|
100
|
+
static displayName = "Heading";
|
|
101
|
+
static componentId = 'Heading';
|
|
102
|
+
static allowedProps = _props.allowedProps;
|
|
103
|
+
static defaultProps = {
|
|
104
|
+
children: null,
|
|
105
|
+
border: 'none',
|
|
106
|
+
color: 'primary'
|
|
107
|
+
};
|
|
108
|
+
ref = null;
|
|
109
|
+
handleRef = el => {
|
|
110
|
+
const {
|
|
111
|
+
elementRef
|
|
112
|
+
} = this.props;
|
|
113
|
+
this.ref = el;
|
|
114
|
+
if (typeof elementRef === 'function') {
|
|
115
|
+
elementRef(el);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
112
118
|
checkProps() {
|
|
113
|
-
const
|
|
114
|
-
variant
|
|
115
|
-
as
|
|
119
|
+
const {
|
|
120
|
+
variant,
|
|
121
|
+
as
|
|
122
|
+
} = this.props;
|
|
116
123
|
if (variant) {
|
|
117
124
|
if (as) {}
|
|
118
125
|
}
|
|
119
126
|
}
|
|
120
127
|
componentDidMount() {
|
|
121
|
-
|
|
122
|
-
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
|
|
128
|
+
this.props.makeStyles?.();
|
|
123
129
|
this.checkProps();
|
|
124
130
|
}
|
|
125
131
|
componentDidUpdate() {
|
|
126
|
-
|
|
127
|
-
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
|
132
|
+
this.props.makeStyles?.();
|
|
128
133
|
this.checkProps();
|
|
129
134
|
}
|
|
130
135
|
getIconSize(forAIHorizontal = false) {
|
|
131
|
-
const
|
|
132
|
-
variant
|
|
133
|
-
level
|
|
134
|
-
as
|
|
136
|
+
const {
|
|
137
|
+
variant,
|
|
138
|
+
level,
|
|
139
|
+
as
|
|
140
|
+
} = this.props;
|
|
135
141
|
if (variant) {
|
|
136
142
|
return forAIHorizontal ? variantToAIHorizontalIconSize[variant] : variantToIconSize[variant];
|
|
137
143
|
}
|
|
@@ -145,56 +151,53 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default)
|
|
|
145
151
|
return 'md';
|
|
146
152
|
}
|
|
147
153
|
renderContent() {
|
|
148
|
-
const
|
|
149
|
-
children
|
|
150
|
-
renderIcon
|
|
151
|
-
aiVariant
|
|
154
|
+
const {
|
|
155
|
+
children,
|
|
156
|
+
renderIcon,
|
|
157
|
+
aiVariant
|
|
158
|
+
} = this.props;
|
|
152
159
|
if (renderIcon && !aiVariant) {
|
|
153
|
-
var _this$props$styles;
|
|
154
160
|
return (0, _jsxRuntime.jsxs)("span", {
|
|
155
|
-
css: [
|
|
161
|
+
css: [this.props.styles?.withIcon],
|
|
156
162
|
"aria-hidden": "true",
|
|
157
163
|
children: [(0, _uiIcons.renderIconWithProps)(renderIcon, this.getIconSize(), 'inherit'), children]
|
|
158
164
|
});
|
|
159
165
|
}
|
|
160
166
|
if (aiVariant === 'stacked') {
|
|
161
|
-
var _this$props$styles2, _this$props$styles3, _this$props$styles4;
|
|
162
167
|
return (0, _jsxRuntime.jsxs)("span", {
|
|
163
|
-
css: [
|
|
168
|
+
css: [this.props.styles?.withIcon],
|
|
164
169
|
"aria-hidden": "true",
|
|
165
170
|
children: [(0, _jsxRuntime.jsxs)("span", {
|
|
166
|
-
css:
|
|
167
|
-
children: [
|
|
171
|
+
css: this.props.styles?.igniteAIStacked,
|
|
172
|
+
children: [(0, _jsxRuntime.jsx)(_uiIcons.IgniteaiLogoInstUIIcon, {
|
|
168
173
|
color: "ai",
|
|
169
174
|
size: "sm"
|
|
170
|
-
})
|
|
171
|
-
css:
|
|
175
|
+
}), (0, _jsxRuntime.jsx)("span", {
|
|
176
|
+
css: this.props.styles?.igniteAI,
|
|
172
177
|
children: "IgniteAI"
|
|
173
178
|
})]
|
|
174
179
|
}), children]
|
|
175
180
|
});
|
|
176
181
|
}
|
|
177
182
|
if (aiVariant === 'horizontal') {
|
|
178
|
-
var _this$props$styles5, _this$props$styles6, _this$props$styles7;
|
|
179
183
|
return (0, _jsxRuntime.jsxs)("span", {
|
|
180
|
-
css:
|
|
184
|
+
css: this.props.styles?.withIcon,
|
|
181
185
|
"aria-hidden": "true",
|
|
182
186
|
children: [(0, _jsxRuntime.jsxs)("span", {
|
|
183
|
-
css:
|
|
187
|
+
css: this.props.styles?.igniteAIHorizontal,
|
|
184
188
|
children: [(0, _jsxRuntime.jsx)(_uiIcons.IgniteaiLogoInstUIIcon, {
|
|
185
189
|
color: "ai",
|
|
186
190
|
size: this.getIconSize(true)
|
|
187
191
|
}), (0, _jsxRuntime.jsx)("span", {
|
|
188
|
-
css:
|
|
192
|
+
css: this.props.styles?.igniteAI,
|
|
189
193
|
children: "IgniteAI"
|
|
190
194
|
})]
|
|
191
195
|
}), children]
|
|
192
196
|
});
|
|
193
197
|
}
|
|
194
198
|
if (aiVariant === 'iconOnly') {
|
|
195
|
-
var _this$props$styles8;
|
|
196
199
|
return (0, _jsxRuntime.jsxs)("span", {
|
|
197
|
-
css:
|
|
200
|
+
css: this.props.styles?.withIcon,
|
|
198
201
|
"aria-hidden": "true",
|
|
199
202
|
children: [(0, _jsxRuntime.jsx)(_uiIcons.IgniteaiLogoInstUIIcon, {
|
|
200
203
|
color: "ai",
|
|
@@ -207,30 +210,31 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default)
|
|
|
207
210
|
|
|
208
211
|
//overriding default screen reader functionality is needed to read spans in h tags correctly
|
|
209
212
|
getAriaLabel() {
|
|
210
|
-
const
|
|
211
|
-
aiVariant
|
|
212
|
-
children
|
|
213
|
-
renderIcon
|
|
213
|
+
const {
|
|
214
|
+
aiVariant,
|
|
215
|
+
children,
|
|
216
|
+
renderIcon
|
|
217
|
+
} = this.props;
|
|
214
218
|
if (aiVariant === 'stacked' || aiVariant === 'horizontal') {
|
|
215
219
|
return `IgniteAI, ${children}`;
|
|
216
220
|
}
|
|
217
221
|
if (aiVariant === 'iconOnly' || renderIcon) {
|
|
218
222
|
return `${children}`;
|
|
219
223
|
}
|
|
220
|
-
return
|
|
224
|
+
return undefined;
|
|
221
225
|
}
|
|
222
226
|
render() {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
227
|
+
const {
|
|
228
|
+
border,
|
|
229
|
+
children,
|
|
230
|
+
color,
|
|
231
|
+
level,
|
|
232
|
+
margin,
|
|
233
|
+
elementRef,
|
|
234
|
+
makeStyles,
|
|
235
|
+
variant,
|
|
236
|
+
...props
|
|
237
|
+
} = this.props;
|
|
234
238
|
let ElementType = 'h2';
|
|
235
239
|
if (variant) {
|
|
236
240
|
// TODO deprecated, remove. `variant` should not set DOM level
|
|
@@ -255,7 +259,7 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default)
|
|
|
255
259
|
return (0, _jsxRuntime.jsx)(_latest.View, {
|
|
256
260
|
"aria-label": this.getAriaLabel(),
|
|
257
261
|
...(0, _passthroughProps.passthroughProps)(props),
|
|
258
|
-
css:
|
|
262
|
+
css: this.props.styles?.heading,
|
|
259
263
|
as: ElementType,
|
|
260
264
|
elementRef: this.handleRef,
|
|
261
265
|
margin: margin,
|
|
@@ -263,9 +267,5 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default)
|
|
|
263
267
|
children: this.renderContent()
|
|
264
268
|
});
|
|
265
269
|
}
|
|
266
|
-
}
|
|
267
|
-
children: null,
|
|
268
|
-
border: 'none',
|
|
269
|
-
color: 'primary'
|
|
270
|
-
}, _Heading)) || _class);
|
|
270
|
+
}) || _class);
|
|
271
271
|
var _default = exports.default = Heading;
|
package/lib/Heading/v2/styles.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/es.array.includes.js");
|
|
7
8
|
/*
|
|
8
9
|
* The MIT License (MIT)
|
|
9
10
|
*
|
|
@@ -38,11 +39,13 @@ exports.default = void 0;
|
|
|
38
39
|
* @return {Object} The final style object, which will be used in the component
|
|
39
40
|
*/
|
|
40
41
|
const generateStyle = (componentTheme, props) => {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const {
|
|
43
|
+
level,
|
|
44
|
+
color,
|
|
45
|
+
border,
|
|
46
|
+
variant,
|
|
47
|
+
aiVariant
|
|
48
|
+
} = props;
|
|
46
49
|
const variants = {
|
|
47
50
|
titlePageDesktop: {
|
|
48
51
|
fontStyle: 'normal',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-heading",
|
|
3
|
-
"version": "11.7.3-snapshot-
|
|
3
|
+
"version": "11.7.3-snapshot-27",
|
|
4
4
|
"description": "A component for creating typographic headings",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
"bugs": "https://github.com/instructure/instructure-ui/issues",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@babel/runtime": "^7.
|
|
18
|
-
"@instructure/console": "11.7.3-snapshot-
|
|
19
|
-
"@instructure/shared-types": "11.7.3-snapshot-
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/
|
|
22
|
-
"@instructure/ui-react-utils": "11.7.3-snapshot-
|
|
23
|
-
"@instructure/ui-themes": "11.7.3-snapshot-
|
|
24
|
-
"@instructure/ui-view": "11.7.3-snapshot-
|
|
17
|
+
"@babel/runtime": "^7.29.2",
|
|
18
|
+
"@instructure/console": "11.7.3-snapshot-27",
|
|
19
|
+
"@instructure/shared-types": "11.7.3-snapshot-27",
|
|
20
|
+
"@instructure/ui-icons": "11.7.3-snapshot-27",
|
|
21
|
+
"@instructure/emotion": "11.7.3-snapshot-27",
|
|
22
|
+
"@instructure/ui-react-utils": "11.7.3-snapshot-27",
|
|
23
|
+
"@instructure/ui-themes": "11.7.3-snapshot-27",
|
|
24
|
+
"@instructure/ui-view": "11.7.3-snapshot-27"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@testing-library/jest-dom": "^6.6.3",
|
|
28
28
|
"@testing-library/react": "15.0.7",
|
|
29
29
|
"vitest": "^3.2.2",
|
|
30
|
-
"@instructure/ui-axe-check": "11.7.3-snapshot-
|
|
31
|
-
"@instructure/ui-babel-preset": "11.7.3-snapshot-
|
|
30
|
+
"@instructure/ui-axe-check": "11.7.3-snapshot-27",
|
|
31
|
+
"@instructure/ui-babel-preset": "11.7.3-snapshot-27"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": ">=18 <=19"
|