Update themed components with refs and css
This commit is contained in:
@@ -1,33 +1,39 @@
|
||||
import type { MattrixwvSwitchProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvSwitch from "./MattrixwvSwitch";
|
||||
|
||||
|
||||
export default function LightSwitch({
|
||||
const LightSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
|
||||
className,
|
||||
knobClassName,
|
||||
disabled,
|
||||
...props
|
||||
}: MattrixwvSwitchProps){
|
||||
}, ref ) => {
|
||||
return (
|
||||
<MattrixwvSwitch
|
||||
{...props}
|
||||
className={clsx(
|
||||
"bg-gray-400",
|
||||
"bg-neutral-mid",
|
||||
className,
|
||||
{
|
||||
"data-checked:bg-white": !disabled,
|
||||
"data-checked:bg-neutral-300/80": disabled
|
||||
"data-checked:bg-light": !disabled,
|
||||
"data-checked:bg-light/80": disabled
|
||||
}
|
||||
)}
|
||||
knobClassName={clsx(
|
||||
knobClassName,
|
||||
{
|
||||
"bg-black": !disabled,
|
||||
"bg-neutral-800": disabled
|
||||
"bg-neutral-dark": disabled
|
||||
}
|
||||
)}
|
||||
disabled={disabled}
|
||||
ref={ref}
|
||||
/>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
LightSwitch.displayName = "LightSwitch";
|
||||
|
||||
export default LightSwitch;
|
||||
|
||||
Reference in New Issue
Block a user