@atlaskit/heading 2.3.0 → 2.3.2
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 +205 -192
- package/LICENSE.md +6 -8
- package/codemods/1.6.0-level-to-size.tsx +52 -66
- package/dist/cjs/heading.partial.js +1 -1
- package/dist/es2019/heading.partial.js +1 -1
- package/dist/esm/heading.partial.js +1 -1
- package/dist/types/heading-context.d.ts +2 -2
- package/dist/types/heading.partial.d.ts +2 -2
- package/dist/types/types.d.ts +0 -1
- package/dist/types-ts4.5/heading-context.d.ts +2 -2
- package/dist/types-ts4.5/heading.partial.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +0 -1
- package/package.json +4 -6
- package/report.api.md +26 -37
- package/scripts/codegen.tsx +25 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,505 +1,518 @@
|
|
|
1
1
|
# @atlaskit/heading
|
|
2
2
|
|
|
3
|
+
## 2.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#110191](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110191)
|
|
8
|
+
[`c3dc02298f8aa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c3dc02298f8aa) -
|
|
9
|
+
[ux] Change heading xsmall lineheight from 16 to 20 for minor third theme.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 2.3.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 2.3.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
6
21
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
22
|
+
- [#97580](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97580)
|
|
23
|
+
[`3e6f291ec2d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3e6f291ec2d5) -
|
|
24
|
+
Color prop to take color tokens when using heading with size prop.
|
|
10
25
|
|
|
11
26
|
## 2.2.0
|
|
12
27
|
|
|
13
28
|
### Minor Changes
|
|
14
29
|
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
30
|
+
- [#91625](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91625)
|
|
31
|
+
[`d7770083ff25`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d7770083ff25) -
|
|
32
|
+
Add support for React 18 in non-strict mode.
|
|
18
33
|
|
|
19
34
|
## 2.1.2
|
|
20
35
|
|
|
21
36
|
### Patch Changes
|
|
22
37
|
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
38
|
+
- [#83130](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83130)
|
|
39
|
+
[`4efd62cdc533`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4efd62cdc533) -
|
|
40
|
+
SHPLVIII-481: Assign name to default export components to fix quick-fix imports
|
|
26
41
|
|
|
27
42
|
## 2.1.1
|
|
28
43
|
|
|
29
44
|
### Patch Changes
|
|
30
45
|
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
46
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
|
|
47
|
+
[`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
|
|
48
|
+
Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
34
49
|
|
|
35
50
|
## 2.1.0
|
|
36
51
|
|
|
37
52
|
### Minor Changes
|
|
38
53
|
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
- [#78900](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78900)
|
|
55
|
+
[`2e05dc3106e3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2e05dc3106e3) -
|
|
56
|
+
Run codegen for Heading font family changes.
|
|
42
57
|
|
|
43
58
|
### Patch Changes
|
|
44
59
|
|
|
45
|
-
-
|
|
60
|
+
- Updated dependencies
|
|
46
61
|
|
|
47
62
|
## 2.0.1
|
|
48
63
|
|
|
49
64
|
### Patch Changes
|
|
50
65
|
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
- [#80571](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80571)
|
|
67
|
+
[`c193ae1d1163`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c193ae1d1163) -
|
|
68
|
+
Fix heading typography styles to for apple OS edge cases.
|
|
54
69
|
|
|
55
70
|
## 2.0.0
|
|
56
71
|
|
|
57
72
|
### Major Changes
|
|
58
73
|
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
74
|
+
- [#81744](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81744)
|
|
75
|
+
[`bc7085853ea2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bc7085853ea2) -
|
|
76
|
+
Renamed `variant` prop to `size`. The prop values remain unchanged.
|
|
62
77
|
|
|
63
78
|
## 1.8.1
|
|
64
79
|
|
|
65
80
|
### Patch Changes
|
|
66
81
|
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
- [#81644](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81644)
|
|
83
|
+
[`8ab7a816dca7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8ab7a816dca7) -
|
|
84
|
+
Revert input border change from the previous version
|
|
70
85
|
|
|
71
86
|
## 1.8.0
|
|
72
87
|
|
|
73
88
|
### Minor Changes
|
|
74
89
|
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
|
|
90
|
+
- [#80528](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80528)
|
|
91
|
+
[`8877e9b57d55`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8877e9b57d55) -
|
|
92
|
+
Added `size` prop which will replace `variant` prop in the next major version.
|
|
78
93
|
|
|
79
94
|
## 1.7.1
|
|
80
95
|
|
|
81
96
|
### Patch Changes
|
|
82
97
|
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
98
|
+
- [#80805](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80805)
|
|
99
|
+
[`427c2dd9e0d6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/427c2dd9e0d6) -
|
|
100
|
+
Update input border color token and width to meet 3:1 color contrast
|
|
101
|
+
- Updated dependencies
|
|
87
102
|
|
|
88
103
|
## 1.7.0
|
|
89
104
|
|
|
90
105
|
### Minor Changes
|
|
91
106
|
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
- [#79770](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/79770)
|
|
108
|
+
[`32e4d951a5ae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32e4d951a5ae) -
|
|
109
|
+
Run the codegen and update heading.partial.tsx
|
|
95
110
|
|
|
96
111
|
### Patch Changes
|
|
97
112
|
|
|
98
|
-
-
|
|
113
|
+
- Updated dependencies
|
|
99
114
|
|
|
100
115
|
## 1.6.0
|
|
101
116
|
|
|
102
117
|
### Minor Changes
|
|
103
118
|
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
119
|
+
- [#68604](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68604)
|
|
120
|
+
[`fdf7f6635426`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fdf7f6635426) -
|
|
121
|
+
Modified mapping of `variant` to the HTML element that gets rendered. Previously `xlarge` would
|
|
122
|
+
render a `h2`, `large` would render a `h3` etc... Now `xlarge` renders a `h1` and so on...
|
|
108
123
|
|
|
109
124
|
## 1.5.1
|
|
110
125
|
|
|
111
126
|
### Patch Changes
|
|
112
127
|
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
thrown.
|
|
128
|
+
- [#70023](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70023)
|
|
129
|
+
[`e2d35320717b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e2d35320717b) -
|
|
130
|
+
Fix types to set either level or variant to be required props to prevent exceptions being thrown.
|
|
117
131
|
|
|
118
132
|
## 1.5.0
|
|
119
133
|
|
|
120
134
|
### Minor Changes
|
|
121
135
|
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
136
|
+
- [#67463](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67463)
|
|
137
|
+
[`caac5b953575`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/caac5b953575) -
|
|
138
|
+
Fixed an issue where typography tokens referenced font family tokens that may not exist on a page,
|
|
139
|
+
causing fallbacks to break.
|
|
126
140
|
|
|
127
141
|
### Patch Changes
|
|
128
142
|
|
|
129
|
-
-
|
|
143
|
+
- Updated dependencies
|
|
130
144
|
|
|
131
145
|
## 1.4.4
|
|
132
146
|
|
|
133
147
|
### Patch Changes
|
|
134
148
|
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
-
|
|
149
|
+
- [#63526](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63526)
|
|
150
|
+
[`cae958047771`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cae958047771) -
|
|
151
|
+
Internal change to how typography tokens are imported. There is no expected behaviour change.
|
|
152
|
+
- Updated dependencies
|
|
139
153
|
|
|
140
154
|
## 1.4.3
|
|
141
155
|
|
|
142
156
|
### Patch Changes
|
|
143
157
|
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
158
|
+
- [#41226](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41226)
|
|
159
|
+
[`fc7aba3cbae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc7aba3cbae) - [ux]
|
|
160
|
+
Further fixes related to heading getting into possible invalid state. Heading will now always
|
|
161
|
+
produce valid markup / aria-attributes for any configuration. Previously if there was no
|
|
162
|
+
`HeadingContext` in the tree the heading would not produce accessibly correct markup in some
|
|
163
|
+
cases. This is now resolved.
|
|
150
164
|
|
|
151
165
|
## 1.4.2
|
|
152
166
|
|
|
153
167
|
### Patch Changes
|
|
154
168
|
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
169
|
+
- [#41124](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41124)
|
|
170
|
+
[`40cd7f0c882`](https://bitbucket.org/atlassian/atlassian-frontend/commits/40cd7f0c882) - Fix to
|
|
171
|
+
prevent heading getting into possible invalid state.
|
|
158
172
|
|
|
159
173
|
## 1.4.1
|
|
160
174
|
|
|
161
175
|
### Patch Changes
|
|
162
176
|
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
-
|
|
168
|
-
|
|
169
|
-
|
|
177
|
+
- [#41032](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41032)
|
|
178
|
+
[`8d9dad6b977`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d9dad6b977) - Heading
|
|
179
|
+
will apply an aria level if rendered as a div. This is an accessibility fix for an incomplete
|
|
180
|
+
feature shipped in the previous minor version.
|
|
181
|
+
- [#40299](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40299)
|
|
182
|
+
[`b1882fdd842`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b1882fdd842) - Change
|
|
183
|
+
typography token naming to be more verbose.
|
|
170
184
|
|
|
171
185
|
## 1.4.0
|
|
172
186
|
|
|
173
187
|
### Minor Changes
|
|
174
188
|
|
|
175
|
-
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
189
|
+
- [#40254](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40254)
|
|
190
|
+
[`9cc7e23c65b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9cc7e23c65b) - [ux]
|
|
191
|
+
Adds additional heading types via the `variant` prop. This prop has been added to aid deprecation
|
|
192
|
+
of the previous `level` prop. The `level` prop will be removed in a future release.
|
|
179
193
|
|
|
180
194
|
## 1.3.8
|
|
181
195
|
|
|
182
196
|
### Patch Changes
|
|
183
197
|
|
|
184
|
-
-
|
|
185
|
-
|
|
186
|
-
|
|
198
|
+
- [#40040](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40040)
|
|
199
|
+
[`ff79902b24c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ff79902b24c) - This
|
|
200
|
+
package is now onboarded onto the product push model.
|
|
187
201
|
|
|
188
202
|
## 1.3.7
|
|
189
203
|
|
|
190
204
|
### Patch Changes
|
|
191
205
|
|
|
192
|
-
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
206
|
+
- [#36754](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36754)
|
|
207
|
+
[`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use
|
|
208
|
+
`@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility
|
|
209
|
+
testing.
|
|
196
210
|
|
|
197
211
|
## 1.3.6
|
|
198
212
|
|
|
199
213
|
### Patch Changes
|
|
200
214
|
|
|
201
|
-
-
|
|
202
|
-
|
|
203
|
-
|
|
215
|
+
- [#35337](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35337)
|
|
216
|
+
[`529814693a1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/529814693a1) - Pin
|
|
217
|
+
version of @atlaskit/primitives so it resolves to correct version
|
|
204
218
|
|
|
205
219
|
## 1.3.5
|
|
206
220
|
|
|
207
221
|
### Patch Changes
|
|
208
222
|
|
|
209
|
-
-
|
|
210
|
-
|
|
211
|
-
|
|
223
|
+
- [#33833](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33833)
|
|
224
|
+
[`b8b41649492`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b8b41649492) - Update
|
|
225
|
+
how certain background colors are referenced by name. Internal changes only.
|
|
212
226
|
|
|
213
227
|
## 1.3.4
|
|
214
228
|
|
|
215
229
|
### Patch Changes
|
|
216
230
|
|
|
217
|
-
-
|
|
218
|
-
|
|
219
|
-
|
|
231
|
+
- [#34922](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34922)
|
|
232
|
+
[`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal
|
|
233
|
+
change only. Replace all instances of Box with stable @atlaskit/primitives version.
|
|
220
234
|
|
|
221
235
|
## 1.3.3
|
|
222
236
|
|
|
223
237
|
### Patch Changes
|
|
224
238
|
|
|
225
|
-
-
|
|
226
|
-
|
|
227
|
-
|
|
239
|
+
- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)
|
|
240
|
+
[`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing
|
|
241
|
+
unused dependencies and dev dependencies
|
|
228
242
|
|
|
229
243
|
## 1.3.2
|
|
230
244
|
|
|
231
245
|
### Patch Changes
|
|
232
246
|
|
|
233
|
-
-
|
|
234
|
-
|
|
235
|
-
|
|
247
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)
|
|
248
|
+
[`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure
|
|
249
|
+
legacy types are published for TS 4.5-4.8
|
|
236
250
|
|
|
237
251
|
## 1.3.1
|
|
238
252
|
|
|
239
253
|
### Patch Changes
|
|
240
254
|
|
|
241
|
-
-
|
|
242
|
-
|
|
243
|
-
|
|
255
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)
|
|
256
|
+
[`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade
|
|
257
|
+
Typescript from `4.5.5` to `4.9.5`
|
|
244
258
|
|
|
245
259
|
## 1.3.0
|
|
246
260
|
|
|
247
261
|
### Minor Changes
|
|
248
262
|
|
|
249
|
-
-
|
|
250
|
-
|
|
251
|
-
|
|
263
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)
|
|
264
|
+
[`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip
|
|
265
|
+
minor dependency bump
|
|
252
266
|
|
|
253
267
|
### Patch Changes
|
|
254
268
|
|
|
255
|
-
-
|
|
269
|
+
- Updated dependencies
|
|
256
270
|
|
|
257
271
|
## 1.2.1
|
|
258
272
|
|
|
259
273
|
### Patch Changes
|
|
260
274
|
|
|
261
|
-
-
|
|
262
|
-
|
|
263
|
-
|
|
275
|
+
- [#32294](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32294)
|
|
276
|
+
[`e0460d5d989`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e0460d5d989) - Usages
|
|
277
|
+
of `process` are now guarded by a `typeof` check.
|
|
264
278
|
|
|
265
279
|
## 1.2.0
|
|
266
280
|
|
|
267
281
|
### Minor Changes
|
|
268
282
|
|
|
269
|
-
-
|
|
270
|
-
|
|
271
|
-
|
|
283
|
+
- [#31206](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31206)
|
|
284
|
+
[`261420360ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/261420360ec) - Upgrades
|
|
285
|
+
component types to support React 18.
|
|
272
286
|
|
|
273
287
|
## 1.1.4
|
|
274
288
|
|
|
275
289
|
### Patch Changes
|
|
276
290
|
|
|
277
|
-
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
`@atlaskit/primitives`.
|
|
291
|
+
- [#31242](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31242)
|
|
292
|
+
[`cfe48bb7ece`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cfe48bb7ece) - Internal
|
|
293
|
+
change only. Replace usages of Inline/Stack with stable version from `@atlaskit/primitives`.
|
|
281
294
|
|
|
282
295
|
## 1.1.3
|
|
283
296
|
|
|
284
297
|
### Patch Changes
|
|
285
298
|
|
|
286
|
-
-
|
|
287
|
-
|
|
288
|
-
|
|
299
|
+
- [#31185](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31185)
|
|
300
|
+
[`b6c5779d358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b6c5779d358) - Internal
|
|
301
|
+
changes only to restrict usage of `Box` from the primitives package.
|
|
289
302
|
|
|
290
303
|
## 1.1.2
|
|
291
304
|
|
|
292
305
|
### Patch Changes
|
|
293
306
|
|
|
294
|
-
-
|
|
307
|
+
- Updated dependencies
|
|
295
308
|
|
|
296
309
|
## 1.1.1
|
|
297
310
|
|
|
298
311
|
### Patch Changes
|
|
299
312
|
|
|
300
|
-
-
|
|
301
|
-
|
|
302
|
-
|
|
313
|
+
- [#29390](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29390)
|
|
314
|
+
[`18aeca8c199`](https://bitbucket.org/atlassian/atlassian-frontend/commits/18aeca8c199) - Internal
|
|
315
|
+
change to update token references. There is no expected behaviour or visual change.
|
|
303
316
|
|
|
304
317
|
## 1.1.0
|
|
305
318
|
|
|
306
319
|
### Minor Changes
|
|
307
320
|
|
|
308
|
-
-
|
|
309
|
-
|
|
310
|
-
|
|
321
|
+
- [#28493](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28493)
|
|
322
|
+
[`fce52a022f5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fce52a022f5) - Adds
|
|
323
|
+
typography tokens to @atlaskit/heading.
|
|
311
324
|
|
|
312
325
|
## 1.0.4
|
|
313
326
|
|
|
314
327
|
### Patch Changes
|
|
315
328
|
|
|
316
|
-
-
|
|
329
|
+
- Updated dependencies
|
|
317
330
|
|
|
318
331
|
## 1.0.3
|
|
319
332
|
|
|
320
333
|
### Patch Changes
|
|
321
334
|
|
|
322
|
-
-
|
|
335
|
+
- Updated dependencies
|
|
323
336
|
|
|
324
337
|
## 1.0.2
|
|
325
338
|
|
|
326
339
|
### Patch Changes
|
|
327
340
|
|
|
328
|
-
-
|
|
329
|
-
|
|
330
|
-
|
|
341
|
+
- [#27341](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/27341)
|
|
342
|
+
[`95fdae34c94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/95fdae34c94) - Revert
|
|
343
|
+
experimental change to `@compiled/react` from `@emotion/react`.
|
|
331
344
|
|
|
332
345
|
## 1.0.1
|
|
333
346
|
|
|
334
347
|
### Patch Changes
|
|
335
348
|
|
|
336
|
-
-
|
|
349
|
+
- Updated dependencies
|
|
337
350
|
|
|
338
351
|
## 1.0.0
|
|
339
352
|
|
|
340
353
|
### Major Changes
|
|
341
354
|
|
|
342
|
-
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
355
|
+
- [#27238](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/27238)
|
|
356
|
+
[`7d92ed50264`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7d92ed50264) - [ux]
|
|
357
|
+
This package is still considered to be in an experimental state and is discouraged for use in
|
|
358
|
+
production. The major is to simplify consumption and versioning in product.
|
|
346
359
|
|
|
347
|
-
|
|
360
|
+
Other changes:
|
|
348
361
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
362
|
+
- Introduction of a `HeadingContext` provider to aid with creating the right semantic structure
|
|
363
|
+
for headings.
|
|
364
|
+
- Migrated internals to use `@compiled/react` from `@emotion/react`.
|
|
352
365
|
|
|
353
366
|
## 0.1.18
|
|
354
367
|
|
|
355
368
|
### Patch Changes
|
|
356
369
|
|
|
357
|
-
-
|
|
358
|
-
|
|
359
|
-
|
|
370
|
+
- [#26488](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26488)
|
|
371
|
+
[`bc989043572`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bc989043572) - Internal
|
|
372
|
+
changes to apply spacing tokens. This should be a no-op change.
|
|
360
373
|
|
|
361
374
|
## 0.1.17
|
|
362
375
|
|
|
363
376
|
### Patch Changes
|
|
364
377
|
|
|
365
|
-
-
|
|
366
|
-
|
|
367
|
-
|
|
378
|
+
- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)
|
|
379
|
+
[`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade
|
|
380
|
+
Typescript from `4.3.5` to `4.5.5`
|
|
368
381
|
|
|
369
382
|
## 0.1.16
|
|
370
383
|
|
|
371
384
|
### Patch Changes
|
|
372
385
|
|
|
373
|
-
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
-
|
|
386
|
+
- [#24004](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24004)
|
|
387
|
+
[`30b11aab9fb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/30b11aab9fb) - Updates
|
|
388
|
+
`@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
389
|
+
- Updated dependencies
|
|
377
390
|
|
|
378
391
|
## 0.1.15
|
|
379
392
|
|
|
380
393
|
### Patch Changes
|
|
381
394
|
|
|
382
|
-
-
|
|
383
|
-
|
|
384
|
-
|
|
395
|
+
- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)
|
|
396
|
+
[`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade
|
|
397
|
+
Typescript from `4.2.4` to `4.3.5`.
|
|
385
398
|
|
|
386
399
|
## 0.1.14
|
|
387
400
|
|
|
388
401
|
### Patch Changes
|
|
389
402
|
|
|
390
|
-
-
|
|
391
|
-
|
|
392
|
-
|
|
403
|
+
- [#23381](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23381)
|
|
404
|
+
[`47b01007f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47b01007f27) -
|
|
405
|
+
Introduces color prop with values default and inverse.
|
|
393
406
|
|
|
394
407
|
## 0.1.13
|
|
395
408
|
|
|
396
409
|
### Patch Changes
|
|
397
410
|
|
|
398
|
-
-
|
|
399
|
-
|
|
400
|
-
|
|
411
|
+
- [#22642](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/22642)
|
|
412
|
+
[`354050b68da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/354050b68da) - Revert
|
|
413
|
+
font size calculations to raw pixels.
|
|
401
414
|
|
|
402
415
|
## 0.1.12
|
|
403
416
|
|
|
404
417
|
### Patch Changes
|
|
405
418
|
|
|
406
|
-
-
|
|
419
|
+
- Updated dependencies
|
|
407
420
|
|
|
408
421
|
## 0.1.11
|
|
409
422
|
|
|
410
423
|
### Patch Changes
|
|
411
424
|
|
|
412
|
-
-
|
|
413
|
-
|
|
414
|
-
|
|
425
|
+
- [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650)
|
|
426
|
+
[`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade
|
|
427
|
+
to TypeScript 4.2.4
|
|
415
428
|
|
|
416
429
|
## 0.1.10
|
|
417
430
|
|
|
418
431
|
### Patch Changes
|
|
419
432
|
|
|
420
|
-
-
|
|
433
|
+
- Updated dependencies
|
|
421
434
|
|
|
422
435
|
## 0.1.9
|
|
423
436
|
|
|
424
437
|
### Patch Changes
|
|
425
438
|
|
|
426
|
-
-
|
|
439
|
+
- Updated dependencies
|
|
427
440
|
|
|
428
441
|
## 0.1.8
|
|
429
442
|
|
|
430
443
|
### Patch Changes
|
|
431
444
|
|
|
432
|
-
-
|
|
445
|
+
- Updated dependencies
|
|
433
446
|
|
|
434
447
|
## 0.1.7
|
|
435
448
|
|
|
436
449
|
### Patch Changes
|
|
437
450
|
|
|
438
|
-
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
-
|
|
451
|
+
- [#16752](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16752)
|
|
452
|
+
[`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Updates
|
|
453
|
+
usage of deprecated token names so they're aligned with the latest naming conventions. No UI or
|
|
454
|
+
visual changes
|
|
455
|
+
- Updated dependencies
|
|
443
456
|
|
|
444
457
|
## 0.1.6
|
|
445
458
|
|
|
446
459
|
### Patch Changes
|
|
447
460
|
|
|
448
|
-
-
|
|
461
|
+
- Updated dependencies
|
|
449
462
|
|
|
450
463
|
## 0.1.5
|
|
451
464
|
|
|
452
465
|
### Patch Changes
|
|
453
466
|
|
|
454
|
-
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
-
|
|
467
|
+
- [#15998](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/15998)
|
|
468
|
+
[`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds
|
|
469
|
+
for this package now pass through a tokens babel plugin, removing runtime invocations of the
|
|
470
|
+
tokens() function and improving bundle size.
|
|
471
|
+
- Updated dependencies
|
|
459
472
|
|
|
460
473
|
## 0.1.4
|
|
461
474
|
|
|
462
475
|
### Patch Changes
|
|
463
476
|
|
|
464
|
-
-
|
|
477
|
+
- Updated dependencies
|
|
465
478
|
|
|
466
479
|
## 0.1.3
|
|
467
480
|
|
|
468
481
|
### Patch Changes
|
|
469
482
|
|
|
470
|
-
-
|
|
483
|
+
- Updated dependencies
|
|
471
484
|
|
|
472
485
|
## 0.1.2
|
|
473
486
|
|
|
474
487
|
### Patch Changes
|
|
475
488
|
|
|
476
|
-
-
|
|
489
|
+
- Updated dependencies
|
|
477
490
|
|
|
478
491
|
## 0.1.1
|
|
479
492
|
|
|
480
493
|
### Patch Changes
|
|
481
494
|
|
|
482
|
-
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
-
|
|
495
|
+
- [#13864](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/13864)
|
|
496
|
+
[`d7a9a4ff7ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d7a9a4ff7ec) -
|
|
497
|
+
Instrumented heading with the new theming package, `@atlaskit/tokens`. New tokens will be visible
|
|
498
|
+
only in applications configured to use the new Tokens API (currently in alpha). These changes are
|
|
499
|
+
intended to be interoperable with the legacy theme implementation. Legacy dark mode users should
|
|
500
|
+
expect no visual or breaking changes.
|
|
501
|
+
- Updated dependencies
|
|
489
502
|
|
|
490
503
|
## 0.1.0
|
|
491
504
|
|
|
492
505
|
### Minor Changes
|
|
493
506
|
|
|
494
|
-
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
507
|
+
- [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837)
|
|
508
|
+
[`ee15e59ba60`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ee15e59ba60) - This is
|
|
509
|
+
the initial release of the Heading package. Typography styles have been duplicated from the
|
|
510
|
+
`@atlaskit/theme` package as standalone components.
|
|
498
511
|
|
|
499
512
|
### Patch Changes
|
|
500
513
|
|
|
501
|
-
-
|
|
502
|
-
|
|
503
|
-
-
|
|
504
|
-
|
|
505
|
-
-
|
|
514
|
+
- [`46816ee8526`](https://bitbucket.org/atlassian/atlassian-frontend/commits/46816ee8526) - Changes
|
|
515
|
+
heading element mappings to match '@atlaskit/css-reset'.
|
|
516
|
+
- [`f9cd2065648`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f9cd2065648) - Removed
|
|
517
|
+
redundant styles for text-transform, moved font-size to `rem` insteda of `em`.
|
|
518
|
+
- Updated dependencies
|
package/LICENSE.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Copyright 2020 Atlassian Pty Ltd
|
|
2
2
|
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
|
|
5
|
-
You may obtain a copy of the License at
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
|
4
|
+
compliance with the License. You may obtain a copy of the License at
|
|
6
5
|
|
|
7
6
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
7
|
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
limitations under the License.
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
10
|
+
implied. See the License for the specific language governing permissions and limitations under the
|
|
11
|
+
License.
|
|
@@ -1,80 +1,66 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type {
|
|
2
|
+
API,
|
|
3
|
+
ASTPath,
|
|
4
|
+
default as core,
|
|
5
|
+
FileInfo,
|
|
6
|
+
ImportDeclaration,
|
|
7
|
+
Options,
|
|
7
8
|
} from 'jscodeshift';
|
|
8
9
|
|
|
9
|
-
export default function transformer(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const headingSpecifier = getDefaultSpecifier(j, base, '@atlaskit/heading');
|
|
16
|
-
if (!headingSpecifier) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
10
|
+
export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) {
|
|
11
|
+
const base = j(fileInfo.source);
|
|
12
|
+
const headingSpecifier = getDefaultSpecifier(j, base, '@atlaskit/heading');
|
|
13
|
+
if (!headingSpecifier) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
replaceLevelWithSize(j, base, headingSpecifier);
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
return base.toSource();
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
const levelToSizeMap = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
h900: 'xxlarge',
|
|
24
|
+
h800: 'xlarge',
|
|
25
|
+
h700: 'large',
|
|
26
|
+
h600: 'medium',
|
|
27
|
+
h500: 'small',
|
|
28
|
+
h400: 'xsmall',
|
|
29
|
+
h300: 'xxsmall',
|
|
30
|
+
// We may want to auto-transform h100s and h200s in the future
|
|
31
|
+
// h200: 'xxsmall',
|
|
32
|
+
// h100: 'xxsmall',
|
|
36
33
|
};
|
|
37
34
|
|
|
38
35
|
function replaceLevelWithSize(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
j: core.JSCodeshift,
|
|
37
|
+
source: ReturnType<typeof j>,
|
|
38
|
+
specifier: string,
|
|
42
39
|
) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
});
|
|
40
|
+
source.findJSXElements(specifier).forEach((element) => {
|
|
41
|
+
j(element)
|
|
42
|
+
.find(j.JSXAttribute, { name: { type: 'JSXIdentifier', name: 'level' } })
|
|
43
|
+
.forEach((attr) => {
|
|
44
|
+
const attrValue = j(attr).nodes()[0].value;
|
|
45
|
+
if (attrValue.type === 'StringLiteral') {
|
|
46
|
+
const replacementValue = levelToSizeMap[attrValue.value as keyof typeof levelToSizeMap];
|
|
47
|
+
if (replacementValue) {
|
|
48
|
+
j(attr).replaceWith(
|
|
49
|
+
j.jsxAttribute(j.jsxIdentifier('size'), j.stringLiteral(replacementValue)),
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
62
55
|
}
|
|
63
56
|
|
|
64
|
-
function getDefaultSpecifier(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
path.node.source.value === specifier,
|
|
74
|
-
)
|
|
75
|
-
.find(j.ImportDefaultSpecifier);
|
|
76
|
-
if (!specifiers.length) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
return specifiers.nodes()[0]!.local!.name;
|
|
57
|
+
function getDefaultSpecifier(j: core.JSCodeshift, source: any, specifier: string) {
|
|
58
|
+
const specifiers = source
|
|
59
|
+
.find(j.ImportDeclaration)
|
|
60
|
+
.filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
|
|
61
|
+
.find(j.ImportDefaultSpecifier);
|
|
62
|
+
if (!specifiers.length) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return specifiers.nodes()[0]!.local!.name;
|
|
80
66
|
}
|
|
@@ -93,7 +93,7 @@ var headingColorStylesMap = exports.headingColorStylesMap = {
|
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
96
|
-
* @codegen <<SignedSource::
|
|
96
|
+
* @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
|
|
97
97
|
* @codegenId typography
|
|
98
98
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
99
99
|
*/
|
|
@@ -82,7 +82,7 @@ export const headingColorStylesMap = {
|
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
85
|
-
* @codegen <<SignedSource::
|
|
85
|
+
* @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
|
|
86
86
|
* @codegenId typography
|
|
87
87
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
88
88
|
*/
|
|
@@ -85,7 +85,7 @@ export var headingColorStylesMap = {
|
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
88
|
-
* @codegen <<SignedSource::
|
|
88
|
+
* @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
|
|
89
89
|
* @codegenId typography
|
|
90
90
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
91
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
|
/**
|
|
@@ -36,5 +36,5 @@ export interface HeadingLevelContextProps {
|
|
|
36
36
|
* </HeadingContext>
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
|
-
declare const HeadingLevelContextProvider: ({ children, value
|
|
39
|
+
declare const HeadingLevelContextProvider: ({ children, value }: HeadingLevelContextProps) => JSX.Element;
|
|
40
40
|
export default HeadingLevelContextProvider;
|
|
@@ -12,11 +12,11 @@ import type { HeadingColor, NewHeadingProps } from './types';
|
|
|
12
12
|
* <Heading size="xxlarge">Page title</Heading>
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
declare const Heading: ({ children, size, id, testId, as, color: colorProp
|
|
15
|
+
declare const Heading: ({ children, size, id, testId, as, color: colorProp }: NewHeadingProps) => jsx.JSX.Element;
|
|
16
16
|
export declare const headingColorStylesMap: Record<HeadingColor, SerializedStyles>;
|
|
17
17
|
/**
|
|
18
18
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
19
|
-
* @codegen <<SignedSource::
|
|
19
|
+
* @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
|
|
20
20
|
* @codegenId typography
|
|
21
21
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
22
22
|
*/
|
package/dist/types/types.d.ts
CHANGED
|
@@ -66,7 +66,6 @@ export type NewHeadingProps = HeadingPropsBase & {
|
|
|
66
66
|
* Heading size. This value is detached from the specific heading level applied to allow for more flexibility.
|
|
67
67
|
* Use instead of the deprecated `level` prop.
|
|
68
68
|
*
|
|
69
|
-
* This prop will only work if the typography tokens theme is applied on the page.
|
|
70
69
|
*/
|
|
71
70
|
size: HeadingSize;
|
|
72
71
|
level?: never;
|
|
@@ -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
|
/**
|
|
@@ -39,5 +39,5 @@ export interface HeadingLevelContextProps {
|
|
|
39
39
|
* </HeadingContext>
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
declare const HeadingLevelContextProvider: ({ children, value
|
|
42
|
+
declare const HeadingLevelContextProvider: ({ children, value }: HeadingLevelContextProps) => JSX.Element;
|
|
43
43
|
export default HeadingLevelContextProvider;
|
|
@@ -12,11 +12,11 @@ import type { HeadingColor, NewHeadingProps } from './types';
|
|
|
12
12
|
* <Heading size="xxlarge">Page title</Heading>
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
declare const Heading: ({ children, size, id, testId, as, color: colorProp
|
|
15
|
+
declare const Heading: ({ children, size, id, testId, as, color: colorProp }: NewHeadingProps) => jsx.JSX.Element;
|
|
16
16
|
export declare const headingColorStylesMap: Record<HeadingColor, SerializedStyles>;
|
|
17
17
|
/**
|
|
18
18
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
19
|
-
* @codegen <<SignedSource::
|
|
19
|
+
* @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
|
|
20
20
|
* @codegenId typography
|
|
21
21
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
22
22
|
*/
|
|
@@ -66,7 +66,6 @@ export type NewHeadingProps = HeadingPropsBase & {
|
|
|
66
66
|
* Heading size. This value is detached from the specific heading level applied to allow for more flexibility.
|
|
67
67
|
* Use instead of the deprecated `level` prop.
|
|
68
68
|
*
|
|
69
|
-
* This prop will only work if the typography tokens theme is applied on the page.
|
|
70
69
|
*/
|
|
71
70
|
size: HeadingSize;
|
|
72
71
|
level?: never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/heading",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
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,8 +33,8 @@
|
|
|
33
33
|
"codegen": "ts-node ./scripts/codegen.tsx"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/primitives": "^
|
|
37
|
-
"@atlaskit/tokens": "^1.
|
|
36
|
+
"@atlaskit/primitives": "^7.0.0",
|
|
37
|
+
"@atlaskit/tokens": "^1.50.0",
|
|
38
38
|
"@babel/runtime": "^7.0.0",
|
|
39
39
|
"@emotion/react": "^11.7.1"
|
|
40
40
|
},
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"@atlaskit/ssr": "*",
|
|
49
49
|
"@atlaskit/toggle": "^13.1.0",
|
|
50
50
|
"@atlaskit/visual-regression": "*",
|
|
51
|
-
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
52
51
|
"@atlassian/codegen": "^0.1.0",
|
|
53
52
|
"@testing-library/react": "^12.1.5",
|
|
54
53
|
"jscodeshift": "^0.13.0",
|
|
@@ -87,6 +86,5 @@
|
|
|
87
86
|
"af:exports": {
|
|
88
87
|
".": "./src/index.tsx"
|
|
89
88
|
},
|
|
90
|
-
"homepage": "https://atlassian.design/components/heading/"
|
|
91
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
89
|
+
"homepage": "https://atlassian.design/components/heading/"
|
|
92
90
|
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/heading"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -24,45 +25,33 @@ const _default: ({ level, variant, ...props }: HeadingProps) => jsx.JSX.Element;
|
|
|
24
25
|
export default _default;
|
|
25
26
|
|
|
26
27
|
// @public
|
|
27
|
-
export const HeadingContextProvider: ({
|
|
28
|
-
children,
|
|
29
|
-
value,
|
|
30
|
-
}: HeadingLevelContextProps) => JSX.Element;
|
|
28
|
+
export const HeadingContextProvider: ({ children, value }: HeadingLevelContextProps) => JSX.Element;
|
|
31
29
|
|
|
32
30
|
// @public (undocumented)
|
|
33
31
|
type HeadingLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
34
32
|
|
|
35
33
|
// @public (undocumented)
|
|
36
34
|
interface HeadingLevelContextProps {
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
value?: HeadingLevel;
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
// @public (undocumented)
|
|
42
40
|
export type HeadingProps = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
testId?: string;
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
id?: string;
|
|
44
|
+
as?: 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span';
|
|
45
|
+
color?: 'default' | 'inverse';
|
|
48
46
|
} & (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
| 'h700'
|
|
58
|
-
| 'h800'
|
|
59
|
-
| 'h900';
|
|
60
|
-
variant?: never;
|
|
61
|
-
}
|
|
62
|
-
| {
|
|
63
|
-
level?: never;
|
|
64
|
-
variant?: HeadingVariant;
|
|
65
|
-
}
|
|
47
|
+
| {
|
|
48
|
+
level?: 'h100' | 'h200' | 'h300' | 'h400' | 'h500' | 'h600' | 'h700' | 'h800' | 'h900';
|
|
49
|
+
variant?: never;
|
|
50
|
+
}
|
|
51
|
+
| {
|
|
52
|
+
level?: never;
|
|
53
|
+
variant?: HeadingVariant;
|
|
54
|
+
}
|
|
66
55
|
);
|
|
67
56
|
|
|
68
57
|
// @public (undocumented)
|
|
@@ -70,13 +59,13 @@ type HeadingVariant = keyof typeof headingVariantStylesMap;
|
|
|
70
59
|
|
|
71
60
|
// @public
|
|
72
61
|
const headingVariantStylesMap: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
62
|
+
large: SerializedStyles;
|
|
63
|
+
medium: SerializedStyles;
|
|
64
|
+
small: SerializedStyles;
|
|
65
|
+
xlarge: SerializedStyles;
|
|
66
|
+
xsmall: SerializedStyles;
|
|
67
|
+
xxlarge: SerializedStyles;
|
|
68
|
+
xxsmall: SerializedStyles;
|
|
80
69
|
};
|
|
81
70
|
|
|
82
71
|
// (No @packageDocumentation comment for this package)
|
|
@@ -90,7 +79,7 @@ const headingVariantStylesMap: {
|
|
|
90
79
|
|
|
91
80
|
```json
|
|
92
81
|
{
|
|
93
|
-
|
|
82
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
94
83
|
}
|
|
95
84
|
```
|
|
96
85
|
|
package/scripts/codegen.tsx
CHANGED
|
@@ -9,47 +9,47 @@ import { createPartialSignedArtifact } from '@atlassian/codegen';
|
|
|
9
9
|
import { typographyAdg3 as tokens } from '@atlaskit/tokens/tokens-raw';
|
|
10
10
|
|
|
11
11
|
const constructTokenFunctionCall = (tokenName: string) => {
|
|
12
|
-
|
|
12
|
+
return `token('${tokenName}')`;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const headingTokens = tokens
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
.filter((t) => t.attributes.group === 'typography')
|
|
17
|
+
.filter((t) => t.cleanName.includes('heading'));
|
|
18
18
|
|
|
19
19
|
const removeVerbosity = (name: string): string => {
|
|
20
|
-
|
|
20
|
+
return name.replace('font.heading.', '');
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export const createTypographyStylesFromTemplate = () => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
return (
|
|
25
|
+
format(
|
|
26
|
+
`
|
|
27
27
|
const headingSizeStylesMap = {
|
|
28
28
|
${headingTokens
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
.map((token) => {
|
|
30
|
+
return `
|
|
31
31
|
'${removeVerbosity(
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
token.name,
|
|
33
|
+
)}': css({ font: ${constructTokenFunctionCall(token.cleanName)} })
|
|
34
34
|
`.trim();
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
})
|
|
36
|
+
.join(',\n\t')}
|
|
37
37
|
};`,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
'typescript',
|
|
39
|
+
) + `\nexport type HeadingSize = keyof typeof headingSizeStylesMap;\n`
|
|
40
|
+
);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
const targetPath = join(__dirname, '../', 'src', 'heading.partial.tsx');
|
|
44
44
|
|
|
45
45
|
writeFileSync(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
join(__dirname, '../src/heading.partial.tsx'),
|
|
47
|
+
createPartialSignedArtifact(
|
|
48
|
+
createTypographyStylesFromTemplate(),
|
|
49
|
+
'yarn workspace @atlaskit/heading codegen',
|
|
50
|
+
{
|
|
51
|
+
id: 'typography',
|
|
52
|
+
absoluteFilePath: targetPath,
|
|
53
|
+
},
|
|
54
|
+
),
|
|
55
55
|
);
|