@umriss-ui/calculation 0.2.2 → 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 CHANGED
@@ -11,6 +11,17 @@ 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
+
14
25
  ## 0.2.2 – Core 0.7.0 (Sep. 2026)
15
26
 
16
27
  ### 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_1vssq_21,._frame_1vssq_21:before,._frame_1vssq_21:after{box-sizing:border-box}._calculation_1vssq_39,._calculation_1vssq_39:before,._calculation_1vssq_39:after{box-sizing:border-box}._disclosure_1vssq_53,._disclosure_1vssq_53:before,._disclosure_1vssq_53:after{box-sizing:border-box}._list_1vssq_57,._list_1vssq_57:before,._list_1vssq_57:after{box-sizing:border-box}._item_1vssq_58,._item_1vssq_58:before,._item_1vssq_58:after{box-sizing:border-box}._derivation_1vssq_59,._derivation_1vssq_59:before,._derivation_1vssq_59:after{box-sizing:border-box}._line_1vssq_109,._line_1vssq_109:before,._line_1vssq_109:after{box-sizing:border-box}._labelCell_1vssq_151,._labelCell_1vssq_151:before,._labelCell_1vssq_151:after{box-sizing:border-box}._names_1vssq_152,._names_1vssq_152:before,._names_1vssq_152:after{box-sizing:border-box}._operator_1vssq_153,._operator_1vssq_153:before,._operator_1vssq_153:after{box-sizing:border-box}._amount_1vssq_154,._amount_1vssq_154:before,._amount_1vssq_154:after{box-sizing:border-box}._unit_1vssq_155,._unit_1vssq_155:before,._unit_1vssq_155:after{box-sizing:border-box}._assessment_1vssq_156,._assessment_1vssq_156:before,._assessment_1vssq_156:after{box-sizing:border-box}._label_1vssq_151,._label_1vssq_151:before,._label_1vssq_151:after{box-sizing:border-box}._approximate_1vssq_269,._approximate_1vssq_269:before,._approximate_1vssq_269:after{box-sizing:border-box}._target_1vssq_297,._target_1vssq_297:before,._target_1vssq_297:after{box-sizing:border-box}._worst_1vssq_298,._worst_1vssq_298:before,._worst_1vssq_298:after{box-sizing:border-box}._notes_1vssq_390,._notes_1vssq_390:before,._notes_1vssq_390:after{box-sizing:border-box}._freshness_1vssq_404,._freshness_1vssq_404:before,._freshness_1vssq_404:after{box-sizing:border-box}._frame_1vssq_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_1vssq_39{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto auto auto auto;margin:0;padding:0;list-style:none}._frame_1vssq_21[data-still]{--disclosure-size: 0px;--disclosure-gap: 0px}._frame_1vssq_21[data-still] ._disclosure_1vssq_53{display:none}._list_1vssq_57,._item_1vssq_58,._derivation_1vssq_59{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_1vssq_59[hidden]{display:none}._derivation_1vssq_59:not([hidden]){animation:_derivationIn_1vssq_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_1vssq_1{0%{opacity:0}}._item_1vssq_58{--fall: calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) / 2 - 1px)}._derivation_1vssq_59{position:relative}._derivation_1vssq_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_1vssq_59)>._item_1vssq_58[data-open]>._line_1vssq_109:not([data-mark]),:not(._derivation_1vssq_59)>._item_1vssq_58>._derivation_1vssq_59{background-color:var(--u-color-surface-sunken)}._derivation_1vssq_59 ._line_1vssq_109{border-top-color:transparent}._line_1vssq_109{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_1vssq_39>._item_1vssq_58:first-child>._line_1vssq_109:first-child,._calculation_1vssq_39>._item_1vssq_58:first-child>._list_1vssq_57>._item_1vssq_58:first-child>._line_1vssq_109{border-top-color:transparent}._line_1vssq_109[data-foldable]{cursor:pointer}._line_1vssq_109[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_1vssq_109[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_1vssq_151,._names_1vssq_152,._operator_1vssq_153,._amount_1vssq_154,._unit_1vssq_155,._assessment_1vssq_156{grid-row:1;padding-top:var(--u-space-2);padding-bottom:var(--u-space-2)}._labelCell_1vssq_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_1vssq_151{min-width:0;color:var(--u-color-text)}._line_1vssq_109[data-reference] ._label_1vssq_151{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_1vssq_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_1vssq_53{box-sizing:border-box}button._disclosure_1vssq_53{cursor:pointer}button._disclosure_1vssq_53:hover,._line_1vssq_109[data-foldable]:hover button._disclosure_1vssq_53{box-sizing:border-box}button._disclosure_1vssq_53:hover,._line_1vssq_109[data-foldable]:hover button._disclosure_1vssq_53{background:var(--u-color-surface-sunken);color:var(--u-color-text)}._item_1vssq_58[data-open]>._line_1vssq_109 button._disclosure_1vssq_53{box-sizing:border-box}._item_1vssq_58[data-open]>._line_1vssq_109 button._disclosure_1vssq_53{color:var(--u-color-accent)}button._disclosure_1vssq_53:focus-visible{box-sizing:border-box}button._disclosure_1vssq_53:focus-visible{outline:none;box-shadow:var(--u-focus-ring)}._disclosure_1vssq_53 svg{box-sizing:border-box}._disclosure_1vssq_53 svg{transition:transform var(--u-duration-fast) var(--u-ease-out)}._disclosure_1vssq_53 svg[data-open]{box-sizing:border-box}._disclosure_1vssq_53 svg[data-open]{transform:rotate(90deg)}._names_1vssq_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_1vssq_153,._amount_1vssq_154,._unit_1vssq_155{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_1vssq_153{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_1vssq_154{grid-column:4;text-align:right;color:var(--u-color-text)}._amount_1vssq_154[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_1vssq_269{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_1vssq_155{grid-column:5;padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_1vssq_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_1vssq_156:empty{padding-right:0}._target_1vssq_297,._worst_1vssq_298{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_1vssq_298:before{content:"● "}._worst_1vssq_298[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_1vssq_298[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_1vssq_298[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_1vssq_109[data-inner]>._amount_1vssq_154{color:var(--u-color-text-secondary)}._line_1vssq_109[data-kind=interim] ._label_1vssq_151,._line_1vssq_109[data-kind=interim]>._amount_1vssq_154{font-weight:var(--u-weight-medium)}._line_1vssq_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_1vssq_109[data-closing] ._label_1vssq_151{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_1vssq_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_1vssq_109[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_1vssq_109[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_1vssq_109[data-kind=result] ._label_1vssq_151{font-weight:var(--u-weight-semibold)}._line_1vssq_109[data-kind=result]>._amount_1vssq_154{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_1vssq_109[data-kind=result]>._amount_1vssq_154:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._notes_1vssq_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_1vssq_404[data-freshness=stale]{color:var(--u-color-warning)}._freshness_1vssq_404[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_1vssq_39{grid-template-columns:minmax(0,1fr) 0 auto auto auto 0}._names_1vssq_152{display:none}._labelCell_1vssq_151{padding-right:var(--u-space-3)}._assessment_1vssq_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_1vssq_390{grid-row:3;grid-column:1 / -1}}@media(prefers-reduced-motion:reduce){._disclosure_1vssq_53 svg{transition:none}._derivation_1vssq_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}}}
@@ -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 _e, useState as oe } from "react";
4
- import { assess as be, verdictWeight as K, useFormats as me, useWording as fe, VisuallyHidden as $e, AngleGlyph as Ne, Tooltip as re, Badge as ie, useFreshness as we } from "@umriss-ui/core";
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
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 qe(t, n) {
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 qe(t.format === "percent" ? n * 100 : n, ye(t));
12
+ return xe(t.format === "percent" ? n * 100 : n, ye(t));
13
13
  }
14
- const xe = (t, n) => t.format === "percent" ? n / 100 : n;
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, o) => v[o + 1] ? e - h : e + h, m);
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":
@@ -26,42 +26,42 @@ function le(t, n, v) {
26
26
  }
27
27
  }
28
28
  const ce = (t, n) => n === void 0 || t !== void 0 && K(t) >= K(n) ? t : n;
29
- function Oe(t) {
29
+ function Se(t) {
30
30
  const n = /* @__PURE__ */ new Map(), v = (m) => {
31
- var $, q, T;
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, o, y = !1, C;
35
+ let h = null, s, y = !1, C;
36
36
  if (e.given) {
37
- const N = e.given.value;
38
- typeof N == "number" && Number.isFinite(N) ? h = N : o = { kind: "missing", label: e.label };
37
+ const $ = e.given.value;
38
+ typeof $ == "number" && Number.isFinite($) ? h = $ : s = { kind: "missing", label: e.label };
39
39
  } else {
40
- const N = e.operands.map((s) => ({ operand: s, ...v(s.key) }));
41
- for (const { operand: s, verdict: c, worst: r } of N) {
42
- const _ = s.reference ? c : ce(c, r);
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
- o = ($ = N.find((s) => s.absence)) == null ? void 0 : $.absence;
46
- const x = N[1];
47
- if (!o && e.operator === "quotient" && x.value === 0 && (o = { kind: "zero", label: t.quantities.get(x.operand.key).label }), !o) {
48
- const s = e.operands.map((r) => r.negated === !0);
49
- h = le(e.operator, N.map((r) => r.value), s);
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
+ const a = e.operands.map((r) => r.negated === !0);
49
+ h = le(e.operator, $.map((r) => r.value), a);
50
50
  const c = le(
51
51
  e.operator,
52
- N.map((r) => xe(t.quantities.get(r.operand.key), r.shown)),
53
- s
52
+ $.map((r) => Oe(t.quantities.get(r.operand.key), r.shown)),
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 || (((q = e.limits) == null ? void 0 : q.length) ?? 0) > 0 ? be(h, d) : void 0, b = (((T = e.limits) == null ? void 0 : T.length) ?? 0) > 0 ? g.verdict : h === null ? "unknown" : void 0, l = {
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: o,
60
+ absence: s,
61
61
  shown: h === null ? null : G(e, h),
62
62
  approximate: y,
63
63
  assessment: g,
64
- verdict: b,
64
+ verdict: _,
65
65
  worst: C
66
66
  };
67
67
  return n.set(m, l), l;
@@ -69,7 +69,7 @@ function Oe(t) {
69
69
  for (const m of t.quantities.keys()) v(m);
70
70
  return n;
71
71
  }
72
- const Se = () => null, Te = () => null, ke = () => null, Ce = () => null, Ae = () => null, ue = () => null, Ie = () => null, Me = () => null, Pe = () => null, De = () => null, Ee = () => null, Y = () => null, Be = /* @__PURE__ */ new Map([
72
+ const qe = () => null, Te = () => null, ke = () => null, Ce = () => null, Ae = () => null, ue = () => null, Ie = () => null, Me = () => null, Pe = () => null, De = () => null, Ee = () => null, Y = () => null, Be = /* @__PURE__ */ new Map([
73
73
  [Te, "sum"],
74
74
  [ke, "difference"],
75
75
  [Ce, "product"],
@@ -85,7 +85,7 @@ const Se = () => null, Te = () => null, ke = () => null, Ce = () => null, Ae = (
85
85
  [De, { name: "Times", operator: "product" }],
86
86
  [Ee, { name: "DividedBy", operator: "quotient" }]
87
87
  ]), X = "<Given>, <Sum>, <Difference>, <Product>, <Quotient> or <Chain>";
88
- function S(t) {
88
+ function q(t) {
89
89
  throw new Error(`@umriss-ui/calculation: ${t}`);
90
90
  }
91
91
  function Q(t) {
@@ -101,68 +101,68 @@ function V(t) {
101
101
  const ee = (t, n, v) => `${t}/${j(n) && n.key || v}`;
102
102
  function je(t) {
103
103
  const n = Q(t);
104
- n.length !== 1 && S(`<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, b) => {
106
- const { id: l, ...$ } = g;
107
- l !== void 0 && (m.has(l) && S(`${b}: the id "${l}" is used twice.`), m.set(l, d));
108
- const q = { ...$, key: d, id: l, operands: [] };
109
- return v.set(d, q), q;
110
- }, h = (d, g, b) => {
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, ...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: b }), l;
113
+ return i.push({ operand: l, to: d.props.to, where: _ }), l;
114
114
  }
115
- return { key: o(d, g, b), reference: !1 };
116
- }, o = (d, g, b) => {
117
- if ((!j(d) || d.type === ue || Z.has(d.type) || d.type === Y) && S(`${b}: ${V(d)} cannot stand here; a quantity must be ${X}.`), d.type === Ie) return y(d.props.children, g, b);
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
- d.type !== Se && l === void 0 && S(
120
- `${b}: ${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.`
119
+ d.type !== qe && l === void 0 && q(
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: $, value: q, source: T, asOf: N, ages: x, ...s } = d.props, c = `${b} › ${s.label}`, r = e(g, s, c);
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: q, source: T, asOf: N, ages: x }, g;
124
+ return r.given = { value: x, source: T, asOf: $, ages: O }, g;
125
125
  r.operator = l;
126
- const _ = Q($), a = _.length;
127
- return (l === "quotient" ? a !== 2 : a < 2) && S(
128
- `${c}: <${We[l]}> takes ${l === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${a}.`
129
- ), r.operands = _.map((u, w) => h(u, ee(g, u, w), c)), g;
130
- }, y = (d, g, b) => {
131
- const l = `${b} › <Chain>`, [$, ...q] = Q(d);
132
- ($ === void 0 || j($) && (Z.has($.type) || $.type === Y)) && S(`${l}: a chain starts with a quantity that has no operator - ${X} or <Ref>.`);
133
- let T = h($, ee(g, $, 0), l), N = V($), x = [], s;
134
- return q.forEach((c, r) => {
135
- const _ = ee(g, c, r + 1);
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
- x.length === 0 && S(`${D}: an <Interim> needs an operand since the named value before it, ${N}.`);
139
- const O = e(_, M, D);
140
- O.interim = !0, O.operator = x[0].line.operator, O.operands = [T, ...x.map((J) => J.operand)], T = { key: _, reference: !1, previous: !0 }, N = `<Interim label="${M.label}">`, x = [], s = _;
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 a = j(c) ? Z.get(c.type) : void 0;
144
- a === void 0 && S(`${l}: ${V(c)} needs an operator in a chain - <Plus>, <Minus>, <Times> or <DividedBy> - or is an <Interim>.`);
145
- const u = a.operator !== "sum", w = x.find((M) => M.line.operator !== "sum");
146
- (u && x.length > 0 || w) && S(
147
- `${l}: <${(w ?? { line: a }).line.name}> stands alone between two named values - directly after the first quantity or an <Interim>, and directly before an <Interim>.`
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
+ (u && O.length > 0 || N) && q(
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 = () => S(`${l}: <${a.name}> takes either a label and a value, or exactly one quantity as its child.`);
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], _, l);
153
- M.negated = a.negated, x.push({ operand: M, line: a });
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(_, { ...L, label: A.label }, `${l} › ${A.label}`);
158
- z.given = { value: E, source: U, asOf: F, ages: R }, x.push({ operand: { key: _, reference: !1, negated: a.negated }, line: a });
159
- }), (x.length > 0 || s === void 0) && S(`${l}: a chain ends with an <Interim>, which names its value.`), s;
160
- }, C = o(n[0], "0", "<Calculation>");
161
- for (const { operand: d, to: g, where: b } of i) {
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
+ }), (O.length > 0 || a === void 0) && q(`${l}: a chain ends with an <Interim>, which names its value.`), a;
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 $ = [...m.keys()].map((q) => `"${q}"`).join(", ");
165
- S(`${b}: <Ref to="${g}"> names no quantity. ${$ ? `The ids that exist: ${$}.` : "No quantity has an id."}`);
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,8 +173,8 @@ 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((o) => t.get(o).label);
177
- S(`the calculation goes round in a circle through references: ${h.join(" → ")}.`);
176
+ const h = [...v.slice(e), i].map((s) => t.get(s).label);
177
+ q(`the calculation goes round in a circle through references: ${h.join(" → ")}.`);
178
178
  }
179
179
  v.push(i);
180
180
  for (const h of t.get(i).operands) m(h.key);
@@ -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 o = t.quantities.get(v), y = n.get(v), C = (_, a, u) => a.shown === null ? u ? e.verdictUnknown : e.statAbsentValue : pe(_, a.shown, i, u ? e.calculationPercent : "%"), d = (_) => {
221
- if (m || !o.operator) return {};
222
- if (!_ && o.operands.length > de)
223
- return { names: e.calculationOperandCount(o.operands.length) };
224
- const a = (u) => o.operands.map((w, B) => {
225
- const A = t.quantities.get(w.key);
226
- return B === 0 ? u(A) : `${te({ operator: o.operator, negated: w.negated === !0 }, _, e)} ${u(A)}`;
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
+ const A = t.quantities.get(N.key);
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: a((u) => u.label),
230
- numbers: a((u) => C(u, n.get(u.key), _))
229
+ names: o((u) => u.label),
230
+ numbers: o((u) => C(u, n.get(u.key), w))
231
231
  };
232
- }, g = (_) => {
233
- var w;
234
- const a = (w = y.assessment) == null ? void 0 : w.deviation;
235
- if (a === void 0 || o.target === void 0) return;
236
- const u = pe(o, G(o, o.target), i, _ ? e.calculationPercent : "%");
237
- return a > 0 ? e.calculationAboveTarget(u) : a < 0 ? e.calculationBelowTarget(u) : e.calculationOnTarget(u);
238
- }, b = d(!1).names, l = b === void 0 || o.operands.length > de ? b : `= ${b}`, $ = d(!0), q = y.absence ? Ue(y.absence, e) : void 0, T = ` ${e.calculationEquals} `, N = y.approximate ? `${e.calculationApproximately} ${C(o, y, !0)}` : C(o, y, !0), s = [
239
- (h ? `${te(h, !0, e)} ` : "") + o.label + T + [$.names, $.numbers, N].filter(Boolean).join(`,${T}`),
232
+ }, g = (w) => {
233
+ var N;
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
240
  y.verdict !== void 0 && y.verdict !== "unknown" ? H(y.verdict, e) : void 0,
241
241
  g(!0),
242
- q
243
- ].filter(Boolean).join(", "), c = y.shown === null ? void 0 : o.format === "percent" ? "%" : o.unit;
244
- return { amount: y.shown === null ? e.statAbsentValue : i.number(y.shown, o.decimals), unit: c, names: l, target: g(!1), reason: q, sentence: s };
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 = "_frame_1vssq_21 _text_1hv7a_23", Ge = "_calculation_1vssq_39", He = "_disclosure_1vssq_53", Ke = "_list_1vssq_57", ze = "_item_1vssq_58", Je = "_derivation_1vssq_59", Ye = "_line_1vssq_109", Ze = "_labelCell_1vssq_151", Xe = "_names_1vssq_152", et = "_operator_1vssq_153", tt = "_amount_1vssq_154", nt = "_unit_1vssq_155", st = "_assessment_1vssq_156", at = "_label_1vssq_151", ot = "_approximate_1vssq_269", rt = "_target_1vssq_297", it = "_worst_1vssq_298", lt = "_notes_1vssq_390", ct = "_freshness_1vssq_404", p = {
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,
@@ -256,38 +256,38 @@ const Ve = "_frame_1vssq_21 _text_1hv7a_23", Ge = "_calculation_1vssq_39", He =
256
256
  operator: et,
257
257
  amount: tt,
258
258
  unit: nt,
259
- assessment: st,
260
- label: at,
261
- approximate: ot,
259
+ assessment: at,
260
+ label: ot,
261
+ approximate: st,
262
262
  target: rt,
263
263
  worst: it,
264
264
  notes: lt,
265
265
  freshness: ct
266
266
  }, ut = { ok: "success", unknown: "neutral", warning: "warning", alarm: "danger" }, dt = (...t) => t.filter(Boolean).join(" ");
267
267
  function pt({ asOf: t, ages: n }) {
268
- const v = me(), m = fe(), i = we(t, n), e = i.freshness === "lost" ? m.freshnessDisconnected : i.freshness === "stale" ? m.freshnessStale : m.freshnessFresh;
268
+ const v = me(), m = fe(), i = Ne(t, n), e = i.freshness === "lost" ? m.freshnessDisconnected : i.freshness === "stale" ? m.freshnessStale : m.freshnessFresh;
269
269
  return /* @__PURE__ */ k("span", { className: p.freshness, "data-freshness": i.freshness, children: [
270
270
  e,
271
271
  i.age !== null && ` · ${v.relative(i.age)}`
272
272
  ] });
273
273
  }
274
274
  function vt({ children: t, className: n, style: v, ...m }) {
275
- const i = me(), e = fe(), h = _e(), o = je(t), y = Oe(o), [C, d] = oe(() => /* @__PURE__ */ new Set()), [g, b] = oe(null), l = (s) => d((c) => {
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
- return r.delete(s) || r.add(s), r;
278
- }), $ = (s, c, r) => r === 0 || c.previous ? void 0 : { operator: s.operator, negated: c.negated === !0 };
279
- let q = !1;
280
- const T = (s, c) => g === null ? void 0 : s === g ? "use" : c === g ? "operand" : void 0, N = (s, c, r, _) => {
281
- const a = o.quantities.get(s), u = y.get(s), w = Le(o, y, s, c, i, e, r.position), B = a.operator !== void 0 && !c, A = s === o.result && !c, W = B && (a.interim ? r.flat : A), I = B && !W, E = I && C.has(s);
282
- q || (q = I);
283
- const U = `${h}-${s}`, F = { depth: W ? r.depth : r.depth + 1, flat: !1, parent: s }, R = B ? a.operands.find((P) => P.previous) : void 0, L = R && r.flat ? N(R.key, !1, { ...r, parent: s, position: void 0 }, `${_}-c`) : [], z = R && !r.flat ? N(R.key, !1, { ...F, flat: !0 }, `${_}-c`) : [], M = B ? a.operands.map(
284
- (P, ae) => P.previous ? null : N(P.key, P.reference, { ...F, position: $(a, P, ae) }, `${_}-${ae}`)
285
- ) : [], D = I && !E && u.worst !== void 0 && K(u.worst) > K(u.verdict ?? "ok") ? u.worst : void 0, O = c ? void 0 : a.given, J = r.position ? te(r.position, !1, e) : void 0, ne = [
286
- !c && a.explanation !== void 0 && /* @__PURE__ */ f("span", { children: a.explanation }, "explanation"),
287
- (O == null ? void 0 : O.source) !== void 0 && /* @__PURE__ */ f("span", { children: e.calculationSource(O.source) }, "source"),
288
- (O == null ? void 0 : O.asOf) !== void 0 && (O.ages !== void 0 ? /* @__PURE__ */ f(pt, { asOf: O.asOf, ages: O.ages }, "asOf") : /* @__PURE__ */ f("span", { children: e.asOfAgo(i.dateTime(new Date(O.asOf), !1)) }, "asOf")),
289
- !c && a.aside !== void 0 && /* @__PURE__ */ f("span", { children: a.aside }, "aside")
290
- ].filter(Boolean), he = A ? "result" : a.interim && !c && r.flat ? "interim" : void 0, se = /* @__PURE__ */ k(
277
+ return r.delete(a) || r.add(a), r;
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
+ (S == null ? void 0 : S.source) !== void 0 && /* @__PURE__ */ f("span", { children: e.calculationSource(S.source) }, "source"),
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 && 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,
@@ -296,18 +296,18 @@ function vt({ children: t, className: n, style: v, ...m }) {
296
296
  "data-kind": he,
297
297
  "data-foldable": I ? "" : void 0,
298
298
  "data-reference": c ? "" : void 0,
299
- "data-mark": T(s, r.parent),
300
- onPointerEnter: () => b(s),
301
- onPointerLeave: () => b(null),
302
- onFocus: () => b(s),
303
- onBlur: () => b(null),
299
+ "data-mark": T(a, r.parent),
300
+ onPointerEnter: () => _(a),
301
+ onPointerLeave: () => _(null),
302
+ onFocus: () => _(a),
303
+ onBlur: () => _(null),
304
304
  onClick: I ? () => {
305
305
  var P;
306
- (P = window.getSelection()) != null && P.toString() || l(s);
306
+ (P = window.getSelection()) != null && P.toString() || l(a);
307
307
  } : void 0,
308
308
  children: [
309
- /* @__PURE__ */ f($e, { children: [
310
- w.sentence,
309
+ /* @__PURE__ */ f(be, { children: [
310
+ N.sentence,
311
311
  u.approximate && e.calculationApproximateNote,
312
312
  D !== void 0 && e.calculationWorstInside(H(D, e))
313
313
  ].filter(Boolean).join(". ") }),
@@ -319,22 +319,22 @@ 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)(a.label),
323
- children: /* @__PURE__ */ f(Ne, { "data-open": E ? "" : void 0 })
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: a.label })
326
+ /* @__PURE__ */ f("span", { className: p.label, "aria-hidden": "true", children: o.label })
327
327
  ] }),
328
- /* @__PURE__ */ f("span", { className: p.names, "aria-hidden": "true", children: I && !E ? w.names : void 0 }),
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 }),
330
330
  /* @__PURE__ */ k("span", { className: p.amount, "aria-hidden": "true", "data-verdict": u.verdict, children: [
331
331
  u.approximate && /* @__PURE__ */ f(re, { content: e.calculationApproximateNote, children: /* @__PURE__ */ f("span", { className: p.approximate, children: "≈" }) }),
332
- w.amount
332
+ N.amount
333
333
  ] }),
334
- /* @__PURE__ */ f("span", { className: p.unit, "aria-hidden": "true", children: w.unit }),
334
+ /* @__PURE__ */ f("span", { className: p.unit, "aria-hidden": "true", children: N.unit }),
335
335
  /* @__PURE__ */ k("span", { className: p.assessment, "aria-hidden": "true", children: [
336
- w.reason !== void 0 ? /* @__PURE__ */ f(ie, { children: w.reason }) : u.verdict !== void 0 && /* @__PURE__ */ f(ie, { tone: ut[u.verdict], children: H(u.verdict, e) }),
337
- w.target !== void 0 && /* @__PURE__ */ f("span", { className: p.target, children: w.target }),
336
+ N.reason !== void 0 ? /* @__PURE__ */ f(ie, { children: N.reason }) : u.verdict !== void 0 && /* @__PURE__ */ f(ie, { tone: ut[u.verdict], children: H(u.verdict, e) }),
337
+ N.target !== void 0 && /* @__PURE__ */ f("span", { className: p.target, children: N.target }),
338
338
  D !== void 0 && /* @__PURE__ */ f("span", { className: p.worst, "data-verdict": D, children: e.calculationWorstInside(H(D, e)) })
339
339
  ] }),
340
340
  ne.length > 0 && /* A click here - on a link in the aside, on a sparkline - is the
@@ -347,12 +347,12 @@ function vt({ children: t, className: n, style: v, ...m }) {
347
347
  ...L,
348
348
  /* @__PURE__ */ k("li", { className: p.item, children: [
349
349
  /* @__PURE__ */ f("ul", { className: p.list, children: M }),
350
- se
351
- ] }, _)
350
+ ae
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: [
355
- se,
355
+ ae,
356
356
  I && /* @__PURE__ */ k("ul", { id: U, className: p.derivation, hidden: !E, children: [
357
357
  z,
358
358
  M,
@@ -363,33 +363,33 @@ function vt({ children: t, className: n, style: v, ...m }) {
363
363
  style: { "--depth": F.depth },
364
364
  "data-inner": "",
365
365
  "data-closing": "",
366
- "data-mark": g === s ? "use" : void 0,
366
+ "data-mark": g === a ? "use" : void 0,
367
367
  children: [
368
368
  /* @__PURE__ */ k("span", { className: p.labelCell, children: [
369
369
  /* @__PURE__ */ f("span", { className: p.disclosure }),
370
370
  /* @__PURE__ */ k("span", { className: p.label, children: [
371
371
  "= ",
372
- a.label
372
+ o.label
373
373
  ] })
374
374
  ] }),
375
375
  /* @__PURE__ */ f("span", { className: p.names }),
376
376
  /* @__PURE__ */ f("span", { className: p.operator }),
377
377
  /* @__PURE__ */ k("span", { className: p.amount, "data-verdict": u.verdict, children: [
378
378
  u.approximate && /* @__PURE__ */ f(re, { content: e.calculationApproximateNote, children: /* @__PURE__ */ f("span", { className: p.approximate, children: "≈" }) }),
379
- w.amount
379
+ N.amount
380
380
  ] }),
381
- /* @__PURE__ */ f("span", { className: p.unit, children: w.unit })
381
+ /* @__PURE__ */ f("span", { className: p.unit, children: N.unit })
382
382
  ]
383
383
  }
384
384
  ) })
385
385
  ] })
386
- ] }, _)
386
+ ] }, w)
387
387
  ];
388
- }, x = N(o.result, !1, { depth: 0, flat: !0, parent: null }, "r");
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": q ? void 0 : "", children: /* @__PURE__ */ f("ul", { className: p.calculation, ...m, children: x }) })
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 {
@@ -397,7 +397,7 @@ export {
397
397
  Ie as Chain,
398
398
  ke as Difference,
399
399
  Ee as DividedBy,
400
- Se as Given,
400
+ qe as Given,
401
401
  Y as Interim,
402
402
  Pe as Minus,
403
403
  Me as Plus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/calculation",
3
- "version": "0.2.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.7.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/core": "0.7.0",
62
- "@umriss-ui/demo": "0.0.0"
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",