@everfur/sdk 0.3.0 → 0.5.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 +251 -4
- package/README.md +9 -3
- package/dist/{Chat-DwAC2vhB.d.ts → Chat-BOX-03ho.d.ts} +17 -3
- package/dist/{Chat-DPUD6dnc.d.cts → Chat-TA-aTcVF.d.cts} +17 -3
- package/dist/{DepthViews-DP0R-DhB.d.cts → DepthViews-CgjX2AJ5.d.ts} +1 -1
- package/dist/{DepthViews-DbFhR4Du.d.cts → DepthViews-Cviea-ri.d.cts} +1 -1
- package/dist/{DepthViews-DNEM96Se.d.ts → DepthViews-D2dRqWRq.d.ts} +1 -1
- package/dist/{DepthViews-D_3hl4xk.d.ts → DepthViews-DSFyaSeL.d.cts} +1 -1
- package/dist/{ErrorPolicyPort-CwbfmxzJ.d.ts → ErrorPolicyPort-D22LUVrK.d.ts} +1 -1
- package/dist/{ErrorPolicyPort-CNf4uQZP.d.cts → ErrorPolicyPort-D6CybiqJ.d.cts} +1 -1
- package/dist/{EverfurResult-DN9pL2Ab.d.cts → EverfurError-DmELDpXp.d.cts} +1 -67
- package/dist/{EverfurResult-DN9pL2Ab.d.ts → EverfurError-DmELDpXp.d.ts} +1 -67
- package/dist/EverfurResult-SGvHKsCB.d.ts +69 -0
- package/dist/EverfurResult-ZtH-YV1h.d.cts +69 -0
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +6 -5
- package/dist/animations/index.d.ts +6 -5
- package/dist/animations/index.js +1 -1
- package/dist/{attachments-5NeobOCd.d.ts → attachments-C_vtFu2f.d.ts} +7 -5
- package/dist/{attachments-D8T5re7e.d.cts → attachments-DHvnITuE.d.cts} +7 -5
- package/dist/{attachments-Bw3iMQgu.d.ts → attachments-oD5U2fXI.d.ts} +3 -3
- package/dist/{attachments-CQgFrEQ7.d.cts → attachments-pIdGOQfm.d.cts} +3 -3
- package/dist/bookingCopy-CJir9mjb.d.ts +1135 -0
- package/dist/bookingCopy-DfuA13dh.d.cts +1135 -0
- package/dist/branding-Xb_wL8N1.d.cts +212 -0
- package/dist/branding-xpQ056sM.d.ts +212 -0
- package/dist/callCopy-rDH9JTFo.d.cts +45 -0
- package/dist/callCopy-rDH9JTFo.d.ts +45 -0
- package/dist/callRoom-7wrE3RP2.d.ts +62 -0
- package/dist/callRoom-B_EqaUzx.d.cts +62 -0
- package/dist/casesRepository-B-Eg8ZJ3.d.cts +63 -0
- package/dist/casesRepository-DHgIYKN9.d.ts +63 -0
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.d.cts +12 -10
- package/dist/chat/index.d.ts +12 -10
- package/dist/chat/index.js +1 -1
- package/dist/client/index.cjs +5 -5
- package/dist/client/index.d.cts +15 -11
- package/dist/client/index.d.ts +15 -11
- package/dist/client/index.js +5 -5
- package/dist/{config-CzTZGlfF.d.cts → config-ClI7QxB0.d.ts} +4 -3
- package/dist/{config-DW60uRb9.d.ts → config-DAFbf721.d.cts} +4 -3
- package/dist/consent/index.cjs +1 -1
- package/dist/consent/index.d.cts +9 -8
- package/dist/consent/index.d.ts +9 -8
- package/dist/consent/index.js +1 -1
- package/dist/{context-XvTzq1tE.d.cts → context-B-dUM1Qf.d.cts} +9 -8
- package/dist/{context-DXhqHlPU.d.ts → context-CZbgF_OH.d.ts} +9 -8
- package/dist/{copy-Mjoo91aS.d.ts → copy-CeRH3NXy.d.ts} +5 -4
- package/dist/{copy-bKDNigLb.d.cts → copy-CneuYdrO.d.cts} +5 -4
- package/dist/core/index.cjs +9 -9
- package/dist/core/index.d.cts +123 -32
- package/dist/core/index.d.ts +123 -32
- package/dist/core/index.js +9 -9
- package/dist/{depth-CErXCU8J.d.cts → depth-B3NFKlF9.d.cts} +38 -6
- package/dist/{depth-DjDcJ6kH.d.ts → depth-DO3Ko_qs.d.ts} +38 -6
- package/dist/entitlementRepository-74kW5mK0.d.ts +43 -0
- package/dist/entitlementRepository-m6zLUmiB.d.cts +43 -0
- package/dist/{identity-DI4eVx9S.d.cts → identity-C7uxGwfT.d.cts} +3 -3
- package/dist/{identity-BMx2SUOM.d.ts → identity-CLAUq-K4.d.ts} +3 -3
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +20 -17
- package/dist/index.d.ts +20 -17
- package/dist/index.js +6 -6
- package/dist/{models-D2EUxPZY.d.cts → models-Bn2z0NNo.d.cts} +1 -1
- package/dist/{models-B-Uh2LTf.d.ts → models-DSqA5Ahs.d.ts} +1 -1
- package/dist/notifications/index.cjs +2 -2
- package/dist/notifications/index.d.cts +5 -4
- package/dist/notifications/index.d.ts +5 -4
- package/dist/notifications/index.js +2 -2
- package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
- package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
- package/dist/{pets-aB8q0JyX.d.cts → pets-BoB5B7kp.d.cts} +2 -2
- package/dist/{pets-CtQdRpWo.d.ts → pets-w4M9d-Dn.d.ts} +2 -2
- package/dist/{casesRepository-ClLv6qMl.d.ts → petsRepository-BjKJ8UsN.d.ts} +3 -49
- package/dist/{casesRepository-DHwtGRYY.d.cts → petsRepository-DZZoEG3r.d.cts} +3 -49
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.d.cts +3 -2
- package/dist/photo/index.d.ts +3 -2
- package/dist/photo/index.js +1 -1
- package/dist/{ports-DMolTRzU.d.ts → ports-BO3bzTJg.d.ts} +14 -17
- package/dist/{ports-DEBzEhbp.d.cts → ports-C2EVK416.d.cts} +14 -17
- package/dist/records/depth/index.cjs +2 -2
- package/dist/records/depth/index.d.cts +11 -10
- package/dist/records/depth/index.d.ts +11 -10
- package/dist/records/depth/index.js +2 -2
- package/dist/records/index.cjs +3 -3
- package/dist/records/index.d.cts +25 -14
- package/dist/records/index.d.ts +25 -14
- package/dist/records/index.js +3 -3
- package/dist/{requestFunnel-CjW7uDuA.d.ts → requestFunnel-D7ipek3e.d.ts} +28 -4
- package/dist/{requestFunnel-L-BQfi0z.d.cts → requestFunnel-Djjwgoe9.d.cts} +28 -4
- package/dist/{runtime-BR9ysG0J.d.ts → runtimeTypes-CTL3yToK.d.ts} +10 -100
- package/dist/{runtime-B8s-_hv8.d.cts → runtimeTypes-D2C9uD85.d.cts} +10 -100
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +4 -3
- package/dist/server/events/index.d.ts +4 -3
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +5 -4
- package/dist/server/index.d.ts +5 -4
- package/dist/server/index.js +1 -1
- package/dist/televet/booking/index.cjs +1 -0
- package/dist/televet/booking/index.d.cts +566 -0
- package/dist/televet/booking/index.d.ts +566 -0
- package/dist/televet/booking/index.js +1 -0
- package/dist/televet/call/index.cjs +1 -0
- package/dist/televet/call/index.d.cts +161 -0
- package/dist/televet/call/index.d.ts +161 -0
- package/dist/televet/call/index.js +1 -0
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.d.cts +64 -12
- package/dist/televet/index.d.ts +64 -12
- package/dist/televet/index.js +1 -1
- package/dist/televetGlobal-CEk0_cW9.d.cts +34 -0
- package/dist/televetGlobal-Cs9Wbqsy.d.ts +34 -0
- package/dist/testing/index.cjs +4 -4
- package/dist/testing/index.d.cts +4 -3
- package/dist/testing/index.d.ts +4 -3
- package/dist/testing/index.js +4 -4
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +13 -10
- package/dist/testing/rn/index.d.ts +13 -10
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.cjs +1 -1
- package/dist/testing/web/index.d.cts +14 -12
- package/dist/testing/web/index.d.ts +14 -12
- package/dist/testing/web/index.js +1 -1
- package/dist/{timelineRows-DZed6dAM.d.ts → timelineRows-7yFNK_rU.d.ts} +1 -1
- package/dist/{timelineRows-CaohZzXS.d.cts → timelineRows-CzR1T2DR.d.cts} +1 -1
- package/dist/tokens-CIngRkvt.d.cts +362 -0
- package/dist/tokens-CIngRkvt.d.ts +362 -0
- package/dist/typeStyle-DHJzDaUo.d.cts +112 -0
- package/dist/typeStyle-YPS_MXeI.d.ts +112 -0
- package/dist/{useRecordsDepth-BHBzJ76R.d.cts → useRecordsDepth-Bnw36jPr.d.cts} +24 -5
- package/dist/{useRecordsDepth-BU-OhzH6.d.ts → useRecordsDepth-DFF7Faxx.d.ts} +24 -5
- package/dist/{useVetVisit-CjmMa896.d.ts → useVetVisit-BsjoDO-n.d.ts} +21 -6
- package/dist/{useVetVisit-Bc84hWUU.d.cts → useVetVisit-Ds8f1peV.d.cts} +21 -6
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.cts +3 -2
- package/dist/video/index.d.ts +3 -2
- package/dist/video/index.js +1 -1
- package/dist/{view-DtSPYpKa.d.ts → view-BqcOYFTr.d.ts} +5 -4
- package/dist/{view-C3qPIXGX.d.cts → view-CaJs8WFH.d.cts} +5 -4
- package/dist/web/consent/index.cjs +1 -1
- package/dist/web/consent/index.d.cts +9 -8
- package/dist/web/consent/index.d.ts +9 -8
- package/dist/web/consent/index.js +1 -1
- package/dist/web/index.cjs +10 -10
- package/dist/web/index.d.cts +43 -19
- package/dist/web/index.d.ts +43 -19
- package/dist/web/index.js +10 -10
- package/dist/web/notifications/index.cjs +2 -2
- package/dist/web/notifications/index.d.cts +7 -6
- package/dist/web/notifications/index.d.ts +7 -6
- package/dist/web/notifications/index.js +2 -2
- package/dist/web/records/depth/index.cjs +2 -2
- package/dist/web/records/depth/index.d.cts +11 -10
- package/dist/web/records/depth/index.d.ts +11 -10
- package/dist/web/records/depth/index.js +2 -2
- package/dist/web/records/index.cjs +3 -3
- package/dist/web/records/index.d.cts +123 -14
- package/dist/web/records/index.d.ts +123 -14
- package/dist/web/records/index.js +3 -3
- package/dist/web/televet/booking/index.cjs +2 -0
- package/dist/web/televet/booking/index.d.cts +770 -0
- package/dist/web/televet/booking/index.d.ts +770 -0
- package/dist/web/televet/booking/index.js +2 -0
- package/dist/web/televet/call/index.cjs +1 -0
- package/dist/web/televet/call/index.d.cts +144 -0
- package/dist/web/televet/call/index.d.ts +144 -0
- package/dist/web/televet/call/index.js +1 -0
- package/dist/web/televet/index.cjs +1 -1
- package/dist/web/televet/index.d.cts +61 -9
- package/dist/web/televet/index.d.ts +61 -9
- package/dist/web/televet/index.js +1 -1
- package/package.json +74 -5
- package/televet/booking/package.json +8 -0
- package/televet/call/package.json +8 -0
- package/web/televet/booking/native-blocked.cjs +12 -0
- package/web/televet/booking/package.json +8 -0
- package/web/televet/call/native-blocked.cjs +12 -0
- package/web/televet/call/package.json +8 -0
- package/dist/entitlementRepository-DKdXFgTo.d.cts +0 -698
- package/dist/entitlementRepository-DSbzuyAW.d.ts +0 -698
- package/dist/typeStyle-0TydiZ1w.d.cts +0 -19
- package/dist/typeStyle-CWMsoe6b.d.ts +0 -19
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/** The fixed set of slot names, in the order the surfaces list them. */
|
|
2
|
+
declare const THEME_SLOT_NAMES: readonly ["composerInput", "sendButton", "userBubble", "assistantBubble", "recordCard", "vetVisitButton", "primaryButton", "link"];
|
|
3
|
+
type EverfurThemeSlotName = (typeof THEME_SLOT_NAMES)[number];
|
|
4
|
+
/** The allow-listed paint keys a slot accepts. */
|
|
5
|
+
declare const THEME_SLOT_KEYS: readonly ["backgroundColor", "borderColor", "borderRadius", "textColor"];
|
|
6
|
+
type EverfurThemeSlotKey = (typeof THEME_SLOT_KEYS)[number];
|
|
7
|
+
/** One slot's paint: every key optional; a key that is absent keeps the surface's own token. */
|
|
8
|
+
interface EverfurThemeSlot {
|
|
9
|
+
/** Normalized colour (`#RRGGBB` or `rgba(...)`). */
|
|
10
|
+
readonly backgroundColor?: string;
|
|
11
|
+
readonly borderColor?: string;
|
|
12
|
+
/** A corner radius in dp/px; never negative. */
|
|
13
|
+
readonly borderRadius?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Normalized colour; guarded at 4.5:1 against `backgroundColor`, or against the slot's default ground when the
|
|
16
|
+
* slot sets no background (see `guardSlotContrast`).
|
|
17
|
+
*/
|
|
18
|
+
readonly textColor?: string;
|
|
19
|
+
}
|
|
20
|
+
/** The slot map a resolved theme carries: only the slots that were set, each frozen. */
|
|
21
|
+
type EverfurThemeSlots = Readonly<Partial<Record<EverfurThemeSlotName, EverfurThemeSlot>>>;
|
|
22
|
+
/** The minimum text-on-background ratio a slot may paint (WCAG AA body text). */
|
|
23
|
+
declare const SLOT_MIN_CONTRAST = 4.5;
|
|
24
|
+
/**
|
|
25
|
+
* Parse an untrusted `slots` blob into the typed slot map. Unknown slot names and unknown keys are ignored, a
|
|
26
|
+
* malformed colour or radius is dropped, and a slot left with no valid key is dropped. Returns null when nothing
|
|
27
|
+
* valid remains (callers read null as "unset"). Never throws.
|
|
28
|
+
*/
|
|
29
|
+
declare function parseThemeSlots(json: unknown): EverfurThemeSlots | null;
|
|
30
|
+
/**
|
|
31
|
+
* Overlay `over` onto `base` slot by slot: a slot the overlay names REPLACES the base slot whole (the backend's
|
|
32
|
+
* overlay unit, so `slots.<name>` locks and overlays agree); a slot it does not name is kept. Either side may be
|
|
33
|
+
* null. Returns a frozen map (the same reference when one side is null or empty).
|
|
34
|
+
*/
|
|
35
|
+
declare function mergeThemeSlots(base: EverfurThemeSlots | null, over: EverfurThemeSlots | null): EverfurThemeSlots;
|
|
36
|
+
/** The minimum ratio a slot's edge may reach on its ground (WCAG 1.4.11, the boundary of a control). */
|
|
37
|
+
declare const SLOT_MIN_BORDER_CONTRAST = 3;
|
|
38
|
+
/**
|
|
39
|
+
* The ground each slot's text sits on when the slot sets no background of its own: the surface's default paint
|
|
40
|
+
* at that place, as the resolver knows it. Every slot lists at least one ground; a text colour must read on all
|
|
41
|
+
* of them (the link list names every ground a text link is drawn on).
|
|
42
|
+
*/
|
|
43
|
+
type SlotGrounds = Readonly<Record<EverfurThemeSlotName, readonly string[]>>;
|
|
44
|
+
/**
|
|
45
|
+
* The contrast guard: every text colour a slot paints must reach `SLOT_MIN_CONTRAST` on the ground it is drawn on,
|
|
46
|
+
* and every edge `SLOT_MIN_BORDER_CONTRAST` on the fill it bounds.
|
|
47
|
+
* - A TRANSLUCENT background whose seats straddle the white/black crossover is collapsed to the opaque colour
|
|
48
|
+
* it shows over the slot's primary ground FIRST (`collapseUnsatisfiableFill`), because such a slot has no
|
|
49
|
+
* readable ink while it means two colours at once. Everything below then measures against one seat.
|
|
50
|
+
* - A slot that supplies a background: its ink is measured on that fill AS THE EYE SEES IT (`seatsOf`, the fill
|
|
51
|
+
* composited onto the surface's default ground at that slot), and a missing or failing one is replaced by the
|
|
52
|
+
* ink that fill is guaranteed to carry (`legibleOn`), then pushed until it reads on every seat.
|
|
53
|
+
* - A slot without one: its `textColor` is measured on the slot's DEFAULT ground (`grounds`, the surface's own
|
|
54
|
+
* paint there) and, when it fails, pushed toward the legible pole of that ground until it reads, so a text-only
|
|
55
|
+
* slot can never paint invisible text either. Without `grounds` such a slot keeps its colour as supplied.
|
|
56
|
+
* - An edge (`borderColor`) is measured on the fill it bounds (the same seats) and pushed the same way when it
|
|
57
|
+
* reads below 3:1.
|
|
58
|
+
* Returns the same reference when nothing changes.
|
|
59
|
+
*/
|
|
60
|
+
declare function guardSlotContrast(slots: EverfurThemeSlots, grounds?: SlotGrounds): EverfurThemeSlots;
|
|
61
|
+
|
|
62
|
+
/** Recursively freeze a plain object/array tree in place and return it (typed as the input). */
|
|
63
|
+
declare function deepFreeze<T>(value: T): T;
|
|
64
|
+
/** Foreground text tokens; the semantic text ramp over surfaces. */
|
|
65
|
+
interface EverfurTextColorTokens {
|
|
66
|
+
readonly primary: string;
|
|
67
|
+
readonly secondary: string;
|
|
68
|
+
readonly muted: string;
|
|
69
|
+
/** The composer placeholder ink (the Everfur app's `rgba(61,61,61,0.75)`, 5:1 on cream; a lifted twin on dark). */
|
|
70
|
+
readonly placeholder: string;
|
|
71
|
+
/** Text drawn on the brand fill (a compiled default; resolve recomputes onPrimary/onAccent via WCAG). */
|
|
72
|
+
readonly onBrand: string;
|
|
73
|
+
readonly metaCool: string;
|
|
74
|
+
/** The message timestamp and copy glyph under a bubble (the Everfur app's footer ink; a lifted twin on dark). */
|
|
75
|
+
readonly timestamp: string;
|
|
76
|
+
}
|
|
77
|
+
/** The Everfur color system: brand + surfaces + text ramp + semantic palette + component washes. */
|
|
78
|
+
interface EverfurColorTokens {
|
|
79
|
+
readonly brand: string;
|
|
80
|
+
readonly brandSoft: string;
|
|
81
|
+
readonly brandSofter: string;
|
|
82
|
+
readonly brandBorder: string;
|
|
83
|
+
readonly borderHairlineGreen: string;
|
|
84
|
+
/**
|
|
85
|
+
* The brand at 55%: the edge of a FORM CONTROL (a text field, a text area, a radio) and of a floating card over
|
|
86
|
+
* the chat (the attachment popover, the Everfur app's). The resolver guarantees it reads at 3:1 (WCAG 1.4.11) on
|
|
87
|
+
* every ground a control sits on, pushing a partner brand that does not; `brandBorder` and `borderHairlineGreen`
|
|
88
|
+
* are decorative hairlines (1.4:1 and 1.6:1) and never the only edge of a control.
|
|
89
|
+
*/
|
|
90
|
+
readonly brandBorderStrong: string;
|
|
91
|
+
/**
|
|
92
|
+
* The brand as TEXT or ICON ink. The resolver derives it from `brand`, pushed toward black (light palette) or
|
|
93
|
+
* white (dark palette) until it reads at 4.5:1 on every ground of the palette, so a light partner colour
|
|
94
|
+
* (yellow, mint, sky) keeps its hue as a fill and still reads as a label. Never use `brand` itself as ink.
|
|
95
|
+
*/
|
|
96
|
+
readonly brandInk: string;
|
|
97
|
+
/**
|
|
98
|
+
* The ink of a TEXT LINK (citation titles, the disclaimer's links, "earlier messages", record document
|
|
99
|
+
* links): the `link` slot's text colour, else `accent`, guarded by the resolver at 4.5:1 on every ground a
|
|
100
|
+
* link sits on. `accent` is the link and highlight colour; this is its legible ink.
|
|
101
|
+
*/
|
|
102
|
+
readonly linkInk: string;
|
|
103
|
+
readonly surface: string;
|
|
104
|
+
readonly surfaceCream: string;
|
|
105
|
+
readonly surfaceSubtle: string;
|
|
106
|
+
readonly background: string;
|
|
107
|
+
readonly borderRingCream: string;
|
|
108
|
+
/**
|
|
109
|
+
* The chat ground: the surface the thread, the empty state and the composer sit on. White by default (the
|
|
110
|
+
* Everfur app's shell); `surface_style` picks it. Kept apart from `surfaceCream` so choosing a ground never
|
|
111
|
+
* repaints the composer or the record cards.
|
|
112
|
+
*/
|
|
113
|
+
readonly chatGround: string;
|
|
114
|
+
/** The composer pill's fill: the Everfur app's fixed cream, whatever `surface_style` picks for the ground. */
|
|
115
|
+
readonly composerFill: string;
|
|
116
|
+
/** The composer pill's edge: the brand at 75% (the Everfur app's, 5:1 on white). */
|
|
117
|
+
readonly composerBorder: string;
|
|
118
|
+
/** The colour of the soft lift under a floating control (the composer, the popover): the Everfur app's. */
|
|
119
|
+
readonly shadow: string;
|
|
120
|
+
readonly text: EverfurTextColorTokens;
|
|
121
|
+
/** The primary CTA fill (server-overridable via primary_color). Foreground is `onPrimary`. */
|
|
122
|
+
readonly primary: string;
|
|
123
|
+
/** WCAG-legible foreground for `primary` (computed by resolveTheme, never passed through). */
|
|
124
|
+
readonly onPrimary: string;
|
|
125
|
+
/** The user/CTA accent fill (server-overridable via accent_color). Foreground is `onAccent`. */
|
|
126
|
+
readonly accent: string;
|
|
127
|
+
/** WCAG-legible foreground for `accent` (computed by resolveTheme). */
|
|
128
|
+
readonly onAccent: string;
|
|
129
|
+
/** The 0.5px bubble edge (a lightened brand / success green for the default). */
|
|
130
|
+
readonly accentEdge: string;
|
|
131
|
+
readonly success: string;
|
|
132
|
+
readonly danger: string;
|
|
133
|
+
readonly errorRed: string;
|
|
134
|
+
readonly warningStrong: string;
|
|
135
|
+
readonly cautionAccent: string;
|
|
136
|
+
readonly riskConcern: string;
|
|
137
|
+
/**
|
|
138
|
+
* The three feedback thumbs under an assistant reply, the Everfur app's Figma strokes: `up` (helpful) green,
|
|
139
|
+
* `neutral` amber, `down` (not helpful) red. The stroke at rest and the fill once recorded.
|
|
140
|
+
*/
|
|
141
|
+
readonly sentiment: {
|
|
142
|
+
readonly up: string;
|
|
143
|
+
readonly neutral: string;
|
|
144
|
+
readonly down: string;
|
|
145
|
+
};
|
|
146
|
+
readonly badgeBgPositive: string;
|
|
147
|
+
readonly badgeBgCaution: string;
|
|
148
|
+
readonly badgeBgCritical: string;
|
|
149
|
+
readonly badgeBgNeutral: string;
|
|
150
|
+
/** user bubble = accent fill; assistant bubble = bare surface (the mobile/Flutter asymmetry). */
|
|
151
|
+
readonly bubbleUser: string;
|
|
152
|
+
readonly bubbleAssistant: string;
|
|
153
|
+
readonly skeleton: string;
|
|
154
|
+
readonly scanButtonPink: string;
|
|
155
|
+
readonly checkupCardLowRiskBg: string;
|
|
156
|
+
readonly checkupCardConcernBg: string;
|
|
157
|
+
}
|
|
158
|
+
/** Spacing scale (dp). */
|
|
159
|
+
interface EverfurSpaceTokens {
|
|
160
|
+
readonly xs: number;
|
|
161
|
+
readonly sm: number;
|
|
162
|
+
readonly md: number;
|
|
163
|
+
readonly lg: number;
|
|
164
|
+
readonly xl: number;
|
|
165
|
+
readonly xxl: number;
|
|
166
|
+
}
|
|
167
|
+
/** Corner-radius scale (dp); `pill` is an effectively-infinite radius. */
|
|
168
|
+
interface EverfurRadiusTokens {
|
|
169
|
+
readonly tile: number;
|
|
170
|
+
readonly xs: number;
|
|
171
|
+
readonly sm: number;
|
|
172
|
+
readonly md: number;
|
|
173
|
+
readonly lg: number;
|
|
174
|
+
readonly xl: number;
|
|
175
|
+
readonly pill: number;
|
|
176
|
+
}
|
|
177
|
+
interface EverfurTypeSizeTokens {
|
|
178
|
+
readonly nano: number;
|
|
179
|
+
readonly small: number;
|
|
180
|
+
readonly micro: number;
|
|
181
|
+
readonly tiny: number;
|
|
182
|
+
readonly caption: number;
|
|
183
|
+
readonly bodyTight: number;
|
|
184
|
+
readonly body: number;
|
|
185
|
+
readonly subtitle: number;
|
|
186
|
+
readonly heading: number;
|
|
187
|
+
readonly verdict: number;
|
|
188
|
+
}
|
|
189
|
+
/** Line-height multipliers (applied to a size to derive an absolute lineHeight). */
|
|
190
|
+
interface EverfurLineHeightTokens {
|
|
191
|
+
readonly tight: number;
|
|
192
|
+
readonly snug: number;
|
|
193
|
+
readonly normal: number;
|
|
194
|
+
readonly relaxed: number;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* RN-assignable font-weight literals. Typed as the exact string literals we ship (not bare `string`) so a
|
|
198
|
+
* consumer can spread a weight token straight into a `Text` style: React Native's `TextStyle['fontWeight']`
|
|
199
|
+
* accepts these, but rejects `string`. Kept framework-free (no react-native import) to hold the client layer's
|
|
200
|
+
* no-framework boundary - these three literals are a subset of RN's fontWeight union.
|
|
201
|
+
*/
|
|
202
|
+
type EverfurFontWeight = '400' | '500' | '700';
|
|
203
|
+
/** RN fontWeight tokens. */
|
|
204
|
+
interface EverfurWeightTokens {
|
|
205
|
+
readonly regular: EverfurFontWeight;
|
|
206
|
+
readonly medium: EverfurFontWeight;
|
|
207
|
+
readonly bold: EverfurFontWeight;
|
|
208
|
+
}
|
|
209
|
+
interface EverfurLetterSpacingTokens {
|
|
210
|
+
readonly eyebrow: number;
|
|
211
|
+
readonly monoWide: number;
|
|
212
|
+
readonly headerBrand: number;
|
|
213
|
+
readonly tight: number;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The faces a theme names: the three text weights and the three mono weights (the Everfur app registers
|
|
217
|
+
* `AzeretMono-Regular`, `-Medium` and `-Bold`). A missing weight falls back along its chain: bold -> medium ->
|
|
218
|
+
* regular, monoBold -> monoMedium -> mono.
|
|
219
|
+
*/
|
|
220
|
+
type EverfurFontFaceKey = 'regular' | 'medium' | 'bold' | 'mono' | 'monoMedium' | 'monoBold';
|
|
221
|
+
/**
|
|
222
|
+
* The text-scale tiers of the Everfur app (`fontScaling.ts`): how far a class of text may follow the user's text
|
|
223
|
+
* size. Flowing `content` (message bodies, card bodies, list rows) is never capped; the bounded chrome is:
|
|
224
|
+
* `heading` 2x, `control` (buttons) 1.8x, `compact` (chips, pills, inline meta) 1.5x, `badge` 1.3x.
|
|
225
|
+
*/
|
|
226
|
+
type EverfurTextScaleTier = 'content' | 'heading' | 'control' | 'compact' | 'badge';
|
|
227
|
+
/**
|
|
228
|
+
* The cap of each tier, React Native's `maxFontSizeMultiplier` semantics: 0 means no maximum. The Everfur app's
|
|
229
|
+
* values, verbatim. A tenant's `accessibility_max_font_scale` may lower the chrome tiers further, never content.
|
|
230
|
+
*/
|
|
231
|
+
declare const TEXT_SCALE_TIER_CAPS: Readonly<Record<EverfurTextScaleTier, number>>;
|
|
232
|
+
/** The family rendered at each face. Every entry is populated (the compiled default is the platform font). */
|
|
233
|
+
type EverfurFontFamilies = Readonly<Record<EverfurFontFaceKey, string>>;
|
|
234
|
+
/**
|
|
235
|
+
* Typography tokens. `families` is the family per face; a branding sets them through `fonts` (one registered
|
|
236
|
+
* face per weight, the Everfur app's own scheme) or the legacy single `font_family`, else the platform font.
|
|
237
|
+
* `family` / `mono` / `fontUrl` are aliases of the regular and mono entries, kept for every reader of the
|
|
238
|
+
* pre-`families` shape. A surface never reads these raw: `face(theme, weight)` (typeStyle.ts) picks the
|
|
239
|
+
* family and decides whether a numeric `fontWeight` belongs beside it.
|
|
240
|
+
*/
|
|
241
|
+
interface EverfurTypeTokens {
|
|
242
|
+
/** Alias of `families.regular`. */
|
|
243
|
+
readonly family: string;
|
|
244
|
+
/** Alias of `families.mono`. */
|
|
245
|
+
readonly mono: string;
|
|
246
|
+
/** Alias of `fontUrls.regular`; null unless an override supplies an https URL. */
|
|
247
|
+
readonly fontUrl: string | null;
|
|
248
|
+
readonly families: EverfurFontFamilies;
|
|
249
|
+
/**
|
|
250
|
+
* Per face: true when `families[face]` is a NAMED face from a `fonts` map (the weight is baked into the
|
|
251
|
+
* registered face, so `face()` sets no `fontWeight`); false when it is a base family (`font_family` or the
|
|
252
|
+
* platform font) that carries every weight and takes the numeric `weight` token.
|
|
253
|
+
*/
|
|
254
|
+
readonly namedFaces: Readonly<Record<EverfurFontFaceKey, boolean>>;
|
|
255
|
+
/** The brand-font URL per face (web only, `font_urls` / `font_url`); absent or null when none applies. */
|
|
256
|
+
readonly fontUrls: Readonly<Partial<Record<EverfurFontFaceKey, string | null>>>;
|
|
257
|
+
/**
|
|
258
|
+
* The type scale. On the web it ALREADY carries `scale` (CSS px do not follow the user's text setting on their
|
|
259
|
+
* own); on React Native it is the authored size, which the platform scales natively up to `maxScale`.
|
|
260
|
+
*/
|
|
261
|
+
readonly size: EverfurTypeSizeTokens;
|
|
262
|
+
readonly lineHeight: EverfurLineHeightTokens;
|
|
263
|
+
readonly weight: EverfurWeightTokens;
|
|
264
|
+
readonly letterSpacing: EverfurLetterSpacingTokens;
|
|
265
|
+
/**
|
|
266
|
+
* `size` per text-scale tier (`EverfurTextScaleTier`). On the web each tier carries the user's scale up to that
|
|
267
|
+
* tier's cap (`content` is `size` itself, uncapped); on React Native every tier is the authored `size` and the
|
|
268
|
+
* platform scales it natively under the tier's `maxFontSizeMultiplier` (`scaleCaps`, applied by the SDK's `Text`).
|
|
269
|
+
*/
|
|
270
|
+
readonly tierSizes: Readonly<Record<'content' | 'heading' | 'control' | 'compact' | 'badge', EverfurTypeSizeTokens>>;
|
|
271
|
+
/** The end user's effective text scale (their device setting, floored at `TEXT_SCALE_FLOOR`); 1 when unknown. */
|
|
272
|
+
readonly scale: number;
|
|
273
|
+
/**
|
|
274
|
+
* The tenant's cap on the CHROME tiers (`accessibility_max_font_scale`): 0 means none (the default), so the
|
|
275
|
+
* tier caps alone bound headings, controls, chips and badges. Flowing content is never capped.
|
|
276
|
+
*/
|
|
277
|
+
readonly maxScale: number;
|
|
278
|
+
/**
|
|
279
|
+
* The effective cap of each tier (`EverfurTextScaleTier`): the tier's own cap, lowered by `maxScale` for the
|
|
280
|
+
* chrome tiers; 0 means none (React Native's `maxFontSizeMultiplier` semantics).
|
|
281
|
+
*/
|
|
282
|
+
readonly scaleCaps: Readonly<Record<'content' | 'heading' | 'control' | 'compact' | 'badge', number>>;
|
|
283
|
+
}
|
|
284
|
+
interface EverfurSpringToken {
|
|
285
|
+
readonly damping: number;
|
|
286
|
+
readonly stiffness: number;
|
|
287
|
+
}
|
|
288
|
+
interface EverfurMotionDurationTokens {
|
|
289
|
+
readonly instant: number;
|
|
290
|
+
readonly fast: number;
|
|
291
|
+
readonly normal: number;
|
|
292
|
+
readonly slow: number;
|
|
293
|
+
}
|
|
294
|
+
/** Motion tokens. Under reduced-motion, resolveTheme collapses durations to 0 and stiffens the spring. */
|
|
295
|
+
interface EverfurMotionTokens {
|
|
296
|
+
readonly duration: EverfurMotionDurationTokens;
|
|
297
|
+
readonly spring: {
|
|
298
|
+
readonly gentle: EverfurSpringToken;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* The Everfur app's curves as CSS `cubic-bezier()` values: `standard` for most transitions, `emphasized` for an
|
|
302
|
+
* entrance that should draw the eye, `exit` for a leave. `EASING_CURVES` holds the same curves as numbers.
|
|
303
|
+
*/
|
|
304
|
+
readonly easing: {
|
|
305
|
+
readonly standard: string;
|
|
306
|
+
readonly emphasized: string;
|
|
307
|
+
readonly exit: string;
|
|
308
|
+
};
|
|
309
|
+
/** true when the resolved theme has collapsed motion (AccessibilityInfo reduced-motion). */
|
|
310
|
+
readonly reducedMotion: boolean;
|
|
311
|
+
}
|
|
312
|
+
/** Non-visual identity + partner copy carried on the theme (server display_name/logo_url/placeholder overlay). */
|
|
313
|
+
interface EverfurThemeMeta {
|
|
314
|
+
readonly displayName: string;
|
|
315
|
+
readonly logoUrl: string | null;
|
|
316
|
+
/** Server-overridable composer placeholder (chat_placeholder/placeholder); null keeps Everfur's neutral default. */
|
|
317
|
+
readonly placeholder: string | null;
|
|
318
|
+
/** White-label switch (hide_powered_by): drop the "powered by everfur" attribution. Default false (shown). */
|
|
319
|
+
readonly hidePoweredBy: boolean;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* The frozen, never-null theme the rn layer renders. Read a token as `theme.color.brand`,
|
|
323
|
+
* `theme.space.md`, `theme.type.size.body`, `theme.radius.lg`, `theme.motion.duration.fast`; a slot's paint
|
|
324
|
+
* as `theme.slots.userBubble?.backgroundColor`.
|
|
325
|
+
*/
|
|
326
|
+
interface EverfurTheme {
|
|
327
|
+
readonly brightness: 'light' | 'dark';
|
|
328
|
+
/** true when the user asked for more contrast (`prefers-contrast: more`) and the palette was derived for it. */
|
|
329
|
+
readonly highContrast: boolean;
|
|
330
|
+
readonly meta: EverfurThemeMeta;
|
|
331
|
+
readonly color: EverfurColorTokens;
|
|
332
|
+
readonly space: EverfurSpaceTokens;
|
|
333
|
+
readonly radius: EverfurRadiusTokens;
|
|
334
|
+
readonly type: EverfurTypeTokens;
|
|
335
|
+
readonly motion: EverfurMotionTokens;
|
|
336
|
+
/** Paint overrides at the named slots (empty by default); each text colour is contrast-guarded. */
|
|
337
|
+
readonly slots: EverfurThemeSlots;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* The tenant's chrome cap when it sets none (`accessibility_max_font_scale`): 0, no cap beyond the tiers of
|
|
341
|
+
* `TEXT_SCALE_TIER_CAPS`, the Everfur app's own policy.
|
|
342
|
+
*/
|
|
343
|
+
declare const DEFAULT_MAX_FONT_SCALE = 0;
|
|
344
|
+
/** The RN token that means "the platform font"; every face of the compiled default. */
|
|
345
|
+
declare const SYSTEM_FONT_FAMILY = "System";
|
|
346
|
+
/**
|
|
347
|
+
* The generic mono keyword of the compiled default. React Native on iOS has no family of that name, so the
|
|
348
|
+
* React Native host maps it per platform (Menlo on iOS); the web host maps it to its mono stack.
|
|
349
|
+
*/
|
|
350
|
+
declare const SYSTEM_MONO_FAMILY = "monospace";
|
|
351
|
+
/** A cubic-bezier as its four control values (`[x1, y1, x2, y2]`). */
|
|
352
|
+
type EverfurEasingCurve = readonly [number, number, number, number];
|
|
353
|
+
/** The Everfur app's easing curves (`src/motion/tokens.ts`), as numbers; `motion.easing` holds them as CSS. */
|
|
354
|
+
declare const EASING_CURVES: Readonly<Record<'standard' | 'emphasized' | 'exit', EverfurEasingCurve>>;
|
|
355
|
+
/** `cubic-bezier(x1, y1, x2, y2)` for a curve. */
|
|
356
|
+
declare function cssCubicBezier(curve: EverfurEasingCurve): string;
|
|
357
|
+
/** The compiled LIGHT default (deeply frozen). */
|
|
358
|
+
declare const EVERFUR_LIGHT: EverfurTheme;
|
|
359
|
+
/** The compiled DARK default (deeply frozen). */
|
|
360
|
+
declare const EVERFUR_DARK: EverfurTheme;
|
|
361
|
+
|
|
362
|
+
export { SLOT_MIN_CONTRAST as A, SYSTEM_FONT_FAMILY as B, SYSTEM_MONO_FAMILY as C, DEFAULT_MAX_FONT_SCALE as D, type EverfurTheme as E, type SlotGrounds as F, TEXT_SCALE_TIER_CAPS as G, cssCubicBezier as H, deepFreeze as I, guardSlotContrast as J, mergeThemeSlots as K, parseThemeSlots as L, SLOT_MIN_BORDER_CONTRAST as S, THEME_SLOT_KEYS as T, type EverfurFontWeight as a, type EverfurFontFaceKey as b, type EverfurThemeSlotName as c, type EverfurThemeSlots as d, type EverfurColorTokens as e, type EverfurFontFamilies as f, type EverfurLetterSpacingTokens as g, type EverfurLineHeightTokens as h, type EverfurMotionDurationTokens as i, type EverfurMotionTokens as j, type EverfurRadiusTokens as k, type EverfurSpaceTokens as l, type EverfurSpringToken as m, type EverfurTextColorTokens as n, type EverfurThemeMeta as o, type EverfurThemeSlot as p, type EverfurThemeSlotKey as q, type EverfurTypeSizeTokens as r, type EverfurTypeTokens as s, type EverfurWeightTokens as t, THEME_SLOT_NAMES as u, EASING_CURVES as v, EVERFUR_DARK as w, EVERFUR_LIGHT as x, type EverfurEasingCurve as y, type EverfurTextScaleTier as z };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { C as ClientBranding, E as EverfurThemeInput } from './branding-Xb_wL8N1.cjs';
|
|
2
|
+
import { E as EverfurTheme, a as EverfurFontWeight, b as EverfurFontFaceKey } from './tokens-CIngRkvt.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Overlay `b` onto `base`, field by field: a non-null branding field WINS; a null field KEEPS the base. A
|
|
6
|
+
* valid brightness re-selects the matching compiled palette (light/dark); an invalid/absent brightness leaves
|
|
7
|
+
* the base palette untouched. Slots merge per slot, per key. Returns a NEW deeply-frozen theme; `base` and `b`
|
|
8
|
+
* are never mutated.
|
|
9
|
+
*
|
|
10
|
+
* The name is historical (the server was once the only overlay); `resolveTheme` applies it twice, server then
|
|
11
|
+
* client, which is how the client wins per field. NOTE: foreground legibility (onPrimary/onAccent, the slot
|
|
12
|
+
* guard) and URL hardening are applied by `resolveTheme`, the total entry point. Call this directly only when
|
|
13
|
+
* you will finalize the result yourself.
|
|
14
|
+
*/
|
|
15
|
+
declare function withServerBranding(base: EverfurTheme, b: ClientBranding | null): EverfurTheme;
|
|
16
|
+
/**
|
|
17
|
+
* Inputs to the total theme resolve. All optional; `resolveTheme(undefined)` yields the compiled Everfur
|
|
18
|
+
* default. Merge order: compiled default <- server branding (render_hints) <- client theme prop, per field, with
|
|
19
|
+
* the tenant's locked fields and the attribution kept from the server (see `resolveTheme`).
|
|
20
|
+
*/
|
|
21
|
+
interface ResolveThemeInput {
|
|
22
|
+
/** Server-driven branding from the live entitlements render_hints (the tenant's console branding). */
|
|
23
|
+
readonly branding?: ClientBranding | null;
|
|
24
|
+
/**
|
|
25
|
+
* The clamped client `theme` prop. It WINS per cosmetic field over the server branding, except the fields the
|
|
26
|
+
* server lists in `locked_fields`. Its hidePoweredBy is IGNORED: whether the Everfur attribution shows is
|
|
27
|
+
* decided by server branding alone.
|
|
28
|
+
*/
|
|
29
|
+
readonly clientOverride?: ClientBranding | null;
|
|
30
|
+
/**
|
|
31
|
+
* The device color scheme (useColorScheme / `prefers-color-scheme`). Read ONLY when the settled brightness is
|
|
32
|
+
* `auto` (an explicit opt-in); with no brightness set anywhere the theme is light, as Everfur's own apps are.
|
|
33
|
+
*/
|
|
34
|
+
readonly colorScheme?: 'light' | 'dark' | null;
|
|
35
|
+
/** AccessibilityInfo reduced-motion / `prefers-reduced-motion`: collapses the motion tokens. */
|
|
36
|
+
readonly reducedMotion?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The user's text scale as the host reads it (React Native: `PixelRatio.getFontScale()`; the browser: the
|
|
39
|
+
* browser's default font size over 16px). Floored at `TEXT_SCALE_FLOOR`; absent or junk reads as 1. Flowing
|
|
40
|
+
* content follows it uncapped; each chrome tier follows it up to that tier's cap (`type.scaleCaps`).
|
|
41
|
+
*/
|
|
42
|
+
readonly textScale?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Multiply the type sizes by the effective scale, per tier (`type.size` for content, `type.tierSizes` for every
|
|
45
|
+
* tier). A browser host passes true (CSS px do not follow the user's setting on their own); a React Native host
|
|
46
|
+
* leaves it false and lets the platform scale every Text natively, capped per tier by `maxFontSizeMultiplier`.
|
|
47
|
+
*/
|
|
48
|
+
readonly scaleTypeSizes?: boolean;
|
|
49
|
+
/** The user asked for more contrast (`prefers-contrast: more`): the palette is derived by `deriveHighContrast`. */
|
|
50
|
+
readonly highContrast?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The family the platform's generic mono keyword (`SYSTEM_MONO_FAMILY`) maps to on this host. React Native on iOS
|
|
53
|
+
* has no family named `monospace` (a Text asking for it renders proportional, and the legacy architecture
|
|
54
|
+
* red-boxes in development), so the React Native host passes `Menlo` there. Applied to the compiled default mono
|
|
55
|
+
* only: a partner's own mono face is never touched. Absent or blank, the keyword stands (the web maps it to its
|
|
56
|
+
* mono stack in CSS).
|
|
57
|
+
*/
|
|
58
|
+
readonly platformMonoFamily?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a family name is registered with the platform, when the host can tell: true or false, else null. A
|
|
61
|
+
* NAMED face (one per-weight name, rendered without a weight) that the host reports unregistered falls back to
|
|
62
|
+
* the platform font of its group WITH its numeric weight, so medium and bold survive instead of every weight
|
|
63
|
+
* collapsing to the platform's regular. Only named faces are asked about; a throw reads as null.
|
|
64
|
+
*/
|
|
65
|
+
readonly isFontRegistered?: (family: string) => boolean | null;
|
|
66
|
+
}
|
|
67
|
+
/** The smallest effective text scale the resolver will report (a device may ask for less; the surfaces stop here). */
|
|
68
|
+
declare const TEXT_SCALE_FLOOR = 0.5;
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the final, legible, deeply-frozen theme. Never throws, never returns null/transparent.
|
|
71
|
+
*
|
|
72
|
+
* PRECEDENCE (per field, owner decision of 18 September 2026; the same rule EFBackend render_hint_fold states):
|
|
73
|
+
* a field in `locked_fields` (plus `hide_powered_by` always) is server-wins; every other cosmetic field is
|
|
74
|
+
* client-wins.
|
|
75
|
+
* - A server branding with an unknown `schema_version` is dropped whole (default plus client theme).
|
|
76
|
+
* - `hide_powered_by`, and every name the server lists in `locked_fields`, are SERVER-WINS: the client's value
|
|
77
|
+
* for such a field is discarded before the merge, so the server's value or the compiled default stands.
|
|
78
|
+
* `slots` in the list locks every slot; `slots.<name>` locks one.
|
|
79
|
+
* - Every other cosmetic field is CLIENT-WINS: the client `theme` prop overrides the console value, and the
|
|
80
|
+
* console fills the fields the prop leaves unset. Brightness is settled the same way; set nowhere, it is
|
|
81
|
+
* LIGHT (owner decision OD28: Everfur's own apps are light-only), and `auto` follows the device scheme.
|
|
82
|
+
* - Slots overlay slot by slot (a named slot replaces the one below it whole) in the same order, after the
|
|
83
|
+
* field precedence.
|
|
84
|
+
* Then the total-resolve guarantees: onPrimary/onAccent via WCAG, the slot contrast guard, https-only logo/font
|
|
85
|
+
* URLs, a non-empty displayName, the text scale (floored; tiered caps on the chrome), motion collapsed under reduced
|
|
86
|
+
* motion, and the high-contrast derivation when the user asked for it.
|
|
87
|
+
*/
|
|
88
|
+
declare function resolveTheme(input?: ResolveThemeInput): EverfurTheme;
|
|
89
|
+
/**
|
|
90
|
+
* The console's preview helper: resolve a draft branding exactly as the device would, from the raw shapes (the
|
|
91
|
+
* partner's `theme` prop and the server-shaped branding object the console is about to publish), with the device
|
|
92
|
+
* inputs of the preview. Pure and total: any shape is tolerated, nothing throws.
|
|
93
|
+
*/
|
|
94
|
+
declare function previewTheme(input: EverfurThemeInput | null, hints: unknown, options?: Omit<ResolveThemeInput, 'branding' | 'clientOverride'>): EverfurTheme;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The text style a surface spreads for one face. `fontWeight` is present ONLY for a base family (the platform
|
|
98
|
+
* font, the legacy `font_family`, or a `fonts` name repeated across weights); a named face carries its weight
|
|
99
|
+
* itself. The regular mono face carries no weight (code renders in the regular mono face); its medium and bold
|
|
100
|
+
* twins (`monoMedium`, `monoBold`) take theirs when the mono family is a base family.
|
|
101
|
+
*/
|
|
102
|
+
interface EverfurFaceStyle {
|
|
103
|
+
readonly fontFamily: string;
|
|
104
|
+
readonly fontWeight?: EverfurFontWeight;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The family (and, for a base family, the numeric weight) of one face of the theme. Spread it into a style:
|
|
108
|
+
* `{ ...face(theme, 'bold'), fontSize: theme.type.size.body }`. Pure and total over any resolved theme.
|
|
109
|
+
*/
|
|
110
|
+
declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
|
|
111
|
+
|
|
112
|
+
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, face as f, previewTheme as p, resolveTheme as r, withServerBranding as w };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { C as ClientBranding, E as EverfurThemeInput } from './branding-xpQ056sM.js';
|
|
2
|
+
import { E as EverfurTheme, a as EverfurFontWeight, b as EverfurFontFaceKey } from './tokens-CIngRkvt.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Overlay `b` onto `base`, field by field: a non-null branding field WINS; a null field KEEPS the base. A
|
|
6
|
+
* valid brightness re-selects the matching compiled palette (light/dark); an invalid/absent brightness leaves
|
|
7
|
+
* the base palette untouched. Slots merge per slot, per key. Returns a NEW deeply-frozen theme; `base` and `b`
|
|
8
|
+
* are never mutated.
|
|
9
|
+
*
|
|
10
|
+
* The name is historical (the server was once the only overlay); `resolveTheme` applies it twice, server then
|
|
11
|
+
* client, which is how the client wins per field. NOTE: foreground legibility (onPrimary/onAccent, the slot
|
|
12
|
+
* guard) and URL hardening are applied by `resolveTheme`, the total entry point. Call this directly only when
|
|
13
|
+
* you will finalize the result yourself.
|
|
14
|
+
*/
|
|
15
|
+
declare function withServerBranding(base: EverfurTheme, b: ClientBranding | null): EverfurTheme;
|
|
16
|
+
/**
|
|
17
|
+
* Inputs to the total theme resolve. All optional; `resolveTheme(undefined)` yields the compiled Everfur
|
|
18
|
+
* default. Merge order: compiled default <- server branding (render_hints) <- client theme prop, per field, with
|
|
19
|
+
* the tenant's locked fields and the attribution kept from the server (see `resolveTheme`).
|
|
20
|
+
*/
|
|
21
|
+
interface ResolveThemeInput {
|
|
22
|
+
/** Server-driven branding from the live entitlements render_hints (the tenant's console branding). */
|
|
23
|
+
readonly branding?: ClientBranding | null;
|
|
24
|
+
/**
|
|
25
|
+
* The clamped client `theme` prop. It WINS per cosmetic field over the server branding, except the fields the
|
|
26
|
+
* server lists in `locked_fields`. Its hidePoweredBy is IGNORED: whether the Everfur attribution shows is
|
|
27
|
+
* decided by server branding alone.
|
|
28
|
+
*/
|
|
29
|
+
readonly clientOverride?: ClientBranding | null;
|
|
30
|
+
/**
|
|
31
|
+
* The device color scheme (useColorScheme / `prefers-color-scheme`). Read ONLY when the settled brightness is
|
|
32
|
+
* `auto` (an explicit opt-in); with no brightness set anywhere the theme is light, as Everfur's own apps are.
|
|
33
|
+
*/
|
|
34
|
+
readonly colorScheme?: 'light' | 'dark' | null;
|
|
35
|
+
/** AccessibilityInfo reduced-motion / `prefers-reduced-motion`: collapses the motion tokens. */
|
|
36
|
+
readonly reducedMotion?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The user's text scale as the host reads it (React Native: `PixelRatio.getFontScale()`; the browser: the
|
|
39
|
+
* browser's default font size over 16px). Floored at `TEXT_SCALE_FLOOR`; absent or junk reads as 1. Flowing
|
|
40
|
+
* content follows it uncapped; each chrome tier follows it up to that tier's cap (`type.scaleCaps`).
|
|
41
|
+
*/
|
|
42
|
+
readonly textScale?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Multiply the type sizes by the effective scale, per tier (`type.size` for content, `type.tierSizes` for every
|
|
45
|
+
* tier). A browser host passes true (CSS px do not follow the user's setting on their own); a React Native host
|
|
46
|
+
* leaves it false and lets the platform scale every Text natively, capped per tier by `maxFontSizeMultiplier`.
|
|
47
|
+
*/
|
|
48
|
+
readonly scaleTypeSizes?: boolean;
|
|
49
|
+
/** The user asked for more contrast (`prefers-contrast: more`): the palette is derived by `deriveHighContrast`. */
|
|
50
|
+
readonly highContrast?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The family the platform's generic mono keyword (`SYSTEM_MONO_FAMILY`) maps to on this host. React Native on iOS
|
|
53
|
+
* has no family named `monospace` (a Text asking for it renders proportional, and the legacy architecture
|
|
54
|
+
* red-boxes in development), so the React Native host passes `Menlo` there. Applied to the compiled default mono
|
|
55
|
+
* only: a partner's own mono face is never touched. Absent or blank, the keyword stands (the web maps it to its
|
|
56
|
+
* mono stack in CSS).
|
|
57
|
+
*/
|
|
58
|
+
readonly platformMonoFamily?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a family name is registered with the platform, when the host can tell: true or false, else null. A
|
|
61
|
+
* NAMED face (one per-weight name, rendered without a weight) that the host reports unregistered falls back to
|
|
62
|
+
* the platform font of its group WITH its numeric weight, so medium and bold survive instead of every weight
|
|
63
|
+
* collapsing to the platform's regular. Only named faces are asked about; a throw reads as null.
|
|
64
|
+
*/
|
|
65
|
+
readonly isFontRegistered?: (family: string) => boolean | null;
|
|
66
|
+
}
|
|
67
|
+
/** The smallest effective text scale the resolver will report (a device may ask for less; the surfaces stop here). */
|
|
68
|
+
declare const TEXT_SCALE_FLOOR = 0.5;
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the final, legible, deeply-frozen theme. Never throws, never returns null/transparent.
|
|
71
|
+
*
|
|
72
|
+
* PRECEDENCE (per field, owner decision of 18 September 2026; the same rule EFBackend render_hint_fold states):
|
|
73
|
+
* a field in `locked_fields` (plus `hide_powered_by` always) is server-wins; every other cosmetic field is
|
|
74
|
+
* client-wins.
|
|
75
|
+
* - A server branding with an unknown `schema_version` is dropped whole (default plus client theme).
|
|
76
|
+
* - `hide_powered_by`, and every name the server lists in `locked_fields`, are SERVER-WINS: the client's value
|
|
77
|
+
* for such a field is discarded before the merge, so the server's value or the compiled default stands.
|
|
78
|
+
* `slots` in the list locks every slot; `slots.<name>` locks one.
|
|
79
|
+
* - Every other cosmetic field is CLIENT-WINS: the client `theme` prop overrides the console value, and the
|
|
80
|
+
* console fills the fields the prop leaves unset. Brightness is settled the same way; set nowhere, it is
|
|
81
|
+
* LIGHT (owner decision OD28: Everfur's own apps are light-only), and `auto` follows the device scheme.
|
|
82
|
+
* - Slots overlay slot by slot (a named slot replaces the one below it whole) in the same order, after the
|
|
83
|
+
* field precedence.
|
|
84
|
+
* Then the total-resolve guarantees: onPrimary/onAccent via WCAG, the slot contrast guard, https-only logo/font
|
|
85
|
+
* URLs, a non-empty displayName, the text scale (floored; tiered caps on the chrome), motion collapsed under reduced
|
|
86
|
+
* motion, and the high-contrast derivation when the user asked for it.
|
|
87
|
+
*/
|
|
88
|
+
declare function resolveTheme(input?: ResolveThemeInput): EverfurTheme;
|
|
89
|
+
/**
|
|
90
|
+
* The console's preview helper: resolve a draft branding exactly as the device would, from the raw shapes (the
|
|
91
|
+
* partner's `theme` prop and the server-shaped branding object the console is about to publish), with the device
|
|
92
|
+
* inputs of the preview. Pure and total: any shape is tolerated, nothing throws.
|
|
93
|
+
*/
|
|
94
|
+
declare function previewTheme(input: EverfurThemeInput | null, hints: unknown, options?: Omit<ResolveThemeInput, 'branding' | 'clientOverride'>): EverfurTheme;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The text style a surface spreads for one face. `fontWeight` is present ONLY for a base family (the platform
|
|
98
|
+
* font, the legacy `font_family`, or a `fonts` name repeated across weights); a named face carries its weight
|
|
99
|
+
* itself. The regular mono face carries no weight (code renders in the regular mono face); its medium and bold
|
|
100
|
+
* twins (`monoMedium`, `monoBold`) take theirs when the mono family is a base family.
|
|
101
|
+
*/
|
|
102
|
+
interface EverfurFaceStyle {
|
|
103
|
+
readonly fontFamily: string;
|
|
104
|
+
readonly fontWeight?: EverfurFontWeight;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The family (and, for a base family, the numeric weight) of one face of the theme. Spread it into a style:
|
|
108
|
+
* `{ ...face(theme, 'bold'), fontSize: theme.type.size.body }`. Pure and total over any resolved theme.
|
|
109
|
+
*/
|
|
110
|
+
declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
|
|
111
|
+
|
|
112
|
+
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, face as f, previewTheme as p, resolveTheme as r, withServerBranding as w };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.cjs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-
|
|
2
|
+
import { a6 as RecordsClinicSearchInput, a7 as RecordsClinicSearchPage, a8 as RecordsRecentClinicsInput, a9 as RecordsAuthorizationCopy, aa as CreateClinicRequestInput, ab as RecordsSignatureUploadPolicy, l as RecordsClinic, P as RecordsClinicBatch, Q as RecordsClinicBatchClient, m as RecordsDepthClient } from './depth-B3NFKlF9.cjs';
|
|
3
|
+
import { E as EverfurResult } from './EverfurResult-ZtH-YV1h.cjs';
|
|
4
|
+
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-Bn2z0NNo.cjs';
|
|
5
|
+
import { E as EverfurError } from './EverfurError-DmELDpXp.cjs';
|
|
5
6
|
|
|
6
7
|
interface RecordsClinicController {
|
|
7
8
|
searchClinics(input?: RecordsClinicSearchInput): Promise<EverfurResult<RecordsClinicSearchPage>>;
|
|
@@ -126,6 +127,15 @@ type RecordsScreen = {
|
|
|
126
127
|
readonly clinic: ClinicDraft;
|
|
127
128
|
} | {
|
|
128
129
|
readonly name: 'upload';
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Every upload and clinic request for the pet, each with its own status: the consumer's
|
|
133
|
+
* `RecordsRequestListScreen` (everfur-mobile src/features/records/ui/RecordsRequestListScreen.tsx, the
|
|
134
|
+
* `/records/requests` route the dashboard's `RecordsRequestsStatusCard` opens). On the web it is the
|
|
135
|
+
* records page's own request list.
|
|
136
|
+
*/
|
|
137
|
+
| {
|
|
138
|
+
readonly name: 'requests';
|
|
129
139
|
};
|
|
130
140
|
interface RecordsNavState {
|
|
131
141
|
readonly stack: readonly RecordsScreen[];
|
|
@@ -187,9 +197,18 @@ type RecordsAskHandler = (prompt: string, entityRef: RecordsAskEntityRef) => voi
|
|
|
187
197
|
|
|
188
198
|
type ClinicLocation = NonNullable<RecordsClinicSearchInput['location']>;
|
|
189
199
|
|
|
190
|
-
|
|
200
|
+
/**
|
|
201
|
+
* What a URL handed to `onOpenUrl` is: a revocable share link, the full record PDF (a short-lived presigned
|
|
202
|
+
* GET), or one file the member uploaded onto a request (`request_document`, web only; also short-lived).
|
|
203
|
+
*/
|
|
204
|
+
type RecordsUrlKind = 'share_link' | 'record_pdf' | 'request_document';
|
|
191
205
|
interface RecordsHostSeams {
|
|
192
|
-
/**
|
|
206
|
+
/**
|
|
207
|
+
* Share a link, or save or preview a file, your app's way. Default, which never leaves your app: React
|
|
208
|
+
* Native shares the link through the OS share sheet (`Share.share`) and offers the PDF's short-lived link
|
|
209
|
+
* the same way (pass this seam to share the FILE, e.g. expo-file-system + expo-sharing); the web shares
|
|
210
|
+
* the link with `navigator.share`, else copies it, and saves a file in place with no new tab.
|
|
211
|
+
*/
|
|
193
212
|
readonly onOpenUrl?: (url: string, kind: RecordsUrlKind) => void | Promise<void>;
|
|
194
213
|
/** Copy a share link. Web default: `navigator.clipboard.writeText`; React Native has no default (see above). */
|
|
195
214
|
readonly onCopy?: (text: string) => Promise<void>;
|