Skip to content

Commit 6d2ef81

Browse files
authored
Merge pull request #103 from wrap-org/docs/etch-token-tables
docs: use etch token tables
2 parents 9a026f5 + fbd73a3 commit 6d2ef81

15 files changed

Lines changed: 52 additions & 238 deletions

File tree

.storybook/preview.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Preview } from '@storybook/react'
22
import { DocPage } from './DocPage';
3+
import tokens from '@wrap.ngo/tokens/dist/index.css?raw'
34

45
// Load the actual web components
56
import '../src/components/composition/App/App';
@@ -53,6 +54,23 @@ const preview: Preview = {
5354
backgrounds: {
5455
disable: true,
5556
},
57+
designTokenTables: {
58+
tokens: [
59+
tokens,
60+
],
61+
collections: {
62+
'evg-color': 'color',
63+
'evg-radius': 'radius',
64+
'evg-spacing': 'spacing',
65+
'evg-shadow': 'shadow',
66+
'evg-font-family': 'font-family',
67+
'evg-font-line-height': 'line-height',
68+
'evg-font-size': 'font-size',
69+
'evg-font-weight': 'font-weight',
70+
'evg-theme': 'color',
71+
'evg-sentiment': 'color',
72+
},
73+
},
5674
viewport: {
5775
viewports: {
5876
aaMinimum: {

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@commitlint/cli": "^19.8.0",
3838
"@commitlint/config-conventional": "^19.4.1",
3939
"@etchteam/eslint-config": "^2.2.32",
40+
"@etchteam/storybook-addon-design-token-tables": "1.1.0",
4041
"@etchteam/stylelint-config": "^1.7.2",
4142
"@rollup/plugin-babel": "^6.0.4",
4243
"@rollup/plugin-commonjs": "^28.0.3",

src/docs/foundations/tokens/Button.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Meta } from '@storybook/blocks';
2-
import Tokens from './blocks/Tokens/Tokens';
2+
import { Tokens } from '@etchteam/storybook-addon-design-token-tables';
33

44
<Meta title="Foundations/Tokens/Button" />
55

@@ -11,4 +11,4 @@ Dedicated token collections that standardise button styling across the system. B
1111
define values for sizes, background and border colours for different states (default, hover,
1212
active, disabled) to ensure consistent interactive elements throughout the interface.
1313

14-
<Tokens collection="button" />
14+
<Tokens collection="evg-button" />

src/docs/foundations/tokens/Colors.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Meta } from '@storybook/blocks';
2-
import Tokens from './blocks/Tokens/Tokens';
2+
import { Tokens } from '@etchteam/storybook-addon-design-token-tables';
33

44
<Meta title="Foundations/Tokens/Colors" />
55

@@ -13,5 +13,5 @@ We've organised them into primary, secondary, neutral, and semantic palettes wit
1313
tints and shades. Each colour is defined as a token that can be referenced consistently across
1414
the entire system.
1515

16-
<Tokens collection="color" />
16+
<Tokens collection="evg-color" />
1717

src/docs/foundations/tokens/Elevation.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Meta } from '@storybook/blocks';
2-
import Tokens from './blocks/Tokens/Tokens';
2+
import { Tokens } from '@etchteam/storybook-addon-design-token-tables';
33

44
<Meta title="Foundations/Tokens/Elevation" />
55

@@ -11,4 +11,4 @@ Shadow system creates depth and hierarchy through perceived elevation from the s
1111
These tokens define box-shadow properties with increasing intensity to establish hierarchy
1212
and focus through perceived distance from the background.
1313

14-
<Tokens collection="shadow" />
14+
<Tokens collection="evg-shadow" />

src/docs/foundations/tokens/Font.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Meta } from '@storybook/blocks';
2-
import Tokens from './blocks/Tokens/Tokens';
2+
import { Tokens } from '@etchteam/storybook-addon-design-token-tables';
33

44
<Meta title="Foundations/Tokens/Font" />
55

@@ -13,12 +13,12 @@ styles and maintaining typographic rhythm throughout the interface.
1313

1414
## Family
1515

16-
<Tokens collection="font-family" />
16+
<Tokens collection="evg-font-family" />
1717

1818
## Size
1919

20-
<Tokens collection="font-size" />
20+
<Tokens collection="evg-font-size" />
2121

2222
## Weight
2323

24-
<Tokens collection="font-weight" />
24+
<Tokens collection="evg-font-weight" />

src/docs/foundations/tokens/Input.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Meta } from '@storybook/blocks';
2-
import Tokens from './blocks/Tokens/Tokens';
2+
import { Tokens } from '@etchteam/storybook-addon-design-token-tables';
33

44
<Meta title="Foundations/Tokens/Input" />
55

@@ -10,4 +10,4 @@ import Tokens from './blocks/Tokens/Tokens';
1010
Input tokens define consistent styling for inputs, selects, textareas, and other
1111
form controls, to ensure that all form interactions are consistent.
1212

13-
<Tokens collection="input" />
13+
<Tokens collection="evg-input" />

src/docs/foundations/tokens/Radius.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Meta } from '@storybook/blocks';
2-
import Tokens from './blocks/Tokens/Tokens';
2+
import { Tokens } from '@etchteam/storybook-addon-design-token-tables';
33

44
<Meta title="Foundations/Tokens/Radius" />
55

@@ -12,4 +12,4 @@ The radius scale provides consistent corner treatments from sharp (0px) to fully
1212
helping to establish the overall aesthetic of the interface and create visual harmony
1313
between components.
1414

15-
<Tokens collection="radius" />
15+
<Tokens collection="evg-radius" />

src/docs/foundations/tokens/Sentiment.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Meta, ColorPalette, ColorItem } from '@storybook/blocks';
2-
import Tokens from './blocks/Tokens/Tokens';
2+
import { Tokens } from '@etchteam/storybook-addon-design-token-tables';
33

44
<Meta title="Foundations/Tokens/Sentiment" />
55

@@ -12,4 +12,4 @@ These colour tokens are designed with appropriate accessible contrast variations
1212
backgrounds, and borders. This streamlined approach creates clear visual signalling for
1313
users across all interface elements.
1414

15-
<Tokens collection="sentiment" />
15+
<Tokens collection="evg-sentiment" />

0 commit comments

Comments
 (0)