diff --git a/packages/eds-core-react/src/components/next/Autocomplete/autocomplete.css b/packages/eds-core-react/src/components/next/Autocomplete/autocomplete.css index 0817dc202d..99949d9d23 100644 --- a/packages/eds-core-react/src/components/next/Autocomplete/autocomplete.css +++ b/packages/eds-core-react/src/components/next/Autocomplete/autocomplete.css @@ -27,7 +27,7 @@ } /* Square connecting corners, suppress focus ring, and use medium border when dropdown is open */ - &:has(input[aria-expanded='true']) .eds-input-container { + &:has(input[aria-expanded='true']) .eds-input { border-end-start-radius: 0; border-end-end-radius: 0; outline-color: var(--eds-color-border-medium); diff --git a/packages/eds-core-react/src/components/next/Foundation/elements.css b/packages/eds-core-react/src/components/next/Foundation/elements.css index a886293c20..363d15b8bd 100644 --- a/packages/eds-core-react/src/components/next/Foundation/elements.css +++ b/packages/eds-core-react/src/components/next/Foundation/elements.css @@ -370,7 +370,7 @@ .eds-elements :where(input):not( [type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='image'], - [type='submit'], [type='reset'], [type='button'], .eds-input + [type='submit'], [type='reset'], [type='button'], .control ) { --_bg-color: var(--eds-color-bg-input); diff --git a/packages/eds-core-react/src/components/next/Input/Input.test.tsx b/packages/eds-core-react/src/components/next/Input/Input.test.tsx index 2599857d3d..1091c85252 100644 --- a/packages/eds-core-react/src/components/next/Input/Input.test.tsx +++ b/packages/eds-core-react/src/components/next/Input/Input.test.tsx @@ -65,7 +65,7 @@ describe('Input (Next EDS 2.0)', () => { it('Can be extended with className on input element', () => { render() const input = screen.getByDisplayValue('textfield') - expect(input).toHaveClass('eds-input') + expect(input).toHaveClass('control') expect(input).toHaveClass('input-class') }) }) @@ -100,7 +100,7 @@ describe('Input (Next EDS 2.0)', () => { it('Shows error icon when invalid by default', () => { const { container } = render() // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access - const errorIcon = container.querySelector('.eds-error-icon') + const errorIcon = container.querySelector('.error-icon') expect(errorIcon).toBeInTheDocument() }) @@ -109,7 +109,7 @@ describe('Input (Next EDS 2.0)', () => { , ) // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access - const errorIcon = container.querySelector('.eds-error-icon') + const errorIcon = container.querySelector('.error-icon') expect(errorIcon).not.toBeInTheDocument() }) @@ -118,7 +118,7 @@ describe('Input (Next EDS 2.0)', () => { , ) // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access - const errorIcon = container.querySelector('.eds-error-icon') + const errorIcon = container.querySelector('.error-icon') expect(errorIcon).not.toBeInTheDocument() }) @@ -127,7 +127,7 @@ describe('Input (Next EDS 2.0)', () => { , ) // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access - const errorIcon = container.querySelector('.eds-error-icon') + const errorIcon = container.querySelector('.error-icon') expect(errorIcon).not.toBeInTheDocument() }) }) @@ -164,8 +164,8 @@ describe('Input (Next EDS 2.0)', () => { it('Text has text class', () => { const { container } = render() /* eslint-disable testing-library/no-container, testing-library/no-node-access */ - const startText = container.querySelector('.eds-adornment__text') - const endText = container.querySelectorAll('.eds-adornment__text')[1] + const startText = container.querySelector('.text') + const endText = container.querySelectorAll('.text')[1] /* eslint-enable testing-library/no-container, testing-library/no-node-access */ expect(startText).toBeInTheDocument() expect(endText).toBeInTheDocument() @@ -179,12 +179,8 @@ describe('Input (Next EDS 2.0)', () => { />, ) /* eslint-disable testing-library/no-container, testing-library/no-node-access */ - const startAdornment = container.querySelector( - '.eds-adornment__adornment', - ) - const endAdornment = container.querySelectorAll( - '.eds-adornment__adornment', - )[1] + const startAdornment = container.querySelector('.item') + const endAdornment = container.querySelectorAll('.item')[1] /* eslint-enable testing-library/no-container, testing-library/no-node-access */ expect(startAdornment).toBeInTheDocument() expect(endAdornment).toBeInTheDocument() @@ -274,14 +270,14 @@ describe('Input (Next EDS 2.0)', () => { it('Applies base class and custom containerClassName', () => { render() const wrapper = getInputWrapper() - expect(wrapper).toHaveClass('eds-input-container') + expect(wrapper).toHaveClass('eds-input') expect(wrapper).toHaveClass('test-class') }) it('Applies input class to input element', () => { render() const input = screen.getByDisplayValue('test') - expect(input).toHaveClass('eds-input') + expect(input).toHaveClass('control') }) it('Applies disabled data attribute when disabled', () => { diff --git a/packages/eds-core-react/src/components/next/Input/Input.tsx b/packages/eds-core-react/src/components/next/Input/Input.tsx index c679c076cc..e6101ee24c 100644 --- a/packages/eds-core-react/src/components/next/Input/Input.tsx +++ b/packages/eds-core-react/src/components/next/Input/Input.tsx @@ -29,7 +29,7 @@ export const Input: OverridableComponent = const hasStartAdornment = startText || startAdornment const hasEndAdornment = endText || endAdornment - const containerClasses = ['eds-input-container', containerClassName] + const containerClasses = ['eds-input', containerClassName] .filter(Boolean) .join(' ') @@ -46,7 +46,7 @@ export const Input: OverridableComponent = > {displayErrorIcon && ( = )} {hasStartAdornment && ( -
+
{startText && ( = )} {startAdornment && ( - + {startAdornment} )} @@ -78,7 +78,7 @@ export const Input: OverridableComponent = type={Component === 'textarea' ? undefined : type} disabled={disabled} readOnly={readOnly} - className={['eds-input', className].filter(Boolean).join(' ')} + className={['control', className].filter(Boolean).join(' ')} data-color-appearance="neutral" data-font-family="ui" data-font-size="md" @@ -89,10 +89,10 @@ export const Input: OverridableComponent = aria-invalid={invalid || undefined} /> {hasEndAdornment && ( -
+
{endText && ( = )} {endAdornment && ( - + {endAdornment} )} diff --git a/packages/eds-core-react/src/components/next/Input/__snapshots__/Input.test.tsx.snap b/packages/eds-core-react/src/components/next/Input/__snapshots__/Input.test.tsx.snap index 4b76c49f82..a63d202658 100644 --- a/packages/eds-core-react/src/components/next/Input/__snapshots__/Input.test.tsx.snap +++ b/packages/eds-core-react/src/components/next/Input/__snapshots__/Input.test.tsx.snap @@ -3,7 +3,7 @@ exports[`Input (Next EDS 2.0) Matches snapshot 1`] = `
+ {label && ( -
+
{label} @@ -43,7 +43,7 @@ export const TextField = forwardRef< round size="small" tone="neutral" - className="eds-text-field__info" + className="info" aria-label="More information" > diff --git a/packages/eds-core-react/src/components/next/TextField/__snapshots__/TextField.test.tsx.snap b/packages/eds-core-react/src/components/next/TextField/__snapshots__/TextField.test.tsx.snap index fc375127b9..e84ea24c91 100644 --- a/packages/eds-core-react/src/components/next/TextField/__snapshots__/TextField.test.tsx.snap +++ b/packages/eds-core-react/src/components/next/TextField/__snapshots__/TextField.test.tsx.snap @@ -3,10 +3,10 @@ exports[`TextField (Next EDS 2.0) Matches snapshot 1`] = `