Open jessicashanshanhuang opened 4 months ago
A story captures the rendered state of a UI component, there are example components that has a set of stories that show the states it supports (Button, Header, Page).
i can create stories (states) but can i create my own component outside of the example ones?
seems like AE is currently using components from Chakra UI and then editing the stories in storybook
looks like i am able to create template components: how to write stories, subcomponents and templates
template component: it means you can more easily reuse the args to each story in a composite component. It also means that you can alter the args to the component with the Controls addon
so it looks like the composite component is what i want to manipulate
There are two basic levels of organization in Storybook: the component and its child stories. Think of each story as a permutation of a component. You can have as many stories per component as you need.
storybook + figma, how it works
The design addon for Storybook allows you to embed Figma files alongside your code-based components in Storybook. Meanwhile, the Storybook plugin for Figma allows you to embed stories alongside your design components in Figma.
we are using Storybook 7.6.20
for reference: workday's storybook design system, canvas
was able to get the figma file to embed through design panel on a test button in storybook
so looks like i am now able to embed figma files into storybook so when a user uses storybook to build a ui component, they can have a live design there.
the next step is to see if i can get the figspec compatibility to work which would allow someone to view the design token specs for the figma design within storybook
got figspec to work, however unable to push changes to my branch since it does use my figma personal access token and github blocked the push (can bypass if i choose to unblock the secret)
newest commit has figspec implementation. to use, edit the .env file to include your personal figma token before running dev
next steps:
questions:
- will storybook version be upgraded anytime soon for streetscape?
Syncing design tokens between figma + storybook
Display design token documentation generated from your stylesheets and icon files. Preview design token changes in the browser. Add your design tokens to your Storybook Docs pages using the custom Doc Blocks.
update: looking more into this, might not be the direct solution i want since it seems there's no direct link from figma to storybook relating design tokens
to get npm install
to work, I had to drop "@storybook/blocks": "^7.4.1",
from package.json
will storybook version be upgraded anytime soon for streetscape?
seems worth trying in ur branch!
related to the .env
, here are two examples of how AE handles that:
you should probably change it to sample.env
and add .env
to the file .gitignore
to get
npm install
to work, I had to drop"@storybook/blocks": "^7.4.1",
frompackage.json
will storybook version be upgraded anytime soon for streetscape?
seems worth trying in ur branch!
sounds good! i think for figma designs plug in i didn't really run into that issue but i am currently running to issues with the design token plug ins so i'll see it that fixes that!
Design Token Automation
- involves github sync with figma which requires a github personal access token
- need to look into more to see how to implement the pipeline
@jessicashanshanhuang happy to help with that!
if other significant parts of Storybook + Figma compatibility are working though, might be nice to document/finalize those and break out token automation into it's own issue?
but if tokens are already an integral part of the DS in figma, could totally see why token automation should be an expectation of Storybook + Figma compatibility!
The storybook designs plug-in is implemented in the testing-figma-plugin
branch, we are currently running the plug-in for storybook v7. The plug-in is capable of the following:
Next Steps: I will write a markdown on how to install and use the storybook designs plug in, potentially it will live in the design repo for now.
Next, we will explore the design token automation pipeline to sync simultaneously update design tokens between figma and storybook. Discussion related to this will be in a new git issue.
updated markdown is in designs-plugin
branch of our design
repo! i will merge it to main soon after some small tweaks with formatting 🫡
updated md is now in main
of our design repo!
ae-streetscape
[!NOTE] the following changes will be on a new branch,
designs-plugin
inae-streetscape
to-do:
design
reporunning to an error trying to commit changes, most likely error is coming from npx lint-staged
?
figma chakra ui kit is now linked with storybook components!
published in latest commit in designs-plugin
notes:
next steps: creating a shared personal access token
update: shared figma access token on Design vault in 1Password, updated designs plug-in doc
@damonmcc will we need to rebase since designs-plugin
branch in ae-streetscape
are only two commits?
PR initiated, waiting on review!
update: looks like there's some dependency issues, will debug
update 2: looks like we have some peer dependency issues, damon and i plan to create two prs: one to upgrade storybook to latest v7 and another to include the design plug with our upgraded version
design
updated to reflect changesUpdate: Storybook upgrade pr in review
Update: Storybook v7 Pr merged, last step is to finish up draft pr for designs plug-in
Figuring out how to incorporate Storybook + Figma plug-in
Currently: prepping pull request to merge design plugin changes to
main
streetscape repo
my current branch