@estuary-solutions/rn-core-ui 0.0.3

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 (304) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +743 -0
  3. package/dist/Accordion/Accordion.d.ts +5 -0
  4. package/dist/Accordion/Accordion.d.ts.map +1 -0
  5. package/dist/Accordion/Accordion.js +19 -0
  6. package/dist/Accordion/AccordionContext.d.ts +7 -0
  7. package/dist/Accordion/AccordionContext.d.ts.map +1 -0
  8. package/dist/Accordion/AccordionContext.js +3 -0
  9. package/dist/Accordion/AccordionGroup.d.ts +7 -0
  10. package/dist/Accordion/AccordionGroup.d.ts.map +1 -0
  11. package/dist/Accordion/AccordionGroup.js +32 -0
  12. package/dist/Accordion/AccordionItem.d.ts +5 -0
  13. package/dist/Accordion/AccordionItem.d.ts.map +1 -0
  14. package/dist/Accordion/AccordionItem.js +12 -0
  15. package/dist/Accordion/AccordionTree.d.ts +6 -0
  16. package/dist/Accordion/AccordionTree.d.ts.map +1 -0
  17. package/dist/Accordion/AccordionTree.js +4 -0
  18. package/dist/Accordion/AccordionTreeInternal.d.ts +5 -0
  19. package/dist/Accordion/AccordionTreeInternal.d.ts.map +1 -0
  20. package/dist/Accordion/AccordionTreeInternal.js +36 -0
  21. package/dist/Accordion/AccordionTreeWithGroup.d.ts +8 -0
  22. package/dist/Accordion/AccordionTreeWithGroup.d.ts.map +1 -0
  23. package/dist/Accordion/AccordionTreeWithGroup.js +11 -0
  24. package/dist/Accordion/index.d.ts +5 -0
  25. package/dist/Accordion/index.d.ts.map +1 -0
  26. package/dist/Accordion/index.js +4 -0
  27. package/dist/Accordion/types/AccordionTypes.d.ts +65 -0
  28. package/dist/Accordion/types/AccordionTypes.d.ts.map +1 -0
  29. package/dist/Accordion/types/AccordionTypes.js +1 -0
  30. package/dist/Avatars/Avatar.d.ts +20 -0
  31. package/dist/Avatars/Avatar.d.ts.map +1 -0
  32. package/dist/Avatars/Avatar.js +63 -0
  33. package/dist/Badges/Badge.d.ts +25 -0
  34. package/dist/Badges/Badge.d.ts.map +1 -0
  35. package/dist/Badges/Badge.js +75 -0
  36. package/dist/Breadcrumbs/Breadcrumb.d.ts +13 -0
  37. package/dist/Breadcrumbs/Breadcrumb.d.ts.map +1 -0
  38. package/dist/Breadcrumbs/Breadcrumb.js +63 -0
  39. package/dist/Button/Button.d.ts +7 -0
  40. package/dist/Button/Button.d.ts.map +1 -0
  41. package/dist/Button/Button.js +62 -0
  42. package/dist/Button/ButtonGradient.d.ts +5 -0
  43. package/dist/Button/ButtonGradient.d.ts.map +1 -0
  44. package/dist/Button/ButtonGradient.js +61 -0
  45. package/dist/Button/index.d.ts +4 -0
  46. package/dist/Button/index.d.ts.map +1 -0
  47. package/dist/Button/index.js +3 -0
  48. package/dist/Button/types/ButtonGradientTypes.d.ts +80 -0
  49. package/dist/Button/types/ButtonGradientTypes.d.ts.map +1 -0
  50. package/dist/Button/types/ButtonGradientTypes.js +1 -0
  51. package/dist/Button/types/ButtonTypes.d.ts +65 -0
  52. package/dist/Button/types/ButtonTypes.d.ts.map +1 -0
  53. package/dist/Button/types/ButtonTypes.js +1 -0
  54. package/dist/Buttons/Button.d.ts +23 -0
  55. package/dist/Buttons/Button.d.ts.map +1 -0
  56. package/dist/Buttons/Button.js +66 -0
  57. package/dist/Cards/Card.d.ts +22 -0
  58. package/dist/Cards/Card.d.ts.map +1 -0
  59. package/dist/Cards/Card.js +26 -0
  60. package/dist/Cards/CardActionArea.d.ts +13 -0
  61. package/dist/Cards/CardActionArea.d.ts.map +1 -0
  62. package/dist/Cards/CardActionArea.js +30 -0
  63. package/dist/Cards/CardActions.d.ts +14 -0
  64. package/dist/Cards/CardActions.d.ts.map +1 -0
  65. package/dist/Cards/CardActions.js +41 -0
  66. package/dist/Cards/CardContent.d.ts +13 -0
  67. package/dist/Cards/CardContent.d.ts.map +1 -0
  68. package/dist/Cards/CardContent.js +19 -0
  69. package/dist/Cards/CardHeader.d.ts +16 -0
  70. package/dist/Cards/CardHeader.d.ts.map +1 -0
  71. package/dist/Cards/CardHeader.js +61 -0
  72. package/dist/Cards/CardMedia.d.ts +23 -0
  73. package/dist/Cards/CardMedia.d.ts.map +1 -0
  74. package/dist/Cards/CardMedia.js +16 -0
  75. package/dist/Cards/Paper.d.ts +13 -0
  76. package/dist/Cards/Paper.d.ts.map +1 -0
  77. package/dist/Cards/Paper.js +42 -0
  78. package/dist/DraggableFlatList/CellDecorators.d.ts +21 -0
  79. package/dist/DraggableFlatList/CellDecorators.d.ts.map +1 -0
  80. package/dist/DraggableFlatList/CellDecorators.js +66 -0
  81. package/dist/DraggableFlatList/CellRendererComponent.d.ts +20 -0
  82. package/dist/DraggableFlatList/CellRendererComponent.d.ts.map +1 -0
  83. package/dist/DraggableFlatList/CellRendererComponent.js +146 -0
  84. package/dist/DraggableFlatList/DraggableFlatList.d.ts +9 -0
  85. package/dist/DraggableFlatList/DraggableFlatList.d.ts.map +1 -0
  86. package/dist/DraggableFlatList/DraggableFlatList.js +282 -0
  87. package/dist/DraggableFlatList/DraggableFlatList.web.d.ts +4 -0
  88. package/dist/DraggableFlatList/DraggableFlatList.web.d.ts.map +1 -0
  89. package/dist/DraggableFlatList/DraggableFlatList.web.js +248 -0
  90. package/dist/DraggableFlatList/NestableDraggableFlatList.d.ts +9 -0
  91. package/dist/DraggableFlatList/NestableDraggableFlatList.d.ts.map +1 -0
  92. package/dist/DraggableFlatList/NestableDraggableFlatList.js +66 -0
  93. package/dist/DraggableFlatList/NestableScrollContainer.d.ts +5 -0
  94. package/dist/DraggableFlatList/NestableScrollContainer.d.ts.map +1 -0
  95. package/dist/DraggableFlatList/NestableScrollContainer.js +28 -0
  96. package/dist/DraggableFlatList/PlaceholderItem.d.ts +8 -0
  97. package/dist/DraggableFlatList/PlaceholderItem.d.ts.map +1 -0
  98. package/dist/DraggableFlatList/PlaceholderItem.js +44 -0
  99. package/dist/DraggableFlatList/RowItem.d.ts +13 -0
  100. package/dist/DraggableFlatList/RowItem.d.ts.map +1 -0
  101. package/dist/DraggableFlatList/RowItem.js +45 -0
  102. package/dist/DraggableFlatList/ScrollOffsetListener.d.ts +8 -0
  103. package/dist/DraggableFlatList/ScrollOffsetListener.d.ts.map +1 -0
  104. package/dist/DraggableFlatList/ScrollOffsetListener.js +13 -0
  105. package/dist/Flex/Flex.d.ts +12 -0
  106. package/dist/Flex/Flex.d.ts.map +1 -0
  107. package/dist/Flex/Flex.js +28 -0
  108. package/dist/Flex/Flex.types.d.ts +10 -0
  109. package/dist/Flex/Flex.types.d.ts.map +1 -0
  110. package/dist/Flex/Flex.types.js +1 -0
  111. package/dist/Flex/index.d.ts +4 -0
  112. package/dist/Flex/index.d.ts.map +1 -0
  113. package/dist/Flex/index.js +3 -0
  114. package/dist/LICENSE +20 -0
  115. package/dist/README.md +743 -0
  116. package/dist/SvgIcon/SvgIcon.d.ts +9 -0
  117. package/dist/SvgIcon/SvgIcon.d.ts.map +1 -0
  118. package/dist/SvgIcon/SvgIcon.js +39 -0
  119. package/dist/SvgIcon/components/IconAlertCircle.d.ts +4 -0
  120. package/dist/SvgIcon/components/IconAlertCircle.d.ts.map +1 -0
  121. package/dist/SvgIcon/components/IconAlertCircle.js +6 -0
  122. package/dist/SvgIcon/components/IconAngleLeft.d.ts +4 -0
  123. package/dist/SvgIcon/components/IconAngleLeft.d.ts.map +1 -0
  124. package/dist/SvgIcon/components/IconAngleLeft.js +6 -0
  125. package/dist/SvgIcon/components/IconAngleRight.d.ts +4 -0
  126. package/dist/SvgIcon/components/IconAngleRight.d.ts.map +1 -0
  127. package/dist/SvgIcon/components/IconAngleRight.js +6 -0
  128. package/dist/SvgIcon/components/IconCheckBox.d.ts +4 -0
  129. package/dist/SvgIcon/components/IconCheckBox.d.ts.map +1 -0
  130. package/dist/SvgIcon/components/IconCheckBox.js +6 -0
  131. package/dist/SvgIcon/components/IconCheckBoxOutlineBlank.d.ts +4 -0
  132. package/dist/SvgIcon/components/IconCheckBoxOutlineBlank.d.ts.map +1 -0
  133. package/dist/SvgIcon/components/IconCheckBoxOutlineBlank.js +6 -0
  134. package/dist/SvgIcon/components/IconCheckBoxWithBg.d.ts +4 -0
  135. package/dist/SvgIcon/components/IconCheckBoxWithBg.d.ts.map +1 -0
  136. package/dist/SvgIcon/components/IconCheckBoxWithBg.js +6 -0
  137. package/dist/SvgIcon/components/IconChevronDown.d.ts +4 -0
  138. package/dist/SvgIcon/components/IconChevronDown.d.ts.map +1 -0
  139. package/dist/SvgIcon/components/IconChevronDown.js +6 -0
  140. package/dist/SvgIcon/components/IconChevronUp.d.ts +4 -0
  141. package/dist/SvgIcon/components/IconChevronUp.d.ts.map +1 -0
  142. package/dist/SvgIcon/components/IconChevronUp.js +6 -0
  143. package/dist/SvgIcon/components/IconHome.d.ts +4 -0
  144. package/dist/SvgIcon/components/IconHome.d.ts.map +1 -0
  145. package/dist/SvgIcon/components/IconHome.js +6 -0
  146. package/dist/SvgIcon/components/IconPerson.d.ts +4 -0
  147. package/dist/SvgIcon/components/IconPerson.d.ts.map +1 -0
  148. package/dist/SvgIcon/components/IconPerson.js +6 -0
  149. package/dist/SvgIcon/components/IconPlayCircle.d.ts +4 -0
  150. package/dist/SvgIcon/components/IconPlayCircle.d.ts.map +1 -0
  151. package/dist/SvgIcon/components/IconPlayCircle.js +9 -0
  152. package/dist/SvgIcon/components/IconPlus.d.ts +4 -0
  153. package/dist/SvgIcon/components/IconPlus.d.ts.map +1 -0
  154. package/dist/SvgIcon/components/IconPlus.js +6 -0
  155. package/dist/SvgIcon/components/index.d.ts +13 -0
  156. package/dist/SvgIcon/components/index.d.ts.map +1 -0
  157. package/dist/SvgIcon/components/index.js +12 -0
  158. package/dist/SvgIcon/types/SvgIconTypes.d.ts +46 -0
  159. package/dist/SvgIcon/types/SvgIconTypes.d.ts.map +1 -0
  160. package/dist/SvgIcon/types/SvgIconTypes.js +1 -0
  161. package/dist/TextFields/TextField.d.ts +34 -0
  162. package/dist/TextFields/TextField.d.ts.map +1 -0
  163. package/dist/TextFields/TextField.js +400 -0
  164. package/dist/TextFields/index.d.ts +2 -0
  165. package/dist/TextFields/index.d.ts.map +1 -0
  166. package/dist/TextFields/index.js +1 -0
  167. package/dist/Texts/Text.d.ts +21 -0
  168. package/dist/Texts/Text.d.ts.map +1 -0
  169. package/dist/Texts/Text.js +49 -0
  170. package/dist/constants/DraggableFlatList/constants.d.ts +28 -0
  171. package/dist/constants/DraggableFlatList/constants.d.ts.map +1 -0
  172. package/dist/constants/DraggableFlatList/constants.js +25 -0
  173. package/dist/constants/DraggableFlatList/types.d.ts +65 -0
  174. package/dist/constants/DraggableFlatList/types.d.ts.map +1 -0
  175. package/dist/constants/DraggableFlatList/types.js +1 -0
  176. package/dist/constants/DraggableFlatList/types.web.d.ts +7 -0
  177. package/dist/constants/DraggableFlatList/types.web.d.ts.map +1 -0
  178. package/dist/constants/DraggableFlatList/types.web.js +1 -0
  179. package/dist/constants/consts.d.ts +16 -0
  180. package/dist/constants/consts.d.ts.map +1 -0
  181. package/dist/constants/consts.js +15 -0
  182. package/dist/constants/index.d.ts +3 -0
  183. package/dist/constants/index.d.ts.map +1 -0
  184. package/dist/constants/index.js +2 -0
  185. package/dist/constants/types.d.ts +22 -0
  186. package/dist/constants/types.d.ts.map +1 -0
  187. package/dist/constants/types.js +21 -0
  188. package/dist/context/DraggableFlatList/animatedValueContext.d.ts +29 -0
  189. package/dist/context/DraggableFlatList/animatedValueContext.d.ts.map +1 -0
  190. package/dist/context/DraggableFlatList/animatedValueContext.js +154 -0
  191. package/dist/context/DraggableFlatList/cellContext.d.ts +10 -0
  192. package/dist/context/DraggableFlatList/cellContext.d.ts.map +1 -0
  193. package/dist/context/DraggableFlatList/cellContext.js +18 -0
  194. package/dist/context/DraggableFlatList/draggableFlatListContext.d.ts +13 -0
  195. package/dist/context/DraggableFlatList/draggableFlatListContext.d.ts.map +1 -0
  196. package/dist/context/DraggableFlatList/draggableFlatListContext.js +19 -0
  197. package/dist/context/DraggableFlatList/nestableScrollContainerContext.d.ts +23 -0
  198. package/dist/context/DraggableFlatList/nestableScrollContainerContext.d.ts.map +1 -0
  199. package/dist/context/DraggableFlatList/nestableScrollContainerContext.js +36 -0
  200. package/dist/context/DraggableFlatList/propsContext.d.ts +9 -0
  201. package/dist/context/DraggableFlatList/propsContext.d.ts.map +1 -0
  202. package/dist/context/DraggableFlatList/propsContext.js +25 -0
  203. package/dist/context/DraggableFlatList/refContext.d.ts +20 -0
  204. package/dist/context/DraggableFlatList/refContext.d.ts.map +1 -0
  205. package/dist/context/DraggableFlatList/refContext.js +55 -0
  206. package/dist/hooks/DraggableFlatList/useAutoScroll.d.ts +2 -0
  207. package/dist/hooks/DraggableFlatList/useAutoScroll.d.ts.map +1 -0
  208. package/dist/hooks/DraggableFlatList/useAutoScroll.js +77 -0
  209. package/dist/hooks/DraggableFlatList/useCellTranslate.d.ts +9 -0
  210. package/dist/hooks/DraggableFlatList/useCellTranslate.d.ts.map +1 -0
  211. package/dist/hooks/DraggableFlatList/useCellTranslate.js +72 -0
  212. package/dist/hooks/DraggableFlatList/useNestedAutoScroll.d.ts +12 -0
  213. package/dist/hooks/DraggableFlatList/useNestedAutoScroll.d.ts.map +1 -0
  214. package/dist/hooks/DraggableFlatList/useNestedAutoScroll.js +77 -0
  215. package/dist/hooks/DraggableFlatList/useOnCellActiveAnimation.d.ts +15 -0
  216. package/dist/hooks/DraggableFlatList/useOnCellActiveAnimation.d.ts.map +1 -0
  217. package/dist/hooks/DraggableFlatList/useOnCellActiveAnimation.js +29 -0
  218. package/dist/hooks/DraggableFlatList/useStableCallback.d.ts +2 -0
  219. package/dist/hooks/DraggableFlatList/useStableCallback.d.ts.map +1 -0
  220. package/dist/hooks/DraggableFlatList/useStableCallback.js +11 -0
  221. package/dist/hooks/useTheme.d.ts +17 -0
  222. package/dist/hooks/useTheme.d.ts.map +1 -0
  223. package/dist/hooks/useTheme.js +12 -0
  224. package/dist/index.d.ts +23 -0
  225. package/dist/index.d.ts.map +1 -0
  226. package/dist/index.js +22 -0
  227. package/dist/themes/colors.d.ts +9 -0
  228. package/dist/themes/colors.d.ts.map +1 -0
  229. package/dist/themes/colors.js +201 -0
  230. package/dist/themes/elevationOverlay.d.ts +2 -0
  231. package/dist/themes/elevationOverlay.d.ts.map +1 -0
  232. package/dist/themes/elevationOverlay.js +12 -0
  233. package/dist/themes/fontSize.d.ts +23 -0
  234. package/dist/themes/fontSize.d.ts.map +1 -0
  235. package/dist/themes/fontSize.js +22 -0
  236. package/dist/themes/index.d.ts +5 -0
  237. package/dist/themes/index.d.ts.map +1 -0
  238. package/dist/themes/index.js +4 -0
  239. package/dist/themes/types/colorTypes.d.ts +665 -0
  240. package/dist/themes/types/colorTypes.d.ts.map +1 -0
  241. package/dist/themes/types/colorTypes.js +1 -0
  242. package/dist/utils/DraggableFlatList/typedMemo.d.ts +2 -0
  243. package/dist/utils/DraggableFlatList/typedMemo.d.ts.map +1 -0
  244. package/dist/utils/DraggableFlatList/typedMemo.js +2 -0
  245. package/dist/utils/cleanTagHTML.d.ts +22 -0
  246. package/dist/utils/cleanTagHTML.d.ts.map +1 -0
  247. package/dist/utils/cleanTagHTML.js +36 -0
  248. package/dist/utils/colors/color.d.ts +2 -0
  249. package/dist/utils/colors/color.d.ts.map +1 -0
  250. package/dist/utils/colors/color.js +6 -0
  251. package/dist/utils/colors/elevation.d.ts +7 -0
  252. package/dist/utils/colors/elevation.d.ts.map +1 -0
  253. package/dist/utils/colors/elevation.js +29 -0
  254. package/dist/utils/colors/index.d.ts +9 -0
  255. package/dist/utils/colors/index.d.ts.map +1 -0
  256. package/dist/utils/colors/index.js +7 -0
  257. package/dist/utils/converter.d.ts +47 -0
  258. package/dist/utils/converter.d.ts.map +1 -0
  259. package/dist/utils/converter.js +54 -0
  260. package/dist/utils/debounce.d.ts +36 -0
  261. package/dist/utils/debounce.d.ts.map +1 -0
  262. package/dist/utils/debounce.js +54 -0
  263. package/dist/utils/filters.d.ts +3 -0
  264. package/dist/utils/filters.d.ts.map +1 -0
  265. package/dist/utils/filters.js +10 -0
  266. package/dist/utils/fixedDistance.d.ts +16 -0
  267. package/dist/utils/fixedDistance.d.ts.map +1 -0
  268. package/dist/utils/fixedDistance.js +17 -0
  269. package/dist/utils/formatMoney.d.ts +30 -0
  270. package/dist/utils/formatMoney.d.ts.map +1 -0
  271. package/dist/utils/formatMoney.js +33 -0
  272. package/dist/utils/getOS.d.ts +6 -0
  273. package/dist/utils/getOS.d.ts.map +1 -0
  274. package/dist/utils/getOS.js +6 -0
  275. package/dist/utils/index.d.ts +13 -0
  276. package/dist/utils/index.d.ts.map +1 -0
  277. package/dist/utils/index.js +12 -0
  278. package/dist/utils/limitedString.d.ts +15 -0
  279. package/dist/utils/limitedString.d.ts.map +1 -0
  280. package/dist/utils/limitedString.js +19 -0
  281. package/dist/utils/resolutions.d.ts +65 -0
  282. package/dist/utils/resolutions.d.ts.map +1 -0
  283. package/dist/utils/resolutions.js +79 -0
  284. package/dist/utils/scale.d.ts +141 -0
  285. package/dist/utils/scale.d.ts.map +1 -0
  286. package/dist/utils/scale.js +141 -0
  287. package/documents/build.js +102 -0
  288. package/documents/buildFromRoot.js +49 -0
  289. package/documents/buildFromSample.js +40 -0
  290. package/documents/buildV2.js +98 -0
  291. package/documents/copyPackageToExample.js +31 -0
  292. package/example/RNCoreUISample/.eslintrc.js +10 -0
  293. package/example/RNCoreUISample/.prettierrc.js +7 -0
  294. package/example/RNCoreUISample/App.js +26 -0
  295. package/example/RNCoreUISample/README.md +104 -0
  296. package/example/RNCoreUISample/android/app/debug.keystore +0 -0
  297. package/example/RNCoreUISample/babel.config.js +29 -0
  298. package/example/RNCoreUISample/documents/storybook/manager.js +5 -0
  299. package/example/RNCoreUISample/fix_node_modules.js +12 -0
  300. package/example/RNCoreUISample/index.js +20 -0
  301. package/example/RNCoreUISample/jest.config.js +3 -0
  302. package/example/RNCoreUISample/metro.config.js +30 -0
  303. package/package.json +101 -0
  304. package/src/constants/DraggableFlatList/draggable.d.ts +12 -0
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: '@react-native',
4
+ ignorePatterns: ['metro.config.js', 'documents/**'],
5
+ rules: {
6
+ 'react/jsx-filename-extension': 'off',
7
+ 'react-hooks/exhaustive-deps': 'off',
8
+ 'requireConfigFile': 'false'
9
+ },
10
+ };
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ arrowParens: 'avoid',
3
+ bracketSameLine: true,
4
+ bracketSpacing: true,
5
+ singleQuote: true,
6
+ trailingComma: 'all',
7
+ };
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { StyleSheet, Text, View } from 'react-native';
3
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
4
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
5
+
6
+ function App() {
7
+ return (
8
+ <GestureHandlerRootView style={styles.flex1}>
9
+ <SafeAreaProvider>
10
+ <View style={styles.flex1}>
11
+ <Text>Just a temp view</Text>
12
+ </View>
13
+ </SafeAreaProvider>
14
+ </GestureHandlerRootView>
15
+ );
16
+ }
17
+
18
+ const styles = StyleSheet.create({
19
+ flex1: {
20
+ flex: 1,
21
+ justifyContent: 'center',
22
+ alignItems: 'center'
23
+ },
24
+ });
25
+
26
+ export default App;
@@ -0,0 +1,104 @@
1
+ This is a sample project, bootstrapped using [`@estuary-solutions/rn-core-ui`](https://lubrytics.com:9929/minhnhat.tran/estuary-rn-core-ui).
2
+
3
+ # Getting Started
4
+
5
+ **Note:** If you are new to this project just follow this command:
6
+
7
+ ```sh
8
+ # If you are currently in root package folder
9
+ # Run yarn install for the first time
10
+ yarn install
11
+
12
+ # Run yarn build for apply you local changes -> build -> copy to example/RNCoreUISample/node_modules
13
+ yarn build
14
+
15
+ # From now if you are in example/RNCoreUISample. Just run yarn install
16
+ # All your changes in package will be packed and copy to example/RNCoreUISample/node_modules
17
+ yarn install
18
+ ```
19
+
20
+ ## Initialize
21
+
22
+ ### Start app without Storybook
23
+ To get started with the project without using Storybook follow those commands:
24
+
25
+ ```sh
26
+ # Install require package (This will include fix node_modules and install local package)
27
+ yarn install
28
+
29
+ # For Android Developer
30
+ yarn android
31
+
32
+ # OR
33
+
34
+ # For iOS Developer
35
+ yarn ios
36
+ ```
37
+
38
+ ### Start app with Storybook
39
+
40
+ For running app with Storybook follow those commands:
41
+
42
+ ```sh
43
+ # Install require package (This will include fix node_modules and install local package)
44
+ yarn install
45
+
46
+ # For Developer using MacOS use this script:
47
+ yarn storybook-android
48
+
49
+ # OR
50
+
51
+ yarn storybook-ios
52
+
53
+ # For Developer using Window use this script:
54
+ yarn windows-storybook-android
55
+ ```
56
+
57
+ **Note:** Storybook can only be start within Metro. So if you don't really need to rebuild the app and want to switch from *None Storybook* to *Storybook*. Just close Metro and run the following script:
58
+
59
+ ```sh
60
+ # For start Metro with apply Storybook
61
+ yarn storybook-start
62
+ ```
63
+
64
+ ### Start Storybook Web
65
+
66
+ For running Web with Storybook follow this command:
67
+
68
+ ```sh
69
+ yarn storybook-web
70
+ ```
71
+
72
+ ### Build Storybook Web For Deploy Website
73
+
74
+ For deploy Storybook Web follow this command:
75
+
76
+ ```sh
77
+ # This script will generate a static storybook folder called:
78
+ # estuary-core-ui
79
+ # You can deploy that to Netify, AWS, Github, etc
80
+ yarn storybook-build-web
81
+ ```
82
+
83
+ ## Contributed package
84
+
85
+ If you're already updated the package, you should run `yarn build` in the root package first, then you can install package in sample project.
86
+
87
+ ```sh
88
+ # Move to root folder
89
+ cd ../..
90
+
91
+ # Install require package
92
+ yarn install
93
+
94
+ # Build your contributed code
95
+ yarn build
96
+
97
+ # Move to sample project
98
+ cd example/RNCoreUISample
99
+
100
+ # Installing new contributed package
101
+ yarn install
102
+
103
+ # NOTE: You may need to remove node_modules in sample project if the package not install correctly.
104
+ ```
@@ -0,0 +1,29 @@
1
+ module.exports = {
2
+ presets: ['module:@react-native/babel-preset'],
3
+ plugins: [
4
+ [
5
+ 'react-native-reanimated/plugin',
6
+ {
7
+ processNestedWorklets: true,
8
+ },
9
+ ],
10
+ [
11
+ 'module-resolver',
12
+ {
13
+ root: ['./src/'],
14
+ alias: {
15
+ '@constant': './src/constants',
16
+ '@layout': './src/views/Layout.js',
17
+ '@utils': './src/utils',
18
+ },
19
+ },
20
+ ],
21
+ [
22
+ '@babel/plugin-transform-private-methods',
23
+ {
24
+ loose: true,
25
+ },
26
+ ],
27
+ ['module:react-native-dotenv'],
28
+ ],
29
+ };
@@ -0,0 +1,5 @@
1
+ import React5, { useRef, useCallback, useEffect, useState } from 'react';
2
+ import { addons, types, useGlobalTypes, useStorybookApi, useGlobals } from 'storybook/internal/manager-api';
3
+ import { Separator, WithTooltip, TooltipLinkList, IconButton } from 'storybook/internal/components';
4
+
5
+ var defaultItemValues={type:"item",value:""},normalizeArgType=(key,argType)=>({...argType,name:argType.name||key,description:argType.description||key,toolbar:{...argType.toolbar,items:argType.toolbar.items.map(_item=>{let item=typeof _item=="string"?{value:_item,title:_item}:_item;return item.type==="reset"&&argType.toolbar.icon&&(item.icon=argType.toolbar.icon,item.hideIcon=!0),{...defaultItemValues,...item}})}});var disallowedCycleableItemTypes=["reset"],createCycleValueArray=items=>items.filter(item=>!disallowedCycleableItemTypes.includes(item.type)).map(item=>item.value);var ADDON_ID="addon-toolbars";var registerShortcuts=async(api,id,shortcuts)=>{shortcuts&&shortcuts.next&&await api.setAddonShortcut(ADDON_ID,{label:shortcuts.next.label,defaultShortcut:shortcuts.next.keys,actionName:`${id}:next`,action:shortcuts.next.action}),shortcuts&&shortcuts.previous&&await api.setAddonShortcut(ADDON_ID,{label:shortcuts.previous.label,defaultShortcut:shortcuts.previous.keys,actionName:`${id}:previous`,action:shortcuts.previous.action}),shortcuts&&shortcuts.reset&&await api.setAddonShortcut(ADDON_ID,{label:shortcuts.reset.label,defaultShortcut:shortcuts.reset.keys,actionName:`${id}:reset`,action:shortcuts.reset.action});};var withKeyboardCycle=Component=>props=>{let{id,toolbar:{items,shortcuts}}=props,api=useStorybookApi(),[globals,updateGlobals]=useGlobals(),cycleValues=useRef([]),currentValue=globals[id],reset=useCallback(()=>{updateGlobals({[id]:""});},[updateGlobals]),setNext=useCallback(()=>{let values=cycleValues.current,currentIndex=values.indexOf(currentValue),newCurrentIndex=currentIndex===values.length-1?0:currentIndex+1,newCurrent=cycleValues.current[newCurrentIndex];updateGlobals({[id]:newCurrent});},[cycleValues,currentValue,updateGlobals]),setPrevious=useCallback(()=>{let values=cycleValues.current,indexOf=values.indexOf(currentValue),currentIndex=indexOf>-1?indexOf:0,newCurrentIndex=currentIndex===0?values.length-1:currentIndex-1,newCurrent=cycleValues.current[newCurrentIndex];updateGlobals({[id]:newCurrent});},[cycleValues,currentValue,updateGlobals]);return useEffect(()=>{shortcuts&&registerShortcuts(api,id,{next:{...shortcuts.next,action:setNext},previous:{...shortcuts.previous,action:setPrevious},reset:{...shortcuts.reset,action:reset}});},[api,id,shortcuts,setNext,setPrevious,reset]),useEffect(()=>{cycleValues.current=createCycleValueArray(items);},[]),React5.createElement(Component,{cycleValues:cycleValues.current,...props})};var getSelectedItem=({currentValue,items})=>currentValue!=null&&items.find(item=>item.value===currentValue&&item.type!=="reset"),getSelectedIcon=({currentValue,items})=>{let selectedItem=getSelectedItem({currentValue,items});if(selectedItem)return selectedItem.icon},getSelectedTitle=({currentValue,items})=>{let selectedItem=getSelectedItem({currentValue,items});if(selectedItem)return selectedItem.title};var ToolbarMenuButton=({active,disabled,title,icon,description,onClick})=>React5.createElement(IconButton,{active,title:description,disabled,onClick:disabled?()=>{}:onClick},icon&&React5.createElement(Icons,{icon,__suppressDeprecationWarning:!0}),title?`\xA0${title}`:null);var ToolbarMenuListItem=({right,title,value,icon,hideIcon,onClick,disabled,currentValue})=>{let Icon=icon&&React5.createElement(Icons,{style:{opacity:1},icon,__suppressDeprecationWarning:!0}),Item={id:value??"_reset",active:currentValue===value,right,title,disabled,onClick};return icon&&!hideIcon&&(Item.icon=Icon),Item};var ToolbarMenuList=withKeyboardCycle(({id,name,description,toolbar:{icon:_icon,items,title:_title,preventDynamicIcon,dynamicTitle}})=>{let[globals,updateGlobals,storyGlobals]=useGlobals(),[isTooltipVisible,setIsTooltipVisible]=useState(!1),currentValue=globals[id],hasGlobalValue=!!currentValue,isOverridden=id in storyGlobals,icon=_icon,title=_title;preventDynamicIcon||(icon=getSelectedIcon({currentValue,items})||icon),dynamicTitle&&(title=getSelectedTitle({currentValue,items})||title),!title&&!icon&&console.warn(`Toolbar '${name}' has no title or icon`);let handleItemClick=useCallback(value=>{updateGlobals({[id]:value});},[id,updateGlobals]);return React5.createElement(WithTooltip,{placement:"top",tooltip:({onHide})=>{let links=items.filter(({type})=>{let shouldReturn=!0;return type==="reset"&&!currentValue&&(shouldReturn=!1),shouldReturn}).map(item=>ToolbarMenuListItem({...item,currentValue,disabled:isOverridden,onClick:()=>{handleItemClick(item.value),onHide();}}));return React5.createElement(TooltipLinkList,{links})},closeOnOutsideClick:!0,onVisibleChange:setIsTooltipVisible},React5.createElement(ToolbarMenuButton,{active:isTooltipVisible||hasGlobalValue,disabled:isOverridden,description:description||"",icon,title:title||""}))});var ToolbarManager=()=>{let globalTypes=useGlobalTypes(),globalIds=Object.keys(globalTypes).filter(id=>!!globalTypes[id].toolbar);return globalIds.length?React5.createElement(React5.Fragment,null,React5.createElement(Separator,null),globalIds.map(id=>{let normalizedArgType=normalizeArgType(id,globalTypes[id]);return React5.createElement(ToolbarMenuList,{key:id,id,...normalizedArgType})})):null};addons.register(ADDON_ID,()=>addons.add(ADDON_ID,{title:ADDON_ID,type:types.TOOL,match:({tabId})=>!tabId,render:()=>React5.createElement(ToolbarManager,null)}));
@@ -0,0 +1,12 @@
1
+ const fs = require('fs');
2
+
3
+ fs.copyFile(
4
+ 'documents/storybook/manager.js',
5
+ 'node_modules/@storybook/addon-toolbars/dist/manager.js',
6
+ err => {
7
+ if (err) {
8
+ console.log('Fail to copy file: manager.js');
9
+ }
10
+ console.log('Done copy file: manager.js');
11
+ },
12
+ );
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @format
3
+ */
4
+
5
+ import { AppRegistry } from 'react-native';
6
+ import App from './App'; // Import thành phần App chính của bạn
7
+ import { name as appName } from './app.json';
8
+
9
+ // Mặc định, thành phần gốc là App
10
+ let RootComponent = App;
11
+ // let RootComponent = require('./.rnstorybook').default;
12
+
13
+ // Kiểm tra biến môi trường để quyết định hiển thị gì
14
+ if (process.env.STORYBOOK_ENABLED === 'true') {
15
+ // Chỉ khi ở chế độ Storybook, chúng ta mới yêu cầu (require) và sử dụng giao diện của nó
16
+ RootComponent = require('./.rnstorybook').default;
17
+ }
18
+
19
+ // Đăng ký thành phần gốc đã được chọn với React Native
20
+ AppRegistry.registerComponent(appName, () => RootComponent);
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ preset: 'react-native',
3
+ };
@@ -0,0 +1,30 @@
1
+ const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
2
+ const path = require('path');
3
+ const withStorybook = require('@storybook/react-native/metro/withStorybook');
4
+
5
+ /**
6
+ * Metro configuration
7
+ * https://reactnative.dev/docs/metro
8
+ *
9
+ * @type {import('@react-native/metro-config').MetroConfig}
10
+ */
11
+ const config = {};
12
+
13
+ // module.exports = mergeConfig(getDefaultConfig(__dirname), config);
14
+
15
+ const defaultConfig = getDefaultConfig(__dirname);
16
+
17
+ const finalConfig = mergeConfig(defaultConfig, config);
18
+
19
+ /**
20
+ * @type {import('@storybook/react-native/metro/withStorybook').WithStorybookOptions}
21
+ */
22
+ const storybookOptions = {
23
+ // set this to "enabled: true" to enable storybook config always
24
+ enabled: process.env.STORYBOOK_ENABLED === 'true',
25
+ configPath: path.resolve(__dirname, './.rnstorybook'),
26
+
27
+ // set this to true to remove storybook from the bundle when disabled
28
+ onDisabledRemoveStorybook: true,
29
+ };
30
+ module.exports = withStorybook(finalConfig, storybookOptions);
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@estuary-solutions/rn-core-ui",
3
+ "version": "0.0.3",
4
+ "description": "React Native Core UI components Powered by Estuary Solutions",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./index.js",
10
+ "require": "./index.js"
11
+ },
12
+ "./themes": {
13
+ "import": "./themes/index.js",
14
+ "require": "./themes/index.js"
15
+ },
16
+ "./utils": {
17
+ "import": "./utils/index.js",
18
+ "require": "./utils/index.js"
19
+ },
20
+ "./Cards/*": {
21
+ "import": "./Cards/*.js",
22
+ "require": "./Cards/*.js"
23
+ },
24
+ "./Badges/*": {
25
+ "import": "./Badges/*.js",
26
+ "require": "./Badges/*.js"
27
+ },
28
+ "./Accordion/*": {
29
+ "import": "./Accordion/*.js",
30
+ "require": "./Accordion/*.js"
31
+ }
32
+ },
33
+ "files": [
34
+ "**/*.js",
35
+ "**/*.d.ts",
36
+ "**/*.js.map",
37
+ "**/*.d.ts.map",
38
+ "README.md",
39
+ "LICENSE"
40
+ ],
41
+ "scripts": {
42
+ "example": "yarn --cwd example",
43
+ "build": "node documents/buildFromRoot.js",
44
+ "publish-lib": "yarn build && cd dist && npm publish --registry=https://registry.npmjs.org/ --access public"
45
+ },
46
+ "author": "tuankiet.pham",
47
+ "keywords": [
48
+ "react-native",
49
+ "ios",
50
+ "android",
51
+ "core-ui",
52
+ "bottom-sheet",
53
+ "react-native-bottom-sheet",
54
+ "react-native-bottom-sheet-modal",
55
+ "svg"
56
+ ],
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://lubrytics.com:9929/minhnhat.tran/estuary-rn-core-ui.git"
60
+ },
61
+ "homepage": "https://lubrytics.com:9929/minhnhat.tran/estuary-rn-core-ui#readme",
62
+ "publishConfig": {
63
+ "registry": "https://registry.npmjs.org/",
64
+ "access": "public"
65
+ },
66
+ "license": "MIT",
67
+ "peerDependencies": {
68
+ "react": "18.2.0",
69
+ "react-native": "0.71.0",
70
+ "react-native-device-info": ">=8.1.3",
71
+ "react-native-fast-image": "^8.6.3",
72
+ "react-native-gesture-handler": ">=2.0.0",
73
+ "react-native-iphone-x-helper": "^1.3.1",
74
+ "react-native-reanimated": ">=3.10.0",
75
+ "react-native-svg": ">=12.1.1"
76
+ },
77
+ "devDependencies": {
78
+ "@types/fs-extra": "^11",
79
+ "@types/react": "18.2.38",
80
+ "@types/react-native": "0.71",
81
+ "esbuild": "^0.25.3",
82
+ "esbuild-plugin-alias": "^0.2.1",
83
+ "fast-glob": "^3.3.3",
84
+ "react-native-device-info": "8.1.3",
85
+ "react-native-fast-image": "^8.6.3",
86
+ "react-native-gesture-handler": "^2.25.0",
87
+ "react-native-iphone-x-helper": "1.3.1",
88
+ "react-native-reanimated": "3.17.4",
89
+ "react-native-svg": "12.1.1",
90
+ "tsc-alias": "^1.8.16",
91
+ "typescript": "^5.8.3"
92
+ },
93
+ "resolutions": {
94
+ "@types/react": "18.2.38"
95
+ },
96
+ "packageManager": "yarn@4.6.0",
97
+ "dependencies": {
98
+ "fs-extra": "^11.3.3",
99
+ "react-native-linear-gradient": "^2.8.3"
100
+ }
101
+ }
@@ -0,0 +1,12 @@
1
+ export { };
2
+
3
+ declare global {
4
+ var LayoutAnimationRepository: {
5
+ configs: Record<number, unknown>;
6
+ registerConfig: (tag: number, config: unknown) => void;
7
+ removeConfig: (tag: number) => void;
8
+ };
9
+ var RNDFLLayoutAnimationConfigStash:
10
+ | Record<number, unknown>
11
+ | undefined;
12
+ }