@hero-design/rn 7.7.0 → 7.9.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 (221) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/es/index.js +1775 -333
  3. package/lib/index.js +1780 -336
  4. package/package.json +4 -8
  5. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  6. package/src/components/Avatar/index.tsx +1 -1
  7. package/src/components/Button/Button.tsx +4 -2
  8. package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +7 -2
  9. package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +2 -0
  10. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +40 -0
  11. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +242 -0
  12. package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +2 -0
  13. package/src/components/Button/LoadingIndicator/index.tsx +3 -1
  14. package/src/components/Button/StyledButton.tsx +15 -2
  15. package/src/components/Button/__tests__/Button.spec.tsx +2 -0
  16. package/src/components/Button/__tests__/StyledButton.spec.tsx +12 -0
  17. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +314 -0
  18. package/src/components/Card/DataCard/StyledDataCard.tsx +18 -0
  19. package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +24 -0
  20. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +96 -0
  21. package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +151 -0
  22. package/src/components/Card/DataCard/__tests__/index.spec.tsx +30 -0
  23. package/src/components/Card/DataCard/index.tsx +35 -0
  24. package/src/components/Card/StyledCard.tsx +1 -3
  25. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -1
  26. package/src/components/Card/index.tsx +7 -2
  27. package/src/components/Checkbox/index.tsx +1 -1
  28. package/src/components/Collapse/index.tsx +1 -1
  29. package/src/components/Icon/HeroIcon/index.tsx +3 -1
  30. package/src/components/Icon/index.tsx +3 -2
  31. package/src/components/List/BasicListItem.tsx +98 -0
  32. package/src/components/List/ListItem.tsx +142 -0
  33. package/src/components/List/StyledBasicListItem.tsx +34 -0
  34. package/src/components/List/StyledListItem.tsx +82 -0
  35. package/src/components/List/__tests__/BasicListItem.spec.tsx +37 -0
  36. package/src/components/List/__tests__/ListItem.spec.tsx +110 -0
  37. package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +24 -0
  38. package/src/components/List/__tests__/StyledListItem.spec.tsx +48 -0
  39. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +103 -0
  40. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +760 -0
  41. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +105 -0
  42. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +200 -0
  43. package/src/components/List/index.tsx +14 -0
  44. package/src/components/SectionHeading/index.tsx +1 -1
  45. package/src/components/Select/Footer.tsx +13 -0
  46. package/src/components/Select/MultiSelect/Option.tsx +25 -0
  47. package/src/components/Select/MultiSelect/OptionList.tsx +30 -63
  48. package/src/components/Select/MultiSelect/__tests__/Option.spec.tsx +16 -0
  49. package/src/components/Select/MultiSelect/__tests__/OptionList.spec.tsx +42 -0
  50. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +70 -0
  51. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +627 -0
  52. package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +6 -6
  53. package/src/components/Select/MultiSelect/index.tsx +8 -7
  54. package/src/components/Select/SingleSelect/Option.tsx +23 -0
  55. package/src/components/Select/SingleSelect/OptionList.tsx +43 -0
  56. package/src/components/Select/SingleSelect/__tests__/Option.spec.tsx +16 -0
  57. package/src/components/Select/SingleSelect/__tests__/OptionList.spec.tsx +42 -0
  58. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +56 -0
  59. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +571 -0
  60. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +1430 -0
  61. package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +89 -0
  62. package/src/components/Select/SingleSelect/index.tsx +89 -0
  63. package/src/components/Select/{MultiSelect/StyledMultiSelect.tsx → StyledSelect.tsx} +1 -1
  64. package/src/components/Select/{MultiSelect/__tests__/StyledMultiSelect.spec.tsx → __tests__/StyledSelect.spec.tsx} +2 -2
  65. package/src/components/Select/{MultiSelect/__tests__/__snapshots__/StyledMultiSelect.spec.tsx.snap → __tests__/__snapshots__/StyledSelect.spec.tsx.snap} +0 -0
  66. package/src/components/Select/helpers.tsx +18 -0
  67. package/src/components/Select/index.tsx +4 -3
  68. package/src/components/Select/{MultiSelect/types.ts → types.ts} +0 -0
  69. package/src/components/Switch/index.tsx +1 -1
  70. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +2 -2
  71. package/src/components/Toolbar/StyledToolbar.tsx +42 -0
  72. package/src/components/Toolbar/ToolbarGroup.tsx +31 -0
  73. package/src/components/Toolbar/ToolbarItem.tsx +57 -0
  74. package/src/components/Toolbar/__tests__/ToolbarGroup.spec.tsx +32 -0
  75. package/src/components/Toolbar/__tests__/ToolbarItem.spec.tsx +57 -0
  76. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +391 -0
  77. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +355 -0
  78. package/src/components/Toolbar/index.tsx +18 -0
  79. package/src/components/Typography/Text/StyledText.tsx +8 -1
  80. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +5 -0
  81. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +110 -0
  82. package/src/components/Typography/Text/index.tsx +9 -2
  83. package/src/index.ts +4 -0
  84. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +83 -3
  85. package/src/theme/components/button.ts +2 -0
  86. package/src/theme/components/card.ts +13 -2
  87. package/src/theme/components/icon.ts +1 -0
  88. package/src/theme/components/list.ts +46 -0
  89. package/src/theme/components/toolbar.ts +27 -0
  90. package/src/theme/components/typography.ts +4 -0
  91. package/src/theme/global/colors.ts +9 -2
  92. package/src/theme/global/space.ts +2 -0
  93. package/src/theme/index.ts +6 -0
  94. package/tsconfig.json +1 -2
  95. package/types/components/Avatar/index.d.ts +1 -1
  96. package/types/components/Button/Button.d.ts +2 -2
  97. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
  98. package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
  99. package/types/components/Button/StyledButton.d.ts +2 -2
  100. package/types/components/Card/DataCard/StyledDataCard.d.ts +16 -0
  101. package/types/components/{Select/MultiSelect/__tests__/StyledMultiSelect.spec.d.ts → Card/DataCard/__tests__/StyledDataCard.spec.d.ts} +0 -0
  102. package/types/components/Card/DataCard/__tests__/index.spec.d.ts +1 -0
  103. package/types/components/Card/DataCard/index.d.ts +22 -0
  104. package/types/components/Card/index.d.ts +7 -3
  105. package/types/components/Checkbox/index.d.ts +1 -1
  106. package/types/components/Collapse/index.d.ts +1 -1
  107. package/types/components/Icon/HeroIcon/index.d.ts +1 -1
  108. package/types/components/Icon/index.d.ts +2 -2
  109. package/types/components/List/BasicListItem.d.ts +43 -0
  110. package/types/components/List/ListItem.d.ts +51 -0
  111. package/types/components/List/StyledBasicListItem.d.ts +29 -0
  112. package/types/components/List/StyledListItem.d.ts +51 -0
  113. package/types/components/List/__tests__/BasicListItem.spec.d.ts +1 -0
  114. package/types/components/List/__tests__/ListItem.spec.d.ts +1 -0
  115. package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +1 -0
  116. package/types/components/List/__tests__/StyledListItem.spec.d.ts +1 -0
  117. package/types/components/List/index.d.ts +8 -0
  118. package/types/components/SectionHeading/index.d.ts +1 -1
  119. package/types/components/Select/{MultiSelect/Footer.d.ts → Footer.d.ts} +2 -2
  120. package/types/components/Select/MultiSelect/Option.d.ts +6 -0
  121. package/types/components/Select/MultiSelect/OptionList.d.ts +7 -1
  122. package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +1 -0
  123. package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +1 -0
  124. package/types/components/Select/MultiSelect/index.d.ts +4 -4
  125. package/types/components/Select/SingleSelect/Option.d.ts +6 -0
  126. package/types/components/Select/SingleSelect/OptionList.d.ts +9 -0
  127. package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +1 -0
  128. package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +1 -0
  129. package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +1 -0
  130. package/types/components/Select/SingleSelect/index.d.ts +35 -0
  131. package/types/components/Select/{MultiSelect/StyledMultiSelect.d.ts → StyledSelect.d.ts} +1 -1
  132. package/types/components/Select/__tests__/StyledSelect.spec.d.ts +1 -0
  133. package/types/components/Select/helpers.d.ts +2 -0
  134. package/types/components/Select/index.d.ts +3 -3
  135. package/types/components/Select/{MultiSelect/types.d.ts → types.d.ts} +0 -0
  136. package/types/components/Switch/index.d.ts +1 -1
  137. package/types/components/Toolbar/StyledToolbar.d.ts +22 -0
  138. package/types/components/Toolbar/ToolbarGroup.d.ts +13 -0
  139. package/types/components/Toolbar/ToolbarItem.d.ts +25 -0
  140. package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +1 -0
  141. package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +1 -0
  142. package/types/components/Toolbar/index.d.ts +11 -0
  143. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  144. package/types/components/Typography/Text/index.d.ts +2 -2
  145. package/types/index.d.ts +3 -1
  146. package/types/theme/components/button.d.ts +2 -0
  147. package/types/theme/components/card.d.ts +10 -0
  148. package/types/theme/components/icon.d.ts +1 -0
  149. package/types/theme/components/list.d.ts +40 -0
  150. package/types/theme/components/toolbar.d.ts +21 -0
  151. package/types/theme/components/typography.d.ts +4 -0
  152. package/types/theme/global/colors.d.ts +5 -0
  153. package/types/theme/global/index.d.ts +5 -0
  154. package/types/theme/global/space.d.ts +1 -0
  155. package/types/theme/index.d.ts +4 -0
  156. package/playground/.detoxrc.json +0 -49
  157. package/playground/.prettierrc.json +0 -8
  158. package/playground/.turbo/turbo-type-check.log +0 -7
  159. package/playground/app.json +0 -9
  160. package/playground/babel.config.js +0 -63
  161. package/playground/e2e/config.json +0 -9
  162. package/playground/e2e/environment.js +0 -23
  163. package/playground/e2e/firstTest.e2e.js +0 -16
  164. package/playground/expoEntry.js +0 -5
  165. package/playground/fonts/be-vietnam-pro-light.ttf +0 -0
  166. package/playground/fonts/be-vietnam-pro-regular.ttf +0 -0
  167. package/playground/fonts/be-vietnam-pro-semibold.ttf +0 -0
  168. package/playground/fonts/hero-icons.ttf +0 -0
  169. package/playground/index.js +0 -7
  170. package/playground/ios/MobileHeroDesignPlayground/AppDelegate.h +0 -9
  171. package/playground/ios/MobileHeroDesignPlayground/AppDelegate.m +0 -75
  172. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
  173. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/Contents.json +0 -6
  174. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/Contents.json +0 -21
  175. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
  176. package/playground/ios/MobileHeroDesignPlayground/Info.plist +0 -85
  177. package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground-Bridging-Header.h +0 -3
  178. package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground.entitlements +0 -8
  179. package/playground/ios/MobileHeroDesignPlayground/SplashScreen.storyboard +0 -40
  180. package/playground/ios/MobileHeroDesignPlayground/Supporting/Expo.plist +0 -16
  181. package/playground/ios/MobileHeroDesignPlayground/main.m +0 -10
  182. package/playground/ios/MobileHeroDesignPlayground/noop-file.swift +0 -4
  183. package/playground/ios/MobileHeroDesignPlayground.xcodeproj/project.pbxproj +0 -515
  184. package/playground/ios/MobileHeroDesignPlayground.xcodeproj/xcshareddata/xcschemes/MobileHeroDesignPlayground.xcscheme +0 -88
  185. package/playground/ios/MobileHeroDesignPlayground.xcworkspace/contents.xcworkspacedata +0 -10
  186. package/playground/ios/MobileHeroDesignPlayground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  187. package/playground/ios/Podfile +0 -49
  188. package/playground/ios/Podfile.lock +0 -478
  189. package/playground/ios/Podfile.properties.json +0 -3
  190. package/playground/metro.config.js +0 -24
  191. package/playground/package.json +0 -63
  192. package/playground/src/Alert.tsx +0 -80
  193. package/playground/src/App.tsx +0 -210
  194. package/playground/src/Avatar.tsx +0 -102
  195. package/playground/src/Badge.tsx +0 -187
  196. package/playground/src/BottomNavigation.tsx +0 -72
  197. package/playground/src/BottomSheet.tsx +0 -43
  198. package/playground/src/Button.tsx +0 -170
  199. package/playground/src/Card.tsx +0 -342
  200. package/playground/src/Checkbox.tsx +0 -55
  201. package/playground/src/Collapse.tsx +0 -99
  202. package/playground/src/ContentNavigator.tsx +0 -58
  203. package/playground/src/Divider.tsx +0 -13
  204. package/playground/src/Drawer.tsx +0 -32
  205. package/playground/src/FAB.tsx +0 -66
  206. package/playground/src/Icon.tsx +0 -144
  207. package/playground/src/IconButton.tsx +0 -78
  208. package/playground/src/MultipleThemes.tsx +0 -34
  209. package/playground/src/Progress.tsx +0 -95
  210. package/playground/src/Radio.tsx +0 -25
  211. package/playground/src/SectionHeading.tsx +0 -68
  212. package/playground/src/Select.tsx +0 -32
  213. package/playground/src/Spinner.tsx +0 -19
  214. package/playground/src/Switch.tsx +0 -80
  215. package/playground/src/Tabs.tsx +0 -136
  216. package/playground/src/Tag.tsx +0 -45
  217. package/playground/src/TextInput.tsx +0 -14
  218. package/playground/src/Toast.tsx +0 -114
  219. package/playground/src/Typography.tsx +0 -23
  220. package/playground/tsconfig.json +0 -21
  221. package/src/components/Select/MultiSelect/Footer.tsx +0 -15
@@ -10,7 +10,7 @@ Object {
10
10
  "colors": Object {
11
11
  "divider": "#fafbfb",
12
12
  "error": "#de350b",
13
- "info": "#1dbeee",
13
+ "info": "#b5c3fd",
14
14
  "success": "#01b39c",
15
15
  "warning": "#ffa234",
16
16
  },
@@ -134,11 +134,13 @@ Object {
134
134
  "default": 2,
135
135
  },
136
136
  "colors": Object {
137
+ "danger": "#de350b",
137
138
  "defaultText": "#292a2b",
138
139
  "disabledBackground": "#ccced1",
139
140
  "disabledBorder": "#ccced1",
140
141
  "disabledText": "#ccced1",
141
142
  "invertedText": "#ffffff",
143
+ "pressedDanger": "#f2ae9d",
142
144
  "pressedPrimary": "#c8a7ef",
143
145
  "pressedSecondary": "#d1d9fe",
144
146
  "primary": "#7622d7",
@@ -167,10 +169,20 @@ Object {
167
169
  "card": Object {
168
170
  "colors": Object {
169
171
  "dataCardIndicator": "#a26fb0",
172
+ "indicator": Object {
173
+ "archived": "#bfc1c5",
174
+ "danger": "#e3602a",
175
+ "info": "#b5c3fd",
176
+ "success": "#5ace7d",
177
+ "warning": "#ffbe71",
178
+ },
170
179
  },
171
180
  "radii": Object {
172
181
  "default": 12,
173
182
  },
183
+ "sizes": Object {
184
+ "indicatorWidth": 16,
185
+ },
174
186
  },
175
187
  "checkbox": Object {
176
188
  "borderWidths": Object {
@@ -284,6 +296,7 @@ Object {
284
296
  "danger": "#de350b",
285
297
  "disabledText": "#8b8d92",
286
298
  "info": "#4568fb",
299
+ "invertedText": "#ffffff",
287
300
  "primary": "#7622d7",
288
301
  "success": "#01b39c",
289
302
  "text": "#292a2b",
@@ -297,6 +310,44 @@ Object {
297
310
  "xsmall": 16,
298
311
  },
299
312
  },
313
+ "list": Object {
314
+ "colors": Object {
315
+ "checkedListItemContainerBackground": "#f1e9fb",
316
+ "leadingStatus": Object {
317
+ "archived": "#ccced1",
318
+ "danger": "#de350b",
319
+ "info": "#d1d9fe",
320
+ "success": "#017d6d",
321
+ "warning": "#ffbe71",
322
+ },
323
+ "listItemContainerBackground": "#ffffff",
324
+ },
325
+ "offsets": Object {
326
+ "cardShadow": Object {
327
+ "height": 2,
328
+ "width": 0,
329
+ },
330
+ },
331
+ "opacity": Object {
332
+ "cardShadow": 1,
333
+ "disabled": 0.38,
334
+ "enabled": 1,
335
+ },
336
+ "radii": Object {
337
+ "card": 8,
338
+ "cardShadow": 4,
339
+ "leadingStatus": 999,
340
+ },
341
+ "space": Object {
342
+ "leadingStatusMarginRight": 8,
343
+ "listItemContainerPadding": 16,
344
+ "prefixContainerMarginRight": 8,
345
+ "suffixContainerMarginLeft": 8,
346
+ },
347
+ "widths": Object {
348
+ "leadingStatus": 8,
349
+ },
350
+ },
300
351
  "progress": Object {
301
352
  "colors": Object {
302
353
  "background": "#dadbde",
@@ -490,7 +541,7 @@ Object {
490
541
  "colors": Object {
491
542
  "divider": "#fafbfb",
492
543
  "error": "#de350b",
493
- "info": "#1dbeee",
544
+ "info": "#b5c3fd",
494
545
  "success": "#01b39c",
495
546
  "warning": "#ffa234",
496
547
  },
@@ -505,11 +556,34 @@ Object {
505
556
  "mediumPadding": 16,
506
557
  },
507
558
  },
559
+ "toolbar": Object {
560
+ "borderWidths": Object {
561
+ "default": 1,
562
+ },
563
+ "colors": Object {
564
+ "background": "#ffffff",
565
+ "border": "#dadbde",
566
+ "danger": "#ffa234",
567
+ "disabled": "#8b8d92",
568
+ "error": "#de350b",
569
+ "info": "#4568fb",
570
+ "primary": "#7622d7",
571
+ "success": "#01b39c",
572
+ },
573
+ "space": Object {
574
+ "horizontalPadding": 12,
575
+ "verticalPadding": 8,
576
+ },
577
+ },
508
578
  "typography": Object {
509
579
  "colors": Object {
510
580
  "body": "#292a2b",
581
+ "danger": "#de350b",
582
+ "info": "#4568fb",
511
583
  "primary": "#7622d7",
512
584
  "subdued": "#8b8d92",
585
+ "success": "#01b39c",
586
+ "warning": "#ffa234",
513
587
  },
514
588
  "fontSizes": Object {
515
589
  "large": 16,
@@ -536,19 +610,21 @@ Object {
536
610
  },
537
611
  "colors": Object {
538
612
  "archived": "#ccced1",
613
+ "archivedDark": "#bfc1c5",
539
614
  "backgroundDark": "#292a2b",
540
615
  "backgroundLight": "#fafbfb",
541
616
  "black": "#000000",
542
617
  "danger": "#de350b",
543
618
  "dangerBackground": "#fcebe7",
544
619
  "dangerLight": "#f2ae9d",
620
+ "dangerMediumLight": "#e3602a",
545
621
  "disabledLightText": "#ccced1",
546
622
  "disabledText": "#8b8d92",
547
623
  "inactiveBackground": "#727478",
548
624
  "info": "#4568fb",
549
625
  "infoBackground": "#ecf0ff",
550
626
  "infoLight": "#d1d9fe",
551
- "infoMediumLight": "#1dbeee",
627
+ "infoMediumLight": "#b5c3fd",
552
628
  "invertedText": "#ffffff",
553
629
  "outline": "#dadbde",
554
630
  "platformBackground": "#ffffff",
@@ -558,13 +634,16 @@ Object {
558
634
  "primaryLight": "#c8a7ef",
559
635
  "secondary": "#4568fb",
560
636
  "secondaryLight": "#d1d9fe",
637
+ "shadow": "#dadbde",
561
638
  "success": "#01b39c",
562
639
  "successBackground": "#f0fef4",
563
640
  "successDark": "#017d6d",
641
+ "successLight": "#5ace7d",
564
642
  "text": "#292a2b",
565
643
  "warning": "#ffa234",
566
644
  "warningBackground": "#fff6eb",
567
645
  "warningDark": "#d98a2c",
646
+ "warningLight": "#ffbe71",
568
647
  },
569
648
  "fontSizes": Object {
570
649
  "large": 16,
@@ -604,6 +683,7 @@ Object {
604
683
  "large": 24,
605
684
  "medium": 16,
606
685
  "small": 8,
686
+ "smallMedium": 12,
607
687
  "xlarge": 32,
608
688
  "xsmall": 4,
609
689
  "xxlarge": 40,
@@ -35,6 +35,8 @@ const getButtonTheme = (theme: GlobalTheme) => {
35
35
  pressedPrimary: theme.colors.primaryLight,
36
36
  secondary: theme.colors.secondary,
37
37
  pressedSecondary: theme.colors.secondaryLight,
38
+ danger: theme.colors.danger,
39
+ pressedDanger: theme.colors.dangerLight,
38
40
  defaultText: theme.colors.text,
39
41
  disabledText: theme.colors.disabledLightText,
40
42
  disabledBorder: theme.colors.disabledLightText,
@@ -3,13 +3,24 @@ import { GlobalTheme } from '../global';
3
3
  const getCardTheme = (theme: GlobalTheme) => {
4
4
  const colors = {
5
5
  dataCardIndicator: theme.colors.primaryDark,
6
+ indicator: {
7
+ archived: theme.colors.archivedDark,
8
+ info: theme.colors.infoMediumLight,
9
+ success: theme.colors.successLight,
10
+ warning: theme.colors.warningLight,
11
+ danger: theme.colors.dangerMediumLight,
12
+ },
13
+ };
14
+
15
+ const sizes = {
16
+ indicatorWidth: theme.space.medium,
6
17
  };
7
18
 
8
19
  const radii = {
9
- default: 12,
20
+ default: theme.radii.large,
10
21
  };
11
22
 
12
- return { colors, radii };
23
+ return { colors, sizes, radii };
13
24
  };
14
25
 
15
26
  export default getCardTheme;
@@ -9,6 +9,7 @@ const getIconTheme = (theme: GlobalTheme) => {
9
9
  success: theme.colors.success,
10
10
  warning: theme.colors.warning,
11
11
  disabledText: theme.colors.disabledText,
12
+ invertedText: theme.colors.invertedText,
12
13
  };
13
14
 
14
15
  const sizes = {
@@ -0,0 +1,46 @@
1
+ import { GlobalTheme } from '../global';
2
+
3
+ const getListTheme = (theme: GlobalTheme) => {
4
+ const colors = {
5
+ checkedListItemContainerBackground: theme.colors.primaryBackground,
6
+ listItemContainerBackground: theme.colors.platformBackground,
7
+ leadingStatus: {
8
+ danger: theme.colors.danger,
9
+ info: theme.colors.infoLight,
10
+ success: theme.colors.successDark,
11
+ warning: theme.colors.warningLight,
12
+ archived: theme.colors.archived,
13
+ },
14
+ };
15
+
16
+ const space = {
17
+ listItemContainerPadding: theme.space.medium,
18
+ leadingStatusMarginRight: theme.space.small,
19
+ prefixContainerMarginRight: theme.space.small,
20
+ suffixContainerMarginLeft: theme.space.small,
21
+ };
22
+
23
+ const radii = {
24
+ card: theme.radii.medium,
25
+ cardShadow: theme.radii.base,
26
+ leadingStatus: theme.radii.rounded,
27
+ };
28
+
29
+ const offsets = {
30
+ cardShadow: { width: 0, height: 2 },
31
+ };
32
+
33
+ const widths = {
34
+ leadingStatus: 8,
35
+ };
36
+
37
+ const opacity = {
38
+ disabled: 0.38,
39
+ enabled: 1,
40
+ cardShadow: 1,
41
+ };
42
+
43
+ return { colors, space, radii, offsets, widths, opacity };
44
+ };
45
+
46
+ export default getListTheme;
@@ -0,0 +1,27 @@
1
+ import { GlobalTheme } from '../global';
2
+
3
+ const getToolbarTheme = (theme: GlobalTheme) => {
4
+ const colors = {
5
+ background: theme.colors.platformBackground,
6
+ border: theme.colors.outline,
7
+ primary: theme.colors.primary,
8
+ info: theme.colors.info,
9
+ success: theme.colors.success,
10
+ danger: theme.colors.warning,
11
+ error: theme.colors.danger,
12
+ disabled: theme.colors.disabledText,
13
+ };
14
+
15
+ const space = {
16
+ verticalPadding: theme.space.small,
17
+ horizontalPadding: theme.space.smallMedium,
18
+ };
19
+
20
+ const borderWidths = {
21
+ default: theme.borderWidths.base,
22
+ };
23
+
24
+ return { colors, space, borderWidths };
25
+ };
26
+
27
+ export default getToolbarTheme;
@@ -5,6 +5,10 @@ const getTypographyTheme = (theme: GlobalTheme) => {
5
5
  body: theme.colors.text,
6
6
  subdued: theme.colors.disabledText,
7
7
  primary: theme.colors.primary,
8
+ info: theme.colors.info,
9
+ danger: theme.colors.danger,
10
+ warning: theme.colors.warning,
11
+ success: theme.colors.success,
8
12
  };
9
13
 
10
14
  const fonts = {
@@ -1,4 +1,6 @@
1
- import palette from '@hero-design/colors';
1
+ import palette, {
2
+ defaultMobilePalette as mobilePalette,
3
+ } from '@hero-design/colors';
2
4
 
3
5
  const systemPalette = {
4
6
  primary: palette.violet,
@@ -8,16 +10,19 @@ const systemPalette = {
8
10
  secondary: palette.dodgerBlue,
9
11
  secondaryLight: palette.dodgerBlueLight75,
10
12
  info: palette.dodgerBlue,
11
- infoMediumLight: palette.blue,
13
+ infoMediumLight: mobilePalette.vodka,
12
14
  infoLight: palette.dodgerBlueLight75,
13
15
  infoBackground: palette.dodgerBlueLight90,
14
16
  success: palette.green,
17
+ successLight: mobilePalette.emerald,
15
18
  successDark: palette.greenDark30,
16
19
  successBackground: palette.grotesqueGreenLight90,
17
20
  danger: palette.red,
21
+ dangerMediumLight: mobilePalette.apple,
18
22
  dangerLight: palette.redLight60,
19
23
  dangerBackground: palette.redLight90,
20
24
  warning: palette.orange,
25
+ warningLight: mobilePalette.mellowApricot,
21
26
  warningDark: palette.orangeDark15,
22
27
  warningBackground: palette.orangeLight90,
23
28
  platformBackground: palette.white,
@@ -28,9 +33,11 @@ const systemPalette = {
28
33
  disabledLightText: palette.greyLight45,
29
34
  invertedText: palette.white,
30
35
  outline: palette.greyLight60,
36
+ archivedDark: mobilePalette.greyLight30,
31
37
  archived: palette.greyLight45,
32
38
  black: palette.black,
33
39
  inactiveBackground: palette.greyDark30,
40
+ shadow: palette.greyLight60,
34
41
  };
35
42
 
36
43
  type SystemPalette = typeof systemPalette;
@@ -4,6 +4,7 @@ interface Space {
4
4
  large: number;
5
5
  medium: number;
6
6
  small: number;
7
+ smallMedium: number;
7
8
  xlarge: number;
8
9
  xsmall: number;
9
10
  xxlarge: number;
@@ -16,6 +17,7 @@ const getSpace = (baseSpace: number): Space => ({
16
17
  xxsmall: scale(baseSpace * 0.25),
17
18
  xsmall: scale(baseSpace * 0.5),
18
19
  small: scale(baseSpace),
20
+ smallMedium: scale(baseSpace) * 1.5,
19
21
  medium: scale(baseSpace * 2),
20
22
  large: scale(baseSpace * 3),
21
23
  xlarge: scale(baseSpace * 4),
@@ -32,7 +32,9 @@ import getTabsTheme from './components/tabs';
32
32
  import getTagTheme from './components/tag';
33
33
  import getTextInputTheme from './components/textInput';
34
34
  import getToastTheme from './components/toast';
35
+ import getToolbarTheme from './components/toolbar';
35
36
  import getTypographyTheme from './components/typography';
37
+ import getListTheme from './components/list';
36
38
 
37
39
  type Theme = GlobalTheme & {
38
40
  __hd__: {
@@ -59,7 +61,9 @@ type Theme = GlobalTheme & {
59
61
  tag: ReturnType<typeof getTagTheme>;
60
62
  textInput: ReturnType<typeof getTextInputTheme>;
61
63
  toast: ReturnType<typeof getToastTheme>;
64
+ toolbar: ReturnType<typeof getToolbarTheme>;
62
65
  typography: ReturnType<typeof getTypographyTheme>;
66
+ list: ReturnType<typeof getListTheme>;
63
67
  };
64
68
  };
65
69
 
@@ -94,7 +98,9 @@ const getTheme = (
94
98
  tag: getTagTheme(globalTheme),
95
99
  textInput: getTextInputTheme(globalTheme),
96
100
  toast: getToastTheme(globalTheme),
101
+ toolbar: getToolbarTheme(globalTheme),
97
102
  typography: getTypographyTheme(globalTheme),
103
+ list: getListTheme(globalTheme),
98
104
  },
99
105
  };
100
106
  };
package/tsconfig.json CHANGED
@@ -21,8 +21,7 @@
21
21
  "src"
22
22
  ],
23
23
  "exclude": [
24
- "node_modules",
25
- "playground"
24
+ "node_modules"
26
25
  ],
27
26
  "extends": "expo/tsconfig.base"
28
27
  }
@@ -13,7 +13,7 @@ interface AvatarProps extends ViewProps {
13
13
  /** Size of the avatar. */
14
14
  size?: 'small' | 'medium' | 'large' | 'xlarge';
15
15
  /**
16
- * Addditional style.
16
+ * Additional style.
17
17
  */
18
18
  style?: StyleProp<ViewStyle>;
19
19
  /**
@@ -22,7 +22,7 @@ export interface ButtonProps {
22
22
  /**
23
23
  * Visual intent color to apply to button. It is required for `filled`, `outlined` and `text` variants.
24
24
  */
25
- intent?: 'primary' | 'secondary';
25
+ intent?: 'primary' | 'secondary' | 'danger';
26
26
  /**
27
27
  * Loading state of button.
28
28
  */
@@ -36,7 +36,7 @@ export interface ButtonProps {
36
36
  */
37
37
  rightIcon?: IconName;
38
38
  /**
39
- * Addditional style.
39
+ * Additional style.
40
40
  */
41
41
  style?: StyleProp<ViewStyle>;
42
42
  /**
@@ -1,6 +1,6 @@
1
1
  import { View, ViewProps } from 'react-native';
2
2
  import { Theme } from '@emotion/react';
3
- declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'outlined-primary' | 'outlined-secondary';
3
+ declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger';
4
4
  declare const StyledLoadingIndicatorWrapper: import("@emotion/native").StyledComponent<ViewProps & {
5
5
  theme?: Theme | undefined;
6
6
  as?: import("react").ElementType<any> | undefined;
@@ -1,5 +1,5 @@
1
1
  import { StyleProp, ViewStyle, ViewProps } from 'react-native';
2
- declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'outlined-primary' | 'outlined-secondary';
2
+ declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger';
3
3
  interface LoadingIndicatorProps extends ViewProps {
4
4
  /**
5
5
  * Size of the loading dot.
@@ -1,7 +1,7 @@
1
1
  import { View } from 'react-native';
2
2
  import { Theme } from '@emotion/react';
3
- declare type Intent = 'primary' | 'secondary';
4
- declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'outlined-primary' | 'outlined-secondary';
3
+ declare type Intent = 'primary' | 'secondary' | 'danger';
4
+ declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger';
5
5
  declare const StyledButtonContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
6
6
  theme?: Theme | undefined;
7
7
  as?: import("react").ElementType<any> | undefined;
@@ -0,0 +1,16 @@
1
+ import { View } from 'react-native';
2
+ declare const StyledDataCard: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, {}, {
6
+ ref?: import("react").Ref<View> | undefined;
7
+ }>;
8
+ declare const Indicator: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
9
+ theme?: import("@emotion/react").Theme | undefined;
10
+ as?: import("react").ElementType<any> | undefined;
11
+ } & {
12
+ themeIntent: 'success' | 'info' | 'warning' | 'danger' | 'archived';
13
+ }, {}, {
14
+ ref?: import("react").Ref<View> | undefined;
15
+ }>;
16
+ export { StyledDataCard, Indicator };
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle, ViewProps } from 'react-native';
3
+ export interface DataCardProps extends ViewProps {
4
+ /**
5
+ * Card's content.
6
+ */
7
+ children?: ReactNode;
8
+ /**
9
+ * Visual intent color to apply to card.
10
+ */
11
+ intent?: 'success' | 'info' | 'warning' | 'danger' | 'archived';
12
+ /**
13
+ * Additional style.
14
+ */
15
+ style?: StyleProp<ViewStyle>;
16
+ /**
17
+ * Testing id of the component.
18
+ */
19
+ testID?: string;
20
+ }
21
+ declare const DataCard: ({ intent, children, ...nativeProps }: DataCardProps) => JSX.Element;
22
+ export default DataCard;
@@ -7,10 +7,12 @@ interface CardProps extends ViewProps {
7
7
  children?: ReactNode;
8
8
  /**
9
9
  * Card type.
10
+ * This is now deprecated. If you want to use "data" variant, please use Card.Data instead.
11
+ * @deprecated
10
12
  */
11
13
  variant?: 'basic' | 'data';
12
14
  /**
13
- * Addditional style.
15
+ * Additional style.
14
16
  */
15
17
  style?: StyleProp<ViewStyle>;
16
18
  /**
@@ -18,5 +20,7 @@ interface CardProps extends ViewProps {
18
20
  */
19
21
  testID?: string;
20
22
  }
21
- declare const Card: ({ variant, children, ...nativeProps }: CardProps) => JSX.Element;
22
- export default Card;
23
+ declare const _default: (({ variant, children, ...nativeProps }: CardProps) => JSX.Element) & {
24
+ Data: ({ intent, children, ...nativeProps }: import("./DataCard").DataCardProps) => JSX.Element;
25
+ };
26
+ export default _default;
@@ -13,7 +13,7 @@ export interface CheckboxProps {
13
13
  */
14
14
  onPress?: () => void;
15
15
  /**
16
- * Addditional style.
16
+ * Additional style.
17
17
  */
18
18
  style?: StyleProp<ViewStyle>;
19
19
  /**
@@ -7,7 +7,7 @@ interface CollapseProps extends ViewProps {
7
7
  */
8
8
  open?: boolean;
9
9
  /**
10
- * Addditional style.
10
+ * Additional style.
11
11
  */
12
12
  style?: StyleProp<ViewStyle>;
13
13
  /**
@@ -1,5 +1,5 @@
1
1
  declare type ThemeSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
2
- declare type ThemeIntent = 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning' | 'disabled-text';
2
+ declare type ThemeIntent = 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning' | 'disabled-text' | 'text-inverted';
3
3
  declare const StyledHeroIcon: import("@emotion/native").StyledComponent<import("react-native-vector-icons/Icon").IconProps & {
4
4
  theme?: import("@emotion/react").Theme | undefined;
5
5
  as?: import("react").ElementType<any> | undefined;
@@ -9,13 +9,13 @@ export interface IconProps {
9
9
  /**
10
10
  * Intent of the Icon.
11
11
  */
12
- intent?: 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning' | 'disabled-text';
12
+ intent?: 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning' | 'disabled-text' | 'text-inverted';
13
13
  /**
14
14
  * Size of the Icon.
15
15
  */
16
16
  size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
17
17
  /**
18
- * Addditional style.
18
+ * Additional style.
19
19
  */
20
20
  style?: StyleProp<TextStyle>;
21
21
  /**
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { IconName } from '../Icon';
4
+ export interface ListItemProps {
5
+ /**
6
+ * Name of Icon or component to render on the left side of title.
7
+ */
8
+ prefix?: IconName | React.ReactElement;
9
+ /**
10
+ * Name of Icon or component to render on the right side of title.
11
+ */
12
+ suffix?: IconName | React.ReactElement;
13
+ /**
14
+ * The title of the component.
15
+ */
16
+ title: string;
17
+ /**
18
+ * The subtile title of the component.
19
+ */
20
+ subtitle?: string;
21
+ /**
22
+ * Whether the component is disabled. Default value is false
23
+ */
24
+ disabled?: boolean;
25
+ /**
26
+ * Whether the component is selected. Default value is false
27
+ */
28
+ selected?: boolean;
29
+ /**
30
+ * Additional wrapper style.
31
+ */
32
+ style?: StyleProp<ViewStyle>;
33
+ /**
34
+ * Testing id of the component.
35
+ */
36
+ testID?: string;
37
+ /**
38
+ * Set the handler to handle press event.
39
+ */
40
+ onPress?: () => void;
41
+ }
42
+ declare const BasicListItem: ({ prefix, suffix, title, subtitle, style, testID, selected, disabled, onPress, }: ListItemProps) => JSX.Element;
43
+ export default BasicListItem;