@pagopa/io-app-design-system 2.1.0-3 → 2.1.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 (204) hide show
  1. package/lib/commonjs/components/alert/Alert.js +12 -5
  2. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  3. package/lib/commonjs/components/banner/Banner.js +5 -1
  4. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  5. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -0
  6. package/lib/commonjs/components/banner/__test__/banner.test.js +4 -2
  7. package/lib/commonjs/components/banner/__test__/banner.test.js.map +1 -1
  8. package/lib/commonjs/components/codeInput/CodeInput.js +1 -1
  9. package/lib/commonjs/components/common/LogoPaymentWithFallback.js +20 -11
  10. package/lib/commonjs/components/common/LogoPaymentWithFallback.js.map +1 -1
  11. package/lib/commonjs/components/icons/Icon.js +6 -2
  12. package/lib/commonjs/components/icons/Icon.js.map +1 -1
  13. package/lib/commonjs/components/icons/svg/IconNavQrWallet.js +28 -0
  14. package/lib/commonjs/components/icons/svg/IconNavQrWallet.js.map +1 -0
  15. package/lib/commonjs/components/icons/svg/originals/IconNavQrWallet.svg +1 -0
  16. package/lib/commonjs/components/listitems/ListItemInfo.js +6 -4
  17. package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
  18. package/lib/commonjs/components/listitems/ListItemTransaction.js +27 -25
  19. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  20. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +0 -10
  21. package/lib/commonjs/components/listitems/__test__/listitem.test.js +10 -4
  22. package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
  23. package/lib/commonjs/components/modules/ModuleIDP.js +2 -9
  24. package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -1
  25. package/lib/commonjs/components/modules/ModulePaymentNotice.js +8 -6
  26. package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
  27. package/lib/commonjs/components/otpInput/BoxedInput.js +1 -1
  28. package/lib/commonjs/components/pictograms/Pictogram.js +4 -0
  29. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  30. package/lib/commonjs/components/pictograms/svg/PictogramEmptyWallet.js +43 -0
  31. package/lib/commonjs/components/pictograms/svg/PictogramEmptyWallet.js.map +1 -0
  32. package/lib/commonjs/components/pictograms/svg/PictogramMeterLimit.js +46 -0
  33. package/lib/commonjs/components/pictograms/svg/PictogramMeterLimit.js.map +1 -0
  34. package/lib/commonjs/components/pictograms/svg/originals/PictogramEmptyWallet.svg +1 -0
  35. package/lib/commonjs/components/pictograms/svg/originals/PictogramMeterLimit.svg +1 -0
  36. package/lib/commonjs/components/tag/Tag.js +4 -11
  37. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  38. package/lib/commonjs/components/typography/ComposedBodyFromArray.js +26 -0
  39. package/lib/commonjs/components/typography/ComposedBodyFromArray.js.map +1 -0
  40. package/lib/commonjs/components/typography/H2.js +2 -2
  41. package/lib/commonjs/components/typography/IOText.js +4 -2
  42. package/lib/commonjs/components/typography/IOText.js.map +1 -1
  43. package/lib/commonjs/components/typography/__test__/ComposedBodyFromArray.test.js +107 -0
  44. package/lib/commonjs/components/typography/__test__/ComposedBodyFromArray.test.js.map +1 -0
  45. package/lib/commonjs/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +895 -0
  46. package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +1 -1
  47. package/lib/commonjs/components/typography/index.js +11 -0
  48. package/lib/commonjs/components/typography/index.js.map +1 -1
  49. package/lib/commonjs/core/IODSExperimentalContextProvider.js +1 -2
  50. package/lib/commonjs/core/IODSExperimentalContextProvider.js.map +1 -1
  51. package/lib/commonjs/core/IOThemeContextProvider.js +1 -2
  52. package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -1
  53. package/lib/commonjs/utils/accessibility.js +1 -14
  54. package/lib/commonjs/utils/accessibility.js.map +1 -1
  55. package/lib/commonjs/utils/image.js +23 -14
  56. package/lib/commonjs/utils/image.js.map +1 -1
  57. package/lib/commonjs/utils/object.js +10 -5
  58. package/lib/commonjs/utils/object.js.map +1 -1
  59. package/lib/module/components/alert/Alert.js +14 -7
  60. package/lib/module/components/alert/Alert.js.map +1 -1
  61. package/lib/module/components/banner/Banner.js +5 -1
  62. package/lib/module/components/banner/Banner.js.map +1 -1
  63. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -0
  64. package/lib/module/components/banner/__test__/banner.test.js +4 -2
  65. package/lib/module/components/banner/__test__/banner.test.js.map +1 -1
  66. package/lib/module/components/codeInput/CodeInput.js +1 -1
  67. package/lib/module/components/common/LogoPaymentWithFallback.js +20 -11
  68. package/lib/module/components/common/LogoPaymentWithFallback.js.map +1 -1
  69. package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
  70. package/lib/module/components/icons/Icon.js +7 -3
  71. package/lib/module/components/icons/Icon.js.map +1 -1
  72. package/lib/module/components/icons/svg/IconNavQrWallet.js +20 -0
  73. package/lib/module/components/icons/svg/IconNavQrWallet.js.map +1 -0
  74. package/lib/module/components/icons/svg/originals/IconNavQrWallet.svg +1 -0
  75. package/lib/module/components/listitems/ListItemInfo.js +6 -4
  76. package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
  77. package/lib/module/components/listitems/ListItemTransaction.js +27 -23
  78. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  79. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +0 -10
  80. package/lib/module/components/listitems/__test__/listitem.test.js +10 -4
  81. package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
  82. package/lib/module/components/modules/ModuleIDP.js +3 -10
  83. package/lib/module/components/modules/ModuleIDP.js.map +1 -1
  84. package/lib/module/components/modules/ModulePaymentNotice.js +8 -6
  85. package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
  86. package/lib/module/components/otpInput/BoxedInput.js +1 -1
  87. package/lib/module/components/pictograms/Pictogram.js +4 -0
  88. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  89. package/lib/module/components/pictograms/svg/PictogramEmptyWallet.js +35 -0
  90. package/lib/module/components/pictograms/svg/PictogramEmptyWallet.js.map +1 -0
  91. package/lib/module/components/pictograms/svg/PictogramMeterLimit.js +38 -0
  92. package/lib/module/components/pictograms/svg/PictogramMeterLimit.js.map +1 -0
  93. package/lib/module/components/pictograms/svg/originals/PictogramEmptyWallet.svg +1 -0
  94. package/lib/module/components/pictograms/svg/originals/PictogramMeterLimit.svg +1 -0
  95. package/lib/module/components/tag/Tag.js +4 -9
  96. package/lib/module/components/tag/Tag.js.map +1 -1
  97. package/lib/module/components/typography/ComposedBodyFromArray.js +18 -0
  98. package/lib/module/components/typography/ComposedBodyFromArray.js.map +1 -0
  99. package/lib/module/components/typography/H2.js +2 -2
  100. package/lib/module/components/typography/IOText.js +4 -2
  101. package/lib/module/components/typography/IOText.js.map +1 -1
  102. package/lib/module/components/typography/__test__/ComposedBodyFromArray.test.js +104 -0
  103. package/lib/module/components/typography/__test__/ComposedBodyFromArray.test.js.map +1 -0
  104. package/lib/module/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +895 -0
  105. package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +1 -1
  106. package/lib/module/components/typography/index.js +1 -0
  107. package/lib/module/components/typography/index.js.map +1 -1
  108. package/lib/module/core/IODSExperimentalContextProvider.js +1 -2
  109. package/lib/module/core/IODSExperimentalContextProvider.js.map +1 -1
  110. package/lib/module/core/IOThemeContextProvider.js +1 -2
  111. package/lib/module/core/IOThemeContextProvider.js.map +1 -1
  112. package/lib/module/utils/accessibility.js +0 -9
  113. package/lib/module/utils/accessibility.js.map +1 -1
  114. package/lib/module/utils/image.js +23 -12
  115. package/lib/module/utils/image.js.map +1 -1
  116. package/lib/module/utils/object.js +10 -3
  117. package/lib/module/utils/object.js.map +1 -1
  118. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  119. package/lib/typescript/components/banner/Banner.d.ts +1 -1
  120. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  121. package/lib/typescript/components/buttons/ButtonLink.d.ts +1 -1
  122. package/lib/typescript/components/buttons/ButtonOutline.d.ts +1 -1
  123. package/lib/typescript/components/buttons/ButtonSolid.d.ts +1 -1
  124. package/lib/typescript/components/common/LogoPaymentWithFallback.d.ts.map +1 -1
  125. package/lib/typescript/components/featureInfo/FeatureInfo.d.ts +2 -2
  126. package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
  127. package/lib/typescript/components/icons/Icon.d.ts +2 -0
  128. package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
  129. package/lib/typescript/components/icons/svg/IconNavQrWallet.d.ts +5 -0
  130. package/lib/typescript/components/icons/svg/IconNavQrWallet.d.ts.map +1 -0
  131. package/lib/typescript/components/listitems/ListItemInfo.d.ts +5 -3
  132. package/lib/typescript/components/listitems/ListItemInfo.d.ts.map +1 -1
  133. package/lib/typescript/components/listitems/ListItemTransaction.d.ts +11 -5
  134. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  135. package/lib/typescript/components/modules/ModuleIDP.d.ts.map +1 -1
  136. package/lib/typescript/components/modules/ModulePaymentNotice.d.ts +10 -4
  137. package/lib/typescript/components/modules/ModulePaymentNotice.d.ts.map +1 -1
  138. package/lib/typescript/components/pictograms/Pictogram.d.ts +2 -0
  139. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  140. package/lib/typescript/components/pictograms/svg/PictogramEmptyWallet.d.ts +5 -0
  141. package/lib/typescript/components/pictograms/svg/PictogramEmptyWallet.d.ts.map +1 -0
  142. package/lib/typescript/components/pictograms/svg/PictogramMeterLimit.d.ts +5 -0
  143. package/lib/typescript/components/pictograms/svg/PictogramMeterLimit.d.ts.map +1 -0
  144. package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
  145. package/lib/typescript/components/typography/ComposedBodyFromArray.d.ts +13 -0
  146. package/lib/typescript/components/typography/ComposedBodyFromArray.d.ts.map +1 -0
  147. package/lib/typescript/components/typography/H2.d.ts +1 -1
  148. package/lib/typescript/components/typography/IOText.d.ts +1 -1
  149. package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
  150. package/lib/typescript/components/typography/__test__/ComposedBodyFromArray.test.d.ts +2 -0
  151. package/lib/typescript/components/typography/__test__/ComposedBodyFromArray.test.d.ts.map +1 -0
  152. package/lib/typescript/components/typography/index.d.ts +1 -0
  153. package/lib/typescript/components/typography/index.d.ts.map +1 -1
  154. package/lib/typescript/core/IODSExperimentalContextProvider.d.ts.map +1 -1
  155. package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -1
  156. package/lib/typescript/utils/accessibility.d.ts +0 -5
  157. package/lib/typescript/utils/accessibility.d.ts.map +1 -1
  158. package/lib/typescript/utils/image.d.ts +2 -2
  159. package/lib/typescript/utils/image.d.ts.map +1 -1
  160. package/lib/typescript/utils/object.d.ts +1 -2
  161. package/lib/typescript/utils/object.d.ts.map +1 -1
  162. package/package.json +2 -5
  163. package/src/components/alert/Alert.tsx +27 -7
  164. package/src/components/banner/Banner.tsx +6 -2
  165. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -0
  166. package/src/components/banner/__test__/banner.test.tsx +2 -0
  167. package/src/components/codeInput/CodeInput.tsx +1 -1
  168. package/src/components/common/LogoPaymentWithFallback.tsx +15 -17
  169. package/src/components/featureInfo/FeatureInfo.tsx +2 -2
  170. package/src/components/icons/Icon.tsx +7 -3
  171. package/src/components/icons/svg/IconNavQrWallet.tsx +16 -0
  172. package/src/components/icons/svg/originals/IconNavQrWallet.svg +1 -0
  173. package/src/components/listitems/ListItemInfo.tsx +7 -4
  174. package/src/components/listitems/ListItemTransaction.tsx +40 -46
  175. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +0 -10
  176. package/src/components/listitems/__test__/listitem.test.tsx +10 -4
  177. package/src/components/modules/ModuleIDP.tsx +4 -13
  178. package/src/components/modules/ModulePaymentNotice.tsx +14 -10
  179. package/src/components/otpInput/BoxedInput.tsx +1 -1
  180. package/src/components/pictograms/Pictogram.tsx +4 -0
  181. package/src/components/pictograms/svg/PictogramEmptyWallet.tsx +42 -0
  182. package/src/components/pictograms/svg/PictogramMeterLimit.tsx +46 -0
  183. package/src/components/pictograms/svg/originals/PictogramEmptyWallet.svg +1 -0
  184. package/src/components/pictograms/svg/originals/PictogramMeterLimit.svg +1 -0
  185. package/src/components/tag/Tag.tsx +10 -19
  186. package/src/components/typography/ComposedBodyFromArray.tsx +25 -0
  187. package/src/components/typography/H2.tsx +2 -2
  188. package/src/components/typography/IOText.tsx +5 -6
  189. package/src/components/typography/__test__/ComposedBodyFromArray.test.tsx +99 -0
  190. package/src/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +895 -0
  191. package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +1 -1
  192. package/src/components/typography/index.tsx +1 -0
  193. package/src/core/IODSExperimentalContextProvider.tsx +1 -2
  194. package/src/core/IOThemeContextProvider.tsx +1 -2
  195. package/src/utils/accessibility.ts +0 -17
  196. package/src/utils/image.ts +28 -28
  197. package/src/utils/object.ts +13 -12
  198. package/lib/commonjs/utils/dates.js +0 -20
  199. package/lib/commonjs/utils/dates.js.map +0 -1
  200. package/lib/module/utils/dates.js +0 -11
  201. package/lib/module/utils/dates.js.map +0 -1
  202. package/lib/typescript/utils/dates.d.ts +0 -9
  203. package/lib/typescript/utils/dates.d.ts.map +0 -1
  204. package/src/utils/dates.ts +0 -18
@@ -130,7 +130,7 @@ exports[`Test Typography Components H2 Snapshot 1`] = `
130
130
  "fontSize": 28,
131
131
  "fontStyle": "normal",
132
132
  "fontWeight": "600",
133
- "lineHeight": 40,
133
+ "lineHeight": 34,
134
134
  },
135
135
  ]
136
136
  }
@@ -1,6 +1,7 @@
1
1
  export * from "./BaseTypography";
2
2
  export * from "./IOText";
3
3
  export * from "./Body";
4
+ export * from "./ComposedBodyFromArray";
4
5
  export * from "./Caption";
5
6
  export * from "./Chip";
6
7
  export * from "./ButtonText";
@@ -1,4 +1,3 @@
1
- import { constVoid } from "fp-ts/function";
2
1
  import React from "react";
3
2
 
4
3
  type IOExperimentalContextType = {
@@ -11,7 +10,7 @@ type IOExperimentalContextType = {
11
10
  export const IOExperimentalDesignContext =
12
11
  React.createContext<IOExperimentalContextType>({
13
12
  isExperimental: false,
14
- setExperimental: constVoid
13
+ setExperimental: () => void 0
15
14
  });
16
15
 
17
16
  export const useIOExperimentalDesign = () =>
@@ -1,4 +1,3 @@
1
- import { constVoid } from "fp-ts/function";
2
1
  import React, { useMemo } from "react";
3
2
  import { Appearance } from "react-native";
4
3
  import {
@@ -24,7 +23,7 @@ export const IOThemeContext: React.Context<IOThemeContextType> =
24
23
  themeType: Appearance.getColorScheme() === "dark" ? "dark" : "light",
25
24
  theme:
26
25
  Appearance.getColorScheme() === "dark" ? IOThemes.dark : IOThemes.light,
27
- setTheme: constVoid
26
+ setTheme: () => void 0
28
27
  });
29
28
 
30
29
  export const useIOThemeContext = () => React.useContext(IOThemeContext);
@@ -1,23 +1,6 @@
1
- import { pipe } from "fp-ts/lib/function";
2
- import * as O from "fp-ts/lib/Option";
3
- import I18n from "i18n-js";
4
1
  import { useEffect, useState } from "react";
5
2
  import { AccessibilityInfo, Platform } from "react-native";
6
3
 
7
- /**
8
- * This function is used to get the text that will be read by the screen reader
9
- * with the correct minus symbol pronunciation.
10
- */
11
- export const getAccessibleAmountText = (amount?: string) =>
12
- pipe(
13
- amount,
14
- O.fromNullable,
15
- O.map(amount =>
16
- amount.replace("-", I18n.t("global.accessibility.minusSymbol"))
17
- ),
18
- O.getOrElseW(() => undefined)
19
- );
20
-
21
4
  /**
22
5
  * Query whether a bold text is currently enabled. The result is true
23
6
  * when bold text is enabled and false otherwise.
@@ -1,9 +1,4 @@
1
- import { pipe } from "fp-ts/lib/function";
2
- import { ImageURISource, Platform } from "react-native";
3
- import * as B from "fp-ts/boolean";
4
- import * as T from "io-ts";
5
- import * as E from "fp-ts/Either";
6
- import { toAndroidCacheTimestamp } from "./dates";
1
+ import { ImageSourcePropType, Platform } from "react-native";
7
2
 
8
3
  /**
9
4
  * Adds a locale timestamp to the image URI to invalidate cache on the following day if the current platform is Android.
@@ -12,27 +7,32 @@ import { toAndroidCacheTimestamp } from "./dates";
12
7
  * @returns a new source with a modified URI which includes the actual timestamp in the locale format without slashes
13
8
  * if the platform is Android and the source contains an URI. The same source otherwise.
14
9
  */
15
- export const addCacheTimestampToUri = (source: ImageURISource) => {
16
- const UriSource = T.type({
17
- uri: T.string
18
- });
10
+ export const addCacheTimestampToUri = (source: ImageSourcePropType) => {
11
+ // If the platform is not Android, return the source as is
12
+ if (Platform.OS !== "android") {
13
+ return source;
14
+ }
19
15
 
20
- return pipe(
21
- Platform.OS === "android",
22
- B.fold(
23
- () => source,
24
- () =>
25
- pipe(
26
- source,
27
- UriSource.decode,
28
- E.fold(
29
- () => source,
30
- () => ({
31
- ...source,
32
- uri: `${source.uri}?ts=${toAndroidCacheTimestamp()}`
33
- })
34
- )
35
- )
36
- )
37
- );
16
+ // If the source is a number, it's a local image return as is
17
+ if (typeof source === "number") {
18
+ return source;
19
+ }
20
+
21
+ // This invalidates the cache on the following day
22
+ const cacheBurstParam = new Date()
23
+ .toISOString()
24
+ .split("T")[0]
25
+ .replace(/-/g, "");
26
+
27
+ if (Array.isArray(source)) {
28
+ return source.map(image =>
29
+ image.uri
30
+ ? { ...image, uri: `${image.uri}?ts=${cacheBurstParam}` }
31
+ : image
32
+ );
33
+ } else {
34
+ return source.uri
35
+ ? { ...source, uri: `${source.uri}?ts=${cacheBurstParam}` }
36
+ : source;
37
+ }
38
38
  };
@@ -1,12 +1,13 @@
1
- import * as A from "fp-ts/Array";
2
- import * as O from "fp-ts/Option";
3
- import { pipe } from "fp-ts/lib/function";
4
-
5
- export const findFirstCaseInsensitive =
6
- <T>(obj: { [key: string]: T }) =>
7
- (key: string): O.Option<[string, T]> =>
8
- pipe(
9
- obj,
10
- Object.entries,
11
- A.findFirst(([k, _]) => k.toLowerCase() === key.toLowerCase())
12
- );
1
+ // Function to find the first case-insensitive logo
2
+ export const findFirstCaseInsensitive = <T>(
3
+ obj: { [key: string]: T },
4
+ key: string
5
+ ) => {
6
+ const lowerKey = key.toLowerCase();
7
+ for (const [k] of Object.entries(obj)) {
8
+ if (k.toLowerCase() === lowerKey) {
9
+ return k;
10
+ }
11
+ }
12
+ return null;
13
+ };
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.toAndroidCacheTimestamp = exports.localeDateFormat = void 0;
7
- var _i18nJs = _interopRequireDefault(require("i18n-js"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- const localeDateFormat = (date, format) => isNaN(date.getTime()) ? _i18nJs.default.t("global.date.invalid") : _i18nJs.default.strftime(date, format);
10
-
11
- /**
12
- * Generates a locale formatted timestamp,
13
- * used to force the refresh of the Image component cache for Android devices
14
- * every 24 hours.
15
- * @returns the actual locale date short format without slashes.
16
- */
17
- exports.localeDateFormat = localeDateFormat;
18
- const toAndroidCacheTimestamp = () => localeDateFormat(new Date(), _i18nJs.default.t("global.dateFormats.shortFormat").replace(/\//g, ""));
19
- exports.toAndroidCacheTimestamp = toAndroidCacheTimestamp;
20
- //# sourceMappingURL=dates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_i18nJs","_interopRequireDefault","require","obj","__esModule","default","localeDateFormat","date","format","isNaN","getTime","I18n","t","strftime","exports","toAndroidCacheTimestamp","Date","replace"],"sourceRoot":"../../../src","sources":["utils/dates.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2B,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpB,MAAMG,gBAAgB,GAAGA,CAACC,IAAU,EAAEC,MAAc,KACzDC,KAAK,CAACF,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC,GACjBC,eAAI,CAACC,CAAC,CAAC,qBAAqB,CAAC,GAC7BD,eAAI,CAACE,QAAQ,CAACN,IAAI,EAAEC,MAAM,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AALAM,OAAA,CAAAR,gBAAA,GAAAA,gBAAA;AAMO,MAAMS,uBAAuB,GAAGA,CAAA,KACrCT,gBAAgB,CACd,IAAIU,IAAI,CAAC,CAAC,EACVL,eAAI,CAACC,CAAC,CAAC,gCAAgC,CAAC,CAACK,OAAO,CAAC,KAAK,EAAE,EAAE,CAC5D,CAAC;AAACH,OAAA,CAAAC,uBAAA,GAAAA,uBAAA"}
@@ -1,11 +0,0 @@
1
- import I18n from "i18n-js";
2
- export const localeDateFormat = (date, format) => isNaN(date.getTime()) ? I18n.t("global.date.invalid") : I18n.strftime(date, format);
3
-
4
- /**
5
- * Generates a locale formatted timestamp,
6
- * used to force the refresh of the Image component cache for Android devices
7
- * every 24 hours.
8
- * @returns the actual locale date short format without slashes.
9
- */
10
- export const toAndroidCacheTimestamp = () => localeDateFormat(new Date(), I18n.t("global.dateFormats.shortFormat").replace(/\//g, ""));
11
- //# sourceMappingURL=dates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["I18n","localeDateFormat","date","format","isNaN","getTime","t","strftime","toAndroidCacheTimestamp","Date","replace"],"sourceRoot":"../../../src","sources":["utils/dates.ts"],"mappings":"AAAA,OAAOA,IAAI,MAAM,SAAS;AAE1B,OAAO,MAAMC,gBAAgB,GAAGA,CAACC,IAAU,EAAEC,MAAc,KACzDC,KAAK,CAACF,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC,GACjBL,IAAI,CAACM,CAAC,CAAC,qBAAqB,CAAC,GAC7BN,IAAI,CAACO,QAAQ,CAACL,IAAI,EAAEC,MAAM,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,uBAAuB,GAAGA,CAAA,KACrCP,gBAAgB,CACd,IAAIQ,IAAI,CAAC,CAAC,EACVT,IAAI,CAACM,CAAC,CAAC,gCAAgC,CAAC,CAACI,OAAO,CAAC,KAAK,EAAE,EAAE,CAC5D,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare const localeDateFormat: (date: Date, format: string) => string;
2
- /**
3
- * Generates a locale formatted timestamp,
4
- * used to force the refresh of the Image component cache for Android devices
5
- * every 24 hours.
6
- * @returns the actual locale date short format without slashes.
7
- */
8
- export declare const toAndroidCacheTimestamp: () => string;
9
- //# sourceMappingURL=dates.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../src/utils/dates.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,SAAU,IAAI,UAAU,MAAM,KAAG,MAG7B,CAAC;AAElC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,cAIjC,CAAC"}
@@ -1,18 +0,0 @@
1
- import I18n from "i18n-js";
2
-
3
- export const localeDateFormat = (date: Date, format: string): string =>
4
- isNaN(date.getTime())
5
- ? I18n.t("global.date.invalid")
6
- : I18n.strftime(date, format);
7
-
8
- /**
9
- * Generates a locale formatted timestamp,
10
- * used to force the refresh of the Image component cache for Android devices
11
- * every 24 hours.
12
- * @returns the actual locale date short format without slashes.
13
- */
14
- export const toAndroidCacheTimestamp = () =>
15
- localeDateFormat(
16
- new Date(),
17
- I18n.t("global.dateFormats.shortFormat").replace(/\//g, "")
18
- );