From 729ed7012a502ae8e91204e77e29ea4686d675fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:11:36 -0500 Subject: [PATCH 1/8] chore(release): publish [skip ci] (#6504) - jest-config-ibm-cloud-cognitive@1.14.0-rc.0 - @carbon/storybook-addon-theme@2.4.0-rc.0 - @carbon/ibm-cloud-cognitive-core@2.31.0-rc.0 - @carbon/ibm-products@2.55.0-rc.0 - @carbon/ibm-products-styles@2.51.0-rc.0 - @carbon/ibm-products-web-components@0.4.0-rc.0 Co-authored-by: carbon-bot --- .../CHANGELOG.md | 8 +++++++ .../package.json | 2 +- .../storybook-addon-carbon-theme/CHANGELOG.md | 8 +++++++ .../storybook-addon-carbon-theme/package.json | 2 +- packages/core/CHANGELOG.md | 16 ++++++++++++++ packages/core/package.json | 4 ++-- packages/ibm-products-styles/CHANGELOG.md | 8 +++++++ packages/ibm-products-styles/package.json | 4 ++-- .../ibm-products-web-components/CHANGELOG.md | 13 +++++++++++ .../ibm-products-web-components/package.json | 4 ++-- packages/ibm-products/CHANGELOG.md | 22 +++++++++++++++++++ packages/ibm-products/package.json | 6 ++--- yarn.lock | 14 ++++++------ 13 files changed, 93 insertions(+), 18 deletions(-) diff --git a/config/jest-config-ibm-cloud-cognitive/CHANGELOG.md b/config/jest-config-ibm-cloud-cognitive/CHANGELOG.md index e144c8d70c..989a417d12 100644 --- a/config/jest-config-ibm-cloud-cognitive/CHANGELOG.md +++ b/config/jest-config-ibm-cloud-cognitive/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.14.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/jest-config-ibm-cloud-cognitive@1.13.0-rc.0...jest-config-ibm-cloud-cognitive@1.14.0-rc.0) (2024-11-25) + +**Note:** Version bump only for package jest-config-ibm-cloud-cognitive + + + + + # [1.13.0](https://github.com/carbon-design-system/ibm-products/compare/jest-config-ibm-cloud-cognitive@1.13.0-rc.1...jest-config-ibm-cloud-cognitive@1.13.0) (2024-11-20) **Note:** Version bump only for package jest-config-ibm-cloud-cognitive diff --git a/config/jest-config-ibm-cloud-cognitive/package.json b/config/jest-config-ibm-cloud-cognitive/package.json index 74f42e17bd..d5ac8dd27e 100644 --- a/config/jest-config-ibm-cloud-cognitive/package.json +++ b/config/jest-config-ibm-cloud-cognitive/package.json @@ -1,7 +1,7 @@ { "name": "jest-config-ibm-cloud-cognitive", "private": true, - "version": "1.13.0", + "version": "1.14.0-rc.0", "license": "Apache-2.0", "main": "index.js", "repository": { diff --git a/config/storybook-addon-carbon-theme/CHANGELOG.md b/config/storybook-addon-carbon-theme/CHANGELOG.md index 2abf85c0cf..7b35d48aa6 100644 --- a/config/storybook-addon-carbon-theme/CHANGELOG.md +++ b/config/storybook-addon-carbon-theme/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.4.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/storybook-addon-theme@2.3.0-rc.0...@carbon/storybook-addon-theme@2.4.0-rc.0) (2024-11-25) + +**Note:** Version bump only for package @carbon/storybook-addon-theme + + + + + # [2.3.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/storybook-addon-theme@2.3.0-rc.1...@carbon/storybook-addon-theme@2.3.0) (2024-11-20) **Note:** Version bump only for package @carbon/storybook-addon-theme diff --git a/config/storybook-addon-carbon-theme/package.json b/config/storybook-addon-carbon-theme/package.json index 0ff405a7f3..5aaf0b187e 100644 --- a/config/storybook-addon-carbon-theme/package.json +++ b/config/storybook-addon-carbon-theme/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/storybook-addon-theme", "description": "Carbon theme switcher for Storybook", - "version": "2.3.0", + "version": "2.4.0-rc.0", "license": "Apache-2.0", "main": "dist/react.js", "repository": { diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index c3305de5a7..e9eca1e180 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.31.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-cloud-cognitive-core@2.30.0-rc.0...@carbon/ibm-cloud-cognitive-core@2.31.0-rc.0) (2024-11-25) + + +### Bug Fixes + +* update to Carbon 11 compatible versions to latest ([#6437](https://github.com/carbon-design-system/ibm-products/issues/6437)) ([48d5c34](https://github.com/carbon-design-system/ibm-products/commit/48d5c34dca79a4b00fc69391a513431fa21295ee)) + + +### Features + +* add utils section to storybook ([#6394](https://github.com/carbon-design-system/ibm-products/issues/6394)) ([711eb72](https://github.com/carbon-design-system/ibm-products/commit/711eb72ef00d1f1935fd0fcec9e0c0383dff53dc)) + + + + + # [2.30.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-cloud-cognitive-core@2.30.0-rc.1...@carbon/ibm-cloud-cognitive-core@2.30.0) (2024-11-20) **Note:** Version bump only for package @carbon/ibm-cloud-cognitive-core diff --git a/packages/core/package.json b/packages/core/package.json index 2da0434f67..5a331ac814 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/ibm-cloud-cognitive-core", "private": true, - "version": "2.30.0", + "version": "2.31.0-rc.0", "license": "Apache-2.0", "main": "scripts/build.js", "repository": { @@ -29,7 +29,7 @@ }, "devDependencies": { "@carbon/grid": "^11.29.0", - "@carbon/ibm-products-styles": "^2.50.0", + "@carbon/ibm-products-styles": "^2.51.0-rc.0", "@carbon/layout": "^11.28.0", "@carbon/motion": "^11.24.0", "@carbon/react": "^1.70.0", diff --git a/packages/ibm-products-styles/CHANGELOG.md b/packages/ibm-products-styles/CHANGELOG.md index 6265053c3a..fa78ce2d2c 100644 --- a/packages/ibm-products-styles/CHANGELOG.md +++ b/packages/ibm-products-styles/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.51.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products-styles@2.50.0-rc.0...@carbon/ibm-products-styles@2.51.0-rc.0) (2024-11-25) + +**Note:** Version bump only for package @carbon/ibm-products-styles + + + + + # [2.50.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products-styles@2.50.0-rc.1...@carbon/ibm-products-styles@2.50.0) (2024-11-20) **Note:** Version bump only for package @carbon/ibm-products-styles diff --git a/packages/ibm-products-styles/package.json b/packages/ibm-products-styles/package.json index 39bf709c54..c626d26cec 100644 --- a/packages/ibm-products-styles/package.json +++ b/packages/ibm-products-styles/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/ibm-products-styles", "description": "Carbon for IBM Products styles", - "version": "2.50.0", + "version": "2.51.0-rc.0", "license": "Apache-2.0", "installConfig": { "hoistingLimits": "none" @@ -52,7 +52,7 @@ "cross-env": "^7.0.3", "glob": "^10.3.10", "jest": "^29.7.0", - "jest-config-ibm-cloud-cognitive": "^1.13.0", + "jest-config-ibm-cloud-cognitive": "^1.14.0-rc.0", "jest-environment-jsdom": "^29.7.0", "npm-check-updates": "^16.14.12", "npm-run-all": "^4.1.5", diff --git a/packages/ibm-products-web-components/CHANGELOG.md b/packages/ibm-products-web-components/CHANGELOG.md index 8996a5906f..fdc379f13d 100644 --- a/packages/ibm-products-web-components/CHANGELOG.md +++ b/packages/ibm-products-web-components/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.4.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products-web-components@0.3.0-rc.0...@carbon/ibm-products-web-components@0.4.0-rc.0) (2024-11-25) + + +### Bug Fixes + +* **Tearsheet in Web Components:** cancel button not working as expected ([#6458](https://github.com/carbon-design-system/ibm-products/issues/6458)) ([2461f81](https://github.com/carbon-design-system/ibm-products/commit/2461f8120431c125ceb826ccb5d139a82d49f39c)) +* **Tearsheet web components:** control changes doesn't reflect in stories ([#6413](https://github.com/carbon-design-system/ibm-products/issues/6413)) ([84f6d14](https://github.com/carbon-design-system/ibm-products/commit/84f6d140d0476868a13b18ea886515d856bb0835)) +* update to Carbon 11 compatible versions to latest ([#6437](https://github.com/carbon-design-system/ibm-products/issues/6437)) ([48d5c34](https://github.com/carbon-design-system/ibm-products/commit/48d5c34dca79a4b00fc69391a513431fa21295ee)) + + + + + # [0.3.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products-web-components@0.3.0-rc.1...@carbon/ibm-products-web-components@0.3.0) (2024-11-20) **Note:** Version bump only for package @carbon/ibm-products-web-components diff --git a/packages/ibm-products-web-components/package.json b/packages/ibm-products-web-components/package.json index bf5d9af7a4..525d6f4c06 100644 --- a/packages/ibm-products-web-components/package.json +++ b/packages/ibm-products-web-components/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/ibm-products-web-components", "description": "Carbon for IBM Products Web Components", - "version": "0.3.0", + "version": "0.4.0-rc.0", "license": "Apache-2.0", "main": "es/index.js", "module": "es/index.js", @@ -49,7 +49,7 @@ "wca": "web-component-analyzer analyze src --outFile custom-elements.json" }, "dependencies": { - "@carbon/ibm-products-styles": "^2.50.0", + "@carbon/ibm-products-styles": "^2.51.0-rc.0", "@carbon/styles": "1.69.0", "@carbon/web-components": "2.17.0", "lit": "^3.1.0" diff --git a/packages/ibm-products/CHANGELOG.md b/packages/ibm-products/CHANGELOG.md index f2b1ce27b0..b157c10fbd 100644 --- a/packages/ibm-products/CHANGELOG.md +++ b/packages/ibm-products/CHANGELOG.md @@ -3,6 +3,28 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.55.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products@2.54.0-rc.0...@carbon/ibm-products@2.55.0-rc.0) (2024-11-25) + + +### Bug Fixes + +* **APIKeyModal:** implement focus return to generate button ([#6440](https://github.com/carbon-design-system/ibm-products/issues/6440)) ([535e871](https://github.com/carbon-design-system/ibm-products/commit/535e87142413695c530952f7b314201c8a35becc)) +* **APIKeyModal:** implement useFocus hook ([#6290](https://github.com/carbon-design-system/ibm-products/issues/6290)) ([4a92770](https://github.com/carbon-design-system/ibm-products/commit/4a92770d9179f6b59bfe18e53c998fdb51bd794a)) +* **conditionBuilder:** issue fix and data correction ([#6421](https://github.com/carbon-design-system/ibm-products/issues/6421)) ([1f5b63e](https://github.com/carbon-design-system/ibm-products/commit/1f5b63ec428ddd2a2b2ee7c4153c83c2fff6a61c)) +* **tearsheet:** address portalTarget type ([#6400](https://github.com/carbon-design-system/ibm-products/issues/6400)) ([a11d036](https://github.com/carbon-design-system/ibm-products/commit/a11d0364a5beaa3d018db559656c3d7806e1b484)) +* update to Carbon 11 compatible versions to latest ([#6437](https://github.com/carbon-design-system/ibm-products/issues/6437)) ([48d5c34](https://github.com/carbon-design-system/ibm-products/commit/48d5c34dca79a4b00fc69391a513431fa21295ee)) +* **useravatar:** accessibility issue and add avt complex state ([#6399](https://github.com/carbon-design-system/ibm-products/issues/6399)) ([4a70821](https://github.com/carbon-design-system/ibm-products/commit/4a70821b85688730a9d4484340da2517ee079db1)) + + +### Features + +* add utils section to storybook ([#6394](https://github.com/carbon-design-system/ibm-products/issues/6394)) ([711eb72](https://github.com/carbon-design-system/ibm-products/commit/711eb72ef00d1f1935fd0fcec9e0c0383dff53dc)) +* **productive card:** floating ui for overflow menu ([#6395](https://github.com/carbon-design-system/ibm-products/issues/6395)) ([42a1362](https://github.com/carbon-design-system/ibm-products/commit/42a1362ad2ff4998f8286ed0698a82c4ec8ea552)) + + + + + # [2.54.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products@2.54.0-rc.1...@carbon/ibm-products@2.54.0) (2024-11-20) **Note:** Version bump only for package @carbon/ibm-products diff --git a/packages/ibm-products/package.json b/packages/ibm-products/package.json index db2b62c65d..d0561058cb 100644 --- a/packages/ibm-products/package.json +++ b/packages/ibm-products/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/ibm-products", "description": "Carbon for IBM Products", - "version": "2.54.0", + "version": "2.55.0-rc.0", "license": "Apache-2.0", "main": "lib/index.js", "module": "es/index.js", @@ -81,7 +81,7 @@ "fs-extra": "^11.2.0", "glob": "^10.3.10", "jest": "^29.7.0", - "jest-config-ibm-cloud-cognitive": "^1.13.0", + "jest-config-ibm-cloud-cognitive": "^1.14.0-rc.0", "jest-environment-jsdom": "^29.7.0", "namor": "^1.1.2", "npm-check-updates": "^16.14.12", @@ -96,7 +96,7 @@ "dependencies": { "@babel/runtime": "^7.23.9", "@carbon/feature-flags": "^0.24.0", - "@carbon/ibm-products-styles": "^2.50.0", + "@carbon/ibm-products-styles": "^2.51.0-rc.0", "@carbon/telemetry": "^0.1.0", "@dnd-kit/core": "^6.0.8", "@dnd-kit/modifiers": "^7.0.0", diff --git a/yarn.lock b/yarn.lock index 9085f758f3..9d41950947 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1778,7 +1778,7 @@ __metadata: resolution: "@carbon/ibm-cloud-cognitive-core@workspace:packages/core" dependencies: "@carbon/grid": "npm:^11.29.0" - "@carbon/ibm-products-styles": "npm:^2.50.0" + "@carbon/ibm-products-styles": "npm:^2.51.0-rc.0" "@carbon/layout": "npm:^11.28.0" "@carbon/motion": "npm:^11.24.0" "@carbon/react": "npm:^1.70.0" @@ -1819,7 +1819,7 @@ __metadata: languageName: unknown linkType: soft -"@carbon/ibm-products-styles@npm:^2.50.0, @carbon/ibm-products-styles@workspace:packages/ibm-products-styles": +"@carbon/ibm-products-styles@npm:^2.51.0-rc.0, @carbon/ibm-products-styles@workspace:packages/ibm-products-styles": version: 0.0.0-use.local resolution: "@carbon/ibm-products-styles@workspace:packages/ibm-products-styles" dependencies: @@ -1829,7 +1829,7 @@ __metadata: cross-env: "npm:^7.0.3" glob: "npm:^10.3.10" jest: "npm:^29.7.0" - jest-config-ibm-cloud-cognitive: "npm:^1.13.0" + jest-config-ibm-cloud-cognitive: "npm:^1.14.0-rc.0" jest-environment-jsdom: "npm:^29.7.0" npm-check-updates: "npm:^16.14.12" npm-run-all: "npm:^4.1.5" @@ -1849,7 +1849,7 @@ __metadata: version: 0.0.0-use.local resolution: "@carbon/ibm-products-web-components@workspace:packages/ibm-products-web-components" dependencies: - "@carbon/ibm-products-styles": "npm:^2.50.0" + "@carbon/ibm-products-styles": "npm:^2.51.0-rc.0" "@carbon/icons": "npm:^11.52.0" "@carbon/motion": "npm:^11.24.0" "@carbon/styles": "npm:1.69.0" @@ -1908,7 +1908,7 @@ __metadata: "@babel/preset-typescript": "npm:^7.21.5" "@babel/runtime": "npm:^7.23.9" "@carbon/feature-flags": "npm:^0.24.0" - "@carbon/ibm-products-styles": "npm:^2.50.0" + "@carbon/ibm-products-styles": "npm:^2.51.0-rc.0" "@carbon/telemetry": "npm:^0.1.0" "@dnd-kit/core": "npm:^6.0.8" "@dnd-kit/modifiers": "npm:^7.0.0" @@ -1933,7 +1933,7 @@ __metadata: glob: "npm:^10.3.10" immutability-helper: "npm:^3.1.1" jest: "npm:^29.7.0" - jest-config-ibm-cloud-cognitive: "npm:^1.13.0" + jest-config-ibm-cloud-cognitive: "npm:^1.14.0-rc.0" jest-environment-jsdom: "npm:^29.7.0" lodash: "npm:^4.17.21" lottie-web: "npm:^5.12.2" @@ -17568,7 +17568,7 @@ __metadata: languageName: node linkType: hard -"jest-config-ibm-cloud-cognitive@npm:^1.13.0, jest-config-ibm-cloud-cognitive@workspace:config/jest-config-ibm-cloud-cognitive": +"jest-config-ibm-cloud-cognitive@npm:^1.14.0-rc.0, jest-config-ibm-cloud-cognitive@workspace:config/jest-config-ibm-cloud-cognitive": version: 0.0.0-use.local resolution: "jest-config-ibm-cloud-cognitive@workspace:config/jest-config-ibm-cloud-cognitive" dependencies: From 2eab4db31164aed9f84c003466fce0bc74467ce3 Mon Sep 17 00:00:00 2001 From: SreeJith <40453569+Sreejith-CS@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:31:07 +0530 Subject: [PATCH 2/8] fix(CreateTearsheet): Dynamically disable/hide the experimentalSecondarySubmit button in CreateTearsheet (#6412) * fix(CreateTearsheet): update experimentalSecondarySubmit button * fix(CreateTearsheet): fix type issue --------- Co-authored-by: Nandan Devadula <47176249+devadula-nandan@users.noreply.github.com> Co-authored-by: Alexander Melo --- .../components/CreateTearsheet/CreateTearsheet.tsx | 6 +++--- .../CreateTearsheet/CreateTearsheetStep.tsx | 12 +++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheet.tsx b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheet.tsx index a7347abae6..97011dbb26 100644 --- a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheet.tsx +++ b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheet.tsx @@ -46,7 +46,7 @@ const blockClass = `${pkg.prefix}--tearsheet-create`; export interface StepsContextType { currentStep: number; setExperimentalSecondarySubmit: Dispatch< - SetStateAction + SetStateAction >; setIsDisabled: Dispatch>; setOnPrevious: (fn: any) => void; @@ -213,7 +213,7 @@ export let CreateTearsheet = forwardRef( const [firstIncludedStep, setFirstIncludedStep] = useState(1); const [lastIncludedStep, setLastIncludedStep] = useState(); const [experimentalSecondarySubmit, setExperimentalSecondarySubmit] = - useState({}); + useState(); const previousState = usePreviousValue({ currentStep, open }); const contentRef = useRef(null); @@ -282,7 +282,7 @@ export let CreateTearsheet = forwardRef( isSubmitting, componentBlockClass: blockClass, experimentalSecondarySubmit, - experimentalSecondarySubmitText: experimentalSecondarySubmit.labelText + experimentalSecondarySubmitText: experimentalSecondarySubmit?.labelText ? experimentalSecondarySubmit.labelText : experimentalSecondarySubmitText, setCreateComponentActions: setCreateTearsheetActions, diff --git a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetStep.tsx b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetStep.tsx index b8c3413999..eda9c66212 100644 --- a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetStep.tsx +++ b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetStep.tsx @@ -215,9 +215,9 @@ export let CreateTearsheetStep = forwardRef( previousState?.currentStep !== stepsContext?.currentStep ) { stepsContext?.setOnMount(onMount); - stepsContext?.setExperimentalSecondarySubmit({ - ...experimentalSecondarySubmit, - }); + stepsContext?.setExperimentalSecondarySubmit( + experimentalSecondarySubmit + ); } }, [ onMount, @@ -264,6 +264,11 @@ export let CreateTearsheetStep = forwardRef( stepsContext.setIsDisabled(!!disableSubmit); stepsContext?.setOnNext(onNext); // needs to be updated here otherwise there could be stale state values from only initially setting onNext stepsContext?.setOnPrevious(onPrevious); + + //Handle props for experimentalSecondarySubmit button, depending on state change + stepsContext?.setExperimentalSecondarySubmit( + experimentalSecondarySubmit + ); } }, [ stepsContext, @@ -273,6 +278,7 @@ export let CreateTearsheetStep = forwardRef( onPrevious, stepRef, stepRefValue, + experimentalSecondarySubmit, ]); const renderDescription = () => { From 1d049e04aef8410f4c5da8b2eb4fe84e15e1d1ce Mon Sep 17 00:00:00 2001 From: Alexander Melo Date: Tue, 26 Nov 2024 01:43:48 -0500 Subject: [PATCH 3/8] test(Coachmark): increases test coverage (#6496) * feat(coachmark): starts adding ally keyboard drag event * feat: adds coachmake tests * fix: resolves conflicts * fix: adds package prefix --- .../components/Coachmark/Coachmark.test.js | 100 +++++++++++++++++- .../CoachmarkBeacon/CoachmarkBeacon.test.js | 2 +- 2 files changed, 100 insertions(+), 2 deletions(-) diff --git a/packages/ibm-products/src/components/Coachmark/Coachmark.test.js b/packages/ibm-products/src/components/Coachmark/Coachmark.test.js index 8c4f955a08..0251d773dc 100644 --- a/packages/ibm-products/src/components/Coachmark/Coachmark.test.js +++ b/packages/ibm-products/src/components/Coachmark/Coachmark.test.js @@ -6,7 +6,13 @@ */ import React from 'react'; -import { render, screen, act } from '@testing-library/react'; // https://testing-library.com/docs/react-testing-library/intro +import { + render, + screen, + act, + waitFor, + fireEvent, +} from '@testing-library/react'; // https://testing-library.com/docs/react-testing-library/intro import userEvent from '@testing-library/user-event'; import { pkg } from '../../settings'; import uuidv4 from '../../global/js/utils/uuidv4'; @@ -18,6 +24,7 @@ import { CoachmarkOverlayElements, } from '..'; import { BEACON_KIND } from './utils/enums'; +import { CoachmarkDragbar } from './CoachmarkDragbar'; const blockClass = `${pkg.prefix}--coachmark`; const componentName = Coachmark.displayName; @@ -105,4 +112,95 @@ describe(componentName, () => { componentName ); }); + + it('renders the closeIconDescription text ', async () => { + const a11yKeyboardHandler = jest.fn(); + const onClose = jest.fn(); + const closeIconDescription = 'Close'; + render( + + ); + + const tooltip = screen.getByText(closeIconDescription); + + expect(tooltip).toBeInTheDocument(); + }); + + it('calls the onClose prop when close is clicked', async () => { + const a11yKeyboardHandler = jest.fn(); + const onClose = jest.fn(); + render( + + ); + + const closeButton = screen.getAllByRole('button')[1]; + + expect(closeButton).toBeInTheDocument(); + await waitFor(() => userEvent.click(closeButton)); + expect(onClose).toHaveBeenCalled(); + }); + + it('showCloseButton prop works as expected', async () => { + const a11yKeyboardHandler = jest.fn(); + + const { rerender } = render( + + ); + + expect(screen.queryAllByRole('button').length).toBe(2); + + rerender( + + ); + + expect(screen.queryAllByRole('button').length).toBe(1); + }); + + it('calls the onDrag prop', async () => { + const a11yKeyboardHandler = jest.fn(); + const onDrag = jest.fn(); + + render( + + ); + + const dragbar = screen.getByRole('button'); + + await waitFor(() => { + fireEvent.mouseDown(dragbar, { clientX: 0, clientY: 0 }); + fireEvent.mouseMove(dragbar, { clientX: 100, clientY: 100 }); + fireEvent.mouseUp(dragbar); + }); + + expect(onDrag).toHaveBeenCalled(); + }); + + it('renders the theme prop', async () => { + renderCoachmark({ + 'data-testid': dataTestId, + theme: 'dark', + }); + + await expect(screen.getByTestId(dataTestId)).toHaveClass( + `${pkg.prefix}--coachmark__dark` + ); + }); }); diff --git a/packages/ibm-products/src/components/CoachmarkBeacon/CoachmarkBeacon.test.js b/packages/ibm-products/src/components/CoachmarkBeacon/CoachmarkBeacon.test.js index 71eb53bef9..3ed52ee51b 100644 --- a/packages/ibm-products/src/components/CoachmarkBeacon/CoachmarkBeacon.test.js +++ b/packages/ibm-products/src/components/CoachmarkBeacon/CoachmarkBeacon.test.js @@ -72,7 +72,7 @@ describe(componentName, () => { renderCoachmarkWithBeacon({ label: testingLabel, }); - screen.getByLabelText(testingLabel); + screen.getAllByLabelText(testingLabel)[1]; }); it('forwards a ref to an appropriate node', () => { From f716852c979a0b9556e853fad7e7a7774b4c6579 Mon Sep 17 00:00:00 2001 From: Amal K Joy <153802538+amal-k-joy@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:41:48 +0530 Subject: [PATCH 4/8] feat(BreadcrumbWithOverflow): adopt overflowMenuV12 and floating ui (#6411) * feat(BreadcrumbWithOverflow): adopt overflowMenuV12 and floating ui * feat(BreadcrumbWithOverflow): adopt overflowMenuV12 styles * feat(BreadcrumbWithOverflow): avt test fix * feat: test coverage * fix: corrected the alignment issue identified by percy * fix: comments removed --- .../PageHeader/PageHeader-test.avt.e2e.js | 10 +++- .../_breadcrumb-with-overflow.scss | 5 +- .../BreadcrumbWithOverflow.js | 54 +++++++++++-------- .../BreadcrumbWithOverflow.test.js | 13 +++-- 4 files changed, 49 insertions(+), 33 deletions(-) diff --git a/e2e/components/PageHeader/PageHeader-test.avt.e2e.js b/e2e/components/PageHeader/PageHeader-test.avt.e2e.js index 597b9ddf08..7185287307 100644 --- a/e2e/components/PageHeader/PageHeader-test.avt.e2e.js +++ b/e2e/components/PageHeader/PageHeader-test.avt.e2e.js @@ -138,7 +138,10 @@ test.describe('PageHeader @avt', () => { // collapses into menu button on small screens await page.setViewportSize({ width: 1024, height: 768 }); // reset focus to first focusable element - await page.getByLabel('Open and close additional').focus(); + await page + .getByLabel('Breadcrumb', { exact: true }) + .getByRole('button') + .focus(); await pressTabKey(page, 6); await expect( @@ -229,7 +232,10 @@ test.describe('PageHeader @avt', () => { // collapses into menu button on small screens await page.setViewportSize({ width: 1024, height: 768 }); // reset focus to first focusable element - await page.getByLabel('Open and close additional').focus(); + await page + .getByLabel('Breadcrumb', { exact: true }) + .getByRole('button') + .focus(); await pressTabKey(page, 1); await expect(page.getByRole('tooltip').getByText('Action 1')).toBeVisible(); await pressTabKey(page, 2); diff --git a/packages/ibm-products-styles/src/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss b/packages/ibm-products-styles/src/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss index 719ef7982e..1218c5edaa 100644 --- a/packages/ibm-products-styles/src/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +++ b/packages/ibm-products-styles/src/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss @@ -89,7 +89,6 @@ $_block-class: #{c4p-settings.$pkg-prefix}--breadcrumb-with-overflow; text-overflow: ellipsis; } } - -.#{$_block-class}__overflow-menu-options.#{$_block-class}__overflow-menu-options { - z-index: utilities.z('header'); +.#{$_block-class}__overflow-menu { + line-height: 0; } diff --git a/packages/ibm-products/src/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js b/packages/ibm-products/src/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js index 7660572808..c63e483765 100644 --- a/packages/ibm-products/src/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +++ b/packages/ibm-products/src/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js @@ -19,9 +19,10 @@ import { BreadcrumbItem, Link, OverflowMenu, - OverflowMenuItem, Tooltip, usePrefix, + unstable_FeatureFlags as FeatureFlags, + MenuItem, } from '@carbon/react'; import { pkg } from '../../settings'; import { ArrowLeft, OverflowMenuHorizontal } from '@carbon/react/icons'; @@ -59,30 +60,37 @@ export let BreadcrumbWithOverflow = ({ // eslint-disable-next-line react/prop-types const BreadcrumbOverflowMenu = ({ overflowItems }) => { + const handleClick = (evt, item) => { + if (item?.props?.href) { + window.location.href = item.props.href; + } + item?.props?.onClick?.(evt); + }; + return ( - ( - - )} - className={`${blockClass}__overflow-menu`} - menuOptionsClass={`${blockClass}__overflow-menu-options`} - > - { - // eslint-disable-next-line react/prop-types - overflowItems.map((item, index) => ( - - )) - } - + + ( + + )} + className={`${blockClass}__overflow-menu`} + tooltipAlignment={overflowTooltipAlign} + > + { + // eslint-disable-next-line react/prop-types + overflowItems.map((item, index) => ( + handleClick(evt, item)} + label={item.props.children} + /> + )) + } + + ); }; diff --git a/packages/ibm-products/src/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.test.js b/packages/ibm-products/src/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.test.js index be44399856..818fc8faed 100644 --- a/packages/ibm-products/src/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.test.js +++ b/packages/ibm-products/src/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.test.js @@ -19,13 +19,13 @@ const breadcrumbContent = Array.from( { length: 5 }, (_, index) => `Breadcrumb ${index + 1}` ); - +const myOnClick = jest.fn(); const breadcrumbItems = breadcrumbContent.map((item) => ({ href: '/#', id: `id-${item.replace(' ', '_')}`, key: item, label: item, - onClick: () => {}, + onClick: myOnClick, })); const sizes = { @@ -152,9 +152,10 @@ describe(BreadcrumbWithOverflow.displayName, () => { ); // item 2 contains an overflow menu - const overflowBtn = screen.getByLabelText(/Open and close/, { - selector: `.${blockClass}__overflow-menu`, - }); + const overflowBtn = document.querySelector( + `.${blockClass}__overflow-menu button` + ); + await act(() => click(overflowBtn)); //
    but default
      role of list used for query @@ -167,6 +168,8 @@ describe(BreadcrumbWithOverflow.displayName, () => { expect(menuItems).toHaveLength(overflowItemsExpected); expect(menuItems[0]).toHaveTextContent(breadcrumbContent[1]); expect(menuItems[1]).toHaveTextContent(breadcrumbContent[2]); + await act(() => click(menuItems[1])); + expect(myOnClick).toHaveBeenCalled(); }); it('Renders just the breadcrumb and last item when very little space', async () => { From 9d07dab82cefd4046f65f8cac25d1d829f6d7c1a Mon Sep 17 00:00:00 2001 From: Sangeetha Babu Date: Tue, 26 Nov 2024 16:25:54 +0530 Subject: [PATCH 5/8] fix(side panel in react): slideIn not working as expected (#6501) --- .../components/SidePanel/SidePanel.stories.jsx | 8 ++++---- .../SidePanel/_storybook-styles.scss | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/ibm-products/src/components/SidePanel/SidePanel.stories.jsx b/packages/ibm-products/src/components/SidePanel/SidePanel.stories.jsx index 133e338697..596ff1d105 100644 --- a/packages/ibm-products/src/components/SidePanel/SidePanel.stories.jsx +++ b/packages/ibm-products/src/components/SidePanel/SidePanel.stories.jsx @@ -596,8 +596,8 @@ const SlideInTemplate = ({ actions, aiLabel, slug, ...args }) => { return ( <> - - +
      +
      - - +
      +
      Date: Tue, 26 Nov 2024 16:00:24 -0500 Subject: [PATCH 6/8] build: update dependency action to use carbon bot/app token (#6498) * build: update dependency action to use bot token * refactor: update commit type to chore * refactor: revert back to build commit type --- .github/workflows/update.yml | 55 +++++++++++++----------------------- 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index e17877a5c4..db16d1f873 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install run: yarn @@ -21,19 +21,22 @@ jobs: yarn env: YARN_ENABLE_IMMUTABLE_INSTALLS: false - + - name: Generate token + uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0 + id: generate_token + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} - name: Create PR id: create-pr - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 with: - token: ${{ secrets.CREATE_PR_ACCESS_TOKEN }} - commit-message: 'fix: update Carbon 11 compatible versions to latest' - committer: GitHub - author: - ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> - branch: 'update-packages' + token: ${{ steps.generate_token.outputs.token }} + commit-message: 'build(deps): update Carbon 11 compatible versions to latest' + delete-branch: true + branch: 'deps/update-carbon-packages' branch-suffix: random - title: 'fix: update to Carbon 11 compatible versions to latest' + title: 'build(deps): update to Carbon 11 compatible versions to latest' body: | This PR was automatically generated to update Carbon 11 compatible versions on a regular basis. This is not intended to create any breaking changes, and will be reflected as a minor version bump for affected packages. NB we'll run all tests and do visual verifications, but there is always the opportunity for unexpected regressions. If you're using one of the packages in a stable or production context you may want to check this before taking the next minor version, and do let us know ASAP if you see anything problematic. @@ -52,27 +55,11 @@ jobs: - [ ] `yarn ci-check` runs cleanly and all tests pass (done automatically as part of the PR checks). - [ ] the Netlify deploy-preview has been used to ensure that storybook runs and the main published components render correctly. - - name: Post reminder to Slack - id: post-reminder - uses: archive/github-actions-slack@v2.0.0 - with: - slack-bot-user-oauth-access-token: - ${{ secrets.CREATE_PR_SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }} - slack-channel: G01PUCL3V8R # cspell:disable-line - slack-text: > - Hello! This is a test post. PR number: - ${{steps.create-pr.outputs.pull-request-number}} 🤓 - - - name: Result from "Post reminder to Slack" - run: | - echo "The PR number was ${{ steps.create-pr.outputs.pull-request-number }}" - echo "The result was ${{ steps.post-reminder.outputs.slack-result }}" - dependencies: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install run: yarn @@ -89,16 +76,14 @@ jobs: - name: Create PR id: create-pr - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 with: - token: ${{ secrets.CREATE_PR_ACCESS_TOKEN }} - commit-message: 'chore: update dev dependencies' - committer: GitHub - author: - ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> - branch: 'update-packages' + token: ${{ steps.generate_token.outputs.token }} + commit-message: 'build(deps): update dev dependencies' + delete-branch: true + branch: 'deps/update-dev-packages' branch-suffix: random - title: 'chore: update dev dependencies' + title: 'build(deps): update dev dependencies' body: | This PR was automatically generated to update versions of dev dependencies to their latest versions. This helps ensure we get fixes and improvements in a timely fashion and reduces the impact of updating the versions that can arise if versions are allowed to become stale for an extended period. From 0072e424fc1f25fbf58be67f7d4d792643f26c30 Mon Sep 17 00:00:00 2001 From: Nandan Devadula <47176249+devadula-nandan@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:47:27 +0530 Subject: [PATCH 7/8] fix(pageHeader): menu button overflow issue on small screens (#6502) --- .../__snapshots__/styles.test.js.snap | 20 +++++++++++++++---- .../components/PageHeader/_page-header.scss | 5 +++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/ibm-products-styles/src/__tests__/__snapshots__/styles.test.js.snap b/packages/ibm-products-styles/src/__tests__/__snapshots__/styles.test.js.snap index 75c14a5b05..8b9b2f99b3 100644 --- a/packages/ibm-products-styles/src/__tests__/__snapshots__/styles.test.js.snap +++ b/packages/ibm-products-styles/src/__tests__/__snapshots__/styles.test.js.snap @@ -254,6 +254,14 @@ p.c4p--about-modal__copyright-text:first-child { --cds-grid-column-hang: 0.96875rem; } +.cds--css-grid--start { + margin-inline-start: 0; +} + +.cds--css-grid--end { + margin-inline-end: 0; +} + .cds--subgrid { display: grid; grid-template-columns: repeat(var(--cds-grid-columns), minmax(0, 1fr)); @@ -3402,7 +3410,7 @@ p.c4p--about-modal__copyright-text:first-child { } .c4p--datagrid__grid-container table.c4p--datagrid__vertical-align-center .c4p--datagrid__head .c4p--datagrid__head-select-all.c4p--datagrid__checkbox-cell.c4p--datagrid__checkbox-cell-sticky-left { position: sticky; - z-index: 1; + z-index: 10; left: 0; } .c4p--datagrid__grid-container table.c4p--datagrid__vertical-align-center .c4p--datagrid__cell { @@ -3773,7 +3781,7 @@ p.c4p--about-modal__copyright-text:first-child { } .c4p--datagrid__head-hidden-select-all.c4p--datagrid__select-all-sticky-left { position: sticky; - z-index: 1; + z-index: 10; left: 0; background-color: var(--cds-layer-accent-01, #e0e0e0); } @@ -4370,7 +4378,7 @@ p.c4p--about-modal__copyright-text:first-child { .c4p--datagrid__left-sticky-column-header { /* stylelint-disable-next-line declaration-no-important */ position: sticky !important; - z-index: 1; + z-index: 10; left: 0; border-right: 1px solid var(--cds-border-subtle); } @@ -4399,7 +4407,7 @@ p.c4p--about-modal__copyright-text:first-child { .c4p--datagrid__select-all-toggle-on.c4p--datagrid__select-all-sticky-left { position: sticky; - z-index: 1; + z-index: 10; left: 0; } @@ -9530,6 +9538,10 @@ button.c4p--add-select__global-filter-toggle--open { z-index: 7999; } +.c4p--page-header__button-set-menu-options > button.cds--menu-button__trigger { + min-inline-size: 0; +} + .c4p--card__productive { display: flex; flex-direction: column; diff --git a/packages/ibm-products-styles/src/components/PageHeader/_page-header.scss b/packages/ibm-products-styles/src/components/PageHeader/_page-header.scss index b5866c4ba7..cb12a5cdf2 100644 --- a/packages/ibm-products-styles/src/components/PageHeader/_page-header.scss +++ b/packages/ibm-products-styles/src/components/PageHeader/_page-header.scss @@ -667,3 +667,8 @@ $right-section-alt-width: 100% - $left-section-alt-width; .#{$block-class}__button-set-menu-options.#{$carbon-prefix}--overflow-menu-options { z-index: $z-index-header-minus; } + +.#{$block-class}__button-set-menu-options + > button.#{$carbon-prefix}--menu-button__trigger { + min-inline-size: 0; +} From 9f31fc33efd601a5ef50baebb998bafd6d568fe8 Mon Sep 17 00:00:00 2001 From: Alexander Melo Date: Wed, 27 Nov 2024 13:06:26 -0500 Subject: [PATCH 8/8] docs(sidepanel, createsidepanel): adds ai label docs (#6468) * feat: starting ai label story for sidepanel * docs(sidepanel): adds with ai label docs * docs(createsidepanel): adds aiLabel docs --------- Co-authored-by: Matt Gallo --- .../CreateSidePanel.docs-page.js | 25 +++++++ .../SidePanel/SidePanel.docs-page.js | 73 +++++++++++++++++++ .../src/components/SidePanel/SidePanel.mdx | 34 --------- .../SidePanel/SidePanel.stories.jsx | 8 +- 4 files changed, 101 insertions(+), 39 deletions(-) create mode 100644 packages/ibm-products/src/components/SidePanel/SidePanel.docs-page.js delete mode 100644 packages/ibm-products/src/components/SidePanel/SidePanel.mdx diff --git a/packages/ibm-products/src/components/CreateSidePanel/CreateSidePanel.docs-page.js b/packages/ibm-products/src/components/CreateSidePanel/CreateSidePanel.docs-page.js index 420c6916be..37f996ea1a 100644 --- a/packages/ibm-products/src/components/CreateSidePanel/CreateSidePanel.docs-page.js +++ b/packages/ibm-products/src/components/CreateSidePanel/CreateSidePanel.docs-page.js @@ -39,6 +39,31 @@ This includes the following: You can find more information on how to validate your form fields in [Carbon's Form usage page](https://www.carbondesignsystem.com/components/form/usage).`, }, + { + title: 'With AI Label', + description: + 'An AI Label is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level. A Carbon AI Label can be provided to the Tearsheet component by including an `aiLabel` property on it and providing the carbon AILabel component as its own custom component.', + source: { + language: 'html', + code: ` + + ... ... + + } +> + ... + + `, + }, + }, ]} /> ); diff --git a/packages/ibm-products/src/components/SidePanel/SidePanel.docs-page.js b/packages/ibm-products/src/components/SidePanel/SidePanel.docs-page.js new file mode 100644 index 0000000000..12911e413c --- /dev/null +++ b/packages/ibm-products/src/components/SidePanel/SidePanel.docs-page.js @@ -0,0 +1,73 @@ +/** + * Copyright IBM Corp. 2024 + * + * This source code is licensed under the Apache-2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React from 'react'; +import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage'; + +import * as stories from './SidePanel'; + +const DocsPage = () => ( + + ... ... + + } +> + ... + + `, + }, + }, + ]} + /> +); + +export default DocsPage; diff --git a/packages/ibm-products/src/components/SidePanel/SidePanel.mdx b/packages/ibm-products/src/components/SidePanel/SidePanel.mdx deleted file mode 100644 index eab7a6de4a..0000000000 --- a/packages/ibm-products/src/components/SidePanel/SidePanel.mdx +++ /dev/null @@ -1,34 +0,0 @@ -import { Story, Controls, Canvas } from '@storybook/addon-docs'; -import { CodesandboxLink } from '../../global/js/utils/story-helper'; -import { SidePanel } from '.'; -import * as stories from './SidePanel.stories'; - -# Side Panel - -[CD&AI Side Panel usage guidelines](https://pages.github.ibm.com/carbon/ibm-products/components/side-panel/usage) - -## Overview - -`Side panel`s keep users in-context of a page while performing tasks like -navigating, editing, viewing details, or configuring something new. - -`Side panel`s are a fluid component and found in a few primary use-cases used -for various reasons. The user needs to see the panel information in the context -of the page for reference, the second being for configuration flows that affect -the content on the page, and simple create flows. There are variants for these -use-cases that require different widths and behaviors based on the content -within them. - -### Default SidePanel component - - - - - -## Code sample - - - -## Component API - - diff --git a/packages/ibm-products/src/components/SidePanel/SidePanel.stories.jsx b/packages/ibm-products/src/components/SidePanel/SidePanel.stories.jsx index 596ff1d105..b177af89f6 100644 --- a/packages/ibm-products/src/components/SidePanel/SidePanel.stories.jsx +++ b/packages/ibm-products/src/components/SidePanel/SidePanel.stories.jsx @@ -33,7 +33,7 @@ import { import { Copy, TrashCan, Settings } from '@carbon/react/icons'; import { SidePanel } from './SidePanel'; import { sidePanelDecorator } from '../../global/decorators/sidePanelDecorator'; -// import mdx from './SidePanel.mdx'; +import DocsPage from './SidePanel.docs-page'; const prefix = 'side-panel-stories__'; @@ -393,11 +393,9 @@ export default { parameters: { layout: 'fullscreen', styles, - /* -docs: { - page: mdx, + docs: { + page: DocsPage, }, -*/ }, argTypes: { actions: {