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]: Avatar #3210

Closed
1 task done
Tracked by #2885
gfellerph opened this issue Jul 2, 2024 · 3 comments · Fixed by #3352
Closed
1 task done
Tracked by #2885

[component]: Avatar #3210

gfellerph opened this issue Jul 2, 2024 · 3 comments · Fixed by #3352
Assignees
Labels
📦 components Related to the @swisspost/design-system-components package

Comments

@gfellerph
Copy link
Member

gfellerph commented Jul 2, 2024

Create a profile picture component.

Props

  • email (optional): if provided, show the gravatar profile picture (grab post profile picture if it's a post account, check if images are available from outside of the post net, potential security issue)
  • firstname (optional): if provided without email, show the first two letters,
  • lastname (optional): if provided without email but with firstname, show initials, if provided as only option, show first two letters

Default slot

Accessible name of the component in a hidden span or alt text for the image when email is provided.

Notes

  • Provide a fallback user image (icon 2125) if no props are passed

Tokens

  • Tokens for this component are ready

DEVs proposal

The Avatar Group will be another component and is therefore not part of this definition.

Token set name: Components/Avatar

  • post-avatar-size
  • post-avatar-bg
  • post-avatar-fg
  • post-avatar-border-width
  • post-avatar-border-color
  • post-avatar-border-radius
  • post-avatar-font-size
  • post-avatar-hover-bg
  • post-avatar-hover-bg-img-overlay
  • post-avatar-focus-outline-width (not used, avatar has no focus state, instead use anchor (link) focus styles in Figma)
  • post-avatar-focus-outline-color (not used, avatar has no focus state, instead use anchor (link) focus styles in Figma)
  • post-avatar-focus-outline-offset (not used, avatar has no focus state, instead use anchor (link) focus styles in Figma)
@gfellerph gfellerph added 📦 components Related to the @swisspost/design-system-components package needs: design This issue needs a design in figma before it can be implemented. labels Jul 2, 2024
@gfellerph gfellerph added this to the Post Header Basics milestone Jul 2, 2024
@github-project-automation github-project-automation bot moved this to 🗃️ Ready for work in Design System Production Board Jul 2, 2024
@gfellerph gfellerph moved this from 🗃️ Ready for work to 👀 Triage in Design System Production Board Jul 3, 2024
@gfellerph gfellerph removed the needs: design This issue needs a design in figma before it can be implemented. label Jul 24, 2024
@oliverschuerch oliverschuerch self-assigned this Jul 24, 2024
@oliverschuerch oliverschuerch moved this from 👀 Triage to 🕹️ Coding in progress in Design System Production Board Jul 25, 2024
@gfellerph gfellerph changed the title Component: profile picture [component]: profile picture Oct 3, 2024
@gfellerph gfellerph changed the title [component]: profile picture [component]: Avatar Oct 8, 2024
@gfellerph gfellerph mentioned this issue Oct 10, 2024
1 task
@Vandapanda
Copy link
Contributor

Tokens added

@Vandapanda Vandapanda removed their assignment Oct 14, 2024
@oliverschuerch
Copy link
Contributor

@Vandapanda The token post-avatar-image-hover-opacty is not working as expected, because the resolved value looks like this: rgba(#fcfcfc, 0.5)

This is not working because the rgba() css function expects a rgb value like so rgba(252, 252, 252, 0.5).
Are you able to fix this?

@Vandapanda
Copy link
Contributor

@oliverschuerch I should be able to fix this when not connecting to the real value for sandgrey 100 and sandgrey 000. This means if we ever switch something in those values we will have to update the alpha values by hand but that shouldnt be a problem I think

@github-project-automation github-project-automation bot moved this from 🤬 Dev in review to 🚀 Done in Design System Production Board Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 components Related to the @swisspost/design-system-components package
Projects
Status: 🚀 Done
3 participants