Skip to content

Commit

Permalink
[TECH] Ajouter un addon storybook pour afficher des tags informatifs
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Feb 28, 2025
2 parents aa7f8e7 + b2261c4 commit 19c6aca
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 3 deletions.
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const config = {
'@storybook/addon-essentials',
'@storybook/addon-a11y',
'@storybook/addon-webpack5-compiler-babel',
'storybook-addon-tag-badges',
],

stories: ['../docs/**/*.@(mdx|stories.@(mdx))', '../app/*/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
Expand Down
2 changes: 2 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { addons } from '@storybook/manager-api';
import { renderLabel } from 'storybook-addon-tag-badges';

import storybookCustomTheme from './storybook-custom-theme';

addons.setConfig({
theme: storybookCustomTheme,
sidebar: {
showRoots: true,
renderLabel,
},
});
1 change: 1 addition & 0 deletions app/stories/pix-table.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { hbs } from 'ember-cli-htmlbars';

export default {
title: 'Data display/Table',
tags: ['new'],
// select attribute data type from https://storybook.js.org/docs/react/essentials/controls
argTypes: {
data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { hbs } from 'ember-cli-htmlbars';

export default {
title: '<%= classifiedModuleName %>',
tags: ['new'], // You can find preconfigured tags list here https://github.com/Sidnioulz/storybook-addon-tag-badges#preconfigured-badges
// TODO: add component attributes information
// select attribute data type from https://storybook.js.org/docs/react/essentials/controls
argTypes: {
Expand Down
2 changes: 2 additions & 0 deletions docs/create-component.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ import { hbs } from 'ember-cli-htmlbars'; // import nécessaire pour 'canvasCont

export default {
title: 'Docs/Notification Alert',
// On peut ajouter un tag qui affichera un badge donnant une information sur le statut du composant (ex: 'new', 'deprecated', ...)
tags: ['new'],
// Ici on définit et on documente les arguments du composant
argTypes: {
type: {
Expand Down
25 changes: 22 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"qunit-dom": "^3.4.0",
"sass": "^1.83.1",
"storybook": "^8.4.7",
"storybook-addon-tag-badges": "^1.4.0",
"stylelint": "^16.13.2",
"svg-sprite": "^2.0.4",
"svgo": "^3.3.2",
Expand Down

0 comments on commit 19c6aca

Please sign in to comment.