-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: split t2 colors stories and remove t2 stories aggregator (#1719)
- Loading branch information
Showing
8 changed files
with
219 additions
and
315 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
.storybook/components/DesignTokens/Tier2/Borders.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type { StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import { Grid, Section } from '../../../../src'; | ||
import filterTokens from '../../../util/filterTokens'; | ||
import { TokenSpecimen } from '../../TokenSpecimen/TokenSpecimen'; | ||
|
||
export default { | ||
title: 'Design Tokens/Tier 2: Usage', | ||
parameters: { | ||
axe: { | ||
// For documentation purposes only | ||
skip: true, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Borders: StoryObj = { | ||
render: () => ( | ||
<div> | ||
<Section title="Border Width"> | ||
<Grid> | ||
{filterTokens(`eds-theme-border-width`).map(function (listItem) { | ||
return ( | ||
<Grid.Item key={listItem.name}> | ||
<TokenSpecimen | ||
inlineStyles={{ | ||
backgroundColor: 'transparent', | ||
borderWidth: `var(${listItem.name})`, | ||
borderStyle: 'solid', | ||
borderColor: 'black', | ||
}} | ||
name={listItem.name} | ||
value={listItem.value} | ||
/> | ||
</Grid.Item> | ||
); | ||
})} | ||
</Grid> | ||
</Section> | ||
</div> | ||
), | ||
}; |
This file was deleted.
Oops, something went wrong.
100 changes: 100 additions & 0 deletions
100
.storybook/components/DesignTokens/Tier2/Colors.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import type { StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import { Section } from '../../../../src'; | ||
import filterTokens from '../../../util/filterTokens'; | ||
import { ColorList } from '../../ColorList/ColorList'; | ||
|
||
export default { | ||
title: 'Design Tokens/Tier 2: Usage/Colors', | ||
parameters: { | ||
axe: { | ||
// For documentation purposes only | ||
skip: true, | ||
}, | ||
}, | ||
}; | ||
|
||
const getListItems = ({ | ||
filterTerm, | ||
figmaTokenHeader, | ||
tailwindClassHeader, | ||
}: { | ||
filterTerm: string; | ||
figmaTokenHeader: string; | ||
tailwindClassHeader: string; | ||
}) => | ||
filterTokens(filterTerm).map(({ name, value }) => { | ||
const specifier = name.slice( | ||
name.indexOf(filterTerm) + filterTerm.length + 1, | ||
); | ||
return { | ||
name, | ||
value, | ||
figmaToken: figmaTokenHeader + '/' + specifier, | ||
tailwindClass: tailwindClassHeader + '-' + specifier, | ||
}; | ||
}); | ||
|
||
export const Text: StoryObj = { | ||
render: () => ( | ||
<div> | ||
<Section title="Text Colors"> | ||
<ColorList | ||
listItems={getListItems({ | ||
filterTerm: 'eds-theme-color-text', | ||
figmaTokenHeader: 'text', | ||
tailwindClassHeader: 'text', | ||
})} | ||
/> | ||
</Section> | ||
</div> | ||
), | ||
}; | ||
|
||
export const Icon: StoryObj = { | ||
render: () => ( | ||
<div> | ||
<Section title="Icon Colors"> | ||
<ColorList | ||
listItems={getListItems({ | ||
filterTerm: 'eds-theme-color-icon', | ||
figmaTokenHeader: 'icon', | ||
tailwindClassHeader: 'text-icon', | ||
})} | ||
/> | ||
</Section> | ||
</div> | ||
), | ||
}; | ||
|
||
export const Background: StoryObj = { | ||
render: () => ( | ||
<div> | ||
<Section title="Background Colors"> | ||
<ColorList | ||
listItems={getListItems({ | ||
filterTerm: 'eds-theme-color-background', | ||
figmaTokenHeader: 'background', | ||
tailwindClassHeader: 'bg', | ||
})} | ||
/> | ||
</Section> | ||
</div> | ||
), | ||
}; | ||
|
||
export const Border: StoryObj = { | ||
render: () => ( | ||
<div> | ||
<Section title="Border Colors"> | ||
<ColorList | ||
listItems={getListItems({ | ||
filterTerm: 'eds-theme-color-border', | ||
figmaTokenHeader: 'border', | ||
tailwindClassHeader: 'border', | ||
})} | ||
/> | ||
</Section> | ||
</div> | ||
), | ||
}; |
Oops, something went wrong.