Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ Object.defineProperty(window, 'matchMedia', {
dispatchEvent: jest.fn(),
})),
});
global.ResizeObserver = jest.fn().mockImplementation(() => ({
observe: jest.fn(),
unobserve: jest.fn(),
disconnect: jest.fn(),
}));
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.7.3"
},
"resolutions": {
"react-is": "^19.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

react-is has moved from being a hard dependency to instead being a peer dependency. This change was done to facilitate React 19 support, so we will need this resolution for Tabs component to get rendered.

see: carbon-design-system/carbon#19538

},
"release": {
"monorepo": "./packages",
"branches": [
Expand Down
2 changes: 1 addition & 1 deletion packages/carbon-component-mapper/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://unpkg.com/carbon-components/css/carbon-components.min.css">
<link rel="stylesheet" href="https://unpkg.com/@carbon/styles/css/styles.min.css">
<title>Data driven forms</title>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion packages/carbon-component-mapper/demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { wizardSchema } from './demo-schemas/wizard-schema';
import sandboxSchema from './demo-schemas/sandbox';
import demoSchema from '../../../shared/demoschema';

import { Button } from 'carbon-components-react';
import { Button } from '@carbon/react';

const fieldArrayState = {
schema: arraySchemaDDF,
Expand Down
6 changes: 1 addition & 5 deletions packages/carbon-component-mapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
"javascript"
],
"devDependencies": {
"@carbon/icons-react": "^10.41.0",
"@types/carbon-components-react": "^7.44.1",
"carbon-components": "^10.46.0",
"carbon-components-react": "^7.46.0",
"carbon-icons": "^7.0.7"
"@carbon/react": "^1.95.0"
},
"peerDependencies": {
"react": "^17.0.2 || ^18.0.0 || ^19.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-render
import { ReactNode } from "react";
import { FormGroupProps } from "../form-group";

import { CheckboxProps as CarbonCheckboxProps } from 'carbon-components-react';
import { CheckboxProps as CarbonCheckboxProps } from '@carbon/react';

export interface CheckboxOption extends CarbonCheckboxProps {
value?: any;
Expand Down
4 changes: 2 additions & 2 deletions packages/carbon-component-mapper/src/checkbox/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { useFieldApi } from '@data-driven-forms/react-form-renderer';
import MultipleChoiceListCommon from '@data-driven-forms/common/multiple-choice-list';

import { Checkbox as CarbonCheckbox, FormGroup } from 'carbon-components-react';
import { Checkbox as CarbonCheckbox, FormGroup } from '@carbon/react';

import WithDescription from '../with-description';
import prepareProps, { buildLabel } from '../prepare-props';
Expand Down Expand Up @@ -33,7 +33,7 @@ const SingleCheckbox = (props) => {
};

const SingleCheckboxInCommon = ({ label, isDisabled, id, meta, option: { value, name, ...rest }, onChange, ...props }) => (
<CarbonCheckbox id={id} labelText={label} disabled={isDisabled} {...props} {...rest} onChange={(_value, _name, event) => onChange(event)} />
<CarbonCheckbox id={id} labelText={label} disabled={isDisabled} {...props} {...rest} onChange={(event, data) => onChange(event, data)} />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Carbon v11, the Checkbox onChange callback receives:

  • event - The change event
  • an object with { checked, id } - The new checked state and the checkbox ID

See: https://github.com/carbon-design-system/carbon/blob/main/docs/migration/v11.md#checkbox

);

const Checkbox = ({ options, ...props }) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FormGroupProps } from "../form-group";
import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer";

import { DatePickerProps as CarbonDatePickerProps, DatePickerInputProps } from 'carbon-components-react';
import { DatePickerProps as CarbonDatePickerProps, DatePickerInputProps } from '@carbon/react';

interface InternalDatePickerProps extends DatePickerInputProps {
datePickerType?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useFieldApi } from '@data-driven-forms/react-form-renderer';

import { DatePicker as CarbonDatePicker, DatePickerInput } from 'carbon-components-react';
import { DatePicker as CarbonDatePicker, DatePickerInput } from '@carbon/react';

import prepareProps from '../prepare-props';
import HelperTextBlock from '../helper-text-block/helper-text-block';
Expand All @@ -23,8 +23,8 @@ const DatePicker = (props) => {

return (
<div {...WrapperProps}>
<CarbonDatePicker {...input} datePickerType={datePickerType} {...DatePickerProps}>
<DatePickerInput id={input.name} invalid={Boolean(invalid)} invalidText={invalid ? invalid : ''} {...rest} />
<CarbonDatePicker {...input} datePickerType={datePickerType} invalid={Boolean(invalid)} {...DatePickerProps}>
Copy link
Contributor Author

@asirvadAbrahamVarghese asirvadAbrahamVarghese Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invalid prop on DatePickerInput has no impact now. So invalid should be passed to DatePicker and invalidText should be passed to DatePickerInput(as it is now) - this is not referenced in the migration docs, after discussing with the Carbon team, I have opened an issue: carbon-design-system/carbon#21035

<DatePickerInput id={input.name} invalidText={invalid || ''} {...rest} />
</CarbonDatePicker>
<HelperTextBlock helperText={!invalid && helperText} warnText={warnText} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
StructuredListProps, StructuredListBodyProps,
AllStructuredListRowProps,
StructuredListCellProps
} from 'carbon-components-react';
} from '@carbon/react';

export interface DualListSelectValue extends AnyObject {
value: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { createUseStyles } from 'react-jss';

import {
Grid,
Row,
Column,
Button,
FormGroup,
Expand All @@ -14,9 +13,8 @@ import {
StructuredListRow,
StructuredListBody,
StructuredListCell,
TooltipIcon,
} from 'carbon-components-react';
import { CheckmarkFilled16, ChevronRight32, ChevronLeft32, CaretSortDown32, CaretSortUp32 } from '@carbon/icons-react';
} from '@carbon/react';
import { CheckmarkFilled, ChevronRight, ChevronLeft, CaretSortDown, CaretSortUp } from '@carbon/react/icons';

import { buildLabel } from '../prepare-props';

Expand Down Expand Up @@ -50,9 +48,13 @@ const useStyles = createUseStyles({
},
toolbar: {
display: 'flex',
'& .cds--tooltip-trigger__wrapper': {
height: '100%',
},
},
tooltipButton: {
background: '#c2c1c1 !important',
height: '100%',
},
});

Expand All @@ -72,18 +74,16 @@ const List = ({ options, selectedValues, handleOptionsClick, noTitle, ListProps,
return options.length > 0 ? (
<StructuredListWrapper selection {...ListProps} className={clsx(dualList, ListProps.className)}>
<StructuredListBody {...BodyProps} className={clsx(dualListBody, BodyProps.className)}>
{options.map(({ value, label, ListRowProps, ListCellProps, GridProps, RowProps, LabelProps, CheckmarkProps }) => (
{options.map(({ value, label, ListRowProps, ListCellProps, GridProps, LabelProps, CheckmarkProps }) => (
<StructuredListRow key={value} {...ListRowProps} onClick={(e) => handleOptionsClick({ ...e, ctrlKey: true }, value)}>
<StructuredListCell {...ListCellProps}>
<Grid {...GridProps}>
<Row narrow {...RowProps}>
<Column sm={3} {...LabelProps}>
{label}
</Column>
<Column sm={1} {...CheckmarkProps}>
{selectedValues.includes(value) && <CheckmarkFilled16 />}
</Column>
</Row>
<Grid condensed {...GridProps}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Grid system has changed. The Row component no longer exists - it's been removed. In v11, we should use Grid and Column directly without Row.
See: https://github.com/carbon-design-system/carbon/blob/main/docs/migration/v11.md#grid

<Column sm={3} {...LabelProps}>
{label}
</Column>
<Column sm={1} {...CheckmarkProps}>
{selectedValues.includes(value) && <CheckmarkFilled size={16} />}
</Column>
</Grid>
</StructuredListCell>
</StructuredListRow>
Expand All @@ -101,9 +101,18 @@ const Toolbar = ({ sortTitle, onFilter, onSort, sortDirection, placeholder, Tool
return (
<div {...ToolbarProps} className={clsx(toolbar, ToolbarProps.className)}>
<Search onChange={(e) => onFilter(e.target.value)} labelText="" placeholder={placeholder} {...SearchProps} />
<TooltipIcon onClick={onSort} tooltipText={sortTitle} {...SortProps} className={clsx(tooltipButton, SortProps.className)}>
{sortDirection ? <CaretSortDown32 /> : <CaretSortUp32 />}
</TooltipIcon>
<Button
kind="ghost"
size="sm"
hasIconOnly
onClick={onSort}
iconDescription={sortTitle}
renderIcon={(props) => (sortDirection ? <CaretSortDown size={32} {...props} /> : <CaretSortUp size={32} {...props} />)}
tooltipAlignment="center"
tooltipPosition="bottom"
{...SortProps}
className={clsx(tooltipButton, SortProps.className)}
/>
</div>
);
};
Expand Down Expand Up @@ -146,7 +155,6 @@ const DualListSelectInner = ({
filterValueText = 'Remove your filter to see all selected',
FormGroupProps = {},
GridProps = {},
RowProps = {},
OptionsColumnProps = {},
ButtonColumnProps = {},
ValuesColumnProps = {},
Expand All @@ -169,77 +177,75 @@ const DualListSelectInner = ({

return (
<FormGroup legendText={buildLabel(label || '', isRequired)} {...FormGroupProps}>
<Grid {...GridProps}>
<Row condensed {...RowProps}>
<Column sm={4} md={8} lg={5} {...OptionsColumnProps}>
{React.createElement(LeftTitleElement, LeftTitleProps, leftTitle)}
<Toolbar
onFilter={filterOptions}
placeholder={filterOptionsTitle}
sortDirection={state.sortLeftDesc}
onSort={sortOptions}
sortTitle={sortOptionsTitle}
ToolbarProps={LeftToolbarProps}
SearchProps={LeftSearchProps}
SortProps={LeftSortProps}
/>
<List
ListProps={LeftListProps}
BodyProps={LeftBodyProps}
options={leftValues}
selectedValues={state.selectedLeftValues}
handleOptionsClick={handleOptionsClick}
noTitle={state.filterOptions ? filterOptionsText : noOptionsTitle}
/>
</Column>
<Column sm={4} md={8} lg={2} {...ButtonColumnProps} className={clsx(buttonWrapper, ButtonColumnProps.className)}>
<Button
id="move-right"
renderIcon={ChevronRight32}
onClick={handleMoveRight}
disabled={isEmpty(state.selectedLeftValues)}
{...AddButtonProps}
>
{moveRightTitle}
</Button>
<Button id="move-all-right" onClick={handleClearLeftValues} disabled={isEmpty(leftValues)} {...AddAllButtonProps}>
{moveAllRightTitle}
</Button>
<Button id="move-all-left" onClick={handleClearRightValues} disabled={isEmpty(rightValues)} {...RemoveAllButtonProps}>
{moveAllLeftTitle}
</Button>
<Button
id="move-left"
renderIcon={ChevronLeft32}
onClick={handleMoveLeft}
disabled={isEmpty(state.selectedRightValues)}
{...RemoveButtonProps}
>
{moveLeftTitle}
</Button>
</Column>
<Column sm={4} md={8} lg={5} {...ValuesColumnProps}>
{React.createElement(RightTitleElement, RightTitleProps, rightTitle)}
<Toolbar
onFilter={filterValues}
placeholder={filterValuesTitle}
sortDirection={state.sortRightDesc}
onSort={sortValues}
sortTitle={sortValuesTitle}
ToolbarProps={RightToolbarProps}
SearchProps={RightSearchProps}
SortProps={RightSortProps}
/>
<List
ListProps={RightListProps}
BodyProps={RightBodyProps}
options={rightValues}
selectedValues={state.selectedRightValues}
handleOptionsClick={handleValuesClick}
noTitle={state.filterValue ? filterValueText : noValueTitle}
/>
</Column>
</Row>
<Grid condensed {...GridProps}>
<Column sm={4} md={8} lg={5} {...OptionsColumnProps}>
{React.createElement(LeftTitleElement, LeftTitleProps, leftTitle)}
<Toolbar
onFilter={filterOptions}
placeholder={filterOptionsTitle}
sortDirection={state.sortLeftDesc}
onSort={sortOptions}
sortTitle={sortOptionsTitle}
ToolbarProps={LeftToolbarProps}
SearchProps={LeftSearchProps}
SortProps={LeftSortProps}
/>
<List
ListProps={LeftListProps}
BodyProps={LeftBodyProps}
options={leftValues}
selectedValues={state.selectedLeftValues}
handleOptionsClick={handleOptionsClick}
noTitle={state.filterOptions ? filterOptionsText : noOptionsTitle}
/>
</Column>
<Column sm={4} md={8} lg={4} {...ButtonColumnProps} className={clsx(buttonWrapper, ButtonColumnProps.className)}>
<Button
id="move-right"
renderIcon={(props) => <ChevronRight size={32} {...props} />}
onClick={handleMoveRight}
disabled={isEmpty(state.selectedLeftValues)}
{...AddButtonProps}
>
{moveRightTitle}
</Button>
<Button id="move-all-right" onClick={handleClearLeftValues} disabled={isEmpty(leftValues)} {...AddAllButtonProps}>
{moveAllRightTitle}
</Button>
<Button id="move-all-left" onClick={handleClearRightValues} disabled={isEmpty(rightValues)} {...RemoveAllButtonProps}>
{moveAllLeftTitle}
</Button>
<Button
id="move-left"
renderIcon={(props) => <ChevronLeft size={32} {...props} />}
onClick={handleMoveLeft}
disabled={isEmpty(state.selectedRightValues)}
{...RemoveButtonProps}
>
{moveLeftTitle}
</Button>
</Column>
<Column sm={4} md={8} lg={5} {...ValuesColumnProps}>
{React.createElement(RightTitleElement, RightTitleProps, rightTitle)}
<Toolbar
onFilter={filterValues}
placeholder={filterValuesTitle}
sortDirection={state.sortRightDesc}
onSort={sortValues}
sortTitle={sortValuesTitle}
ToolbarProps={RightToolbarProps}
SearchProps={RightSearchProps}
SortProps={RightSortProps}
/>
<List
ListProps={RightListProps}
BodyProps={RightBodyProps}
options={rightValues}
selectedValues={state.selectedRightValues}
handleOptionsClick={handleValuesClick}
noTitle={state.filterValue ? filterValueText : noValueTitle}
/>
</Column>
</Grid>
</FormGroup>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FieldArrayField, UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer";
import { ReactNode } from "react";
import { ButtonProps, FormGroupProps as CarbonFormGroupProps } from "carbon-components-react";
import { ButtonProps, FormGroupProps as CarbonFormGroupProps } from "@carbon/react";

import { FormGroupProps } from '../form-group';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { createUseStyles } from 'react-jss';

import { useFieldApi, useFormApi, FieldArray as FieldArrayFF } from '@data-driven-forms/react-form-renderer';

import { Button, FormGroup } from 'carbon-components-react';
import { AddAlt32, Subtract32 } from '@carbon/icons-react';
import { Button, FormGroup } from '@carbon/react';
import { AddAlt, Subtract } from '@carbon/react/icons';

import prepareProps from '../prepare-props';

Expand Down Expand Up @@ -45,7 +45,7 @@ const ArrayItem = memo(
{formOptions.renderForm(editedFields, formOptions)}
<Button
disabled={buttonDisabled}
renderIcon={Subtract32}
renderIcon={(props) => <Subtract size={32} {...props} />}
id={`remove-${name}`}
kind="danger"
onClick={remove}
Expand Down Expand Up @@ -119,7 +119,7 @@ const FieldArray = (props) => {
<div {...AddContainerProps} className={clsx(addContainer, AddContainerProps.className)}>
<Button
disabled={fieldArrayProps.fields.length >= maxItems}
renderIcon={AddAlt32}
renderIcon={(props) => <AddAlt size={32} {...props} />}
Copy link
Contributor Author

@asirvadAbrahamVarghese asirvadAbrahamVarghese Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For button's renderIcon, passing the props to the function component is needed for the proper styles to get applied to the icon(missing classes on the SVG element)
See: carbon-design-system/carbon#11168

id={`add-${input.name}`}
onClick={() => fieldArrayProps.fields.push(defaultItem)}
{...AddButtonProps}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import clsx from 'clsx';
import { createUseStyles } from 'react-jss';

import { Form as CarbonForm, Button as CarbonButton, ButtonSet } from 'carbon-components-react';
import { Form as CarbonForm, Button as CarbonButton, ButtonSet } from '@carbon/react';

import FormTemplate from '@data-driven-forms/common/form-template';

Expand Down
Loading