-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define graph trace color tokens (#2194)
# Pull Request ## π€¨ Rationale Addresses #787 ## π©βπ» Implementation Added 8 color tokens for graph traces, e.g. `graphTrace1Color`. Per the design, we cannot provide graph trace tokens that work generally for monochromatic applications. If the use case only requires a single trace, then it seems correct for that trace (`graphTrace1Color`) to be white for the color theme. If there are more traces, then based on what Rick wrote in his design, the client presumably has to override the token values based on the background color. So defaulting all the traces to white seems reasonable. ## π§ͺ Testing Token story ## β Checklist - [x] I have updated the project documentation to reflect my changes or determined no changes are needed. --------- Co-authored-by: Milan Raj <[email protected]>
- Loading branch information
Showing
7 changed files
with
178 additions
and
40 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@ni-nimble-components-612b4007-c1f6-4b64-92c7-3fb0494c1002.json
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,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Define graph trace color tokens", | ||
"packageName": "@ni/nimble-components", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Canvas, Meta, Controls, Title } from '@storybook/blocks'; | ||
import * as graphStories from './graph.stories'; | ||
import * as tokenStories from '../theme-provider/tokens.stories'; | ||
|
||
<Meta of={graphStories} /> | ||
<Title of={graphStories} /> | ||
|
||
The Nimble Design System does not provide a graph component, but theme-aware | ||
tokens are available for styling custom or third-party graph components to match | ||
the Nimble Design System. | ||
|
||
<Canvas of={tokenStories.graphTokens} /> | ||
<Controls of={tokenStories.graphTokens} /> | ||
|
||
## Usage | ||
|
||
For monochromatic UIs using the Color theme, it is recommended to override the | ||
default values of the graph trace tokens with colors that work with the specific | ||
background color. Special care should be taken to ensure the colors pass | ||
accessibility standards. Consult with a visual designer for help. | ||
|
||
{/* ## Examples */} | ||
|
||
{/* ## Accessibility */} | ||
|
||
{/* ## Resources */} |
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,13 @@ | ||
import { html } from '@microsoft/fast-element'; | ||
import type { Meta, StoryObj } from '@storybook/html'; | ||
import { createUserSelectedThemeStory } from '../../utilities/storybook'; | ||
import { hiddenWrapper } from '../../utilities/hidden'; | ||
|
||
const metadata: Meta = { | ||
title: 'Components/Graph', | ||
render: createUserSelectedThemeStory(hiddenWrapper(html`<style></style>`)) | ||
}; | ||
|
||
export default metadata; | ||
|
||
export const graph: StoryObj = {}; |
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