@umriss-ui/calculation 0.43.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- @layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_18806_22{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}@media(pointer:fine){._dense_18806_38{--u-control-height-sm: var(--u-control-height-xs)}}._ink_18806_49{--u-color-text: var(--u-color-bg);--u-color-text-secondary: color-mix(in srgb, var(--u-color-bg) 75%, transparent);--u-color-text-muted: color-mix(in srgb, var(--u-color-bg) 60%, transparent)}._extent_18806_75{--_chars: 20;--_extra: 0;--_tracking: 0px;--_chrome: 0px;min-inline-size:0;max-inline-size:100%;contain:inline-size;contain-intrinsic-inline-size:calc((var(--_chars) + var(--_extra)) * (1ch + var(--_tracking)) + var(--_chrome))}._field_18806_90{caret-color:var(--u-color-accent)}._scroll_18806_96{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_18806_96::-webkit-scrollbar{width:10px;height:10px}._scroll_18806_96::-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_18806_96::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_18806_125:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_18806_90._field_18806_90,._fieldRoot_18806_145._fieldRoot_18806_145{font-size:16px}}._field_18806_90:-webkit-autofill,._field_18806_90:-webkit-autofill:hover,._field_18806_90:-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.components{._frame_10pic_24,._frame_10pic_24:before,._frame_10pic_24:after{box-sizing:border-box}._calculation_10pic_51,._calculation_10pic_51:before,._calculation_10pic_51:after{box-sizing:border-box}._line_10pic_86,._line_10pic_86:before,._line_10pic_86:after{box-sizing:border-box}._assessment_10pic_98,._assessment_10pic_98:before,._assessment_10pic_98:after{box-sizing:border-box}._disclosure_10pic_107,._disclosure_10pic_107:before,._disclosure_10pic_107:after{box-sizing:border-box}._amount_10pic_90,._amount_10pic_90:before,._amount_10pic_90:after{box-sizing:border-box}._list_10pic_128,._list_10pic_128:before,._list_10pic_128:after{box-sizing:border-box}._item_10pic_129,._item_10pic_129:before,._item_10pic_129:after{box-sizing:border-box}._derivation_10pic_130,._derivation_10pic_130:before,._derivation_10pic_130:after{box-sizing:border-box}._labelCell_10pic_90,._labelCell_10pic_90:before,._labelCell_10pic_90:after{box-sizing:border-box}._names_10pic_90,._names_10pic_90:before,._names_10pic_90:after{box-sizing:border-box}._operator_10pic_90,._operator_10pic_90:before,._operator_10pic_90:after{box-sizing:border-box}._unit_10pic_90,._unit_10pic_90:before,._unit_10pic_90:after{box-sizing:border-box}._label_10pic_90,._label_10pic_90:before,._label_10pic_90:after{box-sizing:border-box}._approximate_10pic_360,._approximate_10pic_360:before,._approximate_10pic_360:after{box-sizing:border-box}._target_10pic_102,._target_10pic_102:before,._target_10pic_102:after{box-sizing:border-box}._worst_10pic_102,._worst_10pic_102:before,._worst_10pic_102:after{box-sizing:border-box}._head_10pic_512,._head_10pic_512:before,._head_10pic_512:after{box-sizing:border-box}._headCell_10pic_519,._headCell_10pic_519:before,._headCell_10pic_519:after{box-sizing:border-box}._headUnit_10pic_532,._headUnit_10pic_532:before,._headUnit_10pic_532:after{box-sizing:border-box}._notes_10pic_539,._notes_10pic_539:before,._notes_10pic_539:after{box-sizing:border-box}._freshness_10pic_553,._freshness_10pic_553:before,._freshness_10pic_553:after{box-sizing:border-box}._headLabel_10pic_583,._headLabel_10pic_583:before,._headLabel_10pic_583:after{box-sizing:border-box}._frame_10pic_24{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);outline:1px solid transparent;box-shadow:var(--u-edge);overflow-x:auto;overflow-y:hidden;--_calculation-disclosure-size: 20px;--_calculation-disclosure-gap: var(--u-space-2);--_calculation-line-pad: var(--u-space-2);--_calculation-line-gap: var(--u-space-1);container-type:inline-size;width:100%}._calculation_10pic_51{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto var(--_calculation-figure-tracks, auto auto) auto;margin:0;padding:0;list-style:none}._frame_10pic_24[data-compact]{--_calculation-line-text: round(up, calc(var(--u-text-xs) * 1.63), 1px);--_calculation-line-pad: var(--u-space-1);--_calculation-line-gap: calc(var(--u-space-1) / 2);font-size:var(--u-text-xs);line-height:var(--_calculation-line-text)}@media(pointer:coarse){._frame_10pic_24[data-compact]{--_calculation-line-pad: var(--u-space-2);--_calculation-line-gap: var(--u-space-1)}}._frame_10pic_24[data-compact]:not([data-two-lines]) ._line_10pic_86{grid-template-rows:minmax(calc(var(--_calculation-line-text) + 2 * var(--_calculation-line-pad)),auto)}._frame_10pic_24[data-compact]:not([data-two-lines]) :is(._labelCell_10pic_90,._names_10pic_90,._operator_10pic_90,._amount_10pic_90,._unit_10pic_90){padding-bottom:calc(var(--_calculation-line-pad) - 1px)}._frame_10pic_24[data-compact]:not([data-two-lines]) ._assessment_10pic_98{padding-bottom:0}._frame_10pic_24[data-compact]:not([data-two-lines]) ._assessment_10pic_98>:not(._target_10pic_102,._worst_10pic_102){margin-block:-1px}._frame_10pic_24[data-compact] ._disclosure_10pic_107{margin-block:-1px}._frame_10pic_24[data-compact] ._line_10pic_86[data-kind=result]>._amount_10pic_90{font-size:var(--u-text-sm);text-underline-offset:3px}._frame_10pic_24[data-still]{--_calculation-disclosure-size: 0px;--_calculation-disclosure-gap: 0px}._frame_10pic_24[data-still] ._disclosure_10pic_107{display:none}._list_10pic_128,._item_10pic_129,._derivation_10pic_130{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_10pic_130[hidden]{display:none}._derivation_10pic_130:not([hidden]){animation:_derivationIn_10pic_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_10pic_1{0%{opacity:0}}._item_10pic_129{--_calculation-fall: calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5) + var(--_calculation-disclosure-size) / 2 - 1px)}._derivation_10pic_130{position:relative}._derivation_10pic_130:before{content:"";position:absolute;top:0;bottom:0;left:var(--_calculation-fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_10pic_130)>._item_10pic_129[data-open]>._line_10pic_86:not([data-mark]),:not(._derivation_10pic_130)>._item_10pic_129>._derivation_10pic_130{background-color:var(--u-color-surface-sunken)}._derivation_10pic_130 ._line_10pic_86{border-top-color:transparent}._line_10pic_86{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_10pic_51>._item_10pic_129:first-child>._line_10pic_86:first-child,._calculation_10pic_51>._item_10pic_129:first-child>._list_10pic_128>._item_10pic_129:first-child>._line_10pic_86{border-top-color:transparent}._line_10pic_86[data-foldable]{cursor:pointer}._line_10pic_86[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_10pic_86[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_10pic_90,._names_10pic_90,._operator_10pic_90,._amount_10pic_90,._unit_10pic_90,._assessment_10pic_98{grid-row:1;padding-top:var(--_calculation-line-pad);padding-bottom:var(--_calculation-line-pad)}._labelCell_10pic_90{grid-column:1;display:flex;align-items:baseline;gap:var(--_calculation-disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_10pic_90{min-width:0;color:var(--u-color-text)}._line_10pic_86[data-reference] ._label_10pic_90{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_10pic_107{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--_calculation-disclosure-size);height:var(--_calculation-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_10pic_107{box-sizing:border-box}button._disclosure_10pic_107{cursor:pointer}@media(pointer:coarse){button._disclosure_10pic_107{position:relative}button._disclosure_10pic_107:after{box-sizing:border-box}button._disclosure_10pic_107:after{content:"";position:absolute;inset:-2px}}button._disclosure_10pic_107:hover,._line_10pic_86[data-foldable]:hover button._disclosure_10pic_107{box-sizing:border-box}button._disclosure_10pic_107:hover,._line_10pic_86[data-foldable]:hover button._disclosure_10pic_107{background:var(--u-color-surface-sunken);color:var(--u-color-text)}button._disclosure_10pic_107:active,._line_10pic_86[data-foldable]:active button._disclosure_10pic_107{box-sizing:border-box}button._disclosure_10pic_107:active,._line_10pic_86[data-foldable]:active button._disclosure_10pic_107{background:var(--u-color-surface-pressed)}._item_10pic_129[data-open]>._line_10pic_86 button._disclosure_10pic_107{box-sizing:border-box}._item_10pic_129[data-open]>._line_10pic_86 button._disclosure_10pic_107{color:var(--u-color-accent)}button._disclosure_10pic_107:focus-visible{box-sizing:border-box}button._disclosure_10pic_107:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}._disclosure_10pic_107 svg{box-sizing:border-box}._disclosure_10pic_107 svg{transition:transform var(--u-transition-path)}._disclosure_10pic_107 svg[data-open]{box-sizing:border-box}._disclosure_10pic_107 svg[data-open]{transform:rotate(90deg)}._names_10pic_90{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_10pic_90,._amount_10pic_90,._unit_10pic_90{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_10pic_90{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_10pic_90{grid-column:var(--_calculation-column, 4);text-align:right;color:var(--u-color-text)}._amount_10pic_90[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_10pic_360{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_10pic_90{grid-column:var(--_calculation-column, 5);padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_10pic_98{grid-column:var(--_calculation-assessment-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_10pic_98:empty{padding-right:0}._target_10pic_102,._worst_10pic_102{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_10pic_102:before{content:"● "}._worst_10pic_102[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_10pic_102[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_10pic_102[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_10pic_86[data-inner]>._amount_10pic_90{color:var(--u-color-text-secondary)}._line_10pic_86[data-kind=interim] ._label_10pic_90,._line_10pic_86[data-kind=interim]>._amount_10pic_90{font-weight:var(--u-weight-medium)}._line_10pic_86[data-emphasis=strong] ._label_10pic_90,._line_10pic_86[data-emphasis=strong]>._amount_10pic_90{font-weight:var(--u-weight-semibold);color:var(--u-color-text)}._line_10pic_86[data-emphasis=muted] ._label_10pic_90,._line_10pic_86[data-emphasis=muted]>._amount_10pic_90{color:var(--u-color-text-secondary)}._line_10pic_86[data-inner][data-emphasis=muted] ._label_10pic_90,._line_10pic_86[data-inner][data-emphasis=muted]>._amount_10pic_90{color:var(--u-color-text-muted)}._line_10pic_86[data-rule],._derivation_10pic_130 ._line_10pic_86[data-rule]{border-top:1px solid var(--u-color-text-secondary)}._line_10pic_86[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / var(--_calculation-figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_10pic_86[data-closing] ._label_10pic_90{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_10pic_86[data-closing]:before{content:"";grid-row:1;grid-column:3 / var(--_calculation-figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_10pic_86[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_10pic_86[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_10pic_86[data-kind=result] ._label_10pic_90{font-weight:var(--u-weight-semibold)}._line_10pic_86[data-kind=result]>._amount_10pic_90{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_10pic_86[data-kind=result]>._amount_10pic_90:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._amount_10pic_90[data-later]{padding-left:var(--u-space-6)}._head_10pic_512{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:end}._headCell_10pic_519{grid-row:1;grid-column:var(--_calculation-column);display:flex;flex-direction:column;align-items:flex-end;padding:var(--_calculation-line-pad) 0 var(--u-space-1);font-size:var(--u-text-xs);font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary);white-space:nowrap}._headUnit_10pic_532{font-family:var(--u-font-mono);font-weight:var(--u-weight-regular)}._notes_10pic_539{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(--_calculation-line-gap));padding:0 var(--u-space-4) var(--_calculation-line-pad) calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5) + var(--_calculation-disclosure-size) + var(--_calculation-disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_10pic_553[data-freshness=stale]{color:var(--u-color-warning)}._freshness_10pic_553[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_10pic_51{grid-template-columns:minmax(0,1fr) 0 auto var(--_calculation-figure-tracks, auto auto) 0}._amount_10pic_90[data-later]{padding-left:var(--u-space-2)}._frame_10pic_24[data-metrics] ._unit_10pic_90:not([data-last]){padding-right:var(--u-space-2)}._headCell_10pic_519[data-unit] ._headLabel_10pic_583,._names_10pic_90{display:none}._labelCell_10pic_90{padding-right:var(--u-space-3)}._assessment_10pic_98:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--_calculation-line-pad) calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5) + var(--_calculation-disclosure-size) + var(--_calculation-disclosure-gap));white-space:normal}._frame_10pic_24[data-compact]:not([data-two-lines]) ._assessment_10pic_98:not(:empty){padding-bottom:var(--_calculation-line-pad)}._frame_10pic_24[data-compact]:not([data-two-lines]) ._assessment_10pic_98:not(:empty)>:not(._target_10pic_102,._worst_10pic_102){margin-block:0}._notes_10pic_539{grid-row:3;grid-column:1 / -1}}._frame_10pic_24[data-two-lines] ._labelCell_10pic_90{grid-column:1 / -1;padding-bottom:0}._frame_10pic_24[data-two-lines] ._names_10pic_90{display:none}._frame_10pic_24[data-two-lines] ._line_10pic_86>._operator_10pic_90,._frame_10pic_24[data-two-lines] ._line_10pic_86>._amount_10pic_90,._frame_10pic_24[data-two-lines] ._line_10pic_86>._unit_10pic_90{grid-row:2;padding-top:var(--_calculation-line-gap)}._frame_10pic_24[data-two-lines] ._line_10pic_86[data-kind=interim]:before,._frame_10pic_24[data-two-lines] ._line_10pic_86[data-closing]:before{grid-row:2}._frame_10pic_24[data-two-lines] ._assessment_10pic_98:not(:empty){grid-area:3 / 1 / 4 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--_calculation-line-pad) calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5) + var(--_calculation-disclosure-size) + var(--_calculation-disclosure-gap));white-space:normal}._frame_10pic_24[data-two-lines] ._notes_10pic_539{grid-row:4;grid-column:1 / -1}@media(prefers-reduced-motion:reduce){._disclosure_10pic_107 svg{transition:none}._derivation_10pic_130:not([hidden]){animation:none}}@media(forced-colors:active){._line_10pic_86[data-mark]{outline:1px solid Highlight;outline-offset:-1px}._line_10pic_86[data-mark=use]{outline-width:2px;outline-offset:-2px}._derivation_10pic_130:before{background:CanvasText}._line_10pic_86[data-emphasis=muted] ._label_10pic_90,._line_10pic_86[data-emphasis=muted]>._amount_10pic_90{color:GrayText}}}
1
+ @layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_18806_22{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}@media(pointer:fine){._dense_18806_38{--u-control-height-sm: var(--u-control-height-xs)}}._ink_18806_49{--u-color-text: var(--u-color-bg);--u-color-text-secondary: color-mix(in srgb, var(--u-color-bg) 75%, transparent);--u-color-text-muted: color-mix(in srgb, var(--u-color-bg) 60%, transparent)}._extent_18806_75{--_chars: 20;--_extra: 0;--_tracking: 0px;--_chrome: 0px;min-inline-size:0;max-inline-size:100%;contain:inline-size;contain-intrinsic-inline-size:calc((var(--_chars) + var(--_extra)) * (1ch + var(--_tracking)) + var(--_chrome))}._field_18806_90{caret-color:var(--u-color-accent)}._scroll_18806_96{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_18806_96::-webkit-scrollbar{width:10px;height:10px}._scroll_18806_96::-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_18806_96::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_18806_125:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_18806_90._field_18806_90,._fieldRoot_18806_145._fieldRoot_18806_145{font-size:16px}}._field_18806_90:-webkit-autofill,._field_18806_90:-webkit-autofill:hover,._field_18806_90:-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.components{._frame_184xf_24,._frame_184xf_24:before,._frame_184xf_24:after{box-sizing:border-box}._calculation_184xf_51,._calculation_184xf_51:before,._calculation_184xf_51:after{box-sizing:border-box}._line_184xf_86,._line_184xf_86:before,._line_184xf_86:after{box-sizing:border-box}._assessment_184xf_98,._assessment_184xf_98:before,._assessment_184xf_98:after{box-sizing:border-box}._disclosure_184xf_107,._disclosure_184xf_107:before,._disclosure_184xf_107:after{box-sizing:border-box}._amount_184xf_90,._amount_184xf_90:before,._amount_184xf_90:after{box-sizing:border-box}._list_184xf_128,._list_184xf_128:before,._list_184xf_128:after{box-sizing:border-box}._item_184xf_129,._item_184xf_129:before,._item_184xf_129:after{box-sizing:border-box}._derivation_184xf_130,._derivation_184xf_130:before,._derivation_184xf_130:after{box-sizing:border-box}._labelCell_184xf_90,._labelCell_184xf_90:before,._labelCell_184xf_90:after{box-sizing:border-box}._names_184xf_90,._names_184xf_90:before,._names_184xf_90:after{box-sizing:border-box}._operator_184xf_90,._operator_184xf_90:before,._operator_184xf_90:after{box-sizing:border-box}._unit_184xf_90,._unit_184xf_90:before,._unit_184xf_90:after{box-sizing:border-box}._label_184xf_90,._label_184xf_90:before,._label_184xf_90:after{box-sizing:border-box}._approximate_184xf_360,._approximate_184xf_360:before,._approximate_184xf_360:after{box-sizing:border-box}._target_184xf_102,._target_184xf_102:before,._target_184xf_102:after{box-sizing:border-box}._worst_184xf_102,._worst_184xf_102:before,._worst_184xf_102:after{box-sizing:border-box}._quality_184xf_102,._quality_184xf_102:before,._quality_184xf_102:after{box-sizing:border-box}._head_184xf_539,._head_184xf_539:before,._head_184xf_539:after{box-sizing:border-box}._headCell_184xf_546,._headCell_184xf_546:before,._headCell_184xf_546:after{box-sizing:border-box}._headUnit_184xf_559,._headUnit_184xf_559:before,._headUnit_184xf_559:after{box-sizing:border-box}._notes_184xf_566,._notes_184xf_566:before,._notes_184xf_566:after{box-sizing:border-box}._freshness_184xf_580,._freshness_184xf_580:before,._freshness_184xf_580:after{box-sizing:border-box}._headLabel_184xf_610,._headLabel_184xf_610:before,._headLabel_184xf_610:after{box-sizing:border-box}._frame_184xf_24{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);outline:1px solid transparent;box-shadow:var(--u-edge);overflow-x:auto;overflow-y:hidden;--_calculation-disclosure-size: 20px;--_calculation-disclosure-gap: var(--u-space-2);--_calculation-line-pad: var(--u-space-2);--_calculation-line-gap: var(--u-space-1);container-type:inline-size;width:100%}._calculation_184xf_51{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto var(--_calculation-figure-tracks, auto auto) auto;margin:0;padding:0;list-style:none}._frame_184xf_24[data-compact]{--_calculation-line-text: round(up, calc(var(--u-text-xs) * 1.63), 1px);--_calculation-line-pad: var(--u-space-1);--_calculation-line-gap: calc(var(--u-space-1) / 2);font-size:var(--u-text-xs);line-height:var(--_calculation-line-text)}@media(pointer:coarse){._frame_184xf_24[data-compact]{--_calculation-line-pad: var(--u-space-2);--_calculation-line-gap: var(--u-space-1)}}._frame_184xf_24[data-compact]:not([data-two-lines]) ._line_184xf_86{grid-template-rows:minmax(calc(var(--_calculation-line-text) + 2 * var(--_calculation-line-pad)),auto)}._frame_184xf_24[data-compact]:not([data-two-lines]) :is(._labelCell_184xf_90,._names_184xf_90,._operator_184xf_90,._amount_184xf_90,._unit_184xf_90){padding-bottom:calc(var(--_calculation-line-pad) - 1px)}._frame_184xf_24[data-compact]:not([data-two-lines]) ._assessment_184xf_98{padding-bottom:0}._frame_184xf_24[data-compact]:not([data-two-lines]) ._assessment_184xf_98>:not(._target_184xf_102,._worst_184xf_102,._quality_184xf_102){margin-block:-1px}._frame_184xf_24[data-compact] ._disclosure_184xf_107{margin-block:-1px}._frame_184xf_24[data-compact] ._line_184xf_86[data-kind=result]>._amount_184xf_90{font-size:var(--u-text-sm);text-underline-offset:3px}._frame_184xf_24[data-still]{--_calculation-disclosure-size: 0px;--_calculation-disclosure-gap: 0px}._frame_184xf_24[data-still] ._disclosure_184xf_107{display:none}._list_184xf_128,._item_184xf_129,._derivation_184xf_130{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_184xf_130[hidden]{display:none}._derivation_184xf_130:not([hidden]){animation:_derivationIn_184xf_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_184xf_1{0%{opacity:0}}._item_184xf_129{--_calculation-fall: calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5) + var(--_calculation-disclosure-size) / 2 - 1px)}._derivation_184xf_130{position:relative}._derivation_184xf_130:before{content:"";position:absolute;top:0;bottom:0;left:var(--_calculation-fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_184xf_130)>._item_184xf_129[data-open]>._line_184xf_86:not([data-mark]),:not(._derivation_184xf_130)>._item_184xf_129>._derivation_184xf_130{background-color:var(--u-color-surface-sunken)}._derivation_184xf_130 ._line_184xf_86{border-top-color:transparent}._line_184xf_86{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_184xf_51>._item_184xf_129:first-child>._line_184xf_86:first-child,._calculation_184xf_51>._item_184xf_129:first-child>._list_184xf_128>._item_184xf_129:first-child>._line_184xf_86{border-top-color:transparent}._line_184xf_86[data-foldable]{cursor:pointer}._line_184xf_86[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_184xf_86[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_184xf_90,._names_184xf_90,._operator_184xf_90,._amount_184xf_90,._unit_184xf_90,._assessment_184xf_98{grid-row:1;padding-top:var(--_calculation-line-pad);padding-bottom:var(--_calculation-line-pad)}._labelCell_184xf_90{grid-column:1;display:flex;align-items:baseline;gap:var(--_calculation-disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_184xf_90{min-width:0;color:var(--u-color-text)}._line_184xf_86[data-reference] ._label_184xf_90{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_184xf_107{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--_calculation-disclosure-size);height:var(--_calculation-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_184xf_107{box-sizing:border-box}button._disclosure_184xf_107{cursor:pointer}@media(pointer:coarse){button._disclosure_184xf_107{position:relative}button._disclosure_184xf_107:after{box-sizing:border-box}button._disclosure_184xf_107:after{content:"";position:absolute;inset:-2px}}button._disclosure_184xf_107:hover,._line_184xf_86[data-foldable]:hover button._disclosure_184xf_107{box-sizing:border-box}button._disclosure_184xf_107:hover,._line_184xf_86[data-foldable]:hover button._disclosure_184xf_107{background:var(--u-color-surface-sunken);color:var(--u-color-text)}button._disclosure_184xf_107:active,._line_184xf_86[data-foldable]:active button._disclosure_184xf_107{box-sizing:border-box}button._disclosure_184xf_107:active,._line_184xf_86[data-foldable]:active button._disclosure_184xf_107{background:var(--u-color-surface-pressed)}._item_184xf_129[data-open]>._line_184xf_86 button._disclosure_184xf_107{box-sizing:border-box}._item_184xf_129[data-open]>._line_184xf_86 button._disclosure_184xf_107{color:var(--u-color-accent)}button._disclosure_184xf_107:focus-visible{box-sizing:border-box}button._disclosure_184xf_107:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}._disclosure_184xf_107 svg{box-sizing:border-box}._disclosure_184xf_107 svg{transition:transform var(--u-transition-path)}._disclosure_184xf_107 svg[data-open]{box-sizing:border-box}._disclosure_184xf_107 svg[data-open]{transform:rotate(90deg)}._names_184xf_90{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_184xf_90,._amount_184xf_90,._unit_184xf_90{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_184xf_90{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_184xf_90{grid-column:var(--_calculation-column, 4);text-align:right;color:var(--u-color-text)}._amount_184xf_90[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_184xf_360{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_184xf_90{grid-column:var(--_calculation-column, 5);padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_184xf_98{grid-column:var(--_calculation-assessment-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_184xf_98:empty{padding-right:0}._target_184xf_102,._worst_184xf_102,._quality_184xf_102{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._quality_184xf_102[data-quality=bad]{font-weight:var(--u-weight-medium)}._amount_184xf_90[data-quality=uncertain]{text-decoration:underline dotted;text-underline-offset:.2em}._amount_184xf_90[data-quality=bad]{text-decoration:underline wavy;text-underline-offset:.2em}._worst_184xf_102:before{content:"● "}._worst_184xf_102[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_184xf_102[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_184xf_102[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_184xf_86[data-inner]>._amount_184xf_90{color:var(--u-color-text-secondary)}._line_184xf_86[data-kind=interim] ._label_184xf_90,._line_184xf_86[data-kind=interim]>._amount_184xf_90{font-weight:var(--u-weight-medium)}._line_184xf_86[data-emphasis=strong] ._label_184xf_90,._line_184xf_86[data-emphasis=strong]>._amount_184xf_90{font-weight:var(--u-weight-semibold);color:var(--u-color-text)}._line_184xf_86[data-emphasis=muted] ._label_184xf_90,._line_184xf_86[data-emphasis=muted]>._amount_184xf_90{color:var(--u-color-text-secondary)}._line_184xf_86[data-inner][data-emphasis=muted] ._label_184xf_90,._line_184xf_86[data-inner][data-emphasis=muted]>._amount_184xf_90{color:var(--u-color-text-muted)}._line_184xf_86[data-rule],._derivation_184xf_130 ._line_184xf_86[data-rule]{border-top:1px solid var(--u-color-text-secondary)}._line_184xf_86[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / var(--_calculation-figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_184xf_86[data-closing] ._label_184xf_90{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_184xf_86[data-closing]:before{content:"";grid-row:1;grid-column:3 / var(--_calculation-figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_184xf_86[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_184xf_86[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_184xf_86[data-kind=result] ._label_184xf_90{font-weight:var(--u-weight-semibold)}._line_184xf_86[data-kind=result]>._amount_184xf_90{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_184xf_86[data-kind=result]>._amount_184xf_90:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._line_184xf_86[data-kind=result]>._amount_184xf_90[data-quality=uncertain]{text-decoration-style:dotted}._line_184xf_86[data-kind=result]>._amount_184xf_90[data-quality=bad]{text-decoration-style:wavy}._amount_184xf_90[data-later]{padding-left:var(--u-space-6)}._head_184xf_539{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:end}._headCell_184xf_546{grid-row:1;grid-column:var(--_calculation-column);display:flex;flex-direction:column;align-items:flex-end;padding:var(--_calculation-line-pad) 0 var(--u-space-1);font-size:var(--u-text-xs);font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary);white-space:nowrap}._headUnit_184xf_559{font-family:var(--u-font-mono);font-weight:var(--u-weight-regular)}._notes_184xf_566{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(--_calculation-line-gap));padding:0 var(--u-space-4) var(--_calculation-line-pad) calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5) + var(--_calculation-disclosure-size) + var(--_calculation-disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_184xf_580[data-freshness=stale]{color:var(--u-color-warning)}._freshness_184xf_580[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_184xf_51{grid-template-columns:minmax(0,1fr) 0 auto var(--_calculation-figure-tracks, auto auto) 0}._amount_184xf_90[data-later]{padding-left:var(--u-space-2)}._frame_184xf_24[data-metrics] ._unit_184xf_90:not([data-last]){padding-right:var(--u-space-2)}._headCell_184xf_546[data-unit] ._headLabel_184xf_610,._names_184xf_90{display:none}._labelCell_184xf_90{padding-right:var(--u-space-3)}._assessment_184xf_98:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--_calculation-line-pad) calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5) + var(--_calculation-disclosure-size) + var(--_calculation-disclosure-gap));white-space:normal}._frame_184xf_24[data-compact]:not([data-two-lines]) ._assessment_184xf_98:not(:empty){padding-bottom:var(--_calculation-line-pad)}._frame_184xf_24[data-compact]:not([data-two-lines]) ._assessment_184xf_98:not(:empty)>:not(._target_184xf_102,._worst_184xf_102,._quality_184xf_102){margin-block:0}._notes_184xf_566{grid-row:3;grid-column:1 / -1}}._frame_184xf_24[data-two-lines] ._labelCell_184xf_90{grid-column:1 / -1;padding-bottom:0}._frame_184xf_24[data-two-lines] ._names_184xf_90{display:none}._frame_184xf_24[data-two-lines] ._line_184xf_86>._operator_184xf_90,._frame_184xf_24[data-two-lines] ._line_184xf_86>._amount_184xf_90,._frame_184xf_24[data-two-lines] ._line_184xf_86>._unit_184xf_90{grid-row:2;padding-top:var(--_calculation-line-gap)}._frame_184xf_24[data-two-lines] ._line_184xf_86[data-kind=interim]:before,._frame_184xf_24[data-two-lines] ._line_184xf_86[data-closing]:before{grid-row:2}._frame_184xf_24[data-two-lines] ._assessment_184xf_98:not(:empty){grid-area:3 / 1 / 4 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--_calculation-line-pad) calc(var(--u-space-3) + var(--_calculation-depth, 0) * var(--u-space-5) + var(--_calculation-disclosure-size) + var(--_calculation-disclosure-gap));white-space:normal}._frame_184xf_24[data-two-lines] ._notes_184xf_566{grid-row:4;grid-column:1 / -1}@media(prefers-reduced-motion:reduce){._disclosure_184xf_107 svg{transition:none}._derivation_184xf_130:not([hidden]){animation:none}}@media(forced-colors:active){._line_184xf_86[data-mark]{outline:1px solid Highlight;outline-offset:-1px}._line_184xf_86[data-mark=use]{outline-width:2px;outline-offset:-2px}._derivation_184xf_130:before{background:CanvasText}._line_184xf_86[data-emphasis=muted] ._label_184xf_90,._line_184xf_86[data-emphasis=muted]>._amount_184xf_90{color:GrayText}}}
@@ -1,6 +1,6 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { r } from "./calculation.model-CZuohgrp.js";
3
- import { C as c, D as d, a as p, G as C, I as x, M as D, P, b as v, Q as G, R as I, S as M, T as Q } from "./calculation.model-CZuohgrp.js";
2
+ import { r } from "./calculation.model-BTqFvIHM.js";
3
+ import { C as c, D as d, a as p, G as C, I as x, M as D, P, b as v, Q as G, R as I, S as M, T as Q } from "./calculation.model-BTqFvIHM.js";
4
4
  import { CalculationView as e } from "./calculation.client.js";
5
5
  function u({ children: a, metrics: i, ...s }) {
6
6
  return /* @__PURE__ */ o(e, { model: r(a, i), ...s });
@@ -0,0 +1,176 @@
1
+ import { Children as ae, isValidElement as b, Fragment as se } from "react";
2
+ const d = (o) => Object.defineProperty(() => {
3
+ throw new Error(
4
+ `@umriss-ui/calculation: <${o}> stands only directly inside a <Calculation>. A tree written in a Server Component must be written inside the <Calculation> there, in one file, not passed through a client component.`
5
+ );
6
+ }, "name", { value: o }), re = d("Given"), ce = d("Sum"), ue = d("Difference"), le = d("Product"), fe = d("Quotient"), U = d("Ref"), de = d("Chain"), pe = d("Plus"), me = d("Minus"), he = d("Times"), $e = d("DividedBy"), B = d("Interim"), ye = /* @__PURE__ */ new Map([
7
+ [ce, "sum"],
8
+ [ue, "difference"],
9
+ [le, "product"],
10
+ [fe, "quotient"]
11
+ ]), Y = {
12
+ sum: "Sum",
13
+ difference: "Difference",
14
+ product: "Product",
15
+ quotient: "Quotient"
16
+ }, G = /* @__PURE__ */ new Map([
17
+ [pe, { name: "Plus", operator: "sum" }],
18
+ [me, { name: "Minus", operator: "sum", negated: !0 }],
19
+ [he, { name: "Times", operator: "product" }],
20
+ [$e, { name: "DividedBy", operator: "quotient" }]
21
+ ]), K = "<Given>, <Sum>, <Difference>, <Product>, <Quotient> or <Chain>", z = "a calculation with metrics only adds and subtracts - <Sum>, <Difference>, <Plus>, <Minus>.", ve = ["unit", "format", "decimals"];
22
+ function a(o) {
23
+ throw new Error(`@umriss-ui/calculation: ${o}`);
24
+ }
25
+ function I(o) {
26
+ return ae.toArray(o).flatMap(
27
+ (t) => b(t) && t.type === se ? I(t.props.children) : [t]
28
+ );
29
+ }
30
+ function E(o) {
31
+ if (!b(o)) return JSON.stringify(o);
32
+ const t = o.type;
33
+ return typeof t == "string" ? `<${t}>` : `<${t.displayName ?? t.name ?? "anonymous"}>`;
34
+ }
35
+ const L = (o, t, s) => `${o}/${b(t) && t.key || s}`;
36
+ function we(o, t) {
37
+ const s = I(o);
38
+ if (s.length !== 1 && a(`<Calculation> takes exactly one child, the result; it was given ${s.length}.`), t !== void 0) {
39
+ t.length === 0 && a("<Calculation>: metrics is empty; leave it out for a calculation with one number per quantity.");
40
+ const n = /* @__PURE__ */ new Set();
41
+ for (const { id: i } of t)
42
+ n.has(i) && a(`<Calculation>: the metric id "${i}" is used twice.`), n.add(i);
43
+ }
44
+ const p = t?.map((n) => `"${n.id}"`).join(", "), r = (n, i) => {
45
+ const c = typeof n == "object" && n !== null;
46
+ if (t === void 0) {
47
+ c && a(`${i}: value is an object by metric, but the calculation has no metrics.`);
48
+ return;
49
+ }
50
+ c || a(`${i}: with metrics, value is an object with a number for each metric - ${p}.`);
51
+ for (const { id: e } of t)
52
+ e in n || a(`${i}: value has no number for the metric "${e}"; write null where it is absent. The metrics: ${p}.`);
53
+ for (const e of Object.keys(n))
54
+ t.some((u) => u.id === e) || a(`${i}: value has a number for "${e}", which is no metric. The metrics: ${p}.`);
55
+ }, l = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), O = [], R = (n, i, c) => {
56
+ const { id: e, ...u } = i;
57
+ if (t !== void 0) {
58
+ for (const w of ve)
59
+ i[w] !== void 0 && a(`${c}: ${w} belongs to the metric once the calculation has metrics, not to a quantity.`);
60
+ (i.target !== void 0 || i.limits !== void 0) && a(`${c}: target and limits are not assessed in a calculation with metrics.`);
61
+ }
62
+ e !== void 0 && (v.has(e) && a(`${c}: the id "${e}" is used twice.`), v.set(e, n));
63
+ const y = { ...u, key: n, id: e, operands: [] };
64
+ return l.set(n, y), y;
65
+ }, N = (n, i, c) => {
66
+ if (b(n) && n.type === U) {
67
+ const e = { key: "", reference: !0 };
68
+ return O.push({ operand: e, to: n.props.to, where: c }), e;
69
+ }
70
+ return { key: _(n, i, c), reference: !1 };
71
+ }, _ = (n, i, c) => {
72
+ if ((!b(n) || n.type === U || G.has(n.type) || n.type === B) && a(`${c}: ${E(n)} cannot stand here; a quantity must be ${K}.`), n.type === de) return W(n.props.children, i, c);
73
+ const e = ye.get(n.type);
74
+ n.type !== re && e === void 0 && a(
75
+ `${c}: ${E(n)} is not an element of the calculation. A calculation reads its children's props and cannot look inside a component of your own; write ${K} or <Ref> directly, or return them from .map.`
76
+ );
77
+ const { children: u, value: y, source: w, asOf: T, ages: m, quality: C, ...h } = n.props, q = `${c} › ${h.label}`;
78
+ t !== void 0 && (e === "product" || e === "quotient") && a(`${q}: <${Y[e]}> - ${z}`);
79
+ const $ = R(i, h, q);
80
+ if (e === void 0)
81
+ return r(y, q), $.given = { value: y, source: w, asOf: T, ages: m, quality: C }, i;
82
+ $.operator = e;
83
+ const f = I(u), M = f.length;
84
+ return (e === "quotient" ? M !== 2 : e !== "sum" && M < 2) && a(
85
+ `${q}: <${Y[e]}> takes ${e === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${M}.`
86
+ ), $.operands = f.map((P, A) => N(P, L(i, P, A), q)), i;
87
+ }, W = (n, i, c) => {
88
+ const e = `${c} › <Chain>`, [u, ...y] = I(n);
89
+ (u === void 0 || b(u) && (G.has(u.type) || u.type === B)) && a(`${e}: a chain starts with a quantity that has no operator - ${K} or <Ref>.`);
90
+ let w = N(u, L(i, u, 0), e), T = E(u), m = [], C;
91
+ return y.forEach((h, q) => {
92
+ const $ = L(i, h, q + 1);
93
+ if (b(h) && h.type === B) {
94
+ const g = h.props, D = `${e} › ${g.label}`;
95
+ m.length === 0 && a(`${D}: an <Interim> needs an operand since the named value before it, ${T}.`);
96
+ const Q = R($, g, D);
97
+ Q.interim = !0, Q.operator = m[0].line.operator, Q.operands = [w, ...m.map((ie) => ie.operand)], w = { key: $, reference: !1, previous: !0 }, T = `<Interim label="${g.label}">`, m = [], C = $;
98
+ return;
99
+ }
100
+ const f = b(h) ? G.get(h.type) : void 0;
101
+ f === void 0 && a(`${e}: ${E(h)} needs an operator in a chain - <Plus>, <Minus>, <Times> or <DividedBy> - or is an <Interim>.`), t !== void 0 && f.operator !== "sum" && a(`${e}: <${f.name}> - ${z}`);
102
+ const M = f.operator !== "sum", P = m.find((g) => g.line.operator !== "sum");
103
+ (M && m.length > 0 || P) && a(
104
+ `${e}: <${(P ?? { line: f }).line.name}> stands alone between two named values - directly after the first quantity or an <Interim>, and directly before an <Interim>.`
105
+ );
106
+ const { children: A, ...S } = h.props, x = I(A), V = () => a(`${e}: <${f.name}> takes either a label and a value, or exactly one quantity as its child.`);
107
+ if (x.length > 0) {
108
+ (x.length > 1 || Object.values(S).some((D) => D !== void 0)) && V();
109
+ const g = N(x[0], $, e);
110
+ g.negated = f.negated, m.push({ operand: g, line: f });
111
+ return;
112
+ }
113
+ S.label === void 0 && V();
114
+ const { value: F, source: X, asOf: Z, ages: ee, quality: te, ...ne } = S, J = `${e} › ${S.label}`, oe = R($, { ...ne, label: S.label }, J);
115
+ r(F, J), oe.given = { value: F, source: X, asOf: Z, ages: ee, quality: te }, m.push({ operand: { key: $, reference: !1, negated: f.negated }, line: f });
116
+ }), (m.length > 0 || C === void 0) && a(`${e}: a chain ends with an <Interim>, which names its value.`), C;
117
+ }, j = _(s[0], "0", "<Calculation>"), k = l.get(j);
118
+ (k.emphasis !== void 0 || k.rule !== void 0) && a(`<Calculation> › ${k.label}: emphasis and rule do not stand on the Result, which is already the heaviest line.`);
119
+ for (const { operand: n, to: i, where: c } of O) {
120
+ const e = v.get(i);
121
+ if (e === void 0) {
122
+ const u = [...v.keys()].map((y) => `"${y}"`).join(", ");
123
+ a(`${c}: <Ref to="${i}"> names no quantity. ${u ? `The ids that exist: ${u}.` : "No quantity has an id."}`);
124
+ }
125
+ n.key = e;
126
+ }
127
+ return ge(l), t === void 0 && H(l, j), { result: j, quantities: l, metrics: t };
128
+ }
129
+ function qe(o) {
130
+ return o.metrics ? o.metrics.map((t) => {
131
+ const s = /* @__PURE__ */ new Map();
132
+ for (const [p, r] of o.quantities) {
133
+ const l = r.given && { ...r.given, value: r.given.value[t.id] };
134
+ s.set(p, { ...r, unit: t.unit, decimals: t.decimals, given: l });
135
+ }
136
+ return { result: o.result, quantities: s };
137
+ }) : [o];
138
+ }
139
+ function H(o, t) {
140
+ const s = o.get(t);
141
+ for (const { key: p, reference: r } of s.operands) {
142
+ if (r) continue;
143
+ const l = o.get(p);
144
+ l.decimals === void 0 && l.unit === s.unit && l.format === s.format && (l.decimals = s.decimals), H(o, p);
145
+ }
146
+ }
147
+ function ge(o) {
148
+ const t = /* @__PURE__ */ new Set(), s = [], p = (r) => {
149
+ if (t.has(r)) return;
150
+ const l = s.indexOf(r);
151
+ if (l !== -1) {
152
+ const v = [...s.slice(l), r].map((O) => o.get(O).label);
153
+ a(`the calculation goes round in a circle through references: ${v.join(" → ")}.`);
154
+ }
155
+ s.push(r);
156
+ for (const v of o.get(r).operands) p(v.key);
157
+ s.pop(), t.add(r);
158
+ };
159
+ for (const r of o.keys()) p(r);
160
+ }
161
+ export {
162
+ de as C,
163
+ ue as D,
164
+ re as G,
165
+ B as I,
166
+ me as M,
167
+ pe as P,
168
+ fe as Q,
169
+ U as R,
170
+ ce as S,
171
+ he as T,
172
+ $e as a,
173
+ le as b,
174
+ qe as p,
175
+ we as r
176
+ };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { FreshnessAges } from '@umriss-ui/core';
2
2
  import { HTMLAttributes } from 'react';
3
3
  import { JSX } from 'react';
4
4
  import { Limit } from '@umriss-ui/core';
5
+ import { Quality } from '@umriss-ui/core';
5
6
  import { ReactNode } from 'react';
6
7
  import { RefProp } from '@umriss-ui/core';
7
8
 
@@ -88,6 +89,10 @@ export declare interface GivenProps extends QuantityProps {
88
89
  /** The ages at which `asOf` turns stale and lost. With both, the given
89
90
  carries a freshness through core; with `asOf` alone, only the time. */
90
91
  ages?: FreshnessAges;
92
+ /** How far the source vouches for the number. Carried up to every quantity
93
+ built on this given - the worst of its operands is a quantity's own - and
94
+ shown on their lines; its freshness is not. Absent counts as good. */
95
+ quality?: Quality;
91
96
  }
92
97
 
93
98
  /** Names the value of a chain where it stands. */
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/calculation 0.43.0
1
+ # @umriss-ui/calculation 0.45.0
2
2
 
3
3
  > React calculation view for data-dense applications - a derivation written as it is shown, evaluated by the library, folded and read line by line.
4
4
 
@@ -1556,7 +1556,7 @@ Name the calculation with `aria-label`, which lands on the list; without it a re
1556
1556
 
1557
1557
  | Prop | Type | Default | Description |
1558
1558
  |---|---|---|---|
1559
- | `children` *required* | `ReactNode` | — | The result: exactly one quantity - a tree (`<Sum>`, `<Difference>`, `<Product>`, `<Quotient>` with their operands, `<Given>` as leaves) or a `<Chain>`, the two mixing freely; `<Ref>` for a quantity defined elsewhere.<br>Shown in: [Two numbers and a sum](#calculation), [Write a tree](#calculation), [Write a chain](#calculation) and 50 more |
1559
+ | `children` *required* | `ReactNode` | — | The result: exactly one quantity - a tree (`<Sum>`, `<Difference>`, `<Product>`, `<Quotient>` with their operands, `<Given>` as leaves) or a `<Chain>`, the two mixing freely; `<Ref>` for a quantity defined elsewhere.<br>Shown in: [Two numbers and a sum](#calculation), [Write a tree](#calculation), [Write a chain](#calculation) and 51 more |
1560
1560
  | `metrics` | `readonly `[`Metric`](#metrics)`[]` | — | Several numbers per quantity, side by side - headcount and full-time equivalents of the same teams ([ADR-0038](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0038-a-calculation-can-carry-several-metrics.md)). Every `value` is then an object with a number for each metric id; unit and places are the metric's. A calculation with metrics only adds and subtracts, and assesses no target or limits.<br>Shown in: [Rows of both signs with metrics (Rows from data)](#rows-from-data), [Headcount and full-time equivalents (Metrics)](#metrics), [A number one metric does not have (Metrics)](#metrics) and 5 more |
1561
1561
  | `density` | `"regular" \| "compact"` | the density of the `UmrissProvider`, else `"regular"` | `"compact"` sets the lines as close as a compact table's rows: smaller type and less room above and below, under a finger still tall enough to tap. Columns, folding and wording stay as they are.<br>Shown in: [Density](#calculation), [A dense staff report (Metrics)](#metrics) |
1562
1562
  | `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`. |
@@ -1568,7 +1568,7 @@ Also takes every attribute of `<div>` – without `children`.
1568
1568
  - No result, formula text or operator of your own: a written-out operation the library did not perform could say something the number does not ([ADR-0027](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0027-a-calculation-is-written-as-it-is-shown.md)).
1569
1569
  - No input: a calculation shows how a figure came about; changing a given is your application's form.
1570
1570
 
1571
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
1571
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
1572
1572
 
1573
1573
  ### Tree
1574
1574
 
@@ -1785,12 +1785,12 @@ The keys of [Calculation](#calculation) apply here.
1785
1785
 
1786
1786
  | Prop | Type | Default | Description |
1787
1787
  |---|---|---|---|
1788
- | `children` | `ReactNode` | — | The operands, in order: quantities, givens and references.<br>Shown in: [Show a share against a target](#tree), [Take several amounts away](#tree), [Multiply quantities with units](#tree) and 42 more |
1789
- | `label` *required* | `string` | — | What the quantity is called. It stands on its line, wherever it is an operand, and in the accessible sentence. From `QuantityProps`.<br>Shown in: [Show a share against a target](#tree), [Take several amounts away](#tree), [Multiply quantities with units](#tree) and 50 more |
1788
+ | `children` | `ReactNode` | — | The operands, in order: quantities, givens and references.<br>Shown in: [Show a share against a target](#tree), [Take several amounts away](#tree), [Multiply quantities with units](#tree) and 43 more |
1789
+ | `label` *required* | `string` | — | What the quantity is called. It stands on its line, wherever it is an operand, and in the accessible sentence. From `QuantityProps`.<br>Shown in: [Show a share against a target](#tree), [Take several amounts away](#tree), [Multiply quantities with units](#tree) and 51 more |
1790
1790
  | `id` | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`.<br>Shown in: [Use a quantity twice](#tree), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 10 more |
1791
- | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`.<br>Shown in: [Show a share against a target](#tree), [Take several amounts away](#tree), [Multiply quantities with units](#tree) and 42 more |
1791
+ | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`.<br>Shown in: [Show a share against a target](#tree), [Take several amounts away](#tree), [Multiply quantities with units](#tree) and 43 more |
1792
1792
  | `format` | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`.<br>Shown in: [Show a share against a target](#tree), [Use a quantity twice](#tree), [Build operands from data](#tree) and 17 more |
1793
- | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`.<br>Shown in: [Multiply quantities with units](#tree), [Build operands from data](#tree), [Hold a figure to its limits](#tree) and 29 more |
1793
+ | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`.<br>Shown in: [Multiply quantities with units](#tree), [Build operands from data](#tree), [Hold a figure to its limits](#tree) and 30 more |
1794
1794
  | `target` | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`.<br>Shown in: [Show a share against a target](#tree), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 6 more |
1795
1795
  | `limits` | `readonly ``Limit``[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`.<br>Shown in: [Hold a figure to its limits](#tree), [Density (Calculation)](#calculation), [Hold an interim to its limits (Chain)](#chain) and 5 more |
1796
1796
  | `explanation` | `string` | — | A sentence of plain text beside the line: why the quantity is here, or what it means. From `QuantityProps`.<br>Shown in: [Say where a number came from (Given)](#given), [A number one metric does not have (Metrics)](#metrics), [Staff movement as a chain (Metrics)](#metrics) and 2 more |
@@ -1849,7 +1849,7 @@ type Severity = "warning" | "alarm";
1849
1849
  - Four operators and nothing else – no powers, roots or functions; compute those before and hand them in as givens.
1850
1850
  - A unit is a label and is never converted or checked; the calculation does no unit algebra.
1851
1851
 
1852
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
1852
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
1853
1853
 
1854
1854
  ### Chain
1855
1855
 
@@ -2098,13 +2098,14 @@ The keys of [Calculation](#calculation) apply here.
2098
2098
  | `label` | `string` | — | The operand's name, where the line is a given written in place. Left out where the line holds a quantity as its child.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 17 more |
2099
2099
  | `value` | `number \| null \| ``MetricValues` | — | The operand's number, where the line is a given written in place. Absent as for a `Given`: the line and every interim after it are absent, with the reason. With `metrics`, an object by metric id, as on a `Given`.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 17 more |
2100
2100
  | `children` | `ReactNode` | — | Instead of `label` and `value`: exactly one quantity - a tree, a `<Ref>` or a `<Chain>`.<br>Shown in: [Fold a group of lines into one](#chain), [Write a chain (Calculation)](#calculation), [Emphasis inside a group (Calculation)](#calculation) and 12 more |
2101
- | `source` | `string` | — | Where the number came from: a system, a report, a person. From `GivenProps`.<br>Shown in: [Say where a number came from (Given)](#given), [State when a number was true (Given)](#given), [Staff movement as a chain (Metrics)](#metrics) and 8 more |
2101
+ | `source` | `string` | — | Where the number came from: a system, a report, a person. From `GivenProps`.<br>Shown in: [Say where a number came from (Given)](#given), [State when a number was true (Given)](#given), [Say how far the source vouches for a number (Given)](#given) and 9 more |
2102
2102
  | `asOf` | `Date \| number` | — | When the number was true - not when it was fetched. From `GivenProps`.<br>Shown in: [Say where a number came from (Given)](#given), [State when a number was true (Given)](#given), [The cost per stop of a day's tours (Worked examples)](#worked-examples) |
2103
2103
  | `ages` | `FreshnessAges` | — | The ages at which `asOf` turns stale and lost. With both, the given carries a freshness through core; with `asOf` alone, only the time. From `GivenProps`.<br>Shown in: [Say where a number came from (Given)](#given), [The cost per stop of a day's tours (Worked examples)](#worked-examples) |
2104
+ | `quality` | `Quality`<br>`"good" \| "uncertain" \| "bad"` | — | How far the source vouches for the number. Carried up to every quantity built on this given - the worst of its operands is a quantity's own - and shown on their lines; its freshness is not. Absent counts as good. From `GivenProps`.<br>Shown in: [Say how far the source vouches for a number (Given)](#given) |
2104
2105
  | `id` | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`.<br>Shown in: [Fold a group of lines into one](#chain), [Put a chain inside a tree](#chain), [The availability of a service (Installation)](#installation) and 10 more |
2105
- | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 42 more |
2106
+ | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 43 more |
2106
2107
  | `format` | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`.<br>Shown in: [Fold a group of lines into one](#chain), [Put a chain inside a tree](#chain), [Hold an interim to its limits](#chain) and 17 more |
2107
- | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 29 more |
2108
+ | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 30 more |
2108
2109
  | `target` | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`.<br>Shown in: [Put a chain inside a tree](#chain), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 6 more |
2109
2110
  | `limits` | `readonly ``Limit``[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`.<br>Shown in: [Hold an interim to its limits](#chain), [Density (Calculation)](#calculation), [Hold a figure to its limits (Tree)](#tree) and 5 more |
2110
2111
  | `explanation` | `string` | — | A sentence of plain text beside the line: why the quantity is here, or what it means. From `QuantityProps`.<br>Shown in: [Say where a number came from (Given)](#given), [A number one metric does not have (Metrics)](#metrics), [Staff movement as a chain (Metrics)](#metrics) and 2 more |
@@ -2116,11 +2117,11 @@ The keys of [Calculation](#calculation) apply here.
2116
2117
 
2117
2118
  | Prop | Type | Default | Description |
2118
2119
  |---|---|---|---|
2119
- | `label` *required* | `string` | — | What the quantity is called. It stands on its line, wherever it is an operand, and in the accessible sentence.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 50 more |
2120
+ | `label` *required* | `string` | — | What the quantity is called. It stands on its line, wherever it is an operand, and in the accessible sentence.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 51 more |
2120
2121
  | `id` | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once.<br>Shown in: [Fold a group of lines into one](#chain), [Put a chain inside a tree](#chain), [The availability of a service (Installation)](#installation) and 10 more |
2121
- | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 42 more |
2122
+ | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 43 more |
2122
2123
  | `format` | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation.<br>Shown in: [Fold a group of lines into one](#chain), [Put a chain inside a tree](#chain), [Hold an interim to its limits](#chain) and 17 more |
2123
- | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 29 more |
2124
+ | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own.<br>Shown in: [Take amounts away from a first quantity](#chain), [Mix additions and deductions](#chain), [Multiply between two interims](#chain) and 30 more |
2124
2125
  | `target` | `number` | — | The value this quantity is meant to reach - missed, never violated.<br>Shown in: [Put a chain inside a tree](#chain), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 6 more |
2125
2126
  | `limits` | `readonly ``Limit``[]` | — | Bounds the quantity is assessed against, through core's `assess()`.<br>Shown in: [Hold an interim to its limits](#chain), [Density (Calculation)](#calculation), [Hold a figure to its limits (Tree)](#tree) and 5 more |
2126
2127
  | `explanation` | `string` | — | A sentence of plain text beside the line: why the quantity is here, or what it means.<br>Shown in: [Say where a number came from (Given)](#given), [A number one metric does not have (Metrics)](#metrics), [Staff movement as a chain (Metrics)](#metrics) and 2 more |
@@ -2155,6 +2156,17 @@ harder statement still wins - the middle state simply falls away.
2155
2156
  | `stale` *required* | `number` | — | From this age on the value counts as stale, but keeps its verdict. |
2156
2157
  | `lost` *required* | `number` | — | From this age on the connection counts as disconnected. |
2157
2158
 
2159
+ ###### `Quality`
2160
+
2161
+ From `@umriss-ui/core`.
2162
+
2163
+ How far a value's source vouches for it - independently of how the value is judged and how old it is.
2164
+ The levels are the severities of an OPC UA status code; mapping a code (or another protocol's quality) to a level is the application's.
2165
+
2166
+ ```ts
2167
+ type Quality = "good" | "uncertain" | "bad";
2168
+ ```
2169
+
2158
2170
  ###### `Limit`
2159
2171
 
2160
2172
  From `@umriss-ui/core`.
@@ -2197,7 +2209,7 @@ type Severity = "warning" | "alarm";
2197
2209
 
2198
2210
  - A chain in view does not fold; as an operand of a tree it folds to its last interim.
2199
2211
 
2200
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
2212
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
2201
2213
 
2202
2214
  ### Rows from data
2203
2215
 
@@ -2637,7 +2649,7 @@ From `Metric` — the full table stands on [Metrics](#metrics).
2637
2649
 
2638
2650
  - Only a sum takes any count: an empty product, a difference of one and a quotient of anything but two still fail on the first render.
2639
2651
 
2640
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
2652
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
2641
2653
 
2642
2654
  ### Given
2643
2655
 
@@ -2649,6 +2661,8 @@ import { Given } from "@umriss-ui/calculation";
2649
2661
 
2650
2662
  A given with `asOf` and `ages` carries a freshness through core, as a `Stat` does – beside the number, never instead of its verdict. There are no default ages.
2651
2663
 
2664
+ `quality` (`good`, `uncertain`, `bad`) says how far the source vouches for the number. It is carried up: every line built on the given shows the worst quality of its operands. The freshness is not.
2665
+
2652
2666
  The operator words, the reasons for absence and the number formats are core's wording; German comes from `@umriss-ui/core/wording/de` ([ADR-0019](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0019-two-wordings-ship-english-is-the-default.md)).
2653
2667
 
2654
2668
  #### Examples
@@ -2732,6 +2746,28 @@ export default function InGerman() {
2732
2746
  }
2733
2747
  ```
2734
2748
 
2749
+ ##### Say how far the source vouches for a number
2750
+
2751
+ `quality` marks a given whose source doubts it. Every line built on it carries the worst quality of its operands, so the result says it too - and a folded line shows it without being opened.
2752
+
2753
+ ```tsx
2754
+ import { Calculation, Given, Product, Sum } from "@umriss-ui/calculation";
2755
+
2756
+ export default function HowFarTheSourceVouches() {
2757
+ return (
2758
+ <Calculation aria-label="Heat used, boiler house, week 12">
2759
+ <Sum label="Heat used" unit="kWh" decimals={0}>
2760
+ <Product label="Boiler 1" unit="kWh" decimals={0}>
2761
+ <Given label="Flow" value={38.5} unit="m³" quality="uncertain" source="Heat meter 1, due for calibration" />
2762
+ <Given label="Energy per m³" value={11.6} unit="kWh/m³" decimals={1} />
2763
+ </Product>
2764
+ <Given label="Boiler 2" value={402} unit="kWh" source="Heat meter 2" />
2765
+ </Sum>
2766
+ </Calculation>
2767
+ );
2768
+ }
2769
+ ```
2770
+
2735
2771
  #### Keyboard
2736
2772
 
2737
2773
  The keys of [Calculation](#calculation) apply here.
@@ -2742,15 +2778,16 @@ The keys of [Calculation](#calculation) apply here.
2742
2778
 
2743
2779
  | Prop | Type | Default | Description |
2744
2780
  |---|---|---|---|
2745
- | `value` *required* | `number \| null \| undefined \| ``MetricValues` | — | The number the calculation starts from. Absent (`null`, `undefined`, not finite) makes every quantity that depends on it absent, with the reason - never zero. Where the calculation has `metrics`, an object with a number for each metric id instead; absence then stays in its metric.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 50 more |
2746
- | `source` | `string` | — | Where the number came from: a system, a report, a person.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Staff movement as a chain (Metrics)](#metrics) and 8 more |
2781
+ | `value` *required* | `number \| null \| undefined \| ``MetricValues` | — | The number the calculation starts from. Absent (`null`, `undefined`, not finite) makes every quantity that depends on it absent, with the reason - never zero. Where the calculation has `metrics`, an object with a number for each metric id instead; absence then stays in its metric.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 51 more |
2782
+ | `source` | `string` | — | Where the number came from: a system, a report, a person.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Say how far the source vouches for a number](#given) and 9 more |
2747
2783
  | `asOf` | `Date \| number` | — | When the number was true - not when it was fetched.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [The cost per stop of a day's tours (Worked examples)](#worked-examples) |
2748
2784
  | `ages` | `FreshnessAges` | — | The ages at which `asOf` turns stale and lost. With both, the given carries a freshness through core; with `asOf` alone, only the time.<br>Shown in: [Say where a number came from](#given), [The cost per stop of a day's tours (Worked examples)](#worked-examples) |
2749
- | `label` *required* | `string` | — | What the quantity is called. It stands on its line, wherever it is an operand, and in the accessible sentence. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 50 more |
2785
+ | `quality` | `Quality`<br>`"good" \| "uncertain" \| "bad"` | — | How far the source vouches for the number. Carried up to every quantity built on this given - the worst of its operands is a quantity's own - and shown on their lines; its freshness is not. Absent counts as good.<br>Shown in: [Say how far the source vouches for a number](#given) |
2786
+ | `label` *required* | `string` | — | What the quantity is called. It stands on its line, wherever it is an operand, and in the accessible sentence. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 51 more |
2750
2787
  | `id` | `string` | — | Makes the quantity referable: `<Ref to>` stands for it elsewhere. Needed only for a quantity used more than once. From `QuantityProps`.<br>Shown in: [Read in German](#given), [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation) and 10 more |
2751
- | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 42 more |
2788
+ | `unit` | `string` | — | A label written after the number - "min", "pcs", "€". Never converted and never checked; the calculation does no unit algebra. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 43 more |
2752
2789
  | `format` | `"percent"` | — | `percent` presents a plain ratio as per cent: 0.916 is shown as 91.6 %. The quantity stays a ratio in every operation. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [Read in German](#given), [The availability of a service (Installation)](#installation) and 17 more |
2753
- | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 29 more |
2790
+ | `decimals` | `number` | one digit for a percentage, at most two for a derived number, a given as it was given | Fixed number of fraction digits as shown. Rounding happens only in presentation; every operation uses the full value. The places carry down to operands of the same `unit` and `format` that set none of their own. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [State when a number was true](#given), [Read in German](#given) and 30 more |
2754
2791
  | `target` | `number` | — | The value this quantity is meant to reach - missed, never violated. From `QuantityProps`.<br>Shown in: [The availability of a service (Installation)](#installation), [Write a tree (Calculation)](#calculation), [Density (Calculation)](#calculation) and 6 more |
2755
2792
  | `limits` | `readonly ``Limit``[]` | — | Bounds the quantity is assessed against, through core's `assess()`. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [Density (Calculation)](#calculation), [Hold a figure to its limits (Tree)](#tree) and 5 more |
2756
2793
  | `explanation` | `string` | — | A sentence of plain text beside the line: why the quantity is here, or what it means. From `QuantityProps`.<br>Shown in: [Say where a number came from](#given), [A number one metric does not have (Metrics)](#metrics), [Staff movement as a chain (Metrics)](#metrics) and 2 more |
@@ -2785,6 +2822,17 @@ harder statement still wins - the middle state simply falls away.
2785
2822
  | `stale` *required* | `number` | — | From this age on the value counts as stale, but keeps its verdict. |
2786
2823
  | `lost` *required* | `number` | — | From this age on the connection counts as disconnected. |
2787
2824
 
2825
+ ###### `Quality`
2826
+
2827
+ From `@umriss-ui/core`.
2828
+
2829
+ How far a value's source vouches for it - independently of how the value is judged and how old it is.
2830
+ The levels are the severities of an OPC UA status code; mapping a code (or another protocol's quality) to a level is the application's.
2831
+
2832
+ ```ts
2833
+ type Quality = "good" | "uncertain" | "bad";
2834
+ ```
2835
+
2788
2836
  ###### `Limit`
2789
2837
 
2790
2838
  From `@umriss-ui/core`.
@@ -3323,7 +3371,7 @@ The keys of [Calculation](#calculation) apply here.
3323
3371
  - Unit, format and places belong to the metric; on a quantity they fail on the first render, and so does a missing or unknown metric key in a `value`.
3324
3372
  - No target or limits with metrics: an assessment per cell is not there yet.
3325
3373
 
3326
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.43.0/docs/adr/0032-what-umriss-is-not.md).
3374
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/calculation-v0.45.0/docs/adr/0032-what-umriss-is-not.md).
3327
3375
 
3328
3376
  ## In practice
3329
3377
 
@@ -4164,7 +4212,7 @@ included. The sum of none is zero, and its line says it has no entries.
4164
4212
  const Sum: (props: OperatorProps) => null;
4165
4213
  ```
4166
4214
 
4167
- Used on [Scenarios](#scenarios), [Calculation](#calculation), [Tree](#tree), [Chain](#chain), [Rows from data](#rows-from-data), [Metrics](#metrics), [What can go wrong](#what-can-go-wrong) and [Worked examples](#worked-examples).
4215
+ Used on [Scenarios](#scenarios), [Calculation](#calculation), [Tree](#tree), [Chain](#chain), [Rows from data](#rows-from-data), [Given](#given), [Metrics](#metrics), [What can go wrong](#what-can-go-wrong) and [Worked examples](#worked-examples).
4168
4216
 
4169
4217
  ##### `Times`
4170
4218
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/calculation",
3
- "version": "0.43.0",
3
+ "version": "0.45.0",
4
4
  "description": "React calculation view for data-dense applications - 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",
@@ -56,7 +56,7 @@
56
56
  }
57
57
  },
58
58
  "peerDependencies": {
59
- "@umriss-ui/core": "^0.43.0",
59
+ "@umriss-ui/core": "^0.45.0",
60
60
  "react": ">=19",
61
61
  "react-dom": ">=19"
62
62
  },
@@ -72,7 +72,7 @@
72
72
  "typescript": "^5.6.3",
73
73
  "vite": "^6.0.0",
74
74
  "vite-plugin-dts": "^4.3.0",
75
- "@umriss-ui/core": "0.43.0",
75
+ "@umriss-ui/core": "0.45.0",
76
76
  "@umriss-ui/demo": "0.0.0"
77
77
  },
78
78
  "scripts": {