@umriss-ui/calculation 0.3.0 → 0.3.2

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/CHANGELOG.md CHANGED
@@ -11,6 +11,18 @@ under a heading "Changed" of its own, no matter which digit rose.
11
11
 
12
12
  ---
13
13
 
14
+ ## 0.3.2 – Core 0.12.0 (Sep. 2026)
15
+
16
+ Needs `@umriss-ui/core` 0.12; the peer range moves to `^0.12.0`. Nothing else changes for a caller.
17
+
18
+ ---
19
+
20
+ ## 0.3.1 – Core 0.11.0 (Sep. 2026)
21
+
22
+ Needs `@umriss-ui/core` 0.11; the peer range moves to `^0.11.0`. Nothing else changes for a caller.
23
+
24
+ ---
25
+
14
26
  ## 0.3.0 – Forced colours and agent-readable docs (Sep. 2026)
15
27
 
16
28
  Needs `@umriss-ui/core` 0.10; the peer range moves to `^0.10.0`.
package/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # @umriss-ui/calculation
2
2
 
3
- A calculation a reader can follow and redo. A plant screen shows a figure — an
4
- OEE of 82 %, a cost per piece — and this package shows how it came about, as a
3
+ A calculation a reader can follow and redo. A screen shows a figure — an
4
+ availability of 99.9 %, a cost per tour, an invoice total — and this package
5
+ shows how it came about, as a
5
6
  statement of account: the operator before each number, the final result above a
6
7
  double rule, and every figure opening beneath itself into the calculation it
7
8
  came from, down to the numbers at its root. The package **performs every operation it
@@ -24,29 +25,25 @@ their children are their operands in order, givens are the leaves (ADR-0027). A
24
25
  quantity used twice is defined once and stands elsewhere as a `<Ref>`:
25
26
 
26
27
  ```tsx
27
- import { Calculation, Difference, Given, Product, Quotient, Ref } from "@umriss-ui/calculation";
28
+ import { Calculation, Difference, Given, Product, Ref, Sum } from "@umriss-ui/calculation";
28
29
 
29
- <Calculation aria-label="OEE, early shift">
30
- <Product label="OEE" format="percent" target={0.85}>
31
- <Quotient label="Availability" format="percent">
32
- <Difference id="runtime" label="Run time" unit="min">
33
- <Given id="planned" label="Planned production time" value={450} unit="min" />
34
- <Given label="Downtime" value={38} unit="min" />
35
- </Difference>
36
- <Ref to="planned" />
37
- </Quotient>
38
- <Quotient label="Performance" format="percent">
39
- <Product label="Ideal run time" unit="min">
40
- <Given label="Ideal cycle time" value={0.8} unit="min/pc" />
41
- <Given id="total" label="Total count" value={480} unit="pcs" />
30
+ <Calculation aria-label="Invoice 2041">
31
+ <Sum label="Invoice total" unit="€" decimals={2}>
32
+ <Difference id="net" label="Net amount" unit="€">
33
+ <Product id="lines" label="Line amount" unit="€">
34
+ <Given label="Quantity" value={12} unit="pcs" />
35
+ <Given label="Unit price" value={389} unit="€" />
42
36
  </Product>
43
- <Ref to="runtime" />
44
- </Quotient>
45
- <Quotient label="Quality" format="percent">
46
- <Given label="Good count" value={461} unit="pcs" />
47
- <Ref to="total" />
48
- </Quotient>
49
- </Product>
37
+ <Product label="Discount" unit="€">
38
+ <Ref to="lines" />
39
+ <Given label="Discount rate" value={0.05} format="percent" />
40
+ </Product>
41
+ </Difference>
42
+ <Product label="VAT" unit="€">
43
+ <Ref to="net" />
44
+ <Given label="VAT rate" value={0.19} format="percent" />
45
+ </Product>
46
+ </Sum>
50
47
  </Calculation>
51
48
  ```
52
49
 
@@ -97,9 +94,9 @@ in a tree - there it folds, and opens whole.
97
94
  with "= label"; folded, the row shows the formula it hides in names — or how
98
95
  many operands there are, above four. The Result is the last row, its number
99
96
  underlined twice.
100
- - **Every line is read as one sentence** — "Availability equals Run time
101
- divided by Planned production time, equals 412 min divided by 450 min,
102
- equals 91.6 percent" — and every derivation is a disclosure.
97
+ - **Every line is read as one sentence** — "Net amount equals Line amount
98
+ minus Discount, equals 4,668 € minus 233.40 €, equals 4,434.60 €" — and
99
+ every derivation is a disclosure.
103
100
  - **A declaration the calculation cannot evaluate fails on the first render**
104
101
  with a message saying which and where: a `Ref` to nothing (listing the ids
105
102
  that exist), a circle through references, a wrong operand count, a