@seanyeh77/ui 0.36.0 → 0.38.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 +3 -3
- package/dist/bundle.js.map +1 -1
- package/dist/{format-entry-CubJQqC9.js → format-entry-DEIDX9E5.js} +21 -1
- package/dist/format-entry-DEIDX9E5.js.map +1 -0
- package/dist/format.js +1 -1
- package/dist/index.d.ts +200 -9
- package/dist/index.js +604 -69
- package/dist/index.js.map +1 -1
- package/dist/styles.css +543 -17
- package/docs/EventTimeline.md +16 -0
- package/docs/KpiCard.md +18 -0
- package/docs/LineChart.md +42 -1
- package/docs/Meter.md +12 -0
- package/docs/StatusBand.md +24 -0
- package/docs/Tag.md +3 -5
- package/docs/TimeControl.md +21 -0
- package/docs/ZoneMap.md +27 -0
- package/docs/guidelines.md +12 -3
- package/package.json +2 -2
- package/dist/format-entry-CubJQqC9.js.map +0 -1
package/dist/styles.css
CHANGED
|
@@ -4613,29 +4613,28 @@ html.ui-theme-fade * {
|
|
|
4613
4613
|
color: var(--ink-muted);
|
|
4614
4614
|
white-space: nowrap;
|
|
4615
4615
|
}
|
|
4616
|
-
/* Tag variant="forecast":
|
|
4617
|
-
|
|
4616
|
+
/* Tag variant="forecast" and "demo": an icon and words in the state's text color, no fill; the size of the text beside
|
|
4617
|
+
them (a mark beside the brand is as large as the brand). */
|
|
4618
|
+
.ui-tag.is-forecast,
|
|
4619
|
+
.ui-tag.is-demo {
|
|
4618
4620
|
display: inline-flex;
|
|
4619
4621
|
align-items: center;
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4622
|
+
gap: 0.3em;
|
|
4623
|
+
font-size: inherit;
|
|
4624
|
+
font-weight: 600;
|
|
4625
|
+
line-height: inherit;
|
|
4626
|
+
}
|
|
4627
|
+
.ui-tag.is-forecast {
|
|
4624
4628
|
color: var(--accent-text);
|
|
4625
|
-
line-height: 20px;
|
|
4626
4629
|
}
|
|
4627
|
-
/* Tag variant="demo": the whole page shows sample values; beside the brand, one per page. */
|
|
4628
4630
|
.ui-tag.is-demo {
|
|
4629
|
-
display: inline-flex;
|
|
4630
|
-
align-items: center;
|
|
4631
|
-
height: 24px;
|
|
4632
|
-
padding: 0 var(--space-2);
|
|
4633
|
-
border-radius: var(--radius-sm);
|
|
4634
|
-
background: var(--warning-soft);
|
|
4635
4631
|
color: var(--warning-text);
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4632
|
+
}
|
|
4633
|
+
.ui-tag.is-forecast > svg,
|
|
4634
|
+
.ui-tag.is-demo > svg {
|
|
4635
|
+
flex: none;
|
|
4636
|
+
width: 1em;
|
|
4637
|
+
height: 1em;
|
|
4639
4638
|
}
|
|
4640
4639
|
/* A forecast (not measured) area: 45 deg stripes over its fill (4 px line, 9 px period). Put it on the element that
|
|
4641
4640
|
has the fill; it adds a layer on top, the fill and text stay. */
|
|
@@ -8205,3 +8204,530 @@ a.ui-wb-brand:focus-visible {
|
|
|
8205
8204
|
transition: none !important;
|
|
8206
8205
|
}
|
|
8207
8206
|
}
|
|
8207
|
+
|
|
8208
|
+
/* LineChart additions for monitoring: band between two series, now and the future, thresholds, marker, playhead. */
|
|
8209
|
+
.ui-chart-headline {
|
|
8210
|
+
margin-bottom: 4px;
|
|
8211
|
+
font-size: 25px;
|
|
8212
|
+
line-height: 32px;
|
|
8213
|
+
font-weight: 700;
|
|
8214
|
+
font-variant-numeric: tabular-nums;
|
|
8215
|
+
}
|
|
8216
|
+
.ui-chart-swatch.is-dashed {
|
|
8217
|
+
height: 0;
|
|
8218
|
+
width: 14px;
|
|
8219
|
+
border-radius: 0;
|
|
8220
|
+
border-top: 2.5px dashed currentColor;
|
|
8221
|
+
}
|
|
8222
|
+
.ui-chart-swatch.is-band.is-success {
|
|
8223
|
+
background: color-mix(in srgb, var(--success) 28%, transparent);
|
|
8224
|
+
}
|
|
8225
|
+
.ui-chart-swatch.is-band.is-diverge {
|
|
8226
|
+
background: linear-gradient(
|
|
8227
|
+
90deg,
|
|
8228
|
+
color-mix(in srgb, var(--diverge-pos) 60%, transparent) 0 50%,
|
|
8229
|
+
color-mix(in srgb, var(--diverge-neg) 60%, transparent) 50% 100%
|
|
8230
|
+
);
|
|
8231
|
+
}
|
|
8232
|
+
.ui-chart-line.is-dashed {
|
|
8233
|
+
stroke-dasharray: 7 5;
|
|
8234
|
+
animation: ui-fade-in 600ms ease both;
|
|
8235
|
+
}
|
|
8236
|
+
@keyframes ui-fade-in {
|
|
8237
|
+
from {
|
|
8238
|
+
opacity: 0;
|
|
8239
|
+
}
|
|
8240
|
+
}
|
|
8241
|
+
.ui-chart-band {
|
|
8242
|
+
stroke: none;
|
|
8243
|
+
}
|
|
8244
|
+
.ui-chart-band.is-pos {
|
|
8245
|
+
fill: var(--diverge-pos);
|
|
8246
|
+
opacity: 0.3;
|
|
8247
|
+
}
|
|
8248
|
+
.ui-chart-band.is-neg {
|
|
8249
|
+
fill: var(--diverge-neg);
|
|
8250
|
+
opacity: 0.3;
|
|
8251
|
+
}
|
|
8252
|
+
.ui-chart-band.is-success {
|
|
8253
|
+
fill: var(--success);
|
|
8254
|
+
opacity: 0.28;
|
|
8255
|
+
}
|
|
8256
|
+
.ui-chart-empty {
|
|
8257
|
+
position: absolute;
|
|
8258
|
+
inset: 0 0 12.5% 6%;
|
|
8259
|
+
display: flex;
|
|
8260
|
+
align-items: center;
|
|
8261
|
+
justify-content: center;
|
|
8262
|
+
font-size: 13px;
|
|
8263
|
+
color: var(--ink-muted);
|
|
8264
|
+
}
|
|
8265
|
+
.ui-chart-stripe {
|
|
8266
|
+
fill: var(--forecast-stripe);
|
|
8267
|
+
}
|
|
8268
|
+
.ui-chart-threshold line {
|
|
8269
|
+
stroke-width: 1.5;
|
|
8270
|
+
stroke-dasharray: 6 4;
|
|
8271
|
+
}
|
|
8272
|
+
.ui-chart-threshold text {
|
|
8273
|
+
font-size: 12px;
|
|
8274
|
+
font-weight: 600;
|
|
8275
|
+
}
|
|
8276
|
+
.ui-chart-threshold.is-warning line {
|
|
8277
|
+
stroke: var(--warning);
|
|
8278
|
+
}
|
|
8279
|
+
.ui-chart-threshold.is-warning text {
|
|
8280
|
+
fill: var(--warning-text);
|
|
8281
|
+
}
|
|
8282
|
+
.ui-chart-threshold.is-danger line {
|
|
8283
|
+
stroke: var(--danger);
|
|
8284
|
+
}
|
|
8285
|
+
.ui-chart-threshold.is-danger text {
|
|
8286
|
+
fill: var(--danger-text);
|
|
8287
|
+
}
|
|
8288
|
+
.ui-chart-now line {
|
|
8289
|
+
stroke: var(--ink);
|
|
8290
|
+
stroke-width: 1.5;
|
|
8291
|
+
}
|
|
8292
|
+
.ui-chart-now text,
|
|
8293
|
+
.ui-chart-marker text {
|
|
8294
|
+
font-size: 12px;
|
|
8295
|
+
font-weight: 600;
|
|
8296
|
+
fill: var(--ink);
|
|
8297
|
+
}
|
|
8298
|
+
.ui-chart-marker circle {
|
|
8299
|
+
fill: var(--surface);
|
|
8300
|
+
stroke-width: 2.5;
|
|
8301
|
+
}
|
|
8302
|
+
.ui-chart-plot.is-replay {
|
|
8303
|
+
touch-action: pan-y;
|
|
8304
|
+
cursor: ew-resize;
|
|
8305
|
+
}
|
|
8306
|
+
.ui-chart-playhead line {
|
|
8307
|
+
stroke: var(--accent);
|
|
8308
|
+
stroke-width: 2;
|
|
8309
|
+
}
|
|
8310
|
+
.ui-chart-playhead circle {
|
|
8311
|
+
fill: var(--accent);
|
|
8312
|
+
stroke: var(--surface);
|
|
8313
|
+
stroke-width: 2;
|
|
8314
|
+
}
|
|
8315
|
+
|
|
8316
|
+
/* StatusBand: a 12 px band of classes along time; under a LineChart it lines up with the points. */
|
|
8317
|
+
.ui-statusband-bar {
|
|
8318
|
+
position: relative;
|
|
8319
|
+
height: 12px;
|
|
8320
|
+
border-radius: 3px;
|
|
8321
|
+
overflow: hidden;
|
|
8322
|
+
background: var(--surface-sub);
|
|
8323
|
+
}
|
|
8324
|
+
.ui-statusband-bar > span {
|
|
8325
|
+
position: absolute;
|
|
8326
|
+
top: 0;
|
|
8327
|
+
bottom: 0;
|
|
8328
|
+
}
|
|
8329
|
+
.ui-statusband.is-attached .ui-statusband-bar {
|
|
8330
|
+
margin-top: 2px;
|
|
8331
|
+
}
|
|
8332
|
+
.ui-statusband-legend {
|
|
8333
|
+
margin: 8px 0 0;
|
|
8334
|
+
}
|
|
8335
|
+
|
|
8336
|
+
/* Meter: a value against its levels. The head is a grid so stacked meters line up: the state ends where the value
|
|
8337
|
+
column starts, the value is right-aligned in a fixed column. */
|
|
8338
|
+
.ui-meter {
|
|
8339
|
+
--meter-ok: color-mix(in srgb, var(--success) 22%, var(--surface-sub));
|
|
8340
|
+
--meter-warn: color-mix(in srgb, var(--warning) 30%, var(--surface-sub));
|
|
8341
|
+
--meter-over: color-mix(in srgb, var(--danger) 28%, var(--surface-sub));
|
|
8342
|
+
display: flex;
|
|
8343
|
+
flex-direction: column;
|
|
8344
|
+
gap: 6px;
|
|
8345
|
+
min-width: 0;
|
|
8346
|
+
}
|
|
8347
|
+
.ui-meter + .ui-meter {
|
|
8348
|
+
margin-top: var(--space-3);
|
|
8349
|
+
}
|
|
8350
|
+
.ui-meter-head {
|
|
8351
|
+
display: grid;
|
|
8352
|
+
grid-template-columns: minmax(0, 1fr) auto var(--meter-value-width, 8ch);
|
|
8353
|
+
align-items: baseline;
|
|
8354
|
+
column-gap: var(--space-3);
|
|
8355
|
+
}
|
|
8356
|
+
.ui-meter-label {
|
|
8357
|
+
min-width: 0;
|
|
8358
|
+
overflow: hidden;
|
|
8359
|
+
text-overflow: ellipsis;
|
|
8360
|
+
white-space: nowrap;
|
|
8361
|
+
}
|
|
8362
|
+
.ui-meter-state {
|
|
8363
|
+
font-size: 13px;
|
|
8364
|
+
font-weight: 600;
|
|
8365
|
+
white-space: nowrap;
|
|
8366
|
+
text-align: right;
|
|
8367
|
+
}
|
|
8368
|
+
.ui-meter-state.is-success {
|
|
8369
|
+
color: var(--success-text);
|
|
8370
|
+
}
|
|
8371
|
+
.ui-meter-state.is-warning {
|
|
8372
|
+
color: var(--warning-text);
|
|
8373
|
+
}
|
|
8374
|
+
.ui-meter-state.is-danger {
|
|
8375
|
+
color: var(--danger-text);
|
|
8376
|
+
}
|
|
8377
|
+
.ui-meter-value {
|
|
8378
|
+
font-family: var(--font-mono);
|
|
8379
|
+
font-weight: 700;
|
|
8380
|
+
font-variant-numeric: tabular-nums;
|
|
8381
|
+
text-align: right;
|
|
8382
|
+
white-space: nowrap;
|
|
8383
|
+
}
|
|
8384
|
+
.ui-meter-track {
|
|
8385
|
+
position: relative;
|
|
8386
|
+
height: 8px;
|
|
8387
|
+
border-radius: 4px;
|
|
8388
|
+
}
|
|
8389
|
+
.ui-meter-mark {
|
|
8390
|
+
position: absolute;
|
|
8391
|
+
top: -4px;
|
|
8392
|
+
width: 2px;
|
|
8393
|
+
height: 16px;
|
|
8394
|
+
margin-left: -1px;
|
|
8395
|
+
border-radius: 1px;
|
|
8396
|
+
}
|
|
8397
|
+
.ui-meter-mark.is-warning {
|
|
8398
|
+
background: var(--warning);
|
|
8399
|
+
}
|
|
8400
|
+
.ui-meter-mark.is-danger {
|
|
8401
|
+
background: var(--danger);
|
|
8402
|
+
}
|
|
8403
|
+
.ui-meter-dot {
|
|
8404
|
+
position: absolute;
|
|
8405
|
+
top: 50%;
|
|
8406
|
+
width: 14px;
|
|
8407
|
+
height: 14px;
|
|
8408
|
+
border-radius: 7px;
|
|
8409
|
+
transform: translate(-50%, -50%);
|
|
8410
|
+
box-shadow: 0 0 0 2px var(--surface);
|
|
8411
|
+
transition: left 0.3s ease;
|
|
8412
|
+
}
|
|
8413
|
+
.ui-meter-dot.is-success {
|
|
8414
|
+
background: var(--success);
|
|
8415
|
+
}
|
|
8416
|
+
.ui-meter-dot.is-warning {
|
|
8417
|
+
background: var(--warning);
|
|
8418
|
+
}
|
|
8419
|
+
.ui-meter-dot.is-danger {
|
|
8420
|
+
background: var(--danger);
|
|
8421
|
+
}
|
|
8422
|
+
.ui-meter-marks {
|
|
8423
|
+
position: relative;
|
|
8424
|
+
height: 18px;
|
|
8425
|
+
font-size: 12px;
|
|
8426
|
+
line-height: 18px;
|
|
8427
|
+
color: var(--ink-muted);
|
|
8428
|
+
}
|
|
8429
|
+
.ui-meter-marks > span {
|
|
8430
|
+
position: absolute;
|
|
8431
|
+
top: 0;
|
|
8432
|
+
padding: 0 4px;
|
|
8433
|
+
white-space: nowrap;
|
|
8434
|
+
}
|
|
8435
|
+
/* Marks close together: the limit label takes a second line. */
|
|
8436
|
+
.ui-meter-marks.is-stacked {
|
|
8437
|
+
height: 36px;
|
|
8438
|
+
}
|
|
8439
|
+
.ui-meter-marks.is-stacked > span.is-danger {
|
|
8440
|
+
top: 18px;
|
|
8441
|
+
}
|
|
8442
|
+
|
|
8443
|
+
/* KpiCard size="compact": a 22 px number for a top bar, no sparkline, a target line; a verdict that is not success
|
|
8444
|
+
takes the target line's place in its color. */
|
|
8445
|
+
.ui-kpi.is-compact {
|
|
8446
|
+
gap: 2px;
|
|
8447
|
+
padding: 10px 14px;
|
|
8448
|
+
}
|
|
8449
|
+
.ui-kpi.is-compact .ui-kpi-value {
|
|
8450
|
+
font-size: 22px;
|
|
8451
|
+
line-height: 30px;
|
|
8452
|
+
}
|
|
8453
|
+
.ui-kpi-target {
|
|
8454
|
+
font-size: 13px;
|
|
8455
|
+
line-height: 20px;
|
|
8456
|
+
color: var(--ink-muted);
|
|
8457
|
+
}
|
|
8458
|
+
.ui-kpi-verdict {
|
|
8459
|
+
font-weight: 600;
|
|
8460
|
+
}
|
|
8461
|
+
.ui-kpi-verdict.is-warning {
|
|
8462
|
+
color: var(--warning-text);
|
|
8463
|
+
}
|
|
8464
|
+
.ui-kpi-verdict.is-danger {
|
|
8465
|
+
color: var(--danger-text);
|
|
8466
|
+
}
|
|
8467
|
+
.ui-zone[data-fill='heat-1'] {
|
|
8468
|
+
color: #ffffff;
|
|
8469
|
+
}
|
|
8470
|
+
.ui-zone[data-fill='heat-2'] {
|
|
8471
|
+
color: #171512;
|
|
8472
|
+
}
|
|
8473
|
+
.ui-zone[data-fill='heat-3'] {
|
|
8474
|
+
color: #171512;
|
|
8475
|
+
}
|
|
8476
|
+
.ui-zone[data-fill='heat-4'] {
|
|
8477
|
+
color: #171512;
|
|
8478
|
+
}
|
|
8479
|
+
.ui-zone[data-fill='heat-5'] {
|
|
8480
|
+
color: #171512;
|
|
8481
|
+
}
|
|
8482
|
+
.ui-zone[data-fill='heat-6'] {
|
|
8483
|
+
color: #171512;
|
|
8484
|
+
}
|
|
8485
|
+
.ui-zone[data-fill='heat-7'] {
|
|
8486
|
+
color: #ffffff;
|
|
8487
|
+
}
|
|
8488
|
+
.ui-zone[data-fill='diverge-neg-strong'] {
|
|
8489
|
+
color: #ffffff;
|
|
8490
|
+
}
|
|
8491
|
+
.ui-zone[data-fill='diverge-neg'] {
|
|
8492
|
+
color: #171512;
|
|
8493
|
+
}
|
|
8494
|
+
.ui-zone[data-fill='diverge-zero'] {
|
|
8495
|
+
color: #171512;
|
|
8496
|
+
}
|
|
8497
|
+
.ui-zone[data-fill='diverge-pos'] {
|
|
8498
|
+
color: #171512;
|
|
8499
|
+
}
|
|
8500
|
+
.ui-zone[data-fill='diverge-pos-strong'] {
|
|
8501
|
+
color: #ffffff;
|
|
8502
|
+
}
|
|
8503
|
+
.ui-zone[data-fill='chart-1'] {
|
|
8504
|
+
color: #ffffff;
|
|
8505
|
+
}
|
|
8506
|
+
.ui-zone[data-fill='chart-2'] {
|
|
8507
|
+
color: #171512;
|
|
8508
|
+
}
|
|
8509
|
+
.ui-zone[data-fill='chart-3'] {
|
|
8510
|
+
color: #171512;
|
|
8511
|
+
}
|
|
8512
|
+
.ui-zone[data-fill='chart-4'] {
|
|
8513
|
+
color: #171512;
|
|
8514
|
+
}
|
|
8515
|
+
[data-theme='dark'] .ui-zone[data-fill='heat-1'] {
|
|
8516
|
+
color: #ffffff;
|
|
8517
|
+
}
|
|
8518
|
+
[data-theme='dark'] .ui-zone[data-fill='heat-2'] {
|
|
8519
|
+
color: #171512;
|
|
8520
|
+
}
|
|
8521
|
+
[data-theme='dark'] .ui-zone[data-fill='heat-3'] {
|
|
8522
|
+
color: #171512;
|
|
8523
|
+
}
|
|
8524
|
+
[data-theme='dark'] .ui-zone[data-fill='heat-4'] {
|
|
8525
|
+
color: #ffffff;
|
|
8526
|
+
}
|
|
8527
|
+
[data-theme='dark'] .ui-zone[data-fill='heat-5'] {
|
|
8528
|
+
color: #171512;
|
|
8529
|
+
}
|
|
8530
|
+
[data-theme='dark'] .ui-zone[data-fill='heat-6'] {
|
|
8531
|
+
color: #171512;
|
|
8532
|
+
}
|
|
8533
|
+
[data-theme='dark'] .ui-zone[data-fill='heat-7'] {
|
|
8534
|
+
color: #171512;
|
|
8535
|
+
}
|
|
8536
|
+
[data-theme='dark'] .ui-zone[data-fill='diverge-neg-strong'] {
|
|
8537
|
+
color: #171512;
|
|
8538
|
+
}
|
|
8539
|
+
[data-theme='dark'] .ui-zone[data-fill='diverge-neg'] {
|
|
8540
|
+
color: #171512;
|
|
8541
|
+
}
|
|
8542
|
+
[data-theme='dark'] .ui-zone[data-fill='diverge-zero'] {
|
|
8543
|
+
color: #ffffff;
|
|
8544
|
+
}
|
|
8545
|
+
[data-theme='dark'] .ui-zone[data-fill='diverge-pos'] {
|
|
8546
|
+
color: #171512;
|
|
8547
|
+
}
|
|
8548
|
+
[data-theme='dark'] .ui-zone[data-fill='diverge-pos-strong'] {
|
|
8549
|
+
color: #171512;
|
|
8550
|
+
}
|
|
8551
|
+
[data-theme='dark'] .ui-zone[data-fill='chart-1'] {
|
|
8552
|
+
color: #171512;
|
|
8553
|
+
}
|
|
8554
|
+
[data-theme='dark'] .ui-zone[data-fill='chart-2'] {
|
|
8555
|
+
color: #171512;
|
|
8556
|
+
}
|
|
8557
|
+
[data-theme='dark'] .ui-zone[data-fill='chart-3'] {
|
|
8558
|
+
color: #171512;
|
|
8559
|
+
}
|
|
8560
|
+
[data-theme='dark'] .ui-zone[data-fill='chart-4'] {
|
|
8561
|
+
color: #171512;
|
|
8562
|
+
}
|
|
8563
|
+
|
|
8564
|
+
/* 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,
|
|
8565
|
+
one 13 px detail line. Selected: an ink outline 4 px outside; attention: a 4 px warning or danger border. */
|
|
8566
|
+
.ui-zonemap {
|
|
8567
|
+
--zone-gap: var(--space-3);
|
|
8568
|
+
display: grid;
|
|
8569
|
+
grid-template-columns: repeat(auto-fill, minmax(max(150px, calc((100% - (var(--zone-cols, 4) - 1) * var(--zone-gap)) / var(--zone-cols, 4))), 1fr));
|
|
8570
|
+
gap: var(--zone-gap);
|
|
8571
|
+
padding: 6px;
|
|
8572
|
+
container-type: inline-size;
|
|
8573
|
+
}
|
|
8574
|
+
/* Too narrow for the columns asked: zones flow in order instead of their grid places. */
|
|
8575
|
+
@container (max-width: 640px) {
|
|
8576
|
+
.ui-zonemap > .ui-zone {
|
|
8577
|
+
grid-row: auto !important;
|
|
8578
|
+
grid-column: auto !important;
|
|
8579
|
+
}
|
|
8580
|
+
}
|
|
8581
|
+
.ui-zone {
|
|
8582
|
+
position: relative;
|
|
8583
|
+
display: flex;
|
|
8584
|
+
flex-direction: column;
|
|
8585
|
+
min-width: 0;
|
|
8586
|
+
padding: 10px 12px;
|
|
8587
|
+
border: 0;
|
|
8588
|
+
border-radius: var(--radius-md);
|
|
8589
|
+
font: inherit;
|
|
8590
|
+
text-align: left;
|
|
8591
|
+
color: var(--ink);
|
|
8592
|
+
cursor: pointer;
|
|
8593
|
+
}
|
|
8594
|
+
.ui-zone:focus-visible {
|
|
8595
|
+
outline: none;
|
|
8596
|
+
box-shadow: 0 0 0 3px var(--focus-ring);
|
|
8597
|
+
}
|
|
8598
|
+
.ui-zone.is-warning {
|
|
8599
|
+
box-shadow: inset 0 0 0 4px var(--warning);
|
|
8600
|
+
}
|
|
8601
|
+
.ui-zone.is-danger {
|
|
8602
|
+
box-shadow: inset 0 0 0 4px var(--danger);
|
|
8603
|
+
}
|
|
8604
|
+
.ui-zone.is-selected::before {
|
|
8605
|
+
content: '';
|
|
8606
|
+
position: absolute;
|
|
8607
|
+
inset: -6px;
|
|
8608
|
+
border: 2px solid var(--ink);
|
|
8609
|
+
border-radius: calc(var(--radius-md) + 4px);
|
|
8610
|
+
pointer-events: none;
|
|
8611
|
+
}
|
|
8612
|
+
.ui-zone-head {
|
|
8613
|
+
display: flex;
|
|
8614
|
+
justify-content: space-between;
|
|
8615
|
+
align-items: baseline;
|
|
8616
|
+
gap: var(--space-2);
|
|
8617
|
+
min-width: 0;
|
|
8618
|
+
}
|
|
8619
|
+
.ui-zone-name {
|
|
8620
|
+
font-size: 16px;
|
|
8621
|
+
font-weight: 600;
|
|
8622
|
+
line-height: 22px;
|
|
8623
|
+
white-space: nowrap;
|
|
8624
|
+
overflow: hidden;
|
|
8625
|
+
text-overflow: ellipsis;
|
|
8626
|
+
}
|
|
8627
|
+
.ui-zone-state {
|
|
8628
|
+
flex: none;
|
|
8629
|
+
font-size: 13px;
|
|
8630
|
+
font-weight: 600;
|
|
8631
|
+
line-height: 20px;
|
|
8632
|
+
white-space: nowrap;
|
|
8633
|
+
}
|
|
8634
|
+
.ui-zone-value {
|
|
8635
|
+
margin-top: auto;
|
|
8636
|
+
font-family: var(--font-mono);
|
|
8637
|
+
font-size: 31px;
|
|
8638
|
+
font-weight: 700;
|
|
8639
|
+
line-height: 1.1;
|
|
8640
|
+
font-variant-numeric: tabular-nums;
|
|
8641
|
+
white-space: nowrap;
|
|
8642
|
+
}
|
|
8643
|
+
.ui-zone-unit {
|
|
8644
|
+
margin-left: 4px;
|
|
8645
|
+
font-family: var(--font-sans);
|
|
8646
|
+
font-size: 16px;
|
|
8647
|
+
font-weight: 500;
|
|
8648
|
+
}
|
|
8649
|
+
.ui-zone-detail {
|
|
8650
|
+
font-size: 13px;
|
|
8651
|
+
line-height: 20px;
|
|
8652
|
+
white-space: nowrap;
|
|
8653
|
+
overflow: hidden;
|
|
8654
|
+
text-overflow: ellipsis;
|
|
8655
|
+
}
|
|
8656
|
+
.ui-zone.is-empty {
|
|
8657
|
+
gap: 2px;
|
|
8658
|
+
border: 1px dashed var(--line-strong);
|
|
8659
|
+
color: var(--ink-muted);
|
|
8660
|
+
cursor: default;
|
|
8661
|
+
}
|
|
8662
|
+
.ui-zone.is-empty .ui-zone-name {
|
|
8663
|
+
color: var(--ink);
|
|
8664
|
+
}
|
|
8665
|
+
|
|
8666
|
+
/* EventTimeline: newest first; time, kind icon (no fill), what happened. */
|
|
8667
|
+
.ui-events {
|
|
8668
|
+
margin: 0;
|
|
8669
|
+
padding: 0;
|
|
8670
|
+
list-style: none;
|
|
8671
|
+
}
|
|
8672
|
+
.ui-events > li {
|
|
8673
|
+
display: grid;
|
|
8674
|
+
grid-template-columns: auto 20px minmax(0, 1fr);
|
|
8675
|
+
gap: var(--space-3);
|
|
8676
|
+
align-items: baseline;
|
|
8677
|
+
padding: var(--space-2) 4px;
|
|
8678
|
+
border-bottom: 1px solid var(--line);
|
|
8679
|
+
}
|
|
8680
|
+
.ui-events > li:last-child {
|
|
8681
|
+
border-bottom: 0;
|
|
8682
|
+
}
|
|
8683
|
+
.ui-events-time {
|
|
8684
|
+
font-family: var(--font-mono);
|
|
8685
|
+
font-size: 13px;
|
|
8686
|
+
color: var(--ink-muted);
|
|
8687
|
+
font-variant-numeric: tabular-nums;
|
|
8688
|
+
}
|
|
8689
|
+
.ui-events-kind {
|
|
8690
|
+
display: inline-flex;
|
|
8691
|
+
align-self: center;
|
|
8692
|
+
color: var(--ink-muted);
|
|
8693
|
+
}
|
|
8694
|
+
.ui-events > li.is-alert .ui-events-kind {
|
|
8695
|
+
color: var(--warning-text);
|
|
8696
|
+
}
|
|
8697
|
+
.ui-events > li.is-switch .ui-events-kind {
|
|
8698
|
+
color: var(--accent-text);
|
|
8699
|
+
}
|
|
8700
|
+
.ui-events-empty {
|
|
8701
|
+
margin: 0;
|
|
8702
|
+
padding: var(--space-4) 4px;
|
|
8703
|
+
color: var(--ink-muted);
|
|
8704
|
+
}
|
|
8705
|
+
|
|
8706
|
+
/* TimeControl: a column for a side panel: the clock, two lines, two buttons. */
|
|
8707
|
+
.ui-timecontrol {
|
|
8708
|
+
display: flex;
|
|
8709
|
+
flex-direction: column;
|
|
8710
|
+
gap: 4px;
|
|
8711
|
+
}
|
|
8712
|
+
.ui-timecontrol-clock {
|
|
8713
|
+
font-family: var(--font-mono);
|
|
8714
|
+
font-size: 28px;
|
|
8715
|
+
font-weight: 700;
|
|
8716
|
+
line-height: 36px;
|
|
8717
|
+
font-variant-numeric: tabular-nums;
|
|
8718
|
+
}
|
|
8719
|
+
.ui-timecontrol-status {
|
|
8720
|
+
margin: 0;
|
|
8721
|
+
}
|
|
8722
|
+
.ui-timecontrol-detail {
|
|
8723
|
+
margin: 0;
|
|
8724
|
+
font-size: 13px;
|
|
8725
|
+
line-height: 20px;
|
|
8726
|
+
color: var(--ink-muted);
|
|
8727
|
+
}
|
|
8728
|
+
.ui-timecontrol-actions {
|
|
8729
|
+
display: flex;
|
|
8730
|
+
flex-wrap: wrap;
|
|
8731
|
+
gap: var(--space-2);
|
|
8732
|
+
margin-top: var(--space-2);
|
|
8733
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# EventTimeline
|
|
2
|
+
|
|
3
|
+
事件列表,由新到舊:每一列是時間、類型圖示和一句說明。
|
|
4
|
+
|
|
5
|
+
- 時間用 Geist Mono 13 px 灰字(24 小時制);說明是內文大小。
|
|
6
|
+
- 類型(`kind`):`alert` 告警(warning 圖示、`warning-text` 色)、`switch` 切換(左右箭頭、`accent-text`)、`ai` AI(星芒、灰)、`manual` 人工(人像、灰)。圖示 20 px、沒有底色,螢幕閱讀器念類型名稱。
|
|
7
|
+
- 依 `time` 由新到舊排,傳入的順序不影響。
|
|
8
|
+
- 沒有事件時顯示 `empty`,例如「近 4 小時沒有事件」。
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
h(UI.EventTimeline, {
|
|
12
|
+
label: '近 4 小時的事件',
|
|
13
|
+
empty: '近 4 小時沒有事件',
|
|
14
|
+
events: [{ time: new Date(), kind: 'alert', text: 'F 區進氣溫度超過上限 29 °C' }],
|
|
15
|
+
});
|
|
16
|
+
```
|
package/docs/KpiCard.md
CHANGED
|
@@ -9,3 +9,21 @@ KPI 卡片,放在 Dashboard 最上方。
|
|
|
9
9
|
- 卡片太窄、最終數字放不下時,字級自動從 31 px 縮小,最小 20 px。
|
|
10
10
|
- 變化:▲/▼ 加百分比,後面接灰色「較上週」(`compareLabel` 可改)。顏色看好壞:`good` 預設為 `delta > 0`,像錯誤率這種上升是壞事的指標要設 `good={false}`;回應時間下降是好事,設 `good`。
|
|
11
11
|
- 百分比的指標,變化用 `deltaUnit="pt"` 顯示「個百分點」。
|
|
12
|
+
|
|
13
|
+
## 緊湊版(`size="compact"`)
|
|
14
|
+
|
|
15
|
+
放進監控畫面頂列的小卡:標籤、22 px 數字、一行 13 px 灰字目標(`target`,例如「目標 ≤ 0.5 °C(示意)」)。不畫迷你折線。
|
|
16
|
+
|
|
17
|
+
- `verdict: { tone, text }`:判定。`success`(例如「預測準確」)時畫面上只有目標那一行,螢幕閱讀器仍會念判定;`warning`(「偏差變大」)或 `danger`(「需要校正」)時,目標那一行換成那個顏色的半粗字「偏差變大(目標 ≤ 0.5 °C(示意))」。不加符號,用文字說出狀態。
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
h(UI.KpiCard, {
|
|
21
|
+
size: 'compact',
|
|
22
|
+
label: '近 1 小時誤差',
|
|
23
|
+
value: 0.9,
|
|
24
|
+
decimals: 1,
|
|
25
|
+
unit: '°C',
|
|
26
|
+
verdict: { tone: 'warning', text: '偏差變大' },
|
|
27
|
+
target: '目標 ≤ 0.5 °C(示意)',
|
|
28
|
+
});
|
|
29
|
+
```
|
package/docs/LineChart.md
CHANGED
|
@@ -2,10 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
折線圖。
|
|
4
4
|
|
|
5
|
-
- 平滑曲線,線寬 2.5 px
|
|
5
|
+
- 平滑曲線,線寬 2.5 px,不填色;唯一的例外是兩組資料之間的差額帶(`band`,見下方)。
|
|
6
6
|
- 多組資料依序用 `chart-1`、`chart-2`、`chart-3`、`chart-4`(暖灰,給「其他」「人工」這類次要的一組);超過一組時上方顯示有文字的圖例。
|
|
7
7
|
- 格線為淡色虛線,底線實線;數字刻度用等寬字。
|
|
8
8
|
- 滑過時出現垂直參考線、各組的點,以及浮起卡片顯示日期和數值(加單位)。
|
|
9
9
|
- 鍵盤:圖可以用 Tab 移到,← → 在時間點之間移動、Home/End 到兩端,和滑過一樣顯示參考線和數值卡片,螢幕閱讀器念「時間點:各組數值」。
|
|
10
10
|
- 進場時一條接一條畫出,間隔 150 ms。
|
|
11
11
|
- `label` 必填,作為圖表的 `aria-label`。
|
|
12
|
+
|
|
13
|
+
## 監控畫面:預測與實際、節能
|
|
14
|
+
|
|
15
|
+
- `min`:y 軸的下限(預設 0),溫度這類離 0 很遠的值要設,例如 `min: 22, max: 30`。
|
|
16
|
+
- 每組資料可以設 `dashed`(虛線,例如預測、基準)和 `color`(用第幾個 `chart-*`,例如預測用 3、基準用 4)。`values` 可以有 `null`:預測比實際長、或中間缺資料時,那裡不畫線。
|
|
17
|
+
- `band: { between: [0, 1], tone, label }`:兩組之間填色,這是「折線不填色」的例外,只用在兩組資料的差上(預測與實際、實際與基準),不疊在三組以上的圖。
|
|
18
|
+
- `tone: 'diverge'`:第一組高於第二組填橘(`diverge-pos`),低於填藍(`diverge-neg`),各 30%。
|
|
19
|
+
- `tone: 'success'`:填 `success` 28%,例如省下的電。
|
|
20
|
+
- `label` 是圖例裡的文字;數值提示多一列「差」。
|
|
21
|
+
- `now`:那個時間點畫「現在」實線,之後的未來區疊預測斜線(和 `ui-forecast` 相同)。
|
|
22
|
+
- `thresholds: [{ value, label, tone }]`:水平 1.5 px 虛線,`warning` 是注意、`danger` 是上限,標籤靠右寫在線上方。
|
|
23
|
+
- `marker: { at, value, label }`:一個空心圓加標籤,例如下一回合的單點預測;顏色跟著那一組(預設最後一組)。
|
|
24
|
+
- `playhead` 加 `onPlayheadChange`:回放用的播放頭,強調色 2 px 線,x 軸上一個 16 px 圓形把手。滑鼠或觸控在圖上按下、拖曳移動;Tab 到圖上後 ← → 一格、Home/End 到兩端,螢幕閱讀器念那個時間點的數值。
|
|
25
|
+
- `headline`:圖上方的大字(25 px),例如「省 186 kWh(約 12%)」;數字用等寬字。來源說明寫在圖下方一行。
|
|
26
|
+
- `status`:圖底部貼一條 StatusBand,和時間點對齊。
|
|
27
|
+
- 沒有任何數值時,圖的中間寫「這段時間沒有資料」(`empty` 可以改字)。
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
h(UI.LineChart, {
|
|
31
|
+
label: '進氣溫度,預測與實際',
|
|
32
|
+
unit: '°C',
|
|
33
|
+
decimals: 1,
|
|
34
|
+
min: 22,
|
|
35
|
+
max: 30,
|
|
36
|
+
labels: times,
|
|
37
|
+
labelEvery: 4,
|
|
38
|
+
series: [
|
|
39
|
+
{ name: '實際', values: actual },
|
|
40
|
+
{ name: '預測', values: forecast, dashed: true, color: 3 },
|
|
41
|
+
],
|
|
42
|
+
band: { between: [0, 1], tone: 'diverge', label: '實際偏高/偏低' },
|
|
43
|
+
now: 15,
|
|
44
|
+
thresholds: [
|
|
45
|
+
{ value: 27, label: '注意 27 °C', tone: 'warning' },
|
|
46
|
+
{ value: 29, label: '上限 29 °C', tone: 'danger' },
|
|
47
|
+
],
|
|
48
|
+
marker: { at: 16, value: 25.8, label: '下一回合 25.8 °C' },
|
|
49
|
+
playhead: at,
|
|
50
|
+
onPlayheadChange: setAt,
|
|
51
|
+
});
|
|
52
|
+
```
|
package/docs/Meter.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Meter
|
|
2
|
+
|
|
3
|
+
一個數值和它的界線:8 px 的條分成正常、注意、超過上限三段淡色,圓點標出目前值,上方寫出數值和狀態。
|
|
4
|
+
|
|
5
|
+
- 條:正常是 `success`、注意是 `warning`、超過上限是 `danger`,各和 `surface-sub` 混成淡色;注意線和上限是兩條 2 px 刻度,下方寫「注意 27」「上限 29」。
|
|
6
|
+
- 圓點 14 px,顏色依狀態;狀態另外用文字寫出(正常、⚠ 注意、⚠ 超過上限),不只靠顏色。數值越高越要注意。
|
|
7
|
+
- 上方一列:名稱靠左;狀態和數值靠右,數值用等寬字、右對齊在固定寬度的欄(8 個字寬,`--meter-value-width` 可以改)。同一張卡片裡疊好幾個 Meter 時,狀態和數值的右緣都對齊。
|
|
8
|
+
- 無障礙:`role="meter"`,`aria-valuetext` 念「28.1 °C,注意,注意 27,上限 29」。
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
h(UI.Meter, { label: 'B 區進氣溫度', value: 28.1, min: 20, max: 32, warn: 27, limit: 29, unit: '°C', decimals: 1 });
|
|
12
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# StatusBand
|
|
2
|
+
|
|
3
|
+
沿著時間軸的類別色帶,例如每 10 分鐘當時採用的策略;可以貼在 LineChart 底部(`status`),也可以單獨使用。
|
|
4
|
+
|
|
5
|
+
- 高 12 px,類別依 `classes` 的順序用 `chart-1` 到 `chart-4`;最多 4 類。帶上不寫字,名稱寫在下方的圖例。
|
|
6
|
+
- 貼在 LineChart 底部時和 x 軸的時間點對齊,圖例放在時間標籤下方。
|
|
7
|
+
- `segments` 的 `from` 是第一個時間點,`to` 是下一段開始的時間點(兩段相接)。沒有資料的時段是淡灰色。
|
|
8
|
+
- 螢幕閱讀器念整條帶:「採用的策略:13:00 到 14:00 AI 最佳化,…」(給 `times` 時寫出時間)。
|
|
9
|
+
- 狀態不只靠顏色:圖例有文字;需要看某個時間點時,LineChart 的數值提示會列出當時的類別。
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
h(UI.StatusBand, {
|
|
13
|
+
label: '採用的策略',
|
|
14
|
+
count: 24,
|
|
15
|
+
classes: [
|
|
16
|
+
{ value: 'ai', label: 'AI 最佳化' },
|
|
17
|
+
{ value: 'pid', label: 'PID' },
|
|
18
|
+
],
|
|
19
|
+
segments: [
|
|
20
|
+
{ from: 0, to: 10, value: 'ai' },
|
|
21
|
+
{ from: 10, to: 24, value: 'pid' },
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
```
|