@seanyeh77/ui 0.39.0 → 0.40.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/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.css +8 -0
- package/docs/ConsoleLayout.md +2 -2
- package/docs/ZoneMap.md +1 -0
- package/package.json +2 -2
package/dist/styles.css
CHANGED
|
@@ -8571,6 +8571,11 @@ a.ui-wb-brand:focus-visible {
|
|
|
8571
8571
|
padding: 6px;
|
|
8572
8572
|
container-type: inline-size;
|
|
8573
8573
|
}
|
|
8574
|
+
/* fill: the map takes the rest of a flex column (a Card in ConsoleLayout's main view) and its rows share it. */
|
|
8575
|
+
.ui-zonemap.is-fill {
|
|
8576
|
+
flex: 1 1 auto;
|
|
8577
|
+
min-height: 0;
|
|
8578
|
+
}
|
|
8574
8579
|
/* Too narrow for the columns asked: zones flow in order instead of their grid places. */
|
|
8575
8580
|
@container (max-width: 640px) {
|
|
8576
8581
|
.ui-zonemap > .ui-zone {
|
|
@@ -8814,6 +8819,9 @@ a.ui-wb-brand:focus-visible {
|
|
|
8814
8819
|
flex: 1 1 auto;
|
|
8815
8820
|
min-height: 0;
|
|
8816
8821
|
overflow: auto;
|
|
8822
|
+
/* a column, so a ZoneMap with fill (or any flex: 1 child) takes the card's remaining height */
|
|
8823
|
+
display: flex;
|
|
8824
|
+
flex-direction: column;
|
|
8817
8825
|
}
|
|
8818
8826
|
.ui-console-side {
|
|
8819
8827
|
grid-column: 2;
|
package/docs/ConsoleLayout.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- 頂列:左邊 `title`(整頁唯一的標題)和 `tags`(例如 `Tag variant="demo"`「示範資料」);右邊依序是 `status`、`kpis`、`clock`、全螢幕按鈕。頂列的字都是 16 px、同一個顏色:`status` 傳一般文字(例如「AI 最佳化中」),不要用 Badge 或狀態色。
|
|
6
6
|
- `kpis` 放 `KpiCard size="compact"`,在頂列裡去掉卡片底色和陰影,中間用 1 px 線分開。
|
|
7
|
-
- `main`:主視覺,例如裝 ZoneMap 的 Card
|
|
7
|
+
- `main`:主視覺,例如裝 ZoneMap 的 Card;填滿左邊的格子,放不下時在卡片裡捲動。卡片裡是由上而下排的欄,ZoneMap 加 `fill` 就會撐滿卡片剩下的高度。
|
|
8
8
|
- `side`:側欄的卡片,由上到下,例如 TimeControl、EventTimeline。側欄 400 px(版面寬度小於 1280 px 時 360 px),放不下時側欄自己捲動。
|
|
9
9
|
- `bottom`:主視覺下方一列,高度跟著內容,例如裝 LineChart 的 Card;主視覺拿剩下的高度。
|
|
10
10
|
- `extras: [{ id, minHeight, node }]`:螢幕夠高才出現的卡片,加在側欄最後面。`minHeight` 比的是「邏輯高度」,也就是畫面高度 ÷ 放大倍數,例如 1040。
|
|
@@ -23,7 +23,7 @@ h(UI.ConsoleLayout, {
|
|
|
23
23
|
h(UI.KpiCard, { key: 'p', size: 'compact', label: 'PUE', value: 1.42, decimals: 2, target: '目標 ≤ 1.45' }),
|
|
24
24
|
],
|
|
25
25
|
clock: '即時',
|
|
26
|
-
main: h(UI.Card, { title: '機房分區' }, h(UI.ZoneMap, { label: '機房分區', zones: zones })),
|
|
26
|
+
main: h(UI.Card, { title: '機房分區' }, h(UI.ZoneMap, { label: '機房分區', zones: zones, fill: true })),
|
|
27
27
|
side: [h(UI.Card, { key: 't' }, h(UI.TimeControl, timeProps)), h(UI.Card, { key: 'e', title: '事件' }, h(UI.EventTimeline, eventProps))],
|
|
28
28
|
bottom: h(UI.Card, null, h(UI.LineChart, chartProps)),
|
|
29
29
|
extras: [{ id: 'meters', minHeight: 1040, node: h(UI.Card, { title: '各區進氣溫度' }, meters) }],
|
package/docs/ZoneMap.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
- 預測:`forecast` 疊上預測斜線,狀態預設「預測」。
|
|
9
9
|
- 沒有資料(`value` 是 `null`):虛線框,名稱加「沒有資料」,不能選。
|
|
10
10
|
- 位置:`area: { row, col, rows, cols }`(從 1 開始);沒給時依序排入 `columns` 欄(預設 4)、每列 `rowHeight` px(預設 120)。目前只有矩形。
|
|
11
|
+
- `fill`:列高平分地圖拿到的高度,最少 `rowHeight` px。用在 ConsoleLayout 的主視覺卡片裡,讓分區撐滿卡片、不留空白。
|
|
11
12
|
- 鍵盤:每個分區是按鈕,Tab 依序經過,Enter 或空白鍵選取(`aria-pressed`)。螢幕閱讀器念「B 區,28.4 °C,注意,進氣 26.1 °C」。
|
|
12
13
|
|
|
13
14
|
```js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seanyeh77/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.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",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-dom": "^19.3.1",
|
|
50
50
|
"tsdown": "^0.23.7",
|
|
51
51
|
"vitest": "^5.1.0",
|
|
52
|
-
"@seanyeh77/tokens": "^0.
|
|
52
|
+
"@seanyeh77/tokens": "^0.40.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@base-ui/react": "^1.9.0"
|