Fix tests after ts change
CI Pipeline / test (20) (pull_request) Successful in 2m41s
CI Pipeline / test (18) (pull_request) Successful in 3m21s
CI Pipeline / e2e (chromium) (pull_request) Failing after 1m25s
CI Pipeline / e2e (firefox) (pull_request) Failing after 1m24s
CI Pipeline / e2e (webkit) (pull_request) Failing after 1m24s
CI Pipeline / visual-regression (pull_request) Failing after 1m53s
CI Pipeline / performance (pull_request) Failing after 1m31s
CI Pipeline / lint (pull_request) Failing after 1m5s
CI Pipeline / storybook (pull_request) Successful in 1m36s
CI Pipeline / build (pull_request) Failing after 1m19s

This commit is contained in:
adilallo
2025-12-10 22:43:36 -07:00
parent f6a0673082
commit 92a3337aeb
65 changed files with 262 additions and 313 deletions
+3
View File
@@ -0,0 +1,3 @@
// Mock CSS imports for tests
// This prevents jsdom from trying to parse Tailwind CSS v4 syntax
export default {};
-1
View File
@@ -1,6 +1,5 @@
import { getAllBlogPosts } from "../../lib/content"; import { getAllBlogPosts } from "../../lib/content";
import ContentThumbnailTemplate from "../components/ContentThumbnailTemplate"; import ContentThumbnailTemplate from "../components/ContentThumbnailTemplate";
import ContentContainer from "../components/ContentContainer";
import type { Metadata } from "next"; import type { Metadata } from "next";
export const metadata: Metadata = { export const metadata: Metadata = {
+3 -3
View File
@@ -27,7 +27,7 @@ declare global {
gtag?: ( gtag?: (
command: string, command: string,
eventName: string, eventName: string,
params?: Record<string, unknown> params?: Record<string, unknown>,
) => void; ) => void;
} }
} }
@@ -45,7 +45,7 @@ const AskOrganizer = memo<AskOrganizerProps>(
}) => { }) => {
// Analytics tracking for contact button clicks // Analytics tracking for contact button clicks
const handleContactClick = ( const handleContactClick = (
event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement> event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>,
) => { ) => {
// Track contact button interaction // Track contact button interaction
if (onContactClick) { if (onContactClick) {
@@ -139,7 +139,7 @@ const AskOrganizer = memo<AskOrganizerProps>(
</div> </div>
</section> </section>
); );
} },
); );
AskOrganizer.displayName = "AskOrganizer"; AskOrganizer.displayName = "AskOrganizer";
+1 -1
View File
@@ -19,7 +19,7 @@ const Avatar = memo<AvatarProps>(
const baseStyles = `rounded-[var(--radius-measures-radius-full)] object-cover ${sizeStyles[size]} ${className}`; const baseStyles = `rounded-[var(--radius-measures-radius-full)] object-cover ${sizeStyles[size]} ${className}`;
return <img src={src} alt={alt} className={baseStyles} {...props} />; return <img src={src} alt={alt} className={baseStyles} {...props} />;
} },
); );
Avatar.displayName = "Avatar"; Avatar.displayName = "Avatar";
+1 -1
View File
@@ -22,7 +22,7 @@ const AvatarContainer = memo<AvatarContainerProps>(
{children} {children}
</div> </div>
); );
} },
); );
AvatarContainer.displayName = "AvatarContainer"; AvatarContainer.displayName = "AvatarContainer";
+10 -2
View File
@@ -2,12 +2,20 @@ import React, { memo } from "react";
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
children: React.ReactNode; children: React.ReactNode;
variant?: "default" | "secondary" | "primary" | "outlined" | "dark" | "inverse"; variant?:
| "default"
| "secondary"
| "primary"
| "outlined"
| "dark"
| "inverse";
size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; size?: "xsmall" | "small" | "medium" | "large" | "xlarge";
className?: string; className?: string;
disabled?: boolean; disabled?: boolean;
type?: "button" | "submit" | "reset"; type?: "button" | "submit" | "reset";
onClick?: (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void; onClick?: (
e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>,
) => void;
href?: string; href?: string;
target?: string; target?: string;
rel?: string; rel?: string;
+1 -1
View File
@@ -178,7 +178,7 @@ const Checkbox = memo<CheckboxProps>(
/> />
</label> </label>
); );
} },
); );
Checkbox.displayName = "Checkbox"; Checkbox.displayName = "Checkbox";
+1 -1
View File
@@ -130,7 +130,7 @@ const ContentContainer = memo<ContentContainerProps>(
</div> </div>
</div> </div>
); );
} },
); );
ContentContainer.displayName = "ContentContainer"; ContentContainer.displayName = "ContentContainer";
+1 -1
View File
@@ -203,7 +203,7 @@ const ContentLockup = memo<ContentLockupProps>(
)} )}
</div> </div>
); );
} },
); );
ContentLockup.displayName = "ContentLockup"; ContentLockup.displayName = "ContentLockup";
+2 -2
View File
@@ -22,7 +22,7 @@ const ContentThumbnailTemplate = memo<ContentThumbnailTemplateProps>(
// Get article-specific background image from frontmatter // Get article-specific background image from frontmatter
const getBackgroundImage = ( const getBackgroundImage = (
post: BlogPost, post: BlogPost,
variant: "vertical" | "horizontal" variant: "vertical" | "horizontal",
): string => { ): string => {
// Check if post has thumbnail images defined in frontmatter // Check if post has thumbnail images defined in frontmatter
if (post.frontmatter?.thumbnail) { if (post.frontmatter?.thumbnail) {
@@ -98,7 +98,7 @@ const ContentThumbnailTemplate = memo<ContentThumbnailTemplateProps>(
</div> </div>
</Link> </Link>
); );
} },
); );
ContentThumbnailTemplate.displayName = "ContentThumbnailTemplate"; ContentThumbnailTemplate.displayName = "ContentThumbnailTemplate";
+1 -1
View File
@@ -33,7 +33,7 @@ const ContextMenu = forwardRef<HTMLDivElement, ContextMenuProps>(
{children} {children}
</div> </div>
); );
} },
); );
ContextMenu.displayName = "ContextMenu"; ContextMenu.displayName = "ContextMenu";
+1 -1
View File
@@ -19,7 +19,7 @@ const ContextMenuDivider = forwardRef<HTMLDivElement, ContextMenuDividerProps>(
return ( return (
<div ref={ref} className={dividerClasses} role="separator" {...props} /> <div ref={ref} className={dividerClasses} role="separator" {...props} />
); );
} },
); );
ContextMenuDivider.displayName = "ContextMenuDivider"; ContextMenuDivider.displayName = "ContextMenuDivider";
+5 -5
View File
@@ -9,7 +9,7 @@ interface ContextMenuItemProps extends React.HTMLAttributes<HTMLDivElement> {
disabled?: boolean; disabled?: boolean;
className?: string; className?: string;
onClick?: ( onClick?: (
e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>,
) => void; ) => void;
size?: "small" | "medium" | "large"; size?: "small" | "medium" | "large";
} }
@@ -26,7 +26,7 @@ const ContextMenuItem = forwardRef<HTMLDivElement, ContextMenuItemProps>(
size = "medium", size = "medium",
...props ...props
}, },
ref ref,
) => { ) => {
const getTextSize = (): string => { const getTextSize = (): string => {
switch (size) { switch (size) {
@@ -69,7 +69,7 @@ const ContextMenuItem = forwardRef<HTMLDivElement, ContextMenuItemProps>(
onClick(e); onClick(e);
} }
}, },
[disabled, onClick] [disabled, onClick],
); );
const handleKeyDown = useCallback( const handleKeyDown = useCallback(
@@ -81,7 +81,7 @@ const ContextMenuItem = forwardRef<HTMLDivElement, ContextMenuItemProps>(
} }
} }
}, },
[disabled, onClick] [disabled, onClick],
); );
return ( return (
@@ -131,7 +131,7 @@ const ContextMenuItem = forwardRef<HTMLDivElement, ContextMenuItemProps>(
)} )}
</div> </div>
); );
} },
); );
ContextMenuItem.displayName = "ContextMenuItem"; ContextMenuItem.displayName = "ContextMenuItem";
+1 -1
View File
@@ -28,7 +28,7 @@ const ContextMenuSection = forwardRef<HTMLDivElement, ContextMenuSectionProps>(
{children} {children}
</div> </div>
); );
} },
); );
ContextMenuSection.displayName = "ContextMenuSection"; ContextMenuSection.displayName = "ContextMenuSection";
+2 -2
View File
@@ -48,7 +48,7 @@ const FeatureGrid = memo<FeatureGridProps>(
href: "#conflict-resolution", href: "#conflict-resolution",
}, },
], ],
[] [],
); );
return ( return (
<section <section
@@ -92,7 +92,7 @@ const FeatureGrid = memo<FeatureGridProps>(
</div> </div>
</section> </section>
); );
} },
); );
FeatureGrid.displayName = "FeatureGrid"; FeatureGrid.displayName = "FeatureGrid";
+36 -8
View File
@@ -1,4 +1,5 @@
import React, { memo } from "react"; import React, { memo } from "react";
import Link from "next/link";
import Logo from "./Logo"; import Logo from "./Logo";
import Separator from "./Separator"; import Separator from "./Separator";
import { getAssetPath, ASSETS } from "../../lib/assetUtils"; import { getAssetPath, ASSETS } from "../../lib/assetUtils";
@@ -103,27 +104,54 @@ const Footer = memo(() => {
{/* Links Section */} {/* Links Section */}
<div className="flex flex-col items-start gap-[var(--spacing-measures-spacing-016,16px)] order-1 sm:order-2"> <div className="flex flex-col items-start gap-[var(--spacing-measures-spacing-016,16px)] order-1 sm:order-2">
<a <Link
href="#"
className="text-[var(--color-content-default-primary)] font-inter text-base leading-5 font-medium tracking-[0%] lg:text-2xl lg:leading-7 lg:font-normal hover:opacity-80 active:opacity-60 focus:opacity-80 focus:outline-none focus:ring-2 focus:ring-[var(--color-content-default-primary)] focus:ring-offset-2 focus:ring-offset-[var(--color-surface-default-primary)] transition-opacity p-2 -m-2 cursor-pointer"
>
Use cases
</Link>
<Link
href="/learn" href="/learn"
className="text-[var(--color-content-default-primary)] font-inter text-base leading-5 font-medium tracking-[0%] lg:text-2xl lg:leading-7 lg:font-normal hover:opacity-80 active:opacity-60 focus:opacity-80 focus:outline-none focus:ring-2 focus:ring-[var(--color-content-default-primary)] focus:ring-offset-2 focus:ring-offset-[var(--color-surface-default-primary)] transition-opacity p-2 -m-2 cursor-pointer" className="text-[var(--color-content-default-primary)] font-inter text-base leading-5 font-medium tracking-[0%] lg:text-2xl lg:leading-7 lg:font-normal hover:opacity-80 active:opacity-60 focus:opacity-80 focus:outline-none focus:ring-2 focus:ring-[var(--color-content-default-primary)] focus:ring-offset-2 focus:ring-offset-[var(--color-surface-default-primary)] transition-opacity p-2 -m-2 cursor-pointer"
> >
Learn Learn
</a> </Link>
<a <Link
href="/blog" href="#"
className="text-[var(--color-content-default-primary)] font-inter text-base leading-5 font-medium tracking-[0%] lg:text-2xl lg:leading-7 lg:font-normal hover:opacity-80 active:opacity-60 focus:opacity-80 focus:outline-none focus:ring-2 focus:ring-[var(--color-content-default-primary)] focus:ring-offset-2 focus:ring-offset-[var(--color-surface-default-primary)] transition-opacity p-2 -m-2 cursor-pointer" className="text-[var(--color-content-default-primary)] font-inter text-base leading-5 font-medium tracking-[0%] lg:text-2xl lg:leading-7 lg:font-normal hover:opacity-80 active:opacity-60 focus:opacity-80 focus:outline-none focus:ring-2 focus:ring-[var(--color-content-default-primary)] focus:ring-offset-2 focus:ring-offset-[var(--color-surface-default-primary)] transition-opacity p-2 -m-2 cursor-pointer"
> >
Blog About
</a> </Link>
</div> </div>
</div> </div>
<Separator /> <Separator />
{/* Legal Links */}
<div className="flex flex-col items-start gap-[var(--spacing-measures-spacing-016,16px)] sm:flex-row sm:gap-[var(--spacing-measures-spacing-024,24px)]">
<Link
href="#"
className="text-[var(--color-content-default-secondary)] font-inter text-sm leading-5 font-normal tracking-[0%] lg:text-base lg:leading-6 hover:opacity-80 active:opacity-60 focus:opacity-80 focus:outline-none focus:ring-2 focus:ring-[var(--color-content-default-primary)] focus:ring-offset-2 focus:ring-offset-[var(--color-surface-default-primary)] transition-opacity p-2 -m-2 cursor-pointer"
>
Privacy Policy
</Link>
<Link
href="#"
className="text-[var(--color-content-default-secondary)] font-inter text-sm leading-5 font-normal tracking-[0%] lg:text-base lg:leading-6 hover:opacity-80 active:opacity-60 focus:opacity-80 focus:outline-none focus:ring-2 focus:ring-[var(--color-content-default-primary)] focus:ring-offset-2 focus:ring-offset-[var(--color-surface-default-primary)] transition-opacity p-2 -m-2 cursor-pointer"
>
Terms of Service
</Link>
<Link
href="#"
className="text-[var(--color-content-default-secondary)] font-inter text-sm leading-5 font-normal tracking-[0%] lg:text-base lg:leading-6 hover:opacity-80 active:opacity-60 focus:opacity-80 focus:outline-none focus:ring-2 focus:ring-[var(--color-content-default-primary)] focus:ring-offset-2 focus:ring-offset-[var(--color-surface-default-primary)] transition-opacity p-2 -m-2 cursor-pointer"
>
Cookies Settings
</Link>
</div>
{/* Copyright */} {/* Copyright */}
<div className="text-[var(--color-content-default-secondary)] font-inter text-sm leading-5 font-normal tracking-[0%] lg:text-base lg:leading-6"> <div className="text-[var(--color-content-default-secondary)] font-inter text-sm leading-5 font-normal tracking-[0%] lg:text-base lg:leading-6">
© {new Date().getFullYear()} Media Economies Design Lab. All rights © All right reserved
reserved.
</div> </div>
</div> </div>
</footer> </footer>
+3 -3
View File
@@ -75,7 +75,7 @@ const Header = memo(() => {
const renderAvatarGroup = ( const renderAvatarGroup = (
containerSize: "small" | "medium" | "large" | "xlarge", containerSize: "small" | "medium" | "large" | "xlarge",
avatarSize: "small" | "medium" | "large" | "xlarge" avatarSize: "small" | "medium" | "large" | "xlarge",
) => { ) => {
return ( return (
<AvatarContainer size={containerSize}> <AvatarContainer size={containerSize}>
@@ -102,7 +102,7 @@ const Header = memo(() => {
const renderCreateRuleButton = ( const renderCreateRuleButton = (
buttonSize: string, buttonSize: string,
containerSize: "small" | "medium" | "large" | "xlarge", containerSize: "small" | "medium" | "large" | "xlarge",
avatarSize: "small" | "medium" | "large" | "xlarge" avatarSize: "small" | "medium" | "large" | "xlarge",
) => { ) => {
return ( return (
<Button <Button
@@ -129,7 +129,7 @@ const Header = memo(() => {
| "headerXl" | "headerXl"
| "footer" | "footer"
| "footerLg", | "footerLg",
showText: boolean showText: boolean,
) => { ) => {
return <Logo size={size} showText={showText} />; return <Logo size={size} showText={showText} />;
}; };
+1 -1
View File
@@ -39,7 +39,7 @@ const HeaderTab = memo<HeaderTabProps>(
/> />
</div> </div>
); );
} },
); );
HeaderTab.displayName = "HeaderTab"; HeaderTab.displayName = "HeaderTab";
+1 -1
View File
@@ -54,7 +54,7 @@ const HeroBanner = memo<HeroBannerProps>(
</div> </div>
</section> </section>
); );
} },
); );
HeroBanner.displayName = "HeroBanner"; HeroBanner.displayName = "HeroBanner";
+7 -7
View File
@@ -83,10 +83,10 @@ const HomeHeader = memo(() => {
? size === "home" || size === "homeMd" ? size === "home" || size === "homeMd"
? "homeMd" ? "homeMd"
: size === "large" : size === "large"
? "large" ? "large"
: size === "homeXlarge" : size === "homeXlarge"
? "homeXlarge" ? "homeXlarge"
: "xsmallUseCases" : "xsmallUseCases"
: size : size
} }
variant={ variant={
@@ -109,7 +109,7 @@ const HomeHeader = memo(() => {
const renderAvatarGroup = ( const renderAvatarGroup = (
containerSize: "small" | "medium" | "large" | "xlarge", containerSize: "small" | "medium" | "large" | "xlarge",
avatarSize: "small" | "medium" | "large" | "xlarge" avatarSize: "small" | "medium" | "large" | "xlarge",
) => { ) => {
return ( return (
<AvatarContainer size={containerSize}> <AvatarContainer size={containerSize}>
@@ -141,7 +141,7 @@ const HomeHeader = memo(() => {
const renderCreateRuleButton = ( const renderCreateRuleButton = (
buttonSize: string, buttonSize: string,
containerSize: "small" | "medium" | "large" | "xlarge", containerSize: "small" | "medium" | "large" | "xlarge",
avatarSize: "small" | "medium" | "large" | "xlarge" avatarSize: "small" | "medium" | "large" | "xlarge",
) => { ) => {
return ( return (
<Button <Button
@@ -169,7 +169,7 @@ const HomeHeader = memo(() => {
| "headerXl" | "headerXl"
| "footer" | "footer"
| "footerLg", | "footerLg",
showText: boolean showText: boolean,
) => { ) => {
return <Logo size={size} showText={showText} />; return <Logo size={size} showText={showText} />;
}; };
+1 -1
View File
@@ -41,7 +41,7 @@ const ImagePlaceholder = memo<ImagePlaceholderProps>(
{text} {text}
</div> </div>
); );
} },
); );
ImagePlaceholder.displayName = "ImagePlaceholder"; ImagePlaceholder.displayName = "ImagePlaceholder";
+9 -10
View File
@@ -2,11 +2,10 @@
import React, { memo, useCallback, forwardRef, useId } from "react"; import React, { memo, useCallback, forwardRef, useId } from "react";
interface InputProps interface InputProps extends Omit<
extends Omit< React.InputHTMLAttributes<HTMLInputElement>,
React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "onFocus" | "onBlur"
"size" | "onChange" | "onFocus" | "onBlur" > {
> {
size?: "small" | "medium" | "large"; size?: "small" | "medium" | "large";
labelVariant?: "default" | "horizontal"; labelVariant?: "default" | "horizontal";
state?: "default" | "active" | "hover" | "focus"; state?: "default" | "active" | "hover" | "focus";
@@ -41,7 +40,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
className = "", className = "",
...props ...props
}, },
ref ref,
) => { ) => {
// Generate unique ID for accessibility if not provided // Generate unique ID for accessibility if not provided
const generatedId = useId(); const generatedId = useId();
@@ -157,7 +156,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
onChange(e); onChange(e);
} }
}, },
[disabled, onChange] [disabled, onChange],
); );
const handleFocus = useCallback( const handleFocus = useCallback(
@@ -166,7 +165,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
onFocus(e); onFocus(e);
} }
}, },
[disabled, onFocus] [disabled, onFocus],
); );
const handleBlur = useCallback( const handleBlur = useCallback(
@@ -175,7 +174,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
onBlur(e); onBlur(e);
} }
}, },
[disabled, onBlur] [disabled, onBlur],
); );
return ( return (
@@ -207,7 +206,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
</div> </div>
</div> </div>
); );
} },
); );
Input.displayName = "Input"; Input.displayName = "Input";
+1 -1
View File
@@ -31,7 +31,7 @@ const MenuBar = memo<MenuBarProps>(
{children} {children}
</nav> </nav>
); );
} },
); );
MenuBar.displayName = "MenuBar"; MenuBar.displayName = "MenuBar";
+2 -3
View File
@@ -1,7 +1,6 @@
import React, { memo } from "react"; import React, { memo } from "react";
interface MenuBarItemProps interface MenuBarItemProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
href?: string; href?: string;
children?: React.ReactNode; children?: React.ReactNode;
variant?: "default" | "home"; variant?: "default" | "home";
@@ -180,7 +179,7 @@ const MenuBarItem = memo<MenuBarItemProps>(
{children} {children}
</a> </a>
); );
} },
); );
MenuBarItem.displayName = "MenuBarItem"; MenuBarItem.displayName = "MenuBarItem";
+1 -1
View File
@@ -129,7 +129,7 @@ const MiniCard = memo<MiniCardProps>(
{cardContent} {cardContent}
</div> </div>
); );
} },
); );
MiniCard.displayName = "MiniCard"; MiniCard.displayName = "MiniCard";
+2 -3
View File
@@ -1,7 +1,6 @@
import React, { memo } from "react"; import React, { memo } from "react";
interface NavigationItemProps interface NavigationItemProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
href?: string; href?: string;
children?: React.ReactNode; children?: React.ReactNode;
variant?: "default"; variant?: "default";
@@ -64,7 +63,7 @@ const NavigationItem = memo<NavigationItemProps>(
{children} {children}
</a> </a>
); );
} },
); );
NavigationItem.displayName = "NavigationItem"; NavigationItem.displayName = "NavigationItem";
+1 -1
View File
@@ -27,7 +27,7 @@ const NumberedCard = memo<NumberedCardProps>(
</div> </div>
</div> </div>
); );
} },
); );
NumberedCard.displayName = "NumberedCard"; NumberedCard.displayName = "NumberedCard";
+1 -1
View File
@@ -32,7 +32,7 @@ const NumberedCards = memo<NumberedCardsProps>(({ title, subtitle, cards }) => {
text: card.text, text: card.text,
})), })),
}), }),
[title, subtitle, cards] [title, subtitle, cards],
); );
return ( return (
+2 -2
View File
@@ -111,7 +111,7 @@ const QuoteBlock = memo<QuoteBlockProps>(
const handleImageError = (error: unknown) => { const handleImageError = (error: unknown) => {
console.warn( console.warn(
`QuoteBlock: Failed to load avatar image for ${author}:`, `QuoteBlock: Failed to load avatar image for ${author}:`,
error error,
); );
setImageError(true); setImageError(true);
setImageLoading(false); setImageLoading(false);
@@ -275,7 +275,7 @@ const QuoteBlock = memo<QuoteBlockProps>(
</div> </div>
</section> </section>
); );
} },
); );
QuoteBlock.displayName = "QuoteBlock"; QuoteBlock.displayName = "QuoteBlock";
+1 -1
View File
@@ -94,7 +94,7 @@ const RadioButton = ({
onChange({ checked: true, value }); onChange({ checked: true, value });
} }
}, },
[disabled, onChange, checked, value] [disabled, onChange, checked, value],
); );
return ( return (
+1 -1
View File
@@ -42,7 +42,7 @@ const RadioGroup = ({
onChange({ value: optionValue }); onChange({ value: optionValue });
} }
}, },
[disabled, onChange] [disabled, onChange],
); );
return ( return (
+7 -7
View File
@@ -15,7 +15,7 @@ const RelatedArticles = memo<RelatedArticlesProps>(
// Memoize filtered posts to prevent unnecessary re-computations // Memoize filtered posts to prevent unnecessary re-computations
const filteredPosts = useMemo( const filteredPosts = useMemo(
() => relatedPosts.filter((post) => post.slug !== currentPostSlug), () => relatedPosts.filter((post) => post.slug !== currentPostSlug),
[relatedPosts, currentPostSlug] [relatedPosts, currentPostSlug],
); );
const [currentIndex, setCurrentIndex] = useState(0); const [currentIndex, setCurrentIndex] = useState(0);
@@ -43,7 +43,7 @@ const RelatedArticles = memo<RelatedArticlesProps>(
document.addEventListener("mousemove", handleMouseMove); document.addEventListener("mousemove", handleMouseMove);
document.addEventListener("mouseup", handleMouseUp); document.addEventListener("mouseup", handleMouseUp);
}, },
[] [],
); );
// Memoize transform style to prevent unnecessary recalculations // Memoize transform style to prevent unnecessary recalculations
@@ -54,7 +54,7 @@ const RelatedArticles = memo<RelatedArticlesProps>(
: "none", : "none",
scrollBehavior: !isMobile ? "smooth" : "auto", scrollBehavior: !isMobile ? "smooth" : "auto",
}), }),
[isMobile, currentIndex] [isMobile, currentIndex],
); );
// Memoize progress bar style calculation // Memoize progress bar style calculation
@@ -64,10 +64,10 @@ const RelatedArticles = memo<RelatedArticlesProps>(
index === currentIndex index === currentIndex
? `${progress}%` ? `${progress}%`
: index < currentIndex : index < currentIndex
? "100%" ? "100%"
: "0%", : "0%",
}), }),
[currentIndex, progress] [currentIndex, progress],
); );
// Check if we're on mobile (below lg breakpoint) // Check if we're on mobile (below lg breakpoint)
@@ -165,7 +165,7 @@ const RelatedArticles = memo<RelatedArticlesProps>(
</div> </div>
</section> </section>
); );
} },
); );
RelatedArticles.displayName = "RelatedArticles"; RelatedArticles.displayName = "RelatedArticles";
+2 -2
View File
@@ -16,7 +16,7 @@ declare global {
gtag?: ( gtag?: (
command: string, command: string,
eventName: string, eventName: string,
params?: Record<string, unknown> params?: Record<string, unknown>,
) => void; ) => void;
analytics?: { analytics?: {
track: (eventName: string, params?: Record<string, unknown>) => void; track: (eventName: string, params?: Record<string, unknown>) => void;
@@ -93,7 +93,7 @@ const RuleCard = memo<RuleCardProps>(
)} )}
</div> </div>
); );
} },
); );
RuleCard.displayName = "RuleCard"; RuleCard.displayName = "RuleCard";
+1 -1
View File
@@ -15,7 +15,7 @@ declare global {
gtag?: ( gtag?: (
command: string, command: string,
eventName: string, eventName: string,
params?: Record<string, unknown> params?: Record<string, unknown>,
) => void; ) => void;
analytics?: { analytics?: {
track: (eventName: string, params?: Record<string, unknown>) => void; track: (eventName: string, params?: Record<string, unknown>) => void;
+1 -1
View File
@@ -59,7 +59,7 @@ const SectionHeader = memo<SectionHeaderProps>(
</div> </div>
</div> </div>
); );
} },
); );
SectionHeader.displayName = "SectionHeader"; SectionHeader.displayName = "SectionHeader";
+7 -7
View File
@@ -51,7 +51,7 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
options, options,
...props ...props
}, },
ref ref,
) => { ) => {
const generatedId = useId(); const generatedId = useId();
const selectId = id || `select-${generatedId}`; const selectId = id || `select-${generatedId}`;
@@ -94,7 +94,7 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
selectRef.current.focus(); selectRef.current.focus();
} }
}, },
[onChange] [onChange],
); );
// Handle select button click // Handle select button click
@@ -116,7 +116,7 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
setIsOpen(false); setIsOpen(false);
} }
}, },
[disabled, isOpen] [disabled, isOpen],
); );
const getSizeStyles = (): string => { const getSizeStyles = (): string => {
@@ -253,7 +253,7 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
// Handle options prop // Handle options prop
if (options && Array.isArray(options)) { if (options && Array.isArray(options)) {
const selectedOption = options.find( const selectedOption = options.find(
(option) => option.value === selectedValue (option) => option.value === selectedValue,
); );
return selectedOption ? selectedOption.label : placeholder; return selectedOption ? selectedOption.label : placeholder;
} }
@@ -261,7 +261,7 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
// Handle children (option elements) // Handle children (option elements)
const selectedOption = React.Children.toArray(children).find( const selectedOption = React.Children.toArray(children).find(
(child) => (child) =>
React.isValidElement(child) && child.props.value === selectedValue React.isValidElement(child) && child.props.value === selectedValue,
) as ) as
| React.ReactElement<{ value: string; children: React.ReactNode }> | React.ReactElement<{ value: string; children: React.ReactNode }>
| undefined; | undefined;
@@ -353,7 +353,7 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
onClick={() => onClick={() =>
handleOptionSelect( handleOptionSelect(
optionProps.value, optionProps.value,
String(optionProps.children) String(optionProps.children),
) )
} }
> >
@@ -369,7 +369,7 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
</div> </div>
</div> </div>
); );
} },
); );
Select.displayName = "Select"; Select.displayName = "Select";
+1 -1
View File
@@ -34,7 +34,7 @@ const SelectDropdown = forwardRef<HTMLDivElement, SelectDropdownProps>(
{children} {children}
</div> </div>
); );
} },
); );
SelectDropdown.displayName = "SelectDropdown"; SelectDropdown.displayName = "SelectDropdown";
+5 -5
View File
@@ -8,7 +8,7 @@ interface SelectOptionProps {
disabled?: boolean; disabled?: boolean;
className?: string; className?: string;
onClick?: ( onClick?: (
e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>,
) => void; ) => void;
size?: "small" | "medium" | "large"; size?: "small" | "medium" | "large";
} }
@@ -24,7 +24,7 @@ const SelectOption = forwardRef<HTMLDivElement, SelectOptionProps>(
size = "medium", size = "medium",
...props ...props
}, },
ref ref,
) => { ) => {
const getTextSize = (): string => { const getTextSize = (): string => {
switch (size) { switch (size) {
@@ -67,7 +67,7 @@ const SelectOption = forwardRef<HTMLDivElement, SelectOptionProps>(
onClick(e); onClick(e);
} }
}, },
[disabled, onClick] [disabled, onClick],
); );
const handleKeyDown = useCallback( const handleKeyDown = useCallback(
@@ -79,7 +79,7 @@ const SelectOption = forwardRef<HTMLDivElement, SelectOptionProps>(
} }
} }
}, },
[disabled, onClick] [disabled, onClick],
); );
return ( return (
@@ -114,7 +114,7 @@ const SelectOption = forwardRef<HTMLDivElement, SelectOptionProps>(
</div> </div>
</div> </div>
); );
} },
); );
SelectOption.displayName = "SelectOption"; SelectOption.displayName = "SelectOption";
+10 -8
View File
@@ -1,12 +1,14 @@
import React, { memo, useCallback, useId, forwardRef } from "react"; import React, { memo, useCallback, useId, forwardRef } from "react";
interface SwitchProps interface SwitchProps extends Omit<
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> { React.ButtonHTMLAttributes<HTMLButtonElement>,
"onChange"
> {
checked?: boolean; checked?: boolean;
onChange?: ( onChange?: (
e: e:
| React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>
| React.KeyboardEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>,
) => void; ) => void;
onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => void; onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => void;
onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => void; onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => void;
@@ -36,7 +38,7 @@ const Switch = memo(
onChange(e); onChange(e);
} }
}, },
[onChange] [onChange],
); );
const handleKeyDown = useCallback( const handleKeyDown = useCallback(
@@ -48,7 +50,7 @@ const Switch = memo(
} }
} }
}, },
[onChange] [onChange],
); );
const handleFocus = useCallback( const handleFocus = useCallback(
@@ -57,7 +59,7 @@ const Switch = memo(
onFocus(e); onFocus(e);
} }
}, },
[onFocus] [onFocus],
); );
const handleBlur = useCallback( const handleBlur = useCallback(
@@ -66,7 +68,7 @@ const Switch = memo(
onBlur(e); onBlur(e);
} }
}, },
[onBlur] [onBlur],
); );
// Switch track styles based on checked state // Switch track styles based on checked state
@@ -170,7 +172,7 @@ const Switch = memo(
{label && <span className={labelClasses}>{label}</span>} {label && <span className={labelClasses}>{label}</span>}
</div> </div>
); );
}) }),
); );
Switch.displayName = "Switch"; Switch.displayName = "Switch";
+9 -10
View File
@@ -2,11 +2,10 @@
import React, { memo, useCallback, forwardRef, useId } from "react"; import React, { memo, useCallback, forwardRef, useId } from "react";
interface TextAreaProps interface TextAreaProps extends Omit<
extends Omit< React.TextareaHTMLAttributes<HTMLTextAreaElement>,
React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "onChange" | "onFocus" | "onBlur"
"size" | "onChange" | "onFocus" | "onBlur" > {
> {
size?: "small" | "medium" | "large"; size?: "small" | "medium" | "large";
labelVariant?: "default" | "horizontal"; labelVariant?: "default" | "horizontal";
state?: "default" | "active" | "hover" | "focus"; state?: "default" | "active" | "hover" | "focus";
@@ -42,7 +41,7 @@ const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
rows, rows,
...props ...props
}, },
ref ref,
) => { ) => {
// Generate unique ID for accessibility if not provided // Generate unique ID for accessibility if not provided
const generatedId = useId(); const generatedId = useId();
@@ -161,7 +160,7 @@ const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
onChange(e); onChange(e);
} }
}, },
[disabled, onChange] [disabled, onChange],
); );
const handleFocus = useCallback( const handleFocus = useCallback(
@@ -170,7 +169,7 @@ const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
onFocus(e); onFocus(e);
} }
}, },
[disabled, onFocus] [disabled, onFocus],
); );
const handleBlur = useCallback( const handleBlur = useCallback(
@@ -179,7 +178,7 @@ const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
onBlur(e); onBlur(e);
} }
}, },
[disabled, onBlur] [disabled, onBlur],
); );
return ( return (
@@ -213,7 +212,7 @@ const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
</div> </div>
</div> </div>
); );
} },
); );
TextArea.displayName = "TextArea"; TextArea.displayName = "TextArea";
+12 -10
View File
@@ -1,13 +1,15 @@
import React, { memo, useCallback, useId, forwardRef } from "react"; import React, { memo, useCallback, useId, forwardRef } from "react";
interface ToggleProps interface ToggleProps extends Omit<
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> { React.ButtonHTMLAttributes<HTMLButtonElement>,
"onChange"
> {
label?: string; label?: string;
checked?: boolean; checked?: boolean;
onChange?: ( onChange?: (
e: e:
| React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>
| React.KeyboardEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>,
) => void; ) => void;
onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => void; onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => void;
onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => void; onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => void;
@@ -37,7 +39,7 @@ const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(
className = "", className = "",
...props ...props
}, },
ref ref,
) => { ) => {
const toggleId = useId(); const toggleId = useId();
const labelId = useId(); const labelId = useId();
@@ -141,13 +143,13 @@ const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(
( (
e: e:
| React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>
| React.KeyboardEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>,
) => { ) => {
if (!disabled && onChange) { if (!disabled && onChange) {
onChange(e); onChange(e);
} }
}, },
[disabled, onChange] [disabled, onChange],
); );
const handleFocus = useCallback( const handleFocus = useCallback(
@@ -156,7 +158,7 @@ const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(
onFocus(e); onFocus(e);
} }
}, },
[disabled, onFocus] [disabled, onFocus],
); );
const handleBlur = useCallback( const handleBlur = useCallback(
@@ -165,7 +167,7 @@ const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(
onBlur(e); onBlur(e);
} }
}, },
[disabled, onBlur] [disabled, onBlur],
); );
const handleKeyDown = useCallback( const handleKeyDown = useCallback(
@@ -177,7 +179,7 @@ const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(
} }
} }
}, },
[disabled, onChange] [disabled, onChange],
); );
return ( return (
@@ -213,7 +215,7 @@ const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(
</div> </div>
</div> </div>
); );
} },
); );
Toggle.displayName = "Toggle"; Toggle.displayName = "Toggle";
+10 -8
View File
@@ -1,7 +1,9 @@
import React, { memo, useCallback, useId, forwardRef } from "react"; import React, { memo, useCallback, useId, forwardRef } from "react";
interface ToggleGroupProps interface ToggleGroupProps extends Omit<
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> { React.ButtonHTMLAttributes<HTMLButtonElement>,
"onChange"
> {
children?: React.ReactNode; children?: React.ReactNode;
className?: string; className?: string;
position?: "left" | "middle" | "right"; position?: "left" | "middle" | "right";
@@ -11,7 +13,7 @@ interface ToggleGroupProps
onChange?: ( onChange?: (
e: e:
| React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>
| React.KeyboardEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>,
) => void; ) => void;
onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => void; onFocus?: (e: React.FocusEvent<HTMLButtonElement>) => void;
onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => void; onBlur?: (e: React.FocusEvent<HTMLButtonElement>) => void;
@@ -72,7 +74,7 @@ const ToggleGroup = memo(
onChange(e); onChange(e);
} }
}, },
[onChange] [onChange],
); );
const handleFocus = useCallback( const handleFocus = useCallback(
@@ -81,7 +83,7 @@ const ToggleGroup = memo(
onFocus(e); onFocus(e);
} }
}, },
[onFocus] [onFocus],
); );
const handleBlur = useCallback( const handleBlur = useCallback(
@@ -90,7 +92,7 @@ const ToggleGroup = memo(
onBlur(e); onBlur(e);
} }
}, },
[onBlur] [onBlur],
); );
const handleKeyDown = useCallback( const handleKeyDown = useCallback(
@@ -102,7 +104,7 @@ const ToggleGroup = memo(
} }
} }
}, },
[onChange] [onChange],
); );
const toggleClasses = ` const toggleClasses = `
@@ -146,7 +148,7 @@ const ToggleGroup = memo(
{showText ? children : children || "☰"} {showText ? children : children || "☰"}
</button> </button>
); );
}) }),
); );
ToggleGroup.displayName = "ToggleGroup"; ToggleGroup.displayName = "ToggleGroup";
+1 -1
View File
@@ -116,7 +116,7 @@ const WebVitalsDashboard = memo(() => {
}, },
})); }));
}); });
} },
); );
} }
}, []); }, []);
@@ -8691,7 +8691,6 @@ function $b(e, t) {
--t && --t &&
Ze() && Ze() &&
!(De < 48 || De > 102 || (De > 57 && De < 65) || (De > 70 && De < 97)); !(De < 48 || De > 102 || (De > 57 && De < 65) || (De > 70 && De < 97));
); );
return io(e, Lo() + (t < 6 && Dt() == 32 && Ze() == 32)); return io(e, Lo() + (t < 6 && Dt() == 32 && Ze() == 32));
} }
@@ -8747,7 +8746,6 @@ function No(e, t, r, n, o, a, i, l, s) {
A = n, A = n,
S = w; S = w;
x; x;
) )
switch (((g = C), (C = Ze()))) { switch (((g = C), (C = Ze()))) {
case 40: case 40:
@@ -8934,7 +8932,6 @@ var wD = P(function (e, t, r) {
for ( for (
var n = 0, o = 0; var n = 0, o = 0;
(n = o), (o = Dt()), n === 38 && o === 12 && (t[r] = 1), !Un(o); (n = o), (o = Dt()), n === 38 && o === 12 && (t[r] = 1), !Un(o);
) )
Ze(); Ze();
return io(e, Je); return io(e, Je);
@@ -8972,7 +8969,6 @@ var wD = P(function (e, t, r) {
r = e.parent, r = e.parent,
n = e.column === r.column && e.line === r.line; n = e.column === r.column && e.line === r.line;
r.type !== "rule"; r.type !== "rule";
) )
if (((r = r.parent), !r)) return; if (((r = r.parent), !r)) return;
if ( if (
@@ -12469,7 +12465,6 @@ function H1(e, t, r, n, o, a, i, l, s) {
f++; f++;
}, "_loop"); }, "_loop");
f < d.length; f < d.length;
) )
v(); v();
if (c !== d.length - 1) { if (c !== d.length - 1) {
@@ -13261,7 +13256,6 @@ var q1,
for ( for (
var i = o || "", l = a || "div", s = {}, u = 0, d, p, c; var i = o || "", l = a || "div", s = {}, u = 0, d, p, c;
u < i.length; u < i.length;
) )
((r.lastIndex = u), ((r.lastIndex = u),
(c = r.exec(i)), (c = r.exec(i)),
@@ -13304,7 +13298,6 @@ var q1,
for ( for (
var l = [], s = String(i || n), u = s.indexOf(t), d = 0, p = !1, c; var l = [], s = String(i || n), u = s.indexOf(t), d = 0, p = !1, c;
!p; !p;
) )
(u === -1 && ((u = s.length), (p = !0)), (u === -1 && ((u = s.length), (p = !0)),
(c = s.slice(d, u).trim()), (c = s.slice(d, u).trim()),
@@ -13760,7 +13753,6 @@ var q1,
We--, We--,
be++; be++;
++We < be; ++We < be;
) )
if ( if (
(bt === f && (Ce = ke[pr] || 1), (bt = H.charCodeAt(We)), bt === x) (bt === f && (Ce = ke[pr] || 1), (bt = H.charCodeAt(We)), bt === x)
@@ -13794,7 +13786,6 @@ var q1,
Ap = I[qt], Ap = I[qt],
Ie--; Ie--;
++Ie < be && ((Ae = H.charCodeAt(Ie)), !!Ap(Ae)); ++Ie < be && ((Ae = H.charCodeAt(Ie)), !!Ap(Ae));
) )
((Me += u(Ae)), ((Me += u(Ae)),
qt === D && s.call(r, Me) && ((Ve = Me), (Pr = r[Me]))); qt === D && s.call(r, Me) && ((Ve = Me), (Pr = r[Me])));
@@ -14769,7 +14760,6 @@ var q1,
for ( for (
L = _[I], L = typeof L == "string" ? [L] : L, j = L.length, B = -1; L = _[I], L = typeof L == "string" ? [L] : L, j = L.length, B = -1;
++B < j; ++B < j;
) )
k[L[B]] = k[I]; k[L[B]] = k[I];
} }
-26
View File
@@ -1332,7 +1332,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
I = R.next(), I = R.next(),
b = 0; b = 0;
!I.done; !I.done;
) )
((S = h ? d.call(h, v, I.value, b) : I.value), ((S = h ? d.call(h, v, I.value, b) : I.value),
g ? ((f.value = S), p(w, b, f)) : (w[b] = S), g ? ((f.value = S), p(w, b, f)) : (w[b] = S),
@@ -1772,7 +1771,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
for ( for (
s = c[1][d], c[0].splice(d, 1), c[1].splice(d, 1); s = c[1][d], c[0].splice(d, 1), c[1].splice(d, 1);
!c[0].length && m.length; !c[0].length && m.length;
) )
((d = m.pop()), ((d = m.pop()),
(c = m.pop()), (c = m.pop()),
@@ -1853,7 +1851,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
for ( for (
l = d[1][f], d[0].splice(f, 1), d[1].splice(f, 1); l = d[1][f], d[0].splice(f, 1), d[1].splice(f, 1);
!d[0].length && p.length; !d[0].length && p.length;
) )
((f = p.pop()), ((f = p.pop()),
(d = p.pop()), (d = p.pop()),
@@ -2705,7 +2702,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
` || ` ||
c === "\r" || c === "\r" ||
c === "\f"; c === "\f";
) )
((b = !0), n++, (c = a.charAt(n))); ((b = !0), n++, (c = a.charAt(n)));
return b; return b;
@@ -2750,7 +2746,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
p(), p(),
(c = a.charAt(n)), (c = a.charAt(n)),
!(n >= l || c === "," || c === ")")); !(n >= l || c === "," || c === ")"));
) )
if (u[c]) { if (u[c]) {
var _ = c; var _ = c;
@@ -3728,7 +3723,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
xe = be.join(""), xe = be.join(""),
Me = []; Me = [];
xe.length; xe.length;
) )
(Me.push(parseInt(xe.substring(0, 8), 2)), (Me.push(parseInt(xe.substring(0, 8), 2)),
(xe = xe.substring(8))); (xe = xe.substring(8)));
@@ -5058,7 +5052,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
_ = [], _ = [],
F; F;
D > w; D > w;
) )
((F = g[w++]), ((F = g[w++]),
(!r || (b ? F in v : l(v, F))) && (!r || (b ? F in v : l(v, F))) &&
@@ -5275,7 +5268,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
for ( for (
var c = i(l), d = o(l), f = d.length, p = 0, m; var c = i(l), d = o(l), f = d.length, p = 0, m;
f > p; f > p;
) )
a.f(s, (m = d[p++]), c[m]); a.f(s, (m = d[p++]), c[m]);
return s; return s;
@@ -6666,7 +6658,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
i = "", i = "",
o = t.charCodeAt(0); o = t.charCodeAt(0);
++a < r; ++a < r;
) { ) {
if (((n = t.charCodeAt(a)), n == 0)) { if (((n = t.charCodeAt(a)), n == 0)) {
i += ""; i += "";
@@ -6956,12 +6947,10 @@ Consider to rely on 'then' or 'done' mode instead.`);
o.children.length && o.children.length &&
(a.push(r), (r = o.children.slice())); (a.push(r), (r = o.children.slice()));
!r.length && a.length; !r.length && a.length;
) )
r = a.pop(); r = a.pop();
}; };
r.length; r.length;
) )
n(); n();
return t; return t;
@@ -7546,7 +7535,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
for ( for (
var n = Array.isArray(t), i = n ? t[r] : t, o = ul(e, i); var n = Array.isArray(t), i = n ? t[r] : t, o = ul(e, i);
!o && a && e.parent; !o && a && e.parent;
) )
((e = e.parent), (o = ul(e, i))); ((e = e.parent), (o = ul(e, i)));
if (r > 0) { if (r > 0) {
@@ -7677,7 +7665,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
n < 16 && (t[a + n++] = pl[i]); n < 16 && (t[a + n++] = pl[i]);
}); });
n < 16; n < 16;
) )
t[a + n++] = 0; t[a + n++] = 0;
return t; return t;
@@ -9119,7 +9106,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
), ),
u = r ? o.nextNode() : o.currentNode; u = r ? o.nextNode() : o.currentNode;
u; u;
) { ) {
var s = le(u); var s = le(u);
(s && s.parent (s && s.parent
@@ -9534,7 +9520,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
a.shadowId === r.shadowId && a.shadowId === r.shadowId &&
!i && !i &&
(n.push(a), a.props.nodeName !== "legend"); (n.push(a), a.props.nodeName !== "legend");
) { ) {
if (a._inDisabledFieldset !== void 0) { if (a._inDisabledFieldset !== void 0) {
i = a._inDisabledFieldset; i = a._inDisabledFieldset;
@@ -9648,7 +9633,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
!o.find(function (v) { !o.find(function (v) {
return v.root === i.getRootNode(); return v.root === i.getRootNode();
}); });
) )
i = i.getRootNode().host; i = i.getRootNode().host;
if ( if (
@@ -15010,7 +14994,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
h = p, h = p,
v = bt(d, c); v = bt(d, c);
v - h > m; v - h > m;
) { ) {
var g = Ta(d); var g = Ta(d);
g = ir(g, { space: i, method: "clip" }); g = ir(g, { space: i, method: "clip" });
@@ -16253,7 +16236,6 @@ Consider to rely on 'then' or 'done' mode instead.`);
return Math.max(I, N); return Math.max(I, N);
}, 0); }, 0);
b > o; b > o;
) { ) {
b = 0; b = 0;
for (var D = 1; D < v.length && v.length < d; D++) { for (var D = 1; D < v.length && v.length < d; D++) {
@@ -19034,7 +19016,6 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`,
for ( for (
L.head.appendChild(a); L.head.appendChild(a);
(o = L.elementFromPoint(n, i)) && l.indexOf(o) === -1; (o = L.elementFromPoint(n, i)) && l.indexOf(o) === -1;
) )
(l.push(o), (l.push(o),
c.push({ c.push({
@@ -19048,7 +19029,6 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`,
l.push(L.documentElement)), l.push(L.documentElement)),
u = c.length; u = c.length;
(s = c[--u]); (s = c[--u]);
) )
l[u].style.setProperty( l[u].style.setProperty(
t, t,
@@ -19088,7 +19068,6 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`,
o = q1(i, t, null, e[0].shadowId, a.pop()), o = q1(i, t, null, e[0].shadowId, a.pop()),
u = []; u = [];
o.vNodesIndex < o.vNodes.length; o.vNodesIndex < o.vNodes.length;
) { ) {
for ( for (
var s, var s,
@@ -19151,7 +19130,6 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`,
c.children.length && c.children.length &&
(n.push(o), (o = q1(c.children, f, d, c.shadowId, a.pop()))); (n.push(o), (o = q1(c.children, f, d, c.shadowId, a.pop())));
o.vNodesIndex === o.vNodes.length && n.length; o.vNodesIndex === o.vNodes.length && n.length;
) )
(a.push(o), (o = n.pop())); (a.push(o), (o = n.pop()));
} }
@@ -32224,7 +32202,6 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`,
r.parent && r.parent &&
!r.parent._hasRegionDescendant && !r.parent._hasRegionDescendant &&
r.parent.actualNode !== L.body; r.parent.actualNode !== L.body;
) )
r = r.parent; r = r.parent;
return r; return r;
@@ -32327,7 +32304,6 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`,
for ( for (
var t = e, r = e.textContent.trim(), a = r; var t = e, r = e.textContent.trim(), a = r;
a === r && t !== void 0; a === r && t !== void 0;
) { ) {
var n = -1; var n = -1;
if (((e = t), e.children.length === 0)) return e; if (((e = t), e.children.length === 0)) return e;
@@ -34252,7 +34228,6 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`,
return !er(u); return !er(u);
})); }));
r; r;
) )
(r.nodeName.toUpperCase() === "LABEL" && (r.nodeName.toUpperCase() === "LABEL" &&
n.indexOf(r) === -1 && n.indexOf(r) === -1 &&
@@ -35367,7 +35342,6 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`,
} }
}; };
(r = n.shift()); (r = n.shift());
) )
i(); i();
return a; return a;
+4 -31
View File
@@ -7995,7 +7995,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
c = "", c = "",
d = o.charCodeAt(0); d = o.charCodeAt(0);
++u < i; ++u < i;
) { ) {
if (((l = o.charCodeAt(u)), l == 0)) { if (((l = o.charCodeAt(u)), l == 0)) {
c += ""; c += "";
@@ -15710,7 +15709,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
for ( for (
var d = l.length, p = "", f = 0, h = 0, m = c, y = r; var d = l.length, p = "", f = 0, h = 0, m = c, y = r;
c > -1 && c < d; c > -1 && c < d;
) { ) {
var b = u(l[c + 1], 4), var b = u(l[c + 1], 4),
g = u(l[c + 2], 0), g = u(l[c + 2], 0),
@@ -18394,7 +18392,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
for ( for (
var P = _; var P = _;
P < x.length - 1 && x[P].charCodeAt(1) + 1 === x[P + 1].charCodeAt(1); P < x.length - 1 && x[P].charCodeAt(1) + 1 === x[P + 1].charCodeAt(1);
) )
P += 1; P += 1;
var D = 1 + P - _; var D = 1 + P - _;
@@ -20086,7 +20083,6 @@ var rg = Mt("warn"),
for ( for (
r.push(t[0].replace(n, "%c").replace(a, "%c")); r.push(t[0].replace(n, "%c").replace(a, "%c"));
(o = n.exec(t[0])); (o = n.exec(t[0]));
) )
(r.push(o[2]), r.push("")); (r.push(o[2]), r.push(""));
for (let i = 1; i < t.length; i++) r.push(t[i]); for (let i = 1; i < t.length; i++) r.push(t[i]);
@@ -31017,7 +31013,6 @@ function Fr(e, t) {
for ( for (
var a = GT(n.length), o = em(r) ? Object(new r(a)) : new Array(a), i = 0, u; var a = GT(n.length), o = em(r) ? Object(new r(a)) : new Array(a), i = 0, u;
i < a; i < a;
) )
((u = n[i]), t ? (o[i] = t(u, i)) : (o[i] = u), (i += 1)); ((u = n[i]), t ? (o[i] = t(u, i)) : (o[i] = u), (i += 1));
return ((o.length = a), o); return ((o.length = a), o);
@@ -33355,7 +33350,6 @@ function gD() {
k = 0, k = 0,
I = !1; I = !1;
_ < D; _ < D;
) { ) {
switch (((L = Q[Q.length - 1]), L.tag)) { switch (((L = Q[Q.length - 1]), L.tag)) {
case "JS": case "JS":
@@ -36166,7 +36160,6 @@ function Ir(e, t) {
for ( for (
var a = pF(n.length), o = xm(r) ? Object(new r(a)) : new Array(a), i = 0, u; var a = pF(n.length), o = xm(r) ? Object(new r(a)) : new Array(a), i = 0, u;
i < a; i < a;
) )
((u = n[i]), t ? (o[i] = t(u, i)) : (o[i] = u), (i += 1)); ((u = n[i]), t ? (o[i] = t(u, i)) : (o[i] = u), (i += 1));
return ((o.length = a), o); return ((o.length = a), o);
@@ -41431,7 +41424,6 @@ function w0(e, t, r = !0) {
t === void 0 t === void 0
? n >= (r ? Math.max(e.childNodes.length - 1, 0) : 0) ? n >= (r ? Math.max(e.childNodes.length - 1, 0) : 0)
: n <= e.childNodes.length; : n <= e.childNodes.length;
) { ) {
if (t && n === e.childNodes.length) if (t && n === e.childNodes.length)
throw new Error("The given offset is out of bounds."); throw new Error("The given offset is out of bounds.");
@@ -49723,7 +49715,6 @@ var Ld = Se({
for ( for (
; ;
(b = y.exec(u)) && (!c || c.index + c[0].length !== u.length); (b = y.exec(u)) && (!c || c.index + c[0].length !== u.length);
) )
((!c || b.index + b[0].length !== c.index + c[0].length) && ((!c || b.index + b[0].length !== c.index + c[0].length) &&
(c = b), (c = b),
@@ -50727,9 +50718,8 @@ async function Uq(
) { ) {
let { renderElement: i, unmountElement: u } = await jt( let { renderElement: i, unmountElement: u } = await jt(
async () => { async () => {
const { renderElement: f, unmountElement: h } = await import( const { renderElement: f, unmountElement: h } =
"./react-18-TXN0K6I-.js" await import("./react-18-TXN0K6I-.js");
);
return { renderElement: f, unmountElement: h }; return { renderElement: f, unmountElement: h };
}, },
__vite__mapDeps([34, 3]), __vite__mapDeps([34, 3]),
@@ -55349,7 +55339,6 @@ var KM = $((...e) => {
E.push(new f(w, null, null, null)), E.push(new f(w, null, null, null)),
_.push(new f(null, null, null, null)); _.push(new f(null, null, null, null));
E.length; E.length;
) { ) {
if (((P = E.pop()), P === Q)) { if (((P = E.pop()), P === Q)) {
if ( if (
@@ -55414,7 +55403,6 @@ var KM = $((...e) => {
E.push(L), E.push(L),
_.push(L); _.push(L);
E.length; E.length;
) { ) {
if (((L = E.pop()), L === W)) { if (((L = E.pop()), L === W)) {
if ( if (
@@ -55512,7 +55500,6 @@ var KM = $((...e) => {
var T; var T;
L < _.length && L < _.length &&
((T = _[L]), !(T.extendedRange[1] > q.range[0])); ((T = _[L]), !(T.extendedRange[1] > q.range[0]));
) )
T.extendedRange[1] === q.range[0] T.extendedRange[1] === q.range[0]
? (q.leadingComments || (q.leadingComments = []), ? (q.leadingComments || (q.leadingComments = []),
@@ -55530,7 +55517,6 @@ var KM = $((...e) => {
var T; var T;
L < _.length && L < _.length &&
((T = _[L]), !(q.range[1] < T.extendedRange[0])); ((T = _[L]), !(q.range[1] < T.extendedRange[0]));
) )
q.range[1] === T.extendedRange[0] q.range[1] === T.extendedRange[0]
? (q.trailingComments || (q.trailingComments = []), ? (q.trailingComments || (q.trailingComments = []),
@@ -56656,7 +56642,6 @@ var KM = $((...e) => {
for ( for (
var g = y.originalColumn; var g = y.originalColumn;
y && y.originalLine === p && y.originalColumn == g; y && y.originalLine === p && y.originalColumn == g;
) )
(h.push({ (h.push({
line: t.getArg(y, "generatedLine", null), line: t.getArg(y, "generatedLine", null),
@@ -56784,7 +56769,6 @@ var KM = $((...e) => {
F, F,
L; L;
x < v; x < v;
) )
if (d.charAt(x) === ";") (f++, x++, (h = 0)); if (d.charAt(x) === ";") (f++, x++, (h = 0));
else if (d.charAt(x) === ",") x++; else if (d.charAt(x) === ",") x++;
@@ -57569,7 +57553,6 @@ var KM = $((...e) => {
(O = +(O.slice(0, j) + O.slice(j + 1)) + "")), (O = +(O.slice(0, j) + O.slice(j + 1)) + "")),
de = 0; de = 0;
O.charCodeAt(O.length + de - 1) === 48; O.charCodeAt(O.length + de - 1) === 48;
) )
--de; --de;
return ( return (
@@ -57770,7 +57753,6 @@ var KM = $((...e) => {
for ( for (
de = j[O], le = 0; de = j[O], le = 0;
le < de.length && i.code.isWhiteSpace(de.charCodeAt(le)); le < de.length && i.code.isWhiteSpace(de.charCodeAt(le));
) )
++le; ++le;
me > le && (me = le); me > le && (me = le);
@@ -60583,7 +60565,6 @@ var Qs,
this.expect(U.braceL), this.expect(U.braceL),
e && this.enterScope(0); e && this.enterScope(0);
this.type !== U.braceR; this.type !== U.braceR;
) { ) {
var n = this.parseStatement(null); var n = this.parseStatement(null);
t.body.push(n); t.body.push(n);
@@ -61502,7 +61483,6 @@ var Qs,
this.potentialArrowAt === e.start, this.potentialArrowAt === e.start,
o = !1; o = !1;
; ;
) { ) {
var i = this.parseSubscript(e, t, r, n, a, o); var i = this.parseSubscript(e, t, r, n, a, o);
if ( if (
@@ -62881,7 +62861,6 @@ var Qs,
for ( for (
e.lastStringValue += Ys(e.lastIntValue); e.lastStringValue += Ys(e.lastIntValue);
this.regexp_eatRegExpIdentifierPart(e); this.regexp_eatRegExpIdentifierPart(e);
) )
e.lastStringValue += Ys(e.lastIntValue); e.lastStringValue += Ys(e.lastIntValue);
return !0; return !0;
@@ -63305,7 +63284,6 @@ var Qs,
r = this.options.onComment && this.curPosition(), r = this.options.onComment && this.curPosition(),
n = this.input.charCodeAt((this.pos += e)); n = this.input.charCodeAt((this.pos += e));
this.pos < this.input.length && !io(n); this.pos < this.input.length && !io(n);
) )
n = this.input.charCodeAt(++this.pos); n = this.input.charCodeAt(++this.pos);
this.options.onComment && this.options.onComment &&
@@ -63863,7 +63841,6 @@ var Qs,
for ( for (
var e = "", t = !0, r = this.pos, n = this.options.ecmaVersion >= 6; var e = "", t = !0, r = this.pos, n = this.options.ecmaVersion >= 6;
this.pos < this.input.length; this.pos < this.input.length;
) { ) {
var a = this.fullCharCodeAtPos(); var a = this.fullCharCodeAtPos();
if (ha(a, n)) this.pos += a <= 65535 ? 1 : 2; if (ha(a, n)) this.pos += a <= 65535 ? 1 : 2;
@@ -64407,7 +64384,6 @@ var Qs,
!c.allowNamespacedObjects && !c.allowNamespacedObjects &&
this.unexpected(); this.unexpected();
this.eat(h.dot); this.eat(h.dot);
) { ) {
let P = this.startNodeAt(C, E); let P = this.startNodeAt(C, E);
((P.object = _), ((P.object = _),
@@ -64479,7 +64455,6 @@ var Qs,
for ( for (
P && (_.name = P); P && (_.name = P);
this.type !== h.slash && this.type !== m.jsxTagEnd; this.type !== h.slash && this.type !== m.jsxTagEnd;
) )
_.attributes.push(this.jsx_parseAttribute()); _.attributes.push(this.jsx_parseAttribute());
return ( return (
@@ -70025,7 +70000,6 @@ function VB() {
return K; return K;
}; };
E < g.length; E < g.length;
) { ) {
var L = P("CHAR"), var L = P("CHAR"),
q = P("NAME"), q = P("NAME"),
@@ -75268,9 +75242,8 @@ var R1 = !1,
) { ) {
if (!R1) { if (!R1) {
let { toHaveNoViolations: p } = await jt(async () => { let { toHaveNoViolations: p } = await jt(async () => {
const { toHaveNoViolations: f } = await import( const { toHaveNoViolations: f } =
"./matchers-7Z3WT2CE-CcSi9QFY.js" await import("./matchers-7Z3WT2CE-CcSi9QFY.js");
);
return { toHaveNoViolations: f }; return { toHaveNoViolations: f };
}, []); }, []);
(S1.extend({ toHaveNoViolations: p }), (R1 = !0)); (S1.extend({ toHaveNoViolations: p }), (R1 = !0));
-10
View File
@@ -123,7 +123,6 @@ function zd() {
for ( for (
Ua(g), Tl = K(Jl); Ua(g), Tl = K(Jl);
Tl !== null && !(Tl.expirationTime > g && ye()); Tl !== null && !(Tl.expirationTime > g && ye());
) { ) {
var p = Tl.callback; var p = Tl.callback;
if (typeof p == "function") { if (typeof p == "function") {
@@ -1059,7 +1058,6 @@ function Ad() {
for ( for (
e = t = 0; e = t = 0;
t < i.length && !i[t].includes("DetermineComponentFrameRoot"); t < i.length && !i[t].includes("DetermineComponentFrameRoot");
) )
t++; t++;
for (; e < d.length && !d[e].includes("DetermineComponentFrameRoot"); ) for (; e < d.length && !d[e].includes("DetermineComponentFrameRoot"); )
@@ -1068,7 +1066,6 @@ function Ad() {
for ( for (
t = i.length - 1, e = d.length - 1; t = i.length - 1, e = d.length - 1;
1 <= t && 0 <= e && i[t] !== d[e]; 1 <= t && 0 <= e && i[t] !== d[e];
) )
e--; e--;
for (; 1 <= t && 0 <= e; t--, e--) for (; 1 <= t && 0 <= e; t--, e--)
@@ -5220,7 +5217,6 @@ Error generating stack: ` +
for ( for (
l = a.child, u = Ca(l, l.pendingProps), a.child = u, u.return = a; l = a.child, u = Ca(l, l.pendingProps), a.child = u, u.return = a;
l.sibling !== null; l.sibling !== null;
) )
((l = l.sibling), ((l = l.sibling),
(u = u.sibling = Ca(l, l.pendingProps)), (u = u.sibling = Ca(l, l.pendingProps)),
@@ -5368,7 +5364,6 @@ Error generating stack: ` +
u = k0(a, null, t, u), u = k0(a, null, t, u),
a.child = u; a.child = u;
u; u;
) )
((u.flags = (u.flags & -3) | 4096), (u = u.sibling)); ((u.flags = (u.flags & -3) | 4096), (u = u.sibling));
} }
@@ -5696,7 +5691,6 @@ Error generating stack: ` +
for ( for (
l.sibling.return = l.return, l = l.sibling; l.sibling.return = l.return, l = l.sibling;
l.tag !== 5 && l.tag !== 6 && l.tag !== 18; l.tag !== 5 && l.tag !== 6 && l.tag !== 18;
) { ) {
if ( if (
(l.tag === 27 && wa(l.type)) || (l.tag === 27 && wa(l.type)) ||
@@ -5799,7 +5793,6 @@ Error generating stack: ` +
T !== n || (t !== 0 && T.nodeType !== 3) || (i = f + t), T !== n || (t !== 0 && T.nodeType !== 3) || (i = f + t),
T.nodeType === 3 && (f += T.nodeValue.length), T.nodeType === 3 && (f += T.nodeValue.length),
(m = T.firstChild) !== null; (m = T.firstChild) !== null;
) )
((s = T), (T = m)); ((s = T), (T = m));
for (;;) { for (;;) {
@@ -5822,7 +5815,6 @@ Error generating stack: ` +
for ( for (
qc = { focusedElem: l, selectionRange: u }, on = !1, yl = a; qc = { focusedElem: l, selectionRange: u }, on = !1, yl = a;
yl !== null; yl !== null;
) )
if ( if (
((a = yl), (l = a.child), (a.subtreeFlags & 1024) !== 0 && l !== null) ((a = yl), (l = a.child), (a.subtreeFlags & 1024) !== 0 && l !== null)
@@ -7545,7 +7537,6 @@ Error generating stack: ` +
l = u, l = u,
u = a.child; u = a.child;
u !== null; u !== null;
) )
(X1(u, l), (u = u.sibling)); (X1(u, l), (u = u.sibling));
return (Z(nl, (nl.current & 1) | 2), a.child); return (Z(nl, (nl.current & 1) | 2), a.child);
@@ -8650,7 +8641,6 @@ Error generating stack: ` +
e = l.expirationTimes, e = l.expirationTimes,
n = l.pendingLanes & -62914561; n = l.pendingLanes & -62914561;
0 < n; 0 < n;
) { ) {
var f = 31 - Nl(n), var f = 31 - Nl(n),
c = 1 << f, c = 1 << f,
@@ -16781,7 +16781,6 @@ try {
for ( for (
var t = bn(10) ? document.body : null, n = e.offsetParent || null; var t = bn(10) ? document.body : null, n = e.offsetParent || null;
n === t && e.nextElementSibling; n === t && e.nextElementSibling;
) )
n = (e = e.nextElementSibling).offsetParent; n = (e = e.nextElementSibling).offsetParent;
var r = n && n.nodeName; var r = n && n.nodeName;
@@ -18136,7 +18135,6 @@ try {
r = new DataView(t.buffer), r = new DataView(t.buffer),
i = e.byteLength; i = e.byteLength;
i--; i--;
) )
if (n.getUint8(i) !== r.getUint8(i)) return !1; if (n.getUint8(i) !== r.getUint8(i)) return !1;
return !0; return !0;
@@ -1457,7 +1457,6 @@ try {
for ( for (
var t = Xe(10) ? document.body : null, n = e.offsetParent || null; var t = Xe(10) ? document.body : null, n = e.offsetParent || null;
n === t && e.nextElementSibling; n === t && e.nextElementSibling;
) )
n = (e = e.nextElementSibling).offsetParent; n = (e = e.nextElementSibling).offsetParent;
var r = n && n.nodeName; var r = n && n.nodeName;
@@ -2457,7 +2456,6 @@ try {
r = new DataView(t.buffer), r = new DataView(t.buffer),
o = e.byteLength; o = e.byteLength;
o--; o--;
) )
if (n.getUint8(o) !== r.getUint8(o)) return !1; if (n.getUint8(o) !== r.getUint8(o)) return !1;
return !0; return !0;
@@ -1702,7 +1702,6 @@ This is deprecated and won't work in Storybook 8 anymore.
for ( for (
var d = l.length, m = "", p = 0, f = 0, g = u, y = r; var d = l.length, m = "", p = 0, f = 0, g = u, y = r;
u > -1 && u < d; u > -1 && u < d;
) { ) {
var E = s(l[u + 1], 4), var E = s(l[u + 1], 4),
b = s(l[u + 2], 0), b = s(l[u + 2], 0),
@@ -4407,7 +4406,6 @@ This is deprecated and won't work in Storybook 8 anymore.
var P = B; var P = B;
P < S.length - 1 && P < S.length - 1 &&
S[P].charCodeAt(1) + 1 === S[P + 1].charCodeAt(1); S[P].charCodeAt(1) + 1 === S[P + 1].charCodeAt(1);
) )
P += 1; P += 1;
var L = 1 + P - B; var L = 1 + P - B;
@@ -21503,7 +21501,6 @@ ${S.description}`);
var P = B; var P = B;
P < S.length - 1 && P < S.length - 1 &&
S[P].charCodeAt(1) + 1 === S[P + 1].charCodeAt(1); S[P].charCodeAt(1) + 1 === S[P + 1].charCodeAt(1);
) )
P += 1; P += 1;
var L = 1 + P - B; var L = 1 + P - B;
-29
View File
@@ -569,7 +569,6 @@ var T9 = R((Ge) => {
for ( for (
rC(t), kn = Eo(aa); rC(t), kn = Eo(aa);
kn !== null && (!(kn.expirationTime > t) || (e && !P9())); kn !== null && (!(kn.expirationTime > t) || (e && !P9()));
) { ) {
var n = kn.callback; var n = kn.callback;
if (typeof n == "function") { if (typeof n == "function") {
@@ -1076,7 +1075,6 @@ al vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mod
s = o.length - 1, s = o.length - 1,
l = i.length - 1; l = i.length - 1;
1 <= s && 0 <= l && o[s] !== i[l]; 1 <= s && 0 <= l && o[s] !== i[l];
) )
l--; l--;
for (; 1 <= s && 0 <= l; s--, l--) for (; 1 <= s && 0 <= l; s--, l--)
@@ -1496,7 +1494,6 @@ al vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mod
p0.innerHTML = "<svg>" + t.valueOf().toString() + "</svg>", p0.innerHTML = "<svg>" + t.valueOf().toString() + "</svg>",
t = p0.firstChild; t = p0.firstChild;
e.firstChild; e.firstChild;
) )
e.removeChild(e.firstChild); e.removeChild(e.firstChild);
for (; t.firstChild; ) e.appendChild(t.firstChild); for (; t.firstChild; ) e.appendChild(t.firstChild);
@@ -2022,7 +2019,6 @@ al vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mod
o = e.expirationTimes, o = e.expirationTimes,
i = e.pendingLanes; i = e.pendingLanes;
0 < i; 0 < i;
) { ) {
var s = 31 - _o(i), var s = 31 - _o(i),
l = 1 << s, l = 1 << s,
@@ -3989,7 +3985,6 @@ _reactEvents$" + Zu,
for ( for (
e = e.return; e = e.return;
e !== null && e.tag !== 5 && e.tag !== 3 && e.tag !== 13; e !== null && e.tag !== 5 && e.tag !== 3 && e.tag !== 13;
) )
e = e.return; e = e.return;
gn = e; gn = e;
@@ -6251,7 +6246,6 @@ on" &&
for ( for (
e = t.child, r = Li(e, e.pendingProps), t.child = r, r.return = t; e = t.child, r = Li(e, e.pendingProps), t.child = r, r.return = t;
e.sibling !== null; e.sibling !== null;
) )
((e = e.sibling), ((e = e.sibling),
(r = r.sibling = Li(e, e.pendingProps)), (r = r.sibling = Li(e, e.pendingProps)),
@@ -6803,7 +6797,6 @@ oll",
n = r, n = r,
r = t.child; r = t.child;
r !== null; r !== null;
) )
((i = r), ((i = r),
(e = n), (e = n),
@@ -7006,7 +6999,6 @@ oll",
f !== i || (n !== 0 && f.nodeType !== 3) || (u = s + n), f !== i || (n !== 0 && f.nodeType !== 3) || (u = s + n),
f.nodeType === 3 && (s += f.nodeValue.length), f.nodeType === 3 && (s += f.nodeValue.length),
(m = f.firstChild) !== null; (m = f.firstChild) !== null;
) )
((p = f), (f = m)); ((p = f), (f = m));
for (;;) { for (;;) {
@@ -7029,7 +7021,6 @@ oll",
for ( for (
JC = { focusedElem: e, selectionRange: r }, V0 = !1, ae = t; JC = { focusedElem: e, selectionRange: r }, V0 = !1, ae = t;
ae !== null; ae !== null;
) )
if ( if (
((t = ae), (e = t.child), (t.subtreeFlags & 1028) !== 0 && e !== null) ((t = ae), (e = t.child), (t.subtreeFlags & 1028) !== 0 && e !== null)
@@ -7167,7 +7158,6 @@ oll",
for ( for (
e.sibling.return = e.return, e = e.sibling; e.sibling.return = e.return, e = e.sibling;
e.tag !== 5 && e.tag !== 6 && e.tag !== 18; e.tag !== 5 && e.tag !== 6 && e.tag !== 18;
) { ) {
if (e.flags & 2 || e.child === null || e.tag === 4) continue e; if (e.flags & 2 || e.child === null || e.tag === 4) continue e;
((e.child.return = e), (e = e.child)); ((e.child.return = e), (e = e.child));
@@ -8083,7 +8073,6 @@ oll",
e.pingedLanes &= ~t, e.pingedLanes &= ~t,
e = e.expirationTimes; e = e.expirationTimes;
0 < t; 0 < t;
) { ) {
var r = 31 - _o(t), var r = 31 - _o(t),
n = 1 << r; n = 1 << r;
@@ -8782,7 +8771,6 @@ oll",
r = Dk(t, null, n, r), r = Dk(t, null, n, r),
t.child = r; t.child = r;
r; r;
) )
((r.flags = (r.flags & -3) | 4096), (r = r.sibling)); ((r.flags = (r.flags & -3) | 4096), (r = r.sibling));
else { else {
@@ -9783,7 +9771,6 @@ var zge,
for ( for (
r.push(t[0].replace(n, "%c").replace(o, "%c")); r.push(t[0].replace(n, "%c").replace(o, "%c"));
(i = n.exec(t[0])); (i = n.exec(t[0]));
) )
(r.push(i[2]), r.push("")); (r.push(i[2]), r.push(""));
for (let s = 1; s < t.length; s++) r.push(t[s]); for (let s = 1; s < t.length; s++) r.push(t[s]);
@@ -10076,7 +10063,6 @@ function xD(e, t) {
--t && --t &&
Fr() && Fr() &&
!(Mt < 48 || Mt > 102 || (Mt > 57 && Mt < 65) || (Mt > 70 && Mt < 97)); !(Mt < 48 || Mt > 102 || (Mt > 57 && Mt < 65) || (Mt > 70 && Mt < 97));
); );
return vc(e, dp() + (t < 6 && zn() == 32 && Fr() == 32)); return vc(e, dp() + (t < 6 && zn() == 32 && Fr() == 32));
} }
@@ -10160,7 +10146,6 @@ function Dg(e, t, r, n, o, i, s, l, u) {
C = n, C = n,
_ = E; _ = E;
b; b;
) )
switch (((v = w), (w = Fr()))) { switch (((v = w), (w = Fr()))) {
// ( // (
@@ -10621,7 +10606,6 @@ var obe,
for ( for (
var o = 0, i = 0; var o = 0, i = 0;
(o = i), (i = zn()), o === 38 && i === 12 && (r[n] = 1), !hc(i); (o = i), (i = zn()), o === 38 && i === 12 && (r[n] = 1), !hc(i);
) )
Fr(); Fr();
return vc(t, Dr); return vc(t, Dr);
@@ -10668,7 +10652,6 @@ var obe,
n = t.parent, n = t.parent,
o = t.column === n.column && t.line === n.line; o = t.column === n.column && t.line === n.line;
n.type !== "rule"; n.type !== "rule";
) )
if (((n = n.parent), !n)) return; if (((n = n.parent), !n)) return;
if ( if (
@@ -14781,7 +14764,6 @@ function rwe(e, t, r, n, o, i, s, l, u) {
m++; m++;
}, "_loop"); }, "_loop");
m < d.length; m < d.length;
) )
g(); g();
if (p !== d.length - 1) { if (p !== d.length - 1) {
@@ -15748,7 +15730,6 @@ var hB = R((Wmt, mB) => {
for ( for (
var r = e || "", n = t || "div", o = {}, i = 0, s, l, u; var r = e || "", n = t || "div", o = {}, i = 0, s, l, u;
i < r.length; i < r.length;
) )
((pB.lastIndex = i), ((pB.lastIndex = i),
(u = pB.exec(r)), (u = pB.exec(r)),
@@ -15799,7 +15780,6 @@ var bB = R((N3) => {
for ( for (
var t = [], r = String(e || Pp), n = r.indexOf(M3), o = 0, i = !1, s; var t = [], r = String(e || Pp), n = r.indexOf(M3), o = 0, i = !1, s;
!i; !i;
) )
(n === -1 && ((n = r.length), (i = !0)), (n === -1 && ((n = r.length), (i = !0)),
(s = r.slice(o, n).trim()), (s = r.slice(o, n).trim()),
@@ -16294,7 +16274,6 @@ hexadecimal",
m--, m--,
p++; p++;
++m < p; ++m < p;
) )
if ((_ === WB && (y = f[v] || 1), (_ = e.charCodeAt(m)), _ === GB)) { if ((_ === WB && (y = f[v] || 1), (_ = e.charCodeAt(m)), _ === GB)) {
if ( if (
@@ -16326,7 +16305,6 @@ hexadecimal",
V = _1[D], V = _1[D],
se--; se--;
++se < p && ((O = e.charCodeAt(se)), !!V(O)); ++se < p && ((O = e.charCodeAt(se)), !!V(O));
) )
((C += Oc(O)), D === Ic && REe.call(zB, C) && ((E = C), (Q = zB[C]))); ((C += Oc(O)), D === Ic && REe.call(zB, C) && ((E = C), (Q = zB[C])));
((S = e.charCodeAt(se) === PEe), ((S = e.charCodeAt(se) === PEe),
@@ -17782,7 +17760,6 @@ var m$ = R((_ht, p$) => {
for ( for (
i = n[o], i = typeof i == "string" ? [i] : i, s = i.length, l = -1; i = n[o], i = typeof i == "string" ? [i] : i, s = i.length, l = -1;
++l < s; ++l < s;
) )
r[i[l]] = r[o]; r[i[l]] = r[o];
} }
@@ -24041,7 +24018,6 @@ var NW = R((dCt, MW) => {
for ( for (
var r = e.length, n = "", o = 0, i = 0, s = t, l = OW; var r = e.length, n = "", o = 0, i = 0, s = t, l = OW;
t > -1 && t < r; t > -1 && t < r;
) { ) {
var u = IW(e[t + 1], 4), var u = IW(e[t + 1], 4),
c = IW(e[t + 2], 0), c = IW(e[t + 2], 0),
@@ -35219,7 +35195,6 @@ var W6 = R((V6, Fre) => {
for ( for (
var n = String(r), o = n.length, i = -1, s, l = "", u = n.charCodeAt(0); var n = String(r), o = n.length, i = -1, s, l = "", u = n.charCodeAt(0);
++i < o; ++i < o;
) { ) {
if (((s = n.charCodeAt(i)), s == 0)) { if (((s = n.charCodeAt(i)), s == 0)) {
l += "\uFFFD"; l += "\uFFFD";
@@ -71648,7 +71623,6 @@ function An(e, t) {
s = 0, s = 0,
l; l;
s < o; s < o;
) )
((l = n[s]), t ? (i[s] = t(l, s)) : (i[s] = l), (s += 1)); ((l = n[s]), t ? (i[s] = t(l, s)) : (i[s] = l), (s += 1));
return ((i.length = o), i); return ((i.length = o), i);
@@ -74091,7 +74065,6 @@ function zBe() {
$ = 0, $ = 0,
D = !1; D = !1;
A < q; A < q;
) { ) {
switch (((U = G[G.length - 1]), U.tag)) { switch (((U = G[G.length - 1]), U.tag)) {
case "JS": case "JS":
@@ -77069,7 +77042,6 @@ function On(e, t) {
s = 0, s = 0,
l; l;
s < o; s < o;
) )
((l = n[s]), t ? (i[s] = t(l, s)) : (i[s] = l), (s += 1)); ((l = n[s]), t ? (i[s] = t(l, s)) : (i[s] = l), (s += 1));
return ((i.length = o), i); return ((i.length = o), i);
@@ -83614,7 +83586,6 @@ function zce(e, t, r = !0) {
t === void 0 t === void 0
? n >= (r ? Math.max(e.childNodes.length - 1, 0) : 0) ? n >= (r ? Math.max(e.childNodes.length - 1, 0) : 0)
: n <= e.childNodes.length; : n <= e.childNodes.length;
) { ) {
if (t && n === e.childNodes.length) if (t && n === e.childNodes.length)
throw new Error("The given offset is out of bounds."); throw new Error("The given offset is out of bounds.");
-1
View File
@@ -695,7 +695,6 @@ var su = we((_A, iu) => {
for ( for (
var o = e.length, i = "", r = 0, n = 0, l = t, u = ru; var o = e.length, i = "", r = 0, n = 0, l = t, u = ru;
t > -1 && t < o; t > -1 && t < o;
) { ) {
var c = nu(e[t + 1], 4), var c = nu(e[t + 1], 4),
d = nu(e[t + 2], 0), d = nu(e[t + 2], 0),
-1
View File
@@ -861,7 +861,6 @@ function ze() {
J = 0, J = 0,
S = !1; S = !1;
p < L; p < L;
) { ) {
switch ((($ = E[E.length - 1]), $.tag)) { switch ((($ = E[E.length - 1]), $.tag)) {
case "JS": case "JS":
+4 -1
View File
@@ -206,7 +206,10 @@ export function getCacheStats(): CacheStats {
tagCacheSize: tagCache.size, tagCacheSize: tagCache.size,
authorCacheSize: authorCache.size, authorCacheSize: authorCache.size,
totalCacheSize: totalCacheSize:
blogPostCache.size + blogListCache.size + tagCache.size + authorCache.size, blogPostCache.size +
blogListCache.size +
tagCache.size +
authorCache.size,
maxCacheSize: MAX_CACHE_SIZE, maxCacheSize: MAX_CACHE_SIZE,
cacheTTL: CACHE_TTL, cacheTTL: CACHE_TTL,
}; };
+2 -5
View File
@@ -1,11 +1,8 @@
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
import matter from "gray-matter"; import matter from "gray-matter";
import { import { validateBlogPost, sanitizeBlogPost } from "./validation";
validateBlogPost, import type { BlogPostFrontmatter } from "./validation";
sanitizeBlogPost,
type BlogPostFrontmatter,
} from "./validation";
/** /**
* Content processing utilities for blog posts * Content processing utilities for blog posts
+3 -11
View File
@@ -3,15 +3,9 @@
*/ */
// Re-export types from other modules for convenience // Re-export types from other modules for convenience
export type { export type { BlogPost, BlogStats } from "./content";
BlogPost,
BlogStats,
} from "./content";
export type { export type { BlogPostFrontmatter, ValidationResult } from "./validation";
BlogPostFrontmatter,
ValidationResult,
} from "./validation";
export type { export type {
Heading, Heading,
@@ -21,9 +15,7 @@ export type {
ProcessedFrontmatter, ProcessedFrontmatter,
} from "./mdx"; } from "./mdx";
export type { export type { CacheStats } from "./cache";
CacheStats,
} from "./cache";
// Additional shared types // Additional shared types
export interface ComponentProps { export interface ComponentProps {
+1 -1
View File
@@ -1,4 +1,4 @@
import Button from "../app/components/Button.js"; import Button from "../app/components/Button";
import { within, userEvent } from "@storybook/test"; import { within, userEvent } from "@storybook/test";
export default { export default {
+1 -1
View File
@@ -1,4 +1,4 @@
import Footer from "../app/components/Footer.js"; import Footer from "../app/components/Footer";
import { within, userEvent } from "@storybook/test"; import { within, userEvent } from "@storybook/test";
export default { export default {
+1 -1
View File
@@ -1,4 +1,4 @@
import Header from "../app/components/Header.js"; import Header from "../app/components/Header";
export default { export default {
title: "Components/Header/Responsive", title: "Components/Header/Responsive",
+27 -25
View File
@@ -14,7 +14,7 @@ describe("Layout Integration", () => {
<div> <div>
<Header /> <Header />
<Footer /> <Footer />
</div>, </div>
); );
// Check that CommunityRule branding appears in both header and footer // Check that CommunityRule branding appears in both header and footer
@@ -30,31 +30,33 @@ describe("Layout Integration", () => {
<div> <div>
<Header /> <Header />
<Footer /> <Footer />
</div>, </div>
); );
// Header navigation items // Header navigation items
expect( expect(
screen.getAllByRole("menuitem", { name: "Navigate to Use cases page" }) screen.getAllByRole("menuitem", { name: "Navigate to Use cases page" })
.length, .length
).toBeGreaterThan(0); ).toBeGreaterThan(0);
expect( expect(
screen.getAllByRole("menuitem", { name: "Navigate to Learn page" }) screen.getAllByRole("menuitem", { name: "Navigate to Learn page" }).length
.length,
).toBeGreaterThan(0); ).toBeGreaterThan(0);
expect( expect(
screen.getAllByRole("menuitem", { name: "Navigate to About page" }) screen.getAllByRole("menuitem", { name: "Navigate to About page" }).length
.length,
).toBeGreaterThan(0); ).toBeGreaterThan(0);
// Footer navigation items (should be present in footer as well) // Footer navigation items (should be present in footer as well)
const useCasesLinks = screen.getAllByRole("link", { name: "Use cases" }); // Footer has navigation links that match header
const learnLinks = screen.getAllByRole("link", { name: "Learn" }); const footerUseCasesLinks = screen.getAllByRole("link", {
const aboutLinks = screen.getAllByRole("link", { name: "About" }); name: "Use cases",
});
const footerLearnLinks = screen.getAllByRole("link", { name: "Learn" });
const footerAboutLinks = screen.getAllByRole("link", { name: "About" });
expect(useCasesLinks.length).toBeGreaterThan(0); // Check that footer has these links (they may be in header too, so getAllByRole will find both)
expect(learnLinks.length).toBeGreaterThan(0); expect(footerUseCasesLinks.length).toBeGreaterThan(0);
expect(aboutLinks.length).toBeGreaterThan(0); expect(footerLearnLinks.length).toBeGreaterThan(0);
expect(footerAboutLinks.length).toBeGreaterThan(0);
}); });
test("header navigation is interactive", async () => { test("header navigation is interactive", async () => {
@@ -94,23 +96,23 @@ describe("Layout Integration", () => {
// Contact information // Contact information
expect(screen.getByText("medlab@colorado.edu")).toBeInTheDocument(); expect(screen.getByText("medlab@colorado.edu")).toBeInTheDocument();
expect( expect(
screen.getByRole("link", { name: "medlab@colorado.edu" }), screen.getByRole("link", { name: "medlab@colorado.edu" })
).toHaveAttribute("href", "mailto:medlab@colorado.edu"); ).toHaveAttribute("href", "mailto:medlab@colorado.edu");
// Social media links // Social media links
expect( expect(
screen.getByRole("link", { name: "Follow us on Bluesky" }), screen.getByRole("link", { name: "Follow us on Bluesky" })
).toBeInTheDocument(); ).toBeInTheDocument();
expect( expect(
screen.getByRole("link", { name: "Follow us on GitLab" }), screen.getByRole("link", { name: "Follow us on GitLab" })
).toBeInTheDocument(); ).toBeInTheDocument();
// Legal links // Legal links
expect( expect(
screen.getByRole("link", { name: "Privacy Policy" }), screen.getByRole("link", { name: "Privacy Policy" })
).toBeInTheDocument(); ).toBeInTheDocument();
expect( expect(
screen.getByRole("link", { name: "Terms of Service" }), screen.getByRole("link", { name: "Terms of Service" })
).toBeInTheDocument(); ).toBeInTheDocument();
}); });
@@ -136,7 +138,7 @@ describe("Layout Integration", () => {
<div> <div>
<Header /> <Header />
<Footer /> <Footer />
</div>, </div>
); );
// Header should have banner role // Header should have banner role
@@ -157,7 +159,7 @@ describe("Layout Integration", () => {
<div> <div>
<Header /> <Header />
<Footer /> <Footer />
</div>, </div>
); );
// Header should have responsive navigation elements // Header should have responsive navigation elements
@@ -174,7 +176,7 @@ describe("Layout Integration", () => {
<div> <div>
<Header /> <Header />
<Footer /> <Footer />
</div>, </div>
); );
// Get all interactive elements // Get all interactive elements
@@ -197,7 +199,7 @@ describe("Layout Integration", () => {
<div> <div>
<Header /> <Header />
<Footer /> <Footer />
</div>, </div>
); );
// Header provides main navigation // Header provides main navigation
@@ -217,7 +219,7 @@ describe("Layout Integration", () => {
<div> <div>
<Header /> <Header />
<Footer /> <Footer />
</div>, </div>
); );
// Main navigation in header // Main navigation in header
@@ -230,13 +232,13 @@ describe("Layout Integration", () => {
(link) => (link) =>
link.textContent?.includes("Use cases") || link.textContent?.includes("Use cases") ||
link.textContent?.includes("Learn") || link.textContent?.includes("Learn") ||
link.textContent?.includes("About"), link.textContent?.includes("About")
); );
expect(navigationLinks.length).toBeGreaterThan(0); expect(navigationLinks.length).toBeGreaterThan(0);
// Contact information in footer // Contact information in footer
expect( expect(
screen.getByRole("link", { name: "medlab@colorado.edu" }), screen.getByRole("link", { name: "medlab@colorado.edu" })
).toBeInTheDocument(); ).toBeInTheDocument();
}); });
}); });
+2 -3
View File
@@ -111,9 +111,8 @@ describe("BlogPostPage", () => {
vi.clearAllMocks(); vi.clearAllMocks();
// Mock the content functions // Mock the content functions
const { getBlogPostBySlug, getAllBlogPosts } = await import( const { getBlogPostBySlug, getAllBlogPosts } =
"../../lib/content" await import("../../lib/content");
);
vi.mocked(getBlogPostBySlug).mockReturnValue(mockPost); vi.mocked(getBlogPostBySlug).mockReturnValue(mockPost);
vi.mocked(getAllBlogPosts).mockReturnValue([mockPost, ...mockRelatedPosts]); vi.mocked(getAllBlogPosts).mockReturnValue([mockPost, ...mockRelatedPosts]);
}); });
+15 -15
View File
@@ -27,7 +27,7 @@ describe("Footer", () => {
expect(schemaData.email).toBe("medlab@colorado.edu"); expect(schemaData.email).toBe("medlab@colorado.edu");
expect(schemaData.url).toBe("https://communityrule.com"); expect(schemaData.url).toBe("https://communityrule.com");
expect(schemaData.sameAs).toContain( expect(schemaData.sameAs).toContain(
"https://bsky.app/profile/medlabboulder", "https://bsky.app/profile/medlabboulder"
); );
expect(schemaData.sameAs).toContain("https://gitlab.com/medlabboulder"); expect(schemaData.sameAs).toContain("https://gitlab.com/medlabboulder");
}); });
@@ -36,7 +36,7 @@ describe("Footer", () => {
render(<Footer />); render(<Footer />);
expect( expect(
screen.getAllByText("Media Economies Design Lab").length, screen.getAllByText("Media Economies Design Lab").length
).toBeGreaterThan(0); ).toBeGreaterThan(0);
const emailLinks = screen.getAllByRole("link", { const emailLinks = screen.getAllByRole("link", {
@@ -86,13 +86,13 @@ describe("Footer", () => {
render(<Footer />); render(<Footer />);
expect( expect(
screen.getAllByRole("link", { name: "Use cases" }).length, screen.getAllByRole("link", { name: "Use cases" }).length
).toBeGreaterThan(0); ).toBeGreaterThan(0);
expect( expect(
screen.getAllByRole("link", { name: "Learn" }).length, screen.getAllByRole("link", { name: "Learn" }).length
).toBeGreaterThan(0); ).toBeGreaterThan(0);
expect( expect(
screen.getAllByRole("link", { name: "About" }).length, screen.getAllByRole("link", { name: "About" }).length
).toBeGreaterThan(0); ).toBeGreaterThan(0);
}); });
@@ -100,13 +100,13 @@ describe("Footer", () => {
render(<Footer />); render(<Footer />);
expect( expect(
screen.getAllByRole("link", { name: "Privacy Policy" }).length, screen.getAllByRole("link", { name: "Privacy Policy" }).length
).toBeGreaterThan(0); ).toBeGreaterThan(0);
expect( expect(
screen.getAllByRole("link", { name: "Terms of Service" }).length, screen.getAllByRole("link", { name: "Terms of Service" }).length
).toBeGreaterThan(0); ).toBeGreaterThan(0);
expect( expect(
screen.getAllByRole("link", { name: "Cookies Settings" }).length, screen.getAllByRole("link", { name: "Cookies Settings" }).length
).toBeGreaterThan(0); ).toBeGreaterThan(0);
}); });
@@ -114,7 +114,7 @@ describe("Footer", () => {
render(<Footer />); render(<Footer />);
expect(screen.getAllByText("© All right reserved").length).toBeGreaterThan( expect(screen.getAllByText("© All right reserved").length).toBeGreaterThan(
0, 0
); );
}); });
@@ -123,7 +123,7 @@ describe("Footer", () => {
// Check that logo containers exist for different breakpoints // Check that logo containers exist for different breakpoints
const logoContainers = document.querySelectorAll( const logoContainers = document.querySelectorAll(
'[class*="block sm:hidden"], [class*="hidden sm:block lg:hidden"], [class*="hidden lg:block"]', '[class*="block sm:hidden"], [class*="hidden sm:block lg:hidden"], [class*="hidden lg:block"]'
); );
expect(logoContainers.length).toBeGreaterThan(0); expect(logoContainers.length).toBeGreaterThan(0);
}); });
@@ -147,7 +147,7 @@ describe("Footer", () => {
// The Separator component should be rendered (it uses a div with border, not hr) // The Separator component should be rendered (it uses a div with border, not hr)
const separator = document.querySelector( const separator = document.querySelector(
".bg-\\[var\\(--border-color-default-secondary\\)\\]", ".bg-\\[var\\(--border-color-default-secondary\\)\\]"
); );
expect(separator).toBeInTheDocument(); expect(separator).toBeInTheDocument();
}); });
@@ -263,10 +263,10 @@ describe("Footer", () => {
expect(emailLink).toHaveClass("focus:ring-2"); expect(emailLink).toHaveClass("focus:ring-2");
expect(emailLink).toHaveClass("focus:ring-offset-2"); expect(emailLink).toHaveClass("focus:ring-offset-2");
expect(emailLink).toHaveClass( expect(emailLink).toHaveClass(
"focus:ring-[var(--color-content-default-primary)]", "focus:ring-[var(--color-content-default-primary)]"
); );
expect(emailLink).toHaveClass( expect(emailLink).toHaveClass(
"focus:ring-offset-[var(--color-surface-default-primary)]", "focus:ring-offset-[var(--color-surface-default-primary)]"
); );
}); });
@@ -276,10 +276,10 @@ describe("Footer", () => {
expect(link).toHaveClass("focus:ring-2"); expect(link).toHaveClass("focus:ring-2");
expect(link).toHaveClass("focus:ring-offset-2"); expect(link).toHaveClass("focus:ring-offset-2");
expect(link).toHaveClass( expect(link).toHaveClass(
"focus:ring-[var(--color-content-default-primary)]", "focus:ring-[var(--color-content-default-primary)]"
); );
expect(link).toHaveClass( expect(link).toHaveClass(
"focus:ring-offset-[var(--color-surface-default-primary)]", "focus:ring-offset-[var(--color-surface-default-primary)]"
); );
}); });
}); });
+8 -1
View File
@@ -23,6 +23,13 @@
} }
] ]
}, },
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"], "include": [
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx"
],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }
+21 -3
View File
@@ -1,11 +1,27 @@
import { defineConfig } from "vitest/config"; import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import path from "path";
import { fileURLToPath } from "url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({ export default defineConfig({
plugins: [react({ jsxRuntime: "automatic" })], plugins: [
react({ jsxRuntime: "automatic" }),
// Transform CSS imports to empty modules to avoid jsdom parsing errors
{
name: "css-mock",
load(id) {
if (id.endsWith(".css")) {
return "export default {};";
}
},
},
],
esbuild: { esbuild: {
target: "node18",
jsx: "automatic", jsx: "automatic",
loader: "jsx", loader: "tsx",
include: /\.[jt]sx?$/, include: /\.[jt]sx?$/,
exclude: [/node_modules/], exclude: [/node_modules/],
}, },
@@ -22,7 +38,9 @@ export default defineConfig({
"tests/e2e/**/*.storybook.test.{js,jsx,ts,tsx}", "tests/e2e/**/*.storybook.test.{js,jsx,ts,tsx}",
"tests/e2e/**/*.spec.{js,jsx,ts,tsx}", "tests/e2e/**/*.spec.{js,jsx,ts,tsx}",
], ],
css: true, // Disable CSS processing in tests to avoid jsdom parsing errors with Tailwind v4
// Tailwind classes are still available via JIT compilation
css: false,
coverage: { coverage: {
provider: "v8", provider: "v8",
reporter: ["text", "lcov"], reporter: ["text", "lcov"],
+4 -2
View File
@@ -2,8 +2,10 @@ import "@testing-library/jest-dom/vitest";
import { afterAll, afterEach, beforeAll } from "vitest"; import { afterAll, afterEach, beforeAll } from "vitest";
import { cleanup } from "@testing-library/react"; import { cleanup } from "@testing-library/react";
import { server } from "./tests/msw/server"; import { server } from "./tests/msw/server";
// expose Tailwind tokens to JSDOM (for design token checks) // Note: Tailwind CSS v4 uses syntax that jsdom can't parse
import "./app/tailwind.css"; // CSS classes are still available via Tailwind's JIT compilation
// Design tokens are accessible via CSS variables in the DOM
// If you need to test CSS, use a CSS transformer or mock the import
// MSW for API integration tests (mock fetch) // MSW for API integration tests (mock fetch)
beforeAll(() => server.listen({ onUnhandledRequest: "bypass" })); beforeAll(() => server.listen({ onUnhandledRequest: "bypass" }));