@umriss-ui/calculation 0.2.1 → 0.2.3
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 +21 -0
- package/dist/calculation.css +1 -1
- package/dist/calculation.js +111 -111
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,27 @@ under a heading "Changed" of its own, no matter which digit rose.
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
+
## 0.2.3 – Core 0.8.0: the canon of states (Sep. 2026)
|
|
15
|
+
|
|
16
|
+
Needs `@umriss-ui/core` 0.8: it reads core's pressed surfaces and motion tokens; the peer range moves to `^0.8.0`.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **The disclosure sinks while pressed** - on the key and on a foldable row -
|
|
21
|
+
with core's `--u-color-surface-pressed`, like every quiet key of the library.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 0.2.2 – Core 0.7.0 (Sep. 2026)
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- **The worst-verdict glyph and the lost freshness read core's
|
|
30
|
+
`--u-color-danger-text`** - lighter in the dark theme, 4.5:1 on every surface.
|
|
31
|
+
The peer range moves to `@umriss-ui/core` `^0.7.0`.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
14
35
|
## 0.2.1 – Core 0.6.0 (Sep. 2026)
|
|
15
36
|
|
|
16
37
|
### Changed
|
package/dist/calculation.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_1hv7a_23{font-family:var(--u-font-sans);font-size:var(--u-text-md);line-height:var(--u-leading-normal);color:var(--u-color-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}._field_1hv7a_34{caret-color:var(--u-color-accent)}._scroll_1hv7a_40{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_1hv7a_40::-webkit-scrollbar{width:10px;height:10px}._scroll_1hv7a_40::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--u-color-text) 22%,transparent);border-radius:var(--u-radius-full);border:3px solid transparent;background-clip:content-box}._scroll_1hv7a_40::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_1hv7a_65:focus-visible{outline:none;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_1hv7a_34._field_1hv7a_34{font-size:16px}}._field_1hv7a_34:-webkit-autofill,._field_1hv7a_34:-webkit-autofill:hover,._field_1hv7a_34:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 1000px var(--u-color-surface),0 0 0 1px var(--u-edge-color-strong);-webkit-text-fill-color:var(--u-color-text);caret-color:var(--u-color-accent)}}@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._frame_1hhx1_21,._frame_1hhx1_21:before,._frame_1hhx1_21:after{box-sizing:border-box}._calculation_1hhx1_39,._calculation_1hhx1_39:before,._calculation_1hhx1_39:after{box-sizing:border-box}._disclosure_1hhx1_53,._disclosure_1hhx1_53:before,._disclosure_1hhx1_53:after{box-sizing:border-box}._list_1hhx1_57,._list_1hhx1_57:before,._list_1hhx1_57:after{box-sizing:border-box}._item_1hhx1_58,._item_1hhx1_58:before,._item_1hhx1_58:after{box-sizing:border-box}._derivation_1hhx1_59,._derivation_1hhx1_59:before,._derivation_1hhx1_59:after{box-sizing:border-box}._line_1hhx1_109,._line_1hhx1_109:before,._line_1hhx1_109:after{box-sizing:border-box}._labelCell_1hhx1_151,._labelCell_1hhx1_151:before,._labelCell_1hhx1_151:after{box-sizing:border-box}._names_1hhx1_152,._names_1hhx1_152:before,._names_1hhx1_152:after{box-sizing:border-box}._operator_1hhx1_153,._operator_1hhx1_153:before,._operator_1hhx1_153:after{box-sizing:border-box}._amount_1hhx1_154,._amount_1hhx1_154:before,._amount_1hhx1_154:after{box-sizing:border-box}._unit_1hhx1_155,._unit_1hhx1_155:before,._unit_1hhx1_155:after{box-sizing:border-box}._assessment_1hhx1_156,._assessment_1hhx1_156:before,._assessment_1hhx1_156:after{box-sizing:border-box}._label_1hhx1_151,._label_1hhx1_151:before,._label_1hhx1_151:after{box-sizing:border-box}._approximate_1hhx1_269,._approximate_1hhx1_269:before,._approximate_1hhx1_269:after{box-sizing:border-box}._target_1hhx1_297,._target_1hhx1_297:before,._target_1hhx1_297:after{box-sizing:border-box}._worst_1hhx1_298,._worst_1hhx1_298:before,._worst_1hhx1_298:after{box-sizing:border-box}._notes_1hhx1_390,._notes_1hhx1_390:before,._notes_1hhx1_390:after{box-sizing:border-box}._freshness_1hhx1_404,._freshness_1hhx1_404:before,._freshness_1hhx1_404:after{box-sizing:border-box}._frame_1hhx1_21{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);box-shadow:var(--u-edge);overflow:hidden;--disclosure-size: 20px;--disclosure-gap: var(--u-space-2);container-type:inline-size;width:100%}._calculation_1hhx1_39{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto auto auto auto;margin:0;padding:0;list-style:none}._frame_1hhx1_21[data-still]{--disclosure-size: 0px;--disclosure-gap: 0px}._frame_1hhx1_21[data-still] ._disclosure_1hhx1_53{display:none}._list_1hhx1_57,._item_1hhx1_58,._derivation_1hhx1_59{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_1hhx1_59[hidden]{display:none}._derivation_1hhx1_59:not([hidden]){animation:_derivationIn_1hhx1_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_1hhx1_1{0%{opacity:0}}._item_1hhx1_58{--fall: calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) / 2 - 1px)}._derivation_1hhx1_59{position:relative}._derivation_1hhx1_59:before{content:"";position:absolute;top:0;bottom:0;left:var(--fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_1hhx1_59)>._item_1hhx1_58[data-open]>._line_1hhx1_109:not([data-mark]),:not(._derivation_1hhx1_59)>._item_1hhx1_58>._derivation_1hhx1_59{background-color:var(--u-color-surface-sunken)}._derivation_1hhx1_59 ._line_1hhx1_109{border-top-color:transparent}._line_1hhx1_109{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_1hhx1_39>._item_1hhx1_58:first-child>._line_1hhx1_109:first-child,._calculation_1hhx1_39>._item_1hhx1_58:first-child>._list_1hhx1_57>._item_1hhx1_58:first-child>._line_1hhx1_109{border-top-color:transparent}._line_1hhx1_109[data-foldable]{cursor:pointer}._line_1hhx1_109[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_1hhx1_109[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_1hhx1_151,._names_1hhx1_152,._operator_1hhx1_153,._amount_1hhx1_154,._unit_1hhx1_155,._assessment_1hhx1_156{grid-row:1;padding-top:var(--u-space-2);padding-bottom:var(--u-space-2)}._labelCell_1hhx1_151{grid-column:1;display:flex;align-items:baseline;gap:var(--disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_1hhx1_151{min-width:0;color:var(--u-color-text)}._line_1hhx1_109[data-reference] ._label_1hhx1_151{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_1hhx1_53{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--disclosure-size);height:var(--disclosure-size);padding:0;border:none;border-radius:var(--u-radius-xs);corner-shape:squircle;background:none;color:var(--u-color-text-muted)}button._disclosure_1hhx1_53{box-sizing:border-box}button._disclosure_1hhx1_53{cursor:pointer}button._disclosure_1hhx1_53:hover,._line_1hhx1_109[data-foldable]:hover button._disclosure_1hhx1_53{box-sizing:border-box}button._disclosure_1hhx1_53:hover,._line_1hhx1_109[data-foldable]:hover button._disclosure_1hhx1_53{background:var(--u-color-surface-sunken);color:var(--u-color-text)}._item_1hhx1_58[data-open]>._line_1hhx1_109 button._disclosure_1hhx1_53{box-sizing:border-box}._item_1hhx1_58[data-open]>._line_1hhx1_109 button._disclosure_1hhx1_53{color:var(--u-color-accent)}button._disclosure_1hhx1_53:focus-visible{box-sizing:border-box}button._disclosure_1hhx1_53:focus-visible{outline:none;box-shadow:var(--u-focus-ring)}._disclosure_1hhx1_53 svg{box-sizing:border-box}._disclosure_1hhx1_53 svg{transition:transform var(--u-duration-fast) var(--u-ease-out)}._disclosure_1hhx1_53 svg[data-open]{box-sizing:border-box}._disclosure_1hhx1_53 svg[data-open]{transform:rotate(90deg)}._names_1hhx1_152{grid-column:2;min-width:0;overflow:hidden;padding-right:var(--u-space-4);white-space:nowrap;text-overflow:ellipsis;color:var(--u-color-text-secondary)}._operator_1hhx1_153,._amount_1hhx1_154,._unit_1hhx1_155{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_1hhx1_153{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_1hhx1_154{grid-column:4;text-align:right;color:var(--u-color-text)}._amount_1hhx1_154[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_1hhx1_269{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_1hhx1_155{grid-column:5;padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_1hhx1_156{grid-column:6;display:flex;align-items:baseline;justify-content:flex-end;gap:var(--u-space-2);padding-right:var(--u-space-3);white-space:nowrap}._assessment_1hhx1_156:empty{padding-right:0}._target_1hhx1_297,._worst_1hhx1_298{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_1hhx1_298:before{content:"● "}._worst_1hhx1_298[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_1hhx1_298[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_1hhx1_298[data-verdict=alarm]:before{color:var(--u-color-danger)}._line_1hhx1_109[data-inner]>._amount_1hhx1_154{color:var(--u-color-text-secondary)}._line_1hhx1_109[data-kind=interim] ._label_1hhx1_151,._line_1hhx1_109[data-kind=interim]>._amount_1hhx1_154{font-weight:var(--u-weight-medium)}._line_1hhx1_109[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / 6;align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_1hhx1_109[data-closing] ._label_1hhx1_151{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_1hhx1_109[data-closing]:before{content:"";grid-row:1;grid-column:3 / 6;align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_1hhx1_109[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_1hhx1_109[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_1hhx1_109[data-kind=result] ._label_1hhx1_151{font-weight:var(--u-weight-semibold)}._line_1hhx1_109[data-kind=result]>._amount_1hhx1_154{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_1hhx1_109[data-kind=result]>._amount_1hhx1_154:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._notes_1hhx1_390{grid-row:2;grid-column:1 / 3;display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--u-space-3);margin-top:calc(-1 * var(--u-space-1));padding:0 var(--u-space-4) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_1hhx1_404[data-freshness=stale]{color:var(--u-color-warning)}._freshness_1hhx1_404[data-freshness=lost]{color:var(--u-color-danger);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_1hhx1_39{grid-template-columns:minmax(0,1fr) 0 auto auto auto 0}._names_1hhx1_152{display:none}._labelCell_1hhx1_151{padding-right:var(--u-space-3)}._assessment_1hhx1_156:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;padding:0 var(--u-space-3) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._notes_1hhx1_390{grid-row:3;grid-column:1 / -1}}@media(prefers-reduced-motion:reduce){._disclosure_1hhx1_53 svg{transition:none}._derivation_1hhx1_59:not([hidden]){animation:none}}}
|
|
1
|
+
@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_1hv7a_23{font-family:var(--u-font-sans);font-size:var(--u-text-md);line-height:var(--u-leading-normal);color:var(--u-color-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}._field_1hv7a_34{caret-color:var(--u-color-accent)}._scroll_1hv7a_40{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_1hv7a_40::-webkit-scrollbar{width:10px;height:10px}._scroll_1hv7a_40::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--u-color-text) 22%,transparent);border-radius:var(--u-radius-full);border:3px solid transparent;background-clip:content-box}._scroll_1hv7a_40::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_1hv7a_65:focus-visible{outline:none;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_1hv7a_34._field_1hv7a_34{font-size:16px}}._field_1hv7a_34:-webkit-autofill,._field_1hv7a_34:-webkit-autofill:hover,._field_1hv7a_34:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 1000px var(--u-color-surface),0 0 0 1px var(--u-edge-color-strong);-webkit-text-fill-color:var(--u-color-text);caret-color:var(--u-color-accent)}}@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._frame_1vwog_21,._frame_1vwog_21:before,._frame_1vwog_21:after{box-sizing:border-box}._calculation_1vwog_39,._calculation_1vwog_39:before,._calculation_1vwog_39:after{box-sizing:border-box}._disclosure_1vwog_53,._disclosure_1vwog_53:before,._disclosure_1vwog_53:after{box-sizing:border-box}._list_1vwog_57,._list_1vwog_57:before,._list_1vwog_57:after{box-sizing:border-box}._item_1vwog_58,._item_1vwog_58:before,._item_1vwog_58:after{box-sizing:border-box}._derivation_1vwog_59,._derivation_1vwog_59:before,._derivation_1vwog_59:after{box-sizing:border-box}._line_1vwog_109,._line_1vwog_109:before,._line_1vwog_109:after{box-sizing:border-box}._labelCell_1vwog_151,._labelCell_1vwog_151:before,._labelCell_1vwog_151:after{box-sizing:border-box}._names_1vwog_152,._names_1vwog_152:before,._names_1vwog_152:after{box-sizing:border-box}._operator_1vwog_153,._operator_1vwog_153:before,._operator_1vwog_153:after{box-sizing:border-box}._amount_1vwog_154,._amount_1vwog_154:before,._amount_1vwog_154:after{box-sizing:border-box}._unit_1vwog_155,._unit_1vwog_155:before,._unit_1vwog_155:after{box-sizing:border-box}._assessment_1vwog_156,._assessment_1vwog_156:before,._assessment_1vwog_156:after{box-sizing:border-box}._label_1vwog_151,._label_1vwog_151:before,._label_1vwog_151:after{box-sizing:border-box}._approximate_1vwog_274,._approximate_1vwog_274:before,._approximate_1vwog_274:after{box-sizing:border-box}._target_1vwog_302,._target_1vwog_302:before,._target_1vwog_302:after{box-sizing:border-box}._worst_1vwog_303,._worst_1vwog_303:before,._worst_1vwog_303:after{box-sizing:border-box}._notes_1vwog_395,._notes_1vwog_395:before,._notes_1vwog_395:after{box-sizing:border-box}._freshness_1vwog_409,._freshness_1vwog_409:before,._freshness_1vwog_409:after{box-sizing:border-box}._frame_1vwog_21{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);box-shadow:var(--u-edge);overflow:hidden;--disclosure-size: 20px;--disclosure-gap: var(--u-space-2);container-type:inline-size;width:100%}._calculation_1vwog_39{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto auto auto auto;margin:0;padding:0;list-style:none}._frame_1vwog_21[data-still]{--disclosure-size: 0px;--disclosure-gap: 0px}._frame_1vwog_21[data-still] ._disclosure_1vwog_53{display:none}._list_1vwog_57,._item_1vwog_58,._derivation_1vwog_59{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_1vwog_59[hidden]{display:none}._derivation_1vwog_59:not([hidden]){animation:_derivationIn_1vwog_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_1vwog_1{0%{opacity:0}}._item_1vwog_58{--fall: calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) / 2 - 1px)}._derivation_1vwog_59{position:relative}._derivation_1vwog_59:before{content:"";position:absolute;top:0;bottom:0;left:var(--fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_1vwog_59)>._item_1vwog_58[data-open]>._line_1vwog_109:not([data-mark]),:not(._derivation_1vwog_59)>._item_1vwog_58>._derivation_1vwog_59{background-color:var(--u-color-surface-sunken)}._derivation_1vwog_59 ._line_1vwog_109{border-top-color:transparent}._line_1vwog_109{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_1vwog_39>._item_1vwog_58:first-child>._line_1vwog_109:first-child,._calculation_1vwog_39>._item_1vwog_58:first-child>._list_1vwog_57>._item_1vwog_58:first-child>._line_1vwog_109{border-top-color:transparent}._line_1vwog_109[data-foldable]{cursor:pointer}._line_1vwog_109[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_1vwog_109[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_1vwog_151,._names_1vwog_152,._operator_1vwog_153,._amount_1vwog_154,._unit_1vwog_155,._assessment_1vwog_156{grid-row:1;padding-top:var(--u-space-2);padding-bottom:var(--u-space-2)}._labelCell_1vwog_151{grid-column:1;display:flex;align-items:baseline;gap:var(--disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_1vwog_151{min-width:0;color:var(--u-color-text)}._line_1vwog_109[data-reference] ._label_1vwog_151{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_1vwog_53{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--disclosure-size);height:var(--disclosure-size);padding:0;border:none;border-radius:var(--u-radius-xs);corner-shape:squircle;background:none;color:var(--u-color-text-muted)}button._disclosure_1vwog_53{box-sizing:border-box}button._disclosure_1vwog_53{cursor:pointer}button._disclosure_1vwog_53:hover,._line_1vwog_109[data-foldable]:hover button._disclosure_1vwog_53{box-sizing:border-box}button._disclosure_1vwog_53:hover,._line_1vwog_109[data-foldable]:hover button._disclosure_1vwog_53{background:var(--u-color-surface-sunken);color:var(--u-color-text)}button._disclosure_1vwog_53:active,._line_1vwog_109[data-foldable]:active button._disclosure_1vwog_53{box-sizing:border-box}button._disclosure_1vwog_53:active,._line_1vwog_109[data-foldable]:active button._disclosure_1vwog_53{background:var(--u-color-surface-pressed)}._item_1vwog_58[data-open]>._line_1vwog_109 button._disclosure_1vwog_53{box-sizing:border-box}._item_1vwog_58[data-open]>._line_1vwog_109 button._disclosure_1vwog_53{color:var(--u-color-accent)}button._disclosure_1vwog_53:focus-visible{box-sizing:border-box}button._disclosure_1vwog_53:focus-visible{outline:none;box-shadow:var(--u-focus-ring)}._disclosure_1vwog_53 svg{box-sizing:border-box}._disclosure_1vwog_53 svg{transition:transform var(--u-transition-path)}._disclosure_1vwog_53 svg[data-open]{box-sizing:border-box}._disclosure_1vwog_53 svg[data-open]{transform:rotate(90deg)}._names_1vwog_152{grid-column:2;min-width:0;overflow:hidden;padding-right:var(--u-space-4);white-space:nowrap;text-overflow:ellipsis;color:var(--u-color-text-secondary)}._operator_1vwog_153,._amount_1vwog_154,._unit_1vwog_155{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_1vwog_153{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_1vwog_154{grid-column:4;text-align:right;color:var(--u-color-text)}._amount_1vwog_154[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_1vwog_274{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_1vwog_155{grid-column:5;padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_1vwog_156{grid-column:6;display:flex;align-items:baseline;justify-content:flex-end;gap:var(--u-space-2);padding-right:var(--u-space-3);white-space:nowrap}._assessment_1vwog_156:empty{padding-right:0}._target_1vwog_302,._worst_1vwog_303{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_1vwog_303:before{content:"● "}._worst_1vwog_303[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_1vwog_303[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_1vwog_303[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_1vwog_109[data-inner]>._amount_1vwog_154{color:var(--u-color-text-secondary)}._line_1vwog_109[data-kind=interim] ._label_1vwog_151,._line_1vwog_109[data-kind=interim]>._amount_1vwog_154{font-weight:var(--u-weight-medium)}._line_1vwog_109[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / 6;align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_1vwog_109[data-closing] ._label_1vwog_151{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_1vwog_109[data-closing]:before{content:"";grid-row:1;grid-column:3 / 6;align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_1vwog_109[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_1vwog_109[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_1vwog_109[data-kind=result] ._label_1vwog_151{font-weight:var(--u-weight-semibold)}._line_1vwog_109[data-kind=result]>._amount_1vwog_154{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_1vwog_109[data-kind=result]>._amount_1vwog_154:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._notes_1vwog_395{grid-row:2;grid-column:1 / 3;display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--u-space-3);margin-top:calc(-1 * var(--u-space-1));padding:0 var(--u-space-4) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_1vwog_409[data-freshness=stale]{color:var(--u-color-warning)}._freshness_1vwog_409[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_1vwog_39{grid-template-columns:minmax(0,1fr) 0 auto auto auto 0}._names_1vwog_152{display:none}._labelCell_1vwog_151{padding-right:var(--u-space-3)}._assessment_1vwog_156:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;padding:0 var(--u-space-3) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._notes_1vwog_395{grid-row:3;grid-column:1 / -1}}@media(prefers-reduced-motion:reduce){._disclosure_1vwog_53 svg{transition:none}._derivation_1vwog_59:not([hidden]){animation:none}}}
|
package/dist/calculation.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import "./calculation.css";
|
|
2
2
|
import { jsx as f, jsxs as k } from "react/jsx-runtime";
|
|
3
|
-
import { Children as ve, isValidElement as j, Fragment as ge, useId as
|
|
4
|
-
import { assess as
|
|
5
|
-
function
|
|
3
|
+
import { Children as ve, isValidElement as j, Fragment as ge, useId as we, useState as se } from "react";
|
|
4
|
+
import { assess as _e, verdictWeight as K, useFormats as me, useWording as fe, VisuallyHidden as be, AngleGlyph as $e, Tooltip as re, Badge as ie, useFreshness as Ne } from "@umriss-ui/core";
|
|
5
|
+
function ye(t) {
|
|
6
6
|
return t.decimals !== void 0 ? t.decimals : t.format === "percent" ? 1 : t.given ? void 0 : 2;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function xe(t, n) {
|
|
9
9
|
return n === void 0 ? t : Math.sign(t) * Number(Math.abs(t).toFixed(n));
|
|
10
10
|
}
|
|
11
11
|
function G(t, n) {
|
|
12
|
-
return
|
|
12
|
+
return xe(t.format === "percent" ? n * 100 : n, ye(t));
|
|
13
13
|
}
|
|
14
14
|
const Oe = (t, n) => t.format === "percent" ? n / 100 : n;
|
|
15
15
|
function le(t, n, v) {
|
|
16
16
|
const [m, ...i] = n;
|
|
17
17
|
switch (t) {
|
|
18
18
|
case "sum":
|
|
19
|
-
return i.reduce((e, h,
|
|
19
|
+
return i.reduce((e, h, s) => v[s + 1] ? e - h : e + h, m);
|
|
20
20
|
case "difference":
|
|
21
21
|
return i.reduce((e, h) => e - h, m);
|
|
22
22
|
case "product":
|
|
@@ -28,40 +28,40 @@ function le(t, n, v) {
|
|
|
28
28
|
const ce = (t, n) => n === void 0 || t !== void 0 && K(t) >= K(n) ? t : n;
|
|
29
29
|
function Se(t) {
|
|
30
30
|
const n = /* @__PURE__ */ new Map(), v = (m) => {
|
|
31
|
-
var
|
|
31
|
+
var b, x, T;
|
|
32
32
|
const i = n.get(m);
|
|
33
33
|
if (i) return i;
|
|
34
34
|
const e = t.quantities.get(m);
|
|
35
|
-
let h = null,
|
|
35
|
+
let h = null, s, y = !1, C;
|
|
36
36
|
if (e.given) {
|
|
37
|
-
const
|
|
38
|
-
typeof
|
|
37
|
+
const $ = e.given.value;
|
|
38
|
+
typeof $ == "number" && Number.isFinite($) ? h = $ : s = { kind: "missing", label: e.label };
|
|
39
39
|
} else {
|
|
40
|
-
const
|
|
41
|
-
for (const { operand: a, verdict: c, worst: r } of
|
|
42
|
-
const
|
|
43
|
-
C = ce(C,
|
|
40
|
+
const $ = e.operands.map((a) => ({ operand: a, ...v(a.key) }));
|
|
41
|
+
for (const { operand: a, verdict: c, worst: r } of $) {
|
|
42
|
+
const w = a.reference ? c : ce(c, r);
|
|
43
|
+
C = ce(C, w);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
const O =
|
|
47
|
-
if (!
|
|
45
|
+
s = (b = $.find((a) => a.absence)) == null ? void 0 : b.absence;
|
|
46
|
+
const O = $[1];
|
|
47
|
+
if (!s && e.operator === "quotient" && O.value === 0 && (s = { kind: "zero", label: t.quantities.get(O.operand.key).label }), !s) {
|
|
48
48
|
const a = e.operands.map((r) => r.negated === !0);
|
|
49
|
-
h = le(e.operator,
|
|
49
|
+
h = le(e.operator, $.map((r) => r.value), a);
|
|
50
50
|
const c = le(
|
|
51
51
|
e.operator,
|
|
52
|
-
|
|
52
|
+
$.map((r) => Oe(t.quantities.get(r.operand.key), r.shown)),
|
|
53
53
|
a
|
|
54
54
|
);
|
|
55
|
-
|
|
55
|
+
y = G(e, c) !== G(e, h);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
const d = { target: e.target, limits: e.limits }, g = e.target !== void 0 || (((
|
|
58
|
+
const d = { target: e.target, limits: e.limits }, g = e.target !== void 0 || (((x = e.limits) == null ? void 0 : x.length) ?? 0) > 0 ? _e(h, d) : void 0, _ = (((T = e.limits) == null ? void 0 : T.length) ?? 0) > 0 ? g.verdict : h === null ? "unknown" : void 0, l = {
|
|
59
59
|
value: h,
|
|
60
|
-
absence:
|
|
60
|
+
absence: s,
|
|
61
61
|
shown: h === null ? null : G(e, h),
|
|
62
|
-
approximate:
|
|
62
|
+
approximate: y,
|
|
63
63
|
assessment: g,
|
|
64
|
-
verdict:
|
|
64
|
+
verdict: _,
|
|
65
65
|
worst: C
|
|
66
66
|
};
|
|
67
67
|
return n.set(m, l), l;
|
|
@@ -102,67 +102,67 @@ const ee = (t, n, v) => `${t}/${j(n) && n.key || v}`;
|
|
|
102
102
|
function je(t) {
|
|
103
103
|
const n = Q(t);
|
|
104
104
|
n.length !== 1 && q(`<Calculation> takes exactly one child, the result; it was given ${n.length}.`);
|
|
105
|
-
const v = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), i = [], e = (d, g,
|
|
106
|
-
const { id: l,
|
|
107
|
-
l !== void 0 && (m.has(l) && q(`${
|
|
108
|
-
const
|
|
109
|
-
return v.set(d,
|
|
110
|
-
}, h = (d, g,
|
|
105
|
+
const v = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), i = [], e = (d, g, _) => {
|
|
106
|
+
const { id: l, ...b } = g;
|
|
107
|
+
l !== void 0 && (m.has(l) && q(`${_}: the id "${l}" is used twice.`), m.set(l, d));
|
|
108
|
+
const x = { ...b, key: d, id: l, operands: [] };
|
|
109
|
+
return v.set(d, x), x;
|
|
110
|
+
}, h = (d, g, _) => {
|
|
111
111
|
if (j(d) && d.type === ue) {
|
|
112
112
|
const l = { key: "", reference: !0 };
|
|
113
|
-
return i.push({ operand: l, to: d.props.to, where:
|
|
113
|
+
return i.push({ operand: l, to: d.props.to, where: _ }), l;
|
|
114
114
|
}
|
|
115
|
-
return { key:
|
|
116
|
-
},
|
|
117
|
-
if ((!j(d) || d.type === ue || Z.has(d.type) || d.type === Y) && q(`${
|
|
115
|
+
return { key: s(d, g, _), reference: !1 };
|
|
116
|
+
}, s = (d, g, _) => {
|
|
117
|
+
if ((!j(d) || d.type === ue || Z.has(d.type) || d.type === Y) && q(`${_}: ${V(d)} cannot stand here; a quantity must be ${X}.`), d.type === Ie) return y(d.props.children, g, _);
|
|
118
118
|
const l = Be.get(d.type);
|
|
119
119
|
d.type !== qe && l === void 0 && q(
|
|
120
|
-
`${
|
|
120
|
+
`${_}: ${V(d)} is not an element of the calculation. A calculation reads its children's props and cannot look inside a component of your own; write ${X} or <Ref> directly, or return them from .map.`
|
|
121
121
|
);
|
|
122
|
-
const { children:
|
|
122
|
+
const { children: b, value: x, source: T, asOf: $, ages: O, ...a } = d.props, c = `${_} › ${a.label}`, r = e(g, a, c);
|
|
123
123
|
if (l === void 0)
|
|
124
|
-
return r.given = { value:
|
|
124
|
+
return r.given = { value: x, source: T, asOf: $, ages: O }, g;
|
|
125
125
|
r.operator = l;
|
|
126
|
-
const
|
|
127
|
-
return (l === "quotient" ?
|
|
128
|
-
`${c}: <${We[l]}> takes ${l === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${
|
|
129
|
-
), r.operands =
|
|
130
|
-
},
|
|
131
|
-
const l = `${
|
|
132
|
-
(
|
|
133
|
-
let T = h(
|
|
134
|
-
return
|
|
135
|
-
const
|
|
126
|
+
const w = Q(b), o = w.length;
|
|
127
|
+
return (l === "quotient" ? o !== 2 : o < 2) && q(
|
|
128
|
+
`${c}: <${We[l]}> takes ${l === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${o}.`
|
|
129
|
+
), r.operands = w.map((u, N) => h(u, ee(g, u, N), c)), g;
|
|
130
|
+
}, y = (d, g, _) => {
|
|
131
|
+
const l = `${_} › <Chain>`, [b, ...x] = Q(d);
|
|
132
|
+
(b === void 0 || j(b) && (Z.has(b.type) || b.type === Y)) && q(`${l}: a chain starts with a quantity that has no operator - ${X} or <Ref>.`);
|
|
133
|
+
let T = h(b, ee(g, b, 0), l), $ = V(b), O = [], a;
|
|
134
|
+
return x.forEach((c, r) => {
|
|
135
|
+
const w = ee(g, c, r + 1);
|
|
136
136
|
if (j(c) && c.type === Y) {
|
|
137
137
|
const M = c.props, D = `${l} › ${M.label}`;
|
|
138
|
-
O.length === 0 && q(`${D}: an <Interim> needs an operand since the named value before it, ${
|
|
139
|
-
const S = e(
|
|
140
|
-
S.interim = !0, S.operator = O[0].line.operator, S.operands = [T, ...O.map((J) => J.operand)], T = { key:
|
|
138
|
+
O.length === 0 && q(`${D}: an <Interim> needs an operand since the named value before it, ${$}.`);
|
|
139
|
+
const S = e(w, M, D);
|
|
140
|
+
S.interim = !0, S.operator = O[0].line.operator, S.operands = [T, ...O.map((J) => J.operand)], T = { key: w, reference: !1, previous: !0 }, $ = `<Interim label="${M.label}">`, O = [], a = w;
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
const u =
|
|
143
|
+
const o = j(c) ? Z.get(c.type) : void 0;
|
|
144
|
+
o === void 0 && q(`${l}: ${V(c)} needs an operator in a chain - <Plus>, <Minus>, <Times> or <DividedBy> - or is an <Interim>.`);
|
|
145
|
+
const u = o.operator !== "sum", N = O.find((M) => M.line.operator !== "sum");
|
|
146
146
|
(u && O.length > 0 || N) && q(
|
|
147
|
-
`${l}: <${(N ?? { line:
|
|
147
|
+
`${l}: <${(N ?? { line: o }).line.name}> stands alone between two named values - directly after the first quantity or an <Interim>, and directly before an <Interim>.`
|
|
148
148
|
);
|
|
149
|
-
const { children: B, ...A } = c.props, W = Q(B), I = () => q(`${l}: <${
|
|
149
|
+
const { children: B, ...A } = c.props, W = Q(B), I = () => q(`${l}: <${o.name}> takes either a label and a value, or exactly one quantity as its child.`);
|
|
150
150
|
if (W.length > 0) {
|
|
151
151
|
(W.length > 1 || Object.values(A).some((D) => D !== void 0)) && I();
|
|
152
|
-
const M = h(W[0],
|
|
153
|
-
M.negated =
|
|
152
|
+
const M = h(W[0], w, l);
|
|
153
|
+
M.negated = o.negated, O.push({ operand: M, line: o });
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
A.label === void 0 && I();
|
|
157
|
-
const { value: E, source: U, asOf: F, ages: R, ...L } = A, z = e(
|
|
158
|
-
z.given = { value: E, source: U, asOf: F, ages: R }, O.push({ operand: { key:
|
|
157
|
+
const { value: E, source: U, asOf: F, ages: R, ...L } = A, z = e(w, { ...L, label: A.label }, `${l} › ${A.label}`);
|
|
158
|
+
z.given = { value: E, source: U, asOf: F, ages: R }, O.push({ operand: { key: w, reference: !1, negated: o.negated }, line: o });
|
|
159
159
|
}), (O.length > 0 || a === void 0) && q(`${l}: a chain ends with an <Interim>, which names its value.`), a;
|
|
160
|
-
}, C =
|
|
161
|
-
for (const { operand: d, to: g, where:
|
|
160
|
+
}, C = s(n[0], "0", "<Calculation>");
|
|
161
|
+
for (const { operand: d, to: g, where: _ } of i) {
|
|
162
162
|
const l = m.get(g);
|
|
163
163
|
if (l === void 0) {
|
|
164
|
-
const
|
|
165
|
-
q(`${
|
|
164
|
+
const b = [...m.keys()].map((x) => `"${x}"`).join(", ");
|
|
165
|
+
q(`${_}: <Ref to="${g}"> names no quantity. ${b ? `The ids that exist: ${b}.` : "No quantity has an id."}`);
|
|
166
166
|
}
|
|
167
167
|
d.key = l;
|
|
168
168
|
}
|
|
@@ -173,7 +173,7 @@ function Re(t) {
|
|
|
173
173
|
if (n.has(i)) return;
|
|
174
174
|
const e = v.indexOf(i);
|
|
175
175
|
if (e !== -1) {
|
|
176
|
-
const h = [...v.slice(e), i].map((
|
|
176
|
+
const h = [...v.slice(e), i].map((s) => t.get(s).label);
|
|
177
177
|
q(`the calculation goes round in a circle through references: ${h.join(" → ")}.`);
|
|
178
178
|
}
|
|
179
179
|
v.push(i);
|
|
@@ -217,33 +217,33 @@ function pe(t, n, v, m) {
|
|
|
217
217
|
return i ? `${e} ${i}` : e;
|
|
218
218
|
}
|
|
219
219
|
function Le(t, n, v, m, i, e, h) {
|
|
220
|
-
const
|
|
221
|
-
if (m || !
|
|
222
|
-
if (!
|
|
223
|
-
return { names: e.calculationOperandCount(
|
|
224
|
-
const
|
|
220
|
+
const s = t.quantities.get(v), y = n.get(v), C = (w, o, u) => o.shown === null ? u ? e.verdictUnknown : e.statAbsentValue : pe(w, o.shown, i, u ? e.calculationPercent : "%"), d = (w) => {
|
|
221
|
+
if (m || !s.operator) return {};
|
|
222
|
+
if (!w && s.operands.length > de)
|
|
223
|
+
return { names: e.calculationOperandCount(s.operands.length) };
|
|
224
|
+
const o = (u) => s.operands.map((N, B) => {
|
|
225
225
|
const A = t.quantities.get(N.key);
|
|
226
|
-
return B === 0 ? u(A) : `${te({ operator:
|
|
226
|
+
return B === 0 ? u(A) : `${te({ operator: s.operator, negated: N.negated === !0 }, w, e)} ${u(A)}`;
|
|
227
227
|
}).join(" ");
|
|
228
228
|
return {
|
|
229
|
-
names:
|
|
230
|
-
numbers:
|
|
229
|
+
names: o((u) => u.label),
|
|
230
|
+
numbers: o((u) => C(u, n.get(u.key), w))
|
|
231
231
|
};
|
|
232
|
-
}, g = (
|
|
232
|
+
}, g = (w) => {
|
|
233
233
|
var N;
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
const u = pe(
|
|
237
|
-
return
|
|
238
|
-
},
|
|
239
|
-
(h ? `${te(h, !0, e)} ` : "") +
|
|
240
|
-
|
|
234
|
+
const o = (N = y.assessment) == null ? void 0 : N.deviation;
|
|
235
|
+
if (o === void 0 || s.target === void 0) return;
|
|
236
|
+
const u = pe(s, G(s, s.target), i, w ? e.calculationPercent : "%");
|
|
237
|
+
return o > 0 ? e.calculationAboveTarget(u) : o < 0 ? e.calculationBelowTarget(u) : e.calculationOnTarget(u);
|
|
238
|
+
}, _ = d(!1).names, l = _ === void 0 || s.operands.length > de ? _ : `= ${_}`, b = d(!0), x = y.absence ? Ue(y.absence, e) : void 0, T = ` ${e.calculationEquals} `, $ = y.approximate ? `${e.calculationApproximately} ${C(s, y, !0)}` : C(s, y, !0), a = [
|
|
239
|
+
(h ? `${te(h, !0, e)} ` : "") + s.label + T + [b.names, b.numbers, $].filter(Boolean).join(`,${T}`),
|
|
240
|
+
y.verdict !== void 0 && y.verdict !== "unknown" ? H(y.verdict, e) : void 0,
|
|
241
241
|
g(!0),
|
|
242
|
-
|
|
243
|
-
].filter(Boolean).join(", "), c =
|
|
244
|
-
return { amount:
|
|
242
|
+
x
|
|
243
|
+
].filter(Boolean).join(", "), c = y.shown === null ? void 0 : s.format === "percent" ? "%" : s.unit;
|
|
244
|
+
return { amount: y.shown === null ? e.statAbsentValue : i.number(y.shown, s.decimals), unit: c, names: l, target: g(!1), reason: x, sentence: a };
|
|
245
245
|
}
|
|
246
|
-
const Ve = "
|
|
246
|
+
const Ve = "_frame_1vwog_21 _text_1hv7a_23", Ge = "_calculation_1vwog_39", He = "_disclosure_1vwog_53", Ke = "_list_1vwog_57", ze = "_item_1vwog_58", Je = "_derivation_1vwog_59", Ye = "_line_1vwog_109", Ze = "_labelCell_1vwog_151", Xe = "_names_1vwog_152", et = "_operator_1vwog_153", tt = "_amount_1vwog_154", nt = "_unit_1vwog_155", at = "_assessment_1vwog_156", ot = "_label_1vwog_151", st = "_approximate_1vwog_274", rt = "_target_1vwog_302", it = "_worst_1vwog_303", lt = "_notes_1vwog_395", ct = "_freshness_1vwog_409", p = {
|
|
247
247
|
frame: Ve,
|
|
248
248
|
calculation: Ge,
|
|
249
249
|
disclosure: He,
|
|
@@ -257,8 +257,8 @@ const Ve = "_frame_1hhx1_21 _text_1hv7a_23", Ge = "_calculation_1hhx1_39", He =
|
|
|
257
257
|
amount: tt,
|
|
258
258
|
unit: nt,
|
|
259
259
|
assessment: at,
|
|
260
|
-
label:
|
|
261
|
-
approximate:
|
|
260
|
+
label: ot,
|
|
261
|
+
approximate: st,
|
|
262
262
|
target: rt,
|
|
263
263
|
worst: it,
|
|
264
264
|
notes: lt,
|
|
@@ -272,22 +272,22 @@ function pt({ asOf: t, ages: n }) {
|
|
|
272
272
|
] });
|
|
273
273
|
}
|
|
274
274
|
function vt({ children: t, className: n, style: v, ...m }) {
|
|
275
|
-
const i = me(), e = fe(), h =
|
|
275
|
+
const i = me(), e = fe(), h = we(), s = je(t), y = Se(s), [C, d] = se(() => /* @__PURE__ */ new Set()), [g, _] = se(null), l = (a) => d((c) => {
|
|
276
276
|
const r = new Set(c);
|
|
277
277
|
return r.delete(a) || r.add(a), r;
|
|
278
|
-
}),
|
|
279
|
-
let
|
|
280
|
-
const T = (a, c) => g === null ? void 0 : a === g ? "use" : c === g ? "operand" : void 0,
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
const U = `${h}-${a}`, F = { depth: W ? r.depth : r.depth + 1, flat: !1, parent: a }, R = B ?
|
|
284
|
-
(P,
|
|
285
|
-
) : [], D = I && !E && u.worst !== void 0 && K(u.worst) > K(u.verdict ?? "ok") ? u.worst : void 0, S = c ? void 0 :
|
|
286
|
-
!c &&
|
|
278
|
+
}), b = (a, c, r) => r === 0 || c.previous ? void 0 : { operator: a.operator, negated: c.negated === !0 };
|
|
279
|
+
let x = !1;
|
|
280
|
+
const T = (a, c) => g === null ? void 0 : a === g ? "use" : c === g ? "operand" : void 0, $ = (a, c, r, w) => {
|
|
281
|
+
const o = s.quantities.get(a), u = y.get(a), N = Le(s, y, a, c, i, e, r.position), B = o.operator !== void 0 && !c, A = a === s.result && !c, W = B && (o.interim ? r.flat : A), I = B && !W, E = I && C.has(a);
|
|
282
|
+
x || (x = I);
|
|
283
|
+
const U = `${h}-${a}`, F = { depth: W ? r.depth : r.depth + 1, flat: !1, parent: a }, R = B ? o.operands.find((P) => P.previous) : void 0, L = R && r.flat ? $(R.key, !1, { ...r, parent: a, position: void 0 }, `${w}-c`) : [], z = R && !r.flat ? $(R.key, !1, { ...F, flat: !0 }, `${w}-c`) : [], M = B ? o.operands.map(
|
|
284
|
+
(P, oe) => P.previous ? null : $(P.key, P.reference, { ...F, position: b(o, P, oe) }, `${w}-${oe}`)
|
|
285
|
+
) : [], D = I && !E && u.worst !== void 0 && K(u.worst) > K(u.verdict ?? "ok") ? u.worst : void 0, S = c ? void 0 : o.given, J = r.position ? te(r.position, !1, e) : void 0, ne = [
|
|
286
|
+
!c && o.explanation !== void 0 && /* @__PURE__ */ f("span", { children: o.explanation }, "explanation"),
|
|
287
287
|
(S == null ? void 0 : S.source) !== void 0 && /* @__PURE__ */ f("span", { children: e.calculationSource(S.source) }, "source"),
|
|
288
288
|
(S == null ? void 0 : S.asOf) !== void 0 && (S.ages !== void 0 ? /* @__PURE__ */ f(pt, { asOf: S.asOf, ages: S.ages }, "asOf") : /* @__PURE__ */ f("span", { children: e.asOfAgo(i.dateTime(new Date(S.asOf), !1)) }, "asOf")),
|
|
289
|
-
!c &&
|
|
290
|
-
].filter(Boolean), he = A ? "result" :
|
|
289
|
+
!c && o.aside !== void 0 && /* @__PURE__ */ f("span", { children: o.aside }, "aside")
|
|
290
|
+
].filter(Boolean), he = A ? "result" : o.interim && !c && r.flat ? "interim" : void 0, ae = /* @__PURE__ */ k(
|
|
291
291
|
"div",
|
|
292
292
|
{
|
|
293
293
|
className: p.line,
|
|
@@ -297,16 +297,16 @@ function vt({ children: t, className: n, style: v, ...m }) {
|
|
|
297
297
|
"data-foldable": I ? "" : void 0,
|
|
298
298
|
"data-reference": c ? "" : void 0,
|
|
299
299
|
"data-mark": T(a, r.parent),
|
|
300
|
-
onPointerEnter: () =>
|
|
301
|
-
onPointerLeave: () =>
|
|
302
|
-
onFocus: () =>
|
|
303
|
-
onBlur: () =>
|
|
300
|
+
onPointerEnter: () => _(a),
|
|
301
|
+
onPointerLeave: () => _(null),
|
|
302
|
+
onFocus: () => _(a),
|
|
303
|
+
onBlur: () => _(null),
|
|
304
304
|
onClick: I ? () => {
|
|
305
305
|
var P;
|
|
306
306
|
(P = window.getSelection()) != null && P.toString() || l(a);
|
|
307
307
|
} : void 0,
|
|
308
308
|
children: [
|
|
309
|
-
/* @__PURE__ */ f(
|
|
309
|
+
/* @__PURE__ */ f(be, { children: [
|
|
310
310
|
N.sentence,
|
|
311
311
|
u.approximate && e.calculationApproximateNote,
|
|
312
312
|
D !== void 0 && e.calculationWorstInside(H(D, e))
|
|
@@ -319,11 +319,11 @@ function vt({ children: t, className: n, style: v, ...m }) {
|
|
|
319
319
|
className: p.disclosure,
|
|
320
320
|
"aria-expanded": E,
|
|
321
321
|
"aria-controls": U,
|
|
322
|
-
"aria-label": (E ? e.calculationHideDerivation : e.calculationShowDerivation)(
|
|
323
|
-
children: /* @__PURE__ */ f(
|
|
322
|
+
"aria-label": (E ? e.calculationHideDerivation : e.calculationShowDerivation)(o.label),
|
|
323
|
+
children: /* @__PURE__ */ f($e, { "data-open": E ? "" : void 0 })
|
|
324
324
|
}
|
|
325
325
|
) : /* @__PURE__ */ f("span", { className: p.disclosure, "aria-hidden": "true" }),
|
|
326
|
-
/* @__PURE__ */ f("span", { className: p.label, "aria-hidden": "true", children:
|
|
326
|
+
/* @__PURE__ */ f("span", { className: p.label, "aria-hidden": "true", children: o.label })
|
|
327
327
|
] }),
|
|
328
328
|
/* @__PURE__ */ f("span", { className: p.names, "aria-hidden": "true", children: I && !E ? N.names : void 0 }),
|
|
329
329
|
/* @__PURE__ */ f("span", { className: p.operator, "aria-hidden": "true", children: J }),
|
|
@@ -348,7 +348,7 @@ function vt({ children: t, className: n, style: v, ...m }) {
|
|
|
348
348
|
/* @__PURE__ */ k("li", { className: p.item, children: [
|
|
349
349
|
/* @__PURE__ */ f("ul", { className: p.list, children: M }),
|
|
350
350
|
ae
|
|
351
|
-
] },
|
|
351
|
+
] }, w)
|
|
352
352
|
] : [
|
|
353
353
|
...L,
|
|
354
354
|
/* @__PURE__ */ k("li", { className: p.item, "data-open": E ? "" : void 0, style: { "--depth": r.depth }, children: [
|
|
@@ -369,7 +369,7 @@ function vt({ children: t, className: n, style: v, ...m }) {
|
|
|
369
369
|
/* @__PURE__ */ f("span", { className: p.disclosure }),
|
|
370
370
|
/* @__PURE__ */ k("span", { className: p.label, children: [
|
|
371
371
|
"= ",
|
|
372
|
-
|
|
372
|
+
o.label
|
|
373
373
|
] })
|
|
374
374
|
] }),
|
|
375
375
|
/* @__PURE__ */ f("span", { className: p.names }),
|
|
@@ -383,13 +383,13 @@ function vt({ children: t, className: n, style: v, ...m }) {
|
|
|
383
383
|
}
|
|
384
384
|
) })
|
|
385
385
|
] })
|
|
386
|
-
] },
|
|
386
|
+
] }, w)
|
|
387
387
|
];
|
|
388
|
-
}, O =
|
|
388
|
+
}, O = $(s.result, !1, { depth: 0, flat: !0, parent: null }, "r");
|
|
389
389
|
return (
|
|
390
390
|
/* The frame is the surface and the container the layout measures itself
|
|
391
391
|
against; the list inside it is the statement. */
|
|
392
|
-
/* @__PURE__ */ f("div", { className: dt(p.frame, n), style: v, "data-still":
|
|
392
|
+
/* @__PURE__ */ f("div", { className: dt(p.frame, n), style: v, "data-still": x ? void 0 : "", children: /* @__PURE__ */ f("ul", { className: p.calculation, ...m, children: O }) })
|
|
393
393
|
);
|
|
394
394
|
}
|
|
395
395
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umriss-ui/calculation",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "The umriss calculation - a derivation written as it is shown, evaluated by the library, folded and read line by line.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Roman Händler",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=18",
|
|
46
46
|
"react-dom": ">=18",
|
|
47
|
-
"@umriss-ui/core": "^0.
|
|
47
|
+
"@umriss-ui/core": "^0.8.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@fontsource/geist-mono": "^5.3.0",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"typescript": "^5.6.3",
|
|
59
59
|
"vite": "^6.0.0",
|
|
60
60
|
"vite-plugin-dts": "^4.3.0",
|
|
61
|
-
"@umriss-ui/
|
|
62
|
-
"@umriss-ui/
|
|
61
|
+
"@umriss-ui/demo": "0.0.0",
|
|
62
|
+
"@umriss-ui/core": "0.8.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"props": "node --disable-warning=ExperimentalWarning --experimental-strip-types demo/props.ts",
|