@hxdhxd/harmony-flow-ui 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -32,7 +32,15 @@ npm run serve
32
32
 
33
33
  默认静态服务地址为 `http://127.0.0.1:4173`。
34
34
 
35
- `npm run test:quality` 是统一质量门,覆盖类型、正式构建、公共 API、浏览器路由、组件文档、视觉证据与完整性。
35
+ `npm run test:quality` 是统一质量门,覆盖类型、正式构建、公共 API、浏览器路由、组件文档、视觉证据与完整性。质量门还会锁定 HarmonyOS 7 的白+浅蓝主题,并按文件阻止新增渐变、毛玻璃、超限圆角、阴影和组件文档裸色值;现有功能性视觉与历史样式只允许逐步减少,不允许数量反弹或转移到其他文件。
36
+
37
+ 可单独执行以下视觉规范检查:
38
+
39
+ ```powershell
40
+ npm run test:theme-contract
41
+ npm run test:ui-quality-gate
42
+ npm run test:ui-quality-gate:self-test
43
+ ```
36
44
 
37
45
  展示页由 esbuild 正式构建,并由项目内 Node 静态服务托管,不使用 Vite。
38
46
 
@@ -42,7 +50,7 @@ npm run serve
42
50
 
43
51
  ## 发布状态与下一步
44
52
 
45
- 正式 npm 包名为 `@hxdhxd/harmony-flow-ui`,当前版本为 `0.1.0`。后续建议在每次发布前更新版本号、运行完整质量门,并在 GitHub 创建对应 Release 或维护变更日志。
53
+ 正式 npm 包名为 `@hxdhxd/harmony-flow-ui`,当前版本为 `0.1.1`。后续建议在每次发布前更新版本号、运行完整质量门,并在 GitHub 创建对应 Release 或维护变更日志。
46
54
 
47
55
  本项目采用 [MIT License](./LICENSE),允许免费用于个人和商业项目;再分发时须保留原许可证和版权声明。
48
56
 
@@ -83,7 +91,9 @@ export default function App() {
83
91
  }
84
92
  ```
85
93
 
86
- `ThemeProvider` 建议放在应用根部。主题覆盖支持 `colorPrimary`、`colorPrimaryHover`、`colorBackground`、`colorSurface`、`colorText`、`colorTextMuted`、`colorBorder`、`radiusMd`、`radiusLg`、`shadowElevated` 与 `motionDuration`。
94
+ `ThemeProvider` 建议放在应用根部。主题覆盖支持颜色、形状、阴影与动效语义令牌。新代码优先使用 `radiusControl`、`radiusPanel`、`radiusOverlay`、`shadowPopover` 与 `shadowModal`;`radiusMd`、`radiusLg`、`shadowElevated` 仅为现有消费者保留,后续版本将逐步迁移。
95
+
96
+ 默认主题继续遵循 HarmonyOS 7 的白色内容面、浅蓝窗口背景、鸿蒙蓝主强调色与深蓝正文。形状和深度令牌建议按语义覆盖,而不是为单个组件写死圆角或阴影。
87
97
 
88
98
  ### Next.js App Router
89
99
 
@@ -126,7 +136,7 @@ npm pack
126
136
  然后在目标项目中安装生成的 `.tgz` 文件(请替换为实际路径和文件名):
127
137
 
128
138
  ```powershell
129
- npm install "D:\path\to\harmony-flow-ui-0.1.0.tgz"
139
+ npm install "D:\path\to\harmony-flow-ui-0.1.1.tgz"
130
140
  ```
131
141
 
132
142
  安装后仍按正式 npm 包的方式从 `@hxdhxd/harmony-flow-ui` 导入。当前不建议直接通过 GitHub URL 安装,因为仓库不提交 `dist/`,Git 依赖安装流程无法保证生成完整发布产物。
package/dist/index.cjs CHANGED
@@ -176,13 +176,43 @@ var defaultTheme = {
176
176
  colorText: "#142033",
177
177
  colorTextMuted: "#66758c",
178
178
  colorBorder: "#dce9f7",
179
+ radiusControl: "6px",
180
+ radiusPanel: "8px",
181
+ radiusOverlay: "10px",
182
+ shadowPopover: "0 8px 24px rgba(41, 106, 168, 0.12)",
183
+ shadowModal: "0 18px 48px rgba(41, 106, 168, 0.16)",
179
184
  radiusMd: "14px",
180
185
  radiusLg: "24px",
181
186
  shadowElevated: "0 18px 48px rgba(41, 106, 168, 0.16)",
182
187
  motionDuration: "180ms"
183
188
  };
184
- var darkTheme = { ...defaultTheme, colorPrimary: "#58a9ff", colorPrimaryHover: "#7cbbff", colorBackground: "#0d1724", colorSurface: "#152337", colorText: "#f4f8fc", colorTextMuted: "#a9bad0", colorBorder: "#30445b", shadowElevated: "0 20px 54px rgba(0,0,0,.46)" };
185
- var highContrastTheme = { ...defaultTheme, colorPrimary: "#005fcc", colorPrimaryHover: "#004a9f", colorBackground: "#ffffff", colorSurface: "#ffffff", colorText: "#000000", colorTextMuted: "#303030", colorBorder: "#000000", shadowElevated: "0 0 0 2px #000000", motionDuration: "0ms" };
189
+ var darkTheme = {
190
+ ...defaultTheme,
191
+ colorPrimary: "#58a9ff",
192
+ colorPrimaryHover: "#7cbbff",
193
+ colorBackground: "#0d1724",
194
+ colorSurface: "#152337",
195
+ colorText: "#f4f8fc",
196
+ colorTextMuted: "#a9bad0",
197
+ colorBorder: "#30445b",
198
+ shadowPopover: "0 8px 24px rgba(0, 0, 0, 0.32)",
199
+ shadowModal: "0 20px 54px rgba(0, 0, 0, 0.46)",
200
+ shadowElevated: "0 20px 54px rgba(0, 0, 0, 0.46)"
201
+ };
202
+ var highContrastTheme = {
203
+ ...defaultTheme,
204
+ colorPrimary: "#005fcc",
205
+ colorPrimaryHover: "#004a9f",
206
+ colorBackground: "#ffffff",
207
+ colorSurface: "#ffffff",
208
+ colorText: "#000000",
209
+ colorTextMuted: "#303030",
210
+ colorBorder: "#000000",
211
+ shadowPopover: "0 0 0 2px #000000",
212
+ shadowModal: "0 0 0 2px #000000",
213
+ shadowElevated: "0 0 0 2px #000000",
214
+ motionDuration: "0ms"
215
+ };
186
216
  var tokenVariables = {
187
217
  colorPrimary: "--hf-color-primary",
188
218
  colorPrimaryHover: "--hf-color-primary-hover",
@@ -191,6 +221,11 @@ var tokenVariables = {
191
221
  colorText: "--hf-color-text",
192
222
  colorTextMuted: "--hf-color-text-muted",
193
223
  colorBorder: "--hf-color-border",
224
+ radiusControl: "--hf-radius-control",
225
+ radiusPanel: "--hf-radius-panel",
226
+ radiusOverlay: "--hf-radius-overlay",
227
+ shadowPopover: "--hf-shadow-popover",
228
+ shadowModal: "--hf-shadow-modal",
194
229
  radiusMd: "--hf-radius-md",
195
230
  radiusLg: "--hf-radius-lg",
196
231
  shadowElevated: "--hf-shadow-elevated",
@@ -220,7 +255,7 @@ function ThemeProvider({ children, tokens, mode = "light", className = "", style
220
255
  // src/components/Button.tsx
221
256
  var import_react = require("react");
222
257
  var import_jsx_runtime2 = require("react/jsx-runtime");
223
- var Button = (0, import_react.forwardRef)(function Button2({ children, className = "", variant = "primary", size = "md", shape = "pill", fullWidth = false, loading = false, leadingIcon, trailingIcon, iconOnly = false, disabled, ...props }, ref) {
258
+ var Button = (0, import_react.forwardRef)(function Button2({ children, className = "", variant = "primary", size = "md", shape = "rounded", fullWidth = false, loading = false, leadingIcon, trailingIcon, iconOnly = false, disabled, ...props }, ref) {
224
259
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
225
260
  "button",
226
261
  {