Files
react/components/utils/prop-types.ts
Nils J 144eaf332f feat(rating): a new component rating indicator (#543)
* chore(deps): bump lodash from 4.17.20 to 4.17.21 (#537)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* (feature) rating state working and islocked working

* (feature) custom emojis for the ratings added

* refactor(rating): migrate component to scaleable

* feat(rating): use inline icon component

test(rating): update testcase

* docs(rating): add document for zh-cn

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: unix <unix.bio@gmail.com>
2021-08-13 17:11:17 +08:00

80 lines
1.4 KiB
TypeScript

export const tuple = <T extends string[]>(...args: T) => args
export const tupleNumber = <T extends number[]>(...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]