import React , { memo , forwardRef } from 'react' ; import { Box , IBoxProps } from '../../primitives' ; import { usePropsResolution } from '../../../hooks/useThemeProps' ; import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps' ; import type { ResponsiveValue } from '../../../components/types' ; import type { ISizes } from '../../../theme/base/sizes' ; export interface IProgressProps extends IBoxProps < IProgressProps > { default value ? : number ; default size ? : ResponsiveValue < ISizes | ( string & { } ) | number > ; default colorScheme ? : string ; /**
     * Pseudo prop to give Prop to filled track
     */ _filledTrack ? : IBoxProps < IProgressProps > ; default min ? : number ; default max ? : number ; } const Progress = ( props , ref ? ) => { const { min , max , value , _filledTrack , children , ... resolvedProps } = usePropsResolution ( 'Progress' , props ) ; if ( useHasResponsiveProps ( props ) ) { return null ; } return ( < Box { ... resolvedProps } ref = { ref } accessible accessibilityRole = "progressbar" accessibilityValue = { { min : min , max : max , now : value < max && value > min ? ( ( value - min ) / ( max - min ) ) * 100 : value > min ? 100 : 0 , } } > < Box { ... _filledTrack } w = { value < max && value > min ? ( ( value - min ) / ( max - min ) ) * 100 + '%' : value > min ? '100%' : '0%' } > { children } < /Box> < /Box>); } ; export default memo ( forwardRef ( Progress ) ) ;