Skip to content

feat: ✨ Input and TextField - new version for EDS 2.0. using new tokens - #4219

Merged
millus merged 66 commits into
mainfrom
feat/4194-text-input-update-code-in-eds-core
Jan 27, 2026
Merged

feat: ✨ Input and TextField - new version for EDS 2.0. using new tokens#4219
millus merged 66 commits into
mainfrom
feat/4194-text-input-update-code-in-eds-core

Conversation

@millus

@millus millus commented Nov 10, 2025

Copy link
Copy Markdown
Collaborator

This pull request introduces the new EDS 2.0 Input component as a low-level, flexible form input for the next generation of the Equinor Design System. It includes the component implementation, types, documentation, comprehensive tests, and updates to package exports and Storybook configuration to support the new features.

New EDS 2.0 Input component:

  • Added the new Input component in src/components/next/Input/Input.tsx, supporting flexible props such as adornments, text, invalid/disabled/readOnly states, and rendering as either input or textarea. The component uses EDS 2.0 token system data attributes and is fully accessible.
  • Defined the InputProps type in Input.types.ts to document and enforce the supported props for the new component.
  • Added an index file to export the new component and its types.
  • Created a snapshot for the new component to support regression testing.

Documentation and Storybook:

  • Added a new MDX documentation file for the Input component, covering usage, examples, and guidance for composition and accessibility.
  • Updated the Storybook preview configuration to include the "Next (EDS 2.0)" section for the new components.

Testing:

  • Added a comprehensive test suite for the new Input component, covering accessibility, states, adornments, EDS 2.0 token system attributes, and CSS classes.

Package and build updates:

  • Updated package.json to include the build output for EDS 2.0 CSS files and ensure they are exported and included in the published package. [1] [2]

Also added TextField component that uses both the new Field wrapper and Input component.

@millus
millus requested a review from vnys as a code owner November 10, 2025 09:00
Copilot AI review requested due to automatic review settings November 10, 2025 09:00
@millus millus linked an issue Nov 10, 2025 that may be closed by this pull request
@millus
millus marked this pull request as draft November 10, 2025 09:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new version of the Input component that replaces styled-components with vanilla CSS, aligning with the project's modernization efforts towards EDS 2.0. The new component maintains full functional parity with the original while using CSS custom properties for styling.

Key Changes

  • New Input component implementation using vanilla CSS instead of styled-components
  • Complete test coverage matching the original component
  • Comprehensive Storybook documentation and examples
  • Exported as InputNew to allow gradual migration

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/eds-core-react/src/components/Input/index.ts Exports the new component as InputNew
packages/eds-core-react/src/components/Input/Input.new.types.ts Type definitions for the new Input component
packages/eds-core-react/src/components/Input/Input.new.tsx Main component implementation using vanilla CSS
packages/eds-core-react/src/components/Input/Input.new.test.tsx Comprehensive test suite with accessibility checks
packages/eds-core-react/src/components/Input/Input.new.stories.tsx Storybook stories demonstrating all variants and features
packages/eds-core-react/src/components/Input/Input.new.docs.mdx Documentation with usage examples and migration guide
packages/eds-core-react/src/components/Input/Input.new.css CSS implementation with BEM naming convention
packages/eds-core-react/src/components/Input/__snapshots__/Input.new.test.tsx.snap Jest snapshot for regression testing

Comment thread packages/eds-core-react/src/components/Input/Input.new.tsx Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.types.ts Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.stories.tsx Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.docs.mdx Outdated
Comment thread packages/eds-core-react/src/components/next/Input/Input.types.ts Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.types.ts Outdated
@millus millus changed the title feat(eds-core) ✨ Input - new version for EDS 2.0. using new tokens feat(eds-core): ✨ Input - new version for EDS 2.0. using new tokens Nov 10, 2025
@millus millus changed the title feat(eds-core): ✨ Input - new version for EDS 2.0. using new tokens feat(eds-core-react): ✨ Input - new version for EDS 2.0. using new tokens Nov 10, 2025
@millus
millus requested a review from Copilot November 12, 2025 11:57
@millus
millus force-pushed the feat/4194-text-input-update-code-in-eds-core branch from 8629bc0 to 8ea5903 Compare November 12, 2025 12:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Comment thread packages/eds-core-react/src/components/Input/Input.new.docs.mdx Outdated
Comment thread packages/eds-core-react/src/styles.css Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.stories.tsx Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.docs.mdx Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.docs.mdx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comment thread packages/eds-core-react/src/components/Input/Input.new.docs.mdx Outdated
Comment thread packages/eds-core-react/src/index.css Outdated
@millus
millus force-pushed the feat/4194-text-input-update-code-in-eds-core branch from 3378bbc to 79f9cfc Compare November 14, 2025 09:22
@millus
millus requested a review from Copilot November 14, 2025 13:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.

Comment thread packages/eds-core-react/src/components/Input/Input.new.docs.mdx Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.stories.tsx Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.stories.tsx Outdated
Comment thread packages/eds-core-react/src/components/Input/input.new.css Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.docs.mdx Outdated
Comment thread packages/eds-core-react/src/components/Input/input.new.css Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.stories.tsx Outdated
Comment thread packages/eds-core-react/src/components/Input/Input.new.stories.tsx Outdated
Comment thread packages/eds-core-react/CSS_ARCHITECTURE.md Outdated
Comment thread packages/eds-core-react/CSS_ARCHITECTURE.md Outdated
Comment thread packages/eds-core-react/src/styles.css Outdated
@millus
millus requested a review from Copilot November 18, 2025 11:44
millus added 23 commits January 26, 2026 14:33
- Add info prop to Label component for displaying tooltip on hover/focus
- Add labelInfo prop to TextField that passes through to Label
- Info icon displays on the right side of the label with hover background
- Add Label stories to Storybook under EDS 2.0 (beta)
- Add comprehensive tests for info tooltip functionality
- Add labelInfo to Introduction story default args
- Organize argTypes into categories: Core, Label, Content, States, Adornments, Other
- Add as prop control for input/textarea selection
- Add id and className to Other category
- Align category order with Input stories
…Label

- Replace old Icon import with new Icon from ../Icon
- Use token-based sizes (xs) instead of pixel values (16, 18)
- Both error icon (Input) and info icon (Label) now use size='xs' (16px)
- Removed info prop from Label component (simplified)
- Added labelInfo prop handling in TextField with Tooltip
- Created text-field.css for header layout styling
- Added DensityModes story with live password validation
- Label now uses inline-flex without wrapper div
- Refactor TextField to use Field.Label, Field.Description, Field.HelperMessage
- Replace optional/required props with indicator prop for visual text
- Remove standalone Label and HelperMessage folders (now using Field's versions)
- Update Input stories to use Field.Label and document TextField recommendation
- Fix CSS import order in index.css
- Update tests for new indicator prop API
- Align font sizes with Figma (md for input value, xs for adornments)
- Rename leftText/rightText to startText/endText for RTL support
- Rename leftAdornment/rightAdornment to startAdornment/endAdornment
- Use data-font-size for dynamic density-aware spacing
- Remove redundant data-line-height attribute
- Update TextField FullExample with money icon and type=number
- Update documentation and tests
- Use CSS nesting for cleaner code structure
- Replace hardcoded 2px with --eds-sizing-stroke-thick token
- Use inline-size instead of width for RTL support
- Add gap token for header spacing
- Add flex-shrink: 0 to info button
- Fix TextField ref type to support HTMLInputElement | HTMLTextAreaElement
- Remove duplicate 'Next (EDS 2.0)' entry from Storybook preview
- Move aria-invalid after spread to prevent accidental override
- Add InputHTMLAttributes to InputProps for proper type exports
- Remove duplicate props from InputProps (now inherited from HTMLAttributes)
- Add role=alert to HelperMessage when invalid for screen readers
- Fix adornment text vertical alignment with display: flex
- Add accessibility note about aria-label in Input docs
- Simplify TextField.types.ts (InputProps already includes HTMLAttributes)
- Remove duplicate FieldDescription.tsx (merged from main)
- Remove 'use client' directive from index.next.ts for SSR compatibility
- Remove automatic CSS import - users must import CSS separately
- Update docs to clarify CSS must be imported manually:
  import '@equinor/eds-core-react/next/index.css'
- Change position: relative to isolation: isolate
- Add padding-block for 36px height using sm + squished tokens
- Add webkit comment for Safari autofill styling
- Add data-baseline to adornments for text alignment
- Add data-line-height to input element
- Add invalid state styling for adornments and error icon
- Simplify adornment CSS with nesting
- Update tests for new token values
- Rename className to containerClassName for explicit container styling
- Keep className for input element (standard React behavior)
- Add Storybook documentation showing both props
- Add tests for both className and containerClassName

Addresses pomfrida's feedback on PR #4219
- Use box-shadow for focus ring since outline is used for border
- Focus ring has stroke-thin thickness with stroke-thick gap
- Border stays in place on focus, only changes color
@millus
millus force-pushed the feat/4194-text-input-update-code-in-eds-core branch from 4edf983 to 0511874 Compare January 26, 2026 13:34

@eddiman eddiman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, great job!

@millus
millus dismissed vnys’s stale review January 27, 2026 08:59

Addressed vnys's feedback:

  • ✅ Changed from position: relative to isolation: isolate as suggested
  • The -webkit-text-fill-color property is used to override Safari's autofill background styling (added comment explaining this in the code)
  • Placeholder using border/strong, will revisit this when we have token available
@millus
millus merged commit 8dd4dca into main Jan 27, 2026
11 checks passed
@millus
millus deleted the feat/4194-text-input-update-code-in-eds-core branch January 27, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text Input - Update code in eds-core

7 participants