Update checkboxes
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const DangerCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function DangerCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const DangerCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
DangerCheckbox.displayName = "DangerCheckbox";
|
||||
|
||||
export default DangerCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const DarkCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function DarkCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const DarkCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
DarkCheckbox.displayName = "DarkCheckbox";
|
||||
|
||||
export default DarkCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const InfoCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function InfoCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const InfoCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
InfoCheckbox.displayName = "InfoCheckbox";
|
||||
|
||||
export default InfoCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const LightCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function LightCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const LightCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
LightCheckbox.displayName = "LightCheckbox";
|
||||
|
||||
export default LightCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import { Checkbox } from "@headlessui/react";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
|
||||
|
||||
const MattrixwvCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function MattrixwvCheckbox({
|
||||
id = crypto.randomUUID().replaceAll("-", ""),
|
||||
className,
|
||||
labelClassName,
|
||||
@@ -18,7 +17,7 @@ const MattrixwvCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
value,
|
||||
disabled,
|
||||
children
|
||||
}, ref ) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<Checkbox
|
||||
id={id}
|
||||
@@ -38,7 +37,6 @@ const MattrixwvCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
value={value}
|
||||
disabled={disabled}
|
||||
aria-labelledby={`${id}Label`}
|
||||
ref={ref}
|
||||
>
|
||||
{/* Checkbox */}
|
||||
<div
|
||||
@@ -82,8 +80,4 @@ const MattrixwvCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
</Checkbox>
|
||||
);
|
||||
});
|
||||
|
||||
MattrixwvCheckbox.displayName = "MattrixwvCheckbox";
|
||||
|
||||
export default MattrixwvCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const MoltenCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function MoltenCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const MoltenCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
MoltenCheckbox.displayName = "MoltenCheckbox";
|
||||
|
||||
export default MoltenCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const PrimaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function PrimaryCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const PrimaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
PrimaryCheckbox.displayName = "PrimaryCheckbox";
|
||||
|
||||
export default PrimaryCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const SecondaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function SecondaryCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const SecondaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
SecondaryCheckbox.displayName = "SecondaryCheckbox";
|
||||
|
||||
export default SecondaryCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const SuccessCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function SuccessCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const SuccessCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
SuccessCheckbox.displayName = "SuccessCheckbox";
|
||||
|
||||
export default SuccessCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const TertiaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function TertiaryCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const TertiaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
TertiaryCheckbox.displayName = "TertiaryCheckbox";
|
||||
|
||||
export default TertiaryCheckbox;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
const WarningCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
export default function WarningCheckbox({
|
||||
className,
|
||||
showBox = true,
|
||||
...props
|
||||
}, ref) => {
|
||||
}: Readonly<CheckboxProps>){
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
@@ -19,12 +18,7 @@ const WarningCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
}
|
||||
)}
|
||||
showBox={showBox}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
WarningCheckbox.displayName = "WarningCheckbox";
|
||||
|
||||
export default WarningCheckbox;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user