From 0cbf766156e3b0ec7a662571606af62895e23f59 Mon Sep 17 00:00:00 2001 From: JC Franco Date: Tue, 7 Jan 2025 12:14:07 -0800 Subject: [PATCH 1/7] fix(text-area): make `readOnly` prop writable (#11218) **Related Issue:** #11217 #10731 ## Summary Removes unintentional `@readonly` on `readOnly` prop. For context, with #10310 any props with the `@readonly` tag will be made read-only. --- .../calcite-components/src/components/text-area/text-area.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/calcite-components/src/components/text-area/text-area.tsx b/packages/calcite-components/src/components/text-area/text-area.tsx index deeb4224247..e3708d630f6 100644 --- a/packages/calcite-components/src/components/text-area/text-area.tsx +++ b/packages/calcite-components/src/components/text-area/text-area.tsx @@ -205,7 +205,6 @@ export class TextArea /** * When `true`, the component's `value` can be read, but cannot be modified. * - * @readonly * @mdn [readOnly](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly) */ @property({ reflect: true }) readOnly = false; From 3f84096d0cfb7d3ceb1c833ce0f7393c2a57ef52 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 7 Jan 2025 20:15:52 +0000 Subject: [PATCH 2/7] chore: release next --- package-lock.json | 6 +++--- 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 | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index bcc7feced73..57cef4c8a85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34970,7 +34970,7 @@ }, "packages/calcite-components": { "name": "@esri/calcite-components", - "version": "3.0.0-next.90", + "version": "3.0.0-next.91", "license": "SEE LICENSE.md", "dependencies": { "@arcgis/components-controllers": "^4.32.0-next.69", @@ -34999,10 +34999,10 @@ }, "packages/calcite-components-react": { "name": "@esri/calcite-components-react", - "version": "3.0.0-next.90", + "version": "3.0.0-next.91", "license": "SEE LICENSE.md", "dependencies": { - "@esri/calcite-components": "3.0.0-next.90", + "@esri/calcite-components": "3.0.0-next.91", "@lit/react": "1.0.6" }, "peerDependencies": { diff --git a/packages/calcite-components-react/CHANGELOG.md b/packages/calcite-components-react/CHANGELOG.md index 51d9dbd58b6..897bb0ae616 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. +## [3.0.0-next.91](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@3.0.0-next.90...@esri/calcite-components-react@3.0.0-next.91) (2025-01-07) + +**Note:** Version bump only for package @esri/calcite-components-react + ## [3.0.0-next.90](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@3.0.0-next.89...@esri/calcite-components-react@3.0.0-next.90) (2025-01-06) **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 be14ab3a8e0..c4f863d992b 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": "3.0.0-next.90", + "version": "3.0.0-next.91", "description": "A set of React components that wrap calcite components", "homepage": "https://developers.arcgis.com/calcite-design-system/", "repository": { @@ -26,7 +26,7 @@ "tsc": "tsc" }, "dependencies": { - "@esri/calcite-components": "3.0.0-next.90", + "@esri/calcite-components": "3.0.0-next.91", "@lit/react": "1.0.6" }, "peerDependencies": { diff --git a/packages/calcite-components/CHANGELOG.md b/packages/calcite-components/CHANGELOG.md index e747c55956d..689b336fd8e 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. +## [3.0.0-next.91](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@3.0.0-next.90...@esri/calcite-components@3.0.0-next.91) (2025-01-07) + +### Bug Fixes + +- **text-area:** make `readOnly` prop writable ([#11218](https://github.com/Esri/calcite-design-system/issues/11218)) ([0cbf766](https://github.com/Esri/calcite-design-system/commit/0cbf766156e3b0ec7a662571606af62895e23f59)), closes [#11217](https://github.com/Esri/calcite-design-system/issues/11217) [#10731](https://github.com/Esri/calcite-design-system/issues/10731) [#10310](https://github.com/Esri/calcite-design-system/issues/10310) + ## [3.0.0-next.90](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@3.0.0-next.89...@esri/calcite-components@3.0.0-next.90) (2025-01-06) ### Features diff --git a/packages/calcite-components/package.json b/packages/calcite-components/package.json index 494bc201f6b..787e5d9066a 100644 --- a/packages/calcite-components/package.json +++ b/packages/calcite-components/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components", - "version": "3.0.0-next.90", + "version": "3.0.0-next.91", "description": "Web Components for Esri's Calcite Design System.", "homepage": "https://developers.arcgis.com/calcite-design-system/", "repository": { From dce56356568f606004f9210ab21cbbcf7dcb94af Mon Sep 17 00:00:00 2001 From: JC Franco Date: Tue, 7 Jan 2025 12:55:02 -0800 Subject: [PATCH 3/7] fix(docs): use updated translation bundle paths to generate `translations.json` (#11219) **Related Issue:** #10731 ## Summary Updates `generateT9nDocsJSON.ts` to reference the updated translations bundle file name (see https://github.com/Esri/calcite-design-system/pull/11054). --- packages/calcite-components/support/generateT9nDocsJSON.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/calcite-components/support/generateT9nDocsJSON.ts b/packages/calcite-components/support/generateT9nDocsJSON.ts index 0a75052b505..9427cb7ec13 100755 --- a/packages/calcite-components/support/generateT9nDocsJSON.ts +++ b/packages/calcite-components/support/generateT9nDocsJSON.ts @@ -24,7 +24,7 @@ Object.keys(messagesFileMain).forEach((key) => (data[component][key] = {})); const messagesFilenames = (await readdir(t9nPath, { withFileTypes: true })).map((dirent) => dirent.name); - const messagesFilenameRegex = new RegExp(`${component}\\.t9n\\.(.*)\\.json`); + const messagesFilenameRegex = new RegExp(`messages\\.(.*)\\.json`); for (const messagesFilename of messagesFilenames) { const messagesFilenameMatch = messagesFilename.match(messagesFilenameRegex); From 2e8ed8ae66710f845671b986bc76f7d16fe3c6b1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:55:55 -0800 Subject: [PATCH 4/7] build(deps): update arcgis to ^4.32.0-next.72 (#11207) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@arcgis/components-controllers](https://developers.arcgis.com/javascript/latest/) | [`^4.32.0-next.69` -> `^4.32.0-next.72`](https://renovatebot.com/diffs/npm/@arcgis%2fcomponents-controllers/4.32.0-next.69/4.32.0-next.72) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@arcgis%2fcomponents-controllers/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@arcgis%2fcomponents-controllers/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@arcgis%2fcomponents-controllers/4.32.0-next.69/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@arcgis%2fcomponents-controllers/4.32.0-next.69/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@arcgis/components-utils](https://developers.arcgis.com/javascript/latest/) | [`^4.32.0-next.69` -> `^4.32.0-next.72`](https://renovatebot.com/diffs/npm/@arcgis%2fcomponents-utils/4.32.0-next.69/4.32.0-next.72) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@arcgis%2fcomponents-utils/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@arcgis%2fcomponents-utils/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@arcgis%2fcomponents-utils/4.32.0-next.69/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@arcgis%2fcomponents-utils/4.32.0-next.69/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | @​arcgis/lumina | [`^4.32.0-next.69` -> `^4.32.0-next.72`](https://renovatebot.com/diffs/npm/@arcgis%2flumina/4.32.0-next.69/4.32.0-next.72) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@arcgis%2flumina/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@arcgis%2flumina/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@arcgis%2flumina/4.32.0-next.69/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@arcgis%2flumina/4.32.0-next.69/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | @​arcgis/lumina-compiler | [`^4.32.0-next.69` -> `^4.32.0-next.72`](https://renovatebot.com/diffs/npm/@arcgis%2flumina-compiler/4.32.0-next.69/4.32.0-next.72) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@arcgis%2flumina-compiler/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@arcgis%2flumina-compiler/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@arcgis%2flumina-compiler/4.32.0-next.69/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@arcgis%2flumina-compiler/4.32.0-next.69/4.32.0-next.72?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- - [ ] 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 | 62 ++++++++++++------------ package.json | 2 +- packages/calcite-components/package.json | 6 +-- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/package-lock.json b/package-lock.json index 57cef4c8a85..04e12359dc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "patch-package": "8.0.0" }, "devDependencies": { - "@arcgis/lumina-compiler": "^4.32.0-next.69", + "@arcgis/lumina-compiler": "^4.32.0-next.72", "@cspell/eslint-plugin": "8.17.1", "@eslint/compat": "1.2.4", "@eslint/eslintrc": "3.2.0", @@ -216,21 +216,21 @@ } }, "node_modules/@arcgis/api-extractor": { - "version": "4.32.0-next.69", - "resolved": "https://registry.npmjs.org/@arcgis/api-extractor/-/api-extractor-4.32.0-next.69.tgz", - "integrity": "sha512-29OD9WT1385nSQzpggEZ0hww2pXnKWwoCXzdJTvWVj11SphobRiIJbVMx+zEr6KU7+cv/JBvoiQIDCOPWaVfxw==", + "version": "4.32.0-next.75", + "resolved": "https://registry.npmjs.org/@arcgis/api-extractor/-/api-extractor-4.32.0-next.75.tgz", + "integrity": "sha512-ia8GG6LEfBPEMPn0fDIKK6sZrE7y4o3mEpkA2UFzR++CO6OGJAltrs+ikI13ZAzZ8f6EATjj3tczq5ORO1+32g==", "dev": true, "dependencies": { - "@arcgis/components-build-utils": "4.32.0-next.69", - "@arcgis/components-utils": "4.32.0-next.69", + "@arcgis/components-build-utils": "4.32.0-next.75", + "@arcgis/components-utils": "4.32.0-next.75", "tslib": "^2.7.0", "typescript": "~5.6.3" } }, "node_modules/@arcgis/components-build-utils": { - "version": "4.32.0-next.69", - "resolved": "https://registry.npmjs.org/@arcgis/components-build-utils/-/components-build-utils-4.32.0-next.69.tgz", - "integrity": "sha512-HHKYdFoI5HXTDE4NABzSdepzqIHapSLaocFFg0ZCAfi2FDg6fq2662Vi23J9NyRcw7Wc5wFR/q8uiNK2IIS5Ag==", + "version": "4.32.0-next.75", + "resolved": "https://registry.npmjs.org/@arcgis/components-build-utils/-/components-build-utils-4.32.0-next.75.tgz", + "integrity": "sha512-kKgUsahHVvlIPfapfp0LitnM2PXTm6EefXVo0CaiVEL/wJ73trdW6LDsWcY0QNyKDgmWpFJSqabHJPJ9HAhc+A==", "dev": true, "dependencies": { "@commander-js/extra-typings": "^11.1.0", @@ -245,29 +245,29 @@ } }, "node_modules/@arcgis/components-controllers": { - "version": "4.32.0-next.69", - "resolved": "https://registry.npmjs.org/@arcgis/components-controllers/-/components-controllers-4.32.0-next.69.tgz", - "integrity": "sha512-IlDqCZVPZEtkxEuzY33RF0zsPe4i9oG+5AXfTcxxdy+cVqUggWUZqj5j+pcUtcA/+nSgLMyJ/zlfTvT2dmox7w==", + "version": "4.32.0-next.75", + "resolved": "https://registry.npmjs.org/@arcgis/components-controllers/-/components-controllers-4.32.0-next.75.tgz", + "integrity": "sha512-k+W7vgAGDqEayA4PvcCCqhaXQ+pwZHogVv4g6vRcWcmug8Q44Nl4O1cGfzG0piHphauy0zn9rwBv3zzpcV0Cmg==", "dependencies": { - "@arcgis/components-utils": "4.32.0-next.69", + "@arcgis/components-utils": "4.32.0-next.75", "tslib": "^2.7.0" } }, "node_modules/@arcgis/components-utils": { - "version": "4.32.0-next.69", - "resolved": "https://registry.npmjs.org/@arcgis/components-utils/-/components-utils-4.32.0-next.69.tgz", - "integrity": "sha512-35KlGF7zALlcZUpDfgeABJymijqo3aKXfEYnnms7hEuvvvXEfgw8nDaW95VZy5uxOzmDo/o5Cpq+hiJ9BTQMKg==", + "version": "4.32.0-next.75", + "resolved": "https://registry.npmjs.org/@arcgis/components-utils/-/components-utils-4.32.0-next.75.tgz", + "integrity": "sha512-aOWBQcMxernyg6I3124Aa77w6KJocXINNX6WSC/02ISWDZ9BSlPEPODYbgdTTPmSM6Uux/4z4oNitl7PgJQGKA==", "dependencies": { "tslib": "^2.7.0" } }, "node_modules/@arcgis/lumina": { - "version": "4.32.0-next.69", - "resolved": "https://registry.npmjs.org/@arcgis/lumina/-/lumina-4.32.0-next.69.tgz", - "integrity": "sha512-9jayFolWVfDOUKgkDMEEcJiffkIe7Vs035ZKatL5pWBOajpjHo9HjkAAxR+n6eigxZmieZfW7BYwM0oRdME3tQ==", + "version": "4.32.0-next.75", + "resolved": "https://registry.npmjs.org/@arcgis/lumina/-/lumina-4.32.0-next.75.tgz", + "integrity": "sha512-Xt/skGurXrhcjfocZHnGhIxLpDapNVdSU3J/w+IGAerdcMxIAEYbyhtOX1Yu5TXVV/EgfJ2+h6lWNqpezDGJVg==", "dependencies": { - "@arcgis/components-controllers": "4.32.0-next.69", - "@arcgis/components-utils": "4.32.0-next.69", + "@arcgis/components-controllers": "4.32.0-next.75", + "@arcgis/components-utils": "4.32.0-next.75", "@lit-labs/ssr": "^3.2.2", "@lit-labs/ssr-client": "^1.1.7", "@lit/context": "^1.1.3", @@ -277,14 +277,14 @@ } }, "node_modules/@arcgis/lumina-compiler": { - "version": "4.32.0-next.69", - "resolved": "https://registry.npmjs.org/@arcgis/lumina-compiler/-/lumina-compiler-4.32.0-next.69.tgz", - "integrity": "sha512-1KeE6uB238LqN7Yafj97rADiTgdyN/DXO00bd/iF8NLE+sHJ7xHJapB2RBafD25bVoHKoO85b94SHA5mSMP+WQ==", + "version": "4.32.0-next.75", + "resolved": "https://registry.npmjs.org/@arcgis/lumina-compiler/-/lumina-compiler-4.32.0-next.75.tgz", + "integrity": "sha512-GB+GrRrUNvc3lX/3u0ZRDHmmXM6RSpBg/wczBO4EttJdVVg7nkPnPXztYOtTo23UNk3CkN63gRv209loBbis0Q==", "dev": true, "dependencies": { - "@arcgis/api-extractor": "4.32.0-next.69", - "@arcgis/components-build-utils": "4.32.0-next.69", - "@arcgis/components-utils": "4.32.0-next.69", + "@arcgis/api-extractor": "4.32.0-next.75", + "@arcgis/components-build-utils": "4.32.0-next.75", + "@arcgis/components-utils": "4.32.0-next.75", "chalk": "^5.3.0", "esbuild": "^0.24.0", "js-beautify": "^1.15.1", @@ -300,7 +300,7 @@ "vitest-fail-on-console": "^0.7.1" }, "peerDependencies": { - "@arcgis/lumina": "~4.32.0-next.69" + "@arcgis/lumina": "~4.32.0-next.75" } }, "node_modules/@babel/code-frame": { @@ -34973,9 +34973,9 @@ "version": "3.0.0-next.91", "license": "SEE LICENSE.md", "dependencies": { - "@arcgis/components-controllers": "^4.32.0-next.69", - "@arcgis/components-utils": "^4.32.0-next.69", - "@arcgis/lumina": "^4.32.0-next.69", + "@arcgis/components-controllers": "^4.32.0-next.72", + "@arcgis/components-utils": "^4.32.0-next.72", + "@arcgis/lumina": "^4.32.0-next.72", "@esri/calcite-ui-icons": "4.0.0-next.7", "@floating-ui/dom": "^1.6.12", "@floating-ui/utils": "^0.2.8", diff --git a/package.json b/package.json index 82d97aa165c..02e90dd2000 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "util:sync-linked-package-versions": "tsx support/syncLinkedPackageVersions.ts" }, "devDependencies": { - "@arcgis/lumina-compiler": "^4.32.0-next.69", + "@arcgis/lumina-compiler": "^4.32.0-next.72", "@cspell/eslint-plugin": "8.17.1", "@eslint/compat": "1.2.4", "@eslint/eslintrc": "3.2.0", diff --git a/packages/calcite-components/package.json b/packages/calcite-components/package.json index 787e5d9066a..cff9b524410 100644 --- a/packages/calcite-components/package.json +++ b/packages/calcite-components/package.json @@ -68,9 +68,9 @@ "util:test-types": "! grep -rnw 'dist/types' -e ' --- .../src/components/rating/rating.e2e.ts | 55 +++++++++++++++++++ .../src/components/rating/rating.scss | 27 +++++---- .../src/components/rating/resources.ts | 11 ++++ .../src/custom-theme.stories.ts | 6 +- .../src/custom-theme/rating.ts | 12 ++++ .../src/tests/utils/cssTokenValues.ts | 1 + 6 files changed, 101 insertions(+), 11 deletions(-) create mode 100644 packages/calcite-components/src/custom-theme/rating.ts diff --git a/packages/calcite-components/src/components/rating/rating.e2e.ts b/packages/calcite-components/src/components/rating/rating.e2e.ts index 1695fdaa6c9..8ee5602953c 100644 --- a/packages/calcite-components/src/components/rating/rating.e2e.ts +++ b/packages/calcite-components/src/components/rating/rating.e2e.ts @@ -11,8 +11,11 @@ import { reflects, renders, t9n, + themed, } from "../../tests/commonTests"; +import { html } from "../../../support/formatting"; import { isElementFocused } from "../../tests/utils"; +import { CSS } from "./resources"; describe("calcite-rating", () => { describe("common tests", () => { @@ -795,4 +798,56 @@ describe("calcite-rating", () => { expect(element).toEqualAttribute("value", "2"); }); }); + + describe("theme", () => { + describe("default", () => { + themed(html``, { + "--calcite-rating-spacing": { + shadowSelector: `.${CSS.fieldSet}`, + targetProp: "gap", + }, + "--calcite-rating-color": { + shadowSelector: `.${CSS.star}`, + targetProp: "color", + }, + }); + }); + describe("selected", () => { + themed(html``, { + "--calcite-rating-color-hover": [ + { + shadowSelector: `.${CSS.star}`, + targetProp: "color", + state: { hover: { attribute: "class", value: CSS.hovered } }, + }, + { + shadowSelector: `.${CSS.selected}`, + targetProp: "color", + }, + ], + }); + }); + describe("average", () => { + themed(html``, { + "--calcite-rating-average-color": [ + { + shadowSelector: `.${CSS.average}`, + targetProp: "color", + }, + { + shadowSelector: `.${CSS.fraction}`, + targetProp: "color", + }, + ], + "--calcite-rating-average-text-color": { + shadowSelector: `.${CSS.numberAverage}`, + targetProp: "color", + }, + "--calcite-rating-count-text-color": { + shadowSelector: `.${CSS.numberCount}`, + targetProp: "color", + }, + }); + }); + }); }); diff --git a/packages/calcite-components/src/components/rating/rating.scss b/packages/calcite-components/src/components/rating/rating.scss index 63a0139f899..65cf389d639 100644 --- a/packages/calcite-components/src/components/rating/rating.scss +++ b/packages/calcite-components/src/components/rating/rating.scss @@ -3,7 +3,13 @@ * * These properties can be overridden using the component's tag as selector. * - * @prop --calcite-rating-spacing-unit: The amount of left and right margin spacing between each rating star. + * @prop --calcite-rating-spacing-unit: [Deprecated] Use `--calcite-rating-spacing`. Specifies the amount of left and right margin spacing between each item. + * @prop --calcite-rating-spacing: Specifies the amount of left and right margin spacing between each item. + * @prop --calcite-rating-color-hover: Specifies the component's item color when hovered or selected. + * @prop --calcite-rating-color: Specifies the component's item color. + * @prop --calcite-rating-average-color: Specifies the component's item color when average is set. + * @prop --calcite-rating-average-text-color: Specifies the component's average text color. + * @prop --calcite-rating-count-text-color: Specifies the component's count text color. */ :host { @@ -15,17 +21,17 @@ :host([scale="s"]) { @apply h-6; - --calcite-rating-spacing-unit: theme("spacing.1"); + --calcite-internal-rating-spacing: theme("spacing.1"); } :host([scale="m"]) { @apply h-8; - --calcite-rating-spacing-unit: theme("spacing.2"); + --calcite-internal-rating-spacing: theme("spacing.2"); } :host([scale="l"]) { @apply h-11; - --calcite-rating-spacing-unit: theme("spacing.3"); + --calcite-internal-rating-spacing: theme("spacing.3"); } :host([read-only]) { @@ -38,7 +44,7 @@ border-width: 0; padding: 0; align-items: center; - gap: var(--calcite-rating-spacing-unit); + gap: var(--calcite-rating-spacing, var(--calcite-internal-rating-spacing)); } .wrapper { @@ -51,7 +57,7 @@ display: flex; flex-direction: column; cursor: pointer; - color: theme("borderColor.color.input"); + color: var(--calcite-rating-color, theme("borderColor.color.input")); &:focus { @apply focus-outset; } @@ -59,12 +65,12 @@ .average, .fraction { - color: theme("colors.warning"); + color: var(--calcite-rating-average-color, theme("colors.warning")); } .hovered, .selected { - color: theme("colors.brand"); + color: var(--calcite-rating-color-hover, theme("colors.brand")); } .fraction { @@ -84,13 +90,14 @@ calcite-chip { .number--average { font-weight: bold; + color: var(--calcite-rating-average-text-color); } .number--count { - color: var(--calcite-color-text-2); + color: var(--calcite-rating-count-text-color, var(--calcite-color-text-2)); font-style: italic; &:not(:first-child) { - margin-inline-start: var(--calcite-rating-spacing-unit); + margin-inline-start: var(--calcite-rating-spacing, var(--calcite-internal-rating-spacing)); } } diff --git a/packages/calcite-components/src/components/rating/resources.ts b/packages/calcite-components/src/components/rating/resources.ts index 3fbf623b870..ad8ee9ebab2 100644 --- a/packages/calcite-components/src/components/rating/resources.ts +++ b/packages/calcite-components/src/components/rating/resources.ts @@ -1,3 +1,14 @@ +export const CSS = { + fieldSet: "fieldset", + star: "star", + hovered: "hovered", + selected: "selected", + average: "average", + fraction: "fraction", + numberAverage: "number--average", + numberCount: "number--count", +}; + export const IDS = { validationMessage: "validationMessage", }; diff --git a/packages/calcite-components/src/custom-theme.stories.ts b/packages/calcite-components/src/custom-theme.stories.ts index 1abd919ce71..d15f02078f5 100644 --- a/packages/calcite-components/src/custom-theme.stories.ts +++ b/packages/calcite-components/src/custom-theme.stories.ts @@ -38,6 +38,7 @@ import { pagination } from "./custom-theme/pagination"; import { popover, popoverTokens } from "./custom-theme/popover"; import { progress, progressTokens } from "./custom-theme/progress"; import { segmentedControl } from "./custom-theme/segmented-control"; +import { rating, ratingTokens } from "./custom-theme/rating"; import { slider, sliderTokens } from "./custom-theme/slider"; import { switchTokens } from "./custom-theme/switch"; import { tabs, tabsBordered, tabsTokens } from "./custom-theme/tabs"; @@ -133,7 +134,9 @@ const kitchenSink = (args: Record, useTestValues = false) => ${avatarInitials} ${avatarThumbnail} ${progress} ${handle} ${textArea} ${popover} ${tile} ${tooltip} ${comboboxItem} -
${navigation} ${navigationLogos} ${navigationUsers} ${blockSection} ${block}
+
+ ${navigation} ${navigationLogos} ${navigationUsers} ${blockSection} ${block} ${rating} +
${alert}
`; @@ -167,6 +170,7 @@ const componentTokens = { ...noticeTokens, ...popoverTokens, ...progressTokens, + ...ratingTokens, ...sliderTokens, ...switchTokens, ...tabsTokens, diff --git a/packages/calcite-components/src/custom-theme/rating.ts b/packages/calcite-components/src/custom-theme/rating.ts new file mode 100644 index 00000000000..656c2eb2c83 --- /dev/null +++ b/packages/calcite-components/src/custom-theme/rating.ts @@ -0,0 +1,12 @@ +import { html } from "../../support/formatting"; + +export const ratingTokens = { + calciteRatingSpacing: "", + calciteRatingColorHover: "", + calciteRatingColor: "", + calciteRatingAverageColor: "", + calciteRatingAverageTextColor: "", + calciteRatingCountTextColor: "", +}; + +export const rating = html``; diff --git a/packages/calcite-components/src/tests/utils/cssTokenValues.ts b/packages/calcite-components/src/tests/utils/cssTokenValues.ts index 42d3990fc7e..10b23f944d1 100644 --- a/packages/calcite-components/src/tests/utils/cssTokenValues.ts +++ b/packages/calcite-components/src/tests/utils/cssTokenValues.ts @@ -7,6 +7,7 @@ */ export function getTokenValue(token: string): string { const tokenValueMap = { + spacing: "42px", // granular patterns for the same token must be listed first to match correctly background$: "rgb(252, 244, 52)", "text-color$": "rgb(239, 118, 39)", From 4b0d8043ddcd2d05451253256a6812d5427a69eb Mon Sep 17 00:00:00 2001 From: JC Franco Date: Tue, 7 Jan 2025 13:28:56 -0800 Subject: [PATCH 7/7] fix(docs): add docs package export (#11221) **Related Issue:** #10731 ## Summary Adds package export to support doc-related ESM imports. --- packages/calcite-components/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/calcite-components/package.json b/packages/calcite-components/package.json index cff9b524410..5e3e70b93dc 100644 --- a/packages/calcite-components/package.json +++ b/packages/calcite-components/package.json @@ -19,6 +19,7 @@ "./types/*": "./dist/types/*.d.ts", "./hydrate": "./hydrate/index.js", "./calcite/calcite.css": "./dist/calcite/calcite.css", + "./docs/*": "./dist/docs/*", "./dist/calcite/calcite.css": "./dist/calcite/calcite.css", "./dist/loader": "./dist/loader.js", "./dist/components": "./dist/index.js",