@pagopa/io-app-design-system 3.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/lib/commonjs/components/alert/Alert.js +1 -2
  2. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  3. package/lib/commonjs/components/alert/AlertEdgeToEdge.js +2 -2
  4. package/lib/commonjs/components/alert/AlertEdgeToEdge.js.map +1 -1
  5. package/lib/commonjs/components/banner/Banner.js +1 -1
  6. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  7. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
  8. package/lib/commonjs/components/buttons/ButtonLink.js +1 -1
  9. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  10. package/lib/commonjs/components/buttons/ButtonOutline.js +1 -1
  11. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  12. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
  13. package/lib/commonjs/components/featureInfo/FeatureInfo.js +3 -2
  14. package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
  15. package/lib/commonjs/components/index.js +11 -0
  16. package/lib/commonjs/components/index.js.map +1 -1
  17. package/lib/commonjs/components/layout/HeaderFirstLevel.js +1 -0
  18. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  19. package/lib/commonjs/components/listitems/ListItemCheckbox.js +1 -1
  20. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  21. package/lib/commonjs/components/listitems/ListItemInfo.js +1 -1
  22. package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
  23. package/lib/commonjs/components/listitems/ListItemInfoCopy.js +1 -1
  24. package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
  25. package/lib/commonjs/components/listitems/ListItemNav.js +1 -1
  26. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  27. package/lib/commonjs/components/listitems/ListItemNavAlert.js +1 -1
  28. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  29. package/lib/commonjs/components/listitems/ListItemRadio.js +1 -1
  30. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  31. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +2 -2
  32. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  33. package/lib/commonjs/components/listitems/ListItemSwitch.js +1 -1
  34. package/lib/commonjs/components/listitems/ListItemSwitch.js.map +1 -1
  35. package/lib/commonjs/components/listitems/ListItemTransaction.js +2 -2
  36. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  37. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
  38. package/lib/commonjs/components/modules/ModuleAttachment.js +1 -1
  39. package/lib/commonjs/components/modules/ModuleAttachment.js.map +1 -1
  40. package/lib/commonjs/components/modules/ModuleCheckout.js +1 -1
  41. package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
  42. package/lib/commonjs/components/modules/ModuleCredential.js +1 -1
  43. package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
  44. package/lib/commonjs/components/modules/ModuleNavigation.js +3 -2
  45. package/lib/commonjs/components/modules/ModuleNavigation.js.map +1 -1
  46. package/lib/commonjs/components/modules/ModulePaymentNotice.js +2 -2
  47. package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
  48. package/lib/commonjs/components/modules/ModuleSummary.js +1 -1
  49. package/lib/commonjs/components/modules/ModuleSummary.js.map +1 -1
  50. package/lib/commonjs/components/otpInput/BoxedInput.js +4 -6
  51. package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -1
  52. package/lib/commonjs/components/otpInput/OTPInput.js +5 -4
  53. package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
  54. package/lib/commonjs/components/tabs/TabItem.js +1 -1
  55. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  56. package/lib/commonjs/components/textInput/TextInputBase.js +2 -2
  57. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  58. package/lib/commonjs/components/tooltip/Arrows.js +49 -0
  59. package/lib/commonjs/components/tooltip/Arrows.js.map +1 -0
  60. package/lib/commonjs/components/tooltip/Tooltip.js +174 -0
  61. package/lib/commonjs/components/tooltip/Tooltip.js.map +1 -0
  62. package/lib/commonjs/components/tooltip/index.js +17 -0
  63. package/lib/commonjs/components/tooltip/index.js.map +1 -0
  64. package/lib/commonjs/components/tooltip/styles.js +50 -0
  65. package/lib/commonjs/components/tooltip/styles.js.map +1 -0
  66. package/lib/commonjs/components/tooltip/utils/index.js +180 -0
  67. package/lib/commonjs/components/tooltip/utils/index.js.map +1 -0
  68. package/lib/commonjs/components/tooltip/utils/types.js +2 -0
  69. package/lib/commonjs/components/tooltip/utils/types.js.map +1 -0
  70. package/lib/commonjs/components/typography/{LabelSmall.js → BodySmall.js} +8 -10
  71. package/lib/commonjs/components/typography/BodySmall.js.map +1 -0
  72. package/lib/commonjs/components/typography/ButtonText.js +1 -3
  73. package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
  74. package/lib/commonjs/components/typography/H3.js +3 -6
  75. package/lib/commonjs/components/typography/H3.js.map +1 -1
  76. package/lib/commonjs/components/typography/H6.js +4 -5
  77. package/lib/commonjs/components/typography/H6.js.map +1 -1
  78. package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
  79. package/lib/commonjs/components/typography/__test__/typography.test.js +6 -18
  80. package/lib/commonjs/components/typography/__test__/typography.test.js.map +1 -1
  81. package/lib/commonjs/components/typography/index.js +28 -72
  82. package/lib/commonjs/components/typography/index.js.map +1 -1
  83. package/lib/module/components/alert/Alert.js +2 -3
  84. package/lib/module/components/alert/Alert.js.map +1 -1
  85. package/lib/module/components/alert/AlertEdgeToEdge.js +2 -2
  86. package/lib/module/components/alert/AlertEdgeToEdge.js.map +1 -1
  87. package/lib/module/components/banner/Banner.js +2 -2
  88. package/lib/module/components/banner/Banner.js.map +1 -1
  89. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
  90. package/lib/module/components/buttons/ButtonLink.js +1 -1
  91. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  92. package/lib/module/components/buttons/ButtonOutline.js +1 -1
  93. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  94. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
  95. package/lib/module/components/featureInfo/FeatureInfo.js +4 -3
  96. package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
  97. package/lib/module/components/index.js +1 -0
  98. package/lib/module/components/index.js.map +1 -1
  99. package/lib/module/components/layout/HeaderFirstLevel.js +1 -0
  100. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  101. package/lib/module/components/listitems/ListItemCheckbox.js +2 -2
  102. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  103. package/lib/module/components/listitems/ListItemInfo.js +2 -2
  104. package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
  105. package/lib/module/components/listitems/ListItemInfoCopy.js +2 -2
  106. package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
  107. package/lib/module/components/listitems/ListItemNav.js +2 -2
  108. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  109. package/lib/module/components/listitems/ListItemNavAlert.js +2 -2
  110. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  111. package/lib/module/components/listitems/ListItemRadio.js +2 -2
  112. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  113. package/lib/module/components/listitems/ListItemRadioWithAmount.js +3 -3
  114. package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  115. package/lib/module/components/listitems/ListItemSwitch.js +2 -2
  116. package/lib/module/components/listitems/ListItemSwitch.js.map +1 -1
  117. package/lib/module/components/listitems/ListItemTransaction.js +3 -3
  118. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  119. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
  120. package/lib/module/components/modules/ModuleAttachment.js +2 -2
  121. package/lib/module/components/modules/ModuleAttachment.js.map +1 -1
  122. package/lib/module/components/modules/ModuleCheckout.js +2 -2
  123. package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
  124. package/lib/module/components/modules/ModuleCredential.js +2 -2
  125. package/lib/module/components/modules/ModuleCredential.js.map +1 -1
  126. package/lib/module/components/modules/ModuleNavigation.js +4 -3
  127. package/lib/module/components/modules/ModuleNavigation.js.map +1 -1
  128. package/lib/module/components/modules/ModulePaymentNotice.js +3 -3
  129. package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
  130. package/lib/module/components/modules/ModuleSummary.js +2 -2
  131. package/lib/module/components/modules/ModuleSummary.js.map +1 -1
  132. package/lib/module/components/otpInput/BoxedInput.js +5 -7
  133. package/lib/module/components/otpInput/BoxedInput.js.map +1 -1
  134. package/lib/module/components/otpInput/OTPInput.js +5 -4
  135. package/lib/module/components/otpInput/OTPInput.js.map +1 -1
  136. package/lib/module/components/tabs/TabItem.js +2 -2
  137. package/lib/module/components/tabs/TabItem.js.map +1 -1
  138. package/lib/module/components/textInput/TextInputBase.js +3 -3
  139. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  140. package/lib/module/components/tooltip/Arrows.js +36 -0
  141. package/lib/module/components/tooltip/Arrows.js.map +1 -0
  142. package/lib/module/components/tooltip/Tooltip.js +165 -0
  143. package/lib/module/components/tooltip/Tooltip.js.map +1 -0
  144. package/lib/module/components/tooltip/index.js +2 -0
  145. package/lib/module/components/tooltip/index.js.map +1 -0
  146. package/lib/module/components/tooltip/styles.js +43 -0
  147. package/lib/module/components/tooltip/styles.js.map +1 -0
  148. package/lib/module/components/tooltip/utils/index.js +163 -0
  149. package/lib/module/components/tooltip/utils/index.js.map +1 -0
  150. package/lib/module/components/tooltip/utils/types.js +2 -0
  151. package/lib/module/components/tooltip/utils/types.js.map +1 -0
  152. package/lib/module/components/typography/{LabelSmall.js → BodySmall.js} +6 -8
  153. package/lib/module/components/typography/BodySmall.js.map +1 -0
  154. package/lib/module/components/typography/ButtonText.js +1 -3
  155. package/lib/module/components/typography/ButtonText.js.map +1 -1
  156. package/lib/module/components/typography/H3.js +3 -6
  157. package/lib/module/components/typography/H3.js.map +1 -1
  158. package/lib/module/components/typography/H6.js +4 -5
  159. package/lib/module/components/typography/H6.js.map +1 -1
  160. package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
  161. package/lib/module/components/typography/__test__/typography.test.js +6 -18
  162. package/lib/module/components/typography/__test__/typography.test.js.map +1 -1
  163. package/lib/module/components/typography/index.js +6 -10
  164. package/lib/module/components/typography/index.js.map +1 -1
  165. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  166. package/lib/typescript/components/banner/Banner.d.ts +1 -1
  167. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  168. package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
  169. package/lib/typescript/components/index.d.ts +1 -0
  170. package/lib/typescript/components/index.d.ts.map +1 -1
  171. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
  172. package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
  173. package/lib/typescript/components/modules/ModuleNavigation.d.ts.map +1 -1
  174. package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -1
  175. package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
  176. package/lib/typescript/components/tooltip/Arrows.d.ts +14 -0
  177. package/lib/typescript/components/tooltip/Arrows.d.ts.map +1 -0
  178. package/lib/typescript/components/tooltip/Tooltip.d.ts +64 -0
  179. package/lib/typescript/components/tooltip/Tooltip.d.ts.map +1 -0
  180. package/lib/typescript/components/tooltip/index.d.ts +2 -0
  181. package/lib/typescript/components/tooltip/index.d.ts.map +1 -0
  182. package/lib/typescript/components/tooltip/styles.d.ts +41 -0
  183. package/lib/typescript/components/tooltip/styles.d.ts.map +1 -0
  184. package/lib/typescript/components/tooltip/utils/index.d.ts +89 -0
  185. package/lib/typescript/components/tooltip/utils/index.d.ts.map +1 -0
  186. package/lib/typescript/components/tooltip/utils/types.d.ts +10 -0
  187. package/lib/typescript/components/tooltip/utils/types.d.ts.map +1 -0
  188. package/lib/typescript/components/typography/Body.d.ts +1 -1
  189. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  190. package/lib/typescript/components/typography/BodySmall.d.ts +13 -0
  191. package/lib/typescript/components/typography/BodySmall.d.ts.map +1 -0
  192. package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
  193. package/lib/typescript/components/typography/H3.d.ts +2 -0
  194. package/lib/typescript/components/typography/H3.d.ts.map +1 -1
  195. package/lib/typescript/components/typography/H6.d.ts.map +1 -1
  196. package/lib/typescript/components/typography/LabelMini.d.ts +1 -1
  197. package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
  198. package/lib/typescript/components/typography/index.d.ts +6 -10
  199. package/lib/typescript/components/typography/index.d.ts.map +1 -1
  200. package/package.json +1 -1
  201. package/src/components/alert/Alert.tsx +3 -4
  202. package/src/components/alert/AlertEdgeToEdge.tsx +3 -3
  203. package/src/components/banner/Banner.tsx +7 -5
  204. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
  205. package/src/components/buttons/ButtonLink.tsx +1 -1
  206. package/src/components/buttons/ButtonOutline.tsx +1 -1
  207. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
  208. package/src/components/featureInfo/FeatureInfo.tsx +6 -6
  209. package/src/components/index.tsx +1 -0
  210. package/src/components/layout/HeaderFirstLevel.tsx +1 -0
  211. package/src/components/listitems/ListItemCheckbox.tsx +3 -3
  212. package/src/components/listitems/ListItemInfo.tsx +3 -3
  213. package/src/components/listitems/ListItemInfoCopy.tsx +3 -3
  214. package/src/components/listitems/ListItemNav.tsx +3 -3
  215. package/src/components/listitems/ListItemNavAlert.tsx +3 -3
  216. package/src/components/listitems/ListItemRadio.tsx +3 -3
  217. package/src/components/listitems/ListItemRadioWithAmount.tsx +5 -5
  218. package/src/components/listitems/ListItemSwitch.tsx +4 -4
  219. package/src/components/listitems/ListItemTransaction.tsx +5 -5
  220. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
  221. package/src/components/modules/ModuleAttachment.tsx +3 -3
  222. package/src/components/modules/ModuleCheckout.tsx +3 -3
  223. package/src/components/modules/ModuleCredential.tsx +3 -3
  224. package/src/components/modules/ModuleNavigation.tsx +6 -4
  225. package/src/components/modules/ModulePaymentNotice.tsx +5 -5
  226. package/src/components/modules/ModuleSummary.tsx +3 -3
  227. package/src/components/otpInput/BoxedInput.tsx +6 -5
  228. package/src/components/otpInput/OTPInput.tsx +23 -8
  229. package/src/components/tabs/TabItem.tsx +3 -3
  230. package/src/components/textInput/TextInputBase.tsx +5 -5
  231. package/src/components/tooltip/Arrows.tsx +36 -0
  232. package/src/components/tooltip/Tooltip.tsx +313 -0
  233. package/src/components/tooltip/index.ts +1 -0
  234. package/src/components/tooltip/styles.ts +44 -0
  235. package/src/components/tooltip/utils/index.ts +179 -0
  236. package/src/components/tooltip/utils/types.ts +9 -0
  237. package/src/components/typography/Body.tsx +1 -1
  238. package/src/components/typography/{LabelSmall.tsx → BodySmall.tsx} +7 -14
  239. package/src/components/typography/ButtonText.tsx +2 -4
  240. package/src/components/typography/H3.tsx +11 -8
  241. package/src/components/typography/H6.tsx +5 -6
  242. package/src/components/typography/LabelMini.tsx +1 -1
  243. package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
  244. package/src/components/typography/__test__/typography.test.tsx +8 -24
  245. package/src/components/typography/index.tsx +6 -10
  246. package/lib/commonjs/components/typography/BaseTypography.js +0 -52
  247. package/lib/commonjs/components/typography/BaseTypography.js.map +0 -1
  248. package/lib/commonjs/components/typography/Chip.js +0 -41
  249. package/lib/commonjs/components/typography/Chip.js.map +0 -1
  250. package/lib/commonjs/components/typography/Factory.js +0 -62
  251. package/lib/commonjs/components/typography/Factory.js.map +0 -1
  252. package/lib/commonjs/components/typography/Label.js +0 -51
  253. package/lib/commonjs/components/typography/Label.js.map +0 -1
  254. package/lib/commonjs/components/typography/LabelSmall.js.map +0 -1
  255. package/lib/module/components/typography/BaseTypography.js +0 -44
  256. package/lib/module/components/typography/BaseTypography.js.map +0 -1
  257. package/lib/module/components/typography/Chip.js +0 -32
  258. package/lib/module/components/typography/Chip.js.map +0 -1
  259. package/lib/module/components/typography/Factory.js +0 -55
  260. package/lib/module/components/typography/Factory.js.map +0 -1
  261. package/lib/module/components/typography/Label.js +0 -42
  262. package/lib/module/components/typography/Label.js.map +0 -1
  263. package/lib/module/components/typography/LabelSmall.js.map +0 -1
  264. package/lib/typescript/components/typography/BaseTypography.d.ts +0 -29
  265. package/lib/typescript/components/typography/BaseTypography.d.ts.map +0 -1
  266. package/lib/typescript/components/typography/Chip.d.ts +0 -13
  267. package/lib/typescript/components/typography/Chip.d.ts.map +0 -1
  268. package/lib/typescript/components/typography/Factory.d.ts +0 -43
  269. package/lib/typescript/components/typography/Factory.d.ts.map +0 -1
  270. package/lib/typescript/components/typography/Label.d.ts +0 -13
  271. package/lib/typescript/components/typography/Label.d.ts.map +0 -1
  272. package/lib/typescript/components/typography/LabelSmall.d.ts +0 -13
  273. package/lib/typescript/components/typography/LabelSmall.d.ts.map +0 -1
  274. package/src/components/typography/BaseTypography.tsx +0 -71
  275. package/src/components/typography/Chip.tsx +0 -33
  276. package/src/components/typography/Factory.tsx +0 -98
  277. package/src/components/typography/Label.tsx +0 -62
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Label = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _core = require("../../core");
9
- var _IOText = require("./IOText");
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
- const fontName = "Titillio";
14
- const fontWeight = "Semibold";
15
- const legacyFontName = "TitilliumSansPro";
16
- const legacyFontWeight = "Semibold";
17
-
18
- /**
19
- * `LabelSmall` typographic style
20
- */
21
- const Label = /*#__PURE__*/(0, _react.forwardRef)(({
22
- weight: customWeight,
23
- color: customColor,
24
- asLink,
25
- ...props
26
- }, ref) => {
27
- const theme = (0, _core.useIOTheme)();
28
- const {
29
- isExperimental
30
- } = (0, _core.useIOExperimentalDesign)();
31
- const defaultColor = asLink ? theme["interactiveElem-default"] : theme["textBody-tertiary"];
32
- const LabelProps = {
33
- ...props,
34
- font: isExperimental ? fontName : legacyFontName,
35
- weight: customWeight ? customWeight : isExperimental ? fontWeight : legacyFontWeight,
36
- size: 16,
37
- lineHeight: 24,
38
- color: customColor ?? defaultColor,
39
- ...(asLink ? {
40
- accessibilityRole: "link",
41
- textStyle: {
42
- textDecorationLine: "underline"
43
- }
44
- } : {})
45
- };
46
- return /*#__PURE__*/_react.default.createElement(_IOText.IOText, _extends({
47
- ref: ref
48
- }, LabelProps), props.children);
49
- });
50
- exports.Label = Label;
51
- //# sourceMappingURL=Label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_core","_IOText","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","fontName","fontWeight","legacyFontName","legacyFontWeight","Label","forwardRef","weight","customWeight","color","customColor","asLink","props","ref","theme","useIOTheme","isExperimental","useIOExperimentalDesign","defaultColor","LabelProps","font","size","lineHeight","accessibilityRole","textStyle","textDecorationLine","createElement","IOText","children","exports"],"sourceRoot":"../../../../src","sources":["components/typography/Label.tsx"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_core","_IOText","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","fontName","fontWeight","legacyFontName","legacyFontWeight","LabelSmall","forwardRef","weight","customWeight","color","customColor","asLink","props","ref","theme","useIOTheme","isExperimental","useIOExperimentalDesign","defaultColor","LabelSmallProps","dynamicTypeRamp","font","size","lineHeight","accessibilityRole","textStyle","textDecorationLine","createElement","IOText","children","exports"],"sourceRoot":"../../../../src","sources":["components/typography/LabelSmall.tsx"],"mappings":"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"}
@@ -1,44 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { useMemo } from "react";
3
- import { Text } from "react-native";
4
- import { IOColors } from "../../core/IOColors";
5
- import { makeFontStyleObject } from "../../utils/fonts";
6
-
7
- /**
8
- * The specific properties needed to calculate the font style using {@link makeFontStyleObject} (these information
9
- * cannot be included in the default StyleProp<TextStyle>
10
- */
11
-
12
- /**
13
- * Decorate the function {@link makeFontStyleObject} with the additional color calculation.
14
- * @param color A value key from {@link IOColors}, transformed here in {@link ColorValue}
15
- * @param args the args of the function {@link makeFontStyleObject}
16
- */
17
- const calculateTextStyle = (color, ...args) => ({
18
- ...makeFontStyleObject(...args),
19
- color: IOColors[color]
20
- });
21
-
22
- /**
23
- * `BaseTypography` is the core Typography component used to render a text.
24
- * It accepts all the default text style `StyleProp<TextStyle>` in addition with {@link BaseTypographyProps}
25
- * used to calculate at runtime the platform-dependent styles.
26
- * This component shouldn't be used in the application but only to compose others `Typography elements`.
27
- * @param props
28
- * @deprecated Use {@link IOText} instead
29
- * @constructor
30
- */
31
- export const BaseTypography = /*#__PURE__*/React.forwardRef((props, ref) => {
32
- const fontStyle = useMemo(() => {
33
- var _props$fontStyle, _props$fontStyle2;
34
- return calculateTextStyle(props.color, (_props$fontStyle = props.fontStyle) === null || _props$fontStyle === void 0 ? void 0 : _props$fontStyle.fontSize, props.font, (_props$fontStyle2 = props.fontStyle) === null || _props$fontStyle2 === void 0 ? void 0 : _props$fontStyle2.lineHeight, props.weight, props.isItalic ? "italic" : "normal");
35
- }, [props.color, props.fontStyle, props.font, props.weight, props.isItalic]);
36
- const style = props.style ? [props.style, props.fontStyle, fontStyle] : [props.fontStyle, fontStyle];
37
- return /*#__PURE__*/React.createElement(Text, _extends({
38
- allowFontScaling: false
39
- }, props, {
40
- ref: ref,
41
- style: style
42
- }), props.children);
43
- });
44
- //# sourceMappingURL=BaseTypography.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useMemo","Text","IOColors","makeFontStyleObject","calculateTextStyle","color","args","BaseTypography","forwardRef","props","ref","fontStyle","_props$fontStyle","_props$fontStyle2","fontSize","font","lineHeight","weight","isItalic","style","createElement","_extends","allowFontScaling","children"],"sourceRoot":"../../../../src","sources":["components/typography/BaseTypography.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,IAAI,QAAyB,cAAc;AACpD,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAIEC,mBAAmB,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,GAAGA,CACzBC,KAAe,EACf,GAAGC,IAA4C,MAC3C;EACJ,GAAGH,mBAAmB,CAAC,GAAGG,IAAI,CAAC;EAC/BD,KAAK,EAAEH,QAAQ,CAACG,KAAK;AACvB,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,cAAc,gBAAGR,KAAK,CAACS,UAAU,CAAiB,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC7E,MAAMC,SAAS,GAAGX,OAAO,CACvB;IAAA,IAAAY,gBAAA,EAAAC,iBAAA;IAAA,OACET,kBAAkB,CAChBK,KAAK,CAACJ,KAAK,GAAAO,gBAAA,GACXH,KAAK,CAACE,SAAS,cAAAC,gBAAA,uBAAfA,gBAAA,CAAiBE,QAAQ,EACzBL,KAAK,CAACM,IAAI,GAAAF,iBAAA,GACVJ,KAAK,CAACE,SAAS,cAAAE,iBAAA,uBAAfA,iBAAA,CAAiBG,UAAU,EAC3BP,KAAK,CAACQ,MAAM,EACZR,KAAK,CAACS,QAAQ,GAAG,QAAQ,GAAG,QAC9B,CAAC;EAAA,GACH,CAACT,KAAK,CAACJ,KAAK,EAAEI,KAAK,CAACE,SAAS,EAAEF,KAAK,CAACM,IAAI,EAAEN,KAAK,CAACQ,MAAM,EAAER,KAAK,CAACS,QAAQ,CACzE,CAAC;EAED,MAAMC,KAAK,GAAGV,KAAK,CAACU,KAAK,GACrB,CAACV,KAAK,CAACU,KAAK,EAAEV,KAAK,CAACE,SAAS,EAAEA,SAAS,CAAC,GACzC,CAACF,KAAK,CAACE,SAAS,EAAEA,SAAS,CAAC;EAEhC,oBACEZ,KAAA,CAAAqB,aAAA,CAACnB,IAAI,EAAAoB,QAAA;IAACC,gBAAgB,EAAE;EAAM,GAAKb,KAAK;IAAEC,GAAG,EAAEA,GAAI;IAACS,KAAK,EAAEA;EAAM,IAC9DV,KAAK,CAACc,QACH,CAAC;AAEX,CAAC,CAAC"}
@@ -1,32 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { forwardRef } from "react";
3
- import { useIOExperimentalDesign, useIOTheme } from "../../core";
4
- import { IOText } from "./IOText";
5
- const fontName = "Titillio";
6
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
7
- const legacyFontName = "TitilliumSansPro";
8
- /**
9
- * `Chip` typographic style
10
- */
11
- export const Chip = /*#__PURE__*/forwardRef(({
12
- color: customColor,
13
- ...props
14
- }, ref) => {
15
- const theme = useIOTheme();
16
- const {
17
- isExperimental
18
- } = useIOExperimentalDesign();
19
- const ChipProps = {
20
- ...props,
21
- dynamicTypeRamp: "caption2",
22
- // iOS only
23
- font: isExperimental ? fontName : legacyFontName,
24
- weight: "Regular",
25
- size: 12,
26
- color: customColor ?? theme["textBody-default"]
27
- };
28
- return /*#__PURE__*/React.createElement(IOText, _extends({
29
- ref: ref
30
- }, ChipProps), props.children);
31
- });
32
- //# sourceMappingURL=Chip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","forwardRef","useIOExperimentalDesign","useIOTheme","IOText","fontName","legacyFontName","Chip","color","customColor","props","ref","theme","isExperimental","ChipProps","dynamicTypeRamp","font","weight","size","createElement","_extends","children"],"sourceRoot":"../../../../src","sources":["components/typography/Chip.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO;AAEvD,SAASC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAEhE,SAASC,MAAM,QAA4C,UAAU;AAErE,MAAMC,QAAsB,GAAG,UAAU;AACzC;AACA,MAAMC,cAA4B,GAAG,kBAAkB;AACvD;AACA;AACA;AACA,OAAO,MAAMC,IAAI,gBAAGN,UAAU,CAC5B,CAAC;EAAEO,KAAK,EAAEC,WAAW;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAwB,KAAK;EAC9D,MAAMC,KAAK,GAAGT,UAAU,CAAC,CAAC;EAC1B,MAAM;IAAEU;EAAe,CAAC,GAAGX,uBAAuB,CAAC,CAAC;EAEpD,MAAMY,SAAsB,GAAG;IAC7B,GAAGJ,KAAK;IACRK,eAAe,EAAE,UAAU;IAAE;IAC7BC,IAAI,EAAEH,cAAc,GAAGR,QAAQ,GAAGC,cAAc;IAChDW,MAAM,EAAE,SAAS;IACjBC,IAAI,EAAE,EAAE;IACRV,KAAK,EAAEC,WAAW,IAAIG,KAAK,CAAC,kBAAkB;EAChD,CAAC;EAED,oBACEZ,KAAA,CAAAmB,aAAA,CAACf,MAAM,EAAAgB,QAAA;IAACT,GAAG,EAAEA;EAAI,GAAKG,SAAS,GAC5BJ,KAAK,CAACW,QACD,CAAC;AAEb,CACF,CAAC"}
@@ -1,55 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { useMemo } from "react";
3
- import { BaseTypography } from "./BaseTypography";
4
- import { calculateWeightColor } from "./common";
5
-
6
- /**
7
- * Using the DefaultArgumentProps is possible to define a default fallback value for weight and color
8
- * that will be used when the fields weight and color will be undefined.
9
- */
10
-
11
- /**
12
- * Using the DefaultFactoryProps is possible to define a custom factory to calculate the default value for
13
- * weight and color, thus allowing to implement more sophisticated strategies.
14
- */
15
-
16
- /**
17
- * Only one type of default props strategy is allowed
18
- */
19
-
20
- /**
21
- * The factory props will include:
22
- * - One of the two DefaultProps
23
- * - The props of {@link BaseTypographyProps} without weight and color
24
- * - The default {@link TypographyProps}
25
- */
26
-
27
- /**
28
- * Calculate if the props is of type {@link DefaultFactoryProps}
29
- * @param props
30
- */
31
- function isDefaultFactoryProps(props) {
32
- return props.weightColorFactory !== undefined;
33
- }
34
-
35
- /**
36
- * Build a {@link BaseTypography} component, calculating the default values for weight and color if undefined.
37
- * The default values can be calculated specifying some fallback values using {@link DefaultArgumentProps}
38
- * or with a factory function to define some custom behaviour using {@link DefaultFactoryProps}
39
- * @param props
40
- * @deprecated Use `IOText` instead. Or use the new typographic styles that use it.
41
- */
42
- export function useTypographyFactory(props, ref) {
43
- // Use different strategy to calculate the default values, based on DefaultProps
44
- const {
45
- weight,
46
- color
47
- } = useMemo(() => isDefaultFactoryProps(props) ? props.weightColorFactory(props.weight, props.color) : calculateWeightColor(props.defaultWeight, props.defaultColor, props.weight, props.color), [props]);
48
- return /*#__PURE__*/React.createElement(BaseTypography, _extends({
49
- weight: weight,
50
- color: color
51
- }, props, {
52
- ref: ref
53
- }));
54
- }
55
- //# sourceMappingURL=Factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useMemo","BaseTypography","calculateWeightColor","isDefaultFactoryProps","props","weightColorFactory","undefined","useTypographyFactory","ref","weight","color","defaultWeight","defaultColor","createElement","_extends"],"sourceRoot":"../../../../src","sources":["components/typography/Factory.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAKtC,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SACEC,oBAAoB,QAGf,UAAU;;AAEjB;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA,SAASC,qBAAqBA,CAC5BC,KAE0D,EACM;EAChE,OACGA,KAAK,CACHC,kBAAkB,KAAKC,SAAS;AAEvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAIlCH,KAAqD,EACrDI,GAA8B,EAC9B;EACA;EACA,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAGV,OAAO,CAC/B,MACEG,qBAAqB,CAACC,KAAK,CAAC,GACxBA,KAAK,CAACC,kBAAkB,CAACD,KAAK,CAACK,MAAM,EAAEL,KAAK,CAACM,KAAK,CAAC,GACnDR,oBAAoB,CAClBE,KAAK,CAACO,aAAa,EACnBP,KAAK,CAACQ,YAAY,EAClBR,KAAK,CAACK,MAAM,EACZL,KAAK,CAACM,KACR,CAAC,EACP,CAACN,KAAK,CACR,CAAC;EAED,oBAAOL,KAAA,CAAAc,aAAA,CAACZ,cAAc,EAAAa,QAAA;IAACL,MAAM,EAAEA,MAAO;IAACC,KAAK,EAAEA;EAAM,GAAKN,KAAK;IAAEI,GAAG,EAAEA;EAAI,EAAE,CAAC;AAC9E"}
@@ -1,42 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { forwardRef } from "react";
3
- import { useIOExperimentalDesign, useIOTheme } from "../../core";
4
- import { IOText } from "./IOText";
5
- const fontName = "Titillio";
6
- const fontWeight = "Semibold";
7
- const legacyFontName = "TitilliumSansPro";
8
- const legacyFontWeight = "Semibold";
9
-
10
- /**
11
- * `LabelSmall` typographic style
12
- */
13
- export const Label = /*#__PURE__*/forwardRef(({
14
- weight: customWeight,
15
- color: customColor,
16
- asLink,
17
- ...props
18
- }, ref) => {
19
- const theme = useIOTheme();
20
- const {
21
- isExperimental
22
- } = useIOExperimentalDesign();
23
- const defaultColor = asLink ? theme["interactiveElem-default"] : theme["textBody-tertiary"];
24
- const LabelProps = {
25
- ...props,
26
- font: isExperimental ? fontName : legacyFontName,
27
- weight: customWeight ? customWeight : isExperimental ? fontWeight : legacyFontWeight,
28
- size: 16,
29
- lineHeight: 24,
30
- color: customColor ?? defaultColor,
31
- ...(asLink ? {
32
- accessibilityRole: "link",
33
- textStyle: {
34
- textDecorationLine: "underline"
35
- }
36
- } : {})
37
- };
38
- return /*#__PURE__*/React.createElement(IOText, _extends({
39
- ref: ref
40
- }, LabelProps), props.children);
41
- });
42
- //# sourceMappingURL=Label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","forwardRef","useIOExperimentalDesign","useIOTheme","IOText","fontName","fontWeight","legacyFontName","legacyFontWeight","Label","weight","customWeight","color","customColor","asLink","props","ref","theme","isExperimental","defaultColor","LabelProps","font","size","lineHeight","accessibilityRole","textStyle","textDecorationLine","createElement","_extends","children"],"sourceRoot":"../../../../src","sources":["components/typography/Label.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO;AAEvD,SAASC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAEhE,SACEC,MAAM,QAID,UAAU;AAMjB,MAAMC,QAAsB,GAAG,UAAU;AACzC,MAAMC,UAAwB,GAAG,UAAU;AAE3C,MAAMC,cAA4B,GAAG,kBAAkB;AACvD,MAAMC,gBAA8B,GAAG,UAAU;;AAEjD;AACA;AACA;AACA,OAAO,MAAMC,KAAK,gBAAGR,UAAU,CAC7B,CACE;EAAES,MAAM,EAAEC,YAAY;EAAEC,KAAK,EAAEC,WAAW;EAAEC,MAAM;EAAE,GAAGC;AAAM,CAAC,EAC9DC,GAAwB,KACrB;EACH,MAAMC,KAAK,GAAGd,UAAU,CAAC,CAAC;EAC1B,MAAM;IAAEe;EAAe,CAAC,GAAGhB,uBAAuB,CAAC,CAAC;EAEpD,MAAMiB,YAAY,GAAGL,MAAM,GACvBG,KAAK,CAAC,yBAAyB,CAAC,GAChCA,KAAK,CAAC,mBAAmB,CAAC;EAE9B,MAAMG,UAAuB,GAAG;IAC9B,GAAGL,KAAK;IACRM,IAAI,EAAEH,cAAc,GAAGb,QAAQ,GAAGE,cAAc;IAChDG,MAAM,EAAEC,YAAY,GAChBA,YAAY,GACZO,cAAc,GACdZ,UAAU,GACVE,gBAAgB;IACpBc,IAAI,EAAE,EAAE;IACRC,UAAU,EAAE,EAAE;IACdX,KAAK,EAAEC,WAAW,IAAIM,YAAY;IAClC,IAAIL,MAAM,GACN;MACEU,iBAAiB,EAAE,MAAM;MACzBC,SAAS,EAAE;QAAEC,kBAAkB,EAAE;MAAY;IAC/C,CAAC,GACD,CAAC,CAAC;EACR,CAAC;EAED,oBACE1B,KAAA,CAAA2B,aAAA,CAACvB,MAAM,EAAAwB,QAAA;IAACZ,GAAG,EAAEA;EAAI,GAAKI,UAAU,GAC7BL,KAAK,CAACc,QACD,CAAC;AAEb,CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","forwardRef","useIOExperimentalDesign","useIOTheme","IOText","fontName","fontWeight","legacyFontName","legacyFontWeight","LabelSmall","weight","customWeight","color","customColor","asLink","props","ref","theme","isExperimental","defaultColor","LabelSmallProps","dynamicTypeRamp","font","size","lineHeight","accessibilityRole","textStyle","textDecorationLine","createElement","_extends","children"],"sourceRoot":"../../../../src","sources":["components/typography/LabelSmall.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO;AAEvD,SAASC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAEhE,SACEC,MAAM,QAID,UAAU;AAMjB,MAAMC,QAAsB,GAAG,UAAU;AACzC,MAAMC,UAAwB,GAAG,UAAU;AAE3C,MAAMC,cAA4B,GAAG,kBAAkB;AACvD,MAAMC,gBAA8B,GAAG,UAAU;;AAEjD;AACA;AACA;AACA,OAAO,MAAMC,UAAU,gBAAGR,UAAU,CAClC,CACE;EAAES,MAAM,EAAEC,YAAY;EAAEC,KAAK,EAAEC,WAAW;EAAEC,MAAM;EAAE,GAAGC;AAAM,CAAC,EAC9DC,GAAwB,KACrB;EACH,MAAMC,KAAK,GAAGd,UAAU,CAAC,CAAC;EAC1B,MAAM;IAAEe;EAAe,CAAC,GAAGhB,uBAAuB,CAAC,CAAC;EAEpD,MAAMiB,YAAY,GAAGL,MAAM,GACvBG,KAAK,CAAC,yBAAyB,CAAC,GAChCA,KAAK,CAAC,mBAAmB,CAAC;EAE9B,MAAMG,eAA4B,GAAG;IACnC,GAAGL,KAAK;IACRM,eAAe,EAAE,UAAU,CAAC;IAC5BC,IAAI,EAAEJ,cAAc,GAAGb,QAAQ,GAAGE,cAAc;IAChDG,MAAM,EAAEC,YAAY,GAChBA,YAAY,GACZO,cAAc,GACdZ,UAAU,GACVE,gBAAgB;IACpBe,IAAI,EAAE,EAAE;IACRC,UAAU,EAAE,EAAE;IACdZ,KAAK,EAAEC,WAAW,IAAIM,YAAY;IAClC,IAAIL,MAAM,GACN;MACEW,iBAAiB,EAAE,MAAM;MACzBC,SAAS,EAAE;QAAEC,kBAAkB,EAAE;MAAY;IAC/C,CAAC,GACD,CAAC,CAAC;EACR,CAAC;EAED,oBACE3B,KAAA,CAAA4B,aAAA,CAACxB,MAAM,EAAAyB,QAAA;IAACb,GAAG,EAAEA;EAAI,GAAKI,eAAe,GAClCL,KAAK,CAACe,QACD,CAAC;AAEb,CACF,CAAC"}
@@ -1,29 +0,0 @@
1
- import React from "react";
2
- import { Text, TextStyle, View } from "react-native";
3
- import { IOColors } from "../../core/IOColors";
4
- import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
5
- /**
6
- * The specific properties needed to calculate the font style using {@link makeFontStyleObject} (these information
7
- * cannot be included in the default StyleProp<TextStyle>
8
- */
9
- type BaseTypographyProps = {
10
- weight: IOFontWeight;
11
- color: IOColors;
12
- font?: IOFontFamily;
13
- isItalic?: boolean;
14
- };
15
- type OwnProps = BaseTypographyProps & {
16
- fontStyle?: TextStyle;
17
- } & React.ComponentPropsWithRef<typeof Text>;
18
- /**
19
- * `BaseTypography` is the core Typography component used to render a text.
20
- * It accepts all the default text style `StyleProp<TextStyle>` in addition with {@link BaseTypographyProps}
21
- * used to calculate at runtime the platform-dependent styles.
22
- * This component shouldn't be used in the application but only to compose others `Typography elements`.
23
- * @param props
24
- * @deprecated Use {@link IOText} instead
25
- * @constructor
26
- */
27
- export declare const BaseTypography: React.ForwardRefExoticComponent<Omit<OwnProps, "ref"> & React.RefAttributes<View>>;
28
- export {};
29
- //# sourceMappingURL=BaseTypography.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseTypography.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/BaseTypography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,YAAY,EAEZ,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,QAAQ,GAAG,mBAAmB,GAAG;IACpC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GAAG,KAAK,CAAC,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAC;AAe7C;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,oFAuBzB,CAAC"}
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
- import { IOTextProps } from "./IOText";
4
- /**
5
- * `Chip` typographic style
6
- */
7
- export declare const Chip: React.ForwardRefExoticComponent<Omit<IOTextProps, "style" | "size" | "color" | "font" | "fontStyle" | "lineHeight" | "weight"> & {
8
- textStyle?: import("./IOText").IOTextStyle | undefined;
9
- style?: import("./IOText").IOTextStyle | undefined;
10
- } & {
11
- color?: "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-400" | "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" | "blueItalia-850" | "blueItalia-600" | "blueItalia-500" | "blueItalia-100" | "blueItalia-50" | "blue-600" | "blue-50" | "greyUltraLight" | "greyLight" | "bluegreyLight" | "grey" | "bluegrey" | "bluegreyDark" | "blue" | "blueUltraLight" | "aqua" | "aquaUltraLight" | "antiqueFuchsia" | "orange" | "red" | "green" | "greenLight" | undefined;
12
- } & React.RefAttributes<View>>;
13
- //# sourceMappingURL=Chip.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EAAU,WAAW,EAAyB,MAAM,UAAU,CAAC;AAKtE;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;8BAoBhB,CAAC"}
@@ -1,43 +0,0 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
- import { IOColors } from "../../core";
4
- import { IOFontWeight } from "../../utils/fonts";
5
- import { XOR } from "../../utils/types";
6
- import { BaseTypography } from "./BaseTypography";
7
- import { RequiredTypographyProps, TypographyProps } from "./common";
8
- /**
9
- * Using the DefaultArgumentProps is possible to define a default fallback value for weight and color
10
- * that will be used when the fields weight and color will be undefined.
11
- */
12
- type DefaultArgumentProps<WeightPropsType, ColorsPropsType> = {
13
- defaultWeight: WeightPropsType;
14
- defaultColor: ColorsPropsType;
15
- };
16
- /**
17
- * Using the DefaultFactoryProps is possible to define a custom factory to calculate the default value for
18
- * weight and color, thus allowing to implement more sophisticated strategies.
19
- */
20
- type DefaultFactoryProps<WeightPropsType, ColorsPropsType> = {
21
- weightColorFactory: (weight?: WeightPropsType, color?: ColorsPropsType) => RequiredTypographyProps<WeightPropsType, ColorsPropsType>;
22
- };
23
- /**
24
- * Only one type of default props strategy is allowed
25
- */
26
- type DefaultProps<WeightPropsType, ColorsPropsType> = XOR<DefaultArgumentProps<WeightPropsType, ColorsPropsType>, DefaultFactoryProps<WeightPropsType, ColorsPropsType>>;
27
- /**
28
- * The factory props will include:
29
- * - One of the two DefaultProps
30
- * - The props of {@link BaseTypographyProps} without weight and color
31
- * - The default {@link TypographyProps}
32
- */
33
- type FactoryProps<WeightPropsType, ColorsPropsType> = TypographyProps<WeightPropsType, ColorsPropsType> & DefaultProps<WeightPropsType, ColorsPropsType> & Omit<React.ComponentProps<typeof BaseTypography>, "weight" | "color">;
34
- /**
35
- * Build a {@link BaseTypography} component, calculating the default values for weight and color if undefined.
36
- * The default values can be calculated specifying some fallback values using {@link DefaultArgumentProps}
37
- * or with a factory function to define some custom behaviour using {@link DefaultFactoryProps}
38
- * @param props
39
- * @deprecated Use `IOText` instead. Or use the new typographic styles that use it.
40
- */
41
- export declare function useTypographyFactory<WeightPropsType extends IOFontWeight, ColorsPropsType extends IOColors>(props: FactoryProps<WeightPropsType, ColorsPropsType>, ref?: React.ForwardedRef<View>): React.JSX.Element;
42
- export {};
43
- //# sourceMappingURL=Factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Factory.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/Factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAEL,uBAAuB,EACvB,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,KAAK,oBAAoB,CAAC,eAAe,EAAE,eAAe,IAAI;IAC5D,aAAa,EAAE,eAAe,CAAC;IAC/B,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,KAAK,mBAAmB,CAAC,eAAe,EAAE,eAAe,IAAI;IAC3D,kBAAkB,EAAE,CAClB,MAAM,CAAC,EAAE,eAAe,EACxB,KAAK,CAAC,EAAE,eAAe,KACpB,uBAAuB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;CAChE,CAAC;AAEF;;GAEG;AACH,KAAK,YAAY,CAAC,eAAe,EAAE,eAAe,IAAI,GAAG,CACvD,oBAAoB,CAAC,eAAe,EAAE,eAAe,CAAC,EACtD,mBAAmB,CAAC,eAAe,EAAE,eAAe,CAAC,CACtD,CAAC;AAEF;;;;;GAKG;AACH,KAAK,YAAY,CAAC,eAAe,EAAE,eAAe,IAAI,eAAe,CACnE,eAAe,EACf,eAAe,CAChB,GACC,YAAY,CAAC,eAAe,EAAE,eAAe,CAAC,GAC9C,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC;AAiBxE;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,SAAS,YAAY,EACpC,eAAe,SAAS,QAAQ,EAEhC,KAAK,EAAE,YAAY,CAAC,eAAe,EAAE,eAAe,CAAC,EACrD,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,qBAiB/B"}
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
- import { IOFontWeight } from "../../utils/fonts";
4
- import { TypographicStyleAsLinkProps, TypographicStyleProps } from "./IOText";
5
- type LabelProps = TypographicStyleProps & {
6
- weight?: Extract<IOFontWeight, "Regular" | "Semibold" | "Bold">;
7
- } & TypographicStyleAsLinkProps;
8
- /**
9
- * `LabelSmall` typographic style
10
- */
11
- export declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<View>>;
12
- export {};
13
- //# sourceMappingURL=Label.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAgB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAGL,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAElB,KAAK,UAAU,GAAG,qBAAqB,GAAG;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;CACjE,GAAG,2BAA2B,CAAC;AAQhC;;GAEG;AACH,eAAO,MAAM,KAAK,yEAqCjB,CAAC"}
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
- import { IOFontWeight } from "../../utils/fonts";
4
- import { TypographicStyleAsLinkProps, TypographicStyleProps } from "./IOText";
5
- type LabelSmallProps = TypographicStyleProps & {
6
- weight?: Extract<IOFontWeight, "Regular" | "Semibold" | "Bold">;
7
- } & TypographicStyleAsLinkProps;
8
- /**
9
- * `LabelSmall` typographic style
10
- */
11
- export declare const LabelSmall: React.ForwardRefExoticComponent<LabelSmallProps & React.RefAttributes<View>>;
12
- export {};
13
- //# sourceMappingURL=LabelSmall.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LabelSmall.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/LabelSmall.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAgB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAGL,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAElB,KAAK,eAAe,GAAG,qBAAqB,GAAG;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;CACjE,GAAG,2BAA2B,CAAC;AAQhC;;GAEG;AACH,eAAO,MAAM,UAAU,8EAsCtB,CAAC"}
@@ -1,71 +0,0 @@
1
- import React, { useMemo } from "react";
2
- import { Text, TextStyle, View } from "react-native";
3
- import { IOColors } from "../../core/IOColors";
4
- import {
5
- IOFontFamily,
6
- IOFontSize,
7
- IOFontWeight,
8
- makeFontStyleObject
9
- } from "../../utils/fonts";
10
-
11
- /**
12
- * The specific properties needed to calculate the font style using {@link makeFontStyleObject} (these information
13
- * cannot be included in the default StyleProp<TextStyle>
14
- */
15
- type BaseTypographyProps = {
16
- weight: IOFontWeight;
17
- color: IOColors;
18
- font?: IOFontFamily;
19
- isItalic?: boolean;
20
- };
21
-
22
- type OwnProps = BaseTypographyProps & {
23
- fontStyle?: TextStyle;
24
- } & React.ComponentPropsWithRef<typeof Text>;
25
-
26
- /**
27
- * Decorate the function {@link makeFontStyleObject} with the additional color calculation.
28
- * @param color A value key from {@link IOColors}, transformed here in {@link ColorValue}
29
- * @param args the args of the function {@link makeFontStyleObject}
30
- */
31
- const calculateTextStyle = (
32
- color: IOColors,
33
- ...args: Parameters<typeof makeFontStyleObject>
34
- ) => ({
35
- ...makeFontStyleObject(...args),
36
- color: IOColors[color]
37
- });
38
-
39
- /**
40
- * `BaseTypography` is the core Typography component used to render a text.
41
- * It accepts all the default text style `StyleProp<TextStyle>` in addition with {@link BaseTypographyProps}
42
- * used to calculate at runtime the platform-dependent styles.
43
- * This component shouldn't be used in the application but only to compose others `Typography elements`.
44
- * @param props
45
- * @deprecated Use {@link IOText} instead
46
- * @constructor
47
- */
48
- export const BaseTypography = React.forwardRef<View, OwnProps>((props, ref) => {
49
- const fontStyle = useMemo(
50
- () =>
51
- calculateTextStyle(
52
- props.color,
53
- props.fontStyle?.fontSize as IOFontSize,
54
- props.font,
55
- props.fontStyle?.lineHeight,
56
- props.weight,
57
- props.isItalic ? "italic" : "normal"
58
- ),
59
- [props.color, props.fontStyle, props.font, props.weight, props.isItalic]
60
- );
61
-
62
- const style = props.style
63
- ? [props.style, props.fontStyle, fontStyle]
64
- : [props.fontStyle, fontStyle];
65
-
66
- return (
67
- <Text allowFontScaling={false} {...props} ref={ref} style={style}>
68
- {props.children}
69
- </Text>
70
- );
71
- });
@@ -1,33 +0,0 @@
1
- import React, { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
- import { useIOExperimentalDesign, useIOTheme } from "../../core";
4
- import { IOFontFamily } from "../../utils/fonts";
5
- import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
6
-
7
- const fontName: IOFontFamily = "Titillio";
8
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
9
- const legacyFontName: IOFontFamily = "TitilliumSansPro";
10
- /**
11
- * `Chip` typographic style
12
- */
13
- export const Chip = forwardRef<View, TypographicStyleProps>(
14
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
15
- const theme = useIOTheme();
16
- const { isExperimental } = useIOExperimentalDesign();
17
-
18
- const ChipProps: IOTextProps = {
19
- ...props,
20
- dynamicTypeRamp: "caption2", // iOS only
21
- font: isExperimental ? fontName : legacyFontName,
22
- weight: "Regular",
23
- size: 12,
24
- color: customColor ?? theme["textBody-default"]
25
- };
26
-
27
- return (
28
- <IOText ref={ref} {...ChipProps}>
29
- {props.children}
30
- </IOText>
31
- );
32
- }
33
- );
@@ -1,98 +0,0 @@
1
- import React, { useMemo } from "react";
2
- import { View } from "react-native";
3
- import { IOColors } from "../../core";
4
- import { IOFontWeight } from "../../utils/fonts";
5
- import { XOR } from "../../utils/types";
6
- import { BaseTypography } from "./BaseTypography";
7
- import {
8
- calculateWeightColor,
9
- RequiredTypographyProps,
10
- TypographyProps
11
- } from "./common";
12
-
13
- /**
14
- * Using the DefaultArgumentProps is possible to define a default fallback value for weight and color
15
- * that will be used when the fields weight and color will be undefined.
16
- */
17
- type DefaultArgumentProps<WeightPropsType, ColorsPropsType> = {
18
- defaultWeight: WeightPropsType;
19
- defaultColor: ColorsPropsType;
20
- };
21
-
22
- /**
23
- * Using the DefaultFactoryProps is possible to define a custom factory to calculate the default value for
24
- * weight and color, thus allowing to implement more sophisticated strategies.
25
- */
26
- type DefaultFactoryProps<WeightPropsType, ColorsPropsType> = {
27
- weightColorFactory: (
28
- weight?: WeightPropsType,
29
- color?: ColorsPropsType
30
- ) => RequiredTypographyProps<WeightPropsType, ColorsPropsType>;
31
- };
32
-
33
- /**
34
- * Only one type of default props strategy is allowed
35
- */
36
- type DefaultProps<WeightPropsType, ColorsPropsType> = XOR<
37
- DefaultArgumentProps<WeightPropsType, ColorsPropsType>,
38
- DefaultFactoryProps<WeightPropsType, ColorsPropsType>
39
- >;
40
-
41
- /**
42
- * The factory props will include:
43
- * - One of the two DefaultProps
44
- * - The props of {@link BaseTypographyProps} without weight and color
45
- * - The default {@link TypographyProps}
46
- */
47
- type FactoryProps<WeightPropsType, ColorsPropsType> = TypographyProps<
48
- WeightPropsType,
49
- ColorsPropsType
50
- > &
51
- DefaultProps<WeightPropsType, ColorsPropsType> &
52
- Omit<React.ComponentProps<typeof BaseTypography>, "weight" | "color">;
53
-
54
- /**
55
- * Calculate if the props is of type {@link DefaultFactoryProps}
56
- * @param props
57
- */
58
- function isDefaultFactoryProps<WeightPropsType, ColorsPropsType>(
59
- props:
60
- | DefaultFactoryProps<WeightPropsType, ColorsPropsType>
61
- | DefaultArgumentProps<WeightPropsType, ColorsPropsType>
62
- ): props is DefaultFactoryProps<WeightPropsType, ColorsPropsType> {
63
- return (
64
- (props as DefaultFactoryProps<WeightPropsType, ColorsPropsType>)
65
- .weightColorFactory !== undefined
66
- );
67
- }
68
-
69
- /**
70
- * Build a {@link BaseTypography} component, calculating the default values for weight and color if undefined.
71
- * The default values can be calculated specifying some fallback values using {@link DefaultArgumentProps}
72
- * or with a factory function to define some custom behaviour using {@link DefaultFactoryProps}
73
- * @param props
74
- * @deprecated Use `IOText` instead. Or use the new typographic styles that use it.
75
- */
76
- export function useTypographyFactory<
77
- WeightPropsType extends IOFontWeight,
78
- ColorsPropsType extends IOColors
79
- >(
80
- props: FactoryProps<WeightPropsType, ColorsPropsType>,
81
- ref?: React.ForwardedRef<View>
82
- ) {
83
- // Use different strategy to calculate the default values, based on DefaultProps
84
- const { weight, color } = useMemo(
85
- () =>
86
- isDefaultFactoryProps(props)
87
- ? props.weightColorFactory(props.weight, props.color)
88
- : calculateWeightColor(
89
- props.defaultWeight,
90
- props.defaultColor,
91
- props.weight,
92
- props.color
93
- ),
94
- [props]
95
- );
96
-
97
- return <BaseTypography weight={weight} color={color} {...props} ref={ref} />;
98
- }