@instructure/ui-heading 11.7.9-snapshot-4 → 11.7.10-snapshot--1
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 +8 -2
- package/es/Heading/v2/index.js +17 -3
- package/lib/Heading/v2/index.js +17 -3
- package/package.json +10 -10
- package/src/Heading/v2/README.md +5 -5
- package/src/Heading/v2/index.tsx +27 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Heading/v2/index.d.ts +1 -1
- package/types/Heading/v2/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,18 @@
|
|
|
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.
|
|
6
|
+
## [11.7.10-snapshot--1](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.10-snapshot--1) (2026-10-14)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **ui-heading:** add AI Heading iconOnly sizes for every Heading variant ([#2738](https://github.com/instructure/instructure-ui/issues/2738)) ([b107d8f](https://github.com/instructure/instructure-ui/commit/b107d8f91673fc8a8835876075a9da6f4acbef03))
|
|
9
11
|
|
|
10
12
|
|
|
13
|
+
## [11.7.9](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9) (2026-10-13)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
11
16
|
|
|
17
|
+
* **ui-heading:** add AI Heading iconOnly sizes for every Heading variant ([#2738](https://github.com/instructure/instructure-ui/issues/2738)) ([b107d8f](https://github.com/instructure/instructure-ui/commit/b107d8f91673fc8a8835876075a9da6f4acbef03))
|
|
12
18
|
|
|
13
19
|
|
|
14
20
|
## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
|
package/es/Heading/v2/index.js
CHANGED
|
@@ -75,6 +75,18 @@ const variantToAIHorizontalIconSize = {
|
|
|
75
75
|
label: 'xs',
|
|
76
76
|
labelInline: 'xs'
|
|
77
77
|
};
|
|
78
|
+
const variantToAIIconOnlySize = {
|
|
79
|
+
titlePageDesktop: 'xl',
|
|
80
|
+
titlePageMobile: 'xl',
|
|
81
|
+
titleSection: 'xl',
|
|
82
|
+
titleCardSection: 'lg',
|
|
83
|
+
titleModule: 'lg',
|
|
84
|
+
titleCardLarge: 'lg',
|
|
85
|
+
titleCardRegular: 'md',
|
|
86
|
+
titleCardMini: 'sm',
|
|
87
|
+
label: 'sm',
|
|
88
|
+
labelInline: 'sm'
|
|
89
|
+
};
|
|
78
90
|
const levelToAIHorizontalIconSize = {
|
|
79
91
|
h1: '2xl',
|
|
80
92
|
h2: 'lg',
|
|
@@ -125,13 +137,15 @@ let Heading = (_dec = withStyleNew(generateStyle), _dec(_class = class Heading e
|
|
|
125
137
|
this.props.makeStyles?.();
|
|
126
138
|
this.checkProps();
|
|
127
139
|
}
|
|
128
|
-
getIconSize(
|
|
140
|
+
getIconSize(aiMode) {
|
|
129
141
|
const {
|
|
130
142
|
variant,
|
|
131
143
|
level,
|
|
132
144
|
as
|
|
133
145
|
} = this.props;
|
|
146
|
+
const forAIHorizontal = !!aiMode;
|
|
134
147
|
if (variant) {
|
|
148
|
+
if (aiMode === 'iconOnly') return variantToAIIconOnlySize[variant];
|
|
135
149
|
return forAIHorizontal ? variantToAIHorizontalIconSize[variant] : variantToIconSize[variant];
|
|
136
150
|
}
|
|
137
151
|
if (level && level !== 'reset') {
|
|
@@ -180,7 +194,7 @@ let Heading = (_dec = withStyleNew(generateStyle), _dec(_class = class Heading e
|
|
|
180
194
|
css: this.props.styles?.igniteAIHorizontal,
|
|
181
195
|
children: [_jsx(IgniteaiLogoInstUIIcon, {
|
|
182
196
|
color: "ai",
|
|
183
|
-
size: this.getIconSize(
|
|
197
|
+
size: this.getIconSize('horizontal')
|
|
184
198
|
}), _jsx("span", {
|
|
185
199
|
css: this.props.styles?.igniteAI,
|
|
186
200
|
children: "IgniteAI"
|
|
@@ -194,7 +208,7 @@ let Heading = (_dec = withStyleNew(generateStyle), _dec(_class = class Heading e
|
|
|
194
208
|
"aria-hidden": "true",
|
|
195
209
|
children: [_jsx(IgniteaiLogoInstUIIcon, {
|
|
196
210
|
color: "ai",
|
|
197
|
-
size: this.getIconSize(
|
|
211
|
+
size: this.getIconSize('iconOnly')
|
|
198
212
|
}), children]
|
|
199
213
|
});
|
|
200
214
|
}
|
package/lib/Heading/v2/index.js
CHANGED
|
@@ -81,6 +81,18 @@ const variantToAIHorizontalIconSize = {
|
|
|
81
81
|
label: 'xs',
|
|
82
82
|
labelInline: 'xs'
|
|
83
83
|
};
|
|
84
|
+
const variantToAIIconOnlySize = {
|
|
85
|
+
titlePageDesktop: 'xl',
|
|
86
|
+
titlePageMobile: 'xl',
|
|
87
|
+
titleSection: 'xl',
|
|
88
|
+
titleCardSection: 'lg',
|
|
89
|
+
titleModule: 'lg',
|
|
90
|
+
titleCardLarge: 'lg',
|
|
91
|
+
titleCardRegular: 'md',
|
|
92
|
+
titleCardMini: 'sm',
|
|
93
|
+
label: 'sm',
|
|
94
|
+
labelInline: 'sm'
|
|
95
|
+
};
|
|
84
96
|
const levelToAIHorizontalIconSize = {
|
|
85
97
|
h1: '2xl',
|
|
86
98
|
h2: 'lg',
|
|
@@ -131,13 +143,15 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyleNew)(_styles.defau
|
|
|
131
143
|
this.props.makeStyles?.();
|
|
132
144
|
this.checkProps();
|
|
133
145
|
}
|
|
134
|
-
getIconSize(
|
|
146
|
+
getIconSize(aiMode) {
|
|
135
147
|
const {
|
|
136
148
|
variant,
|
|
137
149
|
level,
|
|
138
150
|
as
|
|
139
151
|
} = this.props;
|
|
152
|
+
const forAIHorizontal = !!aiMode;
|
|
140
153
|
if (variant) {
|
|
154
|
+
if (aiMode === 'iconOnly') return variantToAIIconOnlySize[variant];
|
|
141
155
|
return forAIHorizontal ? variantToAIHorizontalIconSize[variant] : variantToIconSize[variant];
|
|
142
156
|
}
|
|
143
157
|
if (level && level !== 'reset') {
|
|
@@ -186,7 +200,7 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyleNew)(_styles.defau
|
|
|
186
200
|
css: this.props.styles?.igniteAIHorizontal,
|
|
187
201
|
children: [(0, _jsxRuntime.jsx)(_uiIcons.IgniteaiLogoInstUIIcon, {
|
|
188
202
|
color: "ai",
|
|
189
|
-
size: this.getIconSize(
|
|
203
|
+
size: this.getIconSize('horizontal')
|
|
190
204
|
}), (0, _jsxRuntime.jsx)("span", {
|
|
191
205
|
css: this.props.styles?.igniteAI,
|
|
192
206
|
children: "IgniteAI"
|
|
@@ -200,7 +214,7 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyleNew)(_styles.defau
|
|
|
200
214
|
"aria-hidden": "true",
|
|
201
215
|
children: [(0, _jsxRuntime.jsx)(_uiIcons.IgniteaiLogoInstUIIcon, {
|
|
202
216
|
color: "ai",
|
|
203
|
-
size: this.getIconSize(
|
|
217
|
+
size: this.getIconSize('iconOnly')
|
|
204
218
|
}), children]
|
|
205
219
|
});
|
|
206
220
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-heading",
|
|
3
|
-
"version": "11.7.
|
|
3
|
+
"version": "11.7.10-snapshot--1",
|
|
4
4
|
"description": "A component for creating typographic headings",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/console": "11.7.
|
|
19
|
-
"@instructure/emotion": "11.7.
|
|
20
|
-
"@instructure/shared-types": "11.7.
|
|
21
|
-
"@instructure/ui-icons": "11.7.
|
|
22
|
-
"@instructure/ui-react-utils": "11.7.
|
|
23
|
-
"@instructure/ui-themes": "11.7.
|
|
24
|
-
"@instructure/ui-view": "11.7.
|
|
18
|
+
"@instructure/console": "11.7.10-snapshot--1",
|
|
19
|
+
"@instructure/emotion": "11.7.10-snapshot--1",
|
|
20
|
+
"@instructure/shared-types": "11.7.10-snapshot--1",
|
|
21
|
+
"@instructure/ui-icons": "11.7.10-snapshot--1",
|
|
22
|
+
"@instructure/ui-react-utils": "11.7.10-snapshot--1",
|
|
23
|
+
"@instructure/ui-themes": "11.7.10-snapshot--1",
|
|
24
|
+
"@instructure/ui-view": "11.7.10-snapshot--1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@instructure/ui-axe-check": "11.7.
|
|
28
|
-
"@instructure/ui-babel-preset": "11.7.
|
|
27
|
+
"@instructure/ui-axe-check": "11.7.10-snapshot--1",
|
|
28
|
+
"@instructure/ui-babel-preset": "11.7.10-snapshot--1",
|
|
29
29
|
"vitest": "^5.0.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
package/src/Heading/v2/README.md
CHANGED
|
@@ -42,16 +42,16 @@ type: example
|
|
|
42
42
|
|
|
43
43
|
### AI Heading
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Use the `aiVariant` prop for headings of AI-related content, such as a Modal or Popover header. Use a standard Heading for all other headings.
|
|
46
46
|
|
|
47
47
|
```js
|
|
48
48
|
---
|
|
49
49
|
type: example
|
|
50
50
|
---
|
|
51
|
-
<div style={{display: 'flex', flexDirection: 'column', gap: '
|
|
52
|
-
<Heading aiVariant="stacked" level="h2">
|
|
53
|
-
<Heading aiVariant="horizontal" level="
|
|
54
|
-
<Heading aiVariant="iconOnly" level="
|
|
51
|
+
<div style={{display: 'flex', flexDirection: 'column', gap: '1rem'}}>
|
|
52
|
+
<Heading aiVariant="stacked" variant="titleSection" level="h2">Stacked AI heading</Heading>
|
|
53
|
+
<Heading aiVariant="horizontal" variant="titleSection" level="h2">Horizontal AI heading</Heading>
|
|
54
|
+
<Heading aiVariant="iconOnly" variant="titleSection" level="h2">Icon only AI heading</Heading>
|
|
55
55
|
</div>
|
|
56
56
|
```
|
|
57
57
|
|
package/src/Heading/v2/index.tsx
CHANGED
|
@@ -99,6 +99,22 @@ const variantToAIHorizontalIconSize: Record<
|
|
|
99
99
|
labelInline: 'xs'
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
const variantToAIIconOnlySize: Record<
|
|
103
|
+
NonNullable<HeadingProps['variant']>,
|
|
104
|
+
'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
|
105
|
+
> = {
|
|
106
|
+
titlePageDesktop: 'xl',
|
|
107
|
+
titlePageMobile: 'xl',
|
|
108
|
+
titleSection: 'xl',
|
|
109
|
+
titleCardSection: 'lg',
|
|
110
|
+
titleModule: 'lg',
|
|
111
|
+
titleCardLarge: 'lg',
|
|
112
|
+
titleCardRegular: 'md',
|
|
113
|
+
titleCardMini: 'sm',
|
|
114
|
+
label: 'sm',
|
|
115
|
+
labelInline: 'sm'
|
|
116
|
+
}
|
|
117
|
+
|
|
102
118
|
const levelToAIHorizontalIconSize: Record<
|
|
103
119
|
Exclude<HeadingProps['level'], 'reset' | undefined>,
|
|
104
120
|
'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
|
@@ -159,10 +175,12 @@ class Heading extends Component<HeadingProps> {
|
|
|
159
175
|
this.checkProps()
|
|
160
176
|
}
|
|
161
177
|
|
|
162
|
-
getIconSize(
|
|
178
|
+
getIconSize(aiMode?: 'horizontal' | 'iconOnly') {
|
|
163
179
|
const { variant, level, as } = this.props
|
|
180
|
+
const forAIHorizontal = !!aiMode
|
|
164
181
|
|
|
165
182
|
if (variant) {
|
|
183
|
+
if (aiMode === 'iconOnly') return variantToAIIconOnlySize[variant]
|
|
166
184
|
return forAIHorizontal
|
|
167
185
|
? variantToAIHorizontalIconSize[variant]
|
|
168
186
|
: variantToIconSize[variant]
|
|
@@ -211,7 +229,10 @@ class Heading extends Component<HeadingProps> {
|
|
|
211
229
|
return (
|
|
212
230
|
<span css={this.props.styles?.withIcon} aria-hidden="true">
|
|
213
231
|
<span css={this.props.styles?.igniteAIHorizontal}>
|
|
214
|
-
<IgniteaiLogoInstUIIcon
|
|
232
|
+
<IgniteaiLogoInstUIIcon
|
|
233
|
+
color="ai"
|
|
234
|
+
size={this.getIconSize('horizontal')}
|
|
235
|
+
/>
|
|
215
236
|
<span css={this.props.styles?.igniteAI}>IgniteAI</span>
|
|
216
237
|
</span>
|
|
217
238
|
{children}
|
|
@@ -221,7 +242,10 @@ class Heading extends Component<HeadingProps> {
|
|
|
221
242
|
if (aiVariant === 'iconOnly') {
|
|
222
243
|
return (
|
|
223
244
|
<span css={this.props.styles?.withIcon} aria-hidden="true">
|
|
224
|
-
<IgniteaiLogoInstUIIcon
|
|
245
|
+
<IgniteaiLogoInstUIIcon
|
|
246
|
+
color="ai"
|
|
247
|
+
size={this.getIconSize('iconOnly')}
|
|
248
|
+
/>
|
|
225
249
|
{children}
|
|
226
250
|
</span>
|
|
227
251
|
)
|