@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/dist/bundle.js +20 -20
- package/dist/components/FloorPlan/FloorPlan.d.ts +65 -0
- package/dist/components/FloorPlan/FloorPlan.js +822 -0
- package/dist/components/FloorPlan/FloorPlan.js.map +1 -0
- package/dist/components/InlineCode/InlineCode.js +41 -9
- package/dist/components/InlineCode/InlineCode.js.map +1 -1
- package/dist/components/LayerGraph/LayerGraph.js +19 -6
- package/dist/components/LayerGraph/LayerGraph.js.map +1 -1
- package/dist/components/ZoneMap/ZoneMap.d.ts +3 -0
- package/dist/components/ZoneMap/ZoneMap.js +6 -20
- package/dist/components/ZoneMap/ZoneMap.js.map +1 -1
- package/dist/css/DataTable.css +1 -1
- package/dist/css/FloorPlan.css +270 -0
- package/dist/css/InlineCode.css +23 -0
- package/dist/css/ZoneMap.css +0 -97
- package/dist/css/base.css +99 -0
- package/dist/i18n.js +6 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/internal/util.js +19 -1
- package/dist/internal/util.js.map +1 -1
- package/dist/internal/zone.js +48 -0
- package/dist/internal/zone.js.map +1 -0
- package/dist/styles.css +440 -151
- package/docs/DataColors.md +1 -1
- package/docs/FloorPlan.md +43 -0
- package/docs/InlineCode.md +1 -1
- package/docs/ZoneMap.md +2 -2
- package/docs/agents.md +5 -5
- package/docs/components.json +4 -0
- package/docs/data.md +2 -1
- package/docs/monitoring.md +7 -1
- package/package.json +2 -2
|
@@ -56,4 +56,7 @@ export interface ZoneMapProps {
|
|
|
56
56
|
/** Extra class on the root element. */
|
|
57
57
|
className?: string;
|
|
58
58
|
}
|
|
59
|
+
/** A floor plan of zones as rectangles on a grid, each filled by its value (heat scale) with its name, state, figure
|
|
60
|
+
* and one detail line. Zones are buttons: Tab moves between them, Enter or Space selects. The selected zone has an
|
|
61
|
+
* ink outline outside it; a zone needing attention has a 4 px warning or danger border and 「⚠」 in its state. */
|
|
59
62
|
export declare function ZoneMap({ zones, label, columns, rowHeight, fill, className, ...p }: ZoneMapProps): React.JSX.Element;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { devWarn } from "../../internal/dev.js";
|
|
3
3
|
import { cx } from "../../internal/util.js";
|
|
4
|
-
import { format } from "../../format.js";
|
|
5
4
|
import { tr } from "../../i18n.js";
|
|
6
|
-
import {
|
|
5
|
+
import { heatRange, noData, zoneText } from "../../internal/zone.js";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
// src/components/ZoneMap/ZoneMap.tsx
|
|
9
8
|
/** A floor plan of zones as rectangles on a grid, each filled by its value (heat scale) with its name, state, figure
|
|
10
9
|
* and one detail line. Zones are buttons: Tab moves between them, Enter or Space selects. The selected zone has an
|
|
11
10
|
* ink outline outside it; a zone needing attention has a 4 px warning or danger border and 「⚠」 in its state. */
|
|
12
|
-
const DATA_TOKEN = /^(heat-[1-7]|diverge-(neg|pos)(-strong)?|diverge-zero|chart-[1-4])$/;
|
|
13
11
|
function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, className, ...p }) {
|
|
14
12
|
devWarn(p.selectedId !== void 0 || p.onSelect !== void 0, "ZoneMap", "selectedId and onSelect are renamed value and onChange (id, zone); pass those instead.");
|
|
15
13
|
const selectedId = p.value !== void 0 ? p.value : p.selectedId;
|
|
16
14
|
const pick = (z) => p.onChange ? p.onChange(z.id, z) : p.onSelect?.(z);
|
|
17
|
-
const
|
|
18
|
-
const lo = p.min ?? (values.length ? Math.min(...values) : 0);
|
|
19
|
-
const hiRaw = p.max ?? (values.length ? Math.max(...values) : 1);
|
|
20
|
-
const [min, max] = hiRaw > lo ? [lo, hiRaw] : [lo - 1, lo + 1];
|
|
15
|
+
const [min, max] = heatRange(zones, p.min, p.max);
|
|
21
16
|
return /* @__PURE__ */ jsx("div", {
|
|
22
17
|
className: cx("ui-zonemap", fill && "is-fill", className),
|
|
23
18
|
role: "group",
|
|
@@ -31,7 +26,7 @@ function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, cla
|
|
|
31
26
|
gridRow: `${z.area.row} / span ${z.area.rows ?? 1}`,
|
|
32
27
|
gridColumn: `${z.area.col} / span ${z.area.cols ?? 1}`
|
|
33
28
|
} : void 0;
|
|
34
|
-
if (z
|
|
29
|
+
if (noData(z)) return /* @__PURE__ */ jsxs("div", {
|
|
35
30
|
className: "ui-zone is-empty",
|
|
36
31
|
style: place,
|
|
37
32
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -42,11 +37,7 @@ function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, cla
|
|
|
42
37
|
children: tr("沒有資料")
|
|
43
38
|
})]
|
|
44
39
|
}, z.id);
|
|
45
|
-
const tone = z
|
|
46
|
-
const fill = z.fill ?? (z.value != null ? heatToken(z.value, min, max) : "surface-sub");
|
|
47
|
-
const bg = /^[a-z][a-z0-9-]*$/.test(fill) ? `var(--${fill})` : fill;
|
|
48
|
-
const state = (tone === "normal" ? "" : "⚠ ") + (z.state ?? (z.forecast ? tr("預測") : tr("正常")));
|
|
49
|
-
const figure = z.value != null ? format.number(z.value, z.decimals ?? 1) : "—";
|
|
40
|
+
const { tone, fill, bg, color, state, figure, label: name } = zoneText(z, min, max);
|
|
50
41
|
const on = selectedId === z.id;
|
|
51
42
|
return /* @__PURE__ */ jsxs("button", {
|
|
52
43
|
type: "button",
|
|
@@ -55,15 +46,10 @@ function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, cla
|
|
|
55
46
|
style: {
|
|
56
47
|
...place,
|
|
57
48
|
background: bg,
|
|
58
|
-
color
|
|
49
|
+
color
|
|
59
50
|
},
|
|
60
51
|
"aria-pressed": on,
|
|
61
|
-
"aria-label":
|
|
62
|
-
z.name,
|
|
63
|
-
figure + (z.unit ? " " + z.unit : ""),
|
|
64
|
-
state.replace("⚠ ", ""),
|
|
65
|
-
z.detail
|
|
66
|
-
].filter(Boolean).join(tr(",")),
|
|
52
|
+
"aria-label": name,
|
|
67
53
|
onClick: () => pick(z),
|
|
68
54
|
children: [
|
|
69
55
|
/* @__PURE__ */ jsxs("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneMap.js","names":[],"sources":["../../../src/components/ZoneMap/ZoneMap.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { devWarn } from '../../internal/dev';\nimport { cx } from '../../internal/util';\nimport {
|
|
1
|
+
{"version":3,"file":"ZoneMap.js","names":[],"sources":["../../../src/components/ZoneMap/ZoneMap.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { devWarn } from '../../internal/dev';\nimport { cx } from '../../internal/util';\nimport { tr } from '../../i18n';\nimport { heatRange, noData, zoneText } from '../../internal/zone';\n\nexport interface Zone {\n /** Unique id: value and onChange use it. */\n id: string;\n /** 「A 區」. */\n name: string;\n /** The main figure; null or undefined: no data (a dashed outline, not selectable). */\n value?: number | null;\n /** After the figure, smaller: '°C'. */\n unit?: string;\n /** Decimals of the figure. Default 1. */\n decimals?: number;\n /** The fill: a token name such as 'heat-5' or a color. Default: from the value on the heat scale (min, max). */\n fill?: string;\n /** `warning` or `danger`: a 4 px border in that color, and 「⚠」 before the state. Default normal. */\n tone?: 'normal' | 'warning' | 'danger';\n /** The state in words, e.g. 「正常」「注意」「超過上限」. Default 「正常」, or 「預測」 for a forecast. */\n state?: string;\n /** A forecast, not a measurement: the forecast stripes over the fill. */\n forecast?: boolean;\n /** One line of secondary information, e.g. 「進氣 26.1 °C」. */\n detail?: string;\n /** Where it sits on the grid (1-based); default: the next free cell. */\n area?: { row: number; col: number; rows?: number; cols?: number };\n}\n\nexport interface ZoneMapProps {\n /** The zones, in order (placed by `area` or flowing into the grid). */\n zones: Zone[];\n /** What the map shows, for screen readers, e.g. 「設施分區」. */\n label: string;\n /** Columns of the grid. Default 4. Where a zone would be narrower than 150 px (phones), fewer columns are used and\n * `area` placements are dropped, so zones flow in order. */\n columns?: number;\n /** Height of one grid row in px. Default 120. With `fill`, the least height of a row. */\n rowHeight?: number;\n /** Rows grow to fill the height the map is given (in ConsoleLayout's main view, or any flex column), never below\n * `rowHeight`. */\n fill?: boolean;\n /** Bottom of the heat scale for zones without a fill. Default: the smallest value among the zones. */\n min?: number;\n /** Top of the heat scale for zones without a fill. Default: the largest value among the zones. */\n max?: number;\n /** The selected zone's id (controlled); null for none. */\n value?: string | null;\n /** A zone was picked (click, Enter or Space): its id, and the zone. */\n onChange?: (id: string, zone: Zone) => void;\n /** @deprecated use value. */\n selectedId?: string | null;\n /** @deprecated use onChange (it gets the id first, the zone second). */\n onSelect?: (zone: Zone) => void;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** A floor plan of zones as rectangles on a grid, each filled by its value (heat scale) with its name, state, figure\n * and one detail line. Zones are buttons: Tab moves between them, Enter or Space selects. The selected zone has an\n * ink outline outside it; a zone needing attention has a 4 px warning or danger border and 「⚠」 in its state. */\nexport function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, className, ...p }: ZoneMapProps) {\n devWarn(\n p.selectedId !== undefined || p.onSelect !== undefined,\n 'ZoneMap',\n 'selectedId and onSelect are renamed value and onChange (id, zone); pass those instead.',\n );\n const selectedId = p.value !== undefined ? p.value : p.selectedId;\n const pick = (z: Zone) => (p.onChange ? p.onChange(z.id, z) : p.onSelect?.(z));\n // The heat scale spans the zones' own values unless min and max are given: a map of humidity or load reads as well as\n // one of temperatures.\n const [min, max] = heatRange(zones, p.min, p.max);\n return (\n <div\n className={cx('ui-zonemap', fill && 'is-fill', className)}\n role=\"group\"\n aria-label={label}\n style={{ '--zone-cols': columns, gridAutoRows: fill ? `minmax(${rowHeight}px, 1fr)` : rowHeight + 'px' } as React.CSSProperties}\n >\n {zones.map((z) => {\n const place = z.area ? { gridRow: `${z.area.row} / span ${z.area.rows ?? 1}`, gridColumn: `${z.area.col} / span ${z.area.cols ?? 1}` } : undefined;\n if (noData(z))\n return (\n <div key={z.id} className=\"ui-zone is-empty\" style={place}>\n <span className=\"ui-zone-name\">{z.name}</span>\n <span className=\"ui-zone-detail\">{tr('沒有資料')}</span>\n </div>\n );\n const { tone, fill, bg, color, state, figure, label: name } = zoneText(z, min, max);\n const on = selectedId === z.id;\n return (\n <button\n key={z.id}\n type=\"button\"\n className={cx('ui-zone', 'is-' + tone, z.forecast && 'ui-forecast', on && 'is-selected')}\n data-fill={fill}\n // Text on the data tokens comes from CSS (it follows the theme); other fills are measured here.\n style={{ ...place, background: bg, color }}\n aria-pressed={on}\n aria-label={name}\n onClick={() => pick(z)}\n >\n <span className=\"ui-zone-head\">\n <span className=\"ui-zone-name\">{z.name}</span>\n <span className=\"ui-zone-state\">{state}</span>\n </span>\n <span className=\"ui-zone-value\">\n {figure}\n {/* The space before the unit sits in the unit's text font (a Geist Mono space at h2 size is about 20 px wide)\n and does not break: the shown text is 「23.1 °C」, the same as the button's name (WCAG 2.5.3). */}\n {z.unit ? <span className=\"ui-zone-unit\">{'\\u00a0' + z.unit}</span> : null}\n </span>\n {z.detail ? <span className=\"ui-zone-detail\">{z.detail}</span> : null}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AA+DA,SAAgB,QAAQ,EAAE,OAAO,OAAO,UAAU,GAAG,YAAY,KAAK,OAAO,OAAO,WAAW,GAAG,KAAmB;CACnH,QACE,EAAE,eAAe,KAAA,KAAa,EAAE,aAAa,KAAA,GAC7C,WACA,wFACF;CACA,MAAM,aAAa,EAAE,UAAU,KAAA,IAAY,EAAE,QAAQ,EAAE;CACvD,MAAM,QAAQ,MAAa,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC;CAG5E,MAAM,CAAC,KAAK,OAAO,UAAU,OAAO,EAAE,KAAK,EAAE,GAAG;CAChD,OACE,oBAAC,OAAD;EACE,WAAW,GAAG,cAAc,QAAQ,WAAW,SAAS;EACxD,MAAK;EACL,cAAY;EACZ,OAAO;GAAE,eAAe;GAAS,cAAc,OAAO,UAAU,UAAU,YAAY,YAAY;EAAK;EAEtG,UAAA,MAAM,KAAK,MAAM;GAChB,MAAM,QAAQ,EAAE,OAAO;IAAE,SAAS,GAAG,EAAE,KAAK,IAAI,UAAU,EAAE,KAAK,QAAQ;IAAK,YAAY,GAAG,EAAE,KAAK,IAAI,UAAU,EAAE,KAAK,QAAQ;GAAI,IAAI,KAAA;GACzI,IAAI,OAAO,CAAC,GACV,OACE,qBAAC,OAAD;IAAgB,WAAU;IAAmB,OAAO;IAApD,UAAA,CACE,oBAAC,QAAD;KAAM,WAAU;KAAgB,UAAA,EAAE;IAAW,CAAA,GAC7C,oBAAC,QAAD;KAAM,WAAU;KAAkB,UAAA,GAAG,MAAM;IAAQ,CAAA,CAChD;GAHK,GAAA,EAAE,EAGP;GAET,MAAM,EAAE,MAAM,MAAM,IAAI,OAAO,OAAO,QAAQ,OAAO,SAAS,SAAS,GAAG,KAAK,GAAG;GAClF,MAAM,KAAK,eAAe,EAAE;GAC5B,OACE,qBAAC,UAAD;IAEE,MAAK;IACL,WAAW,GAAG,WAAW,QAAQ,MAAM,EAAE,YAAY,eAAe,MAAM,aAAa;IACvF,aAAW;IAEX,OAAO;KAAE,GAAG;KAAO,YAAY;KAAI;IAAM;IACzC,gBAAc;IACd,cAAY;IACZ,eAAe,KAAK,CAAC;IATvB,UAAA;KAWE,qBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,oBAAC,QAAD;OAAM,WAAU;OAAgB,UAAA,EAAE;MAAW,CAAA,GAC7C,oBAAC,QAAD;OAAM,WAAU;OAAiB,UAAA;MAAY,CAAA,CACzC;;KACN,qBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACG,QAGA,EAAE,OAAO,oBAAC,QAAD;OAAM,WAAU;OAAgB,UAAA,SAAW,EAAE;MAAW,CAAA,IAAI,IAClE;;KACL,EAAE,SAAS,oBAAC,QAAD;MAAM,WAAU;MAAkB,UAAA,EAAE;KAAa,CAAA,IAAI;IAC3D;GArBD,GAAA,EAAE,EAqBD;EAEZ,CAAC;CACE,CAAA;AAET"}
|
package/dist/css/DataTable.css
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@layer theme, base, ui, components, utilities;
|
|
2
2
|
@layer ui.tokens, ui.components;
|
|
3
|
+
@import './Tooltip.css';
|
|
3
4
|
@import './InlineCode.css';
|
|
4
5
|
@import './Button.css';
|
|
5
6
|
@import './Dialog.css';
|
|
@@ -8,7 +9,6 @@
|
|
|
8
9
|
@import './Checkbox.css';
|
|
9
10
|
@import './RadioGroup.css';
|
|
10
11
|
@import './SearchField.css';
|
|
11
|
-
@import './Tooltip.css';
|
|
12
12
|
@import './IconButton.css';
|
|
13
13
|
@import './Menu.css';
|
|
14
14
|
@import './Popover.css';
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
@layer theme, base, ui, components, utilities;
|
|
2
|
+
@layer ui.tokens, ui.components;
|
|
3
|
+
@import './IconButton.css';
|
|
4
|
+
@layer ui.components {
|
|
5
|
+
/* FloorPlan: zones with any outline in an SVG, labels as HTML on top (the same size at every zoom). Fills, the 4 px
|
|
6
|
+
attention border, the forecast stripes, the selection outline (ink, 2 px, 4 px outside) and the label type follow
|
|
7
|
+
ZoneMap. */
|
|
8
|
+
.ui-floorplan {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: var(--space-3);
|
|
12
|
+
min-width: 0;
|
|
13
|
+
}
|
|
14
|
+
.ui-floorplan.is-fill {
|
|
15
|
+
flex: 1 1 auto;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
}
|
|
18
|
+
.ui-fp-box {
|
|
19
|
+
position: relative;
|
|
20
|
+
width: 100%;
|
|
21
|
+
min-height: 240px;
|
|
22
|
+
max-height: 640px;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
border-radius: var(--radius-md);
|
|
25
|
+
}
|
|
26
|
+
.ui-floorplan.is-fill .ui-fp-box {
|
|
27
|
+
flex: 1 1 auto;
|
|
28
|
+
max-height: none;
|
|
29
|
+
}
|
|
30
|
+
.ui-fp-svg {
|
|
31
|
+
position: absolute;
|
|
32
|
+
inset: 0;
|
|
33
|
+
display: block;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
touch-action: none;
|
|
37
|
+
-webkit-user-select: none;
|
|
38
|
+
user-select: none;
|
|
39
|
+
}
|
|
40
|
+
.ui-fp-shell {
|
|
41
|
+
fill: var(--surface-sub);
|
|
42
|
+
stroke: var(--line-strong);
|
|
43
|
+
stroke-width: 1.5px;
|
|
44
|
+
vector-effect: non-scaling-stroke;
|
|
45
|
+
}
|
|
46
|
+
.ui-fp-zone {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
outline: none;
|
|
49
|
+
}
|
|
50
|
+
.ui-fp-fill {
|
|
51
|
+
stroke: var(--surface);
|
|
52
|
+
stroke-width: 1.5px;
|
|
53
|
+
stroke-linejoin: round;
|
|
54
|
+
vector-effect: non-scaling-stroke;
|
|
55
|
+
}
|
|
56
|
+
.ui-fp-zone.is-warning .ui-fp-tone {
|
|
57
|
+
stroke: var(--warning);
|
|
58
|
+
}
|
|
59
|
+
.ui-fp-zone.is-danger .ui-fp-tone {
|
|
60
|
+
stroke: var(--danger);
|
|
61
|
+
}
|
|
62
|
+
.ui-fp-stripe {
|
|
63
|
+
fill: var(--forecast-stripe);
|
|
64
|
+
}
|
|
65
|
+
.ui-fp-empty {
|
|
66
|
+
fill: transparent;
|
|
67
|
+
stroke: var(--line-strong);
|
|
68
|
+
stroke-width: 1px;
|
|
69
|
+
stroke-dasharray: 4 3;
|
|
70
|
+
vector-effect: non-scaling-stroke;
|
|
71
|
+
}
|
|
72
|
+
.ui-fp-edge {
|
|
73
|
+
fill: none;
|
|
74
|
+
stroke: var(--ink-muted);
|
|
75
|
+
stroke-width: 1.5px;
|
|
76
|
+
stroke-dasharray: 5 4;
|
|
77
|
+
vector-effect: non-scaling-stroke;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
}
|
|
80
|
+
.ui-fp-group {
|
|
81
|
+
fill: var(--ink-muted);
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Labels: centred on the zone's label point, sized by FloorPlan (width and height set inline). */
|
|
86
|
+
.ui-fp-labels {
|
|
87
|
+
position: absolute;
|
|
88
|
+
inset: 0;
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
}
|
|
91
|
+
.ui-fp-labels > * {
|
|
92
|
+
position: absolute;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
}
|
|
97
|
+
.ui-fp-label {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
color: var(--ink);
|
|
103
|
+
text-align: center;
|
|
104
|
+
}
|
|
105
|
+
.ui-fp-name {
|
|
106
|
+
max-width: 100%;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
text-overflow: ellipsis;
|
|
109
|
+
font-size: var(--text-body);
|
|
110
|
+
font-weight: 600;
|
|
111
|
+
line-height: 22px;
|
|
112
|
+
}
|
|
113
|
+
.ui-fp-value {
|
|
114
|
+
font-family: var(--font-mono);
|
|
115
|
+
font-size: var(--text-h3);
|
|
116
|
+
font-weight: 700;
|
|
117
|
+
line-height: 32px;
|
|
118
|
+
font-variant-numeric: tabular-nums;
|
|
119
|
+
}
|
|
120
|
+
.ui-fp-unit {
|
|
121
|
+
font-family: var(--font-sans);
|
|
122
|
+
font-size: var(--text-body);
|
|
123
|
+
font-weight: 500;
|
|
124
|
+
}
|
|
125
|
+
.ui-fp-state {
|
|
126
|
+
font-size: var(--text-small);
|
|
127
|
+
font-weight: 600;
|
|
128
|
+
line-height: 20px;
|
|
129
|
+
}
|
|
130
|
+
.ui-fp-label.is-muted .ui-fp-name {
|
|
131
|
+
font-size: var(--text-small);
|
|
132
|
+
line-height: 20px;
|
|
133
|
+
}
|
|
134
|
+
.ui-fp-label.is-muted .ui-fp-value {
|
|
135
|
+
font-size: var(--text-body);
|
|
136
|
+
line-height: 22px;
|
|
137
|
+
}
|
|
138
|
+
.ui-fp-label.is-muted .ui-fp-unit {
|
|
139
|
+
font-size: var(--text-small);
|
|
140
|
+
}
|
|
141
|
+
.ui-fp-label.is-empty .ui-fp-state {
|
|
142
|
+
color: var(--ink-muted);
|
|
143
|
+
font-weight: 400;
|
|
144
|
+
}
|
|
145
|
+
/* One line on a pill of its own ground: slender zones, and zones too small for the full label. */
|
|
146
|
+
.ui-fp-pill {
|
|
147
|
+
padding: 0 8px;
|
|
148
|
+
border: 1px solid var(--line-strong);
|
|
149
|
+
border-radius: var(--radius-full);
|
|
150
|
+
background: var(--surface);
|
|
151
|
+
color: var(--ink);
|
|
152
|
+
font-size: var(--text-small);
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
line-height: 22px;
|
|
155
|
+
text-align: center;
|
|
156
|
+
}
|
|
157
|
+
.ui-fp-pill.is-empty {
|
|
158
|
+
color: var(--ink-muted);
|
|
159
|
+
}
|
|
160
|
+
.ui-fp-num {
|
|
161
|
+
font-family: var(--font-mono);
|
|
162
|
+
font-variant-numeric: tabular-nums;
|
|
163
|
+
}
|
|
164
|
+
.ui-fp-group-name {
|
|
165
|
+
padding: 0 6px;
|
|
166
|
+
border-radius: var(--radius-xs);
|
|
167
|
+
background: var(--surface);
|
|
168
|
+
color: var(--ink-muted);
|
|
169
|
+
font-size: var(--text-small);
|
|
170
|
+
font-weight: 600;
|
|
171
|
+
line-height: 22px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Tooltip: the look of Tooltip, beside the pointer (or the label point, for keyboard focus). */
|
|
175
|
+
.ui-fp-tip {
|
|
176
|
+
position: absolute;
|
|
177
|
+
z-index: var(--z-raised);
|
|
178
|
+
display: flex;
|
|
179
|
+
flex-direction: column;
|
|
180
|
+
max-width: 240px;
|
|
181
|
+
padding: 6px 10px;
|
|
182
|
+
border-radius: var(--radius-chip);
|
|
183
|
+
background: var(--ink);
|
|
184
|
+
color: var(--bg);
|
|
185
|
+
font-size: var(--text-small);
|
|
186
|
+
line-height: 20px;
|
|
187
|
+
pointer-events: none;
|
|
188
|
+
}
|
|
189
|
+
.ui-fp-tip-name {
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.ui-fp-controls {
|
|
194
|
+
position: absolute;
|
|
195
|
+
right: var(--space-2);
|
|
196
|
+
bottom: var(--space-2);
|
|
197
|
+
display: flex;
|
|
198
|
+
gap: var(--space-1);
|
|
199
|
+
}
|
|
200
|
+
.ui-fp-controls > * {
|
|
201
|
+
background: var(--surface);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* Legend: the heat scale with its ends, the watch and limit marks, and a note when there are muted zones. */
|
|
205
|
+
.ui-fp-legend {
|
|
206
|
+
display: flex;
|
|
207
|
+
flex-wrap: wrap;
|
|
208
|
+
align-items: center;
|
|
209
|
+
gap: var(--space-2) var(--space-4);
|
|
210
|
+
color: var(--ink-muted);
|
|
211
|
+
font-size: var(--text-small);
|
|
212
|
+
line-height: 20px;
|
|
213
|
+
}
|
|
214
|
+
.ui-fp-scale {
|
|
215
|
+
display: inline-flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
gap: var(--space-2);
|
|
218
|
+
}
|
|
219
|
+
.ui-fp-bar {
|
|
220
|
+
position: relative;
|
|
221
|
+
display: inline-flex;
|
|
222
|
+
width: 168px;
|
|
223
|
+
height: 12px;
|
|
224
|
+
border-radius: var(--radius-xs);
|
|
225
|
+
}
|
|
226
|
+
.ui-fp-bar > span:not(.ui-fp-tick) {
|
|
227
|
+
flex: 1;
|
|
228
|
+
}
|
|
229
|
+
.ui-fp-bar > span:first-child {
|
|
230
|
+
border-radius: var(--radius-xs) 0 0 var(--radius-xs);
|
|
231
|
+
}
|
|
232
|
+
.ui-fp-bar > span:nth-child(7) {
|
|
233
|
+
border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
|
|
234
|
+
}
|
|
235
|
+
.ui-fp-tick {
|
|
236
|
+
position: absolute;
|
|
237
|
+
top: -4px;
|
|
238
|
+
width: 2px;
|
|
239
|
+
height: 20px;
|
|
240
|
+
margin-left: -1px;
|
|
241
|
+
}
|
|
242
|
+
.ui-fp-tick.is-warning,
|
|
243
|
+
.ui-fp-key.is-warning::before {
|
|
244
|
+
background: var(--warning);
|
|
245
|
+
}
|
|
246
|
+
.ui-fp-tick.is-danger,
|
|
247
|
+
.ui-fp-key.is-danger::before {
|
|
248
|
+
background: var(--danger);
|
|
249
|
+
}
|
|
250
|
+
.ui-fp-key {
|
|
251
|
+
display: inline-flex;
|
|
252
|
+
align-items: center;
|
|
253
|
+
gap: 6px;
|
|
254
|
+
}
|
|
255
|
+
.ui-fp-key::before {
|
|
256
|
+
content: '';
|
|
257
|
+
width: 2px;
|
|
258
|
+
height: 14px;
|
|
259
|
+
}
|
|
260
|
+
.ui-fp-key.is-muted::before {
|
|
261
|
+
width: 14px;
|
|
262
|
+
border-radius: 3px;
|
|
263
|
+
background: color-mix(in srgb, var(--heat-4) 40%, var(--surface));
|
|
264
|
+
box-shadow: inset 0 0 0 1px var(--line);
|
|
265
|
+
}
|
|
266
|
+
.ui-fp-pill .ui-fp-unit {
|
|
267
|
+
font-size: inherit;
|
|
268
|
+
font-weight: inherit;
|
|
269
|
+
}
|
|
270
|
+
}
|
package/dist/css/InlineCode.css
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@layer theme, base, ui, components, utilities;
|
|
2
2
|
@layer ui.tokens, ui.components;
|
|
3
|
+
@import './Tooltip.css';
|
|
3
4
|
@layer ui.components {
|
|
4
5
|
/* Inline code */
|
|
5
6
|
.ui-code {
|
|
@@ -61,6 +62,28 @@
|
|
|
61
62
|
font-size: var(--text-small);
|
|
62
63
|
white-space: nowrap;
|
|
63
64
|
}
|
|
65
|
+
/* A location in a phone card (DataTable under 600 px) is no wider than the card's value column: the folders are cut
|
|
66
|
+
with 「…」 first and the file name and line stay (codemap/…/tshelper.ts:42); a file name wider than the column is
|
|
67
|
+
cut at its end. InlineCode shows the whole path in a Tooltip while it is cut. Desktop tables and text keep the
|
|
68
|
+
plain inline link. */
|
|
69
|
+
@media (max-width: 599px) {
|
|
70
|
+
.ui-dt-body .ui-code.is-link.is-location {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
max-width: 100%;
|
|
73
|
+
}
|
|
74
|
+
.ui-dt-body .ui-code.is-link.is-location > .ui-code-dir {
|
|
75
|
+
flex: 0 1 auto;
|
|
76
|
+
min-width: 1ch;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
text-overflow: ellipsis;
|
|
79
|
+
}
|
|
80
|
+
.ui-dt-body .ui-code.is-link.is-location > .ui-code-file {
|
|
81
|
+
flex: 0 0 auto;
|
|
82
|
+
max-width: 100%;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
text-overflow: ellipsis;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
64
87
|
/* In a table cell a location is often a target on its own, beside the row's other links: its box is about 17 px of
|
|
65
88
|
13 px text. Vertical padding on an inline box grows the box it is clicked by to at least 24 px (WCAG 2.5.8) and
|
|
66
89
|
moves neither the line nor the row; there is no background, so nothing shows. Desktop rows only: in a phone card
|
package/dist/css/ZoneMap.css
CHANGED
|
@@ -1,103 +1,6 @@
|
|
|
1
1
|
@layer theme, base, ui, components, utilities;
|
|
2
2
|
@layer ui.tokens, ui.components;
|
|
3
3
|
@layer ui.components {
|
|
4
|
-
.ui-zone[data-fill='heat-1'] {
|
|
5
|
-
color: #ffffff;
|
|
6
|
-
}
|
|
7
|
-
.ui-zone[data-fill='heat-2'] {
|
|
8
|
-
color: #171512;
|
|
9
|
-
}
|
|
10
|
-
.ui-zone[data-fill='heat-3'] {
|
|
11
|
-
color: #171512;
|
|
12
|
-
}
|
|
13
|
-
.ui-zone[data-fill='heat-4'] {
|
|
14
|
-
color: #171512;
|
|
15
|
-
}
|
|
16
|
-
.ui-zone[data-fill='heat-5'] {
|
|
17
|
-
color: #171512;
|
|
18
|
-
}
|
|
19
|
-
.ui-zone[data-fill='heat-6'] {
|
|
20
|
-
color: #171512;
|
|
21
|
-
}
|
|
22
|
-
.ui-zone[data-fill='heat-7'] {
|
|
23
|
-
color: #ffffff;
|
|
24
|
-
}
|
|
25
|
-
.ui-zone[data-fill='diverge-neg-strong'] {
|
|
26
|
-
color: #ffffff;
|
|
27
|
-
}
|
|
28
|
-
.ui-zone[data-fill='diverge-neg'] {
|
|
29
|
-
color: #171512;
|
|
30
|
-
}
|
|
31
|
-
.ui-zone[data-fill='diverge-zero'] {
|
|
32
|
-
color: #171512;
|
|
33
|
-
}
|
|
34
|
-
.ui-zone[data-fill='diverge-pos'] {
|
|
35
|
-
color: #171512;
|
|
36
|
-
}
|
|
37
|
-
.ui-zone[data-fill='diverge-pos-strong'] {
|
|
38
|
-
color: #ffffff;
|
|
39
|
-
}
|
|
40
|
-
.ui-zone[data-fill='chart-1'] {
|
|
41
|
-
color: #ffffff;
|
|
42
|
-
}
|
|
43
|
-
.ui-zone[data-fill='chart-2'] {
|
|
44
|
-
color: #171512;
|
|
45
|
-
}
|
|
46
|
-
.ui-zone[data-fill='chart-3'] {
|
|
47
|
-
color: #171512;
|
|
48
|
-
}
|
|
49
|
-
.ui-zone[data-fill='chart-4'] {
|
|
50
|
-
color: #171512;
|
|
51
|
-
}
|
|
52
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-1'] {
|
|
53
|
-
color: #ffffff;
|
|
54
|
-
}
|
|
55
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-2'] {
|
|
56
|
-
color: #171512;
|
|
57
|
-
}
|
|
58
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-3'] {
|
|
59
|
-
color: #171512;
|
|
60
|
-
}
|
|
61
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-4'] {
|
|
62
|
-
color: #ffffff;
|
|
63
|
-
}
|
|
64
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-5'] {
|
|
65
|
-
color: #171512;
|
|
66
|
-
}
|
|
67
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-6'] {
|
|
68
|
-
color: #171512;
|
|
69
|
-
}
|
|
70
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-7'] {
|
|
71
|
-
color: #171512;
|
|
72
|
-
}
|
|
73
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-neg-strong'] {
|
|
74
|
-
color: #171512;
|
|
75
|
-
}
|
|
76
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-neg'] {
|
|
77
|
-
color: #171512;
|
|
78
|
-
}
|
|
79
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-zero'] {
|
|
80
|
-
color: #ffffff;
|
|
81
|
-
}
|
|
82
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-pos'] {
|
|
83
|
-
color: #171512;
|
|
84
|
-
}
|
|
85
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-pos-strong'] {
|
|
86
|
-
color: #171512;
|
|
87
|
-
}
|
|
88
|
-
[data-theme='dark'] .ui-zone[data-fill='chart-1'] {
|
|
89
|
-
color: #171512;
|
|
90
|
-
}
|
|
91
|
-
[data-theme='dark'] .ui-zone[data-fill='chart-2'] {
|
|
92
|
-
color: #171512;
|
|
93
|
-
}
|
|
94
|
-
[data-theme='dark'] .ui-zone[data-fill='chart-3'] {
|
|
95
|
-
color: #171512;
|
|
96
|
-
}
|
|
97
|
-
[data-theme='dark'] .ui-zone[data-fill='chart-4'] {
|
|
98
|
-
color: #171512;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
4
|
/* ZoneMap: zones on a grid, filled by value. Name 16 px and state on one line, the figure 31 px with a 16 px unit,
|
|
102
5
|
one 13 px detail line. Selected: an ink outline 4 px outside; attention: a 4 px warning or danger border. */
|
|
103
6
|
.ui-zonemap {
|
package/dist/css/base.css
CHANGED
|
@@ -685,4 +685,103 @@ label:has(> .ui-switch) {
|
|
|
685
685
|
stroke: var(--surface);
|
|
686
686
|
stroke-width: 2;
|
|
687
687
|
}
|
|
688
|
+
|
|
689
|
+
/* Text on a data fill (ZoneMap zones, FloorPlan labels): the pick of textOn() for each step, per theme, so it follows a
|
|
690
|
+
theme switch without a render. */
|
|
691
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='heat-1'] {
|
|
692
|
+
color: #ffffff;
|
|
693
|
+
}
|
|
694
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='heat-2'] {
|
|
695
|
+
color: #171512;
|
|
696
|
+
}
|
|
697
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='heat-3'] {
|
|
698
|
+
color: #171512;
|
|
699
|
+
}
|
|
700
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='heat-4'] {
|
|
701
|
+
color: #171512;
|
|
702
|
+
}
|
|
703
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='heat-5'] {
|
|
704
|
+
color: #171512;
|
|
705
|
+
}
|
|
706
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='heat-6'] {
|
|
707
|
+
color: #171512;
|
|
708
|
+
}
|
|
709
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='heat-7'] {
|
|
710
|
+
color: #ffffff;
|
|
711
|
+
}
|
|
712
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='diverge-neg-strong'] {
|
|
713
|
+
color: #ffffff;
|
|
714
|
+
}
|
|
715
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='diverge-neg'] {
|
|
716
|
+
color: #171512;
|
|
717
|
+
}
|
|
718
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='diverge-zero'] {
|
|
719
|
+
color: #171512;
|
|
720
|
+
}
|
|
721
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='diverge-pos'] {
|
|
722
|
+
color: #171512;
|
|
723
|
+
}
|
|
724
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='diverge-pos-strong'] {
|
|
725
|
+
color: #ffffff;
|
|
726
|
+
}
|
|
727
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='chart-1'] {
|
|
728
|
+
color: #ffffff;
|
|
729
|
+
}
|
|
730
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='chart-2'] {
|
|
731
|
+
color: #171512;
|
|
732
|
+
}
|
|
733
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='chart-3'] {
|
|
734
|
+
color: #171512;
|
|
735
|
+
}
|
|
736
|
+
:is(.ui-zone, .ui-fp-label)[data-fill='chart-4'] {
|
|
737
|
+
color: #171512;
|
|
738
|
+
}
|
|
739
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='heat-1'] {
|
|
740
|
+
color: #ffffff;
|
|
741
|
+
}
|
|
742
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='heat-2'] {
|
|
743
|
+
color: #171512;
|
|
744
|
+
}
|
|
745
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='heat-3'] {
|
|
746
|
+
color: #171512;
|
|
747
|
+
}
|
|
748
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='heat-4'] {
|
|
749
|
+
color: #ffffff;
|
|
750
|
+
}
|
|
751
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='heat-5'] {
|
|
752
|
+
color: #171512;
|
|
753
|
+
}
|
|
754
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='heat-6'] {
|
|
755
|
+
color: #171512;
|
|
756
|
+
}
|
|
757
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='heat-7'] {
|
|
758
|
+
color: #171512;
|
|
759
|
+
}
|
|
760
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='diverge-neg-strong'] {
|
|
761
|
+
color: #171512;
|
|
762
|
+
}
|
|
763
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='diverge-neg'] {
|
|
764
|
+
color: #171512;
|
|
765
|
+
}
|
|
766
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='diverge-zero'] {
|
|
767
|
+
color: #ffffff;
|
|
768
|
+
}
|
|
769
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='diverge-pos'] {
|
|
770
|
+
color: #171512;
|
|
771
|
+
}
|
|
772
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='diverge-pos-strong'] {
|
|
773
|
+
color: #171512;
|
|
774
|
+
}
|
|
775
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='chart-1'] {
|
|
776
|
+
color: #171512;
|
|
777
|
+
}
|
|
778
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='chart-2'] {
|
|
779
|
+
color: #171512;
|
|
780
|
+
}
|
|
781
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='chart-3'] {
|
|
782
|
+
color: #171512;
|
|
783
|
+
}
|
|
784
|
+
[data-theme='dark'] :is(.ui-zone, .ui-fp-label)[data-fill='chart-4'] {
|
|
785
|
+
color: #171512;
|
|
786
|
+
}
|
|
688
787
|
}
|
package/dist/i18n.js
CHANGED
|
@@ -75,6 +75,12 @@ const I18N = {
|
|
|
75
75
|
"⚠ 超過上限": "⚠ Over limit",
|
|
76
76
|
"注意 {v}": "Watch {v}",
|
|
77
77
|
"上限 {v}": "Limit {v}",
|
|
78
|
+
放大: "Zoom in",
|
|
79
|
+
縮小: "Zoom out",
|
|
80
|
+
重設視角: "Reset view",
|
|
81
|
+
次要: "Secondary",
|
|
82
|
+
"淡色=次要區域": "Faded: secondary zone",
|
|
83
|
+
"+ − 縮放,方向鍵平移": "+ − zoom, arrow keys pan",
|
|
78
84
|
"新增「{q}」": "Add “{q}”",
|
|
79
85
|
"日期格式不正確,請寫成 2026/11/14": "Invalid date. Use 2026/11/14.",
|
|
80
86
|
更多操作: "More actions",
|