@pagopa/io-app-design-system 1.11.3 → 1.13.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.
- package/lib/commonjs/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -0
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -0
- package/lib/commonjs/components/buttons/ButtonLink.js +3 -5
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +6 -6
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +40 -12
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +52 -26
- package/lib/commonjs/components/icons/Icon.js +6 -0
- package/lib/commonjs/components/icons/Icon.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconDocPaymentCode.js +31 -0
- package/lib/commonjs/components/icons/svg/IconDocPaymentCode.js.map +1 -0
- package/lib/commonjs/components/icons/svg/IconEntityCode.js +31 -0
- package/lib/commonjs/components/icons/svg/IconEntityCode.js.map +1 -0
- package/lib/commonjs/components/icons/svg/IconNotes.js +31 -0
- package/lib/commonjs/components/icons/svg/IconNotes.js.map +1 -0
- package/lib/commonjs/components/icons/svg/originals/IconDocPaymentCode.svg +3 -0
- package/lib/commonjs/components/icons/svg/originals/IconEntityCode.svg +3 -0
- package/lib/commonjs/components/icons/svg/originals/IconNotes.svg +3 -0
- package/lib/commonjs/components/index.js +22 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/layout/BlockButtons.js +1 -4
- package/lib/commonjs/components/layout/BlockButtons.js.map +1 -1
- package/lib/commonjs/components/layout/Dismissable.js +60 -0
- package/lib/commonjs/components/layout/Dismissable.js.map +1 -0
- package/lib/commonjs/components/layout/FooterWithButtons.js +20 -9
- package/lib/commonjs/components/layout/FooterWithButtons.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderFirstLevel.js +14 -5
- package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +15 -12
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/layout/common.js +6 -0
- package/lib/commonjs/components/layout/common.js.map +1 -0
- package/lib/commonjs/components/layout/index.js +11 -0
- package/lib/commonjs/components/layout/index.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemTransaction.js +5 -4
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +2 -0
- package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js +94 -0
- package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js.map +1 -0
- package/lib/commonjs/components/loadingSpinner/index.js +17 -0
- package/lib/commonjs/components/loadingSpinner/index.js.map +1 -0
- package/lib/commonjs/components/logos/LogoPaymentCard.js +50 -0
- package/lib/commonjs/components/logos/LogoPaymentCard.js.map +1 -0
- package/lib/commonjs/components/logos/LogoPaymentExt.js +1 -1
- package/lib/commonjs/components/logos/LogoPaymentExt.js.map +1 -1
- package/lib/commonjs/components/logos/README.md +2 -1
- package/lib/commonjs/components/logos/index.js +20 -1
- package/lib/commonjs/components/logos/index.js.map +1 -1
- package/lib/commonjs/components/logos/svg/LogoPaymentCardBancomatPay.js +33 -0
- package/lib/commonjs/components/logos/svg/LogoPaymentCardBancomatPay.js.map +1 -0
- package/lib/commonjs/components/logos/svg/LogoPaymentCardPayPal.js +42 -0
- package/lib/commonjs/components/logos/svg/LogoPaymentCardPayPal.js.map +1 -0
- package/lib/commonjs/components/logos/svg/originals/LogoPaymentCardBancomatPay.svg +18 -0
- package/lib/commonjs/components/logos/svg/originals/LogoPaymentCardPayPal.svg +30 -0
- package/lib/commonjs/components/pictograms/Pictogram.js +5 -1
- package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
- package/lib/commonjs/components/pictograms/svg/PictogramBleedNotification.js +47 -0
- package/lib/commonjs/components/pictograms/svg/PictogramBleedNotification.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/PictogramNotification.js +47 -0
- package/lib/commonjs/components/pictograms/svg/PictogramNotification.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramBleedNotification.svg +30 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramNotification.svg +30 -0
- package/lib/commonjs/components/toast/ToastNotification.js +73 -0
- package/lib/commonjs/components/toast/ToastNotification.js.map +1 -0
- package/lib/commonjs/components/toast/ToastProvider.js +135 -0
- package/lib/commonjs/components/toast/ToastProvider.js.map +1 -0
- package/lib/commonjs/components/toast/context.js +14 -0
- package/lib/commonjs/components/toast/context.js.map +1 -0
- package/lib/commonjs/components/toast/index.js +39 -0
- package/lib/commonjs/components/toast/index.js.map +1 -0
- package/lib/commonjs/components/toast/types.js +6 -0
- package/lib/commonjs/components/toast/types.js.map +1 -0
- package/lib/commonjs/components/toast/useIOToast.js +94 -0
- package/lib/commonjs/components/toast/useIOToast.js.map +1 -0
- package/lib/commonjs/components/typography/BaseTypography.js +3 -1
- package/lib/commonjs/components/typography/BaseTypography.js.map +1 -1
- package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +31 -0
- package/lib/commonjs/core/IOStyles.js +10 -0
- package/lib/commonjs/core/IOStyles.js.map +1 -1
- package/lib/commonjs/core/IOTransitions.js +106 -0
- package/lib/commonjs/core/IOTransitions.js.map +1 -0
- package/lib/commonjs/core/index.js +11 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -0
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -0
- package/lib/module/components/buttons/ButtonLink.js +3 -5
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +6 -6
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +40 -13
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +52 -26
- package/lib/module/components/icons/Icon.js +6 -0
- package/lib/module/components/icons/Icon.js.map +1 -1
- package/lib/module/components/icons/svg/IconDocPaymentCode.js +23 -0
- package/lib/module/components/icons/svg/IconDocPaymentCode.js.map +1 -0
- package/lib/module/components/icons/svg/IconEntityCode.js +23 -0
- package/lib/module/components/icons/svg/IconEntityCode.js.map +1 -0
- package/lib/module/components/icons/svg/IconNotes.js +23 -0
- package/lib/module/components/icons/svg/IconNotes.js.map +1 -0
- package/lib/module/components/icons/svg/originals/IconDocPaymentCode.svg +3 -0
- package/lib/module/components/icons/svg/originals/IconEntityCode.svg +3 -0
- package/lib/module/components/icons/svg/originals/IconNotes.svg +3 -0
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/layout/BlockButtons.js +1 -4
- package/lib/module/components/layout/BlockButtons.js.map +1 -1
- package/lib/module/components/layout/Dismissable.js +51 -0
- package/lib/module/components/layout/Dismissable.js.map +1 -0
- package/lib/module/components/layout/FooterWithButtons.js +20 -10
- package/lib/module/components/layout/FooterWithButtons.js.map +1 -1
- package/lib/module/components/layout/HeaderFirstLevel.js +14 -5
- package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +15 -12
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/layout/common.js +2 -0
- package/lib/module/components/layout/common.js.map +1 -0
- package/lib/module/components/layout/index.js +1 -0
- package/lib/module/components/layout/index.js.map +1 -1
- package/lib/module/components/listitems/ListItemTransaction.js +5 -4
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +2 -0
- package/lib/module/components/loadingSpinner/LoadingSpinner.js +86 -0
- package/lib/module/components/loadingSpinner/LoadingSpinner.js.map +1 -0
- package/lib/module/components/loadingSpinner/index.js +2 -0
- package/lib/module/components/loadingSpinner/index.js.map +1 -0
- package/lib/module/components/logos/LogoPaymentCard.js +43 -0
- package/lib/module/components/logos/LogoPaymentCard.js.map +1 -0
- package/lib/module/components/logos/LogoPaymentExt.js +1 -1
- package/lib/module/components/logos/LogoPaymentExt.js.map +1 -1
- package/lib/module/components/logos/README.md +2 -1
- package/lib/module/components/logos/index.js +2 -0
- package/lib/module/components/logos/index.js.map +1 -1
- package/lib/module/components/logos/svg/LogoPaymentCardBancomatPay.js +25 -0
- package/lib/module/components/logos/svg/LogoPaymentCardBancomatPay.js.map +1 -0
- package/lib/module/components/logos/svg/LogoPaymentCardPayPal.js +34 -0
- package/lib/module/components/logos/svg/LogoPaymentCardPayPal.js.map +1 -0
- package/lib/module/components/logos/svg/originals/LogoPaymentCardBancomatPay.svg +18 -0
- package/lib/module/components/logos/svg/originals/LogoPaymentCardPayPal.svg +30 -0
- package/lib/module/components/pictograms/Pictogram.js +5 -1
- package/lib/module/components/pictograms/Pictogram.js.map +1 -1
- package/lib/module/components/pictograms/svg/PictogramBleedNotification.js +39 -0
- package/lib/module/components/pictograms/svg/PictogramBleedNotification.js.map +1 -0
- package/lib/module/components/pictograms/svg/PictogramNotification.js +39 -0
- package/lib/module/components/pictograms/svg/PictogramNotification.js.map +1 -0
- package/lib/module/components/pictograms/svg/originals/PictogramBleedNotification.svg +30 -0
- package/lib/module/components/pictograms/svg/originals/PictogramNotification.svg +30 -0
- package/lib/module/components/toast/ToastNotification.js +66 -0
- package/lib/module/components/toast/ToastNotification.js.map +1 -0
- package/lib/module/components/toast/ToastProvider.js +123 -0
- package/lib/module/components/toast/ToastProvider.js.map +1 -0
- package/lib/module/components/toast/context.js +7 -0
- package/lib/module/components/toast/context.js.map +1 -0
- package/lib/module/components/toast/index.js +4 -0
- package/lib/module/components/toast/index.js.map +1 -0
- package/lib/module/components/toast/types.js +2 -0
- package/lib/module/components/toast/types.js.map +1 -0
- package/lib/module/components/toast/useIOToast.js +84 -0
- package/lib/module/components/toast/useIOToast.js.map +1 -0
- package/lib/module/components/typography/BaseTypography.js +3 -1
- package/lib/module/components/typography/BaseTypography.js.map +1 -1
- package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +31 -0
- package/lib/module/core/IOStyles.js +10 -0
- package/lib/module/core/IOStyles.js.map +1 -1
- package/lib/module/core/IOTransitions.js +98 -0
- package/lib/module/core/IOTransitions.js.map +1 -0
- package/lib/module/core/index.js +1 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts +5 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/icons/Icon.d.ts +3 -0
- package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconDocPaymentCode.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconDocPaymentCode.d.ts.map +1 -0
- package/lib/typescript/components/icons/svg/IconEntityCode.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconEntityCode.d.ts.map +1 -0
- package/lib/typescript/components/icons/svg/IconNotes.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconNotes.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/layout/Dismissable.d.ts +18 -0
- package/lib/typescript/components/layout/Dismissable.d.ts.map +1 -0
- package/lib/typescript/components/layout/FooterWithButtons.d.ts +4 -1
- package/lib/typescript/components/layout/FooterWithButtons.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts +28 -5
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts +8 -3
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/common.d.ts +4 -0
- package/lib/typescript/components/layout/common.d.ts.map +1 -0
- package/lib/typescript/components/layout/index.d.ts +1 -0
- package/lib/typescript/components/layout/index.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts +2 -1
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
- package/lib/typescript/components/loadingSpinner/LoadingSpinner.d.ts +17 -0
- package/lib/typescript/components/loadingSpinner/LoadingSpinner.d.ts.map +1 -0
- package/lib/typescript/components/loadingSpinner/index.d.ts +2 -0
- package/lib/typescript/components/loadingSpinner/index.d.ts.map +1 -0
- package/lib/typescript/components/logos/LogoPaymentCard.d.ts +19 -0
- package/lib/typescript/components/logos/LogoPaymentCard.d.ts.map +1 -0
- package/lib/typescript/components/logos/index.d.ts +2 -0
- package/lib/typescript/components/logos/index.d.ts.map +1 -1
- package/lib/typescript/components/logos/svg/LogoPaymentCardBancomatPay.d.ts +5 -0
- package/lib/typescript/components/logos/svg/LogoPaymentCardBancomatPay.d.ts.map +1 -0
- package/lib/typescript/components/logos/svg/LogoPaymentCardPayPal.d.ts +5 -0
- package/lib/typescript/components/logos/svg/LogoPaymentCardPayPal.d.ts.map +1 -0
- package/lib/typescript/components/pictograms/Pictogram.d.ts +2 -1
- package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/svg/PictogramBleedNotification.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramBleedNotification.d.ts.map +1 -0
- package/lib/typescript/components/pictograms/svg/PictogramNotification.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramNotification.d.ts.map +1 -0
- package/lib/typescript/components/radio/RadioGroup.d.ts +2 -2
- package/lib/typescript/components/radio/RadioGroup.d.ts.map +1 -1
- package/lib/typescript/components/toast/ToastNotification.d.ts +6 -0
- package/lib/typescript/components/toast/ToastNotification.d.ts.map +1 -0
- package/lib/typescript/components/toast/ToastProvider.d.ts +22 -0
- package/lib/typescript/components/toast/ToastProvider.d.ts.map +1 -0
- package/lib/typescript/components/toast/context.d.ts +9 -0
- package/lib/typescript/components/toast/context.d.ts.map +1 -0
- package/lib/typescript/components/toast/index.d.ts +4 -0
- package/lib/typescript/components/toast/index.d.ts.map +1 -0
- package/lib/typescript/components/toast/types.d.ts +11 -0
- package/lib/typescript/components/toast/types.d.ts.map +1 -0
- package/lib/typescript/components/toast/useIOToast.d.ts +23 -0
- package/lib/typescript/components/toast/useIOToast.d.ts.map +1 -0
- package/lib/typescript/core/IOStyles.d.ts +10 -0
- package/lib/typescript/core/IOStyles.d.ts.map +1 -1
- package/lib/typescript/core/IOTransitions.d.ts +58 -0
- package/lib/typescript/core/IOTransitions.d.ts.map +1 -0
- package/lib/typescript/core/index.d.ts +1 -0
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/stories/ButtonDS.stories.d.ts +1 -1
- package/package.json +3 -1
- package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -0
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -0
- package/src/components/buttons/ButtonLink.tsx +2 -4
- package/src/components/buttons/ButtonOutline.tsx +3 -4
- package/src/components/buttons/ButtonSolid.tsx +68 -24
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +52 -26
- package/src/components/icons/Icon.tsx +6 -0
- package/src/components/icons/svg/IconDocPaymentCode.tsx +16 -0
- package/src/components/icons/svg/IconEntityCode.tsx +16 -0
- package/src/components/icons/svg/IconNotes.tsx +16 -0
- package/src/components/icons/svg/originals/IconDocPaymentCode.svg +3 -0
- package/src/components/icons/svg/originals/IconEntityCode.svg +3 -0
- package/src/components/icons/svg/originals/IconNotes.svg +3 -0
- package/src/components/index.tsx +2 -0
- package/src/components/layout/BlockButtons.tsx +1 -1
- package/src/components/layout/Dismissable.tsx +76 -0
- package/src/components/layout/FooterWithButtons.tsx +11 -5
- package/src/components/layout/HeaderFirstLevel.tsx +41 -13
- package/src/components/layout/HeaderSecondLevel.tsx +30 -26
- package/src/components/layout/common.ts +7 -0
- package/src/components/layout/index.tsx +1 -0
- package/src/components/listitems/ListItemTransaction.tsx +7 -5
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +2 -0
- package/src/components/loadingSpinner/LoadingSpinner.tsx +121 -0
- package/src/components/loadingSpinner/index.tsx +1 -0
- package/src/components/logos/LogoPaymentCard.tsx +62 -0
- package/src/components/logos/LogoPaymentExt.tsx +1 -1
- package/src/components/logos/README.md +2 -1
- package/src/components/logos/index.tsx +2 -0
- package/src/components/logos/svg/LogoPaymentCardBancomatPay.tsx +28 -0
- package/src/components/logos/svg/LogoPaymentCardPayPal.tsx +38 -0
- package/src/components/logos/svg/originals/LogoPaymentCardBancomatPay.svg +18 -0
- package/src/components/logos/svg/originals/LogoPaymentCardPayPal.svg +30 -0
- package/src/components/pictograms/Pictogram.tsx +7 -2
- package/src/components/pictograms/svg/PictogramBleedNotification.tsx +42 -0
- package/src/components/pictograms/svg/PictogramNotification.tsx +42 -0
- package/src/components/pictograms/svg/originals/PictogramBleedNotification.svg +30 -0
- package/src/components/pictograms/svg/originals/PictogramNotification.svg +30 -0
- package/src/components/radio/RadioGroup.tsx +2 -2
- package/src/components/toast/ToastNotification.tsx +76 -0
- package/src/components/toast/ToastProvider.tsx +153 -0
- package/src/components/toast/context.ts +14 -0
- package/src/components/toast/index.ts +3 -0
- package/src/components/toast/types.ts +13 -0
- package/src/components/toast/useIOToast.ts +88 -0
- package/src/components/typography/BaseTypography.tsx +1 -1
- package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +31 -0
- package/src/core/IOStyles.ts +10 -0
- package/src/core/IOTransitions.ts +94 -0
- package/src/core/index.ts +1 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Toast } from "./types";
|
|
3
|
+
type Props = Pick<Toast, "message" | "variant" | "icon">;
|
|
4
|
+
declare const ToastNotification: ({ message, variant, icon }: Props) => React.JSX.Element;
|
|
5
|
+
export { ToastNotification };
|
|
6
|
+
//# sourceMappingURL=ToastNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastNotification.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/ToastNotification.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,KAAK,EAAgB,MAAM,SAAS,CAAC;AA8B9C,KAAK,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC,CAAC;AAEzD,QAAA,MAAM,iBAAiB,+BAA4C,KAAK,sBAsBvE,CAAC;AAgBF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The maximum number of toasts that can be displayed at the same time
|
|
4
|
+
* If the number of the toasts exceeds this number, the oldest one will be removed
|
|
5
|
+
*/
|
|
6
|
+
export declare const MAX_TOAST_STACK_SIZE = 3;
|
|
7
|
+
/**
|
|
8
|
+
* The time in milliseconds that a toast notification will be displayed
|
|
9
|
+
*/
|
|
10
|
+
export declare const TOAST_DURATION_TIME = 5000;
|
|
11
|
+
/**
|
|
12
|
+
* This is the time in milliseconds between two toast notifications.
|
|
13
|
+
* This will throttle the toast notifications to avoid displaying too many of them at the same time
|
|
14
|
+
* and causing visual glitches.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TOAST_THROTTLE_TIME = 500;
|
|
17
|
+
type ToastProviderProps = {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export declare const ToastProvider: ({ children }: ToastProviderProps) => React.JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=ToastProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/ToastProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B;;;GAGG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAyBvC,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,aAAa,iBAAkB,kBAAkB,sBAqE7D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Toast } from "./types";
|
|
3
|
+
export type ToastContext = {
|
|
4
|
+
addToast: (props: Toast) => number;
|
|
5
|
+
removeToast: (id: number) => void;
|
|
6
|
+
removeAllToasts: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const ToastContext: import("react").Context<ToastContext>;
|
|
9
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/context.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;IACnC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,YAAY,uCAIvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HapticFeedbackTypes } from "react-native-haptic-feedback";
|
|
2
|
+
import { IOIcons } from "@pagopa/io-app-design-system";
|
|
3
|
+
export type ToastVariant = "neutral" | "error" | "info" | "success" | "warning";
|
|
4
|
+
export type Toast = {
|
|
5
|
+
message: string;
|
|
6
|
+
variant?: ToastVariant;
|
|
7
|
+
icon?: IOIcons;
|
|
8
|
+
hapticFeedback?: keyof typeof HapticFeedbackTypes;
|
|
9
|
+
};
|
|
10
|
+
export type ToastOptions = Omit<Toast, "message">;
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEhF,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ToastOptions } from "./types";
|
|
3
|
+
export declare const useIOToast: () => {
|
|
4
|
+
show: (message: string, options?: ToastOptions) => void;
|
|
5
|
+
error: (message: string) => void;
|
|
6
|
+
info: (message: string) => void;
|
|
7
|
+
success: (message: string) => void;
|
|
8
|
+
warning: (message: string) => void;
|
|
9
|
+
hide: (id: number) => void;
|
|
10
|
+
hideAll: () => void;
|
|
11
|
+
};
|
|
12
|
+
export type IOToast = ReturnType<typeof useIOToast>;
|
|
13
|
+
export declare const IOToastRef: React.MutableRefObject<{
|
|
14
|
+
show: (message: string, options?: ToastOptions) => void;
|
|
15
|
+
error: (message: string) => void;
|
|
16
|
+
info: (message: string) => void;
|
|
17
|
+
success: (message: string) => void;
|
|
18
|
+
warning: (message: string) => void;
|
|
19
|
+
hide: (id: number) => void;
|
|
20
|
+
hideAll: () => void;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const IOToast: IOToast;
|
|
23
|
+
//# sourceMappingURL=useIOToast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIOToast.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/useIOToast.ts"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,eAAO,MAAM,UAAU;oBAKT,MAAM,YAAY,YAAY;qBAO9B,MAAM;oBAWN,MAAM;uBAWN,MAAM;uBAWN,MAAM;;;CAsBnB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,UAAU;oBAlET,MAAM,YAAY,YAAY;qBAO9B,MAAM;oBAWN,MAAM;uBAWN,MAAM;uBAWN,MAAM;;;EA2BqC,CAAC;AAE1D,eAAO,MAAM,OAAO,EAAE,OASrB,CAAC"}
|
|
@@ -72,6 +72,11 @@ export declare const IOButtonLegacyStyles: {
|
|
|
72
72
|
paddingHorizontal: number;
|
|
73
73
|
elevation: number;
|
|
74
74
|
};
|
|
75
|
+
buttonInner: {
|
|
76
|
+
flexDirection: "row";
|
|
77
|
+
alignItems: "center";
|
|
78
|
+
justifyContent: "center";
|
|
79
|
+
};
|
|
75
80
|
label: {
|
|
76
81
|
alignSelf: "center";
|
|
77
82
|
};
|
|
@@ -92,6 +97,11 @@ export declare const IOButtonStyles: {
|
|
|
92
97
|
paddingHorizontal: number;
|
|
93
98
|
elevation: number;
|
|
94
99
|
};
|
|
100
|
+
buttonInner: {
|
|
101
|
+
flexDirection: "row";
|
|
102
|
+
alignItems: "center";
|
|
103
|
+
justifyContent: "center";
|
|
104
|
+
};
|
|
95
105
|
buttonLink: {
|
|
96
106
|
flexDirection: "row";
|
|
97
107
|
alignItems: "center";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IOStyles.d.ts","sourceRoot":"","sources":["../../../src/core/IOStyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEpE;;GAEG;AAEH,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,WAAW,CAAC;IAE9B,YAAY,EAAE,MAAM,CAAC;IAErB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,wBAAwB,EAAE,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,gBAAgB,EAAE,gBAM9B,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDnB,CAAC;AAeH,eAAO,MAAM,iBAAiB,EAAE,MAAuB,CAAC;AAGxD,eAAO,MAAM,gBAAgB,EAAE,MAAW,CAAC;AAE3C,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"IOStyles.d.ts","sourceRoot":"","sources":["../../../src/core/IOStyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEpE;;GAEG;AAEH,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,WAAW,CAAC;IAE9B,YAAY,EAAE,MAAM,CAAC;IAErB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,wBAAwB,EAAE,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,gBAAgB,EAAE,gBAM9B,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDnB,CAAC;AAeH,eAAO,MAAM,iBAAiB,EAAE,MAAuB,CAAC;AAGxD,eAAO,MAAM,gBAAgB,EAAE,MAAW,CAAC;AAE3C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;CAsC/B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDzB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;CAsB7B,CAAC;AAEH;;GAEG;AAEH,UAAU,sBAAsB;IAC9B,eAAe,EAAE,cAAc,CAAC;IAChC,iBAAiB,EAAE,WAAW,CAAC;IAC/B,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,cAAc,CAAC;IAC7B,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,eAAe,CAAC;CAC9B;AAED,eAAO,MAAM,sBAAsB,EAAE,sBAOpC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;CAW3B,CAAC;AAEH;;GAEG;AAEH,UAAU,2BAA2B;IACnC,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,QAAQ,CAAC;IAC9B,cAAc,EAAE,QAAQ,CAAC;IACzB,SAAS,EAAE,QAAQ,CAAC;CACrB;AAED,UAAU,oBAAoB;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,QAAQ,CAAC;IAC1B,cAAc,EAAE,QAAQ,CAAC;IACzB,SAAS,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,iCAAiC;IACzC,mBAAmB,EAAE,QAAQ,CAAC;IAC9B,cAAc,EAAE,QAAQ,CAAC;CAC1B;AAED,eAAO,MAAM,2BAA2B,EAAE,2BAMzC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,oBASlC,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,iCAI7C,CAAC;AAEJ,UAAU,+BAA+B;IACvC,eAAe,EAAE,cAAc,CAAC;IAChC,iBAAiB,EAAE,WAAW,CAAC;IAC/B,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,QAAQ,CAAC;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,iBAAiB,EAAE,QAAQ,CAAC;CAC7B;AAED,eAAO,MAAM,+BAA+B,EAAE,+BAQ3C,CAAC;AAEJ,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAWpC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
A custom enter transition designed for the average size
|
|
3
|
+
inner content of a button or module (e.g. text).
|
|
4
|
+
The scaling effect is slight.
|
|
5
|
+
*/
|
|
6
|
+
export declare const enterTransitionInnerContent: () => {
|
|
7
|
+
initialValues: {
|
|
8
|
+
opacity: number;
|
|
9
|
+
transform: {
|
|
10
|
+
scale: number;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
animations: {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
transform: {
|
|
16
|
+
scale: 1;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
A custom enter transition designed for the small size
|
|
22
|
+
inner content of a button or module (e.g. loading spinner).
|
|
23
|
+
The scaling effect is accentuated.
|
|
24
|
+
*/
|
|
25
|
+
export declare const enterTransitionInnerContentSmall: () => {
|
|
26
|
+
initialValues: {
|
|
27
|
+
opacity: number;
|
|
28
|
+
transform: {
|
|
29
|
+
scale: number;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
animations: {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
transform: {
|
|
35
|
+
scale: 1;
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
A custom exit transition designed for both small
|
|
41
|
+
and average size inner content of a button or module.
|
|
42
|
+
The scaling effect is slight.
|
|
43
|
+
*/
|
|
44
|
+
export declare const exitTransitionInnerContent: () => {
|
|
45
|
+
initialValues: {
|
|
46
|
+
opacity: number;
|
|
47
|
+
transform: {
|
|
48
|
+
scale: number;
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
animations: {
|
|
52
|
+
opacity: 0;
|
|
53
|
+
transform: {
|
|
54
|
+
scale: 0.9;
|
|
55
|
+
}[];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=IOTransitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IOTransitions.d.ts","sourceRoot":"","sources":["../../../src/core/IOTransitions.ts"],"names":[],"mappings":"AAEA;;;;EAIE;AACF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;CAwBvC,CAAC;AAEF;;;;EAIE;AACF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;CAwB5C,CAAC;AAEF;;;;EAIE;AACF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;CAwBtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { StoryObj } from "@storybook/react";
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: import("react").MemoExoticComponent<({ color, label, fullWidth, disabled, icon, iconPosition, onPress, accessibilityLabel, accessibilityHint, testID }: import("../components").ButtonSolidProps) => import("react").JSX.Element>;
|
|
5
|
+
component: import("react").MemoExoticComponent<({ color, label, fullWidth, disabled, loading, icon, iconPosition, onPress, accessibilityLabel, accessibilityHint, testID }: import("../components").ButtonSolidProps) => import("react").JSX.Element>;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagopa/io-app-design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
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",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"@storybook/react-webpack5": "^7.4.0",
|
|
68
68
|
"@storybook/testing-library": "^0.2.0",
|
|
69
69
|
"@types/jest": "^28.1.2",
|
|
70
|
+
"@types/lodash": "^4.14.157",
|
|
70
71
|
"@types/react": "~17.0.38",
|
|
71
72
|
"@types/react-native": "0.70.0",
|
|
72
73
|
"babel-loader": "^9.1.3",
|
|
@@ -170,6 +171,7 @@
|
|
|
170
171
|
]
|
|
171
172
|
},
|
|
172
173
|
"dependencies": {
|
|
174
|
+
"lodash": "^4.17.21",
|
|
173
175
|
"@expo/vector-icons": "^13.0.0",
|
|
174
176
|
"@pagopa/ts-commons": "^12.0.0",
|
|
175
177
|
"@testing-library/jest-native": "^5.4.2",
|
|
@@ -70,6 +70,7 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
|
|
|
70
70
|
}
|
|
71
71
|
>
|
|
72
72
|
<Text
|
|
73
|
+
allowFontScaling={false}
|
|
73
74
|
color="blueIO-850"
|
|
74
75
|
defaultColor="black"
|
|
75
76
|
defaultWeight="SemiBold"
|
|
@@ -184,7 +185,9 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
|
|
|
184
185
|
}
|
|
185
186
|
>
|
|
186
187
|
<Text
|
|
188
|
+
allowFontScaling={false}
|
|
187
189
|
ellipsizeMode="tail"
|
|
190
|
+
maxFontSizeMultiplier={1.3}
|
|
188
191
|
numberOfLines={1}
|
|
189
192
|
style={
|
|
190
193
|
[
|
|
@@ -236,10 +236,8 @@ export const ButtonLink = React.memo(
|
|
|
236
236
|
]}
|
|
237
237
|
numberOfLines={1}
|
|
238
238
|
ellipsizeMode="tail"
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
/* allowFontScaling
|
|
242
|
-
maxFontSizeMultiplier={1.3} */
|
|
239
|
+
allowFontScaling={isExperimental}
|
|
240
|
+
maxFontSizeMultiplier={1.3}
|
|
243
241
|
>
|
|
244
242
|
{label}
|
|
245
243
|
</Animated.Text>
|
|
@@ -332,6 +332,7 @@ export const ButtonOutline = ({
|
|
|
332
332
|
<Animated.View
|
|
333
333
|
style={[
|
|
334
334
|
buttonStyles.button,
|
|
335
|
+
isExperimental && fullWidth && { paddingHorizontal: 16 },
|
|
335
336
|
buttonStylesLocal.buttonWithBorder,
|
|
336
337
|
buttonStyles.buttonSizeDefault,
|
|
337
338
|
iconPosition === "end" && { flexDirection: "row-reverse" },
|
|
@@ -380,10 +381,8 @@ export const ButtonOutline = ({
|
|
|
380
381
|
]}
|
|
381
382
|
numberOfLines={1}
|
|
382
383
|
ellipsizeMode="tail"
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
/* allowFontScaling
|
|
386
|
-
maxFontSizeMultiplier={1.3} */
|
|
384
|
+
allowFontScaling={isExperimental}
|
|
385
|
+
maxFontSizeMultiplier={1.3}
|
|
387
386
|
>
|
|
388
387
|
{label}
|
|
389
388
|
</Animated.Text>
|
|
@@ -9,6 +9,7 @@ import Animated, {
|
|
|
9
9
|
useSharedValue,
|
|
10
10
|
withSpring
|
|
11
11
|
} from "react-native-reanimated";
|
|
12
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
12
13
|
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
|
|
13
14
|
import { WithTestID } from "../../utils/types";
|
|
14
15
|
import { HSpacer } from "../spacer/Spacer";
|
|
@@ -19,8 +20,12 @@ import {
|
|
|
19
20
|
IOColors,
|
|
20
21
|
IOScaleValues,
|
|
21
22
|
IOSpringValues,
|
|
23
|
+
enterTransitionInnerContent,
|
|
24
|
+
enterTransitionInnerContentSmall,
|
|
25
|
+
exitTransitionInnerContent,
|
|
22
26
|
useIOExperimentalDesign
|
|
23
27
|
} from "../../core";
|
|
28
|
+
import { LoadingSpinner } from "../loadingSpinner";
|
|
24
29
|
|
|
25
30
|
type ButtonSolidColor = "primary" | "danger" | "contrast";
|
|
26
31
|
|
|
@@ -65,6 +70,10 @@ export type ButtonSolidProps = WithTestID<{
|
|
|
65
70
|
* @default false
|
|
66
71
|
*/
|
|
67
72
|
fullWidth?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
loading?: boolean;
|
|
68
77
|
/**
|
|
69
78
|
* @default false
|
|
70
79
|
*/
|
|
@@ -152,6 +161,7 @@ export const ButtonSolid = React.memo(
|
|
|
152
161
|
label,
|
|
153
162
|
fullWidth = false,
|
|
154
163
|
disabled = false,
|
|
164
|
+
loading = false,
|
|
155
165
|
icon,
|
|
156
166
|
iconPosition = "start",
|
|
157
167
|
onPress,
|
|
@@ -211,6 +221,19 @@ export const ButtonSolid = React.memo(
|
|
|
211
221
|
isPressed.value = 0;
|
|
212
222
|
}, [isPressed]);
|
|
213
223
|
|
|
224
|
+
const handleOnPress = useCallback(
|
|
225
|
+
(event: GestureResponderEvent) => {
|
|
226
|
+
/* Don't call `onPress` if the button is
|
|
227
|
+
in loading state */
|
|
228
|
+
if (loading) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
ReactNativeHapticFeedback.trigger("impactLight");
|
|
232
|
+
onPress(event);
|
|
233
|
+
},
|
|
234
|
+
[loading, onPress]
|
|
235
|
+
);
|
|
236
|
+
|
|
214
237
|
// Label & Icons colors
|
|
215
238
|
const foregroundColor: IOColors = disabled
|
|
216
239
|
? colorMap[color]?.label?.disabled
|
|
@@ -218,21 +241,23 @@ export const ButtonSolid = React.memo(
|
|
|
218
241
|
|
|
219
242
|
return (
|
|
220
243
|
<Pressable
|
|
244
|
+
testID={testID}
|
|
245
|
+
accessible={true}
|
|
221
246
|
accessibilityLabel={accessibilityLabel}
|
|
222
247
|
accessibilityHint={accessibilityHint}
|
|
248
|
+
accessibilityState={{ busy: loading }}
|
|
223
249
|
accessibilityRole={"button"}
|
|
224
|
-
|
|
225
|
-
onPress={onPress}
|
|
250
|
+
onPress={handleOnPress}
|
|
226
251
|
onPressIn={onPressIn}
|
|
227
252
|
onPressOut={onPressOut}
|
|
228
|
-
accessible={true}
|
|
229
253
|
disabled={disabled}
|
|
230
254
|
style={!fullWidth ? IOButtonStyles.dimensionsDefault : {}}
|
|
231
255
|
>
|
|
232
256
|
<Animated.View
|
|
233
257
|
style={[
|
|
234
258
|
buttonStyles.button,
|
|
235
|
-
|
|
259
|
+
{ overflow: "hidden" },
|
|
260
|
+
isExperimental && fullWidth && { paddingHorizontal: 16 },
|
|
236
261
|
buttonStyles.buttonSizeDefault,
|
|
237
262
|
disabled
|
|
238
263
|
? isExperimental
|
|
@@ -240,32 +265,51 @@ export const ButtonSolid = React.memo(
|
|
|
240
265
|
: legacyStyles.backgroundDisabled
|
|
241
266
|
: { backgroundColor: colorMap[color]?.default },
|
|
242
267
|
/* Prevent Reanimated from overriding background colors
|
|
243
|
-
|
|
268
|
+
if button is disabled */
|
|
244
269
|
!disabled && pressedAnimationStyle
|
|
245
270
|
]}
|
|
246
271
|
>
|
|
247
|
-
{
|
|
248
|
-
|
|
249
|
-
{
|
|
272
|
+
{loading && (
|
|
273
|
+
<Animated.View
|
|
274
|
+
style={buttonStyles.buttonInner}
|
|
275
|
+
entering={enterTransitionInnerContentSmall}
|
|
276
|
+
exiting={exitTransitionInnerContent}
|
|
277
|
+
>
|
|
278
|
+
<LoadingSpinner color={foregroundColor} />
|
|
279
|
+
</Animated.View>
|
|
280
|
+
)}
|
|
281
|
+
|
|
282
|
+
{!loading && (
|
|
283
|
+
<Animated.View
|
|
284
|
+
style={[
|
|
285
|
+
buttonStyles.buttonInner,
|
|
286
|
+
iconPosition === "end" && { flexDirection: "row-reverse" }
|
|
287
|
+
]}
|
|
288
|
+
entering={enterTransitionInnerContent}
|
|
289
|
+
exiting={exitTransitionInnerContent}
|
|
290
|
+
>
|
|
291
|
+
{icon && (
|
|
292
|
+
<>
|
|
293
|
+
{/* If 'iconPosition' is set to 'end', we use
|
|
250
294
|
reverse flex property to invert the position */}
|
|
251
|
-
|
|
252
|
-
|
|
295
|
+
<Icon name={icon} size={iconSize} color={foregroundColor} />
|
|
296
|
+
{/* Once we have support for 'gap' property,
|
|
253
297
|
we can get rid of that spacer */}
|
|
254
|
-
|
|
255
|
-
|
|
298
|
+
<HSpacer size={8} />
|
|
299
|
+
</>
|
|
300
|
+
)}
|
|
301
|
+
<ButtonText
|
|
302
|
+
color={foregroundColor}
|
|
303
|
+
style={IOButtonStyles.label}
|
|
304
|
+
numberOfLines={1}
|
|
305
|
+
ellipsizeMode="tail"
|
|
306
|
+
allowFontScaling={isExperimental}
|
|
307
|
+
maxFontSizeMultiplier={1.3}
|
|
308
|
+
>
|
|
309
|
+
{label}
|
|
310
|
+
</ButtonText>
|
|
311
|
+
</Animated.View>
|
|
256
312
|
)}
|
|
257
|
-
<ButtonText
|
|
258
|
-
color={foregroundColor}
|
|
259
|
-
style={IOButtonStyles.label}
|
|
260
|
-
numberOfLines={1}
|
|
261
|
-
ellipsizeMode="tail"
|
|
262
|
-
/* A11y-related props:
|
|
263
|
-
DON'T UNCOMMENT THEM */
|
|
264
|
-
/* allowFontScaling
|
|
265
|
-
maxFontSizeMultiplier={1.3} */
|
|
266
|
-
>
|
|
267
|
-
{label}
|
|
268
|
-
</ButtonText>
|
|
269
313
|
</Animated.View>
|
|
270
314
|
</Pressable>
|
|
271
315
|
);
|
|
@@ -67,6 +67,7 @@ exports[`Test Buttons Components ButtonExtendedOutline Snapshot 1`] = `
|
|
|
67
67
|
}
|
|
68
68
|
>
|
|
69
69
|
<Text
|
|
70
|
+
allowFontScaling={false}
|
|
70
71
|
color="black"
|
|
71
72
|
defaultColor="black"
|
|
72
73
|
defaultWeight="SemiBold"
|
|
@@ -232,7 +233,9 @@ exports[`Test Buttons Components ButtonLink Snapshot 1`] = `
|
|
|
232
233
|
}
|
|
233
234
|
>
|
|
234
235
|
<Text
|
|
236
|
+
allowFontScaling={false}
|
|
235
237
|
ellipsizeMode="tail"
|
|
238
|
+
maxFontSizeMultiplier={1.3}
|
|
236
239
|
numberOfLines={1}
|
|
237
240
|
style={
|
|
238
241
|
[
|
|
@@ -308,6 +311,7 @@ exports[`Test Buttons Components ButtonOutline Snapshot 1`] = `
|
|
|
308
311
|
"paddingHorizontal": 16,
|
|
309
312
|
"textAlignVertical": "center",
|
|
310
313
|
},
|
|
314
|
+
false,
|
|
311
315
|
{
|
|
312
316
|
"borderWidth": 1,
|
|
313
317
|
},
|
|
@@ -332,7 +336,9 @@ exports[`Test Buttons Components ButtonOutline Snapshot 1`] = `
|
|
|
332
336
|
}
|
|
333
337
|
>
|
|
334
338
|
<Text
|
|
339
|
+
allowFontScaling={false}
|
|
335
340
|
ellipsizeMode="tail"
|
|
341
|
+
maxFontSizeMultiplier={1.3}
|
|
336
342
|
numberOfLines={1}
|
|
337
343
|
style={
|
|
338
344
|
[
|
|
@@ -365,7 +371,7 @@ exports[`Test Buttons Components ButtonSolid Snapshot 1`] = `
|
|
|
365
371
|
accessibilityRole="button"
|
|
366
372
|
accessibilityState={
|
|
367
373
|
{
|
|
368
|
-
"busy":
|
|
374
|
+
"busy": false,
|
|
369
375
|
"checked": undefined,
|
|
370
376
|
"disabled": false,
|
|
371
377
|
"expanded": undefined,
|
|
@@ -410,6 +416,9 @@ exports[`Test Buttons Components ButtonSolid Snapshot 1`] = `
|
|
|
410
416
|
"paddingHorizontal": 16,
|
|
411
417
|
"textAlignVertical": "center",
|
|
412
418
|
},
|
|
419
|
+
{
|
|
420
|
+
"overflow": "hidden",
|
|
421
|
+
},
|
|
413
422
|
false,
|
|
414
423
|
{
|
|
415
424
|
"height": 40,
|
|
@@ -428,38 +437,55 @@ exports[`Test Buttons Components ButtonSolid Snapshot 1`] = `
|
|
|
428
437
|
]
|
|
429
438
|
}
|
|
430
439
|
>
|
|
431
|
-
<
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
defaultWeight="Bold"
|
|
435
|
-
ellipsizeMode="tail"
|
|
436
|
-
font="TitilliumWeb"
|
|
437
|
-
fontStyle={
|
|
438
|
-
{
|
|
439
|
-
"fontSize": 16,
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
numberOfLines={1}
|
|
440
|
+
<View
|
|
441
|
+
entering={[Function]}
|
|
442
|
+
exiting={[Function]}
|
|
443
443
|
style={
|
|
444
444
|
[
|
|
445
445
|
{
|
|
446
|
-
"
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
"fontSize": 16,
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
"color": "#FFFFFF",
|
|
453
|
-
"fontFamily": "Titillium Web",
|
|
454
|
-
"fontStyle": "normal",
|
|
455
|
-
"fontWeight": "700",
|
|
446
|
+
"alignItems": "center",
|
|
447
|
+
"flexDirection": "row",
|
|
448
|
+
"justifyContent": "center",
|
|
456
449
|
},
|
|
450
|
+
false,
|
|
457
451
|
]
|
|
458
452
|
}
|
|
459
|
-
weight="Bold"
|
|
460
453
|
>
|
|
461
|
-
|
|
462
|
-
|
|
454
|
+
<Text
|
|
455
|
+
allowFontScaling={false}
|
|
456
|
+
color="white"
|
|
457
|
+
defaultColor="white"
|
|
458
|
+
defaultWeight="Bold"
|
|
459
|
+
ellipsizeMode="tail"
|
|
460
|
+
font="TitilliumWeb"
|
|
461
|
+
fontStyle={
|
|
462
|
+
{
|
|
463
|
+
"fontSize": 16,
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
maxFontSizeMultiplier={1.3}
|
|
467
|
+
numberOfLines={1}
|
|
468
|
+
style={
|
|
469
|
+
[
|
|
470
|
+
{
|
|
471
|
+
"alignSelf": "center",
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"fontSize": 16,
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"color": "#FFFFFF",
|
|
478
|
+
"fontFamily": "Titillium Web",
|
|
479
|
+
"fontStyle": "normal",
|
|
480
|
+
"fontWeight": "700",
|
|
481
|
+
},
|
|
482
|
+
]
|
|
483
|
+
}
|
|
484
|
+
weight="Bold"
|
|
485
|
+
>
|
|
486
|
+
label
|
|
487
|
+
</Text>
|
|
488
|
+
</View>
|
|
463
489
|
</View>
|
|
464
490
|
</View>
|
|
465
491
|
`;
|
|
@@ -157,6 +157,9 @@ import IconContactless from "./svg/IconContactless";
|
|
|
157
157
|
import IconDisabilityCard from "./svg/IconDisabilityCard";
|
|
158
158
|
import IconDriverLicense from "./svg/IconDriverLicense";
|
|
159
159
|
import IconHealthCard from "./svg/IconHealthCard";
|
|
160
|
+
import IconDocPaymentCode from "./svg/IconDocPaymentCode";
|
|
161
|
+
import IconNotes from "./svg/IconNotes";
|
|
162
|
+
import IconEntityCode from "./svg/IconEntityCode";
|
|
160
163
|
|
|
161
164
|
export const IOIcons = {
|
|
162
165
|
archive: IconArchive,
|
|
@@ -200,13 +203,16 @@ export const IOIcons = {
|
|
|
200
203
|
option: IconOption,
|
|
201
204
|
key: IconKey,
|
|
202
205
|
docGiacenza: IconGiacenza,
|
|
206
|
+
docPaymentCode: IconDocPaymentCode,
|
|
203
207
|
docAttach: IconDocumentAttachment,
|
|
204
208
|
docAttachPDF: IconDocumentAttachmentPDF,
|
|
209
|
+
notes: IconNotes,
|
|
205
210
|
attachment: IconAttachment,
|
|
206
211
|
add: IconAdd,
|
|
207
212
|
success: IconSuccess,
|
|
208
213
|
ok: IconOk,
|
|
209
214
|
fiscalCodeIndividual: IconFiscalCodeIndividual,
|
|
215
|
+
entityCode: IconEntityCode,
|
|
210
216
|
creditCard: IconCreditCard,
|
|
211
217
|
bonus: IconBonus,
|
|
212
218
|
transactionsBoxed: IconTransactionsBoxed,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Svg, Path } from "react-native-svg";
|
|
3
|
+
import { SVGIconProps } from "../Icon";
|
|
4
|
+
|
|
5
|
+
const IconDocPaymentCode = ({ size, style, ...props }: SVGIconProps) => (
|
|
6
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" style={style} {...props}>
|
|
7
|
+
<Path
|
|
8
|
+
fillRule="evenodd"
|
|
9
|
+
clipRule="evenodd"
|
|
10
|
+
d="M5 2C3.34315 2 2 3.34315 2 5V19C2 20.6569 3.34315 22 5 22H19C20.6569 22 22 20.6569 22 19V10H17C15.3431 10 14 8.65685 14 7V2H5ZM16 2.49902V7C16 7.55229 16.4477 8 17 8H21.501C21.3911 7.83409 21.2641 7.67835 21.1213 7.53553L16.4645 2.87868C16.3216 2.73586 16.1659 2.60893 16 2.49902ZM0 5C0 2.23858 2.23858 0 5 0H14.3431C15.6692 0 16.941 0.526784 17.8787 1.46447L22.5355 6.12132C23.4732 7.059 24 8.33077 24 9.65685V19C24 21.7614 21.7614 24 19 24H5C2.23858 24 0 21.7614 0 19V5ZM5 17.5C5 16.6716 5.67157 16 6.5 16C7.32843 16 8 16.6716 8 17.5C8 18.3284 7.32843 19 6.5 19C5.67157 19 5 18.3284 5 17.5ZM10 17.5C10 16.6716 10.6716 16 11.5 16H14.5C15.3284 16 16 16.6716 16 17.5C16 18.3284 15.3284 19 14.5 19H11.5C10.6716 19 10 18.3284 10 17.5Z"
|
|
11
|
+
fill="currentColor"
|
|
12
|
+
/>
|
|
13
|
+
</Svg>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default IconDocPaymentCode;
|