diff --git a/package.json b/package.json index 8c30000c40..e9ccf4a62a 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,8 @@ "test:ui": "vite", "test:src-types": "tsc types/**/*.ts", "test:types": "svelte-check --workspace tests", + "test:svelte5": "cd tests-svelte5 && npm test", + "test:types:svelte5": "cd tests-svelte5 && npm run test:types", "lint": "prettier --write --cache \"**/*.{svelte,md,js,json,ts}\"", "build:css": "node scripts/build-css", "build:docs": "node scripts/build-docs && node scripts/format-component-api", diff --git a/tests-svelte5/package-lock.json b/tests-svelte5/package-lock.json new file mode 100644 index 0000000000..e2c6c14a10 --- /dev/null +++ b/tests-svelte5/package-lock.json @@ -0,0 +1,2696 @@ +{ + "name": "tests-svelte5", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/svelte": "^5.2.8", + "@testing-library/user-event": "^14.6.1", + "carbon-preprocess-svelte": "^0.11.11", + "jsdom": "^26.1.0", + "svelte": "^5.0.0", + "svelte-check": "^4.2.1", + "typescript": "^5.8.3", + "vitest": "^3.2.3" + } + }, + "node_modules/@adobe/css-tools": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.4.tgz", + "integrity": "sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@csstools/color-helpers": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", + "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", + "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.1.0", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.11.tgz", + "integrity": "sha512-Xt1dOL13m8u0WE8iplx9Ibbm+hFAO0GsU2P34UNoDGvZYkY8ifSiy6Zuc1lYxfG7svWE2fzqCUmFp5HCn51gJg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.11.tgz", + "integrity": "sha512-uoa7dU+Dt3HYsethkJ1k6Z9YdcHjTrSb5NUy66ZfZaSV8hEYGD5ZHbEMXnqLFlbBflLsl89Zke7CAdDJ4JI+Gg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.11.tgz", + "integrity": "sha512-9slpyFBc4FPPz48+f6jyiXOx/Y4v34TUeDDXJpZqAWQn/08lKGeD8aDp9TMn9jDz2CiEuHwfhRmGBvpnd/PWIQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.11.tgz", + "integrity": "sha512-Sgiab4xBjPU1QoPEIqS3Xx+R2lezu0LKIEcYe6pftr56PqPygbB7+szVnzoShbx64MUupqoE0KyRlN7gezbl8g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.11.tgz", + "integrity": "sha512-VekY0PBCukppoQrycFxUqkCojnTQhdec0vevUL/EDOCnXd9LKWqD/bHwMPzigIJXPhC59Vd1WFIL57SKs2mg4w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.11.tgz", + "integrity": "sha512-+hfp3yfBalNEpTGp9loYgbknjR695HkqtY3d3/JjSRUyPg/xd6q+mQqIb5qdywnDxRZykIHs3axEqU6l1+oWEQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.11.tgz", + "integrity": "sha512-CmKjrnayyTJF2eVuO//uSjl/K3KsMIeYeyN7FyDBjsR3lnSJHaXlVoAK8DZa7lXWChbuOk7NjAc7ygAwrnPBhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.11.tgz", + "integrity": "sha512-Dyq+5oscTJvMaYPvW3x3FLpi2+gSZTCE/1ffdwuM6G1ARang/mb3jvjxs0mw6n3Lsw84ocfo9CrNMqc5lTfGOw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.11.tgz", + "integrity": "sha512-TBMv6B4kCfrGJ8cUPo7vd6NECZH/8hPpBHHlYI3qzoYFvWu2AdTvZNuU/7hsbKWqu/COU7NIK12dHAAqBLLXgw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.11.tgz", + "integrity": "sha512-Qr8AzcplUhGvdyUF08A1kHU3Vr2O88xxP0Tm8GcdVOUm25XYcMPp2YqSVHbLuXzYQMf9Bh/iKx7YPqECs6ffLA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.11.tgz", + "integrity": "sha512-TmnJg8BMGPehs5JKrCLqyWTVAvielc615jbkOirATQvWWB1NMXY77oLMzsUjRLa0+ngecEmDGqt5jiDC6bfvOw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.11.tgz", + "integrity": "sha512-DIGXL2+gvDaXlaq8xruNXUJdT5tF+SBbJQKbWy/0J7OhU8gOHOzKmGIlfTTl6nHaCOoipxQbuJi7O++ldrxgMw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.11.tgz", + "integrity": "sha512-Osx1nALUJu4pU43o9OyjSCXokFkFbyzjXb6VhGIJZQ5JZi8ylCQ9/LFagolPsHtgw6himDSyb5ETSfmp4rpiKQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.11.tgz", + "integrity": "sha512-nbLFgsQQEsBa8XSgSTSlrnBSrpoWh7ioFDUmwo158gIm5NNP+17IYmNWzaIzWmgCxq56vfr34xGkOcZ7jX6CPw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.11.tgz", + "integrity": "sha512-HfyAmqZi9uBAbgKYP1yGuI7tSREXwIb438q0nqvlpxAOs3XnZ8RsisRfmVsgV486NdjD7Mw2UrFSw51lzUk1ww==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.11.tgz", + "integrity": "sha512-HjLqVgSSYnVXRisyfmzsH6mXqyvj0SA7pG5g+9W7ESgwA70AXYNpfKBqh1KbTxmQVaYxpzA/SvlB9oclGPbApw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.11.tgz", + "integrity": "sha512-HSFAT4+WYjIhrHxKBwGmOOSpphjYkcswF449j6EjsjbinTZbp8PJtjsVK1XFJStdzXdy/jaddAep2FGY+wyFAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.11.tgz", + "integrity": "sha512-hr9Oxj1Fa4r04dNpWr3P8QKVVsjQhqrMSUzZzf+LZcYjZNqhA3IAfPQdEh1FLVUJSiu6sgAwp3OmwBfbFgG2Xg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.11.tgz", + "integrity": "sha512-u7tKA+qbzBydyj0vgpu+5h5AeudxOAGncb8N6C9Kh1N4n7wU1Xw1JDApsRjpShRpXRQlJLb9wY28ELpwdPcZ7A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.11.tgz", + "integrity": "sha512-Qq6YHhayieor3DxFOoYM1q0q1uMFYb7cSpLD2qzDSvK1NAvqFi8Xgivv0cFC6J+hWVw2teCYltyy9/m/14ryHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.11.tgz", + "integrity": "sha512-CN+7c++kkbrckTOz5hrehxWN7uIhFFlmS/hqziSFVWpAzpWrQoAG4chH+nN3Be+Kzv/uuo7zhX716x3Sn2Jduw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.11.tgz", + "integrity": "sha512-rOREuNIQgaiR+9QuNkbkxubbp8MSO9rONmwP5nKncnWJ9v5jQ4JxFnLu4zDSRPf3x4u+2VN4pM4RdyIzDty/wQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.11.tgz", + "integrity": "sha512-nq2xdYaWxyg9DcIyXkZhcYulC6pQ2FuCgem3LI92IwMgIZ69KHeY8T4Y88pcwoLIjbed8n36CyKoYRDygNSGhA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.11.tgz", + "integrity": "sha512-3XxECOWJq1qMZ3MN8srCJ/QfoLpL+VaxD/WfNRm1O3B4+AZ/BnLVgFbUV3eiRYDMXetciH16dwPbbHqwe1uU0Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.11.tgz", + "integrity": "sha512-3ukss6gb9XZ8TlRyJlgLn17ecsK4NSQTmdIXRASVsiS2sQ6zPPZklNJT5GR5tE/MUarymmy8kCEf5xPCNCqVOA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.11.tgz", + "integrity": "sha512-D7Hpz6A2L4hzsRpPaCYkQnGOotdUpDzSGRIv9I+1ITdHROSFUWW95ZPZWQmGka1Fg7W3zFJowyn9WGwMJ0+KPA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.5.tgz", + "integrity": "sha512-8c1vW4ocv3UOMp9K+gToY5zL2XiiVw3k7f1ksf4yO1FlDFQ1C2u72iACFnSOceJFsWskc2WZNqeRhFRPzv+wtQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.52.5.tgz", + "integrity": "sha512-mQGfsIEFcu21mvqkEKKu2dYmtuSZOBMmAl5CFlPGLY94Vlcm+zWApK7F/eocsNzp8tKmbeBP8yXyAbx0XHsFNA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.52.5.tgz", + "integrity": "sha512-takF3CR71mCAGA+v794QUZ0b6ZSrgJkArC+gUiG6LB6TQty9T0Mqh3m2ImRBOxS2IeYBo4lKWIieSvnEk2OQWA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.52.5.tgz", + "integrity": "sha512-W901Pla8Ya95WpxDn//VF9K9u2JbocwV/v75TE0YIHNTbhqUTv9w4VuQ9MaWlNOkkEfFwkdNhXgcLqPSmHy0fA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.52.5.tgz", + "integrity": "sha512-QofO7i7JycsYOWxe0GFqhLmF6l1TqBswJMvICnRUjqCx8b47MTo46W8AoeQwiokAx3zVryVnxtBMcGcnX12LvA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.52.5.tgz", + "integrity": "sha512-jr21b/99ew8ujZubPo9skbrItHEIE50WdV86cdSoRkKtmWa+DDr6fu2c/xyRT0F/WazZpam6kk7IHBerSL7LDQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.52.5.tgz", + "integrity": "sha512-PsNAbcyv9CcecAUagQefwX8fQn9LQ4nZkpDboBOttmyffnInRy8R8dSg6hxxl2Re5QhHBf6FYIDhIj5v982ATQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.52.5.tgz", + "integrity": "sha512-Fw4tysRutyQc/wwkmcyoqFtJhh0u31K+Q6jYjeicsGJJ7bbEq8LwPWV/w0cnzOqR2m694/Af6hpFayLJZkG2VQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.52.5.tgz", + "integrity": "sha512-a+3wVnAYdQClOTlyapKmyI6BLPAFYs0JM8HRpgYZQO02rMR09ZcV9LbQB+NL6sljzG38869YqThrRnfPMCDtZg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.52.5.tgz", + "integrity": "sha512-AvttBOMwO9Pcuuf7m9PkC1PUIKsfaAJ4AYhy944qeTJgQOqJYJ9oVl2nYgY7Rk0mkbsuOpCAYSs6wLYB2Xiw0Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.52.5.tgz", + "integrity": "sha512-DkDk8pmXQV2wVrF6oq5tONK6UHLz/XcEVow4JTTerdeV1uqPeHxwcg7aFsfnSm9L+OO8WJsWotKM2JJPMWrQtA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.52.5.tgz", + "integrity": "sha512-W/b9ZN/U9+hPQVvlGwjzi+Wy4xdoH2I8EjaCkMvzpI7wJUs8sWJ03Rq96jRnHkSrcHTpQe8h5Tg3ZzUPGauvAw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.52.5.tgz", + "integrity": "sha512-sjQLr9BW7R/ZiXnQiWPkErNfLMkkWIoCz7YMn27HldKsADEKa5WYdobaa1hmN6slu9oWQbB6/jFpJ+P2IkVrmw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.52.5.tgz", + "integrity": "sha512-hq3jU/kGyjXWTvAh2awn8oHroCbrPm8JqM7RUpKjalIRWWXE01CQOf/tUNWNHjmbMHg/hmNCwc/Pz3k1T/j/Lg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.52.5.tgz", + "integrity": "sha512-gn8kHOrku8D4NGHMK1Y7NA7INQTRdVOntt1OCYypZPRt6skGbddska44K8iocdpxHTMMNui5oH4elPH4QOLrFQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.5.tgz", + "integrity": "sha512-hXGLYpdhiNElzN770+H2nlx+jRog8TyynpTVzdlc6bndktjKWyZyiCsuDAlpd+j+W+WNqfcyAWz9HxxIGfZm1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.52.5.tgz", + "integrity": "sha512-arCGIcuNKjBoKAXD+y7XomR9gY6Mw7HnFBv5Rw7wQRvwYLR7gBAgV7Mb2QTyjXfTveBNFAtPt46/36vV9STLNg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.52.5.tgz", + "integrity": "sha512-QoFqB6+/9Rly/RiPjaomPLmR/13cgkIGfA40LHly9zcH1S0bN2HVFYk3a1eAyHQyjs3ZJYlXvIGtcCs5tko9Cw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.52.5.tgz", + "integrity": "sha512-w0cDWVR6MlTstla1cIfOGyl8+qb93FlAVutcor14Gf5Md5ap5ySfQ7R9S/NjNaMLSFdUnKGEasmVnu3lCMqB7w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.52.5.tgz", + "integrity": "sha512-Aufdpzp7DpOTULJCuvzqcItSGDH73pF3ko/f+ckJhxQyHtp67rHw3HMNxoIdDMUITJESNE6a8uh4Lo4SLouOUg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.52.5.tgz", + "integrity": "sha512-UGBUGPFp1vkj6p8wCRraqNhqwX/4kNQPS57BCFc8wYh0g94iVIW33wJtQAx3G7vrjjNtRaxiMUylM0ktp/TRSQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.52.5.tgz", + "integrity": "sha512-TAcgQh2sSkykPRWLrdyy2AiceMckNf5loITqXxFI5VuQjS5tSuw3WlwdN8qv8vzjLAUTvYaH/mVjSFpbkFbpTg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sveltejs/acorn-typescript": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.6.tgz", + "integrity": "sha512-4awhxtMh4cx9blePWl10HRHj8Iivtqj+2QdDCSMDzxG+XKa9+VCNupQuCuvzEhYPzZSrX+0gC+0lHA/0fFKKQQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^8.9.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-5.1.1.tgz", + "integrity": "sha512-Y1Cs7hhTc+a5E9Va/xwKlAJoariQyHY+5zBgCZg4PFWNYQ1nMN9sjK1zhw1gK69DuqVP++sht/1GZg1aRwmAXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sveltejs/vite-plugin-svelte-inspector": "^4.0.1", + "debug": "^4.4.1", + "deepmerge": "^4.3.1", + "kleur": "^4.1.5", + "magic-string": "^0.30.17", + "vitefu": "^1.0.6" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22" + }, + "peerDependencies": { + "svelte": "^5.0.0", + "vite": "^6.0.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte-inspector": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-4.0.1.tgz", + "integrity": "sha512-J/Nmb2Q2y7mck2hyCX4ckVHcR5tu2J+MtBEQqpDrrgELZ2uvraQcK/ioCV61AqkdXFgriksOKIceDcQmqnGhVw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.7" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "svelte": "^5.0.0", + "vite": "^6.0.0" + } + }, + "node_modules/@testing-library/dom": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.1.tgz", + "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "picocolors": "1.1.1", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@testing-library/jest-dom": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.9.1.tgz", + "integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@adobe/css-tools": "^4.4.0", + "aria-query": "^5.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.6.3", + "picocolors": "^1.1.1", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@testing-library/svelte": { + "version": "5.2.8", + "resolved": "https://registry.npmjs.org/@testing-library/svelte/-/svelte-5.2.8.tgz", + "integrity": "sha512-ucQOtGsJhtawOEtUmbR4rRh53e6RbM1KUluJIXRmh6D4UzxR847iIqqjRtg9mHNFmGQ8Vkam9yVcR5d1mhIHKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@testing-library/dom": "9.x.x || 10.x.x" + }, + "engines": { + "node": ">= 10" + }, + "peerDependencies": { + "svelte": "^3 || ^4 || ^5 || ^5.0.0-next.0", + "vite": "*", + "vitest": "*" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + }, + "vitest": { + "optional": true + } + } + }, + "node_modules/@testing-library/user-event": { + "version": "14.6.1", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.1.tgz", + "integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" + } + }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/chai": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.2.tgz", + "integrity": "sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitest/expect": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", + "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", + "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.4", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", + "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.2.4", + "pathe": "^2.0.3", + "strip-literal": "^3.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", + "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", + "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", + "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/carbon-preprocess-svelte": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/carbon-preprocess-svelte/-/carbon-preprocess-svelte-0.11.11.tgz", + "integrity": "sha512-F8dZ+evXjmGG/l7gZKHwX5vwJ5CngPFIIWyTsxoBKZqIyCgGZJh83X61q2ZE+jG1vhktZCAd18Z6Yyw1WQMN/Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "estree-walker": "^2.0.2", + "magic-string": "^0.30.17", + "postcss": "^8.5.3", + "postcss-discard-empty": "^7.0.0" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cssstyle": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true, + "license": "MIT" + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true, + "license": "MIT" + }, + "node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.25.11", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.11.tgz", + "integrity": "sha512-KohQwyzrKTQmhXDW1PjCv3Tyspn9n5GcY2RTDqeORIdIJY8yKIF7sTSopFmn/wpMPW4rdPXI0UE5LJLuq3bx0Q==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.11", + "@esbuild/android-arm": "0.25.11", + "@esbuild/android-arm64": "0.25.11", + "@esbuild/android-x64": "0.25.11", + "@esbuild/darwin-arm64": "0.25.11", + "@esbuild/darwin-x64": "0.25.11", + "@esbuild/freebsd-arm64": "0.25.11", + "@esbuild/freebsd-x64": "0.25.11", + "@esbuild/linux-arm": "0.25.11", + "@esbuild/linux-arm64": "0.25.11", + "@esbuild/linux-ia32": "0.25.11", + "@esbuild/linux-loong64": "0.25.11", + "@esbuild/linux-mips64el": "0.25.11", + "@esbuild/linux-ppc64": "0.25.11", + "@esbuild/linux-riscv64": "0.25.11", + "@esbuild/linux-s390x": "0.25.11", + "@esbuild/linux-x64": "0.25.11", + "@esbuild/netbsd-arm64": "0.25.11", + "@esbuild/netbsd-x64": "0.25.11", + "@esbuild/openbsd-arm64": "0.25.11", + "@esbuild/openbsd-x64": "0.25.11", + "@esbuild/openharmony-arm64": "0.25.11", + "@esbuild/sunos-x64": "0.25.11", + "@esbuild/win32-arm64": "0.25.11", + "@esbuild/win32-ia32": "0.25.11", + "@esbuild/win32-x64": "0.25.11" + } + }, + "node_modules/esm-env": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esrap": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.1.0.tgz", + "integrity": "sha512-yzmPNpl7TBbMRC5Lj2JlJZNPml0tzqoqP5B1JXycNUwtqma9AKCO0M2wHrdgsHcy1WRW7S9rJknAMtByg3usgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/expect-type": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.2.tgz", + "integrity": "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-reference": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsdom": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz", + "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.1.1", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.1", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/locate-character": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", + "dev": true, + "license": "MIT" + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "license": "MIT", + "bin": { + "lz-string": "bin/bin.js" + } + }, + "node_modules/magic-string": { + "version": "0.30.19", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.19.tgz", + "integrity": "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/nwsapi": { + "version": "2.2.22", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.22.tgz", + "integrity": "sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-discard-empty": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-7.0.1.tgz", + "integrity": "sha512-cFrJKZvcg/uxB6Ijr4l6qmn3pXQBna9zyrPC+sK0zjbkDUZew+6xDltSF7OeB7rAtzaaMVYSdbod+sZOCWnMOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.12.0 || ^20.9.0 || >=22.0" + }, + "peerDependencies": { + "postcss": "^8.4.32" + } + }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rollup": { + "version": "4.52.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.5.tgz", + "integrity": "sha512-3GuObel8h7Kqdjt0gxkEzaifHTqLVW56Y/bjN7PSQtkKr0w3V/QYSdt6QWYtd7A1xUtYQigtdUfgj1RvWVtorw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.52.5", + "@rollup/rollup-android-arm64": "4.52.5", + "@rollup/rollup-darwin-arm64": "4.52.5", + "@rollup/rollup-darwin-x64": "4.52.5", + "@rollup/rollup-freebsd-arm64": "4.52.5", + "@rollup/rollup-freebsd-x64": "4.52.5", + "@rollup/rollup-linux-arm-gnueabihf": "4.52.5", + "@rollup/rollup-linux-arm-musleabihf": "4.52.5", + "@rollup/rollup-linux-arm64-gnu": "4.52.5", + "@rollup/rollup-linux-arm64-musl": "4.52.5", + "@rollup/rollup-linux-loong64-gnu": "4.52.5", + "@rollup/rollup-linux-ppc64-gnu": "4.52.5", + "@rollup/rollup-linux-riscv64-gnu": "4.52.5", + "@rollup/rollup-linux-riscv64-musl": "4.52.5", + "@rollup/rollup-linux-s390x-gnu": "4.52.5", + "@rollup/rollup-linux-x64-gnu": "4.52.5", + "@rollup/rollup-linux-x64-musl": "4.52.5", + "@rollup/rollup-openharmony-arm64": "4.52.5", + "@rollup/rollup-win32-arm64-msvc": "4.52.5", + "@rollup/rollup-win32-ia32-msvc": "4.52.5", + "@rollup/rollup-win32-x64-gnu": "4.52.5", + "@rollup/rollup-win32-x64-msvc": "4.52.5", + "fsevents": "~2.3.2" + } + }, + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-literal": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", + "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/svelte": { + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.41.0.tgz", + "integrity": "sha512-mP3vFFv5OUM5JN189+nJVW74kQ1dGqUrXTEzvCEVZqessY0GxZDls1nWVvt4Sxyv2USfQvAZO68VRaeIZvpzKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@sveltejs/acorn-typescript": "^1.0.5", + "@types/estree": "^1.0.5", + "acorn": "^8.12.1", + "aria-query": "^5.3.1", + "axobject-query": "^4.1.0", + "clsx": "^2.1.1", + "esm-env": "^1.2.1", + "esrap": "^2.1.0", + "is-reference": "^3.0.3", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/svelte-check": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.3.3.tgz", + "integrity": "sha512-RYP0bEwenDXzfv0P1sKAwjZSlaRyqBn0Fz1TVni58lqyEiqgwztTpmodJrGzP6ZT2aHl4MbTvWP6gbmQ3FOnBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "chokidar": "^4.0.1", + "fdir": "^6.2.0", + "picocolors": "^1.0.0", + "sade": "^1.7.4" + }, + "bin": { + "svelte-check": "bin/svelte-check" + }, + "engines": { + "node": ">= 18.0.0" + }, + "peerDependencies": { + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": ">=5.0.0" + } + }, + "node_modules/svelte/node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", + "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/vite": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.0.tgz", + "integrity": "sha512-oLnWs9Hak/LOlKjeSpOwD6JMks8BeICEdYMJBf6P4Lac/pO9tKiv/XhXnAM7nNfSkZahjlCZu9sS50zL8fSnsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "fdir": "^6.4.4", + "picomatch": "^4.0.2", + "postcss": "^8.5.3", + "rollup": "^4.34.9", + "tinyglobby": "^0.2.13" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", + "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.4.1", + "es-module-lexer": "^1.7.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitefu": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.1.tgz", + "integrity": "sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ==", + "dev": true, + "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*", + "tests/projects/workspace/packages/*" + ], + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", + "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/expect": "3.2.4", + "@vitest/mocker": "3.2.4", + "@vitest/pretty-format": "^3.2.4", + "@vitest/runner": "3.2.4", + "@vitest/snapshot": "3.2.4", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "debug": "^4.4.1", + "expect-type": "^1.2.1", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "std-env": "^3.9.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.14", + "tinypool": "^1.1.1", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", + "vite-node": "3.2.4", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.2.4", + "@vitest/ui": "3.2.4", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/debug": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" + }, + "node_modules/zimmerframe": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", + "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/tests-svelte5/package.json b/tests-svelte5/package.json new file mode 100644 index 0000000000..98c3aab3e7 --- /dev/null +++ b/tests-svelte5/package.json @@ -0,0 +1,20 @@ +{ + "private": true, + "type": "module", + "scripts": { + "test": "vitest", + "test:types": "svelte-check --workspace ../tests" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/svelte": "^5.2.8", + "@testing-library/user-event": "^14.6.1", + "carbon-preprocess-svelte": "^0.11.11", + "jsdom": "^26.1.0", + "svelte": "^5.0.0", + "svelte-check": "^4.2.1", + "typescript": "^5.8.3", + "vitest": "^3.2.3" + } +} diff --git a/tests-svelte5/setup-tests.ts b/tests-svelte5/setup-tests.ts new file mode 100644 index 0000000000..6a07235a43 --- /dev/null +++ b/tests-svelte5/setup-tests.ts @@ -0,0 +1,128 @@ +/// +import "@testing-library/jest-dom/vitest"; +import { userEvent } from "@testing-library/user-event"; +import { version } from "svelte/package.json"; + +export const SVELTE_VERSION = parseInt(version.split(".")[0]); +export const isSvelte4 = SVELTE_VERSION === 4; +export const isSvelte5 = SVELTE_VERSION === 5; + +// Mock scrollIntoView since it's not implemented in JSDOM +Element.prototype.scrollIntoView = vi.fn(); + +// Mock ResizeObserver since it's not implemented in JSDOM +class ResizeObserverMock { + callback: ResizeObserverCallback; + elements: Element[]; + + constructor(callback: ResizeObserverCallback) { + this.callback = callback; + this.elements = []; + } + + observe(element: Element) { + this.elements.push(element); + this.callback( + [ + { + target: element, + contentRect: { height: 100 } as DOMRectReadOnly, + borderBoxSize: [], + contentBoxSize: [], + devicePixelContentBoxSize: [], + }, + ], + this, + ); + } + + unobserve(element: Element) { + this.elements = this.elements.filter((el) => el !== element); + } + + disconnect() { + this.elements = []; + } +} + +global.ResizeObserver = ResizeObserverMock; + +if (typeof DataTransfer === "undefined") { + class DataTransferMock { + items: DataTransferItemList; + files: FileList = [] as unknown as FileList; + private fileList: File[] = []; + + constructor() { + this.items = { + add: (file: File) => { + this.fileList.push(file); + this.updateFiles(); + return null as unknown as DataTransferItem; + }, + length: 0, + } as unknown as DataTransferItemList; + + this.updateFiles(); + } + + private updateFiles() { + const fileList = Object.create(Array.prototype); + this.fileList.forEach((file, index) => { + fileList[index] = file; + }); + fileList.length = this.fileList.length; + fileList.item = (index: number) => this.fileList[index] || null; + + fileList[Symbol.iterator] = function* () { + for (let i = 0; i < this.length; i++) { + yield this[i]; + } + }; + + this.files = fileList as FileList; + } + } + + global.DataTransfer = DataTransferMock as unknown as typeof DataTransfer; +} + +export const user = userEvent.setup(); + +export const setupLocalStorageMock = () => { + let localStorageMock: { [key: string]: string } = {}; + let originalLocalStorage: Storage; + + beforeEach(() => { + originalLocalStorage = global.localStorage; + localStorageMock = {}; + global.localStorage = { + getItem: vi.fn((key) => localStorageMock[key] || null), + setItem: vi.fn((key, value) => { + localStorageMock[key] = value; + }), + removeItem: vi.fn((key) => { + delete localStorageMock[key]; + }), + clear: vi.fn(() => { + localStorageMock = {}; + }), + length: 0, + key: vi.fn(), + }; + }); + + afterEach(() => { + global.localStorage = originalLocalStorage; + localStorage.clear(); + vi.restoreAllMocks(); + localStorageMock = {}; + }); + + return { + setMockItem: (key: string, value: string) => { + localStorageMock[key] = value; + }, + getMockItem: (key: string) => localStorageMock[key], + }; +}; diff --git a/tests-svelte5/vite.config.ts b/tests-svelte5/vite.config.ts new file mode 100644 index 0000000000..02bc8cb9ff --- /dev/null +++ b/tests-svelte5/vite.config.ts @@ -0,0 +1,30 @@ +/// +import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte"; +import { optimizeImports } from "carbon-preprocess-svelte"; +import { defineConfig } from "vite"; + +export default defineConfig({ + plugins: [ + svelte({ + preprocess: [vitePreprocess(), optimizeImports()], + }), + ], + optimizeDeps: { + exclude: ["carbon-components-svelte", "carbon-icons-svelte"], + }, + resolve: process.env.VITEST ? { conditions: ["browser"] } : undefined, + server: { + fs: { + allow: [".."], + }, + }, + test: { + globals: true, + environment: "jsdom", + clearMocks: true, + // Suppress `console` output in CI. + silent: !!process.env.CI, + include: ["../tests/**/*.test.ts"], + setupFiles: ["./setup-tests.ts"], + }, +}); diff --git a/tests/Breakpoint/Breakpoint.svelte5.test.svelte b/tests/Breakpoint/Breakpoint.svelte5.test.svelte new file mode 100644 index 0000000000..15b76c7446 --- /dev/null +++ b/tests/Breakpoint/Breakpoint.svelte5.test.svelte @@ -0,0 +1,29 @@ + + + +
{currentSize}
+
{currentSizes.sm}
+
{currentSizes.md}
+
{currentSizes.lg}
+
{currentSizes.xlg}
+
{currentSizes.max}
+
diff --git a/tests/Breakpoint/Breakpoint.test.ts b/tests/Breakpoint/Breakpoint.test.ts index c76983b674..e7fcabae28 100644 --- a/tests/Breakpoint/Breakpoint.test.ts +++ b/tests/Breakpoint/Breakpoint.test.ts @@ -1,8 +1,12 @@ import { render, screen } from "@testing-library/svelte"; -import Breakpoint from "./Breakpoint.test.svelte"; +import { isSvelte4, isSvelte5 } from "../setup-tests"; +import BreakpointSvelte4 from "./Breakpoint.test.svelte"; +import BreakpointSvelte5 from "./Breakpoint.svelte5.test.svelte"; import BreakpointObserver from "./BreakpointObserver.test.svelte"; import Breakpoints from "./Breakpoints.test.svelte"; +const Breakpoint = isSvelte5 ? BreakpointSvelte5 : BreakpointSvelte4; + describe("Breakpoint", () => { beforeEach(() => { vi.useFakeTimers(); @@ -31,63 +35,125 @@ describe("Breakpoint", () => { expect(screen.getByTestId("is-max").textContent).toBe("false"); }); - it("updates when window size changes", async () => { - const mockChangeHandler = vi.fn(); - const mediaQueryListeners = new Map(); - - vi.stubGlobal("matchMedia", (query: string) => { - const isLgQuery = query.includes( - "(min-width: 1056px) and (max-width: 1312px)", - ); - - return { - matches: isLgQuery, - media: query, - addEventListener: (event: string, listener: MediaQueryList) => { - if (!mediaQueryListeners.has(query)) { - mediaQueryListeners.set(query, []); + describe.skipIf(isSvelte5)("svelte 4", () => { + it("updates when window size changes", async () => { + const mockChangeHandler = vi.fn(); + const mediaQueryListeners = new Map(); + + vi.stubGlobal("matchMedia", (query: string) => { + const isLgQuery = query.includes( + "(min-width: 1056px) and (max-width: 1312px)", + ); + + return { + matches: isLgQuery, + media: query, + addEventListener: (event: string, listener: MediaQueryList) => { + if (!mediaQueryListeners.has(query)) { + mediaQueryListeners.set(query, []); + } + mediaQueryListeners.get(query).push({ event, listener }); + }, + removeEventListener: vi.fn(), + }; + }); + + const { component } = render(Breakpoint); + component.$on("change", mockChangeHandler); + + expect(screen.getByTestId("current-size").textContent).toBe("lg"); + mockChangeHandler.mockClear(); + + for (const [query, listeners] of mediaQueryListeners.entries()) { + const isXlgQuery = query.includes( + "(min-width: 1312px) and (max-width: 1584px)", + ); + + for (const { event, listener } of listeners) { + if (event === "change") { + listener({ matches: isXlgQuery, media: query }); } - mediaQueryListeners.get(query).push({ event, listener }); - }, - removeEventListener: vi.fn(), - }; - }); + } + } - const { component } = render(Breakpoint); - component.$on("change", mockChangeHandler); + await vi.runOnlyPendingTimersAsync(); - expect(screen.getByTestId("current-size").textContent).toBe("lg"); - mockChangeHandler.mockClear(); + expect(mockChangeHandler).toHaveBeenCalled(); + + component.$set({ + size: "xlg", + sizes: { + sm: false, + md: false, + lg: false, + xlg: true, + max: false, + }, + }); - for (const [query, listeners] of mediaQueryListeners.entries()) { - const isXlgQuery = query.includes( - "(min-width: 1312px) and (max-width: 1584px)", - ); + expect(screen.getByTestId("current-size").textContent).toBe("xlg"); + expect(screen.getByTestId("is-xlg").textContent).toBe("true"); + }); + }); - for (const { event, listener } of listeners) { - if (event === "change") { - listener({ matches: isXlgQuery, media: query }); + describe.skipIf(isSvelte4)("svelte 5", () => { + it("updates when window size changes", async () => { + const mockChangeHandler = vi.fn(); + const mediaQueryListeners = new Map(); + + vi.stubGlobal("matchMedia", (query: string) => { + const isLgQuery = query.includes( + "(min-width: 1056px) and (max-width: 1312px)", + ); + + return { + matches: isLgQuery, + media: query, + addEventListener: (event: string, listener: MediaQueryList) => { + if (!mediaQueryListeners.has(query)) { + mediaQueryListeners.set(query, []); + } + mediaQueryListeners.get(query).push({ event, listener }); + }, + removeEventListener: vi.fn(), + }; + }); + + const { rerender } = render(Breakpoint, { onchange: mockChangeHandler }); + + expect(screen.getByTestId("current-size").textContent).toBe("lg"); + mockChangeHandler.mockClear(); + + for (const [query, listeners] of mediaQueryListeners.entries()) { + const isXlgQuery = query.includes( + "(min-width: 1312px) and (max-width: 1584px)", + ); + + for (const { event, listener } of listeners) { + if (event === "change") { + listener({ matches: isXlgQuery, media: query }); + } } } - } - await vi.runOnlyPendingTimersAsync(); + await vi.runOnlyPendingTimersAsync(); - expect(mockChangeHandler).toHaveBeenCalled(); + expect(mockChangeHandler).toHaveBeenCalled(); - component.$set({ - size: "xlg", - sizes: { - sm: false, - md: false, - lg: false, - xlg: true, - max: false, - }, - }); + await rerender({ + size: "xlg", + sizes: { + sm: false, + md: false, + lg: false, + xlg: true, + max: false, + }, + }); - expect(screen.getByTestId("current-size").textContent).toBe("xlg"); - expect(screen.getByTestId("is-xlg").textContent).toBe("true"); + expect(screen.getByTestId("current-size").textContent).toBe("xlg"); + expect(screen.getByTestId("is-xlg").textContent).toBe("true"); + }); }); it("provides breakpointObserver utilities", () => { diff --git a/tests/ComposedModal/ComposedModal.svelte5.test.svelte b/tests/ComposedModal/ComposedModal.svelte5.test.svelte new file mode 100644 index 0000000000..e6d502c1ad --- /dev/null +++ b/tests/ComposedModal/ComposedModal.svelte5.test.svelte @@ -0,0 +1,83 @@ + + + { + console.log("submit"); + if (onsubmit) onsubmit(e); + }} + onclick_button__primary={(e) => { + console.log("click:button--primary"); + if (onclick_button__primary) onclick_button__primary(e); + }} + ontransitionend={(e) => { + console.log("transitionend", e.detail); + if (ontransitionend) ontransitionend(e); + }} + {...$$restProps} +> + {#if headerTitle || headerLabel} + + {/if} + + + + + {#if footerPrimaryButtonText || footerSecondaryButtonText} + { + console.log("click:button--secondary", e.detail); + if (onclick_button__secondary) onclick_button__secondary(e); + }} + /> + {/if} + diff --git a/tests/ComposedModal/ComposedModal.test.ts b/tests/ComposedModal/ComposedModal.test.ts index db86de3f00..66dcd8b78d 100644 --- a/tests/ComposedModal/ComposedModal.test.ts +++ b/tests/ComposedModal/ComposedModal.test.ts @@ -1,7 +1,12 @@ import { render, screen } from "@testing-library/svelte"; import { tick } from "svelte"; -import { user } from "../setup-tests"; -import ComposedModalTest from "./ComposedModal.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import ComposedModalTestSvelte4 from "./ComposedModal.test.svelte"; +import ComposedModalTestSvelte5 from "./ComposedModal.svelte5.test.svelte"; + +const ComposedModalTest = isSvelte5 + ? ComposedModalTestSvelte5 + : ComposedModalTestSvelte4; describe("ComposedModal", () => { beforeEach(() => { diff --git a/tests/DatePicker/DatePicker.svelte5.test.svelte b/tests/DatePicker/DatePicker.svelte5.test.svelte new file mode 100644 index 0000000000..ce41c5a97a --- /dev/null +++ b/tests/DatePicker/DatePicker.svelte5.test.svelte @@ -0,0 +1,54 @@ + + + + + diff --git a/tests/DatePicker/DatePicker.test.ts b/tests/DatePicker/DatePicker.test.ts index 2ac4736ad7..a211dd7079 100644 --- a/tests/DatePicker/DatePicker.test.ts +++ b/tests/DatePicker/DatePicker.test.ts @@ -1,9 +1,12 @@ import { render, screen } from "@testing-library/svelte"; import { tick } from "svelte"; -import { user } from "../setup-tests"; -import DatePicker from "./DatePicker.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import DatePickerSvelte4 from "./DatePicker.test.svelte"; +import DatePickerSvelte5 from "./DatePicker.svelte5.test.svelte"; import DatePickerRange from "./DatePickerRange.test.svelte"; +const DatePicker = isSvelte5 ? DatePickerSvelte5 : DatePickerSvelte4; + describe("DatePicker", () => { it("renders with default props", async () => { render(DatePicker); @@ -108,58 +111,110 @@ describe("DatePicker", () => { expect(screen.getByText("Date")).toHaveClass("bx--visually-hidden"); }); - it("dispatches change event when manually typing in simple mode", async () => { - const changeHandler = vi.fn(); - const { component } = render(DatePicker, { - datePickerType: "simple", + describe.skipIf(isSvelte5)("svelte 4", () => { + it("dispatches change event when manually typing in simple mode", async () => { + const changeHandler = vi.fn(); + const { component } = render(DatePicker, { + datePickerType: "simple", + }); + + component.$on("change", changeHandler); + + const input = screen.getByLabelText("Date"); + await user.type(input, "01/15/2024"); + await user.tab(); + + expect(changeHandler).toHaveBeenCalled(); + expect(changeHandler.mock.lastCall?.[0]?.detail).toBe("01/15/2024"); }); - component.$on("change", changeHandler); + it("dispatches change event when manually typing in single mode", async () => { + const changeHandler = vi.fn(); + const { component } = render(DatePicker, { + datePickerType: "single", + }); - const input = screen.getByLabelText("Date"); - await user.type(input, "01/15/2024"); - await user.tab(); + component.$on("change", changeHandler); - expect(changeHandler).toHaveBeenCalled(); - expect(changeHandler.mock.lastCall?.[0]?.detail).toBe("01/15/2024"); - }); + const input = screen.getByLabelText("Date"); + await user.type(input, "01/15/2024"); + await user.tab(); - it("dispatches change event when manually typing in single mode", async () => { - const changeHandler = vi.fn(); - const { component } = render(DatePicker, { - datePickerType: "single", + expect(changeHandler).toHaveBeenCalled(); + expect(changeHandler.mock.lastCall?.[0]?.detail).toMatchObject({ + dateStr: "01/15/2024", + }); }); - component.$on("change", changeHandler); + it("dispatches change event when manually clearing in single mode", async () => { + const changeHandler = vi.fn(); + const { component } = render(DatePicker, { + datePickerType: "single", + value: "01/15/2024", + }); - const input = screen.getByLabelText("Date"); - await user.type(input, "01/15/2024"); - await user.tab(); + component.$on("change", changeHandler); - expect(changeHandler).toHaveBeenCalled(); - expect(changeHandler.mock.lastCall?.[0]?.detail).toMatchObject({ - dateStr: "01/15/2024", + const input = screen.getByLabelText("Date"); + await user.clear(input); + await user.tab(); + + expect(changeHandler).toHaveBeenCalled(); + expect(changeHandler.mock.lastCall?.[0]?.detail).toMatchObject({ + dateStr: "", + }); }); }); - // Regression tests for https://github.com/carbon-design-system/carbon-components-svelte/issues/314 - // and https://github.com/carbon-design-system/carbon-components-svelte/issues/950 - it("dispatches change event when manually clearing in single mode", async () => { - const changeHandler = vi.fn(); - const { component } = render(DatePicker, { - datePickerType: "single", - value: "01/15/2024", - }); + describe.skipIf(isSvelte4)("svelte 5", () => { + it("dispatches change event when manually typing in simple mode", async () => { + const changeHandler = vi.fn(); + render(DatePicker, { + datePickerType: "simple", + onchange: changeHandler, + }); - component.$on("change", changeHandler); + const input = screen.getByLabelText("Date"); + await user.type(input, "01/15/2024"); + await user.tab(); - const input = screen.getByLabelText("Date"); - await user.clear(input); - await user.tab(); + expect(changeHandler).toHaveBeenCalled(); + expect(changeHandler.mock.lastCall?.[0]?.detail).toBe("01/15/2024"); + }); + + it("dispatches change event when manually typing in single mode", async () => { + const changeHandler = vi.fn(); + render(DatePicker, { + datePickerType: "single", + onchange: changeHandler, + }); + + const input = screen.getByLabelText("Date"); + await user.type(input, "01/15/2024"); + await user.tab(); + + expect(changeHandler).toHaveBeenCalled(); + expect(changeHandler.mock.lastCall?.[0]?.detail).toMatchObject({ + dateStr: "01/15/2024", + }); + }); - expect(changeHandler).toHaveBeenCalled(); - expect(changeHandler.mock.lastCall?.[0]?.detail).toMatchObject({ - dateStr: "", + it("dispatches change event when manually clearing in single mode", async () => { + const changeHandler = vi.fn(); + render(DatePicker, { + datePickerType: "single", + value: "01/15/2024", + onchange: changeHandler, + }); + + const input = screen.getByLabelText("Date"); + await user.clear(input); + await user.tab(); + + expect(changeHandler).toHaveBeenCalled(); + expect(changeHandler.mock.lastCall?.[0]?.detail).toMatchObject({ + dateStr: "", + }); }); }); diff --git a/tests/Dropdown/Dropdown.svelte5.test.svelte b/tests/Dropdown/Dropdown.svelte5.test.svelte new file mode 100644 index 0000000000..aec5be629c --- /dev/null +++ b/tests/Dropdown/Dropdown.svelte5.test.svelte @@ -0,0 +1,54 @@ + + + diff --git a/tests/Dropdown/Dropdown.test.ts b/tests/Dropdown/Dropdown.test.ts index ef73c288bd..b5f465835a 100644 --- a/tests/Dropdown/Dropdown.test.ts +++ b/tests/Dropdown/Dropdown.test.ts @@ -1,8 +1,11 @@ import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Dropdown from "./Dropdown.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import DropdownSvelte4 from "./Dropdown.test.svelte"; +import DropdownSvelte5 from "./Dropdown.svelte5.test.svelte"; import DropdownSlot from "./DropdownSlot.test.svelte"; +const Dropdown = isSvelte5 ? DropdownSvelte5 : DropdownSvelte4; + const items = [ { id: "0", text: "Slack" }, { id: "1", text: "Email" }, @@ -163,30 +166,57 @@ describe("Dropdown", () => { expect(screen.getByText("Help text")).toHaveClass("bx--form__helper-text"); }); - it("should handle item selection", async () => { - const { component } = render(Dropdown, { - props: { + describe.skipIf(isSvelte5)("svelte 4", () => { + it("should handle item selection", async () => { + const { component } = render(Dropdown, { + props: { + items, + selectedId: "0", + }, + }); + + const selectHandler = vi.fn(); + component.$on("select", selectHandler); + + const button = screen.getByRole("button"); + await user.click(button); + + const menuItemText = screen.getByText("Email"); + const menuItem = menuItemText.closest(".bx--list-box__menu-item"); + assert(menuItem); + await user.click(menuItem); + + expect(selectHandler).toHaveBeenCalledWith( + expect.objectContaining({ + detail: { selectedId: "1", selectedItem: items[1] }, + }), + ); + }); + }); + + describe.skipIf(isSvelte4)("svelte 5", () => { + it("should handle item selection", async () => { + const selectHandler = vi.fn(); + render(Dropdown, { items, selectedId: "0", - }, + onselect: selectHandler, + }); + + const button = screen.getByRole("button"); + await user.click(button); + + const menuItemText = screen.getByText("Email"); + const menuItem = menuItemText.closest(".bx--list-box__menu-item"); + assert(menuItem); + await user.click(menuItem); + + expect(selectHandler).toHaveBeenCalledWith( + expect.objectContaining({ + detail: { selectedId: "1", selectedItem: items[1] }, + }), + ); }); - - const selectHandler = vi.fn(); - component.$on("select", selectHandler); - - const button = screen.getByRole("button"); - await user.click(button); - - const menuItemText = screen.getByText("Email"); - const menuItem = menuItemText.closest(".bx--list-box__menu-item"); - assert(menuItem); - await user.click(menuItem); - - expect(selectHandler).toHaveBeenCalledWith( - expect.objectContaining({ - detail: { selectedId: "1", selectedItem: items[1] }, - }), - ); }); it("should handle keyboard navigation", async () => { diff --git a/tests/ImageLoader/ImageLoader.svelte5.test.svelte b/tests/ImageLoader/ImageLoader.svelte5.test.svelte new file mode 100644 index 0000000000..7b7624f308 --- /dev/null +++ b/tests/ImageLoader/ImageLoader.svelte5.test.svelte @@ -0,0 +1,58 @@ + + + + +
+ +
+ +
+ + +
+ +
+
+ +
An error occurred.
+
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
Failed to load image
+
+
+
diff --git a/tests/ImageLoader/ImageLoader.test.ts b/tests/ImageLoader/ImageLoader.test.ts index 86640905bd..b1a4ea57b4 100644 --- a/tests/ImageLoader/ImageLoader.test.ts +++ b/tests/ImageLoader/ImageLoader.test.ts @@ -1,5 +1,9 @@ import { render, screen } from "@testing-library/svelte"; -import ImageLoader from "./ImageLoader.test.svelte"; +import { isSvelte4, isSvelte5 } from "../setup-tests"; +import ImageLoaderSvelte4 from "./ImageLoader.test.svelte"; +import ImageLoaderSvelte5 from "./ImageLoader.svelte5.test.svelte"; + +const ImageLoader = isSvelte5 ? ImageLoaderSvelte5 : ImageLoaderSvelte4; describe("ImageLoader", () => { beforeEach(() => { @@ -99,31 +103,60 @@ describe("ImageLoader", () => { } }); - it("dispatches load and error events", async () => { - const { component } = render(ImageLoader); + describe.skipIf(isSvelte5)("svelte 4", () => { + it("dispatches load and error events", async () => { + const { component } = render(ImageLoader); - const load = vi.fn(); - const error = vi.fn(); + const load = vi.fn(); + const error = vi.fn(); - component.$on("load", load); - component.$on("error", error); + component.$on("load", load); + component.$on("error", error); - const defaultWrapper = screen.getByTestId("default-loader"); - const defaultImg = defaultWrapper.querySelector("img"); - expect(defaultImg).toBeDefined(); + const defaultWrapper = screen.getByTestId("default-loader"); + const defaultImg = defaultWrapper.querySelector("img"); + expect(defaultImg).toBeDefined(); - if (defaultImg) { - defaultImg.dispatchEvent(new Event("load")); - expect(load).toHaveBeenCalled(); - } + if (defaultImg) { + defaultImg.dispatchEvent(new Event("load")); + expect(load).toHaveBeenCalled(); + } - const errorWrapper = screen.getByTestId("error-loader"); - const errorImg = errorWrapper.querySelector("img"); - expect(errorImg).toBeDefined(); + const errorWrapper = screen.getByTestId("error-loader"); + const errorImg = errorWrapper.querySelector("img"); + expect(errorImg).toBeDefined(); - if (errorImg) { - errorImg.dispatchEvent(new Event("error")); - expect(error).toHaveBeenCalled(); - } + if (errorImg) { + errorImg.dispatchEvent(new Event("error")); + expect(error).toHaveBeenCalled(); + } + }); + }); + + describe.skipIf(isSvelte4)("svelte 5", () => { + it("dispatches load and error events", async () => { + const load = vi.fn(); + const error = vi.fn(); + + render(ImageLoader, { onload: load, onerror: error }); + + const defaultWrapper = screen.getByTestId("default-loader"); + const defaultImg = defaultWrapper.querySelector("img"); + expect(defaultImg).toBeDefined(); + + if (defaultImg) { + defaultImg.dispatchEvent(new Event("load")); + expect(load).toHaveBeenCalled(); + } + + const errorWrapper = screen.getByTestId("error-loader"); + const errorImg = errorWrapper.querySelector("img"); + expect(errorImg).toBeDefined(); + + if (errorImg) { + errorImg.dispatchEvent(new Event("error")); + expect(error).toHaveBeenCalled(); + } + }); }); }); diff --git a/tests/ListBox/ListBox.svelte5.test.svelte b/tests/ListBox/ListBox.svelte5.test.svelte new file mode 100644 index 0000000000..95938bb18f --- /dev/null +++ b/tests/ListBox/ListBox.svelte5.test.svelte @@ -0,0 +1,36 @@ + + + + {#if slotContent} + {slotContent} + {/if} + diff --git a/tests/ListBox/ListBox.test.ts b/tests/ListBox/ListBox.test.ts index 7226c70fc2..99d9ac7c27 100644 --- a/tests/ListBox/ListBox.test.ts +++ b/tests/ListBox/ListBox.test.ts @@ -1,6 +1,9 @@ import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import ListBox from "./ListBox.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import ListBoxSvelte4 from "./ListBox.test.svelte"; +import ListBoxSvelte5 from "./ListBox.svelte5.test.svelte"; + +const ListBox = isSvelte5 ? ListBoxSvelte5 : ListBoxSvelte4; describe("ListBox", () => { it("should render with default props", () => { diff --git a/tests/ListBox/ListBoxField.svelte5.test.svelte b/tests/ListBox/ListBoxField.svelte5.test.svelte new file mode 100644 index 0000000000..c60b0ec085 --- /dev/null +++ b/tests/ListBox/ListBoxField.svelte5.test.svelte @@ -0,0 +1,43 @@ + + + + + + {#if slotContent} + {slotContent} + {/if} + diff --git a/tests/ListBox/ListBoxField.test.ts b/tests/ListBox/ListBoxField.test.ts index 2c8f5adcc9..bea788412c 100644 --- a/tests/ListBox/ListBoxField.test.ts +++ b/tests/ListBox/ListBoxField.test.ts @@ -1,6 +1,9 @@ import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import ListBoxField from "./ListBoxField.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import ListBoxFieldSvelte4 from "./ListBoxField.test.svelte"; +import ListBoxFieldSvelte5 from "./ListBoxField.svelte5.test.svelte"; + +const ListBoxField = isSvelte5 ? ListBoxFieldSvelte5 : ListBoxFieldSvelte4; describe("ListBoxField", () => { it("should render with default props", () => { diff --git a/tests/ListBox/ListBoxMenu.svelte5.test.svelte b/tests/ListBox/ListBoxMenu.svelte5.test.svelte new file mode 100644 index 0000000000..e67c5dc6bb --- /dev/null +++ b/tests/ListBox/ListBoxMenu.svelte5.test.svelte @@ -0,0 +1,17 @@ + + + + + + {#if slotContent} + {slotContent} + {/if} + diff --git a/tests/ListBox/ListBoxMenu.test.ts b/tests/ListBox/ListBoxMenu.test.ts index 13dede4d4d..eff0ea6f2f 100644 --- a/tests/ListBox/ListBoxMenu.test.ts +++ b/tests/ListBox/ListBoxMenu.test.ts @@ -1,5 +1,9 @@ import { render, screen } from "@testing-library/svelte"; -import ListBoxMenu from "./ListBoxMenu.test.svelte"; +import { isSvelte4, isSvelte5 } from "../setup-tests"; +import ListBoxMenuSvelte4 from "./ListBoxMenu.test.svelte"; +import ListBoxMenuSvelte5 from "./ListBoxMenu.svelte5.test.svelte"; + +const ListBoxMenu = isSvelte5 ? ListBoxMenuSvelte5 : ListBoxMenuSvelte4; describe("ListBoxMenu", () => { it("should render with default props", () => { diff --git a/tests/ListBox/ListBoxMenuIcon.svelte5.test.svelte b/tests/ListBox/ListBoxMenuIcon.svelte5.test.svelte new file mode 100644 index 0000000000..016bde2bf9 --- /dev/null +++ b/tests/ListBox/ListBoxMenuIcon.svelte5.test.svelte @@ -0,0 +1,13 @@ + + + + + diff --git a/tests/ListBox/ListBoxMenuIcon.test.ts b/tests/ListBox/ListBoxMenuIcon.test.ts index ad62d2d3cd..6fd49d8a81 100644 --- a/tests/ListBox/ListBoxMenuIcon.test.ts +++ b/tests/ListBox/ListBoxMenuIcon.test.ts @@ -1,6 +1,11 @@ import { render } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import ListBoxMenuIcon from "./ListBoxMenuIcon.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import ListBoxMenuIconSvelte4 from "./ListBoxMenuIcon.test.svelte"; +import ListBoxMenuIconSvelte5 from "./ListBoxMenuIcon.svelte5.test.svelte"; + +const ListBoxMenuIcon = isSvelte5 + ? ListBoxMenuIconSvelte5 + : ListBoxMenuIconSvelte4; describe("ListBoxMenuIcon", () => { it("should render with default props", () => { diff --git a/tests/ListBox/ListBoxMenuItem.svelte5.test.svelte b/tests/ListBox/ListBoxMenuItem.svelte5.test.svelte new file mode 100644 index 0000000000..c815d338d1 --- /dev/null +++ b/tests/ListBox/ListBoxMenuItem.svelte5.test.svelte @@ -0,0 +1,26 @@ + + + + {#if slotContent} + {slotContent} + {/if} + diff --git a/tests/ListBox/ListBoxMenuItem.test.ts b/tests/ListBox/ListBoxMenuItem.test.ts index 391b5bbf14..dc1ed2f0a6 100644 --- a/tests/ListBox/ListBoxMenuItem.test.ts +++ b/tests/ListBox/ListBoxMenuItem.test.ts @@ -1,6 +1,11 @@ import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import ListBoxMenuItem from "./ListBoxMenuItem.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import ListBoxMenuItemSvelte4 from "./ListBoxMenuItem.test.svelte"; +import ListBoxMenuItemSvelte5 from "./ListBoxMenuItem.svelte5.test.svelte"; + +const ListBoxMenuItem = isSvelte5 + ? ListBoxMenuItemSvelte5 + : ListBoxMenuItemSvelte4; describe("ListBoxMenuItem", () => { it("should render with default props", () => { diff --git a/tests/ListBox/ListBoxSelection.svelte5.test.svelte b/tests/ListBox/ListBoxSelection.svelte5.test.svelte new file mode 100644 index 0000000000..4444c4eb30 --- /dev/null +++ b/tests/ListBox/ListBoxSelection.svelte5.test.svelte @@ -0,0 +1,23 @@ + + + + + diff --git a/tests/ListBox/ListBoxSelection.test.ts b/tests/ListBox/ListBoxSelection.test.ts index 7f53b422c9..1913dc526d 100644 --- a/tests/ListBox/ListBoxSelection.test.ts +++ b/tests/ListBox/ListBoxSelection.test.ts @@ -1,6 +1,11 @@ import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import ListBoxSelection from "./ListBoxSelection.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import ListBoxSelectionSvelte4 from "./ListBoxSelection.test.svelte"; +import ListBoxSelectionSvelte5 from "./ListBoxSelection.svelte5.test.svelte"; + +const ListBoxSelection = isSvelte5 + ? ListBoxSelectionSvelte5 + : ListBoxSelectionSvelte4; describe("ListBoxSelection", () => { it("should render single selection button", () => { diff --git a/tests/Modal/Modal.svelte5.test.svelte b/tests/Modal/Modal.svelte5.test.svelte new file mode 100644 index 0000000000..72559af173 --- /dev/null +++ b/tests/Modal/Modal.svelte5.test.svelte @@ -0,0 +1,77 @@ + + + { + console.log("submit"); + if (onsubmit) onsubmit(e); + }} + onclick_button__primary={(e) => { + console.log("click:button--primary"); + if (onclick_button__primary) onclick_button__primary(e); + }} + onclick_button__secondary={(e) => { + console.log("click:button--secondary", e.detail); + if (onclick_button__secondary) onclick_button__secondary(e); + }} + ontransitionend={(e) => { + console.log("transitionend", e.detail); + if (ontransitionend) ontransitionend(e); + }} +> + + + diff --git a/tests/Modal/Modal.test.ts b/tests/Modal/Modal.test.ts index c41bc402cf..17113fe9d8 100644 --- a/tests/Modal/Modal.test.ts +++ b/tests/Modal/Modal.test.ts @@ -1,7 +1,10 @@ import { render, screen } from "@testing-library/svelte"; import { tick } from "svelte"; -import { user } from "../setup-tests"; -import ModalTest from "./Modal.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import ModalTestSvelte4 from "./Modal.test.svelte"; +import ModalTestSvelte5 from "./Modal.svelte5.test.svelte"; + +const ModalTest = isSvelte5 ? ModalTestSvelte5 : ModalTestSvelte4; describe("Modal", () => { beforeEach(() => { diff --git a/tests/NumberInput/NumberInput.svelte5.test.svelte b/tests/NumberInput/NumberInput.svelte5.test.svelte new file mode 100644 index 0000000000..5954c24be3 --- /dev/null +++ b/tests/NumberInput/NumberInput.svelte5.test.svelte @@ -0,0 +1,73 @@ + + + + +
{value}
diff --git a/tests/NumberInput/NumberInput.test.ts b/tests/NumberInput/NumberInput.test.ts index caba58cf59..4e4f08519e 100644 --- a/tests/NumberInput/NumberInput.test.ts +++ b/tests/NumberInput/NumberInput.test.ts @@ -1,8 +1,11 @@ import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import NumberInput from "./NumberInput.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import NumberInputSvelte4 from "./NumberInput.test.svelte"; +import NumberInputSvelte5 from "./NumberInput.svelte5.test.svelte"; import NumberInputCustom from "./NumberInputCustom.test.svelte"; +const NumberInput = isSvelte5 ? NumberInputSvelte5 : NumberInputSvelte4; + describe("NumberInput", () => { it("should render with default props", () => { render(NumberInput); @@ -235,49 +238,202 @@ describe("NumberInput", () => { ); }); - it("should dispatch keydown event", async () => { - const { component } = render(NumberInput); - const mockHandler = vi.fn(); - component.$on("keydown", mockHandler); + describe.skipIf(isSvelte5)("svelte 4", () => { + it("should dispatch keydown event", async () => { + const { component } = render(NumberInput); + const mockHandler = vi.fn(); + component.$on("keydown", mockHandler); - const input = screen.getByRole("spinbutton"); - await user.type(input, "{Enter}"); + const input = screen.getByRole("spinbutton"); + await user.type(input, "{Enter}"); - expect(mockHandler).toHaveBeenCalled(); - }); + expect(mockHandler).toHaveBeenCalled(); + }); - it("should dispatch keyup event", async () => { - const { component } = render(NumberInput); - const mockHandler = vi.fn(); - component.$on("keyup", mockHandler); + it("should dispatch keyup event", async () => { + const { component } = render(NumberInput); + const mockHandler = vi.fn(); + component.$on("keyup", mockHandler); - const input = screen.getByRole("spinbutton"); - await user.type(input, "5"); + const input = screen.getByRole("spinbutton"); + await user.type(input, "5"); - expect(mockHandler).toHaveBeenCalled(); - }); + expect(mockHandler).toHaveBeenCalled(); + }); - it("should dispatch focus event", async () => { - const { component } = render(NumberInput); - const mockHandler = vi.fn(); - component.$on("focus", mockHandler); + it("should dispatch focus event", async () => { + const { component } = render(NumberInput); + const mockHandler = vi.fn(); + component.$on("focus", mockHandler); - const input = screen.getByRole("spinbutton"); - await user.click(input); + const input = screen.getByRole("spinbutton"); + await user.click(input); - expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch blur event", async () => { + const { component } = render(NumberInput); + const mockHandler = vi.fn(); + component.$on("blur", mockHandler); + + const input = screen.getByRole("spinbutton"); + await user.click(input); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch change event on typing", async () => { + const { component } = render(NumberInput); + const mockHandler = vi.fn(); + component.$on("change", mockHandler); + + const input = screen.getByRole("spinbutton"); + await user.type(input, "5"); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(5); + }); + + it("should dispatch input event on typing", async () => { + const { component } = render(NumberInput); + const mockHandler = vi.fn(); + component.$on("input", mockHandler); + + const input = screen.getByRole("spinbutton"); + await user.type(input, "7"); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(7); + }); + + it("should dispatch both change and input events on stepper click", async () => { + const { component } = render(NumberInput); + const changeHandler = vi.fn(); + const inputHandler = vi.fn(); + component.$on("change", changeHandler); + component.$on("input", inputHandler); + + const incrementButton = screen.getByRole("button", { + name: "Increment number", + }); + await user.click(incrementButton); + + expect(changeHandler).toHaveBeenCalled(); + expect(inputHandler).toHaveBeenCalled(); + expect(changeHandler.mock.calls[0][0].detail).toBe(1); + expect(inputHandler.mock.calls[0][0].detail).toBe(1); + }); + + it("should dispatch events with null when clearing input", async () => { + const { component } = render(NumberInput, { props: { value: 10 } }); + const inputHandler = vi.fn(); + component.$on("input", inputHandler); + + const input = screen.getByRole("spinbutton"); + await user.clear(input); + + expect(inputHandler).toHaveBeenCalled(); + expect(inputHandler.mock.calls[0][0].detail).toBe(null); + }); }); - it("should dispatch blur event", async () => { - const { component } = render(NumberInput); - const mockHandler = vi.fn(); - component.$on("blur", mockHandler); + describe.skipIf(isSvelte4)("svelte 5", () => { + it("should dispatch keydown event", async () => { + const mockHandler = vi.fn(); + render(NumberInput, { onkeydown: mockHandler }); - const input = screen.getByRole("spinbutton"); - await user.click(input); - await user.tab(); + const input = screen.getByRole("spinbutton"); + await user.type(input, "{Enter}"); - expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch keyup event", async () => { + const mockHandler = vi.fn(); + render(NumberInput, { onkeyup: mockHandler }); + + const input = screen.getByRole("spinbutton"); + await user.type(input, "5"); + + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch focus event", async () => { + const mockHandler = vi.fn(); + render(NumberInput, { onfocus: mockHandler }); + + const input = screen.getByRole("spinbutton"); + await user.click(input); + + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch blur event", async () => { + const mockHandler = vi.fn(); + render(NumberInput, { onblur: mockHandler }); + + const input = screen.getByRole("spinbutton"); + await user.click(input); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch change event on typing", async () => { + const mockHandler = vi.fn(); + render(NumberInput, { onchange: mockHandler }); + + const input = screen.getByRole("spinbutton"); + await user.type(input, "5"); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(5); + }); + + it("should dispatch input event on typing", async () => { + const mockHandler = vi.fn(); + render(NumberInput, { oninput: mockHandler }); + + const input = screen.getByRole("spinbutton"); + await user.type(input, "7"); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(7); + }); + + it("should dispatch both change and input events on stepper click", async () => { + const changeHandler = vi.fn(); + const inputHandler = vi.fn(); + render(NumberInput, { + onchange: changeHandler, + oninput: inputHandler, + }); + + const incrementButton = screen.getByRole("button", { + name: "Increment number", + }); + await user.click(incrementButton); + + expect(changeHandler).toHaveBeenCalled(); + expect(inputHandler).toHaveBeenCalled(); + expect(changeHandler.mock.calls[0][0].detail).toBe(1); + expect(inputHandler.mock.calls[0][0].detail).toBe(1); + }); + + it("should dispatch events with null when clearing input", async () => { + const inputHandler = vi.fn(); + render(NumberInput, { value: 10, oninput: inputHandler }); + + const input = screen.getByRole("spinbutton"); + await user.clear(input); + + expect(inputHandler).toHaveBeenCalled(); + expect(inputHandler.mock.calls[0][0].detail).toBe(null); + }); }); it("should have paste event listener", () => { diff --git a/tests/OrderedList/OrderedList.svelte5.test.svelte b/tests/OrderedList/OrderedList.svelte5.test.svelte new file mode 100644 index 0000000000..cd86f8d62a --- /dev/null +++ b/tests/OrderedList/OrderedList.svelte5.test.svelte @@ -0,0 +1,40 @@ + + + + +
+ + {#each items as item} + + {item} + {#if nested && nestedItems.length > 0} + + {#each nestedItems as nestedItem} + {nestedItem} + {/each} + + {/if} + + {/each} + +
diff --git a/tests/OrderedList/OrderedList.test.ts b/tests/OrderedList/OrderedList.test.ts index 56357e5c78..98b70a2268 100644 --- a/tests/OrderedList/OrderedList.test.ts +++ b/tests/OrderedList/OrderedList.test.ts @@ -1,6 +1,9 @@ import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import OrderedList from "./OrderedList.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import OrderedListSvelte4 from "./OrderedList.test.svelte"; +import OrderedListSvelte5 from "./OrderedList.svelte5.test.svelte"; + +const OrderedList = isSvelte5 ? OrderedListSvelte5 : OrderedListSvelte4; describe("OrderedList", () => { it("should render with default props", () => { @@ -98,32 +101,60 @@ describe("OrderedList", () => { }); describe("events", () => { - it("should emit click event", async () => { - const { component } = render(OrderedList); - const list = screen.getByRole("list"); + describe.skipIf(isSvelte5)("svelte 4", () => { + it("should emit click event", async () => { + const { component } = render(OrderedList); + const list = screen.getByRole("list"); + + const mock = vi.fn(); + component.$on("click", mock); + + await user.click(list); + expect(mock).toHaveBeenCalled(); + }); + + test.each(["mouseover", "mouseenter", "mouseleave"])( + "should emit %s event", + (eventName) => { + const { component } = render(OrderedList); + const list = screen.getByRole("list"); + + const mock = vi.fn(); + component.$on(eventName, mock); - const mock = vi.fn(); - component.$on("click", mock); + const event = new MouseEvent(eventName); + list.dispatchEvent(event); - await user.click(list); - expect(mock).toHaveBeenCalled(); + expect(mock).toHaveBeenCalled(); + }, + ); }); - test.each(["mouseover", "mouseenter", "mouseleave"])( - "should emit %s event", - (eventName) => { - const { component } = render(OrderedList); + describe.skipIf(isSvelte4)("svelte 5", () => { + it("should emit click event", async () => { + const mock = vi.fn(); + render(OrderedList, { onclick: mock }); const list = screen.getByRole("list"); - const mock = vi.fn(); - component.$on(eventName, mock); + await user.click(list); + expect(mock).toHaveBeenCalled(); + }); - const event = new MouseEvent(eventName); - list.dispatchEvent(event); + test.each(["mouseover", "mouseenter", "mouseleave"])( + "should emit %s event", + (eventName) => { + const mock = vi.fn(); + const props = { [`on${eventName}`]: mock }; + render(OrderedList, props); + const list = screen.getByRole("list"); - expect(mock).toHaveBeenCalled(); - }, - ); + const event = new MouseEvent(eventName, { bubbles: true }); + list.dispatchEvent(event); + + expect(mock).toHaveBeenCalled(); + }, + ); + }); }); describe("accessibility", () => { diff --git a/tests/ProgressIndicator/ProgressIndicator.svelte5.test.svelte b/tests/ProgressIndicator/ProgressIndicator.svelte5.test.svelte new file mode 100644 index 0000000000..b788caf80d --- /dev/null +++ b/tests/ProgressIndicator/ProgressIndicator.svelte5.test.svelte @@ -0,0 +1,38 @@ + + + { + console.log("change", e.detail); + if (onchange) onchange(e); + }} +> + {#each steps as step} + + {/each} + diff --git a/tests/ProgressIndicator/ProgressIndicator.test.ts b/tests/ProgressIndicator/ProgressIndicator.test.ts index 649d37cbfb..98f762e2f9 100644 --- a/tests/ProgressIndicator/ProgressIndicator.test.ts +++ b/tests/ProgressIndicator/ProgressIndicator.test.ts @@ -1,6 +1,11 @@ import { render, screen } from "@testing-library/svelte"; -import ProgressIndicator from "./ProgressIndicator.test.svelte"; -import { user } from "../setup-tests"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import ProgressIndicatorSvelte4 from "./ProgressIndicator.test.svelte"; +import ProgressIndicatorSvelte5 from "./ProgressIndicator.svelte5.test.svelte"; + +const ProgressIndicator = isSvelte5 + ? ProgressIndicatorSvelte5 + : ProgressIndicatorSvelte4; describe("ProgressIndicator", () => { describe("Default (horizontal)", () => { @@ -56,24 +61,45 @@ describe("ProgressIndicator", () => { expect(consoleLog).toHaveBeenCalledWith("change", 0); }); - it("should not update currentIndex when preventChangeOnClick is true", async () => { - const { component } = render(ProgressIndicator, { - currentIndex: 2, - preventChangeOnClick: true, - steps: [ - { label: "Step 1", description: "First step", complete: true }, - { label: "Step 2", description: "Second step", complete: true }, - { label: "Step 3", description: "Third step", complete: true }, - { label: "Step 4", description: "Fourth step", complete: false }, - ], + describe.skipIf(isSvelte5)("svelte 4", () => { + it("should not update currentIndex when preventChangeOnClick is true", async () => { + const { component } = render(ProgressIndicator, { + currentIndex: 2, + preventChangeOnClick: true, + steps: [ + { label: "Step 1", description: "First step", complete: true }, + { label: "Step 2", description: "Second step", complete: true }, + { label: "Step 3", description: "Third step", complete: true }, + { label: "Step 4", description: "Fourth step", complete: false }, + ], + }); + + const changeHandler = vi.fn(); + component.$on("change", changeHandler); + + await user.click(screen.getByText("Step 1")); + expect(changeHandler).not.toHaveBeenCalled(); }); + }); - const changeHandler = vi.fn(); - component.$on("change", changeHandler); - - // Click on a completed step - await user.click(screen.getByText("Step 1")); - expect(changeHandler).not.toHaveBeenCalled(); + describe.skipIf(isSvelte4)("svelte 5", () => { + it("should not update currentIndex when preventChangeOnClick is true", async () => { + const changeHandler = vi.fn(); + render(ProgressIndicator, { + currentIndex: 2, + preventChangeOnClick: true, + steps: [ + { label: "Step 1", description: "First step", complete: true }, + { label: "Step 2", description: "Second step", complete: true }, + { label: "Step 3", description: "Third step", complete: true }, + { label: "Step 4", description: "Fourth step", complete: false }, + ], + onchange: changeHandler, + }); + + await user.click(screen.getByText("Step 1")); + expect(changeHandler).not.toHaveBeenCalled(); + }); }); }); diff --git a/tests/TextInput/TextInput.svelte5.test.svelte b/tests/TextInput/TextInput.svelte5.test.svelte new file mode 100644 index 0000000000..66f520e5ba --- /dev/null +++ b/tests/TextInput/TextInput.svelte5.test.svelte @@ -0,0 +1,70 @@ + + + + +
{value}
diff --git a/tests/TextInput/TextInput.test.ts b/tests/TextInput/TextInput.test.ts index b203c574ff..f9c7332af5 100644 --- a/tests/TextInput/TextInput.test.ts +++ b/tests/TextInput/TextInput.test.ts @@ -1,10 +1,13 @@ import { render, screen } from "@testing-library/svelte"; import { assert } from "vitest"; -import { user } from "../setup-tests"; -import TextInput from "./TextInput.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import TextInputSvelte4 from "./TextInput.test.svelte"; +import TextInputSvelte5 from "./TextInput.svelte5.test.svelte"; import TextInputCustom from "./TextInputCustom.test.svelte"; import TextInputFluid from "./TextInputFluid.test.svelte"; +const TextInput = isSvelte5 ? TextInputSvelte5 : TextInputSvelte4; + describe("TextInput", () => { it("should render with default props", () => { render(TextInput); @@ -214,49 +217,231 @@ describe("TextInput", () => { ); }); - it("should dispatch keydown event", async () => { - const { component } = render(TextInput); - const mockHandler = vi.fn(); - component.$on("keydown", mockHandler); + describe.skipIf(isSvelte5)("svelte 4", () => { + it("should dispatch keydown event", async () => { + const { component } = render(TextInput); + const mockHandler = vi.fn(); + component.$on("keydown", mockHandler); - const input = screen.getByRole("textbox"); - await user.type(input, "{Enter}"); + const input = screen.getByRole("textbox"); + await user.type(input, "{Enter}"); - expect(mockHandler).toHaveBeenCalled(); - }); + expect(mockHandler).toHaveBeenCalled(); + }); - it("should dispatch keyup event", async () => { - const { component } = render(TextInput); - const mockHandler = vi.fn(); - component.$on("keyup", mockHandler); + it("should dispatch keyup event", async () => { + const { component } = render(TextInput); + const mockHandler = vi.fn(); + component.$on("keyup", mockHandler); - const input = screen.getByRole("textbox"); - await user.type(input, "a"); + const input = screen.getByRole("textbox"); + await user.type(input, "a"); - expect(mockHandler).toHaveBeenCalled(); - }); + expect(mockHandler).toHaveBeenCalled(); + }); - it("should dispatch focus event", async () => { - const { component } = render(TextInput); - const mockHandler = vi.fn(); - component.$on("focus", mockHandler); + it("should dispatch focus event", async () => { + const { component } = render(TextInput); + const mockHandler = vi.fn(); + component.$on("focus", mockHandler); - const input = screen.getByRole("textbox"); - await user.click(input); + const input = screen.getByRole("textbox"); + await user.click(input); - expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch blur event", async () => { + const { component } = render(TextInput); + const mockHandler = vi.fn(); + component.$on("blur", mockHandler); + + const input = screen.getByRole("textbox"); + await user.click(input); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch change event with parsed value", async () => { + const { component } = render(TextInput); + const mockHandler = vi.fn(); + component.$on("change", mockHandler); + + const input = screen.getByRole("textbox"); + await user.type(input, "test"); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe("test"); + }); + + it("should dispatch change event with number value for number type", async () => { + const { component } = render(TextInput, { + props: { type: "number" }, + }); + const mockHandler = vi.fn(); + component.$on("change", mockHandler); + + const input = screen.getByRole("spinbutton"); + await user.type(input, "123"); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(123); + }); + + it("should dispatch change event with null for empty number input", async () => { + const { component } = render(TextInput, { + props: { type: "number", value: 123 }, + }); + const mockHandler = vi.fn(); + component.$on("change", mockHandler); + + const input = screen.getByRole("spinbutton"); + await user.clear(input); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(null); + }); + + it("should dispatch input event with parsed value", async () => { + const { component } = render(TextInput); + const mockHandler = vi.fn(); + component.$on("input", mockHandler); + + const input = screen.getByRole("textbox"); + await user.type(input, "a"); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe("a"); + }); + + it("should dispatch input event with number value for number type", async () => { + const { component } = render(TextInput, { + props: { type: "number" }, + }); + const mockHandler = vi.fn(); + component.$on("input", mockHandler); + + const input = screen.getByRole("spinbutton"); + await user.type(input, "5"); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(5); + }); }); - it("should dispatch blur event", async () => { - const { component } = render(TextInput); - const mockHandler = vi.fn(); - component.$on("blur", mockHandler); + describe.skipIf(isSvelte4)("svelte 5", () => { + it("should dispatch keydown event", async () => { + const mockHandler = vi.fn(); + render(TextInput, { onkeydown: mockHandler }); - const input = screen.getByRole("textbox"); - await user.click(input); - await user.tab(); + const input = screen.getByRole("textbox"); + await user.type(input, "{Enter}"); - expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch keyup event", async () => { + const mockHandler = vi.fn(); + render(TextInput, { onkeyup: mockHandler }); + + const input = screen.getByRole("textbox"); + await user.type(input, "a"); + + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch focus event", async () => { + const mockHandler = vi.fn(); + render(TextInput, { onfocus: mockHandler }); + + const input = screen.getByRole("textbox"); + await user.click(input); + + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch blur event", async () => { + const mockHandler = vi.fn(); + render(TextInput, { onblur: mockHandler }); + + const input = screen.getByRole("textbox"); + await user.click(input); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + }); + + it("should dispatch change event with parsed value", async () => { + const mockHandler = vi.fn(); + render(TextInput, { onchange: mockHandler }); + + const input = screen.getByRole("textbox"); + await user.type(input, "test"); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe("test"); + }); + + it("should dispatch change event with number value for number type", async () => { + const mockHandler = vi.fn(); + render(TextInput, { + type: "number", + onchange: mockHandler, + }); + + const input = screen.getByRole("spinbutton"); + await user.type(input, "123"); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(123); + }); + + it("should dispatch change event with null for empty number input", async () => { + const mockHandler = vi.fn(); + render(TextInput, { + type: "number", + value: 123, + onchange: mockHandler, + }); + + const input = screen.getByRole("spinbutton"); + await user.clear(input); + await user.tab(); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(null); + }); + + it("should dispatch input event with parsed value", async () => { + const mockHandler = vi.fn(); + render(TextInput, { oninput: mockHandler }); + + const input = screen.getByRole("textbox"); + await user.type(input, "a"); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe("a"); + }); + + it("should dispatch input event with number value for number type", async () => { + const mockHandler = vi.fn(); + render(TextInput, { + type: "number", + oninput: mockHandler, + }); + + const input = screen.getByRole("spinbutton"); + await user.type(input, "5"); + + expect(mockHandler).toHaveBeenCalled(); + expect(mockHandler.mock.calls[0][0].detail).toBe(5); + }); }); it("should have paste event listener", () => { diff --git a/tests/Theme/Theme.svelte5.test.svelte b/tests/Theme/Theme.svelte5.test.svelte new file mode 100644 index 0000000000..60a9c39990 --- /dev/null +++ b/tests/Theme/Theme.svelte5.test.svelte @@ -0,0 +1,25 @@ + + + + +
+ { + console.log("update", detail); + })} + > + + +
diff --git a/tests/UnorderedList/UnorderedList.svelte5.test.svelte b/tests/UnorderedList/UnorderedList.svelte5.test.svelte new file mode 100644 index 0000000000..18480e87c5 --- /dev/null +++ b/tests/UnorderedList/UnorderedList.svelte5.test.svelte @@ -0,0 +1,34 @@ + + + + {#each items as item} + + {item} + {#if nested && nestedItems.length > 0} + + {#each nestedItems as nestedItem} + {nestedItem} + {/each} + + {/if} + + {/each} + diff --git a/tests/UnorderedList/UnorderedList.test.ts b/tests/UnorderedList/UnorderedList.test.ts index 4dd4d7025e..dfc29c5421 100644 --- a/tests/UnorderedList/UnorderedList.test.ts +++ b/tests/UnorderedList/UnorderedList.test.ts @@ -1,6 +1,9 @@ import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import UnorderedList from "./UnorderedList.test.svelte"; +import { user, isSvelte4, isSvelte5 } from "../setup-tests"; +import UnorderedListSvelte4 from "./UnorderedList.test.svelte"; +import UnorderedListSvelte5 from "./UnorderedList.svelte5.test.svelte"; + +const UnorderedList = isSvelte5 ? UnorderedListSvelte5 : UnorderedListSvelte4; describe("UnorderedList", () => { it("should render with default props", () => { @@ -66,32 +69,60 @@ describe("UnorderedList", () => { }); describe("events", () => { - it("should emit click event", async () => { - const { component } = render(UnorderedList); - const list = screen.getByRole("list"); + describe.skipIf(isSvelte5)("svelte 4", () => { + it("should emit click event", async () => { + const { component } = render(UnorderedList); + const list = screen.getByRole("list"); + + const mock = vi.fn(); + component.$on("click", mock); + + await user.click(list); + expect(mock).toHaveBeenCalled(); + }); + + test.each(["mouseover", "mouseenter", "mouseleave"])( + "should emit %s event", + (eventName) => { + const { component } = render(UnorderedList); + const list = screen.getByRole("list"); + + const mock = vi.fn(); + component.$on(eventName, mock); - const mock = vi.fn(); - component.$on("click", mock); + const event = new MouseEvent(eventName, { bubbles: true }); + list.dispatchEvent(event); - await user.click(list); - expect(mock).toHaveBeenCalled(); + expect(mock).toHaveBeenCalled(); + }, + ); }); - test.each(["mouseover", "mouseenter", "mouseleave"])( - "should emit %s event", - (eventName) => { - const { component } = render(UnorderedList); + describe.skipIf(isSvelte4)("svelte 5", () => { + it("should emit click event", async () => { + const mock = vi.fn(); + render(UnorderedList, { onclick: mock }); const list = screen.getByRole("list"); - const mock = vi.fn(); - component.$on(eventName, mock); + await user.click(list); + expect(mock).toHaveBeenCalled(); + }); - const event = new MouseEvent(eventName); - list.dispatchEvent(event); + test.each(["mouseover", "mouseenter", "mouseleave"])( + "should emit %s event", + (eventName) => { + const mock = vi.fn(); + const props = { [`on${eventName}`]: mock }; + render(UnorderedList, props); + const list = screen.getByRole("list"); - expect(mock).toHaveBeenCalled(); - }, - ); + const event = new MouseEvent(eventName, { bubbles: true }); + list.dispatchEvent(event); + + expect(mock).toHaveBeenCalled(); + }, + ); + }); }); describe("accessibility", () => { diff --git a/tests/setup-tests.ts b/tests/setup-tests.ts index 370428e7a6..126e5ca1da 100644 --- a/tests/setup-tests.ts +++ b/tests/setup-tests.ts @@ -1,6 +1,12 @@ /// import "@testing-library/jest-dom/vitest"; import { userEvent } from "@testing-library/user-event"; +// @ts-expect-error +import { version } from "svelte/package.json"; + +export const SVELTE_VERSION = parseInt(version.split(".")[0]); +export const isSvelte4 = SVELTE_VERSION === 4; +export const isSvelte5 = SVELTE_VERSION === 5; // Mock scrollIntoView since it's not implemented in JSDOM Element.prototype.scrollIntoView = vi.fn();