diff --git a/lib/component/input/checkbox/DangerCheckbox.tsx b/lib/component/input/checkbox/DangerCheckbox.tsx index 6520585..1328173 100644 --- a/lib/component/input/checkbox/DangerCheckbox.tsx +++ b/lib/component/input/checkbox/DangerCheckbox.tsx @@ -6,7 +6,7 @@ import MattrixwvCheckbox from "./MattrixwvCheckbox"; const DangerCheckbox = forwardRef(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const DangerCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-danger group-data-checked:stroke-white": box, - "group-data-checked:stroke-danger": !box + "group-data-checked:bg-danger group-data-checked:stroke-white": showBox, + "group-data-checked:stroke-danger": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/component/input/checkbox/DarkCheckbox.tsx b/lib/component/input/checkbox/DarkCheckbox.tsx index c5384f1..fa6a5f9 100644 --- a/lib/component/input/checkbox/DarkCheckbox.tsx +++ b/lib/component/input/checkbox/DarkCheckbox.tsx @@ -6,7 +6,7 @@ import MattrixwvCheckbox from "./MattrixwvCheckbox"; const DarkCheckbox = forwardRef(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const DarkCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-dark group-data-checked:stroke-light": box, - "group-data-checked:stroke-dark": !box + "group-data-checked:bg-dark group-data-checked:stroke-light": showBox, + "group-data-checked:stroke-dark": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/component/input/checkbox/InfoCheckbox.tsx b/lib/component/input/checkbox/InfoCheckbox.tsx index 2e0ed82..d99e103 100644 --- a/lib/component/input/checkbox/InfoCheckbox.tsx +++ b/lib/component/input/checkbox/InfoCheckbox.tsx @@ -6,7 +6,7 @@ import MattrixwvCheckbox from "./MattrixwvCheckbox"; const InfoCheckbox = forwardRef(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const InfoCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-info group-data-checked:stroke-white": box, - "group-data-checked:stroke-info": !box + "group-data-checked:bg-info group-data-checked:stroke-white": showBox, + "group-data-checked:stroke-info": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/component/input/checkbox/LightCheckbox.tsx b/lib/component/input/checkbox/LightCheckbox.tsx index 42c4627..0652d55 100644 --- a/lib/component/input/checkbox/LightCheckbox.tsx +++ b/lib/component/input/checkbox/LightCheckbox.tsx @@ -6,7 +6,7 @@ import MattrixwvCheckbox from "./MattrixwvCheckbox"; const LightCheckbox = forwardRef(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const LightCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-light group-data-checked:stroke-dark": box, - "group-data-checked:stroke-light": !box + "group-data-checked:bg-light group-data-checked:stroke-dark": showBox, + "group-data-checked:stroke-light": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/component/input/checkbox/MattrixwvCheckbox.tsx b/lib/component/input/checkbox/MattrixwvCheckbox.tsx index 88317c2..317b6ae 100644 --- a/lib/component/input/checkbox/MattrixwvCheckbox.tsx +++ b/lib/component/input/checkbox/MattrixwvCheckbox.tsx @@ -10,33 +10,42 @@ const MattrixwvCheckbox = forwardRef(({ labelClassName, name, size = "sm", - box = true, + showBox = true, onChange, checked, defaultChecked, strokeWidth = 2, value, + disabled, + ariaLabel, children }, ref ) => { return ( + {/* Checkbox */}
(({
+ {/* Label */} { children &&
(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const MoltenCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-molten group-data-checked:stroke-white": box, - "group-data-checked:stroke-molten": !box + "group-data-checked:bg-molten group-data-checked:stroke-white": showBox, + "group-data-checked:stroke-molten": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/component/input/checkbox/PrimaryCheckbox.tsx b/lib/component/input/checkbox/PrimaryCheckbox.tsx index 2ec59dd..1c954ef 100644 --- a/lib/component/input/checkbox/PrimaryCheckbox.tsx +++ b/lib/component/input/checkbox/PrimaryCheckbox.tsx @@ -6,7 +6,7 @@ import MattrixwvCheckbox from "./MattrixwvCheckbox"; const PrimaryCheckbox = forwardRef(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const PrimaryCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-primary group-data-checked:stroke-white": box, - "group-data-checked:stroke-primary": !box + "group-data-checked:bg-primary group-data-checked:stroke-white": showBox, + "group-data-checked:stroke-primary": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/component/input/checkbox/SecondaryCheckbox.tsx b/lib/component/input/checkbox/SecondaryCheckbox.tsx index a63ab9c..b08308c 100644 --- a/lib/component/input/checkbox/SecondaryCheckbox.tsx +++ b/lib/component/input/checkbox/SecondaryCheckbox.tsx @@ -6,7 +6,7 @@ import MattrixwvCheckbox from "./MattrixwvCheckbox"; const SecondaryCheckbox = forwardRef(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const SecondaryCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-secondary group-data-checked:stroke-white": box, - "group-data-checked:stroke-secondary": !box + "group-data-checked:bg-secondary group-data-checked:stroke-white": showBox, + "group-data-checked:stroke-secondary": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/component/input/checkbox/SuccessCheckbox.tsx b/lib/component/input/checkbox/SuccessCheckbox.tsx index e382830..8d409e4 100644 --- a/lib/component/input/checkbox/SuccessCheckbox.tsx +++ b/lib/component/input/checkbox/SuccessCheckbox.tsx @@ -6,7 +6,7 @@ import MattrixwvCheckbox from "./MattrixwvCheckbox"; const SuccessCheckbox = forwardRef(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const SuccessCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-success group-data-checked:stroke-white": box, - "group-data-checked:stroke-success": !box + "group-data-checked:bg-success group-data-checked:stroke-white": showBox, + "group-data-checked:stroke-success": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/component/input/checkbox/TertiaryCheckbox.tsx b/lib/component/input/checkbox/TertiaryCheckbox.tsx index 68aa266..481e8d8 100644 --- a/lib/component/input/checkbox/TertiaryCheckbox.tsx +++ b/lib/component/input/checkbox/TertiaryCheckbox.tsx @@ -6,7 +6,7 @@ import MattrixwvCheckbox from "./MattrixwvCheckbox"; const TertiaryCheckbox = forwardRef(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const TertiaryCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-tertiary group-data-checked:stroke-white": box, - "group-data-checked:stroke-tertiary": !box + "group-data-checked:bg-tertiary group-data-checked:stroke-white": showBox, + "group-data-checked:stroke-tertiary": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/component/input/checkbox/WarningCheckbox.tsx b/lib/component/input/checkbox/WarningCheckbox.tsx index 2a744ab..ad3bac1 100644 --- a/lib/component/input/checkbox/WarningCheckbox.tsx +++ b/lib/component/input/checkbox/WarningCheckbox.tsx @@ -6,7 +6,7 @@ import MattrixwvCheckbox from "./MattrixwvCheckbox"; const WarningCheckbox = forwardRef(({ className, - box = true, + showBox = true, ...props }, ref) => { return ( @@ -14,11 +14,11 @@ const WarningCheckbox = forwardRef(({ className={clsx( className, { - "group-data-checked:bg-warning group-data-checked:stroke-white": box, - "group-data-checked:stroke-warning": !box + "group-data-checked:bg-warning group-data-checked:stroke-white": showBox, + "group-data-checked:stroke-warning": !showBox } )} - box={box} + showBox={showBox} {...props} ref={ref} /> diff --git a/lib/types/InputTypes.ts b/lib/types/InputTypes.ts index 2cae599..a395eb0 100644 --- a/lib/types/InputTypes.ts +++ b/lib/types/InputTypes.ts @@ -130,12 +130,14 @@ export interface CheckboxProps { labelClassName?: string; name?: string; size?: CheckboxSize; - box?: boolean; + showBox?: boolean; onChange?: (newChecked: boolean) => void; checked?: boolean; defaultChecked?: boolean; strokeWidth?: number; value?: string; + disabled?: boolean; + ariaLabel: string; children?: React.ReactNode; } diff --git a/src/util/InputUtils.tsx b/src/util/InputUtils.tsx index ee4f5db..f3676a7 100644 --- a/src/util/InputUtils.tsx +++ b/src/util/InputUtils.tsx @@ -530,10 +530,10 @@ export function SwitchContent(){ function SwitchDisplay({ title, children -}:{ +}:Readonly<{ title: React.ReactNode; children: React.ReactNode; -}){ +}>){ return (
){ return (
){ return (
-
- Default - Primary - Secondary - Tertiary - Info - Success - Warning - Danger - Molten - Light - Dark +
+ Default + Primary + Secondary + Tertiary + Info + Success + Warning + Danger + Molten + Light + Dark
-
- Default - Primary - Secondary - Tertiary - Info - Success - Warning - Danger - Molten - Light - Dark +
+ Default + Primary + Secondary + Tertiary + Info + Success + Warning + Danger + Molten + Light + Dark
@@ -726,10 +722,10 @@ export function CheckboxContent(){ function CheckboxDisplay({ title, children -}:{ +}:Readonly<{ title: React.ReactNode; children: React.ReactNode; -}){ +}>){ return (
){ return (