/** * Hybrid Progress Component * Automatically chooses between Tailwind and styled-components based on props. * Consumers passing styled-system props (e.g. `mb`, `width`, `bg`) get the * styled-components implementation; everyone else gets the Tailwind path. */ import * as React from "react"; import { StyledRoot, StyledIndicator } from "./styles"; import { ProgressTailwind } from "./ProgressTailwind"; import { hasStyledProps } from "@sproutsocial/seeds-react-system-props"; import type { TypeProgressProps } from "./ProgressTypes"; export const Progress = (props: TypeProgressProps) => { const { value, max = 100, getValueLabel, trackStyle, indicatorStyle, ...rest } = props; if (hasStyledProps(rest)) { const percentage = max > 0 ? Math.min((value / max) * 100, 100) : 0; return ( ); } // Use Tailwind version (preferred - better performance) return ; };