@pagopa/io-app-design-system 4.3.0 → 4.4.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 (309) hide show
  1. package/lib/commonjs/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +3 -3
  2. package/lib/commonjs/components/alert/Alert.js +34 -34
  3. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  4. package/lib/commonjs/components/badge/Badge.js +16 -3
  5. package/lib/commonjs/components/badge/Badge.js.map +1 -1
  6. package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +9 -5
  7. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  8. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
  9. package/lib/commonjs/components/buttons/ButtonLink.js +6 -1
  10. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  11. package/lib/commonjs/components/buttons/ButtonOutline.js +11 -9
  12. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  13. package/lib/commonjs/components/buttons/ButtonSolid.js +10 -6
  14. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  15. package/lib/commonjs/components/buttons/IconButton.js +2 -0
  16. package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
  17. package/lib/commonjs/components/buttons/IconButtonSolid.js +1 -0
  18. package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
  19. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +27 -9
  20. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +23 -18
  21. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
  22. package/lib/commonjs/components/checkbox/CheckboxLabel.js +13 -8
  23. package/lib/commonjs/components/checkbox/CheckboxLabel.js.map +1 -1
  24. package/lib/commonjs/components/common/AnimatedTick.js +7 -3
  25. package/lib/commonjs/components/common/AnimatedTick.js.map +1 -1
  26. package/lib/commonjs/components/common/LogoPaymentWithFallback.js +9 -3
  27. package/lib/commonjs/components/common/LogoPaymentWithFallback.js.map +1 -1
  28. package/lib/commonjs/components/featureInfo/FeatureInfo.js +9 -6
  29. package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
  30. package/lib/commonjs/components/icons/Icon.js +14 -7
  31. package/lib/commonjs/components/icons/Icon.js.map +1 -1
  32. package/lib/commonjs/components/layout/HeaderFirstLevel.js +7 -10
  33. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  34. package/lib/commonjs/components/layout/HeaderSecondLevel.js +8 -9
  35. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
  36. package/lib/commonjs/components/listitems/ListItemAction.js +11 -7
  37. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  38. package/lib/commonjs/components/listitems/ListItemAmount.js +13 -11
  39. package/lib/commonjs/components/listitems/ListItemAmount.js.map +1 -1
  40. package/lib/commonjs/components/listitems/ListItemCheckbox.js +12 -7
  41. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  42. package/lib/commonjs/components/listitems/ListItemHeader.js +9 -2
  43. package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
  44. package/lib/commonjs/components/listitems/ListItemInfo.js +14 -17
  45. package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
  46. package/lib/commonjs/components/listitems/ListItemInfoCopy.js +15 -13
  47. package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
  48. package/lib/commonjs/components/listitems/ListItemNav.js +20 -17
  49. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  50. package/lib/commonjs/components/listitems/ListItemNavAlert.js +19 -14
  51. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  52. package/lib/commonjs/components/listitems/ListItemRadio.js +24 -9
  53. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  54. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +5 -0
  55. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  56. package/lib/commonjs/components/listitems/ListItemSwitch.js +12 -14
  57. package/lib/commonjs/components/listitems/ListItemSwitch.js.map +1 -1
  58. package/lib/commonjs/components/listitems/ListItemTransaction.js +2 -0
  59. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  60. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +435 -429
  61. package/lib/commonjs/components/modules/ModuleCredential.js +7 -2
  62. package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
  63. package/lib/commonjs/components/modules/ModuleNavigation.js +5 -1
  64. package/lib/commonjs/components/modules/ModuleNavigation.js.map +1 -1
  65. package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -20
  66. package/lib/commonjs/components/pictograms/Pictogram.js +17 -4
  67. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  68. package/lib/commonjs/components/radio/AnimatedRadio.js +16 -15
  69. package/lib/commonjs/components/radio/AnimatedRadio.js.map +1 -1
  70. package/lib/commonjs/components/radio/RadioButtonLabel.js +9 -5
  71. package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -1
  72. package/lib/commonjs/components/searchInput/SearchInput.js +4 -3
  73. package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
  74. package/lib/commonjs/components/spacer/Spacer.js +13 -6
  75. package/lib/commonjs/components/spacer/Spacer.js.map +1 -1
  76. package/lib/commonjs/components/stack/Stack.js +19 -9
  77. package/lib/commonjs/components/stack/Stack.js.map +1 -1
  78. package/lib/commonjs/components/tag/Tag.js +21 -8
  79. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  80. package/lib/commonjs/components/textInput/TextInput.js.map +1 -1
  81. package/lib/commonjs/components/textInput/TextInputBase.js +23 -10
  82. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  83. package/lib/commonjs/components/typography/IOText.js +3 -6
  84. package/lib/commonjs/components/typography/IOText.js.map +1 -1
  85. package/lib/commonjs/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +84 -84
  86. package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +50 -50
  87. package/lib/commonjs/utils/accessibility.js +24 -1
  88. package/lib/commonjs/utils/accessibility.js.map +1 -1
  89. package/lib/commonjs/utils/fonts.js +3 -2
  90. package/lib/commonjs/utils/fonts.js.map +1 -1
  91. package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +3 -3
  92. package/lib/module/components/alert/Alert.js +35 -35
  93. package/lib/module/components/alert/Alert.js.map +1 -1
  94. package/lib/module/components/badge/Badge.js +16 -3
  95. package/lib/module/components/badge/Badge.js.map +1 -1
  96. package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +9 -5
  97. package/lib/module/components/banner/Banner.js.map +1 -1
  98. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
  99. package/lib/module/components/buttons/ButtonLink.js +6 -1
  100. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  101. package/lib/module/components/buttons/ButtonOutline.js +11 -9
  102. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  103. package/lib/module/components/buttons/ButtonSolid.js +10 -6
  104. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  105. package/lib/module/components/buttons/IconButton.js +2 -0
  106. package/lib/module/components/buttons/IconButton.js.map +1 -1
  107. package/lib/module/components/buttons/IconButtonSolid.js +1 -0
  108. package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
  109. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +27 -9
  110. package/lib/module/components/checkbox/AnimatedCheckbox.js +23 -18
  111. package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
  112. package/lib/module/components/checkbox/CheckboxLabel.js +14 -9
  113. package/lib/module/components/checkbox/CheckboxLabel.js.map +1 -1
  114. package/lib/module/components/common/AnimatedTick.js +7 -3
  115. package/lib/module/components/common/AnimatedTick.js.map +1 -1
  116. package/lib/module/components/common/LogoPaymentWithFallback.js +9 -3
  117. package/lib/module/components/common/LogoPaymentWithFallback.js.map +1 -1
  118. package/lib/module/components/featureInfo/FeatureInfo.js +11 -8
  119. package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
  120. package/lib/module/components/icons/Icon.js +15 -6
  121. package/lib/module/components/icons/Icon.js.map +1 -1
  122. package/lib/module/components/layout/HeaderFirstLevel.js +8 -11
  123. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  124. package/lib/module/components/layout/HeaderSecondLevel.js +9 -10
  125. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
  126. package/lib/module/components/listitems/ListItemAction.js +11 -7
  127. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  128. package/lib/module/components/listitems/ListItemAmount.js +13 -11
  129. package/lib/module/components/listitems/ListItemAmount.js.map +1 -1
  130. package/lib/module/components/listitems/ListItemCheckbox.js +14 -9
  131. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  132. package/lib/module/components/listitems/ListItemHeader.js +9 -2
  133. package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
  134. package/lib/module/components/listitems/ListItemInfo.js +14 -17
  135. package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
  136. package/lib/module/components/listitems/ListItemInfoCopy.js +15 -13
  137. package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
  138. package/lib/module/components/listitems/ListItemNav.js +22 -19
  139. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  140. package/lib/module/components/listitems/ListItemNavAlert.js +21 -16
  141. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  142. package/lib/module/components/listitems/ListItemRadio.js +25 -10
  143. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  144. package/lib/module/components/listitems/ListItemRadioWithAmount.js +6 -1
  145. package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  146. package/lib/module/components/listitems/ListItemSwitch.js +12 -14
  147. package/lib/module/components/listitems/ListItemSwitch.js.map +1 -1
  148. package/lib/module/components/listitems/ListItemTransaction.js +2 -0
  149. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  150. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +435 -429
  151. package/lib/module/components/modules/ModuleCredential.js +7 -2
  152. package/lib/module/components/modules/ModuleCredential.js.map +1 -1
  153. package/lib/module/components/modules/ModuleNavigation.js +5 -1
  154. package/lib/module/components/modules/ModuleNavigation.js.map +1 -1
  155. package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -20
  156. package/lib/module/components/pictograms/Pictogram.js +17 -4
  157. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  158. package/lib/module/components/radio/AnimatedRadio.js +16 -15
  159. package/lib/module/components/radio/AnimatedRadio.js.map +1 -1
  160. package/lib/module/components/radio/RadioButtonLabel.js +10 -6
  161. package/lib/module/components/radio/RadioButtonLabel.js.map +1 -1
  162. package/lib/module/components/searchInput/SearchInput.js +5 -4
  163. package/lib/module/components/searchInput/SearchInput.js.map +1 -1
  164. package/lib/module/components/spacer/Spacer.js +11 -5
  165. package/lib/module/components/spacer/Spacer.js.map +1 -1
  166. package/lib/module/components/stack/Stack.js +19 -9
  167. package/lib/module/components/stack/Stack.js.map +1 -1
  168. package/lib/module/components/tag/Tag.js +21 -8
  169. package/lib/module/components/tag/Tag.js.map +1 -1
  170. package/lib/module/components/textInput/TextInput.js.map +1 -1
  171. package/lib/module/components/textInput/TextInputBase.js +23 -10
  172. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  173. package/lib/module/components/typography/IOText.js +5 -8
  174. package/lib/module/components/typography/IOText.js.map +1 -1
  175. package/lib/module/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +84 -84
  176. package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +50 -50
  177. package/lib/module/utils/accessibility.js +23 -1
  178. package/lib/module/utils/accessibility.js.map +1 -1
  179. package/lib/module/utils/fonts.js +1 -0
  180. package/lib/module/utils/fonts.js.map +1 -1
  181. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  182. package/lib/typescript/components/badge/Badge.d.ts +2 -1
  183. package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
  184. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  185. package/lib/typescript/components/buttons/ButtonLink.d.ts +1 -1
  186. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  187. package/lib/typescript/components/buttons/ButtonOutline.d.ts +1 -1
  188. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  189. package/lib/typescript/components/buttons/ButtonSolid.d.ts +1 -1
  190. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  191. package/lib/typescript/components/buttons/IconButton.d.ts.map +1 -1
  192. package/lib/typescript/components/buttons/IconButtonSolid.d.ts.map +1 -1
  193. package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts +2 -1
  194. package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
  195. package/lib/typescript/components/checkbox/CheckboxLabel.d.ts +2 -1
  196. package/lib/typescript/components/checkbox/CheckboxLabel.d.ts.map +1 -1
  197. package/lib/typescript/components/common/AnimatedTick.d.ts +4 -3
  198. package/lib/typescript/components/common/AnimatedTick.d.ts.map +1 -1
  199. package/lib/typescript/components/common/LogoPaymentWithFallback.d.ts.map +1 -1
  200. package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
  201. package/lib/typescript/components/icons/Icon.d.ts +5 -3
  202. package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
  203. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
  204. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
  205. package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
  206. package/lib/typescript/components/listitems/ListItemAmount.d.ts.map +1 -1
  207. package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
  208. package/lib/typescript/components/listitems/ListItemHeader.d.ts.map +1 -1
  209. package/lib/typescript/components/listitems/ListItemInfo.d.ts.map +1 -1
  210. package/lib/typescript/components/listitems/ListItemInfoCopy.d.ts.map +1 -1
  211. package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
  212. package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
  213. package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
  214. package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
  215. package/lib/typescript/components/listitems/ListItemSwitch.d.ts +2 -2
  216. package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
  217. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  218. package/lib/typescript/components/modules/ModuleCredential.d.ts.map +1 -1
  219. package/lib/typescript/components/modules/ModuleNavigation.d.ts.map +1 -1
  220. package/lib/typescript/components/pictograms/Pictogram.d.ts +5 -3
  221. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  222. package/lib/typescript/components/pictograms/types.d.ts +1 -2
  223. package/lib/typescript/components/pictograms/types.d.ts.map +1 -1
  224. package/lib/typescript/components/radio/AnimatedRadio.d.ts +2 -1
  225. package/lib/typescript/components/radio/AnimatedRadio.d.ts.map +1 -1
  226. package/lib/typescript/components/radio/RadioButtonLabel.d.ts +2 -1
  227. package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -1
  228. package/lib/typescript/components/searchInput/SearchInput.d.ts.map +1 -1
  229. package/lib/typescript/components/spacer/Spacer.d.ts +1 -0
  230. package/lib/typescript/components/spacer/Spacer.d.ts.map +1 -1
  231. package/lib/typescript/components/stack/Stack.d.ts +2 -1
  232. package/lib/typescript/components/stack/Stack.d.ts.map +1 -1
  233. package/lib/typescript/components/tag/Tag.d.ts +4 -2
  234. package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
  235. package/lib/typescript/components/textInput/TextInput.d.ts +2 -1
  236. package/lib/typescript/components/textInput/TextInput.d.ts.map +1 -1
  237. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
  238. package/lib/typescript/components/typography/BodyMonospace.d.ts +1 -1
  239. package/lib/typescript/components/typography/ButtonText.d.ts +1 -1
  240. package/lib/typescript/components/typography/Caption.d.ts +1 -1
  241. package/lib/typescript/components/typography/H1.d.ts +1 -1
  242. package/lib/typescript/components/typography/H2.d.ts +4 -1
  243. package/lib/typescript/components/typography/H2.d.ts.map +1 -1
  244. package/lib/typescript/components/typography/H3.d.ts +1 -1
  245. package/lib/typescript/components/typography/H4.d.ts +1 -1
  246. package/lib/typescript/components/typography/H5.d.ts +1 -1
  247. package/lib/typescript/components/typography/H6.d.ts +1 -1
  248. package/lib/typescript/components/typography/Hero.d.ts +1 -1
  249. package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
  250. package/lib/typescript/components/typography/markdown/MdH1.d.ts +1 -1
  251. package/lib/typescript/components/typography/markdown/MdH2.d.ts +1 -1
  252. package/lib/typescript/components/typography/markdown/MdH3.d.ts +1 -1
  253. package/lib/typescript/core/IOStyles.d.ts +7 -7
  254. package/lib/typescript/utils/accessibility.d.ts +10 -0
  255. package/lib/typescript/utils/accessibility.d.ts.map +1 -1
  256. package/lib/typescript/utils/fonts.d.ts +2 -1
  257. package/lib/typescript/utils/fonts.d.ts.map +1 -1
  258. package/package.json +1 -1
  259. package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +3 -3
  260. package/src/components/alert/Alert.tsx +43 -61
  261. package/src/components/badge/Badge.tsx +29 -4
  262. package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +9 -5
  263. package/src/components/banner/Banner.tsx +0 -2
  264. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
  265. package/src/components/buttons/ButtonLink.tsx +4 -0
  266. package/src/components/buttons/ButtonOutline.tsx +24 -25
  267. package/src/components/buttons/ButtonSolid.tsx +10 -9
  268. package/src/components/buttons/IconButton.tsx +2 -0
  269. package/src/components/buttons/IconButtonSolid.tsx +1 -0
  270. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +27 -9
  271. package/src/components/checkbox/AnimatedCheckbox.tsx +36 -18
  272. package/src/components/checkbox/CheckboxLabel.tsx +22 -10
  273. package/src/components/common/AnimatedTick.tsx +9 -3
  274. package/src/components/common/LogoPaymentWithFallback.tsx +27 -5
  275. package/src/components/featureInfo/FeatureInfo.tsx +13 -9
  276. package/src/components/icons/Icon.tsx +23 -7
  277. package/src/components/layout/HeaderFirstLevel.tsx +11 -21
  278. package/src/components/layout/HeaderSecondLevel.tsx +5 -14
  279. package/src/components/listitems/ListItemAction.tsx +19 -8
  280. package/src/components/listitems/ListItemAmount.tsx +16 -11
  281. package/src/components/listitems/ListItemCheckbox.tsx +29 -15
  282. package/src/components/listitems/ListItemHeader.tsx +12 -2
  283. package/src/components/listitems/ListItemInfo.tsx +27 -20
  284. package/src/components/listitems/ListItemInfoCopy.tsx +27 -16
  285. package/src/components/listitems/ListItemNav.tsx +44 -40
  286. package/src/components/listitems/ListItemNavAlert.tsx +30 -16
  287. package/src/components/listitems/ListItemRadio.tsx +46 -32
  288. package/src/components/listitems/ListItemRadioWithAmount.tsx +7 -2
  289. package/src/components/listitems/ListItemSwitch.tsx +21 -27
  290. package/src/components/listitems/ListItemTransaction.tsx +3 -0
  291. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +435 -429
  292. package/src/components/modules/ModuleCredential.tsx +5 -2
  293. package/src/components/modules/ModuleNavigation.tsx +3 -1
  294. package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -20
  295. package/src/components/pictograms/Pictogram.tsx +24 -5
  296. package/src/components/pictograms/types.ts +1 -3
  297. package/src/components/radio/AnimatedRadio.tsx +31 -15
  298. package/src/components/radio/RadioButtonLabel.tsx +16 -8
  299. package/src/components/searchInput/SearchInput.tsx +10 -5
  300. package/src/components/spacer/Spacer.tsx +21 -6
  301. package/src/components/stack/Stack.tsx +25 -14
  302. package/src/components/tag/Tag.tsx +26 -8
  303. package/src/components/textInput/TextInput.tsx +2 -1
  304. package/src/components/textInput/TextInputBase.tsx +44 -11
  305. package/src/components/typography/IOText.tsx +5 -6
  306. package/src/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +84 -84
  307. package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +50 -50
  308. package/src/utils/accessibility.ts +29 -1
  309. package/src/utils/fonts.ts +1 -0
@@ -2,9 +2,9 @@
2
2
 
3
3
  exports[`Test Typography Components Body Snapshot 1`] = `
4
4
  <Text
5
- allowFontScaling={false}
5
+ allowFontScaling={true}
6
6
  dynamicTypeRamp="body"
7
- maxFontSizeMultiplier={1.25}
7
+ maxFontSizeMultiplier={1.5}
8
8
  style={
9
9
  [
10
10
  {},
@@ -25,9 +25,9 @@ exports[`Test Typography Components Body Snapshot 1`] = `
25
25
 
26
26
  exports[`Test Typography Components BodyMonospace Snapshot 1`] = `
27
27
  <Text
28
- allowFontScaling={false}
28
+ allowFontScaling={true}
29
29
  dynamicTypeRamp="body"
30
- maxFontSizeMultiplier={1.25}
30
+ maxFontSizeMultiplier={1.5}
31
31
  style={
32
32
  [
33
33
  {
@@ -50,9 +50,9 @@ exports[`Test Typography Components BodyMonospace Snapshot 1`] = `
50
50
 
51
51
  exports[`Test Typography Components BodySmall Snapshot 1`] = `
52
52
  <Text
53
- allowFontScaling={false}
53
+ allowFontScaling={true}
54
54
  dynamicTypeRamp="footnote"
55
- maxFontSizeMultiplier={1.25}
55
+ maxFontSizeMultiplier={1.5}
56
56
  style={
57
57
  [
58
58
  {},
@@ -73,9 +73,9 @@ exports[`Test Typography Components BodySmall Snapshot 1`] = `
73
73
 
74
74
  exports[`Test Typography Components BodySmall Snapshot 2`] = `
75
75
  <Text
76
- allowFontScaling={false}
76
+ allowFontScaling={true}
77
77
  dynamicTypeRamp="footnote"
78
- maxFontSizeMultiplier={1.25}
78
+ maxFontSizeMultiplier={1.5}
79
79
  style={
80
80
  [
81
81
  {},
@@ -96,9 +96,9 @@ exports[`Test Typography Components BodySmall Snapshot 2`] = `
96
96
 
97
97
  exports[`Test Typography Components BodySmall Snapshot 3`] = `
98
98
  <Text
99
- allowFontScaling={false}
99
+ allowFontScaling={true}
100
100
  dynamicTypeRamp="footnote"
101
- maxFontSizeMultiplier={1.25}
101
+ maxFontSizeMultiplier={1.5}
102
102
  style={
103
103
  [
104
104
  {},
@@ -119,9 +119,9 @@ exports[`Test Typography Components BodySmall Snapshot 3`] = `
119
119
 
120
120
  exports[`Test Typography Components BodySmall Snapshot 4`] = `
121
121
  <Text
122
- allowFontScaling={false}
122
+ allowFontScaling={true}
123
123
  dynamicTypeRamp="footnote"
124
- maxFontSizeMultiplier={1.25}
124
+ maxFontSizeMultiplier={1.5}
125
125
  style={
126
126
  [
127
127
  {},
@@ -142,9 +142,9 @@ exports[`Test Typography Components BodySmall Snapshot 4`] = `
142
142
 
143
143
  exports[`Test Typography Components BodySmall Snapshot 5`] = `
144
144
  <Text
145
- allowFontScaling={false}
145
+ allowFontScaling={true}
146
146
  dynamicTypeRamp="footnote"
147
- maxFontSizeMultiplier={1.25}
147
+ maxFontSizeMultiplier={1.5}
148
148
  style={
149
149
  [
150
150
  {},
@@ -165,8 +165,8 @@ exports[`Test Typography Components BodySmall Snapshot 5`] = `
165
165
 
166
166
  exports[`Test Typography Components CTA Snapshot 1`] = `
167
167
  <Text
168
- allowFontScaling={false}
169
- maxFontSizeMultiplier={1.25}
168
+ allowFontScaling={true}
169
+ maxFontSizeMultiplier={1.5}
170
170
  style={
171
171
  [
172
172
  {},
@@ -187,9 +187,9 @@ exports[`Test Typography Components CTA Snapshot 1`] = `
187
187
 
188
188
  exports[`Test Typography Components H1 Snapshot 1`] = `
189
189
  <Text
190
- allowFontScaling={false}
190
+ allowFontScaling={true}
191
191
  dynamicTypeRamp="largeTitle"
192
- maxFontSizeMultiplier={1.25}
192
+ maxFontSizeMultiplier={1.5}
193
193
  style={
194
194
  [
195
195
  {},
@@ -210,9 +210,9 @@ exports[`Test Typography Components H1 Snapshot 1`] = `
210
210
 
211
211
  exports[`Test Typography Components H1 Snapshot 2`] = `
212
212
  <Text
213
- allowFontScaling={false}
213
+ allowFontScaling={true}
214
214
  dynamicTypeRamp="largeTitle"
215
- maxFontSizeMultiplier={1.25}
215
+ maxFontSizeMultiplier={1.5}
216
216
  style={
217
217
  [
218
218
  {},
@@ -233,9 +233,9 @@ exports[`Test Typography Components H1 Snapshot 2`] = `
233
233
 
234
234
  exports[`Test Typography Components H2 Snapshot 1`] = `
235
235
  <Text
236
- allowFontScaling={false}
236
+ allowFontScaling={true}
237
237
  dynamicTypeRamp="title1"
238
- maxFontSizeMultiplier={1.25}
238
+ maxFontSizeMultiplier={1.5}
239
239
  style={
240
240
  [
241
241
  {},
@@ -256,9 +256,9 @@ exports[`Test Typography Components H2 Snapshot 1`] = `
256
256
 
257
257
  exports[`Test Typography Components H3 Snapshot 1`] = `
258
258
  <Text
259
- allowFontScaling={false}
259
+ allowFontScaling={true}
260
260
  dynamicTypeRamp="title2"
261
- maxFontSizeMultiplier={1.25}
261
+ maxFontSizeMultiplier={1.5}
262
262
  style={
263
263
  [
264
264
  {},
@@ -279,9 +279,9 @@ exports[`Test Typography Components H3 Snapshot 1`] = `
279
279
 
280
280
  exports[`Test Typography Components H3 Snapshot 2`] = `
281
281
  <Text
282
- allowFontScaling={false}
282
+ allowFontScaling={true}
283
283
  dynamicTypeRamp="title2"
284
- maxFontSizeMultiplier={1.25}
284
+ maxFontSizeMultiplier={1.5}
285
285
  style={
286
286
  [
287
287
  {},
@@ -302,9 +302,9 @@ exports[`Test Typography Components H3 Snapshot 2`] = `
302
302
 
303
303
  exports[`Test Typography Components H3 Snapshot 3`] = `
304
304
  <Text
305
- allowFontScaling={false}
305
+ allowFontScaling={true}
306
306
  dynamicTypeRamp="title2"
307
- maxFontSizeMultiplier={1.25}
307
+ maxFontSizeMultiplier={1.5}
308
308
  style={
309
309
  [
310
310
  {},
@@ -325,9 +325,9 @@ exports[`Test Typography Components H3 Snapshot 3`] = `
325
325
 
326
326
  exports[`Test Typography Components H3 Snapshot 4`] = `
327
327
  <Text
328
- allowFontScaling={false}
328
+ allowFontScaling={true}
329
329
  dynamicTypeRamp="title2"
330
- maxFontSizeMultiplier={1.25}
330
+ maxFontSizeMultiplier={1.5}
331
331
  style={
332
332
  [
333
333
  {},
@@ -348,9 +348,9 @@ exports[`Test Typography Components H3 Snapshot 4`] = `
348
348
 
349
349
  exports[`Test Typography Components H3 Snapshot 5`] = `
350
350
  <Text
351
- allowFontScaling={false}
351
+ allowFontScaling={true}
352
352
  dynamicTypeRamp="title2"
353
- maxFontSizeMultiplier={1.25}
353
+ maxFontSizeMultiplier={1.5}
354
354
  style={
355
355
  [
356
356
  {},
@@ -371,9 +371,9 @@ exports[`Test Typography Components H3 Snapshot 5`] = `
371
371
 
372
372
  exports[`Test Typography Components H4 Snapshot 1`] = `
373
373
  <Text
374
- allowFontScaling={false}
374
+ allowFontScaling={true}
375
375
  dynamicTypeRamp="title3"
376
- maxFontSizeMultiplier={1.25}
376
+ maxFontSizeMultiplier={1.5}
377
377
  style={
378
378
  [
379
379
  {},
@@ -394,9 +394,9 @@ exports[`Test Typography Components H4 Snapshot 1`] = `
394
394
 
395
395
  exports[`Test Typography Components H4 Snapshot 2`] = `
396
396
  <Text
397
- allowFontScaling={false}
397
+ allowFontScaling={true}
398
398
  dynamicTypeRamp="title3"
399
- maxFontSizeMultiplier={1.25}
399
+ maxFontSizeMultiplier={1.5}
400
400
  style={
401
401
  [
402
402
  {},
@@ -417,9 +417,9 @@ exports[`Test Typography Components H4 Snapshot 2`] = `
417
417
 
418
418
  exports[`Test Typography Components H4 Snapshot 3`] = `
419
419
  <Text
420
- allowFontScaling={false}
420
+ allowFontScaling={true}
421
421
  dynamicTypeRamp="title3"
422
- maxFontSizeMultiplier={1.25}
422
+ maxFontSizeMultiplier={1.5}
423
423
  style={
424
424
  [
425
425
  {},
@@ -440,9 +440,9 @@ exports[`Test Typography Components H4 Snapshot 3`] = `
440
440
 
441
441
  exports[`Test Typography Components H5 Snapshot 1`] = `
442
442
  <Text
443
- allowFontScaling={false}
443
+ allowFontScaling={true}
444
444
  dynamicTypeRamp="subheadline"
445
- maxFontSizeMultiplier={1.25}
445
+ maxFontSizeMultiplier={1.5}
446
446
  style={
447
447
  [
448
448
  {
@@ -466,9 +466,9 @@ exports[`Test Typography Components H5 Snapshot 1`] = `
466
466
 
467
467
  exports[`Test Typography Components H5 Snapshot 2`] = `
468
468
  <Text
469
- allowFontScaling={false}
469
+ allowFontScaling={true}
470
470
  dynamicTypeRamp="subheadline"
471
- maxFontSizeMultiplier={1.25}
471
+ maxFontSizeMultiplier={1.5}
472
472
  style={
473
473
  [
474
474
  {
@@ -492,9 +492,9 @@ exports[`Test Typography Components H5 Snapshot 2`] = `
492
492
 
493
493
  exports[`Test Typography Components H5 Snapshot 3`] = `
494
494
  <Text
495
- allowFontScaling={false}
495
+ allowFontScaling={true}
496
496
  dynamicTypeRamp="subheadline"
497
- maxFontSizeMultiplier={1.25}
497
+ maxFontSizeMultiplier={1.5}
498
498
  style={
499
499
  [
500
500
  {
@@ -518,9 +518,9 @@ exports[`Test Typography Components H5 Snapshot 3`] = `
518
518
 
519
519
  exports[`Test Typography Components H5 Snapshot 4`] = `
520
520
  <Text
521
- allowFontScaling={false}
521
+ allowFontScaling={true}
522
522
  dynamicTypeRamp="subheadline"
523
- maxFontSizeMultiplier={1.25}
523
+ maxFontSizeMultiplier={1.5}
524
524
  style={
525
525
  [
526
526
  {
@@ -544,9 +544,9 @@ exports[`Test Typography Components H5 Snapshot 4`] = `
544
544
 
545
545
  exports[`Test Typography Components H6 Snapshot 1`] = `
546
546
  <Text
547
- allowFontScaling={false}
547
+ allowFontScaling={true}
548
548
  dynamicTypeRamp="headline"
549
- maxFontSizeMultiplier={1.25}
549
+ maxFontSizeMultiplier={1.5}
550
550
  style={
551
551
  [
552
552
  {},
@@ -568,9 +568,9 @@ exports[`Test Typography Components H6 Snapshot 1`] = `
568
568
  exports[`Test Typography Components Link Snapshot 1`] = `
569
569
  <Text
570
570
  accessibilityRole="link"
571
- allowFontScaling={false}
571
+ allowFontScaling={true}
572
572
  dynamicTypeRamp="body"
573
- maxFontSizeMultiplier={1.25}
573
+ maxFontSizeMultiplier={1.5}
574
574
  onPress={[Function]}
575
575
  style={
576
576
  [
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useBoldTextEnabled = void 0;
6
+ exports.useIOFontDynamicScale = exports.useBoldTextEnabled = void 0;
7
7
  var _react = require("react");
8
8
  var _reactNative = require("react-native");
9
+ var _fonts = require("./fonts");
9
10
  /**
10
11
  * Query whether a bold text is currently enabled. The result is true
11
12
  * when bold text is enabled and false otherwise.
@@ -28,5 +29,27 @@ const useBoldTextEnabled = () => {
28
29
  }, []);
29
30
  return boldTextEnabled;
30
31
  };
32
+
33
+ /**
34
+ * Returns a font size multiplier based on the font scale of the device,
35
+ * but limited to the `IOMaxFontSizeMultiplier` value.
36
+ * @returns number
37
+ */
31
38
  exports.useBoldTextEnabled = useBoldTextEnabled;
39
+ const useIOFontDynamicScale = () => {
40
+ const {
41
+ fontScale
42
+ } = (0, _reactNative.useWindowDimensions)();
43
+ const hugeFontEnabled = fontScale >= 1.35;
44
+ const dynamicFontScale = Math.min(fontScale, _fonts.IOMaxFontSizeMultiplier);
45
+ /* We make the spacing dynamic based on the font scale, but we multiply
46
+ this value to limit the amount of scaling applied to the spacing */
47
+ const spacingScaleMultiplier = dynamicFontScale <= _fonts.IOMaxFontSizeMultiplier ? 1 : 0.8;
48
+ return {
49
+ hugeFontEnabled,
50
+ dynamicFontScale,
51
+ spacingScaleMultiplier
52
+ };
53
+ };
54
+ exports.useIOFontDynamicScale = useIOFontDynamicScale;
32
55
  //# sourceMappingURL=accessibility.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","useBoldTextEnabled","boldTextEnabled","setBoldTextEnabled","useState","useEffect","Platform","OS","boldTextChangedSubscription","AccessibilityInfo","addEventListener","isBoldTextEnabled","then","catch","_","remove","exports"],"sourceRoot":"../../../src","sources":["utils/accessibility.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAME,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE7D,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzB,MAAMC,2BAA2B,GAAGC,8BAAiB,CAACC,gBAAgB,CACpE,iBAAiB,EACjBC,iBAAiB,IAAI;QACnBR,kBAAkB,CAACQ,iBAAiB,CAAC;MACvC,CACF,CAAC;MAEDF,8BAAiB,CAACE,iBAAiB,CAAC,CAAC,CAClCC,IAAI,CAACD,iBAAiB,IAAI;QACzBR,kBAAkB,CAACQ,iBAAiB,CAAC;MACvC,CAAC,CAAC,CACDE,KAAK,CAACC,CAAC,IAAI,KAAK,CAAC;MAEpB,OAAO,MAAM;QACXN,2BAA2B,CAACO,MAAM,CAAC,CAAC;MACtC,CAAC;IACH;IACA;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOb,eAAe;AACxB,CAAC;AAACc,OAAA,CAAAf,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["_react","require","_reactNative","_fonts","useBoldTextEnabled","boldTextEnabled","setBoldTextEnabled","useState","useEffect","Platform","OS","boldTextChangedSubscription","AccessibilityInfo","addEventListener","isBoldTextEnabled","then","catch","_","remove","exports","useIOFontDynamicScale","fontScale","useWindowDimensions","hugeFontEnabled","dynamicFontScale","Math","min","IOMaxFontSizeMultiplier","spacingScaleMultiplier"],"sourceRoot":"../../../src","sources":["utils/accessibility.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMG,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE7D,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzB,MAAMC,2BAA2B,GAAGC,8BAAiB,CAACC,gBAAgB,CACpE,iBAAiB,EACjBC,iBAAiB,IAAI;QACnBR,kBAAkB,CAACQ,iBAAiB,CAAC;MACvC,CACF,CAAC;MAEDF,8BAAiB,CAACE,iBAAiB,CAAC,CAAC,CAClCC,IAAI,CAACD,iBAAiB,IAAI;QACzBR,kBAAkB,CAACQ,iBAAiB,CAAC;MACvC,CAAC,CAAC,CACDE,KAAK,CAACC,CAAC,IAAI,KAAK,CAAC;MAEpB,OAAO,MAAM;QACXN,2BAA2B,CAACO,MAAM,CAAC,CAAC;MACtC,CAAC;IACH;IACA;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOb,eAAe;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJAc,OAAA,CAAAf,kBAAA,GAAAA,kBAAA;AAKO,MAAMgB,qBAAqB,GAAGA,CAAA,KAIhC;EACH,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,gCAAmB,EAAC,CAAC;EAE3C,MAAMC,eAAe,GAAGF,SAAS,IAAI,IAAI;EAEzC,MAAMG,gBAAgB,GAAGC,IAAI,CAACC,GAAG,CAACL,SAAS,EAAEM,8BAAuB,CAAC;EACrE;AACF;EACE,MAAMC,sBAAsB,GAC1BJ,gBAAgB,IAAIG,8BAAuB,GAAG,CAAC,GAAG,GAAG;EAEvD,OAAO;IACLJ,eAAe;IACfC,gBAAgB;IAChBI;EACF,CAAC;AACH,CAAC;AAACT,OAAA,CAAAC,qBAAA,GAAAA,qBAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.makeFontStyleObject = exports.makeFontFamilyName = exports.fontWeights = void 0;
6
+ exports.makeFontStyleObject = exports.makeFontFamilyName = exports.fontWeights = exports.IOMaxFontSizeMultiplier = void 0;
7
7
  var _reactNative = require("react-native");
8
8
  /**
9
9
  * Utility functions to manage font properties to style mapping for both iOS and Android
@@ -91,6 +91,7 @@ exports.makeFontFamilyName = makeFontFamilyName;
91
91
  const defaultFont = "TitilliumSansPro";
92
92
  const defaultWeight = "Regular";
93
93
  const defaultFontSize = 16;
94
+ const IOMaxFontSizeMultiplier = 1.5;
94
95
 
95
96
  /**
96
97
  * Return a {@link FontStyleObject} with the fields filled based on the platform (iOS or Android).
@@ -99,7 +100,7 @@ const defaultFontSize = 16;
99
100
  * @param weight
100
101
  * @param fontStyle
101
102
  */
102
-
103
+ exports.IOMaxFontSizeMultiplier = IOMaxFontSizeMultiplier;
103
104
  const makeFontStyleObject = (size = defaultFontSize, font = defaultFont, lineHeight, weight = defaultWeight, fontStyle = "normal", boldEnabled = false) => {
104
105
  /* If bold text is currently enabled, we select the next
105
106
  available `IOFontWeight` value */
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","fonts","TitilliumSansPro","Platform","select","android","web","ios","default","Titillio","DMMono","fontSizes","fontSizesLegacy","allFontSizes","Set","weights","weightValues","fontWeights","Thin","Light","Regular","Medium","Semibold","Bold","Black","exports","getBolderFontWeight","weight","currentWeight","indexOf","length","makeFontFamilyName","font","defaultWeight","fontStyle","defaultFont","defaultFontSize","makeFontStyleObject","size","lineHeight","boldEnabled","dynamicWeight","fontSize","fontFamily","fontWeight","includeFontPadding"],"sourceRoot":"../../../src","sources":["utils/fon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Z,MAAoB,GAAGM,aAAa,EACpCC,SAAiC,GAAG,QAAQ,EAC5CM,WAAoB,GAAG,KAAK,KACR;EACpB;AACF;EACE,MAAMC,aAAa,GAAGD,WAAW,GAAGd,mBAAmB,CAACC,MAAM,CAAC,GAAGA,MAAM;EAExE,OAAOxB,qBAAQ,CAACC,MAAM,CAAC;IACrBE,GAAG,EAAE;MACHoC,QAAQ,EAAEJ,IAAI;MACdK,UAAU,EAAEZ,kBAAkB,CAACC,IAAI,EAAES,aAAa,EAAEP,SAAS,CAAC;MAC9DU,UAAU,EAAE3B,WAAW,CAACwB,aAAa,CAAC;MACtCF,UAAU;MACVL;IACF,CAAC;IACD;IACA;IACA;IACA7B,OAAO,EAAE;MACPqC,QAAQ,EAAEJ,IAAI;MACdK,UAAU,EAAEZ,kBAAkB,CAACC,IAAI,EAAES,aAAa,EAAEP,SAAS,CAAC;MAC9DK,UAAU;MACVM,kBAAkB,EAAE;IACtB,CAAC;IACDtC,GAAG,EAAE;MACHmC,QAAQ,EAAEJ,IAAI;MACdK,UAAU,EAAEZ,kBAAkB,CAACC,IAAI,EAAES,aAAa,EAAEP,SAAS,CAAC;MAC9DU,UAAU,EAAE3B,WAAW,CAACwB,aAAa,CAAC;MACtCF,UAAU;MACVL;IACF,CAAC;IACD1B,OAAO,EAAE;MACPkC,QAAQ,EAAEJ,IAAI;MACdK,UAAU,EAAEZ,kBAAkB,CAACC,IAAI,EAAES,aAAa,EAAEP,SAAS;IAC/D;EACF,CAAC,CAAC;AACJ,CAAC;AAACT,OAAA,CAAAY,mBAAA,GAAAA,mBAAA"}
1
+ {"version":3,"names":["_reactNative","require","fonts","TitilliumSansPro","Platform","select","android","web","ios","default","Titillio","DMMono","fontSizes","fontSizesLegacy","allFontSizes","Set","weights","weightValues","fontWeights","Thin","Light","Regular","Medium","Semibold","Bold","Black","exports","getBolderFontWeight","weight","currentWeight","indexOf","length","makeFontFamilyName","font","defaultWeight","fontStyle","defaultFont","defaultFontSize","IOMaxFontSizeMultiplier","makeFontStyleObject","size","lineHeight","boldEnabled","dynamicWeight","fontSize","fontFamily","fontWeight","includeFontPadding"],"sourceRoot":"../../../src","sources":["utils/fonts.ts"],"mappings":";;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAMC,KAAK,GAAG;EACZC,gBAAgB,EAAEC,qBAAQ,CAACC,MAAM,CAAC;IAChCC,OAAO,EAAE,kBAAkB;IAC3BC,GAAG,EAAE,kBAAkB;IACvBC,GAAG,EAAE,oBAAoB;IACzBC,OAAO,EAAE;EACX,CAAC,CAAC;EACFC,QAAQ,EAAEN,qBAAQ,CAACC,MAAM,CAAC;IACxBC,OAAO,EAAE,UAAU;IACnBC,GAAG,EAAE,UAAU;IACfC,GAAG,EAAE,UAAU;IACfC,OAAO,EAAE;EACX,CAAC,CAAC;EACFE,MAAM,EAAEP,qBAAQ,CAACC,MAAM,CAAC;IACtBC,OAAO,EAAE,QAAQ;IACjBC,GAAG,EAAE,QAAQ;IACbC,GAAG,EAAE,SAAS;IACdC,OAAO,EAAE;EACX,CAAC;AACH,CAAU;AAIV;AACA;AACA;AACA,MAAMG,SAAS,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAU;AAC3D,MAAMC,eAAe,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAU;AACjD,MAAMC,YAAY,GAAG,CAAC,GAAG,IAAIC,GAAG,CAAC,CAAC,GAAGH,SAAS,EAAE,GAAGC,eAAe,CAAC,CAAC,CAAC;AAGrE;AACA;AACA;;AAEA,MAAMG,OAAO,GAAG,CACd,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,UAAU,EACV,MAAM,EACN,OAAO,CACC;AAGV,MAAMC,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KA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<Text
87
87
  allowFontScaling={true}
88
88
  dynamicTypeRamp="body"
89
- maxFontSizeMultiplier={1.25}
89
+ maxFontSizeMultiplier={1.5}
90
90
  style={
91
91
  [
92
92
  {},
@@ -190,9 +190,9 @@ exports[`Test Advice Components Advice Snapshot 1`] = `
190
190
  }
191
191
  />
192
192
  <Text
193
- allowFontScaling={false}
193
+ allowFontScaling={true}
194
194
  dynamicTypeRamp="body"
195
- maxFontSizeMultiplier={1.25}
195
+ maxFontSizeMultiplier={1.5}
196
196
  style={
197
197
  [
198
198
  {},
@@ -1,32 +1,18 @@
1
1
  import React, { forwardRef, useCallback, useState } from "react";
2
- import { PixelRatio, Pressable, StyleSheet, View } from "react-native";
2
+ import { Pressable, View } from "react-native";
3
3
  import Animated from "react-native-reanimated";
4
4
  import { IOVisualCostants, useIOThemeContext } from "../../core";
5
5
  import { IOColors, hexToRgba } from "../../core/IOColors";
6
6
  import { IOAlertRadius } from "../../core/IOShapes";
7
7
  import { IOAlertSpacing } from "../../core/IOSpacing";
8
8
  import { useScaleAnimation } from "../../hooks";
9
+ import { useIOFontDynamicScale } from "../../utils/accessibility";
9
10
  import { Icon } from "../icons";
10
- import { VSpacer } from "../spacer";
11
+ import { HStack, VStack } from "../stack";
11
12
  import { Body, ButtonText } from "../typography";
12
13
  import { H4 } from "../typography/H4";
13
- const iconSize = 24;
14
- const [spacingDefault, spacingFullWidth] = IOAlertSpacing;
15
- const styles = StyleSheet.create({
16
- container: {
17
- flexDirection: "row",
18
- alignItems: "flex-start",
19
- alignContent: "center"
20
- },
21
- spacingDefault: {
22
- padding: spacingDefault,
23
- borderRadius: IOAlertRadius,
24
- borderCurve: "continuous"
25
- },
26
- spacingFullWidth: {
27
- padding: spacingFullWidth
28
- }
29
- });
14
+ const ICON_SIZE = 24;
15
+ const [padding, paddingFullWidth] = IOAlertSpacing;
30
16
  // COMPONENT CONFIGURATION
31
17
 
32
18
  const mapVariantStatesLightMode = {
@@ -89,6 +75,10 @@ export const Alert = /*#__PURE__*/forwardRef(({
89
75
  onPressOut,
90
76
  scaleAnimatedStyle
91
77
  } = useScaleAnimation("medium");
78
+ const {
79
+ dynamicFontScale,
80
+ spacingScaleMultiplier
81
+ } = useIOFontDynamicScale();
92
82
  const {
93
83
  themeType
94
84
  } = useIOThemeContext();
@@ -96,43 +86,51 @@ export const Alert = /*#__PURE__*/forwardRef(({
96
86
  const onTextLayout = useCallback(event => {
97
87
  setIsMultiline(event.nativeEvent.lines.length > 1);
98
88
  }, []);
89
+ const paddingDefaultVariant = {
90
+ padding,
91
+ borderRadius: IOAlertRadius * dynamicFontScale * spacingScaleMultiplier,
92
+ borderCurve: "continuous"
93
+ };
99
94
  const mapVariantStates = themeType === "light" ? mapVariantStatesLightMode : mapVariantStatesDarkMode;
100
- const renderMainBlock = () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
95
+ const renderMainBlock = () => /*#__PURE__*/React.createElement(HStack, {
96
+ space: IOVisualCostants.iconMargin,
97
+ allowScaleSpacing: true,
101
98
  style: {
102
- marginRight: IOVisualCostants.iconMargin,
103
- alignSelf: "flex-start"
99
+ alignItems: isMultiline ? "flex-start" : "center"
104
100
  }
105
101
  }, /*#__PURE__*/React.createElement(Icon, {
102
+ allowFontScaling: true,
106
103
  name: mapVariantStates[variant].icon,
107
- size: iconSize,
104
+ size: ICON_SIZE,
108
105
  color: mapVariantStates[variant].foreground
109
- })), /*#__PURE__*/React.createElement(View, {
106
+ }), /*#__PURE__*/React.createElement(View, {
110
107
  style: [!title && isMultiline && {
111
- marginTop: -5 * PixelRatio.getFontScale()
108
+ marginTop: -6 * dynamicFontScale
112
109
  }, isMultiline && {
113
- marginBottom: -3 * PixelRatio.getFontScale()
110
+ marginBottom: -4 * dynamicFontScale
114
111
  }, {
115
112
  flex: 1
116
113
  }]
117
- }, title && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(H4, {
114
+ }, /*#__PURE__*/React.createElement(VStack, {
115
+ space: 8,
116
+ allowScaleSpacing: true
117
+ }, title && /*#__PURE__*/React.createElement(H4, {
118
118
  color: mapVariantStates[variant].foreground
119
- }, title), /*#__PURE__*/React.createElement(VSpacer, {
120
- size: 8
121
- })), /*#__PURE__*/React.createElement(Body, {
119
+ }, title), /*#__PURE__*/React.createElement(Body, {
122
120
  color: mapVariantStates[variant].foreground,
123
121
  weight: "Regular",
124
122
  accessibilityRole: "text",
125
123
  onTextLayout: onTextLayout
126
- }, content), action && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VSpacer, {
127
- size: 8
128
- }), /*#__PURE__*/React.createElement(ButtonText, {
124
+ }, content), action && /*#__PURE__*/React.createElement(ButtonText, {
129
125
  color: mapVariantStates[variant].foreground,
130
126
  numberOfLines: 1,
131
127
  ellipsizeMode: "tail"
132
128
  }, action))));
133
129
  const StaticComponent = () => /*#__PURE__*/React.createElement(View, {
134
130
  ref: viewRef,
135
- style: [styles.container, fullWidth ? styles.spacingFullWidth : styles.spacingDefault, {
131
+ style: [fullWidth ? {
132
+ padding
133
+ } : paddingDefaultVariant, {
136
134
  backgroundColor: mapVariantStates[variant].background
137
135
  }],
138
136
  testID: testID,
@@ -153,7 +151,9 @@ export const Alert = /*#__PURE__*/forwardRef(({
153
151
  accessibilityHint: accessibilityHint,
154
152
  accessibilityRole: "button"
155
153
  }, /*#__PURE__*/React.createElement(Animated.View, {
156
- style: [styles.container, fullWidth ? styles.spacingFullWidth : styles.spacingDefault, {
154
+ style: [fullWidth ? {
155
+ padding: paddingFullWidth
156
+ } : paddingDefaultVariant, {
157
157
  backgroundColor: mapVariantStates[variant].background
158
158
  },
159
159
  // Disable pressed animation when component is full width
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","useCallback","useState","PixelRatio","Pressable","StyleSheet","View","Animated","IOVisualCostants","useIOThemeContext","IOColors","hexToRgba","IOAlertRadius","IOAlertSpacing","useScaleAnimation","Icon","VSpacer","Body","ButtonText","H4","iconSize","spacingDefault","spacingFullWidth","styles","create","container","flexDirection","alignItems","alignContent","padding","borderRadius","borderCurve","mapVariantStatesLightMode","error","icon","background","foreground","warning","info","success","bgOpacityDarkMode","mapVariantStatesDarkMode","Alert","variant","title","content","action","onPress","fullWidth","accessibilityHint","testID","viewRef","onPressIn","onPressOut","scaleAnimatedStyle","themeType","isMultiline","setIsMultiline","onTextLayout","event","nativeEvent","lines","length","mapVariantStates","renderMainBlock","createElement","Fragment","style","marginRight","iconMargin","alignSelf","name","size","color","marginTop","getFontScale","marginBottom","flex","weight","accessibilityRole","numberOfLines","ellipsizeMode","StaticComponent","ref","backgroundColor","accessible","PressableButton","onTouchEnd"],"sourceRoot":"../../../../src","sources":["components/alert/Alert.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAChE,SAIEC,UAAU,EACVC,SAAS,EACTC,UAAU,EAEVC,IAAI,QACC,cAAc;AACrB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,YAAY;AAChE,SAASC,QAAQ,EAAEC,SAAS,QAAQ,qBAAqB;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,iBAAiB,QAAQ,aAAa;AAE/C,SAAmCC,IAAI,QAAQ,UAAU;AACzD,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,IAAI,EAAEC,UAAU,QAAQ,eAAe;AAChD,SAASC,EAAE,QAAQ,kBAAkB;AAErC,MAAMC,QAAyB,GAAG,EAAE;AAEpC,MAAM,CAACC,cAAc,EAAEC,gBAAgB,CAAC,GAAGT,cAAc;AAEzD,MAAMU,MAAM,GAAGlB,UAAU,CAACmB,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,YAAY;IACxBC,YAAY,EAAE;EAChB,CAAC;EAC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AAI;IACH6E,GAAG,EAAEhC,OAAQ;IACbgB,KAAK,EAAE,CACL5C,MAAM,CAACE,SAAS,EAChBuB,SAAS,GAAGzB,MAAM,CAACD,gBAAgB,GAAGC,MAAM,CAACF,cAAc,EAC3D;MAAE+D,eAAe,EAAErB,gBAAgB,CAACpB,OAAO,CAAC,CAACR;IAAW,CAAC,CACzD;IACFe,MAAM,EAAEA,MAAO;IACfmC,UAAU,EAAE,KAAM;IAClBN,iBAAiB,EAAC,OAAO;IACzB9B,iBAAiB,EAAEA;EAAkB,GAEpCe,eAAe,CAAC,CACb,CACP;EAED,MAAMsB,eAAe,GAAGA,CAAA,kBACtBvF,KAAA,CAAAkE,aAAA,CAAC7D,SAAS;IACR+E,GAAG,EAAEhC,OAAQ;IACbD,MAAM,EAAEA,MAAO;IACfH,OAAO,EAAEA,OAAQ;IACjBK,SAAS,EAAEA,SAAU;IACrBC,UAAU,EAAEA,UAAW;IACvBkC,UAAU,EAAElC;IACZ;IAAA;IACAgC,UAAU,EAAE,IAAK;IACjBpC,iBAAiB,EAAEA,iBAAkB;IACrC8B,iBAAiB,EAAE;EAAS,gBAE5BhF,KAAA,CAAAkE,aAAA,CAAC1D,QAAQ,CAACD,IAAI;IACZ6D,KAAK,EAAE,CACL5C,MAAM,CAACE,SAAS,EAChBuB,SAAS,GAAGzB,MAAM,CAACD,gBAAgB,GAAGC,MAAM,CAACF,cAAc,EAC3D;MAAE+D,eAAe,EAAErB,gBAAgB,CAACpB,OAAO,CAAC,CAACR;IAAW,CAAC;IACzD;IACA,CAACa,SAAS,IAAIM,kBAAkB;EAChC,GAEDU,eAAe,CAAC,CACJ,CACN,CACZ;EAED,OAAOlB,MAAM,gBAAG/C,KAAA,CAAAkE,aAAA,CAACqB,eAAe,MAAE,CAAC,gBAAGvF,KAAA,CAAAkE,aAAA,CAACiB,eAAe,MAAE,CAAC;AAC3D,CACF,CAAC"}
1
+ {"version":3,"names":["React","forwardRef","useCallback","useState","Pressable","View","Animated","IOVisualCostants","useIOThemeContext","IOColors","hexToRgba","IOAlertRadius","IOAlertSpacing","useScaleAnimation","useIOFontDynamicScale","Icon","HStack","VStack","Body","ButtonText","H4","ICON_SIZE","padding","paddingFullWidth","mapVariantStatesLightMode","error","icon","background","foreground","warning","info","success","bgOpacityDarkMode","mapVariantStatesDarkMode","Alert","variant","title","content","action","onPress","fullWidth","accessibilityHint","testID","viewRef","onPressIn","onPressOut","scaleAnimatedStyle","dynamicFontScale","spacingScaleMultiplier","themeType","isMultiline","setIsMultiline","onTextLayout","event","nativeEvent","lines","length","paddingDefaultVariant","borderRadius","borderCurve","mapVariantStates","renderMainBlock","createElement","space","iconMargin","allowScaleSpacing","style","alignItems","allowFontScaling","name","size","color","marginTop","marginBottom","flex","weight","accessibilityRole","numberOfLines","ellipsizeMode","StaticComponent","ref","backgroundColor","accessible","PressableButton","onTouchEnd"],"sourceRoot":"../../../../src","sources":["components/alert/Alert.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAChE,SAIEC,SAAS,EAETC,IAAI,QACC,cAAc;AACrB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,YAAY;AAChE,SAASC,QAAQ,EAAEC,SAAS,QAAQ,qBAAqB;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,cAAc,QAAkB,sBAAsB;AAC/D,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,qBAAqB,QAAQ,2BAA2B;AAEjE,SAAmCC,IAAI,QAAQ,UAAU;AACzD,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AACzC,SAASC,IAAI,EAAEC,UAAU,QAAQ,eAAe;AAChD,SAASC,EAAE,QAAQ,kBAAkB;AAErC,MAAMC,SAA0B,GAAG,EAAE;AAErC,MAAM,CAACC,OAAO,EAAEC,gBAAgB,CAAC,GAAGX,cAAc;AA6BlD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AAM,EAAEA,MAAO;IACfwC,UAAU,EAAE,KAAM;IAClBN,iBAAiB,EAAC,OAAO;IACzBnC,iBAAiB,EAAEA;EAAkB,GAEpCoB,eAAe,CAAC,CACb,CACP;EAED,MAAMsB,eAAe,GAAGA,CAAA,kBACtBnF,KAAA,CAAA8D,aAAA,CAAC1D,SAAS;IACR4E,GAAG,EAAErC,OAAQ;IACbD,MAAM,EAAEA,MAAO;IACfH,OAAO,EAAEA,OAAQ;IACjBK,SAAS,EAAEA,SAAU;IACrBC,UAAU,EAAEA,UAAW;IACvBuC,UAAU,EAAEvC;IACZ;IAAA;IACAqC,UAAU,EAAE,IAAK;IACjBzC,iBAAiB,EAAEA,iBAAkB;IACrCmC,iBAAiB,EAAE;EAAS,gBAE5B5E,KAAA,CAAA8D,aAAA,CAACxD,QAAQ,CAACD,IAAI;IACZ6D,KAAK,EAAE,CACL1B,SAAS,GAAG;MAAElB,OAAO,EAAEC;IAAiB,CAAC,GAAGkC,qBAAqB,EACjE;MAAEwB,eAAe,EAAErB,gBAAgB,CAACzB,OAAO,CAAC,CAACR;IAAW,CAAC;IACzD;IACA,CAACa,SAAS,IAAIM,kBAAkB;EAChC,GAEDe,eAAe,CAAC,CACJ,CACN,CACZ;EAED,OAAOvB,MAAM,gBAAGtC,KAAA,CAAA8D,aAAA,CAACqB,eAAe,MAAE,CAAC,gBAAGnF,KAAA,CAAA8D,aAAA,CAACiB,eAAe,MAAE,CAAC;AAC3D,CACF,CAAC"}
@@ -1,18 +1,21 @@
1
1
  import React from "react";
2
2
  import { Platform, StyleSheet, View } from "react-native";
3
3
  import { hexToRgba, IOBadgeHSpacing, IOBadgeRadius, IOBadgeVSpacing, IOColors, useIOExperimentalDesign, useIOTheme, useIOThemeContext } from "../../core";
4
+ import { useIOFontDynamicScale } from "../../utils/accessibility";
4
5
  import { IOText } from "../typography";
5
6
  const styles = StyleSheet.create({
6
7
  badge: {
7
8
  flexDirection: "row",
8
9
  alignItems: "center",
9
10
  justifyContent: "center",
11
+ borderCurve: "continuous",
10
12
  ...Platform.select({
11
13
  android: {
12
14
  textAlignVertical: "center"
13
15
  }
14
- }),
15
- borderCurve: "continuous",
16
+ })
17
+ },
18
+ badgeStaticStyle: {
16
19
  borderRadius: IOBadgeRadius,
17
20
  paddingHorizontal: IOBadgeHSpacing,
18
21
  paddingVertical: IOBadgeVSpacing
@@ -25,6 +28,7 @@ const styles = StyleSheet.create({
25
28
  export const Badge = ({
26
29
  text,
27
30
  outline = false,
31
+ allowFontScaling = true,
28
32
  variant,
29
33
  testID
30
34
  }) => {
@@ -32,6 +36,9 @@ export const Badge = ({
32
36
  isExperimental
33
37
  } = useIOExperimentalDesign();
34
38
  const theme = useIOTheme();
39
+ const {
40
+ dynamicFontScale
41
+ } = useIOFontDynamicScale();
35
42
  const {
36
43
  themeType
37
44
  } = useIOThemeContext();
@@ -191,16 +198,22 @@ export const Badge = ({
191
198
  background,
192
199
  foreground
193
200
  } = variantMap[variant];
201
+ const dynamicStyle = {
202
+ borderRadius: IOBadgeRadius * dynamicFontScale,
203
+ paddingHorizontal: IOBadgeHSpacing * dynamicFontScale,
204
+ paddingVertical: IOBadgeVSpacing * dynamicFontScale
205
+ };
194
206
  return /*#__PURE__*/React.createElement(View, {
195
207
  accessible: true,
196
208
  testID: testID,
197
- style: [styles.badge, outline ? {
209
+ style: [styles.badge, allowFontScaling ? dynamicStyle : styles.badgeStaticStyle, outline ? {
198
210
  borderWidth: 1,
199
211
  borderColor: IOColors[foreground]
200
212
  } : {
201
213
  backgroundColor: background ?? undefined
202
214
  }]
203
215
  }, /*#__PURE__*/React.createElement(IOText, {
216
+ allowFontScaling: allowFontScaling,
204
217
  font: isExperimental ? "Titillio" : "TitilliumSansPro",
205
218
  weight: "Semibold",
206
219
  size: 12,