From 21a1438b3776f2a63fb274124ebd9622657e977a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:09:11 -0700 Subject: [PATCH 01/17] build(deps): update dependency @cspell/eslint-plugin to v8.15.4 (#10565) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@cspell/eslint-plugin](https://redirect.github.com/streetsidesoftware/cspell/tree/main/packages/cspell-eslint-plugin#readme) ([source](https://redirect.github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell-eslint-plugin)) | [`8.15.2` -> `8.15.4`](https://renovatebot.com/diffs/npm/@cspell%2feslint-plugin/8.15.2/8.15.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@cspell%2feslint-plugin/8.15.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@cspell%2feslint-plugin/8.15.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@cspell%2feslint-plugin/8.15.2/8.15.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@cspell%2feslint-plugin/8.15.2/8.15.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
streetsidesoftware/cspell (@​cspell/eslint-plugin) ### [`v8.15.4`](https://redirect.github.com/streetsidesoftware/cspell/blob/HEAD/packages/cspell-eslint-plugin/CHANGELOG.md#small8154-2024-10-18-small) [Compare Source](https://redirect.github.com/streetsidesoftware/cspell/compare/v8.15.3...v8.15.4) - chore: Update Integration Test Performance Data ([#​6389](https://redirect.github.com/streetsidesoftware/cspell/issues/6389)) ([7ece6a7](https://redirect.github.com/streetsidesoftware/cspell/commit/7ece6a7)), closes [#​6389](https://redirect.github.com/streetsidesoftware/cspell/issues/6389) ### [`v8.15.3`](https://redirect.github.com/streetsidesoftware/cspell/blob/HEAD/packages/cspell-eslint-plugin/CHANGELOG.md#small8153-2024-10-16-small) [Compare Source](https://redirect.github.com/streetsidesoftware/cspell/compare/v8.15.2...v8.15.3) - chore: Update Integration Test Performance Data ([#​6377](https://redirect.github.com/streetsidesoftware/cspell/issues/6377)) ([7ff6781](https://redirect.github.com/streetsidesoftware/cspell/commit/7ff6781)), closes [#​6377](https://redirect.github.com/streetsidesoftware/cspell/issues/6377)
--- - [ ] If you want to rebase/retry this PR, check this box Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 196 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 99 insertions(+), 99 deletions(-) diff --git a/package-lock.json b/package-lock.json index cac52580fb5..d76c67d662f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "patch-package": "8.0.0" }, "devDependencies": { - "@cspell/eslint-plugin": "8.15.2", + "@cspell/eslint-plugin": "8.15.4", "@esri/calcite-base": "1.2.0", "@esri/calcite-colors": "6.1.0", "@octokit/webhooks-types": "7.6.1", @@ -2451,9 +2451,9 @@ "license": "MIT" }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.2.tgz", - "integrity": "sha512-e+hxoD/GW7iyK1zMeRFd10yBr9tcClnnqFLxJM+tH1cSzLQ66ouXMIMuJpcd8LOCm7zMRdjTm4R72LehMgL79g==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.4.tgz", + "integrity": "sha512-t5b2JwGeUmzmjl319mCuaeKGxTvmzLLRmrpdHr+ZZGRO4nf7L48Lbe9A6uwNUvsZe0cXohiNXsrrsuzRVXswVA==", "dev": true, "dependencies": { "@cspell/dict-ada": "^4.0.5", @@ -2466,7 +2466,7 @@ "@cspell/dict-css": "^4.0.16", "@cspell/dict-dart": "^2.2.4", "@cspell/dict-django": "^4.1.3", - "@cspell/dict-docker": "^1.1.10", + "@cspell/dict-docker": "^1.1.11", "@cspell/dict-dotnet": "^5.0.8", "@cspell/dict-elixir": "^4.0.6", "@cspell/dict-en_us": "^4.3.26", @@ -2497,17 +2497,17 @@ "@cspell/dict-php": "^4.0.13", "@cspell/dict-powershell": "^5.0.13", "@cspell/dict-public-licenses": "^2.0.11", - "@cspell/dict-python": "^4.2.11", + "@cspell/dict-python": "^4.2.12", "@cspell/dict-r": "^2.0.4", "@cspell/dict-ruby": "^5.0.7", "@cspell/dict-rust": "^4.0.9", "@cspell/dict-scala": "^5.0.6", - "@cspell/dict-software-terms": "^4.1.10", + "@cspell/dict-software-terms": "^4.1.11", "@cspell/dict-sql": "^2.1.8", "@cspell/dict-svelte": "^1.0.5", "@cspell/dict-swift": "^2.0.4", "@cspell/dict-terraform": "^1.0.5", - "@cspell/dict-typescript": "^3.1.9", + "@cspell/dict-typescript": "^3.1.10", "@cspell/dict-vue": "^3.0.3" }, "engines": { @@ -2515,18 +2515,18 @@ } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.2.tgz", - "integrity": "sha512-TOcLiRiUSh75y+DQrAW59Ix0/D9WPrd4/KPtUShUepS3vLfoxMQ+TwpXfdc8FrzU73Hg5glXXnQjvdx7vAazVQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.4.tgz", + "integrity": "sha512-WfCmZVFC6mX6vYlf02hWwelcSBTbDQgc5YqY+1miuMk+OHSUAHSACjZId6/a4IAID94xScvFfj7jgrdejUVvIQ==", "dev": true, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.2.tgz", - "integrity": "sha512-XOcHfkKCN+a3zZMexK/BLmDxsqku8Q5ASqYu7JBFsu/axS4K11bkcQMxYoOvHVGBv20vb/gM2D+9MePuxAfssg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.4.tgz", + "integrity": "sha512-Zr428o+uUTqywrdKyjluJVnDPVAJEqZ1chQLKIrHggUah1cgs5aQ7rZ+0Rv5euYMlC2idZnP7IL6TDaIib80oA==", "dev": true, "dependencies": { "global-directory": "^4.0.1" @@ -2536,18 +2536,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.2.tgz", - "integrity": "sha512-g9rhMIU0DX+avIQHFu0Mx3LAFi4lG6zX8iFa2zu+u3ll0IX0WtxTqrzft27jYSwebmm/ysWJUcOY+SWhZfPA0Q==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.4.tgz", + "integrity": "sha512-pXYofnV/V9Y3LZdfFGbmhdxPX/ABjiD3wFjGHt5YhIU9hjVVuvjFlgY7pH2AvRjs4F8xKXv1ReWl44BJOL9gLA==", "dev": true, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.2.tgz", - "integrity": "sha512-bHAkXsrfOhKyZZ+TA5eGH3fqh9DPcP3a2v+ozTnhhZa3zcfuzX7rZnYWEFA8LELMUStWXLECzFoGd9QUEHMstg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.4.tgz", + "integrity": "sha512-1hDtgYDQVW11zgtrr12EmGW45Deoi7IjZOhzPFLb+3WkhZ46ggWdbrRalWwBolQPDDo6+B2Q6WXz5hdND+Tpwg==", "dev": true, "engines": { "node": ">=18" @@ -2620,9 +2620,9 @@ "dev": true }, "node_modules/@cspell/dict-docker": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.10.tgz", - "integrity": "sha512-vWybMfsG/8jhN6kmPoilMon36GB3+Ef+m/mgYUfY8tJN23K/x4KD1rU1OOiNWzDqePhu3MMWVKO5W5x6VI6Gbw==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.11.tgz", + "integrity": "sha512-s0Yhb16/R+UT1y727ekbR/itWQF3Qz275DR1ahOa66wYtPjHUXmhM3B/LT3aPaX+hD6AWmK23v57SuyfYHUjsw==", "dev": true }, "node_modules/@cspell/dict-dotnet": { @@ -2806,9 +2806,9 @@ "dev": true }, "node_modules/@cspell/dict-python": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.11.tgz", - "integrity": "sha512-bshNZqP5FYRO0CtZ9GgtVjHidrSuRRF537MU/sPew8oaqWPg066F9KQfPllbRi9AzFqqeS2l7/ACYUrFMe21gw==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.12.tgz", + "integrity": "sha512-U25eOFu+RE0aEcF2AsxZmq3Lic7y9zspJ9SzjrC0mfJz+yr3YmSCw4E0blMD3mZoNcf7H/vMshuKIY5AY36U+Q==", "dev": true, "dependencies": { "@cspell/dict-data-science": "^2.0.5" @@ -2839,9 +2839,9 @@ "dev": true }, "node_modules/@cspell/dict-software-terms": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.10.tgz", - "integrity": "sha512-+9PuQ9MHQhlET6Hv1mGcWDh6Rb+StzjBMrjfksDeBHBIVdT66u9uCkaZapIzfgktflY4m9oK7+dEynr+BAxvtQ==", + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.11.tgz", + "integrity": "sha512-77CTHxWFTVw6tVoMN8WBMrlNW2F2FbgATwD/6vcOuiyrJUmh8klN5ZK3m+yyK3ZzsnaW2Bduoc0fw2Ckcm/riQ==", "dev": true }, "node_modules/@cspell/dict-sql": { @@ -2869,9 +2869,9 @@ "dev": true }, "node_modules/@cspell/dict-typescript": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.9.tgz", - "integrity": "sha512-ZtO1/cVWvvR477ftTl2TFR09+IIzXG1rcin8CGYA0FO5WhyDAbn8v3A85QikS158BhTVUoq09lPYuSF9HBzqvw==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.10.tgz", + "integrity": "sha512-7Zek3w4Rh3ZYyhihJ34FdnUBwP3OmRldnEq3hZ+FgQ0PyYZjXv5ztEViRBBxXjiFx1nHozr6pLi74TxToD8xsg==", "dev": true }, "node_modules/@cspell/dict-vue": { @@ -2881,9 +2881,9 @@ "dev": true }, "node_modules/@cspell/dynamic-import": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.2.tgz", - "integrity": "sha512-37eYzVLqMv3KnY7UMmv/wC9OlUjPC7EJ3xMDourgDTNp6BtiPlMkHRTN5/yvRjukQedi41R1hewgCcZbwSpNXg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.4.tgz", + "integrity": "sha512-tr0F6EYN6qtniNvt1Uib+PgYQHeo4dQHXE2Optap+hYTOoQ2VoQ+SwBVjZ+Q2bmSAB0fmOyf0AvgsUtnWIpavw==", "dev": true, "dependencies": { "import-meta-resolve": "^4.1.0" @@ -2893,14 +2893,14 @@ } }, "node_modules/@cspell/eslint-plugin": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/eslint-plugin/-/eslint-plugin-8.15.2.tgz", - "integrity": "sha512-vIjfXF/aZuU0PtMwdhUKftkNTAfrlBq7B0RUCf2/2KJu9cg+ZMqjXNXDezSJWJ1BD6RpCAaY4nTKJ6UwtyqzDQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/eslint-plugin/-/eslint-plugin-8.15.4.tgz", + "integrity": "sha512-KySdPTi1of8FiSvGG6cC1nN9GF9xad/2AgDthHv2DJ0UTMTpX7fqccVpWdQ0Yo4qt32XUQgO4EmvwWSNgo1d3w==", "dev": true, "dependencies": { - "@cspell/cspell-types": "8.15.2", - "@cspell/url": "8.15.2", - "cspell-lib": "8.15.2", + "@cspell/cspell-types": "8.15.4", + "@cspell/url": "8.15.4", + "cspell-lib": "8.15.4", "synckit": "^0.9.2" }, "engines": { @@ -2911,27 +2911,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.2.tgz", - "integrity": "sha512-x2ciWqi6y2RoTcXRTG3BuxAly1TIr4puLzKHkMWtnYp1A++gohCBczMt33FwrwFav0Dfx9M0mCpT1h1ORVwzhA==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.4.tgz", + "integrity": "sha512-sNl6jr3ym/4151EY76qlI/00HHsiLZBqW7Vb1tqCzsgSg3EpL30ddjr74So6Sg2PN26Yf09hvxGTJzXn1R4aYw==", "dev": true, "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.2.tgz", - "integrity": "sha512-FMz3vgyPJjJsg0f78ToprOxR0lPhZOWwidxD+gOMLLfUzJ0mBC4VwoggrgIF6YEdXy/2UoIUtjh5B/Qfge9IDw==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.4.tgz", + "integrity": "sha512-m5DeQksbhJFqcSYF8Q0Af/WXmXCMAJocCUShkzOXK+uZNXnvhBZN7VyQ9hL+GRzX8JTPEPdVcz2lFyVE5p+LzQ==", "dev": true, "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.2.tgz", - "integrity": "sha512-AxS6nqh65V8BJf+ke7XNsDlieXfq/73XjZ4OxQAHvmML9kgXAbTviDcN6ddj6d2fTgU3EOSU1fBfDOqpS4n6Sg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.4.tgz", + "integrity": "sha512-K2oZu/oLQPs5suRpLS8uu04O3YMUioSlEU1D66fRoOxzI5NzLt7i7yMg3HQHjChGa09N5bzqmrVdhmQrRZXwGg==", "dev": true, "engines": { "node": ">=18.0" @@ -13503,12 +13503,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.2.tgz", - "integrity": "sha512-0vaZdp1gz5mt7RWTWStHHJBXfELtbtJNCl8RNz9E51906bhAyZ/yBvkOyjCW2Ofsdp2cKS11AuzTrq6N2lmK3g==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.4.tgz", + "integrity": "sha512-vUgikQTRkRMTdkZqSs7F2cTdPpX61cTjr/9L/VCkXkbW38ObCr4650ioiF1Wq3zDF3Gy2bc4ECTpD2PZUXX5SA==", "dev": true, "dependencies": { - "@cspell/cspell-types": "8.15.2", + "@cspell/cspell-types": "8.15.4", "comment-json": "^4.2.5", "yaml": "^2.6.0" }, @@ -13529,14 +13529,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.2.tgz", - "integrity": "sha512-Kvn8ZD+oQs2KKgGoC601NBju3xQcrP4bz1MVZ23ZN9fm6pukb0J8x9hP3d+AuQd/Cl2XG/y/hWZi6MT92uChIg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.4.tgz", + "integrity": "sha512-8+p/l9Saac7qyCbqtELneDoT7CwHu9gYmnI8uXMu34/lPGjhVhy10ZeI0+t1djaO2YyASK400YFKq5uP/5KulA==", "dev": true, "dependencies": { - "@cspell/cspell-pipe": "8.15.2", - "@cspell/cspell-types": "8.15.2", - "cspell-trie-lib": "8.15.2", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4", + "cspell-trie-lib": "8.15.4", "fast-equals": "^5.0.1" }, "engines": { @@ -13544,12 +13544,12 @@ } }, "node_modules/cspell-glob": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.2.tgz", - "integrity": "sha512-AQNskPt3FOF1Z6mc+cvCZ33Xnb+a4cMVZwcLlApc/4uup6OvyEoXNN9IyeHVmloAUPlXadaA79balp3cMj2rWg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.4.tgz", + "integrity": "sha512-TTfRRHRAN+PN9drIz4MAEgKKYnPThBOlPMdFddyuisvU33Do1sPAnqkkOjTEFdi3jAA5KwnSva68SVH6IzzMBQ==", "dev": true, "dependencies": { - "@cspell/url": "8.15.2", + "@cspell/url": "8.15.4", "micromatch": "^4.0.8" }, "engines": { @@ -13557,13 +13557,13 @@ } }, "node_modules/cspell-grammar": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.2.tgz", - "integrity": "sha512-yvCiOlg6G2l+lMWBSmWwnVqIVfDK/uUBzY4WIJQaXWtXRuJ9MdsSEQ3TFd9NgJUhY1gSF8O1zSqeCmfPNuS44g==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.4.tgz", + "integrity": "sha512-MKiKyYi05mRtXOxPoTv3Ksi0GwYLiK84Uq0C+5PaMrnIjXeed0bsddSFXCT+7ywFJc7PdjhTtz0M/9WWK3UgbA==", "dev": true, "dependencies": { - "@cspell/cspell-pipe": "8.15.2", - "@cspell/cspell-types": "8.15.2" + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4" }, "bin": { "cspell-grammar": "bin.mjs" @@ -13573,40 +13573,40 @@ } }, "node_modules/cspell-io": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.2.tgz", - "integrity": "sha512-Y4bEsKVXC48VawU+gU1lcsO7B55pNAjc8/C8Qg8UByobSOxtZKd7jaRRqqvd60Rh8lbgG4Nc05zKCb1CxY1+2Q==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.4.tgz", + "integrity": "sha512-rXIEREPTFV9dwwg4EKfvzqlCNOvT6910AYED5YrSt8Y68usRJ9lbqdx0BrDndVCd33bp1o+9JBfHuRiFIQC81g==", "dev": true, "dependencies": { - "@cspell/cspell-service-bus": "8.15.2", - "@cspell/url": "8.15.2" + "@cspell/cspell-service-bus": "8.15.4", + "@cspell/url": "8.15.4" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.2.tgz", - "integrity": "sha512-u4tO8NoLq/LuOdCBqJdKBLE51uCcE2Ni/DvaEFNfuhk2fCF3rE/2nCzLx6ZEAiFPHZVMs44MJxpH7VF8Rn/T8g==", - "dev": true, - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.15.2", - "@cspell/cspell-pipe": "8.15.2", - "@cspell/cspell-resolver": "8.15.2", - "@cspell/cspell-types": "8.15.2", - "@cspell/dynamic-import": "8.15.2", - "@cspell/filetypes": "8.15.2", - "@cspell/strong-weak-map": "8.15.2", - "@cspell/url": "8.15.2", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.4.tgz", + "integrity": "sha512-iLp/625fvCyFFxSyZYLMgqHIKcrhN4hT7Hw5+ySa38Bp/OfA81ANqWHpsDQ0bGsALTRn/DHBpQYj4xCW/aN9tw==", + "dev": true, + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.15.4", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-resolver": "8.15.4", + "@cspell/cspell-types": "8.15.4", + "@cspell/dynamic-import": "8.15.4", + "@cspell/filetypes": "8.15.4", + "@cspell/strong-weak-map": "8.15.4", + "@cspell/url": "8.15.4", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.15.2", - "cspell-dictionary": "8.15.2", - "cspell-glob": "8.15.2", - "cspell-grammar": "8.15.2", - "cspell-io": "8.15.2", - "cspell-trie-lib": "8.15.2", + "cspell-config-lib": "8.15.4", + "cspell-dictionary": "8.15.4", + "cspell-glob": "8.15.4", + "cspell-grammar": "8.15.4", + "cspell-io": "8.15.4", + "cspell-trie-lib": "8.15.4", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -13634,13 +13634,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.2.tgz", - "integrity": "sha512-dqEc4832iareVCA+pXuvdNwtUF+F8S+w15Tlv0fRdPTz8X4wcUtK0R5npYnL5dyuPhKBdO/PmKXGb7/5I0vBMg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.4.tgz", + "integrity": "sha512-sg9klsNHyrfos0Boiio+qy5d6fI9cCNjBqFYrNxvpKpwZ4gEzDzjgEKdZY1C76RD2KoBQ8I1NF5YcGc0+hhhCw==", "dev": true, "dependencies": { - "@cspell/cspell-pipe": "8.15.2", - "@cspell/cspell-types": "8.15.2", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index 23c58dc157c..35fd35f61f2 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "util:sync-linked-package-versions": "tsx support/syncLinkedPackageVersions.ts" }, "devDependencies": { - "@cspell/eslint-plugin": "8.15.2", + "@cspell/eslint-plugin": "8.15.4", "@esri/calcite-base": "1.2.0", "@esri/calcite-colors": "6.1.0", "@octokit/webhooks-types": "7.6.1", From 8e843f4929f84c658e599b2cec349ddb8a0a74fb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:09:41 -0700 Subject: [PATCH 02/17] build(deps): update dependency tsx to v4.19.1 (#10574) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [tsx](https://tsx.is) ([source](https://redirect.github.com/privatenumber/tsx)) | [`4.17.0` -> `4.19.1`](https://renovatebot.com/diffs/npm/tsx/4.17.0/4.19.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/tsx/4.19.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/tsx/4.19.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/tsx/4.17.0/4.19.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/tsx/4.17.0/4.19.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
privatenumber/tsx (tsx) ### [`v4.19.1`](https://redirect.github.com/privatenumber/tsx/compare/v4.19.0...0329bfc731346d6c8b6055c7f2882e5c3155a7ec) [Compare Source](https://redirect.github.com/privatenumber/tsx/compare/v4.19.0...v4.19.1) ### [`v4.19.0`](https://redirect.github.com/privatenumber/tsx/compare/v4.18.0...157c3ec6bcf0b0a5e387080576404c00f7fd662f) [Compare Source](https://redirect.github.com/privatenumber/tsx/compare/v4.18.0...v4.19.0) ### [`v4.18.0`](https://redirect.github.com/privatenumber/tsx/compare/v4.17.1...474ea71ff9c9cbd2d3a5dbe0951f2c2d92f2e26a) [Compare Source](https://redirect.github.com/privatenumber/tsx/compare/v4.17.1...v4.18.0) ### [`v4.17.1`](https://redirect.github.com/privatenumber/tsx/compare/v4.17.0...af370e7af4837cf3db069c3ee1758c90f94f7d32) [Compare Source](https://redirect.github.com/privatenumber/tsx/compare/v4.17.0...v4.17.1)
--- - [ ] If you want to rebase/retry this PR, check this box Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 34 ++++------------------------------ package.json | 2 +- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index d76c67d662f..bb1275cb79f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -102,7 +102,7 @@ "stylelint-use-logical-spec": "5.0.1", "tailwindcss": "3.4.14", "ts-jest": "29.1.2", - "tsx": "4.17.0", + "tsx": "4.19.1", "turbo": "1.13.4", "typescript": "5.4.4", "workbox-build": "7.1.1" @@ -32420,11 +32420,10 @@ } }, "node_modules/tsx": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.17.0.tgz", - "integrity": "sha512-eN4mnDA5UMKDt4YZixo9tBioibaMBpoxBkD+rIPAjVmYERSG0/dWEY1CEFuV89CgASlKL499q8AhmkMnnjtOJg==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.1.tgz", + "integrity": "sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==", "dev": true, - "license": "MIT", "dependencies": { "esbuild": "~0.23.0", "get-tsconfig": "^4.7.5" @@ -32447,7 +32446,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "aix" @@ -32464,7 +32462,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -32481,7 +32478,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -32498,7 +32494,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -32515,7 +32510,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -32532,7 +32526,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -32549,7 +32542,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -32566,7 +32558,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -32583,7 +32574,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -32600,7 +32590,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -32617,7 +32606,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -32634,7 +32622,6 @@ "loong64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -32651,7 +32638,6 @@ "mips64el" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -32668,7 +32654,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -32685,7 +32670,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -32702,7 +32686,6 @@ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -32719,7 +32702,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -32736,7 +32718,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "netbsd" @@ -32753,7 +32734,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "openbsd" @@ -32770,7 +32750,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "openbsd" @@ -32787,7 +32766,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "sunos" @@ -32804,7 +32782,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -32821,7 +32798,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -32838,7 +32814,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -32853,7 +32828,6 @@ "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", "dev": true, "hasInstallScript": true, - "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, diff --git a/package.json b/package.json index 35fd35f61f2..7ec113b00a4 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "stylelint-use-logical-spec": "5.0.1", "tailwindcss": "3.4.14", "ts-jest": "29.1.2", - "tsx": "4.17.0", + "tsx": "4.19.1", "turbo": "1.13.4", "typescript": "5.4.4", "workbox-build": "7.1.1" From 93b618f3d436c3d8faec3a31cee160d01140964e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:09:47 -0700 Subject: [PATCH 03/17] build(deps): update nrwl monorepo to v19.8.6 (#10575) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@nx/nx-darwin-arm64](https://redirect.github.com/nrwl/nx) ([source](https://redirect.github.com/nrwl/nx/tree/HEAD/packages/nx/native-packages/darwin-arm64)) | [`19.6.5` -> `19.8.6`](https://renovatebot.com/diffs/npm/@nx%2fnx-darwin-arm64/19.6.5/19.8.6) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@nx%2fnx-darwin-arm64/19.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@nx%2fnx-darwin-arm64/19.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@nx%2fnx-darwin-arm64/19.6.5/19.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@nx%2fnx-darwin-arm64/19.6.5/19.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@nx/nx-win32-x64-msvc](https://redirect.github.com/nrwl/nx) ([source](https://redirect.github.com/nrwl/nx/tree/HEAD/packages/nx/native-packages/win32-x64-msvc)) | [`19.6.5` -> `19.8.6`](https://renovatebot.com/diffs/npm/@nx%2fnx-win32-x64-msvc/19.6.5/19.8.6) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@nx%2fnx-win32-x64-msvc/19.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@nx%2fnx-win32-x64-msvc/19.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@nx%2fnx-win32-x64-msvc/19.6.5/19.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@nx%2fnx-win32-x64-msvc/19.6.5/19.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
nrwl/nx (@​nx/nx-darwin-arm64) ### [`v19.8.6`](https://redirect.github.com/nrwl/nx/releases/tag/19.8.6) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.8.5...19.8.6) ##### 19.8.6 (2024-10-18) ##### 🩹 Fixes - **core:** support `NX_NO_CLOUD` ([#​28366](https://redirect.github.com/nrwl/nx/pull/28366)) - **core:** handle `neverConnectToCloud` property ([#​28452](https://redirect.github.com/nrwl/nx/pull/28452)) - **core:** neverConnectToCloud should disable connecting to nxCloud ([#​28501](https://redirect.github.com/nrwl/nx/pull/28501)) ##### ❤️ Thank You - Jonathan Cammisuli - Nicholas Cunningham [@​ndcunningham](https://redirect.github.com/ndcunningham) ### [`v19.8.5`](https://redirect.github.com/nrwl/nx/releases/tag/19.8.5) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.8.4...19.8.5) ##### 19.8.5 (2024-10-15) ##### 🚀 Features - **core:** open sqlite databases with `SQLITE_OPEN_FULL_MUTEX` ([#​28276](https://redirect.github.com/nrwl/nx/pull/28276)) - **devkit:** bump compatibility to Nx 19 - 21.x ([#​28243](https://redirect.github.com/nrwl/nx/pull/28243)) ##### 🩹 Fixes - **core:** add busy handler for sqlite ([#​28390](https://redirect.github.com/nrwl/nx/pull/28390)) - **react:** patch fix for [`88f163e`](https://redirect.github.com/nrwl/nx/commit/88f163e9d5) to normalize project name without messing up directory ([ff23fb0c07](https://redirect.github.com/nrwl/nx/commit/ff23fb0c07)) ##### ❤️ Thank You - Jack Hsu [@​jaysoo](https://redirect.github.com/jaysoo) - Jason Jean [@​FrozenPandaz](https://redirect.github.com/FrozenPandaz) - Jonathan Cammisuli ### [`v19.8.4`](https://redirect.github.com/nrwl/nx/releases/tag/19.8.4) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.8.3...19.8.4) ##### 19.8.4 (2024-10-04) ##### 🚀 Features - **core:** allow circular project dependencies to execute tasks ([#​28227](https://redirect.github.com/nrwl/nx/pull/28227)) - **nx-dev:** add nx powerpack to pricing page ([#​28232](https://redirect.github.com/nrwl/nx/pull/28232)) - **nx-dev:** add nx powerpack gcp & azure mentions ([#​28256](https://redirect.github.com/nrwl/nx/pull/28256)) ##### 🩹 Fixes - **angular:** ensure [@​typescript-eslint/utils](https://redirect.github.com/typescript-eslint/utils) is used with eslint flat config ([#​28267](https://redirect.github.com/nrwl/nx/pull/28267)) - **core:** remove axios import from main code loading ([#​28230](https://redirect.github.com/nrwl/nx/pull/28230)) - **core:** change getCache signature to only accept options ([#​28248](https://redirect.github.com/nrwl/nx/pull/28248)) - **core:** allow prompts during nx add ([#​28247](https://redirect.github.com/nrwl/nx/pull/28247)) - **core:** add stub for conformance:check, add messaging ([#​28250](https://redirect.github.com/nrwl/nx/pull/28250)) - **core:** filter out task dependencies on itself ([#​28261](https://redirect.github.com/nrwl/nx/pull/28261)) - **core:** fixing target groups not merging ([#​28280](https://redirect.github.com/nrwl/nx/pull/28280)) - **js:** resolve VerdaccioWarning on the "logs" configuration property ([#​28234](https://redirect.github.com/nrwl/nx/pull/28234)) - **nx-cloud:** use create-workspace-v1 endpoint if v2 returns with 404 ([#​28015](https://redirect.github.com/nrwl/nx/pull/28015)) - **nx-dev:** fix markdoc table data alignment ([#​28274](https://redirect.github.com/nrwl/nx/pull/28274)) - **react:** host generator should pass normalized name to remote generator ([#​28295](https://redirect.github.com/nrwl/nx/pull/28295)) - **testing:** add support for playwright --last-failed ([#​28161](https://redirect.github.com/nrwl/nx/pull/28161)) ##### ❤️ Thank You - Andrew Goldis [@​agoldis](https://redirect.github.com/agoldis) - Benjamin Cabanes [@​bcabanes](https://redirect.github.com/bcabanes) - Colum Ferry [@​Coly010](https://redirect.github.com/Coly010) - Jack Hsu [@​jaysoo](https://redirect.github.com/jaysoo) - James Henry [@​JamesHenry](https://redirect.github.com/JamesHenry) - Jason Jean [@​FrozenPandaz](https://redirect.github.com/FrozenPandaz) - Jonathan Cammisuli - Louie Weng [@​lourw](https://redirect.github.com/lourw) - Nicholas Cunningham [@​ndcunningham](https://redirect.github.com/ndcunningham) - Shahar Kazaz - Zachary DeRose [@​ZackDeRose](https://redirect.github.com/ZackDeRose) ### [`v19.8.3`](https://redirect.github.com/nrwl/nx/releases/tag/19.8.3) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.8.2...19.8.3) ##### 19.8.3 (2024-10-01) ##### 🚀 Features - **nx-dev:** add Powerpack video to the landing page ([#​28126](https://redirect.github.com/nrwl/nx/pull/28126)) ##### 🩹 Fixes - **angular:** ensure async webpack configs are awaited [#​28200](https://redirect.github.com/nrwl/nx/issues/28200) ([#​28213](https://redirect.github.com/nrwl/nx/pull/28213), [#​28200](https://redirect.github.com/nrwl/nx/issues/28200)) - **core:** fix output for 0 task ([#​28122](https://redirect.github.com/nrwl/nx/pull/28122)) - **core:** log error for runTaskInForkedProcess ([#​28078](https://redirect.github.com/nrwl/nx/pull/28078)) - **core:** calculate project dependencies upfront in the schedule ([#​28152](https://redirect.github.com/nrwl/nx/pull/28152)) - **core:** only stop daemon if enabled ([#​28146](https://redirect.github.com/nrwl/nx/pull/28146)) - **core:** adjust nx import messaging without relative source dir ([#​28052](https://redirect.github.com/nrwl/nx/pull/28052)) - **core:** move getDetails to top ([#​28158](https://redirect.github.com/nrwl/nx/pull/28158)) - **core:** fix env override run command ([#​28156](https://redirect.github.com/nrwl/nx/pull/28156)) - **core:** fix link to powerpack plugins ([#​28182](https://redirect.github.com/nrwl/nx/pull/28182)) - **expo:** change force to be an option for yarn ([#​28115](https://redirect.github.com/nrwl/nx/pull/28115)) - **graph:** add spacing between graph details top ([#​28055](https://redirect.github.com/nrwl/nx/pull/28055)) - **js:** improve typescript-sync generator messaging ([#​28162](https://redirect.github.com/nrwl/nx/pull/28162)) - **module-federation:** exports could be objects and not strings [#​28129](https://redirect.github.com/nrwl/nx/issues/28129) ([#​28215](https://redirect.github.com/nrwl/nx/pull/28215), [#​28129](https://redirect.github.com/nrwl/nx/issues/28129)) - **module-federation:** additionalShared should check node_modules when applying to support transitive deps [#​28137](https://redirect.github.com/nrwl/nx/issues/28137) ([#​28216](https://redirect.github.com/nrwl/nx/pull/28216), [#​28137](https://redirect.github.com/nrwl/nx/issues/28137)) - **nx-dev:** adjust powerpack mobile view ([b76e84dbb1](https://redirect.github.com/nrwl/nx/commit/b76e84dbb1)) - **nx-dev:** options of the affected are messed up ([#​28112](https://redirect.github.com/nrwl/nx/pull/28112)) - **nx-dev:** Update Power pack docs to include OSS projects ([#​28176](https://redirect.github.com/nrwl/nx/pull/28176)) - **nx-dev:** 404 urls ([#​27599](https://redirect.github.com/nrwl/nx/pull/27599)) - **react:** setup-ssr generator should infer bundler based on the executor for build [#​28128](https://redirect.github.com/nrwl/nx/issues/28128) ([#​28217](https://redirect.github.com/nrwl/nx/pull/28217), [#​28128](https://redirect.github.com/nrwl/nx/issues/28128)) - **storybook:** only add [@​storybook/test-runner](https://redirect.github.com/storybook/test-runner) to externalDependencies if installed ([#​28060](https://redirect.github.com/nrwl/nx/pull/28060)) ##### ❤️ Thank You - Colum Ferry [@​Coly010](https://redirect.github.com/Coly010) - Emily Xiong [@​xiongemi](https://redirect.github.com/xiongemi) - Jason Jean [@​FrozenPandaz](https://redirect.github.com/FrozenPandaz) - Juri [@​juristr](https://redirect.github.com/juristr) - Juri Strumpflohner [@​juristr](https://redirect.github.com/juristr) - Leosvel Pérez Espinosa [@​leosvelperez](https://redirect.github.com/leosvelperez) - MaxKless [@​MaxKless](https://redirect.github.com/MaxKless) - Nicholas Cunningham [@​ndcunningham](https://redirect.github.com/ndcunningham) - pawel-twardziak ### [`v19.8.2`](https://redirect.github.com/nrwl/nx/releases/tag/19.8.2) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.8.1...19.8.2) ##### 19.8.2 (2024-09-26) ##### 🚀 Features - **nx-dev:** powerpack landing page ([#​27963](https://redirect.github.com/nrwl/nx/pull/27963)) ##### 🩹 Fixes - **core:** hide no file server process json log ([#​27626](https://redirect.github.com/nrwl/nx/pull/27626)) - **js:** [@​nx/js](https://redirect.github.com/nx/js):init ensures tslib is installed if importHelpers is true ([#​28083](https://redirect.github.com/nrwl/nx/pull/28083)) - **linter:** add files entry to angular flat config to avoid applying TS rules to JSON files ([#​28102](https://redirect.github.com/nrwl/nx/pull/28102)) ##### ❤️ Thank You - Craigory Coppola [@​AgentEnder](https://redirect.github.com/AgentEnder) - Jack Hsu [@​jaysoo](https://redirect.github.com/jaysoo) - Juri Strumpflohner [@​juristr](https://redirect.github.com/juristr) ### [`v19.8.1`](https://redirect.github.com/nrwl/nx/releases/tag/19.8.1) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.8.0...19.8.1) ##### 19.8.1 (2024-09-25) ##### 🚀 Features - **core:** allow prompts from init generators during nx init ([#​28003](https://redirect.github.com/nrwl/nx/pull/28003)) ##### 🩹 Fixes - **bundling:** remove unused `babel-plugin-transform-async-to-promises` from `@nx/rollup` ([#​27669](https://redirect.github.com/nrwl/nx/pull/27669)) - **core:** allow creating a db cache without linking task details ([#​28023](https://redirect.github.com/nrwl/nx/pull/28023)) - **core:** fix output text for multiple targets ([#​28043](https://redirect.github.com/nrwl/nx/pull/28043)) - **core:** sort projects after updating from context ([#​28024](https://redirect.github.com/nrwl/nx/pull/28024)) - **core:** add flag when db is disabled for task history ([#​28059](https://redirect.github.com/nrwl/nx/pull/28059)) - **core:** set windowsHide: true wherever possible ([#​28073](https://redirect.github.com/nrwl/nx/pull/28073)) - **core:** support more structured errors in sync generators ([#​28075](https://redirect.github.com/nrwl/nx/pull/28075)) - **core:** nx add should show errors ([#​28079](https://redirect.github.com/nrwl/nx/pull/28079)) - **core:** several powerpack fixes ([#​28088](https://redirect.github.com/nrwl/nx/pull/28088)) - **core:** remove wasi compatibility while db is unsupported in wasi ([#​28089](https://redirect.github.com/nrwl/nx/pull/28089)) - **linter:** do not generate docs.recommended property ([#​28009](https://redirect.github.com/nrwl/nx/pull/28009)) - **linter:** ignore dist and use compat helper for eslint-plugin-react-hooks ([#​28080](https://redirect.github.com/nrwl/nx/pull/28080)) - **react:** vite should be default bundler in app generator ([#​28013](https://redirect.github.com/nrwl/nx/pull/28013)) - **release:** allow dynamically continuing when current version is unresolvable ([#​28034](https://redirect.github.com/nrwl/nx/pull/28034)) - **release:** add groupPreVersionCommand to schema, improve logging ([#​28087](https://redirect.github.com/nrwl/nx/pull/28087)) ##### ❤️ Thank You - Emily Xiong [@​xiongemi](https://redirect.github.com/xiongemi) - Jack Hsu [@​jaysoo](https://redirect.github.com/jaysoo) - James Henry [@​JamesHenry](https://redirect.github.com/JamesHenry) - Jason Jean [@​FrozenPandaz](https://redirect.github.com/FrozenPandaz) - Jonathan Cammisuli - Juri Strumpflohner [@​juristr](https://redirect.github.com/juristr) - Leosvel Pérez Espinosa [@​leosvelperez](https://redirect.github.com/leosvelperez) - MaxKless [@​MaxKless](https://redirect.github.com/MaxKless) - Phillip Barta [@​Phillip9587](https://redirect.github.com/Phillip9587) ### [`v19.8.0`](https://redirect.github.com/nrwl/nx/releases/tag/19.8.0) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.7.4...19.8.0) ##### 19.8.0 (2024-09-20) ##### 🚀 Features - **angular:** add plugin for inferring nodes from angular.json files ([#​27804](https://redirect.github.com/nrwl/nx/pull/27804)) - **core:** import warns when source and destination directories are different ([#​27875](https://redirect.github.com/nrwl/nx/pull/27875)) - **core:** use durations from task history to schedule tasks ([#​27783](https://redirect.github.com/nrwl/nx/pull/27783)) - **core:** add metagenerator for convert-to-inferred ([#​27672](https://redirect.github.com/nrwl/nx/pull/27672)) - **core:** able to import gradle project ([#​27645](https://redirect.github.com/nrwl/nx/pull/27645)) - **core:** split runCommand to return status per project ([#​27705](https://redirect.github.com/nrwl/nx/pull/27705)) - **core:** handle prettier not installed when running nx format ([#​27970](https://redirect.github.com/nrwl/nx/pull/27970)) - **core:** add integration with nx powerpack ([#​27972](https://redirect.github.com/nrwl/nx/pull/27972)) - **graph:** expose functions to render pdv & error page ([#​27833](https://redirect.github.com/nrwl/nx/pull/27833)) - **graph:** add sync generators to target details in project details view ([#​27639](https://redirect.github.com/nrwl/nx/pull/27639)) - **linter:** create new workspaces with ESLint v9 and typescript-eslint v8 ([#​27404](https://redirect.github.com/nrwl/nx/pull/27404)) - **nx-dev:** clean up enterprise section ([#​27979](https://redirect.github.com/nrwl/nx/pull/27979)) - **release:** allow local dependency version protocols to be preserved, pnpm publish support ([#​27787](https://redirect.github.com/nrwl/nx/pull/27787)) - **release:** support groupPreVersionCommand for release groups ([#​27474](https://redirect.github.com/nrwl/nx/pull/27474)) - **release:** support github enterprise server ([#​26482](https://redirect.github.com/nrwl/nx/pull/26482)) ##### 🩹 Fixes - **angular:** add serve static target more intentionally [#​27854](https://redirect.github.com/nrwl/nx/issues/27854) ([#​27924](https://redirect.github.com/nrwl/nx/pull/27924), [#​27854](https://redirect.github.com/nrwl/nx/issues/27854)) - **angular:** dynamic module federation should not reset remoteUrlDefinitions [#​27793](https://redirect.github.com/nrwl/nx/issues/27793) ([#​27927](https://redirect.github.com/nrwl/nx/pull/27927), [#​27793](https://redirect.github.com/nrwl/nx/issues/27793)) - **angular:** migrations should use correct namedInputs [#​27899](https://redirect.github.com/nrwl/nx/issues/27899) ([#​27929](https://redirect.github.com/nrwl/nx/pull/27929), [#​27899](https://redirect.github.com/nrwl/nx/issues/27899)) - **angular:** license-webpack-plugin should not scan root package.json [#​27989](https://redirect.github.com/nrwl/nx/issues/27989) ([#​27994](https://redirect.github.com/nrwl/nx/pull/27994), [#​27989](https://redirect.github.com/nrwl/nx/issues/27989)) - **core:** make sure sharedGlobals is referenced in default namedInputs ([#​27813](https://redirect.github.com/nrwl/nx/pull/27813)) - **core:** take nx-release-publish target defaults into account for implicit target ([#​27764](https://redirect.github.com/nrwl/nx/pull/27764)) - **core:** handle sync generator failures ([#​27650](https://redirect.github.com/nrwl/nx/pull/27650)) - **core:** handle --no-interative for create-nx-workspace ([#​27702](https://redirect.github.com/nrwl/nx/pull/27702)) - **core:** respect filenames of inputs when computing task hash ([#​27873](https://redirect.github.com/nrwl/nx/pull/27873)) - **core:** handleErrors should display error cause if it exists ([#​27886](https://redirect.github.com/nrwl/nx/pull/27886)) - **core:** add flag to disable the db and logs when there are errors … ([#​27930](https://redirect.github.com/nrwl/nx/pull/27930)) - **core:** import should be rebasable ([#​27940](https://redirect.github.com/nrwl/nx/pull/27940)) - **core:** import handles argument escaping correctly in Windows ([#​27957](https://redirect.github.com/nrwl/nx/pull/27957)) - **core:** fix env for running parallel tasks ([#​27889](https://redirect.github.com/nrwl/nx/pull/27889)) - **core:** nx import detects plugins synchronously ([#​27958](https://redirect.github.com/nrwl/nx/pull/27958)) - **core:** fix powerpack license report and add back remote cache ([#​27983](https://redirect.github.com/nrwl/nx/pull/27983)) - **core:** link to sync generators page during sync prompt, and provide more info on docs page for disabling and applyChanges ([#​28001](https://redirect.github.com/nrwl/nx/pull/28001)) - **core:** fix powerpack fs cache package name ([#​27997](https://redirect.github.com/nrwl/nx/pull/27997)) - **core:** do not check cache validity when putting into the cache ([#​28004](https://redirect.github.com/nrwl/nx/pull/28004)) - **gradle:** fix gradle app deps ([#​27865](https://redirect.github.com/nrwl/nx/pull/27865)) - **graph:** typo ([e9fd0a7e2b](https://redirect.github.com/nrwl/nx/commit/e9fd0a7e2b)) - **js:** keep refs to ignored files and allow opting out of pruning stale refs in typescript sync generator ([#​27636](https://redirect.github.com/nrwl/nx/pull/27636)) - **js:** set compilerOptions correctly when loading .ts that targets ESM ([#​27862](https://redirect.github.com/nrwl/nx/pull/27862)) - **js:** do not infer typecheck target for root tsconfig.json ([#​27950](https://redirect.github.com/nrwl/nx/pull/27950)) - **misc:** createNodesV2 plugins should show inference capabilities ([#​27896](https://redirect.github.com/nrwl/nx/pull/27896)) - **module-federation:** collect secondary entry points from exports [#​26878](https://redirect.github.com/nrwl/nx/issues/26878) ([#​27999](https://redirect.github.com/nrwl/nx/pull/27999), [#​26878](https://redirect.github.com/nrwl/nx/issues/26878)) - **nx-cloud:** include nxCloudId when generating connect urls ([#​27882](https://redirect.github.com/nrwl/nx/pull/27882)) - **nx-dev:** update contributors value ([#​27944](https://redirect.github.com/nrwl/nx/pull/27944)) - **react:** Add historyApiFallback to webpack config ([#​27942](https://redirect.github.com/nrwl/nx/pull/27942)) - **react:** normalizing project names for module federation correctly [#​27901](https://redirect.github.com/nrwl/nx/issues/27901) ([#​27990](https://redirect.github.com/nrwl/nx/pull/27990), [#​27901](https://redirect.github.com/nrwl/nx/issues/27901)) - **release:** respect updateDependents being explicitly disabled in conventional commits ([#​27851](https://redirect.github.com/nrwl/nx/pull/27851)) - **release:** ensure git commits containing pipe can be parsed reliably ([#​27840](https://redirect.github.com/nrwl/nx/pull/27840)) - **release:** ensure default release group has projects on windows ([#​27933](https://redirect.github.com/nrwl/nx/pull/27933)) - **release:** allow string array for commitArgs and tagArgs ([#​27797](https://redirect.github.com/nrwl/nx/pull/27797)) - **remix:** vite plugin should be less strict on inference [#​27884](https://redirect.github.com/nrwl/nx/issues/27884) ([#​27923](https://redirect.github.com/nrwl/nx/pull/27923), [#​27884](https://redirect.github.com/nrwl/nx/issues/27884)) - **storybook:** do not duplicate cacheable operations [#​27866](https://redirect.github.com/nrwl/nx/issues/27866) ([#​27951](https://redirect.github.com/nrwl/nx/pull/27951), [#​27866](https://redirect.github.com/nrwl/nx/issues/27866)) - **vite:** typecheck infer plugin should use correct inputs ([#​27922](https://redirect.github.com/nrwl/nx/pull/27922)) - **vite:** exit from test if no files found ([#​27722](https://redirect.github.com/nrwl/nx/pull/27722)) - **webpack:** handle relative paths for additionalEntryPath ([#​27885](https://redirect.github.com/nrwl/nx/pull/27885)) ##### ❤️ Thank You - Ali Yusuf [@​AliYusuf95](https://redirect.github.com/AliYusuf95) - Austin Fahsl [@​fahslaj](https://redirect.github.com/fahslaj) - Benjamin Cabanes [@​bcabanes](https://redirect.github.com/bcabanes) - Colum Ferry [@​Coly010](https://redirect.github.com/Coly010) - Craigory Coppola [@​AgentEnder](https://redirect.github.com/AgentEnder) - Emily Xiong [@​xiongemi](https://redirect.github.com/xiongemi) - Jack Hsu [@​jaysoo](https://redirect.github.com/jaysoo) - James Henry [@​JamesHenry](https://redirect.github.com/JamesHenry) - Jason Jean [@​FrozenPandaz](https://redirect.github.com/FrozenPandaz) - Jonathan Gelin [@​jogelin](https://redirect.github.com/jogelin) - Juri [@​juristr](https://redirect.github.com/juristr) - Juri Strumpflohner [@​juristr](https://redirect.github.com/juristr) - Leosvel Pérez Espinosa [@​leosvelperez](https://redirect.github.com/leosvelperez) - Louie Weng [@​lourw](https://redirect.github.com/lourw) - MaxKless [@​MaxKless](https://redirect.github.com/MaxKless) - Nate Jacobs [@​iAmNathanJ](https://redirect.github.com/iAmNathanJ) - Nicholas Cunningham [@​ndcunningham](https://redirect.github.com/ndcunningham) ### [`v19.7.4`](https://redirect.github.com/nrwl/nx/releases/tag/19.7.4) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.7.3...19.7.4) ##### 19.7.4 (2024-09-18) ##### 🚀 Features - **core:** able to import gradle project ([#​27645](https://redirect.github.com/nrwl/nx/pull/27645)) - **release:** support groupPreVersionCommand for release groups ([#​27474](https://redirect.github.com/nrwl/nx/pull/27474)) ##### 🩹 Fixes - **angular:** add serve static target more intentionally [#​27854](https://redirect.github.com/nrwl/nx/issues/27854) ([#​27924](https://redirect.github.com/nrwl/nx/pull/27924), [#​27854](https://redirect.github.com/nrwl/nx/issues/27854)) - **angular:** dynamic module federation should not reset remoteUrlDefinitions [#​27793](https://redirect.github.com/nrwl/nx/issues/27793) ([#​27927](https://redirect.github.com/nrwl/nx/pull/27927), [#​27793](https://redirect.github.com/nrwl/nx/issues/27793)) - **angular:** migrations should use correct namedInputs [#​27899](https://redirect.github.com/nrwl/nx/issues/27899) ([#​27929](https://redirect.github.com/nrwl/nx/pull/27929), [#​27899](https://redirect.github.com/nrwl/nx/issues/27899)) - **core:** add flag to disable the db and logs when there are errors … ([#​27930](https://redirect.github.com/nrwl/nx/pull/27930)) - **core:** import should be rebasable ([#​27940](https://redirect.github.com/nrwl/nx/pull/27940)) - **core:** import handles argument escaping correctly in Windows ([#​27957](https://redirect.github.com/nrwl/nx/pull/27957)) - **core:** fix env for running parallel tasks ([#​27889](https://redirect.github.com/nrwl/nx/pull/27889)) - **core:** nx import detects plugins synchronously ([#​27958](https://redirect.github.com/nrwl/nx/pull/27958)) - **js:** set compilerOptions correctly when loading .ts that targets ESM ([#​27862](https://redirect.github.com/nrwl/nx/pull/27862)) - **js:** do not infer typecheck target for root tsconfig.json ([#​27950](https://redirect.github.com/nrwl/nx/pull/27950)) - **nx-dev:** update contributors value ([#​27944](https://redirect.github.com/nrwl/nx/pull/27944)) - **react:** Add historyApiFallback to webpack config ([#​27942](https://redirect.github.com/nrwl/nx/pull/27942)) - **release:** ensure default release group has projects on windows ([#​27933](https://redirect.github.com/nrwl/nx/pull/27933)) - **release:** allow string array for commitArgs and tagArgs ([#​27797](https://redirect.github.com/nrwl/nx/pull/27797)) - **remix:** vite plugin should be less strict on inference [#​27884](https://redirect.github.com/nrwl/nx/issues/27884) ([#​27923](https://redirect.github.com/nrwl/nx/pull/27923), [#​27884](https://redirect.github.com/nrwl/nx/issues/27884)) - **storybook:** do not duplicate cacheable operations [#​27866](https://redirect.github.com/nrwl/nx/issues/27866) ([#​27951](https://redirect.github.com/nrwl/nx/pull/27951), [#​27866](https://redirect.github.com/nrwl/nx/issues/27866)) - **vite:** typecheck infer plugin should use correct inputs ([#​27922](https://redirect.github.com/nrwl/nx/pull/27922)) - **vite:** exit from test if no files found ([#​27722](https://redirect.github.com/nrwl/nx/pull/27722)) ##### ❤️ Thank You - Ali Yusuf [@​AliYusuf95](https://redirect.github.com/AliYusuf95) - Austin Fahsl [@​fahslaj](https://redirect.github.com/fahslaj) - Benjamin Cabanes [@​bcabanes](https://redirect.github.com/bcabanes) - Colum Ferry [@​Coly010](https://redirect.github.com/Coly010) - Craigory Coppola [@​AgentEnder](https://redirect.github.com/AgentEnder) - Emily Xiong [@​xiongemi](https://redirect.github.com/xiongemi) - Jack Hsu [@​jaysoo](https://redirect.github.com/jaysoo) - Jason Jean [@​FrozenPandaz](https://redirect.github.com/FrozenPandaz) - Jonathan Gelin [@​jogelin](https://redirect.github.com/jogelin) - Leosvel Pérez Espinosa [@​leosvelperez](https://redirect.github.com/leosvelperez) - Nicholas Cunningham [@​ndcunningham](https://redirect.github.com/ndcunningham) ### [`v19.7.3`](https://redirect.github.com/nrwl/nx/releases/tag/19.7.3) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.7.2...19.7.3) ##### 19.7.3 (2024-09-12) ##### 🚀 Features - **core:** import warns when source and destination directories are different ([#​27875](https://redirect.github.com/nrwl/nx/pull/27875)) ##### 🩹 Fixes - **core:** handle sync generator failures ([#​27650](https://redirect.github.com/nrwl/nx/pull/27650)) - **core:** handle --no-interative for create-nx-workspace ([#​27702](https://redirect.github.com/nrwl/nx/pull/27702)) - **core:** respect filenames of inputs when computing task hash ([#​27873](https://redirect.github.com/nrwl/nx/pull/27873)) - **core:** handleErrors should display error cause if it exists ([#​27886](https://redirect.github.com/nrwl/nx/pull/27886)) - **gradle:** fix gradle app deps ([#​27865](https://redirect.github.com/nrwl/nx/pull/27865)) - **js:** keep refs to ignored files and allow opting out of pruning stale refs in typescript sync generator ([#​27636](https://redirect.github.com/nrwl/nx/pull/27636)) - **misc:** createNodesV2 plugins should show inference capabilities ([#​27896](https://redirect.github.com/nrwl/nx/pull/27896)) - **nx-cloud:** include nxCloudId when generating connect urls ([#​27882](https://redirect.github.com/nrwl/nx/pull/27882)) - **webpack:** handle relative paths for additionalEntryPath ([#​27885](https://redirect.github.com/nrwl/nx/pull/27885)) ##### ❤️ Thank You - Craigory Coppola [@​AgentEnder](https://redirect.github.com/AgentEnder) - Emily Xiong [@​xiongemi](https://redirect.github.com/xiongemi) - Jack Hsu [@​jaysoo](https://redirect.github.com/jaysoo) - Leosvel Pérez Espinosa [@​leosvelperez](https://redirect.github.com/leosvelperez) - Louie Weng [@​lourw](https://redirect.github.com/lourw) - Nate Jacobs [@​iAmNathanJ](https://redirect.github.com/iAmNathanJ) ### [`v19.7.2`](https://redirect.github.com/nrwl/nx/releases/tag/19.7.2) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.7.1...19.7.2) ##### 19.7.2 (2024-09-10) ##### 🩹 Fixes - **core:** take nx-release-publish target defaults into account for implicit target ([#​27764](https://redirect.github.com/nrwl/nx/pull/27764)) - **release:** ensure git commits containing pipe can be parsed reliably ([#​27840](https://redirect.github.com/nrwl/nx/pull/27840)) ##### ❤️ Thank You - James Henry [@​JamesHenry](https://redirect.github.com/JamesHenry) ### [`v19.7.1`](https://redirect.github.com/nrwl/nx/releases/tag/19.7.1) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.7.0...19.7.1) ##### 19.7.1 (2024-09-10) ##### 🚀 Features - **release:** allow local dependency version protocols to be preserved, pnpm publish support ([#​27787](https://redirect.github.com/nrwl/nx/pull/27787)) ##### 🩹 Fixes - **core:** make sure sharedGlobals is referenced in default namedInputs ([#​27813](https://redirect.github.com/nrwl/nx/pull/27813)) - **release:** respect updateDependents being explicitly disabled in conventional commits ([#​27851](https://redirect.github.com/nrwl/nx/pull/27851)) ##### ❤️ Thank You - James Henry [@​JamesHenry](https://redirect.github.com/JamesHenry) - Juri Strumpflohner [@​juristr](https://redirect.github.com/juristr) ### [`v19.7.0`](https://redirect.github.com/nrwl/nx/releases/tag/19.7.0) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.6.6...19.7.0) ##### 19.7.0 (2024-09-09) ##### 🚀 Features - **bundling:** add option to generate sourcemaps for Rollup build ([#​27539](https://redirect.github.com/nrwl/nx/pull/27539)) - **bundling:** add nxCopyAssetsPlugin for Vite to use in JS libs ([#​27593](https://redirect.github.com/nrwl/nx/pull/27593)) - **core:** add shutdown lifecycle hook to node executor ([#​27354](https://redirect.github.com/nrwl/nx/pull/27354)) - **core:** add sqlite db for nx ([#​26891](https://redirect.github.com/nrwl/nx/pull/26891)) - **core:** expose graph json type ([#​27496](https://redirect.github.com/nrwl/nx/pull/27496)) - **core:** return task results from imperative task runner ([#​27640](https://redirect.github.com/nrwl/nx/pull/27640)) - **core:** refactor graph implementation details ([#​27267](https://redirect.github.com/nrwl/nx/pull/27267)) - **core:** allow disabling registered task sync generators ([#​27638](https://redirect.github.com/nrwl/nx/pull/27638)) - **core:** allow skipping sync when running tasks ([#​27697](https://redirect.github.com/nrwl/nx/pull/27697)) - **core:** add shutdown lifecycle hook to node executor" ([#​27794](https://redirect.github.com/nrwl/nx/pull/27794)) - **core:** update PNPM GH action setup to use v4 and pnpm version 9 ([#​27664](https://redirect.github.com/nrwl/nx/pull/27664)) - **devkit:** prefer strings over Linter enum ([#​27209](https://redirect.github.com/nrwl/nx/pull/27209)) - **docs:** update OpenAI model to use gpt-4o-mini ([#​27434](https://redirect.github.com/nrwl/nx/pull/27434)) - **graph:** add expandedTargets to project details on nx dev ([#​26911](https://redirect.github.com/nrwl/nx/pull/26911)) - **graph:** update tags to render on a single line by default with expand option ([#​27829](https://redirect.github.com/nrwl/nx/pull/27829)) - **js:** add skipPackageManager option to build executors in order to skip generating "packageManager" entry in package.json ([#​27518](https://redirect.github.com/nrwl/nx/pull/27518)) - **js:** generate package.json with overrides and resolutions ([#​27601](https://redirect.github.com/nrwl/nx/pull/27601)) - **js:** add metadata to the typescript inferred tasks ([#​27806](https://redirect.github.com/nrwl/nx/pull/27806)) - **linter:** add option to exclude projects from circular deps check ([#​27504](https://redirect.github.com/nrwl/nx/pull/27504)) - **nx-cloud:** alias for login and logout ([#​27358](https://redirect.github.com/nrwl/nx/pull/27358)) - **nx-cloud:** remove feature flag for nx login ([#​27657](https://redirect.github.com/nrwl/nx/pull/27657)) - **nx-cloud:** add 'generate-token' option to connect ([#​27678](https://redirect.github.com/nrwl/nx/pull/27678)) - **nx-cloud:** remove env variable for login ([#​27791](https://redirect.github.com/nrwl/nx/pull/27791)) - **nx-dev:** add Explain with AI to Enterprise and Pro Plans ([#​27455](https://redirect.github.com/nrwl/nx/pull/27455)) - **nx-dev:** add Monorepo World banner to hero ([#​27482](https://redirect.github.com/nrwl/nx/pull/27482)) - **nx-dev:** honor prefers-reduced-motion ([#​27541](https://redirect.github.com/nrwl/nx/pull/27541)) - **nx-dev:** add deepdive callout component ([daf5837a21](https://redirect.github.com/nrwl/nx/commit/daf5837a21)) - **nx-dev:** add Mike Hartington in the team section ([#​27755](https://redirect.github.com/nrwl/nx/pull/27755)) - **nx-dev:** make animations more performant ([#​27757](https://redirect.github.com/nrwl/nx/pull/27757)) - **nx-dev:** add create-nx-workspace from nx-cloud on ci section ([#​27756](https://redirect.github.com/nrwl/nx/pull/27756)) - **react:** add rspack module federation support ([#​27696](https://redirect.github.com/nrwl/nx/pull/27696)) - **react:** add module federation static server ([#​27802](https://redirect.github.com/nrwl/nx/pull/27802)) - **remix:** infer targets for remix vite in @​nx/remix/plugin ([#​27713](https://redirect.github.com/nrwl/nx/pull/27713)) ##### 🩹 Fixes - missing export for setRemoteDefinition ([#​27491](https://redirect.github.com/nrwl/nx/pull/27491)) - **angular:** generate [@​nx/angular](https://redirect.github.com/nx/angular) in devDependencies and move to dependencies when using runtime helpers ([#​27405](https://redirect.github.com/nrwl/nx/pull/27405)) - **angular:** module-federation-ssr-dev-server should call correct builder ([#​27477](https://redirect.github.com/nrwl/nx/pull/27477)) - **angular:** bump ngrx version to 18.0.2 ([#​27506](https://redirect.github.com/nrwl/nx/pull/27506)) - **angular:** ensure target default for '[@​nx/angular](https://redirect.github.com/nx/angular):webpack-browser' is set [#​26483](https://redirect.github.com/nrwl/nx/issues/26483) ([#​27616](https://redirect.github.com/nrwl/nx/pull/27616), [#​26483](https://redirect.github.com/nrwl/nx/issues/26483)) - **bundling:** update snapshots for copy assets plugin ([#​27610](https://redirect.github.com/nrwl/nx/pull/27610)) - **core:** fix importing files with special characters ([#​27484](https://redirect.github.com/nrwl/nx/pull/27484)) - **core:** use withVerbose util ([#​27553](https://redirect.github.com/nrwl/nx/pull/27553)) - **core:** support import detection of packages installed from git remote URL ([#​27569](https://redirect.github.com/nrwl/nx/pull/27569)) - **core:** fix compat for old remote caches ([#​27574](https://redirect.github.com/nrwl/nx/pull/27574)) - **core:** enable using the daemon in docker if enabled explicitly ([#​27585](https://redirect.github.com/nrwl/nx/pull/27585)) - **core:** ensure file watcher is looking for correct config on windows ([#​27594](https://redirect.github.com/nrwl/nx/pull/27594)) - **core:** change order of CI providers to match their popularity ([#​27623](https://redirect.github.com/nrwl/nx/pull/27623)) - **core:** not parse hex to number ([#​27515](https://redirect.github.com/nrwl/nx/pull/27515)) - **core:** nx migrate should determine angular devkit migration from cli or schematics [#​20282](https://redirect.github.com/nrwl/nx/issues/20282) ([#​27634](https://redirect.github.com/nrwl/nx/pull/27634), [#​20282](https://redirect.github.com/nrwl/nx/issues/20282)) - **core:** do not stream output when static output style is enabled ([#​27642](https://redirect.github.com/nrwl/nx/pull/27642)) - **core:** fix --e2eTestRunner for create-nx-workspace with react native ([#​27543](https://redirect.github.com/nrwl/nx/pull/27543)) - **core:** negative workspace-root filesets should override positive filesets ([#​27524](https://redirect.github.com/nrwl/nx/pull/27524)) - **core:** make sure env vars specified in run-commands envFile option take priority over other loaded env files ([#​27583](https://redirect.github.com/nrwl/nx/pull/27583)) - **core:** change remoteCache to getRemoteCache ([#​27673](https://redirect.github.com/nrwl/nx/pull/27673)) - **core:** fixes an issue where using "node:test" results in infinite loop ([#​27685](https://redirect.github.com/nrwl/nx/pull/27685)) - **core:** handle file change conflicts between sync generators ([#​27695](https://redirect.github.com/nrwl/nx/pull/27695)) - **core:** filter branch in preparation for nx import ([#​27652](https://redirect.github.com/nrwl/nx/pull/27652)) - **core:** add parallelism to target defaults schema ([#​27710](https://redirect.github.com/nrwl/nx/pull/27710)) - **core:** bump plugin pool attempts to work with slow runtimes ([#​27726](https://redirect.github.com/nrwl/nx/pull/27726)) - **core:** optimize daemon output glob matching ([#​27775](https://redirect.github.com/nrwl/nx/pull/27775)) - **core:** fix wasm build ([#​27830](https://redirect.github.com/nrwl/nx/pull/27830)) - **core:** move daemon server-process.json watching to outputs watcher ([#​27832](https://redirect.github.com/nrwl/nx/pull/27832)) - **detox:** fix name with camel case ([#​27602](https://redirect.github.com/nrwl/nx/pull/27602)) - **esbuild:** declaration:true should find the correct package root regardless of cwd [#​26261](https://redirect.github.com/nrwl/nx/issues/26261) ([#​27560](https://redirect.github.com/nrwl/nx/pull/27560), [#​26261](https://redirect.github.com/nrwl/nx/issues/26261)) - **expo:** add expoLibraryGenerator to export ([#​27520](https://redirect.github.com/nrwl/nx/pull/27520)) - **expo:** fix unable to build expo local for yarn 4 ([#​26992](https://redirect.github.com/nrwl/nx/pull/26992)) - **expo:** add cacheVersion to metro.config ([#​27646](https://redirect.github.com/nrwl/nx/pull/27646)) - **gradle:** track childProjects in properties report ([#​27488](https://redirect.github.com/nrwl/nx/pull/27488)) - **gradle:** fix tasksFileLines might be undefined ([#​27548](https://redirect.github.com/nrwl/nx/pull/27548)) - **gradle:** fix child project deps ([#​27643](https://redirect.github.com/nrwl/nx/pull/27643)) - **gradle:** fix find root for projects ([#​27651](https://redirect.github.com/nrwl/nx/pull/27651)) - **graph:** fix "args" help tooltip in pdv and only show "args" usage in fallback example ([#​27808](https://redirect.github.com/nrwl/nx/pull/27808)) - **js:** handle arbitrary nested ts path mappings when re-mapping them to the outputs ([#​27429](https://redirect.github.com/nrwl/nx/pull/27429)) - **js:** only sync references when composite is true, preserve comments in other parts of file ([#​27530](https://redirect.github.com/nrwl/nx/pull/27530)) - **js:** ensure assets option in tsc executor defaults to empty array for programmatic usage ([#​27565](https://redirect.github.com/nrwl/nx/pull/27565)) - **js:** fix verdaccio windows for registry ([#​27350](https://redirect.github.com/nrwl/nx/pull/27350)) - **js:** respect "watch" option when "runBuildTargetDependencies" is true ([#​27677](https://redirect.github.com/nrwl/nx/pull/27677)) - **linter:** update the [@​nx/dependency-checks](https://redirect.github.com/nx/dependency-checks) rule to read the package.json content from the rule context ([#​27476](https://redirect.github.com/nrwl/nx/pull/27476)) - **linter:** fix plugin race condition ([#​27810](https://redirect.github.com/nrwl/nx/pull/27810)) - **misc:** ensure custom reporters are usable with [@​nx/playwright](https://redirect.github.com/nx/playwright):playwright ([#​27443](https://redirect.github.com/nrwl/nx/pull/27443)) - **misc:** fix the URL of the [@​naxodev/nx-cloudflare](https://redirect.github.com/naxodev/nx-cloudflare) plugin ([#​27723](https://redirect.github.com/nrwl/nx/pull/27723)) - **module-federation:** ensure target defaults are set correctly [#​27448](https://redirect.github.com/nrwl/nx/issues/27448) ([#​27472](https://redirect.github.com/nrwl/nx/pull/27472), [#​27448](https://redirect.github.com/nrwl/nx/issues/27448)) - **module-federation:** ensure shared packages can be shared from host [#​27162](https://redirect.github.com/nrwl/nx/issues/27162) ([#​27513](https://redirect.github.com/nrwl/nx/pull/27513), [#​27162](https://redirect.github.com/nrwl/nx/issues/27162)) - **module-federation:** ssr uses async-node with runtime plugin ([#​27492](https://redirect.github.com/nrwl/nx/pull/27492)) - **nextjs:** should not fail when running outside of nx cli ([#​27523](https://redirect.github.com/nrwl/nx/pull/27523)) - **nextjs:** Should be able to run custom server targets with swc ([#​27526](https://redirect.github.com/nrwl/nx/pull/27526)) - **nextjs:** schema type for unitTestRunner for library ([#​26824](https://redirect.github.com/nrwl/nx/pull/26824)) - **node:** build-esbuild-options.ts browser user define envs by config ([#​27480](https://redirect.github.com/nrwl/nx/pull/27480)) - **node:** generate webpack server apps with generatePackageJson:true by default ([#​27570](https://redirect.github.com/nrwl/nx/pull/27570)) - **nx-dev:** Og image path generation ([#​27456](https://redirect.github.com/nrwl/nx/pull/27456)) - **nx-dev:** bad link from home page ([#​27475](https://redirect.github.com/nrwl/nx/pull/27475)) - **nx-dev:** fix use `key` instead of `env` to reference cache key in… ([#​26644](https://redirect.github.com/nrwl/nx/pull/26644)) - **nx-dev:** modify prompt ([#​27536](https://redirect.github.com/nrwl/nx/pull/27536)) - **nx-dev:** show first tab if none selected ([#​27701](https://redirect.github.com/nrwl/nx/pull/27701)) - **nx-dev:** change connect to nx cloud link in home page ([f39b995b88](https://redirect.github.com/nrwl/nx/commit/f39b995b88)) - **nx-dev:** make sure graph height works and render mode is nx-docs ([#​27776](https://redirect.github.com/nrwl/nx/pull/27776)) - **nx-dev:** update Bill's website link ([#​27790](https://redirect.github.com/nrwl/nx/pull/27790)) - **nx-plugin:** allow create-package without e2eProject ([#​27572](https://redirect.github.com/nrwl/nx/pull/27572)) - **react:** ensure [@​vitejs/plugin-react](https://redirect.github.com/vitejs/plugin-react) is installed for storybook ([#​27463](https://redirect.github.com/nrwl/nx/pull/27463)) - **react:** enable vitejs-plugin-react-swc for swc compiler ([#​27457](https://redirect.github.com/nrwl/nx/pull/27457)) - **react:** handle more scenarios when collecting component props for generating stories ([#​27528](https://redirect.github.com/nrwl/nx/pull/27528)) - **react:** tailwind with rspack should work on generation [#​27028](https://redirect.github.com/nrwl/nx/issues/27028) ([#​27619](https://redirect.github.com/nrwl/nx/pull/27619), [#​27028](https://redirect.github.com/nrwl/nx/issues/27028)) - **react:** ensure interop between webpack and rspack module federation ([#​27824](https://redirect.github.com/nrwl/nx/pull/27824)) - **react-native:** remove upgrade command in migration ([#​27467](https://redirect.github.com/nrwl/nx/pull/27467)) - **react-native:** change hermesCommand to build android ([#​27641](https://redirect.github.com/nrwl/nx/pull/27641)) - **release:** programmatic API types should not be any ([#​27647](https://redirect.github.com/nrwl/nx/pull/27647)) - **release:** release plan command should take filters and touched projects into account ([#​27706](https://redirect.github.com/nrwl/nx/pull/27706)) - **release:** version plan changelogs should contain authors and refs ([#​27737](https://redirect.github.com/nrwl/nx/pull/27737)) - **release:** support forwarding the --access flag to npm publish ([#​27765](https://redirect.github.com/nrwl/nx/pull/27765)) - **release:** show version plan deletion log in dry-run ([#​27744](https://redirect.github.com/nrwl/nx/pull/27744)) - **repo:** add dependsOn to native build ([#​27446](https://redirect.github.com/nrwl/nx/pull/27446)) - **storybook:** should generate correct config for nextjs apps [#​27233](https://redirect.github.com/nrwl/nx/issues/27233) ([#​27510](https://redirect.github.com/nrwl/nx/pull/27510), [#​27233](https://redirect.github.com/nrwl/nx/issues/27233)) - **testing:** fix misc issues in migrations ([#​27471](https://redirect.github.com/nrwl/nx/pull/27471)) - **testing:** fix issues in static server target migrations ([#​27547](https://redirect.github.com/nrwl/nx/pull/27547)) - **testing:** application generators should accurately configure e2e projects ([#​27453](https://redirect.github.com/nrwl/nx/pull/27453)) - **vite:** plugin should infer serve target if server config defined [#​27370](https://redirect.github.com/nrwl/nx/issues/27370) ([#​27507](https://redirect.github.com/nrwl/nx/pull/27507), [#​27370](https://redirect.github.com/nrwl/nx/issues/27370)) - **vite:** load the correct config file from [@​nx/vite](https://redirect.github.com/nx/vite):test executor ([#​27514](https://redirect.github.com/nrwl/nx/pull/27514)) - **vite:** add typecheck inferred target for vite plugin [#​27501](https://redirect.github.com/nrwl/nx/issues/27501) ([#​27531](https://redirect.github.com/nrwl/nx/pull/27531), [#​27501](https://redirect.github.com/nrwl/nx/issues/27501)) - **vite:** plugin should infer ts project correctly for libs ([#​27649](https://redirect.github.com/nrwl/nx/pull/27649)) - **vite:** tsconfig paths plugin should resolve file extensions ([#​27774](https://redirect.github.com/nrwl/nx/pull/27774)) - **webpack:** add migration for proxy config ([#​27621](https://redirect.github.com/nrwl/nx/pull/27621)) ##### ❤️ Thank You - [@​NgDaddy](https://redirect.github.com/NgDaddy) [@​NgDaddy](https://redirect.github.com/NgDaddy) - Austin Fahsl [@​fahslaj](https://redirect.github.com/fahslaj) - Benjamin Cabanes [@​bcabanes](https://redirect.github.com/bcabanes) - Chau Tran - Colum Ferry [@​Coly010](https://redirect.github.com/Coly010) - Craigory Coppola [@​AgentEnder](https://redirect.github.com/AgentEnder) - EGonz1PCTY - Emily Xiong [@​xiongemi](https://redirect.github.com/xiongemi) - Feliche-Demian Netliukh - Guilherme Prezzi [@​menosprezzi](https://redirect.github.com/menosprezzi) - Isaac Mann [@​isaacplmann](https://redirect.github.com/isaacplmann) - Jack Hsu [@​jaysoo](https://redirect.github.com/jaysoo) - James Henry [@​JamesHenry](https://redirect.github.com/JamesHenry) - Jason Jean [@​FrozenPandaz](https://redirect.github.com/FrozenPandaz) - Jonathan Cammisuli - Juri [@​juristr](https://redirect.github.com/juristr) - Juri Strumpflohner [@​juristr](https://redirect.github.com/juristr) - Kamenskih Dmitriy - Leosvel Pérez Espinosa [@​leosvelperez](https://redirect.github.com/leosvelperez) - Louie Weng [@​lourw](https://redirect.github.com/lourw) - MaxKless [@​MaxKless](https://redirect.github.com/MaxKless) - Miroslav Jonaš [@​meeroslav](https://redirect.github.com/meeroslav) - Nicholas Cunningham [@​ndcunningham](https://redirect.github.com/ndcunningham) - Nicolas Beaussart - Paweł Twardziak [@​paweltwardziak](https://redirect.github.com/paweltwardziak) - Tine Kondo [@​tinesoft](https://redirect.github.com/tinesoft) - Victor Berchet [@​vicb](https://redirect.github.com/vicb) - Wei Liang [@​weiliang79](https://redirect.github.com/weiliang79) ### [`v19.6.6`](https://redirect.github.com/nrwl/nx/releases/tag/19.6.6) [Compare Source](https://redirect.github.com/nrwl/nx/compare/19.6.5...19.6.6) ##### 19.6.6 (2024-09-09) ##### 🚀 Features - **core:** allow skipping sync when running tasks ([#​27697](https://redirect.github.com/nrwl/nx/pull/27697)) - **core:** add shutdown lifecycle hook to node executor" ([#​27794](https://redirect.github.com/nrwl/nx/pull/27794)) - **core:** update PNPM GH action setup to use v4 and pnpm version 9 ([#​27664](https://redirect.github.com/nrwl/nx/pull/27664)) - **linter:** add option to exclude projects from circular deps check ([#​27504](https://redirect.github.com/nrwl/nx/pull/27504)) - **nx-dev:** add Mike Hartington in the team section ([#​27755](https://redirect.github.com/nrwl/nx/pull/27755)) - **nx-dev:** make animations more performant ([#​27757](https://redirect.github.com/nrwl/nx/pull/27757)) - **nx-dev:** add create-nx-workspace from nx-cloud on ci section ([#​27756](https://redirect.github.com/nrwl/nx/pull/27756)) ##### 🩹 Fixes - **core:** optimize daemon output glob matching ([#​27775](https://redirect.github.com/nrwl/nx/pull/27775)) - **core:** fix wasm build ([#​27830](https://redirect.github.com/nrwl/nx/pull/27830)) - **graph:** fix "args" help tooltip in pdv and only show "args" usage in fallback example ([#​27808](https://redirect.github.com/nrwl/nx/pull/27808)) - **linter:** fix plugin race condition ([#​27810](https://redirect.github.com/nrwl/nx/pull/27810)) - **module-federation:** ssr uses async-node with runtime plugin ([#​27492](https://redirect.github.com/nrwl/nx/pull/27492)) - **nx-dev:** change connect to nx cloud link in home page ([d93cd00123](https://redirect.github.com/nrwl/nx/commit/d93cd00123)) - **nx-dev:** update Bill's website link ([#​27790](https://redirect.github.com/nrwl/nx/pull/27790)) - **release:** show version plan deletion log in dry-run ([#​27744](https://redirect.github.com/nrwl/nx/pull/27744)) - **vite:** tsconfig paths plugin should resolve file extensions ([#​27774](https://redirect.github.com/nrwl/nx/pull/27774)) ##### ❤️ Thank You - Benjamin Cabanes [@​bcabanes](https://redirect.github.com/bcabanes) - Colum Ferry [@​Coly010](https://redirect.github.com/Coly010) - Craigory Coppola [@​AgentEnder](https://redirect.github.com/AgentEnder) - Jack Hsu [@​jaysoo](https://redirect.github.com/jaysoo) - James Henry [@​JamesHenry](https://redirect.github.com/JamesHenry) - Jason Jean [@​FrozenPandaz](https://redirect.github.com/FrozenPandaz) - Juri Strumpflohner [@​juristr](https://redirect.github.com/juristr) - Leosvel Pérez Espinosa [@​leosvelperez](https://redirect.github.com/leosvelperez) - Miroslav Jonaš [@​meeroslav](https://redirect.github.com/meeroslav)
--- - [ ] If you want to rebase/retry this PR, check this box Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 16 ++++++++-------- package.json | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index bb1275cb79f..404c0e11017 100644 --- a/package-lock.json +++ b/package-lock.json @@ -108,9 +108,9 @@ "workbox-build": "7.1.1" }, "optionalDependencies": { - "@nx/nx-darwin-arm64": "19.6.5", + "@nx/nx-darwin-arm64": "19.8.6", "@nx/nx-linux-x64-gnu": "18.3.5", - "@nx/nx-win32-x64-msvc": "19.6.5" + "@nx/nx-win32-x64-msvc": "19.8.6" } }, "node_modules/@actions/core": { @@ -6571,9 +6571,9 @@ "license": "0BSD" }, "node_modules/@nx/nx-darwin-arm64": { - "version": "19.6.5", - "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-19.6.5.tgz", - "integrity": "sha512-sFU2k0BaklM17206F2E5C3866y0SICb0xyuPeD6D07a6hB4IstjIUkldUJJN70wEsJ5I3VP4yZ2oJcwnb1TTRQ==", + "version": "19.8.6", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-19.8.6.tgz", + "integrity": "sha512-lzFV07gUgvy07lPtRFJFhlQdcR0qNTPPq7/ZB+3alwUIDdAn706ZVzf6apCJWOBIgNFKbAQiy/du0zmuKPSzXA==", "cpu": [ "arm64" ], @@ -6720,9 +6720,9 @@ } }, "node_modules/@nx/nx-win32-x64-msvc": { - "version": "19.6.5", - "resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-19.6.5.tgz", - "integrity": "sha512-jjhbDYNBkyz9Fg1jf0KZTrgdf/yx4v+k0ifukDIHZjva+jko0Ve5WzdkQ2K07M9ZxxYibDtTDqX9uX6+eFZtoA==", + "version": "19.8.6", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-19.8.6.tgz", + "integrity": "sha512-kbWDZGD9kwP60UykTnfMR1hOUMDK0evXb5EnF4MAf4o18+b5KSzHyaL2TyNl+3s6lYdtZ2kYC679R+eJErKG8w==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 7ec113b00a4..bf4a10f0d74 100644 --- a/package.json +++ b/package.json @@ -136,8 +136,8 @@ "patch-package": "8.0.0" }, "optionalDependencies": { - "@nx/nx-darwin-arm64": "19.6.5", + "@nx/nx-darwin-arm64": "19.8.6", "@nx/nx-linux-x64-gnu": "18.3.5", - "@nx/nx-win32-x64-msvc": "19.6.5" + "@nx/nx-win32-x64-msvc": "19.8.6" } } From fc1b875be2575fa1c1fe10d207d24d7847ea2a65 Mon Sep 17 00:00:00 2001 From: Ashley Rowles <157734991+arowles@users.noreply.github.com> Date: Wed, 23 Oct 2024 09:58:55 -0700 Subject: [PATCH 04/17] fix: updated web-adapter name (#10581) **Related Issue:** # ## Summary **updated** web-adaptor > web-adapter --- packages/calcite-ui-icons/docs/keywords.json | 2 +- .../icons/{web-adaptor-16.svg => web-adapter-16.svg} | 0 .../icons/{web-adaptor-24.svg => web-adapter-24.svg} | 0 .../icons/{web-adaptor-32.svg => web-adapter-32.svg} | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename packages/calcite-ui-icons/icons/{web-adaptor-16.svg => web-adapter-16.svg} (100%) rename packages/calcite-ui-icons/icons/{web-adaptor-24.svg => web-adapter-24.svg} (100%) rename packages/calcite-ui-icons/icons/{web-adaptor-32.svg => web-adapter-32.svg} (100%) diff --git a/packages/calcite-ui-icons/docs/keywords.json b/packages/calcite-ui-icons/docs/keywords.json index 382c24df4a4..85e5a843081 100644 --- a/packages/calcite-ui-icons/docs/keywords.json +++ b/packages/calcite-ui-icons/docs/keywords.json @@ -8901,7 +8901,7 @@ "category": "Lists", "release": "3.29.6" }, - "web-adaptor": { + "web-adapter": { "alias": ["3.32.0", "gis", "web", "diagram", "nodes", "storage", "servers", "transfer"], "category": "GIS", "release": "3.32.0" diff --git a/packages/calcite-ui-icons/icons/web-adaptor-16.svg b/packages/calcite-ui-icons/icons/web-adapter-16.svg similarity index 100% rename from packages/calcite-ui-icons/icons/web-adaptor-16.svg rename to packages/calcite-ui-icons/icons/web-adapter-16.svg diff --git a/packages/calcite-ui-icons/icons/web-adaptor-24.svg b/packages/calcite-ui-icons/icons/web-adapter-24.svg similarity index 100% rename from packages/calcite-ui-icons/icons/web-adaptor-24.svg rename to packages/calcite-ui-icons/icons/web-adapter-24.svg diff --git a/packages/calcite-ui-icons/icons/web-adaptor-32.svg b/packages/calcite-ui-icons/icons/web-adapter-32.svg similarity index 100% rename from packages/calcite-ui-icons/icons/web-adaptor-32.svg rename to packages/calcite-ui-icons/icons/web-adapter-32.svg From 2a1d6e1e9a62de27ff00adcd3b751b47a465e6a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 23 Oct 2024 17:05:19 +0000 Subject: [PATCH 05/17] chore: release next --- package-lock.json | 14 +++++++------- .../projects/component-library/CHANGELOG.md | 4 ++++ .../projects/component-library/package.json | 4 ++-- packages/calcite-components-react/CHANGELOG.md | 4 ++++ packages/calcite-components-react/package.json | 4 ++-- packages/calcite-components/CHANGELOG.md | 4 ++++ packages/calcite-components/package.json | 4 ++-- packages/calcite-ui-icons/CHANGELOG.md | 6 ++++++ packages/calcite-ui-icons/package.json | 2 +- 9 files changed, 32 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 404c0e11017..bd698fb8313 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35334,10 +35334,10 @@ }, "packages/calcite-components": { "name": "@esri/calcite-components", - "version": "2.14.0-next.15", + "version": "2.14.0-next.16", "license": "SEE LICENSE.md", "dependencies": { - "@esri/calcite-ui-icons": "3.33.0-next.3", + "@esri/calcite-ui-icons": "3.33.0-next.4", "@floating-ui/dom": "1.6.11", "@stencil/core": "4.20.0", "@types/color": "3.0.6", @@ -39035,10 +39035,10 @@ }, "packages/calcite-components-angular/projects/component-library": { "name": "@esri/calcite-components-angular", - "version": "2.14.0-next.15", + "version": "2.14.0-next.16", "license": "SEE LICENSE.md", "dependencies": { - "@esri/calcite-components": "2.14.0-next.15", + "@esri/calcite-components": "2.14.0-next.16", "tslib": "2.6.3" }, "peerDependencies": { @@ -39048,10 +39048,10 @@ }, "packages/calcite-components-react": { "name": "@esri/calcite-components-react", - "version": "2.14.0-next.15", + "version": "2.14.0-next.16", "license": "SEE LICENSE.md", "dependencies": { - "@esri/calcite-components": "2.14.0-next.15" + "@esri/calcite-components": "2.14.0-next.16" }, "peerDependencies": { "react": ">=16.7", @@ -39486,7 +39486,7 @@ }, "packages/calcite-ui-icons": { "name": "@esri/calcite-ui-icons", - "version": "3.33.0-next.3", + "version": "3.33.0-next.4", "license": "SEE LICENSE.md", "bin": { "spriter": "bin/spriter.js" diff --git a/packages/calcite-components-angular/projects/component-library/CHANGELOG.md b/packages/calcite-components-angular/projects/component-library/CHANGELOG.md index 2dd2ad21d0a..f04808681c1 100644 --- a/packages/calcite-components-angular/projects/component-library/CHANGELOG.md +++ b/packages/calcite-components-angular/projects/component-library/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.14.0-next.16](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.14.0-next.15...@esri/calcite-components-angular@2.14.0-next.16) (2024-10-23) + +**Note:** Version bump only for package @esri/calcite-components-angular + ## [2.14.0-next.15](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.14.0-next.14...@esri/calcite-components-angular@2.14.0-next.15) (2024-10-21) **Note:** Version bump only for package @esri/calcite-components-angular diff --git a/packages/calcite-components-angular/projects/component-library/package.json b/packages/calcite-components-angular/projects/component-library/package.json index 7d9ceebac8b..2dd25050645 100644 --- a/packages/calcite-components-angular/projects/component-library/package.json +++ b/packages/calcite-components-angular/projects/component-library/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components-angular", - "version": "2.14.0-next.15", + "version": "2.14.0-next.16", "description": "A set of Angular components that wrap Esri's Calcite Components.", "homepage": "https://developers.arcgis.com/calcite-design-system/", "bugs": { @@ -17,7 +17,7 @@ }, "sideEffects": false, "dependencies": { - "@esri/calcite-components": "2.14.0-next.15", + "@esri/calcite-components": "2.14.0-next.16", "tslib": "2.6.3" }, "peerDependencies": { diff --git a/packages/calcite-components-react/CHANGELOG.md b/packages/calcite-components-react/CHANGELOG.md index 6cdb64cf46a..de3c380162b 100644 --- a/packages/calcite-components-react/CHANGELOG.md +++ b/packages/calcite-components-react/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.14.0-next.16](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.14.0-next.15...@esri/calcite-components-react@2.14.0-next.16) (2024-10-23) + +**Note:** Version bump only for package @esri/calcite-components-react + ## [2.14.0-next.15](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.14.0-next.14...@esri/calcite-components-react@2.14.0-next.15) (2024-10-21) **Note:** Version bump only for package @esri/calcite-components-react diff --git a/packages/calcite-components-react/package.json b/packages/calcite-components-react/package.json index 1c6db380501..fe9fafc25f8 100644 --- a/packages/calcite-components-react/package.json +++ b/packages/calcite-components-react/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components-react", - "version": "2.14.0-next.15", + "version": "2.14.0-next.16", "description": "A set of React components that wrap calcite components", "homepage": "https://developers.arcgis.com/calcite-design-system/", "repository": { @@ -28,7 +28,7 @@ "tsc": "tsc" }, "dependencies": { - "@esri/calcite-components": "2.14.0-next.15" + "@esri/calcite-components": "2.14.0-next.16" }, "peerDependencies": { "react": ">=16.7", diff --git a/packages/calcite-components/CHANGELOG.md b/packages/calcite-components/CHANGELOG.md index 5dffabd550c..905ab530551 100644 --- a/packages/calcite-components/CHANGELOG.md +++ b/packages/calcite-components/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.14.0-next.16](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.14.0-next.15...@esri/calcite-components@2.14.0-next.16) (2024-10-23) + +**Note:** Version bump only for package @esri/calcite-components + ## [2.14.0-next.15](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.14.0-next.14...@esri/calcite-components@2.14.0-next.15) (2024-10-21) ### Features diff --git a/packages/calcite-components/package.json b/packages/calcite-components/package.json index 22ded699820..b7efc61839d 100644 --- a/packages/calcite-components/package.json +++ b/packages/calcite-components/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components", - "version": "2.14.0-next.15", + "version": "2.14.0-next.16", "homepage": "https://developers.arcgis.com/calcite-design-system/", "description": "Web Components for Esri's Calcite Design System.", "main": "dist/index.cjs.js", @@ -60,7 +60,7 @@ "directory": "packages/calcite-components" }, "dependencies": { - "@esri/calcite-ui-icons": "3.33.0-next.3", + "@esri/calcite-ui-icons": "3.33.0-next.4", "@floating-ui/dom": "1.6.11", "@stencil/core": "4.20.0", "@types/color": "3.0.6", diff --git a/packages/calcite-ui-icons/CHANGELOG.md b/packages/calcite-ui-icons/CHANGELOG.md index 2574ae3da33..7c73c173658 100644 --- a/packages/calcite-ui-icons/CHANGELOG.md +++ b/packages/calcite-ui-icons/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.33.0-next.4](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-ui-icons@3.33.0-next.3...@esri/calcite-ui-icons@3.33.0-next.4) (2024-10-23) + +### Bug Fixes + +- updated web-adapter name ([#10581](https://github.com/Esri/calcite-design-system/issues/10581)) ([fc1b875](https://github.com/Esri/calcite-design-system/commit/fc1b875be2575fa1c1fe10d207d24d7847ea2a65)) + ## [3.33.0-next.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-ui-icons@3.33.0-next.2...@esri/calcite-ui-icons@3.33.0-next.3) (2024-10-21) **Note:** Version bump only for package @esri/calcite-ui-icons diff --git a/packages/calcite-ui-icons/package.json b/packages/calcite-ui-icons/package.json index 9042aca55be..2fbf4d44548 100644 --- a/packages/calcite-ui-icons/package.json +++ b/packages/calcite-ui-icons/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-ui-icons", - "version": "3.33.0-next.3", + "version": "3.33.0-next.4", "private": false, "description": "A collection of UI SVG icons created by Esri for applications.", "keywords": [ From 24d43ad2568118457f00221d1c6f216a563c3895 Mon Sep 17 00:00:00 2001 From: Anveshreddy mekala Date: Wed, 23 Oct 2024 13:12:26 -0500 Subject: [PATCH 06/17] feat(input-date-picker, date-picker): improve date picking experience (#8402) **Related Issue:** #3455, #10113 ## Summary Update `calcite-date-picker` & `calcite-input-date-picker` UI & UX. ![4D1CFC3C-8FF9-4493-9178-4DEDA0417031](https://github.com/user-attachments/assets/4b1f5a12-85df-4577-b1cd-812c22e41ef7) ### Key changes - display two calendars for range irrespective of layout. - No longer switches focus from day to end input when startDate is selected initially. - Month selection is possible via select menu - No longer positions the date-picker component relative to endInput when endInput is focused in range. - Dates from previous months are not visible in range calendar. - Divider indicator icons are removed in horizontal layout for range in input-date-picker. - No longer uses chevron icon which indicate the open status of input-date-picker in startInput field. Other issues resolved : https://github.com/Esri/calcite-design-system/issues/6321 https://github.com/Esri/calcite-design-system/issues/6410 https://github.com/Esri/calcite-design-system/issues/10301 https://github.com/Esri/calcite-design-system/issues/10291 https://github.com/Esri/calcite-design-system/issues/10113 https://github.com/Esri/calcite-design-system/issues/10243 https://github.com/Esri/calcite-design-system/issues/10490 Blocked issues: #9167 Wiki https://github.com/Esri/calcite-design-system/wiki/date%E2%80%90picker-enhancement-%238402 --- .../calcite-components/src/components.d.ts | 227 +++- .../src/components/action/action.scss | 9 +- .../date-picker-day/date-picker-day.scss | 207 +--- .../date-picker-day/date-picker-day.tsx | 16 +- .../date-picker-month-header.e2e.ts | 82 +- .../date-picker-month-header.scss | 160 ++- .../date-picker-month-header.tsx | 337 ++++-- .../date-picker-month-header/resources.ts | 13 +- .../date-picker-month/date-picker-month.scss | 107 +- .../date-picker-month/date-picker-month.tsx | 447 ++++++-- .../components/date-picker-month/resources.ts | 14 + .../components/date-picker/date-picker.e2e.ts | 1003 +++++++++++----- .../components/date-picker/date-picker.scss | 26 +- .../date-picker/date-picker.stories.ts | 30 + .../components/date-picker/date-picker.tsx | 268 +++-- .../input-date-picker.e2e.ts | 1020 ++++++++++++----- .../input-date-picker/input-date-picker.scss | 104 +- .../input-date-picker.stories.ts | 128 ++- .../input-date-picker/input-date-picker.tsx | 277 +++-- .../components/input-date-picker/resources.ts | 11 +- .../src/components/input-text/input-text.scss | 14 +- .../src/components/select/select.scss | 61 +- .../calcite-components/src/utils/date.spec.ts | 27 + packages/calcite-components/src/utils/date.ts | 37 + 24 files changed, 3199 insertions(+), 1426 deletions(-) create mode 100644 packages/calcite-components/src/components/date-picker-month/resources.ts diff --git a/packages/calcite-components/src/components.d.ts b/packages/calcite-components/src/components.d.ts index f1aa432bc3b..70288fce667 100644 --- a/packages/calcite-components/src/components.d.ts +++ b/packages/calcite-components/src/components.d.ts @@ -9,91 +9,191 @@ import { Alignment, Appearance, CollapseDirection, FlipContext, IconType, Intera import { RequestedItem } from "./components/accordion/interfaces"; import { IconNameOrString } from "./components/icon/interfaces"; import { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces"; +import { ActionMessages } from "./components/action/assets/action/t9n"; import { FlipPlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; +import { ActionBarMessages } from "./components/action-bar/assets/action-bar/t9n"; import { Columns } from "./components/action-group/interfaces"; +import { ActionGroupMessages } from "./components/action-group/assets/action-group/t9n"; +import { ActionPadMessages } from "./components/action-pad/assets/action-pad/t9n"; import { AlertDuration, AlertQueue } from "./components/alert/interfaces"; import { NumberingSystem } from "./utils/locale"; +import { AlertMessages } from "./components/alert/assets/alert/t9n"; import { HeadingLevel } from "./components/functional/Heading"; +import { BlockMessages } from "./components/block/assets/block/t9n"; import { BlockSectionToggleDisplay } from "./components/block-section/interfaces"; +import { BlockSectionMessages } from "./components/block-section/assets/block-section/t9n"; import { ButtonAlignment, DropdownIconType } from "./components/button/interfaces"; +import { ButtonMessages } from "./components/button/assets/button/t9n"; +import { CardMessages } from "./components/card/assets/card/t9n"; import { ArrowType, AutoplayType } from "./components/carousel/interfaces"; +import { CarouselMessages } from "./components/carousel/assets/carousel/t9n"; import { MutableValidityState } from "./utils/form"; +import { ChipMessages } from "./components/chip/assets/chip/t9n"; import { ColorValue, InternalColor } from "./components/color-picker/interfaces"; import { Format } from "./components/color-picker/utils"; +import { ColorPickerMessages } from "./components/color-picker/assets/color-picker/t9n"; import { ComboboxChildElement, SelectionDisplay } from "./components/combobox/interfaces"; -import { DateLocaleData } from "./components/date-picker/utils"; +import { ComboboxMessages } from "./components/combobox/assets/combobox/t9n"; +import { DatePickerMessages } from "./components/date-picker/assets/date-picker/t9n"; import { HoverRange } from "./utils/date"; +import { DateLocaleData } from "./components/date-picker/utils"; +import { DialogMessages } from "./components/dialog/assets/dialog/t9n"; import { DialogPlacement } from "./components/dialog/interfaces"; import { RequestedItem as RequestedItem2 } from "./components/dropdown-group/interfaces"; import { ItemKeyboardEvent } from "./components/dropdown/interfaces"; +import { FilterMessages } from "./components/filter/assets/filter/t9n"; import { FlowItemLikeElement } from "./components/flow/interfaces"; +import { FlowItemMessages } from "./components/flow-item/assets/flow-item/t9n"; import { ColorStop, DataSeries } from "./components/graph/interfaces"; +import { HandleMessages } from "./components/handle/assets/handle/t9n"; import { HandleChange, HandleNudge } from "./components/handle/interfaces"; +import { InlineEditableMessages } from "./components/inline-editable/assets/inline-editable/t9n"; import { InputPlacement } from "./components/input/interfaces"; +import { InputMessages } from "./components/input/assets/input/t9n"; +import { InputDatePickerMessages } from "./components/input-date-picker/assets/input-date-picker/t9n"; +import { InputNumberMessages } from "./components/input-number/assets/input-number/t9n"; +import { InputTextMessages } from "./components/input-text/assets/input-text/t9n"; +import { InputTimePickerMessages } from "./components/input-time-picker/assets/input-time-picker/t9n"; +import { TimePickerMessages } from "./components/time-picker/assets/time-picker/t9n"; +import { InputTimeZoneMessages } from "./components/input-time-zone/assets/input-time-zone/t9n"; import { OffsetStyle, TimeZoneMode } from "./components/input-time-zone/interfaces"; import { ListDragDetail } from "./components/list/interfaces"; import { ItemData } from "./components/list-item/interfaces"; +import { ListMessages } from "./components/list/assets/list/t9n"; import { SelectionAppearance } from "./components/list/resources"; +import { ListItemMessages } from "./components/list-item/assets/list-item/t9n"; +import { MenuMessages } from "./components/menu/assets/menu/t9n"; +import { MenuItemMessages } from "./components/menu-item/assets/menu-item/t9n"; import { MenuItemCustomEvent } from "./components/menu-item/interfaces"; import { MeterFillType, MeterLabelType } from "./components/meter/interfaces"; +import { ModalMessages } from "./components/modal/assets/modal/t9n"; +import { NoticeMessages } from "./components/notice/assets/notice/t9n"; +import { PaginationMessages } from "./components/pagination/assets/pagination/t9n"; +import { PanelMessages } from "./components/panel/assets/panel/t9n"; import { ItemData as ItemData1, ListFocusId } from "./components/pick-list/shared-list-logic"; import { ICON_TYPES } from "./components/pick-list/resources"; +import { PickListItemMessages } from "./components/pick-list-item/assets/pick-list-item/t9n"; +import { PopoverMessages } from "./components/popover/assets/popover/t9n"; +import { RatingMessages } from "./components/rating/assets/rating/t9n"; +import { ScrimMessages } from "./components/scrim/assets/scrim/t9n"; import { DisplayMode } from "./components/sheet/interfaces"; import { DisplayMode as DisplayMode1 } from "./components/shell-panel/interfaces"; +import { ShellPanelMessages } from "./components/shell-panel/assets/shell-panel/t9n"; import { DragDetail } from "./utils/sortableComponent"; import { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail, StepperLayout } from "./components/stepper/interfaces"; +import { StepperMessages } from "./components/stepper/assets/stepper/t9n"; +import { StepperItemMessages } from "./components/stepper-item/assets/stepper-item/t9n"; import { TabID, TabLayout, TabPosition } from "./components/tabs/interfaces"; +import { TabNavMessages } from "./components/tab-nav/assets/tab-nav/t9n"; import { Element } from "@stencil/core"; import { TabChangeEventDetail, TabCloseEventDetail } from "./components/tab/interfaces"; +import { TabTitleMessages } from "./components/tab-title/assets/tab-title/t9n"; import { RowType, TableInteractionMode, TableLayout, TableRowFocusEvent, TableSelectionDisplay } from "./components/table/interfaces"; +import { TableMessages } from "./components/table/assets/table/t9n"; +import { TableCellMessages } from "./components/table-cell/assets/table-cell/t9n"; +import { TableHeaderMessages } from "./components/table-header/assets/table-header/t9n"; +import { TextAreaMessages } from "./components/text-area/assets/text-area/t9n"; import { TileSelectType } from "./components/tile-select/interfaces"; import { TileSelectGroupLayout } from "./components/tile-select-group/interfaces"; +import { TipMessages } from "./components/tip/assets/tip/t9n"; +import { TipManagerMessages } from "./components/tip-manager/assets/tip-manager/t9n"; import { TreeItemSelectDetail } from "./components/tree-item/interfaces"; +import { ValueListMessages } from "./components/value-list/assets/value-list/t9n"; import { ListItemAndHandle } from "./components/value-list-item/interfaces"; export { Alignment, Appearance, CollapseDirection, FlipContext, IconType, InteractionMode, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces"; export { RequestedItem } from "./components/accordion/interfaces"; export { IconNameOrString } from "./components/icon/interfaces"; export { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces"; +export { ActionMessages } from "./components/action/assets/action/t9n"; export { FlipPlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; +export { ActionBarMessages } from "./components/action-bar/assets/action-bar/t9n"; export { Columns } from "./components/action-group/interfaces"; +export { ActionGroupMessages } from "./components/action-group/assets/action-group/t9n"; +export { ActionPadMessages } from "./components/action-pad/assets/action-pad/t9n"; export { AlertDuration, AlertQueue } from "./components/alert/interfaces"; export { NumberingSystem } from "./utils/locale"; +export { AlertMessages } from "./components/alert/assets/alert/t9n"; export { HeadingLevel } from "./components/functional/Heading"; +export { BlockMessages } from "./components/block/assets/block/t9n"; export { BlockSectionToggleDisplay } from "./components/block-section/interfaces"; +export { BlockSectionMessages } from "./components/block-section/assets/block-section/t9n"; export { ButtonAlignment, DropdownIconType } from "./components/button/interfaces"; +export { ButtonMessages } from "./components/button/assets/button/t9n"; +export { CardMessages } from "./components/card/assets/card/t9n"; export { ArrowType, AutoplayType } from "./components/carousel/interfaces"; +export { CarouselMessages } from "./components/carousel/assets/carousel/t9n"; export { MutableValidityState } from "./utils/form"; +export { ChipMessages } from "./components/chip/assets/chip/t9n"; export { ColorValue, InternalColor } from "./components/color-picker/interfaces"; export { Format } from "./components/color-picker/utils"; +export { ColorPickerMessages } from "./components/color-picker/assets/color-picker/t9n"; export { ComboboxChildElement, SelectionDisplay } from "./components/combobox/interfaces"; -export { DateLocaleData } from "./components/date-picker/utils"; +export { ComboboxMessages } from "./components/combobox/assets/combobox/t9n"; +export { DatePickerMessages } from "./components/date-picker/assets/date-picker/t9n"; export { HoverRange } from "./utils/date"; +export { DateLocaleData } from "./components/date-picker/utils"; +export { DialogMessages } from "./components/dialog/assets/dialog/t9n"; export { DialogPlacement } from "./components/dialog/interfaces"; export { RequestedItem as RequestedItem2 } from "./components/dropdown-group/interfaces"; export { ItemKeyboardEvent } from "./components/dropdown/interfaces"; +export { FilterMessages } from "./components/filter/assets/filter/t9n"; export { FlowItemLikeElement } from "./components/flow/interfaces"; +export { FlowItemMessages } from "./components/flow-item/assets/flow-item/t9n"; export { ColorStop, DataSeries } from "./components/graph/interfaces"; +export { HandleMessages } from "./components/handle/assets/handle/t9n"; export { HandleChange, HandleNudge } from "./components/handle/interfaces"; +export { InlineEditableMessages } from "./components/inline-editable/assets/inline-editable/t9n"; export { InputPlacement } from "./components/input/interfaces"; +export { InputMessages } from "./components/input/assets/input/t9n"; +export { InputDatePickerMessages } from "./components/input-date-picker/assets/input-date-picker/t9n"; +export { InputNumberMessages } from "./components/input-number/assets/input-number/t9n"; +export { InputTextMessages } from "./components/input-text/assets/input-text/t9n"; +export { InputTimePickerMessages } from "./components/input-time-picker/assets/input-time-picker/t9n"; +export { TimePickerMessages } from "./components/time-picker/assets/time-picker/t9n"; +export { InputTimeZoneMessages } from "./components/input-time-zone/assets/input-time-zone/t9n"; export { OffsetStyle, TimeZoneMode } from "./components/input-time-zone/interfaces"; export { ListDragDetail } from "./components/list/interfaces"; export { ItemData } from "./components/list-item/interfaces"; +export { ListMessages } from "./components/list/assets/list/t9n"; export { SelectionAppearance } from "./components/list/resources"; +export { ListItemMessages } from "./components/list-item/assets/list-item/t9n"; +export { MenuMessages } from "./components/menu/assets/menu/t9n"; +export { MenuItemMessages } from "./components/menu-item/assets/menu-item/t9n"; export { MenuItemCustomEvent } from "./components/menu-item/interfaces"; export { MeterFillType, MeterLabelType } from "./components/meter/interfaces"; +export { ModalMessages } from "./components/modal/assets/modal/t9n"; +export { NoticeMessages } from "./components/notice/assets/notice/t9n"; +export { PaginationMessages } from "./components/pagination/assets/pagination/t9n"; +export { PanelMessages } from "./components/panel/assets/panel/t9n"; export { ItemData as ItemData1, ListFocusId } from "./components/pick-list/shared-list-logic"; export { ICON_TYPES } from "./components/pick-list/resources"; +export { PickListItemMessages } from "./components/pick-list-item/assets/pick-list-item/t9n"; +export { PopoverMessages } from "./components/popover/assets/popover/t9n"; +export { RatingMessages } from "./components/rating/assets/rating/t9n"; +export { ScrimMessages } from "./components/scrim/assets/scrim/t9n"; export { DisplayMode } from "./components/sheet/interfaces"; export { DisplayMode as DisplayMode1 } from "./components/shell-panel/interfaces"; +export { ShellPanelMessages } from "./components/shell-panel/assets/shell-panel/t9n"; export { DragDetail } from "./utils/sortableComponent"; export { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail, StepperLayout } from "./components/stepper/interfaces"; +export { StepperMessages } from "./components/stepper/assets/stepper/t9n"; +export { StepperItemMessages } from "./components/stepper-item/assets/stepper-item/t9n"; export { TabID, TabLayout, TabPosition } from "./components/tabs/interfaces"; +export { TabNavMessages } from "./components/tab-nav/assets/tab-nav/t9n"; export { Element } from "@stencil/core"; export { TabChangeEventDetail, TabCloseEventDetail } from "./components/tab/interfaces"; +export { TabTitleMessages } from "./components/tab-title/assets/tab-title/t9n"; export { RowType, TableInteractionMode, TableLayout, TableRowFocusEvent, TableSelectionDisplay } from "./components/table/interfaces"; +export { TableMessages } from "./components/table/assets/table/t9n"; +export { TableCellMessages } from "./components/table-cell/assets/table-cell/t9n"; +export { TableHeaderMessages } from "./components/table-header/assets/table-header/t9n"; +export { TextAreaMessages } from "./components/text-area/assets/text-area/t9n"; export { TileSelectType } from "./components/tile-select/interfaces"; export { TileSelectGroupLayout } from "./components/tile-select-group/interfaces"; +export { TipMessages } from "./components/tip/assets/tip/t9n"; +export { TipManagerMessages } from "./components/tip-manager/assets/tip-manager/t9n"; export { TreeItemSelectDetail } from "./components/tree-item/interfaces"; +export { ValueListMessages } from "./components/value-list/assets/value-list/t9n"; export { ListItemAndHandle } from "./components/value-list-item/interfaces"; export namespace Components { interface CalciteAccordion { @@ -1402,6 +1502,10 @@ export namespace Components { * Specifies the heading level of the component's `heading` for proper document structure, without affecting visual styling. */ "headingLevel": HeadingLevel; + /** + * Defines the layout of the component. + */ + "layout": "horizontal" | "vertical"; /** * Specifies the latest allowed date (`"yyyy-mm-dd"`). */ @@ -1426,6 +1530,10 @@ export namespace Components { * Specifies the earliest allowed date as a full date object (`new Date("yyyy-mm-dd")`). */ "minAsDate": Date; + /** + * Specifies the monthStyle used by the component. + */ + "monthStyle": "abbreviated" | "wide"; /** * Specifies the Unicode numeral system used by the component for localization. This property cannot be dynamically changed. */ @@ -1534,10 +1642,18 @@ export namespace Components { * End date currently active. */ "endDate"?: Date; + /** + * Specifies the number at which section headings should start. + */ + "headingLevel": HeadingLevel; /** * The range of dates currently being hovered. */ "hoverRange": HoverRange; + /** + * Specifies the layout of the component. + */ + "layout": "horizontal" | "vertical"; /** * CLDR locale data for current locale. */ @@ -1546,10 +1662,22 @@ export namespace Components { * Specifies the latest allowed date (`"yyyy-mm-dd"`). */ "max": Date; + /** + * Made into a prop for testing purposes only + */ + "messages": DatePickerMessages; /** * Specifies the earliest allowed date (`"yyyy-mm-dd"`). */ "min": Date; + /** + * Specifies the monthStyle used by the component. + */ + "monthStyle": "abbreviated" | "wide"; + /** + * When `true`, activates the component's range mode which renders two calendars for selecting ranges of dates. + */ + "range": boolean; /** * Specifies the size of the component. */ @@ -1589,6 +1717,14 @@ export namespace Components { * Specifies the earliest allowed date (`"yyyy-mm-dd"`). */ "min": Date; + /** + * Specifies the monthStyle used by the component. + */ + "monthStyle": "abbreviated" | "wide"; + /** + * Specifies the position of the component in a range date-picker. + */ + "position": Extract<"start" | "end", Position>; /** * Specifies the size of the component. */ @@ -2389,6 +2525,10 @@ export namespace Components { * Specifies the earliest allowed date as a full date object. */ "minAsDate": Date; + /** + * Specifies the monthStyle used by the component. + */ + "monthStyle": "abbreviated" | "wide"; /** * Specifies the name of the component. Required to pass the component's `value` on form submission. */ @@ -6603,7 +6743,7 @@ declare global { new (): HTMLCalciteDatePickerElement; }; interface HTMLCalciteDatePickerDayElementEventMap { - "calciteDaySelect": void; + "calciteInternalDaySelect": void; "calciteInternalDayHover": void; } interface HTMLCalciteDatePickerDayElement extends Components.CalciteDatePickerDay, HTMLStencilElement { @@ -6621,10 +6761,14 @@ declare global { new (): HTMLCalciteDatePickerDayElement; }; interface HTMLCalciteDatePickerMonthElementEventMap { - "calciteInternalDatePickerSelect": Date; - "calciteInternalDatePickerHover": Date; - "calciteInternalDatePickerActiveDateChange": Date; - "calciteInternalDatePickerMouseOut": void; + "calciteInternalDatePickerDaySelect": Date; + "calciteInternalDatePickerDayHover": Date; + "calciteInternalDatePickerMonthActiveDateChange": Date; + "calciteInternalDatePickerMonthMouseOut": void; + "calciteInternalDatePickerMonthChange": { + date: Date; + position: string; + }; } interface HTMLCalciteDatePickerMonthElement extends Components.CalciteDatePickerMonth, HTMLStencilElement { addEventListener(type: K, listener: (this: HTMLCalciteDatePickerMonthElement, ev: CalciteDatePickerMonthCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; @@ -6641,7 +6785,7 @@ declare global { new (): HTMLCalciteDatePickerMonthElement; }; interface HTMLCalciteDatePickerMonthHeaderElementEventMap { - "calciteInternalDatePickerSelect": Date; + "calciteInternalDatePickerMonthHeaderSelectChange": Date; } interface HTMLCalciteDatePickerMonthHeaderElement extends Components.CalciteDatePickerMonthHeader, HTMLStencilElement { addEventListener(type: K, listener: (this: HTMLCalciteDatePickerMonthHeaderElement, ev: CalciteDatePickerMonthHeaderCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; @@ -9449,6 +9593,10 @@ declare namespace LocalJSX { * Specifies the heading level of the component's `heading` for proper document structure, without affecting visual styling. */ "headingLevel"?: HeadingLevel; + /** + * Defines the layout of the component. + */ + "layout"?: "horizontal" | "vertical"; /** * Specifies the latest allowed date (`"yyyy-mm-dd"`). */ @@ -9473,6 +9621,10 @@ declare namespace LocalJSX { * Specifies the earliest allowed date as a full date object (`new Date("yyyy-mm-dd")`). */ "minAsDate"?: Date; + /** + * Specifies the monthStyle used by the component. + */ + "monthStyle"?: "abbreviated" | "wide"; /** * Specifies the Unicode numeral system used by the component for localization. This property cannot be dynamically changed. */ @@ -9535,14 +9687,14 @@ declare namespace LocalJSX { * Date is currently highlighted as part of the range, */ "highlighted"?: boolean; - /** - * Fires when user selects day. - */ - "onCalciteDaySelect"?: (event: CalciteDatePickerDayCustomEvent) => void; /** * Fires when user hovers over a day. */ "onCalciteInternalDayHover"?: (event: CalciteDatePickerDayCustomEvent) => void; + /** + * Fires when user selects day. + */ + "onCalciteInternalDaySelect"?: (event: CalciteDatePickerDayCustomEvent) => void; /** * When `true`, activates the component's range mode to allow a start and end date. */ @@ -9585,10 +9737,18 @@ declare namespace LocalJSX { * End date currently active. */ "endDate"?: Date; + /** + * Specifies the number at which section headings should start. + */ + "headingLevel"?: HeadingLevel; /** * The range of dates currently being hovered. */ "hoverRange"?: HoverRange; + /** + * Specifies the layout of the component. + */ + "layout"?: "horizontal" | "vertical"; /** * CLDR locale data for current locale. */ @@ -9597,23 +9757,42 @@ declare namespace LocalJSX { * Specifies the latest allowed date (`"yyyy-mm-dd"`). */ "max"?: Date; + /** + * Made into a prop for testing purposes only + */ + "messages"?: DatePickerMessages; /** * Specifies the earliest allowed date (`"yyyy-mm-dd"`). */ "min"?: Date; /** - * Active date for the user keyboard access. + * Specifies the monthStyle used by the component. */ - "onCalciteInternalDatePickerActiveDateChange"?: (event: CalciteDatePickerMonthCustomEvent) => void; + "monthStyle"?: "abbreviated" | "wide"; /** * Fires when user hovers the date. */ - "onCalciteInternalDatePickerHover"?: (event: CalciteDatePickerMonthCustomEvent) => void; - "onCalciteInternalDatePickerMouseOut"?: (event: CalciteDatePickerMonthCustomEvent) => void; + "onCalciteInternalDatePickerDayHover"?: (event: CalciteDatePickerMonthCustomEvent) => void; /** * Fires when user selects the date. */ - "onCalciteInternalDatePickerSelect"?: (event: CalciteDatePickerMonthCustomEvent) => void; + "onCalciteInternalDatePickerDaySelect"?: (event: CalciteDatePickerMonthCustomEvent) => void; + /** + * Active date for the user keyboard access. + */ + "onCalciteInternalDatePickerMonthActiveDateChange"?: (event: CalciteDatePickerMonthCustomEvent) => void; + /** + * Emits when user updates month or year using `calcite-date-picker-month-header` component. + */ + "onCalciteInternalDatePickerMonthChange"?: (event: CalciteDatePickerMonthCustomEvent<{ + date: Date; + position: string; + }>) => void; + "onCalciteInternalDatePickerMonthMouseOut"?: (event: CalciteDatePickerMonthCustomEvent) => void; + /** + * When `true`, activates the component's range mode which renders two calendars for selecting ranges of dates. + */ + "range"?: boolean; /** * Specifies the size of the component. */ @@ -9653,10 +9832,18 @@ declare namespace LocalJSX { * Specifies the earliest allowed date (`"yyyy-mm-dd"`). */ "min"?: Date; + /** + * Specifies the monthStyle used by the component. + */ + "monthStyle"?: "abbreviated" | "wide"; /** * Fires to active date */ - "onCalciteInternalDatePickerSelect"?: (event: CalciteDatePickerMonthHeaderCustomEvent) => void; + "onCalciteInternalDatePickerMonthHeaderSelectChange"?: (event: CalciteDatePickerMonthHeaderCustomEvent) => void; + /** + * Specifies the position of the component in a range date-picker. + */ + "position"?: Extract<"start" | "end", Position>; /** * Specifies the size of the component. */ @@ -10477,6 +10664,10 @@ declare namespace LocalJSX { * Specifies the earliest allowed date as a full date object. */ "minAsDate"?: Date; + /** + * Specifies the monthStyle used by the component. + */ + "monthStyle"?: "abbreviated" | "wide"; /** * Specifies the name of the component. Required to pass the component's `value` on form submission. */ diff --git a/packages/calcite-components/src/components/action/action.scss b/packages/calcite-components/src/components/action/action.scss index 1966054df1d..716007fec7b 100755 --- a/packages/calcite-components/src/components/action/action.scss +++ b/packages/calcite-components/src/components/action/action.scss @@ -173,7 +173,8 @@ button { :host([scale="s"]) { .button { - @apply text-n2h px-2 py-1 font-normal; + @apply text-n2h px-2 font-normal; + padding-block: var(--calcite-internal-action-padding-block, var(--calcite-size-xxs)); } .button--text-visible .icon-container { margin-inline-end: theme("spacing.2"); @@ -182,7 +183,8 @@ button { :host([scale="m"]) { .button { - @apply text-n1h px-4 py-3 font-normal; + @apply text-n1h px-4 font-normal; + padding-block: var(--calcite-internal-action-padding-block, var(--calcite-size-md)); } .button--text-visible .icon-container { margin-inline-end: theme("spacing.3"); @@ -191,7 +193,8 @@ button { :host([scale="l"]) { .button { - @apply text-0h p-5 font-normal; + @apply text-0h px-5 font-normal; + padding-block: var(--calcite-internal-action-padding-block, var(--calcite-size-xl)); } .button--text-visible .icon-container { margin-inline-end: theme("spacing.4"); diff --git a/packages/calcite-components/src/components/date-picker-day/date-picker-day.scss b/packages/calcite-components/src/components/date-picker-day/date-picker-day.scss index ad0daa2ff6b..1bccad93d51 100644 --- a/packages/calcite-components/src/components/date-picker-day/date-picker-day.scss +++ b/packages/calcite-components/src/components/date-picker-day/date-picker-day.scss @@ -1,88 +1,33 @@ :host { @apply cursor-pointer flex relative text-color-3; + outline: none; } @include disabled(); -@mixin range-part-base() { - &::before, - &::after { - @apply absolute pointer-events-none; - inset-block: 0; - content: ""; - block-size: var(--calcite-internal-day-size); - inline-size: var(--calcite-internal-day-size); - } -} - -@mixin range-part-edge-end() { - &::before { - inset-inline-end: 50%; - } - &::after { - inset-inline-start: 50%; - border-start-end-radius: var(--calcite-internal-day-size); - border-end-end-radius: var(--calcite-internal-day-size); - inline-size: calc(var(--calcite-internal-day-size) / 2); - } -} - -@mixin range-part-edge-start() { - &::before { - inset-inline-end: 50%; - border-start-start-radius: var(--calcite-internal-day-size); - border-end-start-radius: var(--calcite-internal-day-size); - inline-size: calc(var(--calcite-internal-day-size) / 2); - } - &::after { - inset-inline-start: 50%; - } -} - -@mixin range-part-middle() { - &::before { - inset-inline-end: 50%; - border-radius: 0; - } - &::after { - inset-inline-start: 50%; - border-radius: 0; - } -} - -.day-v-wrapper { - @apply flex-auto; -} - .day-wrapper { @apply flex flex-col items-center - relative; -} - -:host([range]), -:host([range-hover]) { - .day-wrapper { - @include range-part-base(); - } + justify-center + relative + w-full; } .day { @apply text-n2h text-color-3 flex - focus-base items-center justify-center - rounded-full leading-none transition-default - z-default; + w-full + relative; + line-height: var(--calcite-font-line-height-fixed-base); background: none; - box-shadow: 0 0 0 2px transparent; block-size: var(--calcite-internal-day-size); - inline-size: var(--calcite-internal-day-size); + outline-color: var(--calcite-color-transparent); } .text { @@ -91,42 +36,22 @@ } :host([scale="s"]) { - --calcite-internal-day-size: 27px; - - .day-v-wrapper { - @apply py-0.5; - } - .day-wrapper { - @apply p-0; - } + --calcite-internal-day-size: #{$calcite-size-32}; .day { @apply text-n2; } } :host([scale="m"]) { - --calcite-internal-day-size: 33px; - - .day-v-wrapper { - @apply py-1; - } - .day-wrapper { - @apply p-0; - } + --calcite-internal-day-size: #{$calcite-size-40}; .day { @apply text-n1; } } :host([scale="l"]) { - --calcite-internal-day-size: 43px; + --calcite-internal-day-size: #{$calcite-size-44}; - .day-v-wrapper { - @apply py-1; - } - .day-wrapper { - @apply px-1; - } .day { @apply text-0; } @@ -136,20 +61,26 @@ @apply opacity-disabled; } -:host(:hover:not([disabled]):not([selected])), -:host([active]:not([range]):not([selected])) { +:host(:hover:not([disabled]):not([selected])) { & .day { @apply bg-foreground-2 text-color-1; } } -:host(:focus), -:host([active]) { - @apply outline-none; +:host(:not([range]):not([selected]).current-day) { + & .day { + color: var(--calcite-color-text-1); + font-weight: var(--calcite-font-weight-medium); + } +} + +:host(:focus[selected]) .day { + @apply focus-outset z-default; + box-shadow: 0 0 0 2px var(--calcite-color-foreground-1); } -:host(:focus:not([disabled])) .day { - @apply focus-outset; +:host(:focus:not([disabled]):not([selected])) .day { + @apply focus-inset; } :host([selected]) .day { @@ -158,83 +89,31 @@ color: var(--calcite-color-foreground-1); } -:host(:focus:not([disabled])), -:host([start-of-range]:not(:focus)), -:host([end-of-range]:not(:focus)) { +:host([range-hover]:not([selected])) { .day { - box-shadow: 0 0 0 2px var(--calcite-color-foreground-1); + @apply bg-foreground-2; + @apply text-color-1; } } -:host([range-hover]:not([selected])), :host([highlighted]:not([selected])) { - .day-wrapper { - @include range-part-middle(); - } - .day { - @apply text-color-1; + color: var(--calcite-color-brand); + background-color: var(--calcite-color-foreground-current); } } -:host([highlighted]), -:host([selected]:not(.hover--outside-range)) { - .day-wrapper { - &::before, - &::after { - background-color: var(--calcite-color-foreground-current); - } - } -} - -:host([range-hover]:not([selected])) { - .day-wrapper { - &::before, - &::after { - @apply bg-foreground-2; - } - } -} - -:host(:hover[range-hover]:not([selected]).focused--end), -:host([highlighted][end-of-range]), -:host([highlighted][range-edge="end"]), -:host([range-hover][range-edge="end"]), -:host(:hover[range-hover].focused--end.hover--outside-range) { - .day-wrapper { - @include range-part-edge-end(); - } -} - -:host([highlighted][start-of-range]), -:host([highlighted][range-edge="start"]), -:host([range-hover][range-edge="start"]), -:host(:hover[range-hover]:not([selected]).focused--start), -:host([start-of-range].hover--inside-range), -:host(:hover[range-hover].focused--start.hover--outside-range) { - .day-wrapper { - @include range-part-edge-start(); - } -} - -:host([range-hover][start-of-range][range-edge="end"]), -:host([range-hover][end-of-range][range-edge="start"]), -:host([start-of-range][range-edge="end"].hover--inside-range), -:host([end-of-range]) { - .day-wrapper { - &::after, - &::before { - content: unset; - } +:host(:hover[highlighted]:not([selected]).inside-range--hover) { + .day { + background-color: var(--calcite-color-foreground-current); + color: var(--calcite-color-brand); + @apply focus-inset; } } -:host(:hover[range-hover]:not([selected]).focused--start), -:host(:hover[range-hover]:not([selected]).focused--end), -:host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range), -:host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) { +:host(:hover:not([highlighted]):not([selected]).outside-range--hover) { .day { - box-shadow: 0 0 0 2px var(--calcite-color-foreground-1); + @apply focus-inset; } } @@ -256,22 +135,16 @@ :host([range][selected]), :host([highlighted]), :host([range-hover]:not([selected])) { - .day-wrapper { - &::before, - &::after { - background-color: highlight; - } + .day { + background-color: highlight; } } :host([range-hover]), :host([range][selected][start-of-range]), :host([range][selected][end-of-range]) { - .day-wrapper { - &::before, - &::after { - background-color: canvas; - } + .day { + background-color: canvas; } } } diff --git a/packages/calcite-components/src/components/date-picker-day/date-picker-day.tsx b/packages/calcite-components/src/components/date-picker-day/date-picker-day.tsx index 9c3e465c6d6..065a2098ba7 100644 --- a/packages/calcite-components/src/components/date-picker-day/date-picker-day.tsx +++ b/packages/calcite-components/src/components/date-picker-day/date-picker-day.tsx @@ -100,12 +100,12 @@ export class DatePickerDay implements InteractiveComponent, LoadableComponent { return; } - this.calciteDaySelect.emit(); + this.calciteInternalDaySelect.emit(); }; keyDownHandler = (event: KeyboardEvent): void => { if (isActivationKey(event.key)) { - !this.disabled && this.calciteDaySelect.emit(); + !this.disabled && this.calciteInternalDaySelect.emit(); event.preventDefault(); } }; @@ -128,7 +128,7 @@ export class DatePickerDay implements InteractiveComponent, LoadableComponent { /** * Fires when user selects day. */ - @Event({ cancelable: false }) calciteDaySelect: EventEmitter; + @Event({ cancelable: false }) calciteInternalDaySelect: EventEmitter; /** * Fires when user hovers over a day. @@ -190,12 +190,10 @@ export class DatePickerDay implements InteractiveComponent, LoadableComponent { tabIndex={this.active && !this.disabled ? 0 : -1} > - + )} +
- - -
- - {localizedMonth} - - - (this.yearInput = el)} - type="text" - value={localizedYear} - /> - {suffix && {suffix}} - + {this.renderMonthYearContainer(reverse)} +
+ {!this.position && ( +
{this.renderChevron("left")}
+ )} +
+ {this.position !== "start" && this.renderChevron("right")}
- - - ); } + private renderMonthYearContainer(reverse: boolean): VNode { + const content = reverse + ? [this.renderYearInput(), this.renderMonthPicker()] + : [this.renderMonthPicker(), this.renderYearInput()]; + return {content}; + } + + private renderMonthPicker(): VNode { + const activeMonth = this.activeDate.getMonth(); + const monthData = this.localeData.months[this.monthStyle]; + return ( + (this.monthPickerEl = el)} + width="auto" + > + {monthData.map((month: string, index: number) => { + return ( + + {month} + + ); + })} + + ); + } + + private renderYearInput(): VNode { + const suffix = this.localeData.year?.suffix; + const localizedYear = this.formatCalendarYear(this.activeDate.getFullYear()); + return ( + + (this.yearInputEl = el)} + type="text" + value={localizedYear} + /> + {suffix && {suffix}} + + ); + } + + private renderChevron(direction: "left" | "right"): VNode { + const isDirectionRight = direction === "right"; + const isDisabled = + hasSameMonthAndYear( + isDirectionRight ? this.nextMonthDate : this.prevMonthDate, + this.activeDate, + ) || !inRange(this.activeDate, this.min, this.max); + + return ( + (isDirectionRight ? (this.nextMonthAction = el) : (this.prevMonthAction = el))} + role="button" + scale={this.scale === "l" ? "l" : "m"} + text={isDirectionRight ? this.messages.nextMonth : this.messages.prevMonth} + /> + ); + } + //-------------------------------------------------------------------------- // // Private State/Props @@ -189,31 +289,28 @@ export class DatePickerMonthHeader { @Element() el: HTMLCalciteDatePickerMonthHeaderElement; - private yearInput: HTMLInputElement; - - private parentDatePickerEl: HTMLCalciteDatePickerElement; - @State() nextMonthDate: Date; @State() prevMonthDate: Date; - @Watch("min") - @Watch("max") - @Watch("activeDate") - setNextPrevMonthDates(): void { - if (!this.activeDate) { - return; - } + private monthPickerEl: HTMLCalciteSelectElement; - this.nextMonthDate = dateFromRange(nextMonth(this.activeDate), this.min, this.max); - this.prevMonthDate = dateFromRange(prevMonth(this.activeDate), this.min, this.max); - } + private nextMonthAction: HTMLCalciteActionElement; + + private parentDatePickerEl: HTMLCalciteDatePickerElement; + + private prevMonthAction: HTMLCalciteActionElement; + + private yearSelectWidthOffset: number; + + private yearInputEl: HTMLInputElement; //-------------------------------------------------------------------------- // // Private Methods // //-------------------------------------------------------------------------- + /** * Increment year on UP/DOWN keys * @@ -279,9 +376,28 @@ export class DatePickerMonthHeader { /* * Update active month on clicks of left/right arrows */ - private handleArrowClick = (event: MouseEvent | KeyboardEvent, date: Date): void => { + private handleArrowClick = async ( + event: MouseEvent | KeyboardEvent, + date: Date, + ): Promise => { event.preventDefault(); - this.calciteInternalDatePickerSelect.emit(date); + + await this.handlePenultimateValidMonth(event); + this.calciteInternalDatePickerMonthHeaderSelectChange.emit(date); + }; + + private handleMonthChange = (event: CustomEvent): void => { + const target = event.target as HTMLCalciteOptionElement; + const { abbreviated, wide } = this.localeData.months; + const localeMonths = this.monthStyle === "wide" ? wide : abbreviated; + const monthIndex = localeMonths.indexOf(target.value); + let newDate = getDateInMonth(this.activeDate, monthIndex); + + if (!inRange(newDate, this.min, this.max)) { + newDate = dateFromRange(newDate, this.min, this.max); + } + this.calciteInternalDatePickerMonthHeaderSelectChange.emit(newDate); + this.setYearSelectMenuWidth(); }; private getInRangeDate({ @@ -323,16 +439,75 @@ export class DatePickerMonthHeader { commit?: boolean; offset?: number; }): void { - const { yearInput, activeDate } = this; + const { yearInputEl, activeDate } = this; const inRangeDate = this.getInRangeDate({ localizedYear, offset }); // if you've supplied a year and it's in range, update active date if (inRangeDate) { - this.calciteInternalDatePickerSelect.emit(inRangeDate); + this.calciteInternalDatePickerMonthHeaderSelectChange.emit(inRangeDate); } if (commit) { - yearInput.value = this.formatCalendarYear((inRangeDate || activeDate).getFullYear()); + yearInputEl.value = this.formatCalendarYear((inRangeDate || activeDate).getFullYear()); + } + } + + private setYearSelectWidthOffset(): void { + this.yearSelectWidthOffset = ICON_WIDTH_M + 3 * parseInt(this.getYearSelectPadding()); + this.setYearSelectMenuWidth(); + } + + private setYearSelectMenuWidth(): void { + const fontStyle = getComputedStyle(this.monthPickerEl).font; + const localeMonths = this.localeData.months[this.monthStyle]; + const activeLocaleMonth = localeMonths[this.activeDate.getMonth()]; + const selectedOptionWidth = getTextWidth(activeLocaleMonth, fontStyle); + this.monthPickerEl.style.width = `${selectedOptionWidth + this.yearSelectWidthOffset}px`; + } + + private isMonthInRange = (index: number): boolean => { + const newActiveDate = getDateInMonth(this.activeDate, index); + + if (!this.min && !this.max) { + return true; + } + return (!!this.max && newActiveDate < this.max) || (!!this.min && newActiveDate > this.min); + }; + + private async handlePenultimateValidMonth(event: MouseEvent | KeyboardEvent): Promise { + const target = event.target as HTMLCalciteActionElement; + const direction = target.getAttribute("data-direction"); + const isDirectionLeft = direction === "left"; + + let isTargetLastValidMonth: boolean; + + if (isDirectionLeft && this.min) { + const prevMonthDate = dateFromRange(prevMonth(this.activeDate), this.min, this.max); + isTargetLastValidMonth = hasSameMonthAndYear(prevMonthDate, this.min); + } else if (this.max) { + const nextMonthDate = dateFromRange(nextMonth(this.activeDate), this.min, this.max); + isTargetLastValidMonth = hasSameMonthAndYear(nextMonthDate, this.max); + } + + if (isTargetLastValidMonth) { + if (!this.position) { + isDirectionLeft + ? await this.nextMonthAction.setFocus() + : await this.prevMonthAction.setFocus(); + } else { + this.yearInputEl.focus(); + } + } + } + + private getYearSelectPadding(): string { + switch (this.scale) { + case "l": + return calciteSizeSm; + case "s": + return calciteSizeXxxs; + default: + return calciteSizeXxs; } } } diff --git a/packages/calcite-components/src/components/date-picker-month-header/resources.ts b/packages/calcite-components/src/components/date-picker-month-header/resources.ts index 59cc3177eb9..b12806eac87 100644 --- a/packages/calcite-components/src/components/date-picker-month-header/resources.ts +++ b/packages/calcite-components/src/components/date-picker-month-header/resources.ts @@ -1,14 +1,19 @@ export const CSS = { header: "header", - month: "month", chevron: "chevron", + chevronContainer: "chevron-container", + chevronContainerLeft: "chevron-container--left", + chevronContainerRight: "chevron-container--right", + monthYearContainer: "month-year-container", + monthPicker: "month-select", + rangeCalendar: "range-calendar", suffix: "suffix", - yearSuffix: "year--suffix", - yearWrap: "year-wrap", - textReverse: "text--reverse", + yearContainer: "year-container", }; export const ICON = { chevronLeft: "chevron-left", chevronRight: "chevron-right", } as const; + +export const ICON_WIDTH_M = 16; diff --git a/packages/calcite-components/src/components/date-picker-month/date-picker-month.scss b/packages/calcite-components/src/components/date-picker-month/date-picker-month.scss index a98c3797a0e..0421a7ebe7f 100644 --- a/packages/calcite-components/src/components/date-picker-month/date-picker-month.scss +++ b/packages/calcite-components/src/components/date-picker-month/date-picker-month.scss @@ -1,55 +1,108 @@ @include base-component(); +.calendar-container { + @apply flex w-full; +} + +:host([range][layout="vertical"]) .calendar-container { + @apply flex-col; +} + .calendar { - @apply mb-1; + @apply w-full; } -.week-headers { - @apply border-color-3 - flex - border-0 - border-t - border-solid - py-0 - px-1; +.week-header-container { + @apply flex; + block-size: #{$calcite-size-16}; + padding-inline: var(--calcite-size-sm); + padding-block: var(--calcite-size-md); } .week-header { @apply text-color-3 text-center - font-bold; + font-bold + flex + text-n2h + justify-center + items-center; inline-size: calc(100% / 7); } -.day { +.day-container { @apply flex min-w-0 - justify-center; - inline-size: 100%; + justify-center + w-full; calcite-date-picker-day { @apply w-full; } } -:host([scale="s"]) .week-header { - @apply text-n2h px-0 pt-2 pb-3; +.week-days { + @apply grid; + grid-template-columns: repeat(7, 1fr); + grid-auto-rows: 1fr; + padding-inline: var(--calcite-size-sm); + padding-block-end: var(--calcite-size-sm); } -:host([scale="m"]) .week-header { - @apply text-n2h px-0 pt-3 pb-4; +.month-header { + @apply flex w-full justify-between; } -:host([scale="l"]) .week-header { - @apply text-n1h px-0 pt-4 pb-5; +.month { + @apply flex w-full justify-between flex-col; } -.week-days { - display: grid; - grid-template-columns: repeat(7, 1fr); - grid-auto-rows: 1fr; - padding-block: 0; - padding-inline: 6px; - &:focus { - @apply outline-none; +.day { + font-size: var(--calcite-font-size); +} + +:host([scale="s"]) { + .week-days { + padding-inline: var(--calcite-size-xs); + padding-block-end: var(--calcite-size-xs); + } + .week-header-container { + padding-inline: var(--calcite-size-xs); + padding-block: var(--calcite-size-sm); } + .day { + font-size: var(--calcite-font-size-sm); + } +} + +:host([scale="l"]) { + .week-header { + @apply text-n1h; + } + .week-days { + padding-inline: var(--calcite-size-md); + padding-block-end: var(--calcite-size-md); + } + .week-header-container { + padding-inline: var(--calcite-size-md); + padding-block: var(--calcite-size-md-plus); + } + .day { + font-size: var(--calcite-font-size-md); + } +} + +.calendar--start { + @apply border-solid border-color-1 border-0; +} + +:host([range][layout="horizontal"]) .calendar--start { + border-inline-end-width: var(--calcite-border-width-sm); +} + +:host([range][layout="vertical"]) .calendar--start { + border-block-end-width: var(--calcite-border-width-sm); +} + +.noncurrent { + @apply pointer-events-none opacity-0; } diff --git a/packages/calcite-components/src/components/date-picker-month/date-picker-month.tsx b/packages/calcite-components/src/components/date-picker-month/date-picker-month.tsx index 198d242f8be..bb72a00133b 100644 --- a/packages/calcite-components/src/components/date-picker-month/date-picker-month.tsx +++ b/packages/calcite-components/src/components/date-picker-month/date-picker-month.tsx @@ -8,10 +8,23 @@ import { Listen, Prop, VNode, + Watch, + State, } from "@stencil/core"; -import { dateFromRange, HoverRange, inRange, sameDate } from "../../utils/date"; +import { + dateFromRange, + getFirstValidDateInMonth, + hasSameMonthAndYear, + HoverRange, + inRange, + nextMonth, + sameDate, +} from "../../utils/date"; import { DateLocaleData } from "../date-picker/utils"; import { Scale } from "../interfaces"; +import { DatePickerMessages } from "../date-picker/assets/date-picker/t9n"; +import { HeadingLevel } from "../functional/Heading"; +import { CSS } from "./resources"; const DAYS_PER_WEEK = 7; const DAYS_MAXIMUM_INDEX = 6; @@ -19,6 +32,7 @@ const DAYS_MAXIMUM_INDEX = 6; interface Day { active: boolean; currentMonth?: boolean; + currentDay?: boolean; date: Date; day: number; dayInWeek?: number; @@ -37,6 +51,18 @@ export class DatePickerMonth { // //-------------------------------------------------------------------------- + /** The currently active Date.*/ + @Prop() activeDate: Date = new Date(); + + @Watch("activeDate") + updateFocusedDateWithActive(newActiveDate: Date): void { + if (!this.selectedDate) { + this.focusedDate = inRange(newActiveDate, this.min, this.max) + ? newActiveDate + : dateFromRange(newActiveDate, this.min, this.max); + } + } + /** * The DateTimeFormat used to provide screen reader labels. * @@ -44,26 +70,21 @@ export class DatePickerMonth { */ @Prop() dateTimeFormat: Intl.DateTimeFormat; - /** Already selected date.*/ - @Prop() selectedDate: Date; - - /** The currently active Date.*/ - @Prop() activeDate: Date = new Date(); - - /** Start date currently active. */ - @Prop() startDate?: Date; - /** End date currently active. */ @Prop() endDate?: Date; - /** Specifies the earliest allowed date (`"yyyy-mm-dd"`). */ - @Prop() min: Date; + /** Specifies the number at which section headings should start. */ + @Prop({ reflect: true }) headingLevel: HeadingLevel; - /** Specifies the latest allowed date (`"yyyy-mm-dd"`). */ - @Prop() max: Date; + /** The range of dates currently being hovered. */ + @Prop() hoverRange: HoverRange; - /** Specifies the size of the component. */ - @Prop({ reflect: true }) scale: Scale; + /** + * Specifies the layout of the component. + * + * @internal + */ + @Prop({ reflect: true }) layout: "horizontal" | "vertical"; /** * CLDR locale data for current locale. @@ -72,8 +93,42 @@ export class DatePickerMonth { */ @Prop() localeData: DateLocaleData; - /** The range of dates currently being hovered. */ - @Prop() hoverRange: HoverRange; + /** Specifies the latest allowed date (`"yyyy-mm-dd"`). */ + @Prop() max: Date; + + /** + * Made into a prop for testing purposes only + * + * @internal + */ + @Prop() messages: DatePickerMessages; + + /** Specifies the earliest allowed date (`"yyyy-mm-dd"`). */ + @Prop() min: Date; + + /** + * Specifies the monthStyle used by the component. + */ + @Prop() monthStyle: "abbreviated" | "wide"; + + /** + * When `true`, activates the component's range mode which renders two calendars for selecting ranges of dates. + */ + @Prop({ reflect: true }) range: boolean = false; + + /** Specifies the size of the component. */ + @Prop({ reflect: true }) scale: Scale; + + /** Already selected date.*/ + @Prop() selectedDate: Date; + + @Watch("selectedDate") + updateFocusedDate(newActiveDate: Date): void { + this.focusedDate = newActiveDate; + } + + /** Start date currently active. */ + @Prop() startDate?: Date; //-------------------------------------------------------------------------- // @@ -86,26 +141,44 @@ export class DatePickerMonth { * * @internal */ - @Event({ cancelable: false }) calciteInternalDatePickerSelect: EventEmitter; + @Event({ cancelable: false }) calciteInternalDatePickerDaySelect: EventEmitter; /** * Fires when user hovers the date. * * @internal */ - @Event({ cancelable: false }) calciteInternalDatePickerHover: EventEmitter; + @Event({ cancelable: false }) calciteInternalDatePickerDayHover: EventEmitter; /** * Active date for the user keyboard access. * * @internal */ - @Event({ cancelable: false }) calciteInternalDatePickerActiveDateChange: EventEmitter; + @Event({ cancelable: false }) calciteInternalDatePickerMonthActiveDateChange: EventEmitter; + + /** + * @internal + */ + @Event({ cancelable: false }) calciteInternalDatePickerMonthMouseOut: EventEmitter; /** + * Emits when user updates month or year using `calcite-date-picker-month-header` component. + * * @internal */ - @Event({ cancelable: false }) calciteInternalDatePickerMouseOut: EventEmitter; + @Event({ cancelable: false }) calciteInternalDatePickerMonthChange: EventEmitter<{ + date: Date; + position: string; + }>; + + //-------------------------------------------------------------------------- + // + // Private State/Props + // + //-------------------------------------------------------------------------- + + @State() focusedDate: Date; //-------------------------------------------------------------------------- // @@ -119,43 +192,44 @@ export class DatePickerMonth { } const isRTL = this.el.dir === "rtl"; + const dateValue = (event.target as HTMLCalciteDatePickerDayElement).value; switch (event.key) { case "ArrowUp": event.preventDefault(); - this.addDays(-7); + this.addDays(-7, dateValue); break; case "ArrowRight": event.preventDefault(); - this.addDays(isRTL ? -1 : 1); + this.addDays(isRTL ? -1 : 1, dateValue); break; case "ArrowDown": event.preventDefault(); - this.addDays(7); + this.addDays(7, dateValue); break; case "ArrowLeft": event.preventDefault(); - this.addDays(isRTL ? 1 : -1); + this.addDays(isRTL ? 1 : -1, dateValue); break; case "PageUp": event.preventDefault(); - this.addMonths(-1); + this.addMonths(-1, dateValue); break; case "PageDown": event.preventDefault(); - this.addMonths(1); + this.addMonths(1, dateValue); break; case "Home": event.preventDefault(); this.activeDate.setDate(1); - this.addDays(); + this.addDays(0, dateValue); break; case "End": event.preventDefault(); this.activeDate.setDate( new Date(this.activeDate.getFullYear(), this.activeDate.getMonth() + 1, 0).getDate(), ); - this.addDays(); + this.addDays(0, dateValue); break; case "Enter": case " ": @@ -176,7 +250,7 @@ export class DatePickerMonth { @Listen("pointerout") pointerOutHandler(): void { - this.calciteInternalDatePickerMouseOut.emit(); + this.calciteInternalDatePickerMonthMouseOut.emit(); } //-------------------------------------------------------------------------- @@ -184,6 +258,11 @@ export class DatePickerMonth { // Lifecycle // //-------------------------------------------------------------------------- + + componentWillLoad(): void { + this.focusedDate = this.selectedDate || this.activeDate; + } + render(): VNode { const month = this.activeDate.getMonth(); const year = this.activeDate.getFullYear(); @@ -195,54 +274,24 @@ export class DatePickerMonth { const curMonDays = this.getCurrentMonthDays(month, year); const prevMonDays = this.getPreviousMonthDays(month, year, startOfWeek); const nextMonDays = this.getNextMonthDays(month, year, startOfWeek); - let dayInWeek = 0; - const getDayInWeek = () => dayInWeek++ % 7; - - const days: Day[] = [ - ...prevMonDays.map((day) => { - return { - active: false, - day, - dayInWeek: getDayInWeek(), - date: new Date(year, month - 1, day), - }; - }), - ...curMonDays.map((day) => { - const date = new Date(year, month, day); - const active = sameDate(date, this.activeDate); - return { - active, - currentMonth: true, - day, - dayInWeek: getDayInWeek(), - date, - ref: true, - }; - }), - ...nextMonDays.map((day) => { - return { - active: false, - day, - dayInWeek: getDayInWeek(), - date: new Date(year, month + 1, day), - }; - }), - ]; + const nextMonth = month + 1; + const endCalendarPrevMonDays = this.getPreviousMonthDays(nextMonth, year, startOfWeek); + const endCalendarCurrMonDays = this.getCurrentMonthDays(nextMonth, year); + const endCalendarNextMonDays = this.getNextMonthDays(nextMonth, year, startOfWeek); + const days = this.getDays(prevMonDays, curMonDays, nextMonDays); + + const nextMonthDays = this.getDays( + endCalendarPrevMonDays, + endCalendarCurrMonDays, + endCalendarNextMonDays, + "end", + ); return ( - -
-
- {adjustedWeekDays.map((weekday) => ( - - {weekday} - - ))} -
- -
- {days.map((day, index) => this.renderDateDay(day, index))} -
+ +
+ {this.renderCalendar(adjustedWeekDays, days)} + {this.range && this.renderCalendar(adjustedWeekDays, nextMonthDays, true)}
); @@ -267,28 +316,35 @@ export class DatePickerMonth { * Add n months to the current month * * @param step + * @param targetDate */ - private addMonths(step: number) { - const nextDate = new Date(this.activeDate); - nextDate.setMonth(this.activeDate.getMonth() + step); - this.calciteInternalDatePickerActiveDateChange.emit( + private addMonths(step: number, targetDate: Date): void { + const nextDate = new Date(targetDate); + nextDate.setMonth(targetDate.getMonth() + step); + this.calciteInternalDatePickerMonthActiveDateChange.emit( dateFromRange(nextDate, this.min, this.max), ); + this.focusedDate = dateFromRange(nextDate, this.min, this.max); this.activeFocus = true; + this.calciteInternalDatePickerDayHover.emit(nextDate); } /** * Add n days to the current date * * @param step + * @param targetDate */ - private addDays(step = 0) { - const nextDate = new Date(this.activeDate); - nextDate.setDate(this.activeDate.getDate() + step); - this.calciteInternalDatePickerActiveDateChange.emit( + private addDays(step = 0, targetDate: Date): void { + const nextDate = new Date(targetDate); + nextDate.setDate(targetDate.getDate() + step); + this.calciteInternalDatePickerMonthActiveDateChange.emit( dateFromRange(nextDate, this.min, this.max), ); + + this.focusedDate = dateFromRange(nextDate, this.min, this.max); this.activeFocus = true; + this.calciteInternalDatePickerDayHover.emit(nextDate); } /** @@ -407,16 +463,18 @@ export class DatePickerMonth { dayHover = (event: CustomEvent): void => { const target = event.target as HTMLCalciteDatePickerDayElement; if (target.disabled) { - this.calciteInternalDatePickerMouseOut.emit(); + this.calciteInternalDatePickerMonthMouseOut.emit(); } else { - this.calciteInternalDatePickerHover.emit(target.value); + this.calciteInternalDatePickerDayHover.emit(target.value); } event.stopPropagation(); }; daySelect = (event: CustomEvent): void => { const target = event.target as HTMLCalciteDatePickerDayElement; - this.calciteInternalDatePickerSelect.emit(target.value); + this.activeFocus = false; + this.calciteInternalDatePickerDaySelect.emit(target.value); + event.stopPropagation(); }; /** @@ -435,34 +493,35 @@ export class DatePickerMonth { * @param active.dayInWeek * @param active.ref * @param key + * @param active.currentDay */ - private renderDateDay({ active, currentMonth, date, day, dayInWeek, ref }: Day, key: number) { - const isFocusedOnStart = this.isFocusedOnStart(); - const isHoverInRange = - this.isHoverInRange() || - (!this.endDate && this.hoverRange && sameDate(this.hoverRange?.end, this.startDate)); + private renderDateDay( + { active, currentMonth, currentDay, date, day, dayInWeek, ref }: Day, + key: number, + ): VNode { + const isDateInRange = inRange(date, this.min, this.max); return ( -
+
{ // when moving via keyboard, focus must be updated on active date if (ref && active && this.activeFocus) { @@ -478,39 +537,187 @@ export class DatePickerMonth { ); } + private renderCalendar(weekDays: string[], days: Day[], isEndCalendar = false): VNode { + return ( +
+ + {this.renderMonthCalendar(weekDays, days, isEndCalendar)} +
+ ); + } + private isFocusedOnStart(): boolean { return this.hoverRange?.focused === "start"; } private isHoverInRange(): boolean { - if (!this.hoverRange) { + if (!this.hoverRange || !this.startDate) { return false; } const { start, end } = this.hoverRange; - return !!( - (!this.isFocusedOnStart() && this.startDate && (!this.endDate || end < this.endDate)) || - (this.isFocusedOnStart() && this.startDate && start > this.startDate) - ); + const isStartFocused = this.isFocusedOnStart(); + const isEndAfterStart = this.startDate && end > this.startDate; + const isEndBeforeEnd = this.endDate && end < this.endDate; + const isStartAfterStart = this.startDate && start > this.startDate; + const isStartBeforeEnd = this.endDate && start < this.endDate; + + const isEndDateAfterStartAndBeforeEnd = + !isStartFocused && this.startDate && isEndAfterStart && (!this.endDate || isEndBeforeEnd); + const isStartDateBeforeEndAndAfterStart = + isStartFocused && this.startDate && isStartAfterStart && isStartBeforeEnd; + + return isEndDateAfterStartAndBeforeEnd || isStartDateBeforeEndAndAfterStart; } - private isRangeHover(date): boolean { + private isRangeHover(date: Date): boolean { if (!this.hoverRange) { return false; } const { start, end } = this.hoverRange; - const isStart = this.isFocusedOnStart(); + const isStartFocused = this.isFocusedOnStart(); const insideRange = this.isHoverInRange(); - const cond1 = - insideRange && - ((!isStart && date > this.startDate && (date < end || sameDate(date, end))) || - (isStart && date < this.endDate && (date > start || sameDate(date, start)))); - const cond2 = - !insideRange && - ((!isStart && date >= this.endDate && (date < end || sameDate(date, end))) || - (isStart && - ((this.startDate && date < this.startDate) || - (this.endDate && sameDate(date, this.startDate))) && - ((start && date > start) || sameDate(date, start)))); - return cond1 || cond2; + + const isDateBeforeStartDateAndAfterStart = date > start && date < this.startDate; + const isDateAfterEndDateAndBeforeEnd = date < end && date > this.endDate; + const isDateBeforeEndDateAndAfterEnd = date > end && date < this.endDate; + const isDateAfterStartDateAndBeforeStart = date < start && date > this.startDate; + const isDateAfterStartDateAndBeforeEnd = date < end && date > this.startDate; + const isDateBeforeEndDateAndAfterStart = date > start && date < this.endDate; + const hasBothStartAndEndDate = this.startDate && this.endDate; + + if (insideRange) { + if (hasBothStartAndEndDate) { + return isStartFocused + ? date < this.endDate && + (isDateAfterStartDateAndBeforeStart || isDateBeforeStartDateAndAfterStart) + : isDateBeforeEndDateAndAfterEnd || isDateAfterEndDateAndBeforeEnd; + } else if (this.startDate && !this.endDate) { + return isStartFocused + ? isDateBeforeStartDateAndAfterStart + : isDateAfterStartDateAndBeforeEnd; + } else if (!this.startDate && this.endDate) { + return isStartFocused ? isDateBeforeEndDateAndAfterStart : isDateAfterEndDateAndBeforeEnd; + } + } else { + if (hasBothStartAndEndDate) { + return isStartFocused ? isDateBeforeStartDateAndAfterStart : isDateAfterEndDateAndBeforeEnd; + } + } + } + + private getDays( + prevMonthDays: number[], + currMonthDays: number[], + nextMonthDays: number[], + position: "start" | "end" = "start", + ): Day[] { + let month = this.activeDate.getMonth(); + const nextMonth = month + 1; + month = position === "end" ? nextMonth : month; + let dayInWeek = 0; + const getDayInWeek = () => dayInWeek++ % 7; + const year = this.activeDate.getFullYear(); + + const days: Day[] = [ + ...prevMonthDays.map((day) => { + return { + active: false, + day, + dayInWeek: getDayInWeek(), + date: new Date(year, month - 1, day), + }; + }), + ...currMonthDays.map((day) => { + const date = new Date(year, month, day); + const isCurrentDay = sameDate(date, new Date()); + const active = + this.focusedDate && + this.focusedDate !== this.startDate && + this.focusedDate !== this.endDate + ? sameDate(date, this.focusedDate) + : sameDate(date, this.startDate) || sameDate(date, this.endDate); + + return { + active, + currentMonth: true, + currentDay: isCurrentDay, + day, + dayInWeek: getDayInWeek(), + date, + ref: true, + }; + }), + ...nextMonthDays.map((day) => { + return { + active: false, + day, + dayInWeek: getDayInWeek(), + date: new Date(year, nextMonth, day), + }; + }), + ]; + + return days; + } + + private renderMonthCalendar(weekDays: string[], days: Day[], isEndCalendar = false): VNode { + const endCalendarStartIndex = 50; + return ( +
+
+ {weekDays.map((weekday) => ( + + {weekday} + + ))} +
+ +
+ {days.map((day, index) => + this.renderDateDay(day, isEndCalendar ? endCalendarStartIndex + index : index), + )} +
+
+ ); + } + + private monthHeaderSelectChange = (event: CustomEvent): void => { + const date = new Date(event.detail); + const target = event.target as HTMLCalciteDatePickerMonthHeaderElement; + this.updateFocusableDate(date); + event.stopPropagation(); + this.calciteInternalDatePickerMonthChange.emit({ date, position: target.position }); + }; + + private updateFocusableDate(date: Date): void { + if (!this.selectedDate || !this.range) { + this.focusedDate = this.getFirstValidDateOfMonth(date); + } else if (this.selectedDate && this.range) { + if (!hasSameMonthAndYear(this.startDate, date) || !hasSameMonthAndYear(this.endDate, date)) { + this.focusedDate = this.getFirstValidDateOfMonth(date); + } + } + } + + private getFirstValidDateOfMonth(date: Date): Date { + return date.getDate() === 1 ? date : getFirstValidDateInMonth(date, this.min, this.max); } } diff --git a/packages/calcite-components/src/components/date-picker-month/resources.ts b/packages/calcite-components/src/components/date-picker-month/resources.ts new file mode 100644 index 00000000000..6448cfe50cb --- /dev/null +++ b/packages/calcite-components/src/components/date-picker-month/resources.ts @@ -0,0 +1,14 @@ +export const CSS = { + calendar: "calendar", + calendarContainer: "calendar-container", + calendarStart: "calendar--start", + currentDay: "current-day", + dayContainer: "day-container", + insideRangeHover: "inside-range--hover", + month: "month", + noncurrent: "noncurrent", + outsideRangeHover: "outside-range--hover", + weekDays: "week-days", + weekHeader: "week-header", + weekHeaderContainer: "week-header-container", +}; diff --git a/packages/calcite-components/src/components/date-picker/date-picker.e2e.ts b/packages/calcite-components/src/components/date-picker/date-picker.e2e.ts index ef20879141f..589a3ba0c78 100644 --- a/packages/calcite-components/src/components/date-picker/date-picker.e2e.ts +++ b/packages/calcite-components/src/components/date-picker/date-picker.e2e.ts @@ -1,8 +1,11 @@ -import { E2EPage, newE2EPage } from "@stencil/core/testing"; +import { E2EElement, E2EPage, newE2EPage } from "@stencil/core/testing"; import { html } from "../../../support/formatting"; import { defaults, focusable, hidden, renders, t9n } from "../../tests/commonTests"; import { skipAnimations } from "../../tests/utils"; import { formatTimePart } from "../../utils/time"; +import { Position } from "../interfaces"; +import { CSS as MONTH_CSS } from "../date-picker-month/resources"; +import { CSS as MONTH_HEADER_CSS } from "../date-picker-month-header/resources"; describe("calcite-date-picker", () => { describe("renders", () => { @@ -24,257 +27,166 @@ describe("calcite-date-picker", () => { describe("focusable", () => { focusable("calcite-date-picker", { - shadowFocusTargetSelector: "calcite-date-picker-month-header", + shadowFocusTargetSelector: "calcite-date-picker-month", }); }); const animationDurationInMs = 200; - it("fires a calciteDatePickerChange event when changing year in header", async () => { - const page = await newE2EPage(); - await page.setContent(""); - const date = await page.find("calcite-date-picker"); - const changedEvent = await page.spyOnEvent("calciteDatePickerChange"); - - await page.waitForTimeout(animationDurationInMs); - // can't find this input as it's deeply nested in shadow dom, so just tab to it - await page.keyboard.press("Tab"); - await page.keyboard.press("Tab"); - await page.keyboard.press("ArrowUp"); - await page.waitForChanges(); - expect(changedEvent).toHaveReceivedEventTimes(0); - const value = await date.getProperty("value"); - expect(value).toEqual("2000-11-27"); - await page.keyboard.press("ArrowDown"); - const value2 = await date.getProperty("value"); - expect(value2).toEqual("2000-11-27"); - expect(changedEvent).toHaveReceivedEventTimes(0); - }); - - it("updates the calendar immediately as a new year is typed but doesn't change the year", async () => { - const page = await newE2EPage(); - await page.setContent(``); - const datePicker = await page.find("calcite-date-picker"); - await page.waitForTimeout(animationDurationInMs); - - async function getActiveMonthDate(): Promise { - return page.$eval("calcite-date-picker", (datePicker: HTMLCalciteDatePickerElement) => - datePicker.shadowRoot.querySelector("calcite-date-picker-month").activeDate.toISOString(), - ); - } - - async function getActiveMonthHeaderInputValue(): Promise { - return page.$eval( - "calcite-date-picker", - (datePicker: HTMLCalciteDatePickerElement) => - datePicker.shadowRoot - .querySelector("calcite-date-picker-month-header") - .shadowRoot.querySelector(".year").value, - ); - } - - const activeDateBefore = await getActiveMonthDate(); - - await page.keyboard.press("Tab"); - await page.keyboard.press("Tab"); - await page.keyboard.down("Meta"); - await page.keyboard.press("a"); - expect(await getActiveMonthHeaderInputValue()).toBe("2015"); - await page.keyboard.press("Backspace"); - await page.keyboard.up("Meta"); - await page.keyboard.type("2016"); - expect(await getActiveMonthHeaderInputValue()).toBe("2016"); - await page.waitForChanges(); + describe("calciteDatePickerChange & calciteDatePickerRangeChange events", () => { + it("fires a calciteDatePickerChange event when changing year in header", async () => { + const page = await newE2EPage(); + await page.setContent(""); + const date = await page.find("calcite-date-picker"); + const changedEvent = await page.spyOnEvent("calciteDatePickerChange"); - const activeDateAfter = await getActiveMonthDate(); + await page.waitForTimeout(animationDurationInMs); + // can't find this input as it's deeply nested in shadow dom, so just tab to it + await page.keyboard.press("Tab"); + await page.keyboard.press("Tab"); + await page.keyboard.press("Tab"); + await page.keyboard.press("Tab"); + await page.keyboard.press("Tab"); + await page.keyboard.press("ArrowUp"); + await page.waitForChanges(); + expect(changedEvent).toHaveReceivedEventTimes(0); + const value = await date.getProperty("value"); + expect(value).toEqual("2000-11-27"); + await page.keyboard.press("ArrowDown"); + const value2 = await date.getProperty("value"); + expect(value2).toEqual("2000-11-27"); + expect(changedEvent).toHaveReceivedEventTimes(0); + }); - expect(activeDateBefore).not.toEqual(activeDateAfter); - expect(await datePicker.getProperty("value")).toBe("2015-02-28"); - }); + it("fires a calciteDatePickerChange event when day is selected", async () => { + const page = await newE2EPage(); + await page.setContent(""); + const changedEvent = await page.spyOnEvent("calciteDatePickerChange"); - it("fires a calciteDatePickerChange event when day is selected", async () => { - const page = await newE2EPage(); - await page.setContent(""); - const changedEvent = await page.spyOnEvent("calciteDatePickerChange"); + await page.waitForTimeout(animationDurationInMs); - await page.waitForTimeout(animationDurationInMs); + await selectFirstAvailableDay(page); + expect(changedEvent).toHaveReceivedEventTimes(1); - await selectFirstAvailableDay(page, "mouse"); - expect(changedEvent).toHaveReceivedEventTimes(1); + await selectFirstAvailableDay(page); + expect(changedEvent).toHaveReceivedEventTimes(2); + }); - await selectFirstAvailableDay(page, "keyboard"); - expect(changedEvent).toHaveReceivedEventTimes(2); - }); + it("emits calciteDatePickerRangeChange event and updates value property when start and end dates are selected from start calendar", async () => { + const page = await newE2EPage(); + await page.setContent(""); + const datePicker = await page.find("calcite-date-picker"); + const eventSpy = await page.spyOnEvent("calciteDatePickerRangeChange"); - it("Emits change event and updates value property when start and end dates are selected", async () => { - const page = await newE2EPage(); - await page.setContent(""); - const datePicker = await page.find("calcite-date-picker"); - const eventSpy = await page.spyOnEvent("calciteDatePickerRangeChange"); + await page.waitForTimeout(animationDurationInMs); - await page.waitForTimeout(animationDurationInMs); + const now = new Date(); + const currentYear = now.getUTCFullYear(); + const currentMonth = now.getUTCMonth() + 1; + const startDate = `${currentYear}-${formatTimePart(currentMonth)}-01`; + const endDate = `${currentYear}-${formatTimePart(currentMonth)}-15`; - const now = new Date(); - const currentYear = now.getUTCFullYear(); - const currentMonth = now.getUTCMonth() + 1; - const startDate = `${currentYear}-${formatTimePart(currentMonth)}-01`; - const endDate = `${currentYear}-${formatTimePart(currentMonth)}-15`; + await selectDayInMonthById(startDate.replaceAll("-", ""), page); + await page.waitForChanges(); - await selectDay(startDate.replaceAll("-", ""), page, "mouse"); - await page.waitForChanges(); + expect(await datePicker.getProperty("value")).toEqual([startDate, ""]); - expect(await datePicker.getProperty("value")).toEqual([startDate, ""]); + await selectDayInMonthById(endDate.replaceAll("-", ""), page); + await page.waitForChanges(); - await selectDay(endDate.replaceAll("-", ""), page, "mouse"); - await page.waitForChanges(); + expect(await datePicker.getProperty("value")).toEqual([startDate, endDate]); + expect(eventSpy).toHaveReceivedEventTimes(2); + }); - expect(await datePicker.getProperty("value")).toEqual([startDate, endDate]); - expect(eventSpy).toHaveReceivedEventTimes(2); - }); + it("Emits calciteDatePickerRangeChange event and updates value property when start and end dates are selected from end calendar", async () => { + const page = await newE2EPage(); + await page.setContent(""); + const datePicker = await page.find("calcite-date-picker"); + const eventSpy = await page.spyOnEvent("calciteDatePickerRangeChange"); - it("doesn't fire calciteDatePickerChange when the selected day is selected", async () => { - const page = await newE2EPage(); - await page.setContent(""); - const changedEvent = await page.spyOnEvent("calciteDatePickerChange"); + await page.waitForTimeout(animationDurationInMs); - await skipAnimations(page); + const now = new Date(); + const currentYear = now.getUTCFullYear(); + const currentMonth = now.getUTCMonth() + 2; + const startDate = `${currentYear}-${formatTimePart(currentMonth)}-01`; + const endDate = `${currentYear}-${formatTimePart(currentMonth)}-15`; - await selectSelectedDay(page, "mouse"); - expect(changedEvent).toHaveReceivedEventTimes(0); - await selectSelectedDay(page, "mouse"); - expect(changedEvent).toHaveReceivedEventTimes(0); - await selectSelectedDay(page, "mouse"); - expect(changedEvent).toHaveReceivedEventTimes(0); - - await selectSelectedDay(page, "keyboard"); - expect(changedEvent).toHaveReceivedEventTimes(0); - await selectSelectedDay(page, "keyboard"); - expect(changedEvent).toHaveReceivedEventTimes(0); - await selectSelectedDay(page, "keyboard"); - expect(changedEvent).toHaveReceivedEventTimes(0); - }); + await selectDayInMonthById(startDate.replaceAll("-", ""), page); + await page.waitForChanges(); - async function selectDay(id: string, page: E2EPage, method: "mouse" | "keyboard"): Promise { - await page.$eval( - "calcite-date-picker", - (datePicker: HTMLCalciteDatePickerElement, id: string, method: "mouse" | "keyboard") => { - const day = datePicker.shadowRoot - .querySelector("calcite-date-picker-month") - .shadowRoot.getElementById(id); - - if (method === "mouse") { - day.click(); - } else { - day.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter" })); - } - }, - id, - method, - ); - await page.waitForChanges(); - } + expect(await datePicker.getProperty("value")).toEqual([startDate, ""]); - async function selectFirstAvailableDay(page: E2EPage, method: "mouse" | "keyboard"): Promise { - await page.$eval( - "calcite-date-picker", - (datePicker: HTMLCalciteDatePickerElement, method: "mouse" | "keyboard") => { - const day = datePicker.shadowRoot - .querySelector("calcite-date-picker-month") - .shadowRoot.querySelector("calcite-date-picker-day:not([selected])"); - - if (method === "mouse") { - day.click(); - } else { - day.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter" })); - } - }, - method, - ); - await page.waitForChanges(); - } + await selectDayInMonthById(endDate.replaceAll("-", ""), page); + await page.waitForChanges(); - async function selectSelectedDay(page: E2EPage, method: "mouse" | "keyboard"): Promise { - await page.$eval( - "calcite-date-picker", - (datePicker: HTMLCalciteDatePickerElement, method: "mouse" | "keyboard") => { - const day = datePicker.shadowRoot - .querySelector("calcite-date-picker-month") - .shadowRoot.querySelector("calcite-date-picker-day[selected]"); - - if (method === "mouse") { - day.click(); - } else { - day.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter" })); - } - }, - method, - ); - await page.waitForChanges(); - } + expect(await datePicker.getProperty("value")).toEqual([startDate, endDate]); + expect(eventSpy).toHaveReceivedEventTimes(2); + }); - it("doesn't fire calciteDatePickerChange on outside changes to value", async () => { - const page = await newE2EPage(); - await page.setContent(""); - const date = await page.find("calcite-date-picker"); - const changedEvent = await page.spyOnEvent("calciteDatePickerChange"); - date.setProperty("value", "2001-10-28"); - await page.waitForChanges(); - expect(changedEvent).toHaveReceivedEventTimes(0); - }); + it("doesn't fire calciteDatePickerChange when the selected day is selected", async () => { + const page = await newE2EPage(); + await page.setContent(""); + const changedEvent = await page.spyOnEvent("calciteDatePickerChange"); + + await skipAnimations(page); + + await selectSelectedDay(page); + expect(changedEvent).toHaveReceivedEventTimes(0); + await selectSelectedDay(page); + expect(changedEvent).toHaveReceivedEventTimes(0); + await selectSelectedDay(page); + expect(changedEvent).toHaveReceivedEventTimes(0); + + await selectSelectedDay(page); + expect(changedEvent).toHaveReceivedEventTimes(0); + await selectSelectedDay(page); + expect(changedEvent).toHaveReceivedEventTimes(0); + await selectSelectedDay(page); + expect(changedEvent).toHaveReceivedEventTimes(0); + }); - it.skip("correctly changes date on next/prev", async () => { - const page = await newE2EPage(); - await page.setContent(""); - const getMonth = () => { - return document - .querySelector("calcite-date-picker") - .shadowRoot.querySelector("calcite-date-picker-month-header") - .shadowRoot.querySelector(".month").textContent; - }; - expect(await page.evaluate(getMonth)).toEqualText("November"); - // tab to prev arrow - await page.keyboard.press("Tab"); - await page.keyboard.press("Enter"); - await page.waitForChanges(); - expect(await page.evaluate(getMonth)).toEqualText("October"); - // tab to next arrow - await page.keyboard.press("Tab"); - await page.keyboard.press("Tab"); - await page.keyboard.press("Enter"); - await page.waitForChanges(); - expect(await page.evaluate(getMonth)).toEqualText("November"); - }); + it("doesn't fire calciteDatePickerChange on outside changes to value", async () => { + const page = await newE2EPage(); + await page.setContent(""); + const date = await page.find("calcite-date-picker"); + const changedEvent = await page.spyOnEvent("calciteDatePickerChange"); + date.setProperty("value", "2001-10-28"); + await page.waitForChanges(); + expect(changedEvent).toHaveReceivedEventTimes(0); + }); - it("fires calciteDatePickerRangeChange event on user change", async () => { - const page = await newE2EPage(); - await page.setContent(``); - await page.waitForChanges(); - const date = await page.find("calcite-date-picker"); - date.setProperty("value", ["2020-09-08", "2020-09-23"]); + it("fires calciteDatePickerRangeChange event on user change", async () => { + const page = await newE2EPage(); + await page.setContent(``); + await page.waitForChanges(); + const date = await page.find("calcite-date-picker"); + date.setProperty("value", ["2020-09-08", "2020-09-23"]); - // have to wait for transition - const changedEvent = await page.spyOnEvent("calciteDatePickerRangeChange"); - await new Promise((res) => global.setTimeout(() => res(true), 200)); - expect(changedEvent).toHaveReceivedEventTimes(0); + // have to wait for transition + const changedEvent = await page.spyOnEvent("calciteDatePickerRangeChange"); + await new Promise((res) => global.setTimeout(() => res(true), 200)); + expect(changedEvent).toHaveReceivedEventTimes(0); - await page.waitForChanges(); + await page.waitForChanges(); - expect(await date.getProperty("value")).toEqual(["2020-09-08", "2020-09-23"]); + expect(await date.getProperty("value")).toEqual(["2020-09-08", "2020-09-23"]); - await page.keyboard.press("Tab"); - await page.waitForChanges(); - await page.keyboard.press("Tab"); - await page.waitForChanges(); - await page.keyboard.press("Tab"); - await page.waitForChanges(); - await page.keyboard.press("Tab"); - await page.waitForChanges(); - await page.keyboard.press("ArrowRight"); - await page.waitForChanges(); - await page.keyboard.press("Space"); - await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("ArrowRight"); + await page.waitForChanges(); + await page.keyboard.press("Space"); + await page.waitForChanges(); - expect(changedEvent).toHaveReceivedEventTimes(1); + expect(changedEvent).toHaveReceivedEventTimes(1); + }); }); describe("when the lang is set to Slovak calendar", () => { @@ -295,60 +207,48 @@ describe("calcite-date-picker", () => { }); }); - it("updates internally when min attribute is updated after initialization", async () => { - const page = await newE2EPage(); - await page.emulateTimezone("America/Los_Angeles"); - await page.setContent( - html``, - ); - - const element = await page.find("calcite-date-picker"); - element.setProperty("min", "2021-11-15"); - element.setProperty("max", "2023-11-15"); - await page.waitForChanges(); - const minDateString = "Mon Nov 15 2021 00:00:00 GMT-0800 (Pacific Standard Time)"; - const minDateAsTime = await page.$eval("calcite-date-picker", (picker: HTMLCalciteDatePickerElement) => - picker.minAsDate.getTime(), - ); - expect(minDateAsTime).toEqual(new Date(minDateString).getTime()); - }); - - it("unsetting min/max updates internally", async () => { - const page = await newE2EPage(); - await page.emulateTimezone("America/Los_Angeles"); - await page.setContent( - html``, - ); + describe("min & max", () => { + it("updates minAsDate when min attribute is updated after initialization", async () => { + const page = await newE2EPage(); + await page.emulateTimezone("America/Los_Angeles"); + await page.setContent( + html``, + ); - const element = await page.find("calcite-date-picker"); + const element = await page.find("calcite-date-picker"); + element.setProperty("min", "2021-11-15"); + element.setProperty("max", "2023-11-15"); + await page.waitForChanges(); + const minDateString = "Mon Nov 15 2021 00:00:00 GMT-0800 (Pacific Standard Time)"; + const minDateAsTime = await page.$eval("calcite-date-picker", (picker: HTMLCalciteDatePickerElement) => + picker.minAsDate.getTime(), + ); + expect(minDateAsTime).toEqual(new Date(minDateString).getTime()); + }); - element.setProperty("min", null); - element.setProperty("max", null); - await page.waitForChanges(); + it("unsetting min/max updates minAsDate & maxAsDate", async () => { + const page = await newE2EPage(); + await page.emulateTimezone("America/Los_Angeles"); + await page.setContent( + html``, + ); - expect(await element.getProperty("minAsDate")).toBe(null); - expect(await element.getProperty("maxAsDate")).toBe(null); + const element = await page.find("calcite-date-picker"); - const dateBeyondMax = "2022-11-26"; - await setActiveDate(page, dateBeyondMax); - expect(await getActiveDate(page)).toEqual(new Date(dateBeyondMax).toISOString()); + element.setProperty("min", null); + element.setProperty("max", null); + await page.waitForChanges(); - const dateBeforeMin = "2022-11-14"; - await setActiveDate(page, dateBeforeMin); - expect(await getActiveDate(page)).toEqual(new Date(dateBeforeMin).toISOString()); - }); + expect(await element.getProperty("minAsDate")).toBe(null); + expect(await element.getProperty("maxAsDate")).toBe(null); - it("passes down the default year prop to child date-picker-month-header", async () => { - const page = await newE2EPage(); - await page.setContent(html``); - const date = await page.find(`calcite-date-picker >>> calcite-date-picker-month-header`); + const dateBeyondMax = "2022-11-26"; + await setActiveDate(page, dateBeyondMax); + expect(await getActiveDate(page)).toEqual(new Date(dateBeyondMax).toISOString()); - expect(await date.getProperty("messages")).toEqual({ - nextMonth: "Next month", - prevMonth: "Previous month", - monthMenu: "Month menu", - yearMenu: "Year menu", - year: "Year", + const dateBeforeMin = "2022-11-14"; + await setActiveDate(page, dateBeforeMin); + expect(await getActiveDate(page)).toEqual(new Date(dateBeforeMin).toISOString()); }); }); @@ -373,7 +273,8 @@ describe("calcite-date-picker", () => { await page.waitForChanges(); await page.keyboard.press("Tab"); await page.waitForChanges(); - + await page.keyboard.press("Tab"); + await page.waitForChanges(); await page.keyboard.press("ArrowUp"); await page.waitForChanges(); await page.keyboard.press("Enter"); @@ -417,6 +318,8 @@ describe("calcite-date-picker", () => { await page.waitForChanges(); await page.keyboard.press("Tab"); await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); await page.keyboard.press("ArrowUp"); await page.waitForChanges(); await page.keyboard.press("Enter"); @@ -465,7 +368,6 @@ describe("calcite-date-picker", () => { await page.waitForChanges(); await page.keyboard.press("Tab"); await page.waitForChanges(); - await page.keyboard.press("ArrowUp"); await page.waitForChanges(); await page.keyboard.press("Enter"); @@ -477,7 +379,6 @@ describe("calcite-date-picker", () => { await page.waitForChanges(); await page.keyboard.press("Enter"); await page.waitForChanges(); - await page.waitForTimeout(4000); expect(await datePicker.getProperty("value")).toEqual(["2023-11-25", "2023-12-25"]); await page.keyboard.press("PageDown"); @@ -486,7 +387,6 @@ describe("calcite-date-picker", () => { await page.waitForChanges(); await page.keyboard.press("Enter"); await page.waitForChanges(); - await page.waitForTimeout(4000); expect(await datePicker.getProperty("value")).toEqual(["2023-11-25", "2024-01-25"]); await page.keyboard.press("ArrowDown"); @@ -524,7 +424,6 @@ describe("calcite-date-picker", () => { await page.waitForChanges(); await page.keyboard.press("Enter"); await page.waitForChanges(); - expect(await datePicker.getProperty("value")).toEqual(["2023-12-25", "2024-01-08"]); await page.keyboard.press("PageUp"); @@ -544,26 +443,81 @@ describe("calcite-date-picker", () => { }); }); - it("restarts range on selection after a range is complete when proximitySelectionDisabled is set", async () => { - const page = await newE2EPage(); - await page.setContent( - html` `, - ); - const datePicker = await page.find("calcite-date-picker"); + describe("hover range", () => { + it("should toggle range-hover attribute when updating the range", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + const datePicker = await page.find("calcite-date-picker"); + datePicker.setProperty("value", ["2024-01-01", "2024-02-10"]); - await selectDay("20200908", page, "mouse"); - await page.waitForChanges(); - await selectDay("20200923", page, "mouse"); - await page.waitForChanges(); - expect(await datePicker.getProperty("value")).toEqual(["2020-09-08", "2020-09-23"]); + await page.waitForChanges(); + let dateInsideRange = await getDayById(page, "20240109"); + await dateInsideRange.hover(); + await page.waitForChanges(); + expect(await (await getDayById(page, "20240108")).getProperty("rangeHover")).toBe(true); + expect(await (await getDayById(page, "20240208")).getProperty("rangeHover")).toBe(false); - await selectDay("20200915", page, "mouse"); - await page.waitForChanges(); - expect(await datePicker.getProperty("value")).toEqual(["2020-09-15", ""]); + dateInsideRange = await getDayById(page, "20240205"); + await dateInsideRange.hover(); + expect(await (await getDayById(page, "20240108")).getProperty("rangeHover")).toBe(false); + expect(await (await getDayById(page, "20240208")).getProperty("rangeHover")).toBe(true); + }); - await selectDay("20200930", page, "mouse"); - await page.waitForChanges(); - expect(await datePicker.getProperty("value")).toEqual(["2020-09-15", "2020-09-30"]); + it("should add range-hover attribute to dates falls outside of current range when extending", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + const datePicker = await page.find("calcite-date-picker"); + datePicker.setProperty("value", ["2024-01-05", "2024-02-15"]); + + await page.waitForChanges(); + expect(await (await getDayById(page, "20240108")).getProperty("rangeHover")).toBe(false); + expect(await (await getDayById(page, "20240208")).getProperty("rangeHover")).toBe(false); + + let dateInsideRange = await getDayById(page, "20240101"); + await dateInsideRange.hover(); + await page.waitForChanges(); + expect(await (await getDayById(page, "20240102")).getProperty("rangeHover")).toBe(true); + expect(await (await getDayById(page, "20240108")).getProperty("rangeHover")).toBe(false); + expect(await (await getDayById(page, "20240208")).getProperty("rangeHover")).toBe(false); + + dateInsideRange = await getDayById(page, "20240225"); + await dateInsideRange.hover(); + await page.waitForChanges(); + expect(await (await getDayById(page, "20240102")).getProperty("rangeHover")).toBe(false); + expect(await (await getDayById(page, "20240108")).getProperty("rangeHover")).toBe(false); + expect(await (await getDayById(page, "20240208")).getProperty("rangeHover")).toBe(false); + expect(await (await getDayById(page, "20240224")).getProperty("rangeHover")).toBe(true); + }); + + it("should not add range-hover attribute to dates before startDate and after endDate during initial selection", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + + await setActiveDate(page, "01-01-2024"); + await page.waitForChanges(); + + const startDate = await getDayById(page, "20240108"); + await startDate.hover(); + await page.waitForChanges(); + + await selectDayInMonthById("20240108", page); + await page.waitForChanges(); + expect(await (await getDayById(page, "20240107")).getProperty("rangeHover")).toBeFalsy(); + expect(await (await getDayById(page, "20240209")).getProperty("rangeHover")).toBeFalsy(); + + const endDate = await getDayById(page, "20240205"); + await endDate.hover(); + await page.waitForChanges(); + expect(await (await getDayById(page, "20240107")).getProperty("rangeHover")).toBeFalsy(); + expect(await (await getDayById(page, "20240209")).getProperty("rangeHover")).toBeFalsy(); + expect(await (await getDayById(page, "20240201")).getProperty("rangeHover")).toBe(true); + + await selectDayInMonthById("20240205", page); + await page.waitForChanges(); + expect(await (await getDayById(page, "20240107")).getProperty("rangeHover")).toBeFalsy(); + expect(await (await getDayById(page, "20240209")).getProperty("rangeHover")).toBeFalsy(); + expect(await (await getDayById(page, "20240201")).getProperty("rangeHover")).toBe(false); + }); }); describe("cross-century date values", () => { @@ -579,7 +533,7 @@ describe("calcite-date-picker", () => { expect(await datePicker.getProperty("value")).toBe(initialValue); const selectedDateInCentury = `${year}0307`; - await selectDay(selectedDateInCentury, page, "mouse"); + await selectDayInMonthById(selectedDateInCentury, page); await page.waitForChanges(); expect(await datePicker.getProperty("value")).toBe(`${year}-03-07`); @@ -617,6 +571,436 @@ describe("calcite-date-picker", () => { await assertCenturyDateValue(1750, "Europe/Zurich"); }); }); + + describe("month & year selection", () => { + it("should allow selecting last valid month from month select menu in start calendar", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + + await setActiveDate(page, "07-01-2024"); + await page.waitForChanges(); + + const [monthSelectStart, monthSelectEnd] = await page.findAll( + `calcite-date-picker >>> calcite-date-picker-month-header >>> calcite-select.${MONTH_HEADER_CSS.monthPicker}`, + ); + const [yearInputStart, yearInputEnd] = await page.findAll( + "calcite-date-picker >>> calcite-date-picker-month-header >>> input", + ); + expect(await yearInputStart.getProperty("value")).toBe("2024"); + expect(await yearInputEnd.getProperty("value")).toBe("2024"); + expect(await monthSelectStart.getProperty("value")).toBe("July"); + expect(await monthSelectEnd.getProperty("value")).toBe("August"); + + await monthSelectStart.click(); + await page.waitForChanges(); + + await page.select( + `calcite-date-picker >>> calcite-date-picker-month-header >>> calcite-select.${MONTH_HEADER_CSS.monthPicker} >>> select`, + "October", + ); + await page.waitForChanges(); + + expect(await monthSelectStart.getProperty("value")).toBe("October"); + expect(await monthSelectEnd.getProperty("value")).toBe("November"); + expect(await yearInputEnd.getProperty("value")).toBe("2024"); + expect(await yearInputStart.getProperty("value")).toBe("2024"); + }); + + it("should allow selecting first valid month from month select menu in end calendar", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + + await setActiveDate(page, "01-01-2024"); + await page.waitForChanges(); + + const [monthSelectStart, monthSelectEnd] = await page.findAll( + `calcite-date-picker >>> calcite-date-picker-month-header >>> calcite-select.${MONTH_HEADER_CSS.monthPicker}`, + ); + const [yearInputStart, yearInputEnd] = await page.findAll( + "calcite-date-picker >>> calcite-date-picker-month-header >>> input", + ); + expect(await yearInputStart.getProperty("value")).toBe("2024"); + expect(await yearInputEnd.getProperty("value")).toBe("2024"); + expect(await monthSelectStart.getProperty("value")).toBe("January"); + expect(await monthSelectEnd.getProperty("value")).toBe("February"); + + await monthSelectEnd.click(); + await page.waitForChanges(); + + await page.select( + `calcite-date-picker >>> [data-test-calendar="end"] >>> calcite-select.${MONTH_HEADER_CSS.monthPicker} >>> select`, + "January", + ); + await page.waitForChanges(); + expect(await monthSelectStart.getProperty("value")).toBe("December"); + expect(await yearInputEnd.getProperty("value")).toBe("2024"); + expect(await yearInputStart.getProperty("value")).toBe("2023"); + }); + }); + + it("should have current-day class for current day only", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + + const activeDate = await page.find( + "calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day[tabindex='0']", + ); + expect(activeDate.classList.contains(MONTH_CSS.currentDay)).toBe(true); + + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + + const firstDayInPreviousMonth = await page.find( + "calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day[tabindex='0']", + ); + expect(firstDayInPreviousMonth.classList.contains(MONTH_CSS.currentDay)).toBe(false); + let currentDay = await page.find( + `calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day.${MONTH_CSS.currentDay}`, + ); + expect(currentDay).toBeTruthy(); + + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + + await page.keyboard.press("Enter"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + + const firstDayInNextMonth = await page.find( + "calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day[tabindex='0']", + ); + expect(firstDayInNextMonth.classList.contains(MONTH_CSS.currentDay)).toBe(false); + currentDay = await page.find( + `calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day.${MONTH_CSS.currentDay}`, + ); + expect(currentDay).toBeFalsy(); + }); + + describe("navigating months", () => { + it("correctly changes date on next/prev", async () => { + const page = await newE2EPage(); + await page.setContent(""); + + const [prevMonth, nextMonth] = await page.findAll( + `calcite-date-picker >>> calcite-date-picker-month-header >>> .${MONTH_HEADER_CSS.header} >>> calcite-action`, + ); + const monthSelect = await page.find("calcite-date-picker >>> calcite-select"); + const yearInput = await page.find("calcite-date-picker >>> input"); + + await prevMonth.click(); + await nextMonth.click(); + await nextMonth.click(); + await nextMonth.click(); + + const currentMonth = await monthSelect.getProperty("value"); + const currentYear = await yearInput.getProperty("value"); + expect(currentMonth).toBe("January"); + expect(currentYear).toBe("2001"); + }); + + it("should navigate to previous month from last valid month", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + + const nextMonth = await page.find( + `calcite-date-picker >>> calcite-date-picker-month-header >>> .${MONTH_HEADER_CSS.header} >>> calcite-action[aria-label='Next month']`, + ); + + await nextMonth.click(); + await page.waitForChanges(); + expect(await getActiveMonth(page)).toBe("October"); + + await nextMonth.click(); + await page.waitForChanges(); + expect(await getActiveMonth(page)).toBe("November"); + + await page.keyboard.press("Enter"); + await page.waitForChanges(); + expect(await getActiveMonth(page)).toBe("October"); + }); + + it("should navigate to next month from first valid month", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + + const prevMonth = await page.find( + `calcite-date-picker >>> calcite-date-picker-month-header >>> .${MONTH_HEADER_CSS.header} >>> calcite-action[aria-label='Previous month']`, + ); + + await prevMonth.click(); + await page.waitForChanges(); + expect(await getActiveMonth(page)).toBe("December"); + + await prevMonth.click(); + await page.waitForChanges(); + expect(await getActiveMonth(page)).toBe("November"); + + await page.keyboard.press("Enter"); + await page.waitForChanges(); + expect(await getActiveMonth(page)).toBe("December"); + }); + }); + + describe("selection", () => { + it("should select first date in month when max is before current in range", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + const datePicker = await page.find("calcite-date-picker"); + + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + + expect(await datePicker.getProperty("value")).toStrictEqual(["2024-07-01", ""]); + }); + + it("should select first date in month when max is before current", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + const datePicker = await page.find("calcite-date-picker"); + + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + + expect(await datePicker.getProperty("value")).toStrictEqual("2024-08-01"); + }); + + it("should select first valid date in month when minAsDate is after current in range", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + const datePicker = await page.find("calcite-date-picker"); + + const currentDate = new Date(); + currentDate.setMonth(currentDate.getMonth() + 2); + currentDate.setDate(12); + const currentISODate = currentDate.toISOString().split("T")[0]; + + await page.evaluate((currentISODate) => { + const datePicker = document.querySelector("calcite-date-picker"); + datePicker.min = currentISODate; + }, currentISODate); + + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + + expect(await datePicker.getProperty("value")).toStrictEqual([currentISODate, ""]); + }); + + it("should select current day when min is before current day but in same month of range date-picker", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + const datePicker = await page.find("calcite-date-picker"); + + const currentDate = new Date(); + if (currentDate.getDate() > 2) { + currentDate.setDate(1); + } + const currentISODate = currentDate.toISOString().split("T")[0]; + + await page.evaluate((currentISODate) => { + const datePicker = document.querySelector("calcite-date-picker"); + datePicker.min = currentISODate; + }, currentISODate); + + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + + const currentDayDate = new Date(); + const currentDayISODate = currentDayDate.toISOString().split("T")[0]; + + expect(await datePicker.getProperty("value")).toStrictEqual([currentDayISODate, ""]); + }); + + it("should select current day when min is before current day but in same month", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + const datePicker = await page.find("calcite-date-picker"); + + const currentDate = new Date(); + if (currentDate.getDate() > 2) { + currentDate.setDate(1); + } + const currentISODate = currentDate.toISOString().split("T")[0]; + + await page.evaluate((currentISODate) => { + const datePicker = document.querySelector("calcite-date-picker"); + datePicker.min = currentISODate; + }, currentISODate); + + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + + const currentDayDate = new Date(); + const currentDayISODate = currentDayDate.toISOString().split("T")[0]; + + expect(await datePicker.getProperty("value")).toEqual(currentDayISODate); + }); + + it("should select first valid date in month when minAsDate is after current", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + const datePicker = await page.find("calcite-date-picker"); + + const currentDate = new Date(); + currentDate.setMonth(currentDate.getMonth() + 2); + currentDate.setDate(12); + const currentISODate = currentDate.toISOString().split("T")[0]; + + await page.evaluate((currentISODate) => { + const datePicker = document.querySelector("calcite-date-picker"); + datePicker.min = currentISODate; + }, currentISODate); + + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + + expect(await datePicker.getProperty("value")).toEqual(currentISODate); + }); + }); + + it("updates the calendar immediately as a new year is typed but doesn't change the year", async () => { + const page = await newE2EPage(); + await page.setContent(``); + const datePicker = await page.find("calcite-date-picker"); + await skipAnimations(page); + + async function getActiveMonthDate(): Promise { + return page.$eval("calcite-date-picker", (datePicker: HTMLCalciteDatePickerElement) => + datePicker.shadowRoot.querySelector("calcite-date-picker-month").activeDate.toISOString(), + ); + } + + async function getActiveMonthHeaderInputValue(): Promise { + return page.$eval( + "calcite-date-picker", + (datePicker: HTMLCalciteDatePickerElement) => + datePicker.shadowRoot + .querySelector("calcite-date-picker-month") + .shadowRoot.querySelector("calcite-date-picker-month-header") + .shadowRoot.querySelector(".year").value, + ); + } + + const activeDateBefore = await getActiveMonthDate(); + + await page.keyboard.press("Tab"); + await page.keyboard.press("Tab"); + await page.keyboard.down("Meta"); + await page.keyboard.press("a"); + expect(await getActiveMonthHeaderInputValue()).toBe("2015"); + await page.keyboard.press("Backspace"); + await page.keyboard.up("Meta"); + await page.keyboard.type("2016"); + await page.waitForChanges(); + expect(await getActiveMonthHeaderInputValue()).toBe("2016"); + + const activeDateAfter = await getActiveMonthDate(); + + expect(activeDateBefore).not.toEqual(activeDateAfter); + expect(await datePicker.getProperty("value")).toBe("2015-02-28"); + }); + + it("passes down the default year prop to child date-picker-month-header", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + const date = await page.find(`calcite-date-picker >>> calcite-date-picker-month`); + + expect(await date.getProperty("messages")).toEqual({ + nextMonth: "Next month", + prevMonth: "Previous month", + monthMenu: "Month menu", + yearMenu: "Year menu", + year: "Year", + }); + }); + + it("restarts range on selection after a range is complete when proximitySelectionDisabled is set", async () => { + const page = await newE2EPage(); + await page.setContent( + html` `, + ); + const datePicker = await page.find("calcite-date-picker"); + + await selectDayInMonthById("20200908", page); + await page.waitForChanges(); + await selectDayInMonthById("20200923", page); + await page.waitForChanges(); + expect(await datePicker.getProperty("value")).toEqual(["2020-09-08", "2020-09-23"]); + + await selectDayInMonthById("20200915", page); + await page.waitForChanges(); + expect(await datePicker.getProperty("value")).toEqual(["2020-09-15", ""]); + + await selectDayInMonthById("20200930", page); + await page.waitForChanges(); + expect(await datePicker.getProperty("value")).toEqual(["2020-09-15", "2020-09-30"]); + }); }); async function setActiveDate(page: E2EPage, date: string): Promise { @@ -633,3 +1017,42 @@ async function getActiveDate(page: E2EPage): Promise { return datePicker.activeDate.toISOString(); }); } + +async function selectDayInMonthById(id: string, page: E2EPage): Promise { + const day = await page.find( + `calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day[current-month][id="${id}"]`, + ); + await day.click(); + await page.waitForChanges(); +} + +async function selectFirstAvailableDay(page: E2EPage): Promise { + const day = await page.find( + "calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day:not([selected])", + ); + await day.click(); + await page.waitForChanges(); +} + +async function selectSelectedDay(page: E2EPage): Promise { + const day = await page.find( + "calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day[selected]", + ); + await day.click(); + await page.waitForChanges(); +} + +async function getDayById(page: E2EPage, id: string): Promise { + return await page.find(`calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day[id="${id}"]`); +} + +async function getActiveMonth(page: E2EPage, position: Extract<"start" | "end", Position> = "start"): Promise { + const [startMonth, endMonth] = await page.findAll( + `calcite-date-picker >>> calcite-date-picker-month-header >>> .${MONTH_HEADER_CSS.header} >>> calcite-select.${MONTH_HEADER_CSS.monthPicker}`, + ); + + if (position === "start") { + return (await startMonth.find("calcite-option[selected]")).textContent; + } + return (await endMonth.find("calcite-option[selected]")).textContent; +} diff --git a/packages/calcite-components/src/components/date-picker/date-picker.scss b/packages/calcite-components/src/components/date-picker/date-picker.scss index c94b0112c41..783823950e7 100644 --- a/packages/calcite-components/src/components/date-picker/date-picker.scss +++ b/packages/calcite-components/src/components/date-picker/date-picker.scss @@ -7,25 +7,43 @@ inline-block overflow-visible rounded-none - w-auto; + w-full; } :host([scale="s"]) { - inline-size: 234px; + inline-size: 236px; min-inline-size: 216px; max-inline-size: 380px; } +:host([scale="s"][range][layout="horizontal"]) { + inline-size: 480px; + min-inline-size: 432px; + max-inline-size: 772px; +} + :host([scale="m"]) { - inline-size: 304px; + inline-size: 298px; min-inline-size: 272px; max-inline-size: 480px; } +:host([scale="m"][range][layout="horizontal"]) { + inline-size: 608px; + min-inline-size: 544px; + max-inline-size: 972px; +} + :host([scale="l"]) { - inline-size: 370px; + inline-size: 334px; min-inline-size: 320px; max-inline-size: 600px; } +:host([scale="l"][range][layout="horizontal"]) { + inline-size: 684px; + min-inline-size: 640px; + max-inline-size: 1212px; +} + @include base-component(); diff --git a/packages/calcite-components/src/components/date-picker/date-picker.stories.ts b/packages/calcite-components/src/components/date-picker/date-picker.stories.ts index 0f034e41de1..c9cd30325fe 100644 --- a/packages/calcite-components/src/components/date-picker/date-picker.stories.ts +++ b/packages/calcite-components/src/components/date-picker/date-picker.stories.ts @@ -83,6 +83,36 @@ export const rangeHighlighted_TestOnly = (): string => html` `; +export const rangeValuesNotInSameMonthAndYear_TestOnly = (): string => html` +
+ +
+ +`; + +export const Focus = (): string => html` +
+ +
+ +`; + +Focus.parameters = { + chromatic: { delay: 2000 }, +}; + export const rangeRTL_TestOnly = (): string => html`
diff --git a/packages/calcite-components/src/components/date-picker/date-picker.tsx b/packages/calcite-components/src/components/date-picker/date-picker.tsx index 179ed394473..fa3e2065a37 100644 --- a/packages/calcite-components/src/components/date-picker/date-picker.tsx +++ b/packages/calcite-components/src/components/date-picker/date-picker.tsx @@ -16,8 +16,12 @@ import { dateFromRange, dateToISO, getDaysDiff, + getFirstValidDateInMonth, HoverRange, - setEndOfDay, + inRange, + nextMonth, + prevMonth, + sameDate, } from "../../utils/date"; import { componentFocusable, @@ -42,6 +46,7 @@ import { } from "../../utils/t9n"; import { HeadingLevel } from "../functional/Heading"; import { isBrowser } from "../../utils/browser"; +import { focusFirstTabbable } from "../../utils/dom"; import { DatePickerMessages } from "./assets/date-picker/t9n"; import { DATE_PICKER_FORMAT_OPTIONS, HEADING_LEVEL } from "./resources"; import { DateLocaleData, getLocaleData, getValueAsDateRange } from "./utils"; @@ -65,9 +70,18 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom @Prop({ mutable: true }) activeDate: Date; @Watch("activeDate") - activeDateWatcher(newActiveDate: Date): void { - if (this.activeRange === "end") { - this.activeEndDate = newActiveDate; + activeDateWatcher(newValue: Date): void { + if (!this.range) { + return; + } + + if (!this.rangeValueChangedByUser) { + if (newValue) { + this.activeStartDate = newValue; + this.activeEndDate = nextMonth(this.activeStartDate); + } else { + this.resetActiveDates(); + } } } @@ -81,22 +95,33 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom */ @Prop({ mutable: true }) value: string | string[]; + @Watch("value") + valueHandler(value: string | string[]): void { + if (Array.isArray(value)) { + this.valueAsDate = getValueAsDateRange(value); + if (!this.rangeValueChangedByUser) { + this.resetActiveDates(); + } + } else if (value) { + this.valueAsDate = dateFromISO(value); + } + } + /** * Specifies the heading level of the component's `heading` for proper document structure, without affecting visual styling. */ @Prop({ reflect: true }) headingLevel: HeadingLevel; + /** Defines the layout of the component. */ + @Prop({ reflect: true }) layout: "horizontal" | "vertical" = "horizontal"; + /** Specifies the selected date as a full date object (`new Date("yyyy-mm-dd")`), or an array containing full date objects (`[new Date("yyyy-mm-dd"), new Date("yyyy-mm-dd")]`). */ @Prop({ mutable: true }) valueAsDate: Date | Date[]; @Watch("valueAsDate") valueAsDateWatcher(newValueAsDate: Date | Date[]): void { - if (this.range && Array.isArray(newValueAsDate)) { - const { activeStartDate, activeEndDate } = this; - const newActiveStartDate = newValueAsDate[0]; - const newActiveEndDate = newValueAsDate[1]; - this.activeStartDate = activeStartDate !== newActiveStartDate && newActiveStartDate; - this.activeEndDate = activeEndDate !== newActiveEndDate && newActiveEndDate; + if (this.range && Array.isArray(newValueAsDate) && !this.rangeValueChangedByUser) { + this.setActiveStartAndEndDates(); } else if (newValueAsDate && newValueAsDate !== this.activeDate) { this.activeDate = newValueAsDate as Date; } @@ -114,6 +139,9 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom @Watch("min") onMinChanged(min: string): void { this.minAsDate = dateFromISO(min); + if (this.range) { + this.setActiveStartAndEndDates(); + } } /** Specifies the latest allowed date (`"yyyy-mm-dd"`). */ @@ -122,8 +150,16 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom @Watch("max") onMaxChanged(max: string): void { this.maxAsDate = dateFromISO(max); + if (this.range) { + this.setActiveStartAndEndDates(); + } } + /** + * Specifies the monthStyle used by the component. + */ + @Prop() monthStyle: "abbreviated" | "wide" = "wide"; + /** * Specifies the Unicode numeral system used by the component for localization. This property cannot be dynamically changed. * @@ -183,7 +219,7 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom @Method() async setFocus(): Promise { await componentFocusable(this); - this.el.focus(); + focusFirstTabbable(this.el); } /** @@ -193,7 +229,7 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom @Method() async reset(): Promise { this.resetActiveDates(); - this.mostRecentRangeValue = undefined; + this.rangeValueChangedByUser = false; } // -------------------------------------------------------------------------- @@ -201,10 +237,10 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom // Lifecycle // // -------------------------------------------------------------------------- + connectedCallback(): void { connectLocalized(this); connectMessages(this); - if (Array.isArray(this.value)) { this.valueAsDate = getValueAsDateRange(this.value); } else if (this.value) { @@ -218,6 +254,7 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom if (this.max) { this.maxAsDate = dateFromISO(this.max); } + this.setActiveStartAndEndDates(); } disconnectedCallback(): void { @@ -243,39 +280,24 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom this.minAsDate, this.maxAsDate, ); - let activeDate = this.getActiveDate(date, this.minAsDate, this.maxAsDate); + const activeDate = this.getActiveDate(date, this.minAsDate, this.maxAsDate); const endDate = this.range && Array.isArray(this.valueAsDate) ? dateFromRange(this.valueAsDate[1], this.minAsDate, this.maxAsDate) : null; - const activeEndDate = this.getActiveEndDate(endDate, this.minAsDate, this.maxAsDate); - if ( - (this.activeRange === "end" || - (this.hoverRange?.focused === "end" && (!this.proximitySelectionDisabled || endDate))) && - activeEndDate - ) { - activeDate = activeEndDate; - } - if (this.range && this.mostRecentRangeValue) { - activeDate = this.mostRecentRangeValue; - } const minDate = this.range && this.activeRange ? this.activeRange === "start" ? this.minAsDate - : date || this.minAsDate + : date : this.minAsDate; - const maxDate = - this.range && this.activeRange - ? this.activeRange === "start" - ? endDate || this.maxAsDate - : this.maxAsDate - : this.maxAsDate; + const startCalendarActiveDate = this.range ? this.activeStartDate : activeDate; + return ( - - {this.renderCalendar(activeDate, maxDate, minDate, date, endDate)} + + {this.renderMonth(startCalendarActiveDate, this.maxAsDate, minDate, date, endDate)} ); } @@ -320,10 +342,10 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom @State() private localeData: DateLocaleData; - @State() private mostRecentRangeValue?: Date; - @State() startAsDate: Date; + private rangeValueChangedByUser = false; + //-------------------------------------------------------------------------- // // Private Methods @@ -336,15 +358,6 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom } }; - @Watch("value") - valueHandler(value: string | string[]): void { - if (Array.isArray(value)) { - this.valueAsDate = getValueAsDateRange(value); - } else if (value) { - this.valueAsDate = dateFromISO(value); - } - } - @Watch("effectiveLocale") private async loadLocaleData(): Promise { if (!isBrowser()) { @@ -361,40 +374,54 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom this.dateTimeFormat = getDateTimeFormat(this.effectiveLocale, DATE_PICKER_FORMAT_OPTIONS); } - monthHeaderSelectChange = (event: CustomEvent): void => { - const date = new Date(event.detail); + private monthHeaderSelectChange = ( + event: CustomEvent<{ date: Date; position: string }>, + ): void => { + const date = new Date(event.detail.date); + const position = event.detail.position; if (!this.range) { this.activeDate = date; } else { - if (this.activeRange === "end") { + if (position === "end") { this.activeEndDate = date; + this.activeStartDate = prevMonth(date); } else { this.activeStartDate = date; + this.activeEndDate = nextMonth(date); } - this.mostRecentRangeValue = date; } + event.stopPropagation(); }; - monthActiveDateChange = (event: CustomEvent): void => { + private monthActiveDateChange = (event: CustomEvent): void => { const date = new Date(event.detail); if (!this.range) { this.activeDate = date; } else { + const month = date.getMonth(); + const isDateOutOfCurrentRange = + month !== this.activeStartDate.getMonth() && + month !== nextMonth(this.activeStartDate).getMonth(); if (this.activeRange === "end") { - this.activeEndDate = date; + if (!this.activeEndDate || (this.activeStartDate && isDateOutOfCurrentRange)) { + this.activeEndDate = date; + this.activeStartDate = prevMonth(date); + } } else { - this.activeStartDate = date; + if ((this.activeStartDate && isDateOutOfCurrentRange) || !this.activeStartDate) { + this.activeStartDate = date; + this.activeEndDate = nextMonth(date); + } } - this.mostRecentRangeValue = date; } + event.stopPropagation(); }; - monthHoverChange = (event: CustomEvent): void => { + private monthHoverChange = (event: CustomEvent): void => { if (!this.range) { this.hoverRange = undefined; return; } - const { valueAsDate } = this; const start = Array.isArray(valueAsDate) && valueAsDate[0]; const end = Array.isArray(valueAsDate) && valueAsDate[1]; @@ -420,21 +447,31 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom this.hoverRange = undefined; } } else { - if (start && end) { - const startDiff = getDaysDiff(date, start); - const endDiff = getDaysDiff(date, end); - if (endDiff > 0) { + if (this.activeRange) { + if (this.activeRange === "end") { this.hoverRange.end = date; this.hoverRange.focused = "end"; - } else if (startDiff < 0) { - this.hoverRange.start = date; - this.hoverRange.focused = "start"; - } else if (startDiff > endDiff) { + } else { this.hoverRange.start = date; this.hoverRange.focused = "start"; - } else { + } + } else if (start && end) { + const startDiff = Math.abs(getDaysDiff(date, start)); + const endDiff = Math.abs(getDaysDiff(date, end)); + if (date > end) { this.hoverRange.end = date; this.hoverRange.focused = "end"; + } else if (date < start) { + this.hoverRange.start = date; + this.hoverRange.focused = "start"; + } else if (date > start && date < end) { + if (startDiff < endDiff) { + this.hoverRange.start = date; + this.hoverRange.focused = "start"; + } else { + this.hoverRange.end = date; + this.hoverRange.focused = "end"; + } } } else { if (start) { @@ -454,10 +491,11 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom event.stopPropagation(); }; - monthMouseOutChange = (): void => { + monthMouseOutChange = (event: CustomEvent): void => { if (this.hoverRange) { this.hoverRange = undefined; } + event.stopPropagation(); }; /** @@ -469,43 +507,38 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom * @param date * @param endDate */ - private renderCalendar( + private renderMonth( activeDate: Date, maxDate: Date, minDate: Date, date: Date, endDate: Date, - ) { + ): VNode { return ( - this.localeData && [ - , + this.localeData && ( , - ] + /> + ) ); } @@ -524,6 +557,7 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom this.activeEndDate = new Date(valueAsDate[1]); } } + this.hoverRange = undefined; }; private getEndDate(): Date { @@ -532,12 +566,12 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom private setEndDate(date: Date): void { const startDate = this.getStartDate(); - const newEndDate = date ? setEndOfDay(date) : date; + this.rangeValueChangedByUser = true; this.value = [dateToISO(startDate), dateToISO(date)]; this.valueAsDate = [startDate, date]; - this.mostRecentRangeValue = newEndDate; - this.calciteDatePickerRangeChange.emit(); - this.activeEndDate = date || null; + if (date) { + this.calciteDatePickerRangeChange.emit(); + } } private getStartDate(): Date { @@ -546,11 +580,10 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom private setStartDate(date: Date): void { const endDate = this.getEndDate(); + this.rangeValueChangedByUser = true; this.value = [dateToISO(date), dateToISO(endDate)]; this.valueAsDate = [date, endDate]; - this.mostRecentRangeValue = date; this.calciteDatePickerRangeChange.emit(); - this.activeStartDate = date || null; } /** @@ -597,6 +630,11 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom if (this.activeRange == "end") { this.setEndDate(date); } else { + //allows start end to go beyond end date and set the end date to empty while editing + if (date > end) { + this.setEndDate(null); + this.activeEndDate = null; + } this.setStartDate(date); } } else { @@ -614,6 +652,7 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom } } } + event.stopPropagation(); this.calciteDatePickerChange.emit(); }; @@ -625,12 +664,55 @@ export class DatePicker implements LocalizedComponent, LoadableComponent, T9nCom * @param max */ private getActiveDate(value: Date | null, min: Date | null, max: Date | null): Date { - return dateFromRange(this.activeDate, min, max) || value || dateFromRange(new Date(), min, max); + const activeDate = dateFromRange(new Date(), min, max); + + return ( + dateFromRange(this.activeDate, min, max) || + value || + (sameDate(max, activeDate) && !this.range + ? getFirstValidDateInMonth(activeDate, min, max) + : activeDate) + ); } private getActiveEndDate(value: Date | null, min: Date | null, max: Date | null): Date { return ( - dateFromRange(this.activeEndDate, min, max) || value || dateFromRange(new Date(), min, max) + dateFromRange(this.activeEndDate, min, max) || + value || + dateFromRange(nextMonth(new Date()), min, max) ); } + + private setActiveStartAndEndDates(): void { + if (this.range) { + const startDate = dateFromRange( + Array.isArray(this.valueAsDate) ? this.valueAsDate[0] : this.valueAsDate, + this.minAsDate, + this.maxAsDate, + ); + + const endDate = dateFromRange( + Array.isArray(this.valueAsDate) ? this.valueAsDate[1] : null, + this.minAsDate, + this.maxAsDate, + ); + + this.activeStartDate = this.getActiveDate(startDate, this.minAsDate, this.maxAsDate); + this.activeEndDate = this.getActiveEndDate(endDate, this.minAsDate, this.maxAsDate); + + if (sameDate(this.activeStartDate, this.activeEndDate)) { + const previousMonthActiveDate = getFirstValidDateInMonth( + prevMonth(this.activeEndDate), + this.minAsDate, + this.maxAsDate, + ); + const nextMonthActiveDate = nextMonth(this.activeEndDate); + if (inRange(previousMonthActiveDate, this.minAsDate, this.maxAsDate)) { + this.activeStartDate = previousMonthActiveDate; + } else if (inRange(nextMonthActiveDate, this.minAsDate, this.maxAsDate)) { + this.activeEndDate = nextMonthActiveDate; + } + } + } + } } diff --git a/packages/calcite-components/src/components/input-date-picker/input-date-picker.e2e.ts b/packages/calcite-components/src/components/input-date-picker/input-date-picker.e2e.ts index fc18d94e22a..fbe6b4b898a 100644 --- a/packages/calcite-components/src/components/input-date-picker/input-date-picker.e2e.ts +++ b/packages/calcite-components/src/components/input-date-picker/input-date-picker.e2e.ts @@ -13,8 +13,9 @@ import { focusable, } from "../../tests/commonTests"; import { html } from "../../../support/formatting"; +import { getFocusedElementProp, isElementFocused, skipAnimations } from "../../tests/utils"; +import { Position } from "../interfaces"; import { CSS as MONTH_HEADER_CSS } from "../date-picker-month-header/resources"; -import { getFocusedElementProp, skipAnimations } from "../../tests/utils"; import { CSS } from "./resources"; const animationDurationInMs = 200; @@ -66,12 +67,7 @@ describe("calcite-input-date-picker", () => { }); describe("disabled", () => { - disabled("calcite-input-date-picker", { - focusTarget: { - tab: "calcite-input-date-picker", - click: "calcite-input-date-picker", - }, - }); + disabled("calcite-input-date-picker"); }); describe("openClose", () => { @@ -88,64 +84,6 @@ describe("calcite-input-date-picker", () => { }); }); - async function navigateMonth(page: E2EPage, direction: "previous" | "next"): Promise { - const linkIndex = direction === "previous" ? 0 : 1; - - await page.evaluate( - async (MONTH_HEADER_CSS, linkIndex: number): Promise => - document - .querySelector("calcite-input-date-picker") - .shadowRoot.querySelector("calcite-date-picker") - .shadowRoot.querySelector("calcite-date-picker-month-header") - .shadowRoot.querySelectorAll(`.${MONTH_HEADER_CSS.chevron}`) - [linkIndex].click(), - MONTH_HEADER_CSS, - linkIndex, - ); - await page.waitForChanges(); - } - - async function selectDayInMonth(page: E2EPage, day: number): Promise { - const dayIndex = day - 1; - - await page.evaluate( - async (dayIndex: number) => - document - .querySelector("calcite-input-date-picker") - .shadowRoot.querySelector("calcite-date-picker") - .shadowRoot.querySelector("calcite-date-picker-month") - .shadowRoot.querySelectorAll("calcite-date-picker-day[current-month]") - [dayIndex].click(), - dayIndex, - ); - await page.waitForChanges(); - } - - async function getActiveMonth(page: E2EPage): Promise { - return page.evaluate( - async (MONTH_HEADER_CSS) => - document - .querySelector("calcite-input-date-picker") - .shadowRoot.querySelector("calcite-date-picker") - .shadowRoot.querySelector("calcite-date-picker-month-header") - .shadowRoot.querySelector(`.${MONTH_HEADER_CSS.month}`).textContent, - MONTH_HEADER_CSS, - ); - } - - async function getDateInputValue(page: E2EPage, type: "start" | "end" = "start"): Promise { - const inputIndex = type === "start" ? 0 : 1; - - return page.evaluate( - async (inputIndex: number): Promise => - document - .querySelector("calcite-input-date-picker") - .shadowRoot.querySelectorAll("calcite-input-text") - [inputIndex].shadowRoot.querySelector("input").value, - inputIndex, - ); - } - describe("event emitting when the value changes", () => { it("emits change event when value is committed for single date", async () => { const page = await newE2EPage(); @@ -159,13 +97,8 @@ describe("calcite-input-date-picker", () => { await input.click(); await page.waitForChanges(); await page.waitForTimeout(animationDurationInMs); - const wrapper = await page.waitForFunction( - (calendarWrapperClass: string) => - document.querySelector("calcite-input-date-picker").shadowRoot.querySelector(`.${calendarWrapperClass}`), - {}, - CSS.calendarWrapper, - ); - expect(await wrapper.isIntersectingViewport()).toBe(true); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(true); await page.keyboard.type("3/7/2020"); await page.keyboard.press("Enter"); @@ -224,21 +157,16 @@ describe("calcite-input-date-picker", () => { it("emits when value is committed for date range", async () => { const page = await newE2EPage(); await page.setContent(""); - const input = await page.find("calcite-input-date-picker"); + const inputDatePicker = await page.find("calcite-input-date-picker"); + const input = await page.find("calcite-input-date-picker >>> calcite-input-text"); const changeEvent = await page.spyOnEvent("calciteInputDatePickerChange"); await input.click(); await page.waitForChanges(); await page.waitForTimeout(animationDurationInMs); - const wrapper = await page.waitForFunction( - (calendarWrapperClass: string) => - document.querySelector("calcite-input-date-picker").shadowRoot.querySelector(`.${calendarWrapperClass}`), - {}, - CSS.calendarWrapper, - ); - - expect(await wrapper.isIntersectingViewport()).toBe(true); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(true); const inputtedStartDate = "1/1/2020"; const expectedStartDateComponentValue = "2020-01-01"; @@ -250,14 +178,15 @@ describe("calcite-input-date-picker", () => { await page.keyboard.press("Enter"); await page.waitForChanges(); - expect(await input.getProperty("value")).toEqual([expectedStartDateComponentValue, ""]); + expect(await inputDatePicker.getProperty("value")).toEqual([expectedStartDateComponentValue, ""]); expect(changeEvent).toHaveReceivedEventTimes(1); + expect(await calendar.isVisible()).toBe(true); await page.keyboard.type(inputtedEndDate); await page.keyboard.press("Enter"); await page.waitForChanges(); - expect(await input.getProperty("value")).toEqual([ + expect(await inputDatePicker.getProperty("value")).toEqual([ expectedStartDateComponentValue, expectedEndDateComponentValue, ]); @@ -276,7 +205,7 @@ describe("calcite-input-date-picker", () => { await page.keyboard.press("Enter"); await page.waitForChanges(); - expect(await input.getProperty("value")).toEqual([expectedStartDateComponentValue, ""]); + expect(await inputDatePicker.getProperty("value")).toEqual([expectedStartDateComponentValue, ""]); expect(changeEvent).toHaveReceivedEventTimes(3); }); @@ -313,7 +242,7 @@ describe("calcite-input-date-picker", () => { await inputDatePickerEl.click(); await page.waitForChanges(); - await selectDayInMonth(page, 28); + await selectDayInMonthByIndex(page, 28); await page.waitForChanges(); expect(await inputDatePickerEl.getProperty("value")).toEqual("2023-06-28"); @@ -372,25 +301,20 @@ describe("calcite-input-date-picker", () => { }); it("toggles the date picker when clicked", async () => { - let calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); - + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); expect(await calendar.isVisible()).toBe(false); await inputDatePicker.click(); await page.waitForChanges(); - calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); - expect(await calendar.isVisible()).toBe(true); await inputDatePicker.click(); await page.waitForChanges(); - calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); - expect(await calendar.isVisible()).toBe(false); }); it("toggles the date picker when using arrow down/escape key", async () => { - let calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); expect(await calendar.isVisible()).toBe(false); @@ -398,14 +322,26 @@ describe("calcite-input-date-picker", () => { await page.waitForChanges(); await page.keyboard.press("ArrowDown"); await page.waitForChanges(); - calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); - expect(await calendar.isVisible()).toBe(true); await page.keyboard.press("Escape"); await page.waitForChanges(); - calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(false); + }); + + it("toggles the date picker when using arrow up/escape key", async () => { + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + + expect(await calendar.isVisible()).toBe(false); + + await inputDatePicker.callMethod("setFocus"); + await page.waitForChanges(); + await page.keyboard.press("ArrowUp"); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + await page.keyboard.press("Escape"); + await page.waitForChanges(); expect(await calendar.isVisible()).toBe(false); }); }); @@ -419,11 +355,6 @@ describe("calcite-input-date-picker", () => { inputDatePicker = await page.find("calcite-input-date-picker"); }); - async function isCalendarVisible(calendar: E2EElement, type: "start" | "end"): Promise { - const calendarPosition = calendar.classList.contains(CSS.calendarWrapperEnd) ? "end" : "start"; - return (await calendar.isVisible()) && calendarPosition === type; - } - async function resetFocus(page: E2EPage): Promise { await page.mouse.click(0, 0); } @@ -431,15 +362,11 @@ describe("calcite-input-date-picker", () => { it("toggles the date picker when clicked", async () => { const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); - expect(await isCalendarVisible(calendar, "start")).toBe(false); - expect(await isCalendarVisible(calendar, "end")).toBe(false); + expect(await calendar.isVisible()).toBe(false); const startInput = await page.find( `calcite-input-date-picker >>> .${CSS.inputWrapper}[data-position="start"] calcite-input-text`, ); - const startInputToggle = await page.find( - `calcite-input-date-picker >>> .${CSS.inputWrapper}[data-position="start"] .${CSS.toggleIcon}`, - ); const endInput = await page.find( `calcite-input-date-picker >>> .${CSS.inputWrapper}[data-position="end"] calcite-input-text`, @@ -449,200 +376,147 @@ describe("calcite-input-date-picker", () => { ); // toggling via start date input - await resetFocus(page); await startInput.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(true); + expect(await calendar.isVisible()).toBe(true); await startInput.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(false); - - // toggling via start date toggle icon - - await resetFocus(page); - await startInputToggle.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(true); - - await startInputToggle.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(false); + expect(await calendar.isVisible()).toBe(false); // toggling via end date input - await resetFocus(page); await endInput.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(true); + expect(await calendar.isVisible()).toBe(true); await endInput.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(false); + expect(await calendar.isVisible()).toBe(false); // toggling via end date toggle icon - await resetFocus(page); await endInputToggle.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(true); + expect(await calendar.isVisible()).toBe(true); await endInputToggle.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(false); - - // toggling via start date input and toggle icon - - await resetFocus(page); - await startInput.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(true); - - await startInputToggle.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(false); - - // toggling via start toggle icon and date input - - await resetFocus(page); - await startInputToggle.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(true); - - await startInput.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(false); + expect(await calendar.isVisible()).toBe(false); // toggling via end date input and toggle icon - await resetFocus(page); await endInput.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(true); + expect(await calendar.isVisible()).toBe(true); await endInputToggle.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(false); + expect(await calendar.isVisible()).toBe(false); // toggling via end toggle icon and date input - await resetFocus(page); await endInputToggle.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(true); + expect(await calendar.isVisible()).toBe(true); await endInput.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(false); + expect(await calendar.isVisible()).toBe(false); // toggling via start date input and end toggle icon - await resetFocus(page); await startInput.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(true); + expect(await calendar.isVisible()).toBe(true); await endInputToggle.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(true); - - // toggling via start toggle icon and date input - - await resetFocus(page); - await startInputToggle.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(true); - - await endInput.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(true); - - // close - await endInput.click(); - await page.waitForChanges(); - - // toggling via end date input and start toggle icon - - await resetFocus(page); - await endInput.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(true); - - await startInputToggle.click(); - await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(true); + expect(await calendar.isVisible()).toBe(true); // toggling via end toggle icon and start date input - await resetFocus(page); await endInputToggle.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(true); + expect(await calendar.isVisible()).toBe(true); await resetFocus(page); await startInput.click(); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(true); + expect(await calendar.isVisible()).toBe(true); }); it("toggles the date picker when using arrow down/escape key", async () => { const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); - - expect(await isCalendarVisible(calendar, "start")).toBe(false); - expect(await isCalendarVisible(calendar, "end")).toBe(false); + expect(await calendar.isVisible()).toBe(false); await inputDatePicker.callMethod("setFocus"); await page.waitForChanges(); await page.keyboard.press("ArrowDown"); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(true); + expect(await calendar.isVisible()).toBe(true); await page.keyboard.press("Escape"); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "start")).toBe(false); + expect(await calendar.isVisible()).toBe(false); await page.keyboard.press("Tab"); - await page.keyboard.press("ArrowDown"); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(true); + expect(await calendar.isVisible()).toBe(true); await page.keyboard.press("Escape"); await page.waitForChanges(); - - expect(await isCalendarVisible(calendar, "end")).toBe(false); + expect(await calendar.isVisible()).toBe(false); }); }); }); + describe("close after selection", () => { + it("should close the date picker after selecting a date", async () => { + const page = await newE2EPage(); + await page.setContent(html` `); + await skipAnimations(page); + await page.waitForChanges(); + const inputDatePicker = await page.find("calcite-input-date-picker"); + + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(false); + + await inputDatePicker.click(); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await selectDayInMonthByIndex(page, 30); + expect(await calendar.isVisible()).toBe(false); + }); + + it("should close the range date picker after selecting both dates", async () => { + const page = await newE2EPage(); + await page.setContent(html` `); + await skipAnimations(page); + await page.waitForChanges(); + + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(false); + + const startInput = await page.find( + `calcite-input-date-picker >>> .${CSS.inputWrapper}[data-position="start"] calcite-input-text`, + ); + + await startInput.click(); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await selectDayInMonthByIndex(page, 30); + expect(await calendar.isVisible()).toBe(true); + + await selectDayInMonthByIndex(page, 50); + expect(await calendar.isVisible()).toBe(false); + }); + }); + describe("localization", () => { it("renders arabic numerals while typing in the input when numbering-system is set to arab", async () => { const page = await newE2EPage(); @@ -718,7 +592,7 @@ describe("calcite-input-date-picker", () => { await inputDatePicker.click(); await calciteInputDatePickerOpenEvent; - await selectDayInMonth(page, 1); + await selectDayInMonthByIndex(page, 1); await inputDatePicker.callMethod("blur"); expect(await inputDatePicker.getProperty("value")).toBe("2023-05-01"); @@ -733,7 +607,7 @@ describe("calcite-input-date-picker", () => { await inputDatePicker.click(); await calciteInputDatePickerOpenEvent; - await selectDayInMonth(page, 1); + await selectDayInMonthByIndex(page, 1); await inputDatePicker.callMethod("blur"); expect(await inputDatePicker.getProperty("value")).toBe("2023-05-01"); @@ -751,7 +625,7 @@ describe("calcite-input-date-picker", () => { await inputDatePicker.click(); await calciteInputDatePickerOpenEvent; - await selectDayInMonth(page, 1); + await selectDayInMonthByIndex(page, 1); await inputDatePicker.callMethod("blur"); expect(await inputDatePicker.getProperty("value")).toBe("2023-05-01"); @@ -770,7 +644,7 @@ describe("calcite-input-date-picker", () => { await inputDatePicker.click(); await page.waitForChanges(); - await selectDayInMonth(page, 1); + await selectDayInMonthByIndex(page, 1); expect(await inputDatePicker.getProperty("value")).toBe("2023-01-01"); }); @@ -790,7 +664,7 @@ describe("calcite-input-date-picker", () => { await inputDatePicker.click(); await page.waitForChanges(); - await selectDayInMonth(page, 7); + await selectDayInMonthByIndex(page, 7); expect(await inputDatePicker.getProperty("value")).toBe(`${year}-03-07`); expect(await getDateInputValue(page)).toEqual(`3/7/${year}`); @@ -1203,30 +1077,32 @@ describe("calcite-input-date-picker", () => { await page.waitForChanges(); const [startDatePicker, endDatePicker] = await page.findAll("calcite-input-date-picker >>> calcite-input-text"); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(false); await startDatePicker.click(); await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); await navigateMonth(page, "previous"); - await selectDayInMonth(page, 1); - - await endDatePicker.click(); - await page.waitForChanges(); + await selectDayInMonthByIndex(page, 1); + expect(await calendar.isVisible()).toBe(true); await navigateMonth(page, "previous"); - await selectDayInMonth(page, 31); + await selectDayInMonthByIndex(page, 31); + expect(await calendar.isVisible()).toBe(false); inputDatePicker.setProperty("value", ["2022-10-01", "2022-10-31"]); await page.waitForChanges(); await startDatePicker.click(); await page.waitForChanges(); - + expect(await calendar.isVisible()).toBe(true); expect(await getActiveMonth(page)).toBe("October"); await endDatePicker.click(); await page.waitForChanges(); - + expect(await calendar.isVisible()).toBe(true); expect(await getActiveMonth(page)).toBe("October"); }); @@ -1266,15 +1142,22 @@ describe("calcite-input-date-picker", () => { it("should normalize year to current century when user types the value in range", async () => { const page = await newE2EPage(); await page.setContent(""); + const inputEl = await page.find("calcite-input-date-picker >>> calcite-input-text"); const element = await page.find("calcite-input-date-picker"); const changeEvent = await page.spyOnEvent("calciteInputDatePickerChange"); - await element.click(); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(false); + + await inputEl.click(); await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + await page.keyboard.type("1/1/20"); await page.keyboard.press("Enter"); await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); expect(await element.getProperty("value")).toEqual(["2020-01-01", ""]); expect(changeEvent).toHaveReceivedEventTimes(1); @@ -1282,109 +1165,366 @@ describe("calcite-input-date-picker", () => { await page.keyboard.press("Enter"); await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); expect(await element.getProperty("value")).toEqual(["2020-01-01", "2020-02-02"]); expect(changeEvent).toHaveReceivedEventTimes(2); }); }); - describe("ArrowKeys and PageKeys", () => { - it("should be able to navigate between months using arrow keys and page keys", async () => { + describe("date-picker visibility in range", () => { + async function isCalendarVisible(page: E2EPage): Promise { + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + return await calendar.isVisible(); + } + + it("should keep date-picker open when user selects dates in range calendar", async () => { const page = await newE2EPage(); - await page.setContent(html``); - await page.waitForChanges(); + await page.setContent(html``); await skipAnimations(page); + await page.waitForChanges(); - const input = await page.find("calcite-input-date-picker >>> calcite-input-text"); - const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + const inputDatePicker = await page.find("calcite-input-date-picker"); + const startDatePicker = await page.find("calcite-input-date-picker >>> calcite-input-text"); + expect(await isCalendarVisible(page)).toBe(false); - expect(await calendar.isVisible()).toBe(false); - await input.click(); - expect(await calendar.isVisible()).toBe(true); + await startDatePicker.click(); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); - await page.keyboard.press("Tab"); + await selectDayInMonthByIndex(page, 1); await page.waitForChanges(); - await page.keyboard.press("Tab"); + expect(await isCalendarVisible(page)).toBe(true); + + await selectDayInMonthByIndex(page, 32); await page.waitForChanges(); - await page.keyboard.press("Tab"); + expect(await isCalendarVisible(page)).toBe(false); + expect(await inputDatePicker.getProperty("value")).not.toBeNull(); + }); + + it("should keep date-picker open when user select startDate from end calendar", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await skipAnimations(page); await page.waitForChanges(); - await page.keyboard.press("Tab"); + + const inputDatePicker = await page.find("calcite-input-date-picker"); + const startDatePicker = await page.find("calcite-input-date-picker >>> calcite-input-text"); + expect(await isCalendarVisible(page)).toBe(false); + + await startDatePicker.click(); await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); - await page.keyboard.press("ArrowUp"); + await selectDayInMonthByIndex(page, 35); await page.waitForChanges(); - expect(await calendar.isVisible()).toBe(true); + expect(await isCalendarVisible(page)).toBe(true); - await page.keyboard.press("PageUp"); + await selectDayInMonthByIndex(page, 52); await page.waitForChanges(); - expect(await calendar.isVisible()).toBe(true); + expect(await isCalendarVisible(page)).toBe(false); + expect(await inputDatePicker.getProperty("value")).not.toBeNull(); + }); - await page.keyboard.press("ArrowDown"); + it("should keep date-picker open when user select startDate from start calendar", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await skipAnimations(page); await page.waitForChanges(); - expect(await calendar.isVisible()).toBe(true); - await page.keyboard.press("PageDown"); + const inputDatePicker = await page.find("calcite-input-date-picker"); + const startDatePicker = await page.find("calcite-input-date-picker >>> calcite-input-text"); + expect(await isCalendarVisible(page)).toBe(false); + + await startDatePicker.click(); await page.waitForChanges(); - expect(await calendar.isVisible()).toBe(true); + expect(await isCalendarVisible(page)).toBe(true); - await page.keyboard.press("PageDown"); + await selectDayInMonthByIndex(page, 5); await page.waitForChanges(); - expect(await calendar.isVisible()).toBe(true); + expect(await isCalendarVisible(page)).toBe(true); - await page.keyboard.press("Enter"); + await selectDayInMonthByIndex(page, 22); await page.waitForChanges(); - expect(await calendar.isVisible()).toBe(false); - expect(await getActiveMonth(page)).toBe("February"); + expect(await isCalendarVisible(page)).toBe(false); + expect(await inputDatePicker.getProperty("value")).not.toBeNull(); }); - it("should be able to navigate between months using arrow keys and page keys in range", async () => { + it("should keep date-picker open when user is modifying the dates after initial selection", async () => { const page = await newE2EPage(); await page.setContent(html``); - await page.waitForChanges(); await skipAnimations(page); + await page.waitForChanges(); - await page.evaluate(() => { - const inputDatePicker = document.querySelector("calcite-input-date-picker"); - inputDatePicker.value = ["2024-01-01", "2024-02-10"]; - }); + const startDatePicker = await page.find("calcite-input-date-picker >>> calcite-input-text"); + expect(await isCalendarVisible(page)).toBe(false); - const inputDatePicker = await page.find("calcite-input-date-picker"); - const [inputStart, inputEnd] = await page.findAll("calcite-input-date-picker >>> calcite-input-text"); - const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); - expect(await calendar.isVisible()).toBe(false); + await startDatePicker.click(); + await page.waitForChanges(); - await inputStart.click(); - expect(await calendar.isVisible()).toBe(true); + await selectDayInMonthByIndex(page, 1); + await page.waitForChanges(); - await page.keyboard.press("Tab"); + await selectDayInMonthByIndex(page, 32); await page.waitForChanges(); + + await startDatePicker.click(); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await navigateMonth(page, "previous", true); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await navigateMonth(page, "previous", true); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await selectDayInMonthByIndex(page, 1); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await navigateMonth(page, "next", true); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await selectDayInMonthByIndex(page, 32); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(false); + }); + + it("should be able to navigate months when valueAsDate is parsed", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await skipAnimations(page); + await page.waitForChanges(); + + const startDatePicker = await page.find("calcite-input-date-picker >>> calcite-input-text"); + + await page.$eval("calcite-input-date-picker", (element: any) => { + element.valueAsDate = [new Date("2024-05-25"), new Date("2024-06-25")]; + }); + + expect(await isCalendarVisible(page)).toBe(false); + + await startDatePicker.click(); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await navigateMonth(page, "previous", true); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await navigateMonth(page, "previous", true); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await navigateMonth(page, "next", true); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + }); + + it("should set the endDate to empty and open the calendar when startDate is updated to date beyond initial endDate", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await skipAnimations(page); + await page.waitForChanges(); + + const inputDatePickerEl = await page.find("calcite-input-date-picker"); + const startDatePicker = await page.find("calcite-input-date-picker >>> calcite-input-text"); + inputDatePickerEl.setProperty("value", ["2024-05-25", "2024-06-20"]); + expect(await isCalendarVisible(page)).toBe(false); + + await startDatePicker.click(); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await selectDayInMonthByIndex(page, 60); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + const value = await inputDatePickerEl.getProperty("value"); + expect(value).toEqual(["2024-06-29", ""]); + }); + + it("should be able to update dates using keyboard", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await skipAnimations(page); + await page.waitForChanges(); + + const inputDatePickerEl = await page.find("calcite-input-date-picker"); + const startDatePicker = await page.find("calcite-input-date-picker >>> calcite-input-text"); + + inputDatePickerEl.setProperty("value", ["2024-05-25", "2024-06-20"]); + expect(await isCalendarVisible(page)).toBe(false); + + await startDatePicker.click(); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + await page.keyboard.press("Tab"); await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await page.keyboard.press("Enter"); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await page.keyboard.press("Enter"); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + await navigateToDateInMonth(page, true, true); + + await page.keyboard.press("Enter"); + await page.waitForChanges(); + expect(await isCalendarVisible(page)).toBe(true); + + const value = await inputDatePickerEl.getProperty("value"); + expect(value).toEqual(["2024-03-01", "2024-06-20"]); + }); + }); + + describe("hover range", () => { + it("should add range-hover attribute for dates less than new startDate and greater than current startDate or greater than new endDate and less than current startDate", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + const datePicker = await page.find("calcite-input-date-picker"); + datePicker.setProperty("value", ["2024-01-10", "2024-02-10"]); + await page.waitForChanges(); + + const input = await page.find("calcite-input-date-picker >>> calcite-input-text"); + await input.click(); + await page.waitForChanges(); + + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(true); + + let dateInsideRange = await getDayById(page, "20240201"); + await dateInsideRange.hover(); + await page.waitForChanges(); + expect(await (await getDayById(page, "20240131")).getProperty("rangeHover")).toBe(true); + + dateInsideRange = await getDayById(page, "20240205"); + await dateInsideRange.hover(); + expect(await (await getDayById(page, "20240202")).getProperty("rangeHover")).toBe(true); + + dateInsideRange = await getDayById(page, "20240105"); + await dateInsideRange.hover(); + expect(await (await getDayById(page, "20240106")).getProperty("rangeHover")).toBe(true); + }); + + it("should add range-hover attribute for dates greater current endDate and less than new endDate or greater than new endDate or less than current endDate", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + const datePicker = await page.find("calcite-input-date-picker"); + datePicker.setProperty("value", ["2024-01-10", "2024-02-10"]); + await page.waitForChanges(); + await page.keyboard.press("Tab"); await page.waitForChanges(); await page.keyboard.press("Tab"); await page.waitForChanges(); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(true); + + let dateInsideRange = await getDayById(page, "20240201"); + await dateInsideRange.hover(); + await page.waitForChanges(); + expect(await (await getDayById(page, "20240209")).getProperty("rangeHover")).toBe(true); + + dateInsideRange = await getDayById(page, "20240115"); + await dateInsideRange.hover(); + expect(await (await getDayById(page, "20240116")).getProperty("rangeHover")).toBe(true); + + let dateOutsideRange = await getDayById(page, "20240215"); + await dateOutsideRange.hover(); + expect(await (await getDayById(page, "20240212")).getProperty("rangeHover")).toBe(true); + + await navigateMonth(page, "next", true); + await page.waitForChanges(); + dateOutsideRange = await getDayById(page, "20240315"); + await dateOutsideRange.hover(); + expect(await (await getDayById(page, "20240314")).getProperty("rangeHover")).toBe(true); + }); + }); + + describe("ArrowKeys and PageKeys", () => { + it("should be able to navigate between months using arrow keys and page keys", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + await skipAnimations(page); + + const input = await page.find("calcite-input-date-picker >>> calcite-input-text"); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + + expect(await calendar.isVisible()).toBe(false); + await input.click(); + expect(await calendar.isVisible()).toBe(true); + + await navigateToDateInMonth(page, false); await page.keyboard.press("ArrowUp"); await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + await page.keyboard.press("PageUp"); await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await page.keyboard.press("PageDown"); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await page.keyboard.press("PageDown"); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + await page.keyboard.press("Enter"); await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(false); + expect(await getActiveMonth(page)).toBe("February"); + }); + + it("should be able to navigate between months using arrow keys and page keys in range", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + await skipAnimations(page); + + await page.evaluate(() => { + const inputDatePicker = document.querySelector("calcite-input-date-picker"); + inputDatePicker.value = ["2024-01-01", "2024-02-10"]; + }); + const inputDatePicker = await page.find("calcite-input-date-picker"); + const input = await page.find("calcite-input-date-picker >>> calcite-input-text"); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); expect(await calendar.isVisible()).toBe(false); - expect(await inputDatePicker.getProperty("value")).toEqual(["2023-11-25", "2024-02-10"]); - await inputEnd.click(); + await input.click(); expect(await calendar.isVisible()).toBe(true); - await page.keyboard.press("Tab"); - await page.waitForChanges(); - await page.keyboard.press("Tab"); + await navigateToDateInMonth(page); + + await page.keyboard.press("ArrowUp"); await page.waitForChanges(); - await page.keyboard.press("Tab"); + await page.keyboard.press("PageUp"); await page.waitForChanges(); - await page.keyboard.press("Tab"); + await page.keyboard.press("Enter"); await page.waitForChanges(); + + expect(await calendar.isVisible()).toBe(true); + expect(await inputDatePicker.getProperty("value")).toEqual(["2023-11-25", "2024-02-10"]); + await page.keyboard.press("ArrowDown"); await page.waitForChanges(); expect(await calendar.isVisible()).toBe(true); @@ -1399,4 +1539,324 @@ describe("calcite-input-date-picker", () => { expect(await inputDatePicker.getProperty("value")).not.toEqual(["2024-01-01", "2024-03-17"]); }); }); + + describe("last valid month", () => { + it("should not close date-picker when user navigate to last valid month", async () => { + const page = await newE2EPage(); + await page.setContent( + html``, + ); + + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(false); + + const input = await page.find("calcite-input-date-picker >>> calcite-input-text"); + await input.click(); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await navigateMonth(page, "next"); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await navigateMonth(page, "previous"); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await navigateMonth(page, "previous"); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + }); + + it("should not close date-picker when user navigate to last valid month in range", async () => { + const page = await newE2EPage(); + await page.setContent( + html``, + ); + + await page.$eval("calcite-input-date-picker", (element: HTMLCalciteInputDatePickerElement) => { + element.value = ["2024-08-15", "2024-09-15"]; + }); + + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(false); + + const input = await page.find("calcite-input-date-picker >>> calcite-input-text"); + await input.click(); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await navigateMonth(page, "next", true); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await navigateMonth(page, "previous", true); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await navigateMonth(page, "previous", true); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + }); + }); + + it("should update activeDate when user selects date from different month using keyboard", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + await skipAnimations(page); + + const inputDatePicker = await page.find("calcite-input-date-picker"); + const input = await page.find("calcite-input-date-picker >>> calcite-input-text"); + inputDatePicker.setProperty("value", ["2025-09-21", "2025-11-11"]); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + + expect(await calendar.isVisible()).toBe(false); + await input.click(); + expect(await calendar.isVisible()).toBe(true); + + await navigateToDateInMonth(page); + + await page.keyboard.press("ArrowRight"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + expect(await getActiveMonth(page)).toBe("September"); + await page.keyboard.press("Escape"); + await page.waitForChanges(); + + expect(await calendar.isVisible()).toBe(false); + await input.click(); + expect(await calendar.isVisible()).toBe(true); + await navigateToDateInMonth(page); + + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("Enter"); + await page.waitForChanges(); + + expect(await calendar.isVisible()).toBe(true); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + expect(await getActiveMonth(page)).toBe("September"); + + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + + expect(await getActiveMonth(page)).toBe("October"); + }); + + it("should not focus disabled dates when navigating using keyboard", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + await skipAnimations(page); + + const inputDatePicker = await page.find("calcite-input-date-picker"); + const [startInput, endInput] = await page.findAll("calcite-input-date-picker >>> calcite-input-text"); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + + expect(await calendar.isVisible()).toBe(false); + await startInput.click(); + expect(await calendar.isVisible()).toBe(true); + + await selectDayInMonthByIndex(page, 25); + expect(await calendar.isVisible()).toBe(true); + + await endInput.click(); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(false); + + await endInput.click(); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(true); + + await navigateToDateInMonth(page, true, true); + + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("ArrowDown"); + await page.waitForChanges(); + await page.keyboard.press("ArrowRight"); + await page.waitForChanges(); + await page.keyboard.press("ArrowRight"); + await page.waitForChanges(); + expect(await getDayById(page, "20240703")).not.toHaveAttribute("range-hover"); + + await page.keyboard.press("Enter"); + await page.waitForChanges(); + expect(await calendar.isVisible()).toBe(false); + const [, endDate] = await inputDatePicker.getProperty("value"); + expect(endDate).toEqual("2024-07-02"); + }); + + it("should not update endDate when startDate is updated", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + await skipAnimations(page); + + const inputDatePicker = await page.find("calcite-input-date-picker"); + const startInput = await page.find("calcite-input-date-picker >>> calcite-input-text"); + + await page.$eval("calcite-input-date-picker", (element: HTMLCalciteInputDatePickerElement) => { + element.valueAsDate = [new Date("09-21-2025"), new Date("11-11-2025")]; + }); + + expect(await inputDatePicker.getProperty("value")).toEqual(["2025-09-21", "2025-11-11"]); + expect(await getDateInputValue(page, "end")).toBe("11/11/2025"); + expect(await getDateInputValue(page, "start")).toBe("9/21/2025"); + + await startInput.click(); + await page.waitForChanges(); + const newStartDate = await getDayById(page, "20250925"); + await newStartDate.click(); + await page.waitForChanges(); + + expect(await inputDatePicker.getProperty("value")).toEqual(["2025-09-25", "2025-11-11"]); + expect(await getDateInputValue(page, "end")).toBe("11/11/2025"); + expect(await getDateInputValue(page, "start")).toBe("9/25/2025"); + }); + + it("should not update startDate when endDate is updated", async () => { + const page = await newE2EPage(); + await page.setContent(html``); + await page.waitForChanges(); + await skipAnimations(page); + + const inputDatePicker = await page.find("calcite-input-date-picker"); + const endInput = await page.find(`calcite-input-date-picker >>> div[data-position="end"] >>> calcite-input-text`); + await page.$eval("calcite-input-date-picker", (element: HTMLCalciteInputDatePickerElement) => { + element.valueAsDate = [new Date("09-21-2025"), new Date("11-11-2025")]; + }); + + await endInput.click(); + await page.waitForChanges(); + const newEndDate = await getDayById(page, "20251005"); + await newEndDate.click(); + await page.waitForChanges(); + + expect(await inputDatePicker.getProperty("value")).toEqual(["2025-09-21", "2025-10-05"]); + expect(await getDateInputValue(page, "end")).toBe("10/5/2025"); + expect(await getDateInputValue(page, "start")).toBe("9/21/2025"); + }); + + it("should not shift focus back on input-date-picker when other input elements are clicked", async () => { + const page = await newE2EPage(); + await page.setContent( + html` + `, + ); + + const input = await page.find("calcite-input"); + const inputDatePicker = await page.find("calcite-input-date-picker"); + const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`); + expect(await calendar.isVisible()).toBe(false); + + await inputDatePicker.click(); + expect(await calendar.isVisible()).toBe(true); + expect(await isElementFocused(page, "#input-date")).toBe(true); + + await input.click(); + expect(await calendar.isVisible()).toBe(false); + expect(await isElementFocused(page, "#input")).toBe(true); + }); }); + +async function selectDayInMonthByIndex(page: E2EPage, day: number): Promise { + const dayIndex = day - 1; + const days = await page.findAll("calcite-input-date-picker >>> calcite-date-picker-day[current-month]"); + await days[dayIndex].click(); + await page.waitForChanges(); +} + +async function getActiveMonth(page: E2EPage, position: Extract<"start" | "end", Position> = "start"): Promise { + const [startMonth, endMonth] = await page.findAll( + `calcite-input-date-picker >>> calcite-date-picker-month-header >>> .${MONTH_HEADER_CSS.header} >>> calcite-select.${MONTH_HEADER_CSS.monthPicker}`, + ); + + const selectedMonth = + position === "start" + ? await startMonth.find("calcite-option[selected]") + : await endMonth.find("calcite-option[selected]"); + return selectedMonth.textContent; +} + +async function getDateInputValue(page: E2EPage, type: "start" | "end" = "start"): Promise { + const inputIndex = type === "start" ? 0 : 1; + + return page.evaluate( + async (inputIndex: number): Promise => + document + .querySelector("calcite-input-date-picker") + .shadowRoot.querySelectorAll("calcite-input-text") + [inputIndex].shadowRoot.querySelector("input").value, + inputIndex, + ); +} + +async function navigateMonth(page: E2EPage, direction: "previous" | "next", range = false): Promise { + const [datePickerMonthHeaderStart, datePickerMonthHeaderEnd] = await page.findAll( + `calcite-input-date-picker >>> calcite-date-picker-month-header >>> .${MONTH_HEADER_CSS.header}`, + ); + + let prevMonth: E2EElement; + let nextMonth: E2EElement; + if (range) { + prevMonth = await datePickerMonthHeaderStart.find("calcite-action"); + nextMonth = await datePickerMonthHeaderEnd.find("calcite-action"); + } else { + [prevMonth, nextMonth] = await datePickerMonthHeaderStart.findAll("calcite-action"); + } + + await (direction === "previous" ? prevMonth.click() : nextMonth.click()); + await page.waitForChanges(); +} + +async function getDayById(page: E2EPage, id: string): Promise { + return await page.find( + `calcite-input-date-picker >>> calcite-date-picker >>> calcite-date-picker-month >>> calcite-date-picker-day[current-month][id="${id}"]`, + ); +} + +async function navigateToDateInMonth( + page: E2EPage, + isRange = true, + isPreviousMonthChevronDisabled = false, +): Promise { + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + await page.keyboard.press("Tab"); + await page.waitForChanges(); + if (!isPreviousMonthChevronDisabled) { + await page.keyboard.press("Tab"); + await page.waitForChanges(); + } + if (!isRange) { + await page.keyboard.press("Tab"); + await page.waitForChanges(); + } +} diff --git a/packages/calcite-components/src/components/input-date-picker/input-date-picker.scss b/packages/calcite-components/src/components/input-date-picker/input-date-picker.scss index 68629ade246..fddda1133a5 100644 --- a/packages/calcite-components/src/components/input-date-picker/input-date-picker.scss +++ b/packages/calcite-components/src/components/input-date-picker/input-date-picker.scss @@ -48,6 +48,9 @@ .chevron-icon { color: var(--calcite-color-text-1); } + ~ .input-wrapper .chevron-icon { + color: var(--calcite-color-text-1); + } } } @@ -59,25 +62,43 @@ } :host([range]) { - .input-container { + .container { @apply flex; } + .input-container { + @apply flex flex-auto; + } + .input-wrapper { @apply flex-auto; } +} - .horizontal-arrow-container { - @apply bg-background - border-color-input - flex - items-center - border - border-l-0 - border-r-0 - border-solid - py-0 - px-1; +.divider-container { + @apply flex items-stretch border-color-input + border + border-l-0 + border-r-0 + border-solid; + background-color: var(--calcite-color-foreground-1); +} + +:host([layout="horizontal"]) .divider-container { + @apply w-px; +} + +.divider { + @apply inline-block w-px; + margin-block: var(--calcite-size-xxs); + background-color: var(--calcite-color-border-2); +} + +:host([layout="vertical"]) .divider-container { + @apply w-full h-px border-t-0 border-b-0 border-l border-r-0; + padding-inline: var(--calcite-size-md); + & .divider { + @apply w-full h-px my-0; } } @@ -87,22 +108,7 @@ } .input-container { - @apply flex-col - items-start; - } - - .calendar-wrapper--end { - transform: translate3d(0, 0, 0); - } - - .vertical-arrow-container { - inset-block-start: theme("spacing.6"); - @apply bg-foreground-1 - absolute - z-default - mx-px - px-2.5; - inset-inline-start: 0; + @apply flex-col items-start; } } @@ -127,25 +133,43 @@ @apply mt-0; } -:host([range][layout="vertical"][scale="m"]) .vertical-arrow-container { - inset-block-start: theme("spacing.6"); - padding-inline-start: theme("spacing.3"); +.vertical-chevron-container { + @apply flex items-center border border-solid border-color-input border-l-0; + padding-inline: var(--calcite-size-md); + background-color: var(--calcite-color-foreground-1); calcite-icon { - @apply h-3 - w-3 - min-w-0; + color: var(--calcite-color-text-3); + + &:hover { + color: var(--calcite-color-text-1); + } + } +} + +:host([range][layout="vertical"][scale="s"]) { + .vertical-chevron-container, + .divider-container { + padding-inline: var(--calcite-size-sm); } } -:host([range][layout="vertical"][scale="l"]) .vertical-arrow-container { - inset-block-start: theme("spacing.9"); - @apply px-3.5; +:host([range][layout="vertical"][scale="l"]) { + .vertical-chevron-container, + .divider-container { + padding-inline: var(--calcite-size-lg); + } } -:host([range][layout="vertical"][open]) { - .vertical-arrow-container { - @apply hidden; +.container { + &:focus-within, + &:active, + &:hover { + .vertical-chevron-container { + calcite-icon { + color: var(--calcite-color-text-1); + } + } } } diff --git a/packages/calcite-components/src/components/input-date-picker/input-date-picker.stories.ts b/packages/calcite-components/src/components/input-date-picker/input-date-picker.stories.ts index d88f117b2e9..891bfc0557f 100644 --- a/packages/calcite-components/src/components/input-date-picker/input-date-picker.stories.ts +++ b/packages/calcite-components/src/components/input-date-picker/input-date-picker.stories.ts @@ -1,4 +1,4 @@ -import { createBreakpointStories, modesDarkDefault } from "../../../.storybook/utils"; +import { boolean, createBreakpointStories, modesDarkDefault } from "../../../.storybook/utils"; import { html } from "../../../support/formatting"; import { locales, defaultLocale } from "../../utils/locale"; import { defaultMenuPlacement, menuPlacements } from "../../utils/floating-ui"; @@ -53,23 +53,47 @@ export default { }; export const simple = (args: InputDatePickerStoryArgs): string => html` -
+ +
`; -export const range = (): string => html` -
+export const withMinMax = (): string => + html` +
+ +
`; + +export const rangeWithMinMax = (): string => html` + +
html` prev-month-label="Previous month" range layout="horizontal" + open >
`; @@ -106,8 +131,14 @@ export const flipPlacements_TestOnly = (): string => html` `; -export const mediumIconForLargeInput_TestOnly = (): string => html` -
+export const chineseLang_TestOnly = (): string => html` + +
html` `; export const readOnlyHasNoDropdownAffordance_TestOnly = (): string => html` -
- -
+ `; export const validationMessageAllScales_TestOnly = (): string => html` @@ -216,15 +245,22 @@ export const scales_TestOnly = (): string => html` `; export const arabicLocaleDarkModeRTL_TestOnly = (): string => html` -
+ +
`; arabicLocaleDarkModeRTL_TestOnly.parameters = { themes: modesDarkDefault }; @@ -234,6 +270,62 @@ export const widthSetToBreakpoints_TestOnly = (): string => html``, ); +export const rangeWithValueAsDate = (): string => html` + +
+ +
+ +`; + +export const rangeWithValue = (): string => html` + +
+ +
+ +`; + +export const rangeWithMinAfterCurrentDate = (): string => html` + +
+ +
+`; + +export const rangeWithMaxBeforeCurrentDate = (): string => html` + +
+ +
+`; + export const Focus = (): string => html` `; -Focus.parameters = { - chromatic: { delay: 2000 }, -}; - export const localeFormatting = (): string => html` -
- - -
+ + `; diff --git a/packages/calcite-components/src/components/input-date-picker/input-date-picker.tsx b/packages/calcite-components/src/components/input-date-picker/input-date-picker.tsx index 101a129d177..fbabd1f6a1c 100644 --- a/packages/calcite-components/src/components/input-date-picker/input-date-picker.tsx +++ b/packages/calcite-components/src/components/input-date-picker/input-date-picker.tsx @@ -5,7 +5,6 @@ import { EventEmitter, h, Host, - Listen, Method, Prop, State, @@ -186,12 +185,12 @@ export class InputDatePicker } @Watch("valueAsDate") - valueAsDateWatcher(valueAsDate: Date): void { - this.datePickerActiveDate = valueAsDate; - const newValue = - this.range && Array.isArray(valueAsDate) - ? [dateToISO(valueAsDate[0]), dateToISO(valueAsDate[1])] - : dateToISO(valueAsDate); + valueAsDateWatcher(valueAsDate: Date | Date[]): void { + const newValue = Array.isArray(valueAsDate) + ? [dateToISO(valueAsDate[0]), dateToISO(valueAsDate[1])] + : dateToISO(valueAsDate); + this.datePickerActiveDate = Array.isArray(valueAsDate) ? valueAsDate[0] : valueAsDate; + if (this.value !== newValue) { this.valueAsDateChangedExternally = true; this.value = newValue; @@ -259,6 +258,11 @@ export class InputDatePicker this.maxAsDate = dateFromISO(max); } + /** + * Specifies the monthStyle used by the component. + */ + @Prop() monthStyle: "abbreviated" | "wide" = "wide"; + /** When `true`, displays the `calcite-date-picker` component. */ @Prop({ mutable: true, reflect: true }) open = false; @@ -363,15 +367,6 @@ export class InputDatePicker // //-------------------------------------------------------------------------- - @Listen("calciteDaySelect") - calciteDaySelectHandler(): void { - if (this.shouldFocusRangeStart() || this.shouldFocusRangeEnd()) { - return; - } - - this.open = false; - } - private calciteInternalInputInputHandler = (event: CustomEvent): void => { const target = event.target as HTMLCalciteInputElement; const value = target.value; @@ -469,7 +464,6 @@ export class InputDatePicker connectedCallback(): void { connectLocalized(this); - this.handleDateTimeFormatChange(); const { open } = this; open && this.openHandler(); @@ -558,135 +552,139 @@ export class InputDatePicker {this.localeData && ( -
-
- - {!this.readOnly && - this.renderToggleIcon(this.open && this.focusedInput === "start")} - -
- - - {this.range && this.layout === "horizontal" && ( -
- -
- )} - {this.range && this.layout === "vertical" && this.scale !== "s" && ( -
- -
- )} - {this.range && ( +
+
{!this.readOnly && - this.renderToggleIcon(this.open && this.focusedInput === "end")} + !this.range && + this.renderToggleIcon(this.open && this.focusedInput === "start")} + +
+ + {this.range && ( +
+
+
+ )} + {this.range && ( +
+ + {!this.readOnly && + this.layout === "horizontal" && + this.renderToggleIcon(this.open)} +
+ )} +
+ {this.range && this.layout === "vertical" && ( +
+
)}
@@ -792,12 +790,13 @@ export class InputDatePicker private userChangedValue = false; + private rangeStartValueChangedByUser = false; + openTransitionProp = "opacity"; transitionEl: HTMLDivElement; @Watch("layout") - @Watch("focusedInput") setReferenceEl(): void { const { focusedInput, layout, endWrapper, startWrapper } = this; @@ -879,7 +878,6 @@ export class InputDatePicker onClose(): void { this.calciteInputDatePickerClose.emit(); deactivateFocusTrap(this); - this.restoreInputFocus(); this.focusOnOpen = false; this.datePickerEl.reset(); } @@ -950,6 +948,10 @@ export class InputDatePicker return; } + const targeHasSelect = event + .composedPath() + .some((el: HTMLElement) => el.tagName === "CALCITE-SELECT"); + if (key === "Enter") { event.preventDefault(); this.commitValue(); @@ -961,12 +963,16 @@ export class InputDatePicker } if (submitForm(this)) { - this.restoreInputFocus(); + this.restoreInputFocus(true); } - } else if (key === "ArrowDown") { + } else if ((key === "ArrowDown" || key === "ArrowUp") && !targeHasSelect) { this.open = true; this.focusOnOpen = true; event.preventDefault(); + } else if (key === "Escape") { + this.open = false; + event.preventDefault(); + this.restoreInputFocus(true); } }; @@ -1064,14 +1070,26 @@ export class InputDatePicker this.restoreInputFocus(); }; - private restoreInputFocus(): void { + private restoreInputFocus(isDatePickerClosed = false): void { if (!this.range) { this.startInput.setFocus(); + this.open = false; return; } - const focusedInput = this.focusedInput === "start" ? this.startInput : this.endInput; - focusedInput.setFocus(); + if (isDatePickerClosed) { + this.focusInput(); + return; + } + + this.rangeStartValueChangedByUser = this.focusedInput === "start"; + this.focusedInput = "end"; + + if (this.shouldFocusRangeStart() || this.rangeStartValueChangedByUser) { + return; + } + this.open = false; + this.focusInput(); } private localizeInputValues(): void { @@ -1217,4 +1235,9 @@ export class InputDatePicker const normalizedYear = normalizeToCurrentCentury(Number(year)); return `${normalizedYear}-${month}-${day}`; } + + private focusInput = (): void => { + const focusedInput = this.focusedInput === "start" ? this.startInput : this.endInput; + focusedInput.setFocus(); + }; } diff --git a/packages/calcite-components/src/components/input-date-picker/resources.ts b/packages/calcite-components/src/components/input-date-picker/resources.ts index 19a65e77795..d06ed9c58df 100644 --- a/packages/calcite-components/src/components/input-date-picker/resources.ts +++ b/packages/calcite-components/src/components/input-date-picker/resources.ts @@ -1,17 +1,22 @@ export const CSS = { assistiveText: "assistive-text", calendarWrapper: "calendar-wrapper", - calendarWrapperEnd: "calendar-wrapper--end", + container: "container", + dividerContainer: "divider-container", + divider: "divider", horizontalArrowContainer: "horizontal-arrow-container", inputBorderTopColorOne: "border-top-color-one", inputContainer: "input-container", - inputNoBottomBorder: "no-bottom-border", + inputNoBottomBorder: "input--no-bottom-border", + inputNoRightBorder: "input--no-right-border", + inputNoTopBorder: "input--no-top-border", + inputNoLeftBorder: "input--no-left-border", inputWrapper: "input-wrapper", input: "input", menu: "menu-container", menuActive: "menu-container--active", toggleIcon: "toggle-icon", - verticalArrowContainer: "vertical-arrow-container", + verticalChevronContainer: "vertical-chevron-container", chevronIcon: "chevron-icon", }; diff --git a/packages/calcite-components/src/components/input-text/input-text.scss b/packages/calcite-components/src/components/input-text/input-text.scss index b1bdab1fc5e..e5ad6e46e1a 100755 --- a/packages/calcite-components/src/components/input-text/input-text.scss +++ b/packages/calcite-components/src/components/input-text/input-text.scss @@ -329,10 +329,22 @@ input[type="text"]::-ms-reveal { items-center; } -:host(.no-bottom-border) input { +:host(.input--no-bottom-border) input { @apply border-b-0; } +:host(.input--no-top-border) input { + @apply border-t-0; +} + +:host(.input--no-right-border) input { + border-inline-end: 0; +} + +:host(.input--no-left-border) input { + border-inline-start: 0; +} + :host(.border-top-color-one) input { @apply border-t-color-1; } diff --git a/packages/calcite-components/src/components/select/select.scss b/packages/calcite-components/src/components/select/select.scss index ba951fb35eb..e77d5cf925a 100644 --- a/packages/calcite-components/src/components/select/select.scss +++ b/packages/calcite-components/src/components/select/select.scss @@ -5,17 +5,20 @@ * * @prop --calcite-select-font-size: The font size of `calcite-option`s in the component. * @prop --calcite-select-spacing: The padding around the selected option text. + * @prop --calcite-select-text-color: The text color of the component. */ :host { @extend %component-spacing; @apply flex flex-col; + font-size: var(--calcite-select-font-size); + font-weight: var(--calcite-internal-select-font-weight, var(--calcite-font-weight-regular)); } .wrapper { @apply relative flex items-stretch; inline-size: var(--select-width); - + block-size: var(--calcite-internal-select-block-size, #{$calcite-size-32}); &:focus-within, &:active, &:hover { @@ -30,40 +33,21 @@ :host([scale="s"]) { --calcite-select-font-size: theme("fontSize.n2h"); --calcite-select-spacing-inline: theme("spacing.2") theme("spacing.8"); - - .wrapper { - @apply h-6; - } - - .icon-container { - @apply px-2; - } + --calcite-internal-select-icon-container-padding-inline: var(--calcite-size-sm); + --calcite-internal-select-block-size: #{$calcite-size-24}; } :host([scale="m"]) { --calcite-select-font-size: theme("fontSize.n1h"); --calcite-select-spacing-inline: theme("spacing.3") theme("spacing.10"); - - .wrapper { - @apply h-8; - } - - .icon-container { - @apply px-3; - } + --calcite-internal-select-icon-container-padding-inline: var(--calcite-size-md); } :host([scale="l"]) { --calcite-select-font-size: theme("fontSize.0h"); --calcite-select-spacing-inline: theme("spacing.4") theme("spacing.12"); - - .wrapper { - block-size: 44px; - } - - .icon-container { - @apply px-4; - } + --calcite-internal-select-icon-container-padding-inline: var(--calcite-size-lg); + --calcite-internal-select-block-size: #{$calcite-size-44}; } :host([width="auto"]) { @@ -79,11 +63,27 @@ } .select { - @apply bg-foreground-1 border-color-input text-color-2 font-inherit focus-base m-0 box-border w-full cursor-pointer appearance-none truncate rounded-none border border-solid; - font-size: var(--calcite-select-font-size); + @apply bg-foreground-1 + border-color-input + text-color-2 + font-inherit + focus-base + m-0 + box-border + w-full + cursor-pointer + appearance-none + truncate + rounded-none + border-solid; + font-size: inherit; + font-weight: inherit; + color: var(--calcite-select-text-color, var(--calcite-color-text-2)); + border-width: var(--calcite-select-internal-border-width, var(--calcite-border-width-sm)); padding-inline: var(--calcite-select-spacing-inline); + padding-block: var(--calcite-internal-select-spacing-block); border-inline-end-width: theme("borderWidth.0"); - + line-height: var(--calcite-select-line-height, normal); &:focus { @apply focus-inset; } @@ -97,8 +97,9 @@ select:disabled { .icon-container { @apply border-color-input text-color-2 pointer-events-none absolute inset-y-0 flex items-center border-0 border-solid bg-transparent; inset-inline-end: theme("inset.0"); - border-inline-width: theme("borderWidth.0") theme("borderWidth.DEFAULT"); - + border-inline-width: theme("borderWidth.0") + var(--calcite-select-internal-icon-border-inline-end-width, theme("borderWidth.DEFAULT")); + padding-inline: var(--calcite-internal-select-icon-container-padding-inline); .icon { color: var(--calcite-color-text-3); } diff --git a/packages/calcite-components/src/utils/date.spec.ts b/packages/calcite-components/src/utils/date.spec.ts index f651fd3c8b4..7665ef83544 100644 --- a/packages/calcite-components/src/utils/date.spec.ts +++ b/packages/calcite-components/src/utils/date.spec.ts @@ -4,12 +4,15 @@ import english from "../components/date-picker/assets/date-picker/nls/en.json"; import french from "../components/date-picker/assets/date-picker/nls/fr.json"; import korean from "../components/date-picker/assets/date-picker/nls/ko.json"; import { + getDateInMonth, dateFromISO, dateFromRange, datePartsFromISO, dateToISO, formatCalendarYear, + getFirstValidDateInMonth, getOrder, + hasSameMonthAndYear, inRange, nextMonth, parseCalendarYear, @@ -257,3 +260,27 @@ describe("datePartsFromISO", () => { expect(datePartsFromISO("00-08-01")).toEqual({ day: "01", month: "08", year: "00" }); }); }); + +describe("getDateInMonth", () => { + it("return date in specified month", () => { + expect(getDateInMonth(new Date(2020, 0, 1), 4)).toEqual(new Date(2020, 4, 1)); + expect(getDateInMonth(new Date(2020, 0, 1), 12)).toEqual(new Date(2021, 0, 1)); + }); +}); + +describe("getFirstValidDateInMonth", () => { + it("return first valid date in month", () => { + const min = new Date(2020, 0, 1); + const max = new Date(2020, 11, 31); + expect(getFirstValidDateInMonth(new Date(2020, 4, 1), min, max)).toEqual(new Date(2020, 4, 1)); + expect(getFirstValidDateInMonth(new Date(2021, 0, 1), min, max)).toEqual(new Date(2020, 11, 31)); + }); +}); + +describe("hasSameMonthAndYear", () => { + it("return true if two dates have same month & year", () => { + expect(hasSameMonthAndYear(new Date(2020, 4, 1), new Date(2020, 4, 22))).toEqual(true); + expect(hasSameMonthAndYear(new Date(2020, 0, 1), new Date(2019, 12, 1))).toEqual(true); + expect(hasSameMonthAndYear(new Date(2020, 1, 1), new Date(2020, 2, 1))).toEqual(false); + }); +}); diff --git a/packages/calcite-components/src/utils/date.ts b/packages/calcite-components/src/utils/date.ts index 9e5deb70d17..2cf231d670a 100644 --- a/packages/calcite-components/src/utils/date.ts +++ b/packages/calcite-components/src/utils/date.ts @@ -202,6 +202,31 @@ export function prevMonth(date: Date): Date { return nextDate; } +/** + * Get active date in a given month. + * + * @param date + * @param month + */ +export function getDateInMonth(date: Date, month: number): Date { + const nextDate = new Date(date); + nextDate.setMonth(month); + return nextDate; +} + +/** + * Get First Valid date in a month. + * + * @param date + * @param min + * @param max + */ +export function getFirstValidDateInMonth(date: Date, min: Date, max: Date): Date { + const newDate = new Date(date); + newDate.setDate(1); + return inRange(newDate, min, max) ? newDate : dateFromRange(newDate, min, max); +} + /** * Get a date one month in the future * @@ -273,3 +298,15 @@ export function setEndOfDay(date: Date): Date { date.setHours(23, 59, 59, 999); return date; } + +/** + * + * Returns true if two dates have same month and year. + * + * @param date1 + * @param date2 + * @returns {boolean} + */ +export function hasSameMonthAndYear(date1: Date, date2: Date): boolean { + return date1 && date2 && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear(); +} From 274cffddd311829be9f7b2d0e1a8ebdad5125cc3 Mon Sep 17 00:00:00 2001 From: Ashley Rowles <157734991+arowles@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:18:34 -0700 Subject: [PATCH 07/17] feat: add buffer point, buffer polygon, buffer polyline, contour, offset (#10594) **Related Issue:** # ## Summary **added** buffer-point-16 buffer-point-24 buffer-point-32 buffer-polygon-16 buffer-polygon-24 buffer-polygon-32 buffer-polyline-16 buffer-polyline-24 buffer-polyline-32 contour-16 contour-24 contour-32 offset-16 offset-24 offset-32 ![image](https://github.com/user-attachments/assets/d8da7b20-bf6f-4f4c-9ca3-12d0f8ebbc4a) --- packages/calcite-ui-icons/docs/keywords.json | 98 +++++++++++++++++++ .../icons/buffer-point-16.svg | 1 + .../icons/buffer-point-24.svg | 1 + .../icons/buffer-point-32.svg | 1 + .../icons/buffer-polygon-16.svg | 1 + .../icons/buffer-polygon-24.svg | 1 + .../icons/buffer-polygon-32.svg | 1 + .../icons/buffer-polyline-16.svg | 1 + .../icons/buffer-polyline-24.svg | 1 + .../icons/buffer-polyline-32.svg | 1 + .../calcite-ui-icons/icons/contour-16.svg | 1 + .../calcite-ui-icons/icons/contour-24.svg | 1 + .../calcite-ui-icons/icons/contour-32.svg | 1 + packages/calcite-ui-icons/icons/offset-16.svg | 1 + packages/calcite-ui-icons/icons/offset-24.svg | 1 + packages/calcite-ui-icons/icons/offset-32.svg | 1 + 16 files changed, 113 insertions(+) create mode 100755 packages/calcite-ui-icons/icons/buffer-point-16.svg create mode 100755 packages/calcite-ui-icons/icons/buffer-point-24.svg create mode 100755 packages/calcite-ui-icons/icons/buffer-point-32.svg create mode 100755 packages/calcite-ui-icons/icons/buffer-polygon-16.svg create mode 100755 packages/calcite-ui-icons/icons/buffer-polygon-24.svg create mode 100755 packages/calcite-ui-icons/icons/buffer-polygon-32.svg create mode 100755 packages/calcite-ui-icons/icons/buffer-polyline-16.svg create mode 100755 packages/calcite-ui-icons/icons/buffer-polyline-24.svg create mode 100755 packages/calcite-ui-icons/icons/buffer-polyline-32.svg create mode 100755 packages/calcite-ui-icons/icons/contour-16.svg create mode 100755 packages/calcite-ui-icons/icons/contour-24.svg create mode 100755 packages/calcite-ui-icons/icons/contour-32.svg create mode 100755 packages/calcite-ui-icons/icons/offset-16.svg create mode 100755 packages/calcite-ui-icons/icons/offset-24.svg create mode 100755 packages/calcite-ui-icons/icons/offset-32.svg diff --git a/packages/calcite-ui-icons/docs/keywords.json b/packages/calcite-ui-icons/docs/keywords.json index 85e5a843081..8a9ddf7d1a5 100644 --- a/packages/calcite-ui-icons/docs/keywords.json +++ b/packages/calcite-ui-icons/docs/keywords.json @@ -9067,5 +9067,103 @@ ], "category": "Generic", "release": "3.33.0" + }, + "buffer-point": { + "alias": [ + "3.33.0", + "gis", + "point", + "dot", + "circles", + "area", + "location", + "cushion", + "shield", + "shock", + "range", + "space", + "expanse", + "sphere", + "round" + ], + "category": "GIS", + "release": "3.33.0" + }, + "buffer-polygon": { + "alias": [ + "3.33.0", + "gis", + "selection", + "shape", + "area", + "location", + "cushion", + "shield", + "shock", + "range", + "space", + "expanse", + "offset" + ], + "category": "GIS", + "release": "3.33.0" + }, + "contour": { + "alias": [ + "3.33.0", + "gis", + "contour map", + "topographic", + "relief map", + "lines", + "height", + "curve", + "deliniation", + "outline", + "profile" + ], + "category": "GIS", + "release": "3.33.0" + }, + "offset": { + "alias": [ + "3.33.0", + "gis", + "dashed", + "expand", + "line", + "area", + "location", + "cushion", + "shield", + "shock", + "range", + "space", + "expanse", + "intersection", + "outline" + ], + "category": "GIS", + "release": "3.33.0" + }, + "buffer-polyline": { + "alias": [ + "3.33.0", + "gis", + "line", + "area", + "location", + "cushion", + "shield", + "shock", + "range", + "space", + "expanse", + "intersection", + "offset", + "outline" + ], + "category": "GIS", + "release": "3.33.0" } } diff --git a/packages/calcite-ui-icons/icons/buffer-point-16.svg b/packages/calcite-ui-icons/icons/buffer-point-16.svg new file mode 100755 index 00000000000..054570816e3 --- /dev/null +++ b/packages/calcite-ui-icons/icons/buffer-point-16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/buffer-point-24.svg b/packages/calcite-ui-icons/icons/buffer-point-24.svg new file mode 100755 index 00000000000..772dab27b7c --- /dev/null +++ b/packages/calcite-ui-icons/icons/buffer-point-24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/buffer-point-32.svg b/packages/calcite-ui-icons/icons/buffer-point-32.svg new file mode 100755 index 00000000000..83e023012c4 --- /dev/null +++ b/packages/calcite-ui-icons/icons/buffer-point-32.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/buffer-polygon-16.svg b/packages/calcite-ui-icons/icons/buffer-polygon-16.svg new file mode 100755 index 00000000000..6d736757c08 --- /dev/null +++ b/packages/calcite-ui-icons/icons/buffer-polygon-16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/buffer-polygon-24.svg b/packages/calcite-ui-icons/icons/buffer-polygon-24.svg new file mode 100755 index 00000000000..90aa0c4debc --- /dev/null +++ b/packages/calcite-ui-icons/icons/buffer-polygon-24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/buffer-polygon-32.svg b/packages/calcite-ui-icons/icons/buffer-polygon-32.svg new file mode 100755 index 00000000000..3d3fef49af0 --- /dev/null +++ b/packages/calcite-ui-icons/icons/buffer-polygon-32.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/buffer-polyline-16.svg b/packages/calcite-ui-icons/icons/buffer-polyline-16.svg new file mode 100755 index 00000000000..972ac16edf5 --- /dev/null +++ b/packages/calcite-ui-icons/icons/buffer-polyline-16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/buffer-polyline-24.svg b/packages/calcite-ui-icons/icons/buffer-polyline-24.svg new file mode 100755 index 00000000000..9d3e7df4a1c --- /dev/null +++ b/packages/calcite-ui-icons/icons/buffer-polyline-24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/buffer-polyline-32.svg b/packages/calcite-ui-icons/icons/buffer-polyline-32.svg new file mode 100755 index 00000000000..fa57f3e07cb --- /dev/null +++ b/packages/calcite-ui-icons/icons/buffer-polyline-32.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/contour-16.svg b/packages/calcite-ui-icons/icons/contour-16.svg new file mode 100755 index 00000000000..d939c03b6b6 --- /dev/null +++ b/packages/calcite-ui-icons/icons/contour-16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/contour-24.svg b/packages/calcite-ui-icons/icons/contour-24.svg new file mode 100755 index 00000000000..b2a301cdb82 --- /dev/null +++ b/packages/calcite-ui-icons/icons/contour-24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/contour-32.svg b/packages/calcite-ui-icons/icons/contour-32.svg new file mode 100755 index 00000000000..b783a069975 --- /dev/null +++ b/packages/calcite-ui-icons/icons/contour-32.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/offset-16.svg b/packages/calcite-ui-icons/icons/offset-16.svg new file mode 100755 index 00000000000..1c73d229cfb --- /dev/null +++ b/packages/calcite-ui-icons/icons/offset-16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/offset-24.svg b/packages/calcite-ui-icons/icons/offset-24.svg new file mode 100755 index 00000000000..9902979d7eb --- /dev/null +++ b/packages/calcite-ui-icons/icons/offset-24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/offset-32.svg b/packages/calcite-ui-icons/icons/offset-32.svg new file mode 100755 index 00000000000..7e380dbb826 --- /dev/null +++ b/packages/calcite-ui-icons/icons/offset-32.svg @@ -0,0 +1 @@ + \ No newline at end of file From 69fa13e60c7bf69a10140b3ed120f21773661edd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 23 Oct 2024 21:24:59 +0000 Subject: [PATCH 08/17] chore: release next --- package-lock.json | 14 +++++++------- .../projects/component-library/CHANGELOG.md | 4 ++++ .../projects/component-library/package.json | 4 ++-- packages/calcite-components-react/CHANGELOG.md | 4 ++++ packages/calcite-components-react/package.json | 4 ++-- packages/calcite-components/CHANGELOG.md | 6 ++++++ packages/calcite-components/package.json | 4 ++-- packages/calcite-ui-icons/CHANGELOG.md | 6 ++++++ packages/calcite-ui-icons/package.json | 2 +- 9 files changed, 34 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd698fb8313..88213605ebb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35334,10 +35334,10 @@ }, "packages/calcite-components": { "name": "@esri/calcite-components", - "version": "2.14.0-next.16", + "version": "2.14.0-next.17", "license": "SEE LICENSE.md", "dependencies": { - "@esri/calcite-ui-icons": "3.33.0-next.4", + "@esri/calcite-ui-icons": "3.33.0-next.5", "@floating-ui/dom": "1.6.11", "@stencil/core": "4.20.0", "@types/color": "3.0.6", @@ -39035,10 +39035,10 @@ }, "packages/calcite-components-angular/projects/component-library": { "name": "@esri/calcite-components-angular", - "version": "2.14.0-next.16", + "version": "2.14.0-next.17", "license": "SEE LICENSE.md", "dependencies": { - "@esri/calcite-components": "2.14.0-next.16", + "@esri/calcite-components": "2.14.0-next.17", "tslib": "2.6.3" }, "peerDependencies": { @@ -39048,10 +39048,10 @@ }, "packages/calcite-components-react": { "name": "@esri/calcite-components-react", - "version": "2.14.0-next.16", + "version": "2.14.0-next.17", "license": "SEE LICENSE.md", "dependencies": { - "@esri/calcite-components": "2.14.0-next.16" + "@esri/calcite-components": "2.14.0-next.17" }, "peerDependencies": { "react": ">=16.7", @@ -39486,7 +39486,7 @@ }, "packages/calcite-ui-icons": { "name": "@esri/calcite-ui-icons", - "version": "3.33.0-next.4", + "version": "3.33.0-next.5", "license": "SEE LICENSE.md", "bin": { "spriter": "bin/spriter.js" diff --git a/packages/calcite-components-angular/projects/component-library/CHANGELOG.md b/packages/calcite-components-angular/projects/component-library/CHANGELOG.md index f04808681c1..e759fb848c1 100644 --- a/packages/calcite-components-angular/projects/component-library/CHANGELOG.md +++ b/packages/calcite-components-angular/projects/component-library/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.14.0-next.17](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.14.0-next.16...@esri/calcite-components-angular@2.14.0-next.17) (2024-10-23) + +**Note:** Version bump only for package @esri/calcite-components-angular + ## [2.14.0-next.16](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.14.0-next.15...@esri/calcite-components-angular@2.14.0-next.16) (2024-10-23) **Note:** Version bump only for package @esri/calcite-components-angular diff --git a/packages/calcite-components-angular/projects/component-library/package.json b/packages/calcite-components-angular/projects/component-library/package.json index 2dd25050645..28e241d99c9 100644 --- a/packages/calcite-components-angular/projects/component-library/package.json +++ b/packages/calcite-components-angular/projects/component-library/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components-angular", - "version": "2.14.0-next.16", + "version": "2.14.0-next.17", "description": "A set of Angular components that wrap Esri's Calcite Components.", "homepage": "https://developers.arcgis.com/calcite-design-system/", "bugs": { @@ -17,7 +17,7 @@ }, "sideEffects": false, "dependencies": { - "@esri/calcite-components": "2.14.0-next.16", + "@esri/calcite-components": "2.14.0-next.17", "tslib": "2.6.3" }, "peerDependencies": { diff --git a/packages/calcite-components-react/CHANGELOG.md b/packages/calcite-components-react/CHANGELOG.md index de3c380162b..6003a797a05 100644 --- a/packages/calcite-components-react/CHANGELOG.md +++ b/packages/calcite-components-react/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.14.0-next.17](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.14.0-next.16...@esri/calcite-components-react@2.14.0-next.17) (2024-10-23) + +**Note:** Version bump only for package @esri/calcite-components-react + ## [2.14.0-next.16](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.14.0-next.15...@esri/calcite-components-react@2.14.0-next.16) (2024-10-23) **Note:** Version bump only for package @esri/calcite-components-react diff --git a/packages/calcite-components-react/package.json b/packages/calcite-components-react/package.json index fe9fafc25f8..009c810da58 100644 --- a/packages/calcite-components-react/package.json +++ b/packages/calcite-components-react/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components-react", - "version": "2.14.0-next.16", + "version": "2.14.0-next.17", "description": "A set of React components that wrap calcite components", "homepage": "https://developers.arcgis.com/calcite-design-system/", "repository": { @@ -28,7 +28,7 @@ "tsc": "tsc" }, "dependencies": { - "@esri/calcite-components": "2.14.0-next.16" + "@esri/calcite-components": "2.14.0-next.17" }, "peerDependencies": { "react": ">=16.7", diff --git a/packages/calcite-components/CHANGELOG.md b/packages/calcite-components/CHANGELOG.md index 905ab530551..bf0885226be 100644 --- a/packages/calcite-components/CHANGELOG.md +++ b/packages/calcite-components/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.14.0-next.17](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.14.0-next.16...@esri/calcite-components@2.14.0-next.17) (2024-10-23) + +### Features + +- **input-date-picker, date-picker:** improve date picking experience ([#8402](https://github.com/Esri/calcite-design-system/issues/8402)) ([24d43ad](https://github.com/Esri/calcite-design-system/commit/24d43ad2568118457f00221d1c6f216a563c3895)), closes [#3455](https://github.com/Esri/calcite-design-system/issues/3455) [#10113](https://github.com/Esri/calcite-design-system/issues/10113) [#9167](https://github.com/Esri/calcite-design-system/issues/9167) + ## [2.14.0-next.16](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.14.0-next.15...@esri/calcite-components@2.14.0-next.16) (2024-10-23) **Note:** Version bump only for package @esri/calcite-components diff --git a/packages/calcite-components/package.json b/packages/calcite-components/package.json index b7efc61839d..b436c94b063 100644 --- a/packages/calcite-components/package.json +++ b/packages/calcite-components/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components", - "version": "2.14.0-next.16", + "version": "2.14.0-next.17", "homepage": "https://developers.arcgis.com/calcite-design-system/", "description": "Web Components for Esri's Calcite Design System.", "main": "dist/index.cjs.js", @@ -60,7 +60,7 @@ "directory": "packages/calcite-components" }, "dependencies": { - "@esri/calcite-ui-icons": "3.33.0-next.4", + "@esri/calcite-ui-icons": "3.33.0-next.5", "@floating-ui/dom": "1.6.11", "@stencil/core": "4.20.0", "@types/color": "3.0.6", diff --git a/packages/calcite-ui-icons/CHANGELOG.md b/packages/calcite-ui-icons/CHANGELOG.md index 7c73c173658..08668adf476 100644 --- a/packages/calcite-ui-icons/CHANGELOG.md +++ b/packages/calcite-ui-icons/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.33.0-next.5](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-ui-icons@3.33.0-next.4...@esri/calcite-ui-icons@3.33.0-next.5) (2024-10-23) + +### Features + +- add buffer point, buffer polygon, buffer polyline, contour, offset ([#10594](https://github.com/Esri/calcite-design-system/issues/10594)) ([274cffd](https://github.com/Esri/calcite-design-system/commit/274cffddd311829be9f7b2d0e1a8ebdad5125cc3)) + ## [3.33.0-next.4](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-ui-icons@3.33.0-next.3...@esri/calcite-ui-icons@3.33.0-next.4) (2024-10-23) ### Bug Fixes diff --git a/packages/calcite-ui-icons/package.json b/packages/calcite-ui-icons/package.json index 2fbf4d44548..206327672f0 100644 --- a/packages/calcite-ui-icons/package.json +++ b/packages/calcite-ui-icons/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-ui-icons", - "version": "3.33.0-next.4", + "version": "3.33.0-next.5", "private": false, "description": "A collection of UI SVG icons created by Esri for applications.", "keywords": [ From 2917d429dba4bc3425e12c21fdcc1a7374923380 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Wed, 23 Oct 2024 16:06:59 -0700 Subject: [PATCH 09/17] ci: add calcite-ui-icons label to relevant package PRs (#10590) ## Summary Add a `calcite-ui-icons` label to pull requests that only change files in `packages/calcite-ui-icons`. Requested by @arowles. --- .github/scripts/iconTeamDiffCheck.js | 4 +++- .github/scripts/support/resources.js | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/scripts/iconTeamDiffCheck.js b/.github/scripts/iconTeamDiffCheck.js index 6a43260f453..ee81fe3ae45 100644 --- a/.github/scripts/iconTeamDiffCheck.js +++ b/.github/scripts/iconTeamDiffCheck.js @@ -1,6 +1,7 @@ const { teams: { admins, iconDesigners }, labels: { snapshots }, + packages, } = require("./support/resources"); /** @param {import('github-script').AsyncFunctionArguments} AsyncFunctionArguments */ @@ -81,8 +82,9 @@ module.exports = async ({ github, context, core }) => { owner, repo, issue_number: pull_number, - labels: [snapshots.skip], + labels: [snapshots.skip, packages.icons], }); + core.setFailed( `An admin needs to review these changes because a file outside of package/calcite-ui-icons was changed.`, ); diff --git a/.github/scripts/support/resources.js b/.github/scripts/support/resources.js index 7239d7866c9..9203eb2402d 100644 --- a/.github/scripts/support/resources.js +++ b/.github/scripts/support/resources.js @@ -47,6 +47,9 @@ const resources = { admins: "calcite-design-system-admins", iconDesigners: "calcite-icon-designers", }, + packages: { + icons: "calcite-ui-icons", + }, }; module.exports = resources; From 63abe8348c9c2649446694f246d6c08644f0d72a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:09:24 -0700 Subject: [PATCH 10/17] build(deps): update dependency axe-core to v4.10.1 (#10566) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [axe-core](https://www.deque.com/axe/) ([source](https://redirect.github.com/dequelabs/axe-core)) | [`4.10.0` -> `4.10.1`](https://renovatebot.com/diffs/npm/axe-core/4.10.0/4.10.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/axe-core/4.10.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/axe-core/4.10.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/axe-core/4.10.0/4.10.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/axe-core/4.10.0/4.10.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
dequelabs/axe-core (axe-core) ### [`v4.10.1`](https://redirect.github.com/dequelabs/axe-core/blob/HEAD/CHANGELOG.md#4101-2024-10-16) [Compare Source](https://redirect.github.com/dequelabs/axe-core/compare/v4.10.0...v4.10.1)
--- - [ ] If you want to rebase/retry this PR, check this box Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 88213605ebb..675102c959e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,7 @@ "@typescript-eslint/parser": "7.13.1", "@whitespace/storybook-addon-html": "6.1.1", "autoprefixer": "10.4.20", - "axe-core": "4.10.0", + "axe-core": "4.10.1", "babel-loader": "9.2.1", "change-case": "4.1.2", "cheerio": "1.0.0", @@ -10648,9 +10648,9 @@ } }, "node_modules/axe-core": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.0.tgz", - "integrity": "sha512-Mr2ZakwQ7XUAjp7pAwQWRhhK8mQQ6JAaNWSjmjxil0R8BPioMtQsTLOolGYkji1rcL++3dCqZA3zWqpT+9Ew6g==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.1.tgz", + "integrity": "sha512-qPC9o+kD8Tir0lzNGLeghbOrWMr3ZJpaRlCIb6Uobt/7N4FiEDvqUMnxzCHRHmg8vOg14kr5gVNyScRmbMaJ9g==", "dev": true, "engines": { "node": ">=4" diff --git a/package.json b/package.json index bf4a10f0d74..fde93e4d613 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "@typescript-eslint/parser": "7.13.1", "@whitespace/storybook-addon-html": "6.1.1", "autoprefixer": "10.4.20", - "axe-core": "4.10.0", + "axe-core": "4.10.1", "babel-loader": "9.2.1", "change-case": "4.1.2", "cheerio": "1.0.0", From 29654777a3c607abda18c9c95c3b3620f9b8c1a4 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Wed, 23 Oct 2024 17:02:41 -0700 Subject: [PATCH 11/17] ci(chromatic): build storybook even when skipping snapshots (#10589) ## Summary There have been a few occasions where storybook build errors made it onto `dev` due to skipping snapshots. This will ensure storybook always builds and catches errors, even if it isn't uploaded to chromatic. --- .github/workflows/chromatic.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index e5eed78c099..7eabddaa911 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -7,8 +7,6 @@ on: types: [opened, labeled, synchronize] jobs: run: - if: | - (github.event.action == 'labeled' && github.event.label.name == 'pr ready for visual snapshots') || github.event_name == 'push' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,11 +15,18 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: package.json - - run: | + - name: Build storybook + env: + STORYBOOK_SCREENSHOT_TEST_BUILD: true + CHROMATIC_DIFF_THRESHOLD: ${{ secrets.CHROMATIC_DIFF_THRESHOLD }} + run: | npm install npm --workspace="packages/calcite-design-tokens" run build npm --workspace="packages/calcite-ui-icons" run build + npm --workspace="packages/calcite-components" run build-storybook - name: Publish to Chromatic + if: | + (github.event.action == 'labeled' && github.event.label.name == 'pr ready for visual snapshots') || github.event_name == 'push' uses: chromaui/action@v11 with: projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} @@ -29,6 +34,7 @@ jobs: exitOnceUploaded: true autoAcceptChanges: ${{ github.base_ref || github.ref_name }} workingDir: packages/calcite-components + storybookBuildDir: docs env: STORYBOOK_SCREENSHOT_TEST_BUILD: true CHROMATIC_DIFF_THRESHOLD: ${{ secrets.CHROMATIC_DIFF_THRESHOLD }} From ce6ba487eca4080b861cd213bae001ab3a529b30 Mon Sep 17 00:00:00 2001 From: Calcite Admin Date: Wed, 23 Oct 2024 17:14:51 -0700 Subject: [PATCH 12/17] chore: release main (#10597) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* ---
@esri/calcite-components: 2.13.2 [2.13.2](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.13.1...@esri/calcite-components@2.13.2) (2024-10-23) * **shell-center-row:** Ensure deprecation warning doesn’t show when using standalone `shell` or `shell-panel` ([#10561](https://github.com/Esri/calcite-design-system/issues/10561)) ([09d74ae](https://github.com/Esri/calcite-design-system/commit/09d74aeb1b4d18299806903e63ce33b28d7406cd))
@esri/calcite-components-angular: 2.13.2 [2.13.2](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.13.1...@esri/calcite-components-angular@2.13.2) (2024-10-23) * **@esri/calcite-components-angular:** Synchronize components versions * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from 2.13.1 to 2.13.2
@esri/calcite-components-react: 2.13.2 [2.13.2](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.13.1...@esri/calcite-components-react@2.13.2) (2024-10-23) * **@esri/calcite-components-react:** Synchronize components versions * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from 2.13.1 to 2.13.2
--- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .release-please-manifest.json | 6 +++--- examples/components/angular/package.json | 2 +- examples/components/preact/package.json | 2 +- examples/components/react/package.json | 2 +- examples/components/rollup/package.json | 2 +- examples/components/vite/package.json | 2 +- examples/components/vue/package.json | 2 +- examples/components/web-dev-server/package.json | 2 +- examples/components/webpack/package.json | 2 +- .../projects/component-library/CHANGELOG.md | 12 ++++++++++++ packages/calcite-components-react/CHANGELOG.md | 12 ++++++++++++ packages/calcite-components/CHANGELOG.md | 6 ++++++ packages/calcite-components/readme.md | 4 ++-- 13 files changed, 43 insertions(+), 13 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3e7e0203ac0..60349519535 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,8 +1,8 @@ { - "packages/calcite-components": "2.13.1", - "packages/calcite-components-react": "2.13.1", + "packages/calcite-components": "2.13.2", + "packages/calcite-components-react": "2.13.2", "packages/calcite-design-tokens": "2.2.0", "packages/calcite-ui-icons": "3.32.0", "packages/eslint-plugin-calcite-components": "1.2.1", - "packages/calcite-components-angular/projects/component-library": "2.13.1" + "packages/calcite-components-angular/projects/component-library": "2.13.2" } diff --git a/examples/components/angular/package.json b/examples/components/angular/package.json index aa460f5f0ba..a4d45f64dd5 100644 --- a/examples/components/angular/package.json +++ b/examples/components/angular/package.json @@ -26,7 +26,7 @@ "@angular/platform-browser": "^18.1.0", "@angular/platform-browser-dynamic": "^18.1.0", "@angular/router": "^18.1.0", - "@esri/calcite-components-angular": "2.13.1", + "@esri/calcite-components-angular": "2.13.2", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.14.3" diff --git a/examples/components/preact/package.json b/examples/components/preact/package.json index cbf915d88b4..73b63d10433 100644 --- a/examples/components/preact/package.json +++ b/examples/components/preact/package.json @@ -28,7 +28,7 @@ ] }, "dependencies": { - "@esri/calcite-components": "2.13.1", + "@esri/calcite-components": "2.13.2", "preact": "^10.10.0", "preact-render-to-string": "^5.2.1", "preact-router": "^3.2.1" diff --git a/examples/components/react/package.json b/examples/components/react/package.json index f10ee2f7c40..d74271ec023 100644 --- a/examples/components/react/package.json +++ b/examples/components/react/package.json @@ -16,7 +16,7 @@ "preview": "vite preview" }, "dependencies": { - "@esri/calcite-components-react": "2.13.1", + "@esri/calcite-components-react": "2.13.2", "react": "^18.3.1", "react-dom": "^18.3.1" }, diff --git a/examples/components/rollup/package.json b/examples/components/rollup/package.json index 833c5cdfe76..7e0e527ab33 100644 --- a/examples/components/rollup/package.json +++ b/examples/components/rollup/package.json @@ -15,7 +15,7 @@ "start": "serve public" }, "dependencies": { - "@esri/calcite-components": "2.13.1" + "@esri/calcite-components": "2.13.2" }, "devDependencies": { "@rollup/plugin-commonjs": "^26.0.1", diff --git a/examples/components/vite/package.json b/examples/components/vite/package.json index 09e54fb6349..17ec8554191 100644 --- a/examples/components/vite/package.json +++ b/examples/components/vite/package.json @@ -15,7 +15,7 @@ "serve": "vite preview" }, "dependencies": { - "@esri/calcite-components": "2.13.1" + "@esri/calcite-components": "2.13.2" }, "devDependencies": { "@types/node": "^22.1.0", diff --git a/examples/components/vue/package.json b/examples/components/vue/package.json index 3da28b83703..a85fc0f88a5 100644 --- a/examples/components/vue/package.json +++ b/examples/components/vue/package.json @@ -16,7 +16,7 @@ "copy": "ncp ./node_modules/@esri/calcite-components/dist/calcite/assets/ ./public/assets/" }, "dependencies": { - "@esri/calcite-components": "2.13.1", + "@esri/calcite-components": "2.13.2", "vue": "^3.4.36" }, "devDependencies": { diff --git a/examples/components/web-dev-server/package.json b/examples/components/web-dev-server/package.json index 214356f8361..d72feb93fa5 100644 --- a/examples/components/web-dev-server/package.json +++ b/examples/components/web-dev-server/package.json @@ -13,7 +13,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { - "@esri/calcite-components": "2.13.1" + "@esri/calcite-components": "2.13.2" }, "devDependencies": { "@web/dev-server": "^0.4.6" diff --git a/examples/components/webpack/package.json b/examples/components/webpack/package.json index 47d6c3137c5..1ee05b1fe82 100644 --- a/examples/components/webpack/package.json +++ b/examples/components/webpack/package.json @@ -14,7 +14,7 @@ "start": "webpack-dev-server --open" }, "dependencies": { - "@esri/calcite-components": "2.13.1" + "@esri/calcite-components": "2.13.2" }, "devDependencies": { "copy-webpack-plugin": "^12.0.2", diff --git a/packages/calcite-components-angular/projects/component-library/CHANGELOG.md b/packages/calcite-components-angular/projects/component-library/CHANGELOG.md index e759fb848c1..65979679da3 100644 --- a/packages/calcite-components-angular/projects/component-library/CHANGELOG.md +++ b/packages/calcite-components-angular/projects/component-library/CHANGELOG.md @@ -75,6 +75,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @esri/calcite-components-angular +## [2.13.2](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.13.1...@esri/calcite-components-angular@2.13.2) (2024-10-23) + +### Miscellaneous Chores + +- **@esri/calcite-components-angular:** Synchronize components versions + +### Dependencies + +- The following workspace dependencies were updated + - dependencies + - @esri/calcite-components bumped from 2.13.1 to 2.13.2 + ## [2.13.1](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.13.0...@esri/calcite-components-angular@2.13.1) (2024-10-11) ### Miscellaneous Chores diff --git a/packages/calcite-components-react/CHANGELOG.md b/packages/calcite-components-react/CHANGELOG.md index 6003a797a05..61120e55777 100644 --- a/packages/calcite-components-react/CHANGELOG.md +++ b/packages/calcite-components-react/CHANGELOG.md @@ -75,6 +75,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @esri/calcite-components-react +## [2.13.2](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.13.1...@esri/calcite-components-react@2.13.2) (2024-10-23) + +### Miscellaneous Chores + +- **@esri/calcite-components-react:** Synchronize components versions + +### Dependencies + +- The following workspace dependencies were updated + - dependencies + - @esri/calcite-components bumped from 2.13.1 to 2.13.2 + ## [2.13.1](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.13.0...@esri/calcite-components-react@2.13.1) (2024-10-11) ### Miscellaneous Chores diff --git a/packages/calcite-components/CHANGELOG.md b/packages/calcite-components/CHANGELOG.md index bf0885226be..861c6bbb1cc 100644 --- a/packages/calcite-components/CHANGELOG.md +++ b/packages/calcite-components/CHANGELOG.md @@ -156,6 +156,12 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline - **text-area:** ensure border-color token doesn't override invalid styles ([#10390](https://github.com/Esri/calcite-design-system/issues/10390)) ([699e166](https://github.com/Esri/calcite-design-system/commit/699e166f19786cee7c9b4a542a1d19426c1051ed)), closes [#7180](https://github.com/Esri/calcite-design-system/issues/7180) - **tooltip:** closed tooltips should not reappear ([#10420](https://github.com/Esri/calcite-design-system/issues/10420)) ([a2f3925](https://github.com/Esri/calcite-design-system/commit/a2f392527dd3efb0fe0f160e67fb4e88115cf203)), closes [#10416](https://github.com/Esri/calcite-design-system/issues/10416) +## [2.13.2](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.13.1...@esri/calcite-components@2.13.2) (2024-10-23) + +### Bug Fixes + +- **shell-center-row:** Ensure deprecation warning doesn’t show when using standalone `shell` or `shell-panel` ([#10561](https://github.com/Esri/calcite-design-system/issues/10561)) ([09d74ae](https://github.com/Esri/calcite-design-system/commit/09d74aeb1b4d18299806903e63ce33b28d7406cd)) + ## [2.13.1](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.13.0...@esri/calcite-components@2.13.1) (2024-10-11) ### Bug Fixes diff --git a/packages/calcite-components/readme.md b/packages/calcite-components/readme.md index 4bb0af02301..37a1d7d0611 100644 --- a/packages/calcite-components/readme.md +++ b/packages/calcite-components/readme.md @@ -17,12 +17,12 @@ The most common approach for loading Calcite Components is to use the version ho ```html ``` From 6fa167817bd0dda53eebea0f87e862851634c9f2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:22:58 -0700 Subject: [PATCH 13/17] build(deps): update dependency @rollup/plugin-replace to v6 (#10604) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@rollup/plugin-replace](https://redirect.github.com/rollup/plugins/tree/master/packages/replace#readme) ([source](https://redirect.github.com/rollup/plugins/tree/HEAD/packages/replace)) | [`5.0.7` -> `6.0.1`](https://renovatebot.com/diffs/npm/@rollup%2fplugin-replace/5.0.7/6.0.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@rollup%2fplugin-replace/6.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@rollup%2fplugin-replace/6.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@rollup%2fplugin-replace/5.0.7/6.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@rollup%2fplugin-replace/5.0.7/6.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
rollup/plugins (@​rollup/plugin-replace) ### [`v6.0.1`](https://redirect.github.com/rollup/plugins/blob/HEAD/packages/replace/CHANGELOG.md#v601) *2024-09-23* ##### Bugfixes - fix: The `preventAssignment` option is treated as a value to replace ([#​1768](https://redirect.github.com/rollup/plugins/issues/1768)) ### [`v6.0.0`](https://redirect.github.com/rollup/plugins/blob/HEAD/packages/replace/CHANGELOG.md#v600) *2024-09-23* ##### Breaking Changes - fix!: objectGuards doesn't take effects ([#​1764](https://redirect.github.com/rollup/plugins/issues/1764))
--- - [ ] If you want to rebase/retry this PR, check this box Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 675102c959e..33d043fcf1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@octokit/webhooks-types": "7.6.1", "@prettier/sync": "0.5.2", "@rollup/plugin-node-resolve": "15.3.0", - "@rollup/plugin-replace": "5.0.7", + "@rollup/plugin-replace": "6.0.1", "@rollup/plugin-typescript": "11.1.6", "@storybook/addon-a11y": "8.2.9", "@storybook/addon-controls": "8.2.9", @@ -7271,9 +7271,10 @@ } }, "node_modules/@rollup/plugin-replace": { - "version": "5.0.7", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-6.0.1.tgz", + "integrity": "sha512-2sPh9b73dj5IxuMmDAsQWVFT7mR+yoHweBaXG2W/R8vQ+IWZlnaI7BR7J6EguVQUp1hd8Z7XuozpDjEKQAAC2Q==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", "magic-string": "^0.30.3" diff --git a/package.json b/package.json index fde93e4d613..7eab3cbc79b 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@octokit/webhooks-types": "7.6.1", "@prettier/sync": "0.5.2", "@rollup/plugin-node-resolve": "15.3.0", - "@rollup/plugin-replace": "5.0.7", + "@rollup/plugin-replace": "6.0.1", "@rollup/plugin-typescript": "11.1.6", "@storybook/addon-a11y": "8.2.9", "@storybook/addon-controls": "8.2.9", From 05ad94514ac4c67364d8bb07c1e16376a3fdd56d Mon Sep 17 00:00:00 2001 From: Calcite Admin Date: Thu, 24 Oct 2024 15:23:47 -0700 Subject: [PATCH 14/17] docs: update component READMEs (#10600) This PR was automatically generated by the update-doc GitHub action Co-authored-by: benelan <10986395+benelan@users.noreply.github.com> --- .../calcite-components/src/components.d.ts | 100 ------------------ .../src/components/action/readme.md | 2 + .../src/components/date-picker-day/readme.md | 6 +- .../date-picker-month-header/readme.md | 18 +++- .../components/date-picker-month/readme.md | 33 ++++-- .../src/components/date-picker/readme.md | 46 ++++---- .../src/components/icon/readme.md | 2 - .../components/input-date-picker/readme.md | 11 +- .../src/components/list/readme.md | 41 +++---- .../src/components/option/readme.md | 14 +++ .../src/components/select/readme.md | 14 ++- 11 files changed, 123 insertions(+), 164 deletions(-) diff --git a/packages/calcite-components/src/components.d.ts b/packages/calcite-components/src/components.d.ts index 70288fce667..9dee40c58d4 100644 --- a/packages/calcite-components/src/components.d.ts +++ b/packages/calcite-components/src/components.d.ts @@ -9,191 +9,91 @@ import { Alignment, Appearance, CollapseDirection, FlipContext, IconType, Intera import { RequestedItem } from "./components/accordion/interfaces"; import { IconNameOrString } from "./components/icon/interfaces"; import { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces"; -import { ActionMessages } from "./components/action/assets/action/t9n"; import { FlipPlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; -import { ActionBarMessages } from "./components/action-bar/assets/action-bar/t9n"; import { Columns } from "./components/action-group/interfaces"; -import { ActionGroupMessages } from "./components/action-group/assets/action-group/t9n"; -import { ActionPadMessages } from "./components/action-pad/assets/action-pad/t9n"; import { AlertDuration, AlertQueue } from "./components/alert/interfaces"; import { NumberingSystem } from "./utils/locale"; -import { AlertMessages } from "./components/alert/assets/alert/t9n"; import { HeadingLevel } from "./components/functional/Heading"; -import { BlockMessages } from "./components/block/assets/block/t9n"; import { BlockSectionToggleDisplay } from "./components/block-section/interfaces"; -import { BlockSectionMessages } from "./components/block-section/assets/block-section/t9n"; import { ButtonAlignment, DropdownIconType } from "./components/button/interfaces"; -import { ButtonMessages } from "./components/button/assets/button/t9n"; -import { CardMessages } from "./components/card/assets/card/t9n"; import { ArrowType, AutoplayType } from "./components/carousel/interfaces"; -import { CarouselMessages } from "./components/carousel/assets/carousel/t9n"; import { MutableValidityState } from "./utils/form"; -import { ChipMessages } from "./components/chip/assets/chip/t9n"; import { ColorValue, InternalColor } from "./components/color-picker/interfaces"; import { Format } from "./components/color-picker/utils"; -import { ColorPickerMessages } from "./components/color-picker/assets/color-picker/t9n"; import { ComboboxChildElement, SelectionDisplay } from "./components/combobox/interfaces"; -import { ComboboxMessages } from "./components/combobox/assets/combobox/t9n"; -import { DatePickerMessages } from "./components/date-picker/assets/date-picker/t9n"; import { HoverRange } from "./utils/date"; import { DateLocaleData } from "./components/date-picker/utils"; -import { DialogMessages } from "./components/dialog/assets/dialog/t9n"; import { DialogPlacement } from "./components/dialog/interfaces"; import { RequestedItem as RequestedItem2 } from "./components/dropdown-group/interfaces"; import { ItemKeyboardEvent } from "./components/dropdown/interfaces"; -import { FilterMessages } from "./components/filter/assets/filter/t9n"; import { FlowItemLikeElement } from "./components/flow/interfaces"; -import { FlowItemMessages } from "./components/flow-item/assets/flow-item/t9n"; import { ColorStop, DataSeries } from "./components/graph/interfaces"; -import { HandleMessages } from "./components/handle/assets/handle/t9n"; import { HandleChange, HandleNudge } from "./components/handle/interfaces"; -import { InlineEditableMessages } from "./components/inline-editable/assets/inline-editable/t9n"; import { InputPlacement } from "./components/input/interfaces"; -import { InputMessages } from "./components/input/assets/input/t9n"; -import { InputDatePickerMessages } from "./components/input-date-picker/assets/input-date-picker/t9n"; -import { InputNumberMessages } from "./components/input-number/assets/input-number/t9n"; -import { InputTextMessages } from "./components/input-text/assets/input-text/t9n"; -import { InputTimePickerMessages } from "./components/input-time-picker/assets/input-time-picker/t9n"; -import { TimePickerMessages } from "./components/time-picker/assets/time-picker/t9n"; -import { InputTimeZoneMessages } from "./components/input-time-zone/assets/input-time-zone/t9n"; import { OffsetStyle, TimeZoneMode } from "./components/input-time-zone/interfaces"; import { ListDragDetail } from "./components/list/interfaces"; import { ItemData } from "./components/list-item/interfaces"; -import { ListMessages } from "./components/list/assets/list/t9n"; import { SelectionAppearance } from "./components/list/resources"; -import { ListItemMessages } from "./components/list-item/assets/list-item/t9n"; -import { MenuMessages } from "./components/menu/assets/menu/t9n"; -import { MenuItemMessages } from "./components/menu-item/assets/menu-item/t9n"; import { MenuItemCustomEvent } from "./components/menu-item/interfaces"; import { MeterFillType, MeterLabelType } from "./components/meter/interfaces"; -import { ModalMessages } from "./components/modal/assets/modal/t9n"; -import { NoticeMessages } from "./components/notice/assets/notice/t9n"; -import { PaginationMessages } from "./components/pagination/assets/pagination/t9n"; -import { PanelMessages } from "./components/panel/assets/panel/t9n"; import { ItemData as ItemData1, ListFocusId } from "./components/pick-list/shared-list-logic"; import { ICON_TYPES } from "./components/pick-list/resources"; -import { PickListItemMessages } from "./components/pick-list-item/assets/pick-list-item/t9n"; -import { PopoverMessages } from "./components/popover/assets/popover/t9n"; -import { RatingMessages } from "./components/rating/assets/rating/t9n"; -import { ScrimMessages } from "./components/scrim/assets/scrim/t9n"; import { DisplayMode } from "./components/sheet/interfaces"; import { DisplayMode as DisplayMode1 } from "./components/shell-panel/interfaces"; -import { ShellPanelMessages } from "./components/shell-panel/assets/shell-panel/t9n"; import { DragDetail } from "./utils/sortableComponent"; import { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail, StepperLayout } from "./components/stepper/interfaces"; -import { StepperMessages } from "./components/stepper/assets/stepper/t9n"; -import { StepperItemMessages } from "./components/stepper-item/assets/stepper-item/t9n"; import { TabID, TabLayout, TabPosition } from "./components/tabs/interfaces"; -import { TabNavMessages } from "./components/tab-nav/assets/tab-nav/t9n"; import { Element } from "@stencil/core"; import { TabChangeEventDetail, TabCloseEventDetail } from "./components/tab/interfaces"; -import { TabTitleMessages } from "./components/tab-title/assets/tab-title/t9n"; import { RowType, TableInteractionMode, TableLayout, TableRowFocusEvent, TableSelectionDisplay } from "./components/table/interfaces"; -import { TableMessages } from "./components/table/assets/table/t9n"; -import { TableCellMessages } from "./components/table-cell/assets/table-cell/t9n"; -import { TableHeaderMessages } from "./components/table-header/assets/table-header/t9n"; -import { TextAreaMessages } from "./components/text-area/assets/text-area/t9n"; import { TileSelectType } from "./components/tile-select/interfaces"; import { TileSelectGroupLayout } from "./components/tile-select-group/interfaces"; -import { TipMessages } from "./components/tip/assets/tip/t9n"; -import { TipManagerMessages } from "./components/tip-manager/assets/tip-manager/t9n"; import { TreeItemSelectDetail } from "./components/tree-item/interfaces"; -import { ValueListMessages } from "./components/value-list/assets/value-list/t9n"; import { ListItemAndHandle } from "./components/value-list-item/interfaces"; export { Alignment, Appearance, CollapseDirection, FlipContext, IconType, InteractionMode, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces"; export { RequestedItem } from "./components/accordion/interfaces"; export { IconNameOrString } from "./components/icon/interfaces"; export { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces"; -export { ActionMessages } from "./components/action/assets/action/t9n"; export { FlipPlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; -export { ActionBarMessages } from "./components/action-bar/assets/action-bar/t9n"; export { Columns } from "./components/action-group/interfaces"; -export { ActionGroupMessages } from "./components/action-group/assets/action-group/t9n"; -export { ActionPadMessages } from "./components/action-pad/assets/action-pad/t9n"; export { AlertDuration, AlertQueue } from "./components/alert/interfaces"; export { NumberingSystem } from "./utils/locale"; -export { AlertMessages } from "./components/alert/assets/alert/t9n"; export { HeadingLevel } from "./components/functional/Heading"; -export { BlockMessages } from "./components/block/assets/block/t9n"; export { BlockSectionToggleDisplay } from "./components/block-section/interfaces"; -export { BlockSectionMessages } from "./components/block-section/assets/block-section/t9n"; export { ButtonAlignment, DropdownIconType } from "./components/button/interfaces"; -export { ButtonMessages } from "./components/button/assets/button/t9n"; -export { CardMessages } from "./components/card/assets/card/t9n"; export { ArrowType, AutoplayType } from "./components/carousel/interfaces"; -export { CarouselMessages } from "./components/carousel/assets/carousel/t9n"; export { MutableValidityState } from "./utils/form"; -export { ChipMessages } from "./components/chip/assets/chip/t9n"; export { ColorValue, InternalColor } from "./components/color-picker/interfaces"; export { Format } from "./components/color-picker/utils"; -export { ColorPickerMessages } from "./components/color-picker/assets/color-picker/t9n"; export { ComboboxChildElement, SelectionDisplay } from "./components/combobox/interfaces"; -export { ComboboxMessages } from "./components/combobox/assets/combobox/t9n"; -export { DatePickerMessages } from "./components/date-picker/assets/date-picker/t9n"; export { HoverRange } from "./utils/date"; export { DateLocaleData } from "./components/date-picker/utils"; -export { DialogMessages } from "./components/dialog/assets/dialog/t9n"; export { DialogPlacement } from "./components/dialog/interfaces"; export { RequestedItem as RequestedItem2 } from "./components/dropdown-group/interfaces"; export { ItemKeyboardEvent } from "./components/dropdown/interfaces"; -export { FilterMessages } from "./components/filter/assets/filter/t9n"; export { FlowItemLikeElement } from "./components/flow/interfaces"; -export { FlowItemMessages } from "./components/flow-item/assets/flow-item/t9n"; export { ColorStop, DataSeries } from "./components/graph/interfaces"; -export { HandleMessages } from "./components/handle/assets/handle/t9n"; export { HandleChange, HandleNudge } from "./components/handle/interfaces"; -export { InlineEditableMessages } from "./components/inline-editable/assets/inline-editable/t9n"; export { InputPlacement } from "./components/input/interfaces"; -export { InputMessages } from "./components/input/assets/input/t9n"; -export { InputDatePickerMessages } from "./components/input-date-picker/assets/input-date-picker/t9n"; -export { InputNumberMessages } from "./components/input-number/assets/input-number/t9n"; -export { InputTextMessages } from "./components/input-text/assets/input-text/t9n"; -export { InputTimePickerMessages } from "./components/input-time-picker/assets/input-time-picker/t9n"; -export { TimePickerMessages } from "./components/time-picker/assets/time-picker/t9n"; -export { InputTimeZoneMessages } from "./components/input-time-zone/assets/input-time-zone/t9n"; export { OffsetStyle, TimeZoneMode } from "./components/input-time-zone/interfaces"; export { ListDragDetail } from "./components/list/interfaces"; export { ItemData } from "./components/list-item/interfaces"; -export { ListMessages } from "./components/list/assets/list/t9n"; export { SelectionAppearance } from "./components/list/resources"; -export { ListItemMessages } from "./components/list-item/assets/list-item/t9n"; -export { MenuMessages } from "./components/menu/assets/menu/t9n"; -export { MenuItemMessages } from "./components/menu-item/assets/menu-item/t9n"; export { MenuItemCustomEvent } from "./components/menu-item/interfaces"; export { MeterFillType, MeterLabelType } from "./components/meter/interfaces"; -export { ModalMessages } from "./components/modal/assets/modal/t9n"; -export { NoticeMessages } from "./components/notice/assets/notice/t9n"; -export { PaginationMessages } from "./components/pagination/assets/pagination/t9n"; -export { PanelMessages } from "./components/panel/assets/panel/t9n"; export { ItemData as ItemData1, ListFocusId } from "./components/pick-list/shared-list-logic"; export { ICON_TYPES } from "./components/pick-list/resources"; -export { PickListItemMessages } from "./components/pick-list-item/assets/pick-list-item/t9n"; -export { PopoverMessages } from "./components/popover/assets/popover/t9n"; -export { RatingMessages } from "./components/rating/assets/rating/t9n"; -export { ScrimMessages } from "./components/scrim/assets/scrim/t9n"; export { DisplayMode } from "./components/sheet/interfaces"; export { DisplayMode as DisplayMode1 } from "./components/shell-panel/interfaces"; -export { ShellPanelMessages } from "./components/shell-panel/assets/shell-panel/t9n"; export { DragDetail } from "./utils/sortableComponent"; export { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail, StepperLayout } from "./components/stepper/interfaces"; -export { StepperMessages } from "./components/stepper/assets/stepper/t9n"; -export { StepperItemMessages } from "./components/stepper-item/assets/stepper-item/t9n"; export { TabID, TabLayout, TabPosition } from "./components/tabs/interfaces"; -export { TabNavMessages } from "./components/tab-nav/assets/tab-nav/t9n"; export { Element } from "@stencil/core"; export { TabChangeEventDetail, TabCloseEventDetail } from "./components/tab/interfaces"; -export { TabTitleMessages } from "./components/tab-title/assets/tab-title/t9n"; export { RowType, TableInteractionMode, TableLayout, TableRowFocusEvent, TableSelectionDisplay } from "./components/table/interfaces"; -export { TableMessages } from "./components/table/assets/table/t9n"; -export { TableCellMessages } from "./components/table-cell/assets/table-cell/t9n"; -export { TableHeaderMessages } from "./components/table-header/assets/table-header/t9n"; -export { TextAreaMessages } from "./components/text-area/assets/text-area/t9n"; export { TileSelectType } from "./components/tile-select/interfaces"; export { TileSelectGroupLayout } from "./components/tile-select-group/interfaces"; -export { TipMessages } from "./components/tip/assets/tip/t9n"; -export { TipManagerMessages } from "./components/tip-manager/assets/tip-manager/t9n"; export { TreeItemSelectDetail } from "./components/tree-item/interfaces"; -export { ValueListMessages } from "./components/value-list/assets/value-list/t9n"; export { ListItemAndHandle } from "./components/value-list-item/interfaces"; export namespace Components { interface CalciteAccordion { diff --git a/packages/calcite-components/src/components/action/readme.md b/packages/calcite-components/src/components/action/readme.md index e2929e717ce..68910df5b98 100755 --- a/packages/calcite-components/src/components/action/readme.md +++ b/packages/calcite-components/src/components/action/readme.md @@ -64,6 +64,7 @@ Type: `Promise` - [calcite-action-group](../action-group) - [calcite-action-menu](../action-menu) - [calcite-action-pad](../action-pad) +- [calcite-date-picker-month-header](../date-picker-month-header) - [calcite-flow-item](../flow-item) - [calcite-list-item](../list-item) - [calcite-menu-item](../menu-item) @@ -90,6 +91,7 @@ graph TD; calcite-action-group --> calcite-action calcite-action-menu --> calcite-action calcite-action-pad --> calcite-action + calcite-date-picker-month-header --> calcite-action calcite-flow-item --> calcite-action calcite-list-item --> calcite-action calcite-menu-item --> calcite-action diff --git a/packages/calcite-components/src/components/date-picker-day/readme.md b/packages/calcite-components/src/components/date-picker-day/readme.md index 8a3787f38f1..94c08bd32a3 100644 --- a/packages/calcite-components/src/components/date-picker-day/readme.md +++ b/packages/calcite-components/src/components/date-picker-day/readme.md @@ -21,9 +21,9 @@ ## Events -| Event | Description | Type | -| ------------------ | ---------------------------- | ------------------- | -| `calciteDaySelect` | Fires when user selects day. | `CustomEvent` | +| Event | Description | Type | +| -------------------------- | ---------------------------- | ------------------- | +| `calciteInternalDaySelect` | Fires when user selects day. | `CustomEvent` | ## Methods diff --git a/packages/calcite-components/src/components/date-picker-month-header/readme.md b/packages/calcite-components/src/components/date-picker-month-header/readme.md index ed7af88b882..13602062c39 100644 --- a/packages/calcite-components/src/components/date-picker-month-header/readme.md +++ b/packages/calcite-components/src/components/date-picker-month-header/readme.md @@ -11,6 +11,7 @@ | `localeData` | -- | CLDR locale data for translated calendar info. | `DateLocaleData` | `undefined` | | `max` | -- | Specifies the latest allowed date (`"yyyy-mm-dd"`). | `Date` | `undefined` | | `min` | -- | Specifies the earliest allowed date (`"yyyy-mm-dd"`). | `Date` | `undefined` | +| `monthStyle` | `month-style` | Specifies the monthStyle used by the component. | `"abbreviated" \| "wide"` | `undefined` | | `scale` | `scale` | Specifies the size of the component. | `"l" \| "m" \| "s"` | `undefined` | | `selectedDate` | -- | Already selected date. | `Date` | `undefined` | @@ -18,18 +19,27 @@ ### Used by -- [calcite-date-picker](../date-picker) +- [calcite-date-picker-month](../date-picker-month) ### Depends on -- [calcite-icon](../icon) +- [calcite-select](../select) +- [calcite-option](../option) +- [calcite-action](../action) ### Graph ```mermaid graph TD; - calcite-date-picker-month-header --> calcite-icon - calcite-date-picker --> calcite-date-picker-month-header + calcite-date-picker-month-header --> calcite-select + calcite-date-picker-month-header --> calcite-option + calcite-date-picker-month-header --> calcite-action + calcite-select --> calcite-icon + calcite-select --> calcite-input-message + calcite-input-message --> calcite-icon + calcite-action --> calcite-loader + calcite-action --> calcite-icon + calcite-date-picker-month --> calcite-date-picker-month-header style calcite-date-picker-month-header fill:#f9f,stroke:#333,stroke-width:4px ``` diff --git a/packages/calcite-components/src/components/date-picker-month/readme.md b/packages/calcite-components/src/components/date-picker-month/readme.md index 52ddf034db5..9b042cff920 100644 --- a/packages/calcite-components/src/components/date-picker-month/readme.md +++ b/packages/calcite-components/src/components/date-picker-month/readme.md @@ -4,16 +4,19 @@ ## Properties -| Property | Attribute | Description | Type | Default | -| -------------- | --------- | ----------------------------------------------------- | ------------------- | ------------ | -| `activeDate` | -- | The currently active Date. | `Date` | `new Date()` | -| `endDate` | -- | End date currently active. | `Date` | `undefined` | -| `hoverRange` | -- | The range of dates currently being hovered. | `HoverRange` | `undefined` | -| `max` | -- | Specifies the latest allowed date (`"yyyy-mm-dd"`). | `Date` | `undefined` | -| `min` | -- | Specifies the earliest allowed date (`"yyyy-mm-dd"`). | `Date` | `undefined` | -| `scale` | `scale` | Specifies the size of the component. | `"l" \| "m" \| "s"` | `undefined` | -| `selectedDate` | -- | Already selected date. | `Date` | `undefined` | -| `startDate` | -- | Start date currently active. | `Date` | `undefined` | +| Property | Attribute | Description | Type | Default | +| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------ | ---------------------------- | ------------ | +| `activeDate` | -- | The currently active Date. | `Date` | `new Date()` | +| `endDate` | -- | End date currently active. | `Date` | `undefined` | +| `headingLevel` | `heading-level` | Specifies the number at which section headings should start. | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `undefined` | +| `hoverRange` | -- | The range of dates currently being hovered. | `HoverRange` | `undefined` | +| `max` | -- | Specifies the latest allowed date (`"yyyy-mm-dd"`). | `Date` | `undefined` | +| `min` | -- | Specifies the earliest allowed date (`"yyyy-mm-dd"`). | `Date` | `undefined` | +| `monthStyle` | `month-style` | Specifies the monthStyle used by the component. | `"abbreviated" \| "wide"` | `undefined` | +| `range` | `range` | When `true`, activates the component's range mode which renders two calendars for selecting ranges of dates. | `boolean` | `false` | +| `scale` | `scale` | Specifies the size of the component. | `"l" \| "m" \| "s"` | `undefined` | +| `selectedDate` | -- | Already selected date. | `Date` | `undefined` | +| `startDate` | -- | Start date currently active. | `Date` | `undefined` | ## Dependencies @@ -24,12 +27,22 @@ ### Depends on - [calcite-date-picker-day](../date-picker-day) +- [calcite-date-picker-month-header](../date-picker-month-header) ### Graph ```mermaid graph TD; calcite-date-picker-month --> calcite-date-picker-day + calcite-date-picker-month --> calcite-date-picker-month-header + calcite-date-picker-month-header --> calcite-select + calcite-date-picker-month-header --> calcite-option + calcite-date-picker-month-header --> calcite-action + calcite-select --> calcite-icon + calcite-select --> calcite-input-message + calcite-input-message --> calcite-icon + calcite-action --> calcite-loader + calcite-action --> calcite-icon calcite-date-picker --> calcite-date-picker-month style calcite-date-picker-month fill:#f9f,stroke:#333,stroke-width:4px ``` diff --git a/packages/calcite-components/src/components/date-picker/readme.md b/packages/calcite-components/src/components/date-picker/readme.md index 5d939459f7b..53836bf039c 100644 --- a/packages/calcite-components/src/components/date-picker/readme.md +++ b/packages/calcite-components/src/components/date-picker/readme.md @@ -6,22 +6,24 @@ For comprehensive guidance on using and implementing `calcite-date-picker`, refe ## Properties -| Property | Attribute | Description | Type | Default | -| ---------------------------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | ----------- | -| `activeDate` | -- | Specifies the component's active date. | `Date` | `undefined` | -| `activeRange` | `active-range` | When `range` is true, specifies the active `range`. Where `"start"` specifies the starting range date and `"end"` the ending range date. | `"end" \| "start"` | `undefined` | -| `headingLevel` | `heading-level` | Specifies the heading level of the component's `heading` for proper document structure, without affecting visual styling. | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `undefined` | -| `max` | `max` | Specifies the latest allowed date (`"yyyy-mm-dd"`). | `string` | `undefined` | -| `maxAsDate` | -- | Specifies the latest allowed date as a full date object (`new Date("yyyy-mm-dd")`). | `Date` | `undefined` | -| `messageOverrides` | `message-overrides` | Use this property to override individual strings used by the component. | `DatePickerMessages` | `undefined` | -| `min` | `min` | Specifies the earliest allowed date (`"yyyy-mm-dd"`). | `string` | `undefined` | -| `minAsDate` | -- | Specifies the earliest allowed date as a full date object (`new Date("yyyy-mm-dd")`). | `Date` | `undefined` | -| `numberingSystem` | `numbering-system` | Specifies the Unicode numeral system used by the component for localization. This property cannot be dynamically changed. | `"arab" \| "arabext" \| "latn"` | `undefined` | -| `proximitySelectionDisabled` | `proximity-selection-disabled` | When `true`, disables the default behavior on the third click of narrowing or extending the range and instead starts a new range. | `boolean` | `false` | -| `range` | `range` | When `true`, activates the component's range mode to allow a start and end date. | `boolean` | `false` | -| `scale` | `scale` | Specifies the size of the component. | `"l" \| "m" \| "s"` | `"m"` | -| `value` | `value` | Specifies the selected date as a string (`"yyyy-mm-dd"`), or an array of strings for `range` values (`["yyyy-mm-dd", "yyyy-mm-dd"]`). | `string \| string[]` | `undefined` | -| `valueAsDate` | -- | Specifies the selected date as a full date object (`new Date("yyyy-mm-dd")`), or an array containing full date objects (`[new Date("yyyy-mm-dd"), new Date("yyyy-mm-dd")]`). | `Date \| Date[]` | `undefined` | +| Property | Attribute | Description | Type | Default | +| ---------------------------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | -------------- | +| `activeDate` | -- | Specifies the component's active date. | `Date` | `undefined` | +| `activeRange` | `active-range` | When `range` is true, specifies the active `range`. Where `"start"` specifies the starting range date and `"end"` the ending range date. | `"end" \| "start"` | `undefined` | +| `headingLevel` | `heading-level` | Specifies the heading level of the component's `heading` for proper document structure, without affecting visual styling. | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `undefined` | +| `layout` | `layout` | Defines the layout of the component. | `"horizontal" \| "vertical"` | `"horizontal"` | +| `max` | `max` | Specifies the latest allowed date (`"yyyy-mm-dd"`). | `string` | `undefined` | +| `maxAsDate` | -- | Specifies the latest allowed date as a full date object (`new Date("yyyy-mm-dd")`). | `Date` | `undefined` | +| `messageOverrides` | `message-overrides` | Use this property to override individual strings used by the component. | `DatePickerMessages` | `undefined` | +| `min` | `min` | Specifies the earliest allowed date (`"yyyy-mm-dd"`). | `string` | `undefined` | +| `minAsDate` | -- | Specifies the earliest allowed date as a full date object (`new Date("yyyy-mm-dd")`). | `Date` | `undefined` | +| `monthStyle` | `month-style` | Specifies the monthStyle used by the component. | `"abbreviated" \| "wide"` | `"wide"` | +| `numberingSystem` | `numbering-system` | Specifies the Unicode numeral system used by the component for localization. This property cannot be dynamically changed. | `"arab" \| "arabext" \| "latn"` | `undefined` | +| `proximitySelectionDisabled` | `proximity-selection-disabled` | When `true`, disables the default behavior on the third click of narrowing or extending the range and instead starts a new range. | `boolean` | `false` | +| `range` | `range` | When `true`, activates the component's range mode to allow a start and end date. | `boolean` | `false` | +| `scale` | `scale` | Specifies the size of the component. | `"l" \| "m" \| "s"` | `"m"` | +| `value` | `value` | Specifies the selected date as a string (`"yyyy-mm-dd"`), or an array of strings for `range` values (`["yyyy-mm-dd", "yyyy-mm-dd"]`). | `string \| string[]` | `undefined` | +| `valueAsDate` | -- | Specifies the selected date as a full date object (`new Date("yyyy-mm-dd")`), or an array containing full date objects (`[new Date("yyyy-mm-dd"), new Date("yyyy-mm-dd")]`). | `Date \| Date[]` | `undefined` | ## Events @@ -48,17 +50,23 @@ Type: `Promise` ### Depends on -- [calcite-date-picker-month-header](../date-picker-month-header) - [calcite-date-picker-month](../date-picker-month) ### Graph ```mermaid graph TD; - calcite-date-picker --> calcite-date-picker-month-header calcite-date-picker --> calcite-date-picker-month - calcite-date-picker-month-header --> calcite-icon calcite-date-picker-month --> calcite-date-picker-day + calcite-date-picker-month --> calcite-date-picker-month-header + calcite-date-picker-month-header --> calcite-select + calcite-date-picker-month-header --> calcite-option + calcite-date-picker-month-header --> calcite-action + calcite-select --> calcite-icon + calcite-select --> calcite-input-message + calcite-input-message --> calcite-icon + calcite-action --> calcite-loader + calcite-action --> calcite-icon calcite-input-date-picker --> calcite-date-picker style calcite-date-picker fill:#f9f,stroke:#333,stroke-width:4px ``` diff --git a/packages/calcite-components/src/components/icon/readme.md b/packages/calcite-components/src/components/icon/readme.md index a72cd7b0bcf..2f605dd9453 100644 --- a/packages/calcite-components/src/components/icon/readme.md +++ b/packages/calcite-components/src/components/icon/readme.md @@ -36,7 +36,6 @@ For comprehensive guidance on using and implementing `calcite-icon`, refer to th - [calcite-chip](../chip) - [calcite-combobox](../combobox) - [calcite-combobox-item](../combobox-item) -- [calcite-date-picker-month-header](../date-picker-month-header) - [calcite-dropdown-item](../dropdown-item) - [calcite-handle](../handle) - [calcite-input](../input) @@ -84,7 +83,6 @@ graph TD; calcite-chip --> calcite-icon calcite-combobox --> calcite-icon calcite-combobox-item --> calcite-icon - calcite-date-picker-month-header --> calcite-icon calcite-dropdown-item --> calcite-icon calcite-handle --> calcite-icon calcite-input --> calcite-icon diff --git a/packages/calcite-components/src/components/input-date-picker/readme.md b/packages/calcite-components/src/components/input-date-picker/readme.md index f6724f2c989..6239a7084ba 100644 --- a/packages/calcite-components/src/components/input-date-picker/readme.md +++ b/packages/calcite-components/src/components/input-date-picker/readme.md @@ -19,6 +19,7 @@ For comprehensive guidance on using and implementing `calcite-input-date-picker` | `messageOverrides` | `message-overrides` | Use this property to override individual strings used by the component. | `any` | `undefined` | | `min` | `min` | Specifies the earliest allowed date ("yyyy-mm-dd"). | `string` | `undefined` | | `minAsDate` | -- | Specifies the earliest allowed date as a full date object. | `Date` | `undefined` | +| `monthStyle` | `month-style` | Specifies the monthStyle used by the component. | `"abbreviated" \| "wide"` | `"wide"` | | `name` | `name` | Specifies the name of the component. Required to pass the component's `value` on form submission. | `string` | `undefined` | | `numberingSystem` | `numbering-system` | Specifies the Unicode numeral system used by the component for localization. This property cannot be dynamically changed. | `"arab" \| "arabext" \| "latn"` | `undefined` | | `open` | `open` | When `true`, displays the `calcite-date-picker` component. | `boolean` | `false` | @@ -93,10 +94,16 @@ graph TD; calcite-input-text --> calcite-icon calcite-input-text --> calcite-input-message calcite-input-message --> calcite-icon - calcite-date-picker --> calcite-date-picker-month-header calcite-date-picker --> calcite-date-picker-month - calcite-date-picker-month-header --> calcite-icon calcite-date-picker-month --> calcite-date-picker-day + calcite-date-picker-month --> calcite-date-picker-month-header + calcite-date-picker-month-header --> calcite-select + calcite-date-picker-month-header --> calcite-option + calcite-date-picker-month-header --> calcite-action + calcite-select --> calcite-icon + calcite-select --> calcite-input-message + calcite-action --> calcite-loader + calcite-action --> calcite-icon style calcite-input-date-picker fill:#f9f,stroke:#333,stroke-width:4px ``` diff --git a/packages/calcite-components/src/components/list/readme.md b/packages/calcite-components/src/components/list/readme.md index 6ce602fe36e..41a353ecffd 100644 --- a/packages/calcite-components/src/components/list/readme.md +++ b/packages/calcite-components/src/components/list/readme.md @@ -10,26 +10,27 @@ A general purpose list that enables users to construct list items that conform t ## Properties -| Property | Attribute | Description | Type | Default | -| --------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ----------- | -| `canPull` | -- | When provided, the method will be called to determine whether the element can move from the list. | `(detail: ListDragDetail) => boolean` | `undefined` | -| `canPut` | -- | When provided, the method will be called to determine whether the element can be added from another list. | `(detail: ListDragDetail) => boolean` | `undefined` | -| `disabled` | `disabled` | When `true`, interaction is prevented and the component is displayed with lower opacity. | `boolean` | `false` | -| `dragEnabled` | `drag-enabled` | When `true`, `calcite-list-item`s are sortable via a draggable button. | `boolean` | `false` | -| `filterEnabled` | `filter-enabled` | When `true`, an input appears at the top of the component that can be used by end users to filter `calcite-list-item`s. | `boolean` | `false` | -| `filterPlaceholder` | `filter-placeholder` | Placeholder text for the component's filter input field. | `string` | `undefined` | -| `filterProps` | -- | Specifies the properties to match against when filtering. If not set, all properties will be matched (label, description, metadata, value). | `string[]` | `undefined` | -| `filterText` | `filter-text` | Text for the component's filter input field. | `string` | `undefined` | -| `filteredData` | -- | The currently filtered `calcite-list-item` data. | `{ label: string; description: string; metadata: Record; value: string; }[]` | `[]` | -| `filteredItems` | -- | The currently filtered `calcite-list-item`s. | `HTMLCalciteListItemElement[]` | `[]` | -| `group` | `group` | The list's group identifier. To drag elements from one list into another, both lists must have the same group value. | `string` | `undefined` | -| `label` | `label` | Specifies an accessible name for the component. | `string` | `undefined` | -| `loading` | `loading` | When `true`, a busy indicator is displayed. | `boolean` | `false` | -| `messageOverrides` | `message-overrides` | Use this property to override individual strings used by the component. | `ListMessages` | `undefined` | -| `numberingSystem` | `numbering-system` | Specifies the Unicode numeral system used by the component for localization. | `"arab" \| "arabext" \| "latn"` | `undefined` | -| `selectedItems` | -- | The currently selected items. | `HTMLCalciteListItemElement[]` | `[]` | -| `selectionAppearance` | `selection-appearance` | Specifies the selection appearance - `"icon"` (displays a checkmark or dot) or `"border"` (displays a border). | `"border" \| "icon"` | `"icon"` | -| `selectionMode` | `selection-mode` | Specifies the selection mode of the component, where: `"multiple"` allows any number of selections, `"single"` allows only one selection, `"single-persist"` allows one selection and prevents de-selection, and `"none"` does not allow any selections. | `"multiple" \| "none" \| "single" \| "single-persist"` | `"none"` | +| Property | Attribute | Description | Type | Default | +| --------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- | --------------- | +| `canPull` | -- | When provided, the method will be called to determine whether the element can move from the list. | `(detail: ListDragDetail) => boolean` | `undefined` | +| `canPut` | -- | When provided, the method will be called to determine whether the element can be added from another list. | `(detail: ListDragDetail) => boolean` | `undefined` | +| `disabled` | `disabled` | When `true`, interaction is prevented and the component is displayed with lower opacity. | `boolean` | `false` | +| `dragEnabled` | `drag-enabled` | When `true`, `calcite-list-item`s are sortable via a draggable button. | `boolean` | `false` | +| `filterEnabled` | `filter-enabled` | When `true`, an input appears at the top of the component that can be used by end users to filter `calcite-list-item`s. | `boolean` | `false` | +| `filterPlaceholder` | `filter-placeholder` | Placeholder text for the component's filter input field. | `string` | `undefined` | +| `filterProps` | -- | Specifies the properties to match against when filtering. If not set, all properties will be matched (label, description, metadata, value). | `string[]` | `undefined` | +| `filterText` | `filter-text` | Text for the component's filter input field. | `string` | `undefined` | +| `filteredData` | -- | The currently filtered `calcite-list-item` data. | `{ label: string; description: string; metadata: Record; value: string; }[]` | `[]` | +| `filteredItems` | -- | The currently filtered `calcite-list-item`s. | `HTMLCalciteListItemElement[]` | `[]` | +| `group` | `group` | The list's group identifier. To drag elements from one list into another, both lists must have the same group value. | `string` | `undefined` | +| `interactionMode` | `interaction-mode` | Specifies the interaction mode of the component. `"interactive"` allows interaction styling and pointer changes on hover `"static"` does not allow interaction styling and pointer changes on hover The `"static"` value should only be used when `selectionMode` is `"none"`. | `"interactive" \| "static"` | `"interactive"` | +| `label` | `label` | Specifies an accessible name for the component. | `string` | `undefined` | +| `loading` | `loading` | When `true`, a busy indicator is displayed. | `boolean` | `false` | +| `messageOverrides` | `message-overrides` | Use this property to override individual strings used by the component. | `ListMessages` | `undefined` | +| `numberingSystem` | `numbering-system` | Specifies the Unicode numeral system used by the component for localization. | `"arab" \| "arabext" \| "latn"` | `undefined` | +| `selectedItems` | -- | The currently selected items. | `HTMLCalciteListItemElement[]` | `[]` | +| `selectionAppearance` | `selection-appearance` | Specifies the selection appearance - `"icon"` (displays a checkmark or dot) or `"border"` (displays a border). | `"border" \| "icon"` | `"icon"` | +| `selectionMode` | `selection-mode` | Specifies the selection mode of the component, where: `"multiple"` allows any number of selections, `"single"` allows only one selection, `"single-persist"` allows one selection and prevents de-selection, and `"none"` does not allow any selections. | `"multiple" \| "none" \| "single" \| "single-persist"` | `"none"` | ## Events diff --git a/packages/calcite-components/src/components/option/readme.md b/packages/calcite-components/src/components/option/readme.md index ca2be50c1bd..62ab3393889 100644 --- a/packages/calcite-components/src/components/option/readme.md +++ b/packages/calcite-components/src/components/option/readme.md @@ -13,6 +13,20 @@ For comprehensive guidance on using and implementing `calcite-option`, refer to | `selected` | `selected` | When `true`, the component is selected. | `boolean` | `undefined` | | `value` | `value` | The component's value. | `any` | `undefined` | +## Dependencies + +### Used by + +- [calcite-date-picker-month-header](../date-picker-month-header) + +### Graph + +```mermaid +graph TD; + calcite-date-picker-month-header --> calcite-option + style calcite-option fill:#f9f,stroke:#333,stroke-width:4px +``` + --- *Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/calcite-components/src/components/select/readme.md b/packages/calcite-components/src/components/select/readme.md index 5113c0252a2..13bace1ad17 100644 --- a/packages/calcite-components/src/components/select/readme.md +++ b/packages/calcite-components/src/components/select/readme.md @@ -46,13 +46,18 @@ Type: `Promise` ## CSS Custom Properties -| Name | Description | -| ---------------------------- | ---------------------------------------------------- | -| `--calcite-select-font-size` | The font size of `calcite-option`s in the component. | -| `--calcite-select-spacing` | The padding around the selected option text. | +| Name | Description | +| ----------------------------- | ---------------------------------------------------- | +| `--calcite-select-font-size` | The font size of `calcite-option`s in the component. | +| `--calcite-select-spacing` | The padding around the selected option text. | +| `--calcite-select-text-color` | The text color of the component. | ## Dependencies +### Used by + +- [calcite-date-picker-month-header](../date-picker-month-header) + ### Depends on - [calcite-icon](../icon) @@ -65,6 +70,7 @@ graph TD; calcite-select --> calcite-icon calcite-select --> calcite-input-message calcite-input-message --> calcite-icon + calcite-date-picker-month-header --> calcite-select style calcite-select fill:#f9f,stroke:#333,stroke-width:4px ``` From 7cdb7aaa1b7b176fc6ad88111db473774eb0d5e3 Mon Sep 17 00:00:00 2001 From: Ashley Rowles <157734991+arowles@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:46:00 -0700 Subject: [PATCH 15/17] deprecate: deprecate web-adaptor in favor of web-adapter (#10598) **Related Issue:** # ## Summary **added** web-adaptor --- packages/calcite-ui-icons/icons/web-adaptor-16.svg | 1 + packages/calcite-ui-icons/icons/web-adaptor-24.svg | 1 + packages/calcite-ui-icons/icons/web-adaptor-32.svg | 1 + 3 files changed, 3 insertions(+) create mode 100755 packages/calcite-ui-icons/icons/web-adaptor-16.svg create mode 100755 packages/calcite-ui-icons/icons/web-adaptor-24.svg create mode 100755 packages/calcite-ui-icons/icons/web-adaptor-32.svg diff --git a/packages/calcite-ui-icons/icons/web-adaptor-16.svg b/packages/calcite-ui-icons/icons/web-adaptor-16.svg new file mode 100755 index 00000000000..0eabb4cf218 --- /dev/null +++ b/packages/calcite-ui-icons/icons/web-adaptor-16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/web-adaptor-24.svg b/packages/calcite-ui-icons/icons/web-adaptor-24.svg new file mode 100755 index 00000000000..bcfdd625965 --- /dev/null +++ b/packages/calcite-ui-icons/icons/web-adaptor-24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/calcite-ui-icons/icons/web-adaptor-32.svg b/packages/calcite-ui-icons/icons/web-adaptor-32.svg new file mode 100755 index 00000000000..70002a3f3bd --- /dev/null +++ b/packages/calcite-ui-icons/icons/web-adaptor-32.svg @@ -0,0 +1 @@ + \ No newline at end of file From 3c338eb6a3f0edc751f888477299d3cacbb696de Mon Sep 17 00:00:00 2001 From: Erik Harper Date: Fri, 25 Oct 2024 14:04:54 -0700 Subject: [PATCH 16/17] feat(tile): add design tokens (#10476) **Related Issue:** #7180 ## Summary Adds design tokens for the Tile component. --calcite-tile-accent-color-press: When the parent `calcite-tile-group` has a `selectionMode` that is not `"none"`, specifies the color of the component's selection elements, such as the radio, checkbox, and border. --calcite-tile-background-color: Specifies the component's background color. --calcite-tile-border-color: Specifies the component's border color. --calcite-tile-corner-radius: Specifies the component's corner radius. --calcite-tile-heading-text-color: Specifies the component's `heading` text color. --calcite-tile-link-color: When the `href` property exists, specifies the color of the component's link elements, such as the border, icon and heading text on hover, focus and press. --calcite-tile-shadow: Specifies the shadow around the component. --calcite-tile-text-color: Specifies the component's `description` and `icon` text color, but not the `heading` text color. --- packages/calcite-components/.stylelintrc.cjs | 9 +- .../calcite-components/src/components.d.ts | 100 +++++ .../src/components/tile/tile.e2e.ts | 351 +++++++++++++++++- .../src/components/tile/tile.scss | 102 ++--- .../src/custom-theme.stories.ts | 4 +- .../src/custom-theme/tile.ts | 21 ++ .../src/demos/tile-group.html | 263 +++++++++++++ 7 files changed, 800 insertions(+), 50 deletions(-) create mode 100644 packages/calcite-components/src/custom-theme/tile.ts diff --git a/packages/calcite-components/.stylelintrc.cjs b/packages/calcite-components/.stylelintrc.cjs index 0998dad6911..f36f9230a75 100644 --- a/packages/calcite-components/.stylelintrc.cjs +++ b/packages/calcite-components/.stylelintrc.cjs @@ -1,7 +1,14 @@ // @ts-check // ⚠️ AUTO-GENERATED CODE - DO NOT EDIT -const customFunctions = []; +const customFunctions = [ + "get-trailing-text-input-padding", + "medium-modular-scale", + "modular-scale", + "scale-duration", + "scaleDuration", + "small-modular-scale" +]; // ⚠️ END OF AUTO-GENERATED CODE const scssPatternRules = [ diff --git a/packages/calcite-components/src/components.d.ts b/packages/calcite-components/src/components.d.ts index 9dee40c58d4..70288fce667 100644 --- a/packages/calcite-components/src/components.d.ts +++ b/packages/calcite-components/src/components.d.ts @@ -9,91 +9,191 @@ import { Alignment, Appearance, CollapseDirection, FlipContext, IconType, Intera import { RequestedItem } from "./components/accordion/interfaces"; import { IconNameOrString } from "./components/icon/interfaces"; import { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces"; +import { ActionMessages } from "./components/action/assets/action/t9n"; import { FlipPlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; +import { ActionBarMessages } from "./components/action-bar/assets/action-bar/t9n"; import { Columns } from "./components/action-group/interfaces"; +import { ActionGroupMessages } from "./components/action-group/assets/action-group/t9n"; +import { ActionPadMessages } from "./components/action-pad/assets/action-pad/t9n"; import { AlertDuration, AlertQueue } from "./components/alert/interfaces"; import { NumberingSystem } from "./utils/locale"; +import { AlertMessages } from "./components/alert/assets/alert/t9n"; import { HeadingLevel } from "./components/functional/Heading"; +import { BlockMessages } from "./components/block/assets/block/t9n"; import { BlockSectionToggleDisplay } from "./components/block-section/interfaces"; +import { BlockSectionMessages } from "./components/block-section/assets/block-section/t9n"; import { ButtonAlignment, DropdownIconType } from "./components/button/interfaces"; +import { ButtonMessages } from "./components/button/assets/button/t9n"; +import { CardMessages } from "./components/card/assets/card/t9n"; import { ArrowType, AutoplayType } from "./components/carousel/interfaces"; +import { CarouselMessages } from "./components/carousel/assets/carousel/t9n"; import { MutableValidityState } from "./utils/form"; +import { ChipMessages } from "./components/chip/assets/chip/t9n"; import { ColorValue, InternalColor } from "./components/color-picker/interfaces"; import { Format } from "./components/color-picker/utils"; +import { ColorPickerMessages } from "./components/color-picker/assets/color-picker/t9n"; import { ComboboxChildElement, SelectionDisplay } from "./components/combobox/interfaces"; +import { ComboboxMessages } from "./components/combobox/assets/combobox/t9n"; +import { DatePickerMessages } from "./components/date-picker/assets/date-picker/t9n"; import { HoverRange } from "./utils/date"; import { DateLocaleData } from "./components/date-picker/utils"; +import { DialogMessages } from "./components/dialog/assets/dialog/t9n"; import { DialogPlacement } from "./components/dialog/interfaces"; import { RequestedItem as RequestedItem2 } from "./components/dropdown-group/interfaces"; import { ItemKeyboardEvent } from "./components/dropdown/interfaces"; +import { FilterMessages } from "./components/filter/assets/filter/t9n"; import { FlowItemLikeElement } from "./components/flow/interfaces"; +import { FlowItemMessages } from "./components/flow-item/assets/flow-item/t9n"; import { ColorStop, DataSeries } from "./components/graph/interfaces"; +import { HandleMessages } from "./components/handle/assets/handle/t9n"; import { HandleChange, HandleNudge } from "./components/handle/interfaces"; +import { InlineEditableMessages } from "./components/inline-editable/assets/inline-editable/t9n"; import { InputPlacement } from "./components/input/interfaces"; +import { InputMessages } from "./components/input/assets/input/t9n"; +import { InputDatePickerMessages } from "./components/input-date-picker/assets/input-date-picker/t9n"; +import { InputNumberMessages } from "./components/input-number/assets/input-number/t9n"; +import { InputTextMessages } from "./components/input-text/assets/input-text/t9n"; +import { InputTimePickerMessages } from "./components/input-time-picker/assets/input-time-picker/t9n"; +import { TimePickerMessages } from "./components/time-picker/assets/time-picker/t9n"; +import { InputTimeZoneMessages } from "./components/input-time-zone/assets/input-time-zone/t9n"; import { OffsetStyle, TimeZoneMode } from "./components/input-time-zone/interfaces"; import { ListDragDetail } from "./components/list/interfaces"; import { ItemData } from "./components/list-item/interfaces"; +import { ListMessages } from "./components/list/assets/list/t9n"; import { SelectionAppearance } from "./components/list/resources"; +import { ListItemMessages } from "./components/list-item/assets/list-item/t9n"; +import { MenuMessages } from "./components/menu/assets/menu/t9n"; +import { MenuItemMessages } from "./components/menu-item/assets/menu-item/t9n"; import { MenuItemCustomEvent } from "./components/menu-item/interfaces"; import { MeterFillType, MeterLabelType } from "./components/meter/interfaces"; +import { ModalMessages } from "./components/modal/assets/modal/t9n"; +import { NoticeMessages } from "./components/notice/assets/notice/t9n"; +import { PaginationMessages } from "./components/pagination/assets/pagination/t9n"; +import { PanelMessages } from "./components/panel/assets/panel/t9n"; import { ItemData as ItemData1, ListFocusId } from "./components/pick-list/shared-list-logic"; import { ICON_TYPES } from "./components/pick-list/resources"; +import { PickListItemMessages } from "./components/pick-list-item/assets/pick-list-item/t9n"; +import { PopoverMessages } from "./components/popover/assets/popover/t9n"; +import { RatingMessages } from "./components/rating/assets/rating/t9n"; +import { ScrimMessages } from "./components/scrim/assets/scrim/t9n"; import { DisplayMode } from "./components/sheet/interfaces"; import { DisplayMode as DisplayMode1 } from "./components/shell-panel/interfaces"; +import { ShellPanelMessages } from "./components/shell-panel/assets/shell-panel/t9n"; import { DragDetail } from "./utils/sortableComponent"; import { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail, StepperLayout } from "./components/stepper/interfaces"; +import { StepperMessages } from "./components/stepper/assets/stepper/t9n"; +import { StepperItemMessages } from "./components/stepper-item/assets/stepper-item/t9n"; import { TabID, TabLayout, TabPosition } from "./components/tabs/interfaces"; +import { TabNavMessages } from "./components/tab-nav/assets/tab-nav/t9n"; import { Element } from "@stencil/core"; import { TabChangeEventDetail, TabCloseEventDetail } from "./components/tab/interfaces"; +import { TabTitleMessages } from "./components/tab-title/assets/tab-title/t9n"; import { RowType, TableInteractionMode, TableLayout, TableRowFocusEvent, TableSelectionDisplay } from "./components/table/interfaces"; +import { TableMessages } from "./components/table/assets/table/t9n"; +import { TableCellMessages } from "./components/table-cell/assets/table-cell/t9n"; +import { TableHeaderMessages } from "./components/table-header/assets/table-header/t9n"; +import { TextAreaMessages } from "./components/text-area/assets/text-area/t9n"; import { TileSelectType } from "./components/tile-select/interfaces"; import { TileSelectGroupLayout } from "./components/tile-select-group/interfaces"; +import { TipMessages } from "./components/tip/assets/tip/t9n"; +import { TipManagerMessages } from "./components/tip-manager/assets/tip-manager/t9n"; import { TreeItemSelectDetail } from "./components/tree-item/interfaces"; +import { ValueListMessages } from "./components/value-list/assets/value-list/t9n"; import { ListItemAndHandle } from "./components/value-list-item/interfaces"; export { Alignment, Appearance, CollapseDirection, FlipContext, IconType, InteractionMode, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces"; export { RequestedItem } from "./components/accordion/interfaces"; export { IconNameOrString } from "./components/icon/interfaces"; export { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces"; +export { ActionMessages } from "./components/action/assets/action/t9n"; export { FlipPlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; +export { ActionBarMessages } from "./components/action-bar/assets/action-bar/t9n"; export { Columns } from "./components/action-group/interfaces"; +export { ActionGroupMessages } from "./components/action-group/assets/action-group/t9n"; +export { ActionPadMessages } from "./components/action-pad/assets/action-pad/t9n"; export { AlertDuration, AlertQueue } from "./components/alert/interfaces"; export { NumberingSystem } from "./utils/locale"; +export { AlertMessages } from "./components/alert/assets/alert/t9n"; export { HeadingLevel } from "./components/functional/Heading"; +export { BlockMessages } from "./components/block/assets/block/t9n"; export { BlockSectionToggleDisplay } from "./components/block-section/interfaces"; +export { BlockSectionMessages } from "./components/block-section/assets/block-section/t9n"; export { ButtonAlignment, DropdownIconType } from "./components/button/interfaces"; +export { ButtonMessages } from "./components/button/assets/button/t9n"; +export { CardMessages } from "./components/card/assets/card/t9n"; export { ArrowType, AutoplayType } from "./components/carousel/interfaces"; +export { CarouselMessages } from "./components/carousel/assets/carousel/t9n"; export { MutableValidityState } from "./utils/form"; +export { ChipMessages } from "./components/chip/assets/chip/t9n"; export { ColorValue, InternalColor } from "./components/color-picker/interfaces"; export { Format } from "./components/color-picker/utils"; +export { ColorPickerMessages } from "./components/color-picker/assets/color-picker/t9n"; export { ComboboxChildElement, SelectionDisplay } from "./components/combobox/interfaces"; +export { ComboboxMessages } from "./components/combobox/assets/combobox/t9n"; +export { DatePickerMessages } from "./components/date-picker/assets/date-picker/t9n"; export { HoverRange } from "./utils/date"; export { DateLocaleData } from "./components/date-picker/utils"; +export { DialogMessages } from "./components/dialog/assets/dialog/t9n"; export { DialogPlacement } from "./components/dialog/interfaces"; export { RequestedItem as RequestedItem2 } from "./components/dropdown-group/interfaces"; export { ItemKeyboardEvent } from "./components/dropdown/interfaces"; +export { FilterMessages } from "./components/filter/assets/filter/t9n"; export { FlowItemLikeElement } from "./components/flow/interfaces"; +export { FlowItemMessages } from "./components/flow-item/assets/flow-item/t9n"; export { ColorStop, DataSeries } from "./components/graph/interfaces"; +export { HandleMessages } from "./components/handle/assets/handle/t9n"; export { HandleChange, HandleNudge } from "./components/handle/interfaces"; +export { InlineEditableMessages } from "./components/inline-editable/assets/inline-editable/t9n"; export { InputPlacement } from "./components/input/interfaces"; +export { InputMessages } from "./components/input/assets/input/t9n"; +export { InputDatePickerMessages } from "./components/input-date-picker/assets/input-date-picker/t9n"; +export { InputNumberMessages } from "./components/input-number/assets/input-number/t9n"; +export { InputTextMessages } from "./components/input-text/assets/input-text/t9n"; +export { InputTimePickerMessages } from "./components/input-time-picker/assets/input-time-picker/t9n"; +export { TimePickerMessages } from "./components/time-picker/assets/time-picker/t9n"; +export { InputTimeZoneMessages } from "./components/input-time-zone/assets/input-time-zone/t9n"; export { OffsetStyle, TimeZoneMode } from "./components/input-time-zone/interfaces"; export { ListDragDetail } from "./components/list/interfaces"; export { ItemData } from "./components/list-item/interfaces"; +export { ListMessages } from "./components/list/assets/list/t9n"; export { SelectionAppearance } from "./components/list/resources"; +export { ListItemMessages } from "./components/list-item/assets/list-item/t9n"; +export { MenuMessages } from "./components/menu/assets/menu/t9n"; +export { MenuItemMessages } from "./components/menu-item/assets/menu-item/t9n"; export { MenuItemCustomEvent } from "./components/menu-item/interfaces"; export { MeterFillType, MeterLabelType } from "./components/meter/interfaces"; +export { ModalMessages } from "./components/modal/assets/modal/t9n"; +export { NoticeMessages } from "./components/notice/assets/notice/t9n"; +export { PaginationMessages } from "./components/pagination/assets/pagination/t9n"; +export { PanelMessages } from "./components/panel/assets/panel/t9n"; export { ItemData as ItemData1, ListFocusId } from "./components/pick-list/shared-list-logic"; export { ICON_TYPES } from "./components/pick-list/resources"; +export { PickListItemMessages } from "./components/pick-list-item/assets/pick-list-item/t9n"; +export { PopoverMessages } from "./components/popover/assets/popover/t9n"; +export { RatingMessages } from "./components/rating/assets/rating/t9n"; +export { ScrimMessages } from "./components/scrim/assets/scrim/t9n"; export { DisplayMode } from "./components/sheet/interfaces"; export { DisplayMode as DisplayMode1 } from "./components/shell-panel/interfaces"; +export { ShellPanelMessages } from "./components/shell-panel/assets/shell-panel/t9n"; export { DragDetail } from "./utils/sortableComponent"; export { StepperItemChangeEventDetail, StepperItemEventDetail, StepperItemKeyEventDetail, StepperLayout } from "./components/stepper/interfaces"; +export { StepperMessages } from "./components/stepper/assets/stepper/t9n"; +export { StepperItemMessages } from "./components/stepper-item/assets/stepper-item/t9n"; export { TabID, TabLayout, TabPosition } from "./components/tabs/interfaces"; +export { TabNavMessages } from "./components/tab-nav/assets/tab-nav/t9n"; export { Element } from "@stencil/core"; export { TabChangeEventDetail, TabCloseEventDetail } from "./components/tab/interfaces"; +export { TabTitleMessages } from "./components/tab-title/assets/tab-title/t9n"; export { RowType, TableInteractionMode, TableLayout, TableRowFocusEvent, TableSelectionDisplay } from "./components/table/interfaces"; +export { TableMessages } from "./components/table/assets/table/t9n"; +export { TableCellMessages } from "./components/table-cell/assets/table-cell/t9n"; +export { TableHeaderMessages } from "./components/table-header/assets/table-header/t9n"; +export { TextAreaMessages } from "./components/text-area/assets/text-area/t9n"; export { TileSelectType } from "./components/tile-select/interfaces"; export { TileSelectGroupLayout } from "./components/tile-select-group/interfaces"; +export { TipMessages } from "./components/tip/assets/tip/t9n"; +export { TipManagerMessages } from "./components/tip-manager/assets/tip-manager/t9n"; export { TreeItemSelectDetail } from "./components/tree-item/interfaces"; +export { ValueListMessages } from "./components/value-list/assets/value-list/t9n"; export { ListItemAndHandle } from "./components/value-list-item/interfaces"; export namespace Components { interface CalciteAccordion { diff --git a/packages/calcite-components/src/components/tile/tile.e2e.ts b/packages/calcite-components/src/components/tile/tile.e2e.ts index 1f7580e132e..9e319b129a7 100644 --- a/packages/calcite-components/src/components/tile/tile.e2e.ts +++ b/packages/calcite-components/src/components/tile/tile.e2e.ts @@ -1,8 +1,18 @@ import { newE2EPage } from "@stencil/core/testing"; -import { accessible, defaults, disabled, focusable, hidden, reflects, renders, slots } from "../../tests/commonTests"; +import { + accessible, + defaults, + disabled, + focusable, + hidden, + reflects, + renders, + slots, + themed, +} from "../../tests/commonTests"; import { html } from "../../../support/formatting"; import { isElementFocused } from "../../tests/utils"; -import { SLOTS } from "./resources"; +import { CSS, SLOTS } from "./resources"; describe("calcite-tile", () => { describe("accessibility", () => { @@ -211,4 +221,341 @@ describe("calcite-tile", () => { expect(description).toBeNull(); }); }); + + describe("theme", () => { + describe("default", () => { + themed( + html` + + + `, + { + "--calcite-tile-background-color": { + shadowSelector: `.${CSS.container}`, + targetProp: "backgroundColor", + }, + "--calcite-tile-border-color": { + shadowSelector: `.${CSS.container}`, + targetProp: "outlineColor", + }, + "--calcite-tile-corner-radius": { + shadowSelector: `.${CSS.container}`, + targetProp: "borderRadius", + }, + "--calcite-tile-text-color": { + shadowSelector: `.${CSS.container}`, + targetProp: "color", + }, + "--calcite-tile-heading-text-color": { + shadowSelector: `.${CSS.heading}`, + targetProp: "color", + }, + "--calcite-tile-shadow": { + selector: `calcite-tile`, + targetProp: "boxShadow", + }, + }, + ); + }); + describe("default changing text colors on hover", () => { + themed( + html` + + + `, + { + "--calcite-tile-text-color": { + shadowSelector: `.${CSS.container}`, + targetProp: "color", + state: "hover", + }, + "--calcite-tile-heading-text-color": { + shadowSelector: `.${CSS.heading}`, + targetProp: "color", + state: "hover", + }, + }, + ); + }); + describe("--calcite-tile-text-color", () => { + describe("applies to the selection icon", () => { + themed( + html` + + + `, + { + "--calcite-tile-text-color": { + shadowSelector: `.${CSS.selectionIcon}`, + targetProp: "color", + }, + }, + ); + }); + describe("applies to the icon", () => { + themed( + html` + + + `, + { + "--calcite-tile-text-color": { + shadowSelector: `.${CSS.icon}`, + targetProp: "color", + }, + }, + ); + }); + }); + describe("--calcite-tile-accent-color-press", () => { + describe("applies to border on hover", () => { + themed( + html` + + + `, + { + "--calcite-tile-accent-color-press": { + shadowSelector: `.${CSS.container}`, + targetProp: "outlineColor", + state: "hover", + }, + }, + ); + }); + describe("applies to selection icon on hover", () => { + themed( + html` + + + `, + { + "--calcite-tile-accent-color-press": { + shadowSelector: `.${CSS.selectionIcon}`, + targetProp: "outlineColor", + state: "hover", + }, + }, + ); + }); + describe("applies to selected item's border", () => { + themed( + html` + + + `, + { + "--calcite-tile-accent-color-press": { + shadowSelector: `.${CSS.container}`, + targetProp: "outlineColor", + }, + }, + ); + }); + describe("applies to selected item's selection icon", () => { + themed( + html` + + + `, + { + "--calcite-tile-accent-color-press": { + shadowSelector: `.${CSS.selectionIcon}`, + targetProp: "color", + }, + }, + ); + }); + describe(`applies to selected item's border using selection-appearance="border"`, () => { + themed( + html` + + + `, + { + "--calcite-tile-accent-color-press": { + shadowSelector: `.${CSS.container}`, + targetProp: "boxShadow", + }, + }, + ); + }); + describe(`selection-mode="none"`, () => { + describe("applies --calcite-tile-border-color when idle and selected attribute is present", () => { + themed( + html` + + + `, + { + "--calcite-tile-border-color": { + shadowSelector: `.${CSS.container}`, + targetProp: "outlineColor", + }, + }, + ); + }); + describe("applies --calcite-tile-border-color when hovered", () => { + themed( + html` + + + `, + { + "--calcite-tile-border-color": { + shadowSelector: `.${CSS.container}`, + targetProp: "outlineColor", + state: "hover", + }, + }, + ); + }); + }); + }); + describe("link", () => { + describe("--calcite-tile-link-color applies to heading text on hover with --calcite-color-text-link as a fallback", () => { + themed( + html` + + + `, + { + "--calcite-tile-link-color": { + shadowSelector: `.${CSS.heading}`, + targetProp: "color", + state: "hover", + }, + "--calcite-color-text-link": { + shadowSelector: `.${CSS.heading}`, + targetProp: "color", + state: "hover", + }, + }, + ); + }); + describe("--calcite-tile-link-color applies to icon on hover with --calcite-color-text-link as a fallback", () => { + themed( + html` + + + `, + { + "--calcite-tile-link-color": { + shadowSelector: `.${CSS.heading}`, + targetProp: "color", + state: "hover", + }, + "--calcite-color-text-link": { + shadowSelector: `.${CSS.icon}`, + targetProp: "color", + state: "hover", + }, + }, + ); + }); + describe("--calcite-tile-link-color applies to border on hover with --calcite-color-text-link as a fallback", () => { + themed( + html` + + + `, + { + "--calcite-tile-link-color": { + shadowSelector: `.${CSS.heading}`, + targetProp: "color", + state: "hover", + }, + "--calcite-color-text-link": { + shadowSelector: `.${CSS.container}`, + targetProp: "outlineColor", + state: "hover", + }, + }, + ); + }); + }); + }); }); diff --git a/packages/calcite-components/src/components/tile/tile.scss b/packages/calcite-components/src/components/tile/tile.scss index c9b1f43fedc..2217e17787c 100644 --- a/packages/calcite-components/src/components/tile/tile.scss +++ b/packages/calcite-components/src/components/tile/tile.scss @@ -3,46 +3,53 @@ * * These properties can be overridden using the component's tag as selector. * - * @prop --calcite-tile-background-color: Specifies the background color of the component. - * @prop --calcite-tile-border-color: Specifies the border color of the component. - * @prop --calcite-tile-description-text-color: Specifies the description text color of the component. - * @prop --calcite-tile-heading-text-color: Specifies the heading text color of the component. + * @prop --calcite-tile-accent-color-press: When the parent `calcite-tile-group` has a `selectionMode` that is not `"none"`, specifies the color of the component's selection elements, such as the radio, checkbox, and border. + * @prop --calcite-tile-background-color: Specifies the component's background color. + * @prop --calcite-tile-border-color: Specifies the component's border color. + * @prop --calcite-tile-corner-radius: Specifies the component's corner radius. + * @prop --calcite-tile-heading-text-color: Specifies the component's `heading` text color. + * @prop --calcite-tile-link-color: When `href` is present, specifies the component's link color. + * @prop --calcite-tile-shadow: Specifies the shadow around the component. + * @prop --calcite-tile-text-color: Specifies the component's `description` and `icon` text color, but not the `heading` text color. */ :host { - --calcite-tile-background-color: var(--calcite-color-foreground-1); - --calcite-tile-border-color: var(--calcite-color-border-2); - --calcite-tile-description-text-color: var(--calcite-color-text-3); - --calcite-tile-heading-text-color: var(--calcite-color-text-2); - --calcite-icon-color: var(--calcite-color-text-3); - + box-shadow: var(--calcite-tile-shadow, var(--calcite-shadow-none)); box-sizing: border-box; display: inline-block; } .container { - background-color: var(--calcite-tile-background-color); + background-color: var(--calcite-tile-background-color, var(--calcite-color-foreground-1)); block-size: var(--calcite-container-size-content-fluid); + border-radius: var(--calcite-tile-corner-radius, var(--calcite-corner-radius)); box-sizing: border-box; + color: var(--calcite-tile-text-color, var(--calcite-color-text-3)); inline-size: var(--calcite-container-size-content-fluid); - outline: var(--calcite-border-width-sm, 1px) solid var(--calcite-tile-border-color); + outline: var(--calcite-border-width-sm, 1px) solid var(--calcite-tile-border-color, var(--calcite-color-border-2)); user-select: none; + + .selection-icon { + color: var(--calcite-tile-text-color, var(--calcite-color-text-3)); + } + &.interactive { cursor: pointer; + &:hover, &:focus, &.selected { - outline-color: var(--calcite-color-brand); + outline-color: var(--calcite-tile-accent-color-press, var(--calcite-color-brand)); position: relative; .selection-icon { - --calcite-icon-color: var(--calcite-color-brand); + color: var(--calcite-tile-accent-color-press, var(--calcite-color-brand)); } } &.selected { z-index: var(--calcite-z-index); } &:focus { - box-shadow: inset 0 0 0 1px var(--calcite-color-brand); + box-shadow: inset 0 0 0 1px var(--calcite-tile-accent-color-press, var(--calcite-color-brand)); z-index: var(--calcite-z-index-sticky); } } @@ -70,12 +77,17 @@ } .heading { - color: var(--calcite-tile-heading-text-color); + color: var(--calcite-tile-heading-text-color, var(--calcite-color-text-2)); font-weight: var(--calcite-font-weight-medium); line-height: 1.20313rem; overflow-wrap: break-word; } +.description { + font-weight: var(--calcite-font-weight-regular); + overflow-wrap: break-word; +} + /* [Deprecated] Use the content-top slot for rendering icon with alignment="center" instead */ .large-visual-deprecated { align-items: center; @@ -93,26 +105,15 @@ } } -.description { - color: var(--calcite-tile-description-text-color); - font-weight: var(--calcite-font-weight-regular); - overflow-wrap: break-word; -} - :host([alignment="center"]) { .icon { align-self: center; } - .text-content-container { - justify-content: center; - } .text-content { text-align: center; } slot[name="content-start"]::slotted(*), - slot[name="content-end"]::slotted(*), - slot[name="content-top"]::slotted(*), - slot[name="content-bottom"]::slotted(*) { + slot[name="content-end"]::slotted(*) { align-self: center; } } @@ -190,7 +191,7 @@ :host([selection-appearance="border"][layout="vertical"]) { .container.selected:focus::before { block-size: 100%; - box-shadow: inset 0 0 0 1px var(--calcite-color-brand); + box-shadow: inset 0 0 0 1px var(--calcite-tile-accent-color-press, var(--calcite-color-brand)); content: ""; display: block; inline-size: 100%; @@ -202,58 +203,67 @@ :host([selection-appearance="border"][layout="horizontal"]) { .container.selected { - box-shadow: inset 0 -4px 0 0 var(--calcite-color-brand); + box-shadow: inset 0 -4px 0 0 var(--calcite-tile-accent-color-press, var(--calcite-color-brand)); } } :host([selection-appearance="border"][layout="vertical"]) { .container.selected { - box-shadow: inset 4px 0 0 0 var(--calcite-color-brand); + box-shadow: inset 4px 0 0 0 var(--calcite-tile-accent-color-press, var(--calcite-color-brand)); + } +} + +:host(:hover:not([disabled])), +:host([active]:not([disabled])) { + .heading { + color: var(--calcite-tile-heading-text-color, var(--calcite-color-text-1)); + } + .description { + color: var(--calcite-tile-text-color, var(--calcite-color-text-2)); } } :host([href]:focus:not([disabled])), :host([href]:hover:not([disabled])) { - --calcite-tile-border-color: var(--calcite-color-text-link); - --calcite-tile-heading-text-color: var(--calcite-color-text-link); - --calcite-icon-color: var(--calcite-color-text-link); .container { + outline-color: var(--calcite-tile-link-color, var(--calcite-color-text-link)); position: relative; z-index: var(--calcite-z-index); } + .icon { + color: var(--calcite-tile-link-color, var(--calcite-color-text-link)); + } + .heading { + color: var(--calcite-tile-link-color, var(--calcite-color-text-link)); + } } :host([href]:active:not([disabled])) { .container { - box-shadow: 0 0 0 3px var(--calcite-tile-border-color); + box-shadow: inset 0 0 0 1px var(--calcite-tile-link-color, var(--calcite-color-text-link)); + outline-color: var(--calcite-tile-link-color, var(--calcite-color-text-link)); } } :host([embed]) { .container { - box-shadow: none; padding: 0; } } :host([selection-mode="none"]) { .container { - outline-color: var(--calcite-tile-border-color); + &:hover, + &.selected { + outline-color: var(--calcite-tile-border-color, var(--calcite-color-border-2)); + } &:focus { - outline-color: var(--calcite-color-brand); - position: relative; + outline-color: var(--calcite-tile-accent-color-press, var(--calcite-color-brand)); } } } @include disabled(); - -:host(:hover:not([disabled])), -:host([active]:not([disabled])) { - --calcite-tile-description-text-color: var(--calcite-color-text-2); - --calcite-tile-heading-text-color: var(--calcite-color-text-1); -} - @include base-component(); ::slotted(*) { diff --git a/packages/calcite-components/src/custom-theme.stories.ts b/packages/calcite-components/src/custom-theme.stories.ts index 7a1aa0767eb..074a384ea5e 100644 --- a/packages/calcite-components/src/custom-theme.stories.ts +++ b/packages/calcite-components/src/custom-theme.stories.ts @@ -35,6 +35,7 @@ import { slider } from "./custom-theme/slider"; import { tabs } from "./custom-theme/tabs"; import { textArea, textAreaTokens } from "./custom-theme/text-area"; import { avatarIcon, avatarInitials, avatarThumbnail, avatarTokens } from "./custom-theme/avatar"; +import { tileTokens, tile } from "./custom-theme/tile"; const globalTokens = { calciteColorBrand: "#007ac2", @@ -115,7 +116,7 @@ const kitchenSink = (args: Record, useTestValues = false) =>
${checkbox}
${chips} ${pagination} ${slider}
-
${datePicker} ${tabs} ${loader} ${calciteSwitch} ${avatarIcon} ${avatarInitials} ${avatarThumbnail} ${progress} ${handle} ${textArea} ${popover}
+
${datePicker} ${tabs} ${loader} ${calciteSwitch} ${avatarIcon} ${avatarInitials} ${avatarThumbnail} ${progress} ${handle} ${textArea} ${popover} ${tile}
${alert}
@@ -140,6 +141,7 @@ const componentTokens = { ...progressTokens, ...inputTokens, ...textAreaTokens, + ...tileTokens, }; export default { diff --git a/packages/calcite-components/src/custom-theme/tile.ts b/packages/calcite-components/src/custom-theme/tile.ts new file mode 100644 index 00000000000..de91065f42e --- /dev/null +++ b/packages/calcite-components/src/custom-theme/tile.ts @@ -0,0 +1,21 @@ +import { html } from "../../support/formatting"; + +export const tileTokens = { + calciteTileAccentColorPress: "", + calciteTileBackgroundColor: "", + calciteTileBorderColor: "", + calciteTileCornerRadius: "", + calciteTileHeadingTextColor: "", + calciteTileLinkColor: "", + calciteTileShadow: "", + calciteTileTextColor: "", +}; + +export const tile = html` + +`; diff --git a/packages/calcite-components/src/demos/tile-group.html b/packages/calcite-components/src/demos/tile-group.html index c139d6c1fe3..7036090ecaa 100644 --- a/packages/calcite-components/src/demos/tile-group.html +++ b/packages/calcite-components/src/demos/tile-group.html @@ -1592,6 +1592,181 @@
+ + + +
+
themed single
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + +
+
themed multiple
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+
+
@@ -2389,6 +2564,94 @@
+ + + +
+
themed
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+