Update switches

This commit is contained in:
2026-02-14 17:04:16 -05:00
parent 1743ed6ce4
commit 31c44d3d92
13 changed files with 39 additions and 117 deletions

View File

@@ -1,11 +1,10 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import { Field, Label, Switch } from "@headlessui/react";
import clsx from "clsx";
import { forwardRef } from "react";
import { Fragment } from "react/jsx-runtime";
const MattrixwvSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
export default function MattrixwvSwitch({
id,
className,
knobClassName,
@@ -20,7 +19,7 @@ const MattrixwvSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
children,
offText,
onText
}, ref ) => {
}: Readonly<MattrixwvSwitchProps>){
return (
<Field as={Fragment}>
<Switch
@@ -54,7 +53,6 @@ const MattrixwvSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
checked={checked}
onChange={onChange}
disabled={disabled}
ref={ref}
>
{
offText &&
@@ -107,8 +105,4 @@ const MattrixwvSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
</Label>
</Field>
);
});
MattrixwvSwitch.displayName = "MattrixwvSwitch";
export default MattrixwvSwitch;
}