@hero-design/rn 7.19.0 → 7.20.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 (171) hide show
  1. package/.eslintrc.json +6 -1
  2. package/.turbo/turbo-build.log +2 -2
  3. package/es/index.js +572 -194
  4. package/lib/index.js +572 -193
  5. package/package.json +4 -4
  6. package/src/components/Alert/StyledAlert.tsx +5 -5
  7. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +140 -19
  8. package/src/components/Alert/__tests__/index.spec.tsx +21 -0
  9. package/src/components/Alert/index.tsx +13 -6
  10. package/src/components/Avatar/StyledAvatar.tsx +2 -1
  11. package/src/components/Avatar/index.tsx +2 -1
  12. package/src/components/Box/StyledBox.tsx +54 -0
  13. package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +605 -0
  14. package/src/components/Box/__tests__/helpers.spec.ts +14 -0
  15. package/src/components/Box/__tests__/index.spec.tsx +155 -0
  16. package/src/components/Box/config.ts +201 -0
  17. package/src/components/Box/helpers.ts +10 -0
  18. package/src/components/Box/index.tsx +13 -0
  19. package/src/components/Box/types.ts +38 -0
  20. package/src/components/Calendar/__tests__/index.spec.tsx +13 -17
  21. package/src/components/Card/DataCard/StyledDataCard.tsx +8 -2
  22. package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +1 -0
  23. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +16 -0
  24. package/src/components/Card/DataCard/index.tsx +1 -1
  25. package/src/components/Card/StyledCard.tsx +12 -19
  26. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +147 -0
  27. package/src/components/Card/__tests__/index.spec.tsx +18 -0
  28. package/src/components/Card/index.tsx +6 -1
  29. package/src/components/Drawer/DragableDrawer/helpers.ts +3 -4
  30. package/src/components/FAB/ActionGroup/index.tsx +6 -8
  31. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +4 -8
  32. package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
  33. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  34. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
  35. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  36. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
  37. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  38. package/src/components/Spinner/AnimatedSpinner.tsx +7 -7
  39. package/src/components/Spinner/StyledSpinner.tsx +24 -19
  40. package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +1 -1
  41. package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +32 -16
  42. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +14 -12
  43. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +273 -31
  44. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +14 -12
  45. package/src/components/Spinner/index.tsx +10 -2
  46. package/src/components/Tabs/ScrollableTabs.tsx +9 -4
  47. package/src/components/Tabs/StyledScrollableTabs.tsx +6 -5
  48. package/src/components/Tabs/StyledTabs.tsx +6 -0
  49. package/src/components/Tabs/TabWithBadge.tsx +68 -0
  50. package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +13 -0
  51. package/src/components/Tabs/__tests__/TabWithBadge.spec.tsx +48 -0
  52. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +205 -43
  53. package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +165 -0
  54. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +135 -34
  55. package/src/components/Tabs/__tests__/index.spec.tsx +12 -0
  56. package/src/components/Tabs/index.tsx +11 -4
  57. package/src/components/Tag/StyledTag.tsx +1 -11
  58. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +4 -4
  59. package/src/components/Tag/index.tsx +2 -2
  60. package/src/components/TextInput/__tests__/index.spec.tsx +10 -14
  61. package/src/components/Toast/StyledToast.tsx +13 -7
  62. package/src/components/Toast/Toast.tsx +34 -9
  63. package/src/components/Toast/ToastProvider.tsx +15 -12
  64. package/src/components/Toast/__tests__/Toast.spec.tsx +17 -0
  65. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +299 -19
  66. package/src/components/Toast/types.ts +15 -1
  67. package/src/components/Typography/Text/StyledText.tsx +7 -1
  68. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
  69. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
  70. package/src/components/Typography/Text/index.tsx +7 -1
  71. package/src/index.ts +2 -0
  72. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +76 -23
  73. package/src/theme/components/.eslintrc.json +10 -0
  74. package/src/theme/components/alert.ts +5 -1
  75. package/src/theme/components/avatar.ts +2 -0
  76. package/src/theme/components/card.ts +6 -7
  77. package/src/theme/components/sectionHeading.ts +1 -1
  78. package/src/theme/components/spinner.ts +19 -7
  79. package/src/theme/components/tabs.ts +3 -2
  80. package/src/theme/components/tag.ts +13 -13
  81. package/src/theme/components/toast.ts +17 -3
  82. package/src/theme/components/typography.ts +2 -0
  83. package/src/theme/global/colors/swag.ts +23 -0
  84. package/src/theme/global/colors/types.ts +23 -0
  85. package/src/theme/global/colors/work.ts +5 -0
  86. package/tsconfig.json +4 -15
  87. package/types/components/Accordion/StyledAccordion.d.ts +14 -14
  88. package/types/components/Alert/StyledAlert.d.ts +16 -16
  89. package/types/components/Alert/index.d.ts +1 -1
  90. package/types/components/Avatar/StyledAvatar.d.ts +16 -16
  91. package/types/components/Avatar/index.d.ts +2 -2
  92. package/types/components/Badge/StyledBadge.d.ts +7 -7
  93. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
  94. package/types/components/BottomSheet/Header.d.ts +1 -1
  95. package/types/components/BottomSheet/StyledBottomSheet.d.ts +19 -19
  96. package/types/components/Box/StyledBox.d.ts +15 -0
  97. package/types/components/Box/__tests__/helpers.spec.d.ts +1 -0
  98. package/types/components/Box/__tests__/index.spec.d.ts +1 -0
  99. package/types/components/Box/config.d.ts +170 -0
  100. package/types/components/Box/helpers.d.ts +1 -0
  101. package/types/components/Box/index.d.ts +5 -0
  102. package/types/components/Box/types.d.ts +31 -0
  103. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +7 -7
  104. package/types/components/Button/StyledButton.d.ts +16 -16
  105. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
  106. package/types/components/Calendar/StyledCalendar.d.ts +25 -25
  107. package/types/components/Calendar/helpers.d.ts +2 -2
  108. package/types/components/Card/DataCard/StyledDataCard.d.ts +7 -7
  109. package/types/components/Card/DataCard/index.d.ts +1 -1
  110. package/types/components/Card/StyledCard.d.ts +7 -6
  111. package/types/components/Card/index.d.ts +5 -1
  112. package/types/components/Checkbox/StyledCheckbox.d.ts +10 -10
  113. package/types/components/Collapse/StyledCollapse.d.ts +8 -8
  114. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
  115. package/types/components/DatePicker/StyledDatePicker.d.ts +3 -3
  116. package/types/components/Divider/StyledDivider.d.ts +5 -5
  117. package/types/components/Drawer/StyledDrawer.d.ts +19 -19
  118. package/types/components/Empty/StyledEmpty.d.ts +12 -12
  119. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +11 -11
  120. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +7 -7
  121. package/types/components/FAB/StyledFAB.d.ts +8 -8
  122. package/types/components/Icon/HeroIcon/index.d.ts +3 -3
  123. package/types/components/List/StyledBasicListItem.d.ts +14 -14
  124. package/types/components/List/StyledListItem.d.ts +23 -23
  125. package/types/components/PinInput/StyledPinInput.d.ts +30 -30
  126. package/types/components/Progress/StyledProgressBar.d.ts +5 -5
  127. package/types/components/Progress/StyledProgressCircle.d.ts +18 -18
  128. package/types/components/Radio/StyledRadio.d.ts +9 -9
  129. package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
  130. package/types/components/RichTextEditor/MentionList.d.ts +1 -1
  131. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
  132. package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
  133. package/types/components/RichTextEditor/index.d.ts +2 -2
  134. package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
  135. package/types/components/Select/MultiSelect/Option.d.ts +1 -1
  136. package/types/components/Select/SingleSelect/Option.d.ts +1 -1
  137. package/types/components/Select/StyledSelect.d.ts +11 -11
  138. package/types/components/Select/helpers.d.ts +1 -1
  139. package/types/components/Spinner/AnimatedSpinner.d.ts +3 -1
  140. package/types/components/Spinner/StyledSpinner.d.ts +14 -12
  141. package/types/components/Spinner/index.d.ts +5 -1
  142. package/types/components/Switch/StyledSwitch.d.ts +5 -5
  143. package/types/components/Tabs/StyledScrollableTabs.d.ts +24 -22
  144. package/types/components/Tabs/StyledTabs.d.ts +26 -20
  145. package/types/components/Tabs/TabWithBadge.d.ts +17 -0
  146. package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +1 -0
  147. package/types/components/Tabs/index.d.ts +3 -1
  148. package/types/components/Tag/StyledTag.d.ts +6 -6
  149. package/types/components/Tag/index.d.ts +1 -1
  150. package/types/components/TextInput/StyledTextInput.d.ts +44 -44
  151. package/types/components/TextInput/index.d.ts +5 -5
  152. package/types/components/TimePicker/StyledTimePicker.d.ts +3 -3
  153. package/types/components/Toast/StyledToast.d.ts +19 -18
  154. package/types/components/Toast/types.d.ts +2 -1
  155. package/types/components/Toolbar/StyledToolbar.d.ts +9 -9
  156. package/types/components/Typography/Text/StyledText.d.ts +4 -4
  157. package/types/components/Typography/Text/index.d.ts +1 -1
  158. package/types/index.d.ts +2 -1
  159. package/types/testHelpers/renderWithTheme.d.ts +1 -1
  160. package/types/theme/ThemeSwitcher.d.ts +1 -1
  161. package/types/theme/components/alert.d.ts +5 -1
  162. package/types/theme/components/avatar.d.ts +2 -0
  163. package/types/theme/components/card.d.ts +6 -7
  164. package/types/theme/components/spinner.d.ts +17 -5
  165. package/types/theme/components/tabs.d.ts +1 -0
  166. package/types/theme/components/tag.d.ts +2 -2
  167. package/types/theme/components/toast.d.ts +18 -2
  168. package/types/theme/components/typography.d.ts +2 -0
  169. package/types/theme/global/colors/types.d.ts +17 -0
  170. package/types/theme/global/index.d.ts +17 -0
  171. package/types/utils/hooks.d.ts +1 -1
@@ -8,9 +8,17 @@ exports[`Toast Icon render custom icon correctly 1`] = `
8
8
  Object {
9
9
  "backgroundColor": "#b5c3fd",
10
10
  "borderRadius": 0,
11
+ "elevation": 4,
11
12
  "flexDirection": "row",
12
13
  "minHeight": 48,
13
14
  "opacity": 0,
15
+ "shadowColor": "#001f23",
16
+ "shadowOffset": Object {
17
+ "height": 2,
18
+ "width": 0,
19
+ },
20
+ "shadowOpacity": 0.12,
21
+ "shadowRadius": 4,
14
22
  "transform": Array [
15
23
  Object {
16
24
  "translateY": 20,
@@ -30,7 +38,7 @@ exports[`Toast Icon render custom icon correctly 1`] = `
30
38
  "borderRightWidth": 0,
31
39
  "flex": 1,
32
40
  "flexDirection": "row",
33
- "paddingVertical": 16,
41
+ "paddingVertical": 12,
34
42
  },
35
43
  undefined,
36
44
  ]
@@ -41,7 +49,7 @@ exports[`Toast Icon render custom icon correctly 1`] = `
41
49
  Array [
42
50
  Object {
43
51
  "alignItems": "center",
44
- "paddingLeft": 16,
52
+ "paddingLeft": 12,
45
53
  },
46
54
  undefined,
47
55
  ]
@@ -68,7 +76,7 @@ exports[`Toast Icon render custom icon correctly 1`] = `
68
76
  Array [
69
77
  Object {
70
78
  "flex": 1,
71
- "paddingHorizontal": 16,
79
+ "paddingHorizontal": 12,
72
80
  },
73
81
  undefined,
74
82
  ]
@@ -106,9 +114,17 @@ exports[`Toast renders correctly when intent is error 1`] = `
106
114
  Object {
107
115
  "backgroundColor": "#f46363",
108
116
  "borderRadius": 0,
117
+ "elevation": 4,
109
118
  "flexDirection": "row",
110
119
  "minHeight": 48,
111
120
  "opacity": 0,
121
+ "shadowColor": "#001f23",
122
+ "shadowOffset": Object {
123
+ "height": 2,
124
+ "width": 0,
125
+ },
126
+ "shadowOpacity": 0.12,
127
+ "shadowRadius": 4,
112
128
  "transform": Array [
113
129
  Object {
114
130
  "translateY": 20,
@@ -128,7 +144,7 @@ exports[`Toast renders correctly when intent is error 1`] = `
128
144
  "borderRightWidth": 1,
129
145
  "flex": 1,
130
146
  "flexDirection": "row",
131
- "paddingVertical": 16,
147
+ "paddingVertical": 12,
132
148
  },
133
149
  undefined,
134
150
  ]
@@ -139,7 +155,7 @@ exports[`Toast renders correctly when intent is error 1`] = `
139
155
  Array [
140
156
  Object {
141
157
  "alignItems": "center",
142
- "paddingLeft": 16,
158
+ "paddingLeft": 12,
143
159
  },
144
160
  undefined,
145
161
  ]
@@ -166,7 +182,7 @@ exports[`Toast renders correctly when intent is error 1`] = `
166
182
  Array [
167
183
  Object {
168
184
  "flex": 1,
169
- "paddingHorizontal": 16,
185
+ "paddingHorizontal": 12,
170
186
  },
171
187
  undefined,
172
188
  ]
@@ -209,7 +225,7 @@ exports[`Toast renders correctly when intent is error 1`] = `
209
225
  Object {
210
226
  "justifyContent": "center",
211
227
  "opacity": 1,
212
- "paddingHorizontal": 16,
228
+ "paddingHorizontal": 12,
213
229
  }
214
230
  }
215
231
  testID="toast-action-button"
@@ -245,9 +261,17 @@ exports[`Toast renders correctly when intent is info 1`] = `
245
261
  Object {
246
262
  "backgroundColor": "#b5c3fd",
247
263
  "borderRadius": 0,
264
+ "elevation": 4,
248
265
  "flexDirection": "row",
249
266
  "minHeight": 48,
250
267
  "opacity": 0,
268
+ "shadowColor": "#001f23",
269
+ "shadowOffset": Object {
270
+ "height": 2,
271
+ "width": 0,
272
+ },
273
+ "shadowOpacity": 0.12,
274
+ "shadowRadius": 4,
251
275
  "transform": Array [
252
276
  Object {
253
277
  "translateY": 20,
@@ -267,7 +291,7 @@ exports[`Toast renders correctly when intent is info 1`] = `
267
291
  "borderRightWidth": 1,
268
292
  "flex": 1,
269
293
  "flexDirection": "row",
270
- "paddingVertical": 16,
294
+ "paddingVertical": 12,
271
295
  },
272
296
  undefined,
273
297
  ]
@@ -278,7 +302,7 @@ exports[`Toast renders correctly when intent is info 1`] = `
278
302
  Array [
279
303
  Object {
280
304
  "alignItems": "center",
281
- "paddingLeft": 16,
305
+ "paddingLeft": 12,
282
306
  },
283
307
  undefined,
284
308
  ]
@@ -305,7 +329,7 @@ exports[`Toast renders correctly when intent is info 1`] = `
305
329
  Array [
306
330
  Object {
307
331
  "flex": 1,
308
- "paddingHorizontal": 16,
332
+ "paddingHorizontal": 12,
309
333
  },
310
334
  undefined,
311
335
  ]
@@ -348,7 +372,7 @@ exports[`Toast renders correctly when intent is info 1`] = `
348
372
  Object {
349
373
  "justifyContent": "center",
350
374
  "opacity": 1,
351
- "paddingHorizontal": 16,
375
+ "paddingHorizontal": 12,
352
376
  }
353
377
  }
354
378
  testID="toast-action-button"
@@ -376,6 +400,246 @@ exports[`Toast renders correctly when intent is info 1`] = `
376
400
  </View>
377
401
  `;
378
402
 
403
+ exports[`Toast renders correctly when intent is notification 1`] = `
404
+ <View
405
+ collapsable={false}
406
+ nativeID="animatedComponent"
407
+ style={
408
+ Object {
409
+ "backgroundColor": "#ffffff",
410
+ "borderRadius": 0,
411
+ "elevation": 4,
412
+ "flexDirection": "row",
413
+ "minHeight": 48,
414
+ "opacity": 0,
415
+ "shadowColor": "#001f23",
416
+ "shadowOffset": Object {
417
+ "height": 2,
418
+ "width": 0,
419
+ },
420
+ "shadowOpacity": 0.12,
421
+ "shadowRadius": 4,
422
+ "transform": Array [
423
+ Object {
424
+ "translateY": 20,
425
+ },
426
+ ],
427
+ }
428
+ }
429
+ themeIntent="notification"
430
+ themeVariant="default"
431
+ >
432
+ <View
433
+ showDivider={true}
434
+ style={
435
+ Array [
436
+ Object {
437
+ "borderColor": "#e8e9ea",
438
+ "borderRightWidth": 1,
439
+ "flex": 1,
440
+ "flexDirection": "row",
441
+ "paddingVertical": 12,
442
+ },
443
+ undefined,
444
+ ]
445
+ }
446
+ >
447
+ <View
448
+ style={
449
+ Array [
450
+ Object {
451
+ "flex": 1,
452
+ "paddingHorizontal": 12,
453
+ },
454
+ undefined,
455
+ ]
456
+ }
457
+ >
458
+ <Text
459
+ style={
460
+ Array [
461
+ Object {
462
+ "color": "#001f23",
463
+ "fontFamily": "BeVietnamPro-Regular",
464
+ "fontSize": 14,
465
+ "letterSpacing": 0.42,
466
+ "lineHeight": 22,
467
+ },
468
+ undefined,
469
+ ]
470
+ }
471
+ themeFontSize="medium"
472
+ themeFontWeight="regular"
473
+ themeIntent="body"
474
+ >
475
+ Toast Content
476
+ </Text>
477
+ </View>
478
+ </View>
479
+ <View
480
+ accessible={true}
481
+ collapsable={false}
482
+ focusable={true}
483
+ nativeID="animatedComponent"
484
+ onClick={[Function]}
485
+ onResponderGrant={[Function]}
486
+ onResponderMove={[Function]}
487
+ onResponderRelease={[Function]}
488
+ onResponderTerminate={[Function]}
489
+ onResponderTerminationRequest={[Function]}
490
+ onStartShouldSetResponder={[Function]}
491
+ style={
492
+ Object {
493
+ "justifyContent": "center",
494
+ "opacity": 1,
495
+ "paddingHorizontal": 12,
496
+ }
497
+ }
498
+ testID="toast-action-button"
499
+ >
500
+ <Text
501
+ style={
502
+ Array [
503
+ Object {
504
+ "color": "#001f23",
505
+ "fontFamily": "BeVietnamPro-SemiBold",
506
+ "fontSize": 14,
507
+ "letterSpacing": 0.42,
508
+ "lineHeight": 22,
509
+ },
510
+ undefined,
511
+ ]
512
+ }
513
+ themeFontSize="medium"
514
+ themeFontWeight="semi-bold"
515
+ themeIntent="body"
516
+ >
517
+ Action
518
+ </Text>
519
+ </View>
520
+ </View>
521
+ `;
522
+
523
+ exports[`Toast renders correctly when intent is snackbar 1`] = `
524
+ <View
525
+ collapsable={false}
526
+ nativeID="animatedComponent"
527
+ style={
528
+ Object {
529
+ "backgroundColor": "#001f23",
530
+ "borderRadius": 0,
531
+ "elevation": 4,
532
+ "flexDirection": "row",
533
+ "minHeight": 48,
534
+ "opacity": 0,
535
+ "shadowColor": "#001f23",
536
+ "shadowOffset": Object {
537
+ "height": 2,
538
+ "width": 0,
539
+ },
540
+ "shadowOpacity": 0.12,
541
+ "shadowRadius": 4,
542
+ "transform": Array [
543
+ Object {
544
+ "translateY": 20,
545
+ },
546
+ ],
547
+ }
548
+ }
549
+ themeIntent="snackbar"
550
+ themeVariant="default"
551
+ >
552
+ <View
553
+ showDivider={true}
554
+ style={
555
+ Array [
556
+ Object {
557
+ "borderColor": "#e8e9ea",
558
+ "borderRightWidth": 1,
559
+ "flex": 1,
560
+ "flexDirection": "row",
561
+ "paddingVertical": 12,
562
+ },
563
+ undefined,
564
+ ]
565
+ }
566
+ >
567
+ <View
568
+ style={
569
+ Array [
570
+ Object {
571
+ "flex": 1,
572
+ "paddingHorizontal": 12,
573
+ },
574
+ undefined,
575
+ ]
576
+ }
577
+ >
578
+ <Text
579
+ style={
580
+ Array [
581
+ Object {
582
+ "color": "#ffffff",
583
+ "fontFamily": "BeVietnamPro-Regular",
584
+ "fontSize": 14,
585
+ "letterSpacing": 0.42,
586
+ "lineHeight": 22,
587
+ },
588
+ undefined,
589
+ ]
590
+ }
591
+ themeFontSize="medium"
592
+ themeFontWeight="regular"
593
+ themeIntent="inverted"
594
+ >
595
+ Toast Content
596
+ </Text>
597
+ </View>
598
+ </View>
599
+ <View
600
+ accessible={true}
601
+ collapsable={false}
602
+ focusable={true}
603
+ nativeID="animatedComponent"
604
+ onClick={[Function]}
605
+ onResponderGrant={[Function]}
606
+ onResponderMove={[Function]}
607
+ onResponderRelease={[Function]}
608
+ onResponderTerminate={[Function]}
609
+ onResponderTerminationRequest={[Function]}
610
+ onStartShouldSetResponder={[Function]}
611
+ style={
612
+ Object {
613
+ "justifyContent": "center",
614
+ "opacity": 1,
615
+ "paddingHorizontal": 12,
616
+ }
617
+ }
618
+ testID="toast-action-button"
619
+ >
620
+ <Text
621
+ style={
622
+ Array [
623
+ Object {
624
+ "color": "#ffffff",
625
+ "fontFamily": "BeVietnamPro-SemiBold",
626
+ "fontSize": 14,
627
+ "letterSpacing": 0.42,
628
+ "lineHeight": 22,
629
+ },
630
+ undefined,
631
+ ]
632
+ }
633
+ themeFontSize="medium"
634
+ themeFontWeight="semi-bold"
635
+ themeIntent="inverted"
636
+ >
637
+ Action
638
+ </Text>
639
+ </View>
640
+ </View>
641
+ `;
642
+
379
643
  exports[`Toast renders correctly when intent is success 1`] = `
380
644
  <View
381
645
  collapsable={false}
@@ -384,9 +648,17 @@ exports[`Toast renders correctly when intent is success 1`] = `
384
648
  Object {
385
649
  "backgroundColor": "#5ace7d",
386
650
  "borderRadius": 0,
651
+ "elevation": 4,
387
652
  "flexDirection": "row",
388
653
  "minHeight": 48,
389
654
  "opacity": 0,
655
+ "shadowColor": "#001f23",
656
+ "shadowOffset": Object {
657
+ "height": 2,
658
+ "width": 0,
659
+ },
660
+ "shadowOpacity": 0.12,
661
+ "shadowRadius": 4,
390
662
  "transform": Array [
391
663
  Object {
392
664
  "translateY": 20,
@@ -406,7 +678,7 @@ exports[`Toast renders correctly when intent is success 1`] = `
406
678
  "borderRightWidth": 1,
407
679
  "flex": 1,
408
680
  "flexDirection": "row",
409
- "paddingVertical": 16,
681
+ "paddingVertical": 12,
410
682
  },
411
683
  undefined,
412
684
  ]
@@ -417,7 +689,7 @@ exports[`Toast renders correctly when intent is success 1`] = `
417
689
  Array [
418
690
  Object {
419
691
  "alignItems": "center",
420
- "paddingLeft": 16,
692
+ "paddingLeft": 12,
421
693
  },
422
694
  undefined,
423
695
  ]
@@ -444,7 +716,7 @@ exports[`Toast renders correctly when intent is success 1`] = `
444
716
  Array [
445
717
  Object {
446
718
  "flex": 1,
447
- "paddingHorizontal": 16,
719
+ "paddingHorizontal": 12,
448
720
  },
449
721
  undefined,
450
722
  ]
@@ -487,7 +759,7 @@ exports[`Toast renders correctly when intent is success 1`] = `
487
759
  Object {
488
760
  "justifyContent": "center",
489
761
  "opacity": 1,
490
- "paddingHorizontal": 16,
762
+ "paddingHorizontal": 12,
491
763
  }
492
764
  }
493
765
  testID="toast-action-button"
@@ -523,9 +795,17 @@ exports[`Toast renders correctly when intent is warning 1`] = `
523
795
  Object {
524
796
  "backgroundColor": "#ffbe71",
525
797
  "borderRadius": 0,
798
+ "elevation": 4,
526
799
  "flexDirection": "row",
527
800
  "minHeight": 48,
528
801
  "opacity": 0,
802
+ "shadowColor": "#001f23",
803
+ "shadowOffset": Object {
804
+ "height": 2,
805
+ "width": 0,
806
+ },
807
+ "shadowOpacity": 0.12,
808
+ "shadowRadius": 4,
529
809
  "transform": Array [
530
810
  Object {
531
811
  "translateY": 20,
@@ -545,7 +825,7 @@ exports[`Toast renders correctly when intent is warning 1`] = `
545
825
  "borderRightWidth": 1,
546
826
  "flex": 1,
547
827
  "flexDirection": "row",
548
- "paddingVertical": 16,
828
+ "paddingVertical": 12,
549
829
  },
550
830
  undefined,
551
831
  ]
@@ -556,7 +836,7 @@ exports[`Toast renders correctly when intent is warning 1`] = `
556
836
  Array [
557
837
  Object {
558
838
  "alignItems": "center",
559
- "paddingLeft": 16,
839
+ "paddingLeft": 12,
560
840
  },
561
841
  undefined,
562
842
  ]
@@ -583,7 +863,7 @@ exports[`Toast renders correctly when intent is warning 1`] = `
583
863
  Array [
584
864
  Object {
585
865
  "flex": 1,
586
- "paddingHorizontal": 16,
866
+ "paddingHorizontal": 12,
587
867
  },
588
868
  undefined,
589
869
  ]
@@ -626,7 +906,7 @@ exports[`Toast renders correctly when intent is warning 1`] = `
626
906
  Object {
627
907
  "justifyContent": "center",
628
908
  "opacity": 1,
629
- "paddingHorizontal": 16,
909
+ "paddingHorizontal": 12,
630
910
  }
631
911
  }
632
912
  testID="toast-action-button"
@@ -2,6 +2,14 @@ import type { ReactElement } from 'react';
2
2
  import type { StyleProp, ViewStyle } from 'react-native';
3
3
  import type { IconName } from '../Icon';
4
4
 
5
+ export type IntentType =
6
+ | 'success'
7
+ | 'info'
8
+ | 'warning'
9
+ | 'error'
10
+ | 'notification'
11
+ | 'snackbar';
12
+
5
13
  export interface ToastProps {
6
14
  /**
7
15
  * Toast content.
@@ -17,7 +25,13 @@ export interface ToastProps {
17
25
  /**
18
26
  * Visual intent color to apply to alert.
19
27
  */
20
- intent?: 'success' | 'info' | 'warning' | 'error';
28
+ intent?:
29
+ | 'success'
30
+ | 'info'
31
+ | 'warning'
32
+ | 'error'
33
+ | 'notification'
34
+ | 'snackbar';
21
35
  /**
22
36
  * Toast variants
23
37
  */
@@ -8,7 +8,13 @@ const FONTWEIGHT_MAP = {
8
8
  } as const;
9
9
 
10
10
  const StyledText = styled(Text)<{
11
- themeFontSize: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxxxlarge';
11
+ themeFontSize:
12
+ | 'small'
13
+ | 'medium'
14
+ | 'large'
15
+ | 'xlarge'
16
+ | 'xxxlarge'
17
+ | 'xxxxxlarge';
12
18
  themeFontWeight: 'light' | 'regular' | 'semi-bold';
13
19
  themeIntent:
14
20
  | 'body'
@@ -9,6 +9,7 @@ describe('StyledText', () => {
9
9
  ${'medium'}
10
10
  ${'large'}
11
11
  ${'xlarge'}
12
+ ${'xxxlarge'}
12
13
  ${'xxxxxlarge'}
13
14
  `('has $fontSize fontSize style', ({ fontSize }) => {
14
15
  const { toJSON } = renderWithTheme(
@@ -330,6 +330,28 @@ exports[`StyledText has xlarge fontSize style 1`] = `
330
330
  </Text>
331
331
  `;
332
332
 
333
+ exports[`StyledText has xxxlarge fontSize style 1`] = `
334
+ <Text
335
+ style={
336
+ Array [
337
+ Object {
338
+ "color": "#001f23",
339
+ "fontFamily": "BeVietnamPro-Regular",
340
+ "fontSize": 24,
341
+ "letterSpacing": 0.72,
342
+ "lineHeight": 32,
343
+ },
344
+ undefined,
345
+ ]
346
+ }
347
+ themeFontSize="xxxlarge"
348
+ themeFontWeight="regular"
349
+ themeIntent="body"
350
+ >
351
+ This is a test
352
+ </Text>
353
+ `;
354
+
333
355
  exports[`StyledText has xxxxxlarge fontSize style 1`] = `
334
356
  <Text
335
357
  style={
@@ -15,7 +15,13 @@ export interface TextProps extends NativeTextProps {
15
15
  /**
16
16
  * Size of the text.
17
17
  */
18
- fontSize?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxxxlarge';
18
+ fontSize?:
19
+ | 'small'
20
+ | 'medium'
21
+ | 'large'
22
+ | 'xlarge'
23
+ | 'xxxlarge'
24
+ | 'xxxxxlarge';
19
25
  /**
20
26
  * Font weight of the text.
21
27
  */
package/src/index.ts CHANGED
@@ -13,6 +13,7 @@ import Avatar from './components/Avatar';
13
13
  import Badge from './components/Badge';
14
14
  import BottomNavigation from './components/BottomNavigation';
15
15
  import BottomSheet from './components/BottomSheet';
16
+ import Box from './components/Box';
16
17
  import Button from './components/Button';
17
18
  import Calendar from './components/Calendar';
18
19
  import Card from './components/Card';
@@ -56,6 +57,7 @@ export {
56
57
  Badge,
57
58
  BottomNavigation,
58
59
  BottomSheet,
60
+ Box,
59
61
  Button,
60
62
  Calendar,
61
63
  Card,