Update themed components with refs and css
This commit is contained in:
@@ -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",
|
||||||
@@ -25,7 +24,7 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>((
|
|||||||
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",
|
||||||
@@ -60,7 +59,8 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>((
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
Button.displayName = "Button";
|
||||||
|
|
||||||
export default Button;
|
export default Button;
|
||||||
|
|||||||
@@ -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 {
|
const DangerButton = forwardRef<HTMLButtonElement, ButtonProps>(({
|
||||||
className,
|
className,
|
||||||
variant = "standard",
|
variant = "standard",
|
||||||
disabled
|
disabled,
|
||||||
} = props;
|
...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;
|
||||||
|
|||||||
@@ -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,
|
||||||
} = props;
|
...buttonProps
|
||||||
|
}, 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;
|
||||||
|
|||||||
@@ -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,
|
||||||
} = props;
|
...buttonProps
|
||||||
|
}, 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;
|
||||||
|
|||||||
@@ -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,
|
||||||
} = props;
|
...buttonProps
|
||||||
|
}, 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-neutral-400/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;
|
||||||
|
|||||||
@@ -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,
|
||||||
} = props;
|
...buttonProps
|
||||||
|
}, 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;
|
||||||
|
|||||||
@@ -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,
|
||||||
} = props;
|
...buttonProps
|
||||||
|
}, 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;
|
||||||
|
|||||||
@@ -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,
|
||||||
} = props;
|
...buttonProps
|
||||||
|
}, 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;
|
||||||
|
|||||||
@@ -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,
|
||||||
} = props;
|
...buttonProps
|
||||||
|
}, 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;
|
||||||
|
|||||||
@@ -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,
|
||||||
} = props;
|
...buttonProps
|
||||||
|
}, 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;
|
||||||
|
|||||||
@@ -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,
|
||||||
} = props;
|
...buttonProps
|
||||||
|
}, 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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
39
lib/component/input/switch/InfoSwitch.tsx
Normal file
39
lib/component/input/switch/InfoSwitch.tsx
Normal 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;
|
||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
39
lib/component/input/switch/MoltenSwitch.tsx
Normal file
39
lib/component/input/switch/MoltenSwitch.tsx
Normal 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;
|
||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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
|
||||||
} = props;
|
}, ref ) => {
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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
80
lib/styles.css
Normal 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 */
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
|||||||
@@ -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) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user