@instructure/ui-heading 11.7.9-snapshot-4 → 11.7.9-snapshot-5

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 CHANGED
@@ -3,12 +3,11 @@
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-snapshot-4](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-4) (2026-10-13)
7
-
8
- **Note:** Version bump only for package @instructure/ui-heading
9
-
6
+ ## [11.7.9-snapshot-5](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-5) (2026-10-13)
10
7
 
8
+ ### Features
11
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))
12
11
 
13
12
 
14
13
  ## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
@@ -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(forAIHorizontal = false) {
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(true)
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(true)
211
+ size: this.getIconSize('iconOnly')
198
212
  }), children]
199
213
  });
200
214
  }
@@ -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(forAIHorizontal = false) {
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(true)
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(true)
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.9-snapshot-4",
3
+ "version": "11.7.9-snapshot-5",
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.9-snapshot-4",
19
- "@instructure/emotion": "11.7.9-snapshot-4",
20
- "@instructure/shared-types": "11.7.9-snapshot-4",
21
- "@instructure/ui-icons": "11.7.9-snapshot-4",
22
- "@instructure/ui-react-utils": "11.7.9-snapshot-4",
23
- "@instructure/ui-themes": "11.7.9-snapshot-4",
24
- "@instructure/ui-view": "11.7.9-snapshot-4"
18
+ "@instructure/console": "11.7.9-snapshot-5",
19
+ "@instructure/emotion": "11.7.9-snapshot-5",
20
+ "@instructure/shared-types": "11.7.9-snapshot-5",
21
+ "@instructure/ui-icons": "11.7.9-snapshot-5",
22
+ "@instructure/ui-react-utils": "11.7.9-snapshot-5",
23
+ "@instructure/ui-themes": "11.7.9-snapshot-5",
24
+ "@instructure/ui-view": "11.7.9-snapshot-5"
25
25
  },
26
26
  "devDependencies": {
27
- "@instructure/ui-axe-check": "11.7.9-snapshot-4",
28
- "@instructure/ui-babel-preset": "11.7.9-snapshot-4",
27
+ "@instructure/ui-axe-check": "11.7.9-snapshot-5",
28
+ "@instructure/ui-babel-preset": "11.7.9-snapshot-5",
29
29
  "vitest": "^5.0.0"
30
30
  },
31
31
  "peerDependencies": {
@@ -42,16 +42,16 @@ type: example
42
42
 
43
43
  ### AI Heading
44
44
 
45
- Pre-configured and with unique styles, the `ai-headings` are used for standardized, ai-related components.
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: '24px'}}>
52
- <Heading aiVariant="stacked" level="h2">Nutrition Facts</Heading>
53
- <Heading aiVariant="horizontal" level="h3">Nutrition Facts</Heading>
54
- <Heading aiVariant="iconOnly" level="h4">Nutrition Facts</Heading>
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
 
@@ -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(forAIHorizontal = false) {
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 color="ai" size={this.getIconSize(true)} />
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 color="ai" size={this.getIconSize(true)} />
245
+ <IgniteaiLogoInstUIIcon
246
+ color="ai"
247
+ size={this.getIconSize('iconOnly')}
248
+ />
225
249
  {children}
226
250
  </span>
227
251
  )