@seanyeh77/ui 0.48.2 → 0.49.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.
package/docs/ZoneMap.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## 用法
4
4
 
5
- 分區平面圖:分區是格線上的矩形,依數值填熱度色階,每區寫名稱、狀態、主數值和一行次要資訊。
5
+ 分區平面圖:分區是格線上的矩形,依數值填熱度色階,每區寫名稱、狀態、主數值和一行次要資訊。分區是任意多邊形時用 FloorPlan。
6
6
 
7
7
  ```js
8
8
  h(UI.ZoneMap, {
@@ -28,7 +28,7 @@ h(UI.ZoneMap, {
28
28
  - 填色:沒給 `fill` 時,用 `value` 在 `min`~`max` 之間對應 `heat-1`…`heat-7`。`min`、`max` 預設是各分區數值的最小值和最大值,溫度、濕度、負載都適用;要固定的範圍(例如溫度 20~30 °C,不同時間的地圖顏色才能比較)時自己給。字的顏色自動選深色或白色(`textOn()`),跟著主題切換。
29
29
  - 選取:`ink` 色 2 px 外框,在分區外 4 px。
30
30
  - 沒有資料(`value` 是 `null`):虛線框,名稱加「沒有資料」,不能選。
31
- - 位置:`area: { row, col, rows, cols }`(從 1 開始);沒給時依序排入 `columns` 欄(預設 4)、每列 `rowHeight` px(預設 120)。目前只有矩形。
31
+ - 位置:`area: { row, col, rows, cols }`(從 1 開始);沒給時依序排入 `columns` 欄(預設 4)、每列 `rowHeight` px(預設 120)。只有矩形;任意多邊形用 FloorPlan。
32
32
  - `fill`:列高平分地圖拿到的高度,最少 `rowHeight` px,不留空白。
33
33
  - 選取是受控的 `value`(選中分區的 `id`)加 `onChange(id, zone)`。
34
34
  - 數值和單位之間有一個空格,畫面上寫「23.1 °C」,和按鈕的名稱一樣(WCAG 2.5.3)。
package/docs/agents.md CHANGED
@@ -65,11 +65,11 @@ export default [ui.configs.recommended];
65
65
  ```html
66
66
  <meta charset="utf-8">
67
67
  <meta name="viewport" content="width=device-width, initial-scale=1">
68
- <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.48.2/fonts.css">
69
- <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.48.2/tokens.css">
70
- <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.48.2/styles.css">
68
+ <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.49.0/fonts.css">
69
+ <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.49.0/tokens.css">
70
+ <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.49.0/styles.css">
71
71
  <div id="root"></div>
72
- <script src="https://seanyeh77.github.io/ui-design-system/dist/0.48.2/bundle.js"></script>
72
+ <script src="https://seanyeh77.github.io/ui-design-system/dist/0.49.0/bundle.js"></script>
73
73
  <script>
74
74
  const h = React.createElement;
75
75
  UI.initTheme();
@@ -77,6 +77,6 @@ export default [ui.configs.recommended];
77
77
  </script>
78
78
  ```
79
79
 
80
- Pin a version as above: `/dist/<version>/` never changes; `/dist/` always serves the latest release. jsDelivr has the same files (`https://cdn.jsdelivr.net/npm/@seanyeh77/ui@0.48.2/dist/bundle.js`, `…/dist/styles.css`; the fonts at `https://cdn.jsdelivr.net/npm/@seanyeh77/tokens@0.48.2/fonts.css`). Without a bundler, `@seanyeh77/ui/dist/fonts.css` cannot resolve its import: load the tokens package's `fonts.css` or the pinned site URL.
80
+ Pin a version as above: `/dist/<version>/` never changes; `/dist/` always serves the latest release. jsDelivr has the same files (`https://cdn.jsdelivr.net/npm/@seanyeh77/ui@0.49.0/dist/bundle.js`, `…/dist/styles.css`; the fonts at `https://cdn.jsdelivr.net/npm/@seanyeh77/tokens@0.49.0/fonts.css`). Without a bundler, `@seanyeh77/ui/dist/fonts.css` cannot resolve its import: load the tokens package's `fonts.css` or the pinned site URL.
81
81
 
82
82
  Scope: web UI, and the tokens of SeanYeh's Slidev decks (`initTheme({ preset: 'teaching' })`, see `theme.md`). Slide layout, Notion documents and teaching diagrams follow the separate `teaching-materials-style` skill.
@@ -107,6 +107,10 @@
107
107
  "name": "FileUpload",
108
108
  "group": "Forms"
109
109
  },
110
+ {
111
+ "name": "FloorPlan",
112
+ "group": "Monitoring"
113
+ },
110
114
  {
111
115
  "name": "FormGrid",
112
116
  "group": "Forms"
package/docs/data.md CHANGED
@@ -16,7 +16,8 @@
16
16
  | 類別比較 | `BarChart` |
17
17
  | 知道進度 | `ProgressBar`;不知道要多久用 `LoadingBar`;達成率用 `ProgressRing` |
18
18
  | 數值和它的界線 | `Meter` |
19
- | 依數值上色的平面圖 | `ZoneMap` |
19
+ | 依數值上色的平面圖,分區在格線上 | `ZoneMap` |
20
+ | 依數值上色的平面圖,分區是任意多邊形 | `FloorPlan`(何時用哪個見 [monitoring.md](monitoring.md)) |
20
21
  | 元件架構 | `LayerGraph`;其他方框與箭頭的圖用 Graph 的 class |
21
22
 
22
23
  ## 表格與結果清單
@@ -14,13 +14,19 @@
14
14
 
15
15
  | 用途 | 元件 |
16
16
  |---|---|
17
- | 分區平面圖,依數值填熱度色 | `ZoneMap`(名稱 16 px 和狀態同一行,主數值 31 px,次要資訊 13 px) |
17
+ | 分區平面圖,分區排在規則格線上(矩形) | `ZoneMap`(名稱 16 px 和狀態同一行,主數值 31 px,次要資訊 13 px) |
18
+ | 分區平面圖,分區是任意多邊形(建築模型算出的外框、L 形、有洞),可縮放 | `FloorPlan`(名稱 16 px,主數值 25 px,狀態 13 px;放不下的標籤改膠囊或捨棄) |
18
19
  | 事件列表,由新到舊 | `EventTimeline`(時間、類型圖示、說明) |
19
20
  | 時鐘、回放、回到現在 | `TimeControl`(直排,時鐘 28 px) |
20
21
  | 預測與實際、節能的折線 | `LineChart`(`dashed`、`band`、`now`、`thresholds`、`marker`、`playhead`、`headline`) |
21
22
  | 沿時間軸的狀態色帶 | `StatusBand`(12 px,貼在折線圖底部,名稱寫在圖例) |
22
23
  | 數值和注意線、上限 | `Meter` |
23
24
 
25
+ ## 平面圖
26
+
27
+ - 分區能排成格線(每區一格或跨幾格)時用 `ZoneMap`:每區都有完整的字,最好讀。分區的外框來自圖面或建築模型、形狀不規則時用 `FloorPlan`:位置和形狀照實際,字放不下時改成膠囊或只在游標提示裡。
28
+ - 兩者的填色、注意、預測、沒有資料、選取的樣子相同,同一頁可以並用。FloorPlan 在手機上旁邊附 DataTable 的清單檢視。
29
+
24
30
  ## 圖表
25
31
 
26
32
  - 預測與實際的圖:實際是實線,預測是虛線(`chart-3`);「現在」是一條實線,之後的未來區疊預測斜線;注意線和上限是 1.5 px 的 `warning`/`danger` 虛線,標籤靠右寫在線上方;下一回合的單點預測是空心圓加標籤。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyeh77/ui",
3
- "version": "0.48.2",
3
+ "version": "0.49.0",
4
4
  "description": "SeanYeh's design system: typed React components on Base UI, styled with design tokens.",
5
5
  "license": "MIT",
6
6
  "author": "Hsiu-An Yeh",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@base-ui/react": "^1.9.0",
61
- "@seanyeh77/tokens": "^0.48.2"
61
+ "@seanyeh77/tokens": "^0.49.0"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "node scripts/theme-defaults.ts && tsdown && node scripts/postbuild.ts",