{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "progress",
  "dependencies": [
    "motion",
    "radix-ui"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "src/components/watermelon-ui/progress.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrime } from 'radix-ui';\nimport { motion } from 'motion/react';\nimport { cn } from '@/lib/utils';\n\ntype ProgressProps = ProgressPrimitiveProps;\n\nfunction Progress({ className, ...props }: ProgressProps) {\n  return (\n    <ProgressPrimitive\n      className={cn(\n        'bg-primary/20 relative h-2 w-full overflow-hidden rounded-full',\n        className,\n      )}\n      {...props}\n    >\n      <ProgressIndicatorPrimitive className=\"bg-primary rounded-full h-full w-full flex-1\" />\n    </ProgressPrimitive>\n  );\n}\n\nexport { Progress, type ProgressProps };\n\n\n\ntype ProgressContextType = {\n  value: number;\n};\n\nconst [ProgressProvider, useProgress] =\n  getStrictContext<ProgressContextType>('ProgressContext');\n\ntype ProgressPrimitiveProps = React.ComponentProps<typeof ProgressPrime.Root>;\n\nfunction ProgressPrimitive(props: ProgressPrimitiveProps) {\n  return (\n    <ProgressProvider value={{ value: props.value ?? 0 }}>\n      <ProgressPrime.Root data-slot=\"progress\" {...props} />\n    </ProgressProvider>\n  );\n}\n\nconst MotionProgressIndicator = motion.create(ProgressPrime.Indicator);\n\ntype ProgressIndicatorProps = React.ComponentProps<\n  typeof MotionProgressIndicator\n>;\n\nfunction ProgressIndicatorPrimitive({\n  transition = { type: 'spring', stiffness: 100, damping: 30 },\n  ...props\n}: ProgressIndicatorProps) {\n  const { value } = useProgress();\n\n  return (\n    <MotionProgressIndicator\n      data-slot=\"progress-indicator\"\n      animate={{ x: `-${100 - (value || 0)}%` }}\n      transition={transition}\n      {...props}\n    />\n  );\n}\n\nfunction getStrictContext<T>(\n  name?: string,\n): readonly [\n  ({\n    value,\n    children,\n  }: {\n    value: T;\n    children?: React.ReactNode;\n  }) => React.JSX.Element,\n  () => T,\n] {\n  const Context = React.createContext<T | undefined>(undefined);\n\n  const Provider = ({\n    value,\n    children,\n  }: {\n    value: T;\n    children?: React.ReactNode;\n  }) => <Context.Provider value={value}>{children}</Context.Provider>;\n\n  const useSafeContext = () => {\n    const ctx = React.useContext(Context);\n    if (ctx === undefined) {\n      throw new Error(`useContext must be used within ${name ?? 'a Provider'}`);\n    }\n    return ctx;\n  };\n\n  return [Provider, useSafeContext] as const;\n}\n\nexport { getStrictContext };\n",
      "type": "registry:ui",
      "target": "components/ui/progress.tsx"
    }
  ],
  "type": "registry:ui"
}
