Skip to content

[FEATURE] UI Customization. Textfield Component - #354

Open
zhuje wants to merge 3 commits into
ui-customizationfrom
zhuje/ou1569-ui-customization-textfield
Open

zhuje wants to merge 3 commits into
ui-customizationfrom
zhuje/ou1569-ui-customization-textfield

Conversation

@zhuje

@zhuje zhuje commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a TextField primitive to components/src/next/primitives, continuing the UI customization series see perses/perses#3570 for background.

Built on Base UI's Field (Root/Label/Control/Description), styled entirely through design tokens under @layer perses.components, with size/status driven by data-size/data-status attributes.

API (everything else flows through native InputHTMLAttributes spread — value, onChange, placeholder, disabled, readOnly, required, etc.):

  • label / helperText — form label (wired via htmlFor) and description slots
  • status — error | warning | success | info, from the new shared Status type
  • size — xs | sm | md | lg, from the new shared Size type
  • fullWidth
  • width — responsive: accepts a plain CSS width or a per-breakpoint object ({ default, xs, sm, md, lg, xl })
  • multiline + rows — renders a <textarea> via Field.Control's render prop
  • startAdornment / endAdornment — generic ReactNode slots

The prop surface was derived from auditing all MUI TextField call sites across perses/shared and perses/perses (87× fullWidth, 72× error, 28× helperText, 17× multiline, 14× size, plus adornments via InputProps) — only props with real usage are implemented. MUI's select, variant, and margin are intentionally omitted (select will be its own primitive; the others are superseded by design tokens).

Responsiveness: reuses the shared responsive system introduced in #299 (primitives/system/responsive.ts + responsive.css). The two system files are included here byte-identical to #299, so whichever PR merges first, the other merges cleanly with no conflict. Plain width values render as inline style; responsive objects emit --ps-responsive-width-<breakpoint> CSS variables consumed by the shared ps-responsive-width class — same pattern as Box.

Also included:

Screenshots

Screenshot 2026-10-06 at 4 35 32 PM

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • E2E tests are stable and unlikely to be flaky.
    See e2e docs for more details. Common issues include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

@zhuje
zhuje requested a review from a team as a code owner October 6, 2026 20:38
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 7e7a3c5.

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
@zhuje
zhuje force-pushed the zhuje/ou1569-ui-customization-textfield branch from ca8ce96 to 04e6bea Compare October 13, 2026 22:47
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
@zhuje
zhuje force-pushed the zhuje/ou1569-ui-customization-textfield branch from 04e6bea to 4df8573 Compare October 13, 2026 22:56
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.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