Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[component]: Segmented button #3460

Open
5 of 7 tasks
Cian77 opened this issue Aug 26, 2024 · 2 comments · May be fixed by #3879
Open
5 of 7 tasks

[component]: Segmented button #3460

Cian77 opened this issue Aug 26, 2024 · 2 comments · May be fixed by #3879
Assignees
Labels
📦 styles Related to the @swisspost/design-system-styles package

Comments

@Cian77
Copy link

Cian77 commented Aug 26, 2024

Description

Open issues:

Design:

  • Integrated new typography
  • Spacing is defined
  • Documentation final

Design

https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=18-16

Tokens proposal

  • button-segmented-horizontal-border-radius
  • button-segmented-vertical-border-radius
  • button-segmented-active-fg
  • button-segmented-active-bg
  • button-segmented-default-fg
  • button-segmented-default-bg (should be transparent, do we need this at all?)
  • button-segmented-border
  • button-segmented-padding-block
  • button-segmented-padding-inline
  • button-segmented-font-size

Development

Implement this pattern as a radiogroup.

<fieldset class="segmented-button"> 
  <legend>Title ("Change view" or whatever makes sense, this should be hidden)</legend>
  <label>
    View 1
    <input type="radio" />
  </label>
  ...
</fieldset>

Other requirements

  • Use container queries to switch from horizontal to vertical mode
  • You can use the label to style the component and hide the input itself, it's also possible to put the label after the input and connect it through the for attribute. The for attribute is not necessary when the input is wrapped by the label.
  • Hide the legend element from view, but make it accessible to screen readers by using the visually-hidden mechanics

Implementation references

Tasks

💻 Tasks

@Cian77 Cian77 added the 📦 components Related to the @swisspost/design-system-components package label Aug 26, 2024
@Cian77 Cian77 added this to the Design v2 milestone Aug 26, 2024
@gfellerph gfellerph added 📦 styles Related to the @swisspost/design-system-styles package and removed 📦 components Related to the @swisspost/design-system-components package needs: refinement labels Oct 1, 2024
@gfellerph gfellerph modified the milestones: Design v2, Cargo Components Oct 1, 2024
@gfellerph gfellerph moved this from 👀 Triage to 💻 Ready for development in Design System Production Board Oct 4, 2024
@gfellerph gfellerph moved this from 💡 Ready for token spec to 🔮 Ready for tokenisation in Design System Production Board Oct 15, 2024
@gfellerph
Copy link
Member

@Vandapanda created a tokens proposal in the issue description.

@Vandapanda
Copy link
Contributor

Certain tokennames have been modified to comply with the naming conventions. Additional tokens added where necessary.

@alionazherdetska alionazherdetska self-assigned this Oct 21, 2024
@alionazherdetska alionazherdetska linked a pull request Nov 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 styles Related to the @swisspost/design-system-styles package
Projects
Status: 🤬 Dev in review
Development

Successfully merging a pull request may close this issue.

5 participants
@gfellerph @Cian77 @alionazherdetska @Vandapanda and others