Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main_v1' into main_v1
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-chase committed Oct 10, 2023
2 parents 4adb1b8 + 042f216 commit f1bdfe0
Show file tree
Hide file tree
Showing 37 changed files with 498 additions and 302 deletions.
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions config/stylelint-config-ibm-products/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.0.33](https://github.com/carbon-design-system/ibm-products/compare/stylelint-config-ibm-products@[email protected]) (2023-10-10)


### Bug Fixes

* update to Carbon 10 compatible versions to latest ([#3495](https://github.com/carbon-design-system/ibm-products/issues/3495)) ([0c41c26](https://github.com/carbon-design-system/ibm-products/commit/0c41c267edf1919355bd56f3e8b8968de5ba8465))





## [0.0.32](https://github.com/carbon-design-system/ibm-products/compare/stylelint-config-ibm-products@[email protected]) (2023-08-15)


Expand Down
4 changes: 2 additions & 2 deletions config/stylelint-config-ibm-products/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "stylelint-config-ibm-products",
"private": true,
"version": "0.0.32",
"version": "0.0.33",
"license": "Apache-2.0",
"main": "index.js",
"repository": {
Expand All @@ -18,7 +18,7 @@
"stylelint": "^15.1.0"
},
"devDependencies": {
"stylelint-config-carbon": "^1.14.0",
"stylelint-config-carbon": "1.14.0",
"stylelint-config-idiomatic-order": "^9.0.0",
"stylelint-config-standard": "^30.0.1",
"stylelint-config-standard-scss": "^7.0.1",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"copyfiles": "^2.4.1",
"cspell": "^6.25.0",
"eslint": "^8.34.0",
"eslint-config-carbon": "3.8.0",
"eslint-config-carbon": "3.10.0",
"husky": "^8.0.3",
"jest": "^29.4.2",
"jest-canvas-mock": "^2.5.1",
Expand Down
22 changes: 22 additions & 0 deletions packages/cdai/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

## [1.24.9](https://github.com/carbon-design-system/ibm-products/compare/@carbon/[email protected]...@carbon/[email protected]) (2023-10-10)


### Bug Fixes

* update to Carbon 10 compatible versions to latest ([#3495](https://github.com/carbon-design-system/ibm-products/issues/3495)) ([0c41c26](https://github.com/carbon-design-system/ibm-products/commit/0c41c267edf1919355bd56f3e8b8968de5ba8465))





## [1.24.8](https://github.com/carbon-design-system/ibm-products/compare/@carbon/[email protected]...@carbon/[email protected]) (2023-09-19)


### Bug Fixes

* update to Carbon 10 compatible versions to latest ([#3387](https://github.com/carbon-design-system/ibm-products/issues/3387)) ([34a6257](https://github.com/carbon-design-system/ibm-products/commit/34a6257288e792160fef634f2675eb7698a756f8))





## [1.24.7](https://github.com/carbon-design-system/ibm-products/compare/@carbon/[email protected]...@carbon/[email protected]) (2023-08-15)


Expand Down
6 changes: 3 additions & 3 deletions packages/cdai/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/ibm-cloud-cognitive-cdai",
"description": "Carbon for Cloud & Cognitive CD&AI UI components",
"version": "1.24.7",
"version": "1.24.9",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -37,8 +37,8 @@
"peerDependencies": {
"@carbon/grid": "^10.43.2",
"@carbon/icons-react": "^10.49.2",
"carbon-components": "^10.58.9",
"carbon-components-react": "^7.59.11",
"carbon-components": "^10.58.10",
"carbon-components-react": "^7.59.14",
"prop-types": "^15.8.1",
"react": "^16.8.6 || ^17.0.1",
"react-dom": "^16.8.6 || ^17.0.1"
Expand Down
22 changes: 22 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

## [1.4.2](https://github.com/carbon-design-system/ibm-products/compare/@carbon/[email protected]...@carbon/[email protected]) (2023-10-10)


### Bug Fixes

* update to Carbon 10 compatible versions to latest ([#3495](https://github.com/carbon-design-system/ibm-products/issues/3495)) ([0c41c26](https://github.com/carbon-design-system/ibm-products/commit/0c41c267edf1919355bd56f3e8b8968de5ba8465))





## [1.4.1](https://github.com/carbon-design-system/ibm-products/compare/@carbon/[email protected]...@carbon/[email protected]) (2023-09-19)


### Bug Fixes

* update to Carbon 10 compatible versions to latest ([#3387](https://github.com/carbon-design-system/ibm-products/issues/3387)) ([34a6257](https://github.com/carbon-design-system/ibm-products/commit/34a6257288e792160fef634f2675eb7698a756f8))





# [1.4.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/[email protected]...@carbon/[email protected]) (2023-09-12)


Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/ibm-cloud-cognitive-core",
"private": true,
"version": "1.4.0",
"version": "1.4.2",
"license": "Apache-2.0",
"main": "scripts/build.js",
"repository": {
Expand Down Expand Up @@ -57,8 +57,8 @@
"@storybook/theming": "^6.5.16",
"babel-loader": "^9.1.2",
"babel-preset-ibm-cloud-cognitive": "^0.14.28",
"carbon-components": "^10.58.9",
"carbon-components-react": "^7.59.11",
"carbon-components": "^10.58.10",
"carbon-components-react": "^7.59.14",
"carbon-icons": "^7.0.7",
"css-loader": "^6.7.3",
"fast-sass-loader": "^2.0.1",
Expand Down
34 changes: 34 additions & 0 deletions packages/ibm-products/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,40 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.59.1](https://github.com/carbon-design-system/ibm-products/compare/@carbon/[email protected]...@carbon/[email protected]) (2023-10-10)


### Bug Fixes

* **Datagrid:** expandable row add background on row hover ([#3551](https://github.com/carbon-design-system/ibm-products/issues/3551)) ([036d579](https://github.com/carbon-design-system/ibm-products/commit/036d5795705da649745f26ad47be3ef1bd503698))
* **Datagrid:** refactor expandable implementation ([#3527](https://github.com/carbon-design-system/ibm-products/issues/3527)) ([9a7cc01](https://github.com/carbon-design-system/ibm-products/commit/9a7cc01d988f9bf503546fbf26cc7b18f88ec276))
* **Datagrid:** remove border for datagrid empty state ([#3540](https://github.com/carbon-design-system/ibm-products/issues/3540)) ([4f90e15](https://github.com/carbon-design-system/ibm-products/commit/4f90e15cd11b73e762641f7633e1c48cef478536))
* DG pagination fixes v1 ([#3549](https://github.com/carbon-design-system/ibm-products/issues/3549)) ([15eadb4](https://github.com/carbon-design-system/ibm-products/commit/15eadb4c8aadbe115e8b20c1784fa205b3950cc7))
* update checklist donut colors ([#3504](https://github.com/carbon-design-system/ibm-products/issues/3504)) ([eeea5d9](https://github.com/carbon-design-system/ibm-products/commit/eeea5d984e1e1f8564bbb716b6351baa0d698b5d))
* update to Carbon 10 compatible versions to latest ([#3495](https://github.com/carbon-design-system/ibm-products/issues/3495)) ([0c41c26](https://github.com/carbon-design-system/ibm-products/commit/0c41c267edf1919355bd56f3e8b8968de5ba8465))





# [1.59.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/[email protected]...@carbon/[email protected]) (2023-09-19)


### Bug Fixes

* datagrid row size accessibility v1 ([#3479](https://github.com/carbon-design-system/ibm-products/issues/3479)) ([b64787b](https://github.com/carbon-design-system/ibm-products/commit/b64787b6f804700012e6854965757bcc34054d89))
* **Datagrid:** add initial width value to `useResizeObserver` and add batch actions test (v1) ([#3378](https://github.com/carbon-design-system/ibm-products/issues/3378)) ([dece763](https://github.com/carbon-design-system/ibm-products/commit/dece763b2f916bd7e50d4e3394457b4917e2fd84))
* update to Carbon 10 compatible versions to latest ([#3387](https://github.com/carbon-design-system/ibm-products/issues/3387)) ([34a6257](https://github.com/carbon-design-system/ibm-products/commit/34a6257288e792160fef634f2675eb7698a756f8))


### Features

* **createfullpage:** initialstep added for v1 ([#3453](https://github.com/carbon-design-system/ibm-products/issues/3453)) ([9f4e30e](https://github.com/carbon-design-system/ibm-products/commit/9f4e30e1af681a485073471d42a12a02a1183d19))





# [1.58.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/[email protected]...@carbon/[email protected]) (2023-09-12)


Expand Down
6 changes: 3 additions & 3 deletions packages/ibm-products/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/ibm-products",
"description": "Carbon for IBM Products",
"version": "1.58.0",
"version": "1.59.1",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -90,8 +90,8 @@
"@carbon/motion": "^10.29.2",
"@carbon/themes": "^10.55.3",
"@carbon/type": "^10.45.3",
"carbon-components": "^10.58.9",
"carbon-components-react": "^7.59.11",
"carbon-components": "^10.58.10",
"carbon-components-react": "^7.59.14",
"carbon-icons": "^7.0.7",
"react": "^16.8.6 || ^17.0.1",
"react-dom": "^16.8.6 || ^17.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const defaults = {
export let ChecklistChart = React.forwardRef(
({ className, value, theme = defaults.theme, ...rest }, ref) => {
const numDegrees = clamp(value * 360, 0, 360);
const circleColor = theme === 'light' ? '#c6c6c6' : '#525252'; // $gray-30, $gray-70
const progressColor = theme === 'light' ? '#6929c4' : '#A56EFF'; // $purple-70, $purple-50
const circleColor = theme === 'light' ? '#e0e0e0' : '#525252'; // $ui-03 (-ish)
const progressColor = theme === 'light' ? '#a56eff' : '#a56eff'; // $purple-50

return (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ import { ActionSet } from '../ActionSet';
import {
usePreviousValue,
useValidCreateStepCount,
useResetCreateComponent,
useCreateComponentFocus,
useCreateComponentStepChange,
} from '../../global/js/hooks';
import { lastIndexInArray } from '../../global/js/utils/lastIndexInArray';
import { getNumberOfHiddenSteps } from '../../global/js/utils/getNumberOfHiddenSteps';

const blockClass = `${pkg.prefix}--create-full-page`;
const componentName = 'CreateFullPage';
Expand All @@ -54,6 +56,7 @@ export let CreateFullPage = React.forwardRef(
cancelButtonText,
children,
className,
initialStep,
modalDangerButtonText,
modalDescription,
modalSecondaryButtonText,
Expand Down Expand Up @@ -91,7 +94,14 @@ export let CreateFullPage = React.forwardRef(
if (lastItem !== lastIncludedStep) {
setLastIncludedStep(lastItem);
}
}, [stepData, firstIncludedStep, lastIncludedStep]);
if (open && initialStep) {
const numberOfHiddenSteps = getNumberOfHiddenSteps(
stepData,
initialStep
);
setCurrentStep(Number(initialStep + numberOfHiddenSteps));
}
}, [stepData, firstIncludedStep, lastIncludedStep, initialStep]);

useCreateComponentFocus({
previousState,
Expand All @@ -101,6 +111,16 @@ export let CreateFullPage = React.forwardRef(
firstFocusElement,
});
useValidCreateStepCount(stepData.length, componentName);
useResetCreateComponent({
firstIncludedStep,
previousState,
open,
setCurrentStep,
stepData,
initialStep,
totalSteps: stepData?.length,
componentName,
});
useCreateComponentStepChange({
firstIncludedStep,
lastIncludedStep,
Expand Down Expand Up @@ -238,6 +258,13 @@ CreateFullPage.propTypes = {
*/
firstFocusElement: PropTypes.string,

/**
* This can be used to open the component to a step other than the first step.
* For example, a create flow was previously in progress, data was saved, and
* is now being completed.
*/
initialStep: PropTypes.number,

/**
* The primary 'danger' button text in the modal
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const finalStepOnNextNonPromise = jest.fn();
const finalStepOnNextRejectFn = jest.fn(() =>
Promise.reject(rejectionErrorMessage)
);
const onMountFn = jest.fn();

const defaultFullPageProps = {
nextButtonText,
Expand Down Expand Up @@ -111,6 +112,7 @@ const renderCreateFullPage = ({
onNext={rejectOnNext ? onNextStepRejectionFn : onNext}
hasFieldset
fieldsetLegendText="Title1"
onMount={onMountFn}
>
{stepFormField}
</CreateFullPageStep>
Expand Down Expand Up @@ -194,6 +196,45 @@ describe(componentName, () => {
expect(container.querySelector(`.${blockClass}`)).toBeTruthy();
});

it('should render the CreateFullPage on the specified initialStep prop provided', () => {
const { container } = renderCreateFullPage({
...defaultFullPageProps,
initialStep: 2,
});
const createFullPageSteps = container.querySelector(
`.${blockClass}__content .${blockClass}__form`
).children;

expect(
createFullPageSteps[1].classList.contains(
`.${blockClass}__step__step--visible-step`
)
);
});

it('renders the first step if an invalid initialStep value is provided', () =>
expectWarn(
`${CreateFullPage.displayName}: An invalid \`initialStep\` prop was supplied. The \`initialStep\` prop should be a number that is greater than 0 or less than or equal to the number of steps your ${CreateFullPage.displayName} has.`,
() => {
const { container } = renderCreateFullPage({
...defaultFullPageProps,
// Starting on 0 step is invalid since the steps start with a value of 1
// This will cause a console warning
initialStep: 0,
});
const createFullPageSteps = container.querySelector(
`.${blockClass}__content .${blockClass}__form`
).children;
expect(
createFullPageSteps[0].classList.contains(
`.${blockClass}__step__step--visible-step`
)
);
// The onMount prop will get called here because the first step is rendered
expect(onMountFn).toHaveBeenCalledTimes(1);
}
));

it('should not render any CreateFullPage steps when there are no FullPageStep components included', () => {
const { container } = renderEmptyCreateFullPage({
...defaultFullPageProps,
Expand Down
37 changes: 7 additions & 30 deletions packages/ibm-products/src/components/Datagrid/Datagrid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1487,22 +1487,9 @@ describe(componentName, () => {
.textContent
).toEqual(`Content for ${rowNumber}`);

fireEvent.click(
screen
.getByRole('table')
.getElementsByTagName('tbody')[0]
.getElementsByClassName('c4p--datagrid__expanded-row')[0]
.getElementsByTagName('tr')[0]
.getElementsByTagName('td')[0]
.getElementsByTagName('button')[0]
);

expect(
screen
.getByRole('table')
.getElementsByTagName('tbody')[0]
.getElementsByClassName('c4p--datagrid__expanded-row').length
).toBe(0);
const firstRowExpander =
screen.getAllByLabelText('Expand current row')[rowNumber];
fireEvent.click(firstRowExpander);
}

it('Expanded Row', () => {
Expand Down Expand Up @@ -1572,20 +1559,10 @@ describe(componentName, () => {

it('Nested Table', () => {
render(<NestedTable data-testid={dataTestId}></NestedTable>);
fireEvent.click(
screen
.getAllByRole('table')[0]
.getElementsByTagName('tbody')[0]
.getElementsByTagName('tr')[0]
.getElementsByTagName('td')[0]
.getElementsByTagName('button')[0]
);
expect(
screen
.getAllByRole('table')[0]
.getElementsByTagName('tbody')[0]
.getElementsByTagName('div')[0].childNodes[1].classList[0]
).toEqual('c4p--datagrid__expanded-row-content');
const firstRowExpander = screen.getAllByLabelText('Expand current row')[0];
const firstRow = screen.getAllByRole('row')[1];
fireEvent.click(firstRowExpander);
expect(firstRow.nextSibling).toHaveClass('c4p--datagrid__expanded-row');

const alertMock = jest.spyOn(window, 'alert');

Expand Down
Loading

0 comments on commit f1bdfe0

Please sign in to comment.