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

story(flip-card): initial implementation (previously Facts-Card) #2669

Closed
kyubisation opened this issue May 17, 2024 · 0 comments · Fixed by #2946
Closed

story(flip-card): initial implementation (previously Facts-Card) #2669

kyubisation opened this issue May 17, 2024 · 0 comments · Fixed by #2946
Assignees
Labels
complexity: M Can be done in a few days proposal: accepted

Comments

@kyubisation
Copy link
Contributor

kyubisation commented May 17, 2024

We want to provide a flip-card component.
It's purpose is to provide a hint and on interaction, more information.

Figma: https://www.figma.com/design/9r6xSfNmEfCFxl1yFYedrj/Lyne-Components?m=auto&node-id=38417%3A401196&t=wS3QP8WeLivUViQy-1
Aria Pattern: Unclear. Possibilities are https://www.w3.org/WAI/ARIA/apg/patterns/carousel/ or https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/

Design Spec:

  • The flip card is per default in its light (summary) state
    • The summary state can have content and an image
  • On interaction, the flip-card switches to its dark (detail) state
    • The details state can have any kind of content
  • In both states the button to switch state in the bottom left corner, for which other content should flow around (possibly achieved via float, if not possible, reserve space horizontally)
  • The flip card should have the same size in default and flipped state, i.e. no change in size is allowed.
    The flip card should grow with the content (with a minimum height). Summary and details view can have different sizes and should grow/shrink when switching states. This can happen independently of other instances.
    • The size has a default (minimum) height and width, but can be changed by consumers directly with css height/width properties on <sbb-flip-card>.
  • The image can be right aligned or bottom aligned.
  • The text should not flow into the button (the button should reserve space horizontally)
  • The text should NOT have a scrollbar
  • Should have animation on switch: https://www.figma.com/proto/9r6xSfNmEfCFxl1yFYedrj/Lyne-Components?page-id=38417%3A397349&node-id=38428-4253&viewport=97%2C1717%2C0.46&t=Y0XboWmoDOxOsfuo-1&scaling=min-zoom

Tech Spec:

  • Click on card should toggle the state (compare with card/card-button implementation)

<sbb-flip-card>

  • Should have a method toggle() which toggles the state
  • Should have a getter for summary (the instance of <sbb-flip-card-summary>) and details (the instance of <sbb-flip-card-details>)

<sbb-flip-card-summary>

  • Should have an unnamed slot and an image slot
  • Should have a property imageAlignment: 'after' | 'below' = 'after' to align the image either after the title or below.

<sbb-flip-card-details>

  • Should have an unnamed slot
<sbb-flip-card>
  <sbb-flip-card-summary>
    <sbb-title level="4">Title</sbb-title>
    <sbb-image slot="image" ...></sbb-title>
  </sbb-flip-card-summary>
  <sbb-flip-card-details>
    <sbb-title level="4">Title</sbb-title>
    <p>
      Long explanation....
      <sbb-link href="..." negative>Link to something</sbb-link>
    </p>
  </sbb-flip-card-details>
</sbb-flip-card>
@kyubisation kyubisation converted this from a draft issue May 17, 2024
@kyubisation kyubisation moved this from sbb.ch Priority to Next in ESTA Web Lyne Design System May 17, 2024
@kyubisation kyubisation changed the title Flip-Card (aka Facts-Card) story(flip-card): initial implementation (previously Facts-Card) May 17, 2024
@dauriamarco dauriamarco self-assigned this May 27, 2024
@kyubisation kyubisation added proposal: accepted complexity: M Can be done in a few days and removed proposal: open labels May 27, 2024
@dauriamarco dauriamarco moved this from Next to In progress in ESTA Web Lyne Design System Jun 13, 2024
@MarioCastigliano MarioCastigliano self-assigned this Jul 18, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in ESTA Web Lyne Design System Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: M Can be done in a few days proposal: accepted
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants