@hero-design/rn 7.3.1 → 7.5.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 (302) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/assets/fonts/hero-icons.ttf +0 -0
  3. package/es/index.js +5630 -4565
  4. package/lib/assets/fonts/hero-icons.ttf +0 -0
  5. package/lib/index.js +5636 -4564
  6. package/package.json +11 -9
  7. package/playground/.detoxrc.json +49 -0
  8. package/playground/.prettierrc.json +8 -0
  9. package/playground/app.json +9 -0
  10. package/playground/babel.config.js +63 -0
  11. package/playground/e2e/config.json +9 -0
  12. package/playground/e2e/environment.js +23 -0
  13. package/playground/e2e/firstTest.e2e.js +16 -0
  14. package/{expoEntry.js → playground/expoEntry.js} +1 -1
  15. package/playground/fonts/be-vietnam-pro-light.ttf +0 -0
  16. package/playground/fonts/be-vietnam-pro-regular.ttf +0 -0
  17. package/playground/fonts/be-vietnam-pro-semibold.ttf +0 -0
  18. package/playground/fonts/hero-icons.ttf +0 -0
  19. package/playground/index.js +7 -0
  20. package/playground/ios/MobileHeroDesignPlayground/AppDelegate.h +9 -0
  21. package/playground/ios/MobileHeroDesignPlayground/AppDelegate.m +75 -0
  22. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
  23. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/Contents.json +6 -0
  24. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/Contents.json +21 -0
  25. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
  26. package/playground/ios/MobileHeroDesignPlayground/Info.plist +85 -0
  27. package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground-Bridging-Header.h +3 -0
  28. package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground.entitlements +8 -0
  29. package/playground/ios/MobileHeroDesignPlayground/SplashScreen.storyboard +40 -0
  30. package/playground/ios/MobileHeroDesignPlayground/Supporting/Expo.plist +16 -0
  31. package/playground/ios/MobileHeroDesignPlayground/main.m +10 -0
  32. package/playground/ios/MobileHeroDesignPlayground/noop-file.swift +4 -0
  33. package/playground/ios/MobileHeroDesignPlayground.xcodeproj/project.pbxproj +515 -0
  34. package/playground/ios/MobileHeroDesignPlayground.xcodeproj/xcshareddata/xcschemes/MobileHeroDesignPlayground.xcscheme +88 -0
  35. package/playground/ios/MobileHeroDesignPlayground.xcworkspace/contents.xcworkspacedata +10 -0
  36. package/playground/ios/MobileHeroDesignPlayground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  37. package/playground/ios/Podfile +49 -0
  38. package/playground/ios/Podfile.lock +478 -0
  39. package/playground/ios/Podfile.properties.json +3 -0
  40. package/{metro.config.js → playground/metro.config.js} +10 -2
  41. package/playground/package.json +63 -0
  42. package/playground/src/Alert.tsx +80 -0
  43. package/playground/{index.tsx → src/App.tsx} +63 -29
  44. package/playground/{components → src}/Avatar.tsx +1 -1
  45. package/playground/{components → src}/Badge.tsx +1 -1
  46. package/playground/{components → src}/BottomNavigation.tsx +1 -1
  47. package/playground/src/BottomSheet.tsx +43 -0
  48. package/playground/{components → src}/Button.tsx +1 -1
  49. package/playground/{components → src}/Card.tsx +1 -1
  50. package/playground/{components → src}/Collapse.tsx +1 -1
  51. package/playground/src/ContentNavigator.tsx +65 -0
  52. package/playground/{components → src}/Divider.tsx +1 -1
  53. package/playground/{components → src}/Drawer.tsx +1 -1
  54. package/playground/{components → src}/FAB.tsx +1 -1
  55. package/playground/{components → src}/Icon.tsx +7 -3
  56. package/playground/{components → src}/IconButton.tsx +12 -1
  57. package/playground/src/MultipleThemes.tsx +34 -0
  58. package/playground/{components → src}/Progress.tsx +1 -1
  59. package/playground/src/Radio.tsx +25 -0
  60. package/playground/src/SectionHeading.tsx +68 -0
  61. package/playground/src/Spinner.tsx +19 -0
  62. package/playground/{components → src}/Tabs.tsx +1 -1
  63. package/playground/{components → src}/Tag.tsx +1 -1
  64. package/playground/src/TextInput.tsx +14 -0
  65. package/playground/{components → src}/Typography.tsx +1 -1
  66. package/playground/src/emotion.d.ts +7 -0
  67. package/playground/tsconfig.json +21 -0
  68. package/src/components/Alert/StyledAlert.tsx +48 -0
  69. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +686 -0
  70. package/src/components/Alert/__tests__/index.spec.tsx +83 -0
  71. package/src/components/Alert/index.tsx +109 -0
  72. package/src/components/BottomSheet/Footer.tsx +19 -0
  73. package/src/components/BottomSheet/Header.tsx +49 -0
  74. package/src/components/BottomSheet/StyledBottomSheet.tsx +75 -0
  75. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +531 -0
  76. package/src/components/BottomSheet/__tests__/index.spec.tsx +107 -0
  77. package/src/components/BottomSheet/index.tsx +171 -0
  78. package/src/components/Button/IconButton.tsx +11 -1
  79. package/src/components/Card/index.tsx +1 -1
  80. package/src/components/Collapse/StyledCollapse.tsx +11 -2
  81. package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +36 -31
  82. package/src/components/Collapse/__tests__/index.spec.tsx +1 -13
  83. package/src/components/Collapse/index.tsx +20 -50
  84. package/src/components/ContentNavigator/StyledContentNavigator.tsx +15 -0
  85. package/src/components/ContentNavigator/__tests__/StyledContentNavigator.spec.tsx +19 -0
  86. package/src/components/ContentNavigator/__tests__/__snapshots__/StyledContentNavigator.spec.tsx.snap +43 -0
  87. package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +217 -0
  88. package/src/components/ContentNavigator/__tests__/index.spec.tsx +74 -0
  89. package/src/components/ContentNavigator/index.tsx +65 -0
  90. package/src/components/Icon/HeroIcon/index.tsx +13 -2
  91. package/src/components/Icon/HeroIcon/selection.json +1 -1
  92. package/src/components/Icon/IconList.ts +8 -0
  93. package/src/components/Icon/index.tsx +8 -1
  94. package/src/components/Radio/Radio.tsx +51 -0
  95. package/src/components/Radio/RadioGroup.tsx +50 -0
  96. package/src/components/Radio/StyledRadio.tsx +42 -0
  97. package/src/components/Radio/__tests__/Radio.spec.tsx +38 -0
  98. package/src/components/Radio/__tests__/RadioGroup.spec.tsx +36 -0
  99. package/src/components/Radio/__tests__/StyledRadio.spec.tsx +43 -0
  100. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +160 -0
  101. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +248 -0
  102. package/src/components/Radio/__tests__/__snapshots__/StyledRadio.spec.tsx.snap +124 -0
  103. package/src/components/Radio/index.tsx +5 -0
  104. package/src/components/SectionHeading/StyledHeading.tsx +24 -0
  105. package/src/components/SectionHeading/__tests__/StyledHeading.tsx +28 -0
  106. package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.tsx.snap +48 -0
  107. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +208 -0
  108. package/src/components/SectionHeading/__tests__/index.spec.tsx +39 -0
  109. package/src/components/SectionHeading/index.tsx +93 -0
  110. package/src/components/Spinner/AnimatedSpinner.tsx +55 -0
  111. package/src/components/Spinner/StyledSpinner.tsx +59 -0
  112. package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +11 -0
  113. package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +56 -0
  114. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +118 -0
  115. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +235 -0
  116. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +141 -0
  117. package/src/components/Spinner/__tests__/index.spec.tsx +12 -0
  118. package/src/components/Spinner/index.tsx +22 -0
  119. package/src/components/TextInput/StyledTextInput.tsx +34 -0
  120. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +33 -0
  121. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +88 -0
  122. package/src/components/TextInput/__tests__/index.spec.tsx +16 -0
  123. package/src/components/TextInput/index.tsx +61 -0
  124. package/src/index.ts +14 -0
  125. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +117 -0
  126. package/src/theme/components/alert.ts +32 -0
  127. package/src/theme/components/bottomSheet.ts +34 -0
  128. package/src/theme/components/contentNavigator.ts +11 -0
  129. package/src/theme/components/icon.ts +1 -0
  130. package/src/theme/components/radio.ts +34 -0
  131. package/src/theme/components/spinner.ts +21 -0
  132. package/src/theme/components/textInput.ts +32 -0
  133. package/src/theme/global/borders.ts +6 -0
  134. package/src/theme/global/colors.ts +2 -0
  135. package/src/theme/index.ts +25 -7
  136. package/tsconfig.json +11 -3
  137. package/types/components/Alert/StyledAlert.d.ts +37 -0
  138. package/types/{src/components/Avatar → components/Alert}/__tests__/index.spec.d.ts +0 -0
  139. package/types/components/Alert/index.d.ts +42 -0
  140. package/types/{src/components → components}/Avatar/StyledAvatar.d.ts +0 -1
  141. package/types/{src/components → components}/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -0
  142. package/types/{src/components/BottomNavigation → components/Avatar}/__tests__/index.spec.d.ts +0 -0
  143. package/types/{src/components → components}/Avatar/index.d.ts +0 -0
  144. package/types/{src/components → components}/Badge/Status.d.ts +0 -0
  145. package/types/{src/components → components}/Badge/StyledBadge.d.ts +0 -1
  146. package/types/{src/components → components}/Badge/__tests__/Badge.spec.d.ts +0 -0
  147. package/types/{src/components → components}/Badge/__tests__/Status.spec.d.ts +0 -0
  148. package/types/{src/components → components}/Badge/index.d.ts +0 -0
  149. package/types/{src/components → components}/BottomNavigation/StyledBottomNavigation.d.ts +0 -1
  150. package/types/{src/components/Button/LoadingIndicator → components/BottomNavigation}/__tests__/index.spec.d.ts +0 -0
  151. package/types/{src/components → components}/BottomNavigation/index.d.ts +0 -0
  152. package/types/components/BottomSheet/Footer.d.ts +6 -0
  153. package/types/components/BottomSheet/Header.d.ts +8 -0
  154. package/types/components/BottomSheet/StyledBottomSheet.d.ts +46 -0
  155. package/types/{src/components/Button → components/BottomSheet}/__tests__/index.spec.d.ts +0 -0
  156. package/types/components/BottomSheet/index.d.ts +51 -0
  157. package/types/{src/components → components}/Button/Button.d.ts +0 -0
  158. package/types/{src/components → components}/Button/IconButton.d.ts +5 -1
  159. package/types/{src/components → components}/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -1
  160. package/types/{src/components → components}/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -0
  161. package/types/{src/components/Card → components/Button/LoadingIndicator}/__tests__/index.spec.d.ts +0 -0
  162. package/types/{src/components → components}/Button/LoadingIndicator/index.d.ts +0 -0
  163. package/types/{src/components → components}/Button/StyledButton.d.ts +0 -1
  164. package/types/{src/components → components}/Button/__tests__/Button.spec.d.ts +0 -0
  165. package/types/{src/components → components}/Button/__tests__/IconButton.spec.d.ts +0 -0
  166. package/types/{src/components → components}/Button/__tests__/StyledButton.spec.d.ts +0 -0
  167. package/types/{src/components → components}/Button/index.d.ts +0 -0
  168. package/types/{src/components → components}/Card/StyledCard.d.ts +0 -1
  169. package/types/{src/components → components}/Card/__tests__/StyledCard.spec.d.ts +0 -0
  170. package/types/{src/components/Collapse → components/Card}/__tests__/index.spec.d.ts +0 -0
  171. package/types/{src/components → components}/Card/index.d.ts +0 -0
  172. package/types/{src/components → components}/Collapse/StyledCollapse.d.ts +12 -2
  173. package/types/{src/components → components}/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -0
  174. package/types/{src/components/Drawer → components/Collapse}/__tests__/index.spec.d.ts +0 -0
  175. package/types/{src/components → components}/Collapse/index.d.ts +1 -5
  176. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +12 -0
  177. package/types/{src/components/Divider/__tests__/StyledDivider.spec.d.ts → components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts} +0 -0
  178. package/types/{src/components/FAB → components/ContentNavigator}/__tests__/index.spec.d.ts +0 -0
  179. package/types/components/ContentNavigator/index.d.ts +33 -0
  180. package/types/{src/components → components}/Divider/StyledDivider.d.ts +0 -1
  181. package/types/{src/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts → components/Divider/__tests__/StyledDivider.spec.d.ts} +0 -0
  182. package/types/{src/components → components}/Divider/index.d.ts +0 -0
  183. package/types/{src/components → components}/Drawer/StyledDrawer.d.ts +0 -1
  184. package/types/{src/components/Icon → components/Drawer}/__tests__/index.spec.d.ts +0 -0
  185. package/types/{src/components → components}/Drawer/index.d.ts +0 -0
  186. package/types/{src/components → components}/FAB/ActionGroup/ActionItem.d.ts +0 -0
  187. package/types/{src/components → components}/FAB/ActionGroup/StyledActionGroup.d.ts +0 -1
  188. package/types/{src/components → components}/FAB/ActionGroup/StyledActionItem.d.ts +0 -1
  189. package/types/{src/components → components}/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
  190. package/types/{src/components → components}/FAB/ActionGroup/index.d.ts +0 -0
  191. package/types/{src/components → components}/FAB/AnimatedFABIcon.d.ts +0 -0
  192. package/types/{src/components → components}/FAB/FAB.d.ts +0 -0
  193. package/types/{src/components → components}/FAB/StyledFAB.d.ts +0 -1
  194. package/types/{src/components/FAB/__tests__/StyledFAB.spec.d.ts → components/FAB/__tests__/AnimatedFABIcon.spec.d.ts} +0 -0
  195. package/types/{src/components/Progress/__tests__/index.spec.d.ts → components/FAB/__tests__/StyledFAB.spec.d.ts} +0 -0
  196. package/types/{src/components/Tabs → components/FAB}/__tests__/index.spec.d.ts +0 -0
  197. package/types/{src/components → components}/FAB/index.d.ts +0 -0
  198. package/types/{src/components → components}/Icon/HeroIcon/index.d.ts +1 -2
  199. package/types/components/Icon/IconList.d.ts +2 -0
  200. package/types/{src/components/Typography/Text → components/Icon}/__tests__/index.spec.d.ts +0 -0
  201. package/types/{src/components → components}/Icon/index.d.ts +1 -1
  202. package/types/components/Icon/utils.d.ts +2 -0
  203. package/types/{src/components → components}/Progress/ProgressBar.d.ts +0 -0
  204. package/types/{src/components → components}/Progress/ProgressCircle.d.ts +0 -0
  205. package/types/{src/components → components}/Progress/StyledProgressBar.d.ts +0 -1
  206. package/types/{src/components → components}/Progress/StyledProgressCircle.d.ts +0 -1
  207. package/types/{src/theme → components/Progress}/__tests__/index.spec.d.ts +0 -0
  208. package/types/{src/components → components}/Progress/index.d.ts +0 -0
  209. package/types/{src/components → components}/Progress/types.d.ts +0 -0
  210. package/types/components/Radio/Radio.d.ts +26 -0
  211. package/types/components/Radio/RadioGroup.d.ts +29 -0
  212. package/types/components/Radio/StyledRadio.d.ts +30 -0
  213. package/types/{src/components/Tabs/__tests__/ScrollableTabs.spec.d.ts → components/Radio/__tests__/Radio.spec.d.ts} +0 -0
  214. package/types/{src/components/Tag/__tests__/Tag.spec.d.ts → components/Radio/__tests__/RadioGroup.spec.d.ts} +0 -0
  215. package/types/{src/components/Typography/Text/__tests__/StyledText.spec.d.ts → components/Radio/__tests__/StyledRadio.spec.d.ts} +0 -0
  216. package/types/components/Radio/index.d.ts +4 -0
  217. package/types/components/SectionHeading/StyledHeading.d.ts +20 -0
  218. package/types/{src/utils/__tests__/scale.spec.d.ts → components/SectionHeading/__tests__/StyledHeading.d.ts} +0 -0
  219. package/types/components/SectionHeading/__tests__/index.spec.d.ts +1 -0
  220. package/types/components/SectionHeading/index.d.ts +39 -0
  221. package/types/components/Spinner/AnimatedSpinner.d.ts +2 -0
  222. package/types/components/Spinner/StyledSpinner.d.ts +30 -0
  223. package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +1 -0
  224. package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +1 -0
  225. package/types/components/Spinner/__tests__/index.spec.d.ts +1 -0
  226. package/types/components/Spinner/index.d.ts +10 -0
  227. package/types/{src/components → components}/Tabs/ActiveTabIndicator.d.ts +0 -0
  228. package/types/{src/components → components}/Tabs/ScrollableTabs.d.ts +0 -0
  229. package/types/{src/components → components}/Tabs/StyledScrollableTabs.d.ts +0 -1
  230. package/types/{src/components → components}/Tabs/StyledTabs.d.ts +0 -1
  231. package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
  232. package/types/components/Tabs/__tests__/index.spec.d.ts +1 -0
  233. package/types/{src/components → components}/Tabs/index.d.ts +0 -0
  234. package/types/{src/components → components}/Tabs/utils.d.ts +0 -0
  235. package/types/{src/components → components}/Tag/StyledTag.d.ts +0 -1
  236. package/types/components/Tag/__tests__/Tag.spec.d.ts +1 -0
  237. package/types/{src/components → components}/Tag/index.d.ts +0 -0
  238. package/types/components/TextInput/StyledTextInput.d.ts +22 -0
  239. package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +1 -0
  240. package/types/components/TextInput/__tests__/index.spec.d.ts +1 -0
  241. package/types/components/TextInput/index.d.ts +26 -0
  242. package/types/{src/components → components}/Typography/Text/StyledText.d.ts +0 -1
  243. package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +1 -0
  244. package/types/components/Typography/Text/__tests__/index.spec.d.ts +1 -0
  245. package/types/{src/components → components}/Typography/Text/index.d.ts +0 -0
  246. package/types/{src/components → components}/Typography/index.d.ts +0 -0
  247. package/types/{src/index.d.ts → index.d.ts} +8 -1
  248. package/types/{src/testHelpers → testHelpers}/renderWithTheme.d.ts +0 -0
  249. package/types/theme/__tests__/index.spec.d.ts +1 -0
  250. package/types/theme/components/alert.d.ts +23 -0
  251. package/types/{src/theme → theme}/components/avatar.d.ts +0 -0
  252. package/types/{src/theme → theme}/components/badge.d.ts +0 -0
  253. package/types/{src/theme → theme}/components/bottomNavigation.d.ts +0 -0
  254. package/types/theme/components/bottomSheet.d.ts +29 -0
  255. package/types/{src/theme → theme}/components/button.d.ts +0 -0
  256. package/types/{src/theme → theme}/components/card.d.ts +0 -0
  257. package/types/theme/components/contentNavigator.d.ts +7 -0
  258. package/types/{src/theme → theme}/components/divider.d.ts +0 -0
  259. package/types/{src/theme → theme}/components/drawer.d.ts +0 -0
  260. package/types/{src/theme → theme}/components/fab.d.ts +0 -0
  261. package/types/{src/theme → theme}/components/icon.d.ts +1 -0
  262. package/types/{src/theme → theme}/components/progress.d.ts +0 -0
  263. package/types/theme/components/radio.d.ts +25 -0
  264. package/types/theme/components/spinner.d.ts +15 -0
  265. package/types/{src/theme → theme}/components/tabs.d.ts +0 -0
  266. package/types/{src/theme → theme}/components/tag.d.ts +0 -0
  267. package/types/theme/components/textInput.d.ts +24 -0
  268. package/types/{src/theme → theme}/components/typography.d.ts +0 -0
  269. package/types/{src/theme → theme}/global/borders.d.ts +3 -0
  270. package/types/{src/theme → theme}/global/colors.d.ts +2 -0
  271. package/types/{src/theme → theme}/global/index.d.ts +2 -0
  272. package/types/{src/theme → theme}/global/scale.d.ts +0 -0
  273. package/types/{src/theme → theme}/global/space.d.ts +0 -0
  274. package/types/{src/theme → theme}/global/typography.d.ts +0 -0
  275. package/types/{src/theme → theme}/index.d.ts +17 -5
  276. package/types/{src/types.d.ts → types.d.ts} +0 -0
  277. package/types/utils/__tests__/scale.spec.d.ts +1 -0
  278. package/types/{src/utils → utils}/helpers.d.ts +0 -0
  279. package/types/{src/utils → utils}/hooks.d.ts +0 -0
  280. package/types/{src/utils → utils}/scale.d.ts +0 -0
  281. package/.turbo/turbo-build:types.log +0 -2
  282. package/.turbo/turbo-test.log +0 -131
  283. package/.turbo/turbo-type-check.log +0 -7
  284. package/app.json +0 -8
  285. package/types/playground/components/Avatar.d.ts +0 -2
  286. package/types/playground/components/Badge.d.ts +0 -2
  287. package/types/playground/components/BottomNavigation.d.ts +0 -2
  288. package/types/playground/components/Button.d.ts +0 -2
  289. package/types/playground/components/Card.d.ts +0 -2
  290. package/types/playground/components/Collapse.d.ts +0 -2
  291. package/types/playground/components/Divider.d.ts +0 -2
  292. package/types/playground/components/Drawer.d.ts +0 -2
  293. package/types/playground/components/FAB.d.ts +0 -2
  294. package/types/playground/components/Icon.d.ts +0 -2
  295. package/types/playground/components/IconButton.d.ts +0 -2
  296. package/types/playground/components/Progress.d.ts +0 -2
  297. package/types/playground/components/Tabs.d.ts +0 -2
  298. package/types/playground/components/Tag.d.ts +0 -2
  299. package/types/playground/components/Typography.d.ts +0 -2
  300. package/types/playground/index.d.ts +0 -2
  301. package/types/src/components/Icon/IconList.d.ts +0 -2
  302. package/types/src/components/Icon/utils.d.ts +0 -2
@@ -0,0 +1,141 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Spinner renders correctly 1`] = `
4
+ <View
5
+ style={
6
+ Array [
7
+ Object {},
8
+ undefined,
9
+ ]
10
+ }
11
+ >
12
+ <View
13
+ style={
14
+ Array [
15
+ Object {
16
+ "alignItems": "center",
17
+ "height": "100%",
18
+ "justifyContent": "center",
19
+ },
20
+ undefined,
21
+ ]
22
+ }
23
+ testID="spinner"
24
+ >
25
+ <View
26
+ collapsable={false}
27
+ nativeID="animatedComponent"
28
+ style={
29
+ Object {
30
+ "transform": Array [
31
+ Object {
32
+ "rotate": "0deg",
33
+ },
34
+ ],
35
+ }
36
+ }
37
+ >
38
+ <View
39
+ collapsable={false}
40
+ nativeID="animatedComponent"
41
+ style={
42
+ Array [
43
+ Object {
44
+ "flexDirection": "row",
45
+ "marginBottom": 8,
46
+ },
47
+ Object {},
48
+ ]
49
+ }
50
+ themePosition="top"
51
+ >
52
+ <View
53
+ collapsable={false}
54
+ nativeID="animatedComponent"
55
+ style={
56
+ Array [
57
+ Object {
58
+ "backgroundColor": "#7622d7",
59
+ "borderRadius": 8,
60
+ "height": 16,
61
+ "opacity": 1,
62
+ "width": 16,
63
+ },
64
+ Object {},
65
+ ]
66
+ }
67
+ themePosition="topLeft"
68
+ />
69
+ <View
70
+ collapsable={false}
71
+ nativeID="animatedComponent"
72
+ style={
73
+ Array [
74
+ Object {
75
+ "backgroundColor": "#7622d7",
76
+ "borderRadius": 8,
77
+ "height": 16,
78
+ "marginLeft": 8,
79
+ "opacity": 0.7,
80
+ "width": 16,
81
+ },
82
+ Object {},
83
+ ]
84
+ }
85
+ themePosition="topRight"
86
+ />
87
+ </View>
88
+ <View
89
+ collapsable={false}
90
+ nativeID="animatedComponent"
91
+ style={
92
+ Array [
93
+ Object {
94
+ "flexDirection": "row",
95
+ "marginBottom": 0,
96
+ },
97
+ Object {},
98
+ ]
99
+ }
100
+ themePosition="bottom"
101
+ >
102
+ <View
103
+ collapsable={false}
104
+ nativeID="animatedComponent"
105
+ style={
106
+ Array [
107
+ Object {
108
+ "backgroundColor": "#7622d7",
109
+ "borderRadius": 8,
110
+ "height": 16,
111
+ "opacity": 0.5,
112
+ "width": 16,
113
+ },
114
+ Object {},
115
+ ]
116
+ }
117
+ themePosition="bottomLeft"
118
+ />
119
+ <View
120
+ collapsable={false}
121
+ nativeID="animatedComponent"
122
+ style={
123
+ Array [
124
+ Object {
125
+ "backgroundColor": "#7622d7",
126
+ "borderRadius": 8,
127
+ "height": 16,
128
+ "marginLeft": 8,
129
+ "opacity": 0.3,
130
+ "width": 16,
131
+ },
132
+ Object {},
133
+ ]
134
+ }
135
+ themePosition="bottomRight"
136
+ />
137
+ </View>
138
+ </View>
139
+ </View>
140
+ </View>
141
+ `;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+
3
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
4
+ import Spinner from '..';
5
+
6
+ describe('Spinner', () => {
7
+ it('renders correctly', () => {
8
+ const { toJSON } = renderWithTheme(<Spinner testID="spinner" />);
9
+
10
+ expect(toJSON()).toMatchSnapshot();
11
+ });
12
+ });
@@ -0,0 +1,22 @@
1
+ import React, { ReactElement } from 'react';
2
+ import { ViewProps } from 'react-native';
3
+
4
+ import { StyledSpinnerContainer, StyledView } from './StyledSpinner';
5
+ import { AnimatedSpinner } from './AnimatedSpinner';
6
+
7
+ interface SpinnerProps extends ViewProps {
8
+ /**
9
+ * Testing id of the component.
10
+ */
11
+ testID?: string;
12
+ }
13
+
14
+ const Spinner = ({ testID, ...nativeProps }: SpinnerProps): ReactElement => (
15
+ <StyledView {...nativeProps}>
16
+ <StyledSpinnerContainer testID={testID}>
17
+ <AnimatedSpinner />
18
+ </StyledSpinnerContainer>
19
+ </StyledView>
20
+ );
21
+
22
+ export default Spinner;
@@ -0,0 +1,34 @@
1
+ import { TextInput, View } from 'react-native';
2
+ import styled from '@emotion/native';
3
+ import Typography from '../Typography';
4
+ import Icon from '../Icon';
5
+
6
+ const Container = styled(View)(({ theme }) => ({
7
+ position: 'relative',
8
+ width: '100%',
9
+ borderWidth: theme.__hd__.textInput.borderWidths.container,
10
+ borderRadius: theme.__hd__.textInput.radii.container,
11
+ padding: theme.__hd__.textInput.space.containerPadding,
12
+ flexDirection: 'row',
13
+ alignItems: 'center',
14
+ }));
15
+
16
+ const Label = styled(Typography.Text)(({ theme }) => ({
17
+ position: 'absolute',
18
+ left: theme.__hd__.textInput.space.labelLeft,
19
+ top: theme.__hd__.textInput.space.labelTop,
20
+ backgroundColor: theme.__hd__.textInput.colors.labelBackground,
21
+ zIndex: 1,
22
+ paddingHorizontal: theme.__hd__.textInput.space.labelHorizontalPadding,
23
+ }));
24
+
25
+ const Prefix = styled(Icon)(({ theme }) => ({
26
+ marginRight: theme.__hd__.textInput.space.prefixMarginRight,
27
+ }));
28
+
29
+ const StyledTextInput = styled(TextInput)(({ theme }) => ({
30
+ flex: 1,
31
+ fontSize: theme.__hd__.textInput.fontSizes.text,
32
+ }));
33
+
34
+ export { Container, Label, Prefix, StyledTextInput };
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
3
+ import { Container, Label, Prefix, StyledTextInput } from '../StyledTextInput';
4
+
5
+ describe('Container', () => {
6
+ it('renders correctly', () => {
7
+ const { toJSON } = renderWithTheme(<Container />);
8
+
9
+ expect(toJSON()).toMatchSnapshot();
10
+ });
11
+ });
12
+
13
+ describe('Label', () => {
14
+ it('renders correctly', () => {
15
+ const { toJSON } = renderWithTheme(<Label>Label</Label>);
16
+
17
+ expect(toJSON()).toMatchSnapshot();
18
+ });
19
+ });
20
+ describe('Prefix', () => {
21
+ it('renders correctly', () => {
22
+ const { toJSON } = renderWithTheme(<Prefix icon="user" />);
23
+
24
+ expect(toJSON()).toMatchSnapshot();
25
+ });
26
+ });
27
+ describe('StyledTextInput', () => {
28
+ it('renders correctly', () => {
29
+ const { toJSON } = renderWithTheme(<StyledTextInput />);
30
+
31
+ expect(toJSON()).toMatchSnapshot();
32
+ });
33
+ });
@@ -0,0 +1,88 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Container renders correctly 1`] = `
4
+ <View
5
+ style={
6
+ Array [
7
+ Object {
8
+ "alignItems": "center",
9
+ "borderRadius": 8,
10
+ "borderWidth": 1,
11
+ "flexDirection": "row",
12
+ "padding": 16,
13
+ "position": "relative",
14
+ "width": "100%",
15
+ },
16
+ undefined,
17
+ ]
18
+ }
19
+ />
20
+ `;
21
+
22
+ exports[`Label renders correctly 1`] = `
23
+ <Text
24
+ style={
25
+ Array [
26
+ Object {
27
+ "color": "#292a2b",
28
+ "fontFamily": "BeVietnamPro-Regular",
29
+ "fontSize": 14,
30
+ "letterSpacing": 0.42,
31
+ "lineHeight": 22,
32
+ },
33
+ Array [
34
+ Object {
35
+ "backgroundColor": "#ffffff",
36
+ "left": 16,
37
+ "paddingHorizontal": 4,
38
+ "position": "absolute",
39
+ "top": -10,
40
+ "zIndex": 1,
41
+ },
42
+ undefined,
43
+ ],
44
+ ]
45
+ }
46
+ themeFontSize="medium"
47
+ themeFontWeight="regular"
48
+ themeIntent="body"
49
+ >
50
+ Label
51
+ </Text>
52
+ `;
53
+
54
+ exports[`Prefix renders correctly 1`] = `
55
+ <HeroIcon
56
+ name="user"
57
+ style={
58
+ Array [
59
+ Object {
60
+ "color": "#292a2b",
61
+ "fontSize": 24,
62
+ },
63
+ Array [
64
+ Object {
65
+ "marginRight": 8,
66
+ },
67
+ undefined,
68
+ ],
69
+ ]
70
+ }
71
+ themeIntent="text"
72
+ themeSize="medium"
73
+ />
74
+ `;
75
+
76
+ exports[`StyledTextInput renders correctly 1`] = `
77
+ <TextInput
78
+ style={
79
+ Array [
80
+ Object {
81
+ "flex": 1,
82
+ "fontSize": 16,
83
+ },
84
+ undefined,
85
+ ]
86
+ }
87
+ />
88
+ `;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
3
+ import TextInput from '../index';
4
+
5
+ describe('TextInput', () => {
6
+ it('renders label, prefix and native TextInput', () => {
7
+ const { queryAllByTestId, queryAllByText } = renderWithTheme(
8
+ <TextInput label="Input Label" prefix="user" />
9
+ );
10
+
11
+ expect(queryAllByText('Input Label')).toHaveLength(1);
12
+ expect(queryAllByTestId('input-label')).toHaveLength(1);
13
+ expect(queryAllByTestId('input-prefix')).toHaveLength(1);
14
+ expect(queryAllByTestId('text-input')).toHaveLength(1);
15
+ });
16
+ });
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+ import {
3
+ TextInputProps as NativeTextInputProps,
4
+ StyleProp,
5
+ ViewStyle,
6
+ } from 'react-native';
7
+ import { Container, Label, Prefix, StyledTextInput } from './StyledTextInput';
8
+ import { IconName } from '../Icon';
9
+
10
+ interface TextInputProps extends NativeTextInputProps {
11
+ /**
12
+ * Field label.
13
+ */
14
+ label?: string;
15
+ /**
16
+ * Name of Icon to render on the left side of the input, before the user's cursor.
17
+ */
18
+ prefix?: IconName;
19
+ /**
20
+ * Additional style.
21
+ */
22
+ style?: StyleProp<ViewStyle>;
23
+ /**
24
+ * Testing id of the component.
25
+ */
26
+ testID?: string;
27
+ /**
28
+ * Accessibility lable for the input (Android).
29
+ */
30
+ accessibilityLabelledBy?: string;
31
+ }
32
+
33
+ const TextInput = ({
34
+ label,
35
+ prefix,
36
+ style,
37
+ testID,
38
+ accessibilityLabelledBy,
39
+ ...nativeProps
40
+ }: TextInputProps) => (
41
+ <Container style={style} testID={testID}>
42
+ {label && (
43
+ <Label
44
+ nativeID={accessibilityLabelledBy}
45
+ testID="input-label"
46
+ fontSize="small"
47
+ >
48
+ {label}
49
+ </Label>
50
+ )}
51
+ {prefix && <Prefix testID="input-prefix" icon={prefix} size="xsmall" />}
52
+ <StyledTextInput
53
+ testID="text-input"
54
+ // @ts-ignore
55
+ accessibilityLabelledBy={accessibilityLabelledBy}
56
+ {...nativeProps}
57
+ />
58
+ </Container>
59
+ );
60
+
61
+ export default TextInput;
package/src/index.ts CHANGED
@@ -2,19 +2,26 @@ import { ThemeProvider, useTheme } from '@emotion/react';
2
2
  import theme, { getTheme } from './theme';
3
3
  import { scale } from './utils/scale';
4
4
 
5
+ import Alert from './components/Alert';
5
6
  import Avatar from './components/Avatar';
6
7
  import Badge from './components/Badge';
7
8
  import BottomNavigation from './components/BottomNavigation';
9
+ import BottomSheet from './components/BottomSheet';
8
10
  import Button from './components/Button';
9
11
  import Card from './components/Card';
10
12
  import Collapse from './components/Collapse';
13
+ import ContentNavigator from './components/ContentNavigator';
11
14
  import Divider from './components/Divider';
12
15
  import Drawer from './components/Drawer';
13
16
  import FAB from './components/FAB';
14
17
  import Icon from './components/Icon';
15
18
  import Progress from './components/Progress';
19
+ import Spinner from './components/Spinner';
20
+ import Radio from './components/Radio';
21
+ import SectionHeading from './components/SectionHeading';
16
22
  import Tabs from './components/Tabs';
17
23
  import Tag from './components/Tag';
24
+ import TextInput from './components/TextInput';
18
25
  import Typography from './components/Typography';
19
26
 
20
27
  export {
@@ -23,19 +30,26 @@ export {
23
30
  useTheme,
24
31
  scale,
25
32
  ThemeProvider,
33
+ Alert,
26
34
  Avatar,
27
35
  Badge,
28
36
  BottomNavigation,
37
+ BottomSheet,
29
38
  Button,
30
39
  Card,
31
40
  Collapse,
41
+ ContentNavigator,
32
42
  Divider,
33
43
  Drawer,
34
44
  FAB,
35
45
  Icon,
36
46
  Progress,
47
+ Spinner,
48
+ Radio,
49
+ SectionHeading,
37
50
  Tabs,
38
51
  Tag,
52
+ TextInput,
39
53
  Typography,
40
54
  };
41
55
 
@@ -3,6 +3,27 @@
3
3
  exports[`theme returns correct theme object 1`] = `
4
4
  Object {
5
5
  "__hd__": Object {
6
+ "alert": Object {
7
+ "borderWidths": Object {
8
+ "base": 1,
9
+ },
10
+ "colors": Object {
11
+ "divider": "#fafbfb",
12
+ "error": "#de350b",
13
+ "info": "#1dbeee",
14
+ "success": "#01b39c",
15
+ "warning": "#ffa234",
16
+ },
17
+ "radii": Object {
18
+ "default": 16,
19
+ },
20
+ "sizes": Object {
21
+ "height": 48,
22
+ },
23
+ "space": Object {
24
+ "padding": 16,
25
+ },
26
+ },
6
27
  "avatar": Object {
7
28
  "borderWidths": Object {
8
29
  "default": 1,
@@ -81,6 +102,33 @@ Object {
81
102
  "titleMarginTop": 4,
82
103
  },
83
104
  },
105
+ "bottomSheet": Object {
106
+ "colors": Object {
107
+ "backdrop": "#292a2b",
108
+ "background": "#ffffff",
109
+ "shadow": "#292a2b",
110
+ },
111
+ "radii": Object {
112
+ "default": 16,
113
+ },
114
+ "shadows": Object {
115
+ "elevation": 10,
116
+ "offset": Object {
117
+ "height": 3,
118
+ "width": 0,
119
+ },
120
+ "opacity": 0.27,
121
+ "radius": 4.65,
122
+ },
123
+ "sizes": Object {
124
+ "closeIconWidth": 72,
125
+ "sectionHeight": 64,
126
+ },
127
+ "space": Object {
128
+ "horizontalPadding": 24,
129
+ "verticalPadding": 8,
130
+ },
131
+ },
84
132
  "button": Object {
85
133
  "borderWidth": Object {
86
134
  "default": 2,
@@ -124,6 +172,11 @@ Object {
124
172
  "default": 12,
125
173
  },
126
174
  },
175
+ "contentNavigator": Object {
176
+ "space": Object {
177
+ "valueHorizontalPadding": 8,
178
+ },
179
+ },
127
180
  "divider": Object {
128
181
  "borderWidths": Object {
129
182
  "default": 1,
@@ -210,6 +263,7 @@ Object {
210
263
  "icon": Object {
211
264
  "colors": Object {
212
265
  "danger": "#de350b",
266
+ "disabledText": "#8b8d92",
213
267
  "info": "#4568fb",
214
268
  "primary": "#7622d7",
215
269
  "success": "#01b39c",
@@ -243,6 +297,42 @@ Object {
243
297
  "strokeWidth": 8,
244
298
  },
245
299
  },
300
+ "radio": Object {
301
+ "borderWidths": Object {
302
+ "circle": 2,
303
+ },
304
+ "colors": Object {
305
+ "checkedCircle": "#7622d7",
306
+ "checkedWrapper": "#f1e9fb",
307
+ "circle": "#000000",
308
+ "wrapper": "#ffffff",
309
+ },
310
+ "radii": Object {
311
+ "wrapper": 4,
312
+ },
313
+ "sizes": Object {
314
+ "circle": 20,
315
+ "innerCircle": 10,
316
+ },
317
+ "space": Object {
318
+ "circleLeftMargin": 8,
319
+ "groupTopMargin": 4,
320
+ "wrapperPadding": 16,
321
+ },
322
+ },
323
+ "spinner": Object {
324
+ "color": Object {
325
+ "default": "#7622d7",
326
+ },
327
+ "radii": Object {
328
+ "default": 8,
329
+ },
330
+ "space": Object {
331
+ "spinnerDot": 16,
332
+ "spinnerDotPadding": 8,
333
+ "spinnerTextPaddingTop": 8,
334
+ },
335
+ },
246
336
  "tabs": Object {
247
337
  "borderWidths": Object {
248
338
  "headerBottom": 1,
@@ -296,6 +386,28 @@ Object {
296
386
  "verticalPadding": 2,
297
387
  },
298
388
  },
389
+ "textInput": Object {
390
+ "borderWidths": Object {
391
+ "container": 1,
392
+ },
393
+ "colors": Object {
394
+ "border": "#292a2b",
395
+ "labelBackground": "#ffffff",
396
+ },
397
+ "fontSizes": Object {
398
+ "text": 16,
399
+ },
400
+ "radii": Object {
401
+ "container": 8,
402
+ },
403
+ "space": Object {
404
+ "containerPadding": 16,
405
+ "labelHorizontalPadding": 4,
406
+ "labelLeft": 16,
407
+ "labelTop": -10,
408
+ "prefixMarginRight": 8,
409
+ },
410
+ },
299
411
  "typography": Object {
300
412
  "colors": Object {
301
413
  "body": "#292a2b",
@@ -323,11 +435,13 @@ Object {
323
435
  },
324
436
  "borderWidths": Object {
325
437
  "base": 1,
438
+ "medium": 2,
326
439
  },
327
440
  "colors": Object {
328
441
  "archived": "#ccced1",
329
442
  "backgroundDark": "#292a2b",
330
443
  "backgroundLight": "#fafbfb",
444
+ "black": "#000000",
331
445
  "danger": "#de350b",
332
446
  "dangerBackground": "#fcebe7",
333
447
  "dangerLight": "#f2ae9d",
@@ -336,6 +450,7 @@ Object {
336
450
  "info": "#4568fb",
337
451
  "infoBackground": "#ecf0ff",
338
452
  "infoLight": "#d1d9fe",
453
+ "infoMediumLight": "#1dbeee",
339
454
  "invertedText": "#ffffff",
340
455
  "outline": "#dadbde",
341
456
  "platformBackground": "#ffffff",
@@ -382,8 +497,10 @@ Object {
382
497
  },
383
498
  "radii": Object {
384
499
  "base": 4,
500
+ "large": 12,
385
501
  "medium": 8,
386
502
  "rounded": 999,
503
+ "xlarge": 16,
387
504
  },
388
505
  "space": Object {
389
506
  "large": 24,
@@ -0,0 +1,32 @@
1
+ import { scale } from '../../utils/scale';
2
+ import { GlobalTheme } from '../global';
3
+
4
+ const getAlertTheme = (theme: GlobalTheme) => {
5
+ const colors = {
6
+ success: theme.colors.success,
7
+ warning: theme.colors.warning,
8
+ error: theme.colors.danger,
9
+ info: theme.colors.infoMediumLight,
10
+ divider: theme.colors.backgroundLight,
11
+ };
12
+
13
+ const sizes = {
14
+ height: scale(48),
15
+ };
16
+
17
+ const space = {
18
+ padding: theme.space.medium,
19
+ };
20
+
21
+ const radii = {
22
+ default: theme.radii.xlarge,
23
+ };
24
+
25
+ const borderWidths = {
26
+ base: theme.borderWidths.base,
27
+ };
28
+
29
+ return { colors, radii, sizes, space, borderWidths };
30
+ };
31
+
32
+ export default getAlertTheme;