/** * Tailwind CSS implementation of Progress component * Uses Seeds progress CSS classes from progress.css */ import * as React from "react"; import * as RadixProgress from "@radix-ui/react-progress"; import type { TypeProgressProps } from "./ProgressTypes"; // Utility for merging class names properly function cn( ...inputs: (string | undefined | null | false | Record)[] ): string { const classes: string[] = []; for (const input of inputs) { if (!input) continue; if (typeof input === "string") { classes.push(input); } else if (typeof input === "object") { for (const [key, value] of Object.entries(input)) { if (value) { classes.push(key); } } } } return classes.join(" "); } export const ProgressTailwind = ({ value, max = 100, getValueLabel, trackStyle, indicatorStyle, className, ...rest }: TypeProgressProps) => { const percentage = max > 0 ? Math.min((value / max) * 100, 100) : 0; return ( div`) continue to resolve. seeds-progress carries the styling. className={cn("Progress", "seeds-progress", className)} data-qa-progress="" style={trackStyle} {...(rest as any)} > ); }; ProgressTailwind.displayName = "ProgressTailwind";