Skip to content

feat(shared): fields v2 — align fields with Toggle + Button system#6118

Open
tsahimatsliah wants to merge 6 commits into
mainfrom
feat/fields-v2-redesign
Open

feat(shared): fields v2 — align fields with Toggle + Button system#6118
tsahimatsliah wants to merge 6 commits into
mainfrom
feat/fields-v2-redesign

Conversation

@tsahimatsliah
Copy link
Copy Markdown
Member

@tsahimatsliah tsahimatsliah commented May 31, 2026

Summary

Brings the fields in line with the redesigned Toggle and the Button system, so fields, buttons and toggles read as one family.

  • New look & states. Replaces the legacy left-edge accent bar with a crisp, even ring for focus / invalid / readonly / password-strength, plus smooth surface transitions that match the toggle's motion. Reskins the shared BaseField primitive in place, so TextField (input), PasswordField, Textarea and SearchField all update across the product automatically. Dropdown is button-based and already follows the button language.
  • Shared size scale. New fieldSizes.ts exposes a FieldSize enum that mirrors ButtonSize exactly — identical heights, radii, value typography and icon sizes. A field and a button of the same size line up pixel-for-pixel in a shared strip, and a "medium" icon is the same glyph size whether it lives in a field or a button.
  • Opt-in, non-breaking. A new fieldSize prop threads through TextField/BaseFieldContainer (icons auto-size to match). When omitted, the legacy fieldType-driven dimensions are preserved, so existing call sites are unchanged.
  • Comparison page. New Storybook story Components/Fields/Field renders the previous vs new fields side-by-side (states, field types, password/search) against a frozen legacy snapshot, plus a dedicated field-vs-button size-alignment section.

Notes

  • size was already taken by the native input attribute, so the new prop is named fieldSize.
  • Touched files are strict-typecheck clean (scripts/typecheck-strict-changed.js) and shared lints clean.

Test plan

  • Storybook → Components/Fields/Field → review Comparison in light & dark; hover / focus / type each field.
  • Confirm the size-alignment rows show field height/radius/icon matching the adjacent button.
  • Spot-check real forms (auth, profile edit, search) for input/password/search visual regressions.
  • pnpm --filter shared test for TextField / PasswordField / SearchField (15 passing).

Made with Cursor

Preview domain

https://feat-fields-v2-redesign.preview.app.daily.dev

Reskin the shared field primitives to the new design language shared with
the redesigned Toggle and the Button system:

- Swap the legacy left-edge accent bar for a crisp, even ring on focus /
  invalid / readonly / password-strength, with smooth surface transitions
  (matching the toggle's motion). Applied to BaseField so input, password,
  textarea and search all update across the product.
- Add a button-aligned FieldSize scale (fieldSizes.ts) that mirrors
  ButtonSize exactly — same heights, radii, value typography and icon sizes.
  A field and a button of the same `size` now line up pixel-for-pixel when
  they sit together in one strip, including matching "medium" icon sizes.
- Thread an opt-in `fieldSize` prop through TextField / BaseFieldContainer
  (icons are auto-sized to match); legacy `fieldType` sizing is preserved
  when `fieldSize` is omitted, so existing call sites are unchanged.
- Add a Storybook before/after comparison page (Field.stories.tsx) with a
  frozen legacy snapshot, covering states, field types, password/search and
  a field-vs-button size-alignment section.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview May 31, 2026 2:23pm
storybook Error Error May 31, 2026 2:23pm

Request Review

…own polish

- Add a faint resting border to every field (BaseField) so fields are
  delineated from the page, matching the Subtle/Button v2 language.
- Introduce FieldVariant (Filled / Outline) on TextField + Textarea:
  Filled sits on the floated surface, Outline is transparent and defined
  by its border with a faint hover fill.
- Restore the password strength left-edge indicator + colour-graded
  gradient on the new field (per design preference).
- Polish the dropdown popover: rounded-14 card, inset items, taller rows
  and smooth highlight transition.
- Expand the comparison story with Variants and Dropdown & textarea
  sections (wrapped in a QueryClientProvider for the dropdown).

Co-authored-by: Cursor <cursoragent@cursor.com>
- Invalid fields now use a red 1px border (same mechanism as the focus
  border) instead of an inset ring, and stay red while focused — matching
  the design and reading as one family with focus/read-only borders.
- Fix declarative validity: an externally-controlled `valid` prop is now
  authoritative on first render, so a field rendered already-invalid shows
  its error state immediately instead of waiting for interaction.
- Restore the disabled dim on fields (BaseFieldContainer + SearchField).
- Storybook: add comprehensive per-field state coverage — TextField
  states, field types, variants, sizes; PasswordField strength ladder;
  SearchField states/sizes/variants; Textarea states; Dropdown states/sizes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Consolidate the field redesign into one "Fields — before & after" page so
the team can play with old vs new side by side:

- Add a "What changed" summary and before/after rows for text input states,
  field types, password & search, textarea and dropdown (trigger + popover).
- Add a LegacyTextarea snapshot of the previous multi-line look for the
  textarea comparison.
- Keep the new-only sections (background variants, size alignment with
  buttons) on the same page.
- Fix stale "even ring" copy now that focus uses a 1px border.

Co-authored-by: Cursor <cursoragent@cursor.com>
On light theme especially, the faint grey fill plus low-contrast tertiary
content made an idle field look almost identical to its dimmed disabled
state. Brighten and define the resting state in both themes:

- Default (empty, editable) icon, value text and placeholder now use
  text-secondary instead of tertiary, so the field reads as active and
  clearly differs from the opacity-dimmed disabled state.
- Resting border steps up from border-subtlest-tertiary to
  border-subtlest-secondary so every field is delineated as a real input
  box rather than a flat grey block.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align the internals of every field with the button system and clean up the
ad-hoc spacing/colors:

- Icons now scale with the field height (one rung below the button glyph scale
  so they stay balanced inside an input) and auto-size even without an explicit
  fieldSize.
- Icon-to-value spacing uses the button gap scale (fieldSizeToGap) instead of a
  flat 8px margin, applied as a row gap so every adornment is evenly spaced.
- Char counter drops back to a muted text-quaternary (was darkened as a side
  effect of the placeholder colour change) since it's metadata, not a value.
- Dropdown trigger text now uses text-secondary; the chevron gets an explicit
  size, a muted text-quaternary rest colour that brightens to primary on hover,
  and the no-op group-hover override is removed.
- SearchField adopts the same icon size / gap scale and the defined secondary
  resting border.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant