@zmzai/theme 0.5.6 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -47,8 +47,27 @@ const paths: Record<string, { d: string; fill?: boolean }> = {
|
|
|
47
47
|
bolt: { d: "M9 2.5L4 9h3.5L7 13.5 12 7H8.5z" },
|
|
48
48
|
shield: { d: "M8 2.5l5 2v4c0 3-2 5-5 6-3-1-5-3-5-6v-4zM6 8.5l1.5 1.5L10 7.5" },
|
|
49
49
|
sparkle: { d: "M8 2.5l1.3 4.2L13.5 8l-4.2 1.3L8 13.5l-1.3-4.2L2.5 8l4.2-1.3z" },
|
|
50
|
+
"arrow-up": { d: "M8 12.5v-8M5 7.5L8 4.5l3 3" },
|
|
51
|
+
"arrow-up-right": { d: "M4 12L12 4M7 3.5h5.5V9" },
|
|
52
|
+
"arrow-left": { d: "M12.5 8h-8M7.5 5L4.5 8l3 3" },
|
|
53
|
+
search: { d: "M7 10.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7zM9.8 9.8l3.2 3.2" },
|
|
54
|
+
message: { d: "M3 3.5h10v7H6l-3 2.5z" },
|
|
55
|
+
folder: { d: "M2.5 4.5h4l1.5 2h5.5v6h-11z" },
|
|
56
|
+
archive: { d: "M2.5 3.5h11V6h-11zM3.5 6.5v7h9v-7M6.5 9h3" },
|
|
57
|
+
clock: { d: "M8 3a5 5 0 1 1 0 10A5 5 0 0 1 8 3zM8 5.5V8l2 1.5" },
|
|
58
|
+
file: { d: "M4 2.5h5l3 3v8H4zM9 2.5v3h3" },
|
|
59
|
+
"file-text": { d: "M4 2.5h5l3 3v8H4zM9 2.5v3h3M6 8.5h4M6 10.5h4" },
|
|
60
|
+
eye: { d: "M1.8 8S4 4.5 8 4.5 14.2 8 14.2 8 12 11.5 8 11.5 1.8 8 1.8 8zM8 6.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3z" },
|
|
61
|
+
"eye-off": { d: "M2.5 3l11 10M1.8 8S4 4.5 8 4.5c.6 0 1.2.1 1.7.3M14.2 8s-.7 1.2-2 2.2M6.5 6.9A1.5 1.5 0 0 0 8 9.5" },
|
|
62
|
+
play: { d: "M5.5 3.5l7 4.5-7 4.5z", fill: true },
|
|
63
|
+
pause: { d: "M5.5 3.5v9M10.5 3.5v9" },
|
|
64
|
+
list: { d: "M5.5 4h8M5.5 8h8M5.5 12h8M3 4h.01M3 8h.01M3 12h.01" },
|
|
65
|
+
sparkles: { d: "M8 2.5l1.3 4.2L13.5 8l-4.2 1.3L8 13.5l-1.3-4.2L2.5 8l4.2-1.3z" },
|
|
66
|
+
warning: { d: "M8 3l5.5 9.5h-11zM8 7v2.5M8 11.4v.01" },
|
|
67
|
+
user: { d: "M8 3.2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM3.5 13c.6-2.6 2.4-4 4.5-4s3.9 1.4 4.5 4" },
|
|
50
68
|
};
|
|
51
69
|
|
|
70
|
+
|
|
52
71
|
export type IconName = keyof typeof paths;
|
|
53
72
|
|
|
54
73
|
export function Icon({ name, size = 14, className = "" }: { name: IconName; size?: number; className?: string }) {
|
|
@@ -4,7 +4,8 @@ import { forwardRef, type ButtonHTMLAttributes } from "react";
|
|
|
4
4
|
import { cn } from "../../utils/cn";
|
|
5
5
|
|
|
6
6
|
export interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "ref"> {
|
|
7
|
-
/** 尺寸:sm=h-6 md=h-7 lg=h-8(密集工具条场景,不做 hover
|
|
7
|
+
/** 尺寸:sm=h-6 md=h-7 lg=h-8(密集工具条场景,不做 hover 缩放)。
|
|
8
|
+
* 触控热区通过 ::after(-inset-2) 扩到 ≥40px,视觉尺寸不变。 */
|
|
8
9
|
size?: "sm" | "md" | "lg";
|
|
9
10
|
/** 视觉:ghost=透明 hover 背景;quiet=无 hover 背景只有颜色变化 */
|
|
10
11
|
tone?: "ghost" | "quiet";
|
|
@@ -29,7 +30,7 @@ export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
|
29
30
|
aria-label={label}
|
|
30
31
|
title={label}
|
|
31
32
|
className={cn(
|
|
32
|
-
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm text-ink-3 transition-colors disabled:pointer-events-none disabled:opacity-40",
|
|
33
|
+
"relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm text-ink-3 transition-colors after:absolute after:-inset-2 after:content-[''] disabled:pointer-events-none disabled:opacity-40",
|
|
33
34
|
size === "sm" && "h-6 w-6",
|
|
34
35
|
size === "md" && "h-7 w-7",
|
|
35
36
|
size === "lg" && "h-8 w-8",
|