Fix testing errors
This commit is contained in:
@@ -50,9 +50,11 @@ const AlertContainer = memo<AlertProps>(
|
|||||||
? "var(--color-border-invert-negative-primary)"
|
? "var(--color-border-invert-negative-primary)"
|
||||||
: undefined,
|
: undefined,
|
||||||
titleColor: "text-[var(--color-content-invert-negative-primary)]",
|
titleColor: "text-[var(--color-content-invert-negative-primary)]",
|
||||||
descriptionColor: "text-[var(--color-content-invert-negative-primary)]",
|
descriptionColor:
|
||||||
|
"text-[var(--color-content-invert-negative-primary)]",
|
||||||
iconColor: "var(--color-red-red500)",
|
iconColor: "var(--color-red-red500)",
|
||||||
closeButtonColor: "text-[var(--color-content-invert-negative-primary)]",
|
closeButtonColor:
|
||||||
|
"text-[var(--color-content-invert-negative-primary)]",
|
||||||
closeButtonIconColor: "var(--color-content-invert-primary)",
|
closeButtonIconColor: "var(--color-content-invert-primary)",
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { ReactNode } from "react";
|
|
||||||
|
|
||||||
export interface AlertProps {
|
export interface AlertProps {
|
||||||
title: string;
|
title: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { getAssetPath, ASSETS } from "../../lib/assetUtils";
|
|
||||||
import type { AlertViewProps } from "./Alert.types";
|
import type { AlertViewProps } from "./Alert.types";
|
||||||
|
|
||||||
export function AlertView({
|
export function AlertView({
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
status,
|
status: _status,
|
||||||
type,
|
type: _type,
|
||||||
className,
|
className,
|
||||||
containerClasses,
|
containerClasses,
|
||||||
containerStyle,
|
containerStyle,
|
||||||
|
|||||||
@@ -5,13 +5,7 @@ import { TooltipView } from "./Tooltip.view";
|
|||||||
import type { TooltipProps } from "./Tooltip.types";
|
import type { TooltipProps } from "./Tooltip.types";
|
||||||
|
|
||||||
const TooltipContainer = memo<TooltipProps>(
|
const TooltipContainer = memo<TooltipProps>(
|
||||||
({
|
({ children, text, position = "top", className = "", disabled = false }) => {
|
||||||
children,
|
|
||||||
text,
|
|
||||||
position = "top",
|
|
||||||
className = "",
|
|
||||||
disabled = false,
|
|
||||||
}) => {
|
|
||||||
const [isVisible, setIsVisible] = useState(false);
|
const [isVisible, setIsVisible] = useState(false);
|
||||||
|
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
@@ -29,8 +23,6 @@ const TooltipContainer = memo<TooltipProps>(
|
|||||||
position === "top" ? "bottom-[-7px]" : "top-[-7px]"
|
position === "top" ? "bottom-[-7px]" : "top-[-7px]"
|
||||||
} left-1/2 -translate-x-1/2`;
|
} left-1/2 -translate-x-1/2`;
|
||||||
|
|
||||||
const tooltipId = `tooltip-${text.replace(/\s+/g, "-").toLowerCase()}`;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`relative inline-block ${className}`}
|
className={`relative inline-block ${className}`}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { TooltipViewProps } from "./Tooltip.types";
|
|||||||
export function TooltipView({
|
export function TooltipView({
|
||||||
text,
|
text,
|
||||||
position,
|
position,
|
||||||
className,
|
className: _className,
|
||||||
tooltipClasses,
|
tooltipClasses,
|
||||||
pointerClasses,
|
pointerClasses,
|
||||||
}: TooltipViewProps) {
|
}: TooltipViewProps) {
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ const Template = (args) => {
|
|||||||
export const Default = Template.bind({});
|
export const Default = Template.bind({});
|
||||||
Default.args = {
|
Default.args = {
|
||||||
title: "Short alert banner message goes here",
|
title: "Short alert banner message goes here",
|
||||||
description: "Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
description:
|
||||||
|
"Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
||||||
status: "default",
|
status: "default",
|
||||||
type: "toast",
|
type: "toast",
|
||||||
};
|
};
|
||||||
@@ -43,7 +44,8 @@ Default.args = {
|
|||||||
export const Positive = Template.bind({});
|
export const Positive = Template.bind({});
|
||||||
Positive.args = {
|
Positive.args = {
|
||||||
title: "Short alert banner message goes here",
|
title: "Short alert banner message goes here",
|
||||||
description: "Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
description:
|
||||||
|
"Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
||||||
status: "positive",
|
status: "positive",
|
||||||
type: "toast",
|
type: "toast",
|
||||||
};
|
};
|
||||||
@@ -51,7 +53,8 @@ Positive.args = {
|
|||||||
export const Warning = Template.bind({});
|
export const Warning = Template.bind({});
|
||||||
Warning.args = {
|
Warning.args = {
|
||||||
title: "Short alert banner message goes here",
|
title: "Short alert banner message goes here",
|
||||||
description: "Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
description:
|
||||||
|
"Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
||||||
status: "warning",
|
status: "warning",
|
||||||
type: "toast",
|
type: "toast",
|
||||||
};
|
};
|
||||||
@@ -59,7 +62,8 @@ Warning.args = {
|
|||||||
export const Danger = Template.bind({});
|
export const Danger = Template.bind({});
|
||||||
Danger.args = {
|
Danger.args = {
|
||||||
title: "Short alert banner message goes here",
|
title: "Short alert banner message goes here",
|
||||||
description: "Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
description:
|
||||||
|
"Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
||||||
status: "danger",
|
status: "danger",
|
||||||
type: "toast",
|
type: "toast",
|
||||||
};
|
};
|
||||||
@@ -67,7 +71,8 @@ Danger.args = {
|
|||||||
export const Banner = Template.bind({});
|
export const Banner = Template.bind({});
|
||||||
Banner.args = {
|
Banner.args = {
|
||||||
title: "Short alert banner message goes here",
|
title: "Short alert banner message goes here",
|
||||||
description: "Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
description:
|
||||||
|
"Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
||||||
status: "default",
|
status: "default",
|
||||||
type: "banner",
|
type: "banner",
|
||||||
};
|
};
|
||||||
@@ -75,7 +80,8 @@ Banner.args = {
|
|||||||
export const BannerPositive = Template.bind({});
|
export const BannerPositive = Template.bind({});
|
||||||
BannerPositive.args = {
|
BannerPositive.args = {
|
||||||
title: "Short alert banner message goes here",
|
title: "Short alert banner message goes here",
|
||||||
description: "Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
description:
|
||||||
|
"Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
||||||
status: "positive",
|
status: "positive",
|
||||||
type: "banner",
|
type: "banner",
|
||||||
};
|
};
|
||||||
@@ -83,7 +89,8 @@ BannerPositive.args = {
|
|||||||
export const BannerWarning = Template.bind({});
|
export const BannerWarning = Template.bind({});
|
||||||
BannerWarning.args = {
|
BannerWarning.args = {
|
||||||
title: "Short alert banner message goes here",
|
title: "Short alert banner message goes here",
|
||||||
description: "Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
description:
|
||||||
|
"Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
||||||
status: "warning",
|
status: "warning",
|
||||||
type: "banner",
|
type: "banner",
|
||||||
};
|
};
|
||||||
@@ -91,7 +98,8 @@ BannerWarning.args = {
|
|||||||
export const BannerDanger = Template.bind({});
|
export const BannerDanger = Template.bind({});
|
||||||
BannerDanger.args = {
|
BannerDanger.args = {
|
||||||
title: "Short alert banner message goes here",
|
title: "Short alert banner message goes here",
|
||||||
description: "Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
description:
|
||||||
|
"Nascetur ipsum a nisi tempor cras nam neque volutpat. Aliquam id est faucibus nunc quis. Eleifend suspendisse.",
|
||||||
status: "danger",
|
status: "danger",
|
||||||
type: "banner",
|
type: "banner",
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user