@pagopa/io-app-design-system 2.1.2 → 3.0.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 (105) hide show
  1. package/lib/commonjs/components/codeInput/CodeInput.js +41 -21
  2. package/lib/commonjs/components/codeInput/CodeInput.js.map +1 -1
  3. package/lib/commonjs/components/common/LogoPaymentWithFallback.js +20 -11
  4. package/lib/commonjs/components/common/LogoPaymentWithFallback.js.map +1 -1
  5. package/lib/commonjs/components/layout/HeaderSecondLevel.js +2 -2
  6. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
  7. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +1 -3
  8. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  9. package/lib/commonjs/components/listitems/ListItemTransaction.js +70 -91
  10. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  11. package/lib/commonjs/components/listitems/PressableListItemsBase.js +3 -1
  12. package/lib/commonjs/components/listitems/PressableListItemsBase.js.map +1 -1
  13. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +18 -38
  14. package/lib/commonjs/components/listitems/__test__/listitem.test.js +8 -4
  15. package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
  16. package/lib/commonjs/components/modules/ModuleIDP.js +2 -9
  17. package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -1
  18. package/lib/commonjs/components/modules/ModulePaymentNotice.js +8 -6
  19. package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
  20. package/lib/commonjs/components/tag/Tag.js +4 -11
  21. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  22. package/lib/commonjs/core/IODSExperimentalContextProvider.js +1 -2
  23. package/lib/commonjs/core/IODSExperimentalContextProvider.js.map +1 -1
  24. package/lib/commonjs/core/IOThemeContextProvider.js +1 -2
  25. package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -1
  26. package/lib/commonjs/utils/accessibility.js +1 -14
  27. package/lib/commonjs/utils/accessibility.js.map +1 -1
  28. package/lib/commonjs/utils/image.js +23 -14
  29. package/lib/commonjs/utils/image.js.map +1 -1
  30. package/lib/commonjs/utils/object.js +10 -5
  31. package/lib/commonjs/utils/object.js.map +1 -1
  32. package/lib/module/components/codeInput/CodeInput.js +43 -23
  33. package/lib/module/components/codeInput/CodeInput.js.map +1 -1
  34. package/lib/module/components/common/LogoPaymentWithFallback.js +20 -11
  35. package/lib/module/components/common/LogoPaymentWithFallback.js.map +1 -1
  36. package/lib/module/components/layout/HeaderSecondLevel.js +2 -2
  37. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
  38. package/lib/module/components/listitems/ListItemRadioWithAmount.js +1 -3
  39. package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  40. package/lib/module/components/listitems/ListItemTransaction.js +71 -90
  41. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  42. package/lib/module/components/listitems/PressableListItemsBase.js +4 -2
  43. package/lib/module/components/listitems/PressableListItemsBase.js.map +1 -1
  44. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +18 -38
  45. package/lib/module/components/listitems/__test__/listitem.test.js +8 -4
  46. package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
  47. package/lib/module/components/modules/ModuleIDP.js +3 -10
  48. package/lib/module/components/modules/ModuleIDP.js.map +1 -1
  49. package/lib/module/components/modules/ModulePaymentNotice.js +8 -6
  50. package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
  51. package/lib/module/components/tag/Tag.js +4 -9
  52. package/lib/module/components/tag/Tag.js.map +1 -1
  53. package/lib/module/core/IODSExperimentalContextProvider.js +1 -2
  54. package/lib/module/core/IODSExperimentalContextProvider.js.map +1 -1
  55. package/lib/module/core/IOThemeContextProvider.js +1 -2
  56. package/lib/module/core/IOThemeContextProvider.js.map +1 -1
  57. package/lib/module/utils/accessibility.js +0 -9
  58. package/lib/module/utils/accessibility.js.map +1 -1
  59. package/lib/module/utils/image.js +23 -12
  60. package/lib/module/utils/image.js.map +1 -1
  61. package/lib/module/utils/object.js +10 -3
  62. package/lib/module/utils/object.js.map +1 -1
  63. package/lib/typescript/components/codeInput/CodeInput.d.ts.map +1 -1
  64. package/lib/typescript/components/common/LogoPaymentWithFallback.d.ts.map +1 -1
  65. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
  66. package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
  67. package/lib/typescript/components/listitems/ListItemTransaction.d.ts +21 -13
  68. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  69. package/lib/typescript/components/listitems/PressableListItemsBase.d.ts.map +1 -1
  70. package/lib/typescript/components/modules/ModuleIDP.d.ts.map +1 -1
  71. package/lib/typescript/components/modules/ModulePaymentNotice.d.ts +10 -4
  72. package/lib/typescript/components/modules/ModulePaymentNotice.d.ts.map +1 -1
  73. package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
  74. package/lib/typescript/core/IODSExperimentalContextProvider.d.ts.map +1 -1
  75. package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -1
  76. package/lib/typescript/utils/accessibility.d.ts +0 -5
  77. package/lib/typescript/utils/accessibility.d.ts.map +1 -1
  78. package/lib/typescript/utils/image.d.ts +2 -2
  79. package/lib/typescript/utils/image.d.ts.map +1 -1
  80. package/lib/typescript/utils/object.d.ts +1 -2
  81. package/lib/typescript/utils/object.d.ts.map +1 -1
  82. package/package.json +1 -4
  83. package/src/components/codeInput/CodeInput.tsx +53 -30
  84. package/src/components/common/LogoPaymentWithFallback.tsx +15 -17
  85. package/src/components/layout/HeaderSecondLevel.tsx +6 -9
  86. package/src/components/listitems/ListItemRadioWithAmount.tsx +0 -1
  87. package/src/components/listitems/ListItemTransaction.tsx +88 -131
  88. package/src/components/listitems/PressableListItemsBase.tsx +6 -2
  89. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +18 -38
  90. package/src/components/listitems/__test__/listitem.test.tsx +8 -4
  91. package/src/components/modules/ModuleIDP.tsx +4 -13
  92. package/src/components/modules/ModulePaymentNotice.tsx +14 -10
  93. package/src/components/tag/Tag.tsx +10 -19
  94. package/src/core/IODSExperimentalContextProvider.tsx +1 -2
  95. package/src/core/IOThemeContextProvider.tsx +1 -2
  96. package/src/utils/accessibility.ts +0 -17
  97. package/src/utils/image.ts +28 -28
  98. package/src/utils/object.ts +13 -12
  99. package/lib/commonjs/utils/dates.js +0 -20
  100. package/lib/commonjs/utils/dates.js.map +0 -1
  101. package/lib/module/utils/dates.js +0 -11
  102. package/lib/module/utils/dates.js.map +0 -1
  103. package/lib/typescript/utils/dates.d.ts +0 -9
  104. package/lib/typescript/utils/dates.d.ts.map +0 -1
  105. package/src/utils/dates.ts +0 -18
@@ -1,14 +1,16 @@
1
- import React from "react";
1
+ import React, { ReactNode } from "react";
2
2
  import { ImageURISource } from "react-native";
3
3
  import { WithTestID } from "../../utils/types";
4
+ import { Badge } from "../badge/Badge";
4
5
  import { IOLogoPaymentType } from "../logos";
5
6
  import { PressableBaseProps } from "./PressableListItemsBase";
6
- export type ListItemTransactionStatus = "success" | "failure" | "pending" | "cancelled" | "refunded" | "reversal";
7
- export type ListItemTransactionStatusWithoutBadge = Extract<ListItemTransactionStatus, "success" | "refunded">;
8
- export type ListItemTransactionStatusWithBadge = Exclude<ListItemTransactionStatus, "success" | "refunded">;
9
- export type ListItemTransactionLogo = IOLogoPaymentType | ImageURISource | React.ReactNode;
7
+ export type ListItemTransactionBadge = {
8
+ text: string;
9
+ variant: Badge["variant"];
10
+ };
11
+ export type ListItemTransactionLogo = IOLogoPaymentType | ImageURISource | ReactNode;
10
12
  export type ListItemTransaction = WithTestID<PressableBaseProps & {
11
- hasChevronRight?: boolean;
13
+ showChevron?: boolean;
12
14
  isLoading?: boolean;
13
15
  /**
14
16
  * A logo that will be displayed on the left of the list item.
@@ -25,13 +27,19 @@ export type ListItemTransaction = WithTestID<PressableBaseProps & {
25
27
  numberOfLines?: number;
26
28
  accessible?: boolean;
27
29
  } & ({
28
- transactionStatus: ListItemTransactionStatusWithoutBadge;
29
- badgeText?: string;
30
- transactionAmount: string;
30
+ transaction: {
31
+ amount: string;
32
+ amountAccessibilityLabel: string;
33
+ badge?: never;
34
+ refund?: boolean;
35
+ };
31
36
  } | {
32
- transactionStatus: ListItemTransactionStatusWithBadge;
33
- badgeText: string;
34
- transactionAmount?: string;
37
+ transaction: {
38
+ amount?: string;
39
+ amountAccessibilityLabel?: string;
40
+ badge: ListItemTransactionBadge;
41
+ refund?: never;
42
+ };
35
43
  })>;
36
- export declare const ListItemTransaction: ({ accessibilityLabel, hasChevronRight, isLoading, paymentLogoIcon, onPress, subtitle, testID, title, transactionAmount, badgeText, transactionStatus, numberOfLines, accessible }: ListItemTransaction) => React.JSX.Element;
44
+ export declare const ListItemTransaction: ({ accessibilityLabel, showChevron, isLoading, paymentLogoIcon, onPress, subtitle, testID, title, transaction: { amount, amountAccessibilityLabel, badge, refund }, numberOfLines, accessible }: ListItemTransaction) => React.JSX.Element;
37
45
  //# sourceMappingURL=ListItemTransaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListItemTransaction.d.ts","sourceRoot":"","sources":["../../../../src/components/listitems/ListItemTransaction.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAoB,MAAM,cAAc,CAAC;AAehE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAM/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,EACL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,SAAS,GACT,SAAS,GACT,WAAW,GACX,UAAU,GACV,UAAU,CAAC;AAEf,MAAM,MAAM,qCAAqC,GAAG,OAAO,CACzD,yBAAyB,EACzB,SAAS,GAAG,UAAU,CACvB,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,OAAO,CACtD,yBAAyB,EACzB,SAAS,GAAG,UAAU,CACvB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B,iBAAiB,GACjB,cAAc,GACd,KAAK,CAAC,SAAS,CAAC;AAEpB,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAC1C,kBAAkB,GAAG;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,CACE;IACE,iBAAiB,EAAE,qCAAqC,CAAC;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,GACD;IACE,iBAAiB,EAAE,kCAAkC,CAAC;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CACJ,CACJ,CAAC;AA2BF,eAAO,MAAM,mBAAmB,sLAc7B,mBAAmB,sBAwHrB,CAAC"}
1
+ {"version":3,"file":"ListItemTransaction.d.ts","sourceRoot":"","sources":["../../../../src/components/listitems/ListItemTransaction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,cAAc,EAAQ,MAAM,cAAc,CAAC;AAapD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAI7C,OAAO,EACL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B,iBAAiB,GACjB,cAAc,GACd,SAAS,CAAC;AAEd,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAC1C,kBAAkB,GAAG;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,CACE;IACE,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,CAAC;QACf,wBAAwB,EAAE,MAAM,CAAC;QACjC,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CACH,GACD;IACE,WAAW,EAAE;QACX,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,KAAK,EAAE,wBAAwB,CAAC;QAChC,MAAM,CAAC,EAAE,KAAK,CAAC;KAChB,CAAC;CACH,CACJ,CACJ,CAAC;AA2BF,eAAO,MAAM,mBAAmB,mMAY7B,mBAAmB,sBAkGrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PressableListItemsBase.d.ts","sourceRoot":"","sources":["../../../../src/components/listitems/PressableListItemsBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,MAAM,kBAAkB,GAAG,UAAU,CACzC,IAAI,CACF,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACpC,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,CACtB,CACF,CAAC;AAEF,eAAO,MAAM,qBAAqB,+DAM/B,MAAM,iBAAiB,CAAC,kBAAkB,CAAC,sBAyB7C,CAAC"}
1
+ {"version":3,"file":"PressableListItemsBase.d.ts","sourceRoot":"","sources":["../../../../src/components/listitems/PressableListItemsBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,MAAM,kBAAkB,GAAG,UAAU,CACzC,IAAI,CACF,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACpC,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,CACtB,CACF,CAAC;AAEF,eAAO,MAAM,qBAAqB,+DAM/B,MAAM,iBAAiB,CAAC,kBAAkB,CAAC,sBA6B7C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleIDP.d.ts","sourceRoot":"","sources":["../../../../src/components/modules/ModuleIDP.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAS,mBAAmB,EAAwB,MAAM,cAAc,CAAC;AAQhF,OAAO,EAEL,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,UAAU,SAAU,SAAQ,wBAAwB;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,mBAAmB,CAAC;IAC/B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAiBD,eAAO,MAAM,SAAS,qFAQnB,SAAS,sBAuCX,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"ModuleIDP.d.ts","sourceRoot":"","sources":["../../../../src/components/modules/ModuleIDP.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAS,mBAAmB,EAAc,MAAM,cAAc,CAAC;AAQtE,OAAO,EAEL,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,UAAU,SAAU,SAAQ,wBAAwB;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,mBAAmB,CAAC;IAC/B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAWD,eAAO,MAAM,SAAS,qFAQnB,SAAS,sBAoCX,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -9,12 +9,18 @@ export type ModulePaymentNoticeProps = WithTestID<{
9
9
  subtitle: string;
10
10
  onPress: (event: GestureResponderEvent) => void;
11
11
  } & ({
12
- paymentNoticeStatus: Extract<PaymentNoticeStatus, "default">;
13
- paymentNoticeAmount: string;
12
+ paymentNotice: {
13
+ status: Extract<PaymentNoticeStatus, "default">;
14
+ amount: string;
15
+ amountAccessibilityLabel: string;
16
+ };
14
17
  badgeText?: never;
15
18
  } | {
16
- paymentNoticeStatus: Exclude<PaymentNoticeStatus, "default">;
17
- paymentNoticeAmount?: never;
19
+ paymentNotice: {
20
+ status: Exclude<PaymentNoticeStatus, "default">;
21
+ amount?: string;
22
+ amountAccessibilityLabel?: string;
23
+ };
18
24
  badgeText: string;
19
25
  })>;
20
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ModulePaymentNotice.d.ts","sourceRoot":"","sources":["../../../../src/components/modules/ModulePaymentNotice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAoB,MAAM,cAAc,CAAC;AAIvE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQ/C,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,MAAM,GACN,OAAO,GACP,SAAS,GACT,SAAS,GACT,UAAU,GACV,aAAa,CAAC;AAElB,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAC/C;IACE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjD,GAAG,CACA;IACE,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;IAC7D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GACD;IACE,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;IAC7D,mBAAmB,CAAC,EAAE,KAAK,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB,CACJ,CACF,CAAC;AAgFF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,gEAM7B,wBAAwB,sBAc1B,CAAC"}
1
+ {"version":3,"file":"ModulePaymentNotice.d.ts","sourceRoot":"","sources":["../../../../src/components/modules/ModulePaymentNotice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAoB,MAAM,cAAc,CAAC;AAGvE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQ/C,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,MAAM,GACN,OAAO,GACP,SAAS,GACT,SAAS,GACT,UAAU,GACV,aAAa,CAAC;AAElB,MAAM,MA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AAY,CAAC;CAC/B,CACJ,CAAC;AAiFJ;;GAEG;AACH,eAAO,MAAM,GAAG,uEAMb,GAAG,sBAyCL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IODSExperimentalContextProvider.d.ts","sourceRoot":"","sources":["../../../src/core/IODSExperimentalContextProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,yBAAyB,GAAG;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,2BAA2B,0CAIpC,CAAC;AAEL,eAAO,MAAM,uBAAuB,iCACW,CAAC;AAEhD,KAAK,kCAAkC,GAAG;IACxC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,+BAA+B,uCAGzC,MAAM,iBAAiB,CAAC,kCAAkC,CAAC,sBAY7D,CAAC"}
1
+ {"version":3,"file":"IODSExperimentalContextProvider.d.ts","sourceRoot":"","sources":["../../../src/core/IODSExperimentalContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,yBAAyB,GAAG;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,2BAA2B,0CAIpC,CAAC;AAEL,eAAO,MAAM,uBAAuB,iCACW,CAAC;AAEhD,KAAK,kCAAkC,GAAG;IACxC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,+BAA+B,uCAGzC,MAAM,iBAAiB,CAAC,kCAAkC,CAAC,sBAY7D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IOThemeContextProvider.d.ts","sourceRoot":"","sources":["../../../src/core/IOThemeContextProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EACL,OAAO,EAIR,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,QAAQ;;;CAA6C,CAAC;AACnE,eAAO,MAAM,cAAc;;;CAAmD,CAAC;AAC/E,KAAK,WAAW,GAAG,MAAM,OAAO,QAAQ,CAAC;AAEzC,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAMzD,CAAC;AAEL,eAAO,MAAM,iBAAiB,0BAAyC,CAAC;AAExE,eAAO,MAAM,UAAU,eAAkC,CAAC;AAE1D,KAAK,2BAA2B,GAAG;IACjC,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,sBAAsB,wBAGhC,MAAM,iBAAiB,CAAC,2BAA2B,CAAC,sBAsBtD,CAAC"}
1
+ {"version":3,"file":"IOThemeContextProvider.d.ts","sourceRoot":"","sources":["../../../src/core/IOThemeContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EACL,OAAO,EAIR,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,QAAQ;;;CAA6C,CAAC;AACnE,eAAO,MAAM,cAAc;;;CAAmD,CAAC;AAC/E,KAAK,WAAW,GAAG,MAAM,OAAO,QAAQ,CAAC;AAEzC,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAMzD,CAAC;AAEL,eAAO,MAAM,iBAAiB,0BAAyC,CAAC;AAExE,eAAO,MAAM,UAAU,eAAkC,CAAC;AAE1D,KAAK,2BAA2B,GAAG;IACjC,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,sBAAsB,wBAGhC,MAAM,iBAAiB,CAAC,2BAA2B,CAAC,sBAsBtD,CAAC"}
@@ -1,8 +1,3 @@
1
- /**
2
- * This function is used to get the text that will be read by the screen reader
3
- * with the correct minus symbol pronunciation.
4
- */
5
- export declare const getAccessibleAmountText: (amount?: string) => string | undefined;
6
1
  /**
7
2
  * Query whether a bold text is currently enabled. The result is true
8
3
  * when bold text is enabled and false otherwise.
@@ -1 +1 @@
1
- {"version":3,"file":"accessibility.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,YAAa,MAAM,uBAQpD,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eA0B9B,CAAC"}
1
+ {"version":3,"file":"accessibility.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eA0B9B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ImageURISource } from "react-native";
1
+ import { ImageSourcePropType } from "react-native";
2
2
  /**
3
3
  * Adds a locale timestamp to the image URI to invalidate cache on the following day if the current platform is Android.
4
4
  * Useful to bypass React Native Image component aggressive cache on Android.
@@ -6,5 +6,5 @@ import { ImageURISource } from "react-native";
6
6
  * @returns a new source with a modified URI which includes the actual timestamp in the locale format without slashes
7
7
  * if the platform is Android and the source contains an URI. The same source otherwise.
8
8
  */
9
- export declare const addCacheTimestampToUri: (source: ImageURISource) => ImageURISource;
9
+ export declare const addCacheTimestampToUri: (source: ImageSourcePropType) => ImageSourcePropType;
10
10
  //# sourceMappingURL=image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/utils/image.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAY,MAAM,cAAc,CAAC;AAMxD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,cAAc,mBAuB5D,CAAC"}
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/utils/image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,cAAc,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,mBAAmB,wBA4BjE,CAAC"}
@@ -1,5 +1,4 @@
1
- import * as O from "fp-ts/Option";
2
1
  export declare const findFirstCaseInsensitive: <T>(obj: {
3
2
  [key: string]: T;
4
- }) => (key: string) => O.Option<[string, T]>;
3
+ }, key: string) => string | null;
5
4
  //# sourceMappingURL=object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/utils/object.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,wBAAwB,WAC1B;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;CAAE,WACvB,MAAM,KAAG,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAKhC,CAAC"}
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/utils/object.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,wBAAwB,WAC9B;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;CAAE,OACpB,MAAM,kBASZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/io-app-design-system",
3
- "version": "2.1.2",
3
+ "version": "3.0.1",
4
4
  "description": "The library defining the core components of the design system of @pagopa/io-app",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -100,7 +100,6 @@
100
100
  "react-dom": "^18.2.0",
101
101
  "react-native": "0.71.8",
102
102
  "react-native-builder-bob": "^0.20.0",
103
- "react-native-i18n": "^2.0.15",
104
103
  "react-native-web": "^0.18.12",
105
104
  "react-native-web-linear-gradient": "^1.1.2",
106
105
  "react-test-renderer": "^18.2.0",
@@ -181,9 +180,7 @@
181
180
  ]
182
181
  },
183
182
  "dependencies": {
184
- "@pagopa/ts-commons": "^12.0.0",
185
183
  "@testing-library/jest-native": "^5.4.2",
186
- "@types/react-native-i18n": "2.0.0",
187
184
  "@types/react-test-renderer": "^18.0.0",
188
185
  "auto-changelog": "^2.4.0",
189
186
  "lodash": "^4.17.21",
@@ -1,7 +1,7 @@
1
- import React, { useEffect, useMemo } from "react";
2
- import { StyleSheet, View } from "react-native";
1
+ import React, { useEffect, useState } from "react";
2
+ import { ColorValue, StyleSheet, View } from "react-native";
3
3
  import Animated from "react-native-reanimated";
4
- import { IOColors, IOStyles } from "../../core";
4
+ import { hexToRgba, IOColors, useIOThemeContext } from "../../core";
5
5
  import { triggerHaptic } from "../../functions";
6
6
  import { useErrorShakeAnimation } from "../../utils/hooks/useErrorShakeAnimation";
7
7
  import { HStack } from "../stack";
@@ -20,28 +20,29 @@ const styles = StyleSheet.create({
20
20
  dotShape: {
21
21
  width: DOT_SIZE,
22
22
  height: DOT_SIZE,
23
- borderRadius: 8,
23
+ borderRadius: DOT_SIZE / 2,
24
24
  borderWidth: 2
25
- },
26
- dotEmpty: {
27
- borderColor: IOColors["grey-650"]
28
- },
29
- wrapper: {
30
- justifyContent: "center"
31
25
  }
32
26
  });
33
27
 
34
- const EmptyDot = () => <View style={[styles.dotShape, styles.dotEmpty]} />;
35
-
36
- const FilletDot = ({ color }: { color: IOColors }) => (
28
+ const EmptyDot = ({ color: borderColor }: { color: ColorValue }) => (
37
29
  <View
38
30
  style={[
39
31
  styles.dotShape,
40
- { backgroundColor: IOColors[color], borderColor: IOColors[color] }
32
+ {
33
+ borderColor,
34
+ backgroundColor: hexToRgba(borderColor, 0)
35
+ }
41
36
  ]}
42
37
  />
43
38
  );
44
39
 
40
+ const FilledDot = ({ color: backgroundColor }: { color: ColorValue }) => (
41
+ <View
42
+ style={[styles.dotShape, { backgroundColor, borderColor: backgroundColor }]}
43
+ />
44
+ );
45
+
45
46
  export const CodeInput = ({
46
47
  length,
47
48
  value,
@@ -49,19 +50,34 @@ export const CodeInput = ({
49
50
  variant = "light",
50
51
  onValidate
51
52
  }: CodeInputProps) => {
52
- const [status, setStatus] = React.useState<"default" | "error">("default");
53
+ const [status, setStatus] = useState<"default" | "error">("default");
54
+ const { themeType } = useIOThemeContext();
53
55
 
54
56
  const { translate, animatedStyle, shakeAnimation } = useErrorShakeAnimation();
55
57
 
56
- const fillColor = useMemo(
57
- () =>
58
- status === "error"
59
- ? "error-600"
60
- : variant === "light"
61
- ? "white"
62
- : "black",
63
- [variant, status]
64
- );
58
+ /* Empty Dot
59
+ - Right color depending on both theme and variant */
60
+ const emptyDotColorLightBg = IOColors["grey-650"];
61
+ const emptyDotColorDarkBg = hexToRgba(IOColors.white, 0.75);
62
+ const emptyDotColorThemeBased =
63
+ themeType === "light" ? emptyDotColorLightBg : emptyDotColorDarkBg;
64
+
65
+ const emptyDotColor =
66
+ variant === "light" ? emptyDotColorDarkBg : emptyDotColorThemeBased;
67
+
68
+ /* Filled Dot
69
+ - Right color depending on theme, variant and status */
70
+ const filledDotColorLightBg = IOColors.black;
71
+ const filledDotColorDarkBg = IOColors.white;
72
+ const filledDotColorThemeBased =
73
+ themeType === "light" ? filledDotColorLightBg : filledDotColorDarkBg;
74
+
75
+ const filledDotColor =
76
+ status === "error"
77
+ ? IOColors["error-600"]
78
+ : variant === "light"
79
+ ? filledDotColorDarkBg
80
+ : filledDotColorThemeBased;
65
81
 
66
82
  useEffect(() => {
67
83
  if (onValidate && value.length === length) {
@@ -85,13 +101,20 @@ export const CodeInput = ({
85
101
  }, [value, onValidate, length, onValueChange, translate, shakeAnimation]);
86
102
 
87
103
  return (
88
- <Animated.View style={[IOStyles.row, styles.wrapper, animatedStyle]}>
104
+ <Animated.View
105
+ style={[
106
+ { flexDirection: "row", justifyContent: "center" },
107
+ animatedStyle
108
+ ]}
109
+ >
89
110
  <HStack space={DOT_SIZE}>
90
- {[...Array(length)].map((_, i) => (
91
- <React.Fragment key={i}>
92
- {value[i] ? <FilletDot color={fillColor} /> : <EmptyDot />}
93
- </React.Fragment>
94
- ))}
111
+ {[...Array(length)].map((_, i) =>
112
+ value[i] ? (
113
+ <FilledDot key={i} color={filledDotColor} />
114
+ ) : (
115
+ <EmptyDot key={i} color={emptyDotColor} />
116
+ )
117
+ )}
95
118
  </HStack>
96
119
  </Animated.View>
97
120
  );
@@ -1,7 +1,4 @@
1
- import * as O from "fp-ts/lib/Option";
2
- import { pipe } from "fp-ts/lib/function";
3
1
  import * as React from "react";
4
- import { findFirstCaseInsensitive } from "../../utils/object";
5
2
  import { IOColors } from "../../core";
6
3
  import { IOIconSizeScale, Icon } from "../icons";
7
4
  import {
@@ -12,6 +9,7 @@ import {
12
9
  LogoPayment,
13
10
  LogoPaymentExt
14
11
  } from "../logos";
12
+ import { findFirstCaseInsensitive } from "../../utils/object";
15
13
 
16
14
  export type LogoPaymentWithFallback = {
17
15
  brand?: string;
@@ -42,19 +40,19 @@ export const LogoPaymentWithFallback = ({
42
40
  }: LogoPaymentWithFallback) => {
43
41
  const logos = isExtended ? IOPaymentExtLogos : IOPaymentLogos;
44
42
 
45
- return pipe(
46
- brand,
47
- O.fromNullable,
48
- O.chain(findFirstCaseInsensitive(logos)),
49
- O.map(([brand]) => brand),
50
- O.fold(
51
- () => <Icon name="creditCard" size={size} color={fallbackIconColor} />,
52
- brand =>
53
- isExtended ? (
54
- <LogoPaymentExt name={brand as IOLogoPaymentExtType} size={size} />
55
- ) : (
56
- <LogoPayment name={brand as IOLogoPaymentType} size={size} />
57
- )
58
- )
43
+ if (!brand) {
44
+ return <Icon name="creditCard" size={size} color={fallbackIconColor} />;
45
+ }
46
+
47
+ const findCase = findFirstCaseInsensitive(logos, brand);
48
+
49
+ if (!findCase) {
50
+ return <Icon name="creditCard" size={size} color={fallbackIconColor} />;
51
+ }
52
+
53
+ return isExtended ? (
54
+ <LogoPaymentExt name={findCase as IOLogoPaymentExtType} size={size} />
55
+ ) : (
56
+ <LogoPayment name={findCase as IOLogoPaymentType} size={size} />
59
57
  );
60
58
  };
@@ -178,22 +178,19 @@ export const HeaderSecondLevel = ({
178
178
  /* Visual attributes when there are transitions between states */
179
179
  const HEADER_DEFAULT_BG_COLOR: IOColors = theme["appBackground-primary"];
180
180
 
181
- const headerBgColorTransparentState = backgroundColor
182
- ? hexToRgba(backgroundColor, 0)
183
- : transparent
184
- ? hexToRgba(IOColors[HEADER_DEFAULT_BG_COLOR], 0)
185
- : IOColors[HEADER_DEFAULT_BG_COLOR];
186
-
187
181
  const headerBgColorSolidState =
188
182
  backgroundColor ?? IOColors[HEADER_DEFAULT_BG_COLOR];
189
183
 
184
+ const headerBgColorTransparentState = transparent
185
+ ? hexToRgba(headerBgColorSolidState, 0)
186
+ : headerBgColorSolidState;
187
+
190
188
  const borderColorDefault = IOColors[theme["divider-default"]];
191
189
 
192
- const borderColorTransparentState = backgroundColor
193
- ? hexToRgba(backgroundColor, 0)
194
- : hexToRgba(borderColorDefault, 0);
195
190
  const borderColorSolidState = backgroundColor ?? borderColorDefault;
196
191
 
192
+ const borderColorTransparentState = hexToRgba(borderColorSolidState, 0);
193
+
197
194
  useLayoutEffect(() => {
198
195
  if (isTitleAccessible) {
199
196
  const reactNode = findNodeHandle(titleRef.current);
@@ -81,7 +81,6 @@ export const ListItemRadioWithAmount = ({
81
81
  importantForAccessibility="no-hide-descendants"
82
82
  style={{ flexDirection: "row" }}
83
83
  >
84
- <HSpacer size={8} />
85
84
  <H6 color={theme["interactiveElem-default"]}>
86
85
  {formattedAmountString}
87
86
  </H6>