https://dev.kronoz.win/r/marzneshin.git
| 1 |
88bd1b0 |
Mrdn |
2y ago |
import * as React from "react" |
| 2 |
88bd1b0 |
Mrdn |
2y ago |
import * as SwitchPrimitives from "@radix-ui/react-switch" |
| 3 |
88bd1b0 |
Mrdn |
2y ago |
|
| 4 |
d636f3f |
Dawsh |
2y ago |
import { cn } from "@marzneshin/common/utils" |
| 5 |
88bd1b0 |
Mrdn |
2y ago |
|
| 6 |
88bd1b0 |
Mrdn |
2y ago |
const Switch = React.forwardRef< |
| 7 |
d636f3f |
Dawsh |
2y ago |
React.ElementRef<typeof SwitchPrimitives.Root>, |
| 8 |
d636f3f |
Dawsh |
2y ago |
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> |
| 9 |
88bd1b0 |
Mrdn |
2y ago |
>(({ className, ...props }, ref) => ( |
| 10 |
d636f3f |
Dawsh |
2y ago |
<SwitchPrimitives.Root |
| 11 |
d636f3f |
Dawsh |
2y ago |
className={cn( |
| 12 |
d636f3f |
Dawsh |
2y ago |
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", |
| 13 |
d636f3f |
Dawsh |
2y ago |
className |
| 14 |
d636f3f |
Dawsh |
2y ago |
)} |
| 15 |
d636f3f |
Dawsh |
2y ago |
{...props} |
| 16 |
d636f3f |
Dawsh |
2y ago |
ref={ref} |
| 17 |
d636f3f |
Dawsh |
2y ago |
> |
| 18 |
d636f3f |
Dawsh |
2y ago |
<SwitchPrimitives.Thumb |
| 19 |
d636f3f |
Dawsh |
2y ago |
className={cn( |
| 20 |
d636f3f |
Dawsh |
2y ago |
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0" |
| 21 |
d636f3f |
Dawsh |
2y ago |
)} |
| 22 |
d636f3f |
Dawsh |
2y ago |
/> |
| 23 |
d636f3f |
Dawsh |
2y ago |
</SwitchPrimitives.Root> |
| 24 |
88bd1b0 |
Mrdn |
2y ago |
)) |
| 25 |
88bd1b0 |
Mrdn |
2y ago |
Switch.displayName = SwitchPrimitives.Root.displayName |
| 26 |
88bd1b0 |
Mrdn |
2y ago |
|
| 27 |
88bd1b0 |
Mrdn |
2y ago |
export { Switch } |