feat: export all types related to components (#562)

* feat: export all types related to components

fix(tooltip): fix the vertical offset of the arrow

* refactor: optimize events of all popup related components

* test: append testcases for popup base component

* test: add testcase for visible events

* test: update snapshots
This commit is contained in:
witt
2021-06-23 23:05:59 +08:00
committed by GitHub
parent d4a1e02430
commit e8a7a17d56
117 changed files with 1062 additions and 586 deletions

View File

@@ -1,3 +1,4 @@
import Progress from './progress'
export type { ProgressProps, ProgressColors, ProgressTypes } from './progress'
export default Progress

View File

@@ -8,6 +8,7 @@ import useScaleable, { withScaleable } from '../use-scaleable'
export type ProgressColors = {
[key: number]: string
}
export type ProgressTypes = NormalTypes
interface Props {
value?: number
@@ -15,14 +16,14 @@ interface Props {
fixedTop?: boolean
fixedBottom?: boolean
colors?: ProgressColors
type?: NormalTypes
type?: ProgressTypes
className?: string
}
const defaultProps = {
value: 0,
max: 100,
type: 'default' as NormalTypes,
type: 'default' as ProgressTypes,
fixedTop: false,
fixedBottom: false,
className: '',
@@ -34,10 +35,10 @@ export type ProgressProps = Props & NativeAttrs
const getCurrentColor = (
ratio: number,
palette: GeistUIThemesPalette,
type: NormalTypes,
type: ProgressTypes,
colors: ProgressColors = {},
): string => {
const defaultColors: { [key in NormalTypes]: string } = {
const defaultColors: { [key in ProgressTypes]: string } = {
default: palette.foreground,
success: palette.success,
secondary: palette.secondary,