@zmzai/theme 0.5.0 → 0.5.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zmzai/theme",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "zmzai 全品牌设计系统 — Radix UI + framer-motion + Tailwind v4 + MiSans",
@@ -361,11 +361,9 @@
361
361
  margin-top: 1px;
362
362
  }
363
363
 
364
- /* ── Status badge(live 脉冲 / building 流光 / planned 虚线) ── */
365
- .status-pulse {
366
- position: relative;
367
- }
368
-
364
+ /* ── Status badge(live 脉冲 / building 流光 / planned 虚线) ──
365
+ 注意:.status-pulse 不能写 position —— 无 layer CSS 会覆盖 Tailwind
366
+ utilities 的 absolute inset-0,把脉冲层压成椭圆。定位由组件 className 提供。 */
369
367
  .status-pulse::after {
370
368
  content: "";
371
369
  position: absolute;
@@ -32,6 +32,8 @@ export interface NavbarProps {
32
32
  actions?: ReactNode;
33
33
  /** 品牌区右侧的附属徽章(如域名 a.zmzai.cloud) */
34
34
  badge?: ReactNode;
35
+ /** 品牌区点击链接(通常回首页,如 "/");不传则品牌区不可点击 */
36
+ brandHref?: string;
35
37
  className?: string;
36
38
  }
37
39
 
@@ -48,7 +50,13 @@ export interface NavbarProps {
48
50
  * <Link href="/audit" className={navItemClass(pathname === "/audit")}>运行审计</Link>
49
51
  * </Navbar>
50
52
  */
51
- export function Navbar({ sublabel, brand, children, actions, badge, className }: NavbarProps) {
53
+ export function Navbar({ sublabel, brand, children, actions, badge, brandHref, className }: NavbarProps) {
54
+ const brandNode = brand ?? (
55
+ <span className="inline-flex items-center gap-2">
56
+ <Logo size={22} />
57
+ <Wordmark size={16} sublabel={sublabel} />
58
+ </span>
59
+ );
52
60
  return (
53
61
  <header
54
62
  className={cn(
@@ -57,11 +65,12 @@ export function Navbar({ sublabel, brand, children, actions, badge, className }:
57
65
  )}
58
66
  >
59
67
  <div className="flex min-w-0 items-center gap-2.5">
60
- {brand ?? (
61
- <span className="inline-flex items-center gap-2">
62
- <Logo size={22} />
63
- <Wordmark size={16} sublabel={sublabel} />
64
- </span>
68
+ {brandHref ? (
69
+ <a href={brandHref} className="inline-flex items-center">
70
+ {brandNode}
71
+ </a>
72
+ ) : (
73
+ brandNode
65
74
  )}
66
75
  {badge}
67
76
  </div>