@fattureincloud-mobile/fic-mobile-ds 1.0.0 → 1.2.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 (469) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +31 -0
  3. package/lib/commonjs/components/Tag/Tag.js +44 -0
  4. package/lib/commonjs/components/Tag/Tag.js.map +1 -0
  5. package/lib/commonjs/components/Tag/index.js +14 -0
  6. package/lib/commonjs/components/Tag/index.js.map +1 -0
  7. package/lib/commonjs/components/Touchable/Touchable.js +79 -0
  8. package/lib/commonjs/components/Touchable/Touchable.js.map +1 -0
  9. package/lib/commonjs/components/Touchable/index.js +14 -0
  10. package/lib/commonjs/components/Touchable/index.js.map +1 -0
  11. package/lib/commonjs/components/base/DatePicker/DatePicker.js +257 -0
  12. package/lib/commonjs/components/base/DatePicker/DatePicker.js.map +1 -0
  13. package/lib/commonjs/components/base/DatePicker/index.js +14 -0
  14. package/lib/commonjs/components/base/DatePicker/index.js.map +1 -0
  15. package/lib/commonjs/components/base/HeaderArrows/HeaderArrows.js +77 -0
  16. package/lib/commonjs/components/base/HeaderArrows/HeaderArrows.js.map +1 -0
  17. package/lib/commonjs/components/base/HeaderArrows/index.js +14 -0
  18. package/lib/commonjs/components/base/HeaderArrows/index.js.map +1 -0
  19. package/lib/commonjs/components/buttons/FicButton/FicButton.js +42 -0
  20. package/lib/commonjs/components/buttons/FicButton/FicButton.js.map +1 -0
  21. package/lib/commonjs/components/buttons/FicButton/FicButton.types.js +6 -0
  22. package/lib/commonjs/components/buttons/FicButton/FicButton.types.js.map +1 -0
  23. package/lib/commonjs/components/buttons/FicButton/FicButtonIcon.js +104 -0
  24. package/lib/commonjs/components/buttons/FicButton/FicButtonIcon.js.map +1 -0
  25. package/lib/commonjs/components/buttons/FicButton/FicButtonPrimary.js +121 -0
  26. package/lib/commonjs/components/buttons/FicButton/FicButtonPrimary.js.map +1 -0
  27. package/lib/commonjs/components/buttons/FicButton/FicButtonSecondary.js +123 -0
  28. package/lib/commonjs/components/buttons/FicButton/FicButtonSecondary.js.map +1 -0
  29. package/lib/commonjs/components/buttons/FicButton/FicButtonTertiary.js +144 -0
  30. package/lib/commonjs/components/buttons/FicButton/FicButtonTertiary.js.map +1 -0
  31. package/lib/commonjs/components/buttons/FicButton/constants.js +23 -0
  32. package/lib/commonjs/components/buttons/FicButton/constants.js.map +1 -0
  33. package/lib/commonjs/components/buttons/FicButton/index.js +14 -0
  34. package/lib/commonjs/components/buttons/FicButton/index.js.map +1 -0
  35. package/lib/commonjs/components/buttons/FicButton/themes/dark.js +291 -0
  36. package/lib/commonjs/components/buttons/FicButton/themes/dark.js.map +1 -0
  37. package/lib/commonjs/components/buttons/FicButton/themes/index.js +14 -0
  38. package/lib/commonjs/components/buttons/FicButton/themes/index.js.map +1 -0
  39. package/lib/commonjs/components/buttons/FicButton/themes/light.js +311 -0
  40. package/lib/commonjs/components/buttons/FicButton/themes/light.js.map +1 -0
  41. package/lib/commonjs/components/buttons/FicButtonGroup/FicButtonGroup.js +54 -0
  42. package/lib/commonjs/components/buttons/FicButtonGroup/FicButtonGroup.js.map +1 -0
  43. package/lib/commonjs/components/buttons/FicButtonGroup/FicButtonGroup.types.js +6 -0
  44. package/lib/commonjs/components/buttons/FicButtonGroup/FicButtonGroup.types.js.map +1 -0
  45. package/lib/commonjs/components/buttons/FicButtonGroup/index.js +14 -0
  46. package/lib/commonjs/components/buttons/FicButtonGroup/index.js.map +1 -0
  47. package/lib/commonjs/components/notifications/Banner/Banner.js +96 -0
  48. package/lib/commonjs/components/notifications/Banner/Banner.js.map +1 -0
  49. package/lib/commonjs/components/notifications/Banner/Banner.types.js +6 -0
  50. package/lib/commonjs/components/notifications/Banner/Banner.types.js.map +1 -0
  51. package/lib/commonjs/components/notifications/Banner/index.js +14 -0
  52. package/lib/commonjs/components/notifications/Banner/index.js.map +1 -0
  53. package/lib/commonjs/components/notifications/Banner/themes/dark.js +47 -0
  54. package/lib/commonjs/components/notifications/Banner/themes/dark.js.map +1 -0
  55. package/lib/commonjs/components/notifications/Banner/themes/index.js +21 -0
  56. package/lib/commonjs/components/notifications/Banner/themes/index.js.map +1 -0
  57. package/lib/commonjs/components/notifications/Banner/themes/light.js +47 -0
  58. package/lib/commonjs/components/notifications/Banner/themes/light.js.map +1 -0
  59. package/lib/commonjs/components/typographies/Body/Body.js +35 -0
  60. package/lib/commonjs/components/typographies/Body/Body.js.map +1 -0
  61. package/lib/commonjs/components/typographies/Body/index.js +14 -0
  62. package/lib/commonjs/components/typographies/Body/index.js.map +1 -0
  63. package/lib/commonjs/components/typographies/ButtonTitle/ButtonTitle.js +45 -0
  64. package/lib/commonjs/components/typographies/ButtonTitle/ButtonTitle.js.map +1 -0
  65. package/lib/commonjs/components/typographies/ButtonTitle/index.js +14 -0
  66. package/lib/commonjs/components/typographies/ButtonTitle/index.js.map +1 -0
  67. package/lib/commonjs/components/typographies/Callout/Callout.js +35 -0
  68. package/lib/commonjs/components/typographies/Callout/Callout.js.map +1 -0
  69. package/lib/commonjs/components/typographies/Callout/index.js +14 -0
  70. package/lib/commonjs/components/typographies/Callout/index.js.map +1 -0
  71. package/lib/commonjs/components/typographies/CaptionOne/CaptionOne.js +35 -0
  72. package/lib/commonjs/components/typographies/CaptionOne/CaptionOne.js.map +1 -0
  73. package/lib/commonjs/components/typographies/CaptionOne/index.js +14 -0
  74. package/lib/commonjs/components/typographies/CaptionOne/index.js.map +1 -0
  75. package/lib/commonjs/components/typographies/CaptionTwo/CaptionTwo.js +35 -0
  76. package/lib/commonjs/components/typographies/CaptionTwo/CaptionTwo.js.map +1 -0
  77. package/lib/commonjs/components/typographies/CaptionTwo/index.js +14 -0
  78. package/lib/commonjs/components/typographies/CaptionTwo/index.js.map +1 -0
  79. package/lib/commonjs/components/typographies/Footnote/Footnote.js +35 -0
  80. package/lib/commonjs/components/typographies/Footnote/Footnote.js.map +1 -0
  81. package/lib/commonjs/components/typographies/Footnote/index.js +14 -0
  82. package/lib/commonjs/components/typographies/Footnote/index.js.map +1 -0
  83. package/lib/commonjs/components/typographies/Headline/Headline.js +35 -0
  84. package/lib/commonjs/components/typographies/Headline/Headline.js.map +1 -0
  85. package/lib/commonjs/components/typographies/Headline/index.js +14 -0
  86. package/lib/commonjs/components/typographies/Headline/index.js.map +1 -0
  87. package/lib/commonjs/components/typographies/LargeTitle/LargeTitle.js +35 -0
  88. package/lib/commonjs/components/typographies/LargeTitle/LargeTitle.js.map +1 -0
  89. package/lib/commonjs/components/typographies/LargeTitle/index.js +14 -0
  90. package/lib/commonjs/components/typographies/LargeTitle/index.js.map +1 -0
  91. package/lib/commonjs/components/typographies/README.md +22 -0
  92. package/lib/commonjs/components/typographies/Subhead/Subhead.js +35 -0
  93. package/lib/commonjs/components/typographies/Subhead/Subhead.js.map +1 -0
  94. package/lib/commonjs/components/typographies/Subhead/index.js +14 -0
  95. package/lib/commonjs/components/typographies/Subhead/index.js.map +1 -0
  96. package/lib/commonjs/components/typographies/TitleOne/TitleOne.js +35 -0
  97. package/lib/commonjs/components/typographies/TitleOne/TitleOne.js.map +1 -0
  98. package/lib/commonjs/components/typographies/TitleOne/index.js +14 -0
  99. package/lib/commonjs/components/typographies/TitleOne/index.js.map +1 -0
  100. package/lib/commonjs/components/typographies/TitleThree/TitleThree.js +35 -0
  101. package/lib/commonjs/components/typographies/TitleThree/TitleThree.js.map +1 -0
  102. package/lib/commonjs/components/typographies/TitleThree/index.js +14 -0
  103. package/lib/commonjs/components/typographies/TitleThree/index.js.map +1 -0
  104. package/lib/commonjs/components/typographies/TitleTwo/TitleTwo.js +35 -0
  105. package/lib/commonjs/components/typographies/TitleTwo/TitleTwo.js.map +1 -0
  106. package/lib/commonjs/components/typographies/TitleTwo/index.js +14 -0
  107. package/lib/commonjs/components/typographies/TitleTwo/index.js.map +1 -0
  108. package/lib/commonjs/components/typographies/font.js +33 -0
  109. package/lib/commonjs/components/typographies/font.js.map +1 -0
  110. package/lib/commonjs/hooks/useTheme.js +24 -0
  111. package/lib/commonjs/hooks/useTheme.js.map +1 -0
  112. package/lib/commonjs/index.js +206 -0
  113. package/lib/commonjs/index.js.map +1 -0
  114. package/lib/commonjs/providers/DesignSystemProvider/DesignSystemProvider.js +30 -0
  115. package/lib/commonjs/providers/DesignSystemProvider/DesignSystemProvider.js.map +1 -0
  116. package/lib/commonjs/providers/DesignSystemProvider/index.js +14 -0
  117. package/lib/commonjs/providers/DesignSystemProvider/index.js.map +1 -0
  118. package/lib/commonjs/providers/IconProvider/IconProvider.js +35 -0
  119. package/lib/commonjs/providers/IconProvider/IconProvider.js.map +1 -0
  120. package/lib/commonjs/providers/IconProvider/index.js +20 -0
  121. package/lib/commonjs/providers/IconProvider/index.js.map +1 -0
  122. package/lib/commonjs/providers/ThemeProvider/ThemeProvider.js +20 -0
  123. package/lib/commonjs/providers/ThemeProvider/ThemeProvider.js.map +1 -0
  124. package/lib/commonjs/styles/calendarTheme.js +6 -0
  125. package/lib/commonjs/styles/calendarTheme.js.map +1 -0
  126. package/lib/commonjs/styles/colors.js +109 -0
  127. package/lib/commonjs/styles/colors.js.map +1 -0
  128. package/lib/commonjs/styles/globalStyles.js +41 -0
  129. package/lib/commonjs/styles/globalStyles.js.map +1 -0
  130. package/lib/commonjs/styles/space.js +34 -0
  131. package/lib/commonjs/styles/space.js.map +1 -0
  132. package/lib/commonjs/styles/theme.js +421 -0
  133. package/lib/commonjs/styles/theme.js.map +1 -0
  134. package/lib/commonjs/utils/locale.js +50 -0
  135. package/lib/commonjs/utils/locale.js.map +1 -0
  136. package/lib/module/components/Tag/Tag.js +37 -0
  137. package/lib/module/components/Tag/Tag.js.map +1 -0
  138. package/lib/module/components/Tag/index.js +3 -0
  139. package/lib/module/components/Tag/index.js.map +1 -0
  140. package/lib/module/components/Touchable/Touchable.js +72 -0
  141. package/lib/module/components/Touchable/Touchable.js.map +1 -0
  142. package/lib/module/components/Touchable/index.js +3 -0
  143. package/lib/module/components/Touchable/index.js.map +1 -0
  144. package/lib/module/components/base/DatePicker/DatePicker.js +251 -0
  145. package/lib/module/components/base/DatePicker/DatePicker.js.map +1 -0
  146. package/lib/module/components/base/DatePicker/index.js +3 -0
  147. package/lib/module/components/base/DatePicker/index.js.map +1 -0
  148. package/lib/module/components/base/HeaderArrows/HeaderArrows.js +70 -0
  149. package/lib/module/components/base/HeaderArrows/HeaderArrows.js.map +1 -0
  150. package/lib/module/components/base/HeaderArrows/index.js +3 -0
  151. package/lib/module/components/base/HeaderArrows/index.js.map +1 -0
  152. package/lib/module/components/buttons/FicButton/FicButton.js +36 -0
  153. package/lib/module/components/buttons/FicButton/FicButton.js.map +1 -0
  154. package/lib/module/components/buttons/FicButton/FicButton.types.js +2 -0
  155. package/lib/module/components/buttons/FicButton/FicButton.types.js.map +1 -0
  156. package/lib/module/components/buttons/FicButton/FicButtonIcon.js +96 -0
  157. package/lib/module/components/buttons/FicButton/FicButtonIcon.js.map +1 -0
  158. package/lib/module/components/buttons/FicButton/FicButtonPrimary.js +114 -0
  159. package/lib/module/components/buttons/FicButton/FicButtonPrimary.js.map +1 -0
  160. package/lib/module/components/buttons/FicButton/FicButtonSecondary.js +116 -0
  161. package/lib/module/components/buttons/FicButton/FicButtonSecondary.js.map +1 -0
  162. package/lib/module/components/buttons/FicButton/FicButtonTertiary.js +137 -0
  163. package/lib/module/components/buttons/FicButton/FicButtonTertiary.js.map +1 -0
  164. package/lib/module/components/buttons/FicButton/constants.js +17 -0
  165. package/lib/module/components/buttons/FicButton/constants.js.map +1 -0
  166. package/lib/module/components/buttons/FicButton/index.js +3 -0
  167. package/lib/module/components/buttons/FicButton/index.js.map +1 -0
  168. package/lib/module/components/buttons/FicButton/themes/dark.js +285 -0
  169. package/lib/module/components/buttons/FicButton/themes/dark.js.map +1 -0
  170. package/lib/module/components/buttons/FicButton/themes/index.js +3 -0
  171. package/lib/module/components/buttons/FicButton/themes/index.js.map +1 -0
  172. package/lib/module/components/buttons/FicButton/themes/light.js +305 -0
  173. package/lib/module/components/buttons/FicButton/themes/light.js.map +1 -0
  174. package/lib/module/components/buttons/FicButtonGroup/FicButtonGroup.js +47 -0
  175. package/lib/module/components/buttons/FicButtonGroup/FicButtonGroup.js.map +1 -0
  176. package/lib/module/components/buttons/FicButtonGroup/FicButtonGroup.types.js +2 -0
  177. package/lib/module/components/buttons/FicButtonGroup/FicButtonGroup.types.js.map +1 -0
  178. package/lib/module/components/buttons/FicButtonGroup/index.js +3 -0
  179. package/lib/module/components/buttons/FicButtonGroup/index.js.map +1 -0
  180. package/lib/module/components/notifications/Banner/Banner.js +89 -0
  181. package/lib/module/components/notifications/Banner/Banner.js.map +1 -0
  182. package/lib/module/components/notifications/Banner/Banner.types.js +2 -0
  183. package/lib/module/components/notifications/Banner/Banner.types.js.map +1 -0
  184. package/lib/module/components/notifications/Banner/index.js +3 -0
  185. package/lib/module/components/notifications/Banner/index.js.map +1 -0
  186. package/lib/module/components/notifications/Banner/themes/dark.js +41 -0
  187. package/lib/module/components/notifications/Banner/themes/dark.js.map +1 -0
  188. package/lib/module/components/notifications/Banner/themes/index.js +4 -0
  189. package/lib/module/components/notifications/Banner/themes/index.js.map +1 -0
  190. package/lib/module/components/notifications/Banner/themes/light.js +41 -0
  191. package/lib/module/components/notifications/Banner/themes/light.js.map +1 -0
  192. package/lib/module/components/typographies/Body/Body.js +29 -0
  193. package/lib/module/components/typographies/Body/Body.js.map +1 -0
  194. package/lib/module/components/typographies/Body/index.js +3 -0
  195. package/lib/module/components/typographies/Body/index.js.map +1 -0
  196. package/lib/module/components/typographies/ButtonTitle/ButtonTitle.js +39 -0
  197. package/lib/module/components/typographies/ButtonTitle/ButtonTitle.js.map +1 -0
  198. package/lib/module/components/typographies/ButtonTitle/index.js +3 -0
  199. package/lib/module/components/typographies/ButtonTitle/index.js.map +1 -0
  200. package/lib/module/components/typographies/Callout/Callout.js +29 -0
  201. package/lib/module/components/typographies/Callout/Callout.js.map +1 -0
  202. package/lib/module/components/typographies/Callout/index.js +3 -0
  203. package/lib/module/components/typographies/Callout/index.js.map +1 -0
  204. package/lib/module/components/typographies/CaptionOne/CaptionOne.js +29 -0
  205. package/lib/module/components/typographies/CaptionOne/CaptionOne.js.map +1 -0
  206. package/lib/module/components/typographies/CaptionOne/index.js +3 -0
  207. package/lib/module/components/typographies/CaptionOne/index.js.map +1 -0
  208. package/lib/module/components/typographies/CaptionTwo/CaptionTwo.js +29 -0
  209. package/lib/module/components/typographies/CaptionTwo/CaptionTwo.js.map +1 -0
  210. package/lib/module/components/typographies/CaptionTwo/index.js +3 -0
  211. package/lib/module/components/typographies/CaptionTwo/index.js.map +1 -0
  212. package/lib/module/components/typographies/Footnote/Footnote.js +29 -0
  213. package/lib/module/components/typographies/Footnote/Footnote.js.map +1 -0
  214. package/lib/module/components/typographies/Footnote/index.js +3 -0
  215. package/lib/module/components/typographies/Footnote/index.js.map +1 -0
  216. package/lib/module/components/typographies/Headline/Headline.js +29 -0
  217. package/lib/module/components/typographies/Headline/Headline.js.map +1 -0
  218. package/lib/module/components/typographies/Headline/index.js +3 -0
  219. package/lib/module/components/typographies/Headline/index.js.map +1 -0
  220. package/lib/module/components/typographies/LargeTitle/LargeTitle.js +29 -0
  221. package/lib/module/components/typographies/LargeTitle/LargeTitle.js.map +1 -0
  222. package/lib/module/components/typographies/LargeTitle/index.js +3 -0
  223. package/lib/module/components/typographies/LargeTitle/index.js.map +1 -0
  224. package/lib/module/components/typographies/README.md +22 -0
  225. package/lib/module/components/typographies/Subhead/Subhead.js +29 -0
  226. package/lib/module/components/typographies/Subhead/Subhead.js.map +1 -0
  227. package/lib/module/components/typographies/Subhead/index.js +3 -0
  228. package/lib/module/components/typographies/Subhead/index.js.map +1 -0
  229. package/lib/module/components/typographies/TitleOne/TitleOne.js +29 -0
  230. package/lib/module/components/typographies/TitleOne/TitleOne.js.map +1 -0
  231. package/lib/module/components/typographies/TitleOne/index.js +3 -0
  232. package/lib/module/components/typographies/TitleOne/index.js.map +1 -0
  233. package/lib/module/components/typographies/TitleThree/TitleThree.js +29 -0
  234. package/lib/module/components/typographies/TitleThree/TitleThree.js.map +1 -0
  235. package/lib/module/components/typographies/TitleThree/index.js +3 -0
  236. package/lib/module/components/typographies/TitleThree/index.js.map +1 -0
  237. package/lib/module/components/typographies/TitleTwo/TitleTwo.js +29 -0
  238. package/lib/module/components/typographies/TitleTwo/TitleTwo.js.map +1 -0
  239. package/lib/module/components/typographies/TitleTwo/index.js +3 -0
  240. package/lib/module/components/typographies/TitleTwo/index.js.map +1 -0
  241. package/lib/module/components/typographies/font.js +26 -0
  242. package/lib/module/components/typographies/font.js.map +1 -0
  243. package/lib/module/hooks/useTheme.js +16 -0
  244. package/lib/module/hooks/useTheme.js.map +1 -0
  245. package/lib/module/index.js +26 -0
  246. package/lib/module/index.js.map +1 -0
  247. package/lib/module/providers/DesignSystemProvider/DesignSystemProvider.js +22 -0
  248. package/lib/module/providers/DesignSystemProvider/DesignSystemProvider.js.map +1 -0
  249. package/lib/module/providers/DesignSystemProvider/index.js +3 -0
  250. package/lib/module/providers/DesignSystemProvider/index.js.map +1 -0
  251. package/lib/module/providers/IconProvider/IconProvider.js +27 -0
  252. package/lib/module/providers/IconProvider/IconProvider.js.map +1 -0
  253. package/lib/module/providers/IconProvider/index.js +3 -0
  254. package/lib/module/providers/IconProvider/index.js.map +1 -0
  255. package/lib/module/providers/ThemeProvider/ThemeProvider.js +13 -0
  256. package/lib/module/providers/ThemeProvider/ThemeProvider.js.map +1 -0
  257. package/lib/module/styles/calendarTheme.js +2 -0
  258. package/lib/module/styles/calendarTheme.js.map +1 -0
  259. package/lib/module/styles/colors.js +103 -0
  260. package/lib/module/styles/colors.js.map +1 -0
  261. package/lib/module/styles/globalStyles.js +35 -0
  262. package/lib/module/styles/globalStyles.js.map +1 -0
  263. package/lib/module/styles/space.js +28 -0
  264. package/lib/module/styles/space.js.map +1 -0
  265. package/lib/module/styles/theme.js +414 -0
  266. package/lib/module/styles/theme.js.map +1 -0
  267. package/lib/module/utils/locale.js +42 -0
  268. package/lib/module/utils/locale.js.map +1 -0
  269. package/lib/package.json +138 -0
  270. package/lib/typescript/components/Tag/Tag.d.ts +13 -0
  271. package/lib/typescript/components/Tag/Tag.d.ts.map +1 -0
  272. package/lib/typescript/components/Tag/index.d.ts +3 -0
  273. package/lib/typescript/components/Tag/index.d.ts.map +1 -0
  274. package/lib/typescript/components/Touchable/Touchable.d.ts +16 -0
  275. package/lib/typescript/components/Touchable/Touchable.d.ts.map +1 -0
  276. package/lib/typescript/components/Touchable/index.d.ts +3 -0
  277. package/lib/typescript/components/Touchable/index.d.ts.map +1 -0
  278. package/lib/typescript/components/base/DatePicker/DatePicker.d.ts +60 -0
  279. package/lib/typescript/components/base/DatePicker/DatePicker.d.ts.map +1 -0
  280. package/lib/typescript/components/base/DatePicker/index.d.ts +4 -0
  281. package/lib/typescript/components/base/DatePicker/index.d.ts.map +1 -0
  282. package/lib/typescript/components/base/HeaderArrows/HeaderArrows.d.ts +16 -0
  283. package/lib/typescript/components/base/HeaderArrows/HeaderArrows.d.ts.map +1 -0
  284. package/lib/typescript/components/base/HeaderArrows/index.d.ts +3 -0
  285. package/lib/typescript/components/base/HeaderArrows/index.d.ts.map +1 -0
  286. package/lib/typescript/components/buttons/FicButton/FicButton.d.ts +5 -0
  287. package/lib/typescript/components/buttons/FicButton/FicButton.d.ts.map +1 -0
  288. package/lib/typescript/components/buttons/FicButton/FicButton.types.d.ts +87 -0
  289. package/lib/typescript/components/buttons/FicButton/FicButton.types.d.ts.map +1 -0
  290. package/lib/typescript/components/buttons/FicButton/FicButtonIcon.d.ts +5 -0
  291. package/lib/typescript/components/buttons/FicButton/FicButtonIcon.d.ts.map +1 -0
  292. package/lib/typescript/components/buttons/FicButton/FicButtonPrimary.d.ts +5 -0
  293. package/lib/typescript/components/buttons/FicButton/FicButtonPrimary.d.ts.map +1 -0
  294. package/lib/typescript/components/buttons/FicButton/FicButtonSecondary.d.ts +5 -0
  295. package/lib/typescript/components/buttons/FicButton/FicButtonSecondary.d.ts.map +1 -0
  296. package/lib/typescript/components/buttons/FicButton/FicButtonTertiary.d.ts +5 -0
  297. package/lib/typescript/components/buttons/FicButton/FicButtonTertiary.d.ts.map +1 -0
  298. package/lib/typescript/components/buttons/FicButton/constants.d.ts +13 -0
  299. package/lib/typescript/components/buttons/FicButton/constants.d.ts.map +1 -0
  300. package/lib/typescript/components/buttons/FicButton/index.d.ts +5 -0
  301. package/lib/typescript/components/buttons/FicButton/index.d.ts.map +1 -0
  302. package/lib/typescript/components/buttons/FicButton/themes/dark.d.ts +4 -0
  303. package/lib/typescript/components/buttons/FicButton/themes/dark.d.ts.map +1 -0
  304. package/lib/typescript/components/buttons/FicButton/themes/index.d.ts +3 -0
  305. package/lib/typescript/components/buttons/FicButton/themes/index.d.ts.map +1 -0
  306. package/lib/typescript/components/buttons/FicButton/themes/light.d.ts +4 -0
  307. package/lib/typescript/components/buttons/FicButton/themes/light.d.ts.map +1 -0
  308. package/lib/typescript/components/buttons/FicButtonGroup/FicButtonGroup.d.ts +5 -0
  309. package/lib/typescript/components/buttons/FicButtonGroup/FicButtonGroup.d.ts.map +1 -0
  310. package/lib/typescript/components/buttons/FicButtonGroup/FicButtonGroup.types.d.ts +10 -0
  311. package/lib/typescript/components/buttons/FicButtonGroup/FicButtonGroup.types.d.ts.map +1 -0
  312. package/lib/typescript/components/buttons/FicButtonGroup/index.d.ts +3 -0
  313. package/lib/typescript/components/buttons/FicButtonGroup/index.d.ts.map +1 -0
  314. package/lib/typescript/components/notifications/Banner/Banner.d.ts +5 -0
  315. package/lib/typescript/components/notifications/Banner/Banner.d.ts.map +1 -0
  316. package/lib/typescript/components/notifications/Banner/Banner.types.d.ts +50 -0
  317. package/lib/typescript/components/notifications/Banner/Banner.types.d.ts.map +1 -0
  318. package/lib/typescript/components/notifications/Banner/index.d.ts +3 -0
  319. package/lib/typescript/components/notifications/Banner/index.d.ts.map +1 -0
  320. package/lib/typescript/components/notifications/Banner/themes/dark.d.ts +4 -0
  321. package/lib/typescript/components/notifications/Banner/themes/dark.d.ts.map +1 -0
  322. package/lib/typescript/components/notifications/Banner/themes/index.d.ts +4 -0
  323. package/lib/typescript/components/notifications/Banner/themes/index.d.ts.map +1 -0
  324. package/lib/typescript/components/notifications/Banner/themes/light.d.ts +4 -0
  325. package/lib/typescript/components/notifications/Banner/themes/light.d.ts.map +1 -0
  326. package/lib/typescript/components/typographies/Body/Body.d.ts +12 -0
  327. package/lib/typescript/components/typographies/Body/Body.d.ts.map +1 -0
  328. package/lib/typescript/components/typographies/Body/index.d.ts +3 -0
  329. package/lib/typescript/components/typographies/Body/index.d.ts.map +1 -0
  330. package/lib/typescript/components/typographies/ButtonTitle/ButtonTitle.d.ts +10 -0
  331. package/lib/typescript/components/typographies/ButtonTitle/ButtonTitle.d.ts.map +1 -0
  332. package/lib/typescript/components/typographies/ButtonTitle/index.d.ts +3 -0
  333. package/lib/typescript/components/typographies/ButtonTitle/index.d.ts.map +1 -0
  334. package/lib/typescript/components/typographies/Callout/Callout.d.ts +12 -0
  335. package/lib/typescript/components/typographies/Callout/Callout.d.ts.map +1 -0
  336. package/lib/typescript/components/typographies/Callout/index.d.ts +3 -0
  337. package/lib/typescript/components/typographies/Callout/index.d.ts.map +1 -0
  338. package/lib/typescript/components/typographies/CaptionOne/CaptionOne.d.ts +12 -0
  339. package/lib/typescript/components/typographies/CaptionOne/CaptionOne.d.ts.map +1 -0
  340. package/lib/typescript/components/typographies/CaptionOne/index.d.ts +3 -0
  341. package/lib/typescript/components/typographies/CaptionOne/index.d.ts.map +1 -0
  342. package/lib/typescript/components/typographies/CaptionTwo/CaptionTwo.d.ts +12 -0
  343. package/lib/typescript/components/typographies/CaptionTwo/CaptionTwo.d.ts.map +1 -0
  344. package/lib/typescript/components/typographies/CaptionTwo/index.d.ts +3 -0
  345. package/lib/typescript/components/typographies/CaptionTwo/index.d.ts.map +1 -0
  346. package/lib/typescript/components/typographies/Footnote/Footnote.d.ts +12 -0
  347. package/lib/typescript/components/typographies/Footnote/Footnote.d.ts.map +1 -0
  348. package/lib/typescript/components/typographies/Footnote/index.d.ts +3 -0
  349. package/lib/typescript/components/typographies/Footnote/index.d.ts.map +1 -0
  350. package/lib/typescript/components/typographies/Headline/Headline.d.ts +12 -0
  351. package/lib/typescript/components/typographies/Headline/Headline.d.ts.map +1 -0
  352. package/lib/typescript/components/typographies/Headline/index.d.ts +3 -0
  353. package/lib/typescript/components/typographies/Headline/index.d.ts.map +1 -0
  354. package/lib/typescript/components/typographies/LargeTitle/LargeTitle.d.ts +12 -0
  355. package/lib/typescript/components/typographies/LargeTitle/LargeTitle.d.ts.map +1 -0
  356. package/lib/typescript/components/typographies/LargeTitle/index.d.ts +3 -0
  357. package/lib/typescript/components/typographies/LargeTitle/index.d.ts.map +1 -0
  358. package/lib/typescript/components/typographies/Subhead/Subhead.d.ts +12 -0
  359. package/lib/typescript/components/typographies/Subhead/Subhead.d.ts.map +1 -0
  360. package/lib/typescript/components/typographies/Subhead/index.d.ts +3 -0
  361. package/lib/typescript/components/typographies/Subhead/index.d.ts.map +1 -0
  362. package/lib/typescript/components/typographies/TitleOne/TitleOne.d.ts +12 -0
  363. package/lib/typescript/components/typographies/TitleOne/TitleOne.d.ts.map +1 -0
  364. package/lib/typescript/components/typographies/TitleOne/index.d.ts +3 -0
  365. package/lib/typescript/components/typographies/TitleOne/index.d.ts.map +1 -0
  366. package/lib/typescript/components/typographies/TitleThree/TitleThree.d.ts +12 -0
  367. package/lib/typescript/components/typographies/TitleThree/TitleThree.d.ts.map +1 -0
  368. package/lib/typescript/components/typographies/TitleThree/index.d.ts +3 -0
  369. package/lib/typescript/components/typographies/TitleThree/index.d.ts.map +1 -0
  370. package/lib/typescript/components/typographies/TitleTwo/TitleTwo.d.ts +12 -0
  371. package/lib/typescript/components/typographies/TitleTwo/TitleTwo.d.ts.map +1 -0
  372. package/lib/typescript/components/typographies/TitleTwo/index.d.ts +3 -0
  373. package/lib/typescript/components/typographies/TitleTwo/index.d.ts.map +1 -0
  374. package/lib/typescript/components/typographies/font.d.ts +9 -0
  375. package/lib/typescript/components/typographies/font.d.ts.map +1 -0
  376. package/lib/typescript/hooks/useTheme.d.ts +3 -0
  377. package/lib/typescript/hooks/useTheme.d.ts.map +1 -0
  378. package/lib/typescript/index.d.ts +31 -0
  379. package/lib/typescript/index.d.ts.map +1 -0
  380. package/lib/typescript/providers/DesignSystemProvider/DesignSystemProvider.d.ts +10 -0
  381. package/lib/typescript/providers/DesignSystemProvider/DesignSystemProvider.d.ts.map +1 -0
  382. package/lib/typescript/providers/DesignSystemProvider/index.d.ts +3 -0
  383. package/lib/typescript/providers/DesignSystemProvider/index.d.ts.map +1 -0
  384. package/lib/typescript/providers/IconProvider/IconProvider.d.ts +21 -0
  385. package/lib/typescript/providers/IconProvider/IconProvider.d.ts.map +1 -0
  386. package/lib/typescript/providers/IconProvider/index.d.ts +4 -0
  387. package/lib/typescript/providers/IconProvider/index.d.ts.map +1 -0
  388. package/lib/typescript/providers/ThemeProvider/ThemeProvider.d.ts +9 -0
  389. package/lib/typescript/providers/ThemeProvider/ThemeProvider.d.ts.map +1 -0
  390. package/lib/typescript/styles/calendarTheme.d.ts +24 -0
  391. package/lib/typescript/styles/calendarTheme.d.ts.map +1 -0
  392. package/lib/typescript/styles/colors.d.ts +100 -0
  393. package/lib/typescript/styles/colors.d.ts.map +1 -0
  394. package/lib/typescript/styles/globalStyles.d.ts +33 -0
  395. package/lib/typescript/styles/globalStyles.d.ts.map +1 -0
  396. package/lib/typescript/styles/space.d.ts +19 -0
  397. package/lib/typescript/styles/space.d.ts.map +1 -0
  398. package/lib/typescript/styles/theme.d.ts +183 -0
  399. package/lib/typescript/styles/theme.d.ts.map +1 -0
  400. package/lib/typescript/utils/locale.d.ts +15 -0
  401. package/lib/typescript/utils/locale.d.ts.map +1 -0
  402. package/package.json +30 -43
  403. package/src/components/Tag/Tag.tsx +59 -0
  404. package/src/components/Tag/index.ts +3 -0
  405. package/src/components/Touchable/Touchable.tsx +110 -0
  406. package/src/components/Touchable/index.ts +3 -0
  407. package/src/components/base/DatePicker/DatePicker.tsx +427 -0
  408. package/src/components/base/DatePicker/index.ts +4 -0
  409. package/src/components/base/HeaderArrows/HeaderArrows.tsx +93 -0
  410. package/src/components/base/HeaderArrows/index.ts +3 -0
  411. package/src/components/buttons/FicButton/FicButton.tsx +41 -0
  412. package/src/components/buttons/FicButton/FicButton.types.ts +114 -0
  413. package/src/components/buttons/FicButton/FicButtonIcon.tsx +161 -0
  414. package/src/components/buttons/FicButton/FicButtonPrimary.tsx +167 -0
  415. package/src/components/buttons/FicButton/FicButtonSecondary.tsx +168 -0
  416. package/src/components/buttons/FicButton/FicButtonTertiary.tsx +188 -0
  417. package/src/components/buttons/FicButton/constants.ts +23 -0
  418. package/src/components/buttons/FicButton/index.ts +5 -0
  419. package/src/components/buttons/FicButton/themes/dark.ts +273 -0
  420. package/src/components/buttons/FicButton/themes/index.ts +3 -0
  421. package/src/components/buttons/FicButton/themes/light.ts +293 -0
  422. package/src/components/buttons/FicButtonGroup/FicButtonGroup.tsx +40 -0
  423. package/src/components/buttons/FicButtonGroup/FicButtonGroup.types.ts +11 -0
  424. package/src/components/buttons/FicButtonGroup/index.ts +2 -0
  425. package/src/components/notifications/Banner/Banner.tsx +105 -0
  426. package/src/components/notifications/Banner/Banner.types.ts +69 -0
  427. package/src/components/notifications/Banner/index.ts +3 -0
  428. package/src/components/notifications/Banner/themes/dark.ts +43 -0
  429. package/src/components/notifications/Banner/themes/index.ts +4 -0
  430. package/src/components/notifications/Banner/themes/light.ts +43 -0
  431. package/src/components/typographies/Body/Body.tsx +38 -0
  432. package/src/components/typographies/Body/index.ts +3 -0
  433. package/src/components/typographies/ButtonTitle/ButtonTitle.tsx +51 -0
  434. package/src/components/typographies/ButtonTitle/index.ts +3 -0
  435. package/src/components/typographies/Callout/Callout.tsx +38 -0
  436. package/src/components/typographies/Callout/index.ts +3 -0
  437. package/src/components/typographies/CaptionOne/CaptionOne.tsx +38 -0
  438. package/src/components/typographies/CaptionOne/index.ts +4 -0
  439. package/src/components/typographies/CaptionTwo/CaptionTwo.tsx +38 -0
  440. package/src/components/typographies/CaptionTwo/index.ts +4 -0
  441. package/src/components/typographies/Footnote/Footnote.tsx +38 -0
  442. package/src/components/typographies/Footnote/index.ts +4 -0
  443. package/src/components/typographies/Headline/Headline.tsx +38 -0
  444. package/src/components/typographies/Headline/index.ts +4 -0
  445. package/src/components/typographies/LargeTitle/LargeTitle.tsx +38 -0
  446. package/src/components/typographies/LargeTitle/index.ts +3 -0
  447. package/src/components/typographies/README.md +22 -0
  448. package/src/components/typographies/Subhead/Subhead.tsx +38 -0
  449. package/src/components/typographies/Subhead/index.ts +4 -0
  450. package/src/components/typographies/TitleOne/TitleOne.tsx +38 -0
  451. package/src/components/typographies/TitleOne/index.ts +4 -0
  452. package/src/components/typographies/TitleThree/TitleThree.tsx +38 -0
  453. package/src/components/typographies/TitleThree/index.ts +4 -0
  454. package/src/components/typographies/TitleTwo/TitleTwo.tsx +38 -0
  455. package/src/components/typographies/TitleTwo/index.ts +4 -0
  456. package/src/components/typographies/font.ts +25 -0
  457. package/src/hooks/useTheme.ts +17 -0
  458. package/src/index.tsx +47 -0
  459. package/src/providers/DesignSystemProvider/DesignSystemProvider.tsx +31 -0
  460. package/src/providers/DesignSystemProvider/index.ts +3 -0
  461. package/src/providers/IconProvider/IconProvider.tsx +46 -0
  462. package/src/providers/IconProvider/index.ts +4 -0
  463. package/src/providers/ThemeProvider/ThemeProvider.tsx +17 -0
  464. package/src/styles/calendarTheme.ts +24 -0
  465. package/src/styles/colors.ts +119 -0
  466. package/src/styles/globalStyles.ts +36 -0
  467. package/src/styles/space.ts +27 -0
  468. package/src/styles/theme.ts +609 -0
  469. package/src/utils/locale.ts +50 -0
@@ -0,0 +1,251 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import { capitalize } from 'lodash';
3
+ import moment from 'moment';
4
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
5
+ // @ts-ignore
6
+
7
+ import { Calendar } from 'react-native-calendars';
8
+ import { useTheme } from '../../../hooks/useTheme';
9
+ import { Icon } from '../../../providers/IconProvider';
10
+ import { Colors } from '../../../styles/colors';
11
+ import { DEFAULT_ICON_SIZE } from '../../buttons/FicButton/constants';
12
+ import { Body } from '../../typographies/Body';
13
+ import { FontWeight } from '../../typographies/font';
14
+ import { HeaderArrows } from '../HeaderArrows';
15
+ const DatePicker = props => {
16
+ const {
17
+ datePickers
18
+ } = useTheme();
19
+ const {
20
+ onDatePicked,
21
+ value,
22
+ startingDate,
23
+ endingDate,
24
+ minDate,
25
+ maxDate,
26
+ showSixWeeks = true,
27
+ hideExtraDays = false,
28
+ format = moment.localeData().longDateFormat('L'),
29
+ firstDay,
30
+ theme = datePickers,
31
+ withYearSelector = false,
32
+ monthIconNames,
33
+ yearIconNames,
34
+ headerIconProps
35
+ } = props;
36
+
37
+ // The style for selected days in period 💄
38
+ const periodMarkingStyle = useMemo(() => ({
39
+ color: theme.selectedDayBackgroundColor,
40
+ textColor: theme.selectedDayTextColor
41
+ }), [theme.selectedDayBackgroundColor, theme.selectedDayTextColor]);
42
+ const formattedStartingDay = startingDate && moment(startingDate, format).format('YYYY-MM-DD');
43
+ const formattedEndingDay = endingDate && moment(endingDate, format).format('YYYY-MM-DD');
44
+ const selectedDate = value && moment(value, format).isValid() ? moment(value, format).format('YYYY-MM-DD') : undefined;
45
+ const [currentYear, setCurrentYear] = useState(value ? moment(value, format).year() : maxDate ? moment(maxDate, format).year() : moment().year());
46
+ const [currentMonth, setCurrentMonth] = useState(value ? moment(value, format).month() + 1 : maxDate ? moment(maxDate, format).month() + 1 : moment().month() + 1);
47
+ useEffect(() => {
48
+ if (value !== undefined) {
49
+ // Improved efficiency. No need to update the state if the value is the same.
50
+ const newMonthFromValue = moment(value, format).month() + 1;
51
+ const newYearFromValue = moment(value, format).year();
52
+ if (currentMonth !== newMonthFromValue) {
53
+ setCurrentMonth(newMonthFromValue);
54
+ }
55
+ if (currentYear !== newYearFromValue) {
56
+ setCurrentYear(newYearFromValue);
57
+ }
58
+ }
59
+ }, [value]);
60
+ const currentDate = useMemo(() => moment(`${currentYear}-${currentMonth}`, 'YYYY-M').format('YYYY-MM-DD'), [currentYear, currentMonth]);
61
+
62
+ // Creates the object with all the days between startDate and endDate styled correctly
63
+ const createDatePeriod = useCallback((startDate, endDate) => {
64
+ const dateRange = {
65
+ [startDate]: {
66
+ startingDay: true,
67
+ ...periodMarkingStyle
68
+ },
69
+ [endDate]: {
70
+ endingDay: true,
71
+ ...periodMarkingStyle
72
+ }
73
+ };
74
+ if (startDate && endDate) {
75
+ let start = moment(startDate).startOf('day').add(1, 'days');
76
+ const end = moment(endDate).startOf('day');
77
+ while (end.isAfter(start)) {
78
+ Object.assign(dateRange, {
79
+ [start.format('YYYY-MM-DD')]: periodMarkingStyle
80
+ });
81
+ start = start.add(1, 'days');
82
+ }
83
+ }
84
+ return dateRange;
85
+ }, [periodMarkingStyle]);
86
+ const onDateSelected = useCallback(date => onDatePicked(moment(date.dateString).format(format)), [format, onDatePicked]);
87
+ const markingType = !!formattedStartingDay && formattedStartingDay !== selectedDate || !!formattedEndingDay && formattedEndingDay !== selectedDate ? 'period' : undefined;
88
+ const formattedMinDate = minDate && moment(minDate, format).format('YYYY-MM-DD');
89
+ const formattedMaxDate = maxDate && moment(maxDate, format).format('YYYY-MM-DD');
90
+ const isTodayBetweenStartingDayAndSelected = !!selectedDate && !!formattedStartingDay && moment().isBetween(moment(formattedStartingDay).startOf('day'), moment(selectedDate).endOf('day'));
91
+ const isTodayBetweenSelectedAndEndingDay = !!selectedDate && !!formattedEndingDay && moment().isBetween(moment(selectedDate).startOf('day'), moment(formattedEndingDay).endOf('day'));
92
+ const isSelectedDateToday = !!selectedDate && moment().isSame(moment(selectedDate), 'day');
93
+ const isTodayInRange = !!selectedDate && (isTodayBetweenStartingDayAndSelected || isTodayBetweenSelectedAndEndingDay || isSelectedDateToday);
94
+ const {
95
+ todayBackgroundColor,
96
+ todayTextColor,
97
+ arrowColor,
98
+ monthTextColor,
99
+ textMonthFontWeight,
100
+ ...restTheme
101
+ } = theme;
102
+ const markedDates = useMemo(() => {
103
+ const toReturn = {};
104
+
105
+ // Filling markedDates for the calendar
106
+ if (!!formattedStartingDay) {
107
+ // If startingDay is defined, treat this calendar as a period picker for the endingDay
108
+ if (!!selectedDate) {
109
+ if (formattedStartingDay === selectedDate) {
110
+ toReturn[formattedStartingDay] = {
111
+ selected: true
112
+ };
113
+ } else {
114
+ // Sets all the days between the selected dates with the selected style
115
+ Object.assign(toReturn, createDatePeriod(formattedStartingDay, selectedDate));
116
+ }
117
+ } else {
118
+ toReturn[formattedStartingDay] = {
119
+ startingDay: true,
120
+ ...periodMarkingStyle
121
+ };
122
+ }
123
+ } else if (!!formattedEndingDay) {
124
+ // If endingDay is defined, treat this calendar as a period picker for the startingDay
125
+ if (!!selectedDate) {
126
+ if (formattedEndingDay === selectedDate) {
127
+ toReturn[formattedEndingDay] = {
128
+ selected: true
129
+ };
130
+ } else {
131
+ // Sets all the days between the selected dates with the selected style
132
+ Object.assign(toReturn, createDatePeriod(selectedDate, formattedEndingDay));
133
+ }
134
+ } else {
135
+ toReturn[formattedEndingDay] = {
136
+ endingDay: true,
137
+ ...periodMarkingStyle
138
+ };
139
+ }
140
+ } else if (!!selectedDate) {
141
+ // Simple picker
142
+ toReturn[selectedDate] = {
143
+ selected: true
144
+ };
145
+ }
146
+
147
+ // If today is not selected, we want to style the day with the todayBackgroundColor
148
+ if (!isTodayInRange) {
149
+ if (markingType === 'period') {
150
+ // Whether today is after the starting date or before the ending date
151
+ const isAfterStartingDate = !!formattedStartingDay && moment().isAfter(moment(formattedStartingDay).startOf('day'));
152
+ const isBeforeEndingDate = !!formattedEndingDay && moment().isBefore(moment(formattedEndingDay).endOf('day'));
153
+ const isSelectable = isAfterStartingDate || isBeforeEndingDate;
154
+ if (isSelectable) {
155
+ toReturn[moment().format('YYYY-MM-DD')] = {
156
+ startingDay: true,
157
+ endingDay: true,
158
+ color: todayBackgroundColor,
159
+ textColor: todayTextColor
160
+ };
161
+ }
162
+ } else {
163
+ toReturn[moment().format('YYYY-MM-DD')] = {
164
+ color: todayBackgroundColor,
165
+ textColor: todayTextColor
166
+ };
167
+ }
168
+ }
169
+ return toReturn;
170
+ }, [formattedStartingDay, formattedEndingDay, periodMarkingStyle, selectedDate, createDatePeriod, isTodayInRange, markingType, todayBackgroundColor, todayTextColor]);
171
+ const onPreviousYearPress = () => {
172
+ setCurrentYear(currentYear - 1);
173
+ };
174
+ const onPreviousMonthPress = () => {
175
+ if (currentMonth === 1) {
176
+ setCurrentYear(currentYear - 1);
177
+ setCurrentMonth(12);
178
+ } else {
179
+ setCurrentMonth(currentMonth - 1);
180
+ }
181
+ };
182
+ const onNextYearPress = () => {
183
+ setCurrentYear(currentYear + 1);
184
+ };
185
+ const onNextMonthPress = () => {
186
+ if (currentMonth === 12) {
187
+ setCurrentYear(currentYear + 1);
188
+ setCurrentMonth(1);
189
+ } else {
190
+ setCurrentMonth(currentMonth + 1);
191
+ }
192
+ };
193
+ const Arrows = ({
194
+ direction
195
+ }) => {
196
+ const createIconComponent = (name, calendarUnit) => ({
197
+ component: /*#__PURE__*/React.createElement(Icon, _extends({
198
+ name: name,
199
+ size: DEFAULT_ICON_SIZE,
200
+ color: arrowColor || Colors.BLUE
201
+ }, headerIconProps)),
202
+ calendarUnit
203
+ });
204
+ const _monthIconName = monthIconNames ? direction === 'left' ? monthIconNames.left : monthIconNames.right : `chevron-${direction}`;
205
+ const _yearIconName = yearIconNames ? direction === 'left' ? yearIconNames.left : yearIconNames.right : `chevron-double-${direction}`;
206
+ const monthIconComponent = createIconComponent(_monthIconName, 'month');
207
+ const yearIconComponent = createIconComponent(_yearIconName, 'year');
208
+ return /*#__PURE__*/React.createElement(HeaderArrows, {
209
+ withYearSelector: withYearSelector,
210
+ monthIconComponent: monthIconComponent,
211
+ yearIconComponent: yearIconComponent,
212
+ onPreviousMonthPress: onPreviousMonthPress,
213
+ onPreviousYearPress: onPreviousYearPress,
214
+ onNextMonthPress: onNextMonthPress,
215
+ onNextYearPress: onNextYearPress,
216
+ direction: direction
217
+ });
218
+ };
219
+
220
+ // Memoized Header
221
+ const Header = useMemo(() => /*#__PURE__*/React.createElement(Body, {
222
+ color: monthTextColor || Colors.BLUE,
223
+ weight: FontWeight.SEMIBOLD,
224
+ style: {
225
+ fontWeight: textMonthFontWeight
226
+ }
227
+ }, capitalize(moment(`${currentMonth}-${currentYear}`, 'M-YYYY').format('MMMM YYYY'))), [currentMonth, currentYear]);
228
+ return /*#__PURE__*/React.createElement(Calendar, {
229
+ disableArrowLeft: true,
230
+ disableArrowRight: true,
231
+ key: `${currentYear}-${currentMonth}`,
232
+ renderArrow: direction => /*#__PURE__*/React.createElement(Arrows, {
233
+ direction: direction
234
+ }),
235
+ renderHeader: () => Header,
236
+ onDayPress: onDateSelected,
237
+ current: currentDate || selectedDate || formattedStartingDay || formattedEndingDay || formattedMinDate || formattedMaxDate,
238
+ hideExtraDays: hideExtraDays
239
+ // @ts-ignore
240
+ ,
241
+ showSixWeeks: showSixWeeks,
242
+ markingType: markingType,
243
+ markedDates: markedDates,
244
+ minDate: formattedMinDate || formattedStartingDay,
245
+ maxDate: formattedMaxDate || formattedEndingDay,
246
+ firstDay: firstDay,
247
+ theme: isTodayInRange ? restTheme : theme
248
+ });
249
+ };
250
+ export default DatePicker;
251
+ //# sourceMappingURL=DatePicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["capitalize","moment","React","useCallback","useEffect","useMemo","useState","Calendar","useTheme","Icon","Colors","DEFAULT_ICON_SIZE","Body","FontWeight","HeaderArrows","DatePicker","props","datePickers","onDatePicked","value","startingDate","endingDate","minDate","maxDate","showSixWeeks","hideExtraDays","format","localeData","longDateFormat","firstDay","theme","withYearSelector","monthIconNames","yearIconNames","headerIconProps","periodMarkingStyle","color","selectedDayBackgroundColor","textColor","selectedDayTextColor","formattedStartingDay","formattedEndingDay","selectedDate","isValid","undefined","currentYear","setCurrentYear","year","currentMonth","setCurrentMonth","month","newMonthFromValue","newYearFromValue","currentDate","createDatePeriod","startDate","endDate","dateRange","startingDay","endingDay","start","startOf","add","end","isAfter","Object","assign","onDateSelected","date","dateString","markingType","formattedMinDate","formattedMaxDate","isTodayBetweenStartingDayAndSelected","isBetween","endOf","isTodayBetweenSelectedAndEndingDay","isSelectedDateToday","isSame","isTodayInRange","todayBackgroundColor","todayTextColor","arrowColor","monthTextColor","textMonthFontWeight","restTheme","markedDates","toReturn","selected","isAfterStartingDate","isBeforeEndingDate","isBefore","isSelectable","onPreviousYearPress","onPreviousMonthPress","onNextYearPress","onNextMonthPress","Arrows","direction","createIconComponent","name","calendarUnit","component","createElement","_extends","size","BLUE","_monthIconName","left","right","_yearIconName","monthIconComponent","yearIconComponent","Header","weight","SEMIBOLD","style","fontWeight","disableArrowLeft","disableArrowRight","key","renderArrow","renderHeader","onDayPress","current"],"sourceRoot":"../../../../../src","sources":["components/base/DatePicker/DatePicker.tsx"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AACnC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE;;AAEA,SAASC,QAAQ,QAAkB,wBAAwB;AAE3D,SAASC,QAAQ,QAAQ,yBAAyB;AAClD,SAASC,IAAI,QAAmB,iCAAiC;AAEjE,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,iBAAiB,QAAQ,mCAAmC;AACrE,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AA+D9C,MAAMC,UAAsC,GAAIC,KAAuB,IAAK;EAC1E,MA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MAAM,CAACgG,IAAK;IACrCQ,MAAM,EAAErG,UAAU,CAACsG,QAAS;IAC5BC,KAAK,EAAE;MACLC,UAAU,EAAEjC;IACd;EAAE,GAEDpF,UAAU,CACTC,MAAM,CAAC,GAAG+C,YAAY,IAAIH,WAAW,EAAE,EAAE,QAAQ,CAAC,CAACnB,MAAM,CAAC,WAAW,CACvE,CACI,CACP,EACD,CAACsB,YAAY,EAAEH,WAAW,CAC5B,CAAC;EAED,oBACE3C,KAAA,CAAAqG,aAAA,CAAChG,QAAQ;IACP+G,gBAAgB;IAChBC,iBAAiB;IACjBC,GAAG,EAAE,GAAG3E,WAAW,IAAIG,YAAY,EAAG;IACtCyE,WAAW,EAAGvB,SAAoB,iBAAKhG,KAAA,CAAAqG,aAAA,CAACN,MAAM;MAACC,SAAS,EAAEA;IAAU,CAAE,CAAE;IACxEwB,YAAY,EAAEA,CAAA,KAAMT,MAAO;IAC3BU,UAAU,EAAExD,cAAe;IAC3ByD,OAAO,EACLvE,WAAW,IACXX,YAAY,IACZF,oBAAoB,IACpBC,kBAAkB,IAClB8B,gBAAgB,IAChBC,gBACD;IACD/C,aAAa,EAAEA;IACf;IAAA;IACAD,YAAY,EAAEA,YAAoB;IAClC8C,WAAW,EAAEA,WAAwB;IACrCgB,WAAW,EAAEA,WAAY;IACzBhE,OAAO,EAAEiD,gBAAgB,IAAI/B,oBAAqB;IAClDjB,OAAO,EAAEiD,gBAAgB,IAAI/B,kBAAmB;IAChDZ,QAAQ,EAAEA,QAAS;IACnBC,KAAK,EAAEiD,cAAc,GAAGM,SAAS,GAAGvD;EAAM,CAC3C,CAAC;AAEN,CAAC;AAED,eAAef,UAAU","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import DatePicker from './DatePicker';
2
+ export { DatePicker };
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DatePicker"],"sourceRoot":"../../../../../src","sources":["components/base/DatePicker/index.ts"],"mappings":"AAAA,OAAOA,UAAU,MAA4B,cAAc;AAE3D,SAASA,UAAU","ignoreList":[]}
@@ -0,0 +1,70 @@
1
+ import React from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import { Touchable } from '../../Touchable';
4
+ const HeaderArrows = ({
5
+ withYearSelector,
6
+ direction,
7
+ monthIconComponent,
8
+ yearIconComponent,
9
+ onPreviousMonthPress,
10
+ onPreviousYearPress,
11
+ onNextMonthPress,
12
+ onNextYearPress
13
+ }) => {
14
+ const iconSet = withYearSelector ? [monthIconComponent, yearIconComponent] : [monthIconComponent];
15
+ const iconsToBeRendered = direction === 'left' ? iconSet.reverse() : iconSet;
16
+ const actions = {
17
+ left: {
18
+ month: onPreviousMonthPress,
19
+ year: onPreviousYearPress
20
+ },
21
+ right: {
22
+ month: onNextMonthPress,
23
+ year: onNextYearPress
24
+ }
25
+ };
26
+ const handleAction = calendarUnit => {
27
+ var _actions$direction, _actions$direction$ca;
28
+ return actions === null || actions === void 0 || (_actions$direction = actions[direction]) === null || _actions$direction === void 0 || (_actions$direction$ca = _actions$direction[calendarUnit]) === null || _actions$direction$ca === void 0 ? void 0 : _actions$direction$ca.call(_actions$direction);
29
+ };
30
+ return /*#__PURE__*/React.createElement(View, {
31
+ style: styles.container
32
+ }, iconsToBeRendered.map(({
33
+ calendarUnit,
34
+ component
35
+ }, idx) => /*#__PURE__*/React.createElement(Touchable, {
36
+ key: idx,
37
+ style: [styles.iconContainer, direction === 'left' && styles.iconContainerLeft, direction === 'right' && styles.iconContainerRight],
38
+ hitSlop: {
39
+ top: 8,
40
+ right: 8,
41
+ bottom: 8,
42
+ left: 8
43
+ },
44
+ onPress: () => handleAction(calendarUnit)
45
+ }, component)));
46
+ };
47
+ const styles = StyleSheet.create({
48
+ // For some reasons if we display custom arrows a horizontal padding of 10px is applied to the header container
49
+ container: {
50
+ alignItems: 'center',
51
+ flexDirection: 'row',
52
+ marginLeft: -10,
53
+ marginRight: -10
54
+ },
55
+ iconContainer: {
56
+ flexDirection: 'row',
57
+ alignItems: 'center',
58
+ padding: 5
59
+ },
60
+ iconContainerLeft: {
61
+ marginRight: 16,
62
+ marginLeft: 0
63
+ },
64
+ iconContainerRight: {
65
+ marginRight: 0,
66
+ marginLeft: 16
67
+ }
68
+ });
69
+ export default HeaderArrows;
70
+ //# sourceMappingURL=HeaderArrows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","Touchable","HeaderArrows","withYearSelector","direction","monthIconComponent","yearIconComponent","onPreviousMonthPress","onPreviousYearPress","onNextMonthPress","onNextYearPress","iconSet","iconsToBeRendered","reverse","actions","left","month","year","right","handleAction","calendarUnit","_actions$direction","_actions$direction$ca","call","createElement","style","styles","container","map","component","idx","key","iconContainer","iconContainerLeft","iconContainerRight","hitSlop","top","bottom","onPress","create","alignItems","flexDirection","marginLeft","marginRight","padding"],"sourceRoot":"../../../../../src","sources":["components/base/HeaderArrows/HeaderArrows.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAA6B,OAAO;AAChD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,SAAS,QAAQ,iBAAiB;AAc3C,MAAMC,YAAmD,GAAGA,CAAC;EAC3DC,gBAAgB;EAChBC,SAAS;EACTC,kBAAkB;EAClBC,iBAAiB;EACjBC,oBAAoB;EACpBC,mBAAmB;EACnBC,gBAAgB;EAChBC;AACF,CAAC,KAAK;EACJ,MAAMC,OAAwB,GAAGR,gBAAgB,GAC7C,CAACE,kBAAkB,EAAEC,iBAAiB,CAAC,GACvC,CAACD,kBAAkB,CAAC;EAExB,MAAMO,iBAAkC,GACtCR,SAAS,KAAK,MAAM,GAAGO,OAAO,CAACE,OAAO,CAAC,CAAC,GAAGF,OAAO;EAEpD,MAAMG,OAAsE,GAC1E;IACEC,IAAI,EAAE;MACJC,KAAK,EAAET,oBAAoB;MAC3BU,IAAI,EAAET;IACR,CAAC;IACDU,KAAK,EAAE;MACLF,KAAK,EAAEP,gBAAgB;MACvBQ,IAAI,E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CAAC;EACDX,iBAAiB,EAAE;IACjBU,WAAW,EAAE,EAAE;IACfD,UAAU,EAAE;EACd,CAAC;EACDR,kBAAkB,EAAE;IAClBS,WAAW,EAAE,CAAC;IACdD,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAexC,YAAY","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import HeaderArrows from './HeaderArrows';
2
+ export { HeaderArrows };
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["HeaderArrows"],"sourceRoot":"../../../../../src","sources":["components/base/HeaderArrows/index.ts"],"mappings":"AAAA,OAAOA,YAAY,MAAM,gBAAgB;AAEzC,SAASA,YAAY","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ // @ts-ignore TS6133
3
+ import React from 'react';
4
+ import FicButtonIcon from './FicButtonIcon';
5
+ import FicButtonPrimary from './FicButtonPrimary';
6
+ import FicButtonSecondary from './FicButtonSecondary';
7
+ import FicButtonTertiary from './FicButtonTertiary';
8
+ const FicButton = ({
9
+ type = 'primary',
10
+ ...commonProps
11
+ }) => {
12
+ const _iconPosition = commonProps.iconPosition ? commonProps.iconPosition : commonProps.iconName ? 'left' : undefined;
13
+ const FButton = () => {
14
+ switch (type) {
15
+ case 'icon':
16
+ return /*#__PURE__*/React.createElement(FicButtonIcon, _extends({
17
+ isPressable: true
18
+ }, commonProps));
19
+ case 'secondary':
20
+ return /*#__PURE__*/React.createElement(FicButtonSecondary, _extends({
21
+ iconPosition: _iconPosition
22
+ }, commonProps));
23
+ case 'tertiary':
24
+ return /*#__PURE__*/React.createElement(FicButtonTertiary, _extends({
25
+ iconPosition: _iconPosition
26
+ }, commonProps));
27
+ default:
28
+ return /*#__PURE__*/React.createElement(FicButtonPrimary, _extends({
29
+ iconPosition: _iconPosition
30
+ }, commonProps));
31
+ }
32
+ };
33
+ return /*#__PURE__*/React.createElement(FButton, null);
34
+ };
35
+ export default FicButton;
36
+ //# sourceMappingURL=FicButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","FicButtonIcon","FicButtonPrimary","FicButtonSecondary","FicButtonTertiary","FicButton","type","commonProps","_iconPosition","iconPosition","iconName","undefined","FButton","createElement","_extends","isPressable"],"sourceRoot":"../../../../../src","sources":["components/buttons/FicButton/FicButton.tsx"],"mappings":";AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,iBAAiB,MAAM,qBAAqB;AAEnD,MAAMC,SAAmC,GAAGA,CAAC;EAC3CC,IAAI,GAAG,SAAS;EAChB,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,aAAa,GAAGD,WAAW,CAACE,YAAY,GAC1CF,WAAW,CAACE,YAAY,GACxBF,WAAW,CAACG,QAAQ,GACpB,MAAM,GACNC,SAAS;EAEb,MAAMC,OAAO,GAAGA,CAAA,KAAM;IACpB,QAAQN,IAAI;MACV,KAAK,MAAM;QACT,oBAAON,KAAA,CAAAa,aAAA,CAACZ,aAAa,EAAAa,QAAA;UAACC,WAAW;QAAA,GAAKR,WAAW,CAAG,CAAC;MACvD,KAAK,WAAW;QACd,oBACEP,KAAA,CAAAa,aAAA,CAACV,kBAAkB,EAAAW,QAAA;UAACL,YAAY,EAAED;QAAc,GAAKD,WAAW,CAAG,CAAC;MAExE,KAAK,UAAU;QACb,oBACEP,KAAA,CAAAa,aAAA,CAACT,iBAAiB,EAAAU,QAAA;UAACL,YAAY,EAAED;QAAc,GAAKD,WAAW,CAAG,CAAC;MAEvE;QACE,oBACEP,KAAA,CAAAa,aAAA,CAACX,gBAAgB,EAAAY,QAAA;UAACL,YAAY,EAAED;QAAc,GAAKD,WAAW,CAAG,CAAC;IAExE;EACF,CAAC;EAED,oBAAOP,KAAA,CAAAa,aAAA,CAACD,OAAO,MAAE,CAAC;AACpB,CAAC;AAED,eAAeP,SAAS","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=FicButton.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/buttons/FicButton/FicButton.types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,96 @@
1
+ // @ts-ignore TS6133
2
+ import * as React from 'react';
3
+ import { useCallback, useMemo, useState } from 'react';
4
+ import { Platform, Pressable as PressableIOS, View } from 'react-native';
5
+ import { TouchableHighlight } from 'react-native-gesture-handler';
6
+ import { useTheme } from '../../../hooks/useTheme';
7
+ import { Icon } from '../../../providers/IconProvider';
8
+ import { DEFAULT_ICON, DEFAULT_ICON_SIZE, HIT_SLOP } from './constants';
9
+ const FicButtonIcon = ({
10
+ iconName,
11
+ iconSize: _iconSize,
12
+ disabled,
13
+ error,
14
+ onPress,
15
+ onPressIn,
16
+ onPressOut,
17
+ containerStyle,
18
+ customPressedIconAreaSize,
19
+ colorContrastForLightTheme,
20
+ solid,
21
+ light,
22
+ duotone,
23
+ regular
24
+ }) => {
25
+ const Pressable = Platform.OS === 'ios' ? PressableIOS : TouchableHighlight;
26
+ const INCREMENT_PRESSED_AREA_SIZE = 16;
27
+ const iconSize = _iconSize ?? DEFAULT_ICON_SIZE;
28
+ const {
29
+ ficButton: theme
30
+ } = useTheme() || {};
31
+ const buttonTheme = (theme === null || theme === void 0 ? void 0 : theme['icon']) || {};
32
+ const themeProps = disabled ? buttonTheme.disabled : error ? buttonTheme.error : buttonTheme.default;
33
+ const [isPressed, setIsPressed] = useState(false);
34
+ const pressedAreaSize = useMemo(() => customPressedIconAreaSize ? customPressedIconAreaSize : iconSize + INCREMENT_PRESSED_AREA_SIZE, [iconSize, customPressedIconAreaSize]);
35
+ const pressableAreaStyle = useMemo(() => {
36
+ var _themeProps$pressedSt;
37
+ return {
38
+ position: 'absolute',
39
+ top: (pressedAreaSize - iconSize) / 2 * -1,
40
+ left: (pressedAreaSize - iconSize) / 2 * -1,
41
+ width: pressedAreaSize ?? iconSize,
42
+ height: pressedAreaSize ?? iconSize,
43
+ borderRadius: pressedAreaSize / 6,
44
+ ...(themeProps === null || themeProps === void 0 || (_themeProps$pressedSt = themeProps.pressedStyle) === null || _themeProps$pressedSt === void 0 ? void 0 : _themeProps$pressedSt.container)
45
+ };
46
+ }, [iconSize, pressedAreaSize, themeProps]);
47
+ const iconStyle = useMemo(() => ({
48
+ textAlign: 'center',
49
+ lineHeight: iconSize,
50
+ width: iconSize,
51
+ height: iconSize,
52
+ fontSize: iconSize ? iconSize === 16 ? iconSize - 2 : iconSize - 4 : DEFAULT_ICON_SIZE
53
+ }), [iconSize]);
54
+ const iconColor = useMemo(() => {
55
+ return colorContrastForLightTheme && !error ? themeProps !== null && themeProps !== void 0 && themeProps.icon.colorContrastForLightTheme ? themeProps === null || themeProps === void 0 ? void 0 : themeProps.icon.colorContrastForLightTheme : themeProps === null || themeProps === void 0 ? void 0 : themeProps.icon.color : themeProps === null || themeProps === void 0 ? void 0 : themeProps.icon.color;
56
+ }, [colorContrastForLightTheme, error, themeProps]);
57
+ const handleOnPressIn = e => {
58
+ if (onPressIn) onPressIn(e);
59
+ setIsPressed(true);
60
+ };
61
+ const handleOnPressOut = e => {
62
+ if (onPressOut) onPressOut(e);
63
+ setIsPressed(false);
64
+ };
65
+ const handleOnPress = e => {
66
+ if (onPress) onPress(e);
67
+ };
68
+ const FicIcon = useCallback(() => /*#__PURE__*/React.createElement(Icon, {
69
+ name: iconName ?? DEFAULT_ICON,
70
+ solid: solid,
71
+ light: light,
72
+ duotone: duotone,
73
+ regular: regular,
74
+ size: iconSize,
75
+ color: iconColor,
76
+ style: iconStyle
77
+ }), [iconName, iconSize, colorContrastForLightTheme, error, iconStyle, themeProps, solid, light, regular, duotone]);
78
+ return /*#__PURE__*/React.createElement(View, {
79
+ style: {
80
+ width: _iconSize,
81
+ height: _iconSize
82
+ }
83
+ }, isPressed ? /*#__PURE__*/React.createElement(View, {
84
+ style: [pressableAreaStyle]
85
+ }) : null, /*#__PURE__*/React.createElement(Pressable, {
86
+ style: [themeProps === null || themeProps === void 0 ? void 0 : themeProps.container, containerStyle],
87
+ onPress: handleOnPress,
88
+ onPressIn: handleOnPressIn,
89
+ onPressOut: handleOnPressOut,
90
+ hitSlop: HIT_SLOP,
91
+ disabled: disabled,
92
+ underlayColor: 'transparent'
93
+ }, FicIcon()));
94
+ };
95
+ export default FicButtonIcon;
96
+ //# sourceMappingURL=FicButtonIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","useMemo","useState","Platform","Pressable","PressableIOS","View","TouchableHighlight","useTheme","Icon","DEFAULT_ICON","DEFAULT_ICON_SIZE","HIT_SLOP","FicButtonIcon","iconName","iconSize","_iconSize","disabled","error","onPress","onPressIn","onPressOut","containerStyle","customPressedIconAreaSize","colorContrastForLightTheme","solid","light","duotone","regular","OS","INCREMENT_PRESSED_AREA_SIZE","ficButton","theme","buttonTheme","themeProps","default","isPressed","setIsPressed","pressedAreaSize","pressableAreaStyle","_themeProps$pressedSt","position","top","left","width","height","borderRadius","pressedStyle","container","iconStyle","textAlign","lineHeight","fontSize","iconColor","icon","color","handleOnPressIn","e","handleOnPressOut","handleOnPress","FicIcon","createElement","name","size","style","hitSlop","underlayColor"],"sourceRoot":"../../../../../src","sources":["components/buttons/FicButton/FicButtonIcon.tsx"],"mappings":"AAAA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAA4BC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzE,SAEEC,QAAQ,EACRC,SAAS,IAAIC,YAAY,EAEzBC,IAAI,QAEC,cAAc;AACrB,SAASC,kBAAkB,QAAQ,8BAA8B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AAc,CAAE;IAC/CH,OAAO,EAAEwC,aAAc;IACvBvC,SAAS,EAAEoC,eAAgB;IAC3BnC,UAAU,EAAEqC,gBAAiB;IAC7BO,OAAO,EAAErD,QAAS;IAClBK,QAAQ,EAAEA,QAAS;IACnBiD,aAAa,EAAE;EAAc,GAE5BN,OAAO,CAAC,CACA,CACP,CAAC;AAEX,CAAC;AAED,eAAe/C,aAAa","ignoreList":[]}
@@ -0,0 +1,114 @@
1
+ import * as React from 'react';
2
+ import { useCallback, useMemo, useState } from 'react';
3
+ import { Platform, Pressable, View } from 'react-native';
4
+ import { TouchableHighlight } from 'react-native-gesture-handler';
5
+ import { useTheme } from '../../../hooks/useTheme';
6
+ import { Icon } from '../../../providers/IconProvider';
7
+ import { BORDER_RADIUS, PADDING } from '../../../styles/space';
8
+ import { Body } from '../../typographies/Body';
9
+ import { BUTTON_INTERNAL_PADDING_HORIZONTAL, DEFAULT_ICON, DEFAULT_ICON_SIZE, DEFAULT_TITLE, ICON_HORIZONTAL_MARGIN } from './constants';
10
+ const FicButtonPrimary = ({
11
+ title,
12
+ iconName,
13
+ iconSize,
14
+ onPress,
15
+ onPressIn,
16
+ onPressOut,
17
+ disabled,
18
+ error,
19
+ iconPosition,
20
+ fullWidth,
21
+ small,
22
+ solid,
23
+ regular,
24
+ light,
25
+ duotone,
26
+ containerStyle
27
+ }) => {
28
+ var _themeProps$pressedSt3;
29
+ const {
30
+ ficButton: theme
31
+ } = useTheme() || {};
32
+ const buttonTheme = (theme === null || theme === void 0 ? void 0 : theme['primary']) || {};
33
+ const themeProps = disabled ? buttonTheme.disabled : error ? buttonTheme.error : buttonTheme.default;
34
+ const containerStyleObj = containerStyle ?? {};
35
+ const [isPressed, setIsPressed] = useState(false);
36
+ const styleBasedOnPress = useMemo(() => {
37
+ var _themeProps$pressedSt;
38
+ return {
39
+ ...(isPressed && !disabled ? themeProps === null || themeProps === void 0 || (_themeProps$pressedSt = themeProps.pressedStyle) === null || _themeProps$pressedSt === void 0 ? void 0 : _themeProps$pressedSt.container : themeProps === null || themeProps === void 0 ? void 0 : themeProps.container)
40
+ };
41
+ }, [disabled, themeProps, isPressed]);
42
+ const ficPrimaryViewStyle = useMemo(() => ({
43
+ paddingHorizontal: BUTTON_INTERNAL_PADDING_HORIZONTAL,
44
+ paddingVertical: small ? PADDING.SM : PADDING.LG,
45
+ width: fullWidth ? '100%' : 'auto',
46
+ flexDirection: 'row',
47
+ alignItems: 'center',
48
+ justifyContent: 'center'
49
+ }), [fullWidth, small]);
50
+ const bodyStyle = useMemo(() => {
51
+ var _themeProps$pressedSt2;
52
+ return {
53
+ marginLeft: iconPosition === 'left' ? ICON_HORIZONTAL_MARGIN : 0,
54
+ marginRight: iconPosition === 'right' ? ICON_HORIZONTAL_MARGIN : 0,
55
+ ...(isPressed && !disabled ? themeProps === null || themeProps === void 0 || (_themeProps$pressedSt2 = themeProps.pressedStyle) === null || _themeProps$pressedSt2 === void 0 ? void 0 : _themeProps$pressedSt2.text : themeProps === null || themeProps === void 0 ? void 0 : themeProps.text)
56
+ };
57
+ }, [iconPosition, themeProps, disabled, isPressed]);
58
+ const handleOnPressIn = e => {
59
+ if (onPressIn) onPressIn(e);
60
+ setIsPressed(true);
61
+ };
62
+ const handleOnPressOut = e => {
63
+ if (onPressOut) onPressOut(e);
64
+ setIsPressed(false);
65
+ };
66
+ const handleOnPress = e => {
67
+ if (onPress) {
68
+ onPress(e);
69
+ }
70
+ };
71
+ const FicPrimary = useCallback(() => {
72
+ return /*#__PURE__*/React.createElement(View, {
73
+ style: ficPrimaryViewStyle
74
+ }, iconPosition === 'left' ? /*#__PURE__*/React.createElement(Icon, {
75
+ name: iconName || DEFAULT_ICON,
76
+ size: iconSize ?? DEFAULT_ICON_SIZE,
77
+ color: themeProps === null || themeProps === void 0 ? void 0 : themeProps.icon.color,
78
+ solid: solid,
79
+ regular: regular,
80
+ light: light,
81
+ duotone: duotone
82
+ }) : null, /*#__PURE__*/React.createElement(Body, {
83
+ text: title ?? DEFAULT_TITLE,
84
+ style: bodyStyle
85
+ }), iconPosition === 'right' ? /*#__PURE__*/React.createElement(Icon, {
86
+ name: iconName || DEFAULT_ICON,
87
+ size: iconSize ?? DEFAULT_ICON_SIZE,
88
+ color: themeProps === null || themeProps === void 0 ? void 0 : themeProps.icon.color,
89
+ solid: solid,
90
+ regular: regular,
91
+ light: light,
92
+ duotone: duotone
93
+ }) : null);
94
+ }, [iconPosition, iconName, iconSize, bodyStyle, title, ficPrimaryViewStyle, themeProps, solid, regular, light, duotone]);
95
+ return Platform.OS === 'android' ? /*#__PURE__*/React.createElement(TouchableHighlight, {
96
+ disabled: disabled,
97
+ containerStyle: [containerStyleObj],
98
+ style: [{
99
+ borderRadius: BORDER_RADIUS.SM
100
+ }, styleBasedOnPress],
101
+ onPress: handleOnPress,
102
+ onPressIn: handleOnPressIn,
103
+ onPressOut: handleOnPressOut,
104
+ underlayColor: themeProps === null || themeProps === void 0 || (_themeProps$pressedSt3 = themeProps.pressedStyle) === null || _themeProps$pressedSt3 === void 0 ? void 0 : _themeProps$pressedSt3.container.backgroundColor
105
+ }, FicPrimary()) : /*#__PURE__*/React.createElement(Pressable, {
106
+ disabled: disabled,
107
+ style: [styleBasedOnPress, containerStyleObj],
108
+ onPress: handleOnPress,
109
+ onPressIn: handleOnPressIn,
110
+ onPressOut: handleOnPressOut
111
+ }, FicPrimary());
112
+ };
113
+ export default FicButtonPrimary;
114
+ //# sourceMappingURL=FicButtonPrimary.js.map