Update themed components with refs and css

This commit is contained in:
2026-02-10 21:09:36 -05:00
parent 456feed128
commit 2e54b81d8f
72 changed files with 1147 additions and 562 deletions

View File

@@ -1,10 +1,11 @@
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";
export default function MattrixwvSwitch({
const MattrixwvSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
id,
className,
knobClassName,
@@ -19,7 +20,7 @@ export default function MattrixwvSwitch({
children,
offText,
onText
}: MattrixwvSwitchProps){
}, ref ) => {
return (
<Field as={Fragment}>
<Switch
@@ -53,6 +54,7 @@ export default function MattrixwvSwitch({
checked={checked}
onChange={onChange}
disabled={disabled}
ref={ref}
>
{
offText &&
@@ -105,4 +107,8 @@ export default function MattrixwvSwitch({
</Label>
</Field>
);
}
});
MattrixwvSwitch.displayName = "MattrixwvSwitch";
export default MattrixwvSwitch;