diff --git a/.changeset/heavy-chairs-repeat.md b/.changeset/heavy-chairs-repeat.md new file mode 100644 index 0000000000..1acc7d344f --- /dev/null +++ b/.changeset/heavy-chairs-repeat.md @@ -0,0 +1,13 @@ +--- +"@sumup-oss/stylelint-plugin-circuit-ui": major +"@sumup-oss/eslint-plugin-circuit-ui": major +"next-app": major +"@sumup-oss/design-tokens": major +"@sumup-oss/circuit-ui": major +"@sumup-oss/cna-template": major +"@sumup-oss/astro-template-circuit-ui": major +"@sumup-oss/remix-template-circuit-ui": major +"@sumup-oss/icons": major +--- + +Raised the minimum Node.js version to 20+. diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 6c63ed2ac3..be234452d9 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -16,10 +16,10 @@ jobs: with: fetch-depth: 0 - - name: Setup Node.js v18 + - name: Setup Node.js v20 uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6ebf26052..c2836519b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [18, 20] + node: [20, 22] steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index f89e07cd40..7c94261b65 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -11,7 +11,7 @@ jobs: strategy: # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs matrix: - node: [18, 20] + node: [20, 22] template: [astro, nextjs, remix] include: - template: astro diff --git a/.nvmrc b/.nvmrc index a77793ecc5..9de2256827 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/hydrogen +lts/iron diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 19588af374..13d0bfadda 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ We appreciate pull requests (PRs) for smaller changes and bug fixes. For larger ### Prerequisites -- [Node.js v18](https://nodejs.org/) +- [Node.js v20](https://nodejs.org/) ### Installation diff --git a/package-lock.json b/package-lock.json index e1c24c2ef0..73f279b91a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "@sumup-oss/eslint-plugin-circuit-ui": "^4.0.0", "@sumup-oss/foundry": "^8.2.0", "@sumup-oss/stylelint-plugin-circuit-ui": "^2.0.0", - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@vitest/coverage-v8": "^2.0.5", "audit-ci": "^7.1.0", "chromatic": "^11.7.1", @@ -10064,6 +10064,23 @@ "url": "https://opencollective.com/storybook" } }, + "node_modules/@storybook/core/node_modules/@types/node": { + "version": "18.19.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.55.tgz", + "integrity": "sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@storybook/core/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, "node_modules/@storybook/csf": { "version": "0.1.11", "resolved": "https://registry.npmjs.org/@storybook/csf/-/csf-0.1.11.tgz", @@ -10258,6 +10275,16 @@ "node": ">=6" } }, + "node_modules/@storybook/react/node_modules/@types/node": { + "version": "18.19.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.55.tgz", + "integrity": "sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, "node_modules/@storybook/react/node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -10270,6 +10297,13 @@ "node": ">=0.4.0" } }, + "node_modules/@storybook/react/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, "node_modules/@storybook/source-loader": { "version": "8.2.4", "resolved": "https://registry.npmjs.org/@storybook/source-loader/-/source-loader-8.2.4.tgz", @@ -11115,12 +11149,13 @@ } }, "node_modules/@types/node": { - "version": "18.19.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.39.tgz", - "integrity": "sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==", + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", "devOptional": true, + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/normalize-package-data": { @@ -40248,10 +40283,11 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "devOptional": true + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "devOptional": true, + "license": "MIT" }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", @@ -42507,7 +42543,7 @@ "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.5.2", "@types/jest-axe": "^3.5.9", - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@types/react": "^18.3.3", "@types/react-dates": "^21.8.6", "@types/react-dom": "^18.3.0", @@ -42524,7 +42560,7 @@ "vite": "^5.3.5" }, "engines": { - "node": ">=18" + "node": ">=20" }, "optionalDependencies": { "moment": ">=2.30", @@ -42593,7 +42629,7 @@ "prop-types": "^15.8.1" }, "devDependencies": { - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@types/prop-types": "^15.7.12", "tsx": "^4.16.5", "typescript": "^5.5.4" @@ -42632,7 +42668,7 @@ "typescript": "^5.5.4" }, "engines": { - "node": ">=18" + "node": ">=20" }, "peerDependencies": { "react": ">=16.0.0 <19.0.0" @@ -42667,7 +42703,7 @@ "typescript-plugin-css-modules": "^5.1.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/stylelint-plugin-circuit-ui": { @@ -42735,7 +42771,7 @@ "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.12", "@types/jest-axe": "^3.5.9", - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "eslint-config-next": "^14.2.5", @@ -42776,7 +42812,7 @@ "typescript-plugin-css-modules": "^5.1.0" }, "engines": { - "node": ">=18" + "node": ">=20" } } }, @@ -49442,6 +49478,23 @@ "recast": "^0.23.5", "util": "^0.12.4", "ws": "^8.2.3" + }, + "dependencies": { + "@types/node": { + "version": "18.19.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.55.tgz", + "integrity": "sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } + }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } } }, "@storybook/csf": { @@ -49529,11 +49582,26 @@ "util-deprecate": "^1.0.2" }, "dependencies": { + "@types/node": { + "version": "18.19.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.55.tgz", + "integrity": "sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } + }, "acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true + }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true } } }, @@ -49738,7 +49806,7 @@ "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.5.2", "@types/jest-axe": "^3.5.9", - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@types/react": "^18.3.3", "@types/react-dates": "^21.8.6", "@types/react-dom": "^18.3.0", @@ -49765,7 +49833,7 @@ "@sumup-oss/design-tokens": { "version": "file:packages/design-tokens", "requires": { - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@types/prop-types": "^15.7.12", "browserslist": "^4.23.2", "lightningcss": "^1.25.1", @@ -50374,12 +50442,12 @@ } }, "@types/node": { - "version": "18.19.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.39.tgz", - "integrity": "sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==", + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", "devOptional": true, "requires": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "@types/normalize-package-data": { @@ -64371,7 +64439,7 @@ "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.12", "@types/jest-axe": "^3.5.9", - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "eslint-config-next": "^14.2.5", @@ -70494,9 +70562,9 @@ "integrity": "sha512-JfjKqIauur3Q6biAtHJ564e3bWa8VvT+7cSiOJHFbX4Erv6CLGDpg8z+Fmg/1OI/47RA+GI2QZaF48SSaLvyBA==" }, "undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "devOptional": true }, "unicode-canonical-property-names-ecmascript": { diff --git a/package.json b/package.json index c3d2876a18..b816ef4625 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@sumup-oss/foundry": "^8.2.0", "@sumup-oss/eslint-plugin-circuit-ui": "^4.0.0", "@sumup-oss/stylelint-plugin-circuit-ui": "^2.0.0", - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@vitest/coverage-v8": "^2.0.5", "audit-ci": "^7.1.0", "chromatic": "^11.7.1", diff --git a/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.ts b/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.ts index e78b011571..d2aa1e4e24 100644 --- a/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.ts +++ b/packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.ts @@ -46,7 +46,7 @@ export function mapCountryCodeOptions( const displayName = new Intl.DisplayNames(locale, { type: 'region' }); return countryCodeOptions .map(({ code, country }) => { - const countryName = displayName.of(country); + const countryName = country ? displayName.of(country) : country; return { label: countryName ? `${countryName} (${code})` : code, value: code, diff --git a/packages/circuit-ui/package.json b/packages/circuit-ui/package.json index b1c4f9c430..f28347121f 100644 --- a/packages/circuit-ui/package.json +++ b/packages/circuit-ui/package.json @@ -71,7 +71,7 @@ "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.5.2", "@types/jest-axe": "^3.5.9", - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@types/react": "^18.3.3", "@types/react-dates": "^21.8.6", "@types/react-dom": "^18.3.0", @@ -102,6 +102,6 @@ "react-dates": ">=21.8" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/design-tokens/package.json b/packages/design-tokens/package.json index d208693f15..eb20a1cf36 100644 --- a/packages/design-tokens/package.json +++ b/packages/design-tokens/package.json @@ -36,7 +36,7 @@ "prop-types": "^15.8.1" }, "devDependencies": { - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@types/prop-types": "^15.7.12", "tsx": "^4.16.5", "typescript": "^5.5.4" diff --git a/packages/icons/package.json b/packages/icons/package.json index 0c5429655d..7b4565f970 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -48,6 +48,6 @@ "react": ">=16.0.0 <19.0.0" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/templates/nextjs/README.md b/templates/nextjs/README.md index a4759f76de..25ab014fa2 100644 --- a/templates/nextjs/README.md +++ b/templates/nextjs/README.md @@ -10,7 +10,7 @@ A [create-next-app template](https://nextjs.org/docs/api-reference/create-next-a ## 💻 Prerequisites -- You should have **Node.js** installed at a version equal to or above **`v18.0.0`**. +- You should have **Node.js** installed at a version equal to or above **`v20.0.0`**. ## ✨ Setting up a new Circuit UI + Next.js project diff --git a/templates/nextjs/template/.nvmrc b/templates/nextjs/template/.nvmrc index a77793ecc5..9de2256827 100644 --- a/templates/nextjs/template/.nvmrc +++ b/templates/nextjs/template/.nvmrc @@ -1 +1 @@ -lts/hydrogen +lts/iron diff --git a/templates/nextjs/template/package.json b/templates/nextjs/template/package.json index d4b15c4cdf..d84567b907 100644 --- a/templates/nextjs/template/package.json +++ b/templates/nextjs/template/package.json @@ -31,7 +31,7 @@ "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.12", "@types/jest-axe": "^3.5.9", - "@types/node": "^18.19.39", + "@types/node": "^22.7.4", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "eslint-config-next": "^14.2.5", diff --git a/templates/remix/package.json b/templates/remix/package.json index b4de9e06b1..bcfea399ed 100644 --- a/templates/remix/package.json +++ b/templates/remix/package.json @@ -38,6 +38,6 @@ "typescript-plugin-css-modules": "^5.1.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }