From 64c49a7a32db2e124f0e0ae0e1ab46e0b5fc3909 Mon Sep 17 00:00:00 2001 From: Thomas Tykesson Date: Mon, 25 Mar 2024 12:57:55 +0100 Subject: [PATCH 1/2] Migrerer, og oppgraderer aksel og ds-pakkene til v5 --- components/ErrorMessageProvider.tsx | 7 +- components/FellesModal.tsx | 81 +++++------- components/Fil.tsx | 3 +- components/Filvelger.tsx | 8 +- components/SoknadModalProvider.tsx | 18 +-- cypress/e2e/dokumentinnsendingTest.cy.js | 2 +- cypress/e2e/ettersendingTest.cy.js | 14 +-- package-lock.json | 150 ++++++++++------------- package.json | 6 +- 9 files changed, 118 insertions(+), 171 deletions(-) diff --git a/components/ErrorMessageProvider.tsx b/components/ErrorMessageProvider.tsx index 378efb0d..628b8f32 100644 --- a/components/ErrorMessageProvider.tsx +++ b/components/ErrorMessageProvider.tsx @@ -1,4 +1,4 @@ -import { BodyLong, Heading } from '@navikt/ds-react'; +import { BodyLong } from '@navikt/ds-react'; import { createContext, useContext, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FellesModal } from './FellesModal'; @@ -48,15 +48,12 @@ export const ErrorMessageProvider = ({ children }: ErrorMessageProviderProps) => {children} - - {error.title || defaultTitle} - - {error.message} diff --git a/components/FellesModal.tsx b/components/FellesModal.tsx index b4472db7..c980f32b 100644 --- a/components/FellesModal.tsx +++ b/components/FellesModal.tsx @@ -1,25 +1,12 @@ import { Button, ButtonProps, Modal } from '@navikt/ds-react'; -import React, { useEffect } from 'react'; +import React from 'react'; import styled from 'styled-components'; const StyledModal = styled(Modal)` max-width: 700px; `; -const ButtonRow = styled.div` - padding-top: 37px; - display: flex; - justify-content: right; - button { - margin: 0 12px; - } -`; - -const StyledContent = styled(Modal.Content)` - > *:first-child { - margin-right: 36px; - } - +const StyledModalBody = styled(Modal.Body)` ol, ul { padding-left: 1.75rem; @@ -33,6 +20,7 @@ const StyledContent = styled(Modal.Content)` `; type FellesModalProps = { + heading: string; open: boolean; setOpen(isOpen: boolean): void; children?: React.ReactNode; @@ -42,10 +30,12 @@ type FellesModalProps = { acceptButtonVariant?: ButtonProps['variant']; cancelButtonVariant?: ButtonProps['variant']; isLoading?: boolean; + closeButton?: boolean; }; export const FellesModal = (props: FellesModalProps) => { const { + heading, open, setOpen, onAccept, @@ -55,43 +45,38 @@ export const FellesModal = (props: FellesModalProps) => { acceptButtonVariant = 'primary', cancelButtonVariant = 'tertiary', isLoading = false, + closeButton = true, } = props; - useEffect(() => { - Modal.setAppElement('#__next'); - }, []); - return ( <> - setOpen(false)}> - - {children} - {(acceptButtonText || cancelButtonText) && ( - - {cancelButtonText && ( - - )} - {acceptButtonText && ( - - )} - - )} - + setOpen(false)}> + {children} + {(acceptButtonText || cancelButtonText) && ( + + {acceptButtonText && ( + + )} + {cancelButtonText && ( + + )} + + )} ); diff --git a/components/Fil.tsx b/components/Fil.tsx index a7837bae..3f31ff8f 100644 --- a/components/Fil.tsx +++ b/components/Fil.tsx @@ -476,7 +476,8 @@ export function Fil({ }) } CustomButton={ - } diff --git a/components/Filvelger.tsx b/components/Filvelger.tsx index 8eb5e8f5..59aff388 100644 --- a/components/Filvelger.tsx +++ b/components/Filvelger.tsx @@ -82,7 +82,13 @@ export function Filvelger(props: FilvelgerProps) { const CurrentButton = useCallback(() => { const DefaultButton = ( - ); diff --git a/components/SoknadModalProvider.tsx b/components/SoknadModalProvider.tsx index 603dc6d5..833b6b50 100644 --- a/components/SoknadModalProvider.tsx +++ b/components/SoknadModalProvider.tsx @@ -1,4 +1,4 @@ -import { BodyLong, Heading } from '@navikt/ds-react'; +import { BodyLong } from '@navikt/ds-react'; import { createContext, useCallback, useContext, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { datoOmXDager, formatertDato } from '../utils/dato'; @@ -79,15 +79,13 @@ export const SoknadModalProvider = ({ children }: SoknadModalProviderProps) => { {children} - - {t('modal.fortsettSenere.tittel')} - {( t('modal.fortsettSenere.liste', { @@ -100,6 +98,7 @@ export const SoknadModalProvider = ({ children }: SoknadModalProviderProps) => { { cancelButtonText={t('modal.slett.cancel')} isLoading={lagrer} > - - {t('modal.slett.tittel')} - {( t('modal.slett.liste', { @@ -122,6 +118,7 @@ export const SoknadModalProvider = ({ children }: SoknadModalProviderProps) => { { @@ -132,9 +129,6 @@ export const SoknadModalProvider = ({ children }: SoknadModalProviderProps) => { cancelButtonText={t('modal.sendInnUferdig.cancel')} isLoading={lagrer} > - - {t('modal.sendInnUferdig.tittel')} - {( t('modal.sendInnUferdig.liste', { @@ -153,6 +147,7 @@ export const SoknadModalProvider = ({ children }: SoknadModalProviderProps) => { { @@ -163,9 +158,6 @@ export const SoknadModalProvider = ({ children }: SoknadModalProviderProps) => { cancelButtonText={t('modal.sendInnKomplett.cancel')} isLoading={lagrer} > - - {t('modal.sendInnKomplett.tittel')} - {( t('modal.sendInnKomplett.liste', { diff --git a/cypress/e2e/dokumentinnsendingTest.cy.js b/cypress/e2e/dokumentinnsendingTest.cy.js index 9c92e408..def0c332 100644 --- a/cypress/e2e/dokumentinnsendingTest.cy.js +++ b/cypress/e2e/dokumentinnsendingTest.cy.js @@ -88,7 +88,7 @@ describe('Tester dokumentinnsendingsløpet', () => { // Sender inn cy.get('[data-cy="sendTilNAVKnapp"]').click(); - cy.get('[data-cy="jaFellesModalKnapp"]').should('be.visible').click(); + cy.get('[data-cy="jaFellesModalKnapp"]').filter(':visible').should('be.visible').click(); cy.get('[data-cy="kvitteringOverskrift"]').should('be.visible'); }); diff --git a/cypress/e2e/ettersendingTest.cy.js b/cypress/e2e/ettersendingTest.cy.js index fc7dc79b..a0e81ccf 100644 --- a/cypress/e2e/ettersendingTest.cy.js +++ b/cypress/e2e/ettersendingTest.cy.js @@ -33,18 +33,10 @@ describe('Tester ettersendingsløpet', () => { }); // Sender inn - cy.get('[data-cy="sendTilNAVKnapp"]', { - timeout: 10000, - }).click(); + cy.get('[data-cy="sendTilNAVKnapp"]').click(); - cy.get('[data-cy="jaFellesModalKnapp"]', { - timeout: 10000, - }).should('be.visible'); + cy.get('[data-cy="jaFellesModalKnapp"]').filter(':visible').should('be.visible').click(); - cy.get('[data-cy="jaFellesModalKnapp"]').click(); - - cy.get('[data-cy="kvitteringOverskrift"]', { - timeout: 10000, - }).should('be.visible'); + cy.get('[data-cy="kvitteringOverskrift"]').should('be.visible'); }); }); diff --git a/package-lock.json b/package-lock.json index fc388bd7..ee8d31f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,9 @@ "name": "send-inn-frontend", "version": "0.1.0", "dependencies": { - "@navikt/aksel-icons": "^4.12.1", - "@navikt/ds-css": "^4.12.1", - "@navikt/ds-react": "^4.12.1", + "@navikt/aksel-icons": "^5.18.3", + "@navikt/ds-css": "^5.18.3", + "@navikt/ds-react": "^5.18.3", "@navikt/nav-dekoratoren-moduler": "^2.1.6", "@sentry/nextjs": "^7.107.0", "axios": "^1.6.7", @@ -259,29 +259,39 @@ } }, "node_modules/@floating-ui/core": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.4.1.tgz", - "integrity": "sha512-jk3WqquEJRlcyu7997NtR5PibI+y5bi+LS3hPmguVClypenMsCY3CBa3LAQnozRCtCrYWSEtAdiskpamuJRFOQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.0.tgz", + "integrity": "sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==", "dependencies": { - "@floating-ui/utils": "^0.1.1" + "@floating-ui/utils": "^0.2.1" } }, + "node_modules/@floating-ui/core/node_modules/@floating-ui/utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", + "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" + }, "node_modules/@floating-ui/dom": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.1.tgz", - "integrity": "sha512-KwvVcPSXg6mQygvA1TjbN/gh///36kKtllIF8SUm0qpFj8+rvYrpvlYdL1JoA71SHpDqgSSdGOSoQ0Mp3uY5aw==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz", + "integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==", "dependencies": { - "@floating-ui/core": "^1.4.1", - "@floating-ui/utils": "^0.1.1" + "@floating-ui/core": "^1.0.0", + "@floating-ui/utils": "^0.2.0" } }, + "node_modules/@floating-ui/dom/node_modules/@floating-ui/utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", + "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" + }, "node_modules/@floating-ui/react": { - "version": "0.24.1", - "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.24.1.tgz", - "integrity": "sha512-qjCKUZDEz/4bnJmu4gn66TqsoX912/re8JGEi3pXazsphmyh327l0UpTgpBAT3WkNbnzAH7Adt3wKlLMNtfupw==", + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.25.4.tgz", + "integrity": "sha512-lWRQ/UiTvSIBxohn0/2HFHEmnmOVRjl7j6XcRJuLH0ls6f/9AyHMWVzkAJFuwx0n9gaEeCmg9VccCSCJzbEJig==", "dependencies": { - "@floating-ui/react-dom": "^2.0.0", - "aria-hidden": "^1.1.3", + "@floating-ui/react-dom": "^2.0.2", + "@floating-ui/utils": "^0.1.1", "tabbable": "^6.0.1" }, "peerDependencies": { @@ -290,11 +300,11 @@ } }, "node_modules/@floating-ui/react-dom": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.1.tgz", - "integrity": "sha512-rZtAmSht4Lry6gdhAJDrCp/6rKN7++JnL1/Anbr/DdeyYXQPxvg/ivrbYvJulbRf4vL8b212suwMM2lxbv+RQA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.8.tgz", + "integrity": "sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==", "dependencies": { - "@floating-ui/dom": "^1.3.0" + "@floating-ui/dom": "^1.6.1" }, "peerDependencies": { "react": ">=16.8.0", @@ -302,9 +312,9 @@ } }, "node_modules/@floating-ui/utils": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.1.tgz", - "integrity": "sha512-m0G6wlnhm/AX0H12IOWtK8gASEMffnX08RtKkCgTdHb9JpHKGloI7icFfLg9ZmQeavcvR0PKmzxClyuFPSjKWw==" + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz", + "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", @@ -550,37 +560,43 @@ } }, "node_modules/@navikt/aksel-icons": { - "version": "4.12.1", - "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/4.12.1/1055d322e956e073b83dca8e8b3a6be62879e1f1", - "integrity": "sha512-OCCKfb3dtk2gUBKdzbJiMkM4PfYZZXL3tfNHKJLn8QDpt+x6zdsaJWwTPc/pyDrl/quVGN3oPBHZ+3+7r/YtVw==", + "version": "5.18.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/5.18.3/0e8ff38b54ec91be6c5e8d8574a3341ee87eb792", + "integrity": "sha512-kytq0BT1xsJBrG7/eyDuMQLddQZA4OMT3Fw3VLGHsJNqjEWEVOl3uYCGL70Thvg0+du0s/Z3mXPQUQpIaDt7rg==", "license": "MIT" }, "node_modules/@navikt/ds-css": { - "version": "4.12.1", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/4.12.1/e2fa643caca8d998149ef56965d74dc646038ed2", - "integrity": "sha512-yBYFFgC749qtrlJddfmylaNyVI2++U7ZDduQWW0YAd6sYNURt5p2GkWJwFL78PdD+Rlc4bSi573LKJSmpw0/iw==", + "version": "5.18.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/5.18.3/cbeeddfeca6dd1efbbbb93a29a7cc3a9d5f6df86", + "integrity": "sha512-/BfZKrx7S5bVfjCQzm0B+3QgSHitPOAn04Bq0hAplFWXveLG0HkrVauDxL6dq9mqFN8zAJCSTXZjltRjY+JoHA==", "license": "MIT" }, "node_modules/@navikt/ds-react": { - "version": "4.12.1", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/4.12.1/75b4207b51213a3de620f9dd8b5b72095c741bbe", - "integrity": "sha512-fw3UcwLzq84fqFAgK0yZj6cADZy8uhHXK3mNnLJWXo8OxbVx3TEx5dR0Aa3mWASeTYFXdcp/n5Cj6Mu2ZnRlHw==", + "version": "5.18.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/5.18.3/dfa962fc74ec44189b33ad8076908f291ea91fd8", + "integrity": "sha512-+Ant1d6BhlOHuACttwCEiZLVPlVxEYEFGjPdr2EnDYRexmQVvY9dICnKaInBI/Cu6+cKl9BdnZbHsAs4+IPKQA==", "license": "MIT", "dependencies": { - "@floating-ui/react": "0.24.1", - "@navikt/aksel-icons": "^4.12.1", + "@floating-ui/react": "0.25.4", + "@navikt/aksel-icons": "^5.18.3", + "@navikt/ds-tokens": "^5.18.3", "@radix-ui/react-tabs": "1.0.0", "@radix-ui/react-toggle-group": "1.0.0", "clsx": "^1.2.1", - "date-fns": "2.29.3", - "react-day-picker": "8.3.4", - "react-modal": "3.15.1" + "date-fns": "^2.30.0", + "react-day-picker": "8.3.4" }, "peerDependencies": { "@types/react": "^17.0.30 || ^18.0.0", "react": "^17.0.0 || ^18.0.0" } }, + "node_modules/@navikt/ds-tokens": { + "version": "5.18.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-tokens/5.18.3/c03906e7264f2534ab5f6238a2e2850307e51af3", + "integrity": "sha512-PMA4K1DCosKbekk/hySFnjIRaQxwExhhdV6LFED+ImlutzYKJI79Gmbw1mttp6RWNAJYeVX5z8hCXPTMq6fu6w==", + "license": "MIT" + }, "node_modules/@navikt/nav-dekoratoren-moduler": { "version": "2.1.6", "resolved": "https://npm.pkg.github.com/download/@navikt/nav-dekoratoren-moduler/2.1.6/049e1daeecff43519e41e387f21fd7e3634c2bd3", @@ -2046,17 +2062,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/aria-hidden": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.3.tgz", - "integrity": "sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/aria-query": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", @@ -2962,9 +2967,12 @@ } }, "node_modules/date-fns": { - "version": "2.29.3", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz", - "integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==", + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, "engines": { "node": ">=0.11" }, @@ -3981,11 +3989,6 @@ "node": ">=4" } }, - "node_modules/exenv": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz", - "integrity": "sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw==" - }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -6610,6 +6613,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -7137,6 +7141,7 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -7288,29 +7293,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "node_modules/react-lifecycles-compat": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", - "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" - }, - "node_modules/react-modal": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/react-modal/-/react-modal-3.15.1.tgz", - "integrity": "sha512-duB9bxOaYg7Zt6TMFldIFxQRtSP+Dg3F1ZX3FXxSUn+3tZZ/9JCgeAQKDg7rhZSAqopq8TFRw3yIbnx77gyFTw==", - "dependencies": { - "exenv": "^1.2.0", - "prop-types": "^15.7.2", - "react-lifecycles-compat": "^3.0.0", - "warning": "^4.0.3" - }, - "engines": { - "node": ">=8" - }, - "peerDependencies": { - "react": "^0.14.0 || ^15.0.0 || ^16 || ^17 || ^18", - "react-dom": "^0.14.0 || ^15.0.0 || ^16 || ^17 || ^18" - } - }, "node_modules/react-property": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/react-property/-/react-property-2.0.0.tgz", @@ -8516,14 +8498,6 @@ "node": ">=14" } }, - "node_modules/warning": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", - "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", diff --git a/package.json b/package.json index 4fad09e6..6a9c4dd3 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "prettier": "prettier --write ." }, "dependencies": { - "@navikt/aksel-icons": "^4.12.1", - "@navikt/ds-css": "^4.12.1", - "@navikt/ds-react": "^4.12.1", + "@navikt/aksel-icons": "^5.18.3", + "@navikt/ds-css": "^5.18.3", + "@navikt/ds-react": "^5.18.3", "@navikt/nav-dekoratoren-moduler": "^2.1.6", "@sentry/nextjs": "^7.107.0", "axios": "^1.6.7", From 15372135cd0992ddb17e156ee83e27cabdb059e7 Mon Sep 17 00:00:00 2001 From: Thomas Tykesson Date: Mon, 25 Mar 2024 13:17:02 +0100 Subject: [PATCH 2/2] Oppgraderer, og migrerer aksel/ds-pakkene til v6 --- next.config.js | 3 ++ package-lock.json | 70 ++++++++++++++++++++++------------------------- package.json | 6 ++-- 3 files changed, 38 insertions(+), 41 deletions(-) diff --git a/next.config.js b/next.config.js index d748fc56..309c5d7f 100644 --- a/next.config.js +++ b/next.config.js @@ -5,6 +5,9 @@ const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ''; import { withSentryConfig } from '@sentry/nextjs'; const nextConfig = { + experimental: { + optimizePackageImports: ['@navikt/ds-react', '@navikt/aksel-icons'], + }, reactStrictMode: false, eslint: { // Warning: This allows production builds to successfully complete even if diff --git a/package-lock.json b/package-lock.json index ee8d31f5..f018b09e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,9 @@ "name": "send-inn-frontend", "version": "0.1.0", "dependencies": { - "@navikt/aksel-icons": "^5.18.3", - "@navikt/ds-css": "^5.18.3", - "@navikt/ds-react": "^5.18.3", + "@navikt/aksel-icons": "^6.3.3", + "@navikt/ds-css": "^6.3.3", + "@navikt/ds-react": "^6.3.3", "@navikt/nav-dekoratoren-moduler": "^2.1.6", "@sentry/nextjs": "^7.107.0", "axios": "^1.6.7", @@ -560,31 +560,31 @@ } }, "node_modules/@navikt/aksel-icons": { - "version": "5.18.3", - "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/5.18.3/0e8ff38b54ec91be6c5e8d8574a3341ee87eb792", - "integrity": "sha512-kytq0BT1xsJBrG7/eyDuMQLddQZA4OMT3Fw3VLGHsJNqjEWEVOl3uYCGL70Thvg0+du0s/Z3mXPQUQpIaDt7rg==", + "version": "6.3.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/6.3.3/251b544c7aea1904c7d11341fbc999e6b7e6e3e1", + "integrity": "sha512-DRWDvqJCPc1kYTjJwzv6sw5Bxf6DfHortkYDUtFSriwvXRaL1DM1/LxPtpu+fkMlCIBBioGps8CHZzRpg7Q8UQ==", "license": "MIT" }, "node_modules/@navikt/ds-css": { - "version": "5.18.3", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/5.18.3/cbeeddfeca6dd1efbbbb93a29a7cc3a9d5f6df86", - "integrity": "sha512-/BfZKrx7S5bVfjCQzm0B+3QgSHitPOAn04Bq0hAplFWXveLG0HkrVauDxL6dq9mqFN8zAJCSTXZjltRjY+JoHA==", + "version": "6.3.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/6.3.3/86285e2560cc1c06a9fdac1baf34415dcf7808dd", + "integrity": "sha512-Rpm71ivCpJ5CQuItrIKCe7h/tSnjqnZh9+DS1Mq3LUXaAEdBa1wIg1wF8Eqximy3QcObcO/tRwEkMcFxKe4xLQ==", "license": "MIT" }, "node_modules/@navikt/ds-react": { - "version": "5.18.3", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/5.18.3/dfa962fc74ec44189b33ad8076908f291ea91fd8", - "integrity": "sha512-+Ant1d6BhlOHuACttwCEiZLVPlVxEYEFGjPdr2EnDYRexmQVvY9dICnKaInBI/Cu6+cKl9BdnZbHsAs4+IPKQA==", + "version": "6.3.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/6.3.3/b432ae6ff3940ea88951a467923d96ff53b16b96", + "integrity": "sha512-iOCX4zO/CB6yM5GxTBDd8yl/sFe7QP2aNMxgA2uqH6l4S+tX1T7CKnMyUhxWrYTgGYFbjAaEppj77q2Gjokvkg==", "license": "MIT", "dependencies": { "@floating-ui/react": "0.25.4", - "@navikt/aksel-icons": "^5.18.3", - "@navikt/ds-tokens": "^5.18.3", + "@navikt/aksel-icons": "^6.3.3", + "@navikt/ds-tokens": "^6.3.3", "@radix-ui/react-tabs": "1.0.0", "@radix-ui/react-toggle-group": "1.0.0", - "clsx": "^1.2.1", - "date-fns": "^2.30.0", - "react-day-picker": "8.3.4" + "clsx": "^2.1.0", + "date-fns": "^3.0.0", + "react-day-picker": "8.10.0" }, "peerDependencies": { "@types/react": "^17.0.30 || ^18.0.0", @@ -592,9 +592,9 @@ } }, "node_modules/@navikt/ds-tokens": { - "version": "5.18.3", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-tokens/5.18.3/c03906e7264f2534ab5f6238a2e2850307e51af3", - "integrity": "sha512-PMA4K1DCosKbekk/hySFnjIRaQxwExhhdV6LFED+ImlutzYKJI79Gmbw1mttp6RWNAJYeVX5z8hCXPTMq6fu6w==", + "version": "6.3.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-tokens/6.3.3/d6403f08c3aa389e917b6fbb962ded0c5ce6f603", + "integrity": "sha512-EArixE4zSCbkqAYh2iQarsWtTl80yhcKrkAyPlQHrUr19EeRLJIRBQW+lnSiGFMXe+jh7ZUqsHeY1mDOr693Eg==", "license": "MIT" }, "node_modules/@navikt/nav-dekoratoren-moduler": { @@ -2634,9 +2634,9 @@ } }, "node_modules/clsx": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", - "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", "engines": { "node": ">=6" } @@ -2967,18 +2967,12 @@ } }, "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", + "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" } }, "node_modules/dayjs": { @@ -7228,15 +7222,15 @@ } }, "node_modules/react-day-picker": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.3.4.tgz", - "integrity": "sha512-UuCbfZ69DhQmd+UhEv8nCPp5PxMk7ioNTuOLMlU0X7q3wd7o8TKDdsjduQoeBYTPTMS3LFdbA1qqbrIpRHo/Vg==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.10.0.tgz", + "integrity": "sha512-mz+qeyrOM7++1NCb1ARXmkjMkzWVh2GL9YiPbRjKe0zHccvekk4HE+0MPOZOrosn8r8zTHIIeOUXTmXRqmkRmg==", "funding": { "type": "individual", "url": "https://github.com/sponsors/gpbl" }, "peerDependencies": { - "date-fns": "^2.28.0", + "date-fns": "^2.28.0 || ^3.0.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, diff --git a/package.json b/package.json index 6a9c4dd3..9d8068fc 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "prettier": "prettier --write ." }, "dependencies": { - "@navikt/aksel-icons": "^5.18.3", - "@navikt/ds-css": "^5.18.3", - "@navikt/ds-react": "^5.18.3", + "@navikt/aksel-icons": "^6.3.3", + "@navikt/ds-css": "^6.3.3", + "@navikt/ds-react": "^6.3.3", "@navikt/nav-dekoratoren-moduler": "^2.1.6", "@sentry/nextjs": "^7.107.0", "axios": "^1.6.7",