@pagopa/selfcare-common-frontend 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/lib/components/BackComponent.d.ts +1 -1
  3. package/lib/components/CustomAlert.d.ts +1 -1
  4. package/lib/components/CustomAvatar.d.ts +2 -1
  5. package/lib/components/CustomPagination.d.ts +1 -1
  6. package/lib/components/EndingPage.d.ts +1 -1
  7. package/lib/components/ErrorBoundary/components/BlockingErrorPage.d.ts +1 -1
  8. package/lib/components/FilterModal.d.ts +1 -1
  9. package/lib/components/Footer/Footer.d.ts +1 -1
  10. package/lib/components/Header/Header.d.ts +1 -1
  11. package/lib/components/Loading/LoadingOverlay.d.ts +1 -1
  12. package/lib/components/LoadingOverlayComponent.d.ts +1 -1
  13. package/lib/components/LoadingOverlayComponent.js +1 -2
  14. package/lib/components/NavigationBar.d.ts +1 -1
  15. package/lib/components/TitleBox.d.ts +1 -1
  16. package/lib/components/Toast.d.ts +1 -1
  17. package/lib/components/Toast.js +3 -4
  18. package/lib/components/ToastWrapper.d.ts +1 -1
  19. package/lib/components/UnloadEventHandler.d.ts +1 -1
  20. package/lib/components/UserNotifyHandle.d.ts +1 -1
  21. package/lib/components/icons/CheckIllustrationIcon.d.ts +1 -1
  22. package/lib/components/icons/ErrorIcon.d.ts +1 -1
  23. package/lib/components/icons/PagoPaIcon.d.ts +1 -1
  24. package/lib/components/icons/PagoPaIconColored.d.ts +1 -1
  25. package/lib/components/icons/PagoPaMiniIcon.d.ts +1 -1
  26. package/lib/config/env.d.ts +5 -0
  27. package/lib/config/env.js +6 -1
  28. package/lib/decorators/__mocks__/withLogin.d.ts +1 -1
  29. package/lib/hooks/useLiveAnnouncerWithRegion.d.ts +1 -1
  30. package/lib/hooks/useLogin.js +3 -1
  31. package/package.json +7 -9
  32. package/lib/common-polyfill.d.ts +0 -9
  33. package/lib/common-polyfill.js +0 -9
package/CHANGELOG.md CHANGED
@@ -4,7 +4,21 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- #### [v2.0.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.38.0...v2.0.0)
7
+ #### [v2.1.1](https://github.com/pagopa/selfcare-common-frontend/compare/v2.1.0...v2.1.1)
8
+
9
+ - [SELC-9128] feat: configuration OneTrust cookie consent [`#354`](https://github.com/pagopa/selfcare-common-frontend/pull/354)
10
+ - chore: release v2.1.0 [`#353`](https://github.com/pagopa/selfcare-common-frontend/pull/353)
11
+ - [SELC-9128] feat: configuration OneTrust cookie consent (#354) [`#9128`](https://pagopa.atlassian.net/browse/9128)
12
+
13
+ #### [v2.1.0](https://github.com/pagopa/selfcare-common-frontend/compare/v2.0.0...v2.1.0)
14
+
15
+ > 28 July 2026
16
+
17
+ - refactor: remove polyfills, update dependencies, and redesign AppExample layout [`#351`](https://github.com/pagopa/selfcare-common-frontend/pull/351)
18
+
19
+ ### [v2.0.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.38.0...v2.0.0)
20
+
21
+ > 28 July 2026
8
22
 
9
23
  #### [v1.38.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.37.0...v1.38.0)
10
24
 
@@ -3,5 +3,5 @@ type Props = {
3
3
  backLabel?: string;
4
4
  color?: string;
5
5
  };
6
- export default function BackComponent({ goBack, backLabel, color }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export default function BackComponent({ goBack, backLabel, color }: Props): import("react").JSX.Element;
7
7
  export {};
@@ -8,5 +8,5 @@ type AlertProps = {
8
8
  /** Additional custom styles */
9
9
  sx?: object;
10
10
  };
11
- export default function CustomAlert({ text, severity, variant, sx, ...rest }: AlertProps): import("react/jsx-runtime").JSX.Element;
11
+ export default function CustomAlert({ text, severity, variant, sx, ...rest }: AlertProps): import("react").JSX.Element;
12
12
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  type Props = {
2
3
  /** The id attribute added to the element */
3
4
  id?: string;
@@ -13,5 +14,5 @@ type Props = {
13
14
  loading?: boolean;
14
15
  };
15
16
  /** Avatar to use to load Organization logo */
16
- export default function CustomAvatar({ customAlt, customSrc, customWidth, customHeight, id, loading, }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export default function CustomAvatar({ customAlt, customSrc, customWidth, customHeight, id, loading, }: Props): React.JSX.Element;
17
18
  export {};
@@ -14,5 +14,5 @@ type Props = {
14
14
  pageSizeControl?: React.ReactNode;
15
15
  };
16
16
  /** Selfcare custom table available pages component */
17
- export default function CustomPagination({ page, onPageRequest, sort, variant, pageSizeControl, }: Readonly<Props>): import("react/jsx-runtime").JSX.Element;
17
+ export default function CustomPagination({ page, onPageRequest, sort, variant, pageSizeControl, }: Readonly<Props>): React.JSX.Element;
18
18
  export {};
@@ -33,5 +33,5 @@ type Props = {
33
33
  haveTwoButtons?: boolean;
34
34
  };
35
35
  /** Selfcare's Ending Page */
36
- declare const _default: ({ minHeight, description, onButtonClick, onSecondButtonClick, icon, title, buttonLabel, variantTitle, variantDescription, paragraph, isParagraphPresent, haveTwoButtons, secondButtonLabel, variantFirstButton, variantSecondButton, }: Props) => import("react/jsx-runtime").JSX.Element;
36
+ declare const _default: ({ minHeight, description, onButtonClick, onSecondButtonClick, icon, title, buttonLabel, variantTitle, variantDescription, paragraph, isParagraphPresent, haveTwoButtons, secondButtonLabel, variantFirstButton, variantSecondButton, }: Props) => import("react").JSX.Element;
37
37
  export default _default;
@@ -3,5 +3,5 @@ type Props = {
3
3
  assistanceEmail?: string;
4
4
  minHeight?: '52vh' | '100vh';
5
5
  };
6
- declare const _default: ({ description, assistanceEmail, minHeight }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ declare const _default: ({ description, assistanceEmail, minHeight }: Props) => import("react").JSX.Element;
7
7
  export default _default;
@@ -24,5 +24,5 @@ export type FilterModalConfig<T, V> = {
24
24
  onFilterChange: (v: V) => void;
25
25
  };
26
26
  /** Modal used to show a list of values from which to choose a single value */
27
- export default function FilterModal({ open, handleClose, title, filterModalConfig, height, minHeight, }: Props): import("react/jsx-runtime").JSX.Element;
27
+ export default function FilterModal({ open, handleClose, title, filterModalConfig, height, minHeight, }: Props): React.JSX.Element;
28
28
  export {};
@@ -3,5 +3,5 @@ type FooterProps = {
3
3
  productsJsonUrl?: string;
4
4
  onExit?: (exitAction: () => void) => void;
5
5
  };
6
- export default function Footer({ loggedUser, productsJsonUrl, onExit, }: FooterProps): import("react/jsx-runtime").JSX.Element;
6
+ export default function Footer({ loggedUser, productsJsonUrl, onExit, }: FooterProps): import("react").JSX.Element;
7
7
  export {};
@@ -42,5 +42,5 @@ type HeaderProps = {
42
42
  fixedParty?: PartyEntity;
43
43
  };
44
44
  /** SelfCare Header component */
45
- declare const Header: ({ withSecondHeader, productsList, selectedPartyId, selectedProductId, partyList, loggedUser, assistanceEmail, enableLogin, userActions, enableDropdown, addSelfcareProduct, onExit, onSelectedProduct, onSelectedParty, maxCharactersNumberMultiLineButton, maxCharactersNumberMultiLineItem, enableAssistanceButton, onDocumentationClick, onLogoutClick, fixedParty, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
45
+ declare const Header: ({ withSecondHeader, productsList, selectedPartyId, selectedProductId, partyList, loggedUser, assistanceEmail, enableLogin, userActions, enableDropdown, addSelfcareProduct, onExit, onSelectedProduct, onSelectedParty, maxCharactersNumberMultiLineButton, maxCharactersNumberMultiLineItem, enableAssistanceButton, onDocumentationClick, onLogoutClick, fixedParty, }: HeaderProps) => import("react").JSX.Element;
46
46
  export default Header;
@@ -3,4 +3,4 @@ It allows to draw a loader when an async task to wait is running.
3
3
 
4
4
  To use this feature you have to put LoadingOverlay in your App as a child of a redux Provider component.
5
5
  In order to register the start of an async task you have to use the custom hook useLoading passing the id of the task to await, which will return a setter function used to start and end the loading behavior. */
6
- export default function LoadingOverlay(): import("react/jsx-runtime").JSX.Element;
6
+ export default function LoadingOverlay(): import("react").JSX.Element;
@@ -3,5 +3,5 @@ type Props = {
3
3
  loadingMessage?: string;
4
4
  };
5
5
  /** A component which render an overlay loading */
6
- export default function LoadingOverlayComponent({ open, loadingMessage }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export default function LoadingOverlayComponent({ open, loadingMessage }: Props): import("react").JSX.Element;
7
7
  export {};
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Modal, useTheme } from '@mui/material';
3
- import { Box } from '@mui/system';
2
+ import { Box, Modal, useTheme } from '@mui/material';
4
3
  import MDSpinner from 'react-md-spinner';
5
4
  /** A component which render an overlay loading */
6
5
  export default function LoadingOverlayComponent({ open, loadingMessage = 'Caricamento in corso' }) {
@@ -14,5 +14,5 @@ export type NavigationPath = {
14
14
  onClick?: () => void;
15
15
  icon?: SvgIconComponent;
16
16
  };
17
- export default function NavigationBar({ paths, goBack, showBackComponent, backLabel, color, }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export default function NavigationBar({ paths, goBack, showBackComponent, backLabel, color, }: Props): import("react").JSX.Element;
18
18
  export {};
@@ -21,5 +21,5 @@ type Props = {
21
21
  subTitleFontSize?: string;
22
22
  };
23
23
  /** Selfcare's page title */
24
- export default function TitleBox({ title, subTitle, mbTitle, mtTitle, mbSubTitle, variantTitle, variantSubTitle, titleFontSize, subTitleFontSize, }: Props): import("react/jsx-runtime").JSX.Element;
24
+ export default function TitleBox({ title, subTitle, mbTitle, mtTitle, mbSubTitle, variantTitle, variantSubTitle, titleFontSize, subTitleFontSize, }: Props): import("react").JSX.Element;
25
25
  export {};
@@ -26,5 +26,5 @@ type Props = {
26
26
  toastColorIcon?: string;
27
27
  };
28
28
  /** Selfcare's toast */
29
- export default function Toast({ open, title, message, onCloseToast, logo, leftBorderColor, width, wrapped, bottom, right, showToastCloseIcon, toastColorIcon, }: Readonly<Props>): import("react/jsx-runtime").JSX.Element;
29
+ export default function Toast({ open, title, message, onCloseToast, logo, leftBorderColor, width, wrapped, bottom, right, showToastCloseIcon, toastColorIcon, }: Readonly<Props>): React.JSX.Element;
30
30
  export {};
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Fragment } from 'react';
3
- import { Alert, Grid, Typography, IconButton, SvgIcon } from '@mui/material';
4
- import { styled } from '@mui/system';
5
- import CloseIcon from '@mui/icons-material/Close';
6
2
  import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
3
+ import CloseIcon from '@mui/icons-material/Close';
4
+ import { Alert, Grid, IconButton, SvgIcon, Typography, styled } from '@mui/material';
5
+ import { Fragment } from 'react';
7
6
  const CustomAlert = styled(Alert)({
8
7
  '.MuiAlert-icon': { display: 'none' },
9
8
  });
@@ -7,5 +7,5 @@ type Props = {
7
7
  right?: string;
8
8
  };
9
9
  /** To stack multiple Toast component. Each Toast should have the prop wrapped setted to true */
10
- export default function ToastWrapper({ children, bottom, right }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export default function ToastWrapper({ children, bottom, right }: Props): import("react").JSX.Element;
11
11
  export {};
@@ -5,4 +5,4 @@ To use this feature you have to put UnloadEventHandler in your App as a child of
5
5
  In order to use this feature you have to use the custom hook useUnloadEventInterceptor.
6
6
  @see {@link useUnloadEventInterceptor}
7
7
  */
8
- export default function UnloadEventHandler(): import("react/jsx-runtime").JSX.Element;
8
+ export default function UnloadEventHandler(): import("react").JSX.Element;
@@ -3,5 +3,5 @@ It allows to dispatch User Notifies in order to display a pop up or a toast noti
3
3
 
4
4
  To use this feature you have to put UserNotifyHandle in your App as a child of a redux Provider component.
5
5
  In order to dispatch a User Notify, you have to use the custom hook useUserNotify which will return a fuction to be used to dispatch the User Notify. */
6
- declare function UserNotifyHandle(): import("react/jsx-runtime").JSX.Element;
6
+ declare function UserNotifyHandle(): import("react").JSX.Element;
7
7
  export default UserNotifyHandle;
@@ -1,4 +1,4 @@
1
1
  import { SvgIconTypeMap } from '@mui/material/SvgIcon';
2
2
  import { DefaultComponentProps } from '@mui/material/OverridableComponent';
3
- declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react/jsx-runtime").JSX.Element;
3
+ declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react").JSX.Element;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import { SvgIconTypeMap } from '@mui/material/SvgIcon';
2
2
  import { DefaultComponentProps } from '@mui/material/OverridableComponent';
3
- declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react/jsx-runtime").JSX.Element;
3
+ declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react").JSX.Element;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import { SvgIconTypeMap } from '@mui/material/SvgIcon';
2
2
  import { DefaultComponentProps } from '@mui/material/OverridableComponent';
3
- declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react/jsx-runtime").JSX.Element;
3
+ declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react").JSX.Element;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import { SvgIconTypeMap } from '@mui/material/SvgIcon';
2
2
  import { DefaultComponentProps } from '@mui/material/OverridableComponent';
3
- declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react/jsx-runtime").JSX.Element;
3
+ declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react").JSX.Element;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import { SvgIconTypeMap } from '@mui/material/SvgIcon';
2
2
  import { DefaultComponentProps } from '@mui/material/OverridableComponent';
3
- declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react/jsx-runtime").JSX.Element;
3
+ declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => import("react").JSX.Element;
4
4
  export default _default;
@@ -27,6 +27,11 @@ export declare const CONFIG: {
27
27
  COOKIE_GROUP_ANALYTICS: string;
28
28
  };
29
29
  TEST: {
30
+ /**
31
+ * Local/dev-only test token.
32
+ * Do not commit real tokens in source code. Provide it via `.env.development.local`:
33
+ * VITE_TEST_JWT=...
34
+ */
30
35
  JWT: string;
31
36
  };
32
37
  FOOTER: {
package/lib/config/env.js CHANGED
@@ -27,7 +27,12 @@ export const CONFIG = {
27
27
  COOKIE_GROUP_ANALYTICS: 'C0002',
28
28
  },
29
29
  TEST: {
30
- JWT: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmYW1pbHlfbmFtZSI6Im1vY2tlZCIsImZpc2NhbF9udW1iZXIiOiIyMjMzNDQ1Njc4NiIsIm5hbWUiOiJ1c2VyIiwiZnJvbV9hYSI6ZmFsc2UsInVpZCI6IjUwNTRwZWM2LTIyMzMyLTQ1ZDUtOWJkZi0yYmg5NzRhN2MxYzgiLCJsZXZlbCI6IkwyIiwiaWF0IjoxNzEwNzU4Njk0LCJleHAiOjE3MDgyNTMxODl9.qGqULn7A29daBAvc34azOgL5PhLt6Srge0PxopPj_DA',
30
+ /**
31
+ * Local/dev-only test token.
32
+ * Do not commit real tokens in source code. Provide it via `.env.development.local`:
33
+ * VITE_TEST_JWT=...
34
+ */
35
+ JWT: import.meta.env.VITE_TEST_JWT || '',
31
36
  },
32
37
  FOOTER: {
33
38
  LINK: {
@@ -1,5 +1,5 @@
1
1
  import { User } from '../../model/User';
2
2
  export declare const mockedUser: User;
3
3
  export declare const verifyMockExecution: (state: any) => void;
4
- declare const _default: (WrappedComponent: React.ComponentType<any>) => (props: any) => import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: (WrappedComponent: React.ComponentType<any>) => (props: any) => import("react").JSX.Element;
5
5
  export default _default;
@@ -1,4 +1,4 @@
1
1
  export declare const useLiveAnnouncerWithRegion: () => {
2
2
  announce: (msg: string) => void;
3
- LiveRegion: import("react/jsx-runtime").JSX.Element;
3
+ LiveRegion: import("react").JSX.Element;
4
4
  };
@@ -19,7 +19,9 @@ export const useLogin = () => {
19
19
  const attemptSilentLogin = async () => {
20
20
  if (CONFIG.MOCKS.MOCK_USER) {
21
21
  setUser(mockedUser);
22
- storageTokenOps.write(testToken);
22
+ if (testToken) {
23
+ storageTokenOps.write(testToken);
24
+ }
23
25
  storageUserOps.write(mockedUser);
24
26
  return;
25
27
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pagopa/selfcare-common-frontend",
3
3
  "description": "Shared React components for the pagopa selfcare project",
4
- "version": "2.0.0",
4
+ "version": "2.1.1",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/pagopa/selfcare-common-frontend",
7
7
  "author": "https://www.pagopa.gov.it",
@@ -10,7 +10,6 @@
10
10
  "types": "lib/index.d.ts",
11
11
  "sideEffects": [
12
12
  "lib/consentManagementConfigure.js",
13
- "lib/common-polyfill.js",
14
13
  "lib/**/*.css"
15
14
  ],
16
15
  "dependencies": {
@@ -26,7 +25,6 @@
26
25
  "@pagopa/ts-commons": "^13.1.2",
27
26
  "@reduxjs/toolkit": "^2.9.0",
28
27
  "async": "3.2.4",
29
- "core-js": "^3.20.2",
30
28
  "fp-ts": "^2.11.5",
31
29
  "i18next": "^25.4.2",
32
30
  "i18next-browser-languagedetector": "^8.0.0",
@@ -74,9 +72,9 @@
74
72
  "@types/redux-logger": "^3.0.9",
75
73
  "@typescript-eslint/eslint-plugin": "^5.0.0",
76
74
  "@typescript-eslint/parser": "^5.0.0",
77
- "@vitejs/plugin-react": "^5.1.4",
78
- "@vitest/browser": "^4.0.18",
79
- "@vitest/coverage-v8": "^4.0.18",
75
+ "@vitejs/plugin-react": "^5.2.0",
76
+ "@vitest/browser": "4.1.10",
77
+ "@vitest/coverage-v8": "4.1.10",
80
78
  "auto-changelog": "^2.3.0",
81
79
  "copyfiles": "^2.4.1",
82
80
  "eslint": "7.11.0",
@@ -94,9 +92,9 @@
94
92
  "renamer": "^4.0.0",
95
93
  "rimraf": "^6.0.1",
96
94
  "typescript": "^5.9.2",
97
- "vite": "^7.3.1",
98
- "vite-tsconfig-paths": "^6.1.1",
99
- "vitest": "^4.0.18"
95
+ "vite": "^8.1.5",
96
+ "vite-plugin-html": "^3.2.2",
97
+ "vitest": "4.1.10"
100
98
  },
101
99
  "resolutions": {
102
100
  "@types/react": "18.3.16"
@@ -1,9 +0,0 @@
1
- import 'core-js/es/object/entries';
2
- import 'core-js/es/object/from-entries';
3
- import 'core-js/es/object/values';
4
- import 'core-js/es/map';
5
- import 'core-js/es/promise';
6
- import 'core-js/es/array';
7
- import 'core-js/stable/string';
8
- import 'core-js/stable/number';
9
- import 'core-js/stable/url-search-params';
@@ -1,9 +0,0 @@
1
- import 'core-js/es/object/entries';
2
- import 'core-js/es/object/from-entries';
3
- import 'core-js/es/object/values';
4
- import 'core-js/es/map';
5
- import 'core-js/es/promise';
6
- import 'core-js/es/array';
7
- import 'core-js/stable/string';
8
- import 'core-js/stable/number';
9
- import 'core-js/stable/url-search-params';