-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/upgrade storybook #37
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ export const parameters = { | |
}, | ||
}, | ||
}; | ||
export const tags = ['autodocs']; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,8 @@ | |
"test": "vitest run --reporter=verbose --reporter=junit --coverage", | ||
"test:watch": "vitest", | ||
"design-tokens:generate": "node ./tokens/style-dictionary.cjs", | ||
"icons:generate": "node src/components/icon/generate-icon-types.js" | ||
"icons:generate": "node src/components/icon/generate-icon-types.js", | ||
"chromatic": "VITE_IS_CHROMATIC=true chromatic" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. turns out I forgot to add this script in the last PR that actually makes sure, chromatic has the proper ENV var passed during build |
||
}, | ||
"dependencies": { | ||
"@floating-ui/dom": "1.6.3", | ||
|
@@ -48,14 +49,15 @@ | |
"@easepick/range-plugin": "1.2.1", | ||
"@lit-labs/virtualizer": "2.0.12", | ||
"@open-wc/testing-helpers": "3.0.0", | ||
"@storybook/addon-actions": "7.6.17", | ||
"@storybook/addon-essentials": "7.6.17", | ||
"@storybook/addon-links": "7.6.17", | ||
"@storybook/addons": "7.6.17", | ||
"@storybook/blocks": "7.6.17", | ||
"@storybook/theming": "7.6.17", | ||
"@storybook/web-components": "7.6.17", | ||
"@storybook/web-components-vite": "7.6.17", | ||
"@storybook/addon-actions": "8.1.6", | ||
"@storybook/addon-essentials": "8.1.6", | ||
"@storybook/addon-links": "8.1.6", | ||
"@storybook/blocks": "8.1.6", | ||
"@storybook/manager-api": "8.1.6", | ||
"@storybook/preview-api": "8.1.6", | ||
"@storybook/theming": "8.1.6", | ||
"@storybook/web-components": "8.1.6", | ||
"@storybook/web-components-vite": "8.1.6", | ||
"@testing-library/dom": "9.3.4", | ||
"@testing-library/jest-dom": "6.4.2", | ||
"@testing-library/user-event": "14.5.2", | ||
|
@@ -64,6 +66,7 @@ | |
"@web-types/lit": "2.0.0-3", | ||
"babel-loader": "9.1.3", | ||
"cem-plugin-expanded-types": "1.2.0", | ||
"chromatic": "11.5.3", | ||
"custom-element-jet-brains-integration": "1.4.4", | ||
"date-fns": "2.30.0", | ||
"element-internals-polyfill": "1.3.10", | ||
|
@@ -76,10 +79,8 @@ | |
"globby": "14.0.1", | ||
"jsdom": "24.0.0", | ||
"pascal-case": "4.0.0", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"shadow-dom-testing-library": "1.11.2", | ||
"storybook": "7.6.17", | ||
"storybook": "8.1.6", | ||
"style-dictionary": "3.9.2", | ||
"ts-lit-plugin": "2.0.2", | ||
"typescript": "5.3.3", | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import {Meta} from '@storybook/blocks'; | ||
|
||
<Meta title="Intro"/> | ||
<Meta title="Intro" /> | ||
|
||
# Design System Starter | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import React from 'react'; | ||
import {Canvas, ColorItem, ColorPalette, Meta} from '@storybook/blocks'; | ||
import {ColorItem, ColorPalette, Meta} from '@storybook/blocks'; | ||
import tokens from './design-tokens.json'; | ||
import {groupColors} from "./color.helper"; | ||
import {groupColors} from './color.helper'; | ||
|
||
<Meta title="Design Tokens"/> | ||
|
||
|
@@ -50,16 +49,31 @@ properties. | |
|
||
## Typography | ||
|
||
<Canvas> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<div> | ||
<small>Small</small> | ||
<p>Text</p> | ||
<h4>h4. Title</h4> | ||
<h3>h3. Title</h3> | ||
<h2>h2. Title</h2> | ||
<h1>h1. Title</h1> | ||
</div> | ||
</Canvas> | ||
**Typeface:** {tokens.typography.main.fontFamily.value} | ||
|
||
<div style={{ display: 'grid', gridTemplateColumns: 'max-content auto', gap: tokens.size['2'].value, alignItems: 'center' }}> | ||
{Object.entries(tokens.typography) | ||
.map(([name, token]) => ( | ||
<div style={{ display: 'contents' }}> | ||
<small>{name}</small> | ||
<div | ||
style={{ | ||
fontFamily: token.fontFamily.value, | ||
fontSize: token.fontSize.value, | ||
lineHeight: token.lineHeight.value, | ||
fontWeight: token.fontWeight.value, | ||
fontStretch: token.fontStretch.value, | ||
letterSpacing: token.letterSpacing.value, | ||
textDecorationStyle: token.textDecoration.value, | ||
paragraphIndent: token.paragraphIndent.value, | ||
}} | ||
> | ||
The quick brown fox jumps over the lazy dog | ||
</div> | ||
</div> | ||
)) | ||
} | ||
</div> | ||
|
||
## Sizes | ||
|
||
|
@@ -84,7 +98,7 @@ properties. | |
return numberA - numberB; | ||
}) | ||
.map(([, token], index) => ( | ||
<React.Fragment key={index}> | ||
<div key={index} style={{display: 'contents'}}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. React has been removed as a peer dependency of Storbook, so since we only use it here, we can remove it and use the |
||
<div | ||
style={{ | ||
width: token.value, | ||
|
@@ -94,7 +108,7 @@ properties. | |
/> | ||
<span>{token.value}</span> | ||
<strong>{token.name}</strong> | ||
</React.Fragment> | ||
</div> | ||
))} | ||
</div> | ||
|
||
|
@@ -109,7 +123,7 @@ properties. | |
}} | ||
> | ||
{Object.entries(tokens.effect).map(([name, token], index) => ( | ||
<React.Fragment key={index}> | ||
<div key={index} style={{display: 'contents'}}> | ||
<div | ||
style={{ | ||
boxShadow: token.value, | ||
|
@@ -120,7 +134,7 @@ properties. | |
}} | ||
/> | ||
<strong>{token.name}</strong> | ||
</React.Fragment> | ||
</div> | ||
))} | ||
</div> | ||
|
||
|
@@ -135,7 +149,7 @@ properties. | |
}} | ||
> | ||
{Object.entries(tokens.radius).map(([, token], index) => ( | ||
<React.Fragment key={index}> | ||
<div key={index} style={{display: 'contents'}}> | ||
<div | ||
style={{ | ||
border: `var(--size-0-25) solid var(--color-brand-brand-100)`, | ||
|
@@ -146,6 +160,6 @@ properties. | |
/> | ||
<span>{token.value}</span> | ||
<strong>{token.name}</strong> | ||
</React.Fragment> | ||
</div> | ||
))} | ||
</div> |
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.
That was an automatic Storybook migration.