-
Notifications
You must be signed in to change notification settings - Fork 185
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
base: master
Are you sure you want to change the base?
tech(storybook): add addon @storybook/addon-designs #8269
Conversation
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. |
size-limit report 📦
|
e2e tests |
👀 Docs deployed
Commit 471c78d |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отличная работа 👏
parameters.design = { | ||
type: 'figma', | ||
url: designUrl, | ||
}; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот бы тут как-нибудь в типах актуальный список компонентов поддерживать, чтобы при добавлении нового компонента не забывать про его дизайн, чтобы линтер ругался, а если у компонента нету дизайна (подкомпонент), то явно это указать и отфильтровывать, получив уже актуальный список компонентов с дизайном для аддона.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Думал как это сделать адекватно, но не придумал(
Изменения
@storybook/addon-designs
, который позволяет добавить вкладку, в которой будет открываться фигма с дизайном компонентаcreateStoryParameters
, которая скрывает детали составления параметров для стори. В данный момент эта функция добавляет ссылку на дизайн из мапы, если у данного компонента есть ссылка на дизайн. В будущем данная функция возможно будет скрывать дополнительную логикуcreateStoryParameters
, так чтобы в будущем было бы удобнее менять/добавлять ссылки на дизайн к любому компоненту.Release notes
Документация
@storybook/addon-designs
, который позволяет открывать страницу с дизайном компонента