-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat(styles): add the radio/checkbox card component #1607
Conversation
🦋 Changeset detectedLatest commit: 56dd629 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Preview environment ready: https://preview-1607--swisspost-web-frontend.netlify.app |
8329317
to
82fff41
Compare
packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.docs.mdx
Outdated
Show resolved
Hide resolved
packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.docs.mdx
Outdated
Show resolved
Hide resolved
packages/documentation-v7/src/stories/components/choice-card/checkbox-card.docs.mdx
Outdated
Show resolved
Hide resolved
packages/documentation-v7/src/stories/components/choice-card/checkbox-card.docs.mdx
Outdated
Show resolved
Hide resolved
…adiobutton-card.docs.mdx Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
…adiobutton-card.docs.mdx Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
…heckbox-card.docs.mdx Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
…heckbox-card.docs.mdx Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
This reverts commit 82fff41.
This reverts commit 620c553.
packages/documentation-v7/src/stories/components/choice-card/choice-control.snapshot.stories.ts
Outdated
Show resolved
Hide resolved
border-color 100ms ease-in-out; | ||
|
||
// Checked | ||
&:where(:has(input:checked)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:has is not supported by Firefox at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a fallback with classes until it is.
…hoice-control.snapshot.stories.ts Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
&:where(:has(input:checked)) { | ||
--post-card-select--hover-bg: #{color.$yellow}; | ||
background-color: color.$yellow; | ||
border-color: color.$gray-60; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
border-color: color.$gray-60; | |
border-color: color.$gray-60; | |
input { | |
background-color: color.$white; | |
} |
The radio/checkbox background is not white when check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&:has(input[aria-invalid]), | ||
&:has(input.is-invalid) { | ||
color: color.$error; | ||
border-color: color.$error; | ||
|
||
~ .invalid-feedback { | ||
display: block; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The input and the label should also be red colored in an invalid state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.stories.ts
Show resolved
Hide resolved
packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.stories.ts
Show resolved
Hide resolved
@@ -77,6 +77,7 @@ $font-sizes: ( | |||
); | |||
|
|||
$font-size-map: ( | |||
12: $font-size-12, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be done in another PR together with a changeset?
packages/documentation-v7/src/stories/components/choice-card/checkbox-card.stories.ts
Show resolved
Hide resolved
packages/documentation-v7/src/stories/components/choice-card/checkbox-card.stories.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user checks/unchecks the checkbox in the preview story, the control for toggling the Checked
state is not working anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validation states are only reflected with color. There should be at least a hidden text which tells the user, the field is invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HCM Styles are not well.
Use smaller borders for cards and higlight color for selected cards.
Firefox does not support `:has` as of August 2023, therefore implemented a class based fallback for the choice cards. A web-component would be an option, but due to the criticality of the component, this is a faster solution.
…hoice-control.ts Co-authored-by: Oliver Schürch <oliver.schuerch@post.ch>
…hoice-control.ts Co-authored-by: Oliver Schürch <oliver.schuerch@post.ch>
…adiobutton-card.docs.mdx Co-authored-by: Oliver Schürch <oliver.schuerch@post.ch>
Updated the hover styles, but I would not use the selectedItem color as background, I think it's a bit disruptive to the otherwise very simple HCM. Also, a 10px border is coming from storybook, which has some broken HCM styles anyway. |
…thub.com/swisspost/design-system into 1469-add-the-radio-button-card-component
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Added the radio button and checkbox card component.