feat(ui): support Switch state content#90
Conversation
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f71c6db35e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <span | ||
| aria-hidden="true" | ||
| className={cn( | ||
| 'pointer-events-none absolute inset-y-0 flex max-w-[calc(100%-1.75rem)] items-center overflow-hidden truncate text-[10px] font-medium leading-none text-white', |
There was a problem hiding this comment.
Let switch content size the track
When callers pass text such as checkedChildren="Yearly" / unCheckedChildren="Monthly", this absolutely positioned content is capped to calc(100%-1.75rem) and cannot contribute to the button's intrinsic width; the button only gets min-w-14, leaving roughly 26px for the label and clipping most state text by default. Please keep the state content in layout or otherwise size the track from the content so the new visual labels are actually readable.
Useful? React with 👍 / 👎.
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
Summary
checkedChildrenandunCheckedChildrenprops for Switch state content parityaria-hiddenso the switch accessible name stays stableValidation
CI / qualitypassed for headf71c6db35e528ffc552ddd68d324d0d6eac57dd2in run28893400648.npm run lint:ui,npm run typecheck:ui,npm run test:ui,npm run build:ui,npm run build:docs.Failed to create unified exec process: No such file or directory.Notes
codebase-memory-mcpgraph tools were not exposed in this session, so this run used repository files through GitHub as the AGENTS.md fallback.checkedChildren/unCheckedChildren; Element Plus exposes active/inactive text; WAI-ARIA switch guidance requires a stable accessible label andaria-checkedstate.