@pagopa/io-app-design-system 1.3.2 → 1.5.1

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 (306) hide show
  1. package/README.md +11 -0
  2. package/lib/commonjs/components/accordion/AccordionItem.js +137 -0
  3. package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -0
  4. package/lib/commonjs/components/accordion/index.js +4 -4
  5. package/lib/commonjs/components/accordion/index.js.map +1 -1
  6. package/lib/commonjs/components/alert/Alert.js +1 -1
  7. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  8. package/lib/commonjs/components/banner/Banner.js +1 -1
  9. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  10. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js +1 -1
  11. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
  12. package/lib/commonjs/components/buttons/ButtonLink.js +6 -6
  13. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  14. package/lib/commonjs/components/buttons/ButtonOutline.js +10 -10
  15. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  16. package/lib/commonjs/components/buttons/ButtonSolid.js +5 -5
  17. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  18. package/lib/commonjs/components/buttons/IconButton.js +4 -4
  19. package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
  20. package/lib/commonjs/components/buttons/IconButtonContained.js +4 -4
  21. package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
  22. package/lib/commonjs/components/buttons/IconButtonSolid.js +5 -5
  23. package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
  24. package/lib/commonjs/components/common/LogoPaymentWithFallback.js +49 -0
  25. package/lib/commonjs/components/common/LogoPaymentWithFallback.js.map +1 -0
  26. package/lib/commonjs/components/index.js +22 -0
  27. package/lib/commonjs/components/index.js.map +1 -1
  28. package/lib/commonjs/components/layout/BlockButtons.js +82 -0
  29. package/lib/commonjs/components/layout/BlockButtons.js.map +1 -0
  30. package/lib/commonjs/components/layout/FooterWithButtons.js +41 -0
  31. package/lib/commonjs/components/layout/FooterWithButtons.js.map +1 -0
  32. package/lib/commonjs/components/layout/index.js +11 -0
  33. package/lib/commonjs/components/layout/index.js.map +1 -1
  34. package/lib/commonjs/components/listitems/ListItemAction.js +1 -1
  35. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  36. package/lib/commonjs/components/listitems/ListItemCheckbox.js +1 -1
  37. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  38. package/lib/commonjs/components/listitems/ListItemIDP.js +1 -1
  39. package/lib/commonjs/components/listitems/ListItemIDP.js.map +1 -1
  40. package/lib/commonjs/components/listitems/ListItemInfoCopy.js +1 -1
  41. package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
  42. package/lib/commonjs/components/listitems/ListItemNav.js +1 -1
  43. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  44. package/lib/commonjs/components/listitems/ListItemNavAlert.js +1 -1
  45. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  46. package/lib/commonjs/components/listitems/ListItemRadio.js +1 -1
  47. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  48. package/lib/commonjs/components/listitems/ListItemTransaction.js +47 -29
  49. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  50. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js +1 -1
  51. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
  52. package/lib/commonjs/components/tabs/TabItem.js +1 -1
  53. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  54. package/lib/commonjs/components/tabs/TabNavigation.js +2 -2
  55. package/lib/commonjs/components/tabs/TabNavigation.js.map +1 -1
  56. package/lib/commonjs/components/{accordion/IOAccordion.js → textInput/TextInput.js} +5 -27
  57. package/lib/commonjs/components/textInput/TextInput.js.map +1 -0
  58. package/lib/commonjs/components/textInput/TextInputBase.js +233 -0
  59. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -0
  60. package/lib/commonjs/components/textInput/TextInputPassword.js +36 -0
  61. package/lib/commonjs/components/textInput/TextInputPassword.js.map +1 -0
  62. package/lib/commonjs/components/textInput/TextInputValidation.js +57 -0
  63. package/lib/commonjs/components/textInput/TextInputValidation.js.map +1 -0
  64. package/lib/commonjs/components/textInput/index.js +39 -0
  65. package/lib/commonjs/components/textInput/index.js.map +1 -0
  66. package/lib/commonjs/core/IOAnimations.js +5 -0
  67. package/lib/commonjs/core/IOAnimations.js.map +1 -1
  68. package/lib/commonjs/core/IOShapes.js +3 -1
  69. package/lib/commonjs/core/IOShapes.js.map +1 -1
  70. package/lib/commonjs/stories/ButtonDS.stories.js +34 -0
  71. package/lib/commonjs/stories/ButtonDS.stories.js.map +1 -0
  72. package/lib/commonjs/stories/H1.stories.js +33 -0
  73. package/lib/commonjs/stories/H1.stories.js.map +1 -0
  74. package/lib/commonjs/stories/H2.stories.js +33 -0
  75. package/lib/commonjs/stories/H2.stories.js.map +1 -0
  76. package/lib/commonjs/stories/H3.stories.js +33 -0
  77. package/lib/commonjs/stories/H3.stories.js.map +1 -0
  78. package/lib/commonjs/stories/H4.stories.js +33 -0
  79. package/lib/commonjs/stories/H4.stories.js.map +1 -0
  80. package/lib/commonjs/stories/H5.stories.js +33 -0
  81. package/lib/commonjs/stories/H5.stories.js.map +1 -0
  82. package/lib/commonjs/stories/H6.stories.js +33 -0
  83. package/lib/commonjs/stories/H6.stories.js.map +1 -0
  84. package/lib/commonjs/stories/Label.stories.js +33 -0
  85. package/lib/commonjs/stories/Label.stories.js.map +1 -0
  86. package/lib/commonjs/stories/LabelSmall.stories.js +33 -0
  87. package/lib/commonjs/stories/LabelSmall.stories.js.map +1 -0
  88. package/lib/commonjs/stories/Link.stories.js +33 -0
  89. package/lib/commonjs/stories/Link.stories.js.map +1 -0
  90. package/lib/commonjs/stories/Monospace.stories.js +33 -0
  91. package/lib/commonjs/stories/Monospace.stories.js.map +1 -0
  92. package/lib/commonjs/utils/accessibility.js +19 -0
  93. package/lib/commonjs/utils/accessibility.js.map +1 -0
  94. package/lib/commonjs/utils/fonts.js +13 -4
  95. package/lib/commonjs/utils/fonts.js.map +1 -1
  96. package/lib/commonjs/utils/object.js +16 -0
  97. package/lib/commonjs/utils/object.js.map +1 -0
  98. package/lib/commonjs/utils/textInput/index.js +24 -0
  99. package/lib/commonjs/utils/textInput/index.js.map +1 -0
  100. package/lib/commonjs/utils/url.js +14 -0
  101. package/lib/commonjs/utils/url.js.map +1 -0
  102. package/lib/module/components/accordion/AccordionItem.js +126 -0
  103. package/lib/module/components/accordion/AccordionItem.js.map +1 -0
  104. package/lib/module/components/accordion/index.js +1 -1
  105. package/lib/module/components/accordion/index.js.map +1 -1
  106. package/lib/module/components/alert/Alert.js +1 -1
  107. package/lib/module/components/alert/Alert.js.map +1 -1
  108. package/lib/module/components/banner/Banner.js +1 -1
  109. package/lib/module/components/banner/Banner.js.map +1 -1
  110. package/lib/module/components/buttons/ButtonExtendedOutline.js +1 -1
  111. package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
  112. package/lib/module/components/buttons/ButtonLink.js +6 -6
  113. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  114. package/lib/module/components/buttons/ButtonOutline.js +10 -10
  115. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  116. package/lib/module/components/buttons/ButtonSolid.js +5 -5
  117. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  118. package/lib/module/components/buttons/IconButton.js +4 -4
  119. package/lib/module/components/buttons/IconButton.js.map +1 -1
  120. package/lib/module/components/buttons/IconButtonContained.js +4 -4
  121. package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
  122. package/lib/module/components/buttons/IconButtonSolid.js +5 -5
  123. package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
  124. package/lib/module/components/common/LogoPaymentWithFallback.js +40 -0
  125. package/lib/module/components/common/LogoPaymentWithFallback.js.map +1 -0
  126. package/lib/module/components/index.js +2 -0
  127. package/lib/module/components/index.js.map +1 -1
  128. package/lib/module/components/layout/BlockButtons.js +73 -0
  129. package/lib/module/components/layout/BlockButtons.js.map +1 -0
  130. package/lib/module/components/layout/FooterWithButtons.js +32 -0
  131. package/lib/module/components/layout/FooterWithButtons.js.map +1 -0
  132. package/lib/module/components/layout/index.js +1 -0
  133. package/lib/module/components/layout/index.js.map +1 -1
  134. package/lib/module/components/listitems/ListItemAction.js +1 -1
  135. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  136. package/lib/module/components/listitems/ListItemCheckbox.js +1 -1
  137. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  138. package/lib/module/components/listitems/ListItemIDP.js +1 -1
  139. package/lib/module/components/listitems/ListItemIDP.js.map +1 -1
  140. package/lib/module/components/listitems/ListItemInfoCopy.js +1 -1
  141. package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
  142. package/lib/module/components/listitems/ListItemNav.js +1 -1
  143. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  144. package/lib/module/components/listitems/ListItemNavAlert.js +1 -1
  145. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  146. package/lib/module/components/listitems/ListItemRadio.js +1 -1
  147. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  148. package/lib/module/components/listitems/ListItemTransaction.js +48 -30
  149. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  150. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js +1 -1
  151. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
  152. package/lib/module/components/tabs/TabItem.js +1 -1
  153. package/lib/module/components/tabs/TabItem.js.map +1 -1
  154. package/lib/module/components/tabs/TabNavigation.js +2 -2
  155. package/lib/module/components/tabs/TabNavigation.js.map +1 -1
  156. package/lib/module/components/textInput/TextInput.js +4 -0
  157. package/lib/module/components/textInput/TextInput.js.map +1 -0
  158. package/lib/module/components/textInput/TextInputBase.js +225 -0
  159. package/lib/module/components/textInput/TextInputBase.js.map +1 -0
  160. package/lib/module/components/textInput/TextInputPassword.js +27 -0
  161. package/lib/module/components/textInput/TextInputPassword.js.map +1 -0
  162. package/lib/module/components/textInput/TextInputValidation.js +47 -0
  163. package/lib/module/components/textInput/TextInputValidation.js.map +1 -0
  164. package/lib/module/components/textInput/index.js +4 -0
  165. package/lib/module/components/textInput/index.js.map +1 -0
  166. package/lib/module/core/IOAnimations.js +5 -0
  167. package/lib/module/core/IOAnimations.js.map +1 -1
  168. package/lib/module/core/IOShapes.js +1 -0
  169. package/lib/module/core/IOShapes.js.map +1 -1
  170. package/lib/module/stories/ButtonDS.stories.js +27 -0
  171. package/lib/module/stories/ButtonDS.stories.js.map +1 -0
  172. package/lib/module/stories/H1.stories.js +26 -0
  173. package/lib/module/stories/H1.stories.js.map +1 -0
  174. package/lib/module/stories/H2.stories.js +26 -0
  175. package/lib/module/stories/H2.stories.js.map +1 -0
  176. package/lib/module/stories/H3.stories.js +26 -0
  177. package/lib/module/stories/H3.stories.js.map +1 -0
  178. package/lib/module/stories/H4.stories.js +26 -0
  179. package/lib/module/stories/H4.stories.js.map +1 -0
  180. package/lib/module/stories/H5.stories.js +26 -0
  181. package/lib/module/stories/H5.stories.js.map +1 -0
  182. package/lib/module/stories/H6.stories.js +26 -0
  183. package/lib/module/stories/H6.stories.js.map +1 -0
  184. package/lib/module/stories/Label.stories.js +26 -0
  185. package/lib/module/stories/Label.stories.js.map +1 -0
  186. package/lib/module/stories/LabelSmall.stories.js +26 -0
  187. package/lib/module/stories/LabelSmall.stories.js.map +1 -0
  188. package/lib/module/stories/Link.stories.js +26 -0
  189. package/lib/module/stories/Link.stories.js.map +1 -0
  190. package/lib/module/stories/Monospace.stories.js +26 -0
  191. package/lib/module/stories/Monospace.stories.js.map +1 -0
  192. package/lib/module/utils/accessibility.js +10 -0
  193. package/lib/module/utils/accessibility.js.map +1 -0
  194. package/lib/module/utils/fonts.js +13 -4
  195. package/lib/module/utils/fonts.js.map +1 -1
  196. package/lib/module/utils/object.js +7 -0
  197. package/lib/module/utils/object.js.map +1 -0
  198. package/lib/module/utils/textInput/index.js +17 -0
  199. package/lib/module/utils/textInput/index.js.map +1 -0
  200. package/lib/module/utils/url.js +7 -0
  201. package/lib/module/utils/url.js.map +1 -0
  202. package/lib/typescript/components/accordion/AccordionItem.d.ts +14 -0
  203. package/lib/typescript/components/accordion/AccordionItem.d.ts.map +1 -0
  204. package/lib/typescript/components/accordion/index.d.ts +1 -1
  205. package/lib/typescript/components/accordion/index.d.ts.map +1 -1
  206. package/lib/typescript/components/buttons/ButtonSolid.d.ts +16 -0
  207. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  208. package/lib/typescript/components/common/LogoPaymentWithFallback.d.ts +27 -0
  209. package/lib/typescript/components/common/LogoPaymentWithFallback.d.ts.map +1 -0
  210. package/lib/typescript/components/index.d.ts +2 -0
  211. package/lib/typescript/components/index.d.ts.map +1 -1
  212. package/lib/typescript/components/layout/BlockButtons.d.ts +53 -0
  213. package/lib/typescript/components/layout/BlockButtons.d.ts.map +1 -0
  214. package/lib/typescript/components/layout/FooterWithButtons.d.ts +9 -0
  215. package/lib/typescript/components/layout/FooterWithButtons.d.ts.map +1 -0
  216. package/lib/typescript/components/layout/index.d.ts +1 -0
  217. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  218. package/lib/typescript/components/listitems/ListItemTransaction.d.ts +13 -5
  219. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  220. package/lib/typescript/components/textInput/TextInput.d.ts +6 -0
  221. package/lib/typescript/components/textInput/TextInput.d.ts.map +1 -0
  222. package/lib/typescript/components/textInput/TextInputBase.d.ts +28 -0
  223. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -0
  224. package/lib/typescript/components/textInput/TextInputPassword.d.ts +6 -0
  225. package/lib/typescript/components/textInput/TextInputPassword.d.ts.map +1 -0
  226. package/lib/typescript/components/textInput/TextInputValidation.d.ts +9 -0
  227. package/lib/typescript/components/textInput/TextInputValidation.d.ts.map +1 -0
  228. package/lib/typescript/components/textInput/index.d.ts +4 -0
  229. package/lib/typescript/components/textInput/index.d.ts.map +1 -0
  230. package/lib/typescript/core/IOAnimations.d.ts +5 -0
  231. package/lib/typescript/core/IOAnimations.d.ts.map +1 -1
  232. package/lib/typescript/core/IOShapes.d.ts +1 -0
  233. package/lib/typescript/core/IOShapes.d.ts.map +1 -1
  234. package/lib/typescript/stories/ButtonDS.stories.d.ts +14 -0
  235. package/lib/typescript/stories/ButtonDS.stories.d.ts.map +1 -0
  236. package/lib/typescript/stories/H1.stories.d.ts +19 -0
  237. package/lib/typescript/stories/H1.stories.d.ts.map +1 -0
  238. package/lib/typescript/stories/H2.stories.d.ts +19 -0
  239. package/lib/typescript/stories/H2.stories.d.ts.map +1 -0
  240. package/lib/typescript/stories/H3.stories.d.ts +19 -0
  241. package/lib/typescript/stories/H3.stories.d.ts.map +1 -0
  242. package/lib/typescript/stories/H4.stories.d.ts +19 -0
  243. package/lib/typescript/stories/H4.stories.d.ts.map +1 -0
  244. package/lib/typescript/stories/H5.stories.d.ts +27 -0
  245. package/lib/typescript/stories/H5.stories.d.ts.map +1 -0
  246. package/lib/typescript/stories/H6.stories.d.ts +19 -0
  247. package/lib/typescript/stories/H6.stories.d.ts.map +1 -0
  248. package/lib/typescript/stories/Label.stories.d.ts +19 -0
  249. package/lib/typescript/stories/Label.stories.d.ts.map +1 -0
  250. package/lib/typescript/stories/LabelSmall.stories.d.ts +21 -0
  251. package/lib/typescript/stories/LabelSmall.stories.d.ts.map +1 -0
  252. package/lib/typescript/stories/Link.stories.d.ts +21 -0
  253. package/lib/typescript/stories/Link.stories.d.ts.map +1 -0
  254. package/lib/typescript/stories/Monospace.stories.d.ts +19 -0
  255. package/lib/typescript/stories/Monospace.stories.d.ts.map +1 -0
  256. package/lib/typescript/utils/accessibility.d.ts +6 -0
  257. package/lib/typescript/utils/accessibility.d.ts.map +1 -0
  258. package/lib/typescript/utils/fonts.d.ts.map +1 -1
  259. package/lib/typescript/utils/object.d.ts +5 -0
  260. package/lib/typescript/utils/object.d.ts.map +1 -0
  261. package/lib/typescript/utils/textInput/index.d.ts +9 -0
  262. package/lib/typescript/utils/textInput/index.d.ts.map +1 -0
  263. package/lib/typescript/utils/types.d.ts +1 -0
  264. package/lib/typescript/utils/types.d.ts.map +1 -1
  265. package/lib/typescript/utils/url.d.ts +8 -0
  266. package/lib/typescript/utils/url.d.ts.map +1 -0
  267. package/package.json +25 -4
  268. package/src/components/accordion/AccordionItem.tsx +165 -0
  269. package/src/components/accordion/index.tsx +1 -1
  270. package/src/components/buttons/ButtonSolid.tsx +16 -0
  271. package/src/components/common/LogoPaymentWithFallback.tsx +60 -0
  272. package/src/components/index.tsx +2 -0
  273. package/src/components/layout/BlockButtons.tsx +142 -0
  274. package/src/components/layout/FooterWithButtons.tsx +37 -0
  275. package/src/components/layout/index.tsx +1 -0
  276. package/src/components/listitems/ListItemTransaction.tsx +86 -39
  277. package/src/components/textInput/TextInput.tsx +15 -0
  278. package/src/components/textInput/TextInputBase.tsx +327 -0
  279. package/src/components/textInput/TextInputPassword.tsx +36 -0
  280. package/src/components/textInput/TextInputValidation.tsx +71 -0
  281. package/src/components/textInput/index.tsx +3 -0
  282. package/src/core/IOAnimations.ts +5 -0
  283. package/src/core/IOShapes.ts +1 -0
  284. package/src/stories/ButtonDS.stories.ts +31 -0
  285. package/src/stories/H1.stories.ts +28 -0
  286. package/src/stories/H2.stories.ts +28 -0
  287. package/src/stories/H3.stories.ts +28 -0
  288. package/src/stories/H4.stories.ts +28 -0
  289. package/src/stories/H5.stories.ts +28 -0
  290. package/src/stories/H6.stories.ts +28 -0
  291. package/src/stories/Label.stories.ts +28 -0
  292. package/src/stories/LabelSmall.stories.ts +28 -0
  293. package/src/stories/Link.stories.ts +28 -0
  294. package/src/stories/Monospace.stories.ts +28 -0
  295. package/src/utils/accessibility.ts +17 -0
  296. package/src/utils/fonts.ts +12 -5
  297. package/src/utils/object.ts +12 -0
  298. package/src/utils/textInput/index.ts +29 -0
  299. package/src/utils/types.ts +2 -0
  300. package/src/utils/url.ts +9 -0
  301. package/lib/commonjs/components/accordion/IOAccordion.js.map +0 -1
  302. package/lib/module/components/accordion/IOAccordion.js +0 -26
  303. package/lib/module/components/accordion/IOAccordion.js.map +0 -1
  304. package/lib/typescript/components/accordion/IOAccordion.d.ts +0 -13
  305. package/lib/typescript/components/accordion/IOAccordion.d.ts.map +0 -1
  306. package/src/components/accordion/IOAccordion.tsx +0 -35
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from "@storybook/react";
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").FunctionComponent<Omit<import("react-native").TextProps & import("react").RefAttributes<import("react-native").Text>, "style"> & import("../components").TypographyProps<"SemiBold" | "Bold", "white" | "grey-50" | "grey-100" | "grey-200" | "grey-300" | "grey-450" | "grey-650" | "grey-700" | "grey-850" | "black" | "blueIO-850" | "blueIO-600" | "blueIO-500" | "blueIO-450" | "blueIO-200" | "blueIO-150" | "blueIO-100" | "blueIO-50" | "hanPurple-850" | "hanPurple-500" | "hanPurple-250" | "hanPurple-100" | "hanPurple-50" | "turquoise-850" | "turquoise-500" | "turquoise-450" | "turquoise-150" | "turquoise-100" | "turquoise-50" | "error-850" | "error-600" | "error-500" | "error-400" | "error-100" | "warning-850" | "warning-700" | "warning-500" | "warning-400" | "warning-100" | "success-850" | "success-700" | "success-500" | "success-400" | "success-100" | "info-850" | "info-700" | "info-500" | "info-400" | "info-100" | "cobalt" | "blueItalia-850" | "blueItalia-600" | "blueItalia-500" | "blueItalia-100" | "blueItalia-50" | "blue-600" | "blue-50" | "greyUltraLight" | "greyLight" | "bluegreyLight" | "grey" | "milderGray" | "bluegrey" | "bluegreyDark" | "noCieButton" | "blue" | "blueUltraLight" | "aqua" | "aquaUltraLight" | "antiqueFuchsia" | "yellow" | "orange" | "red" | "green" | "greenLight"> & {
6
+ style?: import("react-native").Falsy | Omit<import("react-native").TextStyle, "color" | "fontStyle" | "fontWeight" | "fontSize" | "fontFamily"> | import("react-native").RegisteredStyle<Omit<import("react-native").TextStyle, "color" | "fontStyle" | "fontWeight" | "fontSize" | "fontFamily">> | import("react-native").RecursiveArray<import("react-native").Falsy | Omit<import("react-native").TextStyle, "color" | "fontStyle" | "fontWeight" | "fontSize" | "fontFamily"> | import("react-native").RegisteredStyle<Omit<import("react-native").TextStyle, "color" | "fontStyle" | "fontWeight" | "fontSize" | "fontFamily">>>;
7
+ } & {
8
+ fontSize?: ("small" | "regular") | undefined;
9
+ }>;
10
+ parameters: {
11
+ layout: string;
12
+ actions: {
13
+ argTypesRegex: string;
14
+ };
15
+ };
16
+ tags: string[];
17
+ };
18
+ export default meta;
19
+ type Story = StoryObj<typeof meta>;
20
+ export declare const Primary: Story;
21
+ //# sourceMappingURL=Link.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/Link.stories.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;CAUmB,CAAC;AAE9B,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from "@storybook/react";
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").FC<Omit<import("react-native").TextProps & import("react").RefAttributes<import("react-native").Text>, "style"> & import("../components").TypographyProps<"Regular" | "SemiBold" | "Bold", "bluegrey" | "bluegreyDark"> & {
6
+ style?: import("react-native").Falsy | Omit<import("react-native").TextStyle, "color" | "fontStyle" | "fontWeight" | "fontSize" | "fontFamily"> | import("react-native").RegisteredStyle<Omit<import("react-native").TextStyle, "color" | "fontStyle" | "fontWeight" | "fontSize" | "fontFamily">> | import("react-native").RecursiveArray<import("react-native").Falsy | Omit<import("react-native").TextStyle, "color" | "fontStyle" | "fontWeight" | "fontSize" | "fontFamily"> | import("react-native").RegisteredStyle<Omit<import("react-native").TextStyle, "color" | "fontStyle" | "fontWeight" | "fontSize" | "fontFamily">>>;
7
+ }>;
8
+ parameters: {
9
+ layout: string;
10
+ actions: {
11
+ argTypesRegex: string;
12
+ };
13
+ };
14
+ tags: string[];
15
+ };
16
+ export default meta;
17
+ type Story = StoryObj<typeof meta>;
18
+ export declare const Primary: Story;
19
+ //# sourceMappingURL=Monospace.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Monospace.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/Monospace.stories.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,QAAA,MAAM,IAAI;;;;;;;;;;;;CAUwB,CAAC;AAEnC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This function is used to get the text that will be read by the screen reader
3
+ * with the correct minus symbol pronunciation.
4
+ */
5
+ export declare const getAccessibleAmountText: (amount?: string) => string | undefined;
6
+ //# sourceMappingURL=accessibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessibility.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,YAAa,MAAM,uBAQpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/utils/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,KAAK,CAAC;AAE9C,QAAA,MAAM,OAAO,mDAAoD,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,QAAA,MAAM,YAAY,uCAAwC,CAAC;AAC3D,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;GAEG;AACH,QAAA,MAAM,KAAK;;;;CAaV,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,eAAe,CAK7D,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,KAAK,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,eAAe,CAKhE,CAAC;AAEF,oBAAY,SAAS;IACnB,QAAQ,WAAW;IACnB,QAAQ,WAAW;CACpB;AAED,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,UAAU,WACP,YAAY,aACX,OAAO,KAChB,MAKC,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,YACtB,YAAY,GAAG,SAAS,aACtB,OAAO,GAAG,SAAS,SACvB,UAAU,GAAG,SAAS,KAC3B,eAaC,CAAC"}
1
+ {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/utils/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,KAAK,CAAC;AAE9C,QAAA,MAAM,OAAO,mDAAoD,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,QAAA,MAAM,YAAY,uCAAwC,CAAC;AAC3D,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;GAEG;AACH,QAAA,MAAM,KAAK;;;;CAgBV,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,eAAe,CAK7D,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,KAAK,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,eAAe,CAKhE,CAAC;AAEF,oBAAY,SAAS;IACnB,QAAQ,WAAW;IACnB,QAAQ,WAAW;CACpB;AAED,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,UAAU,WACP,YAAY,aACX,OAAO,KAChB,MAMC,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,YACtB,YAAY,GAAG,SAAS,aACtB,OAAO,GAAG,SAAS,SACvB,UAAU,GAAG,SAAS,KAC3B,eAgBC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as O from "fp-ts/Option";
2
+ export declare const findFirstCaseInsensitive: <T>(obj: {
3
+ [key: string]: T;
4
+ }) => (key: string) => O.Option<[string, T]>;
5
+ //# sourceMappingURL=object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/utils/object.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,wBAAwB;;YAE7B,MAAM,0BAKT,CAAC"}
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { TextInputBase } from "../../components/textInput/TextInputBase";
3
+ import { InputType } from "../types";
4
+ type InputProps = Pick<React.ComponentProps<typeof TextInputBase>, "textInputProps"> & {
5
+ valueFormat?: (value: string) => string;
6
+ };
7
+ export declare const getInputPropsByType: (type: InputType) => InputProps | undefined;
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/textInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,UAAU,GAAG,IAAI,CACpB,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,EAC1C,gBAAgB,CACjB,GAAG;IACF,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,mBAAmB,SACxB,SAAS,KACd,UAAU,GAAG,SAef,CAAC"}
@@ -25,5 +25,6 @@ type Without<T, U> = {
25
25
  * Ensure that the types T and U are mutually exclusive
26
26
  */
27
27
  export type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
28
+ export type InputType = "credit-card" | "default";
28
29
  export {};
29
30
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAGvC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,KAAK,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAExD;;GAEG;AACH,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK;CAAE,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,MAAM,GACxC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GACzC,CAAC,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAGvC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,KAAK,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAExD;;GAEG;AACH,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK;CAAE,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,MAAM,GACxC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GACzC,CAAC,GAAG,CAAC,CAAC;AAEV,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { ImageURISource } from "react-native";
2
+ /**
3
+ * type guard to check if a value is an ImageURISource
4
+ * @argument value the value to check, can be anything
5
+ * @returns boolean
6
+ */
7
+ export declare const isImageUri: (value: unknown) => value is ImageURISource;
8
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,UAAU,UAAW,OAAO,4BACsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/io-app-design-system",
3
- "version": "1.3.2",
3
+ "version": "1.5.1",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -34,7 +34,9 @@
34
34
  "prepack": "bob build",
35
35
  "release": "release-it",
36
36
  "example": "yarn --cwd example",
37
- "bootstrap": "yarn example && yarn install"
37
+ "bootstrap": "yarn example && yarn install",
38
+ "storybook": "storybook dev -p 6006",
39
+ "build-storybook": "storybook build"
38
40
  },
39
41
  "keywords": [
40
42
  "react-native",
@@ -49,13 +51,25 @@
49
51
  },
50
52
  "homepage": "https://github.com/pagopa/io-app-design-system#readme",
51
53
  "devDependencies": {
54
+ "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
52
55
  "@commitlint/config-conventional": "^17.0.2",
53
56
  "@evilmartians/lefthook": "^1.2.2",
54
57
  "@react-native-community/eslint-config": "^3.0.2",
55
58
  "@release-it/conventional-changelog": "^5.0.0",
59
+ "@storybook/addon-essentials": "^7.4.0",
60
+ "@storybook/addon-interactions": "^7.4.0",
61
+ "@storybook/addon-links": "^7.4.0",
62
+ "@storybook/addon-onboarding": "^1.0.8",
63
+ "@storybook/addon-react-native-web": "^0.0.21",
64
+ "@storybook/blocks": "^7.4.0",
65
+ "@storybook/react": "^7.4.0",
66
+ "@storybook/react-webpack5": "^7.4.0",
67
+ "@storybook/testing-library": "^0.2.0",
56
68
  "@types/jest": "^28.1.2",
57
69
  "@types/react": "~17.0.38",
58
70
  "@types/react-native": "0.70.0",
71
+ "babel-loader": "^9.1.3",
72
+ "babel-plugin-react-native-web": "^0.19.8",
59
73
  "commitlint": "^17.0.2",
60
74
  "del-cli": "^5.0.0",
61
75
  "eslint": "^8.4.1",
@@ -63,15 +77,21 @@
63
77
  "eslint-plugin-functional": "^5.0.8",
64
78
  "eslint-plugin-import": "^2.27.5",
65
79
  "eslint-plugin-prettier": "^4.0.0",
80
+ "eslint-plugin-storybook": "^0.6.13",
66
81
  "jest": "^29.5.0",
82
+ "metro-react-native-babel-preset": "^0.77.0",
67
83
  "pod-install": "^0.1.0",
68
84
  "prettier": "^2.0.5",
69
85
  "react": "18.2.0",
86
+ "react-dom": "^18.2.0",
70
87
  "react-native": "0.71.8",
71
88
  "react-native-builder-bob": "^0.20.0",
72
89
  "react-native-i18n": "^2.0.15",
90
+ "react-native-web": "^0.18.12",
91
+ "react-native-web-linear-gradient": "^1.1.2",
73
92
  "react-test-renderer": "^18.2.0",
74
93
  "release-it": "^15.0.0",
94
+ "storybook": "^7.4.0",
75
95
  "typescript": "^4.9.5"
76
96
  },
77
97
  "resolutions": {
@@ -80,12 +100,12 @@
80
100
  "peerDependencies": {
81
101
  "react": "*",
82
102
  "react-native": "*",
103
+ "react-native-gesture-handler": "*",
83
104
  "react-native-haptic-feedback": "*",
84
105
  "react-native-linear-gradient": "*",
85
106
  "react-native-reanimated": "*",
86
- "react-native-svg": "*",
87
107
  "react-native-safe-area-context": "*",
88
- "react-native-gesture-handler": "*"
108
+ "react-native-svg": "*"
89
109
  },
90
110
  "engines": {
91
111
  "node": ">= 16.0.0"
@@ -149,6 +169,7 @@
149
169
  ]
150
170
  },
151
171
  "dependencies": {
172
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
152
173
  "@expo/vector-icons": "^13.0.0",
153
174
  "@pagopa/ts-commons": "^12.0.0",
154
175
  "@testing-library/jest-native": "^5.4.2",
@@ -0,0 +1,165 @@
1
+ import React, { useState } from "react";
2
+ import {
3
+ Text,
4
+ View,
5
+ StyleSheet,
6
+ TouchableWithoutFeedback,
7
+ LayoutChangeEvent
8
+ } from "react-native";
9
+ import Animated, {
10
+ useAnimatedStyle,
11
+ withSpring
12
+ } from "react-native-reanimated";
13
+ import LinearGradient from "react-native-linear-gradient";
14
+ import { IOAccordionRadius, type IOSpacingScale } from "../../core";
15
+ import { makeFontStyleObject } from "../../utils/fonts";
16
+ import { IOColors, hexToRgba } from "../../core/IOColors";
17
+ import { H6 } from "../typography";
18
+ import { IOSpringValues } from "../../core/IOAnimations";
19
+ import { Icon } from "../icons/Icon";
20
+
21
+ export type AccordionItem = {
22
+ id: number;
23
+ title: string;
24
+ body: string | React.ReactNode;
25
+ };
26
+
27
+ type AccordionBody = {
28
+ children: React.ReactNode;
29
+ expanded: boolean;
30
+ };
31
+
32
+ const accordionBodySpacing: IOSpacingScale = 16;
33
+ const accordionIconMargin: IOSpacingScale = 8;
34
+ const accordionBorder: IOColors = "grey-200";
35
+ const accordionBackground: IOColors = "white";
36
+
37
+ /* The code below is a re-adaptation of Dima Portenko's code:
38
+ https://github.com/dimaportenko/reanimated-collapsable-card-tutorial
39
+ */
40
+ export const AccordionBody = ({ children, expanded }: AccordionBody) => {
41
+ const [height, setHeight] = useState(0);
42
+
43
+ const onLayout = (event: LayoutChangeEvent) => {
44
+ const { height: onLayoutHeight } = event.nativeEvent.layout;
45
+
46
+ if (onLayoutHeight > 0 && height !== onLayoutHeight) {
47
+ setHeight(onLayoutHeight);
48
+ }
49
+ };
50
+
51
+ const animatedHeightStyle = useAnimatedStyle(
52
+ () => ({
53
+ height: expanded
54
+ ? withSpring(height, IOSpringValues.accordion)
55
+ : withSpring(0, IOSpringValues.accordion)
56
+ }),
57
+ [expanded]
58
+ );
59
+
60
+ return (
61
+ <Animated.View
62
+ style={[animatedHeightStyle, styles.accordionCollapsableContainer]}
63
+ >
64
+ <View style={styles.accordionBodyContainer} onLayout={onLayout}>
65
+ {children}
66
+ </View>
67
+ </Animated.View>
68
+ );
69
+ };
70
+
71
+ export const AccordionItem = ({ title, body }: AccordionItem) => {
72
+ const [expanded, setExpanded] = useState(false);
73
+
74
+ const onItemPress = () => {
75
+ setExpanded(!expanded);
76
+ };
77
+
78
+ const animatedChevron = useAnimatedStyle(
79
+ () => ({
80
+ transform: [
81
+ {
82
+ rotate: expanded
83
+ ? withSpring(`180deg`, IOSpringValues.accordion)
84
+ : withSpring(`0deg`, IOSpringValues.accordion)
85
+ }
86
+ ]
87
+ }),
88
+ [expanded]
89
+ );
90
+
91
+ return (
92
+ <View style={styles.accordionWrapper}>
93
+ <TouchableWithoutFeedback
94
+ accessible={true}
95
+ accessibilityRole="button"
96
+ accessibilityState={{ expanded }}
97
+ onPress={onItemPress}
98
+ >
99
+ <View style={styles.textContainer}>
100
+ <View style={{ flexShrink: 1, marginRight: accordionIconMargin }}>
101
+ <H6 color="black">{title}</H6>
102
+ </View>
103
+ <Animated.View style={animatedChevron}>
104
+ <Icon name="chevronBottom" color="blueIO-500" />
105
+ </Animated.View>
106
+ </View>
107
+ </TouchableWithoutFeedback>
108
+
109
+ <AccordionBody expanded={expanded}>
110
+ {typeof body === "string" ? (
111
+ <Text style={styles.accordionBodyText}>{body}</Text>
112
+ ) : (
113
+ body
114
+ )}
115
+ </AccordionBody>
116
+ {/* This gradient adds a smooth end to the content. If it is missing,
117
+ the content will be cut sharply during the height transition. */}
118
+ <LinearGradient
119
+ style={{
120
+ height: accordionBodySpacing,
121
+ position: "absolute",
122
+ // Place at the bottom
123
+ bottom: 0,
124
+ // Avoid gradient overlaps with border radius
125
+ left: accordionBodySpacing,
126
+ right: accordionBodySpacing
127
+ }}
128
+ colors={[
129
+ hexToRgba(IOColors[accordionBackground], 0),
130
+ IOColors[accordionBackground]
131
+ ]}
132
+ />
133
+ </View>
134
+ );
135
+ };
136
+
137
+ const styles = StyleSheet.create({
138
+ accordionWrapper: {
139
+ borderColor: IOColors[accordionBorder],
140
+ borderWidth: 1,
141
+ borderRadius: IOAccordionRadius,
142
+ backgroundColor: IOColors[accordionBackground]
143
+ },
144
+ accordionCollapsableContainer: {
145
+ overflow: "hidden"
146
+ },
147
+ accordionBodyContainer: {
148
+ position: "absolute",
149
+ padding: accordionBodySpacing,
150
+ paddingTop: 0
151
+ },
152
+ accordionBodyText: {
153
+ fontSize: 14,
154
+ lineHeight: 21,
155
+ color: IOColors["grey-700"],
156
+ ...makeFontStyleObject("Regular", undefined, "TitilliumWeb")
157
+ },
158
+ textContainer: {
159
+ padding: accordionBodySpacing,
160
+ flexGrow: 1,
161
+ flexDirection: "row",
162
+ alignItems: "center",
163
+ justifyContent: "space-between"
164
+ }
165
+ });
@@ -1,2 +1,2 @@
1
1
  export * from "./RawAccordion";
2
- export * from "./IOAccordion";
2
+ export * from "./AccordionItem";
@@ -39,12 +39,28 @@ const styles = StyleSheet.create({
39
39
  });
40
40
 
41
41
  export type ButtonSolidProps = WithTestID<{
42
+ /**
43
+ * @default primary
44
+ */
42
45
  color?: ButtonSolidColor;
43
46
  label: string;
47
+ /**
48
+ * Renders a small variant of the button. This property applies to the legacy look only
49
+ * @default false
50
+ */
44
51
  small?: boolean;
52
+ /**
53
+ * @default false
54
+ */
45
55
  fullWidth?: boolean;
56
+ /**
57
+ * @default false
58
+ */
46
59
  disabled?: boolean;
47
60
  icon?: IOIcons;
61
+ /**
62
+ * @default start
63
+ */
48
64
  iconPosition?: "start" | "end";
49
65
  accessibilityLabel: string;
50
66
  accessibilityHint?: string;
@@ -0,0 +1,60 @@
1
+ import * as O from "fp-ts/lib/Option";
2
+ import { pipe } from "fp-ts/lib/function";
3
+ import * as React from "react";
4
+ import { findFirstCaseInsensitive } from "../../utils/object";
5
+ import { IOColors } from "../../core";
6
+ import { IOIconSizeScale, Icon } from "../icons";
7
+ import {
8
+ IOLogoPaymentExtType,
9
+ IOLogoPaymentType,
10
+ IOPaymentExtLogos,
11
+ IOPaymentLogos,
12
+ LogoPayment,
13
+ LogoPaymentExt
14
+ } from "../logos";
15
+
16
+ export type LogoPaymentWithFallback = {
17
+ brand?: string;
18
+ fallbackIconColor?: IOColors;
19
+ size?: IOIconSizeScale;
20
+ isExtended?: boolean;
21
+ };
22
+ export type LogoPaymentExtOrDefaultIconProps = {
23
+ cardIcon?: IOLogoPaymentExtType;
24
+ fallbackIconColor?: IOColors;
25
+ size?: IOIconSizeScale;
26
+ };
27
+ /**
28
+ * This component renders either
29
+ * - a LogoPayment/LogoPaymentExt component
30
+ * - a default credit card icon
31
+ * @param cardIcon: IOLogoPaymentType icon
32
+ * @param size: the size of the icon (standard is 24/48)
33
+ * @param fallbackIconColor: default icon color (standard is grey-700)
34
+ * @param isExtended: if true, renders a LogoPaymentExt component
35
+ * @returns a LogoPayment/LogopaymentExt component if the cardIcon is supported, a default credit card icon otherwise
36
+ */
37
+ export const LogoPaymentWithFallback = ({
38
+ brand,
39
+ fallbackIconColor = "grey-700",
40
+ isExtended = false,
41
+ size = isExtended ? 48 : 24
42
+ }: LogoPaymentWithFallback) => {
43
+ const logos = isExtended ? IOPaymentExtLogos : IOPaymentLogos;
44
+
45
+ return pipe(
46
+ brand,
47
+ O.fromNullable,
48
+ O.chain(findFirstCaseInsensitive(logos)),
49
+ O.map(([brand]) => brand),
50
+ O.fold(
51
+ () => <Icon name="creditCard" size={size} color={fallbackIconColor} />,
52
+ brand =>
53
+ isExtended ? (
54
+ <LogoPaymentExt name={brand as IOLogoPaymentExtType} size={size} />
55
+ ) : (
56
+ <LogoPayment name={brand as IOLogoPaymentType} size={size} />
57
+ )
58
+ )
59
+ );
60
+ };
@@ -17,3 +17,5 @@ export * from "./switch";
17
17
  export * from "./tag";
18
18
  export * from "./tabs";
19
19
  export * from "./typography";
20
+ export * from "./textInput";
21
+ export * from "./layout";
@@ -0,0 +1,142 @@
1
+ import * as React from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import { HSpacer } from "../spacer/Spacer";
4
+ import { ButtonOutline, ButtonSolid, ButtonSolidProps } from "../buttons";
5
+ import { IOStyles } from "../../core";
6
+
7
+ const styles = StyleSheet.create({
8
+ button: {
9
+ alignContent: "center",
10
+ justifyContent: "center",
11
+ flex: 1
12
+ },
13
+ buttonTwoThirds: {
14
+ alignContent: "center",
15
+ flex: 2
16
+ }
17
+ });
18
+
19
+ type CommonProps = Readonly<{
20
+ primary: BlockButtonProps;
21
+ accessible?: boolean;
22
+ }>;
23
+
24
+ export type BlockButtonProps = {
25
+ type: "Solid" | "Outline";
26
+ buttonProps: ButtonSolidProps;
27
+ };
28
+
29
+ /**
30
+ * | single button |
31
+ */
32
+ export interface SingleButton extends CommonProps {
33
+ type: "SingleButton";
34
+ }
35
+
36
+ /**
37
+ * | left | right |
38
+ */
39
+ export interface TwoButtonsInlineHalf extends CommonProps {
40
+ type: "TwoButtonsInlineHalf";
41
+ secondary: BlockButtonProps;
42
+ }
43
+
44
+ /**
45
+ * | left | right |
46
+ */
47
+ interface TwoButtonsInlineThird extends CommonProps {
48
+ type: "TwoButtonsInlineThird";
49
+ secondary: BlockButtonProps;
50
+ }
51
+
52
+ /**
53
+ * | left | right |
54
+ */
55
+ interface TwoButtonsInlineThirdInverted extends CommonProps {
56
+ type: "TwoButtonsInlineThirdInverted";
57
+ secondary: BlockButtonProps;
58
+ }
59
+
60
+ /**
61
+ * | left | mid | right |
62
+ */
63
+ interface ThreeButtonsInLine extends CommonProps {
64
+ type: "ThreeButtonsInLine";
65
+ secondary: BlockButtonProps;
66
+ third: BlockButtonProps;
67
+ }
68
+
69
+ type Props =
70
+ | SingleButton
71
+ | TwoButtonsInlineHalf
72
+ | TwoButtonsInlineThird
73
+ | TwoButtonsInlineThirdInverted
74
+ | ThreeButtonsInLine;
75
+
76
+ export type BlockButtonsProps = Props;
77
+
78
+ /**
79
+ * Implements a component that show buttons on a line on 1, 2 or 3 buttons
80
+ */
81
+ export const BlockButtons = (props: Props) => {
82
+ const renderRightButton = () => {
83
+ if (props.type === "SingleButton") {
84
+ return null;
85
+ }
86
+
87
+ const secondaryButtonStyle =
88
+ props.type === "TwoButtonsInlineThird"
89
+ ? styles.buttonTwoThirds
90
+ : styles.button;
91
+
92
+ return (
93
+ <React.Fragment>
94
+ <HSpacer size={16} />
95
+ {renderButton(props.secondary, secondaryButtonStyle)}
96
+ </React.Fragment>
97
+ );
98
+ };
99
+
100
+ const renderMidButton = () => {
101
+ if (props.type !== "ThreeButtonsInLine") {
102
+ return null;
103
+ }
104
+
105
+ return (
106
+ <React.Fragment>
107
+ <HSpacer size={16} />
108
+ {renderButton(props.third, styles.button)}
109
+ </React.Fragment>
110
+ );
111
+ };
112
+
113
+ const renderLeftButton = () => {
114
+ const primaryButtonStyle =
115
+ props.type === "TwoButtonsInlineThirdInverted"
116
+ ? styles.buttonTwoThirds
117
+ : styles.button;
118
+
119
+ return renderButton(props.primary, primaryButtonStyle);
120
+ };
121
+
122
+ const renderButton = (
123
+ props: BlockButtonProps,
124
+ style: React.ComponentProps<typeof View>["style"]
125
+ ) => (
126
+ <View style={style}>
127
+ {props.type === "Solid" ? (
128
+ <ButtonSolid {...props.buttonProps} />
129
+ ) : (
130
+ <ButtonOutline {...props.buttonProps} />
131
+ )}
132
+ </View>
133
+ );
134
+
135
+ return (
136
+ <View style={{ ...IOStyles.flex, ...IOStyles.row }}>
137
+ {renderLeftButton()}
138
+ {renderMidButton()}
139
+ {renderRightButton()}
140
+ </View>
141
+ );
142
+ };
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+
3
+ import { StyleSheet, View } from "react-native";
4
+ import { IOStyles } from "../../core";
5
+ import { BlockButtons, BlockButtonsProps } from "./BlockButtons";
6
+
7
+ // TODO: Refactor with an unique component like `FooterTopShadow` after bonus vacanze
8
+ const styles = StyleSheet.create({
9
+ container: {
10
+ overflow: "hidden",
11
+ width: "100%",
12
+ // This Magic number is an heritage of the app code-base, this component should be removed in favor of `GradientBottomAction`
13
+ marginTop: -50,
14
+ paddingTop: 50,
15
+ position: "absolute",
16
+ bottom: 0
17
+ }
18
+ });
19
+
20
+ /**
21
+ * Implements a component that show buttons as sticky footer
22
+ * It can include 1, 2 or 3 buttons. If they are 2, they can have the inlineHalf or the inlineOneThird style
23
+ */
24
+ export const FooterWithButtons = (props: BlockButtonsProps) => (
25
+ <View
26
+ style={styles.container}
27
+ accessible={props.accessible}
28
+ pointerEvents={"box-none"}
29
+ testID="FooterWithButtons"
30
+ >
31
+ <View style={IOStyles.footer}>
32
+ <BlockButtons {...props} />
33
+ </View>
34
+ </View>
35
+ );
36
+
37
+ export default FooterWithButtons;
@@ -2,3 +2,4 @@ export * from "./GradientScrollView";
2
2
  export * from "./GradientBottomActions";
3
3
  export * from "./HeaderFirstLevel";
4
4
  export * from "./HeaderSecondLevel";
5
+ export * from "./FooterWithButtons";