Page MenuHomePhabricator

Binary inputs: Use the Label component internally
Closed, ResolvedPublic2 Estimated Story Points

Description

Binary input components (Checkbox, Radio, and ToggleSwitch) have a <label> element that could be swapped out for the Label component so that:

  • All binary input components can now have a semantic description in addition to a label
  • The ToggleSwitch component can have a hideLabel prop which would cause the label to be visually hidden (this does not apply to Checkbox and Radio since there are no supported use cases for hidden labels)

We should aim to implement this while still allowing for a simple <label> element within the CSS-only examples that do not take advantage of the description or hideLabel feature.


Acceptance criteria

  • Label is implemented in the 3 binary input components
  • Description slot is added to the 3 binary input components
  • hideLabel prop is added to ToggleSwitch, which is passed to the Label component
  • Docs for Vue and CSS-only implementations are updated to demonstrate these new features

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
CCiufo-WMF renamed this task from Checkbox, Radio, ToggleSwitch: Consider using the Label component internally to Checkbox, Radio, ToggleSwitch: Use the Label component internally.Jun 22 2023, 5:11 PM
CCiufo-WMF updated the task description. (Show Details)
CCiufo-WMF set the point value for this task to 2.
CCiufo-WMF moved this task from Backlog to Up Next on the Design-System-Team board.
CCiufo-WMF renamed this task from Checkbox, Radio, ToggleSwitch: Use the Label component internally to Binary Inputs: Use the Label component internally.Jun 22 2023, 7:43 PM
CCiufo-WMF renamed this task from Binary Inputs: Use the Label component internally to Binary inputs: Use the Label component internally.
CCiufo-WMF updated the task description. (Show Details)
CCiufo-WMF triaged this task as Medium priority.Jun 26 2023, 2:31 PM

Change 940257 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] Checkbox, Radio, ToggleSwitch: Use Label internally

https://gerrit.wikimedia.org/r/940257

Change 940257 merged by jenkins-bot:

[design/codex@main] Checkbox, Radio, ToggleSwitch: Use Label internally

https://gerrit.wikimedia.org/r/940257

Change 944353 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update Codex from v0.15.0 to v0.16.1

https://gerrit.wikimedia.org/r/944353

Change 944353 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v0.15.0 to v0.16.1

https://gerrit.wikimedia.org/r/944353