@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,22 @@
1
+ /**
2
+ * Provide a function to clean HTML tags and   from a string.
3
+ *
4
+ * @example
5
+ * ```js
6
+ * import { cleanHTML } from '@estuary-solutions/rn-core-ui/utils';
7
+ *
8
+ * const raw = `
9
+ * <div>Hello&nbsp;&nbsp;&nbsp;World</div>
10
+ * <p>This is&nbsp;a <strong>test</strong></p>
11
+ * `;
12
+ *
13
+ * console.log(cleanHTML(raw));
14
+ * // Output:
15
+ * // Hello
16
+ * // World
17
+ * // This is a test
18
+ * ```
19
+ */
20
+ declare const _default: (str?: string) => string;
21
+ export default _default;
22
+ //# sourceMappingURL=cleanTagHTML.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanTagHTML.d.ts","sourceRoot":"","sources":["../../src/utils/cleanTagHTML.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;yBACa,MAAK,MAAW;AAAhC,wBAgBE"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Provide a function to clean HTML tags and &nbsp; from a string.
3
+ *
4
+ * @example
5
+ * ```js
6
+ * import { cleanHTML } from '@estuary-solutions/rn-core-ui/utils';
7
+ *
8
+ * const raw = `
9
+ * <div>Hello&nbsp;&nbsp;&nbsp;World</div>
10
+ * <p>This is&nbsp;a <strong>test</strong></p>
11
+ * `;
12
+ *
13
+ * console.log(cleanHTML(raw));
14
+ * // Output:
15
+ * // Hello
16
+ * // World
17
+ * // This is a test
18
+ * ```
19
+ */
20
+ export default (str = '') => {
21
+ if (str && str.trim().length) {
22
+ let data = [];
23
+ let arr = str.replace(/<\/?[^>]+(>|$)/g, '').split('&nbsp;');
24
+ // break one line when multiple &nbsp;
25
+ for (let i = 0; i < arr.length; i++) {
26
+ if (arr[i] && arr[i].trim()) {
27
+ data.push(arr[i]);
28
+ }
29
+ else if (arr[i - 1] && arr[i - 1].trim()) {
30
+ data.push('\n');
31
+ }
32
+ }
33
+ return data.join('');
34
+ }
35
+ return '';
36
+ };
@@ -0,0 +1,2 @@
1
+ export declare function alpha(hex: string, opacity: number): string;
2
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/utils/colors/color.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAMjD"}
@@ -0,0 +1,6 @@
1
+ export function alpha(hex, opacity) {
2
+ const r = parseInt(hex.slice(1, 3), 16);
3
+ const g = parseInt(hex.slice(3, 5), 16);
4
+ const b = parseInt(hex.slice(5, 7), 16);
5
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { ViewStyle } from 'react-native';
2
+ export declare function clampElevation(value: number): number;
3
+ export declare function getElevationStyle(elevation: number, isDark: boolean): {
4
+ shadowStyle: ViewStyle;
5
+ overlayColor?: string;
6
+ };
7
+ //# sourceMappingURL=elevation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elevation.d.ts","sourceRoot":"","sources":["../../../src/utils/colors/elevation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,UAE3C;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,OAAO,GACd;IACD,WAAW,EAAE,SAAS,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CA2BA"}
@@ -0,0 +1,29 @@
1
+ import { colors, elevationOverlay } from '../../themes';
2
+ import { ANDROID } from '..';
3
+ import { alpha } from './color';
4
+ export function clampElevation(value) {
5
+ return Math.min(24, Math.max(0, value));
6
+ }
7
+ export function getElevationStyle(elevation, isDark) {
8
+ var _a;
9
+ const e = clampElevation(elevation);
10
+ if (e === 0) {
11
+ return { shadowStyle: {} };
12
+ }
13
+ const shadowStyle = ANDROID
14
+ ? { elevation: e }
15
+ : {
16
+ shadowColor: colors.black,
17
+ shadowOffset: { width: 0, height: e * 0.5 },
18
+ shadowOpacity: 0.15,
19
+ shadowRadius: e * 0.8,
20
+ };
21
+ if (!isDark) {
22
+ return { shadowStyle };
23
+ }
24
+ const opacity = (_a = elevationOverlay[e]) !== null && _a !== void 0 ? _a : 0.16;
25
+ return {
26
+ shadowStyle,
27
+ overlayColor: alpha(colors.white, opacity),
28
+ };
29
+ }
@@ -0,0 +1,9 @@
1
+ import { alpha } from './color';
2
+ import { clampElevation, getElevationStyle } from './elevation';
3
+ declare const _default: {
4
+ alpha: typeof alpha;
5
+ clampElevation: typeof clampElevation;
6
+ getElevationStyle: typeof getElevationStyle;
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/colors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;;;;;;AAEhE,wBAIC"}
@@ -0,0 +1,7 @@
1
+ import { alpha } from './color';
2
+ import { clampElevation, getElevationStyle } from './elevation';
3
+ export default {
4
+ alpha,
5
+ clampElevation,
6
+ getElevationStyle
7
+ };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * This function converts input into a string.
3
+ * * If the input is null or undefined, it returns an empty string.
4
+ * * If the input is an object, it returns a stringified version of the object.
5
+ * * Otherwise, it returns the string representation of the input.
6
+ * @example
7
+ * ```js
8
+ * import { convertString } from '@estuary-solutions/rn-core-ui/utils';
9
+ * const str = convertString(2003); // "2003"
10
+ * ```
11
+ */
12
+ export declare const convertString: (value: any) => string;
13
+ /**
14
+ * This function converts input into a number.
15
+ * * If the input is null or undefined, it returns 0.
16
+ * * If the input is not a number, it returns 0.
17
+ * * Otherwise, it returns the parsed float value of the input.
18
+ * @example
19
+ * ```js
20
+ * import { convertNumber } from '@estuary-solutions/rn-core-ui/utils';
21
+ * const num = convertNumber("2003"); // 2003
22
+ * ```
23
+ */
24
+ export declare const convertNumber: (value: any) => number;
25
+ /**
26
+ * Function to convert seconds to a string in the format "mm:ss".
27
+ * * If the input is less than 0, it returns "00:00".
28
+ * * If the input is greater than 3599, it returns "00:00".
29
+ * @example
30
+ * ```js
31
+ * import { convertSeconds } from '@estuary-solutions/rn-core-ui/utils';
32
+ * const time = convertSeconds(123); // "02:03"
33
+ * ```
34
+ */
35
+ export declare const convertSeconds: (seconds?: number) => string;
36
+ /**
37
+ * Function to format seconds into a string in the format "hh:mm:ss".
38
+ * * If the input is less than 0, it returns "00:00:00".
39
+ * * If the input is greater than 86399, it returns "00:00:00".
40
+ * @example
41
+ * ```js
42
+ * import { formatHour } from '@estuary-solutions/rn-core-ui/utils';
43
+ * const time = formatHour(3661); // "01:01:01"
44
+ * ```
45
+ */
46
+ export declare const formatHour: (seconds?: number) => string;
47
+ //# sourceMappingURL=converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converter.d.ts","sourceRoot":"","sources":["../../src/utils/converter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,GAAG,WAEvC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,GAAG,WAEvC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAI,UAAS,MAAU,WAEjD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,UAAS,MAAU,WAE7C,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * This function converts input into a string.
3
+ * * If the input is null or undefined, it returns an empty string.
4
+ * * If the input is an object, it returns a stringified version of the object.
5
+ * * Otherwise, it returns the string representation of the input.
6
+ * @example
7
+ * ```js
8
+ * import { convertString } from '@estuary-solutions/rn-core-ui/utils';
9
+ * const str = convertString(2003); // "2003"
10
+ * ```
11
+ */
12
+ export const convertString = (value) => {
13
+ return String(value);
14
+ };
15
+ /**
16
+ * This function converts input into a number.
17
+ * * If the input is null or undefined, it returns 0.
18
+ * * If the input is not a number, it returns 0.
19
+ * * Otherwise, it returns the parsed float value of the input.
20
+ * @example
21
+ * ```js
22
+ * import { convertNumber } from '@estuary-solutions/rn-core-ui/utils';
23
+ * const num = convertNumber("2003"); // 2003
24
+ * ```
25
+ */
26
+ export const convertNumber = (value) => {
27
+ return isNaN(parseFloat(value)) ? 0 : parseFloat(value);
28
+ };
29
+ /**
30
+ * Function to convert seconds to a string in the format "mm:ss".
31
+ * * If the input is less than 0, it returns "00:00".
32
+ * * If the input is greater than 3599, it returns "00:00".
33
+ * @example
34
+ * ```js
35
+ * import { convertSeconds } from '@estuary-solutions/rn-core-ui/utils';
36
+ * const time = convertSeconds(123); // "02:03"
37
+ * ```
38
+ */
39
+ export const convertSeconds = (seconds = 0) => {
40
+ return new Date(Math.max(seconds, 0) * 1000).toISOString().substr(14, 5);
41
+ };
42
+ /**
43
+ * Function to format seconds into a string in the format "hh:mm:ss".
44
+ * * If the input is less than 0, it returns "00:00:00".
45
+ * * If the input is greater than 86399, it returns "00:00:00".
46
+ * @example
47
+ * ```js
48
+ * import { formatHour } from '@estuary-solutions/rn-core-ui/utils';
49
+ * const time = formatHour(3661); // "01:01:01"
50
+ * ```
51
+ */
52
+ export const formatHour = (seconds = 0) => {
53
+ return new Date(Math.max(seconds, 0) * 1000).toISOString().substr(11, 8);
54
+ };
@@ -0,0 +1,36 @@
1
+ export type DebouncedFunction<F extends (...args: any[]) => any> = {
2
+ (...args: Parameters<F>): void;
3
+ cancel: () => void;
4
+ flush: () => void;
5
+ };
6
+ /**
7
+ * - Creates a debounced function that delays invoking the provided function until after
8
+ * a specified delay in milliseconds has elapsed since the last time the debounced
9
+ * function was invoked.
10
+ * - The debounced function comes with `cancel` and `flush` methods to cancel the
11
+ * debounced invocation and to immediately invoke the function, respectively.
12
+ * @example
13
+ * ```jsx
14
+ * import { debounce } from '@estuary-solutions/rn-core-ui/utils';
15
+ * const onChangeText = debounce(() => {
16
+ * console.log('Function executed!');
17
+ * }, 1000);
18
+ *
19
+ * //Flush case
20
+ * const debouncedLog = debounce(logMessage, 2000);
21
+ *
22
+ * debouncedLog("Waiting 2s...");
23
+ * setTimeout(() => {
24
+ * debouncedLog.flush(); // Immediately execute the function
25
+ * }, 1000);
26
+ *
27
+ * //Cancel case
28
+ * debouncedLog("Canceled");
29
+ * setTimeout(() => {
30
+ * debouncedLog.cancel(); // Don't execute the function
31
+ * }, 1000);
32
+ * ```
33
+ */
34
+ declare const debounce: <F extends (...args: any[]) => any>(func: F, delay: number) => DebouncedFunction<F>;
35
+ export default debounce;
36
+ //# sourceMappingURL=debounce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI;IACjE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,QAAQ,GAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACjD,MAAM,CAAC,EACP,OAAO,MAAM,KACZ,iBAAiB,CAAC,CAAC,CA6BrB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * - Creates a debounced function that delays invoking the provided function until after
3
+ * a specified delay in milliseconds has elapsed since the last time the debounced
4
+ * function was invoked.
5
+ * - The debounced function comes with `cancel` and `flush` methods to cancel the
6
+ * debounced invocation and to immediately invoke the function, respectively.
7
+ * @example
8
+ * ```jsx
9
+ * import { debounce } from '@estuary-solutions/rn-core-ui/utils';
10
+ * const onChangeText = debounce(() => {
11
+ * console.log('Function executed!');
12
+ * }, 1000);
13
+ *
14
+ * //Flush case
15
+ * const debouncedLog = debounce(logMessage, 2000);
16
+ *
17
+ * debouncedLog("Waiting 2s...");
18
+ * setTimeout(() => {
19
+ * debouncedLog.flush(); // Immediately execute the function
20
+ * }, 1000);
21
+ *
22
+ * //Cancel case
23
+ * debouncedLog("Canceled");
24
+ * setTimeout(() => {
25
+ * debouncedLog.cancel(); // Don't execute the function
26
+ * }, 1000);
27
+ * ```
28
+ */
29
+ const debounce = (func, delay) => {
30
+ let timeoutId = null;
31
+ const debounced = (...args) => {
32
+ if (timeoutId) {
33
+ clearTimeout(timeoutId);
34
+ }
35
+ timeoutId = setTimeout(() => {
36
+ func(...args);
37
+ }, delay);
38
+ };
39
+ debounced.cancel = () => {
40
+ if (timeoutId) {
41
+ clearTimeout(timeoutId);
42
+ timeoutId = null;
43
+ }
44
+ };
45
+ debounced.flush = () => {
46
+ if (timeoutId) {
47
+ clearTimeout(timeoutId);
48
+ func();
49
+ timeoutId = null;
50
+ }
51
+ };
52
+ return debounced;
53
+ };
54
+ export default debounce;
@@ -0,0 +1,3 @@
1
+ import { TextStyle } from "react-native";
2
+ export declare const filterAllowedTextStyle: (style: any) => Partial<TextStyle>;
3
+ //# sourceMappingURL=filters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/utils/filters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,eAAO,MAAM,sBAAsB,GAAI,OAAO,GAAG,KAAG,OAAO,CAAC,SAAS,CAQpE,CAAC"}
@@ -0,0 +1,10 @@
1
+ const ALLOWED_STYLE_KEYS = ['color', 'fontFamily', 'fontWeight'];
2
+ export const filterAllowedTextStyle = (style) => {
3
+ const filtered = {};
4
+ for (const key of ALLOWED_STYLE_KEYS) {
5
+ if (key in style) {
6
+ filtered[key] = style[key];
7
+ }
8
+ }
9
+ return filtered;
10
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Function to format a distance value.
3
+ * - If the input is an integer, it returns the integer value.
4
+ * - If the input is a float, it returns the value formatted to a custom toFixed value decimal places.
5
+ * - If the input is null or undefined, it returns 0.
6
+ *
7
+ * *Note:* The toFixed value should be between 1 and 5, otherwise it defaults to 2.
8
+ * @example
9
+ * ```js
10
+ * import { fixedDistance } from '@estuary-solutions/rn-core-ui/utils';
11
+ * const distance = fixedDistance(123.456); // "123.46"
12
+ * ```
13
+ */
14
+ declare const _default: (distance?: number, toFixed?: number) => string | number;
15
+ export default _default;
16
+ //# sourceMappingURL=fixedDistance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixedDistance.d.ts","sourceRoot":"","sources":["../../src/utils/fixedDistance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;yBACa,WAAU,MAAU,EAAE,UAAS,MAAU;AAAzD,wBAGE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Function to format a distance value.
3
+ * - If the input is an integer, it returns the integer value.
4
+ * - If the input is a float, it returns the value formatted to a custom toFixed value decimal places.
5
+ * - If the input is null or undefined, it returns 0.
6
+ *
7
+ * *Note:* The toFixed value should be between 1 and 5, otherwise it defaults to 2.
8
+ * @example
9
+ * ```js
10
+ * import { fixedDistance } from '@estuary-solutions/rn-core-ui/utils';
11
+ * const distance = fixedDistance(123.456); // "123.46"
12
+ * ```
13
+ */
14
+ export default (distance = 0, toFixed = 2) => {
15
+ const toFixedVal = (toFixed < 1 || toFixed > 5) ? 2 : toFixed;
16
+ return Number.isInteger(Number(distance)) ? distance : distance === null || distance === void 0 ? void 0 : distance.toFixed(toFixedVal);
17
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Function to format money values.
3
+ *
4
+ * `num` - The number to format. Default is 0.
5
+ *
6
+ * `maximumFractionDigits` - The maximum number of decimal places to display. Default is 0.
7
+ *
8
+ * `lang`
9
+ * * The locale to use for formatting. Default is 'en-US'.
10
+ * * This should be a BCP 47 language tag (e.g., 'en-US', 'vi-VN').
11
+ * * This is a string that contains a language code and an optional country code, separated by a hyphen.
12
+ * * Structure: `"[languageCode]-[countryCode]"`
13
+ *
14
+ * @example
15
+ * ```js
16
+ * import { formatMoney } from '@estuary-solutions/rn-core-ui/utils';
17
+ * const money = formatMoney(1234567.89); // "1,234,568"
18
+ * const money2 = formatMoney(1234567.89, 2); // "1,234,567.89"
19
+ * const money3 = formatMoney(1234567.89, 2, 'vi-VN'); // "1.234.567,89"
20
+ * ```
21
+ *
22
+ * To get more information. Please see the [Documentation](https://lubrytics.com:9929/minhnhat.tran/estuary-rn-core-ui?tab=readme-ov-file#formatmoney)
23
+ *
24
+ * *Reference:*
25
+ * - [List of ISO 639 language codes](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)
26
+ * - [List of ISO 3166-1 country codes](https://vi.wikipedia.org/wiki/ISO_3166-1)
27
+ */
28
+ declare const _default: (num?: number, maximumFractionDigits?: number, lang?: string) => string | 0;
29
+ export default _default;
30
+ //# sourceMappingURL=formatMoney.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatMoney.d.ts","sourceRoot":"","sources":["../../src/utils/formatMoney.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;yBAED,MAAK,MAAU,EACf,wBAAuB,MAAU,EACjC,OAAM,MAAgB;AAHxB,wBASE"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Function to format money values.
3
+ *
4
+ * `num` - The number to format. Default is 0.
5
+ *
6
+ * `maximumFractionDigits` - The maximum number of decimal places to display. Default is 0.
7
+ *
8
+ * `lang`
9
+ * * The locale to use for formatting. Default is 'en-US'.
10
+ * * This should be a BCP 47 language tag (e.g., 'en-US', 'vi-VN').
11
+ * * This is a string that contains a language code and an optional country code, separated by a hyphen.
12
+ * * Structure: `"[languageCode]-[countryCode]"`
13
+ *
14
+ * @example
15
+ * ```js
16
+ * import { formatMoney } from '@estuary-solutions/rn-core-ui/utils';
17
+ * const money = formatMoney(1234567.89); // "1,234,568"
18
+ * const money2 = formatMoney(1234567.89, 2); // "1,234,567.89"
19
+ * const money3 = formatMoney(1234567.89, 2, 'vi-VN'); // "1.234.567,89"
20
+ * ```
21
+ *
22
+ * To get more information. Please see the [Documentation](https://lubrytics.com:9929/minhnhat.tran/estuary-rn-core-ui?tab=readme-ov-file#formatmoney)
23
+ *
24
+ * *Reference:*
25
+ * - [List of ISO 639 language codes](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)
26
+ * - [List of ISO 3166-1 country codes](https://vi.wikipedia.org/wiki/ISO_3166-1)
27
+ */
28
+ export default (num = 0, maximumFractionDigits = 0, lang = 'en-US') => {
29
+ if (!num) {
30
+ return 0;
31
+ }
32
+ return new Intl.NumberFormat(lang, { maximumFractionDigits }).format(num);
33
+ };
@@ -0,0 +1,6 @@
1
+ export declare const ANDROID: boolean;
2
+ export declare const IOS: boolean;
3
+ export declare const MACOS: boolean;
4
+ export declare const WEB: boolean;
5
+ export declare const WINDOWS: boolean;
6
+ //# sourceMappingURL=getOS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOS.d.ts","sourceRoot":"","sources":["../../src/utils/getOS.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,SAA4B,CAAC;AACjD,eAAO,MAAM,GAAG,SAAwB,CAAC;AACzC,eAAO,MAAM,KAAK,SAA0B,CAAC;AAC7C,eAAO,MAAM,GAAG,SAAwB,CAAC;AACzC,eAAO,MAAM,OAAO,SAA4B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from 'react-native';
2
+ export const ANDROID = Platform.OS === 'android';
3
+ export const IOS = Platform.OS === 'ios';
4
+ export const MACOS = Platform.OS === 'macos';
5
+ export const WEB = Platform.OS === 'web';
6
+ export const WINDOWS = Platform.OS === 'windows';
@@ -0,0 +1,13 @@
1
+ import { statusBarHeight, StylePlatform, getPaddingBottom, getPaddingTop, isTablet } from './resolutions';
2
+ import { filterAllowedTextStyle } from './filters';
3
+ import { width, height, IPHONE_12_HEIGTH, IPHONE_12_WIDTH, scale, scaleH, scaleFont, moderateScale, moderateHeightScale } from './scale';
4
+ import cleanTagHTML from './cleanTagHTML';
5
+ import { convertString, convertNumber, convertSeconds, formatHour } from './converter';
6
+ import debounce from './debounce';
7
+ import fixedDistance from './fixedDistance';
8
+ import formatMoney from './formatMoney';
9
+ import limitedString from './limitedString';
10
+ import { IOS, ANDROID, MACOS, WEB, WINDOWS } from './getOS';
11
+ export { default as colorsUtils } from './colors';
12
+ export { width, height, IPHONE_12_HEIGTH, IPHONE_12_WIDTH, scale, scaleH, scaleFont, statusBarHeight, filterAllowedTextStyle, moderateScale, moderateHeightScale, StylePlatform, getPaddingBottom, getPaddingTop, isTablet, cleanTagHTML, convertString, convertNumber, convertSeconds, formatHour, debounce, fixedDistance, formatMoney, limitedString, IOS, ANDROID, MACOS, WEB, WINDOWS };
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EACL,KAAK,EACL,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,KAAK,EACL,MAAM,EACN,SAAS,EACT,aAAa,EACb,mBAAmB,EACpB,MAAM,SAAS,CAAC;AACjB,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,UAAU,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EACL,KAAK,EACL,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,KAAK,EACL,MAAM,EACN,SAAS,EACT,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,UAAU,EACV,QAAQ,EACR,aAAa,EACb,WAAW,EACX,aAAa,EACb,GAAG,EACH,OAAO,EACP,KAAK,EACL,GAAG,EACH,OAAO,EACR,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { statusBarHeight, StylePlatform, getPaddingBottom, getPaddingTop, isTablet, } from './resolutions';
2
+ import { filterAllowedTextStyle } from './filters';
3
+ import { width, height, IPHONE_12_HEIGTH, IPHONE_12_WIDTH, scale, scaleH, scaleFont, moderateScale, moderateHeightScale, } from './scale';
4
+ import cleanTagHTML from './cleanTagHTML';
5
+ import { convertString, convertNumber, convertSeconds, formatHour, } from './converter';
6
+ import debounce from './debounce';
7
+ import fixedDistance from './fixedDistance';
8
+ import formatMoney from './formatMoney';
9
+ import limitedString from './limitedString';
10
+ import { IOS, ANDROID, MACOS, WEB, WINDOWS } from './getOS';
11
+ export { default as colorsUtils } from './colors';
12
+ export { width, height, IPHONE_12_HEIGTH, IPHONE_12_WIDTH, scale, scaleH, scaleFont, statusBarHeight, filterAllowedTextStyle, moderateScale, moderateHeightScale, StylePlatform, getPaddingBottom, getPaddingTop, isTablet, cleanTagHTML, convertString, convertNumber, convertSeconds, formatHour, debounce, fixedDistance, formatMoney, limitedString, IOS, ANDROID, MACOS, WEB, WINDOWS };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Function to limit the number of words in a string.
3
+ * @param {string} str - The string to limit. *Default:* str = ''
4
+ * @param {number} maxLength - The maximum number of words allowed. *Default:* maxLength = 5
5
+ * @returns {string} - The limited string
6
+ * @example
7
+ * ```js
8
+ * import { limitedString } from '@estuary-solutions/rn-core-ui/utils';
9
+ * const inputString = "Lorem Ipsum is simply dummy text of the printing and typesetting industry";
10
+ * console.log(limitedString(inputString)); // "Lorem Ipsum is simply dummy..."
11
+ * ```
12
+ */
13
+ declare const _default: (str?: string, maxLength?: number) => string;
14
+ export default _default;
15
+ //# sourceMappingURL=limitedString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limitedString.d.ts","sourceRoot":"","sources":["../../src/utils/limitedString.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;yBACa,MAAK,MAAW,EAAE,YAAW,MAAU,KAAE,MAAM;AAA/D,wBAME"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Function to limit the number of words in a string.
3
+ * @param {string} str - The string to limit. *Default:* str = ''
4
+ * @param {number} maxLength - The maximum number of words allowed. *Default:* maxLength = 5
5
+ * @returns {string} - The limited string
6
+ * @example
7
+ * ```js
8
+ * import { limitedString } from '@estuary-solutions/rn-core-ui/utils';
9
+ * const inputString = "Lorem Ipsum is simply dummy text of the printing and typesetting industry";
10
+ * console.log(limitedString(inputString)); // "Lorem Ipsum is simply dummy..."
11
+ * ```
12
+ */
13
+ export default (str = '', maxLength = 5) => {
14
+ let arr = str.split(' ');
15
+ if (arr.length > maxLength) {
16
+ return arr.slice(0, maxLength).join(' ') + '...';
17
+ }
18
+ return str;
19
+ };
@@ -0,0 +1,65 @@
1
+ import { StyleProp } from 'react-native';
2
+ /**
3
+ * getPaddingTop - Get the top padding based on the device type
4
+ *
5
+ * 26 OPPO
6
+ * 28 NOKIA
7
+ * @returns {number} - Top padding
8
+ * @example
9
+ * ```jsx
10
+ * import { getPaddingTop } from '@estuary-solutions/rn-core-ui/utils';
11
+ * const paddingTop = getPaddingTop();
12
+ * console.log("paddingTop:", paddingTop);
13
+ * ```
14
+ */
15
+ export declare const getPaddingTop: () => number;
16
+ /**
17
+ * getPaddingBottom - Get the bottom padding based on the device type
18
+ * @returns {number} - Bottom padding
19
+ * @example
20
+ * ```jsx
21
+ * import { getPaddingBottom } from '@estuary-solutions/rn-core-ui/utils';
22
+ * const paddingBottom = getPaddingBottom();
23
+ * console.log("paddingBottom:", paddingBottom);
24
+ * ```
25
+ */
26
+ export declare const getPaddingBottom: () => number;
27
+ /**
28
+ * isTablet - Check if the device is a tablet
29
+ * @returns {boolean} - true if the device is a tablet, false otherwise
30
+ * @example
31
+ * ```jsx
32
+ * import { isTablet } from '@estuary-solutions/rn-core-ui/utils';
33
+ * console.log("isTablet", isTablet); // true/false
34
+ * ```
35
+ */
36
+ export declare const isTablet: boolean;
37
+ /**
38
+ * Use this function to get the styles based on the device type
39
+ * @example
40
+ * ```jsx
41
+ * <View style={StylePlatform({
42
+ tablet: styles.containerTablet,
43
+ phone: styles.containerPhone
44
+ })}>
45
+ <Text style={StylePlatform({
46
+ tablet: styles.textTablet,
47
+ phone: styles.textPhone
48
+ })}>
49
+ Hello, Platform!
50
+ </Text>
51
+ </View>
52
+ ```
53
+ */
54
+ export declare const StylePlatform: (styles: StyleProp<any>) => any;
55
+ /**
56
+ * statusBarHeight of the device
57
+ * @returns {number} - statusBarHeight
58
+ * @example
59
+ * ```jsx
60
+ * import { statusBarHeight } from '@estuary-solutions/rn-core-ui/utils';
61
+ * console.log("statusBarHeight", statusBarHeight);
62
+ * ```
63
+ */
64
+ export declare const statusBarHeight: number;
65
+ //# sourceMappingURL=resolutions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolutions.d.ts","sourceRoot":"","sources":["../../src/utils/resolutions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,SAAS,EAAE,MAAM,cAAc,CAAC;AAO9D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,QAAO,MAKhC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,QAAO,MAGnC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,SAAwB,CAAC;AAE9C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,CAAC,GAAG,CAAC,QAKnD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,QAAsF,CAAC"}