@atlaskit/avatar 21.9.0 → 21.9.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +1094 -1082
  2. package/codemods/18.0.0-lite-mode.ts +222 -270
  3. package/codemods/19.0.0-render-props.ts +101 -132
  4. package/codemods/__tests__/18.0.0-lite-mode.ts +140 -140
  5. package/codemods/__tests__/19.0.0-render-props.ts +28 -28
  6. package/dist/cjs/Avatar.js +10 -7
  7. package/dist/cjs/AvatarImage.js +4 -1
  8. package/dist/cjs/AvatarItem.js +1 -1
  9. package/dist/cjs/IconWrapper.js +1 -0
  10. package/dist/cjs/Presence.js +4 -0
  11. package/dist/cjs/Skeleton.js +8 -2
  12. package/dist/cjs/Status.js +3 -0
  13. package/dist/es2019/Avatar.js +51 -45
  14. package/dist/es2019/AvatarImage.js +4 -1
  15. package/dist/es2019/AvatarItem.js +20 -20
  16. package/dist/es2019/IconWrapper.js +1 -0
  17. package/dist/es2019/Presence.js +4 -0
  18. package/dist/es2019/Skeleton.js +10 -2
  19. package/dist/es2019/Status.js +3 -0
  20. package/dist/esm/Avatar.js +10 -7
  21. package/dist/esm/AvatarImage.js +4 -1
  22. package/dist/esm/AvatarItem.js +1 -1
  23. package/dist/esm/IconWrapper.js +1 -0
  24. package/dist/esm/Presence.js +4 -0
  25. package/dist/esm/Skeleton.js +8 -2
  26. package/dist/esm/Status.js +3 -0
  27. package/dist/types/Avatar.d.ts +5 -1
  28. package/dist/types/AvatarImage.d.ts +2 -2
  29. package/dist/types/IconWrapper.d.ts +1 -1
  30. package/dist/types/Presence.d.ts +2 -2
  31. package/dist/types/Skeleton.d.ts +2 -2
  32. package/dist/types/Status.d.ts +2 -2
  33. package/dist/types/constants.d.ts +1 -1
  34. package/dist/types/index.d.ts +2 -2
  35. package/dist/types/types.d.ts +1 -1
  36. package/dist/types/utilities.d.ts +1 -1
  37. package/dist/types-ts4.5/Avatar.d.ts +5 -1
  38. package/dist/types-ts4.5/AvatarImage.d.ts +2 -2
  39. package/dist/types-ts4.5/IconWrapper.d.ts +1 -1
  40. package/dist/types-ts4.5/Presence.d.ts +2 -2
  41. package/dist/types-ts4.5/Skeleton.d.ts +2 -2
  42. package/dist/types-ts4.5/Status.d.ts +2 -2
  43. package/dist/types-ts4.5/constants.d.ts +1 -1
  44. package/dist/types-ts4.5/index.d.ts +2 -2
  45. package/dist/types-ts4.5/types.d.ts +1 -1
  46. package/dist/types-ts4.5/utilities.d.ts +1 -1
  47. package/package.json +4 -6
  48. package/report.api.md +83 -94
@@ -6,17 +6,17 @@ import * as transformer from '../18.0.0-lite-mode';
6
6
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
7
7
 
8
8
  describe('Update Avatar props', () => {
9
- defineInlineTest(
10
- { ...transformer, parser: 'tsx' },
11
- {},
12
- `
9
+ defineInlineTest(
10
+ { ...transformer, parser: 'tsx' },
11
+ {},
12
+ `
13
13
  import Avatar from '@atlaskit/avatar';
14
14
 
15
15
  const App = () => {
16
16
  return <Avatar name="foo" />;
17
17
  }
18
18
  `,
19
- `
19
+ `
20
20
  import Tooltip from '@atlaskit/tooltip';
21
21
  import Avatar from '@atlaskit/avatar';
22
22
 
@@ -24,13 +24,13 @@ describe('Update Avatar props', () => {
24
24
  return <Tooltip content="foo"><Avatar name="foo" /></Tooltip>;
25
25
  }
26
26
  `,
27
- 'should wrap avatar in a tooltip if name is defined',
28
- );
27
+ 'should wrap avatar in a tooltip if name is defined',
28
+ );
29
29
 
30
- defineInlineTest(
31
- { ...transformer, parser: 'tsx' },
32
- {},
33
- `
30
+ defineInlineTest(
31
+ { ...transformer, parser: 'tsx' },
32
+ {},
33
+ `
34
34
  import Avatar from '@atlaskit/avatar';
35
35
 
36
36
  const name = 'foo';
@@ -39,7 +39,7 @@ describe('Update Avatar props', () => {
39
39
  return <Avatar name={name} />;
40
40
  }
41
41
  `,
42
- `
42
+ `
43
43
  import Tooltip from '@atlaskit/tooltip';
44
44
  import Avatar from '@atlaskit/avatar';
45
45
 
@@ -49,20 +49,20 @@ describe('Update Avatar props', () => {
49
49
  return <Tooltip content={name}><Avatar name={name} /></Tooltip>;
50
50
  }
51
51
  `,
52
- 'should wrap avatar in a tooltip if name is defined as a variable',
53
- );
52
+ 'should wrap avatar in a tooltip if name is defined as a variable',
53
+ );
54
54
 
55
- defineInlineTest(
56
- { ...transformer, parser: 'tsx' },
57
- {},
58
- `
55
+ defineInlineTest(
56
+ { ...transformer, parser: 'tsx' },
57
+ {},
58
+ `
59
59
  import Avatar from '@atlaskit/avatar';
60
60
 
61
61
  const App = () => {
62
62
  return <Avatar name="foo" enableTooltip={true} />;
63
63
  }
64
64
  `,
65
- `
65
+ `
66
66
  import Tooltip from '@atlaskit/tooltip';
67
67
  import Avatar from '@atlaskit/avatar';
68
68
 
@@ -70,13 +70,13 @@ describe('Update Avatar props', () => {
70
70
  return <Tooltip content="foo"><Avatar name="foo" /></Tooltip>;
71
71
  }
72
72
  `,
73
- 'should wrap avatar in a tooltip if name and enableTooltip are provided',
74
- );
73
+ 'should wrap avatar in a tooltip if name and enableTooltip are provided',
74
+ );
75
75
 
76
- defineInlineTest(
77
- { ...transformer, parser: 'tsx' },
78
- {},
79
- `
76
+ defineInlineTest(
77
+ { ...transformer, parser: 'tsx' },
78
+ {},
79
+ `
80
80
  import Avatar from '@atlaskit/avatar';
81
81
 
82
82
  const value = true;
@@ -85,7 +85,7 @@ describe('Update Avatar props', () => {
85
85
  return <Avatar name="foo" enableTooltip={value} />;
86
86
  }
87
87
  `,
88
- `
88
+ `
89
89
  import Tooltip from '@atlaskit/tooltip';
90
90
  import Avatar from '@atlaskit/avatar';
91
91
 
@@ -95,33 +95,33 @@ describe('Update Avatar props', () => {
95
95
  return value ? <Tooltip content="foo"><Avatar name="foo" /></Tooltip> : <Avatar name="foo" />;
96
96
  }
97
97
  `,
98
- 'should conditionally wrap avatar in toolip if an expression is passed to enableTooltip',
99
- );
98
+ 'should conditionally wrap avatar in toolip if an expression is passed to enableTooltip',
99
+ );
100
100
 
101
- defineInlineTest(
102
- { ...transformer, parser: 'tsx' },
103
- {},
104
- `
101
+ defineInlineTest(
102
+ { ...transformer, parser: 'tsx' },
103
+ {},
104
+ `
105
105
  import Avatar from '@atlaskit/avatar';
106
106
 
107
107
  const App = () => {
108
108
  return <Avatar name="Foo" enableTooltip={false} />;
109
109
  }
110
110
  `,
111
- `
111
+ `
112
112
  import Avatar from '@atlaskit/avatar';
113
113
 
114
114
  const App = () => {
115
115
  return <Avatar name="Foo" />;
116
116
  }
117
117
  `,
118
- 'should not wrap avatar in a tooltip if name is defined and enableTooltip is false',
119
- );
118
+ 'should not wrap avatar in a tooltip if name is defined and enableTooltip is false',
119
+ );
120
120
 
121
- defineInlineTest(
122
- { ...transformer, parser: 'tsx' },
123
- {},
124
- `
121
+ defineInlineTest(
122
+ { ...transformer, parser: 'tsx' },
123
+ {},
124
+ `
125
125
  import Avatar from '@atlaskit/avatar';
126
126
 
127
127
  const App = () => {
@@ -136,20 +136,20 @@ describe('Update Avatar props', () => {
136
136
  )
137
137
  }
138
138
  `,
139
- `
139
+ `
140
140
  import Avatar from '@atlaskit/avatar';
141
141
 
142
142
  const App = () => {
143
143
  return <Avatar />;
144
144
  }
145
145
  `,
146
- 'should remove all deleted props',
147
- );
146
+ 'should remove all deleted props',
147
+ );
148
148
 
149
- defineInlineTest(
150
- { ...transformer, parser: 'tsx' },
151
- {},
152
- `
149
+ defineInlineTest(
150
+ { ...transformer, parser: 'tsx' },
151
+ {},
152
+ `
153
153
  import Foo from '@atlaskit/avatar';
154
154
 
155
155
  const App = () => {
@@ -164,20 +164,20 @@ describe('Update Avatar props', () => {
164
164
  )
165
165
  }
166
166
  `,
167
- `
167
+ `
168
168
  import Foo from '@atlaskit/avatar';
169
169
 
170
170
  const App = () => {
171
171
  return <Foo />;
172
172
  }
173
173
  `,
174
- 'should remove all deleted props with aliased import name',
175
- );
174
+ 'should remove all deleted props with aliased import name',
175
+ );
176
176
 
177
- defineInlineTest(
178
- { ...transformer, parser: 'tsx' },
179
- {},
180
- `
177
+ defineInlineTest(
178
+ { ...transformer, parser: 'tsx' },
179
+ {},
180
+ `
181
181
  import Avatar from '@atlaskit/avatar';
182
182
 
183
183
  const App = () => {
@@ -188,20 +188,20 @@ describe('Update Avatar props', () => {
188
188
  )
189
189
  }
190
190
  `,
191
- `
191
+ `
192
192
  import Avatar from '@atlaskit/avatar';
193
193
 
194
194
  const App = () => {
195
195
  return <Avatar />;
196
196
  }
197
197
  `,
198
- 'should remove enableTooltip when false',
199
- );
198
+ 'should remove enableTooltip when false',
199
+ );
200
200
 
201
- defineInlineTest(
202
- { ...transformer, parser: 'tsx' },
203
- {},
204
- `
201
+ defineInlineTest(
202
+ { ...transformer, parser: 'tsx' },
203
+ {},
204
+ `
205
205
  const App = () => {
206
206
  return (
207
207
  <Avatar
@@ -214,7 +214,7 @@ describe('Update Avatar props', () => {
214
214
  )
215
215
  }
216
216
  `,
217
- `
217
+ `
218
218
  const App = () => {
219
219
  return (
220
220
  <Avatar
@@ -227,15 +227,15 @@ describe('Update Avatar props', () => {
227
227
  )
228
228
  }
229
229
  `,
230
- 'should not mutate JSX if import is missing',
231
- );
230
+ 'should not mutate JSX if import is missing',
231
+ );
232
232
  });
233
233
 
234
234
  describe('Update AvatarItem props', () => {
235
- defineInlineTest(
236
- { ...transformer, parser: 'tsx' },
237
- {},
238
- `
235
+ defineInlineTest(
236
+ { ...transformer, parser: 'tsx' },
237
+ {},
238
+ `
239
239
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
240
240
 
241
241
  const App = () => {
@@ -250,20 +250,20 @@ describe('Update AvatarItem props', () => {
250
250
  )
251
251
  }
252
252
  `,
253
- `
253
+ `
254
254
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
255
255
 
256
256
  const App = () => {
257
257
  return <AvatarItem />;
258
258
  }
259
259
  `,
260
- 'should remove all deleted props',
261
- );
260
+ 'should remove all deleted props',
261
+ );
262
262
 
263
- defineInlineTest(
264
- { ...transformer, parser: 'tsx' },
265
- {},
266
- `
263
+ defineInlineTest(
264
+ { ...transformer, parser: 'tsx' },
265
+ {},
266
+ `
267
267
  import { AvatarItem as Foo } from '@atlaskit/avatar';
268
268
 
269
269
  const App = () => {
@@ -278,20 +278,20 @@ describe('Update AvatarItem props', () => {
278
278
  )
279
279
  }
280
280
  `,
281
- `
281
+ `
282
282
  import { AvatarItem as Foo } from '@atlaskit/avatar';
283
283
 
284
284
  const App = () => {
285
285
  return <Foo />;
286
286
  }
287
287
  `,
288
- 'should remove all deleted props with aliased import',
289
- );
288
+ 'should remove all deleted props with aliased import',
289
+ );
290
290
 
291
- defineInlineTest(
292
- { ...transformer, parser: 'tsx' },
293
- {},
294
- `
291
+ defineInlineTest(
292
+ { ...transformer, parser: 'tsx' },
293
+ {},
294
+ `
295
295
  import { AvatarItem } from '@atlaskit/avatar';
296
296
 
297
297
  const App = () => {
@@ -302,20 +302,20 @@ describe('Update AvatarItem props', () => {
302
302
  );
303
303
  }
304
304
  `,
305
- `
305
+ `
306
306
  import { AvatarItem } from '@atlaskit/avatar';
307
307
 
308
308
  const App = () => {
309
309
  return <AvatarItem />;
310
310
  }
311
311
  `,
312
- 'should remove enableTextTruncate when defaulted to true',
313
- );
312
+ 'should remove enableTextTruncate when defaulted to true',
313
+ );
314
314
 
315
- defineInlineTest(
316
- { ...transformer, parser: 'tsx' },
317
- {},
318
- `
315
+ defineInlineTest(
316
+ { ...transformer, parser: 'tsx' },
317
+ {},
318
+ `
319
319
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
320
320
 
321
321
  const App = () => {
@@ -326,7 +326,7 @@ describe('Update AvatarItem props', () => {
326
326
  )
327
327
  }
328
328
  `,
329
- `
329
+ `
330
330
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
331
331
 
332
332
  const App = () => {
@@ -337,13 +337,13 @@ describe('Update AvatarItem props', () => {
337
337
  );
338
338
  }
339
339
  `,
340
- 'should rename isTruncationDisabled when false',
341
- );
340
+ 'should rename isTruncationDisabled when false',
341
+ );
342
342
 
343
- defineInlineTest(
344
- { ...transformer, parser: 'tsx' },
345
- {},
346
- `
343
+ defineInlineTest(
344
+ { ...transformer, parser: 'tsx' },
345
+ {},
346
+ `
347
347
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
348
348
 
349
349
  const value = true;
@@ -356,7 +356,7 @@ describe('Update AvatarItem props', () => {
356
356
  );
357
357
  }
358
358
  `,
359
- `
359
+ `
360
360
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
361
361
 
362
362
  const value = true;
@@ -369,13 +369,13 @@ describe('Update AvatarItem props', () => {
369
369
  );
370
370
  }
371
371
  `,
372
- 'should rename isTruncationDisabled and negate non-boolean values',
373
- );
372
+ 'should rename isTruncationDisabled and negate non-boolean values',
373
+ );
374
374
 
375
- defineInlineTest(
376
- { ...transformer, parser: 'tsx' },
377
- {},
378
- `
375
+ defineInlineTest(
376
+ { ...transformer, parser: 'tsx' },
377
+ {},
378
+ `
379
379
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
380
380
 
381
381
  const foo = 'foo';
@@ -389,7 +389,7 @@ describe('Update AvatarItem props', () => {
389
389
  );
390
390
  }
391
391
  `,
392
- `
392
+ `
393
393
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
394
394
 
395
395
  const foo = 'foo';
@@ -403,13 +403,13 @@ describe('Update AvatarItem props', () => {
403
403
  );
404
404
  }
405
405
  `,
406
- 'should rename isTruncationDisabled and negate non-boolean values',
407
- );
406
+ 'should rename isTruncationDisabled and negate non-boolean values',
407
+ );
408
408
 
409
- defineInlineTest(
410
- { ...transformer, parser: 'tsx' },
411
- {},
412
- `
409
+ defineInlineTest(
410
+ { ...transformer, parser: 'tsx' },
411
+ {},
412
+ `
413
413
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
414
414
 
415
415
  const App = () => {
@@ -420,20 +420,20 @@ describe('Update AvatarItem props', () => {
420
420
  )
421
421
  }
422
422
  `,
423
- `
423
+ `
424
424
  import Avatar, { AvatarItem } from '@atlaskit/avatar';
425
425
 
426
426
  const App = () => {
427
427
  return <AvatarItem />;
428
428
  }
429
429
  `,
430
- 'should remove isTruncationDisabled when true',
431
- );
430
+ 'should remove isTruncationDisabled when true',
431
+ );
432
432
 
433
- defineInlineTest(
434
- { ...transformer, parser: 'tsx' },
435
- {},
436
- `
433
+ defineInlineTest(
434
+ { ...transformer, parser: 'tsx' },
435
+ {},
436
+ `
437
437
  const App = () => {
438
438
  return (
439
439
  <AvatarItem
@@ -446,7 +446,7 @@ describe('Update AvatarItem props', () => {
446
446
  )
447
447
  }
448
448
  `,
449
- `
449
+ `
450
450
  const App = () => {
451
451
  return (
452
452
  <AvatarItem
@@ -459,56 +459,56 @@ describe('Update AvatarItem props', () => {
459
459
  )
460
460
  }
461
461
  `,
462
- 'should not mutate JSX if import is missing',
463
- );
462
+ 'should not mutate JSX if import is missing',
463
+ );
464
464
  });
465
465
 
466
466
  describe('Update BORDER_WIDTH usage', () => {
467
- defineInlineTest(
468
- { ...transformer, parser: 'tsx' },
469
- {},
470
- `
467
+ defineInlineTest(
468
+ { ...transformer, parser: 'tsx' },
469
+ {},
470
+ `
471
471
  import { BORDER_WIDTH } from '@atlaskit/avatar';
472
472
 
473
473
  var borderWidth = BORDER_WIDTH['foo'];
474
474
  `,
475
- `
475
+ `
476
476
  import { BORDER_WIDTH } from '@atlaskit/avatar';
477
477
 
478
478
  var borderWidth = BORDER_WIDTH;
479
479
  `,
480
- 'should update square bracket notation usages',
481
- );
480
+ 'should update square bracket notation usages',
481
+ );
482
482
 
483
- defineInlineTest(
484
- { ...transformer, parser: 'tsx' },
485
- {},
486
- `
483
+ defineInlineTest(
484
+ { ...transformer, parser: 'tsx' },
485
+ {},
486
+ `
487
487
  import { BORDER_WIDTH } from '@atlaskit/avatar';
488
488
 
489
489
  var borderWidth = BORDER_WIDTH.medium;
490
490
  `,
491
- `
491
+ `
492
492
  import { BORDER_WIDTH } from '@atlaskit/avatar';
493
493
 
494
494
  var borderWidth = BORDER_WIDTH;
495
495
  `,
496
- 'should update dot notation usages',
497
- );
496
+ 'should update dot notation usages',
497
+ );
498
498
 
499
- defineInlineTest(
500
- { ...transformer, parser: 'tsx' },
501
- {},
502
- `
499
+ defineInlineTest(
500
+ { ...transformer, parser: 'tsx' },
501
+ {},
502
+ `
503
503
  import Avatar, { BORDER_WIDTH, AvatarItem } from '@atlaskit/avatar';
504
504
 
505
505
  var borderWidth = BORDER_WIDTH['foo'];
506
506
  `,
507
- `
507
+ `
508
508
  import Avatar, { BORDER_WIDTH, AvatarItem } from '@atlaskit/avatar';
509
509
 
510
510
  var borderWidth = BORDER_WIDTH;
511
511
  `,
512
- 'should update usages with multiple imports',
513
- );
512
+ 'should update usages with multiple imports',
513
+ );
514
514
  });
@@ -6,17 +6,17 @@ import * as transformer from '../19.0.0-render-props';
6
6
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
7
7
 
8
8
  describe('Update Avatar to use render props', () => {
9
- defineInlineTest(
10
- { ...transformer, parser: 'tsx' },
11
- {},
12
- `
9
+ defineInlineTest(
10
+ { ...transformer, parser: 'tsx' },
11
+ {},
12
+ `
13
13
  import Avatar from '@atlaskit/avatar';
14
14
 
15
15
  const App = () => {
16
16
  return <Avatar name="MCB" component={CustomAvatar} />;
17
17
  }
18
18
  `,
19
- `
19
+ `
20
20
  import Avatar from '@atlaskit/avatar';
21
21
 
22
22
  const App = () => {
@@ -30,20 +30,20 @@ describe('Update Avatar to use render props', () => {
30
30
  );
31
31
  }
32
32
  `,
33
- 'should wrap custom component in render prop',
34
- );
33
+ 'should wrap custom component in render prop',
34
+ );
35
35
 
36
- defineInlineTest(
37
- { ...transformer, parser: 'tsx' },
38
- {},
39
- `
36
+ defineInlineTest(
37
+ { ...transformer, parser: 'tsx' },
38
+ {},
39
+ `
40
40
  import Foo from '@atlaskit/avatar';
41
41
 
42
42
  const App = () => {
43
43
  return <Foo component={CustomAvatarItem} />;
44
44
  }
45
45
  `,
46
- `
46
+ `
47
47
  import Foo from '@atlaskit/avatar';
48
48
 
49
49
  const App = () => {
@@ -57,22 +57,22 @@ describe('Update Avatar to use render props', () => {
57
57
  );
58
58
  }
59
59
  `,
60
- 'should convert aliased Avatar component prop to render prop',
61
- );
60
+ 'should convert aliased Avatar component prop to render prop',
61
+ );
62
62
  });
63
63
 
64
64
  describe('Update AvatarItem to use render props', () => {
65
- defineInlineTest(
66
- { ...transformer, parser: 'tsx' },
67
- {},
68
- `
65
+ defineInlineTest(
66
+ { ...transformer, parser: 'tsx' },
67
+ {},
68
+ `
69
69
  import { AvatarItem } from '@atlaskit/avatar';
70
70
 
71
71
  const App = () => {
72
72
  return <AvatarItem component={CustomAvatarItem} />;
73
73
  }
74
74
  `,
75
- `
75
+ `
76
76
  import { AvatarItem } from '@atlaskit/avatar';
77
77
 
78
78
  const App = () => {
@@ -86,20 +86,20 @@ describe('Update AvatarItem to use render props', () => {
86
86
  );
87
87
  }
88
88
  `,
89
- 'should wrap custom component in render prop',
90
- );
89
+ 'should wrap custom component in render prop',
90
+ );
91
91
 
92
- defineInlineTest(
93
- { ...transformer, parser: 'tsx' },
94
- {},
95
- `
92
+ defineInlineTest(
93
+ { ...transformer, parser: 'tsx' },
94
+ {},
95
+ `
96
96
  import { AvatarItem as Foo } from '@atlaskit/avatar';
97
97
 
98
98
  const App = () => {
99
99
  return <Foo component={CustomAvatarItem} />;
100
100
  }
101
101
  `,
102
- `
102
+ `
103
103
  import { AvatarItem as Foo } from '@atlaskit/avatar';
104
104
 
105
105
  const App = () => {
@@ -113,6 +113,6 @@ describe('Update AvatarItem to use render props', () => {
113
113
  );
114
114
  }
115
115
  `,
116
- 'should convert aliased AvatarItem component prop to render prop',
117
- );
116
+ 'should convert aliased AvatarItem component prop to render prop',
117
+ );
118
118
  });