@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.
- package/lib/commonjs/components/codeInput/CodeInput.js +41 -21
- package/lib/commonjs/components/codeInput/CodeInput.js.map +1 -1
- package/lib/commonjs/components/common/LogoPaymentWithFallback.js +20 -11
- package/lib/commonjs/components/common/LogoPaymentWithFallback.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +2 -2
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +1 -3
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemTransaction.js +70 -91
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/PressableListItemsBase.js +3 -1
- package/lib/commonjs/components/listitems/PressableListItemsBase.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +18 -38
- package/lib/commonjs/components/listitems/__test__/listitem.test.js +8 -4
- package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleIDP.js +2 -9
- package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -1
- package/lib/commonjs/components/modules/ModulePaymentNotice.js +8 -6
- package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/commonjs/components/tag/Tag.js +4 -11
- package/lib/commonjs/components/tag/Tag.js.map +1 -1
- package/lib/commonjs/core/IODSExperimentalContextProvider.js +1 -2
- package/lib/commonjs/core/IODSExperimentalContextProvider.js.map +1 -1
- package/lib/commonjs/core/IOThemeContextProvider.js +1 -2
- package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -1
- package/lib/commonjs/utils/accessibility.js +1 -14
- package/lib/commonjs/utils/accessibility.js.map +1 -1
- package/lib/commonjs/utils/image.js +23 -14
- package/lib/commonjs/utils/image.js.map +1 -1
- package/lib/commonjs/utils/object.js +10 -5
- package/lib/commonjs/utils/object.js.map +1 -1
- package/lib/module/components/codeInput/CodeInput.js +43 -23
- package/lib/module/components/codeInput/CodeInput.js.map +1 -1
- package/lib/module/components/common/LogoPaymentWithFallback.js +20 -11
- package/lib/module/components/common/LogoPaymentWithFallback.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +2 -2
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadioWithAmount.js +1 -3
- package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/module/components/listitems/ListItemTransaction.js +71 -90
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/PressableListItemsBase.js +4 -2
- package/lib/module/components/listitems/PressableListItemsBase.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +18 -38
- package/lib/module/components/listitems/__test__/listitem.test.js +8 -4
- package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
- package/lib/module/components/modules/ModuleIDP.js +3 -10
- package/lib/module/components/modules/ModuleIDP.js.map +1 -1
- package/lib/module/components/modules/ModulePaymentNotice.js +8 -6
- package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/module/components/tag/Tag.js +4 -9
- package/lib/module/components/tag/Tag.js.map +1 -1
- package/lib/module/core/IODSExperimentalContextProvider.js +1 -2
- package/lib/module/core/IODSExperimentalContextProvider.js.map +1 -1
- package/lib/module/core/IOThemeContextProvider.js +1 -2
- package/lib/module/core/IOThemeContextProvider.js.map +1 -1
- package/lib/module/utils/accessibility.js +0 -9
- package/lib/module/utils/accessibility.js.map +1 -1
- package/lib/module/utils/image.js +23 -12
- package/lib/module/utils/image.js.map +1 -1
- package/lib/module/utils/object.js +10 -3
- package/lib/module/utils/object.js.map +1 -1
- package/lib/typescript/components/codeInput/CodeInput.d.ts.map +1 -1
- package/lib/typescript/components/common/LogoPaymentWithFallback.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts +21 -13
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
- package/lib/typescript/components/listitems/PressableListItemsBase.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleIDP.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModulePaymentNotice.d.ts +10 -4
- package/lib/typescript/components/modules/ModulePaymentNotice.d.ts.map +1 -1
- package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
- package/lib/typescript/core/IODSExperimentalContextProvider.d.ts.map +1 -1
- package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -1
- package/lib/typescript/utils/accessibility.d.ts +0 -5
- package/lib/typescript/utils/accessibility.d.ts.map +1 -1
- package/lib/typescript/utils/image.d.ts +2 -2
- package/lib/typescript/utils/image.d.ts.map +1 -1
- package/lib/typescript/utils/object.d.ts +1 -2
- package/lib/typescript/utils/object.d.ts.map +1 -1
- package/package.json +1 -4
- package/src/components/codeInput/CodeInput.tsx +53 -30
- package/src/components/common/LogoPaymentWithFallback.tsx +15 -17
- package/src/components/layout/HeaderSecondLevel.tsx +6 -9
- package/src/components/listitems/ListItemRadioWithAmount.tsx +0 -1
- package/src/components/listitems/ListItemTransaction.tsx +88 -131
- package/src/components/listitems/PressableListItemsBase.tsx +6 -2
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +18 -38
- package/src/components/listitems/__test__/listitem.test.tsx +8 -4
- package/src/components/modules/ModuleIDP.tsx +4 -13
- package/src/components/modules/ModulePaymentNotice.tsx +14 -10
- package/src/components/tag/Tag.tsx +10 -19
- package/src/core/IODSExperimentalContextProvider.tsx +1 -2
- package/src/core/IOThemeContextProvider.tsx +1 -2
- package/src/utils/accessibility.ts +0 -17
- package/src/utils/image.ts +28 -28
- package/src/utils/object.ts +13 -12
- package/lib/commonjs/utils/dates.js +0 -20
- package/lib/commonjs/utils/dates.js.map +0 -1
- package/lib/module/utils/dates.js +0 -11
- package/lib/module/utils/dates.js.map +0 -1
- package/lib/typescript/utils/dates.d.ts +0 -9
- package/lib/typescript/utils/dates.d.ts.map +0 -1
- 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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
transaction: {
|
|
31
|
+
amount: string;
|
|
32
|
+
amountAccessibilityLabel: string;
|
|
33
|
+
badge?: never;
|
|
34
|
+
refund?: boolean;
|
|
35
|
+
};
|
|
31
36
|
} | {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
transaction: {
|
|
38
|
+
amount?: string;
|
|
39
|
+
amountAccessibilityLabel?: string;
|
|
40
|
+
badge: ListItemTransactionBadge;
|
|
41
|
+
refund?: never;
|
|
42
|
+
};
|
|
35
43
|
})>;
|
|
36
|
-
export declare const ListItemTransaction: ({ accessibilityLabel,
|
|
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":"
|
|
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,
|
|
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,
|
|
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
|
-
|
|
13
|
-
|
|
12
|
+
paymentNotice: {
|
|
13
|
+
status: Extract<PaymentNoticeStatus, "default">;
|
|
14
|
+
amount: string;
|
|
15
|
+
amountAccessibilityLabel: string;
|
|
16
|
+
};
|
|
14
17
|
badgeText?: never;
|
|
15
18
|
} | {
|
|
16
|
-
|
|
17
|
-
|
|
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;
|
|
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,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,aAAa,EAAE;QACb,MAAM,EAAE,OAAO,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;QAChD,MAAM,EAAE,MAAM,CAAC;QACf,wBAAwB,EAAE,MAAM,CAAC;KAClC,CAAC;IACF,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GACD;IACE,aAAa,EAAE;QACb,MAAM,EAAE,OAAO,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;QAChD,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,wBAAwB,CAAC,EAAE,MAAM,CAAC;KACnC,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;CACnB,CACJ,CACF,CAAC;AA+EF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,gEAM7B,wBAAwB,sBAc1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../src/components/tag/Tag.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../src/components/tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,QAAQ,EAIT,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAmB,OAAO,EAAQ,MAAM,UAAU,CAAC;AAG1D,KAAK,YAAY,GAAG;IAClB,SAAS,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,SAAS,GACV;IACE,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,GACD;IACE,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEN,MAAM,MAAM,GAAG,GAAG,SAAS,GACzB,UAAU,CACN;IACE,OAAO,EACH,QAAQ,GACR,cAAc,GACd,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,YAAY,GACZ,QAAQ,CAAC;IACb,eAAe,CAAC,EAAE,KAAK,CAAC;CACzB,GACD;IACE,OAAO,EAAE,YAAY,CAAC;IACtB,eAAe,EAAE,YAAY,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":"
|
|
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":"
|
|
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":"
|
|
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 {
|
|
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:
|
|
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":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/utils/object.ts"],"names":[],"mappings":"AACA,
|
|
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": "
|
|
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,
|
|
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,
|
|
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:
|
|
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 = (
|
|
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
|
-
{
|
|
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] =
|
|
53
|
+
const [status, setStatus] = useState<"default" | "error">("default");
|
|
54
|
+
const { themeType } = useIOThemeContext();
|
|
53
55
|
|
|
54
56
|
const { translate, animatedStyle, shakeAnimation } = useErrorShakeAnimation();
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
|
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
|
-
|
|
92
|
-
{
|
|
93
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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);
|