Files
react/components/select/styles.ts
witt d4a1e02430 feat(scaleable): add scaleable props to each component (#531)
* 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
2021-06-23 10:53:30 +08:00

53 lines
1.3 KiB
TypeScript

import { NormalTypes } from '../utils/prop-types'
import { GeistUIThemesPalette } from '../themes/presets'
export type SelectColor = {
border: string
borderHover: string
iconBorder: string
placeholderColor: string
}
export const getColors = (
palette: GeistUIThemesPalette,
status?: NormalTypes,
): SelectColor => {
const colors: { [key in NormalTypes]: SelectColor } = {
default: {
border: palette.border,
borderHover: palette.foreground,
iconBorder: palette.accents_5,
placeholderColor: palette.accents_3,
},
secondary: {
border: palette.border,
borderHover: palette.foreground,
iconBorder: palette.accents_5,
placeholderColor: palette.accents_3,
},
success: {
border: palette.success,
borderHover: palette.successDark,
iconBorder: palette.success,
placeholderColor: palette.accents_3,
},
warning: {
border: palette.warning,
borderHover: palette.warningDark,
iconBorder: palette.warning,
placeholderColor: palette.accents_3,
},
error: {
border: palette.error,
borderHover: palette.errorDark,
iconBorder: palette.error,
placeholderColor: palette.error,
},
}
if (!status) return colors.default
return colors[status]
}