ci: adds basic visual regression testing for icons (#16408)
This commit is contained in:
1 parent
2e36cadce4
commit
36e79bf69c
8 files changed
+229
-136
No files matched your search
@@ -1,17 +1,26 @@
|
||||
import { type SVGProps } from "react";
|
||||
|
||||
import cn from "@calcom/lib/classNames";
|
||||
|
||||
import type { IconName } from "./icon-names";
|
||||
|
||||
function Icon({
|
||||
name,
|
||||
size = 16,
|
||||
className,
|
||||
...props
|
||||
}: SVGProps<SVGSVGElement> & {
|
||||
name: IconName;
|
||||
size?: number | string;
|
||||
}) {
|
||||
return (
|
||||
<svg height={size} width={size} {...props} aria-hidden>
|
||||
<svg
|
||||
height={size}
|
||||
width={size}
|
||||
// Fill are inherited so we transparent by default. Can be overiden tailwind.
|
||||
className={cn("fill-transparent", className)}
|
||||
{...props}
|
||||
aria-hidden>
|
||||
<use href={`#${name}`} />
|
||||
</svg>
|
||||
);
|
||||
|
||||
@@ -44,7 +44,6 @@ export const lucideIconList = new Set([
|
||||
"circle",
|
||||
"clipboard-check",
|
||||
"clipboard",
|
||||
"clipboard",
|
||||
"clock",
|
||||
"code",
|
||||
"columns-3",
|
||||
@@ -95,7 +94,6 @@ export const lucideIconList = new Set([
|
||||
"paintbrush",
|
||||
"paperclip",
|
||||
"pencil",
|
||||
"pencil",
|
||||
"phone-call",
|
||||
"phone",
|
||||
"plus",
|
||||
@@ -121,10 +119,8 @@ export const lucideIconList = new Set([
|
||||
"sunrise",
|
||||
"sunset",
|
||||
"terminal",
|
||||
"terminal",
|
||||
"trash-2",
|
||||
"trash",
|
||||
"trash",
|
||||
"trello",
|
||||
"triangle-alert",
|
||||
"upload",
|
||||
|
||||
@@ -89,6 +89,7 @@ async function generateSvgSprite({ files, inputDir, outputPath }) {
|
||||
|
||||
svg.tagName = "symbol";
|
||||
svg.setAttribute("id", iconName(file));
|
||||
svg.setAttribute("fill", "inherit");
|
||||
svg.removeAttribute("xmlns");
|
||||
svg.removeAttribute("xmlns:xlink");
|
||||
svg.removeAttribute("version");
|
||||
|
||||
Reference in new issue
Block a user