Files
react/components/utils/prop-types.ts
witt 80956b0cc8 chore: release v2.1.0-canary.3 (#450)
* docs: add link to GH discussions

* chore: upgrade deps

* chore: update code style for prettier

* chore: release v2.1.0-canary.3

* chore(deps): upgrade babel

* chore: replace enzyme adapter with community repo to fit react.17

* test: updatee snapshots for auto typesetting

* test(config): ignore unexported parts of the tools
2021-02-14 15:27:37 +08:00

82 lines
1.5 KiB
TypeScript

export const tuple = <T extends string[]>(...args: T) => args
const buttonTypes = tuple(
'default',
'secondary',
'success',
'warning',
'error',
'abort',
'secondary-light',
'success-light',
'warning-light',
'error-light',
)
const normalSizes = tuple('mini', 'small', 'medium', 'large')
const normalTypes = tuple('default', 'secondary', 'success', 'warning', 'error')
const snippetTypes = tuple(
'default',
'secondary',
'success',
'warning',
'error',
'dark',
'lite',
)
const cardTypes = tuple(
'default',
'secondary',
'success',
'warning',
'error',
'dark',
'lite',
'alert',
'purple',
'violet',
'cyan',
)
const copyTypes = tuple('default', 'slient', 'prevent')
const triggerTypes = tuple('hover', 'click')
const placement = tuple(
'top',
'topStart',
'topEnd',
'left',
'leftStart',
'leftEnd',
'bottom',
'bottomStart',
'bottomEnd',
'right',
'rightStart',
'rightEnd',
)
const dividerAlign = tuple('start', 'center', 'end', 'left', 'right')
export type ButtonTypes = typeof buttonTypes[number]
export type NormalSizes = typeof normalSizes[number]
export type NormalTypes = typeof normalTypes[number]
export type SnippetTypes = typeof snippetTypes[number]
export type CardTypes = typeof cardTypes[number]
export type CopyTypes = typeof copyTypes[number]
export type TriggerTypes = typeof triggerTypes[number]
export type Placement = typeof placement[number]
export type DividerAlign = typeof dividerAlign[number]