Skip to content

Commit

Permalink
TOKEN_MAP code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo committed Apr 24, 2019
1 parent 1ca3d3f commit 9ba2dfc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
32 changes: 7 additions & 25 deletions src/components/token/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
import { FunctionComponent, HTMLAttributes } from 'react';
import { CommonProps } from '../common';
import { IconType } from '../icon';
import { EuiTokenMapDisplayOptions } from './token_map';
export {
EuiTokenMapDisplayOptions,
TokenShape,
TokenColor,
EuiTokenMapType,
} from './token_map';

declare module '@elastic/eui' {
/**
* token type defs
*
* @see './token.js'
*/

export type TokenSize = 's' | 'm' | 'l';

export type TokenColor =
| 'tokenTint01'
| 'tokenTint02'
| 'tokenTint03'
| 'tokenTint04'
| 'tokenTint05'
| 'tokenTint06'
| 'tokenTint07'
| 'tokenTint08'
| 'tokenTint09'
| 'tokenTint10'
| 'tokenTint11'
| 'tokenTint12';

export type TokenShape = 'circle' | 'square' | 'rectangle';

export interface EuiTokenMapDisplayOptions {
color?: TokenColor;
shape?: TokenShape;
fill?: boolean;
hasBorder?: boolean;
}

export interface EuiTokenProps {
iconType: IconType;
size?: TokenSize;
Expand Down
28 changes: 23 additions & 5 deletions src/components/token/token_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,28 @@
// fill: false,
// },

import { EuiTokenMapDisplayOptions } from '@elastic/eui';
export type TokenColor =
| 'tokenTint01'
| 'tokenTint02'
| 'tokenTint03'
| 'tokenTint04'
| 'tokenTint05'
| 'tokenTint06'
| 'tokenTint07'
| 'tokenTint08'
| 'tokenTint09'
| 'tokenTint10'
| 'tokenTint11'
| 'tokenTint12';

export type TokenShape = 'circle' | 'square' | 'rectangle';

export interface EuiTokenMapDisplayOptions {
color?: TokenColor;
shape?: TokenShape;
fill?: boolean;
hasBorder?: boolean;
}

export type EuiTokenMapType =
| 'tokenClass'
Expand Down Expand Up @@ -39,10 +60,7 @@ export type EuiTokenMapType =
| 'tokenNamespace'
| 'tokenModule';

export const TOKEN_MAP: Record<
EuiTokenMapType,
Partial<EuiTokenMapDisplayOptions>
> = {
export const TOKEN_MAP: Record<EuiTokenMapType, EuiTokenMapDisplayOptions> = {
tokenClass: {
shape: 'circle',
color: 'tokenTint01',
Expand Down

0 comments on commit 9ba2dfc

Please sign in to comment.