29 lines
941 B
TypeScript
29 lines
941 B
TypeScript
import * as React from "react"
|
|
import * as ProgressPrimitive from "@radix-ui/react-progress"
|
|
|
|
import { Progress as SubframeProgress } from "~/ui/components/Progress"
|
|
import { cn } from "~/lib/utils"
|
|
|
|
// Subframe migration (strangler shim):
|
|
// Keeps the original shadcn `Progress` API (a bare `value` 0-100 bar) but renders the
|
|
// Subframe design-system Progress behind it. Subframe's Progress is a richer labelled
|
|
// widget with a fixed `w-56` width; here we suppress the label (`hideLabel`) and reset the
|
|
// width so it behaves like the original full-width bar. The public API (single `Progress`
|
|
// export, `value`, `className`, native Root props) is unchanged.
|
|
function Progress({
|
|
className,
|
|
value,
|
|
...props
|
|
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
|
|
return (
|
|
<SubframeProgress
|
|
hideLabel
|
|
value={value ?? 0}
|
|
className={cn("w-full", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export { Progress }
|