perf(ui): migrate icons to SVG sprite system
Replace @remixicon/react with a shared Icon component that renders via <use href> references to a single hidden SVG sprite. This reduces DOM node count by replacing inline SVGs with lightweight references. - Create Icon component with sprite injection (packages/ui/src/components/icon/) - Migrate all 164 files from @remixicon/react to Icon component - Auto-generate sprite data from remixicon bundle (scripts/generate-icon-sprite.mjs) - Add bun run icons:generate to package.json - Move @remixicon/react to devDependencies - Add icon usage instructions to theme-system skill
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { RiEyeLine, RiEyeOffLine } from '@remixicon/react';
|
||||
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Icon } from "@/components/icon/Icon";
|
||||
|
||||
export type PreviewToggleButtonProps = {
|
||||
/** Current mode - determines which icon is displayed */
|
||||
@@ -37,9 +36,9 @@ export const PreviewToggleButton: React.FC<PreviewToggleButtonProps> = ({
|
||||
className="h-5 w-5 p-0"
|
||||
>
|
||||
{isPreview ? (
|
||||
<RiEyeLine className="size-4" aria-hidden="true" />
|
||||
<Icon name="eye" className="size-4" aria-hidden="true"/>
|
||||
) : (
|
||||
<RiEyeOffLine className="size-4" aria-hidden="true" />
|
||||
<Icon name="eye-off" className="size-4" aria-hidden="true"/>
|
||||
)}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
|
||||
Reference in New Issue
Block a user