import { useMemo } from 'react' import { ProgressBarV2Appearance } from './progressBarV2.types' import { LinearProgressBarV2Props } from './progressBarV2.types' import { getProgressBarValueState } from './utils' import Block from '../Primitives/Block/Block' import Text from '../Text/Text' export const LinearProgressBarV2 = ({ value, size, appearance, tokens, showLabel, ariaLabel, ariaLabelledby, min, max, }: LinearProgressBarV2Props) => { const { rangeMin, rangeMax, clampedValue, percentage } = useMemo( () => getProgressBarValueState(value, min, max), [value, min, max] ) const containerHeight = tokens.linear.height[size] const fillBackgroundColor = tokens.linear.fill.backgroundColor[appearance] const fillBorderRadius = tokens.linear.fill.borderRadius[appearance] const emptyBackgroundColor = tokens.linear.empty.backgroundColor[appearance] const containerBorderRadius = tokens.linear.borderRadius[appearance] return (