@hero-design/rn 7.5.0 → 7.6.1-alpha.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 (409) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/.turbo/turbo-build:types.log +2 -0
  3. package/.turbo/turbo-build:watch.log +1 -0
  4. package/.turbo/turbo-lint.log +2 -0
  5. package/.turbo/turbo-type-check.log +2 -0
  6. package/es/components/Avatar/StyledAvatar.d.ts +46 -0
  7. package/es/components/Avatar/__tests__/StyledAvatar.spec.d.ts +1 -0
  8. package/es/components/Avatar/__tests__/index.spec.d.ts +1 -0
  9. package/es/components/Avatar/index.d.ts +25 -0
  10. package/es/components/Badge/Status.d.ts +24 -0
  11. package/es/components/Badge/StyledBadge.d.ts +28 -0
  12. package/es/components/Badge/__tests__/Badge.spec.d.ts +1 -0
  13. package/es/components/Badge/__tests__/Status.spec.d.ts +1 -0
  14. package/es/components/Badge/index.d.ts +32 -0
  15. package/es/components/BottomNavigation/StyledBottomNavigation.d.ts +52 -0
  16. package/es/components/BottomNavigation/__tests__/index.spec.d.ts +1 -0
  17. package/es/components/BottomNavigation/index.d.ts +45 -0
  18. package/es/components/Button/IconButton.d.ts +34 -0
  19. package/es/components/Button/__tests__/index.spec.d.ts +1 -0
  20. package/es/components/Button/index.d.ts +4 -0
  21. package/es/components/Card/StyledCard.d.ts +17 -0
  22. package/es/components/Card/__tests__/StyledCard.spec.d.ts +1 -0
  23. package/es/components/Card/__tests__/index.spec.d.ts +1 -0
  24. package/es/components/Card/index.d.ts +22 -0
  25. package/es/components/Collapse/StyledCollapse.d.ts +15 -0
  26. package/es/components/Collapse/__tests__/StyledCollapse.spec.d.ts +1 -0
  27. package/es/components/Collapse/__tests__/index.spec.d.ts +1 -0
  28. package/es/components/Collapse/index.d.ts +23 -0
  29. package/es/components/Divider/StyledDivider.d.ts +13 -0
  30. package/es/components/Divider/__tests__/StyledDivider.spec.d.ts +1 -0
  31. package/es/components/Divider/index.d.ts +21 -0
  32. package/es/components/Drawer/StyledDrawer.d.ts +25 -0
  33. package/es/components/Drawer/__tests__/index.spec.d.ts +1 -0
  34. package/es/components/Drawer/index.d.ts +25 -0
  35. package/es/components/FAB/ActionGroup/ActionItem.d.ts +12 -0
  36. package/es/components/FAB/ActionGroup/StyledActionGroup.d.ts +30 -0
  37. package/es/components/FAB/ActionGroup/StyledActionItem.d.ts +13 -0
  38. package/es/components/FAB/ActionGroup/__tests__/index.spec.d.ts +1 -0
  39. package/es/components/FAB/ActionGroup/index.d.ts +34 -0
  40. package/es/components/FAB/AnimatedFABIcon.d.ts +6 -0
  41. package/es/components/FAB/FAB.d.ts +34 -0
  42. package/es/components/FAB/StyledFAB.d.ts +20 -0
  43. package/es/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +1 -0
  44. package/es/components/FAB/__tests__/StyledFAB.spec.d.ts +1 -0
  45. package/es/components/FAB/__tests__/index.spec.d.ts +1 -0
  46. package/es/components/FAB/index.d.ts +4 -0
  47. package/es/components/Icon/HeroIcon/index.d.ts +13 -0
  48. package/es/components/Icon/IconList.d.ts +2 -0
  49. package/es/components/Icon/__tests__/index.spec.d.ts +1 -0
  50. package/es/components/Icon/index.d.ts +27 -0
  51. package/es/components/Icon/utils.d.ts +2 -0
  52. package/es/components/Progress/ProgressBar.d.ts +18 -0
  53. package/es/components/Progress/ProgressCircle.d.ts +18 -0
  54. package/es/components/Progress/StyledProgressBar.d.ts +18 -0
  55. package/es/components/Progress/StyledProgressCircle.d.ts +38 -0
  56. package/es/components/Progress/index.d.ts +5 -0
  57. package/es/components/Progress/types.d.ts +1 -0
  58. package/es/components/Tabs/ActiveTabIndicator.d.ts +8 -0
  59. package/es/components/Tabs/ScrollableTabs.d.ts +3 -0
  60. package/es/components/Tabs/StyledScrollableTabs.d.ts +61 -0
  61. package/es/components/Tabs/StyledTabs.d.ts +55 -0
  62. package/es/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
  63. package/es/components/Tabs/__tests__/index.spec.d.ts +1 -0
  64. package/es/components/Tabs/index.d.ts +54 -0
  65. package/es/components/Tabs/utils.d.ts +2 -0
  66. package/es/components/Tag/StyledTag.d.ts +20 -0
  67. package/es/components/Tag/__tests__/Tag.spec.d.ts +1 -0
  68. package/es/components/Tag/index.d.ts +21 -0
  69. package/es/components/Typography/Text/StyledText.d.ts +13 -0
  70. package/es/components/Typography/Text/__tests__/StyledText.spec.d.ts +1 -0
  71. package/es/components/Typography/Text/__tests__/index.spec.d.ts +1 -0
  72. package/es/components/Typography/Text/index.d.ts +30 -0
  73. package/es/components/Typography/index.d.ts +6 -0
  74. package/es/index.d.ts +19 -0
  75. package/es/index.js +647 -2551
  76. package/es/theme/__tests__/index.spec.d.ts +1 -0
  77. package/es/theme/components/avatar.d.ts +32 -0
  78. package/es/theme/components/badge.d.ts +29 -0
  79. package/es/theme/components/bottomNavigation.d.ts +23 -0
  80. package/es/theme/components/card.d.ts +10 -0
  81. package/es/theme/components/divider.d.ts +17 -0
  82. package/es/theme/components/drawer.d.ts +21 -0
  83. package/es/theme/components/fab.d.ts +51 -0
  84. package/es/theme/components/icon.d.ts +19 -0
  85. package/es/theme/components/progress.d.ts +21 -0
  86. package/es/theme/components/tabs.d.ts +27 -0
  87. package/es/theme/components/tag.d.ts +30 -0
  88. package/es/theme/components/typography.d.ts +26 -0
  89. package/es/theme/global/borders.d.ts +11 -0
  90. package/es/theme/global/colors.d.ts +29 -0
  91. package/es/theme/global/index.d.ts +39 -0
  92. package/es/theme/global/scale.d.ts +9 -0
  93. package/es/theme/global/space.d.ts +13 -0
  94. package/es/theme/global/typography.d.ts +21 -0
  95. package/es/theme/index.d.ts +33 -0
  96. package/es/types.d.ts +5 -0
  97. package/es/utils/__tests__/scale.spec.d.ts +1 -0
  98. package/es/utils/helpers.d.ts +2 -0
  99. package/es/utils/hooks.d.ts +1 -0
  100. package/es/utils/scale.d.ts +3 -0
  101. package/lib/components/Avatar/StyledAvatar.d.ts +46 -0
  102. package/lib/components/Avatar/__tests__/StyledAvatar.spec.d.ts +1 -0
  103. package/lib/components/Avatar/__tests__/index.spec.d.ts +1 -0
  104. package/lib/components/Avatar/index.d.ts +25 -0
  105. package/lib/components/Badge/Status.d.ts +24 -0
  106. package/lib/components/Badge/StyledBadge.d.ts +28 -0
  107. package/lib/components/Badge/__tests__/Badge.spec.d.ts +1 -0
  108. package/lib/components/Badge/__tests__/Status.spec.d.ts +1 -0
  109. package/lib/components/Badge/index.d.ts +32 -0
  110. package/lib/components/BottomNavigation/StyledBottomNavigation.d.ts +52 -0
  111. package/lib/components/BottomNavigation/__tests__/index.spec.d.ts +1 -0
  112. package/lib/components/BottomNavigation/index.d.ts +45 -0
  113. package/lib/components/Button/IconButton.d.ts +34 -0
  114. package/lib/components/Button/__tests__/index.spec.d.ts +1 -0
  115. package/lib/components/Button/index.d.ts +4 -0
  116. package/lib/components/Card/StyledCard.d.ts +17 -0
  117. package/lib/components/Card/__tests__/StyledCard.spec.d.ts +1 -0
  118. package/lib/components/Card/__tests__/index.spec.d.ts +1 -0
  119. package/lib/components/Card/index.d.ts +22 -0
  120. package/lib/components/Collapse/StyledCollapse.d.ts +15 -0
  121. package/lib/components/Collapse/__tests__/StyledCollapse.spec.d.ts +1 -0
  122. package/lib/components/Collapse/__tests__/index.spec.d.ts +1 -0
  123. package/lib/components/Collapse/index.d.ts +23 -0
  124. package/lib/components/Divider/StyledDivider.d.ts +13 -0
  125. package/lib/components/Divider/__tests__/StyledDivider.spec.d.ts +1 -0
  126. package/lib/components/Divider/index.d.ts +21 -0
  127. package/lib/components/Drawer/StyledDrawer.d.ts +25 -0
  128. package/lib/components/Drawer/__tests__/index.spec.d.ts +1 -0
  129. package/lib/components/Drawer/index.d.ts +25 -0
  130. package/lib/components/FAB/ActionGroup/ActionItem.d.ts +12 -0
  131. package/lib/components/FAB/ActionGroup/StyledActionGroup.d.ts +30 -0
  132. package/lib/components/FAB/ActionGroup/StyledActionItem.d.ts +13 -0
  133. package/lib/components/FAB/ActionGroup/__tests__/index.spec.d.ts +1 -0
  134. package/lib/components/FAB/ActionGroup/index.d.ts +34 -0
  135. package/lib/components/FAB/AnimatedFABIcon.d.ts +6 -0
  136. package/lib/components/FAB/FAB.d.ts +34 -0
  137. package/lib/components/FAB/StyledFAB.d.ts +20 -0
  138. package/lib/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +1 -0
  139. package/lib/components/FAB/__tests__/StyledFAB.spec.d.ts +1 -0
  140. package/lib/components/FAB/__tests__/index.spec.d.ts +1 -0
  141. package/lib/components/FAB/index.d.ts +4 -0
  142. package/lib/components/Icon/HeroIcon/index.d.ts +13 -0
  143. package/lib/components/Icon/IconList.d.ts +2 -0
  144. package/lib/components/Icon/__tests__/index.spec.d.ts +1 -0
  145. package/lib/components/Icon/index.d.ts +27 -0
  146. package/lib/components/Icon/utils.d.ts +2 -0
  147. package/lib/components/Progress/ProgressBar.d.ts +18 -0
  148. package/lib/components/Progress/ProgressCircle.d.ts +18 -0
  149. package/lib/components/Progress/StyledProgressBar.d.ts +18 -0
  150. package/lib/components/Progress/StyledProgressCircle.d.ts +38 -0
  151. package/lib/components/Progress/index.d.ts +5 -0
  152. package/lib/components/Progress/types.d.ts +1 -0
  153. package/lib/components/Tabs/ActiveTabIndicator.d.ts +8 -0
  154. package/lib/components/Tabs/ScrollableTabs.d.ts +3 -0
  155. package/lib/components/Tabs/StyledScrollableTabs.d.ts +61 -0
  156. package/lib/components/Tabs/StyledTabs.d.ts +55 -0
  157. package/lib/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
  158. package/lib/components/Tabs/__tests__/index.spec.d.ts +1 -0
  159. package/lib/components/Tabs/index.d.ts +54 -0
  160. package/lib/components/Tabs/utils.d.ts +2 -0
  161. package/lib/components/Tag/StyledTag.d.ts +20 -0
  162. package/lib/components/Tag/__tests__/Tag.spec.d.ts +1 -0
  163. package/lib/components/Tag/index.d.ts +21 -0
  164. package/lib/components/Typography/Text/StyledText.d.ts +13 -0
  165. package/lib/components/Typography/Text/__tests__/StyledText.spec.d.ts +1 -0
  166. package/lib/components/Typography/Text/__tests__/index.spec.d.ts +1 -0
  167. package/lib/components/Typography/Text/index.d.ts +30 -0
  168. package/lib/components/Typography/index.d.ts +6 -0
  169. package/lib/index.d.ts +19 -0
  170. package/lib/index.js +798 -2700
  171. package/lib/theme/__tests__/index.spec.d.ts +1 -0
  172. package/lib/theme/components/avatar.d.ts +32 -0
  173. package/lib/theme/components/badge.d.ts +29 -0
  174. package/lib/theme/components/bottomNavigation.d.ts +23 -0
  175. package/lib/theme/components/card.d.ts +10 -0
  176. package/lib/theme/components/divider.d.ts +17 -0
  177. package/lib/theme/components/drawer.d.ts +21 -0
  178. package/lib/theme/components/fab.d.ts +51 -0
  179. package/lib/theme/components/icon.d.ts +19 -0
  180. package/lib/theme/components/progress.d.ts +21 -0
  181. package/lib/theme/components/tabs.d.ts +27 -0
  182. package/lib/theme/components/tag.d.ts +30 -0
  183. package/lib/theme/components/typography.d.ts +26 -0
  184. package/lib/theme/global/borders.d.ts +11 -0
  185. package/lib/theme/global/colors.d.ts +29 -0
  186. package/lib/theme/global/index.d.ts +39 -0
  187. package/lib/theme/global/scale.d.ts +9 -0
  188. package/lib/theme/global/space.d.ts +13 -0
  189. package/lib/theme/global/typography.d.ts +21 -0
  190. package/lib/theme/index.d.ts +33 -0
  191. package/lib/types.d.ts +5 -0
  192. package/lib/utils/__tests__/scale.spec.d.ts +1 -0
  193. package/lib/utils/helpers.d.ts +2 -0
  194. package/lib/utils/hooks.d.ts +1 -0
  195. package/lib/utils/scale.d.ts +3 -0
  196. package/package.json +2 -4
  197. package/playground/package.json +3 -3
  198. package/playground/src/App.tsx +6 -0
  199. package/playground/src/ContentNavigator.tsx +3 -10
  200. package/playground/src/Select.tsx +32 -0
  201. package/playground/src/Switch.tsx +80 -0
  202. package/rollup.config.js +7 -1
  203. package/src/components/BottomSheet/Header.tsx +1 -1
  204. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +8 -8
  205. package/src/components/BottomSheet/index.tsx +6 -0
  206. package/src/components/Radio/RadioGroup.tsx +31 -7
  207. package/src/components/Radio/types.ts +1 -0
  208. package/src/components/SectionHeading/StyledHeading.tsx +5 -5
  209. package/src/components/SectionHeading/__tests__/{StyledHeading.tsx → StyledHeading.spec.tsx} +0 -0
  210. package/src/components/SectionHeading/__tests__/__snapshots__/{StyledHeading.tsx.snap → StyledHeading.spec.tsx.snap} +0 -0
  211. package/src/components/Select/MultiSelect/Footer.tsx +15 -0
  212. package/src/components/Select/MultiSelect/OptionList.tsx +76 -0
  213. package/src/components/Select/MultiSelect/StyledMultiSelect.tsx +30 -0
  214. package/src/components/Select/MultiSelect/__tests__/StyledMultiSelect.spec.tsx +49 -0
  215. package/src/components/Select/MultiSelect/__tests__/__snapshots__/StyledMultiSelect.spec.tsx.snap +108 -0
  216. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +1630 -0
  217. package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +94 -0
  218. package/src/components/Select/MultiSelect/index.tsx +103 -0
  219. package/src/components/Select/MultiSelect/types.ts +1 -0
  220. package/src/components/Select/index.tsx +5 -0
  221. package/src/components/Switch/StyledSwitch.tsx +50 -0
  222. package/src/components/Switch/__tests__/StyledHeading.spec.tsx +42 -0
  223. package/src/components/Switch/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +74 -0
  224. package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +129 -0
  225. package/src/components/Switch/__tests__/index.spec.tsx +24 -0
  226. package/src/components/Switch/index.tsx +87 -0
  227. package/src/components/TextInput/StyledTextInput.tsx +2 -6
  228. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +1 -7
  229. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +1 -22
  230. package/src/components/TextInput/__tests__/index.spec.tsx +2 -1
  231. package/src/components/TextInput/index.tsx +19 -6
  232. package/src/index.ts +5 -2
  233. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +58 -1
  234. package/src/theme/components/sectionHeading.ts +18 -0
  235. package/src/theme/components/select.ts +23 -0
  236. package/src/theme/components/switch.ts +50 -0
  237. package/src/theme/components/textInput.ts +1 -1
  238. package/src/theme/global/colors.ts +1 -0
  239. package/src/theme/index.ts +27 -4
  240. package/types/components/Avatar/StyledAvatar.d.ts +0 -0
  241. package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -0
  242. package/types/components/Avatar/__tests__/index.spec.d.ts +0 -0
  243. package/types/components/Avatar/index.d.ts +0 -0
  244. package/types/components/Badge/Status.d.ts +0 -0
  245. package/types/components/Badge/StyledBadge.d.ts +0 -0
  246. package/types/components/Badge/__tests__/Badge.spec.d.ts +0 -0
  247. package/types/components/Badge/__tests__/Status.spec.d.ts +0 -0
  248. package/types/components/Badge/index.d.ts +0 -0
  249. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
  250. package/types/components/BottomNavigation/__tests__/index.spec.d.ts +0 -0
  251. package/types/components/BottomNavigation/index.d.ts +0 -0
  252. package/types/components/BottomSheet/Footer.d.ts +0 -0
  253. package/types/components/BottomSheet/Header.d.ts +0 -0
  254. package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
  255. package/types/components/BottomSheet/__tests__/index.spec.d.ts +0 -0
  256. package/types/components/BottomSheet/index.d.ts +5 -1
  257. package/types/components/Button/Button.d.ts +0 -0
  258. package/types/components/Button/IconButton.d.ts +0 -0
  259. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
  260. package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -0
  261. package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -0
  262. package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
  263. package/types/components/Button/StyledButton.d.ts +0 -0
  264. package/types/components/Button/__tests__/Button.spec.d.ts +0 -0
  265. package/types/components/Button/__tests__/IconButton.spec.d.ts +0 -0
  266. package/types/components/Button/__tests__/StyledButton.spec.d.ts +0 -0
  267. package/types/components/Button/index.d.ts +0 -0
  268. package/types/components/Card/StyledCard.d.ts +0 -0
  269. package/types/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
  270. package/types/components/Card/__tests__/index.spec.d.ts +0 -0
  271. package/types/components/Card/index.d.ts +0 -0
  272. package/types/components/Checkbox/StyledCheckbox.d.ts +8 -0
  273. package/types/components/Checkbox/__tests__/StyledCheckbox.spec.d.ts +1 -0
  274. package/types/components/Checkbox/__tests__/index.spec.d.ts +1 -0
  275. package/types/components/Checkbox/index.d.ts +25 -0
  276. package/types/components/Collapse/StyledCollapse.d.ts +0 -0
  277. package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -0
  278. package/types/components/Collapse/__tests__/index.spec.d.ts +0 -0
  279. package/types/components/Collapse/index.d.ts +0 -0
  280. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
  281. package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +0 -0
  282. package/types/components/ContentNavigator/__tests__/index.spec.d.ts +0 -0
  283. package/types/components/ContentNavigator/index.d.ts +0 -0
  284. package/types/components/Divider/StyledDivider.d.ts +0 -0
  285. package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
  286. package/types/components/Divider/index.d.ts +0 -0
  287. package/types/components/Drawer/StyledDrawer.d.ts +0 -0
  288. package/types/components/Drawer/__tests__/index.spec.d.ts +0 -0
  289. package/types/components/Drawer/index.d.ts +0 -0
  290. package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
  291. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
  292. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
  293. package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
  294. package/types/components/FAB/ActionGroup/index.d.ts +0 -0
  295. package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
  296. package/types/components/FAB/FAB.d.ts +0 -0
  297. package/types/components/FAB/StyledFAB.d.ts +0 -0
  298. package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
  299. package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
  300. package/types/components/FAB/__tests__/index.spec.d.ts +0 -0
  301. package/types/components/FAB/index.d.ts +0 -0
  302. package/types/components/Icon/HeroIcon/index.d.ts +0 -0
  303. package/types/components/Icon/IconList.d.ts +0 -0
  304. package/types/components/Icon/__tests__/index.spec.d.ts +0 -0
  305. package/types/components/Icon/index.d.ts +0 -0
  306. package/types/components/Icon/utils.d.ts +0 -0
  307. package/types/components/Progress/ProgressBar.d.ts +0 -0
  308. package/types/components/Progress/ProgressCircle.d.ts +0 -0
  309. package/types/components/Progress/StyledProgressBar.d.ts +0 -0
  310. package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
  311. package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
  312. package/types/components/Progress/index.d.ts +0 -0
  313. package/types/components/Progress/types.d.ts +0 -0
  314. package/types/components/Radio/Radio.d.ts +0 -0
  315. package/types/components/Radio/RadioGroup.d.ts +11 -8
  316. package/types/components/Radio/StyledRadio.d.ts +0 -0
  317. package/types/components/Radio/__tests__/Radio.spec.d.ts +0 -0
  318. package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +0 -0
  319. package/types/components/Radio/__tests__/StyledRadio.spec.d.ts +0 -0
  320. package/types/components/Radio/index.d.ts +1 -1
  321. package/types/components/Radio/types.d.ts +5 -0
  322. package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
  323. package/types/components/SectionHeading/__tests__/StyledHeading.d.ts +0 -0
  324. package/types/components/SectionHeading/__tests__/StyledHeading.spec.d.ts +1 -0
  325. package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -0
  326. package/types/components/SectionHeading/index.d.ts +0 -0
  327. package/types/components/Select/MultiSelect/Footer.d.ts +5 -0
  328. package/types/components/Select/MultiSelect/OptionList.d.ts +3 -0
  329. package/types/components/Select/MultiSelect/StyledMultiSelect.d.ts +26 -0
  330. package/types/components/Select/MultiSelect/__tests__/StyledMultiSelect.spec.d.ts +1 -0
  331. package/types/components/Select/MultiSelect/__tests__/index.spec.d.ts +1 -0
  332. package/types/components/Select/MultiSelect/index.d.ts +39 -0
  333. package/types/components/Select/MultiSelect/types.d.ts +5 -0
  334. package/types/components/Select/index.d.ts +5 -0
  335. package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
  336. package/types/components/Spinner/StyledSpinner.d.ts +0 -0
  337. package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +0 -0
  338. package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +0 -0
  339. package/types/components/Spinner/__tests__/index.spec.d.ts +0 -0
  340. package/types/components/Spinner/index.d.ts +0 -0
  341. package/types/components/Switch/StyledSwitch.d.ts +36 -0
  342. package/types/components/Switch/__tests__/StyledHeading.spec.d.ts +1 -0
  343. package/types/components/Switch/__tests__/index.spec.d.ts +1 -0
  344. package/types/components/Switch/index.d.ts +30 -0
  345. package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
  346. package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
  347. package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
  348. package/types/components/Tabs/StyledTabs.d.ts +0 -0
  349. package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -0
  350. package/types/components/Tabs/__tests__/index.spec.d.ts +0 -0
  351. package/types/components/Tabs/index.d.ts +0 -0
  352. package/types/components/Tabs/utils.d.ts +0 -0
  353. package/types/components/Tag/StyledTag.d.ts +0 -0
  354. package/types/components/Tag/__tests__/Tag.spec.d.ts +0 -0
  355. package/types/components/Tag/index.d.ts +0 -0
  356. package/types/components/TextInput/StyledTextInput.d.ts +1 -5
  357. package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +0 -0
  358. package/types/components/TextInput/__tests__/index.spec.d.ts +0 -0
  359. package/types/components/TextInput/index.d.ts +13 -5
  360. package/types/components/Typography/Text/StyledText.d.ts +0 -0
  361. package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
  362. package/types/components/Typography/Text/__tests__/index.spec.d.ts +0 -0
  363. package/types/components/Typography/Text/index.d.ts +0 -0
  364. package/types/components/Typography/index.d.ts +0 -0
  365. package/types/index.d.ts +4 -3
  366. package/types/testHelpers/renderWithTheme.d.ts +0 -0
  367. package/types/theme/__tests__/index.spec.d.ts +0 -0
  368. package/types/theme/components/avatar.d.ts +0 -0
  369. package/types/theme/components/badge.d.ts +0 -0
  370. package/types/theme/components/bottomNavigation.d.ts +0 -0
  371. package/types/theme/components/bottomSheet.d.ts +0 -0
  372. package/types/theme/components/button.d.ts +0 -0
  373. package/types/theme/components/card.d.ts +0 -0
  374. package/types/theme/components/checkbox.d.ts +21 -0
  375. package/types/theme/components/contentNavigator.d.ts +0 -0
  376. package/types/theme/components/divider.d.ts +0 -0
  377. package/types/theme/components/drawer.d.ts +0 -0
  378. package/types/theme/components/fab.d.ts +0 -0
  379. package/types/theme/components/icon.d.ts +0 -0
  380. package/types/theme/components/progress.d.ts +0 -0
  381. package/types/theme/components/radio.d.ts +0 -0
  382. package/types/theme/components/sectionHeading.d.ts +13 -0
  383. package/types/theme/components/select.d.ts +17 -0
  384. package/types/theme/components/spinner.d.ts +0 -0
  385. package/types/theme/components/switch.d.ts +32 -0
  386. package/types/theme/components/tabs.d.ts +0 -0
  387. package/types/theme/components/tag.d.ts +0 -0
  388. package/types/theme/components/textInput.d.ts +1 -1
  389. package/types/theme/components/typography.d.ts +0 -0
  390. package/types/theme/global/borders.d.ts +0 -0
  391. package/types/theme/global/colors.d.ts +1 -0
  392. package/types/theme/global/index.d.ts +1 -0
  393. package/types/theme/global/scale.d.ts +0 -0
  394. package/types/theme/global/space.d.ts +0 -0
  395. package/types/theme/global/typography.d.ts +0 -0
  396. package/types/theme/index.d.ts +18 -3
  397. package/types/types.d.ts +0 -0
  398. package/types/utils/__tests__/scale.spec.d.ts +0 -0
  399. package/types/utils/helpers.d.ts +0 -0
  400. package/types/utils/hooks.d.ts +0 -0
  401. package/types/utils/scale.d.ts +0 -0
  402. package/.expo/README.md +0 -15
  403. package/.expo/packager-info.json +0 -10
  404. package/.expo/prebuild/cached-packages.json +0 -4
  405. package/.expo/settings.json +0 -10
  406. package/.expo/xcodebuild-error.log +0 -2
  407. package/.expo/xcodebuild.log +0 -11199
  408. package/.turbo/turbo-publish:npm.log +0 -0
  409. package/playground/src/emotion.d.ts +0 -7
@@ -0,0 +1,80 @@
1
+ import React from 'react';
2
+ import { View } from 'react-native';
3
+
4
+ import { Switch, Typography, useTheme } from '@hero-design/rn';
5
+
6
+ type StateIndex = 'switchOne' | 'switchTwo' | 'switchThree' | 'switchFour';
7
+
8
+ type SwitchStates = {
9
+ switchOne: boolean;
10
+ switchTwo: boolean;
11
+ switchThree: boolean;
12
+ switchFour: boolean;
13
+ };
14
+
15
+ const SwitchPlayground = () => {
16
+ const theme = useTheme();
17
+
18
+ const [isChecked, setIsChecked] = React.useState<SwitchStates>({
19
+ switchOne: true,
20
+ switchTwo: false,
21
+ switchThree: true,
22
+ switchFour: false,
23
+ });
24
+
25
+ const toggleState = React.useCallback(
26
+ (switchId: StateIndex) =>
27
+ setIsChecked({
28
+ ...isChecked,
29
+ [switchId]: !isChecked[switchId],
30
+ }),
31
+ [isChecked]
32
+ );
33
+
34
+ return (
35
+ <View
36
+ style={{
37
+ margin: theme.space.medium,
38
+ }}
39
+ >
40
+ <Typography.Text style={{ marginVertical: theme.space.xsmall }}>
41
+ Medium size
42
+ </Typography.Text>
43
+ <Switch
44
+ checked={isChecked.switchOne}
45
+ onPress={() => toggleState('switchOne')}
46
+ />
47
+ <Switch
48
+ style={{ marginTop: theme.space.small }}
49
+ checked={isChecked.switchTwo}
50
+ onPress={() => toggleState('switchTwo')}
51
+ />
52
+ <Switch checked disabled style={{ marginTop: theme.space.small }} />
53
+ <Switch disabled style={{ marginTop: theme.space.small }} />
54
+
55
+ <Typography.Text style={{ marginVertical: theme.space.xsmall }}>
56
+ Small size
57
+ </Typography.Text>
58
+ <Switch
59
+ size="small"
60
+ checked={isChecked.switchThree}
61
+ onPress={() => toggleState('switchThree')}
62
+ />
63
+ <Switch
64
+ style={{ marginTop: theme.space.small }}
65
+ size="small"
66
+ checked={isChecked.switchFour}
67
+ onPress={() => toggleState('switchFour')}
68
+ />
69
+ <Switch
70
+ checked
71
+ disabled
72
+ style={{ marginTop: theme.space.small }}
73
+ size="small"
74
+ />
75
+ <Switch disabled style={{ marginTop: theme.space.small }} size="small" />
76
+ </View>
77
+ );
78
+ };
79
+
80
+ export default SwitchPlayground;
package/rollup.config.js CHANGED
@@ -22,7 +22,13 @@ export default {
22
22
  format: 'esm',
23
23
  },
24
24
  ],
25
- external: ['react', 'react-native', 'react-native-safe-area-context'],
25
+ external: [
26
+ 'react',
27
+ 'react-native',
28
+ 'react-native-safe-area-context',
29
+ 'react-native-vector-icons',
30
+ 'react-native-pager-view',
31
+ ],
26
32
  plugins: [
27
33
  replace({
28
34
  'process.env.NODE_ENV': JSON.stringify('production'),
@@ -24,7 +24,7 @@ const Header = ({
24
24
  <StyledHeaderWrapper>
25
25
  {typeof content === 'string' ? (
26
26
  <StyledHeader adjacentIcon={showCloseButton}>
27
- <Typography.Text fontSize="xlarge" fontWeight="semi-bold">
27
+ <Typography.Text fontSize="large" fontWeight="semi-bold">
28
28
  {content}
29
29
  </Typography.Text>
30
30
  </StyledHeader>
@@ -111,14 +111,14 @@ exports[`BottomSheet renders correctly with close state 1`] = `
111
111
  Object {
112
112
  "color": "#292a2b",
113
113
  "fontFamily": "BeVietnamPro-SemiBold",
114
- "fontSize": 18,
115
- "letterSpacing": 0.54,
116
- "lineHeight": 26,
114
+ "fontSize": 16,
115
+ "letterSpacing": 0.48,
116
+ "lineHeight": 24,
117
117
  },
118
118
  undefined,
119
119
  ]
120
120
  }
121
- themeFontSize="xlarge"
121
+ themeFontSize="large"
122
122
  themeFontWeight="semi-bold"
123
123
  themeIntent="body"
124
124
  >
@@ -376,14 +376,14 @@ exports[`BottomSheet renders correctly with open state 1`] = `
376
376
  Object {
377
377
  "color": "#292a2b",
378
378
  "fontFamily": "BeVietnamPro-SemiBold",
379
- "fontSize": 18,
380
- "letterSpacing": 0.54,
381
- "lineHeight": 26,
379
+ "fontSize": 16,
380
+ "letterSpacing": 0.48,
381
+ "lineHeight": 24,
382
382
  },
383
383
  undefined,
384
384
  ]
385
385
  }
386
- themeFontSize="xlarge"
386
+ themeFontSize="large"
387
387
  themeFontWeight="semi-bold"
388
388
  themeIntent="body"
389
389
  >
@@ -40,6 +40,10 @@ interface BottomSheetProps {
40
40
  * is being dismiss by interacting outside of the bottom sheet.
41
41
  */
42
42
  onRequestClose?: () => void;
43
+ /**
44
+ * Callback that is called once the bottom sheet has been dismissed.
45
+ */
46
+ onDismiss?: () => void;
43
47
  /**
44
48
  * Displays an X button on bottom sheet header that will invoke onRequestClose callback on press.
45
49
  */
@@ -69,6 +73,7 @@ const BottomSheet = ({
69
73
  children,
70
74
  onOpen,
71
75
  onRequestClose,
76
+ onDismiss,
72
77
  showCloseButton = true,
73
78
  hasBackdrop = true,
74
79
  showDivider = true,
@@ -93,6 +98,7 @@ const BottomSheet = ({
93
98
  const endValueOfTransition = open ? 1 : 0;
94
99
  if (endValueOfTransition === 0 && value === endValueOfTransition) {
95
100
  setVisibility(false);
101
+ onDismiss?.();
96
102
  }
97
103
  });
98
104
 
@@ -2,20 +2,26 @@ import React, { ReactElement } from 'react';
2
2
  import { StyleProp, View, ViewStyle } from 'react-native';
3
3
  import Radio from './Radio';
4
4
  import { Spacer } from './StyledRadio';
5
+ import { OptionType } from './types';
5
6
 
6
- export interface RadioGroupProps {
7
+ export interface RadioGroupProps<T> {
7
8
  /**
8
9
  * An array of radio options to be selected.
9
10
  */
10
- options: { text: string; value: string }[];
11
+ options: OptionType<T>[];
11
12
  /**
12
13
  * Radio input value.
13
14
  */
14
- value: string;
15
+ value: T;
15
16
  /**
16
17
  * Press event handler receiving selected radio's value.
17
18
  */
18
- onPress: (value: string) => void;
19
+ onPress: (value: T) => void;
20
+ /**
21
+ * Used to extract a unique key for a given option at the specified index. Key is used for caching and as the react key to track item re-ordering.
22
+ * The default extractor checks option.key, and then falls back to using the index, like React does.
23
+ */
24
+ keyExtractor?: (option: OptionType<T>, index?: number) => string;
19
25
  /**
20
26
  * Additional style.
21
27
  */
@@ -26,16 +32,34 @@ export interface RadioGroupProps {
26
32
  testID?: string;
27
33
  }
28
34
 
29
- const RadioGroup = ({
35
+ function getKey<T>(
36
+ option: OptionType<T>,
37
+ index: number,
38
+ keyExtractor?: (opt: OptionType<T>, i?: number) => string
39
+ ) {
40
+ let key: React.Key = '';
41
+ if (keyExtractor !== undefined) {
42
+ key = keyExtractor(option, index);
43
+ } else if (option.key !== undefined) {
44
+ key = option.key;
45
+ } else {
46
+ key = index;
47
+ }
48
+
49
+ return key;
50
+ }
51
+
52
+ const RadioGroup = <T,>({
30
53
  value,
31
54
  onPress,
32
55
  options,
56
+ keyExtractor,
33
57
  style,
34
58
  testID,
35
- }: RadioGroupProps): ReactElement => (
59
+ }: RadioGroupProps<T>): ReactElement => (
36
60
  <View style={style} testID={testID}>
37
61
  {options.map((option, index) => (
38
- <React.Fragment key={option.value}>
62
+ <React.Fragment key={getKey(option, index, keyExtractor)}>
39
63
  {index !== 0 && <Spacer />}
40
64
  <Radio
41
65
  text={option.text}
@@ -0,0 +1 @@
1
+ export type OptionType<T> = { value: T; text: string; key?: string };
@@ -2,10 +2,10 @@ import styled from '@emotion/native';
2
2
  import { View } from 'react-native';
3
3
 
4
4
  const StyledHeading = styled(View)(({ theme }) => ({
5
- paddingVertical: theme.space.small,
6
- paddingHorizontal: theme.space.medium,
7
- backgroundColor: theme.colors.outline,
8
- marginBottom: theme.space.medium,
5
+ paddingVertical: theme.__hd__.sectionHeading.space.headingVerticalPadding,
6
+ paddingHorizontal: theme.__hd__.sectionHeading.space.headingHorizontalPadding,
7
+ backgroundColor: theme.__hd__.sectionHeading.colors.background,
8
+ marginBottom: theme.__hd__.sectionHeading.space.headingMarginBottom,
9
9
  display: 'flex',
10
10
  flexDirection: 'row',
11
11
  alignContent: 'center',
@@ -13,7 +13,7 @@ const StyledHeading = styled(View)(({ theme }) => ({
13
13
  }));
14
14
 
15
15
  const StyledIconWrapper = styled(View)(({ theme }) => ({
16
- marginRight: theme.space.small,
16
+ marginRight: theme.__hd__.sectionHeading.space.iconMarginRight,
17
17
  }));
18
18
 
19
19
  const StyledWrapper = styled(View)(() => ({
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { TouchableOpacity } from 'react-native';
3
+ import { FooterText } from './StyledMultiSelect';
4
+
5
+ function Footer({ label, onPress }: { label: string; onPress: () => void }) {
6
+ return (
7
+ <TouchableOpacity onPress={onPress}>
8
+ <FooterText fontSize="large" fontWeight="semi-bold">
9
+ {label}
10
+ </FooterText>
11
+ </TouchableOpacity>
12
+ );
13
+ }
14
+
15
+ export default Footer;
@@ -0,0 +1,76 @@
1
+ import React from 'react';
2
+ import { View } from 'react-native';
3
+ import { MultiSelectProps } from '.';
4
+ import Icon from '../../Icon';
5
+ import Typography from '../../Typography';
6
+ import { OptionListWrapper, OptionWrapper, Spacer } from './StyledMultiSelect';
7
+ import { OptionType } from './types';
8
+
9
+ function Option({
10
+ text,
11
+ selected,
12
+ onPress,
13
+ }: {
14
+ text: string;
15
+ selected: boolean;
16
+ onPress: () => void;
17
+ }) {
18
+ return (
19
+ <OptionWrapper themeSelected={selected} onPress={onPress}>
20
+ <View style={{ flex: 1 }}>
21
+ <Typography.Text fontSize="large">{text}</Typography.Text>
22
+ </View>
23
+ {selected && <Icon icon="checkmark" size="small" />}
24
+ </OptionWrapper>
25
+ );
26
+ }
27
+
28
+ function getKey<T>(
29
+ option: OptionType<T>,
30
+ index: number,
31
+ keyExtractor?: (opt: OptionType<T>, i?: number) => string
32
+ ) {
33
+ let key: React.Key = '';
34
+ if (keyExtractor !== undefined) {
35
+ key = keyExtractor(option, index);
36
+ } else if (option.key !== undefined) {
37
+ key = option.key;
38
+ } else {
39
+ key = index;
40
+ }
41
+
42
+ return key;
43
+ }
44
+
45
+ function OptionList<T>({
46
+ value,
47
+ options,
48
+ onPress,
49
+ keyExtractor,
50
+ }: Pick<
51
+ MultiSelectProps<T>,
52
+ 'value' | 'options' | 'onPress' | 'keyExtractor'
53
+ >) {
54
+ return (
55
+ <OptionListWrapper>
56
+ {options.map((opt, index) => (
57
+ <React.Fragment key={getKey(opt, index, keyExtractor)}>
58
+ {index !== 0 && <Spacer />}
59
+ <Option
60
+ text={opt.text}
61
+ selected={value.includes(opt.value)}
62
+ onPress={() => {
63
+ if (value.includes(opt.value)) {
64
+ onPress(value.filter(val => val !== opt.value));
65
+ } else {
66
+ onPress([...value, opt.value]);
67
+ }
68
+ }}
69
+ />
70
+ </React.Fragment>
71
+ ))}
72
+ </OptionListWrapper>
73
+ );
74
+ }
75
+
76
+ export default OptionList;
@@ -0,0 +1,30 @@
1
+ import { View, TouchableOpacity } from 'react-native';
2
+ import styled from '@emotion/native';
3
+ import Typography from '../../Typography';
4
+
5
+ const OptionWrapper = styled(TouchableOpacity)<{ themeSelected: boolean }>(
6
+ ({ theme, themeSelected }) => ({
7
+ flexDirection: 'row',
8
+ justifyContent: 'space-between',
9
+ alignItems: 'center',
10
+ borderRadius: theme.__hd__.select.radii.option,
11
+ padding: theme.__hd__.select.space.optionPadding,
12
+ backgroundColor: themeSelected
13
+ ? theme.__hd__.select.colors.checkedOption
14
+ : theme.__hd__.select.colors.option,
15
+ })
16
+ );
17
+
18
+ const OptionListWrapper = styled(View)(({ theme }) => ({
19
+ padding: theme.__hd__.select.space.optionListPadding,
20
+ }));
21
+
22
+ const Spacer = styled(View)(({ theme }) => ({
23
+ marginTop: theme.__hd__.select.space.optionListSpacing,
24
+ }));
25
+
26
+ const FooterText = styled(Typography.Text)(({ theme }) => ({
27
+ color: theme.__hd__.select.colors.footerText,
28
+ }));
29
+
30
+ export { OptionWrapper, OptionListWrapper, Spacer, FooterText };
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import renderWithTheme from '../../../../testHelpers/renderWithTheme';
3
+ import {
4
+ OptionWrapper,
5
+ OptionListWrapper,
6
+ Spacer,
7
+ FooterText,
8
+ } from '../StyledMultiSelect';
9
+
10
+ describe('OptionWrapper', () => {
11
+ it.each`
12
+ themeSelected
13
+ ${true}
14
+ ${false}
15
+ `('has selected style: $themeSelected', ({ themeSelected }) => {
16
+ const { toJSON } = renderWithTheme(
17
+ <OptionWrapper themeSelected={themeSelected} />
18
+ );
19
+
20
+ expect(toJSON()).toMatchSnapshot();
21
+ });
22
+ });
23
+
24
+ describe('OptionListWrapper', () => {
25
+ it('has correct style', () => {
26
+ const { toJSON } = renderWithTheme(<OptionListWrapper />);
27
+
28
+ expect(toJSON()).toMatchSnapshot();
29
+ });
30
+ });
31
+
32
+ describe('Spacer', () => {
33
+ it('has correct style', () => {
34
+ const { toJSON } = renderWithTheme(<Spacer />);
35
+
36
+ expect(toJSON()).toMatchSnapshot();
37
+ });
38
+ });
39
+
40
+ describe('FooterText', () => {
41
+ it('has correct style', () => {
42
+ const { toJSON, getByText } = renderWithTheme(
43
+ <FooterText>Confirm</FooterText>
44
+ );
45
+
46
+ expect(getByText('Confirm')).toBeDefined();
47
+ expect(toJSON()).toMatchSnapshot();
48
+ });
49
+ });
@@ -0,0 +1,108 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`FooterText has correct style 1`] = `
4
+ <Text
5
+ style={
6
+ Array [
7
+ Object {
8
+ "color": "#292a2b",
9
+ "fontFamily": "BeVietnamPro-Regular",
10
+ "fontSize": 14,
11
+ "letterSpacing": 0.42,
12
+ "lineHeight": 22,
13
+ },
14
+ Array [
15
+ Object {
16
+ "color": "#7622d7",
17
+ },
18
+ undefined,
19
+ ],
20
+ ]
21
+ }
22
+ themeFontSize="medium"
23
+ themeFontWeight="regular"
24
+ themeIntent="body"
25
+ >
26
+ Confirm
27
+ </Text>
28
+ `;
29
+
30
+ exports[`OptionListWrapper has correct style 1`] = `
31
+ <View
32
+ style={
33
+ Array [
34
+ Object {
35
+ "padding": 16,
36
+ },
37
+ undefined,
38
+ ]
39
+ }
40
+ />
41
+ `;
42
+
43
+ exports[`OptionWrapper has selected style: false 1`] = `
44
+ <View
45
+ accessible={true}
46
+ collapsable={false}
47
+ focusable={false}
48
+ nativeID="animatedComponent"
49
+ onClick={[Function]}
50
+ onResponderGrant={[Function]}
51
+ onResponderMove={[Function]}
52
+ onResponderRelease={[Function]}
53
+ onResponderTerminate={[Function]}
54
+ onResponderTerminationRequest={[Function]}
55
+ onStartShouldSetResponder={[Function]}
56
+ style={
57
+ Object {
58
+ "alignItems": "center",
59
+ "backgroundColor": "#ffffff",
60
+ "borderRadius": 4,
61
+ "flexDirection": "row",
62
+ "justifyContent": "space-between",
63
+ "opacity": 1,
64
+ "padding": 16,
65
+ }
66
+ }
67
+ />
68
+ `;
69
+
70
+ exports[`OptionWrapper has selected style: true 1`] = `
71
+ <View
72
+ accessible={true}
73
+ collapsable={false}
74
+ focusable={false}
75
+ nativeID="animatedComponent"
76
+ onClick={[Function]}
77
+ onResponderGrant={[Function]}
78
+ onResponderMove={[Function]}
79
+ onResponderRelease={[Function]}
80
+ onResponderTerminate={[Function]}
81
+ onResponderTerminationRequest={[Function]}
82
+ onStartShouldSetResponder={[Function]}
83
+ style={
84
+ Object {
85
+ "alignItems": "center",
86
+ "backgroundColor": "#f1e9fb",
87
+ "borderRadius": 4,
88
+ "flexDirection": "row",
89
+ "justifyContent": "space-between",
90
+ "opacity": 1,
91
+ "padding": 16,
92
+ }
93
+ }
94
+ />
95
+ `;
96
+
97
+ exports[`Spacer has correct style 1`] = `
98
+ <View
99
+ style={
100
+ Array [
101
+ Object {
102
+ "marginTop": 4,
103
+ },
104
+ undefined,
105
+ ]
106
+ }
107
+ />
108
+ `;