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

tech(storybook): add addon @storybook/addon-designs #8269

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

EldarMuhamethanov
Copy link
Contributor

  • Release notes

Изменения

  • Добавил аддон @storybook/addon-designs, который позволяет добавить вкладку, в которой будет открываться фигма с дизайном компонента
  • Добавил мапу названия компонентов на урл к дизайну в фигме. Сделал мапу, чтобы все урлы лежали удобно в одном месте
  • Добавил функцию createStoryParameters, которая скрывает детали составления параметров для стори. В данный момент эта функция добавляет ссылку на дизайн из мапы, если у данного компонента есть ссылка на дизайн. В будущем данная функция возможно будет скрывать дополнительную логику
  • Прошелся по компонентам и их стори, и добавил использования функции createStoryParameters, так чтобы в будущем было бы удобнее менять/добавлять ссылки на дизайн к любому компоненту.

Release notes

Документация

  • в storybook был добавлен аддон @storybook/addon-designs, который позволяет открывать страницу с дизайном компонента

@EldarMuhamethanov EldarMuhamethanov added this to the v7.2.0 milestone Feb 13, 2025
@EldarMuhamethanov EldarMuhamethanov self-assigned this Feb 13, 2025
@EldarMuhamethanov EldarMuhamethanov requested a review from a team as a code owner February 13, 2025 13:25
Copy link

codesandbox-ci bot commented Feb 13, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

github-actions bot commented Feb 13, 2025

size-limit report 📦

Path Size
JS 396.93 KB (0%)
JS (gzip) 120.57 KB (0%)
JS (brotli) 99.18 KB (0%)
JS import Div (tree shaking) 1.56 KB (0%)
CSS 348.58 KB (0%)
CSS (gzip) 43.16 KB (0%)
CSS (brotli) 34.47 KB (0%)

Copy link
Contributor

github-actions bot commented Feb 13, 2025

e2e tests

Playwright Report

Copy link
Contributor

github-actions bot commented Feb 13, 2025

👀 Docs deployed

Commit 471c78d

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.54%. Comparing base (95ede57) to head (471c78d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8269   +/-   ##
=======================================
  Coverage   95.54%   95.54%           
=======================================
  Files         404      404           
  Lines       11640    11640           
  Branches     3857     3857           
=======================================
  Hits        11121    11121           
  Misses        519      519           
Flag Coverage Δ
unittests 95.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@andrey-medvedev-vk andrey-medvedev-vk left a comment

Choose a reason for hiding this comment

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

Отличная работа 👏

Comment on lines 12 to 15
parameters.design = {
type: 'figma',
url: designUrl,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Вижу, что сейчас только Common Android дизайн добавляем. А не думал ещё и ссылку на iOS добавить?
Судя по доке это можно: https://storybookjs.github.io/addon-designs/?path=/docs/docs-advanced-usage--docs#embed-multiple-designs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Добавил дизайн для IOS для компонентов, у которых есть дизайн в фигме

@@ -0,0 +1,149 @@
export const COMPONENTS_TO_FIGMA_DESIGN_URL: Record<string, string> = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Вот бы тут как-нибудь в типах актуальный список компонентов поддерживать, чтобы при добавлении нового компонента не забывать про его дизайн, чтобы линтер ругался, а если у компонента нету дизайна (подкомпонент), то явно это указать и отфильтровывать, получив уже актуальный список компонентов с дизайном для аддона.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Думал как это сделать адекватно, но не придумал(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

2 participants