@opsinjs/react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +21 -0
- package/README.md +114 -2
- package/dist/components/accordion.d.ts +82 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +154 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-banner.d.ts +291 -0
- package/dist/components/alert-banner.d.ts.map +1 -0
- package/dist/components/alert-banner.js +529 -0
- package/dist/components/alert-banner.js.map +1 -0
- package/dist/components/avatar.d.ts +45 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +159 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +78 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +32 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/body-map.d.ts +51 -0
- package/dist/components/body-map.d.ts.map +1 -0
- package/dist/components/body-map.js +190 -0
- package/dist/components/body-map.js.map +1 -0
- package/dist/components/button.d.ts +260 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +609 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/callout.d.ts +99 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +285 -0
- package/dist/components/callout.js.map +1 -0
- package/dist/components/card.d.ts +156 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +396 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/care-card.d.ts +182 -0
- package/dist/components/care-card.d.ts.map +1 -0
- package/dist/components/care-card.js +544 -0
- package/dist/components/care-card.js.map +1 -0
- package/dist/components/checkbox.d.ts +58 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +167 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/combobox.d.ts +71 -0
- package/dist/components/combobox.d.ts.map +1 -0
- package/dist/components/combobox.js +204 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/consent-sheet.d.ts +186 -0
- package/dist/components/consent-sheet.d.ts.map +1 -0
- package/dist/components/consent-sheet.js +452 -0
- package/dist/components/consent-sheet.js.map +1 -0
- package/dist/components/dialog.d.ts +108 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +573 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/disclaimer-note.d.ts +144 -0
- package/dist/components/disclaimer-note.d.ts.map +1 -0
- package/dist/components/disclaimer-note.js +486 -0
- package/dist/components/disclaimer-note.js.map +1 -0
- package/dist/components/divider.d.ts +76 -0
- package/dist/components/divider.d.ts.map +1 -0
- package/dist/components/divider.js +101 -0
- package/dist/components/divider.js.map +1 -0
- package/dist/components/dose-tracker.d.ts +137 -0
- package/dist/components/dose-tracker.d.ts.map +1 -0
- package/dist/components/dose-tracker.js +154 -0
- package/dist/components/dose-tracker.js.map +1 -0
- package/dist/components/empty-state.d.ts +171 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +387 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/field.d.ts +195 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +282 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/goal-ring.d.ts +114 -0
- package/dist/components/goal-ring.d.ts.map +1 -0
- package/dist/components/goal-ring.js +254 -0
- package/dist/components/goal-ring.js.map +1 -0
- package/dist/components/icon-button.d.ts +124 -0
- package/dist/components/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button.js +113 -0
- package/dist/components/icon-button.js.map +1 -0
- package/dist/components/link.d.ts +122 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/link.js +164 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/log-sheet.d.ts +259 -0
- package/dist/components/log-sheet.d.ts.map +1 -0
- package/dist/components/log-sheet.js +437 -0
- package/dist/components/log-sheet.js.map +1 -0
- package/dist/components/menu.d.ts +69 -0
- package/dist/components/menu.d.ts.map +1 -0
- package/dist/components/menu.js +190 -0
- package/dist/components/menu.js.map +1 -0
- package/dist/components/metric-tile.d.ts +301 -0
- package/dist/components/metric-tile.d.ts.map +1 -0
- package/dist/components/metric-tile.js +533 -0
- package/dist/components/metric-tile.js.map +1 -0
- package/dist/components/number-field.d.ts +62 -0
- package/dist/components/number-field.d.ts.map +1 -0
- package/dist/components/number-field.js +134 -0
- package/dist/components/number-field.js.map +1 -0
- package/dist/components/popover.d.ts +70 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +174 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +83 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +140 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/questionnaire.d.ts +123 -0
- package/dist/components/questionnaire.d.ts.map +1 -0
- package/dist/components/questionnaire.js +148 -0
- package/dist/components/questionnaire.js.map +1 -0
- package/dist/components/radio-group.d.ts +66 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +186 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/range-bar.d.ts +172 -0
- package/dist/components/range-bar.d.ts.map +1 -0
- package/dist/components/range-bar.js +578 -0
- package/dist/components/range-bar.js.map +1 -0
- package/dist/components/range-legend.d.ts +97 -0
- package/dist/components/range-legend.d.ts.map +1 -0
- package/dist/components/range-legend.js +166 -0
- package/dist/components/range-legend.js.map +1 -0
- package/dist/components/reading-input.d.ts +225 -0
- package/dist/components/reading-input.d.ts.map +1 -0
- package/dist/components/reading-input.js +651 -0
- package/dist/components/reading-input.js.map +1 -0
- package/dist/components/relative-time.d.ts +177 -0
- package/dist/components/relative-time.d.ts.map +1 -0
- package/dist/components/relative-time.js +603 -0
- package/dist/components/relative-time.js.map +1 -0
- package/dist/components/result-card.d.ts +319 -0
- package/dist/components/result-card.d.ts.map +1 -0
- package/dist/components/result-card.js +614 -0
- package/dist/components/result-card.js.map +1 -0
- package/dist/components/scale-input.d.ts +58 -0
- package/dist/components/scale-input.d.ts.map +1 -0
- package/dist/components/scale-input.js +170 -0
- package/dist/components/scale-input.js.map +1 -0
- package/dist/components/score-dial.d.ts +205 -0
- package/dist/components/score-dial.d.ts.map +1 -0
- package/dist/components/score-dial.js +728 -0
- package/dist/components/score-dial.js.map +1 -0
- package/dist/components/scroll-area.d.ts +38 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +138 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/segmented-control.d.ts +69 -0
- package/dist/components/segmented-control.d.ts.map +1 -0
- package/dist/components/segmented-control.js +259 -0
- package/dist/components/segmented-control.js.map +1 -0
- package/dist/components/select.d.ts +72 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +205 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/sheet.d.ts +192 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +952 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/skeleton.d.ts +104 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +266 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +55 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +170 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/source-citation.d.ts +127 -0
- package/dist/components/source-citation.d.ts.map +1 -0
- package/dist/components/source-citation.js +391 -0
- package/dist/components/source-citation.js.map +1 -0
- package/dist/components/spinner.d.ts +86 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +97 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/status-pill.d.ts +90 -0
- package/dist/components/status-pill.d.ts.map +1 -0
- package/dist/components/status-pill.js +259 -0
- package/dist/components/status-pill.js.map +1 -0
- package/dist/components/stepper.d.ts +99 -0
- package/dist/components/stepper.d.ts.map +1 -0
- package/dist/components/stepper.js +152 -0
- package/dist/components/stepper.js.map +1 -0
- package/dist/components/surface.d.ts +92 -0
- package/dist/components/surface.d.ts.map +1 -0
- package/dist/components/surface.js +261 -0
- package/dist/components/surface.js.map +1 -0
- package/dist/components/switch.d.ts +48 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +152 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/symptom-picker.d.ts +69 -0
- package/dist/components/symptom-picker.d.ts.map +1 -0
- package/dist/components/symptom-picker.js +170 -0
- package/dist/components/symptom-picker.js.map +1 -0
- package/dist/components/tab-bar.d.ts +110 -0
- package/dist/components/tab-bar.d.ts.map +1 -0
- package/dist/components/tab-bar.js +118 -0
- package/dist/components/tab-bar.js.map +1 -0
- package/dist/components/table.d.ts +117 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +65 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +106 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +136 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/term.d.ts +243 -0
- package/dist/components/term.d.ts.map +1 -0
- package/dist/components/term.js +562 -0
- package/dist/components/term.js.map +1 -0
- package/dist/components/textarea.d.ts +157 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +66 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/timeline-entry.d.ts +99 -0
- package/dist/components/timeline-entry.d.ts.map +1 -0
- package/dist/components/timeline-entry.js +47 -0
- package/dist/components/timeline-entry.js.map +1 -0
- package/dist/components/toast.d.ts +80 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +266 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/tooltip.d.ts +48 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +159 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/trend-sparkline.d.ts +188 -0
- package/dist/components/trend-sparkline.d.ts.map +1 -0
- package/dist/components/trend-sparkline.js +796 -0
- package/dist/components/trend-sparkline.js.map +1 -0
- package/dist/components/value.d.ts +150 -0
- package/dist/components/value.d.ts.map +1 -0
- package/dist/components/value.js +402 -0
- package/dist/components/value.js.map +1 -0
- package/dist/components/visually-hidden.d.ts +61 -0
- package/dist/components/visually-hidden.d.ts.map +1 -0
- package/dist/components/visually-hidden.js +172 -0
- package/dist/components/visually-hidden.js.map +1 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -0
- package/dist/opsinjs.d.ts +443 -0
- package/dist/opsinjs.d.ts.map +1 -0
- package/dist/opsinjs.js +906 -0
- package/dist/opsinjs.js.map +1 -0
- package/dist/status.d.ts +111 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +125 -0
- package/dist/status.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +82 -0
- package/dist/utils.js.map +1 -0
- package/package.json +86 -3
- package/styles/base.css +132 -0
- package/styles/roles.css +412 -0
- package/styles/standalone.css +20 -0
- package/styles/tailwind.css +18 -0
- package/styles/theme.css +309 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trend-sparkline.js","sourceRoot":"","sources":["../../src/components/trend-sparkline.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,QAAQ,GAIT,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAA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AAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAI,iBAAY,GAAG,EAChG,KAAC,UAAU,IAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,GAAI,SACtD,CACJ,EAGA,KAAK,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CACpD,8BACG,GAAG,EACH,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,iBAAa,aAAa,IACjD,CACJ,CAAC,CAAC,CAAC,CACF,eAAe,CAChB,EAGA,YAAY,EAGZ,CAAC,YAAY,IAAI,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CACjE,oDAAqB,aAAa,mBAAe,UAAU,SAAK,CACjE,CAAC,CAAC,CAAC,CACF,8BACG,GAAG,qBACY,UAAU,UAAM,aAAa,0BAAsB,WAAW,SAC7E,CACJ,IACC,IACA,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Value is one number, its unit, and nothing else.
|
|
3
|
+
*
|
|
4
|
+
* The smallest component in the system and the one with the widest blast
|
|
5
|
+
* radius. Every number a reader sees passes through it, so a formatting
|
|
6
|
+
* decision made here is made everywhere. So is a formatting bug.
|
|
7
|
+
*
|
|
8
|
+
* WHAT IT ASSERTS, and it is a short list on purpose: that this quantity has
|
|
9
|
+
* this magnitude in this unit, to this many decimal places. It carries no
|
|
10
|
+
* status, no colour, no band and no judgement. There is no `status` prop, no
|
|
11
|
+
* `color` prop and no `variant` prop, and adding one would put the two colour
|
|
12
|
+
* axes into the smallest and most-repeated element in the system, where nobody
|
|
13
|
+
* could police them. A number that has to look different because of what it is
|
|
14
|
+
* worth belongs inside a component that owns that verdict.
|
|
15
|
+
*
|
|
16
|
+
* THE ONE THING IT DOES THAT NOTHING ELSE DOES is put the unit into the
|
|
17
|
+
* accessibility tree in words. `mmHg` has no pronunciation; a screen reader
|
|
18
|
+
* handed it improvises, and "one twenty over eighty em em aitch gee" is a
|
|
19
|
+
* failure rather than a quirk. The spoken forms live in `tokens/units.json` and
|
|
20
|
+
* reach this file through the generated table in `../opsinjs.ts`, so a unit is
|
|
21
|
+
* spoken the same way in every component that renders one.
|
|
22
|
+
*
|
|
23
|
+
* PRECISION MEANS DECIMAL PLACES, everywhere in opsinjs, and this file is
|
|
24
|
+
* where that was settled. Significant figures are the alternative reading,
|
|
25
|
+
* and they make the same metric show a different number of decimal places at
|
|
26
|
+
* different magnitudes, which is exactly what `health/numbers-units-precision`
|
|
27
|
+
* rule 2 forbids: "the same metric is shown to the same number of decimal
|
|
28
|
+
* places every time, so a reader can compare two readings at a glance".
|
|
29
|
+
* Decimal places are also what an instrument's resolution actually is: a scale
|
|
30
|
+
* reads to 100 g whatever is standing on it, light or heavy.
|
|
31
|
+
*
|
|
32
|
+
* PRECISION IS REQUIRED, AND IT HAS NO DEFAULT TO FALL BACK ON. `precision`
|
|
33
|
+
* travels with the MEASUREMENT, from the product, so `ValueProps` declares it
|
|
34
|
+
* `precision: number` and a TypeScript caller cannot omit it. The omission is a
|
|
35
|
+
* compile error rather than a runtime guess, which is where the doctrine's "no
|
|
36
|
+
* default float rendering anywhere" belongs. The unit table deliberately
|
|
37
|
+
* carries no default either, because one unit serves many metrics and a
|
|
38
|
+
* per-unit default would be wrong for one of them on every screen. Glucose and
|
|
39
|
+
* cholesterol are both reported in mmol/L and do not share a number of decimal
|
|
40
|
+
* places. This file ships as source into JavaScript projects where a required
|
|
41
|
+
* prop is advice rather than a guarantee, so a caller who omits it there still
|
|
42
|
+
* reaches the runtime path below: this component rounds nothing and pads
|
|
43
|
+
* nothing, the digits it was handed are the digits it shows, and it warns. That
|
|
44
|
+
* is louder than a guess, and it is meant to be.
|
|
45
|
+
*
|
|
46
|
+
* NOTHING HERE ANIMATES. Not on first paint, not on a change. A number that
|
|
47
|
+
* counts up has displayed, for every frame of the count, a figure that is not
|
|
48
|
+
* true.
|
|
49
|
+
*/
|
|
50
|
+
export interface ValueProps {
|
|
51
|
+
/**
|
|
52
|
+
* The reading. `null` renders the absence form and is never rendered as 0:
|
|
53
|
+
* zero is a real measurement for several metrics, and a missing one is not a
|
|
54
|
+
* measurement at all.
|
|
55
|
+
*/
|
|
56
|
+
value: number | null;
|
|
57
|
+
/**
|
|
58
|
+
* Display symbol, exactly as `tokens/units.json` spells it, such as "kg",
|
|
59
|
+
* "mmol/L" or "°C". The spoken form is resolved from that table, so this is
|
|
60
|
+
* the only place a unit is named. A symbol the table does not hold is
|
|
61
|
+
* rendered as written rather than pronounced by guesswork.
|
|
62
|
+
*
|
|
63
|
+
* Three states, and they are distinct on purpose. `undefined` means nobody
|
|
64
|
+
* said, which is the ambiguity OPSIN-0003 fires about: the same digits are one
|
|
65
|
+
* reading in mmol/L and a very different one in mg/dL. `null` means this
|
|
66
|
+
* number has no unit by design, which a composite score, a count already named
|
|
67
|
+
* by its label, or a ratio all are, and it renders the digits alone and warns
|
|
68
|
+
* about nothing. A string is the symbol.
|
|
69
|
+
*/
|
|
70
|
+
unit?: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Where the unit is shown. The default is `symbol`, which prints the symbol
|
|
73
|
+
* beside the number and speaks the words in the accessibility tree, the form
|
|
74
|
+
* every reading has always taken.
|
|
75
|
+
*
|
|
76
|
+
* `spoken` keeps the unit in the accessibility tree and takes it off the
|
|
77
|
+
* screen, for the one case where the visible sentence already prints the unit
|
|
78
|
+
* once for a pair of readings, as "10 to 20 mg/dL" does. A screen reader still
|
|
79
|
+
* hears "10 milligrams per decilitre" so no reading is spoken bare. It is
|
|
80
|
+
* never a way to render a number with no unit at all, which is what OPSIN-0003
|
|
81
|
+
* exists to prevent, so it is meaningless without `unit` and reports itself
|
|
82
|
+
* when it is asked for with none.
|
|
83
|
+
*/
|
|
84
|
+
unitDisplay?: "symbol" | "spoken";
|
|
85
|
+
/**
|
|
86
|
+
* Decimal places, from the precision of the MEASUREMENT, which is the
|
|
87
|
+
* resolution of the device, or the number of places the laboratory reported.
|
|
88
|
+
* Never chosen at render time to make a column line up. A whole number from 0
|
|
89
|
+
* to 20.
|
|
90
|
+
*
|
|
91
|
+
* Required, and required rather than defaulted on purpose. There is no
|
|
92
|
+
* per-unit default to fall back on: precision is a property of the metric and
|
|
93
|
+
* not of the unit, and two metrics reported in the same unit do not share one,
|
|
94
|
+
* so the honest place for the number is the caller's, and the honest place for
|
|
95
|
+
* the omission is a compile error. A TypeScript caller that forgets it does
|
|
96
|
+
* not ship a raw double to a reader; it fails to build.
|
|
97
|
+
*
|
|
98
|
+
* The type is a guarantee only where TypeScript is enforced. This file ships
|
|
99
|
+
* as source into JavaScript projects, where a required prop is advice, so a
|
|
100
|
+
* caller who omits it there prints the digits the double happened to hold. The
|
|
101
|
+
* component then rounds nothing and pads nothing and warns in development,
|
|
102
|
+
* naming the unit and the count of unasked-for digits. The warning is the
|
|
103
|
+
* honest signal, because there is no number this file could supply in place of
|
|
104
|
+
* the one nobody stated.
|
|
105
|
+
*/
|
|
106
|
+
precision: number;
|
|
107
|
+
/**
|
|
108
|
+
* BCP 47 locale for separators and digit shaping. Distinct from `unit`:
|
|
109
|
+
* locale decides how a number is written, unit systems decide which number.
|
|
110
|
+
* Omitted on the client, the reader's own environment decides. Under server
|
|
111
|
+
* rendering there is no reader's environment, so the server process's own
|
|
112
|
+
* default formats the first paint. A de-DE reader then sees "1,000.2" before
|
|
113
|
+
* hydration and "1.000,2" after it, with a React text mismatch in between,
|
|
114
|
+
* and rule 10 of `health/numbers-units-precision` is about exactly that
|
|
115
|
+
* confusion of separators being a hundredfold error. On any surface that
|
|
116
|
+
* renders on a server, pass `locale` explicitly, from the request or from the
|
|
117
|
+
* reader's stored setting. A tag `Intl` cannot parse,
|
|
118
|
+
* such as "en_GB" with an underscore, is reported in development and ignored,
|
|
119
|
+
* and the runtime's default formats the number, because a malformed setting
|
|
120
|
+
* must not take a screen down.
|
|
121
|
+
*/
|
|
122
|
+
locale?: string;
|
|
123
|
+
/**
|
|
124
|
+
* What the absence form says when there is no reading. The default is "no
|
|
125
|
+
* reading yet". It is not used for a number that arrived broken, which is a
|
|
126
|
+
* different thing and says so in different words.
|
|
127
|
+
*
|
|
128
|
+
* An empty string falls back to the default and reports itself. The absence
|
|
129
|
+
* form is words and nothing else, so an empty label would leave an empty
|
|
130
|
+
* element where a reader expects to be told something.
|
|
131
|
+
*/
|
|
132
|
+
absenceLabel?: string;
|
|
133
|
+
/** Visual weight. Never changes the value, the precision or the unit. */
|
|
134
|
+
size?: "inherit" | "display";
|
|
135
|
+
/**
|
|
136
|
+
* Merged onto the root with `tailwind-merge`, and a class you pass WINS over
|
|
137
|
+
* the component's own where the two conflict. `cn("inline tabular-nums", …,
|
|
138
|
+
* className)` puts yours last and `twMerge` keeps the later of a conflicting
|
|
139
|
+
* pair. That was verified: `twMerge("inline tabular-nums", "block truncate")`
|
|
140
|
+
* returns `"tabular-nums block truncate"`.
|
|
141
|
+
*
|
|
142
|
+
* That includes `truncate` and any fixed height. This component never shortens
|
|
143
|
+
* a number on its own and sets no ellipsis and no height; passing a class that
|
|
144
|
+
* does is the one way to make a reading come back to somebody with digits
|
|
145
|
+
* missing off the end.
|
|
146
|
+
*/
|
|
147
|
+
className?: string;
|
|
148
|
+
}
|
|
149
|
+
export declare function Value({ value, unit, unitDisplay, precision: declaredPrecision, locale, absenceLabel, size, className, }: ValueProps): import("react").JSX.Element;
|
|
150
|
+
//# sourceMappingURL=value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../src/components/value.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAgKH,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IACjC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,yEAAyE;IACzE,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC5B;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,IAAI,EACJ,WAAsB,EACtB,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EACN,YAAY,EACZ,IAAgB,EAChB,SAAS,GACV,EAAE,UAAU,+BAmYZ"}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Value is one number, its unit, and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* The smallest component in the system and the one with the widest blast
|
|
6
|
+
* radius. Every number a reader sees passes through it, so a formatting
|
|
7
|
+
* decision made here is made everywhere. So is a formatting bug.
|
|
8
|
+
*
|
|
9
|
+
* WHAT IT ASSERTS, and it is a short list on purpose: that this quantity has
|
|
10
|
+
* this magnitude in this unit, to this many decimal places. It carries no
|
|
11
|
+
* status, no colour, no band and no judgement. There is no `status` prop, no
|
|
12
|
+
* `color` prop and no `variant` prop, and adding one would put the two colour
|
|
13
|
+
* axes into the smallest and most-repeated element in the system, where nobody
|
|
14
|
+
* could police them. A number that has to look different because of what it is
|
|
15
|
+
* worth belongs inside a component that owns that verdict.
|
|
16
|
+
*
|
|
17
|
+
* THE ONE THING IT DOES THAT NOTHING ELSE DOES is put the unit into the
|
|
18
|
+
* accessibility tree in words. `mmHg` has no pronunciation; a screen reader
|
|
19
|
+
* handed it improvises, and "one twenty over eighty em em aitch gee" is a
|
|
20
|
+
* failure rather than a quirk. The spoken forms live in `tokens/units.json` and
|
|
21
|
+
* reach this file through the generated table in `../opsinjs.ts`, so a unit is
|
|
22
|
+
* spoken the same way in every component that renders one.
|
|
23
|
+
*
|
|
24
|
+
* PRECISION MEANS DECIMAL PLACES, everywhere in opsinjs, and this file is
|
|
25
|
+
* where that was settled. Significant figures are the alternative reading,
|
|
26
|
+
* and they make the same metric show a different number of decimal places at
|
|
27
|
+
* different magnitudes, which is exactly what `health/numbers-units-precision`
|
|
28
|
+
* rule 2 forbids: "the same metric is shown to the same number of decimal
|
|
29
|
+
* places every time, so a reader can compare two readings at a glance".
|
|
30
|
+
* Decimal places are also what an instrument's resolution actually is: a scale
|
|
31
|
+
* reads to 100 g whatever is standing on it, light or heavy.
|
|
32
|
+
*
|
|
33
|
+
* PRECISION IS REQUIRED, AND IT HAS NO DEFAULT TO FALL BACK ON. `precision`
|
|
34
|
+
* travels with the MEASUREMENT, from the product, so `ValueProps` declares it
|
|
35
|
+
* `precision: number` and a TypeScript caller cannot omit it. The omission is a
|
|
36
|
+
* compile error rather than a runtime guess, which is where the doctrine's "no
|
|
37
|
+
* default float rendering anywhere" belongs. The unit table deliberately
|
|
38
|
+
* carries no default either, because one unit serves many metrics and a
|
|
39
|
+
* per-unit default would be wrong for one of them on every screen. Glucose and
|
|
40
|
+
* cholesterol are both reported in mmol/L and do not share a number of decimal
|
|
41
|
+
* places. This file ships as source into JavaScript projects where a required
|
|
42
|
+
* prop is advice rather than a guarantee, so a caller who omits it there still
|
|
43
|
+
* reaches the runtime path below: this component rounds nothing and pads
|
|
44
|
+
* nothing, the digits it was handed are the digits it shows, and it warns. That
|
|
45
|
+
* is louder than a guess, and it is meant to be.
|
|
46
|
+
*
|
|
47
|
+
* NOTHING HERE ANIMATES. Not on first paint, not on a change. A number that
|
|
48
|
+
* counts up has displayed, for every frame of the count, a figure that is not
|
|
49
|
+
* true.
|
|
50
|
+
*/
|
|
51
|
+
import { findUnit, isDevelopment, spokenUnit, warnOnce, } from "../opsinjs.js";
|
|
52
|
+
import { cn } from "../utils.js";
|
|
53
|
+
/**
|
|
54
|
+
* The ceiling `Intl.NumberFormat` accepts for fraction digits.
|
|
55
|
+
*
|
|
56
|
+
* Used as `maximumFractionDigits` when no `precision` was supplied, which is
|
|
57
|
+
* how "show the digits you were handed" is expressed to a formatter whose own
|
|
58
|
+
* default is to round silently at three. Rounding a reader's measurement
|
|
59
|
+
* because nobody said how precise it was is the failure this constant exists
|
|
60
|
+
* to prevent.
|
|
61
|
+
*/
|
|
62
|
+
const MAX_FRACTION_DIGITS = 20;
|
|
63
|
+
/**
|
|
64
|
+
* Which development warnings this session has already printed.
|
|
65
|
+
*
|
|
66
|
+
* Declared rather than created, the way `warnOnce` does it in the substrate: in
|
|
67
|
+
* a production bundle `isDevelopment()` is statically false, every body that
|
|
68
|
+
* touches this is dead code, and the set is never allocated. In development it
|
|
69
|
+
* exists for the session, which is what "once" means. A column of thirty
|
|
70
|
+
* readings with no `precision` prints one warning rather than thirty.
|
|
71
|
+
*
|
|
72
|
+
* It is not `warnOnce` itself because none of the seven complaints below has an
|
|
73
|
+
* OPSIN code. That table is generated from `tokens/errors.json` and allocating
|
|
74
|
+
* a code in it is not this component's to do; the omission is reported upward
|
|
75
|
+
* instead. The channel and the wording are the same either way. The one
|
|
76
|
+
* complaint that does have a code is OPSIN-0003, which fires for a reading
|
|
77
|
+
* with no unit, and it goes through `warnOnce` rather than through here.
|
|
78
|
+
*
|
|
79
|
+
* EVERY KEY NAMES THE MISTAKE, NEVER THE READING. That is exactly the
|
|
80
|
+
* identity/payload split `warnOnce` makes, and for the same reason: keying on
|
|
81
|
+
* the value turns "warn once" into "warn every render", because the next tile
|
|
82
|
+
* in the column carries a different number and the same defect. So the
|
|
83
|
+
* unstated-precision key is the unit and the count of unasked-for digits, the
|
|
84
|
+
* unknown-unit key is the unit as written, the out-of-range-precision key is
|
|
85
|
+
* the precision as written, and the empty-`absenceLabel` key is a constant,
|
|
86
|
+
* that complaint having only one shape. The spoken-without-unit key is a
|
|
87
|
+
* constant for the same reason, that complaint too having only one shape. The
|
|
88
|
+
* malformed-locale key is the tag as
|
|
89
|
+
* written, which is the mistake, and it cannot grow with the data because a
|
|
90
|
+
* product has one wrong setting rather than one per reading. The broken-value
|
|
91
|
+
* key is the only one that carries the value, and it can: a value reaches that
|
|
92
|
+
* branch only when it is not finite, so the key ranges over NaN and the two
|
|
93
|
+
* infinities and cannot grow with the data.
|
|
94
|
+
*
|
|
95
|
+
* Every one of these lives in a render body, so without the set they print on
|
|
96
|
+
* every render and twice again under Strict Mode. A console an author filters
|
|
97
|
+
* is a channel that no longer carries its one real finding.
|
|
98
|
+
*/
|
|
99
|
+
let warnedDev;
|
|
100
|
+
function warnDevOnce(key, message) {
|
|
101
|
+
if (warnedDev?.has(key) === true)
|
|
102
|
+
return;
|
|
103
|
+
warnedDev ??= new Set();
|
|
104
|
+
warnedDev.add(key);
|
|
105
|
+
console.warn(message);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The caller's language tag, or `undefined` where it is not a language tag.
|
|
109
|
+
*
|
|
110
|
+
* `Intl` throws a `RangeError` on a malformed tag, and it throws it during
|
|
111
|
+
* render. A component that takes a screen down because a locale arrived as
|
|
112
|
+
* `"en_GB"` from a settings table has turned a cosmetic defect into an outage,
|
|
113
|
+
* so the tag is checked once and the runtime's own default is used instead.
|
|
114
|
+
* That is the same argument the `precision` range guard below makes, applied to
|
|
115
|
+
* the other prop that can be written wrong.
|
|
116
|
+
*/
|
|
117
|
+
function usableLocale(locale) {
|
|
118
|
+
if (locale === undefined)
|
|
119
|
+
return undefined;
|
|
120
|
+
try {
|
|
121
|
+
Intl.getCanonicalLocales(locale);
|
|
122
|
+
return locale;
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
if (isDevelopment()) {
|
|
126
|
+
warnDevOnce(`malformed-locale:${locale}`, `[opsinjs] <Value> received locale="${locale}", which is not a BCP 47 ` +
|
|
127
|
+
"language tag, so the number was formatted with the runtime's default " +
|
|
128
|
+
'instead. A tag looks like "en-GB", with a hyphen.');
|
|
129
|
+
}
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Whether the spoken form in the unit table is a language this reader's voice
|
|
135
|
+
* will say correctly.
|
|
136
|
+
*
|
|
137
|
+
* `tokens/units.json` holds British English and nothing else. Substituting
|
|
138
|
+
* "kilograms" for "kg" helps an English reader and hurts a Spanish one, whose
|
|
139
|
+
* voice pronounces an English word with Spanish phonetics while the symbol it
|
|
140
|
+
* could have spelled has been hidden. So the substitution happens only where
|
|
141
|
+
* the words are in the reader's language. An absent `locale` keeps the
|
|
142
|
+
* substitution, because "the reader's environment decides" is not a reason to
|
|
143
|
+
* drop the one thing this component does that nothing else does.
|
|
144
|
+
*
|
|
145
|
+
* The language subtag is taken by splitting on the first hyphen rather than
|
|
146
|
+
* through `Intl.Locale`, which would add an ES2020 lib requirement to a file
|
|
147
|
+
* that ships as source into projects this repository does not control. The tag
|
|
148
|
+
* has already been through `usableLocale`, so it parses.
|
|
149
|
+
*/
|
|
150
|
+
function speaksEnglish(locale) {
|
|
151
|
+
if (locale === undefined)
|
|
152
|
+
return true;
|
|
153
|
+
return locale.split("-")[0].toLowerCase() === "en";
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Visual weight, and only visual weight.
|
|
157
|
+
*
|
|
158
|
+
* Written out rather than built from the prop, because Tailwind reads class
|
|
159
|
+
* names out of source as literal strings: `text-opsin-${size}` generates no CSS
|
|
160
|
+
* at all and the number renders unstyled.
|
|
161
|
+
*
|
|
162
|
+
* `inherit` adds nothing. The value takes the size, weight and family of the
|
|
163
|
+
* sentence it sits in, which is what an inline reading should do. `display`
|
|
164
|
+
* is the hero treatment, and it is the only place the numeric family is asked
|
|
165
|
+
* for by name: a number set apart from running text is its own typographic
|
|
166
|
+
* object, while a number inside a sentence that changed family mid-line would
|
|
167
|
+
* read as a mistake.
|
|
168
|
+
*
|
|
169
|
+
* AN ABSENCE IS NEVER DRAWN AT THE WEIGHT OF A READING. When there is no
|
|
170
|
+
* reading and `size` is `display`, the root drops the hero treatment and takes
|
|
171
|
+
* `text-opsin-headline` in the muted role instead, so "no reading yet" is never
|
|
172
|
+
* the largest and boldest text on a surface. `foundations/data-states` exists
|
|
173
|
+
* so that a statement of not knowing is never drawn as an ordinary reading, and
|
|
174
|
+
* an absence set at the same size and weight as a hero number is drawn as the
|
|
175
|
+
* loudest reading on the screen, which is the opposite of what it is. This
|
|
176
|
+
* matches ScoreDial, whose band name sits at the headline step when there is no
|
|
177
|
+
* band to show. The `inherit` size is left as it is: an inline absence inside
|
|
178
|
+
* running prose already takes the surrounding colour, and forcing it muted
|
|
179
|
+
* would fade it below the sentence it sits in.
|
|
180
|
+
*/
|
|
181
|
+
const ROOT_SIZE = {
|
|
182
|
+
inherit: "",
|
|
183
|
+
display: "font-opsin-numeric text-opsin-title1",
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* The unit's own type treatment, one step down from the number at `display`.
|
|
187
|
+
*
|
|
188
|
+
* The unit is the annotation and the magnitude is the message, so the symbol
|
|
189
|
+
* is smaller and a little lighter rather than competing with the digits for
|
|
190
|
+
* the reader's eye. The weights are 700 against 800 since ADR 0028 set the
|
|
191
|
+
* title steps heavier, so the gap between them is unchanged.
|
|
192
|
+
*/
|
|
193
|
+
const UNIT_SIZE = {
|
|
194
|
+
inherit: "",
|
|
195
|
+
display: "text-opsin-title3",
|
|
196
|
+
};
|
|
197
|
+
export function Value({ value, unit, unitDisplay = "symbol", precision: declaredPrecision, locale, absenceLabel, size = "inherit", className, }) {
|
|
198
|
+
/* `precision` is required on `ValueProps`, so a TypeScript caller cannot omit
|
|
199
|
+
it and cannot reach the unstated-precision path below. It is re-widened to
|
|
200
|
+
`number | undefined` here for the one caller the type cannot reach: this
|
|
201
|
+
file ships as source into JavaScript projects, where a required prop is
|
|
202
|
+
advice rather than a guarantee, and a JS caller who omits it lands on
|
|
203
|
+
`undefined`. Every guard below reads this local and keeps working
|
|
204
|
+
unaltered, which is why the `precision === undefined` test that follows is
|
|
205
|
+
live code rather than a branch the compiler has proved dead. */
|
|
206
|
+
const precision = declaredPrecision;
|
|
207
|
+
/* THE THREE STATES, and keeping them three is the whole of the null handling.
|
|
208
|
+
`0 steps` is a measurement. "No reading yet" is an absence. "Not available"
|
|
209
|
+
is a failure. `health/numbers-units-precision` rule 13 names all three and
|
|
210
|
+
says never to collapse them, and collapsing the last two is the tempting
|
|
211
|
+
one: a reader told "no reading yet" about a number that DID exist and
|
|
212
|
+
arrived broken has been told something untrue about their own record. */
|
|
213
|
+
const broken = value !== null && !Number.isFinite(value);
|
|
214
|
+
/* Narrowed to a real reading, so nothing below has to assert its way past
|
|
215
|
+
the type. A value outside the finite range can only have come from a
|
|
216
|
+
caller's pipeline, and this file ships as source into JavaScript projects
|
|
217
|
+
where `number | null` is advice rather than a guarantee. A parse that
|
|
218
|
+
produced nothing and a division with no divisor are two of the ways such a
|
|
219
|
+
value arrives. Rendering the literal text "NaN" beside somebody's own
|
|
220
|
+
measurements is not an option, and neither is quietly calling it an
|
|
221
|
+
absence. */
|
|
222
|
+
const reading = value === null || broken ? null : value;
|
|
223
|
+
if (broken && isDevelopment()) {
|
|
224
|
+
warnDevOnce(`broken:${String(value)}`, `[opsinjs] <Value> received ${String(value)}, which is not a finite number. ` +
|
|
225
|
+
'The words "not available" were rendered in its place, because a broken ' +
|
|
226
|
+
"number is a failure rather than a reading that was never taken, and the " +
|
|
227
|
+
"reader is entitled to know which of the two happened. Check where the " +
|
|
228
|
+
"value is produced.");
|
|
229
|
+
}
|
|
230
|
+
/* OPSIN-0003. The same digits are one reading in mmol/L and a very different
|
|
231
|
+
one in mg/dL, and nothing on the surface tells the reader which was meant.
|
|
232
|
+
It fires only for `undefined`, which is a unit nobody supplied. A `null`
|
|
233
|
+
unit is a caller saying this number has no unit by design, and a deliberate
|
|
234
|
+
absence is not the mistake this warning exists to catch. */
|
|
235
|
+
if (reading !== null && unit === undefined) {
|
|
236
|
+
warnOnce("OPSIN-0003", { value: String(reading) });
|
|
237
|
+
}
|
|
238
|
+
/* One lookup, read by the unknown-unit warning here and the separator below.
|
|
239
|
+
A unit the table has never heard of returns `undefined` and so keeps its
|
|
240
|
+
no-break space, which is the right default for something nobody declared. */
|
|
241
|
+
const unitRow = unit == null ? undefined : findUnit(unit);
|
|
242
|
+
if (unit != null && unitRow === undefined && isDevelopment()) {
|
|
243
|
+
warnDevOnce(`unknown-unit:${unit}`, `[opsinjs] <Value> was given the unit "${unit}", which is not in the unit ` +
|
|
244
|
+
"table. It has been rendered as written and has NOT been given a spoken " +
|
|
245
|
+
'form, because guessing at a pronunciation is how "mmHg" becomes "em em ' +
|
|
246
|
+
'aitch gee". Add the unit to tokens/units.json with its symbol, its ' +
|
|
247
|
+
"spoken form and its plural, then run `pnpm run generate`.");
|
|
248
|
+
}
|
|
249
|
+
/* `unitDisplay="spoken"` asks for the unit to be heard and not seen, which is
|
|
250
|
+
only meaningful when there is a unit to hear. Asked for with no unit it is a
|
|
251
|
+
caller mistake, so it is reported and carried on with rather than thrown,
|
|
252
|
+
the same rule this file follows everywhere else. */
|
|
253
|
+
if (unitDisplay === "spoken" && unit == null && isDevelopment()) {
|
|
254
|
+
warnDevOnce("spoken-without-unit", '[opsinjs] <Value> received unitDisplay="spoken" with no unit to speak. The ' +
|
|
255
|
+
"prop takes a unit off the screen and keeps it in the accessibility tree, " +
|
|
256
|
+
"so it needs a unit to move. It was ignored. Pass the unit, or drop the " +
|
|
257
|
+
"prop for a number that has no unit by design.");
|
|
258
|
+
}
|
|
259
|
+
/* `Intl.NumberFormat` throws a RangeError outside 0 to 100, and a component
|
|
260
|
+
that takes a health product down over a documentation-quality mistake is a
|
|
261
|
+
worse defect than the mistake. Reported and ignored, which leaves the
|
|
262
|
+
honest fallback: the digits as supplied. */
|
|
263
|
+
const usable = precision === undefined ||
|
|
264
|
+
(Number.isInteger(precision) && precision >= 0 && precision <= MAX_FRACTION_DIGITS);
|
|
265
|
+
if (!usable && isDevelopment()) {
|
|
266
|
+
warnDevOnce(`precision-range:${String(precision)}`, `[opsinjs] <Value> received precision={${String(precision)}}. Precision is a ` +
|
|
267
|
+
`count of decimal places: a whole number from 0 to ${MAX_FRACTION_DIGITS}. ` +
|
|
268
|
+
"It was ignored, so the number below is showing exactly the digits it was " +
|
|
269
|
+
"handed rather than a precision nobody asked for.");
|
|
270
|
+
}
|
|
271
|
+
const places = usable ? precision : undefined;
|
|
272
|
+
/* An empty `absenceLabel` is the only way this component can be made to
|
|
273
|
+
render nothing at all where an absence belongs, and `numbers-units-
|
|
274
|
+
precision` rule 13 requires an absence to be said in words. Falling back to
|
|
275
|
+
the default wording is the honest repair: a blank slot is
|
|
276
|
+
indistinguishable from a component that failed to render. */
|
|
277
|
+
const emptyLabel = absenceLabel !== undefined && absenceLabel.trim() === "";
|
|
278
|
+
if (emptyLabel && isDevelopment()) {
|
|
279
|
+
warnDevOnce("empty-absence-label", '[opsinjs] <Value> received absenceLabel="", which would leave the absence ' +
|
|
280
|
+
"slot empty. The default wording was used instead. An absence is said in " +
|
|
281
|
+
"words, and a blank is indistinguishable from a component that rendered " +
|
|
282
|
+
"nothing.");
|
|
283
|
+
}
|
|
284
|
+
const absenceWords = absenceLabel !== undefined && !emptyLabel ? absenceLabel : "no reading yet";
|
|
285
|
+
/* The locale is validated once, here, and the validated tag is what both the
|
|
286
|
+
formatter and the spoken-form gate read below. A raw `en_GB` from a
|
|
287
|
+
settings table is not a BCP 47 tag: it splits on the underscore rather than
|
|
288
|
+
a hyphen, so a language check run against it would decide an English
|
|
289
|
+
product does not speak English and would silently take the spoken unit off.
|
|
290
|
+
`usableLocale` reports the malformed tag and returns `undefined`, which is
|
|
291
|
+
the runtime default for the formatter and, for the language gate, the same
|
|
292
|
+
"the reader's environment decides" that keeps the spoken form. */
|
|
293
|
+
const tag = usableLocale(locale);
|
|
294
|
+
/* Rounding is `halfExpand`, which rounds half away from zero and is
|
|
295
|
+
`numbers-units-precision` rule 3. It is INHERITED rather than named, and
|
|
296
|
+
that is a portability decision rather than a preference: `roundingMode` is
|
|
297
|
+
an ES2023 addition to `Intl.NumberFormatOptions`, so writing it out made
|
|
298
|
+
this file fail to typecheck in any consumer whose `lib` stops at ES2022.
|
|
299
|
+
That was found by installing it into one. `halfExpand` is this formatter's
|
|
300
|
+
own default, so the behaviour is identical and only the documentation
|
|
301
|
+
moved, which is where it now is. Rounded ONCE, here, at the point of
|
|
302
|
+
display. It is never rounded before a comparison, and never over an
|
|
303
|
+
already-rounded value.
|
|
304
|
+
|
|
305
|
+
With no `places`, `maximumFractionDigits` is opened all the way rather than
|
|
306
|
+
left at the formatter's default of three, which would round a reader's
|
|
307
|
+
measurement because nobody had said how precise it was. */
|
|
308
|
+
const formatter = new Intl.NumberFormat(tag, {
|
|
309
|
+
minimumFractionDigits: places,
|
|
310
|
+
maximumFractionDigits: places ?? MAX_FRACTION_DIGITS,
|
|
311
|
+
});
|
|
312
|
+
const formatted = reading === null ? "" : formatter.format(reading);
|
|
313
|
+
/* THE SILENT CASE, MADE AUDIBLE. Opening `maximumFractionDigits` all the way
|
|
314
|
+
is right for a measurement whose resolution nobody stated, and it stops
|
|
315
|
+
being right the moment the number arrived from arithmetic rather than from
|
|
316
|
+
an instrument: every IEEE-754 double holds `0.1 + 0.2` as
|
|
317
|
+
0.30000000000000004, and seventeen digits printed beside somebody's own
|
|
318
|
+
readings assert an accuracy no device has. The specification calls the long
|
|
319
|
+
float "a visible prompt to go and find out what the measurement's
|
|
320
|
+
resolution actually is", and a prompt nobody is told about is not one.
|
|
321
|
+
|
|
322
|
+
The test is exact rather than a guess at how many digits are too many: ask
|
|
323
|
+
the formatter whether it is about to print a fraction the caller never
|
|
324
|
+
asked for. `formatToParts` rather than a regular expression on the string,
|
|
325
|
+
because `\d` matches only ASCII and a locale with its own digit shapes
|
|
326
|
+
would come back empty. The plural rule below avoids the same trap.
|
|
327
|
+
|
|
328
|
+
Development only, and it stays a warning. `precision` is required at the
|
|
329
|
+
type level, so a TypeScript caller never reaches here; this branch serves a
|
|
330
|
+
JavaScript caller who omitted it, for whom the required type was advice. No
|
|
331
|
+
default is invented for that caller either: precision belongs to the metric
|
|
332
|
+
rather than to the unit, so there is no honest number for this file to fall
|
|
333
|
+
back on. */
|
|
334
|
+
if (places === undefined && reading !== null && isDevelopment()) {
|
|
335
|
+
const fraction = formatter
|
|
336
|
+
.formatToParts(reading)
|
|
337
|
+
.find((part) => part.type === "fraction");
|
|
338
|
+
const key = `${unit ?? ""}:${String(fraction?.value.length ?? 0)}`;
|
|
339
|
+
if (fraction !== undefined) {
|
|
340
|
+
warnDevOnce(`precision-unstated:${key}`, `[opsinjs] <Value> is showing ${String(fraction.value.length)} decimal ` +
|
|
341
|
+
`places and was given no \`precision\` to show them to: "${formatted}". ` +
|
|
342
|
+
"With no precision this component rounds nothing and pads nothing, so " +
|
|
343
|
+
"the digits are whatever the double happened to hold rather than what " +
|
|
344
|
+
"anybody measured. Pass the precision the measurement was reported " +
|
|
345
|
+
"to. That is the resolution of the device, or the number of places " +
|
|
346
|
+
"the laboratory gave. There is deliberately no default to fall back " +
|
|
347
|
+
"on: precision is a property of the metric and not of the unit, so " +
|
|
348
|
+
"nothing here can supply one for you.");
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/* THE PLURAL FOLLOWS WHAT IS ON THE SCREEN, and it is decided by asking the
|
|
352
|
+
same formatter what one looks like rather than by inspecting the number or
|
|
353
|
+
the string. Parsing the digits back out would be wrong twice over: `\d`
|
|
354
|
+
matches only ASCII, so a locale with its own digit shapes would come back
|
|
355
|
+
empty, and a locale that groups with a full stop would come back as a
|
|
356
|
+
different number entirely. Comparing against `format(1)` is exact in every
|
|
357
|
+
locale, and it also settles the "1.0" case. A reading shown to one decimal
|
|
358
|
+
place matches `format(1)`, which is "1.0", and is spoken in the singular.
|
|
359
|
+
|
|
360
|
+
THE WORDS ARE ENGLISH, and they are now offered only to an English reader.
|
|
361
|
+
The table holds British English and nothing else, so a non-English locale
|
|
362
|
+
leaves the symbol audible rather than hearing an English word pronounced
|
|
363
|
+
with its own phonetics. */
|
|
364
|
+
const singular = reading !== null && (formatted === formatter.format(1) || formatted === formatter.format(-1));
|
|
365
|
+
const spoken = reading === null || unit == null || !speaksEnglish(tag)
|
|
366
|
+
? undefined
|
|
367
|
+
: spokenUnit(unit, singular ? 1 : reading);
|
|
368
|
+
/* An absence at the hero size comes down to the headline step in the muted
|
|
369
|
+
role, so a surface with no reading does not shout louder than one with a
|
|
370
|
+
steady reading. See the note on ROOT_SIZE. Everything else keeps the size
|
|
371
|
+
it asked for, including an inline absence, which inherits the surrounding
|
|
372
|
+
colour and must not be dimmed below the sentence it sits in.
|
|
373
|
+
|
|
374
|
+
The muted colour is written as `[color:var(--muted-foreground)]` and not as
|
|
375
|
+
`text-muted-foreground`, because this class is merged through `cn`, which is
|
|
376
|
+
`twMerge`, and `text-muted-foreground` and `text-opsin-headline` land in one
|
|
377
|
+
`text-*` conflict group where the later one deletes the earlier. Spelled as
|
|
378
|
+
an arbitrary property the colour is its own group and the headline step
|
|
379
|
+
survives. `button.tsx` and `disclaimer-note.tsx` spell an ink this way for
|
|
380
|
+
the same reason. */
|
|
381
|
+
const rootSizeClass = reading === null && size === "display"
|
|
382
|
+
? "text-opsin-headline [color:var(--muted-foreground)]"
|
|
383
|
+
: ROOT_SIZE[size];
|
|
384
|
+
return (_jsx("span", { "data-slot": "value", "data-opsinjs-value": reading === null ? "" : String(reading), className: cn(
|
|
385
|
+
/* `tabular-nums` is set here as well as by the theme, and the
|
|
386
|
+
duplication is deliberate: `[data-opsinjs-value]` is a rule in
|
|
387
|
+
@opsinjs/react/base.css, which is opt-in. Without this class a Value
|
|
388
|
+
in somebody else's app that leaves that stylesheet out would
|
|
389
|
+
re-kern every time a digit changed, and a reading that shifts sideways
|
|
390
|
+
as it updates is a reading that looks like it is moving. */
|
|
391
|
+
"inline tabular-nums", rootSizeClass, className), children: reading === null ? (_jsx("span", { "data-slot": "value-absence", children: broken ? "not available" : absenceWords })) : (_jsxs(_Fragment, { children: [_jsx("span", { "data-slot": "value-number", children: formatted }), unit == null ? null : (_jsxs(_Fragment, { children: [unitDisplay === "spoken" ? null : (_jsxs("span", { "data-slot": "value-unit", "aria-hidden": spoken === undefined ? undefined : "true",
|
|
392
|
+
/* `undefined` rather than an empty string, so an inline value
|
|
393
|
+
does not ship a `class=""` attribute on every unit in the
|
|
394
|
+
product. */
|
|
395
|
+
className: UNIT_SIZE[size] || undefined, children: [unitRow?.joined === true ? null : "\u00A0", unit] })), spoken === undefined ? null : (_jsxs("span", { "data-slot": "value-spoken", className: "sr-only select-none",
|
|
396
|
+
/* The words are English whatever the surrounding page is set
|
|
397
|
+
to, and `lang` describes the content rather than the reader,
|
|
398
|
+
so a screen reader switches to an English voice for them.
|
|
399
|
+
Correct unconditionally, including when `locale` is absent. */
|
|
400
|
+
lang: "en", children: [" ", spoken] }))] }))] })) }));
|
|
401
|
+
}
|
|
402
|
+
//# sourceMappingURL=value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value.js","sourceRoot":"","sources":["../../src/components/value.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,QAAQ,GACT,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC;;;;;;;;GAQG;AACH,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,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