diff --git a/src/components/token/index.d.ts b/src/components/token/index.d.ts index 74a456e42ec..538e37f5565 100644 --- a/src/components/token/index.d.ts +++ b/src/components/token/index.d.ts @@ -1,6 +1,13 @@ 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' { /** @@ -8,32 +15,7 @@ declare module '@elastic/eui' { * * @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; diff --git a/src/components/token/token_map.ts b/src/components/token/token_map.ts index 36d1bb97b70..e9617f0cf59 100644 --- a/src/components/token/token_map.ts +++ b/src/components/token/token_map.ts @@ -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' @@ -39,10 +60,7 @@ export type EuiTokenMapType = | 'tokenNamespace' | 'tokenModule'; -export const TOKEN_MAP: Record< - EuiTokenMapType, - Partial -> = { +export const TOKEN_MAP: Record = { tokenClass: { shape: 'circle', color: 'tokenTint01',