@instructure/ui-heading 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.
- package/CHANGELOG.md +13 -0
- package/es/Heading/v1/index.js +192 -198
- package/es/Heading/v1/props.js +12 -26
- package/es/Heading/v1/styles.js +200 -242
- package/es/Heading/v1/theme.js +44 -79
- package/es/Heading/v2/index.js +218 -235
- package/es/Heading/v2/props.js +12 -26
- package/es/Heading/v2/styles.js +229 -263
- package/es/exports/a.js +1 -25
- package/es/exports/b.js +1 -25
- package/package.json +12 -18
- package/tsconfig.build.json +0 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/lib/Heading/v1/index.js +0 -226
- package/lib/Heading/v1/props.js +0 -31
- package/lib/Heading/v1/styles.js +0 -251
- package/lib/Heading/v1/theme.js +0 -86
- package/lib/Heading/v2/index.js +0 -270
- package/lib/Heading/v2/props.js +0 -31
- package/lib/Heading/v2/styles.js +0 -274
- package/lib/exports/a.js +0 -12
- package/lib/exports/b.js +0 -12
- package/lib/package.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.7.9-pr-snapshot-1792147648392](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-pr-snapshot-1792147648392) (2026-10-16)
|
|
7
|
+
|
|
8
|
+
### Build System
|
|
9
|
+
|
|
10
|
+
* **many:** replace babel with swc ([7e36c54](https://github.com/instructure/instructure-ui/commit/7e36c54d240b4fa483801c03ab18e7f860f561e2))
|
|
11
|
+
|
|
12
|
+
### BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
* **many:** `@instructure/ui-babel-preset` and
|
|
15
|
+
`@instructure/browserslist-config-instui` are removed and will no longer be
|
|
16
|
+
published. Packages depend on `@swc/helpers` instead of `@babel/runtime`.
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
|
|
7
20
|
|
|
8
21
|
**Note:** Version bump only for package @instructure/ui-heading
|
package/es/Heading/v1/index.js
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
|
|
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, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
26
3
|
import { Component } from 'react';
|
|
27
4
|
import { View } from '@instructure/ui-view/v11_6';
|
|
28
5
|
import { passthroughProps, callRenderProp } from '@instructure/ui-react-utils';
|
|
@@ -31,190 +8,207 @@ import { withStyle } from '@instructure/emotion';
|
|
|
31
8
|
import generateStyle from './styles.js';
|
|
32
9
|
import generateComponentTheme from './theme.js';
|
|
33
10
|
import { allowedProps } from './props.js';
|
|
34
|
-
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
35
11
|
const variantLevels = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
12
|
+
titlePageDesktop: 'h1',
|
|
13
|
+
titlePageMobile: 'h1',
|
|
14
|
+
titleSection: 'h2',
|
|
15
|
+
titleCardSection: 'h2',
|
|
16
|
+
titleModule: 'h3',
|
|
17
|
+
titleCardLarge: 'h4',
|
|
18
|
+
titleCardRegular: 'h4',
|
|
19
|
+
titleCardMini: 'h4',
|
|
20
|
+
label: 'h5',
|
|
21
|
+
labelInline: 'h5'
|
|
46
22
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
category: components
|
|
51
|
-
---
|
|
52
|
-
**/
|
|
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);
|
|
23
|
+
class Heading extends Component {
|
|
24
|
+
static{
|
|
25
|
+
this.displayName = 'Heading';
|
|
70
26
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const {
|
|
74
|
-
variant,
|
|
75
|
-
as
|
|
76
|
-
} = this.props;
|
|
77
|
-
if (variant) {
|
|
78
|
-
if (as) {}
|
|
27
|
+
static{
|
|
28
|
+
this.componentId = 'Heading';
|
|
79
29
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.props.makeStyles?.();
|
|
83
|
-
this.checkProps();
|
|
84
|
-
}
|
|
85
|
-
componentDidUpdate() {
|
|
86
|
-
this.props.makeStyles?.();
|
|
87
|
-
this.checkProps();
|
|
88
|
-
}
|
|
89
|
-
renderContent() {
|
|
90
|
-
const {
|
|
91
|
-
children,
|
|
92
|
-
renderIcon,
|
|
93
|
-
aiVariant
|
|
94
|
-
} = this.props;
|
|
95
|
-
if (renderIcon && !aiVariant) {
|
|
96
|
-
return _jsxs("span", {
|
|
97
|
-
css: [this.props.styles?.withIcon],
|
|
98
|
-
"aria-hidden": "true",
|
|
99
|
-
children: [callRenderProp(renderIcon), "\xA0", children]
|
|
100
|
-
});
|
|
30
|
+
static{
|
|
31
|
+
this.allowedProps = allowedProps;
|
|
101
32
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
children: [_jsx(IconAiColoredSolid, {}), _jsx("span", {
|
|
109
|
-
css: this.props.styles?.igniteAI,
|
|
110
|
-
children: "IgniteAI"
|
|
111
|
-
})]
|
|
112
|
-
}), children]
|
|
113
|
-
});
|
|
33
|
+
static{
|
|
34
|
+
this.defaultProps = {
|
|
35
|
+
children: null,
|
|
36
|
+
border: 'none',
|
|
37
|
+
color: 'inherit'
|
|
38
|
+
};
|
|
114
39
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}), children]
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
if (aiVariant === 'iconOnly') {
|
|
126
|
-
return _jsxs("span", {
|
|
127
|
-
css: this.props.styles?.withIcon,
|
|
128
|
-
"aria-hidden": "true",
|
|
129
|
-
children: [_jsx(IconAiColoredSolid, {}), "\xA0", children]
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
if (aiVariant === 'stacked') {
|
|
133
|
-
return _jsxs(_Fragment, {
|
|
134
|
-
children: [_jsxs("span", {
|
|
135
|
-
css: this.props.styles?.igniteAIStacked,
|
|
136
|
-
children: [_jsx(IconAiColoredSolid, {}), _jsx("span", {
|
|
137
|
-
css: this.props.styles?.igniteAI,
|
|
138
|
-
children: "IgniteAI"
|
|
139
|
-
})]
|
|
140
|
-
}), children]
|
|
141
|
-
});
|
|
40
|
+
checkProps() {
|
|
41
|
+
const { variant, as } = this.props;
|
|
42
|
+
if (variant) {
|
|
43
|
+
if (as) {
|
|
44
|
+
void 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
142
47
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
css: this.props.styles?.igniteAI,
|
|
147
|
-
children: "IgniteAI"
|
|
148
|
-
}), children]
|
|
149
|
-
});
|
|
48
|
+
componentDidMount() {
|
|
49
|
+
this.props.makeStyles?.();
|
|
50
|
+
this.checkProps();
|
|
150
51
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
});
|
|
52
|
+
componentDidUpdate() {
|
|
53
|
+
this.props.makeStyles?.();
|
|
54
|
+
this.checkProps();
|
|
155
55
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
56
|
+
renderContent() {
|
|
57
|
+
const { children, renderIcon, aiVariant } = this.props;
|
|
58
|
+
if (renderIcon && !aiVariant) {
|
|
59
|
+
return /*#__PURE__*/ _jsxs("span", {
|
|
60
|
+
css: [
|
|
61
|
+
this.props.styles?.withIcon
|
|
62
|
+
],
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
children: [
|
|
65
|
+
callRenderProp(renderIcon),
|
|
66
|
+
"\xa0",
|
|
67
|
+
children
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (aiVariant === 'stacked') {
|
|
72
|
+
return /*#__PURE__*/ _jsxs("span", {
|
|
73
|
+
css: [
|
|
74
|
+
this.props.styles?.withIcon
|
|
75
|
+
],
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
children: [
|
|
78
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
79
|
+
css: this.props.styles?.igniteAIStacked,
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsx(IconAiColoredSolid, {}),
|
|
82
|
+
/*#__PURE__*/ _jsx("span", {
|
|
83
|
+
css: this.props.styles?.igniteAI,
|
|
84
|
+
children: "IgniteAI"
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
}),
|
|
88
|
+
children
|
|
89
|
+
]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (aiVariant === 'horizontal') {
|
|
93
|
+
return /*#__PURE__*/ _jsxs("span", {
|
|
94
|
+
css: this.props.styles?.withIcon,
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
children: [
|
|
97
|
+
/*#__PURE__*/ _jsx(IconAiColoredSolid, {}),
|
|
98
|
+
/*#__PURE__*/ _jsx("span", {
|
|
99
|
+
css: this.props.styles?.igniteAI,
|
|
100
|
+
children: "IgniteAI"
|
|
101
|
+
}),
|
|
102
|
+
children
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (aiVariant === 'iconOnly') {
|
|
107
|
+
return /*#__PURE__*/ _jsxs("span", {
|
|
108
|
+
css: this.props.styles?.withIcon,
|
|
109
|
+
"aria-hidden": "true",
|
|
110
|
+
children: [
|
|
111
|
+
/*#__PURE__*/ _jsx(IconAiColoredSolid, {}),
|
|
112
|
+
"\xa0",
|
|
113
|
+
children
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (aiVariant === 'stacked') {
|
|
118
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
119
|
+
children: [
|
|
120
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
121
|
+
css: this.props.styles?.igniteAIStacked,
|
|
122
|
+
children: [
|
|
123
|
+
/*#__PURE__*/ _jsx(IconAiColoredSolid, {}),
|
|
124
|
+
/*#__PURE__*/ _jsx("span", {
|
|
125
|
+
css: this.props.styles?.igniteAI,
|
|
126
|
+
children: "IgniteAI"
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}),
|
|
130
|
+
children
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
if (aiVariant === 'horizontal') {
|
|
135
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
136
|
+
children: [
|
|
137
|
+
/*#__PURE__*/ _jsx(IconAiColoredSolid, {}),
|
|
138
|
+
/*#__PURE__*/ _jsx("span", {
|
|
139
|
+
css: this.props.styles?.igniteAI,
|
|
140
|
+
children: "IgniteAI"
|
|
141
|
+
}),
|
|
142
|
+
children
|
|
143
|
+
]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (aiVariant === 'iconOnly') {
|
|
147
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
148
|
+
children: [
|
|
149
|
+
/*#__PURE__*/ _jsx(IconAiColoredSolid, {}),
|
|
150
|
+
"\xa0",
|
|
151
|
+
children
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return children;
|
|
168
156
|
}
|
|
169
|
-
|
|
170
|
-
|
|
157
|
+
getAriaLabel() {
|
|
158
|
+
const { aiVariant, children, renderIcon } = this.props;
|
|
159
|
+
if (aiVariant === 'stacked' || aiVariant === 'horizontal') {
|
|
160
|
+
return `IgniteAI, ${children}`;
|
|
161
|
+
}
|
|
162
|
+
if (aiVariant === 'iconOnly' || renderIcon) {
|
|
163
|
+
return `${children}`;
|
|
164
|
+
}
|
|
165
|
+
return undefined;
|
|
171
166
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
ElementType = level;
|
|
167
|
+
render() {
|
|
168
|
+
const { border, children, color, level, margin, elementRef, makeStyles, variant, ...props } = this.props;
|
|
169
|
+
let ElementType = 'h2';
|
|
170
|
+
if (variant) {
|
|
171
|
+
if (level) {
|
|
172
|
+
if (level === 'reset') {
|
|
173
|
+
ElementType = 'span';
|
|
174
|
+
} else {
|
|
175
|
+
ElementType = level;
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
ElementType = variantLevels[variant];
|
|
179
|
+
}
|
|
180
|
+
} else if (props.as) {
|
|
181
|
+
ElementType = props.as;
|
|
182
|
+
} else if (level) {
|
|
183
|
+
if (level === 'reset') {
|
|
184
|
+
ElementType = 'span';
|
|
185
|
+
} else {
|
|
186
|
+
ElementType = level;
|
|
187
|
+
}
|
|
194
188
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
189
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
190
|
+
"aria-label": this.getAriaLabel(),
|
|
191
|
+
...passthroughProps(props),
|
|
192
|
+
css: this.props.styles?.heading,
|
|
193
|
+
as: ElementType,
|
|
194
|
+
elementRef: this.handleRef,
|
|
195
|
+
margin: margin,
|
|
196
|
+
"data-cid": "Heading",
|
|
197
|
+
children: this.renderContent()
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
constructor(...args){
|
|
201
|
+
super(...args), this.ref = null, this.handleRef = (el)=>{
|
|
202
|
+
const { elementRef } = this.props;
|
|
203
|
+
this.ref = el;
|
|
204
|
+
if (typeof elementRef === 'function') {
|
|
205
|
+
elementRef(el);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
206
208
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
as: ElementType,
|
|
212
|
-
elementRef: this.handleRef,
|
|
213
|
-
margin: margin,
|
|
214
|
-
"data-cid": "Heading",
|
|
215
|
-
children: this.renderContent()
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}) || _class);
|
|
209
|
+
}
|
|
210
|
+
Heading = _ts_decorate([
|
|
211
|
+
withStyle(generateStyle, generateComponentTheme)
|
|
212
|
+
], Heading);
|
|
219
213
|
export default Heading;
|
|
220
|
-
export { Heading };
|
|
214
|
+
export { Heading };
|
package/es/Heading/v1/props.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 };
|
|
1
|
+
const allowedProps = [
|
|
2
|
+
'aiVariant',
|
|
3
|
+
'border',
|
|
4
|
+
'children',
|
|
5
|
+
'color',
|
|
6
|
+
'level',
|
|
7
|
+
'as',
|
|
8
|
+
'margin',
|
|
9
|
+
'elementRef',
|
|
10
|
+
'variant'
|
|
11
|
+
];
|
|
12
|
+
export { allowedProps };
|