@umriss-ui/core 0.12.0 → 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.0
1
+ # @umriss-ui/core 0.13.0
2
2
 
3
3
  > A React component library for data-dense applications - precise, quiet, professional.
4
4
 
@@ -7999,13 +7999,6 @@ You hold `open`, the popover hangs from `anchorRef` and reports every wish to cl
7999
7999
  import { useRef, useState } from "react";
8000
8000
  import { Button, Popover, Stack, Text } from "@umriss-ui/core";
8001
8001
 
8002
- const SURFACE = {
8003
- padding: "var(--u-space-4)",
8004
- background: "var(--u-color-surface)",
8005
- borderRadius: "var(--u-radius-md)",
8006
- boxShadow: "var(--u-shadow-overlay)",
8007
- };
8008
-
8009
8002
  export default function AnchoredSurface() {
8010
8003
  const anchor = useRef<HTMLButtonElement>(null);
8011
8004
  const [open, setOpen] = useState(false);
@@ -8016,7 +8009,7 @@ export default function AnchoredSurface() {
8016
8009
  Sprint 14
8017
8010
  </Button>
8018
8011
  <Popover open={open} onOpenChange={setOpen} anchorRef={anchor} role="dialog" ariaLabel="Sprint 14" restoreFocus width={280}>
8019
- <Stack gap={2} style={SURFACE}>
8012
+ <Stack gap={2} style={{ padding: "var(--u-space-4)" }}>
8020
8013
  <Text size="sm" weight="medium">
8021
8014
  Member portal sign-in and profile
8022
8015
  </Text>
@@ -8038,13 +8031,6 @@ export default function AnchoredSurface() {
8038
8031
  import { useRef, useState } from "react";
8039
8032
  import { Button, Popover, Stack, Text } from "@umriss-ui/core";
8040
8033
 
8041
- const SURFACE = {
8042
- padding: "var(--u-space-3)",
8043
- background: "var(--u-color-surface)",
8044
- borderRadius: "var(--u-radius-md)",
8045
- boxShadow: "var(--u-shadow-overlay)",
8046
- };
8047
-
8048
8034
  export default function WidthFromAnchor() {
8049
8035
  const anchor = useRef<HTMLButtonElement>(null);
8050
8036
  const [open, setOpen] = useState(false);
@@ -8064,7 +8050,7 @@ export default function WidthFromAnchor() {
8064
8050
  minWidth={180}
8065
8051
  restoreFocus
8066
8052
  >
8067
- <Stack gap={1} style={SURFACE}>
8053
+ <Stack gap={1} style={{ padding: "var(--u-space-3)" }}>
8068
8054
  <Text size="sm" mono>FP 402 R · van</Text>
8069
8055
  <Text size="sm" mono>FP 455 R · e-van</Text>
8070
8056
  </Stack>
@@ -8113,15 +8099,7 @@ export default function AFilterPanel() {
8113
8099
  Depots: {applied.length === DEPOTS.length ? "all" : applied.length}
8114
8100
  </Button>
8115
8101
  <Popover open={open} onOpenChange={setOpen} anchorRef={anchor} role="dialog" ariaLabel="Filter by depot" restoreFocus width={260}>
8116
- <Stack
8117
- gap={3}
8118
- style={{
8119
- padding: "var(--u-space-4)",
8120
- background: "var(--u-color-surface)",
8121
- borderRadius: "var(--u-radius-md)",
8122
- boxShadow: "var(--u-shadow-overlay)",
8123
- }}
8124
- >
8102
+ <Stack gap={3} style={{ padding: "var(--u-space-4)" }}>
8125
8103
  {DEPOTS.map((depot) => (
8126
8104
  <Checkbox key={depot} label={depot} checked={draft.includes(depot)} onChange={() => toggle(depot)} />
8127
8105
  ))}
@@ -8191,7 +8169,7 @@ export default function AFilterPanel() {
8191
8169
 
8192
8170
  #### Known limits
8193
8171
 
8194
- - No look of its own: background, radius and shadow are yours, so each surface built on it keeps its own.
8172
+ - No padding and no inner layout: it brings the overlay's surface - ground, corners, shadow - and the rest is yours. A `className` restates the surface where one needs another.
8195
8173
  - It does not trap focus; a surface the user must answer is a [Modal](#/modal).
8196
8174
 
8197
8175
  What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0032-what-umriss-is-not.md).
@@ -10980,7 +10958,7 @@ export default function Unknown() {
10980
10958
 
10981
10959
  ##### Add a history
10982
10960
 
10983
- `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.
10984
10962
 
10985
10963
  ```tsx
10986
10964
  import { Stat } from "@umriss-ui/core";
@@ -11015,6 +10993,58 @@ export default function History() {
11015
10993
 
11016
10994
  It imports `operations.ts` from beside itself; the file stands once, under "Files the examples show" at the end.
11017
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
+
11018
11048
  ##### Measure against a target
11019
11049
 
11020
11050
  A `target` is missed by an amount, never violated: the tile shows the signed deviation beside its verdict from the limits.
@@ -11223,7 +11253,7 @@ It imports `operations.ts` from beside itself; the file stands once, under "File
11223
11253
  | `unit` | `string` | — | The unit as it stands behind the value – „ms", „%", „GB". |
11224
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. |
11225
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. |
11226
- | `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. |
11227
11257
  | `asOf` | `Date \| number \| null` | — | When the value was true – not when it was fetched. |
11228
11258
  | `ages` | `FreshnessAges` | — | Without ages there is no freshness display and no cadence. |
11229
11259
 
@@ -11558,8 +11588,8 @@ It imports `operations.ts` from beside itself; the file stands once, under "File
11558
11588
  | Prop | Type | Default | Description |
11559
11589
  |---|---|---|---|
11560
11590
  | `data` (required) | `readonly number[]` | — | Values in chronological order; at least two. |
11561
- | `width` | `number` | `96` | Width in pixels. Default 96 - a row width, not a chart width. |
11562
- | `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. |
11563
11593
  | `tone` | `"ink" \| "accent"` | `"ink"` | The line is ink, not meaning: `accent` only where exactly one line among several is to be emphasised. |
11564
11594
 
11565
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.0",
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",