diff --git a/lib/component/input/switch/ButtonSwitch.tsx b/lib/component/input/switch/ButtonSwitch.tsx index 74c05e8..2be307d 100644 --- a/lib/component/input/switch/ButtonSwitch.tsx +++ b/lib/component/input/switch/ButtonSwitch.tsx @@ -1,9 +1,8 @@ import type { MattrixwvButtonSwitchProps } from "$/types/InputTypes"; import { Switch } from "@headlessui/react"; -import { forwardRef } from "react"; -const ButtonSwitch = forwardRef(({ +export default function ButtonSwitch({ id, className, name, @@ -14,7 +13,7 @@ const ButtonSwitch = forwardRef(( disabled, onNode, offNode -}, ref ) => { +}: Readonly){ return ( (( checked={checked} onChange={onChange} disabled={disabled} - ref={ref} > {({ checked }) => ( <> @@ -34,8 +32,4 @@ const ButtonSwitch = forwardRef(( )} ); -}); - -ButtonSwitch.displayName = "ButtonSwitch"; - -export default ButtonSwitch; +} diff --git a/lib/component/input/switch/DangerSwitch.tsx b/lib/component/input/switch/DangerSwitch.tsx index a20caf3..a5beb83 100644 --- a/lib/component/input/switch/DangerSwitch.tsx +++ b/lib/component/input/switch/DangerSwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const DangerSwitch = forwardRef(({ +export default function DangerSwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -DangerSwitch.displayName = "DangerSwitch"; - -export default DangerSwitch; +} diff --git a/lib/component/input/switch/DarkSwitch.tsx b/lib/component/input/switch/DarkSwitch.tsx index 953b9a4..771bd91 100644 --- a/lib/component/input/switch/DarkSwitch.tsx +++ b/lib/component/input/switch/DarkSwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const DarkSwitch = forwardRef(({ +export default function DarkSwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -DarkSwitch.displayName = "DarkSwitch"; - -export default DarkSwitch; +} diff --git a/lib/component/input/switch/InfoSwitch.tsx b/lib/component/input/switch/InfoSwitch.tsx index 7b423bb..47d01dd 100644 --- a/lib/component/input/switch/InfoSwitch.tsx +++ b/lib/component/input/switch/InfoSwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const InfoSwitch = forwardRef(({ +export default function InfoSwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -InfoSwitch.displayName = "InfoSwitch"; - -export default InfoSwitch; +} diff --git a/lib/component/input/switch/LightSwitch.tsx b/lib/component/input/switch/LightSwitch.tsx index 5452b9a..2736cd6 100644 --- a/lib/component/input/switch/LightSwitch.tsx +++ b/lib/component/input/switch/LightSwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const LightSwitch = forwardRef(({ +export default function LightSwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -LightSwitch.displayName = "LightSwitch"; - -export default LightSwitch; +} diff --git a/lib/component/input/switch/MattrixwvSwitch.tsx b/lib/component/input/switch/MattrixwvSwitch.tsx index 904fd47..f05441b 100644 --- a/lib/component/input/switch/MattrixwvSwitch.tsx +++ b/lib/component/input/switch/MattrixwvSwitch.tsx @@ -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(({ +export default function MattrixwvSwitch({ id, className, knobClassName, @@ -20,7 +19,7 @@ const MattrixwvSwitch = forwardRef(({ children, offText, onText -}, ref ) => { +}: Readonly){ return ( (({ checked={checked} onChange={onChange} disabled={disabled} - ref={ref} > { offText && @@ -107,8 +105,4 @@ const MattrixwvSwitch = forwardRef(({ ); -}); - -MattrixwvSwitch.displayName = "MattrixwvSwitch"; - -export default MattrixwvSwitch; +} diff --git a/lib/component/input/switch/MoltenSwitch.tsx b/lib/component/input/switch/MoltenSwitch.tsx index 24b984e..a753be9 100644 --- a/lib/component/input/switch/MoltenSwitch.tsx +++ b/lib/component/input/switch/MoltenSwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const MoltenSwitch = forwardRef(({ +export default function MoltenSwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -MoltenSwitch.displayName = "MoltenSwitch"; - -export default MoltenSwitch; +} diff --git a/lib/component/input/switch/PrimarySwitch.tsx b/lib/component/input/switch/PrimarySwitch.tsx index dce5ce8..c58d6b3 100644 --- a/lib/component/input/switch/PrimarySwitch.tsx +++ b/lib/component/input/switch/PrimarySwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const PrimarySwitch = forwardRef(({ +export default function PrimarySwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -PrimarySwitch.displayName = "PrimarySwitch"; - -export default PrimarySwitch; +} diff --git a/lib/component/input/switch/SecondarySwitch.tsx b/lib/component/input/switch/SecondarySwitch.tsx index 8863e1c..ff2935c 100644 --- a/lib/component/input/switch/SecondarySwitch.tsx +++ b/lib/component/input/switch/SecondarySwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const SecondarySwitch = forwardRef(({ +export default function SecondarySwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -SecondarySwitch.displayName = "SecondarySwitch"; - -export default SecondarySwitch; +} diff --git a/lib/component/input/switch/SuccessDangerSwitch.tsx b/lib/component/input/switch/SuccessDangerSwitch.tsx index 60996cb..cc4a7db 100644 --- a/lib/component/input/switch/SuccessDangerSwitch.tsx +++ b/lib/component/input/switch/SuccessDangerSwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const SuccessDangerSwitch = forwardRef(({ +export default function SuccessDangerSwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( ( } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -SuccessDangerSwitch.displayName = "SuccessDangerSwitch"; - -export default SuccessDangerSwitch; +} diff --git a/lib/component/input/switch/SuccessSwitch.tsx b/lib/component/input/switch/SuccessSwitch.tsx index b6f0d7c..0060eaa 100644 --- a/lib/component/input/switch/SuccessSwitch.tsx +++ b/lib/component/input/switch/SuccessSwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const SuccessSwitch = forwardRef(({ +export default function SuccessSwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -SuccessSwitch.displayName = "SuccessSwitch"; - -export default SuccessSwitch; +} diff --git a/lib/component/input/switch/TertiarySwitch.tsx b/lib/component/input/switch/TertiarySwitch.tsx index f16227c..789111e 100644 --- a/lib/component/input/switch/TertiarySwitch.tsx +++ b/lib/component/input/switch/TertiarySwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const TertiarySwitch = forwardRef(({ +export default function TertiarySwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -TertiarySwitch.displayName = "TertiarySwitch"; - -export default TertiarySwitch; +} diff --git a/lib/component/input/switch/WarningSwitch.tsx b/lib/component/input/switch/WarningSwitch.tsx index d71c80b..f2cbb09 100644 --- a/lib/component/input/switch/WarningSwitch.tsx +++ b/lib/component/input/switch/WarningSwitch.tsx @@ -1,15 +1,14 @@ import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import clsx from "clsx"; -import { forwardRef } from "react"; import MattrixwvSwitch from "./MattrixwvSwitch"; -const WarningSwitch = forwardRef(({ +export default function WarningSwitch({ className, knobClassName, disabled, ...props -}, ref ) => { +}: Readonly){ return ( (({ } )} disabled={disabled} - ref={ref} {...props} /> ); -}); - -WarningSwitch.displayName = "WarningSwitch"; - -export default WarningSwitch; +}