Skip to content

Commit

Permalink
add stories
Browse files Browse the repository at this point in the history
  • Loading branch information
langermank committed Feb 28, 2025
1 parent 4266174 commit 3d1d910
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion docs/storybook/stories/Color/Patterns/AllPatterns.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ export const Treeview = () => {
return (
<Table.Container>
<h1 className="sr-only" id="treeViewItem">
Tooltip
Treeview
</h1>
<DataTable
aria-labelledby="treeViewItem"
Expand Down Expand Up @@ -831,3 +831,56 @@ export const Treeview = () => {
</Table.Container>
)
}

export const ContributionGraphic = () => {
const data = getTokensByName(colorTokens, 'contribution').map(token => {
return {
id: token.name,
...token,
}
})
return (
<Table.Container>
<h1 className="sr-only" id="contribution">
Contribution graph
</h1>
<DataTable
aria-labelledby="contribution"
data={data}
columns={[
{
header: 'Sample',
field: 'name',
rowHeader: true,
renderCell: row => {
return (
<ColorTokenSwatch
bgColor={row.name.includes('bgColor') || row.name.includes('iconColor') ? row.name : undefined}
textColor={row.name.includes('fgColor') ? row.name : undefined}
shadowColor={row.name.includes('shadow') ? row.name : undefined}
borderColor={row.name.includes('borderColor') ? row.name : undefined}
/>
)
},
},
{
header: 'Token',
field: 'name',
rowHeader: true,
renderCell: row => {
return <InlineCode value={row.name} copyClipboard cssVar />
},
},
{
header: 'Output value',
field: 'value',
rowHeader: true,
renderCell: row => {
return <p>{row.value}</p>
},
},
]}
/>
</Table.Container>
)
}

0 comments on commit 3d1d910

Please sign in to comment.