-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
480 additions
and
85 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
"@primer/primitives": patch | ||
--- | ||
|
||
Add alpha data-vis colors |
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,66 @@ | ||
import React from 'react' | ||
// eslint-disable-next-line import/extensions | ||
import colorTokens from '../../../../../tokens-next-private/docs/functional/themes/light.json' | ||
import {ColorTokenSwatch} from '../../StorybookComponents/ColorTokenSwatch/ColorTokenSwatch' | ||
import {DataTable, Table} from '@primer/react/drafts' | ||
import {InlineCode} from '../../StorybookComponents/InlineCode/InlineCode' | ||
import {getTokensByName} from '../../utilities/getTokensByName' | ||
|
||
export default { | ||
title: 'Color/DataVis', | ||
tags: ['excludeSnapshot'], | ||
parameters: { | ||
parameters: { | ||
controls: {hideNoControlsWarning: true}, | ||
options: { | ||
showPanel: false, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
export const HighchartsAccentColors = () => { | ||
const data = getTokensByName(colorTokens, 'data').map(token => { | ||
return { | ||
id: token.name, | ||
...token, | ||
} | ||
}) | ||
return ( | ||
<Table.Container> | ||
<Table.Title as="h1" id="pattern"> | ||
Data visualization | ||
</Table.Title> | ||
<DataTable | ||
aria-labelledby="pattern" | ||
data={data} | ||
columns={[ | ||
{ | ||
header: 'Sample', | ||
field: 'name', | ||
rowHeader: true, | ||
renderCell: row => { | ||
return <ColorTokenSwatch bgColor={row.name} /> | ||
}, | ||
}, | ||
{ | ||
header: 'Token', | ||
field: 'name', | ||
rowHeader: true, | ||
renderCell: row => { | ||
return <InlineCode value={row.name} copyClipboard /> | ||
}, | ||
}, | ||
{ | ||
header: 'Output value', | ||
field: 'value', | ||
rowHeader: true, | ||
renderCell: row => { | ||
return <p>{row.value}</p> | ||
}, | ||
}, | ||
]} | ||
/> | ||
</Table.Container> | ||
) | ||
} |
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
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
Oops, something went wrong.