@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/index.d.ts
CHANGED
|
@@ -1437,8 +1437,11 @@ interface ZoneMapProps {
|
|
|
1437
1437
|
/** Columns of the grid. Default 4. Where a zone would be narrower than 150 px (phones), fewer columns are used and
|
|
1438
1438
|
* `area` placements are dropped, so zones flow in order. */
|
|
1439
1439
|
columns?: number;
|
|
1440
|
-
/** Height of one grid row in px. Default 120. */
|
|
1440
|
+
/** Height of one grid row in px. Default 120. With `fill`, the least height of a row. */
|
|
1441
1441
|
rowHeight?: number;
|
|
1442
|
+
/** Rows grow to fill the height the map is given (in ConsoleLayout's main view, or any flex column), never below
|
|
1443
|
+
* `rowHeight`. */
|
|
1444
|
+
fill?: boolean;
|
|
1442
1445
|
/** The heat scale's range for zones without a fill. Default 20 to 30. */
|
|
1443
1446
|
min?: number;
|
|
1444
1447
|
max?: number;
|
|
@@ -1446,7 +1449,7 @@ interface ZoneMapProps {
|
|
|
1446
1449
|
onSelect?: (zone: Zone) => void;
|
|
1447
1450
|
className?: string;
|
|
1448
1451
|
}
|
|
1449
|
-
export declare function ZoneMap({ zones, label, columns, rowHeight, min, max, selectedId, onSelect, className }: ZoneMapProps): React.JSX.Element;
|
|
1452
|
+
export declare function ZoneMap({ zones, label, columns, rowHeight, fill, min, max, selectedId, onSelect, className }: ZoneMapProps): React.JSX.Element;
|
|
1450
1453
|
type EventKind = 'alert' | 'switch' | 'ai' | 'manual';
|
|
1451
1454
|
interface TimelineEvent {
|
|
1452
1455
|
id?: string;
|
package/dist/index.js
CHANGED
|
@@ -9219,14 +9219,14 @@ function Meter({ label, value, min, max, warn, limit, unit, decimals = 0, classN
|
|
|
9219
9219
|
* and one detail line. Zones are buttons: Tab moves between them, Enter or Space selects. The selected zone has an
|
|
9220
9220
|
* ink outline outside it; a zone needing attention has a 4 px warning or danger border and 「⚠」 in its state. */
|
|
9221
9221
|
const DATA_TOKEN = /^(heat-[1-7]|diverge-(neg|pos)(-strong)?|diverge-zero|chart-[1-4])$/;
|
|
9222
|
-
function ZoneMap({ zones, label, columns = 4, rowHeight = 120, min = 20, max = 30, selectedId, onSelect, className }) {
|
|
9222
|
+
function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, min = 20, max = 30, selectedId, onSelect, className }) {
|
|
9223
9223
|
return /* @__PURE__ */ jsx("div", {
|
|
9224
|
-
className: cx("ui-zonemap", className),
|
|
9224
|
+
className: cx("ui-zonemap", fill && "is-fill", className),
|
|
9225
9225
|
role: "group",
|
|
9226
9226
|
"aria-label": label,
|
|
9227
9227
|
style: {
|
|
9228
9228
|
"--zone-cols": columns,
|
|
9229
|
-
gridAutoRows: rowHeight + "px"
|
|
9229
|
+
gridAutoRows: fill ? `minmax(${rowHeight}px, 1fr)` : rowHeight + "px"
|
|
9230
9230
|
},
|
|
9231
9231
|
children: zones.map((z) => {
|
|
9232
9232
|
const place = z.area ? {
|