@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,578 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Circle, CircleDot, Diamond, Octagon } from "lucide-react";
|
|
3
|
+
import { CLINICAL_STATUS_META, HEALTH_CATEGORIES, isClinicalStatus, isDevelopment, isHealthCategory, warnOnce } from "../opsinjs.js";
|
|
4
|
+
import { cn } from "../utils.js";
|
|
5
|
+
import { StatusPill } from "./status-pill.js";
|
|
6
|
+
import { Value } from "./value.js";
|
|
7
|
+
/**
|
|
8
|
+
* The glyph for each level, and the second copy of this map in the system.
|
|
9
|
+
*
|
|
10
|
+
* `CLINICAL_STATUS_META[level].icon` is the source of truth for WHICH lucide
|
|
11
|
+
* icon a level uses; a bundler cannot resolve that name at runtime without
|
|
12
|
+
* pulling the whole icon set into the bundle, so the binding from name to
|
|
13
|
+
* component has to be written out. Typing it `Record<ClinicalStatus, …>` makes
|
|
14
|
+
* a missing level a compile error, and the assertion below is what catches this
|
|
15
|
+
* copy drifting away from `../status.ts`.
|
|
16
|
+
*
|
|
17
|
+
* THIS MAP NO LONGER FEEDS A GLYPH THIS FILE DRAWS. The level beside the label
|
|
18
|
+
* is now a StatusPill, so one capsule carries the word, the glyph and the
|
|
19
|
+
* colour, and a reader learns to scan for a single shape wherever a level
|
|
20
|
+
* appears in the system. The status word still lives outside the summary, where
|
|
21
|
+
* a caller who replaces the sentence cannot take it away, because the pill sits
|
|
22
|
+
* in the label row rather than inside the sentence. What remains here is the
|
|
23
|
+
* development-only drift guard below, kept in step with the copy StatusPill runs
|
|
24
|
+
* on itself, and the vocabulary is read from `CLINICAL_STATUS_META` so the two
|
|
25
|
+
* can never say different words for one level.
|
|
26
|
+
*/
|
|
27
|
+
const ICONS = {
|
|
28
|
+
steady: Circle,
|
|
29
|
+
watch: CircleDot,
|
|
30
|
+
attention: Diamond,
|
|
31
|
+
urgent: Octagon,
|
|
32
|
+
};
|
|
33
|
+
/* Development-only. If somebody changes an icon name in ../status.ts and not
|
|
34
|
+
here, this file keeps rendering a plausible glyph for the wrong level, which
|
|
35
|
+
is precisely the failure the four-distinct-shapes rule exists to prevent. */
|
|
36
|
+
if (isDevelopment()) {
|
|
37
|
+
for (const [level, Icon] of Object.entries(ICONS)) {
|
|
38
|
+
const expected = CLINICAL_STATUS_META[level].icon;
|
|
39
|
+
const actual = Icon.displayName;
|
|
40
|
+
if (actual && actual !== expected) {
|
|
41
|
+
/* Not an OPSIN code. Those describe a mistake a CONSUMER made with the
|
|
42
|
+
API; this is this file disagreeing with ../status.ts, which is a defect
|
|
43
|
+
in opsinjs itself and belongs in a different channel. */
|
|
44
|
+
console.warn(`[opsinjs] RangeBar renders <${actual}> for status "${level}", but ` +
|
|
45
|
+
`CLINICAL_STATUS_META says the icon is "${expected}". The four levels ` +
|
|
46
|
+
`must be four distinct glyph shapes; fix ICONS in range-bar.tsx.`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Development warnings, said once per offending call site.
|
|
52
|
+
*
|
|
53
|
+
* `tokens/errors.json` states the policy, and that policy is development only,
|
|
54
|
+
* once per offending call site, through `console.warn`. `warnOnce` in the
|
|
55
|
+
* substrate keeps to it, but `warnOnce` is keyed to an `OpsinErrorCode` and the
|
|
56
|
+
* four complaints in the component body below have no code allocated: they are
|
|
57
|
+
* drawing and labelling defects rather than mistakes with the clinical API, and
|
|
58
|
+
* a component may not mint a code, because the errors table is generated from
|
|
59
|
+
* that file.
|
|
60
|
+
*
|
|
61
|
+
* Without a keyed set they print on every render, and twice again per render
|
|
62
|
+
* under Strict Mode. A bar inside a list that re-renders on scroll would repeat
|
|
63
|
+
* the same paragraph until the console is unusable, and a channel somebody
|
|
64
|
+
* filters is one that no longer carries the finding they needed. Here that
|
|
65
|
+
* finding is a range with no interval under it, or two bounds that read as one
|
|
66
|
+
* number.
|
|
67
|
+
*
|
|
68
|
+
* The key names the offence and the values that caused it, never the reading:
|
|
69
|
+
* one bar with a bad range says so once, and a second bar with a different bad
|
|
70
|
+
* range still gets its own line.
|
|
71
|
+
*/
|
|
72
|
+
const warned = new Set();
|
|
73
|
+
function warnDev(key, message) {
|
|
74
|
+
if (!isDevelopment() || warned.has(key))
|
|
75
|
+
return;
|
|
76
|
+
warned.add(key);
|
|
77
|
+
console.warn(message);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The tick's fill, one class per level, written out rather than built.
|
|
81
|
+
*
|
|
82
|
+
* Tailwind reads class names out of source as literal strings, so
|
|
83
|
+
* `bg-status-${level}` generates no CSS at all and the tick renders invisible
|
|
84
|
+
* against the rail. The bare status name is the LINE role. That is the boundary
|
|
85
|
+
* colour, which is what a 4px mark on a neutral rail is. `-accent` is
|
|
86
|
+
* deliberately absent: it is the identity fill, chosen for recognition rather
|
|
87
|
+
* than contrast, and a tick is read for its position before its colour.
|
|
88
|
+
*/
|
|
89
|
+
const TICK_TONE = {
|
|
90
|
+
steady: "bg-status-steady",
|
|
91
|
+
watch: "bg-status-watch",
|
|
92
|
+
attention: "bg-status-attention",
|
|
93
|
+
urgent: "bg-status-urgent",
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The category tint, on the label and on nothing else.
|
|
97
|
+
*
|
|
98
|
+
* Category colour is IDENTITY. It says what this reading is about, and never a
|
|
99
|
+
* verdict, so it says nothing in greyscale except which metric you are looking
|
|
100
|
+
* at, which is why no word accompanies it. The label is also the one place the
|
|
101
|
+
* specification permits it: the track, the band and the tick stay outside the
|
|
102
|
+
* category axis entirely.
|
|
103
|
+
*/
|
|
104
|
+
const CATEGORY_INK = {
|
|
105
|
+
sleep: "text-category-sleep-ink",
|
|
106
|
+
heart: "text-category-heart-ink",
|
|
107
|
+
activity: "text-category-activity-ink",
|
|
108
|
+
nutrition: "text-category-nutrition-ink",
|
|
109
|
+
mind: "text-category-mind-ink",
|
|
110
|
+
labs: "text-category-labs-ink",
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* How much of the drawn extent is breathing room, as a fraction of it.
|
|
114
|
+
*
|
|
115
|
+
* A DRAWING constant and not a clinical one: it decides where the ends of the
|
|
116
|
+
* line fall, never what a reading means. Without it a value sitting exactly at
|
|
117
|
+
* the extent would be drawn centred on the very edge of the track, half of the
|
|
118
|
+
* mark outside the box and its number hanging off the surface.
|
|
119
|
+
*/
|
|
120
|
+
const EDGE_ROOM = 0.08;
|
|
121
|
+
/**
|
|
122
|
+
* The ceiling `Intl.NumberFormat` accepts for fraction digits, mirrored from
|
|
123
|
+
* `Value`. It is how "show the digits you were handed" is said to a formatter
|
|
124
|
+
* whose own default is to round silently at three.
|
|
125
|
+
*/
|
|
126
|
+
const MAX_FRACTION_DIGITS = 20;
|
|
127
|
+
/**
|
|
128
|
+
* The drawn extent, or `null` when there is nothing honest to draw.
|
|
129
|
+
*
|
|
130
|
+
* WIDER THAN THE RANGE ON BOTH SIDES, by one band-width each way, so that a
|
|
131
|
+
* reading outside the range has somewhere to be. And it always contains the
|
|
132
|
+
* reading: a value far beyond the range compresses the band towards a sliver,
|
|
133
|
+
* which is TRUE TO SCALE and is the information. A picture that clipped the
|
|
134
|
+
* reading to the edge instead would be showing it somewhere it is not.
|
|
135
|
+
*
|
|
136
|
+
* It carries the reading back out with it, narrowed to a real number. Every
|
|
137
|
+
* caller that has an extent has a reading to draw on it, and returning the two
|
|
138
|
+
* together is what makes that true to the type checker as well as to the eye.
|
|
139
|
+
*/
|
|
140
|
+
function drawnExtent(range, value) {
|
|
141
|
+
if (range === undefined || value === null || !Number.isFinite(value))
|
|
142
|
+
return null;
|
|
143
|
+
const { low, high } = range;
|
|
144
|
+
if (low === undefined || high === undefined)
|
|
145
|
+
return null;
|
|
146
|
+
/* A range whose bounds are equal or inverted has no width, and a width is
|
|
147
|
+
what a scale is made of. Such a range is refused before it reaches here,
|
|
148
|
+
because it never becomes `compared`. This stays so the function is honest
|
|
149
|
+
read on its own rather than honest by arrangement with its caller. */
|
|
150
|
+
if (!(high > low))
|
|
151
|
+
return null;
|
|
152
|
+
const reach = high - low;
|
|
153
|
+
const start = Math.min(low - reach, value);
|
|
154
|
+
const end = Math.max(high + reach, value);
|
|
155
|
+
const room = (end - start) * EDGE_ROOM;
|
|
156
|
+
return { start: start - room, end: end + room, low, high, reading: value };
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Where the reading sits against the bounds the caller supplied.
|
|
160
|
+
*
|
|
161
|
+
* Three words, all of them arithmetic. This is the one comparison the component
|
|
162
|
+
* performs, and it is the same comparison the drawing performs; it says where a
|
|
163
|
+
* number is and never what being there means.
|
|
164
|
+
*
|
|
165
|
+
* IT IS ONLY EVER CALLED WITH A RANGE THAT HAS A BOUND. `within` is the
|
|
166
|
+
* fall-through, so a range carrying neither bound would come back `within`.
|
|
167
|
+
* That is a position, in the reassuring direction, against an interval nobody
|
|
168
|
+
* supplied. That range is discarded in the component body before it reaches
|
|
169
|
+
* here.
|
|
170
|
+
*/
|
|
171
|
+
function positionOf(value, range) {
|
|
172
|
+
if (range.low !== undefined && value < range.low)
|
|
173
|
+
return "below";
|
|
174
|
+
if (range.high !== undefined && value > range.high)
|
|
175
|
+
return "above";
|
|
176
|
+
return "within";
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The range as a noun phrase, open at either end when only one bound is known.
|
|
180
|
+
*
|
|
181
|
+
* A range with neither bound is discarded upstream and never reaches here; the
|
|
182
|
+
* empty return is what keeps this function total, and it is not a state the
|
|
183
|
+
* sentence is ever built from. An empty phrase spliced into "within the range
|
|
184
|
+
* …, from …" is a comparison with nothing in it.
|
|
185
|
+
*
|
|
186
|
+
* The low bound of a two-bound pair carries `unitDisplay: "spoken"`, so the
|
|
187
|
+
* phrase reads "10 to 20 mg/dL" on the screen rather than "10 mg/dL to 20 mg/dL":
|
|
188
|
+
* one unit for one measurement written at both its ends. The unit stays spoken
|
|
189
|
+
* on both, because a listener meets the bounds one after the other and has no
|
|
190
|
+
* column heading to carry the unit across from the first to the second.
|
|
191
|
+
*
|
|
192
|
+
* IT NOW SERVES THE NO-READING BRANCH ALONE. The has-reading sentence takes its
|
|
193
|
+
* comparison clause from `comparisonPieces`, which templates the phrasing per
|
|
194
|
+
* range shape. This function is the range as a bare noun phrase, which is what
|
|
195
|
+
* "The range is 10 to 20 mg/dL, from X." and "The range is up to 20 mg/dL, from
|
|
196
|
+
* X." both need, because there is no position word beside it for an open-ended
|
|
197
|
+
* phrase to collide with. Do not reuse it inside a comparison; that is the
|
|
198
|
+
* collision `comparisonPieces` exists to prevent.
|
|
199
|
+
*/
|
|
200
|
+
function rangePieces(range, unit) {
|
|
201
|
+
const { low, high } = range;
|
|
202
|
+
if (low !== undefined && high !== undefined) {
|
|
203
|
+
return [{ reading: low, unit, unitDisplay: "spoken" }, " to ", { reading: high, unit }];
|
|
204
|
+
}
|
|
205
|
+
if (high !== undefined)
|
|
206
|
+
return ["up to ", { reading: high, unit }];
|
|
207
|
+
if (low !== undefined)
|
|
208
|
+
return [{ reading: low, unit }, " and upwards"];
|
|
209
|
+
return [];
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The comparison clause, templated per range shape, comma and space included.
|
|
213
|
+
*
|
|
214
|
+
* The clause carries its own leading ", " so the caller concatenates it rather
|
|
215
|
+
* than interpolating a position word into a fixed frame. A two-bound range keeps
|
|
216
|
+
* the frame it always had, "within/above/below the range X to Y", which is the
|
|
217
|
+
* sentence the has-reading branch produced before this function existed. A
|
|
218
|
+
* one-bound range does not: splicing an open-ended noun phrase into that frame
|
|
219
|
+
* gives "within the range up to 20", two prepositions fighting over one number,
|
|
220
|
+
* so each open shape gets a clause written for it that names the bound and never
|
|
221
|
+
* the reader. The words are the direction-based lay phrasing
|
|
222
|
+
* `content/docs/health/reference-ranges.mdx` prefers, and none of them is on the
|
|
223
|
+
* banned list in `tokens/glossary.json`.
|
|
224
|
+
*
|
|
225
|
+
* `positionOf` decides the direction, and it cannot return every direction for
|
|
226
|
+
* every shape. With only `high` it returns "above" or "within" and never
|
|
227
|
+
* "below"; with only `low` it returns "below" or "within" and never "above". The
|
|
228
|
+
* unreachable direction falls through to the within-side wording rather than
|
|
229
|
+
* throwing, so the function is total whatever a caller's pipeline hands it. The
|
|
230
|
+
* within-side clause says "at or under" and "at or above" rather than the bare
|
|
231
|
+
* preposition because `positionOf` tests the bounds strictly, so a reading equal
|
|
232
|
+
* to its only bound comes back "within" and lands here. A reading on the cutoff
|
|
233
|
+
* is neither under nor above it, and "at or under 20" stays true when the
|
|
234
|
+
* reading is 20 where "under 20" would be false. The
|
|
235
|
+
* boundless range, which carries neither bound, is discarded upstream and never
|
|
236
|
+
* reaches here; its empty return mirrors `rangePieces` and keeps this function
|
|
237
|
+
* honest read on its own.
|
|
238
|
+
*/
|
|
239
|
+
function comparisonPieces(value, range, unit) {
|
|
240
|
+
const { low, high } = range;
|
|
241
|
+
if (low !== undefined && high !== undefined) {
|
|
242
|
+
return [
|
|
243
|
+
`, ${positionOf(value, range)} the range `,
|
|
244
|
+
{ reading: low, unit, unitDisplay: "spoken" },
|
|
245
|
+
" to ",
|
|
246
|
+
{ reading: high, unit },
|
|
247
|
+
];
|
|
248
|
+
}
|
|
249
|
+
if (high !== undefined) {
|
|
250
|
+
return positionOf(value, range) === "above"
|
|
251
|
+
? [", higher than the upper limit of ", { reading: high, unit }]
|
|
252
|
+
: [", at or under the upper limit of ", { reading: high, unit }];
|
|
253
|
+
}
|
|
254
|
+
if (low !== undefined) {
|
|
255
|
+
return positionOf(value, range) === "below"
|
|
256
|
+
? [", lower than the lower limit of ", { reading: low, unit }]
|
|
257
|
+
: [", at or above the lower limit of ", { reading: low, unit }];
|
|
258
|
+
}
|
|
259
|
+
return [];
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* The sentence, in pieces, so that each reading renders as a `Value`.
|
|
263
|
+
*
|
|
264
|
+
* It is built once and rendered once, in the visible summary paragraph, where
|
|
265
|
+
* each reading is a `Value` that carries the unit's spoken form. That paragraph
|
|
266
|
+
* is plain text in the accessibility tree, so it is also what a screen reader
|
|
267
|
+
* reads: the sentence is heard from the paragraph itself rather than from a
|
|
268
|
+
* separate accessible name, and the track above it is now decorative and
|
|
269
|
+
* hidden, so no reader hears the sentence twice.
|
|
270
|
+
*
|
|
271
|
+
* It always states the reading, the range and the position, in that order, so
|
|
272
|
+
* that it stands alone when it is read out of context, whether in a screen
|
|
273
|
+
* reader, in a notification or in a printed summary. It also names whose range
|
|
274
|
+
* it is, which is why `ReferenceRange.source` is required.
|
|
275
|
+
*/
|
|
276
|
+
function summaryPieces(label, value, unit, range) {
|
|
277
|
+
if (value === null || !Number.isFinite(value)) {
|
|
278
|
+
const opening = [`${label}: `, { reading: value, unit }, "."];
|
|
279
|
+
if (range === undefined)
|
|
280
|
+
return opening;
|
|
281
|
+
return [
|
|
282
|
+
...opening,
|
|
283
|
+
" The range is ",
|
|
284
|
+
...rangePieces(range, unit),
|
|
285
|
+
`, from ${range.source}.`,
|
|
286
|
+
];
|
|
287
|
+
}
|
|
288
|
+
if (range === undefined) {
|
|
289
|
+
return [
|
|
290
|
+
`${label} is `,
|
|
291
|
+
{ reading: value, unit },
|
|
292
|
+
". We do not have a reference range for this test, so we cannot show where this result sits.",
|
|
293
|
+
];
|
|
294
|
+
}
|
|
295
|
+
return [
|
|
296
|
+
`${label} is `,
|
|
297
|
+
{ reading: value, unit },
|
|
298
|
+
...comparisonPieces(value, range, unit),
|
|
299
|
+
`, from ${range.source}.`,
|
|
300
|
+
];
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* The digits, formatted the way `Value` formats them.
|
|
304
|
+
*
|
|
305
|
+
* A deliberate mirror rather than a second policy: `halfExpand` is
|
|
306
|
+
* round-half-away-from-zero, rounding happens once at display, and with no
|
|
307
|
+
* `precision` the fraction digits are opened all the way rather than left at
|
|
308
|
+
* the formatter's default of three, which would round somebody's measurement
|
|
309
|
+
* because nobody had said how precise it was. It exists because an `aria-label`
|
|
310
|
+
* is a string and a string cannot contain a component; the numbers a reader
|
|
311
|
+
* SEES all come from `Value` itself.
|
|
312
|
+
*/
|
|
313
|
+
function digitsOf(reading, precision, locale) {
|
|
314
|
+
return new Intl.NumberFormat(locale, {
|
|
315
|
+
minimumFractionDigits: precision,
|
|
316
|
+
maximumFractionDigits: precision ?? MAX_FRACTION_DIGITS,
|
|
317
|
+
}).format(reading);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* A date, or the string as supplied when it is not one.
|
|
321
|
+
*
|
|
322
|
+
* `timeZone: "UTC"` rather than the reader's zone, because this renders on a
|
|
323
|
+
* server and again in a browser: a date that resolved differently in the two
|
|
324
|
+
* places would hydrate into a mismatch, and a provenance date that changes
|
|
325
|
+
* under the reader is worse than one that is a few hours out.
|
|
326
|
+
*
|
|
327
|
+
* The locale is the other half of that same hydration problem, and it is not
|
|
328
|
+
* fixed here. With `locale` undefined the server formats this date with the host
|
|
329
|
+
* process's locale and the browser reformats it with the reader's, so the
|
|
330
|
+
* footnote can flip its date order on load. One component cannot resolve that on
|
|
331
|
+
* its own: the only document-level source of a locale is client-only and would
|
|
332
|
+
* itself differ between the server pass and the first client pass, which is the
|
|
333
|
+
* bug rather than the fix. The caller passes the locale the surface renders in.
|
|
334
|
+
*/
|
|
335
|
+
function formatDate(iso, locale) {
|
|
336
|
+
const instant = new Date(iso);
|
|
337
|
+
if (Number.isNaN(instant.getTime()))
|
|
338
|
+
return iso;
|
|
339
|
+
return new Intl.DateTimeFormat(locale, {
|
|
340
|
+
dateStyle: "long",
|
|
341
|
+
timeZone: "UTC",
|
|
342
|
+
}).format(instant);
|
|
343
|
+
}
|
|
344
|
+
export function RangeBar({ label, value, unit, range, status, category, precision, measuredAt, readingRecency = "state", summary, locale, className, }) {
|
|
345
|
+
/* THE FIFTH LEVEL IS REFUSED, NOT APPROXIMATED. This file ships as source
|
|
346
|
+
into JavaScript projects where a type is advice, and a level outside the
|
|
347
|
+
four has no word, no glyph and no meaning. So the bar is drawn without a
|
|
348
|
+
status rather than with an invented one. `unknown` gets its own code
|
|
349
|
+
because it is the likeliest wrong answer and the most dangerous: it is the
|
|
350
|
+
absence of an assertion, and a reader who meets it rendered as a level
|
|
351
|
+
reads it as "probably fine". */
|
|
352
|
+
let level;
|
|
353
|
+
if (status !== undefined) {
|
|
354
|
+
if (isClinicalStatus(status)) {
|
|
355
|
+
level = status;
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
warnOnce(status === "unknown" ? "OPSIN-0011" : "OPSIN-0021", {
|
|
359
|
+
component: "RangeBar",
|
|
360
|
+
status: String(status),
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
/* A seventh category is a ramp that does not exist, so it resolves to no
|
|
365
|
+
colour at all rather than to a plausible one. */
|
|
366
|
+
let tint;
|
|
367
|
+
if (category !== undefined) {
|
|
368
|
+
if (isHealthCategory(category)) {
|
|
369
|
+
tint = category;
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
warnOnce("OPSIN-0010", {
|
|
373
|
+
category: String(category),
|
|
374
|
+
known: HEALTH_CATEGORIES.join(", "),
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/* OPSIN-0004, at its enforcement point. A range is a comparison somebody
|
|
379
|
+
chose, and an unattributed one asks this system to vouch for a threshold it
|
|
380
|
+
has never seen. The repair is to drop the range entirely rather than to
|
|
381
|
+
draw the band and omit the credit, which would leave the reader looking
|
|
382
|
+
at a comparison with no author and no way to know that is what they are
|
|
383
|
+
doing. */
|
|
384
|
+
const attributed = range !== undefined && typeof range.source === "string" && range.source.trim() !== "";
|
|
385
|
+
if (range !== undefined && !attributed) {
|
|
386
|
+
warnOnce("OPSIN-0004", { component: "RangeBar" });
|
|
387
|
+
}
|
|
388
|
+
/* AN INTERVAL, OR NOTHING AT ALL. These are the second and third ways a range
|
|
389
|
+
arrives unusable, and they are dangerous in the sentence rather than in the
|
|
390
|
+
picture. Both bounds are optional on `ReferenceRange`, so `{ source }` on
|
|
391
|
+
its own typechecks, and a pair that runs downwards typechecks too. Neither
|
|
392
|
+
is an interval, and neither may be half-used: the drawing already refuses
|
|
393
|
+
both, and the SENTENCE is what would otherwise state a position against
|
|
394
|
+
them. That is "within the range ,", in the reassuring direction, naming an
|
|
395
|
+
interval printed nowhere on the screen, or "below the range 20 to 10". They
|
|
396
|
+
take the exit an unattributed range already takes: the reading, and
|
|
397
|
+
the words for having nothing to compare it with. */
|
|
398
|
+
const boundless = range !== undefined && range.low === undefined && range.high === undefined;
|
|
399
|
+
const inverted = range !== undefined &&
|
|
400
|
+
range.low !== undefined &&
|
|
401
|
+
range.high !== undefined &&
|
|
402
|
+
!(range.high > range.low);
|
|
403
|
+
const compared = attributed && !boundless && !inverted ? range : undefined;
|
|
404
|
+
if (attributed && boundless) {
|
|
405
|
+
warnDev(`range-boundless:${label}`, "[opsinjs] <RangeBar> was given a `range` with neither `low` nor `high`, " +
|
|
406
|
+
"which is a source with no interval underneath it. It was discarded " +
|
|
407
|
+
"rather than compared against, because a reading is not `within` an " +
|
|
408
|
+
"interval nobody supplied. The sentence states the reading and says " +
|
|
409
|
+
"there is nothing to compare it with.");
|
|
410
|
+
}
|
|
411
|
+
if (inverted) {
|
|
412
|
+
warnDev(`range-inverted:${String(range?.low)}:${String(range?.high)}`, `[opsinjs] <RangeBar> was given low=${String(range?.low)} and ` +
|
|
413
|
+
`high=${String(range?.high)}, which leaves the range no width to draw a ` +
|
|
414
|
+
"scale from and no order to place a reading against. It was discarded: " +
|
|
415
|
+
"no bar is drawn, and the sentence says there is nothing to compare the " +
|
|
416
|
+
"reading with rather than naming a position between two bounds that run " +
|
|
417
|
+
"downwards.");
|
|
418
|
+
}
|
|
419
|
+
const extent = drawnExtent(compared, value);
|
|
420
|
+
/* Both boundary labels rounding to the same digits is not a drawing bug and
|
|
421
|
+
is not repaired by quietly adding a decimal place: a number shown to more
|
|
422
|
+
places than the measurement carries is an accuracy claim nobody made. It
|
|
423
|
+
means the precision this metric is reported to cannot separate its own
|
|
424
|
+
bounds, and the caller is the only one who can say what it should be. */
|
|
425
|
+
if (extent !== null &&
|
|
426
|
+
digitsOf(extent.low, precision, locale) === digitsOf(extent.high, precision, locale)) {
|
|
427
|
+
warnDev(`bounds-collapse:${String(precision)}:${String(extent.low)}:${String(extent.high)}`, `[opsinjs] <RangeBar> is labelling both ends of the range ` +
|
|
428
|
+
`"${digitsOf(extent.low, precision, locale)}", because ` +
|
|
429
|
+
`precision=${String(precision)} rounds ${String(extent.low)} and ` +
|
|
430
|
+
`${String(extent.high)} to the same digits. The two marks are drawn in the ` +
|
|
431
|
+
"right places and read as one number. Pass the precision this measurement " +
|
|
432
|
+
"is reported to; nothing here invents a decimal place to separate them.");
|
|
433
|
+
}
|
|
434
|
+
const pieces = summaryPieces(label, value, unit, compared);
|
|
435
|
+
/* An empty `summary` is the only way this component can be asked to render
|
|
436
|
+
without a sentence, and the answer is no. The generated one is used
|
|
437
|
+
instead, because a bar with no words is a picture whose entire meaning is
|
|
438
|
+
carried by a position on a line. That is nothing at all in a screen
|
|
439
|
+
reader, on a printout, or to a reader who cannot see it. */
|
|
440
|
+
const blankSummary = summary !== undefined && summary.trim() === "";
|
|
441
|
+
if (blankSummary) {
|
|
442
|
+
warnDev(`summary-blank:${label}`, '[opsinjs] <RangeBar> received summary="", which would render the bar with ' +
|
|
443
|
+
"no sentence beside it. The generated sentence was used instead. The " +
|
|
444
|
+
"wording is yours to replace; the sentence is not optional, because it is " +
|
|
445
|
+
"the whole component for anybody who is not looking at the picture.");
|
|
446
|
+
}
|
|
447
|
+
const sentence = summary !== undefined && !blankSummary ? summary : undefined;
|
|
448
|
+
const at = (point) => extent === null ? 0 : ((point - extent.start) / (extent.end - extent.start)) * 100;
|
|
449
|
+
/* NEVER SILENT ABOUT WHEN THE READING WAS TAKEN, UNLESS A CONTAINER TAKES IT
|
|
450
|
+
OVER. A number on a screen with no time beside it is read as "now", so a
|
|
451
|
+
standalone bar STATES an absent `measuredAt` rather than saying nothing. It
|
|
452
|
+
is a recency signal and not a staleness treatment: there is no boundary
|
|
453
|
+
here and there will not be one, because how old is too old is clinical,
|
|
454
|
+
differs by metric, and belongs to whoever owns the range.
|
|
455
|
+
|
|
456
|
+
The one exception is `readingRecency === "delegated"`, which a surrounding
|
|
457
|
+
component sets when it already states the instant itself, in view and in
|
|
458
|
+
the accessibility tree. Then the bar prints neither reading sentence,
|
|
459
|
+
because the fact is on the screen once already and printing it twice is
|
|
460
|
+
what this exception exists to stop. It never makes the fact disappear: the
|
|
461
|
+
container has promised to carry it. `ResultCard` is the caller that does,
|
|
462
|
+
through the `RelativeTime` in its header.
|
|
463
|
+
|
|
464
|
+
The range is different, and neither rule carries across to it. The range's
|
|
465
|
+
author is already named in the summary sentence one line up, on every bar
|
|
466
|
+
without exception, because `ReferenceRange.source` is required and
|
|
467
|
+
OPSIN-0004 is enforced above, so a reader always knows whose comparison
|
|
468
|
+
they are reading. A confirmation date is added when somebody supplies one.
|
|
469
|
+
A line per row saying nobody knows a date the reader could not act on
|
|
470
|
+
anyway reads as the product disowning its own ranges, and none of the
|
|
471
|
+
health rules in content/docs/health/uncertainty-and-staleness.mdx asks an
|
|
472
|
+
undated range to announce itself. So the undated range says nothing. */
|
|
473
|
+
const asOf = compared?.asOf;
|
|
474
|
+
const hasReading = value !== null && Number.isFinite(value);
|
|
475
|
+
const provenance = [];
|
|
476
|
+
if (asOf !== undefined) {
|
|
477
|
+
provenance.push(`This range was last confirmed on ${formatDate(asOf, locale)}.`);
|
|
478
|
+
}
|
|
479
|
+
if (readingRecency === "state") {
|
|
480
|
+
if (measuredAt !== undefined) {
|
|
481
|
+
provenance.push(`This reading was taken on ${formatDate(measuredAt, locale)}.`);
|
|
482
|
+
}
|
|
483
|
+
else if (hasReading) {
|
|
484
|
+
provenance.push("We do not know when this reading was taken.");
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return (_jsxs("div", { "data-slot": "range-bar", className: cn(
|
|
488
|
+
/* No fixed height and no truncation anywhere in this component: at 200%
|
|
489
|
+
text every row here has to grow and wrap, and a height would clip the
|
|
490
|
+
number rather than the decoration. */
|
|
491
|
+
"flex w-full flex-col gap-opsin-2 text-opsin-body", className), children: [_jsxs("div", { className: "flex flex-wrap items-baseline justify-between gap-opsin-2", children: [_jsx("span", { "data-slot": "range-bar-label", "data-category": tint, className: tint === undefined
|
|
492
|
+
? "text-opsin-headline"
|
|
493
|
+
: "text-opsin-headline " + CATEGORY_INK[tint], children: label }), level !== undefined ? (_jsx(StatusPill, { status: level, describes: label })) : null] }), extent === null ? null : (
|
|
494
|
+
/* Padded in `em` rather than in a fixed measure, because what has to fit
|
|
495
|
+
in it is text: the reading above the track and the two boundary
|
|
496
|
+
labels below it, both of which grow with the reader's own type size.
|
|
497
|
+
A rem here would hold its ground while the labels grew through it.
|
|
498
|
+
|
|
499
|
+
The padding is asymmetric on purpose. Above the track sits the
|
|
500
|
+
reading, which is a health value and so is drawn at the `headline`
|
|
501
|
+
step, body size at weight 600, never below the floor tokens/type.json
|
|
502
|
+
rules[1] fixes. Below it sit the two boundary numbers, which are axis
|
|
503
|
+
labels and stay at caption1, a step smaller. The top therefore needs
|
|
504
|
+
more room than the bottom, so `pt` is `3.3em` to clear a 24px line
|
|
505
|
+
plus the `mb-opsin-4` gap, and `pb` is `2.55em` to clear a caption line
|
|
506
|
+
plus `mt-opsin-4`. Both gaps are wider than the track needs on its
|
|
507
|
+
own, because the cursor stands proud of the tube by about a third of
|
|
508
|
+
its own height above and below and must never touch a label. */
|
|
509
|
+
_jsx("div", { className: "relative pt-[3.3em] pb-[2.55em] text-opsin-footnote", style: { "--rb-label-half": "3.5em" }, children: _jsxs("div", { "data-slot": "range-bar-track", "aria-hidden": "true",
|
|
510
|
+
/* THE TRACK IS A GROOVE, SO IT READS THE INSET RUNG. `bg-muted` sat
|
|
511
|
+
ABOVE the card fill in dark, which drew the track as a raised
|
|
512
|
+
strip inside the card it belongs to rather than a recess cut into
|
|
513
|
+
it, the opposite of the light layout. The token-only `inset` rung
|
|
514
|
+
in tokens/material.json is authored to sit between the card and
|
|
515
|
+
the page in both themes, so the track reads
|
|
516
|
+
--opsin-material-inset-tint directly, the way Surface reads a
|
|
517
|
+
rung's tint. The rung is opaque by design (tint-alpha 1, no blur),
|
|
518
|
+
so a flat background colour is the whole of the treatment and no
|
|
519
|
+
backdrop layer is needed here. */
|
|
520
|
+
/* A GLASS TUBE. The groove reads the inset rung as before; on top of
|
|
521
|
+
it sit a shadow along the inner top edge, a line of light along
|
|
522
|
+
the inner bottom edge, and a streak of reflected light across
|
|
523
|
+
the upper third, the `after:` layer, which is what makes a
|
|
524
|
+
recess read as glass. The streak and both inner lines are light,
|
|
525
|
+
never a colour, and the cursor below is stacked above the streak
|
|
526
|
+
so nothing crosses the reading. Print drops the light and keeps
|
|
527
|
+
the line. */
|
|
528
|
+
className: "relative h-[0.9em] rounded-full border border-edge bg-(--opsin-material-inset-tint) " +
|
|
529
|
+
"shadow-[inset_0_1px_3px_oklch(0_0_0/0.16),inset_0_-1px_0_oklch(1_0_0/0.7)] " +
|
|
530
|
+
"dark:shadow-[inset_0_1px_3px_oklch(0_0_0/0.55),inset_0_-1px_0_oklch(1_0_0/0.07)] " +
|
|
531
|
+
"after:pointer-events-none after:absolute after:inset-x-[0.6em] after:top-[0.12em] after:h-[0.22em] after:rounded-full " +
|
|
532
|
+
"after:bg-[linear-gradient(90deg,transparent,color-mix(in_oklab,var(--card)_80%,transparent)_14%,color-mix(in_oklab,var(--card)_80%,transparent)_86%,transparent)] " +
|
|
533
|
+
"dark:after:bg-[linear-gradient(90deg,transparent,color-mix(in_oklab,var(--foreground)_14%,transparent)_14%,color-mix(in_oklab,var(--foreground)_14%,transparent)_86%,transparent)] " +
|
|
534
|
+
"print:border-border print:shadow-none print:after:hidden", children: [_jsx("div", { "data-slot": "range-bar-band", style: {
|
|
535
|
+
insetInlineStart: `${at(extent.low).toFixed(3)}%`,
|
|
536
|
+
inlineSize: `${(at(extent.high) - at(extent.low)).toFixed(3)}%`,
|
|
537
|
+
},
|
|
538
|
+
/* The lit section of the tube: an opaque card-coloured capsule
|
|
539
|
+
inside the groove, outlined in the boundary ink, with its own
|
|
540
|
+
line of light along the top so it reads as a body of glass
|
|
541
|
+
inside the tube rather than a sticker on it. Still neutral. */
|
|
542
|
+
className: "absolute inset-y-[0.08em] rounded-full border border-muted-foreground bg-card shadow-[inset_0_1px_0_oklch(1_0_0/0.95),0_1px_2px_oklch(0_0_0/0.12)] dark:shadow-[inset_0_1px_0_oklch(1_0_0/0.1),0_1px_2px_oklch(0_0_0/0.5)]" }), [extent.low, extent.high].map((bound) => (_jsx("div", { "data-slot": "range-bar-mark", style: { insetInlineStart: `${at(bound).toFixed(3)}%` }, className: "absolute -top-[0.4em] -bottom-[0.4em] w-px -translate-x-1/2 rounded-full bg-muted-foreground rtl:translate-x-1/2 forced-colors:bg-[CanvasText]" }, bound))), _jsx("div", { className: "absolute top-full mt-opsin-4 flex justify-end-safe", style: {
|
|
543
|
+
insetInlineStart: 0,
|
|
544
|
+
inlineSize: `${at(extent.low).toFixed(3)}%`,
|
|
545
|
+
}, children: _jsx("span", { className: "whitespace-nowrap pe-opsin-1 text-opsin-caption1 text-muted-foreground", children: _jsx(Value, { value: extent.low, unit: unit, precision: precision, locale: locale }) }) }), _jsx("div", { className: "absolute top-full mt-opsin-4", style: {
|
|
546
|
+
insetInlineEnd: 0,
|
|
547
|
+
inlineSize: `calc(100% - ${at(extent.high).toFixed(3)}%)`,
|
|
548
|
+
}, children: _jsx("div", { className: "flex w-full justify-end-safe [direction:rtl] rtl:[direction:ltr]", children: _jsx("span", { className: "whitespace-nowrap ps-opsin-1 text-opsin-caption1 text-muted-foreground [direction:ltr] rtl:[direction:rtl]", children: _jsx(Value, { value: extent.high, unit: unit, precision: precision, locale: locale }) }) }) }), _jsx("div", { "data-slot": "range-bar-tick", "data-status": level, style: { insetInlineStart: `${at(extent.reading).toFixed(3)}%` },
|
|
549
|
+
/* THE READING IS A CURSOR THAT RIDES THE TUBE. A capsule of
|
|
550
|
+
frosted glass, taller than the tube and standing proud of it
|
|
551
|
+
above and below, so it reads as a piece that slides along the
|
|
552
|
+
gauge, with an index line down its middle that marks the exact
|
|
553
|
+
position. The glass is light, never a colour, and the one
|
|
554
|
+
coloured thing in it is the index line, in the level's line
|
|
555
|
+
role, which is the colour the legend's swatch names. A
|
|
556
|
+
boundary mark is a 1px line and the index sits inside a body
|
|
557
|
+
of glass, so the two are told apart by shape before colour.
|
|
558
|
+
It is stacked above the tube's streak of light, so the
|
|
559
|
+
reflection never crosses the reading. */
|
|
560
|
+
className: "absolute top-1/2 z-10 h-[2.35em] w-[1.45em] -translate-x-1/2 -translate-y-1/2 rounded-full rtl:translate-x-1/2 " +
|
|
561
|
+
"border border-edge bg-[color-mix(in_oklab,var(--card)_58%,transparent)] backdrop-blur-[3px] backdrop-saturate-150 " +
|
|
562
|
+
"shadow-[inset_0_1px_0_oklch(1_0_0/0.95),inset_0_-1px_0_oklch(0_0_0/0.05),0_1px_2px_oklch(0_0_0/0.16),0_6px_16px_-6px_oklch(0_0_0/0.32)] " +
|
|
563
|
+
"dark:bg-[color-mix(in_oklab,var(--foreground)_10%,transparent)] dark:shadow-[inset_0_1px_0_oklch(1_0_0/0.22),0_1px_2px_oklch(0_0_0/0.5),0_8px_18px_-8px_oklch(0_0_0/0.8)] " +
|
|
564
|
+
"print:bg-card print:shadow-none forced-colors:[outline:1px_solid_CanvasText]", children: _jsx("span", { "aria-hidden": "true", className: "absolute inset-y-[0.42em] inset-s-1/2 w-[0.26em] -translate-x-1/2 rounded-full rtl:translate-x-1/2 forced-colors:bg-[Highlight] " +
|
|
565
|
+
(level === undefined ? "bg-foreground" : TICK_TONE[level]) }) }), _jsx("span", { "data-slot": "range-bar-value", className: "absolute bottom-full mb-opsin-4 -translate-x-1/2 whitespace-nowrap text-opsin-headline rtl:translate-x-1/2", style: {
|
|
566
|
+
insetInlineStart: `clamp(var(--rb-label-half), ${at(extent.reading).toFixed(3)}%, calc(100% - var(--rb-label-half)))`,
|
|
567
|
+
}, children: _jsx(Value, { value: value, unit: unit, precision: precision, locale: locale }) })] }) })), _jsx("p", { "data-slot": "range-bar-summary", className: "m-0", children: sentence ??
|
|
568
|
+
pieces.map((piece, index) => typeof piece === "string" ? (piece) : (_jsx(Value, { value: piece.reading, unit: piece.unit, unitDisplay: piece.unitDisplay, precision: precision, locale: locale }, index))) }), provenance.length === 0 ? null : (
|
|
569
|
+
/* FOOTNOTE, NOT CAPTION1. The type scale puts provenance lines and
|
|
570
|
+
timestamps on the footnote step and reserves caption1 as the floor
|
|
571
|
+
for axis labels, legends and legal text. This sentence is provenance,
|
|
572
|
+
so it takes footnote and reads a step larger than the tick and
|
|
573
|
+
boundary labels under the track, which are axis text and stay at
|
|
574
|
+
caption1. The reader over sixty meets the least legible size only on
|
|
575
|
+
the axis, never on the "when was this measured" line. */
|
|
576
|
+
_jsx("p", { "data-slot": "range-bar-footnote", className: "m-0 text-opsin-footnote text-muted-foreground", children: provenance.join(" ") }))] }));
|
|
577
|
+
}
|
|
578
|
+
//# sourceMappingURL=range-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range-bar.js","sourceRoot":"","sources":["../../src/components/range-bar.tsx"],"names":[],"mappings":";AAqDA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAElE,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAiE,MAAM,eAAe,CAAA;AACnM,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAmB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAa,CAAA;AAEnC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,KAAK,GAA0C;IACnD,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,OAAO;IAClB,MAAM,EAAE,OAAO;CAChB,CAAA;AAED;;+EAE+E;AAC/E,IAAI,aAAa,EAAE,EAAE,CAAC;IACpB,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,QAAQ,GAAG,oBAAoB,CAAC,KAAuB,CAAC,CAAC,IAAI,CAAA;QACnE,MAAM,MAAM,GAAI,IAAiC,CAAC,WAAW,CAAA;QAC7D,IAAI,MAAM,IAA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