@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,161 @@
1
+ // @ts-ignore TS6133
2
+ import * as React from 'react';
3
+ import { FunctionComponent, useCallback, useMemo, useState } from 'react';
4
+ import {
5
+ GestureResponderEvent,
6
+ Platform,
7
+ Pressable as PressableIOS,
8
+ StyleProp,
9
+ View,
10
+ ViewStyle,
11
+ } from 'react-native';
12
+ import { TouchableHighlight } from 'react-native-gesture-handler';
13
+ import { useTheme } from '../../../hooks/useTheme';
14
+ import { Icon } from '../../../providers/IconProvider';
15
+ import {
16
+ FicButtonThemeProps,
17
+ FicIconProps,
18
+ onPressType,
19
+ } from './FicButton.types';
20
+ import { DEFAULT_ICON, DEFAULT_ICON_SIZE, HIT_SLOP } from './constants';
21
+
22
+ const FicButtonIcon: FunctionComponent<FicIconProps> = ({
23
+ iconName,
24
+ iconSize: _iconSize,
25
+ disabled,
26
+ error,
27
+ onPress,
28
+ onPressIn,
29
+ onPressOut,
30
+ containerStyle,
31
+ customPressedIconAreaSize,
32
+ colorContrastForLightTheme,
33
+ solid,
34
+ light,
35
+ duotone,
36
+ regular,
37
+ }) => {
38
+ const Pressable = Platform.OS === 'ios' ? PressableIOS : TouchableHighlight;
39
+
40
+ const INCREMENT_PRESSED_AREA_SIZE = 16;
41
+ const iconSize = _iconSize ?? DEFAULT_ICON_SIZE;
42
+
43
+ const { ficButton: theme } = useTheme() || {};
44
+
45
+ const buttonTheme = (theme?.['icon'] as FicButtonThemeProps) || {};
46
+ const themeProps = disabled
47
+ ? buttonTheme.disabled
48
+ : error
49
+ ? buttonTheme.error
50
+ : buttonTheme.default;
51
+
52
+ const [isPressed, setIsPressed] = useState(false);
53
+
54
+ const pressedAreaSize = useMemo(
55
+ () =>
56
+ customPressedIconAreaSize
57
+ ? customPressedIconAreaSize
58
+ : iconSize + INCREMENT_PRESSED_AREA_SIZE,
59
+ [iconSize, customPressedIconAreaSize]
60
+ );
61
+
62
+ const pressableAreaStyle: StyleProp<ViewStyle> = useMemo(
63
+ () => ({
64
+ position: 'absolute',
65
+ top: ((pressedAreaSize - iconSize) / 2) * -1,
66
+ left: ((pressedAreaSize - iconSize) / 2) * -1,
67
+ width: pressedAreaSize ?? iconSize,
68
+ height: pressedAreaSize ?? iconSize,
69
+ borderRadius: pressedAreaSize / 6,
70
+ ...themeProps?.pressedStyle?.container,
71
+ }),
72
+ [iconSize, pressedAreaSize, themeProps]
73
+ );
74
+
75
+ const iconStyle: StyleProp<ViewStyle> = useMemo(
76
+ () => ({
77
+ textAlign: 'center',
78
+ lineHeight: iconSize,
79
+ width: iconSize,
80
+ height: iconSize,
81
+ fontSize: iconSize
82
+ ? iconSize === 16
83
+ ? iconSize - 2
84
+ : iconSize - 4
85
+ : DEFAULT_ICON_SIZE,
86
+ }),
87
+ [iconSize]
88
+ );
89
+
90
+ const iconColor = useMemo(() => {
91
+ return colorContrastForLightTheme && !error
92
+ ? themeProps?.icon.colorContrastForLightTheme
93
+ ? themeProps?.icon.colorContrastForLightTheme
94
+ : themeProps?.icon.color
95
+ : themeProps?.icon.color;
96
+ }, [colorContrastForLightTheme, error, themeProps]);
97
+
98
+ const handleOnPressIn: onPressType = (
99
+ e: GestureResponderEvent | undefined
100
+ ) => {
101
+ if (onPressIn) onPressIn(e);
102
+ setIsPressed(true);
103
+ };
104
+
105
+ const handleOnPressOut: onPressType = (
106
+ e: GestureResponderEvent | undefined
107
+ ) => {
108
+ if (onPressOut) onPressOut(e);
109
+ setIsPressed(false);
110
+ };
111
+
112
+ const handleOnPress: onPressType = (e: GestureResponderEvent | undefined) => {
113
+ if (onPress) onPress(e);
114
+ };
115
+
116
+ const FicIcon = useCallback(
117
+ () => (
118
+ <Icon
119
+ name={iconName ?? DEFAULT_ICON}
120
+ solid={solid}
121
+ light={light}
122
+ duotone={duotone}
123
+ regular={regular}
124
+ size={iconSize}
125
+ color={iconColor}
126
+ style={iconStyle}
127
+ />
128
+ ),
129
+ [
130
+ iconName,
131
+ iconSize,
132
+ colorContrastForLightTheme,
133
+ error,
134
+ iconStyle,
135
+ themeProps,
136
+ solid,
137
+ light,
138
+ regular,
139
+ duotone,
140
+ ]
141
+ );
142
+
143
+ return (
144
+ <View style={{ width: _iconSize, height: _iconSize }}>
145
+ {isPressed ? <View style={[pressableAreaStyle]} /> : null}
146
+ <Pressable
147
+ style={[themeProps?.container, containerStyle]}
148
+ onPress={handleOnPress}
149
+ onPressIn={handleOnPressIn}
150
+ onPressOut={handleOnPressOut}
151
+ hitSlop={HIT_SLOP}
152
+ disabled={disabled}
153
+ underlayColor={'transparent'}
154
+ >
155
+ {FicIcon()}
156
+ </Pressable>
157
+ </View>
158
+ );
159
+ };
160
+
161
+ export default FicButtonIcon;
@@ -0,0 +1,167 @@
1
+ import * as React from 'react';
2
+ import { useCallback, useMemo, useState } from 'react';
3
+ import {
4
+ GestureResponderEvent,
5
+ Platform,
6
+ Pressable,
7
+ StyleProp,
8
+ TextStyle,
9
+ View,
10
+ ViewStyle,
11
+ } from 'react-native';
12
+ import { TouchableHighlight } from 'react-native-gesture-handler';
13
+ import { useTheme } from '../../../hooks/useTheme';
14
+ import { Icon } from '../../../providers/IconProvider';
15
+ import { BORDER_RADIUS, PADDING } from '../../../styles/space';
16
+ import { Body } from '../../typographies/Body';
17
+ import {
18
+ BUTTON_INTERNAL_PADDING_HORIZONTAL,
19
+ DEFAULT_ICON,
20
+ DEFAULT_ICON_SIZE,
21
+ DEFAULT_TITLE,
22
+ ICON_HORIZONTAL_MARGIN,
23
+ } from './constants';
24
+ import {
25
+ FicButtonTextProps,
26
+ FicButtonThemeProps,
27
+ onPressType,
28
+ } from './FicButton.types';
29
+
30
+ const FicButtonPrimary: React.FC<FicButtonTextProps> = ({
31
+ title,
32
+ iconName,
33
+ iconSize,
34
+ onPress,
35
+ onPressIn,
36
+ onPressOut,
37
+ disabled,
38
+ error,
39
+ iconPosition,
40
+ fullWidth,
41
+ small,
42
+ solid,
43
+ regular,
44
+ light,
45
+ duotone,
46
+ containerStyle,
47
+ }) => {
48
+ const { ficButton: theme } = useTheme() || {};
49
+
50
+ const buttonTheme = (theme?.['primary'] as FicButtonThemeProps) || {};
51
+ const themeProps = disabled
52
+ ? buttonTheme.disabled
53
+ : error
54
+ ? buttonTheme.error
55
+ : buttonTheme.default;
56
+ const containerStyleObj = containerStyle ?? {};
57
+
58
+ const [isPressed, setIsPressed] = useState(false);
59
+
60
+ const styleBasedOnPress: StyleProp<ViewStyle> = useMemo(
61
+ () => ({
62
+ ...(isPressed && !disabled
63
+ ? themeProps?.pressedStyle?.container
64
+ : themeProps?.container),
65
+ }),
66
+ [disabled, themeProps, isPressed]
67
+ );
68
+
69
+ const ficPrimaryViewStyle: StyleProp<ViewStyle> = useMemo(
70
+ () => ({
71
+ paddingHorizontal: BUTTON_INTERNAL_PADDING_HORIZONTAL,
72
+ paddingVertical: small ? PADDING.SM : PADDING.LG,
73
+ width: fullWidth ? '100%' : 'auto',
74
+ flexDirection: 'row',
75
+ alignItems: 'center',
76
+ justifyContent: 'center',
77
+ }),
78
+ [fullWidth, small]
79
+ );
80
+
81
+ const bodyStyle: StyleProp<TextStyle> = useMemo(
82
+ () => ({
83
+ marginLeft: iconPosition === 'left' ? ICON_HORIZONTAL_MARGIN : 0,
84
+ marginRight: iconPosition === 'right' ? ICON_HORIZONTAL_MARGIN : 0,
85
+ ...(isPressed && !disabled
86
+ ? themeProps?.pressedStyle?.text
87
+ : themeProps?.text),
88
+ }),
89
+ [iconPosition, themeProps, disabled, isPressed]
90
+ );
91
+
92
+ const handleOnPressIn: onPressType = (
93
+ e: GestureResponderEvent | undefined
94
+ ) => {
95
+ if (onPressIn) onPressIn(e);
96
+ setIsPressed(true);
97
+ };
98
+
99
+ const handleOnPressOut: onPressType = (
100
+ e: GestureResponderEvent | undefined
101
+ ) => {
102
+ if (onPressOut) onPressOut(e);
103
+ setIsPressed(false);
104
+ };
105
+
106
+ const handleOnPress: onPressType = (e: GestureResponderEvent | undefined) => {
107
+ if (onPress) {
108
+ onPress(e);
109
+ }
110
+ };
111
+
112
+ const FicPrimary = useCallback(() => {
113
+ return (
114
+ <View style={ficPrimaryViewStyle}>
115
+ {iconPosition === 'left' ? (
116
+ <Icon
117
+ name={iconName || DEFAULT_ICON}
118
+ size={iconSize ?? DEFAULT_ICON_SIZE}
119
+ color={themeProps?.icon.color}
120
+ solid={solid}
121
+ regular={regular}
122
+ light={light}
123
+ duotone={duotone}
124
+ />
125
+ ) : null}
126
+ <Body text={title ?? DEFAULT_TITLE} style={bodyStyle} />
127
+ {iconPosition === 'right' ? (
128
+ <Icon
129
+ name={iconName || DEFAULT_ICON}
130
+ size={iconSize ?? DEFAULT_ICON_SIZE}
131
+ color={themeProps?.icon.color}
132
+ solid={solid}
133
+ regular={regular}
134
+ light={light}
135
+ duotone={duotone}
136
+ />
137
+ ) : null}
138
+ </View>
139
+ );
140
+ }, [iconPosition, iconName, iconSize, bodyStyle, title, ficPrimaryViewStyle, themeProps, solid, regular, light, duotone]);
141
+
142
+ return Platform.OS === 'android' ? (
143
+ <TouchableHighlight
144
+ disabled={disabled}
145
+ containerStyle={[containerStyleObj]}
146
+ style={[{ borderRadius: BORDER_RADIUS.SM }, styleBasedOnPress]}
147
+ onPress={handleOnPress}
148
+ onPressIn={handleOnPressIn}
149
+ onPressOut={handleOnPressOut}
150
+ underlayColor={themeProps?.pressedStyle?.container.backgroundColor}
151
+ >
152
+ {FicPrimary()}
153
+ </TouchableHighlight>
154
+ ) : (
155
+ <Pressable
156
+ disabled={disabled}
157
+ style={[styleBasedOnPress, containerStyleObj]}
158
+ onPress={handleOnPress}
159
+ onPressIn={handleOnPressIn}
160
+ onPressOut={handleOnPressOut}
161
+ >
162
+ {FicPrimary()}
163
+ </Pressable>
164
+ );
165
+ };
166
+
167
+ export default FicButtonPrimary;
@@ -0,0 +1,168 @@
1
+ import * as React from 'react';
2
+ import { useCallback, useMemo, useState } from 'react';
3
+ import {
4
+ GestureResponderEvent,
5
+ Platform,
6
+ Pressable,
7
+ StyleProp,
8
+ TextStyle,
9
+ View,
10
+ ViewStyle,
11
+ } from 'react-native';
12
+ import { TouchableHighlight } from 'react-native-gesture-handler';
13
+ import { useTheme } from '../../../hooks/useTheme';
14
+ import { Icon } from '../../../providers/IconProvider';
15
+ import { BORDER_RADIUS, PADDING } from '../../../styles/space';
16
+ import { Body } from '../../typographies/Body';
17
+ import {
18
+ BUTTON_INTERNAL_PADDING_HORIZONTAL,
19
+ DEFAULT_ICON,
20
+ DEFAULT_ICON_SIZE,
21
+ DEFAULT_TITLE,
22
+ ICON_HORIZONTAL_MARGIN,
23
+ } from './constants';
24
+ import {
25
+ FicButtonTextProps,
26
+ FicButtonThemeProps,
27
+ onPressType,
28
+ } from './FicButton.types';
29
+
30
+ const FicButtonSecondary: React.FC<FicButtonTextProps> = ({
31
+ title,
32
+ iconName,
33
+ iconSize,
34
+ onPress,
35
+ onPressIn,
36
+ onPressOut,
37
+ disabled,
38
+ error,
39
+ iconPosition,
40
+ fullWidth,
41
+ small,
42
+ solid,
43
+ regular,
44
+ light,
45
+ duotone,
46
+ containerStyle,
47
+ }) => {
48
+ const { ficButton: theme } = useTheme() || {};
49
+
50
+ const buttonTheme = (theme?.['secondary'] as FicButtonThemeProps) || {};
51
+ const themeProps = disabled
52
+ ? buttonTheme.disabled
53
+ : error
54
+ ? buttonTheme.error
55
+ : buttonTheme.default;
56
+ const containerStyleObj = containerStyle ?? {};
57
+
58
+ const [isPressed, setIsPressed] = useState(false);
59
+
60
+ const styleBasedOnPress: StyleProp<ViewStyle> = useMemo(
61
+ () => ({
62
+ ...(isPressed && !disabled
63
+ ? themeProps?.pressedStyle?.container
64
+ : themeProps?.container),
65
+ }),
66
+ [themeProps, disabled, isPressed]
67
+ );
68
+
69
+ const ficSecondaryViewStyle: StyleProp<ViewStyle> = useMemo(
70
+ () => ({
71
+ paddingHorizontal: BUTTON_INTERNAL_PADDING_HORIZONTAL,
72
+ width: fullWidth ? '100%' : 'auto',
73
+ // removing 1 borderWidth to match primary button height
74
+ paddingVertical:
75
+ (small ? PADDING.SM : PADDING.LG) -
76
+ (themeProps?.container?.borderWidth || 0),
77
+ flexDirection: 'row',
78
+ alignItems: 'center',
79
+ justifyContent: 'center',
80
+ }),
81
+ [fullWidth, themeProps]
82
+ );
83
+
84
+ const bodyStyle: StyleProp<TextStyle> = useMemo(
85
+ () => ({
86
+ marginLeft: iconPosition === 'left' ? ICON_HORIZONTAL_MARGIN : 0,
87
+ marginRight: iconPosition === 'right' ? ICON_HORIZONTAL_MARGIN : 0,
88
+ ...(isPressed && !disabled
89
+ ? themeProps?.pressedStyle?.text
90
+ : themeProps?.text),
91
+ }),
92
+ [themeProps, iconPosition, disabled, isPressed]
93
+ );
94
+
95
+ const handleOnPressIn: onPressType = (
96
+ e: GestureResponderEvent | undefined
97
+ ) => {
98
+ if (onPressIn) onPressIn(e);
99
+ setIsPressed(true);
100
+ };
101
+
102
+ const handleOnPressOut: onPressType = (
103
+ e: GestureResponderEvent | undefined
104
+ ) => {
105
+ if (onPressOut) onPressOut(e);
106
+ setIsPressed(false);
107
+ };
108
+
109
+ const handleOnPress: onPressType = (e: GestureResponderEvent | undefined) => {
110
+ if (onPress) onPress(e);
111
+ };
112
+
113
+ const FicSecondary = useCallback(() => {
114
+ return (
115
+ <View style={ficSecondaryViewStyle}>
116
+ {iconPosition === 'left' ? (
117
+ <Icon
118
+ name={iconName || DEFAULT_ICON}
119
+ size={iconSize ?? DEFAULT_ICON_SIZE}
120
+ color={themeProps?.icon.color}
121
+ solid={solid}
122
+ regular={regular}
123
+ light={light}
124
+ duotone={duotone}
125
+ />
126
+ ) : null}
127
+ <Body text={title ?? DEFAULT_TITLE} style={bodyStyle} />
128
+ {iconPosition === 'right' ? (
129
+ <Icon
130
+ name={iconName || DEFAULT_ICON}
131
+ size={iconSize ?? DEFAULT_ICON_SIZE}
132
+ color={themeProps?.icon.color}
133
+ solid={solid}
134
+ regular={regular}
135
+ light={light}
136
+ duotone={duotone}
137
+ />
138
+ ) : null}
139
+ </View>
140
+ );
141
+ }, [iconPosition, iconName, iconSize, bodyStyle, title]);
142
+
143
+ return Platform.OS === 'android' ? (
144
+ <TouchableHighlight
145
+ disabled={disabled}
146
+ containerStyle={containerStyleObj}
147
+ style={[{ borderRadius: BORDER_RADIUS.SM }, styleBasedOnPress]}
148
+ onPress={handleOnPress}
149
+ onPressIn={handleOnPressIn}
150
+ onPressOut={handleOnPressOut}
151
+ underlayColor={themeProps?.pressedStyle?.container.backgroundColor}
152
+ >
153
+ {FicSecondary()}
154
+ </TouchableHighlight>
155
+ ) : (
156
+ <Pressable
157
+ style={[styleBasedOnPress, containerStyleObj]}
158
+ onPress={handleOnPress}
159
+ onPressIn={handleOnPressIn}
160
+ onPressOut={handleOnPressOut}
161
+ disabled={disabled}
162
+ >
163
+ {FicSecondary()}
164
+ </Pressable>
165
+ );
166
+ };
167
+
168
+ export default FicButtonSecondary;
@@ -0,0 +1,188 @@
1
+ import * as React from 'react';
2
+ import { useCallback, useMemo, useState } from 'react';
3
+ import {
4
+ GestureResponderEvent,
5
+ Platform,
6
+ Pressable as PressableIOS,
7
+ StyleProp,
8
+ TextStyle,
9
+ View,
10
+ ViewStyle
11
+ } from 'react-native';
12
+ import { TouchableHighlight } from 'react-native-gesture-handler';
13
+ import { useTheme } from '../../../hooks/useTheme';
14
+ import { Icon } from '../../../providers/IconProvider';
15
+ import { PADDING } from '../../../styles/space';
16
+ import { Body } from '../../typographies/Body';
17
+ import { DEFAULT_ICON, DEFAULT_ICON_SIZE, DEFAULT_TITLE, HIT_SLOP, ICON_HORIZONTAL_MARGIN } from './constants';
18
+ import { FicButtonTextProps, FicButtonThemeProps, onPressType } from './FicButton.types';
19
+
20
+ const FicButtonTertiary: React.FC<FicButtonTextProps> = ({
21
+ title,
22
+ iconName,
23
+ iconSize,
24
+ onPress,
25
+ onPressIn,
26
+ onPressOut,
27
+ disabled,
28
+ error,
29
+ iconPosition,
30
+ colorContrastForLightTheme,
31
+ fullWidth,
32
+ small,
33
+ solid,
34
+ regular,
35
+ light,
36
+ duotone,
37
+ containerStyle
38
+ }) => {
39
+ const { ficButton: theme } = useTheme() || {};
40
+
41
+ const Pressable = Platform.OS === 'ios' ? PressableIOS : TouchableHighlight;
42
+
43
+ const buttonTheme = (theme?.['tertiary'] as FicButtonThemeProps) || {};
44
+ const themeProps = disabled ? buttonTheme.disabled : error ? buttonTheme.error : buttonTheme.default;
45
+ const _containerStyle = containerStyle ?? {};
46
+
47
+ const [isPressed, setIsPressed] = useState(false);
48
+
49
+ const iconColor = useMemo(() => {
50
+ return colorContrastForLightTheme && !error
51
+ ? themeProps?.icon.colorContrastForLightTheme
52
+ ? themeProps?.icon.colorContrastForLightTheme
53
+ : themeProps?.icon.color
54
+ : themeProps?.icon.color;
55
+ }, [themeProps, colorContrastForLightTheme, error]);
56
+
57
+ const bodyColor = useMemo(() => {
58
+ return colorContrastForLightTheme && !error
59
+ ? themeProps?.text.colorContrastForLightTheme
60
+ ? themeProps?.text.colorContrastForLightTheme
61
+ : themeProps?.text.color
62
+ : themeProps?.text.color;
63
+ }, [themeProps, colorContrastForLightTheme, error]);
64
+
65
+ const bodyStyle: StyleProp<TextStyle> = useMemo(
66
+ () => ({
67
+ marginLeft: iconPosition === 'left' ? ICON_HORIZONTAL_MARGIN : 0,
68
+ marginRight: iconPosition === 'right' ? ICON_HORIZONTAL_MARGIN : 0,
69
+ textDecorationLine: themeProps?.text.textDecorationLine ?? 'underline'
70
+ }),
71
+ [themeProps, iconPosition, isPressed, disabled]
72
+ );
73
+
74
+ const tertiaryPressedAreaStyle: StyleProp<ViewStyle> = useMemo(
75
+ () => ({
76
+ top: small ? -PADDING.SM : -PADDING.LG,
77
+ bottom: small ? -PADDING.SM : -PADDING.LG,
78
+ left: fullWidth ? 0 : PADDING.LG * -1,
79
+ right: fullWidth ? 0 : PADDING.LG * -1,
80
+ position: 'absolute',
81
+ ...themeProps?.pressedStyle?.container
82
+ }),
83
+ [small, themeProps, fullWidth]
84
+ );
85
+
86
+ const dynamicContainerStyle: StyleProp<ViewStyle> = useMemo(
87
+ () => ({
88
+ paddingTop: small ? PADDING.SM : PADDING.LG,
89
+ paddingBottom: small ? PADDING.SM : PADDING.LG,
90
+ width: '100%',
91
+ ...(isPressed ? themeProps?.pressedStyle?.container : themeProps?.container)
92
+ }),
93
+ [disabled, themeProps, isPressed]
94
+ );
95
+
96
+ const dynamicContainerStyleContainer: StyleProp<ViewStyle> = useMemo(
97
+ () => ({
98
+ width: '100%',
99
+ ...(isPressed ? themeProps?.pressedStyle?.container : themeProps?.container)
100
+ }),
101
+ [disabled, themeProps, isPressed]
102
+ );
103
+
104
+ const handleOnPressIn: onPressType = (e: GestureResponderEvent | undefined) => {
105
+ if (onPressIn) onPressIn(e);
106
+ setIsPressed(true);
107
+ };
108
+
109
+ const handleOnPressOut: onPressType = (e: GestureResponderEvent | undefined) => {
110
+ if (onPressOut) onPressOut(e);
111
+ setIsPressed(false);
112
+ };
113
+
114
+ const handleOnPress: onPressType = (e: GestureResponderEvent | undefined) => {
115
+ if (onPress) onPress(e);
116
+ };
117
+
118
+ const FicTertiary = useCallback(() => {
119
+ return (
120
+ <>
121
+ {iconPosition === 'left' ? (
122
+ <Icon
123
+ name={iconName || DEFAULT_ICON}
124
+ size={iconSize ?? DEFAULT_ICON_SIZE}
125
+ color={iconColor}
126
+ solid={solid}
127
+ regular={regular}
128
+ light={light}
129
+ duotone={duotone}
130
+ />
131
+ ) : null}
132
+ <Body text={title ?? DEFAULT_TITLE} style={bodyStyle} color={bodyColor} />
133
+ {iconPosition === 'right' ? (
134
+ <Icon
135
+ name={iconName || DEFAULT_ICON}
136
+ size={iconSize ?? DEFAULT_ICON_SIZE}
137
+ color={iconColor}
138
+ solid={solid}
139
+ regular={regular}
140
+ light={light}
141
+ duotone={duotone}
142
+ />
143
+ ) : null}
144
+ </>
145
+ );
146
+ }, [iconPosition, iconName, iconSize, buttonTheme, disabled, error, bodyStyle, title]);
147
+
148
+ return fullWidth ? (
149
+ <Pressable
150
+ style={[dynamicContainerStyle, Platform.OS === 'ios' ? _containerStyle : {}]}
151
+ containerStyle={[dynamicContainerStyleContainer, _containerStyle]}
152
+ onPress={handleOnPress}
153
+ onPressIn={handleOnPressIn}
154
+ onPressOut={handleOnPressOut}
155
+ disabled={disabled}
156
+ hitSlop={HIT_SLOP}
157
+ underlayColor={'transparent'}
158
+ >
159
+ {FicTertiary()}
160
+ </Pressable>
161
+ ) : (
162
+ <View
163
+ style={[
164
+ {
165
+ position: 'relative',
166
+ alignSelf: 'flex-start',
167
+ width: fullWidth ? '100%' : 'auto'
168
+ },
169
+ _containerStyle
170
+ ]}
171
+ >
172
+ {isPressed ? <View style={[tertiaryPressedAreaStyle]} /> : null}
173
+ <Pressable
174
+ style={themeProps?.container}
175
+ onPress={handleOnPress}
176
+ onPressIn={handleOnPressIn}
177
+ onPressOut={handleOnPressOut}
178
+ disabled={disabled}
179
+ hitSlop={HIT_SLOP}
180
+ underlayColor={'transparent'}
181
+ >
182
+ {FicTertiary()}
183
+ </Pressable>
184
+ </View>
185
+ );
186
+ };
187
+
188
+ export default FicButtonTertiary;
@@ -0,0 +1,23 @@
1
+ import { Insets } from 'react-native';
2
+ import { Colors } from '../../../styles/colors';
3
+ import { PADDING } from '../../../styles/space';
4
+
5
+ export const FONT_SIZE = 17;
6
+
7
+ export const ICON_HORIZONTAL_MARGIN = 8;
8
+ export const ICON_SIZE_BIG = 24;
9
+
10
+ export const DEFAULT_ICON_SIZE = 16;
11
+ export const DEFAULT_PRESSED_BG_COLOR = Colors.GREY_2;
12
+
13
+ export const DEFAULT_TITLE = 'Button';
14
+ export const DEFAULT_ICON = 'heart';
15
+
16
+ export const BUTTON_INTERNAL_PADDING_HORIZONTAL = PADDING.LG;
17
+
18
+ export const HIT_SLOP: Insets = {
19
+ top: 16,
20
+ left: 16,
21
+ right: 16,
22
+ bottom: 16,
23
+ };
@@ -0,0 +1,5 @@
1
+ import FicButton from './FicButton';
2
+ import { FicButtonProps } from './FicButton.types';
3
+
4
+ export { FicButton };
5
+ export type { FicButtonProps };