@hero-design/rn 8.110.0 → 8.111.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 (159) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +18 -0
  3. package/assets/fonts/BeVietnamPro-BoldItalic.ttf +0 -0
  4. package/assets/fonts/BeVietnamPro-LightItalic.ttf +0 -0
  5. package/assets/fonts/BeVietnamPro-RegularItalic.ttf +0 -0
  6. package/assets/fonts/BeVietnamPro-SemiBoldItalic.ttf +0 -0
  7. package/assets/fonts/Saiga-LightItalic.otf +0 -0
  8. package/assets/fonts/Saiga-MediumItalic.otf +0 -0
  9. package/assets/fonts/Saiga-RegularItalic.otf +0 -0
  10. package/es/index.js +86 -40
  11. package/lib/index.js +86 -40
  12. package/package.json +7 -7
  13. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +48 -24
  14. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +72 -36
  15. package/src/components/Accordion/index.tsx +6 -1
  16. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +13 -0
  17. package/src/components/Alert/index.tsx +10 -2
  18. package/src/components/AnimatedScroller/__tests__/__snapshots__/ScrollablesWithFAB.spec.tsx.snap +70 -0
  19. package/src/components/AppCue/__tests__/__snapshots__/StyledAppCue.tsx.snap +121 -97
  20. package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
  21. package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/StyledAvatarStack.spec.tsx.snap +2 -0
  22. package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/index.spec.tsx.snap +31 -0
  23. package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +1 -0
  24. package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -0
  25. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +8 -0
  26. package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +1 -0
  27. package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +4 -0
  28. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +8 -3
  29. package/src/components/Button/Button.tsx +10 -4
  30. package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +2 -0
  31. package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +51 -18
  32. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +13 -0
  33. package/src/components/Calendar/__tests__/__snapshots__/CalendarRangeConnector.spec.tsx.snap +5 -0
  34. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +5 -0
  35. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +8 -0
  36. package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +16 -0
  37. package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +20 -0
  38. package/src/components/Chart/ColumnChart/__tests__/__snapshots__/index.spec.tsx.snap +49 -0
  39. package/src/components/Chart/Line/__tests__/__snapshots__/index.spec.tsx.snap +60 -0
  40. package/src/components/Chart/shared/__tests__/__snapshots__/ChartFrame.spec.tsx.snap +62 -0
  41. package/src/components/Chart/shared/__tests__/__snapshots__/ChartHeader.spec.tsx.snap +2 -0
  42. package/src/components/Chart/shared/__tests__/__snapshots__/EmptyState.spec.tsx.snap +2 -0
  43. package/src/components/Chart/shared/__tests__/__snapshots__/XAxis.spec.tsx.snap +12 -0
  44. package/src/components/Chart/shared/__tests__/__snapshots__/YAxis.spec.tsx.snap +36 -0
  45. package/src/components/Checkbox/__tests__/__snapshots__/DefaultCheckBox.spec.tsx.snap +4 -0
  46. package/src/components/Checkbox/__tests__/__snapshots__/InlineCheckBox.spec.tsx.snap +6 -0
  47. package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +19 -0
  48. package/src/components/Chip/index.tsx +15 -8
  49. package/src/components/Collapse/__tests__/__snapshots__/StyledCollapse.spec.tsx.snap +8 -5
  50. package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +20 -12
  51. package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +3 -0
  52. package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +3 -0
  53. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +1 -0
  54. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +1 -0
  55. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +6 -0
  56. package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +13 -9
  57. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +6 -0
  58. package/src/components/FAB/Pair/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
  59. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +2 -0
  60. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
  61. package/src/components/FilterTrigger/__tests__/__snapshots__/index.spec.tsx.snap +6 -0
  62. package/src/components/FloatingIsland/__tests__/__snapshots__/index.spec.tsx.snap +6 -0
  63. package/src/components/HeroDesignProvider/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
  64. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +4 -0
  65. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +13 -0
  66. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +4 -0
  67. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +4 -0
  68. package/src/components/Modal/__tests__/__snapshots__/index.spec.tsx.snap +2 -0
  69. package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +5 -0
  70. package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +4 -0
  71. package/src/components/PinInput/index.tsx +6 -1
  72. package/src/components/Portal/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
  73. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +3 -0
  74. package/src/components/Radio/RadioGroup.tsx +6 -1
  75. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +4 -0
  76. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +10 -0
  77. package/src/components/Rate/__tests__/__snapshots__/index.spec.tsx.snap +84 -48
  78. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +4 -0
  79. package/src/components/Search/SearchOneLine.tsx +6 -0
  80. package/src/components/Search/SearchTwoLine.tsx +6 -1
  81. package/src/components/Search/__tests__/__snapshots__/SearchOneLine.spec.tsx.snap +2 -0
  82. package/src/components/Search/__tests__/__snapshots__/SearchSuffixIcon.spec.tsx.snap +1 -0
  83. package/src/components/Search/__tests__/__snapshots__/SearchTwoLine.spec.tsx.snap +4 -0
  84. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +7 -0
  85. package/src/components/SegmentedControl/__tests__/__snapshots__/SegmentedItem.spec.tsx.snap +1 -0
  86. package/src/components/SegmentedControl/__tests__/__snapshots__/index.spec.tsx.snap +3 -0
  87. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -0
  88. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +20 -0
  89. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +57 -3
  90. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -0
  91. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +24 -0
  92. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +45 -3
  93. package/src/components/StatusScreens/Empty/__tests__/__snapshots__/index.spec.tsx.snap +8 -0
  94. package/src/components/StatusScreens/Error/__tests__/__snapshots__/index.spec.tsx.snap +13 -0
  95. package/src/components/StatusScreens/Success/__tests__/__snapshots__/index.spec.tsx.snap +16 -0
  96. package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +3 -0
  97. package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +2 -0
  98. package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +1 -0
  99. package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
  100. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +9 -6
  101. package/src/components/Tabs/__tests__/__snapshots__/SceneView.spec.tsx.snap +3 -0
  102. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +219 -138
  103. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +102 -62
  104. package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +1 -0
  105. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +18 -0
  106. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +10 -0
  107. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +7 -0
  108. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +40 -0
  109. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +3 -0
  110. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +5 -0
  111. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +13 -0
  112. package/src/components/Toolbar/ToolbarGroup.tsx +18 -4
  113. package/src/components/Toolbar/__tests__/ToolbarGroup.spec.tsx +34 -1
  114. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +9 -0
  115. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +7 -0
  116. package/src/components/Typography/Body/StyledBody.tsx +24 -19
  117. package/src/components/Typography/Body/__tests__/__snapshots__/index.spec.tsx.snap +229 -0
  118. package/src/components/Typography/Body/__tests__/index.spec.tsx +19 -0
  119. package/src/components/Typography/Body/index.tsx +8 -2
  120. package/src/components/Typography/Caption/StyledCaption.tsx +15 -8
  121. package/src/components/Typography/Caption/__tests__/__snapshots__/index.spec.tsx.snap +219 -0
  122. package/src/components/Typography/Caption/__tests__/index.spec.tsx +19 -0
  123. package/src/components/Typography/Caption/index.tsx +18 -10
  124. package/src/components/Typography/Label/StyledLabel.tsx +16 -6
  125. package/src/components/Typography/Label/__tests__/__snapshots__/StyledLabel.tsx.snap +8 -0
  126. package/src/components/Typography/Label/__tests__/__snapshots__/index.spec.tsx.snap +126 -0
  127. package/src/components/Typography/Label/__tests__/index.spec.tsx +12 -0
  128. package/src/components/Typography/Label/index.tsx +17 -9
  129. package/src/components/Typography/Title/StyledTitle.tsx +22 -8
  130. package/src/components/Typography/Title/__tests__/__snapshots__/index.spec.tsx.snap +441 -0
  131. package/src/components/Typography/Title/__tests__/index.spec.tsx +23 -0
  132. package/src/components/Typography/Title/index.tsx +8 -2
  133. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +24 -10
  134. package/src/theme/components/typography.ts +12 -10
  135. package/src/theme/global/typography.ts +9 -0
  136. package/stats/8.110.1/rn-stats.html +4844 -0
  137. package/stats/8.111.0/rn-stats.html +4844 -0
  138. package/types/components/Accordion/index.d.ts +5 -1
  139. package/types/components/Alert/index.d.ts +8 -2
  140. package/types/components/Button/Button.d.ts +8 -4
  141. package/types/components/Chip/index.d.ts +12 -3
  142. package/types/components/PinInput/index.d.ts +4 -0
  143. package/types/components/Radio/RadioGroup.d.ts +5 -1
  144. package/types/components/Radio/index.d.ts +1 -1
  145. package/types/components/Search/SearchOneLine.d.ts +4 -0
  146. package/types/components/Search/SearchTwoLine.d.ts +4 -0
  147. package/types/components/TextInput/StyledTextInput.d.ts +1 -1
  148. package/types/components/Toolbar/ToolbarGroup.d.ts +11 -3
  149. package/types/components/Toolbar/index.d.ts +1 -1
  150. package/types/components/Typography/Body/StyledBody.d.ts +1 -0
  151. package/types/components/Typography/Body/index.d.ts +6 -2
  152. package/types/components/Typography/Caption/StyledCaption.d.ts +1 -0
  153. package/types/components/Typography/Caption/index.d.ts +5 -1
  154. package/types/components/Typography/Label/StyledLabel.d.ts +1 -0
  155. package/types/components/Typography/Label/index.d.ts +5 -1
  156. package/types/components/Typography/Title/StyledTitle.d.ts +1 -0
  157. package/types/components/Typography/Title/index.d.ts +6 -2
  158. package/types/theme/components/typography.d.ts +12 -10
  159. package/types/theme/global/typography.d.ts +3 -0
@@ -14,6 +14,7 @@ exports[`Label has archived intent style 1`] = `
14
14
  [
15
15
  {
16
16
  "color": "#606065",
17
+ "fontFamily": "BeVietnamPro-Regular",
17
18
  "fontSize": 10,
18
19
  "letterSpacing": 0,
19
20
  "lineHeight": 14,
@@ -22,6 +23,7 @@ exports[`Label has archived intent style 1`] = `
22
23
  ]
23
24
  }
24
25
  themeIntent="archived"
26
+ themeIsItalic={false}
25
27
  >
26
28
  This is a test
27
29
  </Text>
@@ -62,6 +64,7 @@ exports[`Label has body intent style 1`] = `
62
64
  [
63
65
  {
64
66
  "color": "#001f23",
67
+ "fontFamily": "BeVietnamPro-Regular",
65
68
  "fontSize": 10,
66
69
  "letterSpacing": 0,
67
70
  "lineHeight": 14,
@@ -70,6 +73,7 @@ exports[`Label has body intent style 1`] = `
70
73
  ]
71
74
  }
72
75
  themeIntent="body"
76
+ themeIsItalic={false}
73
77
  >
74
78
  This is a test
75
79
  </Text>
@@ -110,6 +114,7 @@ exports[`Label has danger intent style 1`] = `
110
114
  [
111
115
  {
112
116
  "color": "#cb300a",
117
+ "fontFamily": "BeVietnamPro-Regular",
113
118
  "fontSize": 10,
114
119
  "letterSpacing": 0,
115
120
  "lineHeight": 14,
@@ -118,6 +123,7 @@ exports[`Label has danger intent style 1`] = `
118
123
  ]
119
124
  }
120
125
  themeIntent="danger"
126
+ themeIsItalic={false}
121
127
  >
122
128
  This is a test
123
129
  </Text>
@@ -158,6 +164,7 @@ exports[`Label has disabled intent style 1`] = `
158
164
  [
159
165
  {
160
166
  "color": "#bfc1c5",
167
+ "fontFamily": "BeVietnamPro-Regular",
161
168
  "fontSize": 10,
162
169
  "letterSpacing": 0,
163
170
  "lineHeight": 14,
@@ -166,6 +173,7 @@ exports[`Label has disabled intent style 1`] = `
166
173
  ]
167
174
  }
168
175
  themeIntent="disabled"
176
+ themeIsItalic={false}
169
177
  >
170
178
  This is a test
171
179
  </Text>
@@ -206,6 +214,7 @@ exports[`Label has inactive intent style 1`] = `
206
214
  [
207
215
  {
208
216
  "color": "#808f91",
217
+ "fontFamily": "BeVietnamPro-Regular",
209
218
  "fontSize": 10,
210
219
  "letterSpacing": 0,
211
220
  "lineHeight": 14,
@@ -214,6 +223,7 @@ exports[`Label has inactive intent style 1`] = `
214
223
  ]
215
224
  }
216
225
  themeIntent="inactive"
226
+ themeIsItalic={false}
217
227
  >
218
228
  This is a test
219
229
  </Text>
@@ -254,6 +264,7 @@ exports[`Label has info intent style 1`] = `
254
264
  [
255
265
  {
256
266
  "color": "#355bfb",
267
+ "fontFamily": "BeVietnamPro-Regular",
257
268
  "fontSize": 10,
258
269
  "letterSpacing": 0,
259
270
  "lineHeight": 14,
@@ -262,6 +273,7 @@ exports[`Label has info intent style 1`] = `
262
273
  ]
263
274
  }
264
275
  themeIntent="info"
276
+ themeIsItalic={false}
265
277
  >
266
278
  This is a test
267
279
  </Text>
@@ -302,6 +314,7 @@ exports[`Label has inverted intent style 1`] = `
302
314
  [
303
315
  {
304
316
  "color": "#ffffff",
317
+ "fontFamily": "BeVietnamPro-Regular",
305
318
  "fontSize": 10,
306
319
  "letterSpacing": 0,
307
320
  "lineHeight": 14,
@@ -310,6 +323,7 @@ exports[`Label has inverted intent style 1`] = `
310
323
  ]
311
324
  }
312
325
  themeIntent="inverted"
326
+ themeIsItalic={false}
313
327
  >
314
328
  This is a test
315
329
  </Text>
@@ -350,6 +364,7 @@ exports[`Label has muted intent style 1`] = `
350
364
  [
351
365
  {
352
366
  "color": "#4d6265",
367
+ "fontFamily": "BeVietnamPro-Regular",
353
368
  "fontSize": 10,
354
369
  "letterSpacing": 0,
355
370
  "lineHeight": 14,
@@ -358,6 +373,7 @@ exports[`Label has muted intent style 1`] = `
358
373
  ]
359
374
  }
360
375
  themeIntent="muted"
376
+ themeIsItalic={false}
361
377
  >
362
378
  This is a test
363
379
  </Text>
@@ -398,6 +414,7 @@ exports[`Label has primary intent style 1`] = `
398
414
  [
399
415
  {
400
416
  "color": "#401960",
417
+ "fontFamily": "BeVietnamPro-Regular",
401
418
  "fontSize": 10,
402
419
  "letterSpacing": 0,
403
420
  "lineHeight": 14,
@@ -406,6 +423,7 @@ exports[`Label has primary intent style 1`] = `
406
423
  ]
407
424
  }
408
425
  themeIntent="primary"
426
+ themeIsItalic={false}
409
427
  >
410
428
  This is a test
411
429
  </Text>
@@ -446,6 +464,7 @@ exports[`Label has secondary intent style 1`] = `
446
464
  [
447
465
  {
448
466
  "color": "#795e90",
467
+ "fontFamily": "BeVietnamPro-Regular",
449
468
  "fontSize": 10,
450
469
  "letterSpacing": 0,
451
470
  "lineHeight": 14,
@@ -454,6 +473,7 @@ exports[`Label has secondary intent style 1`] = `
454
473
  ]
455
474
  }
456
475
  themeIntent="secondary"
476
+ themeIsItalic={false}
457
477
  >
458
478
  This is a test
459
479
  </Text>
@@ -494,6 +514,7 @@ exports[`Label has subdued intent style 1`] = `
494
514
  [
495
515
  {
496
516
  "color": "#4d6265",
517
+ "fontFamily": "BeVietnamPro-Regular",
497
518
  "fontSize": 10,
498
519
  "letterSpacing": 0,
499
520
  "lineHeight": 14,
@@ -502,6 +523,7 @@ exports[`Label has subdued intent style 1`] = `
502
523
  ]
503
524
  }
504
525
  themeIntent="subdued"
526
+ themeIsItalic={false}
505
527
  >
506
528
  This is a test
507
529
  </Text>
@@ -542,6 +564,7 @@ exports[`Label has success intent style 1`] = `
542
564
  [
543
565
  {
544
566
  "color": "#5ace7d",
567
+ "fontFamily": "BeVietnamPro-Regular",
545
568
  "fontSize": 10,
546
569
  "letterSpacing": 0,
547
570
  "lineHeight": 14,
@@ -550,6 +573,7 @@ exports[`Label has success intent style 1`] = `
550
573
  ]
551
574
  }
552
575
  themeIntent="success"
576
+ themeIsItalic={false}
553
577
  >
554
578
  This is a test
555
579
  </Text>
@@ -590,6 +614,7 @@ exports[`Label has warning intent style 1`] = `
590
614
  [
591
615
  {
592
616
  "color": "#ffbe71",
617
+ "fontFamily": "BeVietnamPro-Regular",
593
618
  "fontSize": 10,
594
619
  "letterSpacing": 0,
595
620
  "lineHeight": 14,
@@ -598,6 +623,7 @@ exports[`Label has warning intent style 1`] = `
598
623
  ]
599
624
  }
600
625
  themeIntent="warning"
626
+ themeIsItalic={false}
601
627
  >
602
628
  This is a test
603
629
  </Text>
@@ -623,3 +649,103 @@ exports[`Label has warning intent style 1`] = `
623
649
  />
624
650
  </View>
625
651
  `;
652
+
653
+ exports[`Label renders fontStyle=italic 1`] = `
654
+ <View
655
+ style={
656
+ {
657
+ "flex": 1,
658
+ }
659
+ }
660
+ >
661
+ <Text
662
+ allowFontScaling={false}
663
+ style={
664
+ [
665
+ {
666
+ "color": "#001f23",
667
+ "fontFamily": "BeVietnamPro-RegularItalic",
668
+ "fontSize": 10,
669
+ "letterSpacing": 0,
670
+ "lineHeight": 14,
671
+ },
672
+ undefined,
673
+ ]
674
+ }
675
+ themeIntent="body"
676
+ themeIsItalic={true}
677
+ >
678
+ This is text with fontStyle
679
+ </Text>
680
+ <View
681
+ pointerEvents="box-none"
682
+ position="bottom"
683
+ style={
684
+ [
685
+ {
686
+ "bottom": 0,
687
+ "elevation": 9999,
688
+ "flexDirection": "column-reverse",
689
+ "left": 0,
690
+ "paddingHorizontal": 24,
691
+ "paddingVertical": 16,
692
+ "position": "absolute",
693
+ "right": 0,
694
+ "top": 0,
695
+ },
696
+ undefined,
697
+ ]
698
+ }
699
+ />
700
+ </View>
701
+ `;
702
+
703
+ exports[`Label renders fontStyle=normal 1`] = `
704
+ <View
705
+ style={
706
+ {
707
+ "flex": 1,
708
+ }
709
+ }
710
+ >
711
+ <Text
712
+ allowFontScaling={false}
713
+ style={
714
+ [
715
+ {
716
+ "color": "#001f23",
717
+ "fontFamily": "BeVietnamPro-Regular",
718
+ "fontSize": 10,
719
+ "letterSpacing": 0,
720
+ "lineHeight": 14,
721
+ },
722
+ undefined,
723
+ ]
724
+ }
725
+ themeIntent="body"
726
+ themeIsItalic={false}
727
+ >
728
+ This is text with fontStyle
729
+ </Text>
730
+ <View
731
+ pointerEvents="box-none"
732
+ position="bottom"
733
+ style={
734
+ [
735
+ {
736
+ "bottom": 0,
737
+ "elevation": 9999,
738
+ "flexDirection": "column-reverse",
739
+ "left": 0,
740
+ "paddingHorizontal": 24,
741
+ "paddingVertical": 16,
742
+ "position": "absolute",
743
+ "right": 0,
744
+ "top": 0,
745
+ },
746
+ undefined,
747
+ ]
748
+ }
749
+ />
750
+ </View>
751
+ `;
@@ -31,4 +31,16 @@ describe('Label', () => {
31
31
 
32
32
  expect(toJSON()).toMatchSnapshot();
33
33
  });
34
+
35
+ it.each`
36
+ fontStyle
37
+ ${'normal'}
38
+ ${'italic'}
39
+ `('renders fontStyle=$fontStyle', ({ fontStyle }) => {
40
+ const { toJSON } = renderWithTheme(
41
+ <Label fontStyle={fontStyle}>This is text with fontStyle</Label>
42
+ );
43
+
44
+ expect(toJSON()).toMatchSnapshot();
45
+ });
34
46
  });
@@ -25,21 +25,29 @@ export interface LabelProps extends NativeTextProps {
25
25
  * Testing id of the component.
26
26
  */
27
27
  testID?: string;
28
+ /**
29
+ * Font style to apply to the text.
30
+ */
31
+ fontStyle?: 'normal' | 'italic';
28
32
  }
29
33
 
30
34
  const Label = ({
31
35
  children,
32
36
  intent = 'body',
33
37
  allowFontScaling = false,
38
+ fontStyle = 'normal',
34
39
  ...nativeProps
35
- }: LabelProps) => (
36
- <StyledLabel
37
- {...nativeProps}
38
- themeIntent={intent}
39
- allowFontScaling={allowFontScaling}
40
- >
41
- {children}
42
- </StyledLabel>
43
- );
40
+ }: LabelProps) => {
41
+ return (
42
+ <StyledLabel
43
+ {...nativeProps}
44
+ themeIntent={intent}
45
+ themeIsItalic={fontStyle === 'italic'}
46
+ allowFontScaling={allowFontScaling}
47
+ >
48
+ {children}
49
+ </StyledLabel>
50
+ );
51
+ };
44
52
 
45
53
  export default Label;
@@ -8,13 +8,27 @@ const StyledTitle = styled(Text)<{
8
8
  themeIntent: TypographyIntent;
9
9
  themeLevel: ThemeLevel;
10
10
  themeTypeface: 'neutral' | 'playful';
11
- }>(({ themeIntent, themeLevel, theme, themeTypeface: typeface }) => ({
12
- fontSize: theme.__hd__.typography.fontSizes.titles[typeface][themeLevel],
13
- lineHeight: theme.__hd__.typography.lineHeights.titles[typeface][themeLevel],
14
- letterSpacing:
15
- theme.__hd__.typography.letterSpacings.titles[typeface][themeLevel],
16
- fontFamily: theme.__hd__.typography.fontWeights.titles[typeface][themeLevel],
17
- color: theme.__hd__.typography.colors[themeIntent],
18
- }));
11
+ themeIsItalic?: boolean;
12
+ }>(
13
+ ({
14
+ themeIntent,
15
+ themeLevel,
16
+ theme,
17
+ themeTypeface: typeface,
18
+ themeIsItalic,
19
+ }) => ({
20
+ fontSize: theme.__hd__.typography.fontSizes.titles[typeface][themeLevel],
21
+ lineHeight:
22
+ theme.__hd__.typography.lineHeights.titles[typeface][themeLevel],
23
+ letterSpacing:
24
+ theme.__hd__.typography.letterSpacings.titles[typeface][themeLevel],
25
+ color: theme.__hd__.typography.colors[themeIntent],
26
+ fontFamily: themeIsItalic
27
+ ? theme.__hd__.typography.fontWeights.titles[typeface][
28
+ `${themeLevel}Italic`
29
+ ]
30
+ : theme.__hd__.typography.fontWeights.titles[typeface][themeLevel],
31
+ })
32
+ );
19
33
 
20
34
  export { StyledTitle };