@umriss-ui/core 0.12.1 → 0.13.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/index.d.ts CHANGED
@@ -1564,9 +1564,13 @@ export declare const Sparkline: ForwardRefExoticComponent<SparklineProps & RefAt
1564
1564
  export declare interface SparklineProps extends HTMLAttributes<HTMLSpanElement> {
1565
1565
  /** Values in chronological order; at least two. */
1566
1566
  data: readonly number[];
1567
- /** Width in pixels. Default 96 - a row width, not a chart width. */
1568
- width?: number;
1569
- /** Height in pixels. Default 28 - as high as a table row. */
1567
+ /** Width in pixels. Default 96 - a row width, not a chart width. `"fill"`
1568
+ takes the width of its container, as a tile's history does; the line
1569
+ keeps its stroke and the end point stays round. */
1570
+ width?: number | "fill";
1571
+ /** Height in pixels. Default 28 - as high as a table row. With `width`
1572
+ `"fill"` a stylesheet may set the height instead: the drawing follows
1573
+ its box. */
1570
1574
  height?: number;
1571
1575
  /** The line is ink, not meaning: `accent` only where exactly one line among
1572
1576
  several is to be emphasised. */
@@ -1659,7 +1663,8 @@ export declare interface StatProps extends Omit<HTMLAttributes<HTMLDivElement>,
1659
1663
  /** The rule the value is read against. Without it the tile is neutral – the
1660
1664
  honest display of a number for which nobody has named a rule. */
1661
1665
  limits?: LimitSet;
1662
- /** Values in chronological order; yields the history line. */
1666
+ /** Values in chronological order; yields the history line, across the
1667
+ tile beneath the figures, or beside them in a tile of 380 px and more. */
1663
1668
  history?: readonly number[];
1664
1669
  /** When the value was true – not when it was fetched. */
1665
1670
  asOf?: Date | number | null;
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/core 0.12.1
1
+ # @umriss-ui/core 0.13.0
2
2
 
3
3
  > A React component library for data-dense applications - precise, quiet, professional.
4
4
 
@@ -10958,7 +10958,7 @@ export default function Unknown() {
10958
10958
 
10959
10959
  ##### Add a history
10960
10960
 
10961
- `history` draws the values before it as a line under the figure: the shape of the last hours, not a trend arrow.
10961
+ `history` draws the values before it as a line across the tile - under the figure, or beside it where the tile is wide: the shape of the last hours, not a trend arrow.
10962
10962
 
10963
10963
  ```tsx
10964
10964
  import { Stat } from "@umriss-ui/core";
@@ -10993,6 +10993,58 @@ export default function History() {
10993
10993
 
10994
10994
  It imports `operations.ts` from beside itself; the file stands once, under "Files the examples show" at the end.
10995
10995
 
10996
+ ##### Give the history room
10997
+
10998
+ A tile of 380 px and more puts its history beside the figures, as high as they are; a narrower one keeps it beneath. The tile decides by its own width.
10999
+
11000
+ ```tsx
11001
+ import { Grid, Stat } from "@umriss-ui/core";
11002
+ import type { LimitSet } from "@umriss-ui/core";
11003
+ import { metrics } from "./operations";
11004
+
11005
+ const P95: LimitSet = {
11006
+ limits: [
11007
+ { value: 240, side: "upper", severity: "warning" },
11008
+ { value: 300, side: "upper", severity: "alarm" },
11009
+ ],
11010
+ };
11011
+
11012
+ const ERRORS: LimitSet = {
11013
+ limits: [
11014
+ { value: 1, side: "upper", severity: "warning" },
11015
+ { value: 2, side: "upper", severity: "alarm" },
11016
+ ],
11017
+ };
11018
+
11019
+ /** Checkout since six this morning, every five minutes. */
11020
+ const MORNING = metrics("checkout").slice(-54);
11021
+
11022
+ export default function GiveTheHistoryRoom() {
11023
+ return (
11024
+ <Grid minItemWidth="380px" gap={4}>
11025
+ <Stat
11026
+ label="p95 latency · Checkout · since 06:00"
11027
+ value={MORNING.at(-1)?.p95}
11028
+ unit="ms"
11029
+ decimals={0}
11030
+ limits={P95}
11031
+ history={MORNING.map((point) => point.p95)}
11032
+ />
11033
+ <Stat
11034
+ label="Error rate · Checkout · since 06:00"
11035
+ value={MORNING.at(-1)?.errorRate}
11036
+ unit="%"
11037
+ decimals={2}
11038
+ limits={ERRORS}
11039
+ history={MORNING.map((point) => point.errorRate)}
11040
+ />
11041
+ </Grid>
11042
+ );
11043
+ }
11044
+ ```
11045
+
11046
+ It imports `operations.ts` from beside itself; the file stands once, under "Files the examples show" at the end.
11047
+
10996
11048
  ##### Measure against a target
10997
11049
 
10998
11050
  A `target` is missed by an amount, never violated: the tile shows the signed deviation beside its verdict from the limits.
@@ -11201,7 +11253,7 @@ It imports `operations.ts` from beside itself; the file stands once, under "File
11201
11253
  | `unit` | `string` | — | The unit as it stands behind the value – „ms", „%", „GB". |
11202
11254
  | `decimals` | `number` | — | Fixed number of decimal places. Without it the notation decides; a metric whose number of digits jumps reads as a jump in the value. |
11203
11255
  | `limits` | `LimitSet` | — | The rule the value is read against. Without it the tile is neutral – the honest display of a number for which nobody has named a rule. |
11204
- | `history` | `readonly number[]` | — | Values in chronological order; yields the history line. |
11256
+ | `history` | `readonly number[]` | — | Values in chronological order; yields the history line, across the tile beneath the figures, or beside them in a tile of 380 px and more. |
11205
11257
  | `asOf` | `Date \| number \| null` | — | When the value was true – not when it was fetched. |
11206
11258
  | `ages` | `FreshnessAges` | — | Without ages there is no freshness display and no cadence. |
11207
11259
 
@@ -11536,8 +11588,8 @@ It imports `operations.ts` from beside itself; the file stands once, under "File
11536
11588
  | Prop | Type | Default | Description |
11537
11589
  |---|---|---|---|
11538
11590
  | `data` (required) | `readonly number[]` | — | Values in chronological order; at least two. |
11539
- | `width` | `number` | `96` | Width in pixels. Default 96 - a row width, not a chart width. |
11540
- | `height` | `number` | `28` | Height in pixels. Default 28 - as high as a table row. |
11591
+ | `width` | `number \| "fill"` | `96` | Width in pixels. Default 96 - a row width, not a chart width. `"fill"` takes the width of its container, as a tile's history does; the line keeps its stroke and the end point stays round. |
11592
+ | `height` | `number` | `28` | Height in pixels. Default 28 - as high as a table row. With `width` `"fill"` a stylesheet may set the height instead: the drawing follows its box. |
11541
11593
  | `tone` | `"ink" \| "accent"` | `"ink"` | The line is ink, not meaning: `accent` only where exactly one line among several is to be emphasised. |
11542
11594
 
11543
11595
  Also takes every attribute of `<span>`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/core",
3
- "version": "0.12.1",
3
+ "version": "0.13.0",
4
4
  "description": "A React component library for data-dense applications - precise, quiet, professional.",
5
5
  "license": "MIT",
6
6
  "author": "Roman Händler",