@hero-design/rn 8.73.0 → 8.74.0

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 (46) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +14 -0
  3. package/es/index.js +16 -22
  4. package/lib/index.js +16 -22
  5. package/package.json +1 -1
  6. package/src/components/Chip/StyledChip.tsx +1 -7
  7. package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +4 -17
  8. package/src/components/Icon/HeroIcon/index.tsx +3 -1
  9. package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +405 -0
  10. package/src/components/Icon/__tests__/index.spec.tsx +14 -2
  11. package/src/components/Icon/index.tsx +2 -1
  12. package/src/components/MapPin/StyledMapPin.tsx +2 -5
  13. package/src/components/MapPin/__tests__/__snapshots__/index.spec.tsx.snap +9 -13
  14. package/src/components/MapPin/index.tsx +2 -2
  15. package/src/components/Typography/Body/__tests__/__snapshots__/index.spec.tsx.snap +51 -0
  16. package/src/components/Typography/Body/__tests__/index.spec.tsx +1 -0
  17. package/src/components/Typography/Body/index.tsx +2 -1
  18. package/src/components/Typography/Caption/__tests__/__snapshots__/index.spec.tsx.snap +50 -0
  19. package/src/components/Typography/Caption/__tests__/index.spec.tsx +1 -0
  20. package/src/components/Typography/Caption/index.tsx +2 -1
  21. package/src/components/Typography/Label/__tests__/__snapshots__/index.spec.tsx.snap +48 -0
  22. package/src/components/Typography/Label/__tests__/index.spec.tsx +1 -0
  23. package/src/components/Typography/Label/index.tsx +2 -1
  24. package/src/components/Typography/Title/__tests__/__snapshots__/index.spec.tsx.snap +51 -0
  25. package/src/components/Typography/Title/__tests__/index.spec.tsx +1 -0
  26. package/src/components/Typography/Title/index.tsx +2 -1
  27. package/src/components/Typography/types.ts +2 -1
  28. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +3 -6
  29. package/src/theme/components/chip.ts +1 -7
  30. package/src/theme/components/icon.ts +1 -0
  31. package/src/theme/components/mapPin.ts +0 -1
  32. package/src/theme/components/typography.ts +1 -0
  33. package/stats/8.73.1/rn-stats.html +4842 -0
  34. package/stats/8.74.0/rn-stats.html +4842 -0
  35. package/types/components/Icon/HeroIcon/index.d.ts +1 -1
  36. package/types/components/Icon/index.d.ts +1 -1
  37. package/types/components/MapPin/StyledMapPin.d.ts +0 -1
  38. package/types/components/Typography/Body/index.d.ts +1 -1
  39. package/types/components/Typography/Caption/index.d.ts +1 -1
  40. package/types/components/Typography/Label/index.d.ts +1 -1
  41. package/types/components/Typography/Title/index.d.ts +1 -1
  42. package/types/components/Typography/types.d.ts +1 -1
  43. package/types/theme/components/chip.d.ts +1 -5
  44. package/types/theme/components/icon.d.ts +1 -0
  45. package/types/theme/components/mapPin.d.ts +0 -1
  46. package/types/theme/components/typography.d.ts +1 -0
@@ -149,6 +149,51 @@ exports[`Icon renders correctly with color and size 1`] = `
149
149
  `;
150
150
 
151
151
  exports[`Icon renders correctly with intent 1`] = `
152
+ <View
153
+ style={
154
+ {
155
+ "flex": 1,
156
+ }
157
+ }
158
+ >
159
+ <HeroIcon
160
+ name="home"
161
+ style={
162
+ [
163
+ {
164
+ "color": "#001f23",
165
+ "fontSize": 24,
166
+ },
167
+ undefined,
168
+ ]
169
+ }
170
+ themeIntent="text"
171
+ themeSize="medium"
172
+ />
173
+ <View
174
+ pointerEvents="box-none"
175
+ position="bottom"
176
+ style={
177
+ [
178
+ {
179
+ "bottom": 0,
180
+ "elevation": 9999,
181
+ "flexDirection": "column-reverse",
182
+ "left": 0,
183
+ "paddingHorizontal": 24,
184
+ "paddingVertical": 16,
185
+ "position": "absolute",
186
+ "right": 0,
187
+ "top": 0,
188
+ },
189
+ undefined,
190
+ ]
191
+ }
192
+ />
193
+ </View>
194
+ `;
195
+
196
+ exports[`Icon renders correctly with intent 2`] = `
152
197
  <View
153
198
  style={
154
199
  {
@@ -192,3 +237,363 @@ exports[`Icon renders correctly with intent 1`] = `
192
237
  />
193
238
  </View>
194
239
  `;
240
+
241
+ exports[`Icon renders correctly with intent 3`] = `
242
+ <View
243
+ style={
244
+ {
245
+ "flex": 1,
246
+ }
247
+ }
248
+ >
249
+ <HeroIcon
250
+ name="home"
251
+ style={
252
+ [
253
+ {
254
+ "color": "#795e90",
255
+ "fontSize": 24,
256
+ },
257
+ undefined,
258
+ ]
259
+ }
260
+ themeIntent="secondary"
261
+ themeSize="medium"
262
+ />
263
+ <View
264
+ pointerEvents="box-none"
265
+ position="bottom"
266
+ style={
267
+ [
268
+ {
269
+ "bottom": 0,
270
+ "elevation": 9999,
271
+ "flexDirection": "column-reverse",
272
+ "left": 0,
273
+ "paddingHorizontal": 24,
274
+ "paddingVertical": 16,
275
+ "position": "absolute",
276
+ "right": 0,
277
+ "top": 0,
278
+ },
279
+ undefined,
280
+ ]
281
+ }
282
+ />
283
+ </View>
284
+ `;
285
+
286
+ exports[`Icon renders correctly with intent 4`] = `
287
+ <View
288
+ style={
289
+ {
290
+ "flex": 1,
291
+ }
292
+ }
293
+ >
294
+ <HeroIcon
295
+ name="home"
296
+ style={
297
+ [
298
+ {
299
+ "color": "#b5c3fd",
300
+ "fontSize": 24,
301
+ },
302
+ undefined,
303
+ ]
304
+ }
305
+ themeIntent="info"
306
+ themeSize="medium"
307
+ />
308
+ <View
309
+ pointerEvents="box-none"
310
+ position="bottom"
311
+ style={
312
+ [
313
+ {
314
+ "bottom": 0,
315
+ "elevation": 9999,
316
+ "flexDirection": "column-reverse",
317
+ "left": 0,
318
+ "paddingHorizontal": 24,
319
+ "paddingVertical": 16,
320
+ "position": "absolute",
321
+ "right": 0,
322
+ "top": 0,
323
+ },
324
+ undefined,
325
+ ]
326
+ }
327
+ />
328
+ </View>
329
+ `;
330
+
331
+ exports[`Icon renders correctly with intent 5`] = `
332
+ <View
333
+ style={
334
+ {
335
+ "flex": 1,
336
+ }
337
+ }
338
+ >
339
+ <HeroIcon
340
+ name="home"
341
+ style={
342
+ [
343
+ {
344
+ "color": "#cb300a",
345
+ "fontSize": 24,
346
+ },
347
+ undefined,
348
+ ]
349
+ }
350
+ themeIntent="danger"
351
+ themeSize="medium"
352
+ />
353
+ <View
354
+ pointerEvents="box-none"
355
+ position="bottom"
356
+ style={
357
+ [
358
+ {
359
+ "bottom": 0,
360
+ "elevation": 9999,
361
+ "flexDirection": "column-reverse",
362
+ "left": 0,
363
+ "paddingHorizontal": 24,
364
+ "paddingVertical": 16,
365
+ "position": "absolute",
366
+ "right": 0,
367
+ "top": 0,
368
+ },
369
+ undefined,
370
+ ]
371
+ }
372
+ />
373
+ </View>
374
+ `;
375
+
376
+ exports[`Icon renders correctly with intent 6`] = `
377
+ <View
378
+ style={
379
+ {
380
+ "flex": 1,
381
+ }
382
+ }
383
+ >
384
+ <HeroIcon
385
+ name="home"
386
+ style={
387
+ [
388
+ {
389
+ "color": "#5ace7d",
390
+ "fontSize": 24,
391
+ },
392
+ undefined,
393
+ ]
394
+ }
395
+ themeIntent="success"
396
+ themeSize="medium"
397
+ />
398
+ <View
399
+ pointerEvents="box-none"
400
+ position="bottom"
401
+ style={
402
+ [
403
+ {
404
+ "bottom": 0,
405
+ "elevation": 9999,
406
+ "flexDirection": "column-reverse",
407
+ "left": 0,
408
+ "paddingHorizontal": 24,
409
+ "paddingVertical": 16,
410
+ "position": "absolute",
411
+ "right": 0,
412
+ "top": 0,
413
+ },
414
+ undefined,
415
+ ]
416
+ }
417
+ />
418
+ </View>
419
+ `;
420
+
421
+ exports[`Icon renders correctly with intent 7`] = `
422
+ <View
423
+ style={
424
+ {
425
+ "flex": 1,
426
+ }
427
+ }
428
+ >
429
+ <HeroIcon
430
+ name="home"
431
+ style={
432
+ [
433
+ {
434
+ "color": "#ffbe71",
435
+ "fontSize": 24,
436
+ },
437
+ undefined,
438
+ ]
439
+ }
440
+ themeIntent="warning"
441
+ themeSize="medium"
442
+ />
443
+ <View
444
+ pointerEvents="box-none"
445
+ position="bottom"
446
+ style={
447
+ [
448
+ {
449
+ "bottom": 0,
450
+ "elevation": 9999,
451
+ "flexDirection": "column-reverse",
452
+ "left": 0,
453
+ "paddingHorizontal": 24,
454
+ "paddingVertical": 16,
455
+ "position": "absolute",
456
+ "right": 0,
457
+ "top": 0,
458
+ },
459
+ undefined,
460
+ ]
461
+ }
462
+ />
463
+ </View>
464
+ `;
465
+
466
+ exports[`Icon renders correctly with intent 8`] = `
467
+ <View
468
+ style={
469
+ {
470
+ "flex": 1,
471
+ }
472
+ }
473
+ >
474
+ <HeroIcon
475
+ name="home"
476
+ style={
477
+ [
478
+ {
479
+ "color": "#bfc1c5",
480
+ "fontSize": 24,
481
+ },
482
+ undefined,
483
+ ]
484
+ }
485
+ themeIntent="disabled-text"
486
+ themeSize="medium"
487
+ />
488
+ <View
489
+ pointerEvents="box-none"
490
+ position="bottom"
491
+ style={
492
+ [
493
+ {
494
+ "bottom": 0,
495
+ "elevation": 9999,
496
+ "flexDirection": "column-reverse",
497
+ "left": 0,
498
+ "paddingHorizontal": 24,
499
+ "paddingVertical": 16,
500
+ "position": "absolute",
501
+ "right": 0,
502
+ "top": 0,
503
+ },
504
+ undefined,
505
+ ]
506
+ }
507
+ />
508
+ </View>
509
+ `;
510
+
511
+ exports[`Icon renders correctly with intent 9`] = `
512
+ <View
513
+ style={
514
+ {
515
+ "flex": 1,
516
+ }
517
+ }
518
+ >
519
+ <HeroIcon
520
+ name="home"
521
+ style={
522
+ [
523
+ {
524
+ "color": "#ffffff",
525
+ "fontSize": 24,
526
+ },
527
+ undefined,
528
+ ]
529
+ }
530
+ themeIntent="text-inverted"
531
+ themeSize="medium"
532
+ />
533
+ <View
534
+ pointerEvents="box-none"
535
+ position="bottom"
536
+ style={
537
+ [
538
+ {
539
+ "bottom": 0,
540
+ "elevation": 9999,
541
+ "flexDirection": "column-reverse",
542
+ "left": 0,
543
+ "paddingHorizontal": 24,
544
+ "paddingVertical": 16,
545
+ "position": "absolute",
546
+ "right": 0,
547
+ "top": 0,
548
+ },
549
+ undefined,
550
+ ]
551
+ }
552
+ />
553
+ </View>
554
+ `;
555
+
556
+ exports[`Icon renders correctly with intent 10`] = `
557
+ <View
558
+ style={
559
+ {
560
+ "flex": 1,
561
+ }
562
+ }
563
+ >
564
+ <HeroIcon
565
+ name="home"
566
+ style={
567
+ [
568
+ {
569
+ "color": "#4d6265",
570
+ "fontSize": 24,
571
+ },
572
+ undefined,
573
+ ]
574
+ }
575
+ themeIntent="muted"
576
+ themeSize="medium"
577
+ />
578
+ <View
579
+ pointerEvents="box-none"
580
+ position="bottom"
581
+ style={
582
+ [
583
+ {
584
+ "bottom": 0,
585
+ "elevation": 9999,
586
+ "flexDirection": "column-reverse",
587
+ "left": 0,
588
+ "paddingHorizontal": 24,
589
+ "paddingVertical": 16,
590
+ "position": "absolute",
591
+ "right": 0,
592
+ "top": 0,
593
+ },
594
+ undefined,
595
+ ]
596
+ }
597
+ />
598
+ </View>
599
+ `;
@@ -9,8 +9,20 @@ describe('Icon', () => {
9
9
  expect(toJSON()).toMatchSnapshot();
10
10
  });
11
11
 
12
- it('renders correctly with intent', () => {
13
- const { toJSON } = renderWithTheme(<Icon icon="home" intent="primary" />);
12
+ it.each`
13
+ intent
14
+ ${'text'}
15
+ ${'primary'}
16
+ ${'secondary'}
17
+ ${'info'}
18
+ ${'danger'}
19
+ ${'success'}
20
+ ${'warning'}
21
+ ${'disabled-text'}
22
+ ${'text-inverted'}
23
+ ${'muted'}
24
+ `('renders correctly with intent', ({ intent }) => {
25
+ const { toJSON } = renderWithTheme(<Icon icon="home" intent={intent} />);
14
26
 
15
27
  expect(toJSON()).toMatchSnapshot();
16
28
  });
@@ -24,7 +24,8 @@ export interface IconProps extends AccessibilityProps {
24
24
  | 'success'
25
25
  | 'warning'
26
26
  | 'disabled-text'
27
- | 'text-inverted';
27
+ | 'text-inverted'
28
+ | 'muted';
28
29
  /**
29
30
  * Size of the Icon.
30
31
  */
@@ -15,11 +15,8 @@ export const StyledContainer = styled(View)(({ theme }) => ({
15
15
 
16
16
  export const StyledContent = styled(View)<{
17
17
  themeState: State;
18
- themeIsIcon: boolean;
19
- }>(({ theme, themeState, themeIsIcon }) => ({
20
- backgroundColor: themeIsIcon
21
- ? theme.__hd__.mapPin.colors.iconBackground
22
- : theme.__hd__.mapPin.colors.background,
18
+ }>(({ theme, themeState }) => ({
19
+ backgroundColor: theme.__hd__.mapPin.colors.background,
23
20
  borderRadius: theme.__hd__.mapPin.radii.default,
24
21
  borderWidth: theme.__hd__.mapPin.borderWidths.default,
25
22
  borderColor: theme.__hd__.mapPin.colors.border[themeState],
@@ -28,7 +28,7 @@ exports[`MapPin renders applied state correctly 1`] = `
28
28
  [
29
29
  {
30
30
  "alignItems": "center",
31
- "backgroundColor": "#4d6265",
31
+ "backgroundColor": "#ffffff",
32
32
  "borderColor": "#795e90",
33
33
  "borderRadius": 12,
34
34
  "borderWidth": 4,
@@ -48,7 +48,6 @@ exports[`MapPin renders applied state correctly 1`] = `
48
48
  undefined,
49
49
  ]
50
50
  }
51
- themeIsIcon={true}
52
51
  themeState="applied"
53
52
  >
54
53
  <HeroIcon
@@ -56,14 +55,14 @@ exports[`MapPin renders applied state correctly 1`] = `
56
55
  style={
57
56
  [
58
57
  {
59
- "color": "#ffffff",
58
+ "color": "#001f23",
60
59
  "fontSize": 16,
61
60
  },
62
61
  undefined,
63
62
  ]
64
63
  }
65
64
  testID="map-pin-icon"
66
- themeIntent="text-inverted"
65
+ themeIntent="text"
67
66
  themeSize="xsmall"
68
67
  />
69
68
  </View>
@@ -170,7 +169,7 @@ exports[`MapPin renders icon correctly 1`] = `
170
169
  [
171
170
  {
172
171
  "alignItems": "center",
173
- "backgroundColor": "#4d6265",
172
+ "backgroundColor": "#ffffff",
174
173
  "borderColor": "#ffffff",
175
174
  "borderRadius": 12,
176
175
  "borderWidth": 4,
@@ -190,7 +189,6 @@ exports[`MapPin renders icon correctly 1`] = `
190
189
  undefined,
191
190
  ]
192
191
  }
193
- themeIsIcon={true}
194
192
  themeState="idle"
195
193
  >
196
194
  <HeroIcon
@@ -198,14 +196,14 @@ exports[`MapPin renders icon correctly 1`] = `
198
196
  style={
199
197
  [
200
198
  {
201
- "color": "#ffffff",
199
+ "color": "#001f23",
202
200
  "fontSize": 16,
203
201
  },
204
202
  undefined,
205
203
  ]
206
204
  }
207
205
  testID="map-pin-icon"
208
- themeIntent="text-inverted"
206
+ themeIntent="text"
209
207
  themeSize="xsmall"
210
208
  />
211
209
  </View>
@@ -281,7 +279,6 @@ exports[`MapPin renders image correctly 1`] = `
281
279
  undefined,
282
280
  ]
283
281
  }
284
- themeIsIcon={false}
285
282
  themeState="idle"
286
283
  >
287
284
  <Image
@@ -355,7 +352,7 @@ exports[`MapPin renders selected state correctly 1`] = `
355
352
  [
356
353
  {
357
354
  "alignItems": "center",
358
- "backgroundColor": "#4d6265",
355
+ "backgroundColor": "#ffffff",
359
356
  "borderColor": "#795e90",
360
357
  "borderRadius": 12,
361
358
  "borderWidth": 4,
@@ -375,7 +372,6 @@ exports[`MapPin renders selected state correctly 1`] = `
375
372
  undefined,
376
373
  ]
377
374
  }
378
- themeIsIcon={true}
379
375
  themeState="selected"
380
376
  >
381
377
  <HeroIcon
@@ -383,14 +379,14 @@ exports[`MapPin renders selected state correctly 1`] = `
383
379
  style={
384
380
  [
385
381
  {
386
- "color": "#ffffff",
382
+ "color": "#001f23",
387
383
  "fontSize": 16,
388
384
  },
389
385
  undefined,
390
386
  ]
391
387
  }
392
388
  testID="map-pin-icon"
393
- themeIntent="text-inverted"
389
+ themeIntent="text"
394
390
  themeSize="xsmall"
395
391
  />
396
392
  </View>
@@ -32,7 +32,7 @@ const MapPin = ({
32
32
  const badgeIcon = getBadgeIconName(state);
33
33
  return (
34
34
  <StyledContainer {...nativeProps} style={style} testID={testID}>
35
- <StyledContent themeState={state} themeIsIcon={!!icon}>
35
+ <StyledContent themeState={state}>
36
36
  {image && (
37
37
  <StyledImage
38
38
  testID={testID ? `${testID}-image` : undefined}
@@ -43,7 +43,7 @@ const MapPin = ({
43
43
  <Icon
44
44
  icon={icon}
45
45
  size="xsmall"
46
- intent="text-inverted"
46
+ intent="text"
47
47
  testID={testID ? `${testID}-icon` : undefined}
48
48
  />
49
49
  )}
@@ -306,6 +306,57 @@ exports[`Body has inverted intent style 1`] = `
306
306
  </View>
307
307
  `;
308
308
 
309
+ exports[`Body has muted intent style 1`] = `
310
+ <View
311
+ style={
312
+ {
313
+ "flex": 1,
314
+ }
315
+ }
316
+ >
317
+ <Text
318
+ allowFontScaling={false}
319
+ style={
320
+ [
321
+ {
322
+ "color": "#4d6265",
323
+ "fontFamily": "BeVietnamPro-Regular",
324
+ "fontSize": 16,
325
+ "letterSpacing": 0.48,
326
+ "lineHeight": 24,
327
+ },
328
+ undefined,
329
+ ]
330
+ }
331
+ themeIntent="muted"
332
+ themeTypeface="neutral"
333
+ themeVariant="regular"
334
+ >
335
+ This is a test
336
+ </Text>
337
+ <View
338
+ pointerEvents="box-none"
339
+ position="bottom"
340
+ style={
341
+ [
342
+ {
343
+ "bottom": 0,
344
+ "elevation": 9999,
345
+ "flexDirection": "column-reverse",
346
+ "left": 0,
347
+ "paddingHorizontal": 24,
348
+ "paddingVertical": 16,
349
+ "position": "absolute",
350
+ "right": 0,
351
+ "top": 0,
352
+ },
353
+ undefined,
354
+ ]
355
+ }
356
+ />
357
+ </View>
358
+ `;
359
+
309
360
  exports[`Body has primary intent style 1`] = `
310
361
  <View
311
362
  style={
@@ -22,6 +22,7 @@ describe('Body', () => {
22
22
  ${'inverted'}
23
23
  ${'archived'}
24
24
  ${'disabled'}
25
+ ${'muted'}
25
26
  `('has $intent intent style', ({ intent }) => {
26
27
  const { toJSON } = renderWithTheme(
27
28
  <Body intent={intent}>This is a test</Body>
@@ -26,7 +26,8 @@ export interface BodyProps extends NativeTextProps {
26
26
  | 'danger'
27
27
  | 'inverted'
28
28
  | 'archived'
29
- | 'disabled';
29
+ | 'disabled'
30
+ | 'muted';
30
31
  /**
31
32
  * Additional style.
32
33
  */