@zmzai/theme 0.1.0

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.
Files changed (129) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +76 -0
  3. package/package.json +91 -0
  4. package/src/brand/index.ts +3 -0
  5. package/src/brand/logo/Logo.tsx +46 -0
  6. package/src/brand/logo/favicon.png +0 -0
  7. package/src/brand/logo/index.ts +2 -0
  8. package/src/brand/logo/zmzai-logo.png +0 -0
  9. package/src/brand/wordmark/Wordmark.tsx +48 -0
  10. package/src/brand/wordmark/index.ts +2 -0
  11. package/src/components/aceternity-sidebar/AceternitySidebar.tsx +133 -0
  12. package/src/components/aceternity-sidebar/index.ts +2 -0
  13. package/src/components/animated-tabs/AnimatedTabs.tsx +60 -0
  14. package/src/components/animated-tabs/index.ts +2 -0
  15. package/src/components/animated-tooltip/AnimatedTooltip.tsx +93 -0
  16. package/src/components/animated-tooltip/index.ts +2 -0
  17. package/src/components/avatar/Avatar.tsx +59 -0
  18. package/src/components/avatar/index.ts +2 -0
  19. package/src/components/badge/Badge.tsx +45 -0
  20. package/src/components/badge/index.ts +2 -0
  21. package/src/components/bento-grid/BentoGrid.tsx +85 -0
  22. package/src/components/bento-grid/index.ts +2 -0
  23. package/src/components/button/Button.tsx +66 -0
  24. package/src/components/button/button.styles.ts +41 -0
  25. package/src/components/button/index.ts +4 -0
  26. package/src/components/card/Card.tsx +87 -0
  27. package/src/components/card/card.styles.ts +35 -0
  28. package/src/components/card/index.ts +4 -0
  29. package/src/components/card-3d/Card3D.tsx +84 -0
  30. package/src/components/card-3d/index.ts +2 -0
  31. package/src/components/card-hover-effect/CardHoverEffect.tsx +83 -0
  32. package/src/components/card-hover-effect/index.ts +2 -0
  33. package/src/components/card-spotlight/CardSpotlight.tsx +63 -0
  34. package/src/components/card-spotlight/index.ts +2 -0
  35. package/src/components/carousel/Carousel.tsx +79 -0
  36. package/src/components/carousel/index.ts +2 -0
  37. package/src/components/code-block/CodeBlock.tsx +153 -0
  38. package/src/components/code-block/index.ts +2 -0
  39. package/src/components/comet-card/CometCard.tsx +106 -0
  40. package/src/components/comet-card/index.ts +2 -0
  41. package/src/components/compare/Compare.tsx +128 -0
  42. package/src/components/compare/index.ts +2 -0
  43. package/src/components/dialog/Dialog.tsx +79 -0
  44. package/src/components/dialog/index.ts +10 -0
  45. package/src/components/dropdown-menu/DropdownMenu.tsx +76 -0
  46. package/src/components/dropdown-menu/index.ts +8 -0
  47. package/src/components/empty-state/EmptyState.tsx +78 -0
  48. package/src/components/empty-state/index.ts +2 -0
  49. package/src/components/encrypt-text/EncryptText.tsx +102 -0
  50. package/src/components/encrypt-text/index.ts +2 -0
  51. package/src/components/evervault-card/EvervaultCard.tsx +114 -0
  52. package/src/components/evervault-card/index.ts +2 -0
  53. package/src/components/expandable-card/ExpandableCard.tsx +91 -0
  54. package/src/components/expandable-card/index.ts +2 -0
  55. package/src/components/file-upload/FileUpload.tsx +171 -0
  56. package/src/components/file-upload/index.ts +2 -0
  57. package/src/components/flip-words/FlipWords.tsx +70 -0
  58. package/src/components/flip-words/index.ts +2 -0
  59. package/src/components/floating-navbar/FloatingNavbar.tsx +82 -0
  60. package/src/components/floating-navbar/index.ts +2 -0
  61. package/src/components/focus-cards/FocusCards.tsx +93 -0
  62. package/src/components/focus-cards/index.ts +2 -0
  63. package/src/components/glare-card/GlareCard.tsx +66 -0
  64. package/src/components/glare-card/index.ts +2 -0
  65. package/src/components/glowing-effect/GlowingEffect.tsx +68 -0
  66. package/src/components/glowing-effect/index.ts +2 -0
  67. package/src/components/hover-border-gradient/HoverBorderGradient.tsx +80 -0
  68. package/src/components/hover-border-gradient/index.ts +2 -0
  69. package/src/components/index.ts +71 -0
  70. package/src/components/infinite-moving-cards/InfiniteMovingCards.tsx +84 -0
  71. package/src/components/infinite-moving-cards/index.ts +2 -0
  72. package/src/components/input/Input.tsx +35 -0
  73. package/src/components/input/index.ts +4 -0
  74. package/src/components/input/input.styles.ts +34 -0
  75. package/src/components/keyboard/Keyboard.tsx +38 -0
  76. package/src/components/keyboard/index.ts +2 -0
  77. package/src/components/layout-grid/LayoutGrid.tsx +121 -0
  78. package/src/components/layout-grid/index.ts +2 -0
  79. package/src/components/link-preview/LinkPreview.tsx +121 -0
  80. package/src/components/link-preview/index.ts +2 -0
  81. package/src/components/loader/Loader.tsx +130 -0
  82. package/src/components/loader/index.ts +2 -0
  83. package/src/components/magnetic-button/MagneticButton.tsx +79 -0
  84. package/src/components/magnetic-button/index.ts +2 -0
  85. package/src/components/moving-border/MovingBorder.tsx +72 -0
  86. package/src/components/moving-border/index.ts +2 -0
  87. package/src/components/multi-step-loader/MultiStepLoader.tsx +95 -0
  88. package/src/components/multi-step-loader/index.ts +2 -0
  89. package/src/components/notch/Notch.tsx +47 -0
  90. package/src/components/notch/index.ts +2 -0
  91. package/src/components/select/Select.tsx +100 -0
  92. package/src/components/select/index.ts +10 -0
  93. package/src/components/skeleton/Skeleton.tsx +34 -0
  94. package/src/components/skeleton/index.ts +2 -0
  95. package/src/components/stateful-button/StatefulButton.tsx +115 -0
  96. package/src/components/stateful-button/index.ts +2 -0
  97. package/src/components/sticky-banner/StickyBanner.tsx +74 -0
  98. package/src/components/sticky-banner/index.ts +2 -0
  99. package/src/components/sticky-scroll-reveal/StickyScrollReveal.tsx +141 -0
  100. package/src/components/sticky-scroll-reveal/index.ts +2 -0
  101. package/src/components/terminal/Terminal.tsx +55 -0
  102. package/src/components/terminal/index.ts +2 -0
  103. package/src/components/text-generate/TextGenerate.tsx +59 -0
  104. package/src/components/text-generate/index.ts +2 -0
  105. package/src/components/text-hover-effect/TextHoverEffect.tsx +90 -0
  106. package/src/components/text-hover-effect/index.ts +2 -0
  107. package/src/components/textarea/Textarea.tsx +39 -0
  108. package/src/components/textarea/index.ts +2 -0
  109. package/src/components/timeline/Timeline.tsx +106 -0
  110. package/src/components/timeline/index.ts +3 -0
  111. package/src/components/tooltip/Tooltip.tsx +51 -0
  112. package/src/components/tooltip/index.ts +2 -0
  113. package/src/components/tooltip-card/TooltipCard.tsx +130 -0
  114. package/src/components/tooltip-card/index.ts +2 -0
  115. package/src/components/tracing-beam/TracingBeam.tsx +110 -0
  116. package/src/components/tracing-beam/index.ts +2 -0
  117. package/src/components/typewriter/Typewriter.tsx +69 -0
  118. package/src/components/typewriter/index.ts +2 -0
  119. package/src/components/vanish-input/VanishInput.tsx +170 -0
  120. package/src/components/vanish-input/index.ts +2 -0
  121. package/src/components/wobble-card/WobbleCard.tsx +77 -0
  122. package/src/components/wobble-card/index.ts +2 -0
  123. package/src/index.ts +21 -0
  124. package/src/tokens/fonts.css +42 -0
  125. package/src/tokens/theme.css +120 -0
  126. package/src/utils/cn.ts +13 -0
  127. package/src/utils/index.ts +2 -0
  128. package/src/utils/motion.ts +47 -0
  129. package/src/vite-env.d.ts +6 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 知末智云 (zmzai.cloud)
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing permissions
201
+ and limitations under the License.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # @zmzai/theme
2
+
3
+ zmzai 全品牌设计系统 — Radix UI + framer-motion + Tailwind v4 + MiSans.
4
+
5
+ ## Quick Start
6
+
7
+ ### Install (consumer app)
8
+
9
+ ```bash
10
+ pnpm add @zmzai/theme
11
+ # or via git:
12
+ pnpm add @zmzai/theme@github:Ulanxx/zmzai-theme
13
+ ```
14
+
15
+ ### Import tokens + fonts
16
+
17
+ In your app's `globals.css`:
18
+
19
+ ```css
20
+ @import "tailwindcss";
21
+ @import "@zmzai/theme/tokens"; /* Design tokens (@theme block) */
22
+ @import "@zmzai/theme/fonts"; /* MiSans @font-face */
23
+
24
+ /* Optional: per-site accent override */
25
+ :root {
26
+ --color-accent: #7C3AED; /* sandbox = violet */
27
+ }
28
+ ```
29
+
30
+ ### Use components
31
+
32
+ ```tsx
33
+ import { Button, Card, Logo, Wordmark } from "@zmzai/theme";
34
+
35
+ <Button variant="primary" size="md">发送</Button>
36
+ <Card variant="interactive" animatedHover padding="lg">
37
+ Hover me
38
+ </Card>
39
+ <Logo size={28} />
40
+ <Wordmark sublabel="agent" />
41
+ ```
42
+
43
+ ## Design Language
44
+
45
+ - **Color**: 纯白底 + 纯黑字, neutral grays. 蓝色 `#2563EB` 只用于动态状态.
46
+ - **Font**: SF Pro (英文) + MiSans (中文), SF Mono (等宽).
47
+ - **Radius**: 8/12/16/20px + pill.
48
+ - **Motion**: framer-motion, exponential ease-out `cubic-bezier(0.16,1,0.3,1)`.
49
+
50
+ ## Components
51
+
52
+ | Module | Components |
53
+ |--------|-----------|
54
+ | `@zmzai/theme` (default) | Button, Input, Card |
55
+ | `@zmzai/theme/brand` | Logo, Wordmark |
56
+
57
+ ### Variants (per-site accent)
58
+
59
+ | Site | accent |
60
+ |------|--------|
61
+ | cloud / muzhi / auth / agent | `#000000` (default) |
62
+ | relay | `#2563EB` blue |
63
+ | sandbox | `#7C3AED` violet |
64
+ | workos | `#059669` emerald |
65
+
66
+ ## Development
67
+
68
+ ```bash
69
+ pnpm install
70
+ pnpm playground # Vite dev server at :5174
71
+ pnpm typecheck # tsc --noEmit
72
+ ```
73
+
74
+ ## License
75
+
76
+ Apache-2.0
package/package.json ADDED
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "@zmzai/theme",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "zmzai 全品牌设计系统 — Radix UI + framer-motion + Tailwind v4 + MiSans",
7
+ "license": "Apache-2.0",
8
+ "author": "知末智云 <mifindxuan@gmail.com>",
9
+ "homepage": "https://github.com/zmzai-cloud/zmzai-theme",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/zmzai-cloud/zmzai-theme.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/zmzai-cloud/zmzai-theme/issues"
16
+ },
17
+ "keywords": [
18
+ "zmzai",
19
+ "design-system",
20
+ "radix-ui",
21
+ "tailwindcss",
22
+ "framer-motion",
23
+ "react",
24
+ "components"
25
+ ],
26
+ "sideEffects": [
27
+ "**/*.css"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public",
31
+ "registry": "https://registry.npmjs.org/"
32
+ },
33
+ "exports": {
34
+ ".": {
35
+ "types": "./src/index.ts",
36
+ "import": "./src/index.ts"
37
+ },
38
+ "./tokens": "./src/tokens/theme.css",
39
+ "./fonts": "./src/tokens/fonts.css",
40
+ "./components": {
41
+ "types": "./src/components/index.ts",
42
+ "import": "./src/components/index.ts"
43
+ },
44
+ "./components/*": {
45
+ "types": "./src/components/*/index.ts",
46
+ "import": "./src/components/*/index.ts"
47
+ },
48
+ "./brand": {
49
+ "types": "./src/brand/index.ts",
50
+ "import": "./src/brand/index.ts"
51
+ }
52
+ },
53
+ "files": [
54
+ "src",
55
+ "README.md",
56
+ "LICENSE"
57
+ ],
58
+ "scripts": {
59
+ "build": "tsc -p tsconfig.json --noEmit",
60
+ "typecheck": "tsc --noEmit",
61
+ "playground": "vite playground --port 5174",
62
+ "prepublishOnly": "pnpm typecheck"
63
+ },
64
+ "peerDependencies": {
65
+ "react": "^19.0.0",
66
+ "react-dom": "^19.0.0",
67
+ "framer-motion": "^11.0.0",
68
+ "tailwindcss": "^4.0.0"
69
+ },
70
+ "devDependencies": {
71
+ "@radix-ui/react-dialog": "^1.1.0",
72
+ "@radix-ui/react-dropdown-menu": "^2.1.0",
73
+ "@radix-ui/react-select": "^2.1.0",
74
+ "@radix-ui/react-tabs": "^1.1.0",
75
+ "@radix-ui/react-tooltip": "^1.1.0",
76
+ "@types/react": "^19.0.0",
77
+ "@types/react-dom": "^19.0.0",
78
+ "@tailwindcss/vite": "^4.0.0",
79
+ "@vitejs/plugin-react": "^4.3.0",
80
+ "class-variance-authority": "^0.7.0",
81
+ "clsx": "^2.1.0",
82
+ "framer-motion": "^11.0.0",
83
+ "react": "^19.0.0",
84
+ "react-dom": "^19.0.0",
85
+ "tailwind-merge": "^2.5.0",
86
+ "tailwindcss": "^4.0.0",
87
+ "typescript": "^5.9.0",
88
+ "vite": "^5.4.0"
89
+ },
90
+ "packageManager": "pnpm@10.34.5+sha512.a4ee05f2f73658255bd6a89859c065a45c28a57daefae2c893a168ee2b73168c37b91e83e57ea67654ad03f03031746430e8bce38e362e042605fb8abc80192e"
91
+ }
@@ -0,0 +1,3 @@
1
+ // @zmzai/theme — Brand assets barrel
2
+ export * from "./logo";
3
+ export * from "./wordmark";
@@ -0,0 +1,46 @@
1
+ "use client";
2
+
3
+ import { forwardRef, type ImgHTMLAttributes } from "react";
4
+ import { cn } from "../../utils/cn";
5
+ import logoSrc from "./zmzai-logo.png";
6
+
7
+ export interface LogoProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "src"> {
8
+ /** Size in pixels (width = height, logo is square-cropped) */
9
+ size?: number;
10
+ /** Invert for dark backgrounds (black → white) */
11
+ inverted?: boolean;
12
+ }
13
+
14
+ /**
15
+ * Logo — zmzai 云朵品牌标志.
16
+ *
17
+ * 亮色背景用黑色 logo(默认)
18
+ * 暗色背景用 `inverted`(CSS filter 反白)
19
+ *
20
+ * @example
21
+ * <Logo size={28} /> // 黑色,用于白底导航
22
+ * <Logo size={28} inverted /> // 白色,用于黑底 footer
23
+ */
24
+ export const Logo = forwardRef<HTMLImageElement, LogoProps>(
25
+ ({ className, size = 28, inverted, ...props }, ref) => {
26
+ // Handle both string src (Vite) and StaticImageData (Next.js)
27
+ const src = typeof logoSrc === "string" ? logoSrc : (logoSrc as { src: string }).src;
28
+ return (
29
+ <img
30
+ ref={ref}
31
+ src={src}
32
+ alt="zmzai"
33
+ width={size}
34
+ height={size}
35
+ className={cn(
36
+ "object-contain",
37
+ inverted && "[filter:invert(1)]",
38
+ className
39
+ )}
40
+ {...props}
41
+ />
42
+ );
43
+ }
44
+ );
45
+
46
+ Logo.displayName = "Logo";
Binary file
@@ -0,0 +1,2 @@
1
+ export { Logo } from "./Logo";
2
+ export type { LogoProps } from "./Logo";
Binary file
@@ -0,0 +1,48 @@
1
+ "use client";
2
+
3
+ import { forwardRef, type HTMLAttributes } from "react";
4
+ import { cn } from "../../utils/cn";
5
+
6
+ export interface WordmarkProps extends HTMLAttributes<HTMLSpanElement> {
7
+ /** Font weight 100-900, default 600 */
8
+ weight?: number;
9
+ /** Font size in px, default 16 */
10
+ size?: number;
11
+ /** Append a sub-label (e.g. "relay", "agent") after ZMZAI */
12
+ sublabel?: string;
13
+ }
14
+
15
+ /**
16
+ * Wordmark — `ZMZAI` 文字标.
17
+ *
18
+ * Sans-serif, negative letter-spacing, optional sublabel.
19
+ *
20
+ * @example
21
+ * <Wordmark /> // "ZMZAI"
22
+ * <Wordmark sublabel="relay" /> // "ZMZAI · relay"
23
+ * <Wordmark size={24} weight={700} />
24
+ */
25
+ export const Wordmark = forwardRef<HTMLSpanElement, WordmarkProps>(
26
+ ({ className, weight = 600, size = 16, sublabel, style, ...props }, ref) => {
27
+ return (
28
+ <span
29
+ ref={ref}
30
+ className={cn("inline-flex items-baseline gap-1.5 select-none", className)}
31
+ style={{ fontWeight: weight, fontSize: size, letterSpacing: "-0.02em", ...style }}
32
+ {...props}
33
+ >
34
+ ZMZAI
35
+ {sublabel && (
36
+ <span
37
+ className="font-normal text-ink-3"
38
+ style={{ fontSize: size * 0.7, letterSpacing: 0 }}
39
+ >
40
+ · {sublabel}
41
+ </span>
42
+ )}
43
+ </span>
44
+ );
45
+ }
46
+ );
47
+
48
+ Wordmark.displayName = "Wordmark";
@@ -0,0 +1,2 @@
1
+ export { Wordmark } from "./Wordmark";
2
+ export type { WordmarkProps } from "./Wordmark";
@@ -0,0 +1,133 @@
1
+ "use client";
2
+
3
+ import { useState, type ReactNode } from "react";
4
+ import { motion, AnimatePresence } from "framer-motion";
5
+ import { cn } from "../../utils/cn";
6
+
7
+ export interface AceternitySidebarItem {
8
+ icon: ReactNode;
9
+ label: string;
10
+ href?: string;
11
+ active?: boolean;
12
+ }
13
+
14
+ export interface AceternitySidebarProps {
15
+ items: AceternitySidebarItem[];
16
+ className?: string;
17
+ /** Called when an item is clicked (item index passed) */
18
+ onNavigate?: (item: AceternitySidebarItem, index: number) => void;
19
+ }
20
+
21
+ const COLLAPSED_WIDTH = 64; // ~60px narrow
22
+ const EXPANDED_WIDTH = 240;
23
+
24
+ /**
25
+ * AceternitySidebar — collapsible sidebar that expands on hover.
26
+ *
27
+ * Collapsed state shows icons only (~60px); hovering expands to show full
28
+ * labels (~240px). Smooth width transition via framer-motion layout animation.
29
+ *
30
+ * @example
31
+ * const items = [
32
+ * { icon: <HomeIcon />, label: "首页", active: true },
33
+ * { icon: <SettingsIcon />, label: "设置" },
34
+ * ];
35
+ * <AceternitySidebar items={items} onNavigate={(item) => console.log(item)} />
36
+ */
37
+ export function AceternitySidebar({
38
+ items,
39
+ className,
40
+ onNavigate,
41
+ }: AceternitySidebarProps) {
42
+ const [expanded, setExpanded] = useState(false);
43
+
44
+ return (
45
+ <motion.aside
46
+ onMouseEnter={() => setExpanded(true)}
47
+ onMouseLeave={() => setExpanded(false)}
48
+ animate={{ width: expanded ? EXPANDED_WIDTH : COLLAPSED_WIDTH }}
49
+ transition={{ duration: 0.3, ease: [0.16, 1, 0.3, 1] }}
50
+ className={cn(
51
+ "sticky top-0 flex h-screen flex-col overflow-hidden border-r border-line bg-bg py-3",
52
+ className
53
+ )}
54
+ >
55
+ <nav className="flex flex-1 flex-col gap-1 px-2">
56
+ {items.map((item, index) => (
57
+ <SidebarItem
58
+ key={index}
59
+ item={item}
60
+ expanded={expanded}
61
+ onClick={() => onNavigate?.(item, index)}
62
+ />
63
+ ))}
64
+ </nav>
65
+ </motion.aside>
66
+ );
67
+ }
68
+
69
+ function SidebarItem({
70
+ item,
71
+ expanded,
72
+ onClick,
73
+ }: {
74
+ item: AceternitySidebarItem;
75
+ expanded: boolean;
76
+ onClick: () => void;
77
+ }) {
78
+ const content = (
79
+ <>
80
+ {/* Active indicator bar */}
81
+ {item.active && (
82
+ <motion.span
83
+ layoutId="sidebar-active"
84
+ className="absolute left-0 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-ink"
85
+ transition={{ duration: 0.3, ease: [0.16, 1, 0.3, 1] }}
86
+ />
87
+ )}
88
+ <span
89
+ className={cn(
90
+ "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",
91
+ item.active ? "text-ink" : "text-ink-2"
92
+ )}
93
+ >
94
+ {item.icon}
95
+ </span>
96
+ <AnimatePresence initial={false}>
97
+ {expanded && (
98
+ <motion.span
99
+ initial={{ opacity: 0, width: 0 }}
100
+ animate={{ opacity: 1, width: "auto" }}
101
+ exit={{ opacity: 0, width: 0 }}
102
+ transition={{ duration: 0.2, ease: [0.16, 1, 0.3, 1] }}
103
+ className={cn(
104
+ "overflow-hidden whitespace-nowrap text-sm font-medium",
105
+ item.active ? "text-ink" : "text-ink-2"
106
+ )}
107
+ >
108
+ {item.label}
109
+ </motion.span>
110
+ )}
111
+ </AnimatePresence>
112
+ </>
113
+ );
114
+
115
+ const baseClass = cn(
116
+ "relative flex items-center gap-3 rounded-lg px-2 py-2 transition-colors hover:bg-surface-2",
117
+ item.active && "bg-surface-2"
118
+ );
119
+
120
+ if (item.href) {
121
+ return (
122
+ <a href={item.href} className={baseClass} onClick={onClick}>
123
+ {content}
124
+ </a>
125
+ );
126
+ }
127
+
128
+ return (
129
+ <button type="button" className={baseClass} onClick={onClick}>
130
+ {content}
131
+ </button>
132
+ );
133
+ }
@@ -0,0 +1,2 @@
1
+ export { AceternitySidebar } from "./AceternitySidebar";
2
+ export type { AceternitySidebarProps, AceternitySidebarItem } from "./AceternitySidebar";
@@ -0,0 +1,60 @@
1
+ "use client";
2
+
3
+ import { useState, type ReactNode } from "react";
4
+ import { motion } from "framer-motion";
5
+ import { cn } from "../../utils/cn";
6
+
7
+ export interface AnimatedTabsProps {
8
+ tabs: { label: string; content: ReactNode }[];
9
+ className?: string;
10
+ /** Initial active tab index (default 0) */
11
+ defaultIndex?: number;
12
+ }
13
+
14
+ /**
15
+ * AnimatedTabs — tabs with sliding underline indicator.
16
+ *
17
+ * Uses framer-motion's layoutId for a smooth sliding underline
18
+ * that moves between tabs on click. Minimal monochrome styling.
19
+ *
20
+ * @example
21
+ * <AnimatedTabs tabs={[
22
+ * { label: "产物", content: <Artifacts /> },
23
+ * { label: "文件", content: <Files /> },
24
+ * ]} />
25
+ */
26
+ export function AnimatedTabs({ tabs, className, defaultIndex = 0 }: AnimatedTabsProps) {
27
+ const [active, setActive] = useState(defaultIndex);
28
+
29
+ return (
30
+ <div className={cn("w-full", className)}>
31
+ {/* Tab bar */}
32
+ <div className="flex gap-1 border-b border-line">
33
+ {tabs.map((tab, index) => (
34
+ <button
35
+ key={index}
36
+ onClick={() => setActive(index)}
37
+ className={cn(
38
+ "relative cursor-pointer px-4 py-2.5 text-sm font-medium transition-colors",
39
+ active === index ? "text-ink" : "text-ink-3 hover:text-ink-2"
40
+ )}
41
+ >
42
+ {tab.label}
43
+ {active === index && (
44
+ <motion.div
45
+ layoutId="animated-tab-underline"
46
+ className="absolute bottom-0 left-0 right-0 h-0.5 bg-ink"
47
+ transition={{ type: "spring", stiffness: 400, damping: 30 }}
48
+ />
49
+ )}
50
+ </button>
51
+ ))}
52
+ </div>
53
+
54
+ {/* Tab content */}
55
+ <div className="pt-4">
56
+ {tabs[active]?.content}
57
+ </div>
58
+ </div>
59
+ );
60
+ }
@@ -0,0 +1,2 @@
1
+ export { AnimatedTabs } from "./AnimatedTabs";
2
+ export type { AnimatedTabsProps } from "./AnimatedTabs";