@instructure/ui-heading 11.6.0 → 11.6.1-snapshot-129

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 (56) hide show
  1. package/CHANGELOG.md +42 -304
  2. package/es/Heading/{index.js → v1/index.js} +2 -2
  3. package/es/Heading/v2/index.js +266 -0
  4. package/es/Heading/v2/props.js +26 -0
  5. package/es/Heading/v2/styles.js +273 -0
  6. package/es/{index.js → exports/a.js} +1 -1
  7. package/{src/index.ts → es/exports/b.js} +1 -3
  8. package/lib/Heading/{index.js → v1/index.js} +4 -4
  9. package/lib/Heading/v2/index.js +271 -0
  10. package/lib/Heading/v2/props.js +31 -0
  11. package/lib/Heading/v2/styles.js +279 -0
  12. package/lib/{index.js → exports/a.js} +2 -2
  13. package/lib/exports/b.js +12 -0
  14. package/package.json +39 -17
  15. package/src/Heading/{index.tsx → v1/index.tsx} +2 -2
  16. package/src/Heading/v2/README.md +158 -0
  17. package/src/Heading/v2/index.tsx +291 -0
  18. package/src/Heading/v2/props.ts +133 -0
  19. package/src/Heading/v2/styles.ts +273 -0
  20. package/src/exports/a.ts +26 -0
  21. package/src/exports/b.ts +26 -0
  22. package/tsconfig.build.tsbuildinfo +1 -1
  23. package/types/Heading/v1/index.d.ts.map +1 -0
  24. package/types/Heading/v1/props.d.ts.map +1 -0
  25. package/types/Heading/v1/styles.d.ts.map +1 -0
  26. package/types/Heading/v1/theme.d.ts.map +1 -0
  27. package/types/Heading/v2/index.d.ts +40 -0
  28. package/types/Heading/v2/index.d.ts.map +1 -0
  29. package/types/Heading/v2/props.d.ts +62 -0
  30. package/types/Heading/v2/props.d.ts.map +1 -0
  31. package/types/Heading/v2/styles.d.ts +14 -0
  32. package/types/Heading/v2/styles.d.ts.map +1 -0
  33. package/types/exports/a.d.ts +3 -0
  34. package/types/exports/a.d.ts.map +1 -0
  35. package/types/exports/b.d.ts +3 -0
  36. package/types/exports/b.d.ts.map +1 -0
  37. package/types/Heading/index.d.ts.map +0 -1
  38. package/types/Heading/props.d.ts.map +0 -1
  39. package/types/Heading/styles.d.ts.map +0 -1
  40. package/types/Heading/theme.d.ts.map +0 -1
  41. package/types/index.d.ts +0 -3
  42. package/types/index.d.ts.map +0 -1
  43. /package/es/Heading/{props.js → v1/props.js} +0 -0
  44. /package/es/Heading/{styles.js → v1/styles.js} +0 -0
  45. /package/es/Heading/{theme.js → v1/theme.js} +0 -0
  46. /package/lib/Heading/{props.js → v1/props.js} +0 -0
  47. /package/lib/Heading/{styles.js → v1/styles.js} +0 -0
  48. /package/lib/Heading/{theme.js → v1/theme.js} +0 -0
  49. /package/src/Heading/{README.md → v1/README.md} +0 -0
  50. /package/src/Heading/{props.ts → v1/props.ts} +0 -0
  51. /package/src/Heading/{styles.ts → v1/styles.ts} +0 -0
  52. /package/src/Heading/{theme.ts → v1/theme.ts} +0 -0
  53. /package/types/Heading/{index.d.ts → v1/index.d.ts} +0 -0
  54. /package/types/Heading/{props.d.ts → v1/props.d.ts} +0 -0
  55. /package/types/Heading/{styles.d.ts → v1/styles.d.ts} +0 -0
  56. /package/types/Heading/{theme.d.ts → v1/theme.d.ts} +0 -0
@@ -0,0 +1,266 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ const _excluded = ["border", "children", "color", "level", "margin", "elementRef", "makeStyles", "variant"];
3
+ var _dec, _class, _Heading, _StarsInstUIIcon;
4
+ /*
5
+ * The MIT License (MIT)
6
+ *
7
+ * Copyright (c) 2015 - present Instructure, Inc.
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+
28
+ import { Component } from 'react';
29
+ import { View } from '@instructure/ui-view/latest';
30
+ import { passthroughProps } from '@instructure/ui-react-utils';
31
+ import { StarsInstUIIcon, renderIconWithProps } from '@instructure/ui-icons';
32
+ import { withStyle } from '@instructure/emotion';
33
+ import generateStyle from "./styles.js";
34
+ import { allowedProps } from "./props.js";
35
+ import { jsxs as _jsxs, jsx as _jsx } from "@emotion/react/jsx-runtime";
36
+ const variantLevels = {
37
+ titlePageDesktop: 'h1',
38
+ titlePageMobile: 'h1',
39
+ titleSection: 'h2',
40
+ titleCardSection: 'h2',
41
+ titleModule: 'h3',
42
+ titleCardLarge: 'h4',
43
+ titleCardRegular: 'h4',
44
+ titleCardMini: 'h4',
45
+ label: 'h5',
46
+ labelInline: 'h5'
47
+ };
48
+ const variantToIconSize = {
49
+ titlePageDesktop: '2xl',
50
+ titlePageMobile: 'xl',
51
+ titleSection: 'xl',
52
+ titleCardSection: 'xl',
53
+ titleModule: 'xl',
54
+ titleCardLarge: 'xl',
55
+ titleCardRegular: 'lg',
56
+ titleCardMini: 'md',
57
+ label: 'md',
58
+ labelInline: 'md'
59
+ };
60
+ const levelToIconSize = {
61
+ h1: '2xl',
62
+ h2: 'xl',
63
+ h3: 'xl',
64
+ h4: 'lg',
65
+ h5: 'md',
66
+ h6: 'md'
67
+ };
68
+ const variantToAIHorizontalIconSize = {
69
+ titlePageDesktop: '2xl',
70
+ titlePageMobile: 'xl',
71
+ titleSection: 'xl',
72
+ titleCardSection: 'xl',
73
+ titleModule: 'md',
74
+ titleCardLarge: 'md',
75
+ titleCardRegular: 'md',
76
+ titleCardMini: 'xs',
77
+ label: 'xs',
78
+ labelInline: 'xs'
79
+ };
80
+ const levelToAIHorizontalIconSize = {
81
+ h1: '2xl',
82
+ h2: 'lg',
83
+ h3: 'md',
84
+ h4: 'sm',
85
+ h5: 'xs',
86
+ h6: 'xs'
87
+ };
88
+
89
+ /**
90
+ ---
91
+ category: components
92
+ ---
93
+ **/
94
+ let Heading = (_dec = withStyle(generateStyle), _dec(_class = (_Heading = class Heading extends Component {
95
+ constructor(...args) {
96
+ super(...args);
97
+ this.ref = null;
98
+ this.handleRef = el => {
99
+ const elementRef = this.props.elementRef;
100
+ this.ref = el;
101
+ if (typeof elementRef === 'function') {
102
+ elementRef(el);
103
+ }
104
+ };
105
+ }
106
+ checkProps() {
107
+ const _this$props = this.props,
108
+ variant = _this$props.variant,
109
+ as = _this$props.as;
110
+ if (variant) {
111
+ if (as) {}
112
+ }
113
+ }
114
+ componentDidMount() {
115
+ var _this$props$makeStyle, _this$props2;
116
+ (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
117
+ this.checkProps();
118
+ }
119
+ componentDidUpdate() {
120
+ var _this$props$makeStyle2, _this$props3;
121
+ (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
122
+ this.checkProps();
123
+ }
124
+ getIconSize(forAIHorizontal = false) {
125
+ const _this$props4 = this.props,
126
+ variant = _this$props4.variant,
127
+ level = _this$props4.level,
128
+ as = _this$props4.as;
129
+ if (variant) {
130
+ return forAIHorizontal ? variantToAIHorizontalIconSize[variant] : variantToIconSize[variant];
131
+ }
132
+ if (level && level !== 'reset') {
133
+ return forAIHorizontal ? levelToAIHorizontalIconSize[level] : levelToIconSize[level];
134
+ }
135
+ if (as && typeof as === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(as)) {
136
+ const asLevel = as;
137
+ return forAIHorizontal ? levelToAIHorizontalIconSize[asLevel] : levelToIconSize[asLevel];
138
+ }
139
+ return 'md';
140
+ }
141
+ renderContent() {
142
+ const _this$props5 = this.props,
143
+ children = _this$props5.children,
144
+ renderIcon = _this$props5.renderIcon,
145
+ aiVariant = _this$props5.aiVariant;
146
+ if (renderIcon && !aiVariant) {
147
+ var _this$props$styles;
148
+ return _jsxs("span", {
149
+ css: [(_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.withIcon],
150
+ "aria-hidden": "true",
151
+ children: [renderIconWithProps(renderIcon, this.getIconSize(), 'inherit'), children]
152
+ });
153
+ }
154
+ if (aiVariant === 'stacked') {
155
+ var _this$props$styles2, _this$props$styles3, _this$props$styles4;
156
+ return _jsxs("span", {
157
+ css: [(_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.withIcon],
158
+ "aria-hidden": "true",
159
+ children: [_jsxs("span", {
160
+ css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.igniteAIStacked,
161
+ children: [_StarsInstUIIcon || (_StarsInstUIIcon = _jsx(StarsInstUIIcon, {
162
+ color: "ai",
163
+ size: "sm"
164
+ })), _jsx("span", {
165
+ css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.igniteAI,
166
+ children: "IgniteAI"
167
+ })]
168
+ }), children]
169
+ });
170
+ }
171
+ if (aiVariant === 'horizontal') {
172
+ var _this$props$styles5, _this$props$styles6, _this$props$styles7;
173
+ return _jsxs("span", {
174
+ css: (_this$props$styles5 = this.props.styles) === null || _this$props$styles5 === void 0 ? void 0 : _this$props$styles5.withIcon,
175
+ "aria-hidden": "true",
176
+ children: [_jsxs("span", {
177
+ css: (_this$props$styles6 = this.props.styles) === null || _this$props$styles6 === void 0 ? void 0 : _this$props$styles6.igniteAIHorizontal,
178
+ children: [_jsx(StarsInstUIIcon, {
179
+ color: "ai",
180
+ size: this.getIconSize(true)
181
+ }), _jsx("span", {
182
+ css: (_this$props$styles7 = this.props.styles) === null || _this$props$styles7 === void 0 ? void 0 : _this$props$styles7.igniteAI,
183
+ children: "IgniteAI"
184
+ })]
185
+ }), children]
186
+ });
187
+ }
188
+ if (aiVariant === 'iconOnly') {
189
+ var _this$props$styles8;
190
+ return _jsxs("span", {
191
+ css: (_this$props$styles8 = this.props.styles) === null || _this$props$styles8 === void 0 ? void 0 : _this$props$styles8.withIcon,
192
+ "aria-hidden": "true",
193
+ children: [_jsx(StarsInstUIIcon, {
194
+ color: "ai",
195
+ size: this.getIconSize(true)
196
+ }), children]
197
+ });
198
+ }
199
+ return children;
200
+ }
201
+
202
+ //overriding default screen reader functionality is needed to read spans in h tags correctly
203
+ getAriaLabel() {
204
+ const _this$props6 = this.props,
205
+ aiVariant = _this$props6.aiVariant,
206
+ children = _this$props6.children,
207
+ renderIcon = _this$props6.renderIcon;
208
+ if (aiVariant === 'stacked' || aiVariant === 'horizontal') {
209
+ return `IgniteAI, ${children}`;
210
+ }
211
+ if (aiVariant === 'iconOnly' || renderIcon) {
212
+ return `${children}`;
213
+ }
214
+ return void 0;
215
+ }
216
+ render() {
217
+ var _this$props$styles9;
218
+ const _this$props7 = this.props,
219
+ border = _this$props7.border,
220
+ children = _this$props7.children,
221
+ color = _this$props7.color,
222
+ level = _this$props7.level,
223
+ margin = _this$props7.margin,
224
+ elementRef = _this$props7.elementRef,
225
+ makeStyles = _this$props7.makeStyles,
226
+ variant = _this$props7.variant,
227
+ props = _objectWithoutProperties(_this$props7, _excluded);
228
+ let ElementType = 'h2';
229
+ if (variant) {
230
+ // TODO deprecated, remove. `variant` should not set DOM level
231
+ if (level) {
232
+ if (level === 'reset') {
233
+ ElementType = 'span';
234
+ } else {
235
+ ElementType = level;
236
+ }
237
+ } else {
238
+ ElementType = variantLevels[variant];
239
+ }
240
+ } else if (props.as) {
241
+ ElementType = props.as;
242
+ } else if (level) {
243
+ if (level === 'reset') {
244
+ ElementType = 'span';
245
+ } else {
246
+ ElementType = level;
247
+ }
248
+ }
249
+ return _jsx(View, {
250
+ "aria-label": this.getAriaLabel(),
251
+ ...passthroughProps(props),
252
+ css: (_this$props$styles9 = this.props.styles) === null || _this$props$styles9 === void 0 ? void 0 : _this$props$styles9.heading,
253
+ as: ElementType,
254
+ elementRef: this.handleRef,
255
+ margin: margin,
256
+ "data-cid": "Heading",
257
+ children: this.renderContent()
258
+ });
259
+ }
260
+ }, _Heading.displayName = "Heading", _Heading.componentId = 'Heading', _Heading.allowedProps = allowedProps, _Heading.defaultProps = {
261
+ children: null,
262
+ border: 'none',
263
+ color: 'primary'
264
+ }, _Heading)) || _class);
265
+ export default Heading;
266
+ export { Heading };
@@ -0,0 +1,26 @@
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 = ['aiVariant', 'border', 'children', 'color', 'level', 'as', 'margin', 'elementRef', 'variant'];
26
+ export { allowedProps };
@@ -0,0 +1,273 @@
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 level = props.level,
36
+ color = props.color,
37
+ border = props.border,
38
+ variant = props.variant,
39
+ aiVariant = props.aiVariant;
40
+ const variants = {
41
+ titlePageDesktop: {
42
+ fontStyle: 'normal',
43
+ ...componentTheme.titlePageDesktop
44
+ },
45
+ titlePageMobile: {
46
+ fontStyle: 'normal',
47
+ ...componentTheme.titlePageMobile
48
+ },
49
+ titleSection: {
50
+ fontStyle: 'normal',
51
+ ...componentTheme.titleSection
52
+ },
53
+ titleCardSection: {
54
+ fontStyle: 'normal',
55
+ ...componentTheme.titleCardSection
56
+ },
57
+ titleModule: {
58
+ fontStyle: 'normal',
59
+ ...componentTheme.titleModule
60
+ },
61
+ titleCardLarge: {
62
+ fontStyle: 'normal',
63
+ ...componentTheme.titleCardLarge
64
+ },
65
+ titleCardRegular: {
66
+ fontStyle: 'normal',
67
+ ...componentTheme.titleCardRegular
68
+ },
69
+ titleCardMini: {
70
+ fontStyle: 'normal',
71
+ ...componentTheme.titleCardMini
72
+ },
73
+ label: {
74
+ fontStyle: 'normal',
75
+ ...componentTheme.label
76
+ },
77
+ labelInline: {
78
+ fontStyle: 'normal',
79
+ ...componentTheme.labelInline
80
+ }
81
+ };
82
+ const levelStyles = {
83
+ h1: {
84
+ fontFamily: componentTheme.h1FontFamily,
85
+ fontSize: componentTheme.h1FontSize,
86
+ fontWeight: componentTheme.h1FontWeight
87
+ },
88
+ h2: {
89
+ fontFamily: componentTheme.h2FontFamily,
90
+ fontSize: componentTheme.h2FontSize,
91
+ fontWeight: componentTheme.h2FontWeight
92
+ },
93
+ h3: {
94
+ fontFamily: componentTheme.h3FontFamily,
95
+ fontSize: componentTheme.h3FontSize,
96
+ fontWeight: componentTheme.h3FontWeight
97
+ },
98
+ h4: {
99
+ fontFamily: componentTheme.h4FontFamily,
100
+ fontSize: componentTheme.h4FontSize,
101
+ fontWeight: componentTheme.h4FontWeight
102
+ },
103
+ h5: {
104
+ fontFamily: componentTheme.h5FontFamily,
105
+ fontSize: componentTheme.h5FontSize,
106
+ fontWeight: componentTheme.h5FontWeight
107
+ },
108
+ h6: {
109
+ fontFamily: componentTheme.h6FontFamily,
110
+ fontSize: componentTheme.h6FontSize,
111
+ fontWeight: componentTheme.h6FontWeight
112
+ },
113
+ reset: {
114
+ margin: 0,
115
+ fontSize: 'inherit',
116
+ fontWeight: 'inherit',
117
+ lineHeight: 'inherit'
118
+ }
119
+ };
120
+ const colorStyles = {
121
+ inherit: {
122
+ color: 'inherit'
123
+ },
124
+ primary: {
125
+ color: componentTheme.baseColor
126
+ },
127
+ secondary: {
128
+ color: componentTheme.mutedColor
129
+ },
130
+ 'primary-inverse': {
131
+ color: componentTheme.inverseColor
132
+ },
133
+ 'secondary-inverse': {
134
+ color: componentTheme.inverseColor
135
+ },
136
+ 'primary-on': {
137
+ color: componentTheme.baseOnColor
138
+ },
139
+ 'secondary-on': {
140
+ color: componentTheme.mutedOnColor
141
+ },
142
+ ai: {
143
+ background: `
144
+ linear-gradient(to bottom, ${componentTheme.aiTextTopGradientColor} 0%, ${componentTheme.aiTextBottomGradientColor} 100%) text`,
145
+ border: 'solid transparent',
146
+ WebkitTextFillColor: 'transparent',
147
+ '@media print': {
148
+ background: 'transparent',
149
+ WebkitTextFillColor: 'unset'
150
+ }
151
+ }
152
+ };
153
+ const borderStyles = {
154
+ top: {
155
+ paddingTop: componentTheme.borderPadding,
156
+ borderTop: `${componentTheme.borderWidth} ${componentTheme.borderStyle} ${componentTheme.borderColor}`
157
+ },
158
+ bottom: {
159
+ paddingBottom: componentTheme.borderPadding,
160
+ borderBottom: `${componentTheme.borderWidth} ${componentTheme.borderStyle} ${componentTheme.borderColor}`
161
+ },
162
+ none: {}
163
+ };
164
+ const inputStyles = {
165
+ outline: 0,
166
+ appearance: 'none',
167
+ boxSizing: 'border-box',
168
+ background: 'none',
169
+ border: 'none',
170
+ borderRadius: 0,
171
+ padding: 0,
172
+ margin: '-0.375rem 0 0 0',
173
+ color: 'inherit',
174
+ height: 'auto',
175
+ width: '100%',
176
+ lineHeight: 'inherit',
177
+ textAlign: 'start',
178
+ boxShadow: 'none',
179
+ display: 'block',
180
+ '&:focus': {
181
+ outline: 'none'
182
+ }
183
+ };
184
+ const iconGapVariants = {
185
+ titlePageDesktop: componentTheme.gapIconLg,
186
+ titlePageMobile: componentTheme.gapIconLg,
187
+ titleSection: componentTheme.gapIconLg,
188
+ titleCardSection: componentTheme.gapIconLg,
189
+ titleModule: componentTheme.gapIconMd,
190
+ titleCardLarge: componentTheme.gapIconMd,
191
+ titleCardRegular: componentTheme.gapIconMd,
192
+ titleCardMini: componentTheme.gapIconSm,
193
+ label: componentTheme.gapIconSm,
194
+ labelInline: componentTheme.gapIconSm
195
+ };
196
+ const iconGapLevels = {
197
+ h1: componentTheme.gapIconLg,
198
+ h2: componentTheme.gapIconLg,
199
+ h3: componentTheme.gapIconMd,
200
+ h4: componentTheme.gapIconMd,
201
+ h5: componentTheme.gapIconSm,
202
+ h6: componentTheme.gapIconSm
203
+ };
204
+ const getIconGap = () => {
205
+ if (variant) return {
206
+ gap: iconGapVariants[variant]
207
+ };
208
+ if (level && level !== 'reset') return {
209
+ gap: iconGapLevels[level]
210
+ };
211
+ if (props.as && typeof props.as === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(props.as)) {
212
+ return {
213
+ gap: iconGapLevels[props.as]
214
+ };
215
+ }
216
+ return {
217
+ gap: componentTheme.gapIconLg
218
+ };
219
+ };
220
+ return {
221
+ heading: {
222
+ label: 'heading',
223
+ lineHeight: componentTheme.lineHeight,
224
+ margin: 0,
225
+ // NOTE: the input styles exist to accommodate the InPlaceEdit component
226
+ // NOTE: needs separate groups for `:is()` and `:-webkit-any()` because of css selector group validation (see https://www.w3.org/TR/selectors-3/#grouping)
227
+ '&:is(input)[type]': inputStyles,
228
+ '&:-webkit-any(input)[type]': inputStyles,
229
+ ...(variant ? variants[variant] : levelStyles[level]),
230
+ ...colorStyles[color],
231
+ ...borderStyles[border]
232
+ },
233
+ igniteAI: {
234
+ label: 'heading__ignite-ai',
235
+ background: `
236
+ linear-gradient(to bottom, ${componentTheme.aiTextTopGradientColor} 0%, ${componentTheme.aiTextBottomGradientColor} 100%) text`,
237
+ border: 'solid transparent',
238
+ WebkitTextFillColor: 'transparent',
239
+ '@media print': {
240
+ background: 'transparent',
241
+ WebkitTextFillColor: 'unset'
242
+ },
243
+ ...(aiVariant !== 'stacked' && {
244
+ paddingRight: '.25rem'
245
+ })
246
+ },
247
+ igniteAIStacked: {
248
+ label: 'heading__ignite-ai-stacked',
249
+ fontSize: '1rem',
250
+ lineHeight: '1.25rem',
251
+ display: 'flex',
252
+ alignItems: 'center',
253
+ gap: componentTheme.gapIconSm
254
+ },
255
+ igniteAIHorizontal: {
256
+ label: 'heading__ignite-ai-horizontal',
257
+ display: 'flex',
258
+ alignItems: 'center',
259
+ ...getIconGap()
260
+ },
261
+ withIcon: {
262
+ label: 'heading__with-icon',
263
+ display: 'flex',
264
+ alignItems: 'center',
265
+ ...(aiVariant === 'stacked' && {
266
+ flexDirection: 'column',
267
+ alignItems: 'flex-start'
268
+ }),
269
+ ...getIconGap()
270
+ }
271
+ };
272
+ };
273
+ export default generateStyle;
@@ -21,4 +21,4 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
- export { Heading } from "./Heading/index.js";
24
+ export { Heading } from "../Heading/v1/index.js";
@@ -21,6 +21,4 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
-
25
- export { Heading } from './Heading'
26
- export type { HeadingProps } from './Heading/props'
24
+ export { Heading } from "../Heading/v2/index.js";
@@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = exports.Heading = void 0;
8
8
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
9
  var _react = require("react");
10
- var _View = require("@instructure/ui-view/lib/View");
10
+ var _v11_ = require("@instructure/ui-view/v11_6");
11
11
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
12
12
  var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
13
- var _IconAiColoredSolid7 = require("@instructure/ui-icons/lib/IconAiColoredSolid.js");
13
+ var _IconAiColoredSolid7 = require("@instructure/ui-icons/lib/generated/IconAiColoredSolid.js");
14
14
  var _emotion = require("@instructure/emotion");
15
15
  var _styles = _interopRequireDefault(require("./styles"));
16
16
  var _theme = _interopRequireDefault(require("./theme"));
@@ -59,7 +59,7 @@ const variantLevels = {
59
59
  category: components
60
60
  ---
61
61
  **/
62
- let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_Heading = class Heading extends _react.Component {
62
+ let Heading = exports.Heading = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_Heading = class Heading extends _react.Component {
63
63
  constructor(...args) {
64
64
  super(...args);
65
65
  this.ref = null;
@@ -211,7 +211,7 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default,
211
211
  ElementType = level;
212
212
  }
213
213
  }
214
- return (0, _jsxRuntime.jsx)(_View.View, {
214
+ return (0, _jsxRuntime.jsx)(_v11_.View, {
215
215
  "aria-label": this.getAriaLabel(),
216
216
  ...(0, _passthroughProps.passthroughProps)(props),
217
217
  css: (_this$props$styles1 = this.props.styles) === null || _this$props$styles1 === void 0 ? void 0 : _this$props$styles1.heading,