mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-24 04:15:54 +08:00
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:
@@ -1,3 +1,4 @@
|
||||
import Progress from './progress'
|
||||
|
||||
export type { ProgressProps, ProgressColors, ProgressTypes } from './progress'
|
||||
export default Progress
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user