Sifa professional network frontend (Next.js, React, TailwindCSS) sifa.id/
at main 66 lines 1.7 kB view raw
1'use client'; 2 3import { Progress as ProgressPrimitive } from '@base-ui/react/progress'; 4 5import { cn } from '@/lib/utils'; 6 7function Progress({ className, children, value, ...props }: ProgressPrimitive.Root.Props) { 8 return ( 9 <ProgressPrimitive.Root 10 value={value} 11 data-slot="progress" 12 className={cn('flex flex-wrap gap-3', className)} 13 {...props} 14 > 15 {children} 16 <ProgressTrack> 17 <ProgressIndicator /> 18 </ProgressTrack> 19 </ProgressPrimitive.Root> 20 ); 21} 22 23function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) { 24 return ( 25 <ProgressPrimitive.Track 26 className={cn( 27 'relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted', 28 className, 29 )} 30 data-slot="progress-track" 31 {...props} 32 /> 33 ); 34} 35 36function ProgressIndicator({ className, ...props }: ProgressPrimitive.Indicator.Props) { 37 return ( 38 <ProgressPrimitive.Indicator 39 data-slot="progress-indicator" 40 className={cn('h-full bg-primary transition-all', className)} 41 {...props} 42 /> 43 ); 44} 45 46function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) { 47 return ( 48 <ProgressPrimitive.Label 49 className={cn('text-sm font-medium', className)} 50 data-slot="progress-label" 51 {...props} 52 /> 53 ); 54} 55 56function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) { 57 return ( 58 <ProgressPrimitive.Value 59 className={cn('ml-auto text-sm text-muted-foreground tabular-nums', className)} 60 data-slot="progress-value" 61 {...props} 62 /> 63 ); 64} 65 66export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue };