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]: Validation #3630

Open
4 of 6 tasks
schaertim opened this issue Oct 3, 2024 · 7 comments · May be fixed by #3824
Open
4 of 6 tasks

[component]: Validation #3630

schaertim opened this issue Oct 3, 2024 · 7 comments · May be fixed by #3824
Assignees
Labels
needs: 💬 pattern discussion This issue will be discussed in the next Pattern Discussion meeting. 📦 styles Related to the @swisspost/design-system-styles package

Comments

@schaertim
Copy link
Contributor

schaertim commented Oct 3, 2024

It was decided that validation should be implemented separately and reused in all components requiring it. A dedicated token set has to be provided first.

Design

https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=577-14513&t=uKEtTo9BEaPpKSV5-1

Requirements

  • Variants: Error or success message, with or without icon (exclamation- or checkmark, see radiobutton list design)
  • Is linked to the input field via aria-describedby (by the user)
  • Can be re-used by all components that need validation

Tasks

@schaertim schaertim added the 📦 styles Related to the @swisspost/design-system-styles package label Oct 3, 2024
@schaertim schaertim added this to the Cargo Components milestone Oct 3, 2024
@gfellerph gfellerph changed the title Updated version of validation component [component]: Validation Oct 3, 2024
@gfellerph
Copy link
Member

@gfellerph add more information

@gfellerph gfellerph added needs: discussion There is at least one topic in the pattern descussion meeting about the issue needs: 🏓 dev roundtable To be discussed at the roundtable of esteemed developers and removed needs: refinement labels Oct 8, 2024
@alizedebray
Copy link
Contributor

  • How should we handle the two different error message variants ?
  • How do we know which variant applies to which component ?

@gfellerph
Copy link
Member

gfellerph commented Oct 10, 2024

Tokens:
post-validation-valid-fg
post-validation-invalid-fg

Variant 1:
<p class="validation invalid icon">Error</p>

Variant 2:
[type="checkbox"] ~ .validation { // Show icon }

Resolution:

  • Variant to be used is inferred by type of component used (variant 2)

@gfellerph gfellerph removed needs: discussion There is at least one topic in the pattern descussion meeting about the issue needs: 🏓 dev roundtable To be discussed at the roundtable of esteemed developers labels Oct 10, 2024
@myrta2302 myrta2302 self-assigned this Oct 24, 2024
@myrta2302 myrta2302 linked a pull request Oct 25, 2024 that will close this issue
@myrta2302
Copy link
Contributor

Tokens

post.validation.error #B200000
post.validation.success #107800
post.validation.font-size 14px
post.validation.text.padding.block.text 6px
post.validation.text.padding.inline.text 2px
post.validation.list.gap.inline 8/6/4px
post.validation.list.padding.block.text 1px
post.validation.list.icon.size 24/22/20px
post.validation.list.icon.padding 0/1/2px

@Vandapanda Vandapanda added the needs: 💬 pattern discussion This issue will be discussed in the next Pattern Discussion meeting. label Oct 30, 2024
@Vandapanda
Copy link
Contributor

Added this one to the pattern discussion as its connected to the other issue I got

@myrta2302
Copy link
Contributor

myrta2302 commented Nov 1, 2024

  • Will the rest of the input types be designed
  • Success and Error colors on Dark theme?

@oliverschuerch
Copy link
Contributor

Let's concentrate on the components needed for PPNL:

  • Text input
  • Select
  • Textarea
  • Checkbox
  • Radio Button
  • Card Control (if it does not take to much time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: 💬 pattern discussion This issue will be discussed in the next Pattern Discussion meeting. 📦 styles Related to the @swisspost/design-system-styles package
Projects
Status: 🕹️ Coding in progress
Development

Successfully merging a pull request may close this issue.

6 participants