Skip to content

Conversation

@hugomslv
Copy link
Contributor

@hugomslv hugomslv commented Oct 8, 2025

📄 Description

clean up card documentation

🚀 Demo

If applicable, please add a screenshot or video to illustrate the changes.


🔮 Design review

  • Design review done
  • No design review needed

📝 Checklist

  • ✅ My code follows the style guidelines of this project
  • 🛠️ I have performed a self-review of my own code
  • 📄 I have made corresponding changes to the documentation
  • ⚠️ My changes generate no new warnings or errors
  • 🧪 I have added tests that prove my fix is effective or that my feature works
  • ✔️ New and existing unit tests pass locally with my changes

@hugomslv hugomslv requested review from a team as code owners October 8, 2025 11:29
@hugomslv hugomslv requested a review from alizedebray October 8, 2025 11:29
@hugomslv hugomslv linked an issue Oct 8, 2025 that may be closed by this pull request
@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest commit: 1e80ddf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@swisspost/design-system-documentation Patch

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

@hugomslv hugomslv changed the title docs(docs) clean up card documentation docs(card): clean up examples and fix layout issues Oct 8, 2025
@swisspost-bot
Copy link
Contributor

swisspost-bot commented Oct 8, 2025

Related Previews

Copy link
Contributor

@alizedebray alizedebray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the PR title? It should be like:
chore({package}): {description}

return html`
${['Link Text', 'More Link'].map(label => html` <a class="card-link" href="#">${label}</a> `)}
<div class="card-links">
${['Link Text', 'More Link'].map(label => html` <a href="#">${label}</a> `)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update this to have only one link in the card to fit what's in Figma?
Also the links must have tertiary button classes (you can check the button documentation to see which one to use).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function getCardButton() {
return html`
<button class="btn btn-primary">
<button class="btn btn-primary ">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match Figma, it would be good to have 3 buttons here: a primary, a secondary and a tertiary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you've added a "Variant" control for the button, what I meant was have the 3 buttons in the card as designed here: https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations---Components-Next-Level?node-id=9908-19099&m=dev
image

decorators: [gridContainer],
render: (args: Args) =>
html`${args.action === 'button' ? renderInteractiveCard(args) : renderNoninteractiveCard(args)}`,
html`${args.action === 'button'
Copy link
Contributor

@alizedebray alizedebray Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a new "interactive" argument to control this independently of the selected action?
Ideally we would have the following controls:

  1. Title (string)
  2. Body (string)
  3. Interactive (boolean)
  4. Action (buttons, links, or none) - only if Interactive is false
  5. Interactive Action (button or link) - only if Interactive is true

Copy link
Contributor

@alizedebray alizedebray Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the "Interactive" control and move it to the "Card Content" section.
The goal of this control is to always have this behavior:

  • The card is interactive (i.e. is is a post-linkarea) if there is one and only one link or button
  • The card is not interactive (i.e. it is a div) if there is no or multiple links or buttons

Therefore depending on whether user select true or false for the "Interactive" control, you should show 0, 1 or multiple links or buttons:

Interactive (Interactive) Action Container Content
true button post-linkarea text + 1 full-width button (primary)
true link post-linkarea text + 1 link (tertiary no padding)
false buttons div text + 3 full-width buttons in a column (primary, secondary, tertiary)
false links div text + 2 links in a row (tertiary no padding)
false none div text only

@hugomslv hugomslv requested a review from alizedebray November 11, 2025 08:07
@sonarqubecloud
Copy link

Copy link
Contributor

@alizedebray alizedebray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check my comments above.
Also the PR title is still incorrect.

@hugomslv hugomslv changed the title docs(card): clean up examples and fix layout issues chore(docs): clean up cards examples and fix layout issues Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update card documentation

4 participants