diff --git a/aries-site/src/data/structures/tokens.js b/aries-site/src/data/structures/tokens.js index 4fac5cb9f..68bde1aba 100644 --- a/aries-site/src/data/structures/tokens.js +++ b/aries-site/src/data/structures/tokens.js @@ -1,6 +1,7 @@ /* eslint-disable max-len */ import { Figma, Code, Book, Table } from 'grommet-icons'; import { Box, Text } from 'grommet'; +import { ButtonStates } from '../../examples'; export const tokens = [ { @@ -38,6 +39,24 @@ export const tokens = [ ], tags: [], }, + { + name: 'Component states', + type: 'Getting started', + description: + 'The state of a component communicates feedback based on user interaction, system status, or both.', + preview: { + component: () => , + }, + seoDescription: + 'The state of a component communicates feedback based on user interaction, system status, or both.', + sections: [], + relatedContent: [ + 'All design tokens', + 'Using design tokens in code', + 'Using design tokens in Figma', + ], + tags: [], + }, { name: 'Element', type: 'Getting started', diff --git a/aries-site/src/examples/tokens/ComponentStates.js b/aries-site/src/examples/tokens/ComponentStates.js new file mode 100644 index 000000000..5b9fad64e --- /dev/null +++ b/aries-site/src/examples/tokens/ComponentStates.js @@ -0,0 +1,48 @@ +import React from 'react'; +import styled from 'styled-components'; +import { global, components } from 'hpe-design-tokens'; +import { Box, Button, FormField, TextInput } from 'grommet'; + +const HoverButton = styled(Button)` + background: ${components.hpe.button.primary.hover.background}; +`; + +const FocusButton = styled(Button)` + outline-color: ${props => + props.theme.global.colors[ + props.theme.global.colors[global.hpe.focusIndicator.outline.color] + ]}; + outline-width: ${global.hpe.focusIndicator.outline.width}; + outline-style: ${global.hpe.focusIndicator.outline.style}; + outline-offset: ${global.hpe.focusIndicator.outlineOffset}; +`; + +// eslint-disable-next-line react/prop-types +export const ButtonStates = ({ size, tabIndex }) => ( + +