Skip to content

feat(OK-3293): CDS Input components  Dropdown + Text#678

Open
luiz-camargo-cb wants to merge 12 commits into
coinbase:masterfrom
luiz-camargo-cb:master
Open

feat(OK-3293): CDS Input components  Dropdown + Text#678
luiz-camargo-cb wants to merge 12 commits into
coinbase:masterfrom
luiz-camargo-cb:master

Conversation

@luiz-camargo-cb
Copy link
Copy Markdown

@luiz-camargo-cb luiz-camargo-cb commented May 13, 2026

What changed? Why?

This PR aligns TextInput, Select, and Alpha Select focus/border behavior with the latest design expectations
across mobile/web.
Main changes:

  • TextInput (mobile + web):
    • focused border treatment for muted/foreground variants now uses the intended high-contrast active border
    • readOnly and disabled states no longer enter focused visual styling (no thick/active focus border)
  • Select + Alpha Select (mobile):
    • focused variant logic was adjusted to avoid inconsistent focus-color behavior
    • disabled-state handling now uses the expected non-interactive border treatment for muted variants
  • Alpha Select (web):
    • added runtime value-shape guards for single vs multi usage and tests

UI changes

Web Android. iOS
Gravacao.de.Tela.2026-05-13.as.13.33.32.mp4
Gravacao.de.Tela.2026-05-13.as.13.38.05.mp4
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-05-13.at.13.37.35.mp4

Testing

How has it been tested?

  • Unit tests
  • Interaction tests
  • Pseudo State tests
  • Manual - Web
  • Manual - Android (Emulator / Device)
  • Manual - iOS (Emulator / Device)

Testing instructions

  1. Open TextInput stories/screens on mobile and web.
  2. Validate focused/typing state:
    • default muted variants show dark/black active border (not blue)
  3. Validate readOnly and disabled:
    • no focused/thick border state appears
  4. Open mobile Select + Alpha Select stories/screens:
    • active/open state border is dark/black, not primary blue
  5. Run:
    • NX_DAEMON=false yarn nx run mobile:test --testPathPattern=packages/mobile/src/controls/__tests__/TextInput.test.tsx
    • NX_DAEMON=false yarn nx run mobile:test --testPathPattern=packages/mobile/src/controls/__tests__/Select.test.tsx
    • NX_DAEMON=false yarn nx run-many --target=typecheck --projects=mobile,web
    • yarn nx format:write

Illustrations/Icons Checklist

Required if this PR changes files under packages/illustrations/** or packages/icons/**

  • verified visreg changes with Terran (include link to visreg run/approval)
  • all illustration/icons names have been reviewed by Dom and/or Terran

Change management

type=routine
risk=low
impact=sev5
automerge=false

luiz-camargo-cb and others added 5 commits May 12, 2026 19:46
Unifies the input and dropdown design updates into a single signed commit so the history is easier to audit and verify.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add runtime guards for Alpha Select value shape based on selection mode so invalid single/multi value combinations fail fast with clear errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent readonly and disabled TextInput from entering focused visual state so borders do not thicken or change color when interaction is blocked.

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

cb-heimdall commented May 13, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1
CODEOWNERS 🟡 See below

🟡 CODEOWNERS

Code Owner Status Calculation
ui-systems-eng-team 🟡 0/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

@luiz-camargo-cb luiz-camargo-cb marked this pull request as ready for review May 13, 2026 16:41
luiz-camargo-cb and others added 6 commits May 13, 2026 14:30
Unifies the input and dropdown design updates into a single signed commit so the history is easier to audit and verify.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add runtime guards for Alpha Select value shape based on selection mode so invalid single/multi value combinations fail fast with clear errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent readonly and disabled TextInput from entering focused visual state so borders do not thicken or change color when interaction is blocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
secondary: 'fg',
};

const defaultTextInputBorderRadius: InputStackBaseProps['borderRadius'] = 400;
Copy link
Copy Markdown
Contributor

@hcopp hcopp May 14, 2026

Choose a reason for hiding this comment

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

@luiz-camargo-cb we would need design to reflect borderRadius of 400 before we ship this in code https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/%E2%9C%A8-CDS-Components?node-id=49527-136174&m=dev

If this was for your team you could use our theming to accomplish it for your team's purposes - playground example. This might not be possible for all your current style changes, we could look to expose additional props as needed.

const readOnlyInputBackground = useMemo(() => {
if (!disabled && nativeInputRestProps.readOnly) {
return 'bgSecondary';
return 'bgSecondaryWash';
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.

This also would need to be a decision that design is in agreement for.

...nativeInputRestProps
} = mergedProps;
const isReadOnly = !!nativeInputRestProps.readOnly;
const disableFocusedStyle = disabled || isReadOnly;
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.

When I go to Mozilla and try out

<label for="name">Name (4 to 8 characters):</label>

<input
  type="text"
  id="regular"
  name="regular"
  value="regular"
  required
  minlength="4"
  maxlength="8"
  size="10"  />
<input
  type="text"
  id="readonly"
  name="readonly"
  value="readonly"
  required
  minlength="4"
  maxlength="8"
  size="10"
  readonly />
<input
  type="text"
  id="disabled"
  name="disabled"
  value="disabled"
  required
  minlength="4"
  maxlength="8"
  size="10"
  disabled />

I am still able to focus on the read only input, not the disabled. It seems to me like we match this behavior - [see example playground](https://cds.coinbase.com/getting-started/playground?code=PTAEGECcFMEMBdqgJ4HsCulSoO4DtRoAPWAWwAcAbJAY1QtT2j3gGdRY8ATUAC1VQBrVgBpQ8Xs1A1YlSqBjdokABQBKcagXMuy8ZNIAoQ3Tyt4oAKIkK1UAF5Q6hwD5QAb0Oht8TARVe3qAAPABqAMrwsDSCoADmsOT27gAsAL4ugUEhACrE8ACSeOTo8FnZoJSwAEbQlPYARABK0HHoVZAN5dkAbrLo0I0wbR1dFaDAmePBeUSFxaXdQVW19c1wPADyeJTIY%2BOgfZQDQxvYO3tL3jCwXNu7S5NLM-lFJWUHlTV1jQAiAJasGrULj7cZHE4NLiA4HQUFXUDQoHVEGPKZBYLACJRGLotQAbkMaUJhhAoAAmhhQKR0OZpLJ5IpdKoNPAtEy9GhMNJULpDBzVMFrGQqEhJgSgA but let me know if you are able to focus on disabled).

const toggleSelectTrayOff = useCallback(() => toggleSelectTray(false), [toggleSelectTray]);
const toggleSelectTrayOn = useCallback(() => toggleSelectTray(true), [toggleSelectTray]);
const focusedVariant = useInputVariant(!!isSelectTrayOpen, variant);
const defaultFocusedVariant = useInputVariant(!!isSelectTrayOpen, variant);
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.

This component is deprecated. Is it possible to migrate to use the alpha Select instead.

const selectTriggerMinHeight = 56;
const selectTriggerCompactMinHeight = 40;
const selectTriggerInsideLabelMinHeight = 62;
const selectTriggerBorderRadius = 400;
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.

can we make sure its possible to set borderRadius via props?

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.

not just here specifically, but across the board on any of the components that needed to be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants