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

Specify available components output #2710

Closed
Tracked by #2674
oliverschuerch opened this issue Feb 21, 2024 · 3 comments
Closed
Tracked by #2674

Specify available components output #2710

oliverschuerch opened this issue Feb 21, 2024 · 3 comments
Assignees
Labels
📦 documentation Related to the @swisspost/design-system-documentation package on hold Wait for something to be done, before continue working on this Issue

Comments

@oliverschuerch
Copy link
Contributor

oliverschuerch commented Feb 21, 2024

To have a better overview, which component is available in which forms (for example as CSS-only component, as web-component, ...), we should add the tags property to all of our components in its story file meta object.

// accordion.stories.ts
const meta: Meta = {
  id: '4d1b4185-e04d-494a-ab38-2b56c1778b0b',
  title: 'Components/Accordion',
  parameters: {
    tags: ['WC', 'NG'],
  }
  ...
};

My suggestion is to add them like so:

  • CSS for CSS-only components
  • WC for web-components
  • NG for angular-components
  • etc.

After that, we are able to use the renderLabel method in manager.tsx to add some flags/svg behind a components name:

// manager.tsx
addons.setConfig({
  ...
  sidebar: {
    collapsedRoots: [],
    renderLabel: item => {
      // implement our custom logic here
      return <div>item.name</div>;
    }
  }
});
@oliverschuerch oliverschuerch self-assigned this Feb 21, 2024
@oliverschuerch oliverschuerch moved this from 📋 Backlog to 🔖 Ready in Design System Production Board Feb 21, 2024
@oliverschuerch oliverschuerch moved this from 🔖 Ready to 🏗 In progress in Design System Production Board Feb 21, 2024
@gfellerph gfellerph added 📦 documentation Related to the @swisspost/design-system-documentation package and removed storybook labels Feb 21, 2024
@oliverschuerch
Copy link
Contributor Author

oliverschuerch commented Feb 21, 2024

There is an issue with the item parameter provided by the method renderLabel: storybookjs/storybook#25998

As long as this is not solved, we're not able to use the tags parameter as we like.

@oliverschuerch oliverschuerch added the on hold Wait for something to be done, before continue working on this Issue label Feb 22, 2024
@oliverschuerch oliverschuerch moved this from 🏗 In progress to 🔖 Ready in Design System Production Board Feb 22, 2024
@gfellerph gfellerph moved this from 🔖 Ready to 📋 Backlog in Design System Production Board Feb 28, 2024
@oliverschuerch
Copy link
Contributor Author

oliverschuerch commented Mar 15, 2024

I've opened a feature request to make this possible: storybookjs/storybook#26518

@oliverschuerch
Copy link
Contributor Author

Wont do because it's not possible by storybook.

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Design System Production Board Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 documentation Related to the @swisspost/design-system-documentation package on hold Wait for something to be done, before continue working on this Issue
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants