@atlaskit/heading 2.2.0 → 2.3.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 CHANGED
@@ -1,28 +1,50 @@
1
1
  # @atlaskit/heading
2
2
 
3
+ ## 2.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#97580](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97580)
14
+ [`3e6f291ec2d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3e6f291ec2d5) -
15
+ Color prop to take color tokens when using heading with size prop.
16
+
3
17
  ## 2.2.0
4
18
 
5
19
  ### Minor Changes
6
20
 
7
- - [#91625](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91625) [`d7770083ff25`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d7770083ff25) - Add support for React 18.
21
+ - [#91625](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91625)
22
+ [`d7770083ff25`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d7770083ff25) -
23
+ Add support for React 18.
8
24
 
9
25
  ## 2.1.2
10
26
 
11
27
  ### Patch Changes
12
28
 
13
- - [#83130](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83130) [`4efd62cdc533`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4efd62cdc533) - SHPLVIII-481: Assign name to default export components to fix quick-fix imports
29
+ - [#83130](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83130)
30
+ [`4efd62cdc533`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4efd62cdc533) -
31
+ SHPLVIII-481: Assign name to default export components to fix quick-fix imports
14
32
 
15
33
  ## 2.1.1
16
34
 
17
35
  ### Patch Changes
18
36
 
19
- - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
37
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
38
+ [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
39
+ Upgrade Typescript from `4.9.5` to `5.4.2`
20
40
 
21
41
  ## 2.1.0
22
42
 
23
43
  ### Minor Changes
24
44
 
25
- - [#78900](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78900) [`2e05dc3106e3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2e05dc3106e3) - Run codegen for Heading font family changes.
45
+ - [#78900](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78900)
46
+ [`2e05dc3106e3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2e05dc3106e3) -
47
+ Run codegen for Heading font family changes.
26
48
 
27
49
  ### Patch Changes
28
50
 
@@ -32,38 +54,50 @@
32
54
 
33
55
  ### Patch Changes
34
56
 
35
- - [#80571](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80571) [`c193ae1d1163`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c193ae1d1163) - Fix heading typography styles to for apple OS edge cases.
57
+ - [#80571](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80571)
58
+ [`c193ae1d1163`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c193ae1d1163) -
59
+ Fix heading typography styles to for apple OS edge cases.
36
60
 
37
61
  ## 2.0.0
38
62
 
39
63
  ### Major Changes
40
64
 
41
- - [#81744](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81744) [`bc7085853ea2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bc7085853ea2) - Renamed `variant` prop to `size`. The prop values remain unchanged.
65
+ - [#81744](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81744)
66
+ [`bc7085853ea2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bc7085853ea2) -
67
+ Renamed `variant` prop to `size`. The prop values remain unchanged.
42
68
 
43
69
  ## 1.8.1
44
70
 
45
71
  ### Patch Changes
46
72
 
47
- - [#81644](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81644) [`8ab7a816dca7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8ab7a816dca7) - Revert input border change from the previous version
73
+ - [#81644](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81644)
74
+ [`8ab7a816dca7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8ab7a816dca7) -
75
+ Revert input border change from the previous version
48
76
 
49
77
  ## 1.8.0
50
78
 
51
79
  ### Minor Changes
52
80
 
53
- - [#80528](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80528) [`8877e9b57d55`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8877e9b57d55) - Added `size` prop which will replace `variant` prop in the next major version.
81
+ - [#80528](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80528)
82
+ [`8877e9b57d55`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8877e9b57d55) -
83
+ Added `size` prop which will replace `variant` prop in the next major version.
54
84
 
55
85
  ## 1.7.1
56
86
 
57
87
  ### Patch Changes
58
88
 
59
- - [#80805](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80805) [`427c2dd9e0d6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/427c2dd9e0d6) - Update input border color token and width to meet 3:1 color contrast
89
+ - [#80805](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80805)
90
+ [`427c2dd9e0d6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/427c2dd9e0d6) -
91
+ Update input border color token and width to meet 3:1 color contrast
60
92
  - Updated dependencies
61
93
 
62
94
  ## 1.7.0
63
95
 
64
96
  ### Minor Changes
65
97
 
66
- - [#79770](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/79770) [`32e4d951a5ae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32e4d951a5ae) - Run the codegen and update heading.partial.tsx
98
+ - [#79770](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/79770)
99
+ [`32e4d951a5ae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32e4d951a5ae) -
100
+ Run the codegen and update heading.partial.tsx
67
101
 
68
102
  ### Patch Changes
69
103
 
@@ -73,19 +107,27 @@
73
107
 
74
108
  ### Minor Changes
75
109
 
76
- - [#68604](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68604) [`fdf7f6635426`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fdf7f6635426) - Modified mapping of `variant` to the HTML element that gets rendered. Previously `xlarge` would render a `h2`, `large` would render a `h3` etc... Now `xlarge` renders a `h1` and so on...
110
+ - [#68604](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68604)
111
+ [`fdf7f6635426`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fdf7f6635426) -
112
+ Modified mapping of `variant` to the HTML element that gets rendered. Previously `xlarge` would
113
+ render a `h2`, `large` would render a `h3` etc... Now `xlarge` renders a `h1` and so on...
77
114
 
78
115
  ## 1.5.1
79
116
 
80
117
  ### Patch Changes
81
118
 
82
- - [#70023](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70023) [`e2d35320717b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2d35320717b) - Fix types to set either level or variant to be required props to prevent exceptions being thrown.
119
+ - [#70023](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70023)
120
+ [`e2d35320717b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2d35320717b) -
121
+ Fix types to set either level or variant to be required props to prevent exceptions being thrown.
83
122
 
84
123
  ## 1.5.0
85
124
 
86
125
  ### Minor Changes
87
126
 
88
- - [#67463](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67463) [`caac5b953575`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/caac5b953575) - Fixed an issue where typography tokens referenced font family tokens that may not exist on a page, causing fallbacks to break.
127
+ - [#67463](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67463)
128
+ [`caac5b953575`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/caac5b953575) -
129
+ Fixed an issue where typography tokens referenced font family tokens that may not exist on a page,
130
+ causing fallbacks to break.
89
131
 
90
132
  ### Patch Changes
91
133
 
@@ -95,87 +137,123 @@
95
137
 
96
138
  ### Patch Changes
97
139
 
98
- - [#63526](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63526) [`cae958047771`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cae958047771) - Internal change to how typography tokens are imported. There is no expected behaviour change.
140
+ - [#63526](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63526)
141
+ [`cae958047771`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cae958047771) -
142
+ Internal change to how typography tokens are imported. There is no expected behaviour change.
99
143
  - Updated dependencies
100
144
 
101
145
  ## 1.4.3
102
146
 
103
147
  ### Patch Changes
104
148
 
105
- - [#41226](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41226) [`fc7aba3cbae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc7aba3cbae) - [ux] Further fixes related to heading getting into possible invalid state. Heading will now always produce valid markup / aria-attributes for any configuration. Previously if there was no `HeadingContext` in the tree the heading would not produce accessibly correct markup in some cases. This is now resolved.
149
+ - [#41226](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41226)
150
+ [`fc7aba3cbae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc7aba3cbae) - [ux]
151
+ Further fixes related to heading getting into possible invalid state. Heading will now always
152
+ produce valid markup / aria-attributes for any configuration. Previously if there was no
153
+ `HeadingContext` in the tree the heading would not produce accessibly correct markup in some
154
+ cases. This is now resolved.
106
155
 
107
156
  ## 1.4.2
108
157
 
109
158
  ### Patch Changes
110
159
 
111
- - [#41124](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41124) [`40cd7f0c882`](https://bitbucket.org/atlassian/atlassian-frontend/commits/40cd7f0c882) - Fix to prevent heading getting into possible invalid state.
160
+ - [#41124](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41124)
161
+ [`40cd7f0c882`](https://bitbucket.org/atlassian/atlassian-frontend/commits/40cd7f0c882) - Fix to
162
+ prevent heading getting into possible invalid state.
112
163
 
113
164
  ## 1.4.1
114
165
 
115
166
  ### Patch Changes
116
167
 
117
- - [#41032](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41032) [`8d9dad6b977`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d9dad6b977) - Heading will apply an aria level if rendered as a div. This is an accessibility fix for an incomplete feature shipped in the previous minor version.
118
- - [#40299](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40299) [`b1882fdd842`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b1882fdd842) - Change typography token naming to be more verbose.
168
+ - [#41032](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41032)
169
+ [`8d9dad6b977`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d9dad6b977) - Heading
170
+ will apply an aria level if rendered as a div. This is an accessibility fix for an incomplete
171
+ feature shipped in the previous minor version.
172
+ - [#40299](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40299)
173
+ [`b1882fdd842`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b1882fdd842) - Change
174
+ typography token naming to be more verbose.
119
175
 
120
176
  ## 1.4.0
121
177
 
122
178
  ### Minor Changes
123
179
 
124
- - [#40254](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40254) [`9cc7e23c65b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9cc7e23c65b) - [ux] Adds additional heading types via the `variant` prop. This prop has been added to aid deprecation of the previous `level` prop. The `level` prop will be removed in a future release.
180
+ - [#40254](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40254)
181
+ [`9cc7e23c65b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9cc7e23c65b) - [ux]
182
+ Adds additional heading types via the `variant` prop. This prop has been added to aid deprecation
183
+ of the previous `level` prop. The `level` prop will be removed in a future release.
125
184
 
126
185
  ## 1.3.8
127
186
 
128
187
  ### Patch Changes
129
188
 
130
- - [#40040](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40040) [`ff79902b24c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ff79902b24c) - This package is now onboarded onto the product push model.
189
+ - [#40040](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40040)
190
+ [`ff79902b24c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ff79902b24c) - This
191
+ package is now onboarded onto the product push model.
131
192
 
132
193
  ## 1.3.7
133
194
 
134
195
  ### Patch Changes
135
196
 
136
- - [#36754](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36754) [`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use `@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility testing.
197
+ - [#36754](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36754)
198
+ [`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use
199
+ `@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility
200
+ testing.
137
201
 
138
202
  ## 1.3.6
139
203
 
140
204
  ### Patch Changes
141
205
 
142
- - [#35337](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35337) [`529814693a1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/529814693a1) - Pin version of @atlaskit/primitives so it resolves to correct version
206
+ - [#35337](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35337)
207
+ [`529814693a1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/529814693a1) - Pin
208
+ version of @atlaskit/primitives so it resolves to correct version
143
209
 
144
210
  ## 1.3.5
145
211
 
146
212
  ### Patch Changes
147
213
 
148
- - [#33833](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33833) [`b8b41649492`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b8b41649492) - Update how certain background colors are referenced by name. Internal changes only.
214
+ - [#33833](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33833)
215
+ [`b8b41649492`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b8b41649492) - Update
216
+ how certain background colors are referenced by name. Internal changes only.
149
217
 
150
218
  ## 1.3.4
151
219
 
152
220
  ### Patch Changes
153
221
 
154
- - [#34922](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34922) [`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal change only. Replace all instances of Box with stable @atlaskit/primitives version.
222
+ - [#34922](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34922)
223
+ [`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal
224
+ change only. Replace all instances of Box with stable @atlaskit/primitives version.
155
225
 
156
226
  ## 1.3.3
157
227
 
158
228
  ### Patch Changes
159
229
 
160
- - [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443) [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies
230
+ - [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)
231
+ [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing
232
+ unused dependencies and dev dependencies
161
233
 
162
234
  ## 1.3.2
163
235
 
164
236
  ### Patch Changes
165
237
 
166
- - [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
238
+ - [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)
239
+ [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure
240
+ legacy types are published for TS 4.5-4.8
167
241
 
168
242
  ## 1.3.1
169
243
 
170
244
  ### Patch Changes
171
245
 
172
- - [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
246
+ - [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)
247
+ [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade
248
+ Typescript from `4.5.5` to `4.9.5`
173
249
 
174
250
  ## 1.3.0
175
251
 
176
252
  ### Minor Changes
177
253
 
178
- - [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
254
+ - [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)
255
+ [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip
256
+ minor dependency bump
179
257
 
180
258
  ### Patch Changes
181
259
 
@@ -185,25 +263,33 @@
185
263
 
186
264
  ### Patch Changes
187
265
 
188
- - [#32294](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32294) [`e0460d5d989`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e0460d5d989) - Usages of `process` are now guarded by a `typeof` check.
266
+ - [#32294](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32294)
267
+ [`e0460d5d989`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e0460d5d989) - Usages
268
+ of `process` are now guarded by a `typeof` check.
189
269
 
190
270
  ## 1.2.0
191
271
 
192
272
  ### Minor Changes
193
273
 
194
- - [#31206](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31206) [`261420360ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/261420360ec) - Upgrades component types to support React 18.
274
+ - [#31206](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31206)
275
+ [`261420360ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/261420360ec) - Upgrades
276
+ component types to support React 18.
195
277
 
196
278
  ## 1.1.4
197
279
 
198
280
  ### Patch Changes
199
281
 
200
- - [#31242](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31242) [`cfe48bb7ece`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cfe48bb7ece) - Internal change only. Replace usages of Inline/Stack with stable version from `@atlaskit/primitives`.
282
+ - [#31242](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31242)
283
+ [`cfe48bb7ece`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cfe48bb7ece) - Internal
284
+ change only. Replace usages of Inline/Stack with stable version from `@atlaskit/primitives`.
201
285
 
202
286
  ## 1.1.3
203
287
 
204
288
  ### Patch Changes
205
289
 
206
- - [#31185](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31185) [`b6c5779d358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b6c5779d358) - Internal changes only to restrict usage of `Box` from the primitives package.
290
+ - [#31185](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31185)
291
+ [`b6c5779d358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b6c5779d358) - Internal
292
+ changes only to restrict usage of `Box` from the primitives package.
207
293
 
208
294
  ## 1.1.2
209
295
 
@@ -215,13 +301,17 @@
215
301
 
216
302
  ### Patch Changes
217
303
 
218
- - [#29390](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29390) [`18aeca8c199`](https://bitbucket.org/atlassian/atlassian-frontend/commits/18aeca8c199) - Internal change to update token references. There is no expected behaviour or visual change.
304
+ - [#29390](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29390)
305
+ [`18aeca8c199`](https://bitbucket.org/atlassian/atlassian-frontend/commits/18aeca8c199) - Internal
306
+ change to update token references. There is no expected behaviour or visual change.
219
307
 
220
308
  ## 1.1.0
221
309
 
222
310
  ### Minor Changes
223
311
 
224
- - [#28493](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28493) [`fce52a022f5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fce52a022f5) - Adds typography tokens to @atlaskit/heading.
312
+ - [#28493](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28493)
313
+ [`fce52a022f5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fce52a022f5) - Adds
314
+ typography tokens to @atlaskit/heading.
225
315
 
226
316
  ## 1.0.4
227
317
 
@@ -239,7 +329,9 @@
239
329
 
240
330
  ### Patch Changes
241
331
 
242
- - [#27341](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/27341) [`95fdae34c94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/95fdae34c94) - Revert experimental change to `@compiled/react` from `@emotion/react`.
332
+ - [#27341](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/27341)
333
+ [`95fdae34c94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/95fdae34c94) - Revert
334
+ experimental change to `@compiled/react` from `@emotion/react`.
243
335
 
244
336
  ## 1.0.1
245
337
 
@@ -251,49 +343,65 @@
251
343
 
252
344
  ### Major Changes
253
345
 
254
- - [#27238](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/27238) [`7d92ed50264`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7d92ed50264) - [ux] This package is still considered to be in an experimental state and is discouraged for use in production. The major is to simplify consumption and versioning in product.
346
+ - [#27238](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/27238)
347
+ [`7d92ed50264`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7d92ed50264) - [ux]
348
+ This package is still considered to be in an experimental state and is discouraged for use in
349
+ production. The major is to simplify consumption and versioning in product.
255
350
 
256
351
  Other changes:
257
352
 
258
- - Introduction of a `HeadingContext` provider to aid with creating the right semantic structure for headings.
353
+ - Introduction of a `HeadingContext` provider to aid with creating the right semantic structure
354
+ for headings.
259
355
  - Migrated internals to use `@compiled/react` from `@emotion/react`.
260
356
 
261
357
  ## 0.1.18
262
358
 
263
359
  ### Patch Changes
264
360
 
265
- - [#26488](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26488) [`bc989043572`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bc989043572) - Internal changes to apply spacing tokens. This should be a no-op change.
361
+ - [#26488](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26488)
362
+ [`bc989043572`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bc989043572) - Internal
363
+ changes to apply spacing tokens. This should be a no-op change.
266
364
 
267
365
  ## 0.1.17
268
366
 
269
367
  ### Patch Changes
270
368
 
271
- - [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874) [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
369
+ - [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)
370
+ [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade
371
+ Typescript from `4.3.5` to `4.5.5`
272
372
 
273
373
  ## 0.1.16
274
374
 
275
375
  ### Patch Changes
276
376
 
277
- - [#24004](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24004) [`30b11aab9fb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/30b11aab9fb) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
377
+ - [#24004](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24004)
378
+ [`30b11aab9fb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/30b11aab9fb) - Updates
379
+ `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
278
380
  - Updated dependencies
279
381
 
280
382
  ## 0.1.15
281
383
 
282
384
  ### Patch Changes
283
385
 
284
- - [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492) [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
386
+ - [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)
387
+ [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade
388
+ Typescript from `4.2.4` to `4.3.5`.
285
389
 
286
390
  ## 0.1.14
287
391
 
288
392
  ### Patch Changes
289
393
 
290
- - [#23381](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23381) [`47b01007f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47b01007f27) - Introduces color prop with values default and inverse.
394
+ - [#23381](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23381)
395
+ [`47b01007f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47b01007f27) -
396
+ Introduces color prop with values default and inverse.
291
397
 
292
398
  ## 0.1.13
293
399
 
294
400
  ### Patch Changes
295
401
 
296
- - [#22642](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/22642) [`354050b68da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/354050b68da) - Revert font size calculations to raw pixels.
402
+ - [#22642](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/22642)
403
+ [`354050b68da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/354050b68da) - Revert
404
+ font size calculations to raw pixels.
297
405
 
298
406
  ## 0.1.12
299
407
 
@@ -305,7 +413,9 @@
305
413
 
306
414
  ### Patch Changes
307
415
 
308
- - [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650) [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
416
+ - [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650)
417
+ [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade
418
+ to TypeScript 4.2.4
309
419
 
310
420
  ## 0.1.10
311
421
 
@@ -329,7 +439,10 @@
329
439
 
330
440
  ### Patch Changes
331
441
 
332
- - [#16752](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16752) [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Updates usage of deprecated token names so they're aligned with the latest naming conventions. No UI or visual changes
442
+ - [#16752](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16752)
443
+ [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Updates
444
+ usage of deprecated token names so they're aligned with the latest naming conventions. No UI or
445
+ visual changes
333
446
  - Updated dependencies
334
447
 
335
448
  ## 0.1.6
@@ -342,7 +455,10 @@
342
455
 
343
456
  ### Patch Changes
344
457
 
345
- - [#15998](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/15998) [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving bundle size.
458
+ - [#15998](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/15998)
459
+ [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds
460
+ for this package now pass through a tokens babel plugin, removing runtime invocations of the
461
+ tokens() function and improving bundle size.
346
462
  - Updated dependencies
347
463
 
348
464
  ## 0.1.4
@@ -367,20 +483,27 @@
367
483
 
368
484
  ### Patch Changes
369
485
 
370
- - [#13864](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/13864) [`d7a9a4ff7ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d7a9a4ff7ec) - Instrumented heading with the new theming package, `@atlaskit/tokens`.
371
- New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
372
- These changes are intended to be interoperable with the legacy theme implementation.
373
- Legacy dark mode users should expect no visual or breaking changes.
486
+ - [#13864](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/13864)
487
+ [`d7a9a4ff7ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d7a9a4ff7ec) -
488
+ Instrumented heading with the new theming package, `@atlaskit/tokens`. New tokens will be visible
489
+ only in applications configured to use the new Tokens API (currently in alpha). These changes are
490
+ intended to be interoperable with the legacy theme implementation. Legacy dark mode users should
491
+ expect no visual or breaking changes.
374
492
  - Updated dependencies
375
493
 
376
494
  ## 0.1.0
377
495
 
378
496
  ### Minor Changes
379
497
 
380
- - [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837) [`ee15e59ba60`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ee15e59ba60) - This is the initial release of the Heading package. Typography styles have been duplicated from the `@atlaskit/theme` package as standalone components.
498
+ - [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837)
499
+ [`ee15e59ba60`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ee15e59ba60) - This is
500
+ the initial release of the Heading package. Typography styles have been duplicated from the
501
+ `@atlaskit/theme` package as standalone components.
381
502
 
382
503
  ### Patch Changes
383
504
 
384
- - [`46816ee8526`](https://bitbucket.org/atlassian/atlassian-frontend/commits/46816ee8526) - Changes heading element mappings to match '@atlaskit/css-reset'.
385
- - [`f9cd2065648`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f9cd2065648) - Removed redundant styles for text-transform, moved font-size to `rem` insteda of `em`.
505
+ - [`46816ee8526`](https://bitbucket.org/atlassian/atlassian-frontend/commits/46816ee8526) - Changes
506
+ heading element mappings to match '@atlaskit/css-reset'.
507
+ - [`f9cd2065648`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f9cd2065648) - Removed
508
+ redundant styles for text-transform, moved font-size to `rem` insteda of `em`.
386
509
  - Updated dependencies
@@ -1,6 +1,7 @@
1
- import core, {
1
+ import type {
2
2
  API,
3
3
  ASTPath,
4
+ default as core,
4
5
  FileInfo,
5
6
  ImportDeclaration,
6
7
  Options,
@@ -11,7 +11,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  var _react = require("@emotion/react");
12
12
  var _headingContext = require("./heading-context");
13
13
  var _heading = _interopRequireDefault(require("./heading.partial"));
14
- var _excluded = ["level", "size"];
14
+ var _excluded = ["level"];
15
+ /* eslint-disable @atlaskit/design-system/no-deprecated-design-token-usage */
15
16
  /** @jsx jsx */
16
17
  // https://atlassian.design/foundations/typography
17
18
  var levelMap = {
@@ -155,7 +156,6 @@ var OldHeading = function OldHeading(_ref) {
155
156
  */
156
157
  var Heading = function Heading(_ref2) {
157
158
  var level = _ref2.level,
158
- size = _ref2.size,
159
159
  props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
160
160
  return level ?
161
161
  // eslint-disable-next-line jsx-a11y/heading-has-content, @repo/internal/react/no-unsafe-spread-props
@@ -163,8 +163,6 @@ var Heading = function Heading(_ref2) {
163
163
  level: level
164
164
  }, props)) :
165
165
  // eslint-disable-next-line jsx-a11y/heading-has-content, @repo/internal/react/no-unsafe-spread-props
166
- (0, _react.jsx)(_heading.default, (0, _extends2.default)({
167
- size: size
168
- }, props));
166
+ (0, _react.jsx)(_heading.default, props);
169
167
  };
170
168
  var _default = exports.default = Heading;
@@ -4,9 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.headingColorStylesMap = exports.default = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _react = require("@emotion/react");
10
+ var _primitives = require("@atlaskit/primitives");
10
11
  var _headingContext = require("./heading-context");
11
12
  /** @jsx jsx */
12
13
 
@@ -20,14 +21,22 @@ var sizeTagMap = {
20
21
  xxsmall: 'h6'
21
22
  };
22
23
  var headingResetStyles = (0, _react.css)({
23
- color: "var(--ds-text, #172B4D)",
24
24
  letterSpacing: 'normal',
25
25
  marginBlock: 0,
26
26
  textTransform: 'none'
27
27
  });
28
- var inverseStyles = (0, _react.css)({
29
- color: "var(--ds-text-inverse, #FFF)"
30
- });
28
+ var useColor = function useColor(colorProp) {
29
+ var surface = (0, _primitives.UNSAFE_useSurface)();
30
+
31
+ /**
32
+ * Where the color of the surface is inverted we always override the color
33
+ * as there is no valid choice that is not covered by the override.
34
+ */
35
+ if (_primitives.UNSAFE_inverseColorMap.hasOwnProperty(surface)) {
36
+ return _primitives.UNSAFE_inverseColorMap[surface];
37
+ }
38
+ return colorProp || 'color.text';
39
+ };
31
40
 
32
41
  /**
33
42
  * __Heading__
@@ -46,8 +55,7 @@ var Heading = function Heading(_ref) {
46
55
  id = _ref.id,
47
56
  testId = _ref.testId,
48
57
  as = _ref.as,
49
- _ref$color = _ref.color,
50
- color = _ref$color === void 0 ? 'default' : _ref$color;
58
+ colorProp = _ref.color;
51
59
  if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production' && as && typeof as !== 'string') {
52
60
  throw new Error('`as` prop should be a string.');
53
61
  }
@@ -60,18 +68,32 @@ var Heading = function Heading(_ref) {
60
68
  inferredElement = _useHeading2[1];
61
69
  var Component = as || inferredElement;
62
70
  var needsAriaRole = Component === 'div' && hLevel;
71
+ var color = useColor(colorProp);
63
72
  return (0, _react.jsx)(Component, {
64
73
  id: id,
65
74
  "data-testid": testId,
66
75
  role: needsAriaRole ? 'heading' : undefined,
67
76
  "aria-level": needsAriaRole ? hLevel : undefined,
68
- css: [headingResetStyles, size && headingSizeStylesMap[size], color === 'inverse' && inverseStyles]
77
+ css: [headingResetStyles, size && headingSizeStylesMap[size], headingColorStylesMap[color]]
69
78
  }, children);
70
79
  };
71
80
 
81
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css
82
+ var headingColorStylesMap = exports.headingColorStylesMap = {
83
+ 'color.text': (0, _react.css)({
84
+ color: "var(--ds-text, #172B4D)"
85
+ }),
86
+ 'color.text.inverse': (0, _react.css)({
87
+ color: "var(--ds-text-inverse, #FFFFFF)"
88
+ }),
89
+ 'color.text.warning.inverse': (0, _react.css)({
90
+ color: "var(--ds-text-warning-inverse, #172B4D)"
91
+ })
92
+ };
93
+
72
94
  /**
73
95
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
74
- * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
96
+ * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
75
97
  * @codegenId typography
76
98
  * @codegenCommand yarn workspace @atlaskit/heading codegen
77
99
  */
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ /* eslint-disable @atlaskit/design-system/no-deprecated-design-token-usage */
2
3
  /** @jsx jsx */
3
4
  import { css, jsx } from '@emotion/react';
4
5
  import { useHeading } from './heading-context';
@@ -142,7 +143,6 @@ const OldHeading = ({
142
143
  */
143
144
  const Heading = ({
144
145
  level,
145
- size,
146
146
  ...props
147
147
  }) => {
148
148
  return level ?
@@ -151,8 +151,6 @@ const Heading = ({
151
151
  level: level
152
152
  }, props)) :
153
153
  // eslint-disable-next-line jsx-a11y/heading-has-content, @repo/internal/react/no-unsafe-spread-props
154
- jsx(NewHeading, _extends({
155
- size: size
156
- }, props));
154
+ jsx(NewHeading, props);
157
155
  };
158
156
  export default Heading;
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { css, jsx } from '@emotion/react';
3
+ import { UNSAFE_inverseColorMap, UNSAFE_useSurface } from '@atlaskit/primitives';
3
4
  import { useHeading } from './heading-context';
4
5
  const sizeTagMap = {
5
6
  xxlarge: 'h1',
@@ -11,14 +12,22 @@ const sizeTagMap = {
11
12
  xxsmall: 'h6'
12
13
  };
13
14
  const headingResetStyles = css({
14
- color: "var(--ds-text, #172B4D)",
15
15
  letterSpacing: 'normal',
16
16
  marginBlock: 0,
17
17
  textTransform: 'none'
18
18
  });
19
- const inverseStyles = css({
20
- color: "var(--ds-text-inverse, #FFF)"
21
- });
19
+ const useColor = colorProp => {
20
+ const surface = UNSAFE_useSurface();
21
+
22
+ /**
23
+ * Where the color of the surface is inverted we always override the color
24
+ * as there is no valid choice that is not covered by the override.
25
+ */
26
+ if (UNSAFE_inverseColorMap.hasOwnProperty(surface)) {
27
+ return UNSAFE_inverseColorMap[surface];
28
+ }
29
+ return colorProp || 'color.text';
30
+ };
22
31
 
23
32
  /**
24
33
  * __Heading__
@@ -37,7 +46,7 @@ const Heading = ({
37
46
  id,
38
47
  testId,
39
48
  as,
40
- color = 'default'
49
+ color: colorProp
41
50
  }) => {
42
51
  if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production' && as && typeof as !== 'string') {
43
52
  throw new Error('`as` prop should be a string.');
@@ -48,18 +57,32 @@ const Heading = ({
48
57
  const [hLevel, inferredElement] = useHeading(sizeTagMap[size]);
49
58
  const Component = as || inferredElement;
50
59
  const needsAriaRole = Component === 'div' && hLevel;
60
+ const color = useColor(colorProp);
51
61
  return jsx(Component, {
52
62
  id: id,
53
63
  "data-testid": testId,
54
64
  role: needsAriaRole ? 'heading' : undefined,
55
65
  "aria-level": needsAriaRole ? hLevel : undefined,
56
- css: [headingResetStyles, size && headingSizeStylesMap[size], color === 'inverse' && inverseStyles]
66
+ css: [headingResetStyles, size && headingSizeStylesMap[size], headingColorStylesMap[color]]
57
67
  }, children);
58
68
  };
59
69
 
70
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css
71
+ export const headingColorStylesMap = {
72
+ 'color.text': css({
73
+ color: "var(--ds-text, #172B4D)"
74
+ }),
75
+ 'color.text.inverse': css({
76
+ color: "var(--ds-text-inverse, #FFFFFF)"
77
+ }),
78
+ 'color.text.warning.inverse': css({
79
+ color: "var(--ds-text-warning-inverse, #172B4D)"
80
+ })
81
+ };
82
+
60
83
  /**
61
84
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
62
- * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
85
+ * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
63
86
  * @codegenId typography
64
87
  * @codegenCommand yarn workspace @atlaskit/heading codegen
65
88
  */
@@ -1,7 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- var _excluded = ["level", "size"];
4
+ var _excluded = ["level"];
5
+ /* eslint-disable @atlaskit/design-system/no-deprecated-design-token-usage */
5
6
  /** @jsx jsx */
6
7
  import { css, jsx } from '@emotion/react';
7
8
  import { useHeading } from './heading-context';
@@ -148,7 +149,6 @@ var OldHeading = function OldHeading(_ref) {
148
149
  */
149
150
  var Heading = function Heading(_ref2) {
150
151
  var level = _ref2.level,
151
- size = _ref2.size,
152
152
  props = _objectWithoutProperties(_ref2, _excluded);
153
153
  return level ?
154
154
  // eslint-disable-next-line jsx-a11y/heading-has-content, @repo/internal/react/no-unsafe-spread-props
@@ -156,8 +156,6 @@ var Heading = function Heading(_ref2) {
156
156
  level: level
157
157
  }, props)) :
158
158
  // eslint-disable-next-line jsx-a11y/heading-has-content, @repo/internal/react/no-unsafe-spread-props
159
- jsx(NewHeading, _extends({
160
- size: size
161
- }, props));
159
+ jsx(NewHeading, props);
162
160
  };
163
161
  export default Heading;
@@ -1,6 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  /** @jsx jsx */
3
3
  import { css, jsx } from '@emotion/react';
4
+ import { UNSAFE_inverseColorMap, UNSAFE_useSurface } from '@atlaskit/primitives';
4
5
  import { useHeading } from './heading-context';
5
6
  var sizeTagMap = {
6
7
  xxlarge: 'h1',
@@ -12,14 +13,22 @@ var sizeTagMap = {
12
13
  xxsmall: 'h6'
13
14
  };
14
15
  var headingResetStyles = css({
15
- color: "var(--ds-text, #172B4D)",
16
16
  letterSpacing: 'normal',
17
17
  marginBlock: 0,
18
18
  textTransform: 'none'
19
19
  });
20
- var inverseStyles = css({
21
- color: "var(--ds-text-inverse, #FFF)"
22
- });
20
+ var useColor = function useColor(colorProp) {
21
+ var surface = UNSAFE_useSurface();
22
+
23
+ /**
24
+ * Where the color of the surface is inverted we always override the color
25
+ * as there is no valid choice that is not covered by the override.
26
+ */
27
+ if (UNSAFE_inverseColorMap.hasOwnProperty(surface)) {
28
+ return UNSAFE_inverseColorMap[surface];
29
+ }
30
+ return colorProp || 'color.text';
31
+ };
23
32
 
24
33
  /**
25
34
  * __Heading__
@@ -38,8 +47,7 @@ var Heading = function Heading(_ref) {
38
47
  id = _ref.id,
39
48
  testId = _ref.testId,
40
49
  as = _ref.as,
41
- _ref$color = _ref.color,
42
- color = _ref$color === void 0 ? 'default' : _ref$color;
50
+ colorProp = _ref.color;
43
51
  if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production' && as && typeof as !== 'string') {
44
52
  throw new Error('`as` prop should be a string.');
45
53
  }
@@ -52,18 +60,32 @@ var Heading = function Heading(_ref) {
52
60
  inferredElement = _useHeading2[1];
53
61
  var Component = as || inferredElement;
54
62
  var needsAriaRole = Component === 'div' && hLevel;
63
+ var color = useColor(colorProp);
55
64
  return jsx(Component, {
56
65
  id: id,
57
66
  "data-testid": testId,
58
67
  role: needsAriaRole ? 'heading' : undefined,
59
68
  "aria-level": needsAriaRole ? hLevel : undefined,
60
- css: [headingResetStyles, size && headingSizeStylesMap[size], color === 'inverse' && inverseStyles]
69
+ css: [headingResetStyles, size && headingSizeStylesMap[size], headingColorStylesMap[color]]
61
70
  }, children);
62
71
  };
63
72
 
73
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css
74
+ export var headingColorStylesMap = {
75
+ 'color.text': css({
76
+ color: "var(--ds-text, #172B4D)"
77
+ }),
78
+ 'color.text.inverse': css({
79
+ color: "var(--ds-text-inverse, #FFFFFF)"
80
+ }),
81
+ 'color.text.warning.inverse': css({
82
+ color: "var(--ds-text-warning-inverse, #172B4D)"
83
+ })
84
+ };
85
+
64
86
  /**
65
87
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
66
- * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
88
+ * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
67
89
  * @codegenId typography
68
90
  * @codegenCommand yarn workspace @atlaskit/heading codegen
69
91
  */
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  type HeadingLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
3
3
  type HeadingElement = `h${1 | 2 | 3 | 4 | 5 | 6}` | 'div';
4
4
  /**
@@ -20,5 +20,5 @@ import type { HeadingProps } from './types';
20
20
  * );
21
21
  * ```
22
22
  */
23
- declare const Heading: ({ level, size, ...props }: HeadingProps) => jsx.JSX.Element;
23
+ declare const Heading: ({ level, ...props }: HeadingProps) => jsx.JSX.Element;
24
24
  export default Heading;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import type { HeadingProps } from './types';
2
+ import { jsx, type SerializedStyles } from '@emotion/react';
3
+ import type { HeadingColor, NewHeadingProps } from './types';
4
4
  /**
5
5
  * __Heading__
6
6
  *
@@ -12,21 +12,22 @@ import type { HeadingProps } from './types';
12
12
  * <Heading size="xxlarge">Page title</Heading>
13
13
  * ```
14
14
  */
15
- declare const Heading: ({ children, size, id, testId, as, color, }: HeadingProps) => jsx.JSX.Element;
15
+ declare const Heading: ({ children, size, id, testId, as, color: colorProp, }: NewHeadingProps) => jsx.JSX.Element;
16
+ export declare const headingColorStylesMap: Record<HeadingColor, SerializedStyles>;
16
17
  /**
17
18
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
18
- * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
19
+ * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
19
20
  * @codegenId typography
20
21
  * @codegenCommand yarn workspace @atlaskit/heading codegen
21
22
  */
22
23
  declare const headingSizeStylesMap: {
23
- xxlarge: import("@emotion/react").SerializedStyles;
24
- xlarge: import("@emotion/react").SerializedStyles;
25
- large: import("@emotion/react").SerializedStyles;
26
- medium: import("@emotion/react").SerializedStyles;
27
- small: import("@emotion/react").SerializedStyles;
28
- xsmall: import("@emotion/react").SerializedStyles;
29
- xxsmall: import("@emotion/react").SerializedStyles;
24
+ xxlarge: SerializedStyles;
25
+ xlarge: SerializedStyles;
26
+ large: SerializedStyles;
27
+ medium: SerializedStyles;
28
+ small: SerializedStyles;
29
+ xsmall: SerializedStyles;
30
+ xxsmall: SerializedStyles;
30
31
  };
31
32
  export type HeadingSize = keyof typeof headingSizeStylesMap;
32
33
  /**
@@ -1,6 +1,6 @@
1
- import { ReactNode } from 'react';
2
- import { HeadingSize } from './heading.partial';
3
- export type HeadingProps = {
1
+ import { type ReactNode } from 'react';
2
+ import { type HeadingSize } from './heading.partial';
3
+ type HeadingPropsBase = {
4
4
  /**
5
5
  * A `testId` prop is provided for specified elements, which is a unique
6
6
  * string that appears as a data attribute `data-testid` in the rendered code,
@@ -19,12 +19,13 @@ export type HeadingProps = {
19
19
  * Allows the component to be rendered as the specified DOM element, overriding a default element set by `level` prop.
20
20
  */
21
21
  as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' | 'span';
22
+ };
23
+ export type OldHeadingProps = HeadingPropsBase & {
22
24
  /**
23
25
  * Text color of the heading. Use `"inverse"` option for a light text color over a dark background.
24
26
  * Defaults to `"default"`.
25
27
  */
26
28
  color?: 'inverse' | 'default';
27
- } & ({
28
29
  /**
29
30
  * @private
30
31
  * @deprecated Use `size` prop instead.
@@ -52,13 +53,22 @@ export type HeadingProps = {
52
53
  * Heading size. Use instead of the deprecated `level` prop.
53
54
  */
54
55
  size?: never;
55
- } | {
56
- level?: never;
56
+ };
57
+ export type HeadingColor = 'color.text' | 'color.text.inverse' | 'color.text.warning.inverse';
58
+ export type NewHeadingProps = HeadingPropsBase & {
59
+ /**
60
+ * Token representing text color with a built-in fallback value.
61
+ * Will apply inverse text color automatically if placed within a Box with bold background color.
62
+ * Defaults to `color.text`.
63
+ */
64
+ color?: HeadingColor;
57
65
  /**
58
66
  * Heading size. This value is detached from the specific heading level applied to allow for more flexibility.
59
67
  * Use instead of the deprecated `level` prop.
60
68
  *
61
- * This prop will only work if the typography tokens theme is applied on the page.
62
69
  */
63
70
  size: HeadingSize;
64
- });
71
+ level?: never;
72
+ };
73
+ export type HeadingProps = OldHeadingProps | NewHeadingProps;
74
+ export {};
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  type HeadingLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
3
3
  type HeadingElement = `h${1 | 2 | 3 | 4 | 5 | 6}` | 'div';
4
4
  /**
@@ -20,5 +20,5 @@ import type { HeadingProps } from './types';
20
20
  * );
21
21
  * ```
22
22
  */
23
- declare const Heading: ({ level, size, ...props }: HeadingProps) => jsx.JSX.Element;
23
+ declare const Heading: ({ level, ...props }: HeadingProps) => jsx.JSX.Element;
24
24
  export default Heading;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import type { HeadingProps } from './types';
2
+ import { jsx, type SerializedStyles } from '@emotion/react';
3
+ import type { HeadingColor, NewHeadingProps } from './types';
4
4
  /**
5
5
  * __Heading__
6
6
  *
@@ -12,21 +12,22 @@ import type { HeadingProps } from './types';
12
12
  * <Heading size="xxlarge">Page title</Heading>
13
13
  * ```
14
14
  */
15
- declare const Heading: ({ children, size, id, testId, as, color, }: HeadingProps) => jsx.JSX.Element;
15
+ declare const Heading: ({ children, size, id, testId, as, color: colorProp, }: NewHeadingProps) => jsx.JSX.Element;
16
+ export declare const headingColorStylesMap: Record<HeadingColor, SerializedStyles>;
16
17
  /**
17
18
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
18
- * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
19
+ * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
19
20
  * @codegenId typography
20
21
  * @codegenCommand yarn workspace @atlaskit/heading codegen
21
22
  */
22
23
  declare const headingSizeStylesMap: {
23
- xxlarge: import("@emotion/react").SerializedStyles;
24
- xlarge: import("@emotion/react").SerializedStyles;
25
- large: import("@emotion/react").SerializedStyles;
26
- medium: import("@emotion/react").SerializedStyles;
27
- small: import("@emotion/react").SerializedStyles;
28
- xsmall: import("@emotion/react").SerializedStyles;
29
- xxsmall: import("@emotion/react").SerializedStyles;
24
+ xxlarge: SerializedStyles;
25
+ xlarge: SerializedStyles;
26
+ large: SerializedStyles;
27
+ medium: SerializedStyles;
28
+ small: SerializedStyles;
29
+ xsmall: SerializedStyles;
30
+ xxsmall: SerializedStyles;
30
31
  };
31
32
  export type HeadingSize = keyof typeof headingSizeStylesMap;
32
33
  /**
@@ -1,6 +1,6 @@
1
- import { ReactNode } from 'react';
2
- import { HeadingSize } from './heading.partial';
3
- export type HeadingProps = {
1
+ import { type ReactNode } from 'react';
2
+ import { type HeadingSize } from './heading.partial';
3
+ type HeadingPropsBase = {
4
4
  /**
5
5
  * A `testId` prop is provided for specified elements, which is a unique
6
6
  * string that appears as a data attribute `data-testid` in the rendered code,
@@ -19,12 +19,13 @@ export type HeadingProps = {
19
19
  * Allows the component to be rendered as the specified DOM element, overriding a default element set by `level` prop.
20
20
  */
21
21
  as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' | 'span';
22
+ };
23
+ export type OldHeadingProps = HeadingPropsBase & {
22
24
  /**
23
25
  * Text color of the heading. Use `"inverse"` option for a light text color over a dark background.
24
26
  * Defaults to `"default"`.
25
27
  */
26
28
  color?: 'inverse' | 'default';
27
- } & ({
28
29
  /**
29
30
  * @private
30
31
  * @deprecated Use `size` prop instead.
@@ -52,13 +53,22 @@ export type HeadingProps = {
52
53
  * Heading size. Use instead of the deprecated `level` prop.
53
54
  */
54
55
  size?: never;
55
- } | {
56
- level?: never;
56
+ };
57
+ export type HeadingColor = 'color.text' | 'color.text.inverse' | 'color.text.warning.inverse';
58
+ export type NewHeadingProps = HeadingPropsBase & {
59
+ /**
60
+ * Token representing text color with a built-in fallback value.
61
+ * Will apply inverse text color automatically if placed within a Box with bold background color.
62
+ * Defaults to `color.text`.
63
+ */
64
+ color?: HeadingColor;
57
65
  /**
58
66
  * Heading size. This value is detached from the specific heading level applied to allow for more flexibility.
59
67
  * Use instead of the deprecated `level` prop.
60
68
  *
61
- * This prop will only work if the typography tokens theme is applied on the page.
62
69
  */
63
70
  size: HeadingSize;
64
- });
71
+ level?: never;
72
+ };
73
+ export type HeadingProps = OldHeadingProps | NewHeadingProps;
74
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/heading",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "A heading is a typography component used to display text in different sizes and formats.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -33,7 +33,8 @@
33
33
  "codegen": "ts-node ./scripts/codegen.tsx"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/tokens": "^1.43.0",
36
+ "@atlaskit/primitives": "^7.0.0",
37
+ "@atlaskit/tokens": "^1.49.0",
37
38
  "@babel/runtime": "^7.0.0",
38
39
  "@emotion/react": "^11.7.1"
39
40
  },
@@ -42,14 +43,14 @@
42
43
  },
43
44
  "devDependencies": {
44
45
  "@af/accessibility-testing": "*",
46
+ "@af/formatting": "*",
45
47
  "@atlaskit/ds-lib": "^2.3.0",
46
48
  "@atlaskit/ssr": "*",
49
+ "@atlaskit/toggle": "^13.1.0",
47
50
  "@atlaskit/visual-regression": "*",
48
- "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
49
51
  "@atlassian/codegen": "^0.1.0",
50
52
  "@testing-library/react": "^12.1.5",
51
53
  "jscodeshift": "^0.13.0",
52
- "prettier": "^2.8.0",
53
54
  "react-dom": "^16.8.0",
54
55
  "ts-node": "^10.9.1",
55
56
  "typescript": "~5.4.2"
@@ -85,6 +86,5 @@
85
86
  "af:exports": {
86
87
  ".": "./src/index.tsx"
87
88
  },
88
- "homepage": "https://atlassian.design/components/heading/",
89
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
89
+ "homepage": "https://atlassian.design/components/heading/"
90
90
  }
@@ -1,17 +1,15 @@
1
1
  import { writeFileSync } from 'fs';
2
2
  import { join } from 'path';
3
3
 
4
- import prettier from 'prettier';
5
- import parserTypeScript from 'prettier/parser-typescript';
6
-
4
+ import format from '@af/formatting/sync';
7
5
  // eslint-disable-next-line import/order
8
6
  import { createPartialSignedArtifact } from '@atlassian/codegen';
9
7
 
10
8
  // eslint-disable-next-line import/order
11
9
  import { typographyAdg3 as tokens } from '@atlaskit/tokens/tokens-raw';
12
10
 
13
- const constructTokenFunctionCall = (tokenName: string, fallback: string) => {
14
- return `token('${tokenName}', '${fallback}')`;
11
+ const constructTokenFunctionCall = (tokenName: string) => {
12
+ return `token('${tokenName}')`;
15
13
  };
16
14
 
17
15
  const headingTokens = tokens
@@ -24,7 +22,7 @@ const removeVerbosity = (name: string): string => {
24
22
 
25
23
  export const createTypographyStylesFromTemplate = () => {
26
24
  return (
27
- prettier.format(
25
+ format(
28
26
  `
29
27
  const headingSizeStylesMap = {
30
28
  ${headingTokens
@@ -32,20 +30,12 @@ const headingSizeStylesMap = {
32
30
  return `
33
31
  '${removeVerbosity(
34
32
  token.name,
35
- )}': css({ font: ${constructTokenFunctionCall(
36
- token.cleanName,
37
- token.value,
38
- )} })
33
+ )}': css({ font: ${constructTokenFunctionCall(token.cleanName)} })
39
34
  `.trim();
40
35
  })
41
36
  .join(',\n\t')}
42
37
  };`,
43
- {
44
- singleQuote: true,
45
- trailingComma: 'all',
46
- parser: 'typescript',
47
- plugins: [parserTypeScript],
48
- },
38
+ 'typescript',
49
39
  ) + `\nexport type HeadingSize = keyof typeof headingSizeStylesMap;\n`
50
40
  );
51
41
  };
@@ -1,80 +0,0 @@
1
- jest.autoMockOff();
2
-
3
- import transformer from '../1.6.0-level-to-size';
4
-
5
- import { check } from './_framework';
6
-
7
- check({
8
- transformer,
9
- it: 'should replace level with size only on Heading component',
10
- original: `
11
- import Heading from '@atlaskit/heading';
12
-
13
- function App() {
14
- return <>
15
- <Heading level="h700" as="h3">hello</Heading>
16
- <SomethingElse level="h700">still here</SomethingElse>
17
- </>;
18
- }
19
- `,
20
- expected: `
21
- import Heading from '@atlaskit/heading';
22
-
23
- function App() {
24
- return <>
25
- <Heading size="large" as="h3">hello</Heading>
26
- <SomethingElse level="h700">still here</SomethingElse>
27
- </>;
28
- }
29
- `,
30
- });
31
-
32
- check({
33
- transformer,
34
- it: 'should do nothing if level is h200 or h100',
35
- original: `
36
- import Heading from '@atlaskit/heading';
37
-
38
- function App() {
39
- return <>
40
- <Heading level="h300">hello</Heading>
41
- <Heading level="h200">hello</Heading>
42
- <Heading level="h100">hello</Heading>
43
- </>;
44
- }
45
- `,
46
- expected: `
47
- import Heading from '@atlaskit/heading';
48
-
49
- function App() {
50
- return <>
51
- <Heading size="xxsmall">hello</Heading>
52
- <Heading level="h200">hello</Heading>
53
- <Heading level="h100">hello</Heading>
54
- </>;
55
- }
56
- `,
57
- });
58
-
59
- check({
60
- transformer,
61
- it: 'should do nothing if size already exists',
62
- original: `
63
- import Heading from '@atlaskit/heading';
64
-
65
- function App() {
66
- return <>
67
- <Heading size="large">hello</Heading>
68
- </>;
69
- }
70
- `,
71
- expected: `
72
- import Heading from '@atlaskit/heading';
73
-
74
- function App() {
75
- return <>
76
- <Heading size="large">hello</Heading>
77
- </>;
78
- }
79
- `,
80
- });
@@ -1,46 +0,0 @@
1
- import { API, FileInfo, Options } from 'jscodeshift';
2
-
3
- import noop from '@atlaskit/ds-lib/noop';
4
-
5
- const applyTransform = require('jscodeshift/dist/testUtils').applyTransform;
6
-
7
- type Transformer = (file: FileInfo, jscodeshift: API, options: Options) => void;
8
-
9
- type TestArgs = {
10
- it: string;
11
- original: string;
12
- expected: string;
13
- transformer: Transformer;
14
- mode?: 'only' | 'skip' | 'standard';
15
- before?: () => void;
16
- after?: () => void;
17
- };
18
-
19
- export function check({
20
- it: name,
21
- original,
22
- expected,
23
- transformer,
24
- before = noop,
25
- after = noop,
26
- mode = 'standard',
27
- }: TestArgs) {
28
- const run = mode === 'only' ? it.only : mode === 'skip' ? it.skip : it;
29
- run(name, () => {
30
- before();
31
- try {
32
- const output: string = applyTransform(
33
- { default: transformer, parser: 'tsx' },
34
- {},
35
- { source: original },
36
- );
37
- expect(output).toBe(expected.trim());
38
- } catch (e) {
39
- // a failed assertion will throw
40
- after();
41
- throw e;
42
- }
43
- // will only be hit if we don't throw
44
- after();
45
- });
46
- }