Compare commits

..

2 Commits

Author SHA1 Message Date
5abceb7bc7 Update themed component tests 2026-02-10 22:14:48 -05:00
2e54b81d8f Update themed components with refs and css 2026-02-10 21:09:36 -05:00
92 changed files with 1385 additions and 801 deletions

View File

@@ -4,8 +4,7 @@ import { forwardRef } from "react";
const Button = forwardRef<HTMLButtonElement, ButtonProps>(( const Button = forwardRef<HTMLButtonElement, ButtonProps>(({
{
className, className,
type="button", type="button",
rounding = "lg", rounding = "lg",
@@ -15,52 +14,53 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>((
disabled, disabled,
...buttonProps ...buttonProps
}, ref ) => { }, ref ) => {
return ( return (
<button <button
data-testid="mattrixwv-button" data-testid="mattrixwv-button"
ref={ref} ref={ref}
type={type} type={type}
{...buttonProps} {...buttonProps}
disabled={disabled} disabled={disabled}
className={clsx( className={clsx(
className, className,
//Focus //Focus
"focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
//Rounding //Rounding
{ {
"rounded-sm": rounding === "sm", "rounded-sm": rounding === "sm",
"rounded-md": rounding === "md", "rounded-md": rounding === "md",
"rounded-lg": rounding === "lg", "rounded-lg": rounding === "lg",
"rounded-full": rounding === "full" "rounded-full": rounding === "full"
}, },
//Size and shape //Size and shape
{ {
"p-0": size === "xs" && shape === "square", "p-0": size === "xs" && shape === "square",
"p-1": size === "sm" && shape === "square", "p-1": size === "sm" && shape === "square",
"p-2": size === "md" && shape === "square", "p-2": size === "md" && shape === "square",
"p-3": size === "lg" && shape === "square", "p-3": size === "lg" && shape === "square",
"p-4": size === "xl" && shape === "square", "p-4": size === "xl" && shape === "square",
"px-1 py-0": size === "xs" && shape === "rectangle", "px-1 py-0": size === "xs" && shape === "rectangle",
"px-2 py-1": size === "sm" && shape === "rectangle", "px-2 py-1": size === "sm" && shape === "rectangle",
"px-4 py-2": size === "md" && shape === "rectangle", "px-4 py-2": size === "md" && shape === "rectangle",
"px-6 py-3": size === "lg" && shape === "rectangle", "px-6 py-3": size === "lg" && shape === "rectangle",
"px-8 py-4": size === "xl" && shape === "rectangle", "px-8 py-4": size === "xl" && shape === "rectangle",
}, },
//Variant //Variant
{ {
"border": variant === "standard" || variant === "outline" || variant === "outline-ghost", "border": variant === "standard" || variant === "outline" || variant === "outline-ghost",
"border-none": variant === "ghost" || variant === "icon" "border-none": variant === "ghost" || variant === "icon"
}, },
//Disabled //Disabled
{ {
"cursor-pointer": !disabled, "cursor-pointer": !disabled,
"cursor-not-allowed opacity-75": disabled "cursor-not-allowed opacity-75": disabled
} }
)} )}
/> />
); );
} });
);
Button.displayName = "Button";
export default Button; export default Button;

View File

@@ -1,47 +1,51 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function DangerButton(props: ButtonProps){
const {
className,
variant = "standard",
disabled
} = props;
const DangerButton = forwardRef<HTMLButtonElement, ButtonProps>(({
className,
variant = "standard",
disabled,
...buttonProps
}, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-danger-button" data-testid="mattrixwv-danger-button"
{...props} {...buttonProps}
ref={ref}
variant={variant}
disabled={disabled}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-red-600 hover:bg-red-700 active:bg-red-800": (variant === "standard") && (!disabled), "bg-danger active:bg-danger-dark": (variant === "standard") && (!disabled),
"bg-red-400/80": (variant === "standard") && (disabled), "bg-danger-light/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-red-600 active:bg-red-700": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-danger active:bg-danger-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-red-600 hover:border-red-700 active:border-red-800": (variant === "standard" || variant === "outline") && (!disabled), "border-danger active:border-danger-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-red-400/80": (variant === "standard" || variant === "outline") && (disabled), "border-danger-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-red-600 hover:border-red-600 active:border-red-700": (variant === "outline-ghost") && (!disabled),
"border-red-400/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-white": variant === "standard", "text-white": variant === "standard",
"text-red-600 hover:text-red-700 active:text-red-800": (variant === "outline" || variant === "icon") && (!disabled), "text-danger active:text-danger-dark": (variant === "outline" || variant === "icon") && (!disabled),
"text-red-400/80": (variant === "outline" || variant === "icon") && (disabled), "text-danger-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-red-600 hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-danger hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-red-400/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
DangerButton.displayName = "DangerButton";
export default DangerButton;

View File

@@ -1,47 +1,50 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function DarkButton(props: ButtonProps){ const DarkButton = forwardRef<HTMLButtonElement, ButtonProps>(({
const { className,
className, variant = "standard",
variant = "standard", disabled,
disabled ...buttonProps
} = props; }, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-dark-button" data-testid="mattrixwv-dark-button"
{...props} {...buttonProps}
ref={ref}
variant={variant}
disabled={disabled}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-black hover:bg-neutral-700 active:bg-neutral-600": (variant === "standard") && (!disabled), "bg-dark active:bg-dark-mid": (variant === "standard") && (!disabled),
"bg-neutral-700/80": (variant === "standard") && (disabled), "bg-dark-mid/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-black active:bg-neutral-700": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-dark active:bg-dark-mid": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-black hover:border-neutral-700 active:border-neutral-600": (variant === "standard" || variant === "outline") && (!disabled), "border-dark active:border-dark-mid": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-neutral-700/80": (variant === "standard" || variant === "outline") && (disabled), "border-dark-mid/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-black hover:border-black active:border-neutral-700": (variant === "outline-ghost") && (!disabled),
"border-neutral-700/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-white": variant === "standard", "text-white": variant === "standard",
"text-black hover:text-neutral-700 active:text-neutral-600": (variant === "outline" || variant === "icon") && (!disabled), "text-dark active:text-dark-mid": (variant === "outline" || variant === "icon") && (!disabled),
"text-neutral-700/80": (variant === "outline" || variant === "icon") && (disabled), "text-dark-mid/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-black hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-dark hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-neutral-700/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
DarkButton.displayName = "DarkButton";
export default DarkButton;

View File

@@ -1,47 +1,50 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function InfoButton(props: ButtonProps){ const InfoButton = forwardRef<HTMLButtonElement, ButtonProps>(({
const { className,
className, variant = "standard",
variant = "standard", disabled,
disabled ...buttonProps
} = props; }, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-info-button" data-testid="mattrixwv-info-button"
{...props} {...buttonProps}
variant={variant}
disabled={disabled}
ref={ref}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-cyan-500 hover:bg-cyan-600 active:bg-cyan-700": (variant === "standard") && (!disabled), "bg-info active:bg-info-dark": (variant === "standard") && (!disabled),
"bg-sky-300/80": (variant === "standard") && (disabled), "bg-info-light/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-cyan-500 active:bg-cyan-600": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-info active:bg-info-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-cyan-500 hover:border-cyan-600 active:border-cyan-700": (variant === "standard" || variant === "outline") && (!disabled), "border-info active:border-info-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-sky-300/80": (variant === "standard" || variant === "outline") && (disabled), "border-info-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-cyan-500 hover:border-cyan-500 active:border-cyan-600": (variant === "outline-ghost") && (!disabled),
"border-sky-300/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-black": variant === "standard", "text-black": variant === "standard",
"text-cyan-500 hover:text-cyan-600 active:text-cyan-700": (variant === "outline" || variant === "icon") && (!disabled), "text-info active:text-info-dark": (variant === "outline" || variant === "icon") && (!disabled),
"text-sky-300/80": (variant === "outline" || variant === "icon") && (disabled), "text-info-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-cyan-500 hover:text-black active:text-black": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-info hover:text-black active:text-black": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-sky-300/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
InfoButton.displayName = "InfoButton";
export default InfoButton;

View File

@@ -1,47 +1,50 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function LightButton(props: ButtonProps){ const LightButton = forwardRef<HTMLButtonElement, ButtonProps>(({
const { className,
className, variant = "standard",
variant = "standard", disabled,
disabled ...buttonProps
} = props; }, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-light-button" data-testid="mattrixwv-light-button"
{...props} {...buttonProps}
ref={ref}
variant={variant}
disabled={disabled}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-white hover:bg-neutral-300 active:bg-neutral-400": (variant === "standard") && (!disabled), "bg-light active:bg-light-dark": (variant === "standard") && (!disabled),
"bg-neutral-400/80": (variant === "standard") && (disabled), "bg-light-light/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-white active:bg-neutral-300": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-light active:bg-light-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-white hover:border-neutral-300 active:border-neutral-400": (variant === "standard" || variant === "outline") && (!disabled), "border-light active:border-light-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-neutral-400/80": (variant === "standard" || variant === "outline") && (disabled), "border-light-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-white hover:border-white active:border-neutral-300": (variant === "outline-ghost") && (!disabled),
"border-neutral-400/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-black": variant === "standard", "text-black": variant === "standard",
"text-white hover:text-neutral-300 active:text-neutral-400": (variant === "outline" || variant === "icon") && (!disabled), "text-light active:text-light-dark": (variant === "outline" || variant === "icon") && (!disabled),
"text-neutral-400/80": (variant === "outline" || variant === "icon") && (disabled), "text-light-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-white hover:text-black active:text-black": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-light hover:text-black active:text-black": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-neutral-400/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
LightButton.displayName = "LightButton";
export default LightButton;

View File

@@ -1,47 +1,50 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function MoltenButton(props: ButtonProps){ const MoltenButton = forwardRef<HTMLButtonElement, ButtonProps>(({
const { className,
className, variant = "standard",
variant = "standard", disabled,
disabled ...buttonProps
} = props; }, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-molten-button" data-testid="mattrixwv-molten-button"
{...props} {...buttonProps}
ref={ref}
variant={variant}
disabled={disabled}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-orange-600 hover:bg-orange-700 active:bg-orange-800": (variant === "standard") && (!disabled), "bg-molten active:bg-molten-dark": (variant === "standard") && (!disabled),
"bg-orange-400/80": (variant === "standard") && (disabled), "bg-molten-light/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-orange-600 active:bg-orange-700": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-molten active:bg-molten-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-orange-600 hover:border-orange-700 active:border-orange-800": (variant === "standard" || variant === "outline") && (!disabled), "border-molten active:border-molten-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-orange-400/80": (variant === "standard" || variant === "outline") && (disabled), "border-molten-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-orange-600 hover:border-orange-600 active:border-orange-700": (variant === "outline-ghost") && (!disabled),
"border-orange-400/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-white": variant === "standard", "text-black": variant === "standard",
"text-orange-600 hover:text-orange-700 active:text-orange-800": (variant === "outline" || variant === "icon") && (!disabled), "text-molten active:text-molten-dark": (variant === "outline" || variant === "icon") && (!disabled),
"text-orange-400/80": (variant === "outline" || variant === "icon") && (disabled), "text-molten-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-orange-600 hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-molten hover:text-black active:text-black": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-orange-400/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
MoltenButton.displayName = "MoltenButton";
export default MoltenButton;

View File

@@ -1,47 +1,50 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function PrimaryButton(props: ButtonProps){ const PrimaryButton = forwardRef<HTMLButtonElement, ButtonProps>(({
const { className,
className, variant = "standard",
variant = "standard", disabled,
disabled ...buttonProps
} = props; }, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-primary-button" data-testid="mattrixwv-primary-button"
{...props} {...buttonProps}
ref={ref}
variant={variant}
disabled={disabled}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-blue-600 hover:bg-blue-700 active:bg-blue-800": (variant === "standard") && (!disabled), "bg-primary active:bg-primary-dark": (variant === "standard") && (!disabled),
"bg-blue-400/80": (variant === "standard") && (disabled), "bg-primary-light/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-blue-600 active:bg-blue-700": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-primary active:bg-primary-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-blue-600 hover:border-blue-700 active:border-blue-800": (variant === "standard" || variant === "outline") && (!disabled), "border-primary active:border-primary-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-blue-400/80": (variant === "standard" || variant === "outline") && (disabled), "border-primary-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-blue-600 hover:border-blue-600 active:border-blue-700": (variant === "outline-ghost") && (!disabled),
"border-blue-400/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-white": variant === "standard", "text-white": variant === "standard",
"text-blue-600 hover:text-blue-700 active:text-blue-800": (variant === "outline" || variant === "icon") && (!disabled), "text-primary active:text-primary-dark": (variant === "outline" || variant === "icon") && (!disabled),
"text-blue-400/80": (variant === "outline" || variant === "icon") && (disabled), "text-primary-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-blue-600 hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-primary hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-blue-400/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
PrimaryButton.displayName = "PrimaryButton";
export default PrimaryButton;

View File

@@ -1,47 +1,50 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function SecondaryButton(props: ButtonProps){ const SecondaryButton = forwardRef<HTMLButtonElement, ButtonProps>(({
const { className,
className, variant = "standard",
variant = "standard", disabled,
disabled ...buttonProps
} = props; }, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-secondary-button" data-testid="mattrixwv-secondary-button"
{...props} {...buttonProps}
ref={ref}
variant={variant}
disabled={disabled}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-neutral-500 hover:bg-neutral-600 active:bg-neutral-700": (variant === "standard") && (!disabled), "bg-secondary active:bg-secondary-dark": (variant === "standard") && (!disabled),
"bg-neutral-300/80": (variant === "standard") && (disabled), "bg-secondary-light/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-neutral-500 active:bg-neutral-600": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-secondary active:bg-secondary-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-neutral-500 hover:border-neutral-600 active:border-neutral-700": (variant === "standard" || variant === "outline") && (!disabled), "border-secondary active:border-secondary-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-neutral-300/80": (variant === "standard" || variant === "outline") && (disabled), "border-secondary-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-neutral-500 hover:border-neutral-500 active:border-neutral-600": (variant === "outline-ghost") && (!disabled),
"border-neutral-300/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-white": variant === "standard", "text-white": variant === "standard",
"text-neutral-500 hover:text-neutral-600 active:text-neutral-700": (variant === "outline" || variant === "icon") && (!disabled), "text-secondary active:text-secondary-dark": (variant === "outline" || variant === "icon") && (!disabled),
"text-neutral-300/80": (variant === "outline" || variant === "icon") && (disabled), "text-secondary-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-neutral-500 hover:text-black active:text-black": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-secondary hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-neutral-300/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
SecondaryButton.displayName = "SecondaryButton";
export default SecondaryButton;

View File

@@ -1,47 +1,50 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function SuccessButton(props: ButtonProps){ const SuccessButton = forwardRef<HTMLButtonElement, ButtonProps>(({
const { className,
className, variant = "standard",
variant = "standard", disabled,
disabled ...buttonProps
} = props; }, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-success-button" data-testid="mattrixwv-success-button"
{...props} {...buttonProps}
ref={ref}
variant={variant}
disabled={disabled}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-green-600 hover:bg-green-700 active:bg-green-800": (variant === "standard") && (!disabled), "bg-success active:bg-success-dark": (variant === "standard") && (!disabled),
"bg-green-400/80": (variant === "standard") && (disabled), "bg-success-light/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-green-600 active:bg-green-700": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-success active:bg-success-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-green-600 hover:border-green-700 active:border-green-800": (variant === "standard" || variant === "outline") && (!disabled), "border-success active:border-success-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-green-400/80": (variant === "standard" || variant === "outline") && (disabled), "border-success-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-green-600 hover:border-green-600 active:border-green-700": (variant === "outline-ghost") && (!disabled),
"border-green-400/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-white": variant === "standard", "text-black": variant === "standard",
"text-green-600 hover:text-green-700 active:text-green-800": (variant === "outline" || variant === "icon") && (!disabled), "text-success active:text-success-dark": (variant === "outline" || variant === "icon") && (!disabled),
"text-green-400/80": (variant === "outline" || variant === "icon") && (disabled), "text-success-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-green-600 hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-success hover:text-black active:text-black": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-green-400/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
SuccessButton.displayName = "SuccessButton";
export default SuccessButton;

View File

@@ -1,47 +1,50 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function TertiaryButton(props: ButtonProps){ const TertiaryButton = forwardRef<HTMLButtonElement, ButtonProps>(({
const { className,
className, variant = "standard",
variant = "standard", disabled,
disabled ...buttonProps
} = props; }, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-tertiary-button" data-testid="mattrixwv-tertiary-button"
{...props} {...buttonProps}
ref={ref}
variant={variant}
disabled={disabled}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-purple-600 hover:bg-purple-700 active:bg-purple-800": (variant === "standard") && (!disabled), "bg-tertiary active:bg-tertiary-dark": (variant === "standard") && (!disabled),
"bg-purple-400/80": (variant === "standard") && (disabled), "bg-tertiary-light/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-purple-600 active:bg-purple-700": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-tertiary active:bg-tertiary-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-purple-600 hover:border-purple-700 active:border-purple-800": (variant === "standard" || variant === "outline") && (!disabled), "border-tertiary active:border-tertiary-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-purple-400/80": (variant === "standard" || variant === "outline") && (disabled), "border-tertiary-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-purple-600 hover:border-purple-600 active:border-purple-700": (variant === "outline-ghost") && (!disabled),
"border-purple-400/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-white": variant === "standard", "text-white": variant === "standard",
"text-purple-600 hover:text-purple-700 active:text-purple-800": (variant === "outline" || variant === "icon") && (!disabled), "text-tertiary active:text-tertiary-dark": (variant === "outline" || variant === "icon") && (!disabled),
"text-purple-400/80": (variant === "outline" || variant === "icon") && (disabled), "text-tertiary-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-purple-600 hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-tertiary hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-purple-400/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
TertiaryButton.displayName = "TertiaryButton";
export default TertiaryButton;

View File

@@ -1,47 +1,50 @@
import type { ButtonProps } from "$/types/ButtonTypes"; import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import Button from "./Button"; import Button from "./Button";
export default function WarningButton(props: ButtonProps){ const WarningButton = forwardRef<HTMLButtonElement, ButtonProps>(({
const { className,
className, variant = "standard",
variant = "standard", disabled,
disabled ...buttonProps
} = props; }, ref) => {
return ( return (
<Button <Button
data-testid="mattrixwv-warning-button" data-testid="mattrixwv-warning-button"
{...props} {...buttonProps}
ref={ref}
variant={variant}
disabled={disabled}
className={clsx( className={clsx(
"transition duration-300", "transition duration-300",
className, className,
//Background //Background
{ {
"bg-yellow-500 hover:bg-yellow-600 active:bg-yellow-700": (variant === "standard") && (!disabled), "bg-warning active:bg-warning-dark": (variant === "standard") && (!disabled),
"bg-yellow-300/80": (variant === "standard") && (disabled), "bg-warning-light/80": (variant === "standard") && (disabled),
"bg-transparent": (variant === "outline" || variant === "icon"), "bg-transparent": (variant === "outline" || variant === "icon"),
"bg-transparent hover:bg-yellow-500 active:bg-yellow-600": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "bg-transparent hover:bg-warning active:bg-warning-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled) "bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
}, },
//Outline //Outline
{ {
"border-yellow-500 hover:border-yellow-600 active:border-yellow-700": (variant === "standard" || variant === "outline") && (!disabled), "border-warning active:border-warning-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
"border-yellow-300/80": (variant === "standard" || variant === "outline") && (disabled), "border-warning-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
"border-yellow-500 hover:border-yellow-500 active:border-yellow-600": (variant === "outline-ghost") && (!disabled),
"border-yellow-300/80 ": (variant === "outline-ghost") && (disabled)
}, },
//Text //Text
{ {
"text-black": variant === "standard", "text-black": variant === "standard",
"text-yellow-500 hover:text-yellow-600 active:text-yellow-700": (variant === "outline" || variant === "icon") && (!disabled), "text-warning active:text-warning-dark": (variant === "outline" || variant === "icon") && (!disabled),
"text-yellow-300/80": (variant === "outline" || variant === "icon") && (disabled), "text-warning-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
"text-yellow-500 hover:text-black active:text-black": (variant === "ghost" || variant === "outline-ghost") && (!disabled), "text-warning hover:text-black active:text-black": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
"text-yellow-300/80 ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
} }
)} )}
/> />
); );
} });
WarningButton.displayName = "WarningButton";
export default WarningButton;

View File

@@ -1,24 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function DangerCheckbox({ const DangerCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-red-600 group-data-checked:stroke-white": box, "group-data-checked:bg-danger group-data-checked:stroke-white": box,
"group-data-checked:stroke-red-600": !box "group-data-checked:stroke-danger": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
DangerCheckbox.displayName = "DangerCheckbox";
export default DangerCheckbox;

View File

@@ -1,24 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function DarkCheckbox({ const DarkCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-black group-data-checked:stroke-white": box, "group-data-checked:bg-dark group-data-checked:stroke-light": box,
"group-data-checked:stroke-black": !box "group-data-checked:stroke-dark": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
DarkCheckbox.displayName = "DarkCheckbox";
export default DarkCheckbox;

View File

@@ -1,24 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function InfoCheckbox({ const InfoCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-cyan-500 group-data-checked:stroke-white": box, "group-data-checked:bg-info group-data-checked:stroke-white": box,
"group-data-checked:stroke-cyan-500": !box "group-data-checked:stroke-info": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
InfoCheckbox.displayName = "InfoCheckbox";
export default InfoCheckbox;

View File

@@ -1,24 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function LightCheckbox({ const LightCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-white group-data-checked:stroke-black": box, "group-data-checked:bg-light group-data-checked:stroke-dark": box,
"group-data-checked:stroke-white": !box "group-data-checked:stroke-light": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
LightCheckbox.displayName = "LightCheckbox";
export default LightCheckbox;

View File

@@ -1,9 +1,10 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import { Checkbox } from "@headlessui/react"; import { Checkbox } from "@headlessui/react";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
export default function MattrixwvCheckbox({ const MattrixwvCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
id, id,
className, className,
labelClassName, labelClassName,
@@ -16,7 +17,7 @@ export default function MattrixwvCheckbox({
strokeWidth = 2, strokeWidth = 2,
value, value,
children children
}: CheckboxProps){ }, ref ) => {
return ( return (
<Checkbox <Checkbox
id={id} id={id}
@@ -29,6 +30,7 @@ export default function MattrixwvCheckbox({
defaultChecked={defaultChecked} defaultChecked={defaultChecked}
onChange={onChange} onChange={onChange}
value={value} value={value}
ref={ref}
> >
<div <div
className={clsx( className={clsx(
@@ -49,6 +51,7 @@ export default function MattrixwvCheckbox({
<svg <svg
viewBox="0 0 14 14" viewBox="0 0 14 14"
fill="none" fill="none"
aria-label="checkbox"
> >
<path <path
d="M3 8L6 11L11 3.5" d="M3 8L6 11L11 3.5"
@@ -68,4 +71,8 @@ export default function MattrixwvCheckbox({
} }
</Checkbox> </Checkbox>
); );
} });
MattrixwvCheckbox.displayName = "MattrixwvCheckbox";
export default MattrixwvCheckbox;

View File

@@ -1,24 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function MoltenCheckbox({ const MoltenCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-orange-600 group-data-checked:stroke-white": box, "group-data-checked:bg-molten group-data-checked:stroke-white": box,
"group-data-checked:stroke-orange-600": !box "group-data-checked:stroke-molten": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
MoltenCheckbox.displayName = "MoltenCheckbox";
export default MoltenCheckbox;

View File

@@ -1,24 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function PrimaryCheckbox({ const PrimaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-blue-600 group-data-checked:stroke-white": box, "group-data-checked:bg-primary group-data-checked:stroke-white": box,
"group-data-checked:stroke-blue-600": !box "group-data-checked:stroke-primary": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
PrimaryCheckbox.displayName = "PrimaryCheckbox";
export default PrimaryCheckbox;

View File

@@ -1,24 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function SecondaryCheckbox({ const SecondaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-neutral-600 group-data-checked:stroke-white": box, "group-data-checked:bg-secondary group-data-checked:stroke-white": box,
"group-data-checked:stroke-neutral-600": !box "group-data-checked:stroke-secondary": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
SecondaryCheckbox.displayName = "SecondaryCheckbox";
export default SecondaryCheckbox;

View File

@@ -1,25 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function SuccessCheckbox({ const SuccessCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-green-600 group-data-checked:stroke-white": box, "group-data-checked:bg-success group-data-checked:stroke-white": box,
"group-data-checked:stroke-green-600": !box "group-data-checked:stroke-success": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
SuccessCheckbox.displayName = "SuccessCheckbox";
export default SuccessCheckbox;

View File

@@ -1,24 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function TertiaryCheckbox({ const TertiaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-purple-600 group-data-checked:stroke-white": box, "group-data-checked:bg-tertiary group-data-checked:stroke-white": box,
"group-data-checked:stroke-purple-600": !box "group-data-checked:stroke-tertiary": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
TertiaryCheckbox.displayName = "TertiaryCheckbox";
export default TertiaryCheckbox;

View File

@@ -1,24 +1,30 @@
import type { CheckboxProps } from "$/types/InputTypes"; import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox"; import MattrixwvCheckbox from "./MattrixwvCheckbox";
export default function WarningCheckbox({ const WarningCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className, className,
box = true, box = true,
...props ...props
}: CheckboxProps){ }, ref) => {
return ( return (
<MattrixwvCheckbox <MattrixwvCheckbox
className={clsx( className={clsx(
className, className,
{ {
"group-data-checked:bg-yellow-500 group-data-checked:stroke-white": box, "group-data-checked:bg-warning group-data-checked:stroke-white": box,
"group-data-checked:stroke-yellow-500": !box "group-data-checked:stroke-warning": !box
} }
)} )}
box={box} box={box}
{...props} {...props}
ref={ref}
/> />
); );
} });
WarningCheckbox.displayName = "WarningCheckbox";
export default WarningCheckbox;

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function DangerRadioButton({ const DangerRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-red-600", "group-data-checked:bg-danger",
className className
)} )}
ref={ref}
{...props} {...props}
/> />
); );
} });
DangerRadioButton.displayName = "DangerRadioButton";
export default DangerRadioButton;

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function DarkRadioButton({ const DarkRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-black", "group-data-checked:bg-dark",
className className
)} )}
{...props} {...props}
ref={ref}
/> />
); );
} });
DarkRadioButton.displayName = "DarkRadioButton";
export default DarkRadioButton;

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function InfoRadioButton({ const InfoRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-cyan-500", "group-data-checked:bg-cyan-500",
className className
)} )}
ref={ref}
{...props} {...props}
/> />
); );
} });
InfoRadioButton.displayName = "InfoRadioButton";
export default InfoRadioButton;

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function LightRadioButton({ const LightRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-white", "group-data-checked:bg-light",
className className
)} )}
ref={ref}
{...props} {...props}
/> />
); );
} });
LightRadioButton.displayName = "LightRadioButton";
export default LightRadioButton;

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function MoltenRadioButton({ const MoltenRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-orange-600", "group-data-checked:bg-molten",
className className
)} )}
ref={ref}
{...props} {...props}
/> />
); );
} });
MoltenRadioButton.displayName = "MoltenRadioButton";
export default MoltenRadioButton;

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function PrimaryRadioButton({ const PrimaryRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-blue-500", "group-data-checked:bg-primary",
className className
)} )}
ref={ref}
{...props} {...props}
/> />
); );
} });
PrimaryRadioButton.displayName = "PrimaryRadioButton";
export default PrimaryRadioButton;

View File

@@ -1,21 +1,23 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import { Radio } from "@headlessui/react"; import { Radio } from "@headlessui/react";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
export default function RadioButton({ const RadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
id, id,
className, className,
labelClassName, labelClassName,
size = "sm", size = "sm",
value, value,
children children
}: RadioButtonProps){ }, ref ) => {
return ( return (
<Radio <Radio
id={id} id={id}
value={value} value={value}
className="group flex flex-row items-center justify-center gap-x-2 cursor-pointer" className="group flex flex-row items-center justify-center gap-x-2 cursor-pointer"
ref={ref}
> >
<div <div
className={clsx( className={clsx(
@@ -41,4 +43,8 @@ export default function RadioButton({
} }
</Radio> </Radio>
); );
} });
RadioButton.displayName = "RadioButton";
export default RadioButton;

View File

@@ -12,7 +12,7 @@ export default function RadioList({
defaultValue, defaultValue,
direction = "horizontal", direction = "horizontal",
children children
}: RadioListProps){ }: Readonly<RadioListProps>){
return ( return (
<RadioGroup <RadioGroup
id={id} id={id}

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function SecondaryRadioButton({ const SecondaryRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-neutral-600", "group-data-checked:bg-secondary",
className className
)} )}
ref={ref}
{...props} {...props}
/> />
); );
} });
SecondaryRadioButton.displayName = "SecondaryRadioButton";
export default SecondaryRadioButton;

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function SuccessRadioButton({ const SuccessRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-green-600", "group-data-checked:bg-green-600",
className className
)} )}
ref={ref}
{...props} {...props}
/> />
); );
} });
SuccessRadioButton.displayName = "SuccessRadioButton";
export default SuccessRadioButton;

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function TertiaryRadioButton({ const TertiaryRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-purple-600", "group-data-checked:bg-tertiary",
className className
)} )}
ref={ref}
{...props} {...props}
/> />
); );
} });
TertiaryRadioButton.displayName = "TertiaryRadioButton";
export default TertiaryRadioButton;

View File

@@ -1,19 +1,25 @@
import type { RadioButtonProps } from "$/types/InputTypes"; import type { RadioButtonProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import RadioButton from "./RadioButton"; import RadioButton from "./RadioButton";
export default function WarningRadioButton({ const WarningRadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
className, className,
...props ...props
}: RadioButtonProps){ }, ref ) => {
return ( return (
<RadioButton <RadioButton
className={clsx( className={clsx(
"group-data-checked:bg-yellow-500", "group-data-checked:bg-warning",
className className
)} )}
ref={ref}
{...props} {...props}
/> />
); );
} });
WarningRadioButton.displayName = "WarningRadioButton";
export default WarningRadioButton;

View File

@@ -1,8 +1,9 @@
import type { MattrixwvButtonSwitchProps } from "$/types/InputTypes"; import type { MattrixwvButtonSwitchProps } from "$/types/InputTypes";
import { Switch } from "@headlessui/react"; import { Switch } from "@headlessui/react";
import { forwardRef } from "react";
export default function ButtonSwitch({ const ButtonSwitch = forwardRef<HTMLButtonElement, MattrixwvButtonSwitchProps>(({
id, id,
className, className,
name, name,
@@ -13,7 +14,7 @@ export default function ButtonSwitch({
disabled, disabled,
onNode, onNode,
offNode offNode
}: MattrixwvButtonSwitchProps){ }, ref ) => {
return ( return (
<Switch <Switch
id={id} id={id}
@@ -24,6 +25,7 @@ export default function ButtonSwitch({
checked={checked} checked={checked}
onChange={onChange} onChange={onChange}
disabled={disabled} disabled={disabled}
ref={ref}
> >
{({ checked }) => ( {({ checked }) => (
<> <>
@@ -32,4 +34,8 @@ export default function ButtonSwitch({
)} )}
</Switch> </Switch>
); );
} });
ButtonSwitch.displayName = "ButtonSwitch";
export default ButtonSwitch;

View File

@@ -1,33 +1,39 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch"; import MattrixwvSwitch from "./MattrixwvSwitch";
export default function DangerSwitch({ const DangerSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className, className,
knobClassName, knobClassName,
disabled, disabled,
...props ...props
}: MattrixwvSwitchProps){ }, ref ) => {
return ( return (
<MattrixwvSwitch <MattrixwvSwitch
{...props} {...props}
className={clsx( className={clsx(
"bg-gray-400", "bg-neutral-mid",
className, className,
{ {
"data-checked:bg-red-600": !disabled, "data-checked:bg-danger": !disabled,
"data-checked:bg-red-400/80": disabled "data-checked:bg-danger-light/80": disabled
} }
)} )}
knobClassName={clsx( knobClassName={clsx(
knobClassName, knobClassName,
{ {
"bg-white": !disabled, "bg-white": !disabled,
"bg-gray-300": disabled "bg-neutral-light": disabled
} }
)} )}
disabled={disabled} disabled={disabled}
ref={ref}
/> />
); );
} });
DangerSwitch.displayName = "DangerSwitch";
export default DangerSwitch;

View File

@@ -1,33 +1,39 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch"; import MattrixwvSwitch from "./MattrixwvSwitch";
export default function DarkSwitch({ const DarkSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className, className,
knobClassName, knobClassName,
disabled, disabled,
...props ...props
}: MattrixwvSwitchProps){ }, ref ) => {
return ( return (
<MattrixwvSwitch <MattrixwvSwitch
{...props} {...props}
className={clsx( className={clsx(
"bg-gray-400", "bg-neutral-mid",
className, className,
{ {
"data-checked:bg-black": !disabled, "data-checked:bg-dark": !disabled,
"data-checked:bg-neutral-800/80": disabled "data-checked:bg-dark-mid/80": disabled
} }
)} )}
knobClassName={clsx( knobClassName={clsx(
knobClassName, knobClassName,
{ {
"bg-white": !disabled, "bg-white": !disabled,
"bg-gray-300": disabled "bg-neutral-light": disabled
} }
)} )}
disabled={disabled} disabled={disabled}
ref={ref}
/> />
); );
} });
DarkSwitch.displayName = "DarkSwitch";
export default DarkSwitch;

View File

@@ -0,0 +1,39 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch";
const InfoSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className,
knobClassName,
disabled,
...props
}, ref ) => {
return (
<MattrixwvSwitch
{...props}
className={clsx(
"bg-gray-400",
className,
{
"data-checked:bg-info": !disabled,
"data-checked:bg-info-light/80": disabled
}
)}
knobClassName={clsx(
knobClassName,
{
"bg-white": !disabled,
"bg-neutral-light": disabled
}
)}
disabled={disabled}
ref={ref}
/>
);
});
InfoSwitch.displayName = "InfoSwitch";
export default InfoSwitch;

View File

@@ -1,33 +1,39 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch"; import MattrixwvSwitch from "./MattrixwvSwitch";
export default function LightSwitch({ const LightSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className, className,
knobClassName, knobClassName,
disabled, disabled,
...props ...props
}: MattrixwvSwitchProps){ }, ref ) => {
return ( return (
<MattrixwvSwitch <MattrixwvSwitch
{...props} {...props}
className={clsx( className={clsx(
"bg-gray-400", "bg-neutral-mid",
className, className,
{ {
"data-checked:bg-white": !disabled, "data-checked:bg-light": !disabled,
"data-checked:bg-neutral-300/80": disabled "data-checked:bg-light/80": disabled
} }
)} )}
knobClassName={clsx( knobClassName={clsx(
knobClassName, knobClassName,
{ {
"bg-black": !disabled, "bg-black": !disabled,
"bg-neutral-800": disabled "bg-neutral-dark": disabled
} }
)} )}
disabled={disabled} disabled={disabled}
ref={ref}
/> />
); );
} });
LightSwitch.displayName = "LightSwitch";
export default LightSwitch;

View File

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

View File

@@ -0,0 +1,39 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch";
const MoltenSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className,
knobClassName,
disabled,
...props
}, ref ) => {
return (
<MattrixwvSwitch
{...props}
className={clsx(
"bg-neutral-mid",
className,
{
"data-checked:bg-molten": !disabled,
"data-checked:bg-molten-light/80": disabled
}
)}
knobClassName={clsx(
knobClassName,
{
"bg-white": !disabled,
"bg-neutral-light": disabled
}
)}
disabled={disabled}
ref={ref}
/>
);
});
MoltenSwitch.displayName = "MoltenSwitch";
export default MoltenSwitch;

View File

@@ -1,33 +1,39 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch"; import MattrixwvSwitch from "./MattrixwvSwitch";
export default function PrimarySwitch({ const PrimarySwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className, className,
knobClassName, knobClassName,
disabled, disabled,
...props ...props
}: MattrixwvSwitchProps){ }, ref ) => {
return ( return (
<MattrixwvSwitch <MattrixwvSwitch
{...props} {...props}
className={clsx( className={clsx(
"bg-gray-400", "bg-neutral-mid",
className, className,
{ {
"data-checked:bg-blue-600": !disabled, "data-checked:bg-primary": !disabled,
"data-checked:bg-blue-400/80": disabled "data-checked:bg-primary-light/80": disabled
} }
)} )}
knobClassName={clsx( knobClassName={clsx(
knobClassName, knobClassName,
{ {
"bg-white": !disabled, "bg-white": !disabled,
"bg-gray-200": disabled "bg-neutral-light": disabled
} }
)} )}
disabled={disabled} disabled={disabled}
ref={ref}
/> />
); );
} });
PrimarySwitch.displayName = "PrimarySwitch";
export default PrimarySwitch;

View File

@@ -1,33 +1,39 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch"; import MattrixwvSwitch from "./MattrixwvSwitch";
export default function SecondarySwitch({ const SecondarySwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className, className,
knobClassName, knobClassName,
disabled, disabled,
...props ...props
}: MattrixwvSwitchProps){ }, ref ) => {
return ( return (
<MattrixwvSwitch <MattrixwvSwitch
{...props} {...props}
className={clsx( className={clsx(
"bg-gray-400", "bg-neutral-mid",
className, className,
{ {
"data-checked:bg-neutral-600": !disabled, "data-checked:bg-secondary": !disabled,
"data-checked:bg-neutral-400/80": disabled "data-checked:bg-secondary-light/80": disabled
} }
)} )}
knobClassName={clsx( knobClassName={clsx(
knobClassName, knobClassName,
{ {
"bg-white": !disabled, "bg-white": !disabled,
"bg-gray-200": disabled "bg-neutral-light": disabled
} }
)} )}
disabled={disabled} disabled={disabled}
ref={ref}
/> />
); );
} });
SecondarySwitch.displayName = "SecondarySwitch";
export default SecondarySwitch;

View File

@@ -1,32 +1,38 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch"; import MattrixwvSwitch from "./MattrixwvSwitch";
export default function SuccessDangerSwitch({ const SuccessDangerSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className, className,
knobClassName, knobClassName,
disabled, disabled,
...props ...props
}: MattrixwvSwitchProps){ }, ref ) => {
return ( return (
<MattrixwvSwitch <MattrixwvSwitch
{...props} {...props}
className={clsx( className={clsx(
className, className,
{ {
"bg-red-600 data-checked:bg-green-600": !disabled, "bg-danger data-checked:bg-success": !disabled,
"bg-red-400/80 data-checked:bg-green-400/80": disabled "bg-danger-light/80 data-checked:bg-success-light/80": disabled
} }
)} )}
knobClassName={clsx( knobClassName={clsx(
knobClassName, knobClassName,
{ {
"bg-white": !disabled, "bg-white": !disabled,
"bg-gray-200": disabled "bg-neutral-light": disabled
} }
)} )}
disabled={disabled} disabled={disabled}
ref={ref}
/> />
); );
} });
SuccessDangerSwitch.displayName = "SuccessDangerSwitch";
export default SuccessDangerSwitch;

View File

@@ -1,33 +1,39 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch"; import MattrixwvSwitch from "./MattrixwvSwitch";
export default function SuccessSwitch({ const SuccessSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className, className,
knobClassName, knobClassName,
disabled, disabled,
...props ...props
}: MattrixwvSwitchProps){ }, ref ) => {
return ( return (
<MattrixwvSwitch <MattrixwvSwitch
{...props} {...props}
className={clsx( className={clsx(
"bg-gray-400", "bg-neutral-mid",
className, className,
{ {
"data-checked:bg-green-600": !disabled, "data-checked:bg-success": !disabled,
"data-checked:bg-green-400/80": disabled "data-checked:bg-success-light/80": disabled
} }
)} )}
knobClassName={clsx( knobClassName={clsx(
knobClassName, knobClassName,
{ {
"bg-white": !disabled, "bg-white": !disabled,
"bg-gray-200": disabled "bg-neutral-light": disabled
} }
)} )}
disabled={disabled} disabled={disabled}
ref={ref}
/> />
); );
} });
SuccessSwitch.displayName = "SuccessSwitch";
export default SuccessSwitch;

View File

@@ -1,14 +1,15 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch"; import MattrixwvSwitch from "./MattrixwvSwitch";
export default function TertiarySwitch({ const TertiarySwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className, className,
knobClassName, knobClassName,
disabled, disabled,
...props ...props
}: MattrixwvSwitchProps){ }, ref ) => {
return ( return (
<MattrixwvSwitch <MattrixwvSwitch
{...props} {...props}
@@ -16,18 +17,23 @@ export default function TertiarySwitch({
"bg-gray-400", "bg-gray-400",
className, className,
{ {
"data-checked:bg-purple-600": !disabled, "data-checked:bg-tertiary": !disabled,
"data-checked:bg-purple-400/80": disabled "data-checked:bg-tertiary-light/80": disabled
} }
)} )}
knobClassName={clsx( knobClassName={clsx(
knobClassName, knobClassName,
{ {
"bg-white": !disabled, "bg-white": !disabled,
"bg-gray-200": disabled "bg-neutral-light": disabled
} }
)} )}
disabled={disabled} disabled={disabled}
ref={ref}
/> />
); );
} });
TertiarySwitch.displayName = "TertiarySwitch";
export default TertiarySwitch;

View File

@@ -1,33 +1,39 @@
import type { MattrixwvSwitchProps } from "$/types/InputTypes"; import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch"; import MattrixwvSwitch from "./MattrixwvSwitch";
export default function WarningSwitch({ const WarningSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className, className,
knobClassName, knobClassName,
disabled, disabled,
...props ...props
}: MattrixwvSwitchProps){ }, ref ) => {
return ( return (
<MattrixwvSwitch <MattrixwvSwitch
{...props} {...props}
className={clsx( className={clsx(
"bg-gray-400", "bg-neutral-mid",
className, className,
{ {
"data-checked:bg-yellow-500": !disabled, "data-checked:bg-warning": !disabled,
"data-checked:bg-yellow-300/80": disabled "data-checked:bg-warning-light/80": disabled
} }
)} )}
knobClassName={clsx( knobClassName={clsx(
knobClassName, knobClassName,
{ {
"bg-white": !disabled, "bg-white": !disabled,
"bg-gray-300": disabled "bg-neutral-light": disabled
} }
)} )}
disabled={disabled} disabled={disabled}
ref={ref}
/> />
); );
} });
WarningSwitch.displayName = "WarningSwitch";
export default WarningSwitch;

View File

@@ -1,23 +1,26 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function DangerMessageBlock(props: MessageBlockProps){ const DangerMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-danger-message-block" data-testid="mattrixwv-danger-message-block"
{...messageProps} {...messageProps}
className={clsx( className={clsx(
className, className,
"bg-red-200 text-red-600" "bg-danger-xlight text-danger-dark"
)} )}
ref={ref}
/> />
); );
} });
DangerMessageBlock.displayName = "DangerMessageBlock";
export default DangerMessageBlock;

View File

@@ -1,23 +1,26 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function DarkMessageBlock(props: MessageBlockProps){ const DarkMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-dark-message-block" data-testid="mattrixwv-dark-message-block"
{...messageProps} {...messageProps}
className={clsx( className={clsx(
className, className,
"bg-black text-white" "bg-dark text-dark-xlight"
)} )}
ref={ref}
/> />
); );
} });
DarkMessageBlock.displayName = "DarkMessageBlock";
export default DarkMessageBlock;

View File

@@ -1,23 +1,26 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function InfoMessageBlock(props: MessageBlockProps){ const InfoMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-info-message-block" data-testid="mattrixwv-info-message-block"
{...messageProps} {...messageProps}
className={clsx( className={clsx(
className, className,
"bg-cyan-100 text-blue-600" "bg-info-xlight text-info-xdark"
)} )}
ref={ref}
/> />
); );
} });
InfoMessageBlock.displayName = "InfoMessageBlock";
export default InfoMessageBlock;

View File

@@ -1,15 +1,13 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function LightMessageBlock(props: MessageBlockProps){ const LightMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-light-message-block" data-testid="mattrixwv-light-message-block"
@@ -18,6 +16,11 @@ export default function LightMessageBlock(props: MessageBlockProps){
className, className,
"bg-white text-black" "bg-white text-black"
)} )}
ref={ref}
/> />
); );
} });
LightMessageBlock.displayName = "LightMessageBlock";
export default LightMessageBlock;

View File

@@ -1,16 +1,14 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
export default function MessageBlock(props: MessageBlockProps){ const MessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, outline = "sm",
outline = "sm", rounded = "lg",
rounded = "lg", ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<div <div
data-testid="mattrixwv-message-block" data-testid="mattrixwv-message-block"
@@ -33,6 +31,11 @@ export default function MessageBlock(props: MessageBlockProps){
"rounded-xl": rounded === "xl" "rounded-xl": rounded === "xl"
} }
)} )}
ref={ref}
/> />
); );
} });
MessageBlock.displayName = "MessageBlock";
export default MessageBlock;

View File

@@ -1,23 +1,26 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function MoltenMessageBlock(props: MessageBlockProps){ const MoltenMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-molten-message-block" data-testid="mattrixwv-molten-message-block"
{...messageProps} {...messageProps}
className={clsx( className={clsx(
className, className,
"bg-orange-100 text-orange-600" "bg-molten-xlight text-molten-mid"
)} )}
ref={ref}
/> />
); );
} });
MoltenMessageBlock.displayName = "MoltenMessageBlock";
export default MoltenMessageBlock;

View File

@@ -1,23 +1,26 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function PrimaryMessageBlock(props: MessageBlockProps){ const PrimaryMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-primary-message-block" data-testid="mattrixwv-primary-message-block"
{...messageProps} {...messageProps}
className={clsx( className={clsx(
className, className,
"bg-blue-200 text-blue-600" "bg-primary-xlight text-primary-dark"
)} )}
ref={ref}
/> />
); );
} });
PrimaryMessageBlock.displayName = "PrimaryMessageBlock";
export default PrimaryMessageBlock;

View File

@@ -1,23 +1,26 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function SecondaryMessageBlock(props: MessageBlockProps){ const SecondaryMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-secondary-message-block" data-testid="mattrixwv-secondary-message-block"
{...messageProps} {...messageProps}
className={clsx( className={clsx(
className, className,
"bg-neutral-200 text-neutral-600" "bg-secondary-xlight text-secondary-mid"
)} )}
ref={ref}
/> />
); );
} });
SecondaryMessageBlock.displayName = "SecondaryMessageBlock";
export default SecondaryMessageBlock;

View File

@@ -1,23 +1,26 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function SuccessMessageBlock(props: MessageBlockProps){ const SuccessMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-success-message-block" data-testid="mattrixwv-success-message-block"
{...messageProps} {...messageProps}
className={clsx( className={clsx(
className, className,
"bg-green-100 text-green-600" "bg-success-xlight text-success-mid"
)} )}
ref={ref}
/> />
); );
} });
SuccessMessageBlock.displayName = "SuccessMessageBlock";
export default SuccessMessageBlock;

View File

@@ -1,24 +1,26 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function TertiaryMessageBlock(props: MessageBlockProps){ const TertiaryMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-tertiary-message-block" data-testid="mattrixwv-tertiary-message-block"
{...messageProps} {...messageProps}
className={clsx( className={clsx(
className, className,
"bg-purple-200 text-purple-600" "bg-tertiary-xlight text-tertiary-mid"
)} )}
ref={ref}
/> />
); );
} });
TertiaryMessageBlock.displayName = "TertiaryMessageBlock";
export default TertiaryMessageBlock;

View File

@@ -1,23 +1,26 @@
import type { MessageBlockProps } from "$/types/MessageTypes"; import type { MessageBlockProps } from "$/types/MessageTypes";
import clsx from "clsx"; import clsx from "clsx";
import { forwardRef } from "react";
import MessageBlock from "./MessageBlock"; import MessageBlock from "./MessageBlock";
export default function WarningMessageBlock(props: MessageBlockProps){ const WarningMessageBlock = forwardRef<HTMLDivElement, MessageBlockProps>(({
const { className,
className, ...messageProps
...messageProps }, ref ) => {
} = props;
return ( return (
<MessageBlock <MessageBlock
data-testid="mattrixwv-warning-message-block" data-testid="mattrixwv-warning-message-block"
{...messageProps} {...messageProps}
className={clsx( className={clsx(
className, className,
"bg-yellow-100 text-yellow-600" "bg-warning-xlight text-warning-dark"
)} )}
ref={ref}
/> />
); );
} });
WarningMessageBlock.displayName = "WarningMessageBlock";
export default WarningMessageBlock;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function DangerProgress(props: ThemedProgressProps){ const DangerProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-gray-300)" backgroundColor="var(--color-neutral)"
progressColor="var(--color-red-600)" progressColor="var(--color-danger)"
{...props} {...props}
ref={ref}
/> />
); );
} });
DangerProgress.displayName = "DangerProgress";
export default DangerProgress;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function DarkProgress(props: ThemedProgressProps){ const DarkProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-white)" backgroundColor="var(--color-neutral)"
progressColor="var(--color-black)" progressColor="var(--color-dark)"
{...props} {...props}
ref={ref}
/> />
); );
} });
DarkProgress.displayName = "DarkProgress";
export default DarkProgress;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function InfoProgress(props: ThemedProgressProps){ const InfoProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-gray-300)" backgroundColor="var(--color-neutral)"
progressColor="var(--color-cyan-500)" progressColor="var(--color-info)"
{...props} {...props}
ref={ref}
/> />
); );
} });
InfoProgress.displayName = "InfoProgress";
export default InfoProgress;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function LightProgress(props: ThemedProgressProps){ const LightProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-black)" backgroundColor="var(--color-dark)"
progressColor="var(--color-white)" progressColor="var(--color-light)"
{...props} {...props}
ref={ref}
/> />
); );
} });
LightProgress.displayName = "LightProgress";
export default LightProgress;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function MoltenProgress(props: ThemedProgressProps){ const MoltenProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-gray-300)" backgroundColor="var(--color-neutral)"
progressColor="var(--color-orange-600)" progressColor="var(--color-molten)"
{...props} {...props}
ref={ref}
/> />
); );
} });
MoltenProgress.displayName = "MoltenProgress";
export default MoltenProgress;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function PrimaryProgress(props: ThemedProgressProps){ const PrimaryProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-gray-300)" backgroundColor="var(--color-neutral)"
progressColor="var(--color-blue-500)" progressColor="var(--color-primary)"
ref={ref}
{...props} {...props}
/> />
); );
} });
PrimaryProgress.displayName = "PrimaryProgress";
export default PrimaryProgress;

View File

@@ -1,9 +1,9 @@
import type { ProgressProps } from "$/types/ProgressTypes"; import type { ProgressProps } from "$/types/ProgressTypes";
import clsx from "clsx"; import clsx from "clsx";
import { useMemo } from "react"; import { forwardRef, useMemo } from "react";
export default function Progress({ const Progress = forwardRef<HTMLDivElement, ProgressProps>(({
id, id,
className, className,
value, value,
@@ -15,7 +15,7 @@ export default function Progress({
tabIndex, tabIndex,
progressColor, progressColor,
backgroundColor backgroundColor
}: ProgressProps){ }, ref ) => {
const percentage = useMemo(() => { const percentage = useMemo(() => {
const num = !value || Number.isNaN(value) ? min : Math.max(value, min); const num = !value || Number.isNaN(value) ? min : Math.max(value, min);
const den = (!value || Number.isNaN(value) ? max : Math.max(value, max)) - min; const den = (!value || Number.isNaN(value) ? max : Math.max(value, max)) - min;
@@ -55,6 +55,7 @@ export default function Progress({
aria-valuenow={value ? Math.round(value * 10000) / 100 : undefined} aria-valuenow={value ? Math.round(value * 10000) / 100 : undefined}
aria-label={label} aria-label={label}
tabIndex={tabIndex ?? 0} tabIndex={tabIndex ?? 0}
ref={ref}
> >
<div <div
className={clsx( className={clsx(
@@ -76,4 +77,8 @@ export default function Progress({
/> />
</div> </div>
); );
} });
Progress.displayName = "Progress";
export default Progress;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function SecondaryProgress(props: ThemedProgressProps){ const SecondaryProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-gray-300)" backgroundColor="var(--color-gray-300)"
progressColor="var(--color-neutral-500)" progressColor="var(--color-neutral-500)"
ref={ref}
{...props} {...props}
/> />
); );
} });
SecondaryProgress.displayName = "SecondaryProgress";
export default SecondaryProgress;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function SuccessProgress(props: ThemedProgressProps){ const SuccessProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-gray-300)" backgroundColor="var(--color-neutral)"
progressColor="var(--color-green-600)" progressColor="var(--color-success)"
{...props} {...props}
ref={ref}
/> />
); );
} });
SuccessProgress.displayName = "SuccessProgress";
export default SuccessProgress;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function TertiaryProgress(props: ThemedProgressProps){ const TertiaryProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-gray-300)" backgroundColor="var(--color-neutral)"
progressColor="var(--color-purple-600)" progressColor="var(--color-tertiary)"
{...props} {...props}
ref={ref}
/> />
); );
} });
TertiaryProgress.displayName = "TertiaryProgress";
export default TertiaryProgress;

View File

@@ -1,13 +1,21 @@
import type { ThemedProgressProps } from "$/types/ProgressTypes"; import type { ThemedProgressProps } from "$/types/ProgressTypes";
import { forwardRef } from "react";
import Progress from "./Progress"; import Progress from "./Progress";
export default function WarningProgress(props: ThemedProgressProps){ const WarningProgress = forwardRef<HTMLDivElement, ThemedProgressProps>(({
...props
}, ref ) => {
return ( return (
<Progress <Progress
backgroundColor="var(--color-gray-300)" backgroundColor="var(--color-neutral)"
progressColor="var(--color-yellow-500)" progressColor="var(--color-warning)"
ref={ref}
{...props} {...props}
/> />
); );
} });
WarningProgress.displayName = "WarningProgress";
export default WarningProgress;

80
lib/styles.css Normal file
View File

@@ -0,0 +1,80 @@
@import "tailwindcss";
@theme {
/* Universal */
--color-neutral-light: oklch(92.8% 0.006 264.531); /* gray-200 */
--color-neutral: oklch(87.2% 0.01 258.338); /* gray-300 */
--color-neutral-mid: oklch(70.7% 0.022 261.325); /* gray-400 */
--color-neutral-dark: oklch(26.9% 0 0); /* gray-800 */
/* Primary */
--color-primary-xlight: oklch(88.2% 0.059 254.128); /* blue-200 */
--color-primary-light: oklch(70.7% 0.165 254.624); /* blue-400 */
--color-primary: oklch(54.6% 0.245 262.881); /* blue-600 */
--color-primary-mid: oklch(48.8% 0.243 264.376); /* blue-700 */
--color-primary-dark: oklch(42.4% 0.199 265.638); /* blue-800 */
/* Secondary */
--color-secondary-xlight: oklch(92.2% 0 0); /* neutral-200 */
--color-secondary-light: oklch(87% 0 0); /* neutral-300 */
--color-secondary: oklch(55.6% 0 0); /* neutral-500 */
--color-secondary-mid: oklch(43.9% 0 0); /* neutral-600 */
--color-secondary-dark: oklch(37.1% 0 0); /* neutral-700 */
/* Tertiary */
--color-tertiary-xlight: oklch(90.2% 0.063 306.703); /* purple-200 */
--color-tertiary-light: oklch(71.4% 0.203 305.504); /* purple-400 */
--color-tertiary: oklch(55.8% 0.288 302.321); /* purple-600 */
--color-tertiary-mid: oklch(49.6% 0.265 301.924); /* purple-700 */
--color-tertiary-dark: oklch(43.8% 0.218 303.724); /* purple-800 */
/* Info */
--color-info-xlight: oklch(95.6% 0.045 203.388); /* cyan-100 */
--color-info-light: oklch(82.8% 0.111 230.318); /* sky-300 */
--color-info: oklch(71.5% 0.143 215.221); /* cyan-500 */
--color-info-mid: oklch(60.9% 0.126 221.723); /* cyan-600 */
--color-info-dark: oklch(52% 0.105 223.128); /* cyan-700 */
--color-info-xdark: oklch(54.6% 0.245 262.881); /* blue-600 */
/* Molten */
--color-molten-xlight: oklch(95.4% 0.038 75.164); /* orange-100 */
--color-molten-light: oklch(75% 0.183 55.934); /* orange-400 */
--color-molten: oklch(64.6% 0.222 41.116); /* orange-600 */
--color-molten-mid: oklch(55.3% 0.195 38.402); /* orange-700 */
--color-molten-dark: oklch(47% 0.157 37.304); /* orange-800 */
/* Success */
--color-success-xlight: oklch(96.2% 0.044 156.743); /* green-100 */
--color-success-light: oklch(79.2% 0.209 151.711); /* green-400 */
--color-success: oklch(62.7% 0.194 149.214); /* green-600 */
--color-success-mid: oklch(52.7% 0.154 150.069); /* green-700 */
--color-success-dark: oklch(44.8% 0.119 151.328); /* green-800 */
/* Warning */
--color-warning-xlight: oklch(97.3% 0.071 103.193); /* yellow-100 */
--color-warning-light: oklch(90.5% 0.182 98.111); /* yellow-300 */
--color-warning: oklch(79.5% 0.184 86.047); /* yellow-500 */
--color-warning-mid: oklch(68.1% 0.162 75.834); /* yellow-600 */
--color-warning-dark: oklch(55.4% 0.135 66.442); /* yellow-700 */
/* Danger */
--color-danger-xlight: oklch(88.5% 0.062 18.334); /* red-200 */
--color-danger-light: oklch(70.4% 0.191 22.216); /* red-400 */
--color-danger: oklch(57.7% 0.245 27.325); /* red-600 */
--color-danger-mid: oklch(50.5% 0.213 27.518); /* red-700 */
--color-danger-dark: oklch(44.4% 0.177 26.899); /* red-800 */
/* Light */
--color-light-xlight: oklch(87% 0 0); /* neutral-300 */
--color-light-light: oklch(70.8% 0 0); /* neutral-400 */
--color-light: oklch(100% 0 0); /* white */
--color-light-mid: oklch(87% 0 0); /* neutral-300 */
--color-light-dark: oklch(70.8% 0 0); /* neutral-400 */
/* Dark */
--color-dark-xlight: oklch(100% 0 0); /* white */
--color-dark-light: oklch(37.1% 0 0); /* neutral-700 */
--color-dark: oklch(0% 0 0); /* black */
--color-dark-mid: oklch(37.1% 0 0); /* neutral-700 */
--color-dark-dark: oklch(43.9% 0 0); /* neutral-600 */
}

View File

@@ -1,6 +1,9 @@
@import "tailwindcss"; @import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *)); @custom-variant dark (&:where(.dark, .dark *));
@import "../lib/styles.css";
@theme { @theme {
--color-neutral-825: oklch(0.253 0 0); --color-neutral-825: oklch(0.253 0 0);
--color-neutral-850: oklch(0.237 0 0); --color-neutral-850: oklch(0.237 0 0);

View File

@@ -29,8 +29,10 @@ import WarningRadioButton from "$/component/input/radio/WarningRadioButton";
import ButtonSwitch from "$/component/input/switch/ButtonSwitch"; import ButtonSwitch from "$/component/input/switch/ButtonSwitch";
import DangerSwitch from "$/component/input/switch/DangerSwitch"; import DangerSwitch from "$/component/input/switch/DangerSwitch";
import DarkSwitch from "$/component/input/switch/DarkSwitch"; import DarkSwitch from "$/component/input/switch/DarkSwitch";
import InfoSwitch from "$/component/input/switch/InfoSwitch";
import LightSwitch from "$/component/input/switch/LightSwitch"; import LightSwitch from "$/component/input/switch/LightSwitch";
import MattrixwvSwitch from "$/component/input/switch/MattrixwvSwitch"; import MattrixwvSwitch from "$/component/input/switch/MattrixwvSwitch";
import MoltenSwitch from "$/component/input/switch/MoltenSwitch";
import PrimarySwitch from "$/component/input/switch/PrimarySwitch"; import PrimarySwitch from "$/component/input/switch/PrimarySwitch";
import SecondarySwitch from "$/component/input/switch/SecondarySwitch"; import SecondarySwitch from "$/component/input/switch/SecondarySwitch";
import SuccessDangerSwitch from "$/component/input/switch/SuccessDangerSwitch"; import SuccessDangerSwitch from "$/component/input/switch/SuccessDangerSwitch";
@@ -206,6 +208,44 @@ export function SwitchContent(){
</TertiarySwitch> </TertiarySwitch>
</div> </div>
</SwitchDisplay> </SwitchDisplay>
<SwitchDisplay title="Info">
{
sizes.map((size) => (
<div
key={size}
className="flex flex-row items-center justify-center gap-x-2"
>
<InfoSwitch
size={size}
defaultChecked={true}
>
{size} Switch
</InfoSwitch>
</div>
))
}
<div
className="flex flex-row items-center justify-center gap-x-2"
>
<InfoSwitch
size="md"
disabled={true}
>
Disabled Switch
</InfoSwitch>
</div>
<div
className="flex flex-row items-center justify-center gap-x-2"
>
<InfoSwitch
size="md"
disabled={true}
checked={true}
>
Disabled Switch
</InfoSwitch>
</div>
</SwitchDisplay>
<SwitchDisplay title="Success"> <SwitchDisplay title="Success">
{ {
sizes.map((size) => ( sizes.map((size) => (
@@ -320,6 +360,44 @@ export function SwitchContent(){
</DangerSwitch> </DangerSwitch>
</div> </div>
</SwitchDisplay> </SwitchDisplay>
<SwitchDisplay title="Molten">
{
sizes.map((size) => (
<div
key={size}
className="flex flex-row items-center justify-center gap-x-2"
>
<MoltenSwitch
size={size}
defaultChecked={true}
>
{size} Switch
</MoltenSwitch>
</div>
))
}
<div
className="flex flex-row items-center justify-center gap-x-2"
>
<MoltenSwitch
size="md"
disabled={true}
>
Disabled Switch
</MoltenSwitch>
</div>
<div
className="flex flex-row items-center justify-center gap-x-2"
>
<MoltenSwitch
size="md"
disabled={true}
checked={true}
>
Disabled Switch
</MoltenSwitch>
</div>
</SwitchDisplay>
<SwitchDisplay title="Dark"> <SwitchDisplay title="Dark">
{ {
sizes.map((size) => ( sizes.map((size) => (

View File

@@ -21,8 +21,8 @@ describe("DangerButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-red-600", "hover:bg-red-700", "active:bg-red-800"); expect(button).toHaveClass("bg-danger", "active:bg-danger-dark");
expect(button).toHaveClass("border-red-600", "hover:border-red-700", "active:border-red-800"); expect(button).toHaveClass("border-danger", "active:border-danger-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
@@ -173,8 +173,8 @@ describe("DangerButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-red-400/80"); expect(button).toHaveClass("bg-danger-light/80");
expect(button).toHaveClass("border-red-400/80"); expect(button).toHaveClass("border-danger-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
@@ -215,8 +215,8 @@ describe("DangerButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-danger-button"); const button = screen.getByTestId("mattrixwv-danger-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-red-600", "hover:bg-red-700", "active:bg-red-800"); expect(button).toHaveClass("bg-danger", "active:bg-danger-dark");
expect(button).toHaveClass("border", "border-red-600", "hover:border-red-700", "active:border-red-800"); expect(button).toHaveClass("border", "border-danger", "active:border-danger-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
@@ -225,26 +225,26 @@ describe("DangerButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-danger-button"); const button = screen.getByTestId("mattrixwv-danger-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-red-600", "hover:border-red-700", "active:border-red-800"); expect(button).toHaveClass("border", "border-danger", "active:border-danger-dark");
expect(button).toHaveClass("text-red-600", "hover:text-red-700", "active:text-red-800"); expect(button).toHaveClass("text-danger", "active:text-danger-dark");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<DangerButton variant="outline-ghost">{buttonText}</DangerButton>); render(<DangerButton variant="outline-ghost">{buttonText}</DangerButton>);
const button = screen.getByTestId("mattrixwv-danger-button"); const button = screen.getByTestId("mattrixwv-danger-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-red-600", "active:bg-red-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-danger", "active:bg-danger-dark");
expect(button).toHaveClass("border", "border-red-600", "hover:border-red-600", "active:border-red-700"); expect(button).toHaveClass("border", "border-danger", "active:border-danger-dark");
expect(button).toHaveClass("text-red-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-danger", "hover:text-white", "active:text-white");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<DangerButton variant="ghost">{buttonText}</DangerButton>); render(<DangerButton variant="ghost">{buttonText}</DangerButton>);
const button = screen.getByTestId("mattrixwv-danger-button"); const button = screen.getByTestId("mattrixwv-danger-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-red-600", "active:bg-red-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-danger", "active:bg-danger-dark");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-red-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-danger", "hover:text-white", "active:text-white");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<DangerButton variant="icon">{buttonText}</DangerButton>); render(<DangerButton variant="icon">{buttonText}</DangerButton>);
@@ -253,7 +253,7 @@ describe("DangerButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-red-600", "hover:text-red-700", "active:text-red-800"); expect(button).toHaveClass("text-danger", "active:text-danger-dark");
}); });
}); });
@@ -263,8 +263,8 @@ describe("DangerButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-danger-button"); const button = screen.getByTestId("mattrixwv-danger-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-red-400/80"); expect(button).toHaveClass("bg-danger-light/80");
expect(button).toHaveClass("border", "border-red-400/80"); expect(button).toHaveClass("border", "border-danger-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
@@ -273,8 +273,8 @@ describe("DangerButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-danger-button"); const button = screen.getByTestId("mattrixwv-danger-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-red-400/80"); expect(button).toHaveClass("border", "border-danger-light/80");
expect(button).toHaveClass("text-red-400/80"); expect(button).toHaveClass("text-danger-light/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<DangerButton variant="outline-ghost" disabled>{buttonText}</DangerButton>); render(<DangerButton variant="outline-ghost" disabled>{buttonText}</DangerButton>);
@@ -282,8 +282,8 @@ describe("DangerButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-danger-button"); const button = screen.getByTestId("mattrixwv-danger-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-red-400/80"); expect(button).toHaveClass("border", "border-danger-light/80");
expect(button).toHaveClass("text-red-400/80"); expect(button).toHaveClass("text-danger-light/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<DangerButton variant="ghost" disabled>{buttonText}</DangerButton>); render(<DangerButton variant="ghost" disabled>{buttonText}</DangerButton>);
@@ -292,7 +292,7 @@ describe("DangerButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-red-400/80"); expect(button).toHaveClass("text-danger-light/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<DangerButton variant="icon" disabled>{buttonText}</DangerButton>); render(<DangerButton variant="icon" disabled>{buttonText}</DangerButton>);
@@ -301,6 +301,6 @@ describe("DangerButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-red-400/80"); expect(button).toHaveClass("text-danger-light/80");
}); });
}); });

View File

@@ -21,8 +21,8 @@ describe("DarkButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-black", "hover:bg-neutral-700", "active:bg-neutral-600"); expect(button).toHaveClass("bg-dark", "active:bg-dark-mid");
expect(button).toHaveClass("border-black", "hover:border-neutral-700", "active:border-neutral-600"); expect(button).toHaveClass("border-dark", "active:border-dark-mid");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
@@ -178,8 +178,8 @@ describe("DarkButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-neutral-700/80"); expect(button).toHaveClass("bg-dark-mid/80");
expect(button).toHaveClass("border-neutral-700/80"); expect(button).toHaveClass("border-dark-mid/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
@@ -220,8 +220,8 @@ describe("DarkButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-dark-button"); const button = screen.getByTestId("mattrixwv-dark-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-black", "hover:bg-neutral-700", "active:bg-neutral-600"); expect(button).toHaveClass("bg-dark", "active:bg-dark-mid");
expect(button).toHaveClass("border", "border-black", "hover:border-neutral-700", "active:border-neutral-600"); expect(button).toHaveClass("border", "border-dark", "active:border-dark-mid");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
@@ -230,26 +230,26 @@ describe("DarkButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-dark-button"); const button = screen.getByTestId("mattrixwv-dark-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-black", "hover:border-neutral-700", "active:border-neutral-600"); expect(button).toHaveClass("border", "border-dark", "active:border-dark-mid");
expect(button).toHaveClass("text-black", "hover:text-neutral-700", "active:text-neutral-600"); expect(button).toHaveClass("text-dark", "active:text-dark-mid");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<DarkButton variant="outline-ghost">{buttonText}</DarkButton>); render(<DarkButton variant="outline-ghost">{buttonText}</DarkButton>);
const button = screen.getByTestId("mattrixwv-dark-button"); const button = screen.getByTestId("mattrixwv-dark-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-black", "active:bg-neutral-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-dark", "active:bg-dark-mid");
expect(button).toHaveClass("border", "border-black", "hover:border-black", "active:border-neutral-700"); expect(button).toHaveClass("border", "border-dark", "active:border-dark-mid");
expect(button).toHaveClass("text-black", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-dark", "hover:text-white", "active:text-white");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<DarkButton variant="ghost">{buttonText}</DarkButton>); render(<DarkButton variant="ghost">{buttonText}</DarkButton>);
const button = screen.getByTestId("mattrixwv-dark-button"); const button = screen.getByTestId("mattrixwv-dark-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-black", "active:bg-neutral-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-dark", "active:bg-dark-mid");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-black", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-dark", "hover:text-white", "active:text-white");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<DarkButton variant="icon">{buttonText}</DarkButton>); render(<DarkButton variant="icon">{buttonText}</DarkButton>);
@@ -258,7 +258,7 @@ describe("DarkButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-black", "hover:text-neutral-700", "active:text-neutral-600"); expect(button).toHaveClass("text-dark", "active:text-dark-mid");
}); });
}); });
@@ -268,8 +268,8 @@ describe("DarkButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-dark-button"); const button = screen.getByTestId("mattrixwv-dark-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-neutral-700/80"); expect(button).toHaveClass("bg-dark-mid/80");
expect(button).toHaveClass("border", "border-neutral-700/80"); expect(button).toHaveClass("border", "border-dark-mid/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
@@ -278,8 +278,8 @@ describe("DarkButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-dark-button"); const button = screen.getByTestId("mattrixwv-dark-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-neutral-700/80"); expect(button).toHaveClass("border", "border-dark-mid/80");
expect(button).toHaveClass("text-neutral-700/80"); expect(button).toHaveClass("text-dark-mid/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<DarkButton variant="outline-ghost" disabled>{buttonText}</DarkButton>); render(<DarkButton variant="outline-ghost" disabled>{buttonText}</DarkButton>);
@@ -287,8 +287,8 @@ describe("DarkButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-dark-button"); const button = screen.getByTestId("mattrixwv-dark-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-neutral-700/80"); expect(button).toHaveClass("border", "border-dark-mid/80");
expect(button).toHaveClass("text-neutral-700/80"); expect(button).toHaveClass("text-dark-mid/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<DarkButton variant="ghost" disabled>{buttonText}</DarkButton>); render(<DarkButton variant="ghost" disabled>{buttonText}</DarkButton>);
@@ -297,7 +297,7 @@ describe("DarkButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-neutral-700/80"); expect(button).toHaveClass("text-dark-mid/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<DarkButton variant="icon" disabled>{buttonText}</DarkButton>); render(<DarkButton variant="icon" disabled>{buttonText}</DarkButton>);
@@ -306,6 +306,6 @@ describe("DarkButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-neutral-700/80"); expect(button).toHaveClass("text-dark-mid/80");
}); });
}); });

View File

@@ -21,8 +21,8 @@ describe("InfoButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-cyan-500", "hover:bg-cyan-600", "active:bg-cyan-700"); expect(button).toHaveClass("bg-info", "active:bg-info-dark");
expect(button).toHaveClass("border-cyan-500", "hover:border-cyan-600", "active:border-cyan-700"); expect(button).toHaveClass("border-info", "active:border-info-dark");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
@@ -178,8 +178,8 @@ describe("InfoButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-sky-300/80"); expect(button).toHaveClass("bg-info-light/80");
expect(button).toHaveClass("border-sky-300/80"); expect(button).toHaveClass("border-info-light/80");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
@@ -220,8 +220,8 @@ describe("InfoButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-info-button"); const button = screen.getByTestId("mattrixwv-info-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-cyan-500", "hover:bg-cyan-600", "active:bg-cyan-700"); expect(button).toHaveClass("bg-info", "active:bg-info-dark");
expect(button).toHaveClass("border", "border-cyan-500", "hover:border-cyan-600", "active:border-cyan-700"); expect(button).toHaveClass("border", "border-info", "active:border-info-dark");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
@@ -230,26 +230,26 @@ describe("InfoButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-info-button"); const button = screen.getByTestId("mattrixwv-info-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-cyan-500", "hover:border-cyan-600", "active:border-cyan-700"); expect(button).toHaveClass("border", "border-info", "active:border-info-dark");
expect(button).toHaveClass("text-cyan-500", "hover:text-cyan-600", "active:text-cyan-700"); expect(button).toHaveClass("text-info", "active:text-info-dark");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<InfoButton variant="outline-ghost">{buttonText}</InfoButton>); render(<InfoButton variant="outline-ghost">{buttonText}</InfoButton>);
const button = screen.getByTestId("mattrixwv-info-button"); const button = screen.getByTestId("mattrixwv-info-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-cyan-500", "active:bg-cyan-600"); expect(button).toHaveClass("bg-transparent", "hover:bg-info", "active:bg-info-dark");
expect(button).toHaveClass("border", "border-cyan-500", "hover:border-cyan-500", "active:border-cyan-600"); expect(button).toHaveClass("border", "border-info", "active:border-info-dark");
expect(button).toHaveClass("text-cyan-500", "hover:text-black", "active:text-black"); expect(button).toHaveClass("text-info", "hover:text-black", "active:text-black");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<InfoButton variant="ghost">{buttonText}</InfoButton>); render(<InfoButton variant="ghost">{buttonText}</InfoButton>);
const button = screen.getByTestId("mattrixwv-info-button"); const button = screen.getByTestId("mattrixwv-info-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-cyan-500", "active:bg-cyan-600"); expect(button).toHaveClass("bg-transparent", "hover:bg-info", "active:bg-info-dark");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-cyan-500", "hover:text-black", "active:text-black"); expect(button).toHaveClass("text-info", "hover:text-black", "active:text-black");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<InfoButton variant="icon">{buttonText}</InfoButton>); render(<InfoButton variant="icon">{buttonText}</InfoButton>);
@@ -258,7 +258,7 @@ describe("InfoButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-cyan-500", "hover:text-cyan-600", "active:text-cyan-700"); expect(button).toHaveClass("text-info", "active:text-info-dark");
}); });
}); });
@@ -268,8 +268,8 @@ describe("InfoButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-info-button"); const button = screen.getByTestId("mattrixwv-info-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-sky-300/80"); expect(button).toHaveClass("bg-info-light/80");
expect(button).toHaveClass("border", "border-sky-300/80"); expect(button).toHaveClass("border", "border-info-light/80");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
@@ -278,8 +278,8 @@ describe("InfoButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-info-button"); const button = screen.getByTestId("mattrixwv-info-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-sky-300/80"); expect(button).toHaveClass("border", "border-info-light/80");
expect(button).toHaveClass("text-sky-300/80"); expect(button).toHaveClass("text-info-light/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<InfoButton variant="outline-ghost" disabled>{buttonText}</InfoButton>); render(<InfoButton variant="outline-ghost" disabled>{buttonText}</InfoButton>);
@@ -287,8 +287,8 @@ describe("InfoButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-info-button"); const button = screen.getByTestId("mattrixwv-info-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-sky-300/80"); expect(button).toHaveClass("border", "border-info-light/80");
expect(button).toHaveClass("text-sky-300/80"); expect(button).toHaveClass("text-info-light/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<InfoButton variant="ghost" disabled>{buttonText}</InfoButton>); render(<InfoButton variant="ghost" disabled>{buttonText}</InfoButton>);
@@ -297,7 +297,7 @@ describe("InfoButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-sky-300/80"); expect(button).toHaveClass("text-info-light/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<InfoButton variant="icon" disabled>{buttonText}</InfoButton>); render(<InfoButton variant="icon" disabled>{buttonText}</InfoButton>);
@@ -306,6 +306,6 @@ describe("InfoButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-sky-300/80"); expect(button).toHaveClass("text-info-light/80");
}); });
}); });

View File

@@ -21,8 +21,8 @@ describe("LightButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-white", "hover:bg-neutral-300", "active:bg-neutral-400"); expect(button).toHaveClass("bg-light", "active:bg-light-dark");
expect(button).toHaveClass("border-white", "hover:border-neutral-300", "active:border-neutral-400"); expect(button).toHaveClass("border-light", "active:border-light-dark");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
@@ -178,8 +178,8 @@ describe("LightButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-neutral-400/80"); expect(button).toHaveClass("bg-light-light/80");
expect(button).toHaveClass("border-neutral-400/80"); expect(button).toHaveClass("border-light-light/80");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
@@ -220,8 +220,8 @@ describe("LightButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-light-button"); const button = screen.getByTestId("mattrixwv-light-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-white", "hover:bg-neutral-300", "active:bg-neutral-400"); expect(button).toHaveClass("bg-light", "active:bg-light-dark");
expect(button).toHaveClass("border", "border-white", "hover:border-neutral-300", "active:border-neutral-400"); expect(button).toHaveClass("border", "border-light", "active:border-light-dark");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
@@ -230,26 +230,26 @@ describe("LightButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-light-button"); const button = screen.getByTestId("mattrixwv-light-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-white", "hover:border-neutral-300", "active:border-neutral-400"); expect(button).toHaveClass("border", "border-light", "active:border-light-dark");
expect(button).toHaveClass("text-white", "hover:text-neutral-300", "active:text-neutral-400"); expect(button).toHaveClass("text-light", "active:text-light-dark");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<LightButton variant="outline-ghost">{buttonText}</LightButton>); render(<LightButton variant="outline-ghost">{buttonText}</LightButton>);
const button = screen.getByTestId("mattrixwv-light-button"); const button = screen.getByTestId("mattrixwv-light-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-white", "active:bg-neutral-300"); expect(button).toHaveClass("bg-transparent", "hover:bg-light", "active:bg-light-dark");
expect(button).toHaveClass("border", "border-white", "hover:border-white", "active:border-neutral-300"); expect(button).toHaveClass("border", "border-light", "active:border-light-dark");
expect(button).toHaveClass("text-white", "hover:text-black", "active:text-black"); expect(button).toHaveClass("text-light", "hover:text-black", "active:text-black");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<LightButton variant="ghost">{buttonText}</LightButton>); render(<LightButton variant="ghost">{buttonText}</LightButton>);
const button = screen.getByTestId("mattrixwv-light-button"); const button = screen.getByTestId("mattrixwv-light-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-white", "active:bg-neutral-300"); expect(button).toHaveClass("bg-transparent", "hover:bg-light", "active:bg-light-dark");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-white", "hover:text-black", "active:text-black"); expect(button).toHaveClass("text-light", "hover:text-black", "active:text-black");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<LightButton variant="icon">{buttonText}</LightButton>); render(<LightButton variant="icon">{buttonText}</LightButton>);
@@ -258,7 +258,7 @@ describe("LightButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-white", "hover:text-neutral-300", "active:text-neutral-400"); expect(button).toHaveClass("text-light", "active:text-light-dark");
}); });
}); });
@@ -268,8 +268,8 @@ describe("LightButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-light-button"); const button = screen.getByTestId("mattrixwv-light-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-neutral-400/80"); expect(button).toHaveClass("bg-light-light/80");
expect(button).toHaveClass("border", "border-neutral-400/80"); expect(button).toHaveClass("border", "border-light-light/80");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
@@ -278,8 +278,8 @@ describe("LightButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-light-button"); const button = screen.getByTestId("mattrixwv-light-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-neutral-400/80"); expect(button).toHaveClass("border", "border-light-light/80");
expect(button).toHaveClass("text-neutral-400/80"); expect(button).toHaveClass("text-light-light/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<LightButton variant="outline-ghost" disabled>{buttonText}</LightButton>); render(<LightButton variant="outline-ghost" disabled>{buttonText}</LightButton>);
@@ -287,8 +287,8 @@ describe("LightButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-light-button"); const button = screen.getByTestId("mattrixwv-light-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-neutral-400/80"); expect(button).toHaveClass("border", "border-light-light/80");
expect(button).toHaveClass("text-neutral-400/80"); expect(button).toHaveClass("text-light-light/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<LightButton variant="ghost" disabled>{buttonText}</LightButton>); render(<LightButton variant="ghost" disabled>{buttonText}</LightButton>);
@@ -297,7 +297,7 @@ describe("LightButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-neutral-400/80"); expect(button).toHaveClass("text-light-light/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<LightButton variant="icon" disabled>{buttonText}</LightButton>); render(<LightButton variant="icon" disabled>{buttonText}</LightButton>);
@@ -306,6 +306,6 @@ describe("LightButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-neutral-400/80"); expect(button).toHaveClass("text-light-light/80");
}); });
}); });

View File

@@ -21,9 +21,9 @@ describe("MoltenButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-orange-600", "hover:bg-orange-700", "active:bg-orange-800"); expect(button).toHaveClass("bg-molten", "active:bg-molten-dark");
expect(button).toHaveClass("border-orange-600", "hover:border-orange-700", "active:border-orange-800"); expect(button).toHaveClass("border-molten", "active:border-molten-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-black");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
@@ -178,9 +178,9 @@ describe("MoltenButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-orange-400/80"); expect(button).toHaveClass("bg-molten-light/80");
expect(button).toHaveClass("border-orange-400/80"); expect(button).toHaveClass("border-molten-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-black");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
const customClass = "custom-molten-button-class"; const customClass = "custom-molten-button-class";
@@ -220,9 +220,9 @@ describe("MoltenButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-molten-button"); const button = screen.getByTestId("mattrixwv-molten-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-orange-600", "hover:bg-orange-700", "active:bg-orange-800"); expect(button).toHaveClass("bg-molten", "active:bg-molten-dark");
expect(button).toHaveClass("border", "border-orange-600", "hover:border-orange-700", "active:border-orange-800"); expect(button).toHaveClass("border", "border-molten", "active:border-molten-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
render(<MoltenButton variant="outline">{buttonText}</MoltenButton>); render(<MoltenButton variant="outline">{buttonText}</MoltenButton>);
@@ -230,26 +230,26 @@ describe("MoltenButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-molten-button"); const button = screen.getByTestId("mattrixwv-molten-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-orange-600", "hover:border-orange-700", "active:border-orange-800"); expect(button).toHaveClass("border", "border-molten", "active:border-molten-dark");
expect(button).toHaveClass("text-orange-600", "hover:text-orange-700", "active:text-orange-800"); expect(button).toHaveClass("text-molten", "active:text-molten-dark");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<MoltenButton variant="outline-ghost">{buttonText}</MoltenButton>); render(<MoltenButton variant="outline-ghost">{buttonText}</MoltenButton>);
const button = screen.getByTestId("mattrixwv-molten-button"); const button = screen.getByTestId("mattrixwv-molten-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-orange-600", "active:bg-orange-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-molten", "active:bg-molten-dark");
expect(button).toHaveClass("border", "border-orange-600", "hover:border-orange-600", "active:border-orange-700"); expect(button).toHaveClass("border", "border-molten", "active:border-molten-dark");
expect(button).toHaveClass("text-orange-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-molten", "hover:text-black", "active:text-black");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<MoltenButton variant="ghost">{buttonText}</MoltenButton>); render(<MoltenButton variant="ghost">{buttonText}</MoltenButton>);
const button = screen.getByTestId("mattrixwv-molten-button"); const button = screen.getByTestId("mattrixwv-molten-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-orange-600", "active:bg-orange-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-molten", "active:bg-molten-dark");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-orange-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-molten", "hover:text-black", "active:text-black");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<MoltenButton variant="icon">{buttonText}</MoltenButton>); render(<MoltenButton variant="icon">{buttonText}</MoltenButton>);
@@ -258,7 +258,7 @@ describe("MoltenButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-orange-600", "hover:text-orange-700", "active:text-orange-800"); expect(button).toHaveClass("text-molten", "active:text-molten-dark");
}); });
}); });
@@ -268,9 +268,9 @@ describe("MoltenButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-molten-button"); const button = screen.getByTestId("mattrixwv-molten-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-orange-400/80"); expect(button).toHaveClass("bg-molten-light/80");
expect(button).toHaveClass("border", "border-orange-400/80"); expect(button).toHaveClass("border", "border-molten-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
render(<MoltenButton variant="outline" disabled>{buttonText}</MoltenButton>); render(<MoltenButton variant="outline" disabled>{buttonText}</MoltenButton>);
@@ -278,8 +278,8 @@ describe("MoltenButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-molten-button"); const button = screen.getByTestId("mattrixwv-molten-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-orange-400/80"); expect(button).toHaveClass("border", "border-molten-light/80");
expect(button).toHaveClass("text-orange-400/80"); expect(button).toHaveClass("text-molten-light/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<MoltenButton variant="outline-ghost" disabled>{buttonText}</MoltenButton>); render(<MoltenButton variant="outline-ghost" disabled>{buttonText}</MoltenButton>);
@@ -287,8 +287,8 @@ describe("MoltenButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-molten-button"); const button = screen.getByTestId("mattrixwv-molten-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-orange-400/80"); expect(button).toHaveClass("border", "border-molten-light/80");
expect(button).toHaveClass("text-orange-400/80"); expect(button).toHaveClass("text-molten-light/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<MoltenButton variant="ghost" disabled>{buttonText}</MoltenButton>); render(<MoltenButton variant="ghost" disabled>{buttonText}</MoltenButton>);
@@ -297,7 +297,7 @@ describe("MoltenButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-orange-400/80"); expect(button).toHaveClass("text-molten-light/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<MoltenButton variant="icon" disabled>{buttonText}</MoltenButton>); render(<MoltenButton variant="icon" disabled>{buttonText}</MoltenButton>);
@@ -306,6 +306,6 @@ describe("MoltenButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-orange-400/80"); expect(button).toHaveClass("text-molten-light/80");
}); });
}); });

View File

@@ -21,8 +21,8 @@ describe("PrimaryButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-blue-600", "hover:bg-blue-700", "active:bg-blue-800"); expect(button).toHaveClass("bg-primary", "active:bg-primary-dark");
expect(button).toHaveClass("border-blue-600", "hover:border-blue-700", "active:border-blue-800"); expect(button).toHaveClass("border-primary", "active:border-primary-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
@@ -178,8 +178,8 @@ describe("PrimaryButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-blue-400/80"); expect(button).toHaveClass("bg-primary-light/80");
expect(button).toHaveClass("border-blue-400/80"); expect(button).toHaveClass("border-primary-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
@@ -220,8 +220,8 @@ describe("PrimaryButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-primary-button"); const button = screen.getByTestId("mattrixwv-primary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-blue-600", "hover:bg-blue-700", "active:bg-blue-800"); expect(button).toHaveClass("bg-primary", "active:bg-primary-dark");
expect(button).toHaveClass("border", "border-blue-600", "hover:border-blue-700", "active:border-blue-800"); expect(button).toHaveClass("border", "border-primary", "active:border-primary-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
@@ -230,26 +230,26 @@ describe("PrimaryButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-primary-button"); const button = screen.getByTestId("mattrixwv-primary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-blue-600", "hover:border-blue-700", "active:border-blue-800"); expect(button).toHaveClass("border", "border-primary", "active:border-primary-dark");
expect(button).toHaveClass("text-blue-600", "hover:text-blue-700", "active:text-blue-800"); expect(button).toHaveClass("text-primary", "active:text-primary-dark");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<PrimaryButton variant="outline-ghost">{buttonText}</PrimaryButton>); render(<PrimaryButton variant="outline-ghost">{buttonText}</PrimaryButton>);
const button = screen.getByTestId("mattrixwv-primary-button"); const button = screen.getByTestId("mattrixwv-primary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-blue-600", "active:bg-blue-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-primary", "active:bg-primary-dark");
expect(button).toHaveClass("border", "border-blue-600", "hover:border-blue-600", "active:border-blue-700"); expect(button).toHaveClass("border", "border-primary", "active:border-primary-dark");
expect(button).toHaveClass("text-blue-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-primary", "hover:text-white", "active:text-white");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<PrimaryButton variant="ghost">{buttonText}</PrimaryButton>); render(<PrimaryButton variant="ghost">{buttonText}</PrimaryButton>);
const button = screen.getByTestId("mattrixwv-primary-button"); const button = screen.getByTestId("mattrixwv-primary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-blue-600", "active:bg-blue-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-primary", "active:bg-primary-dark");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-blue-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-primary", "hover:text-white", "active:text-white");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<PrimaryButton variant="icon">{buttonText}</PrimaryButton>); render(<PrimaryButton variant="icon">{buttonText}</PrimaryButton>);
@@ -258,7 +258,7 @@ describe("PrimaryButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-blue-600", "hover:text-blue-700", "active:text-blue-800"); expect(button).toHaveClass("text-primary", "active:text-primary-dark");
}); });
}); });
@@ -268,8 +268,8 @@ describe("PrimaryButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-primary-button"); const button = screen.getByTestId("mattrixwv-primary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-blue-400/80"); expect(button).toHaveClass("bg-primary-light/80");
expect(button).toHaveClass("border", "border-blue-400/80"); expect(button).toHaveClass("border", "border-primary-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
@@ -278,8 +278,8 @@ describe("PrimaryButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-primary-button"); const button = screen.getByTestId("mattrixwv-primary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-blue-400/80"); expect(button).toHaveClass("border", "border-primary-light/80");
expect(button).toHaveClass("text-blue-400/80"); expect(button).toHaveClass("text-primary-light/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<PrimaryButton variant="outline-ghost" disabled>{buttonText}</PrimaryButton>); render(<PrimaryButton variant="outline-ghost" disabled>{buttonText}</PrimaryButton>);
@@ -287,8 +287,8 @@ describe("PrimaryButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-primary-button"); const button = screen.getByTestId("mattrixwv-primary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-blue-400/80"); expect(button).toHaveClass("border", "border-primary-light/80");
expect(button).toHaveClass("text-blue-400/80"); expect(button).toHaveClass("text-primary-light/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<PrimaryButton variant="ghost" disabled>{buttonText}</PrimaryButton>); render(<PrimaryButton variant="ghost" disabled>{buttonText}</PrimaryButton>);
@@ -297,7 +297,7 @@ describe("PrimaryButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-blue-400/80"); expect(button).toHaveClass("text-primary-light/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<PrimaryButton variant="icon" disabled>{buttonText}</PrimaryButton>); render(<PrimaryButton variant="icon" disabled>{buttonText}</PrimaryButton>);
@@ -306,6 +306,6 @@ describe("PrimaryButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-blue-400/80"); expect(button).toHaveClass("text-primary-light/80");
}); });
}); });

View File

@@ -21,8 +21,8 @@ describe("SecondaryButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-neutral-500", "hover:bg-neutral-600", "active:bg-neutral-700"); expect(button).toHaveClass("bg-secondary", "active:bg-secondary-dark");
expect(button).toHaveClass("border-neutral-500", "hover:border-neutral-600", "active:border-neutral-700"); expect(button).toHaveClass("border-secondary", "active:border-secondary-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
@@ -177,8 +177,8 @@ describe("SecondaryButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-neutral-300/80"); expect(button).toHaveClass("bg-secondary-light/80");
expect(button).toHaveClass("border-neutral-300/80"); expect(button).toHaveClass("border-secondary-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
@@ -218,8 +218,8 @@ describe("SecondaryButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-secondary-button"); const button = screen.getByTestId("mattrixwv-secondary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-neutral-500", "hover:bg-neutral-600", "active:bg-neutral-700"); expect(button).toHaveClass("bg-secondary", "active:bg-secondary-dark");
expect(button).toHaveClass("border", "border-neutral-500", "hover:border-neutral-600", "active:border-neutral-700"); expect(button).toHaveClass("border", "border-secondary", "active:border-secondary-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
@@ -228,26 +228,26 @@ describe("SecondaryButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-secondary-button"); const button = screen.getByTestId("mattrixwv-secondary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-neutral-500", "hover:border-neutral-600", "active:border-neutral-700"); expect(button).toHaveClass("border", "border-secondary", "active:border-secondary-dark");
expect(button).toHaveClass("text-neutral-500", "hover:text-neutral-600", "active:text-neutral-700"); expect(button).toHaveClass("text-secondary", "active:text-secondary-dark");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<SecondaryButton variant="outline-ghost">{buttonText}</SecondaryButton>); render(<SecondaryButton variant="outline-ghost">{buttonText}</SecondaryButton>);
const button = screen.getByTestId("mattrixwv-secondary-button"); const button = screen.getByTestId("mattrixwv-secondary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-neutral-500", "active:bg-neutral-600"); expect(button).toHaveClass("bg-transparent", "hover:bg-secondary", "active:bg-secondary-dark");
expect(button).toHaveClass("border", "border-neutral-500", "hover:border-neutral-500", "active:border-neutral-600"); expect(button).toHaveClass("border", "border-secondary", "active:border-secondary-dark");
expect(button).toHaveClass("text-neutral-500", "hover:text-black", "active:text-black"); expect(button).toHaveClass("text-secondary", "hover:text-white", "active:text-white");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<SecondaryButton variant="ghost">{buttonText}</SecondaryButton>); render(<SecondaryButton variant="ghost">{buttonText}</SecondaryButton>);
const button = screen.getByTestId("mattrixwv-secondary-button"); const button = screen.getByTestId("mattrixwv-secondary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-neutral-500", "active:bg-neutral-600"); expect(button).toHaveClass("bg-transparent", "hover:bg-secondary", "active:bg-secondary-dark");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-neutral-500", "hover:text-black", "active:text-black"); expect(button).toHaveClass("text-secondary", "hover:text-white", "active:text-white");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<SecondaryButton variant="icon">{buttonText}</SecondaryButton>); render(<SecondaryButton variant="icon">{buttonText}</SecondaryButton>);
@@ -256,7 +256,7 @@ describe("SecondaryButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-neutral-500", "hover:text-neutral-600", "active:text-neutral-700"); expect(button).toHaveClass("text-secondary", "active:text-secondary-dark");
}); });
}); });
@@ -266,8 +266,8 @@ describe("SecondaryButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-secondary-button"); const button = screen.getByTestId("mattrixwv-secondary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-neutral-300/80"); expect(button).toHaveClass("bg-secondary-light/80");
expect(button).toHaveClass("border", "border-neutral-300/80"); expect(button).toHaveClass("border", "border-secondary-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
@@ -276,8 +276,8 @@ describe("SecondaryButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-secondary-button"); const button = screen.getByTestId("mattrixwv-secondary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-neutral-300/80"); expect(button).toHaveClass("border", "border-secondary-light/80");
expect(button).toHaveClass("text-neutral-300/80"); expect(button).toHaveClass("text-secondary-light/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<SecondaryButton variant="outline-ghost" disabled>{buttonText}</SecondaryButton>); render(<SecondaryButton variant="outline-ghost" disabled>{buttonText}</SecondaryButton>);
@@ -285,8 +285,8 @@ describe("SecondaryButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-secondary-button"); const button = screen.getByTestId("mattrixwv-secondary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-neutral-300/80"); expect(button).toHaveClass("border", "border-secondary-light/80");
expect(button).toHaveClass("text-neutral-300/80"); expect(button).toHaveClass("text-secondary-light/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<SecondaryButton variant="ghost" disabled>{buttonText}</SecondaryButton>); render(<SecondaryButton variant="ghost" disabled>{buttonText}</SecondaryButton>);
@@ -295,7 +295,7 @@ describe("SecondaryButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-neutral-300/80"); expect(button).toHaveClass("text-secondary-light/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<SecondaryButton variant="icon" disabled>{buttonText}</SecondaryButton>); render(<SecondaryButton variant="icon" disabled>{buttonText}</SecondaryButton>);
@@ -304,6 +304,6 @@ describe("SecondaryButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-neutral-300/80"); expect(button).toHaveClass("text-secondary-light/80");
}); });
}); });

View File

@@ -21,9 +21,9 @@ describe("SuccessButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-green-600", "hover:bg-green-700", "active:bg-green-800"); expect(button).toHaveClass("bg-success", "active:bg-success-dark");
expect(button).toHaveClass("border-green-600", "hover:border-green-700", "active:border-green-800"); expect(button).toHaveClass("border-success", "active:border-success-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-black");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
@@ -177,9 +177,9 @@ describe("SuccessButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-green-400/80"); expect(button).toHaveClass("bg-success-light/80");
expect(button).toHaveClass("border-green-400/80"); expect(button).toHaveClass("border-success-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-black");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
const customClass = "custom-success-button-class"; const customClass = "custom-success-button-class";
@@ -218,9 +218,9 @@ describe("SuccessButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-success-button"); const button = screen.getByTestId("mattrixwv-success-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-green-600", "hover:bg-green-700", "active:bg-green-800"); expect(button).toHaveClass("bg-success", "active:bg-success-dark");
expect(button).toHaveClass("border", "border-green-600", "hover:border-green-700", "active:border-green-800"); expect(button).toHaveClass("border", "border-success", "active:border-success-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
render(<SuccessButton variant="outline">{buttonText}</SuccessButton>); render(<SuccessButton variant="outline">{buttonText}</SuccessButton>);
@@ -228,26 +228,26 @@ describe("SuccessButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-success-button"); const button = screen.getByTestId("mattrixwv-success-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-green-600", "hover:border-green-700", "active:border-green-800"); expect(button).toHaveClass("border", "border-success", "active:border-success-dark");
expect(button).toHaveClass("text-green-600", "hover:text-green-700", "active:text-green-800"); expect(button).toHaveClass("text-success", "active:text-success-dark");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<SuccessButton variant="outline-ghost">{buttonText}</SuccessButton>); render(<SuccessButton variant="outline-ghost">{buttonText}</SuccessButton>);
const button = screen.getByTestId("mattrixwv-success-button"); const button = screen.getByTestId("mattrixwv-success-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-green-600", "active:bg-green-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-success", "active:bg-success-dark");
expect(button).toHaveClass("border", "border-green-600", "hover:border-green-600", "active:border-green-700"); expect(button).toHaveClass("border", "border-success", "active:border-success-dark");
expect(button).toHaveClass("text-green-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-success", "hover:text-black", "active:text-black");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<SuccessButton variant="ghost">{buttonText}</SuccessButton>); render(<SuccessButton variant="ghost">{buttonText}</SuccessButton>);
const button = screen.getByTestId("mattrixwv-success-button"); const button = screen.getByTestId("mattrixwv-success-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-green-600", "active:bg-green-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-success", "active:bg-success-dark");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-green-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-success", "hover:text-black", "active:text-black");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<SuccessButton variant="icon">{buttonText}</SuccessButton>); render(<SuccessButton variant="icon">{buttonText}</SuccessButton>);
@@ -256,7 +256,7 @@ describe("SuccessButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-green-600", "hover:text-green-700", "active:text-green-800"); expect(button).toHaveClass("text-success", "active:text-success-dark");
}); });
}); });
@@ -266,9 +266,9 @@ describe("SuccessButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-success-button"); const button = screen.getByTestId("mattrixwv-success-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-green-400/80"); expect(button).toHaveClass("bg-success-light/80");
expect(button).toHaveClass("border", "border-green-400/80"); expect(button).toHaveClass("border", "border-success-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
render(<SuccessButton variant="outline" disabled>{buttonText}</SuccessButton>); render(<SuccessButton variant="outline" disabled>{buttonText}</SuccessButton>);
@@ -276,8 +276,8 @@ describe("SuccessButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-success-button"); const button = screen.getByTestId("mattrixwv-success-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-green-400/80"); expect(button).toHaveClass("border", "border-success-light/80");
expect(button).toHaveClass("text-green-400/80"); expect(button).toHaveClass("text-success-light/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<SuccessButton variant="outline-ghost" disabled>{buttonText}</SuccessButton>); render(<SuccessButton variant="outline-ghost" disabled>{buttonText}</SuccessButton>);
@@ -285,8 +285,8 @@ describe("SuccessButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-success-button"); const button = screen.getByTestId("mattrixwv-success-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-green-400/80"); expect(button).toHaveClass("border", "border-success-light/80");
expect(button).toHaveClass("text-green-400/80"); expect(button).toHaveClass("text-success-light/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<SuccessButton variant="ghost" disabled>{buttonText}</SuccessButton>); render(<SuccessButton variant="ghost" disabled>{buttonText}</SuccessButton>);
@@ -295,7 +295,7 @@ describe("SuccessButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-green-400/80"); expect(button).toHaveClass("text-success-light/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<SuccessButton variant="icon" disabled>{buttonText}</SuccessButton>); render(<SuccessButton variant="icon" disabled>{buttonText}</SuccessButton>);
@@ -304,6 +304,6 @@ describe("SuccessButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-green-400/80"); expect(button).toHaveClass("text-success-light/80");
}); });
}); });

View File

@@ -21,8 +21,8 @@ describe("TertiaryButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-purple-600", "hover:bg-purple-700", "active:bg-purple-800"); expect(button).toHaveClass("bg-tertiary", "active:bg-tertiary-dark");
expect(button).toHaveClass("border-purple-600", "hover:border-purple-700", "active:border-purple-800"); expect(button).toHaveClass("border-tertiary", "active:border-tertiary-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
@@ -177,8 +177,8 @@ describe("TertiaryButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-purple-400/80"); expect(button).toHaveClass("bg-tertiary-light/80");
expect(button).toHaveClass("border-purple-400/80"); expect(button).toHaveClass("border-tertiary-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
@@ -218,8 +218,8 @@ describe("TertiaryButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-tertiary-button"); const button = screen.getByTestId("mattrixwv-tertiary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-purple-600", "hover:bg-purple-700", "active:bg-purple-800"); expect(button).toHaveClass("bg-tertiary", "active:bg-tertiary-dark");
expect(button).toHaveClass("border", "border-purple-600", "hover:border-purple-700", "active:border-purple-800"); expect(button).toHaveClass("border", "border-tertiary", "active:border-tertiary-dark");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
@@ -228,26 +228,26 @@ describe("TertiaryButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-tertiary-button"); const button = screen.getByTestId("mattrixwv-tertiary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-purple-600", "hover:border-purple-700", "active:border-purple-800"); expect(button).toHaveClass("border", "border-tertiary", "active:border-tertiary-dark");
expect(button).toHaveClass("text-purple-600", "hover:text-purple-700", "active:text-purple-800"); expect(button).toHaveClass("text-tertiary", "active:text-tertiary-dark");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<TertiaryButton variant="outline-ghost">{buttonText}</TertiaryButton>); render(<TertiaryButton variant="outline-ghost">{buttonText}</TertiaryButton>);
const button = screen.getByTestId("mattrixwv-tertiary-button"); const button = screen.getByTestId("mattrixwv-tertiary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-purple-600", "active:bg-purple-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-tertiary", "active:bg-tertiary-dark");
expect(button).toHaveClass("border", "border-purple-600", "hover:border-purple-600", "active:border-purple-700"); expect(button).toHaveClass("border", "border-tertiary", "active:border-tertiary-dark");
expect(button).toHaveClass("text-purple-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-tertiary", "hover:text-white", "active:text-white");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<TertiaryButton variant="ghost">{buttonText}</TertiaryButton>); render(<TertiaryButton variant="ghost">{buttonText}</TertiaryButton>);
const button = screen.getByTestId("mattrixwv-tertiary-button"); const button = screen.getByTestId("mattrixwv-tertiary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-purple-600", "active:bg-purple-700"); expect(button).toHaveClass("bg-transparent", "hover:bg-tertiary", "active:bg-tertiary-dark");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-purple-600", "hover:text-white", "active:text-white"); expect(button).toHaveClass("text-tertiary", "hover:text-white", "active:text-white");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<TertiaryButton variant="icon">{buttonText}</TertiaryButton>); render(<TertiaryButton variant="icon">{buttonText}</TertiaryButton>);
@@ -256,7 +256,7 @@ describe("TertiaryButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-purple-600", "hover:text-purple-700", "active:text-purple-800"); expect(button).toHaveClass("text-tertiary", "active:text-tertiary-dark");
}); });
}); });
@@ -266,8 +266,8 @@ describe("TertiaryButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-tertiary-button"); const button = screen.getByTestId("mattrixwv-tertiary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-purple-400/80"); expect(button).toHaveClass("bg-tertiary-light/80");
expect(button).toHaveClass("border", "border-purple-400/80"); expect(button).toHaveClass("border", "border-tertiary-light/80");
expect(button).toHaveClass("text-white"); expect(button).toHaveClass("text-white");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
@@ -276,8 +276,8 @@ describe("TertiaryButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-tertiary-button"); const button = screen.getByTestId("mattrixwv-tertiary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-purple-400/80"); expect(button).toHaveClass("border", "border-tertiary-light/80");
expect(button).toHaveClass("text-purple-400/80"); expect(button).toHaveClass("text-tertiary-light/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<TertiaryButton variant="outline-ghost" disabled>{buttonText}</TertiaryButton>); render(<TertiaryButton variant="outline-ghost" disabled>{buttonText}</TertiaryButton>);
@@ -285,8 +285,8 @@ describe("TertiaryButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-tertiary-button"); const button = screen.getByTestId("mattrixwv-tertiary-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-purple-400/80"); expect(button).toHaveClass("border", "border-tertiary-light/80");
expect(button).toHaveClass("text-purple-400/80"); expect(button).toHaveClass("text-tertiary-light/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<TertiaryButton variant="ghost" disabled>{buttonText}</TertiaryButton>); render(<TertiaryButton variant="ghost" disabled>{buttonText}</TertiaryButton>);
@@ -295,7 +295,7 @@ describe("TertiaryButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-purple-400/80"); expect(button).toHaveClass("text-tertiary-light/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<TertiaryButton variant="icon" disabled>{buttonText}</TertiaryButton>); render(<TertiaryButton variant="icon" disabled>{buttonText}</TertiaryButton>);
@@ -304,6 +304,6 @@ describe("TertiaryButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-purple-400/80"); expect(button).toHaveClass("text-tertiary-light/80");
}); });
}); });

View File

@@ -21,8 +21,8 @@ describe("WarningButton Component", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
expect(button).toHaveClass("cursor-pointer"); expect(button).toHaveClass("cursor-pointer");
//Colors //Colors
expect(button).toHaveClass("bg-yellow-500", "hover:bg-yellow-600", "active:bg-yellow-700"); expect(button).toHaveClass("bg-warning", "active:bg-warning-dark");
expect(button).toHaveClass("border-yellow-500", "hover:border-yellow-600", "active:border-yellow-700"); expect(button).toHaveClass("border-warning", "active:border-warning-dark");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
@@ -173,8 +173,8 @@ describe("WarningButton Component Disabled", () => {
expect(button).toHaveClass("border"); expect(button).toHaveClass("border");
//Disabled state //Disabled state
expect(button).not.toHaveClass("cursor-pointer"); expect(button).not.toHaveClass("cursor-pointer");
expect(button).toHaveClass("bg-yellow-300/80"); expect(button).toHaveClass("bg-warning-light/80");
expect(button).toHaveClass("border-yellow-300/80"); expect(button).toHaveClass("border-warning-light/80");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with custom className when disabled", () => { it("Renders with custom className when disabled", () => {
@@ -215,8 +215,8 @@ describe("WarningButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-warning-button"); const button = screen.getByTestId("mattrixwv-warning-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-yellow-500", "hover:bg-yellow-600", "active:bg-yellow-700"); expect(button).toHaveClass("bg-warning", "active:bg-warning-dark");
expect(button).toHaveClass("border", "border-yellow-500", "hover:border-yellow-600", "active:border-yellow-700"); expect(button).toHaveClass("border", "border-warning", "active:border-warning-dark");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant", () => { it("Renders with outline variant", () => {
@@ -225,26 +225,26 @@ describe("WarningButton Component Variants", () => {
const button = screen.getByTestId("mattrixwv-warning-button"); const button = screen.getByTestId("mattrixwv-warning-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-yellow-500", "hover:border-yellow-600", "active:border-yellow-700"); expect(button).toHaveClass("border", "border-warning", "active:border-warning-dark");
expect(button).toHaveClass("text-yellow-500", "hover:text-yellow-600", "active:text-yellow-700"); expect(button).toHaveClass("text-warning", "active:text-warning-dark");
}); });
it("Renders with outline-ghost variant", () => { it("Renders with outline-ghost variant", () => {
render(<WarningButton variant="outline-ghost">{buttonText}</WarningButton>); render(<WarningButton variant="outline-ghost">{buttonText}</WarningButton>);
const button = screen.getByTestId("mattrixwv-warning-button"); const button = screen.getByTestId("mattrixwv-warning-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-yellow-500", "active:bg-yellow-600"); expect(button).toHaveClass("bg-transparent", "hover:bg-warning", "active:bg-warning-dark");
expect(button).toHaveClass("border", "border-yellow-500", "hover:border-yellow-500", "active:border-yellow-600"); expect(button).toHaveClass("border", "border-warning", "active:border-warning-dark");
expect(button).toHaveClass("text-yellow-500", "hover:text-black", "active:text-black"); expect(button).toHaveClass("text-warning", "hover:text-black", "active:text-black");
}); });
it("Renders with ghost variant", () => { it("Renders with ghost variant", () => {
render(<WarningButton variant="ghost">{buttonText}</WarningButton>); render(<WarningButton variant="ghost">{buttonText}</WarningButton>);
const button = screen.getByTestId("mattrixwv-warning-button"); const button = screen.getByTestId("mattrixwv-warning-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent", "hover:bg-yellow-500", "active:bg-yellow-600"); expect(button).toHaveClass("bg-transparent", "hover:bg-warning", "active:bg-warning-dark");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-yellow-500", "hover:text-black", "active:text-black"); expect(button).toHaveClass("text-warning", "hover:text-black", "active:text-black");
}); });
it("Renders with icon variant", () => { it("Renders with icon variant", () => {
render(<WarningButton variant="icon">{buttonText}</WarningButton>); render(<WarningButton variant="icon">{buttonText}</WarningButton>);
@@ -253,7 +253,7 @@ describe("WarningButton Component Variants", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-yellow-500", "hover:text-yellow-600", "active:text-yellow-700"); expect(button).toHaveClass("text-warning", "active:text-warning-dark");
}); });
}); });
@@ -263,8 +263,8 @@ describe("WarningButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-warning-button"); const button = screen.getByTestId("mattrixwv-warning-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-yellow-300/80"); expect(button).toHaveClass("bg-warning-light/80");
expect(button).toHaveClass("border", "border-yellow-300/80"); expect(button).toHaveClass("border", "border-warning-light/80");
expect(button).toHaveClass("text-black"); expect(button).toHaveClass("text-black");
}); });
it("Renders with outline variant when disabled", () => { it("Renders with outline variant when disabled", () => {
@@ -273,8 +273,8 @@ describe("WarningButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-warning-button"); const button = screen.getByTestId("mattrixwv-warning-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-yellow-300/80"); expect(button).toHaveClass("border", "border-warning-light/80");
expect(button).toHaveClass("text-yellow-300/80"); expect(button).toHaveClass("text-warning-light/80");
}); });
it("Renders with outline-ghost variant when disabled", () => { it("Renders with outline-ghost variant when disabled", () => {
render(<WarningButton variant="outline-ghost" disabled>{buttonText}</WarningButton>); render(<WarningButton variant="outline-ghost" disabled>{buttonText}</WarningButton>);
@@ -282,8 +282,8 @@ describe("WarningButton Component Variants Disabled", () => {
const button = screen.getByTestId("mattrixwv-warning-button"); const button = screen.getByTestId("mattrixwv-warning-button");
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border", "border-yellow-300/80"); expect(button).toHaveClass("border", "border-warning-light/80");
expect(button).toHaveClass("text-yellow-300/80"); expect(button).toHaveClass("text-warning-light/80");
}); });
it("Renders with ghost variant when disabled", () => { it("Renders with ghost variant when disabled", () => {
render(<WarningButton variant="ghost" disabled>{buttonText}</WarningButton>); render(<WarningButton variant="ghost" disabled>{buttonText}</WarningButton>);
@@ -292,7 +292,7 @@ describe("WarningButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-yellow-300/80"); expect(button).toHaveClass("text-warning-light/80");
}); });
it("Renders with icon variant when disabled", () => { it("Renders with icon variant when disabled", () => {
render(<WarningButton variant="icon" disabled>{buttonText}</WarningButton>); render(<WarningButton variant="icon" disabled>{buttonText}</WarningButton>);
@@ -301,6 +301,6 @@ describe("WarningButton Component Variants Disabled", () => {
expect(button).toBeInTheDocument(); expect(button).toBeInTheDocument();
expect(button).toHaveClass("bg-transparent"); expect(button).toHaveClass("bg-transparent");
expect(button).toHaveClass("border-none"); expect(button).toHaveClass("border-none");
expect(button).toHaveClass("text-yellow-300/80"); expect(button).toHaveClass("text-warning-light/80");
}); });
}); });

View File

@@ -18,7 +18,7 @@ describe("Renders with defaults", () => {
expect(messageBlock).toHaveClass("px-4", "py-2"); expect(messageBlock).toHaveClass("px-4", "py-2");
expect(messageBlock).toHaveClass("border"); expect(messageBlock).toHaveClass("border");
expect(messageBlock).toHaveClass("rounded-lg"); expect(messageBlock).toHaveClass("rounded-lg");
expect(messageBlock).toHaveClass("bg-red-200", "text-red-600"); expect(messageBlock).toHaveClass("bg-danger-xlight", "text-danger-dark");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
const customClassName = "custom-danger-message-block-class"; const customClassName = "custom-danger-message-block-class";

View File

@@ -18,7 +18,7 @@ describe("Renders with defaults", () => {
expect(messageBlock).toHaveClass("px-4", "py-2"); expect(messageBlock).toHaveClass("px-4", "py-2");
expect(messageBlock).toHaveClass("border"); expect(messageBlock).toHaveClass("border");
expect(messageBlock).toHaveClass("rounded-lg"); expect(messageBlock).toHaveClass("rounded-lg");
expect(messageBlock).toHaveClass("bg-black", "text-white"); expect(messageBlock).toHaveClass("bg-dark", "text-dark-xlight");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
const customClassName = "custom-dark-message-block-class"; const customClassName = "custom-dark-message-block-class";

View File

@@ -18,7 +18,7 @@ describe("Renders with defaults", () => {
expect(messageBlock).toHaveClass("px-4", "py-2"); expect(messageBlock).toHaveClass("px-4", "py-2");
expect(messageBlock).toHaveClass("border"); expect(messageBlock).toHaveClass("border");
expect(messageBlock).toHaveClass("rounded-lg"); expect(messageBlock).toHaveClass("rounded-lg");
expect(messageBlock).toHaveClass("bg-cyan-100", "text-blue-600"); expect(messageBlock).toHaveClass("bg-info-xlight", "text-info-xdark");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
const customClassName = "custom-info-message-block-class"; const customClassName = "custom-info-message-block-class";

View File

@@ -18,7 +18,7 @@ describe("Renders with defaults", () => {
expect(messageBlock).toHaveClass("px-4", "py-2"); expect(messageBlock).toHaveClass("px-4", "py-2");
expect(messageBlock).toHaveClass("border"); expect(messageBlock).toHaveClass("border");
expect(messageBlock).toHaveClass("rounded-lg"); expect(messageBlock).toHaveClass("rounded-lg");
expect(messageBlock).toHaveClass("bg-orange-100", "text-orange-600"); expect(messageBlock).toHaveClass("bg-molten-xlight", "text-molten-mid");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
const customClassName = "custom-molten-message-block-class"; const customClassName = "custom-molten-message-block-class";

View File

@@ -18,7 +18,7 @@ describe("Renders with defaults", () => {
expect(messageBlock).toHaveClass("px-4", "py-2"); expect(messageBlock).toHaveClass("px-4", "py-2");
expect(messageBlock).toHaveClass("border"); expect(messageBlock).toHaveClass("border");
expect(messageBlock).toHaveClass("rounded-lg"); expect(messageBlock).toHaveClass("rounded-lg");
expect(messageBlock).toHaveClass("bg-blue-200", "text-blue-600"); expect(messageBlock).toHaveClass("bg-primary-xlight", "text-primary-dark");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
const customClassName = "custom-primary-message-block-class"; const customClassName = "custom-primary-message-block-class";

View File

@@ -18,7 +18,7 @@ describe("Renders with defaults", () => {
expect(messageBlock).toHaveClass("px-4", "py-2"); expect(messageBlock).toHaveClass("px-4", "py-2");
expect(messageBlock).toHaveClass("border"); expect(messageBlock).toHaveClass("border");
expect(messageBlock).toHaveClass("rounded-lg"); expect(messageBlock).toHaveClass("rounded-lg");
expect(messageBlock).toHaveClass("bg-neutral-200", "text-neutral-600"); expect(messageBlock).toHaveClass("bg-secondary-xlight", "text-secondary-mid");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
const customClassName = "custom-secondary-message-block-class"; const customClassName = "custom-secondary-message-block-class";

View File

@@ -18,7 +18,7 @@ describe("Renders with defaults", () => {
expect(messageBlock).toHaveClass("px-4", "py-2"); expect(messageBlock).toHaveClass("px-4", "py-2");
expect(messageBlock).toHaveClass("border"); expect(messageBlock).toHaveClass("border");
expect(messageBlock).toHaveClass("rounded-lg"); expect(messageBlock).toHaveClass("rounded-lg");
expect(messageBlock).toHaveClass("bg-green-100", "text-green-600"); expect(messageBlock).toHaveClass("bg-success-xlight", "text-success-mid");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
const customClassName = "custom-success-message-block-class"; const customClassName = "custom-success-message-block-class";

View File

@@ -18,7 +18,7 @@ describe("Renders with defaults", () => {
expect(messageBlock).toHaveClass("px-4", "py-2"); expect(messageBlock).toHaveClass("px-4", "py-2");
expect(messageBlock).toHaveClass("border"); expect(messageBlock).toHaveClass("border");
expect(messageBlock).toHaveClass("rounded-lg"); expect(messageBlock).toHaveClass("rounded-lg");
expect(messageBlock).toHaveClass("bg-purple-200", "text-purple-600"); expect(messageBlock).toHaveClass("bg-tertiary-xlight", "text-tertiary-mid");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
const customClassName = "custom-tertiary-message-block-class"; const customClassName = "custom-tertiary-message-block-class";

View File

@@ -18,7 +18,7 @@ describe("Renders with defaults", () => {
expect(messageBlock).toHaveClass("px-4", "py-2"); expect(messageBlock).toHaveClass("px-4", "py-2");
expect(messageBlock).toHaveClass("border"); expect(messageBlock).toHaveClass("border");
expect(messageBlock).toHaveClass("rounded-lg"); expect(messageBlock).toHaveClass("rounded-lg");
expect(messageBlock).toHaveClass("bg-yellow-100", "text-yellow-600"); expect(messageBlock).toHaveClass("bg-warning-xlight", "text-warning-dark");
}); });
it("Renders with custom className", () => { it("Renders with custom className", () => {
const customClassName = "custom-warning-message-block-class"; const customClassName = "custom-warning-message-block-class";

View File

@@ -61,8 +61,7 @@ export default defineConfig({
publicDir: false, publicDir: false,
test: { test: {
globals: true, globals: true,
root: "test",
environment: "jsdom", environment: "jsdom",
setupFiles: [ "jest.config.ts" ] setupFiles: [ "test/jest.config.ts" ]
} }
}); });