mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-12 22:29:35 +08:00
* feat(scaleable): add scaleable props to each component * chore(scaleable): update the exported type * feat: apply scaleable to components chore: remove with-default test: improve testcase for scaleable chore: resolve test warning ci: upgrade nodejs to latest lts docs: fix type error in document site * docs: update documents to be compatible with scaleable chore: fix build errors * chore: remove all size-related attributes docs: improve guide document * docs: add scaleable documentation test: update snapshots chore: remove unused * feat: add scaleable to grid components * docs: improve docs * test: update snapshots * fix(grid): fix basic component props
78 lines
1.4 KiB
TypeScript
78 lines
1.4 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 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', 'silent', '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 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]
|