@bloxwap/hig 0.9.0 → 0.9.1

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.
Files changed (68) hide show
  1. package/README.md +1 -0
  2. package/chart/README.md +3 -4
  3. package/chart/dist/altimeter-burst.d.ts +2 -2
  4. package/chart/dist/altimeter-burst.js +8 -7
  5. package/chart/dist/altimeter-chart.d.ts +13 -3
  6. package/chart/dist/altimeter-chart.js +37 -12
  7. package/chart/dist/altimeter-core.d.ts +21 -0
  8. package/chart/dist/altimeter-core.js +13 -0
  9. package/chart/dist/altimeter-targets.d.ts +3 -2
  10. package/chart/dist/altimeter-targets.js +7 -7
  11. package/chart/dist/index.d.ts +2 -2
  12. package/chart/dist/outcome-chart.d.ts +4 -2
  13. package/chart/dist/outcome-chart.js +9 -6
  14. package/chart/dist/outcome-model.d.ts +14 -1
  15. package/chart/dist/outcome-model.js +12 -4
  16. package/contracts/README.md +1 -1
  17. package/feedback/README.md +1 -1
  18. package/native/README.md +1 -1
  19. package/native/dist/address-readout.d.ts +9 -0
  20. package/native/dist/address-readout.js +22 -0
  21. package/native/dist/blocks.d.ts +2 -1
  22. package/native/dist/blocks.js +2 -1
  23. package/native/dist/chart.d.ts +20 -0
  24. package/native/dist/chart.js +161 -0
  25. package/native/dist/claim-reward-block.d.ts +22 -0
  26. package/native/dist/claim-reward-block.js +16 -0
  27. package/native/dist/confirm-block.d.ts +1 -5
  28. package/native/dist/confirm-block.js +5 -16
  29. package/native/dist/deposit-block.js +5 -2
  30. package/native/dist/gesture-sheet.js +1 -1
  31. package/native/dist/language-block.js +1 -1
  32. package/native/dist/manage-position-block.d.ts +7 -0
  33. package/native/dist/manage-position-block.js +29 -28
  34. package/native/dist/modal-radius.d.ts +2 -0
  35. package/native/dist/modal-radius.js +2 -0
  36. package/native/dist/overlay.d.ts +6 -2
  37. package/native/dist/overlay.js +7 -5
  38. package/native/dist/positions-block.d.ts +28 -0
  39. package/native/dist/positions-block.js +15 -0
  40. package/native/dist/screen-header.d.ts +3 -1
  41. package/native/dist/screen-header.js +2 -2
  42. package/native/dist/status.js +3 -2
  43. package/native-fonts/README.md +1 -1
  44. package/og-fonts/README.md +1 -1
  45. package/package.json +32 -12
  46. package/react/README.md +1 -1
  47. package/react/dist/blocks/address-readout.d.ts +9 -0
  48. package/react/dist/blocks/address-readout.js +16 -0
  49. package/react/dist/blocks/claim-reward-block.d.ts +22 -0
  50. package/react/dist/blocks/claim-reward-block.js +10 -0
  51. package/react/dist/blocks/confirm-block.d.ts +1 -5
  52. package/react/dist/blocks/confirm-block.js +3 -13
  53. package/react/dist/blocks/deposit-block.js +5 -2
  54. package/react/dist/blocks/login-block.d.ts +15 -3
  55. package/react/dist/blocks/login-block.js +22 -7
  56. package/react/dist/blocks/manage-position-block.d.ts +7 -0
  57. package/react/dist/blocks/manage-position-block.js +9 -4
  58. package/react/dist/blocks/positions-block.d.ts +28 -0
  59. package/react/dist/blocks/positions-block.js +14 -0
  60. package/react/dist/blocks.d.ts +2 -1
  61. package/react/dist/blocks.js +2 -1
  62. package/react/dist/gesture-sheet.js +6 -2
  63. package/react/dist/styles.css +170 -37
  64. package/tokens/README.md +1 -1
  65. package/native/dist/explainer-block.d.ts +0 -91
  66. package/native/dist/explainer-block.js +0 -34
  67. package/react/dist/blocks/explainer-block.d.ts +0 -80
  68. package/react/dist/blocks/explainer-block.js +0 -20
@@ -0,0 +1,161 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useId, useMemo, useRef, useState } from 'react';
3
+ import { AppState, View } from 'react-native';
4
+ import Svg, { Circle, Defs, G, Line, LinearGradient, Path, Rect, Stop, Text as SvgText } from 'react-native-svg';
5
+ import { tokens } from '@bloxwap/hig/tokens';
6
+ import { ALTIMETER_BURST_COOLDOWN_MS, ALTIMETER_FLOW_PX, ALTIMETER_SAMPLE_MS, ALTIMETER_TICK_PX, bitcoinPrice, gridPhase, labelDecimalsFor, ladderPrices, priceTween, smoothTrail, sparkGeometry, targetCrossings, targetLayout, tickSpacingFor, trailPoints, validTargets } from '@bloxwap/hig/chart/altimeter-core';
7
+ import { useColors, useHIG, useMessages, useNumberLocale } from './provider.js';
8
+ import { Text } from './surface.js';
9
+ export { bitcoinPrice };
10
+ const noTargets = [];
11
+ const validPrice = (p) => p != null && Number.isFinite(p) && p > 0;
12
+ const emptyFrame = { now: 0, display: NaN, mark: null, spacing: 1, anchor: 0, ticks: [], levels: new Map() };
13
+ function BurstEffect({ burst, now, x, y, width }) {
14
+ const progress = Math.min(1, (now - burst.start) / (tokens.motion.base * 2));
15
+ const travel = 1 - (1 - progress) ** 3;
16
+ const color = burst.color;
17
+ return _jsxs(G, { opacity: Math.min(1, (1 - progress) * 3), children: [progress < .5 && _jsx(Rect, { x: x - width / 2 - 10 * travel, y: y - 18 - 8 * travel, width: width + 20 * travel, height: 36 + 16 * travel, rx: 24, fill: "none", stroke: color, strokeWidth: 2, opacity: 1 - progress * 2 }), Array.from({ length: 24 }, (_, i) => {
18
+ const { dx, dy, distance, size } = sparkGeometry(i, burst.direction);
19
+ const cx = x + dx * (width / 2 - 3 + distance * travel), cy = y + dy * (15 + distance * travel);
20
+ return _jsxs(G, { children: [_jsx(Circle, { cx: cx, cy: cy, r: size, fill: color, opacity: .25 }), _jsx(Circle, { cx: cx, cy: cy, r: size / 2, fill: color })] }, i);
21
+ })] });
22
+ }
23
+ /** Native SVG price ladder, scrolling trail and position readout. Stops drawing and unsubscribes in the background. */
24
+ export function AltimeterChart({ summary, price, feed = bitcoinPrice, height = 320, priceOptions, position, targets = noTargets, targetLabelInsets, dgen, degen = dgen ?? false, ...view }) {
25
+ const colors = useColors(), { reducedMotion, monoFontFamily } = useHIG(), messages = useMessages(), locale = useNumberLocale();
26
+ const [width, setWidth] = useState(0), [frame, setFrame] = useState(emptyFrame), [stale, setStale] = useState(false);
27
+ const [active, setActive] = useState(AppState.currentState == null || AppState.currentState === 'active');
28
+ useEffect(() => { const sub = AppState.addEventListener('change', state => setActive(state === 'active')); return () => sub.remove(); }, []);
29
+ const levels = useMemo(() => validTargets(targets), [targets]);
30
+ const controlled = price !== undefined, latest = useRef(null);
31
+ const settings = useRef({ width, height, reducedMotion, degen, levels, targetLabelInsets });
32
+ useEffect(() => { settings.current = { width, height, reducedMotion, degen, levels, targetLabelInsets }; if (controlled)
33
+ latest.current = validPrice(price) ? price : null; }, [width, height, reducedMotion, degen, levels, targetLabelInsets, controlled, price]);
34
+ useEffect(() => {
35
+ if (controlled || !active) {
36
+ setStale(false);
37
+ return;
38
+ }
39
+ let alive = true, deadline;
40
+ const expire = () => { if (alive) {
41
+ latest.current = null;
42
+ setStale(true);
43
+ } };
44
+ const arm = () => { clearTimeout(deadline); deadline = setTimeout(expire, 30_000); };
45
+ latest.current = null;
46
+ setStale(false);
47
+ arm();
48
+ const stop = feed(p => { if (alive && validPrice(p)) {
49
+ latest.current = p;
50
+ setStale(false);
51
+ arm();
52
+ } }, expire);
53
+ return () => { alive = false; clearTimeout(deadline); stop(); };
54
+ }, [controlled, controlled ? undefined : feed, active]);
55
+ const hasSize = width > 0 && height > 0;
56
+ useEffect(() => {
57
+ if (!active || !hasSize)
58
+ return;
59
+ let raf = 0, last = -Infinity, sampled = -Infinity, lastBurst = -Infinity, previous = NaN, anchor = NaN, spacing = 0;
60
+ let ticks = [], burst;
61
+ const tween = priceTween(), layout = targetLayout(), crossings = targetCrossings();
62
+ const step = (now) => {
63
+ raf = requestAnimationFrame(step);
64
+ const { width, height, reducedMotion, levels, degen, targetLabelInsets } = settings.current, mark = latest.current;
65
+ // Bound SVG commits to 30 Hz. Reduced motion needs only the price sample cadence.
66
+ if (now - last < (reducedMotion ? ALTIMETER_SAMPLE_MS : 1000 / 30) - 1)
67
+ return;
68
+ const gap = now - last > 2000;
69
+ last = now;
70
+ if (gap || mark == null) {
71
+ ticks = [];
72
+ sampled = -Infinity;
73
+ tween.reset();
74
+ crossings.reset();
75
+ layout.reset();
76
+ burst = undefined;
77
+ }
78
+ const display = mark == null ? NaN : tween.update(mark, now, reducedMotion || gap);
79
+ if (mark != null) {
80
+ if (!spacing || Math.abs(display - anchor) > 40 * spacing) {
81
+ spacing = tickSpacingFor(display);
82
+ anchor = Math.round(display / spacing) * spacing;
83
+ }
84
+ if (now - sampled >= ALTIMETER_SAMPLE_MS) {
85
+ const keep = width / ALTIMETER_FLOW_PX * 1000 + 2000;
86
+ if (!ticks.length)
87
+ ticks = [{ t: now - keep, p: display }];
88
+ ticks = [...ticks, { t: now, p: display }];
89
+ while (ticks.length > 2 && ticks[1].t < now - keep)
90
+ ticks.shift();
91
+ sampled = now;
92
+ }
93
+ const hit = crossings.update(display, levels).at(-1);
94
+ if (hit && degen && !reducedMotion && now - lastBurst >= ALTIMETER_BURST_COOLDOWN_MS) {
95
+ burst = { start: now, direction: display > previous ? 'up' : 'down', color: hit.color };
96
+ lastBurst = now;
97
+ }
98
+ }
99
+ if (!degen || reducedMotion || (burst && now - burst.start >= tokens.motion.base * 2))
100
+ burst = undefined;
101
+ previous = display;
102
+ setFrame({ now, mark, display, anchor, spacing, ticks, levels: layout.update(levels, display, spacing, height, now, reducedMotion || gap, targetLabelInsets), burst });
103
+ };
104
+ raf = requestAnimationFrame(step);
105
+ return () => cancelAnimationFrame(raf);
106
+ }, [active, hasSize, controlled, controlled ? undefined : feed]);
107
+ const { now, display, mark, spacing, anchor, ticks } = frame, center = height / 2;
108
+ const digits = labelDecimalsFor(spacing, display);
109
+ const optionsKey = JSON.stringify(priceOptions ?? {});
110
+ const format = useMemo(() => new Intl.NumberFormat(locale, { style: 'currency', currency: 'USD', minimumFractionDigits: digits, maximumFractionDigits: digits, ...priceOptions }), [locale, digits, optionsKey]);
111
+ const pnlFormat = useMemo(() => new Intl.NumberFormat(locale, { style: 'currency', currency: priceOptions?.currency ?? 'USD', signDisplay: 'exceptZero' }), [locale, priceOptions?.currency]);
112
+ const percent = useMemo(() => new Intl.NumberFormat(locale, { style: 'percent', minimumFractionDigits: 2, maximumFractionDigits: 2, signDisplay: 'exceptZero' }), [locale]);
113
+ const capsule = position?.capsule;
114
+ const value = typeof capsule === 'object' ? capsule.returnRatio : capsule === 'pnl' ? position?.pnl : mark;
115
+ const reading = value != null && Number.isFinite(value) ? (typeof capsule === 'object' ? percent : capsule === 'pnl' ? pnlFormat : format).format(value) : '—';
116
+ const tone = (n) => !Number.isFinite(n) || n === 0 ? colors.muted : n > 0 ? colors.positive : colors.negative;
117
+ const pillColor = position ? tone(position.pnl) : colors.action;
118
+ const basis = position?.breakEvenPrice;
119
+ const lineColor = position ? tone(mark != null && validPrice(basis) ? (mark - basis) * (position.side === 'short' ? -1 : 1) : 0) : colors.action;
120
+ const pillWidth = Math.min(Math.max(0, width - 8), Math.max(110, reading.length * 10 + 20)), end = Math.max(0, width - 8 - pillWidth);
121
+ const yFor = (p) => center - (p - display) / spacing * ALTIMETER_TICK_PX;
122
+ const points = trailPoints(ticks, now, 18, end, yFor), parts = [];
123
+ smoothTrail(points, { moveTo: (x, y) => parts.push(`M${x} ${y}`), lineTo: (x, y) => parts.push(`L${x} ${y}`), bezierCurveTo: (a, b, c, d, x, y) => parts.push(`C${a} ${b} ${c} ${d} ${x} ${y}`) });
124
+ const last = points.at(-1);
125
+ if (last) {
126
+ const dx = (end - last[0]) / 3;
127
+ parts.push(`C${last[0] + dx} ${last[1]} ${end - dx} ${center} ${end} ${center}`);
128
+ }
129
+ const trail = parts.join(' '), basisY = validPrice(basis) ? yFor(basis) : center;
130
+ const grid = useMemo(() => {
131
+ const marks = [];
132
+ for (let x = 25; x < width + 54; x += 50)
133
+ for (let y = 25; y < height + 3; y += 50)
134
+ marks.push(`M${x - 3} ${y}h6M${x} ${y - 3}v6`);
135
+ return marks.join(' ');
136
+ }, [width, height]);
137
+ const reach = (center / ALTIMETER_TICK_PX + 1) * spacing;
138
+ // Labels and Intl formatting change only when the visible tick range or its format changes.
139
+ const low = Math.floor((display - reach - anchor) / spacing), high = Math.ceil((display + reach - anchor) / spacing);
140
+ const ladder = useMemo(() => Number.isFinite(low) && Number.isFinite(high)
141
+ ? ladderPrices(anchor, spacing, anchor + low * spacing, anchor + high * spacing).map(price => ({ price, label: format.format(price) }))
142
+ : [], [anchor, spacing, low, high, format]);
143
+ const targetTexts = useMemo(() => new Map(levels.map(level => [level.id, [level.label, format.format(level.price)].filter(Boolean).join(' ')])), [levels, format]);
144
+ const bounds = Array.from(frame.levels.values());
145
+ const id = useId().replace(/[^a-zA-Z0-9_-]/g, ''), fade = 'trail' + id, shade = 'basis' + id;
146
+ const status = stale ? messages.stale : messages.loadingChart;
147
+ const label = [summary, mark == null ? status : reading, ...targetTexts.values()].join('. ');
148
+ const burst = degen && !reducedMotion ? frame.burst : undefined;
149
+ const shake = burst && now - burst.start < tokens.motion.base ? Math.sin((now - burst.start) / 18) * 3 * (1 - (now - burst.start) / tokens.motion.base) : 0;
150
+ return _jsxs(View, { ...view, children: [_jsx(Text, { children: summary }), _jsx(View, { accessible: true, accessibilityLabel: label, accessibilityRole: "image", onLayout: e => setWidth(e.nativeEvent.layout.width), style: { height, overflow: 'hidden', borderRadius: tokens.radius.xl, backgroundColor: colors.background }, children: width > 0 && _jsxs(Svg, { width: width, height: height, accessible: false, children: [_jsxs(Defs, { children: [_jsxs(LinearGradient, { id: fade, gradientUnits: "userSpaceOnUse", x1: 18, x2: end, y1: 0, y2: 0, children: [_jsx(Stop, { offset: 0, stopColor: lineColor, stopOpacity: 0 }), _jsx(Stop, { offset: 1, stopColor: lineColor })] }), validPrice(display) && validPrice(basis) && basisY !== center && _jsxs(LinearGradient, { id: shade, gradientUnits: "userSpaceOnUse", x1: 0, x2: 0, y1: center, y2: Math.min(height, Math.max(0, basisY)), children: [_jsx(Stop, { offset: 0, stopColor: lineColor, stopOpacity: .5 }), _jsx(Stop, { offset: 1, stopColor: lineColor, stopOpacity: 0 })] })] }), _jsx(Path, { d: grid, translateX: reducedMotion ? 0 : gridPhase(now), stroke: colors.nested, fill: "none" }), ladder.map(({ price: p, label }) => {
151
+ const y = yFor(p), covered = bounds.some(l => l.labelTop != null && y + 7 > l.labelTop - 2 && y - 7 < l.labelTop + 20);
152
+ return _jsxs(G, { opacity: .75, children: [_jsx(Path, { d: `M10 ${y}h8M${width - 18} ${y}h8`, stroke: colors.muted }), !covered && _jsx(SvgText, { x: width - 32, y: y + 4, textAnchor: "end", fontFamily: monoFontFamily, fontSize: 13, fill: colors.muted, children: label })] }, p);
153
+ }), trail && validPrice(basis) && basisY !== center ? _jsx(Path, { d: `${trail}L${end} ${basisY}L${points[0][0]} ${basisY}Z`, fill: `url(#${shade})` }) : null, trail ? _jsx(Path, { d: trail, stroke: `url(#${fade})`, strokeWidth: 2.5, fill: "none" }) : null, levels.map(l => {
154
+ const pos = frame.levels.get(l.id);
155
+ if (!pos)
156
+ return null;
157
+ const color = l.color ?? colors.action;
158
+ return _jsxs(G, { children: [!pos.pinned && _jsx(Line, { x1: 0, x2: width, y1: pos.y, y2: pos.y, stroke: color, strokeDasharray: "3 4" }), l.label && pos.labelTop != null && _jsx(SvgText, { x: width - 8, y: pos.labelTop + 14, textAnchor: "end", fontSize: 12, fill: color, children: targetTexts.get(l.id) })] }, l.id);
159
+ }), mark == null ? _jsx(SvgText, { x: width / 2, y: center, textAnchor: "middle", fill: colors.muted, children: status }) :
160
+ _jsxs(G, { translateX: shake, children: [_jsx(Rect, { x: end, y: center - 18, width: pillWidth, height: 36, rx: 18, fill: colors.background, stroke: pillColor }), _jsx(SvgText, { x: end + pillWidth / 2, y: center + 5, textAnchor: "middle", fontFamily: monoFontFamily, fontSize: 16, fontWeight: "600", fill: pillColor, children: reading })] }), burst && _jsx(BurstEffect, { burst: { ...burst, color: burst.color ?? colors.action }, now: now, x: end + pillWidth / 2, y: center, width: pillWidth })] }) })] });
161
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ export interface ClaimRewardBlockProps {
3
+ amount: number;
4
+ symbol: string;
5
+ walletAddress: string;
6
+ chain: string;
7
+ details?: readonly {
8
+ label: string;
9
+ value: string;
10
+ }[];
11
+ labels: {
12
+ title: string;
13
+ claim: string;
14
+ cancel: string;
15
+ wallet: string;
16
+ chain: string;
17
+ };
18
+ /** Open the host's confirmation screen for this prize. */
19
+ onClaim: () => void;
20
+ onCancel: () => void;
21
+ }
22
+ export declare function ClaimRewardBlock({ amount, symbol, walletAddress, chain, details, labels, onClaim, onCancel }: ClaimRewardBlockProps): React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ import { AnimatedNumberReadout } from './animated-number.js';
4
+ import { Button } from './button.js';
5
+ import { ScreenHeader } from './screen-header.js';
6
+ import { Stack, Text } from './surface.js';
7
+ import { AddressReadout } from './address-readout.js';
8
+ export function ClaimRewardBlock({ amount, symbol, walletAddress, chain, details, labels, onClaim, onCancel }) {
9
+ const disabled = !Number.isFinite(amount) || amount <= 0 || !walletAddress.trim() || !chain.trim();
10
+ const info = [
11
+ ...(details ?? []),
12
+ { label: labels.wallet, value: walletAddress, address: true },
13
+ { label: labels.chain, value: chain },
14
+ ];
15
+ return _jsxs(Stack, { children: [_jsx(ScreenHeader, { title: labels.title }), _jsxs(View, { style: { flexDirection: 'row', alignItems: 'baseline', justifyContent: 'center', flexWrap: 'wrap', gap: 8 }, children: [_jsx(AnimatedNumberReadout, { value: amount, options: { maximumFractionDigits: 6 }, style: { fontSize: 44, lineHeight: 50, fontWeight: '700' } }), _jsx(Text, { tone: "muted", style: { fontSize: 24, fontWeight: '600' }, children: symbol })] }), _jsx(View, { style: { gap: 12, paddingHorizontal: 4 }, children: info.map(detail => _jsxs(View, { accessible: true, accessibilityLabel: `${detail.label}, ${detail.value}`, style: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'baseline', justifyContent: 'space-between', gap: 8 }, children: [_jsx(Text, { tone: "muted", children: detail.label }), _jsx(View, { style: { marginStart: 'auto', maxWidth: '100%' }, children: detail.address ? _jsx(AddressReadout, { address: walletAddress }) : _jsx(Text, { children: detail.value }) })] }, detail.label)) }), _jsxs(View, { style: { flexDirection: 'row', gap: 8 }, children: [_jsx(Button, { style: { flex: 1 }, intent: "secondary", onPress: onCancel, children: labels.cancel }), _jsx(Button, { style: { flex: 1 }, disabled: disabled, onPress: onClaim, children: labels.claim })] })] });
16
+ }
@@ -89,10 +89,6 @@ export interface ConfirmBlockProps {
89
89
  /** Prefix of the test IDs: `<testID>-header`, `-amount`, `-symbol`, `-to`, `-network`, `-detail-<index>`, `-body`, `-point-<index>`, `-warning`, `-confirm`, `-cancel` and `-tertiary`. Defaults to `confirm`. `confirmTestID`, `cancelTestID` and `tertiaryAction.testID` replace the last three one by one. */
90
90
  testID?: string;
91
91
  }
92
- /** The address as the two rows the block draws: split at the middle, with `anchor` on the characters people compare, the first 4 (6 when it starts with `0x`) and the last 4. An address too short to have a middle is all anchor. */
93
- export declare function confirmAddressRows(address: string): {
94
- text: string;
95
- anchor: boolean;
96
- }[][];
92
+ export { confirmAddressRows } from './address-readout.js';
97
93
  /** The last look before a send: the amount as the headline, where it goes and on which network, a warning that it cannot be taken back, then Cancel and Confirm side by side. Without an amount, address or network it confirms anything else, such as signing out or deleting an account: the header, `children`, then the actions. */
98
94
  export declare function ConfirmBlock({ amount, symbol, amountOptions, amountLabel, address, network, details, oneLineDetails, children, points, confirmIntent, tertiaryAction, title, warningTitle, warning, notice, onConfirm, confirmLabel, busy, confirmDisabled, cancelWhileBusy, backWhileBusy, onCancel, cancelLabel, cancelDisabled, confirmTestID, cancelTestID, onBack, backProps, headerAction, stickyHeader, stickyHeaderBackground, scrollComponent, headingId, testID }: ConfirmBlockProps): React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import { Platform, View } from 'react-native';
2
+ import { AddressReadout } from './address-readout.js';
3
+ import { View } from 'react-native';
4
4
  import { withAlpha } from '@bloxwap/hig/tokens';
5
5
  import { useColors, useHIG, useMessages } from './provider.js';
6
6
  import { Text } from './surface.js';
@@ -8,25 +8,14 @@ import { Button } from './button.js';
8
8
  import { AnimatedNumberReadout } from './animated-number.js';
9
9
  import { ScreenHeader } from './screen-header.js';
10
10
  import { StickyHeaderLayout } from './sticky-header.js';
11
+ export { confirmAddressRows } from './address-readout.js';
11
12
  const amountFormat = { maximumFractionDigits: 6 };
12
- /** The address as the two rows the block draws: split at the middle, with `anchor` on the characters people compare, the first 4 (6 when it starts with `0x`) and the last 4. An address too short to have a middle is all anchor. */
13
- export function confirmAddressRows(address) {
14
- const characters = Array.from(address), head = address.startsWith('0x') ? 6 : 4, tail = characters.length - 4, split = Math.ceil(characters.length / 2);
15
- return [characters.slice(0, split), characters.slice(split)].map((row, rowIndex) => {
16
- const parts = [];
17
- row.forEach((character, index) => { const position = rowIndex * split + index, anchor = position < head || position >= tail, last = parts[parts.length - 1]; if (last && last.anchor === anchor)
18
- last.text += character;
19
- else
20
- parts.push({ text: character, anchor }); });
21
- return parts;
22
- });
23
- }
24
13
  /** The last look before a send: the amount as the headline, where it goes and on which network, a warning that it cannot be taken back, then Cancel and Confirm side by side. Without an amount, address or network it confirms anything else, such as signing out or deleting an account: the header, `children`, then the actions. */
25
14
  export function ConfirmBlock({ amount, symbol, amountOptions = amountFormat, amountLabel, address, network, details, oneLineDetails, children, points, confirmIntent = 'primary', tertiaryAction, title, warningTitle, warning, notice, onConfirm, confirmLabel, busy, confirmDisabled, cancelWhileBusy, backWhileBusy, onCancel, cancelLabel, cancelDisabled, confirmTestID, cancelTestID, onBack, backProps, headerAction, stickyHeader, stickyHeaderBackground, scrollComponent, headingId, testID = 'confirm' }) {
26
15
  // What busy holds besides the confirming action: Back, Cancel and the tertiary action, unless the host lets them leave the wait (Back alone with backWhileBusy).
27
16
  const held = !!busy && !cancelWhileBusy;
28
17
  const backHeld = held && !backWhileBusy;
29
- const colors = useColors(), t = useMessages(), { direction, monoFontFamily } = useHIG();
18
+ const colors = useColors(), t = useMessages(), { direction } = useHIG();
30
19
  const id = (part) => `${testID}-${part}`;
31
20
  const note = warning === undefined ? (address !== undefined ? t.sendWarning(symbol ?? '', network ?? '') : null) : warning;
32
21
  // Read-only lines, each read as one: "To, 0x…".
@@ -36,7 +25,7 @@ export function ConfirmBlock({ amount, symbol, amountOptions = amountFormat, amo
36
25
  const one = !!oneLineDetails && part !== toPart, lines = one ? 1 : undefined;
37
26
  return _jsxs(View, { accessible: true, accessibilityLabel: spoken !== undefined || typeof value === 'string' || typeof value === 'number' ? `${label}, ${spoken ?? value}` : undefined, style: { direction, flexDirection: 'row', alignItems: 'baseline', justifyContent: 'space-between', gap: 12 }, children: [_jsx(Text, { numberOfLines: lines, style: { ...(one ? { flexShrink: 0 } : null), fontSize: 16, lineHeight: 24, color: colors.muted }, children: label }), one || typeof value === 'string' || typeof value === 'number' ? _jsx(Text, { testID: id(part), numberOfLines: lines, ellipsizeMode: one ? 'tail' : undefined, style: { flexShrink: 1, fontSize: 16, lineHeight: 24, fontWeight: '500', textAlign: 'right', color: colors.text }, children: value }) : _jsx(View, { testID: id(part), style: { flexShrink: 1 }, children: value })] }, part);
38
27
  };
39
- const toPart = 'to', networkPart = 'network', mono = monoFontFamily ?? Platform.select({ ios: 'Menlo', default: 'monospace' }), type = { fontFamily: mono, fontSize: 15, lineHeight: 22 }, shown = address === undefined ? null : _jsx(Text, { accessible: false, maxFontSizeMultiplier: 1.2, style: { ...type, writingDirection: 'ltr', textAlign: 'left' }, children: confirmAddressRows(address).map((row, index) => _jsxs(React.Fragment, { children: [index > 0 ? '\n' : null, row.map((part, offset) => _jsx(Text, { maxFontSizeMultiplier: 1.2, style: { ...type, color: part.anchor ? colors.text : colors.muted, fontWeight: part.anchor ? '700' : '500' }, children: part.text }, offset))] }, index)) }), lines = [...(address !== undefined ? [line(toPart, t.sendTo, shown, address)] : []), ...(network !== undefined ? [line(networkPart, t.sendNetwork, network)] : []), ...(details ?? []).map((detail, index) => line(`detail-${index}`, detail.label, detail.value, detail.valueLabel))];
28
+ const toPart = 'to', networkPart = 'network', shown = address === undefined ? null : _jsx(AddressReadout, { address: address }), lines = [...(address !== undefined ? [line(toPart, t.sendTo, shown, address)] : []), ...(network !== undefined ? [line(networkPart, t.sendNetwork, network)] : []), ...(details ?? []).map((detail, index) => line(`detail-${index}`, detail.label, detail.value, detail.valueLabel))];
40
29
  const header = _jsx(ScreenHeader, { title: title ?? t.confirmSend, onBack: onBack, backDisabled: backHeld, backProps: backProps, action: headerAction, headingId: headingId, testID: testID });
41
30
  const hasBody = (children != null && children !== false) || !!points?.length;
42
31
  const tertiaryInert = held || !!tertiaryAction?.disabled;
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { QrCode } from '@bloxwap/icons/native/qr-code';
2
3
  import { depositIcon } from '@bloxwap/hig/tokens/deposit-icons';
3
4
  import { View } from 'react-native';
4
5
  import { SvgXml } from 'react-native-svg';
@@ -9,9 +10,11 @@ import { ScreenHeader } from './screen-header.js';
9
10
  export function DepositBlock({ title, description, methods, onSelect, onBack, headerAction, headingId }) {
10
11
  const messages = useMessages();
11
12
  const colors = useColors();
12
- return _jsxs(View, { style: { gap: 12 }, children: [_jsx(ScreenHeader, { title: title ?? messages.deposit, onBack: onBack, action: headerAction, headingId: headingId }), description && _jsx(Text, { style: { color: colors.muted, fontSize: 14, textAlign: 'center' }, children: description }), _jsx(ListGroup, { children: methods.map(method => {
13
+ const qr = methods.find(method => method.id === 'qr');
14
+ const orderedMethods = qr ? [qr, ...methods.filter(method => method.id !== 'qr')] : methods;
15
+ return _jsxs(View, { style: { gap: 12 }, children: [_jsx(ScreenHeader, { title: title ?? messages.deposit, onBack: onBack, action: headerAction, headingId: headingId }), description && _jsx(Text, { style: { color: colors.muted, fontSize: 14, textAlign: 'center' }, children: description }), _jsx(ListGroup, { children: orderedMethods.map(method => {
13
16
  const svg = depositIcon(method.id);
14
- const leading = method.icon ?? (svg && _jsx(SvgXml, { xml: svg, width: 44, height: 44 }));
17
+ const leading = method.icon ?? (method.id === 'qr' ? _jsx(View, { style: { width: 44, height: 44, borderRadius: 10, backgroundColor: colors.background, alignItems: "center", justifyContent: "center" }, children: _jsx(QrCode, { size: 24, color: colors.text }) }) : svg && _jsx(SvgXml, { xml: svg, width: 44, height: 44 }));
15
18
  return _jsx(ListRow, { leading: leading, label: method.label, description: method.description, disabled: method.disabled, onSelect: () => onSelect(method) }, method.id);
16
19
  }) })] });
17
20
  }
@@ -154,7 +154,7 @@ export function GestureSheet({ open, onOpenChange, title, description, children,
154
154
  const sheetFill = useMemo(() => ({ backgroundColor: colors.overlay, borderRadius: tokens.radius.xl, boxShadow: '0 -8px 32px #0008' }), [colors.overlay]);
155
155
  const sheetBackground = useMemo(() => backgroundStyle ? [sheetFill, backgroundStyle] : sheetFill, [sheetFill, backgroundStyle]);
156
156
  const sheetIndicator = useMemo(() => { const fill = { backgroundColor: colors.action }; return handleIndicatorStyle ? [fill, handleIndicatorStyle] : fill; }, [colors.action, handleIndicatorStyle]);
157
- const backendProps = { accessible: false, accessibilityLabel: title, index: presentation === 'inline' && !open ? -1 : presented.current ? Math.max(0, Math.min(activeIndex.current, detentCount - 1)) : startingIndex, snapPoints: enableDynamicSizing ? undefined : backendSnapPoints, enableDynamicSizing, maxDynamicContentSize: enableDynamicSizing ? maxDynamicContentSize : undefined, enableContentPanningGesture, enablePanDownToClose: dismissible, topInset: topInset ?? insets.top, bottomInset: bottomInset ?? insets.bottom, keyboardBehavior, keyboardBlurBehavior, android_keyboardInputMode, overrideReduceMotion: env.reducedMotion ? ReduceMotion.Always : ReduceMotion.System, animateOnMount, animationConfigs, backdropComponent: backdropComponent === undefined ? backdrop : backdropComponent, handleComponent, handleStyle, backgroundComponent, containerStyle, backgroundStyle: sheetBackground, handleIndicatorStyle: sheetIndicator, onChange: handleChange };
157
+ const backendProps = { style: { marginLeft: 8 + insets.left, marginRight: 8 + insets.right }, accessible: false, accessibilityLabel: title, index: presentation === 'inline' && !open ? -1 : presented.current ? Math.max(0, Math.min(activeIndex.current, detentCount - 1)) : startingIndex, snapPoints: enableDynamicSizing ? undefined : backendSnapPoints, enableDynamicSizing, maxDynamicContentSize: enableDynamicSizing ? maxDynamicContentSize : undefined, enableContentPanningGesture, enablePanDownToClose: dismissible, topInset: topInset ?? insets.top, bottomInset: bottomInset ?? insets.bottom, keyboardBehavior, keyboardBlurBehavior, android_keyboardInputMode, overrideReduceMotion: env.reducedMotion ? ReduceMotion.Always : ReduceMotion.System, animateOnMount, animationConfigs, backdropComponent: backdropComponent === undefined ? backdrop : backdropComponent, handleComponent, handleStyle, backgroundComponent, containerStyle, backgroundStyle: sheetBackground, handleIndicatorStyle: sheetIndicator, onChange: handleChange };
158
158
  const lifted = raised ? _jsx(Raised, { children: content }) : content;
159
159
  return presentation === 'inline' ? _jsx(BottomSheet, { ...backendProps, ref: inline, accessibilityElementsHidden: !open, importantForAccessibility: open ? 'auto' : 'no-hide-descendants', onClose: handleSettledClose, children: lifted }) : _jsx(BottomSheetModal, { ...backendProps, ref: sheet, enableDismissOnClose: true, stackBehavior: 'push', onDismiss: handleSettledClose, children: lifted });
160
160
  }
@@ -28,7 +28,7 @@ export function LanguageBlock({ title, onBack, headerAction, languages, value =
28
28
  const body = _jsxs(_Fragment, { children: [description ? _jsx(Text, { testID: testID ? `${testID}-description` : undefined, style: { paddingHorizontal: 4, fontSize: 14, lineHeight: 21, color: colors.muted }, children: description }) : null, search ? _jsx(SearchInput, { testID: testID ? `${testID}-search` : undefined, accessibilityLabel: t.searchLanguages, placeholder: t.searchLanguages, value: query, onChangeText: setQuery, returnKeyType: 'search', autoCapitalize: 'none', autoCorrect: false, spellCheck: false }) : null, rows.length === 0 ? _jsx(Text, { testID: testID ? `${testID}-empty` : undefined, accessibilityLiveRegion: 'polite', style: { paddingVertical: 32, textAlign: 'center', fontSize: 14, lineHeight: 20, color: colors.muted }, children: t.noResults }) :
29
29
  _jsx(View, { testID: testID ? `${testID}-list` : undefined, accessibilityRole: 'radiogroup', accessibilityLabel: heading, style: { gap: 4 }, children: rows.map(language => {
30
30
  const selected = language.code === value;
31
- return _jsxs(Pressable, { testID: testID ? `${testID}-${language.code}` : undefined, accessibilityRole: 'radio', accessibilityState: disabled ? { checked: selected, disabled: true } : { checked: selected }, accessibilityLabel: [language.name, language.description].filter(Boolean).join(', '), accessibilityLanguage: language.code, disabled: disabled, onPress: () => onSelect(language), style: disabled ? ({ pressed }) => ({ ...row(pressed), opacity: 0.5 }) : ({ pressed }) => row(pressed), children: [_jsx(View, { ...hidden, children: typeof language.flag === 'string' ? _jsx(Image, { accessible: false, accessibilityIgnoresInvertColors: true, source: { uri: language.flag }, style: shape }) : _jsx(View, { style: shape, children: language.flag ?? _jsx(Text, { accessible: false, maxFontSizeMultiplier: 1, style: { fontSize: 12, lineHeight: 16, fontWeight: '600', color: colors.muted }, children: language.code.slice(0, 2).toUpperCase() }) }) }), _jsxs(View, { ...hidden, style: { flex: 1, flexShrink: 1, minWidth: 0 }, children: [_jsx(Text, { style: { fontSize: 16, lineHeight: 24, fontWeight: '600', color: colors.text }, children: language.name }), language.description ? _jsx(Text, { style: { fontSize: 14, lineHeight: 20, color: colors.muted }, children: language.description }) : null] }), selected ? _jsx(Check, { size: 20, color: colors.text, testID: testID ? `${testID}-check` : undefined }) : null] }, language.code);
31
+ return _jsxs(Pressable, { testID: testID ? `${testID}-${language.code}` : undefined, accessibilityRole: 'radio', accessibilityState: disabled ? { checked: selected, disabled: true } : { checked: selected }, accessibilityLabel: [language.name, language.description].filter(Boolean).join(', '), accessibilityLanguage: language.code, disabled: disabled, onPress: () => onSelect(language), style: disabled ? ({ pressed }) => ({ ...row(pressed), opacity: 0.5 }) : ({ pressed }) => row(pressed), children: [_jsx(View, { ...hidden, children: typeof language.flag === 'string' ? _jsx(Image, { accessible: false, accessibilityIgnoresInvertColors: true, source: { uri: language.flag }, style: shape }) : _jsx(View, { style: shape, children: language.flag ?? _jsx(Text, { accessible: false, maxFontSizeMultiplier: 1, style: { fontSize: 12, lineHeight: 16, fontWeight: '600', color: colors.muted }, children: language.code.slice(0, 2).toUpperCase() }) }) }), _jsxs(View, { ...hidden, style: { flex: 1, flexShrink: 1, minWidth: 0 }, children: [_jsx(Text, { style: { fontSize: 16, lineHeight: 24, fontWeight: '600', color: colors.text }, children: language.name }), language.description ? _jsx(Text, { style: { fontSize: 14, lineHeight: 20, color: colors.muted }, children: language.description }) : null] }), selected ? _jsx(Check, { size: 20, color: colors.positive, testID: testID ? `${testID}-check` : undefined }) : null] }, language.code);
32
32
  }) })] });
33
33
  // The sticky layout puts the header and the body in separate views, so the body's first gap is its top padding.
34
34
  if (stickyHeader)
@@ -98,5 +98,12 @@ export declare function positionCorridor({ side, entry, mark, liquidation }: {
98
98
  drawdown: number;
99
99
  share: number | null;
100
100
  };
101
+ export declare function PositionSummaryRow({ position, side, labels, pnlOptions, disclosure }: {
102
+ position: ManagePositionBlockSummary;
103
+ side: 'long' | 'short';
104
+ labels: Pick<ManagePositionBlockLabels, 'long' | 'short'>;
105
+ pnlOptions?: Intl.NumberFormatOptions;
106
+ disclosure?: boolean;
107
+ }): React.JSX.Element;
101
108
  /** One open position as a screen: margin and notional under the share left before liquidation, then the liquidation, mark and entry prices as a `BarPnl`, what can be done, and the position itself. Both bars are drawn without a card, because nothing in them can be pressed. */
102
109
  export declare function ManagePositionBlock({ labels, mode, side, entry, mark, liquidation, margin, notional, priceOptions, actions, position, pnlOptions, onBack, headerAction, headingId, stickyHeader, stickyHeaderBackground, scrollComponent, testID }: ManagePositionBlockProps): React.JSX.Element;
@@ -38,39 +38,40 @@ function Sentence({ template, text, value, options, suffix, testID }) {
38
38
  return _jsx(Text, { testID: testID, style: { ...words, flexShrink: 1 }, children: reading });
39
39
  return _jsxs(View, { accessible: true, accessibilityLabel: reading, testID: testID, style: { direction, flexDirection: 'row', alignItems: 'center', flexShrink: 1 }, children: [parts[0] ? _jsx(Text, { accessible: false, style: words, children: parts[0] }) : null, _jsx(AnimatedNumberReadout, { value: value, options: options, suffix: suffix, tone: 'muted', style: type }), parts[1] ? _jsx(Text, { accessible: false, style: words, children: parts[1] }) : null] });
40
40
  }
41
- /** One open position as a screen: margin and notional under the share left before liquidation, then the liquidation, mark and entry prices as a `BarPnl`, what can be done, and the position itself. Both bars are drawn without a card, because nothing in them can be pressed. */
42
- export function ManagePositionBlock({ labels, mode, side, entry, mark, liquidation, margin, notional, priceOptions, actions, position, pnlOptions, onBack, headerAction, headingId, stickyHeader, stickyHeaderBackground, scrollComponent, testID }) {
43
- const colors = useColors(), fills = useFills(), t = useMessages(), { direction } = useHIG(), locale = useNumberLocale(), present = usePresentNumber();
41
+ export function PositionSummaryRow({ position, side, labels, pnlOptions, disclosure = false }) {
42
+ const colors = useColors(), fills = useFills(), { direction } = useHIG(), locale = useNumberLocale(), present = usePresentNumber();
43
+ const long = side === 'long';
44
44
  // The artwork that failed to draw (its URL, or the position for a host element); it then shows the fallback or the initials until the artwork changes.
45
45
  const [broken, setBroken] = useState(null);
46
46
  const pnlUsd = pnlOptions ? { ...pnlUsdDefault, ...pnlOptions } : pnlUsdDefault;
47
47
  const read = (value, options) => known(value) ? formatNumberReadout(value, locale, present(options)).text : unknown;
48
- const corridor = positionCorridor({ side, entry, mark, liquidation }), long = side === 'long';
48
+ const shape = { width: avatar, height: avatar, borderRadius: avatar / 2, backgroundColor: fills.raised, alignItems: 'center', justifyContent: 'center', overflow: 'hidden' };
49
+ const { name, icon, iconFallback, symbol, leverage, size, pnl, pnlPercent, badge, caption, onSelect } = position;
50
+ const initials = _jsx(Text, { accessible: false, maxFontSizeMultiplier: 1, style: { fontSize: 12, lineHeight: 16, fontWeight: '600', color: colors.muted }, children: symbol ?? name.slice(0, 3) });
51
+ const key = typeof icon === 'string' ? icon : `${symbol ?? ''}|${name}`, failed = broken === key, fail = () => setBroken(key);
52
+ const art = failed ? _jsx(View, { testID: 'manage-position-initials', style: shape, children: iconFallback ?? initials })
53
+ : typeof icon === 'string' ? _jsx(Image, { accessible: false, accessibilityIgnoresInvertColors: true, source: { uri: icon }, onError: fail, style: shape })
54
+ : _jsx(View, { style: shape, children: typeof icon === 'function' ? icon(fail) : icon ?? initials });
55
+ const gearing = known(leverage) ? formatNumberReadout(leverage, locale, units).text + times : null, held = size !== undefined ? read(size, units) : null;
56
+ const label = [name, long ? labels.long : labels.short, gearing, held, pnl !== undefined ? read(pnl, pnlUsd) : null, pnlPercent !== undefined ? read(pnlPercent, pnlShare) : null].filter(Boolean).join(', ');
57
+ const meta = { fontSize: 14, lineHeight: 20 };
58
+ const title = _jsx(Text, { numberOfLines: 1, style: { fontSize: 16, lineHeight: 24, fontWeight: '600', color: colors.text, ...(badge ? { flexShrink: 1 } : null) }, children: name });
59
+ const surface = (pressed) => ({ flexDirection: 'row', alignItems: 'center', gap: 12, minHeight: 56, paddingVertical: 8, paddingStart: 8, paddingEnd: 16, borderRadius: 28, backgroundColor: pressed ? fills.raised : fills.well, marginTop: disclosure ? 0 : 16, ...(disclosure ? { paddingVertical: 16, paddingStart: 16, borderRadius: 0 } : {}) });
60
+ const parts = _jsxs(_Fragment, { children: [_jsx(View, { ...hidden, children: art }), _jsxs(View, { ...hidden, style: { flex: 1, flexShrink: 1, minWidth: 0 }, children: [badge ? _jsxs(View, { style: { direction, flexDirection: 'row', alignItems: 'center', gap: 8, minWidth: 0 }, children: [title, _jsx(View, { testID: 'manage-position-badge', style: { flexShrink: 0, borderRadius: 9999, paddingHorizontal: 8, backgroundColor: fills.raised }, children: _jsx(Text, { numberOfLines: 1, style: { fontSize: 12, lineHeight: 18, fontWeight: '500', color: colors.muted }, children: badge }) })] }) : title, _jsxs(View, { style: { direction, flexDirection: 'row', alignItems: 'center', gap: 4 }, children: [_jsx(Text, { testID: 'manage-position-side', style: { ...meta, fontWeight: '600', color: long ? colors.up : colors.down }, children: long ? up : down }), gearing ? _jsx(Text, { testID: 'manage-position-leverage', style: { ...meta, fontWeight: '600', color: long ? colors.up : colors.down }, children: gearing }) : null, gearing && held ? _jsx(Text, { style: { ...meta, color: colors.muted }, children: dot.trim() }) : null, size !== undefined ? _jsx(AnimatedNumberReadout, { value: size, options: units, tone: 'muted', testID: 'manage-position-size', style: meta }) : null] })] }), _jsxs(View, { ...hidden, style: { alignItems: 'flex-end', justifyContent: 'center' }, children: [pnl !== undefined ? _jsx(AnimatedNumberReadout, { value: pnl, options: pnlUsd, tone: known(pnl) && pnl > 0 ? 'up' : known(pnl) && pnl < 0 ? 'down' : 'text', testID: 'manage-position-pnl', style: { fontSize: 16, lineHeight: 24, fontWeight: '600' } }) : null, pnlPercent !== undefined ? _jsx(AnimatedNumberReadout, { value: pnlPercent, options: pnlShare, tone: 'muted', testID: 'manage-position-pnl-percent', style: meta }) : null] }), disclosure && onSelect && _jsx(View, { style: { transform: [{ rotate: direction === 'rtl' ? '90deg' : '-90deg' }] }, children: _jsx(ChevronIcon, { color: colors.muted }) })] });
61
+ const note = caption ? _jsx(Text, { testID: 'manage-position-caption', style: { marginTop: 8, paddingHorizontal: 16, color: colors.muted, fontSize: 13, lineHeight: 20 }, children: caption }) : null;
62
+ if (onSelect) {
63
+ // A pressable row is named by the host's label and then what it shows, so the figures are read even with hints off; the caption is its hint.
64
+ return _jsxs(_Fragment, { children: [_jsx(Pressable, { testID: 'manage-position-row', accessibilityRole: 'button', accessibilityLabel: position.label ? `${position.label}, ${label}` : label, accessibilityHint: caption, onPress: onSelect, style: ({ pressed }) => surface(pressed), children: parts }), note] });
65
+ }
66
+ return _jsxs(_Fragment, { children: [_jsx(View, { testID: 'manage-position-row', accessible: true, accessibilityLabel: label, style: surface(false), children: parts }), note] });
67
+ }
68
+ /** One open position as a screen: margin and notional under the share left before liquidation, then the liquidation, mark and entry prices as a `BarPnl`, what can be done, and the position itself. Both bars are drawn without a card, because nothing in them can be pressed. */
69
+ export function ManagePositionBlock({ labels, mode, side, entry, mark, liquidation, margin, notional, priceOptions, actions, position, pnlOptions, onBack, headerAction, headingId, stickyHeader, stickyHeaderBackground, scrollComponent, testID }) {
70
+ const colors = useColors(), t = useMessages(), { direction } = useHIG(), locale = useNumberLocale(), present = usePresentNumber();
71
+ const read = (value, options) => known(value) ? formatNumberReadout(value, locale, present(options)).text : unknown;
72
+ const corridor = positionCorridor({ side, entry, mark, liquidation });
49
73
  const marginBar = [{ id: 'margin', label: labels.margin, value: margin, detail: read(margin, usd), tone: 'info' }, { id: 'notional', label: labels.notional, value: known(notional) ? Math.max(notional - margin, 0) : 0, detail: read(notional, usd), tone: 'positive' }];
50
74
  const left = corridor.share === null ? null : corridor.share * 100;
51
- const shape = { width: avatar, height: avatar, borderRadius: avatar / 2, backgroundColor: fills.raised, alignItems: 'center', justifyContent: 'center', overflow: 'hidden' };
52
- const row = () => {
53
- if (!position)
54
- return null;
55
- const { name, icon, iconFallback, symbol, leverage, size, pnl, pnlPercent, badge, caption, onSelect } = position;
56
- const initials = _jsx(Text, { accessible: false, maxFontSizeMultiplier: 1, style: { fontSize: 12, lineHeight: 16, fontWeight: '600', color: colors.muted }, children: symbol ?? name.slice(0, 3) });
57
- const key = typeof icon === 'string' ? icon : `${symbol ?? ''}|${name}`, failed = broken === key, fail = () => setBroken(key);
58
- const art = failed ? _jsx(View, { testID: 'manage-position-initials', style: shape, children: iconFallback ?? initials })
59
- : typeof icon === 'string' ? _jsx(Image, { accessible: false, accessibilityIgnoresInvertColors: true, source: { uri: icon }, onError: fail, style: shape })
60
- : _jsx(View, { style: shape, children: typeof icon === 'function' ? icon(fail) : icon ?? initials });
61
- const gearing = known(leverage) ? formatNumberReadout(leverage, locale, units).text + times : null, held = size !== undefined ? read(size, units) : null;
62
- const label = [name, long ? labels.long : labels.short, gearing, held, pnl !== undefined ? read(pnl, pnlUsd) : null, pnlPercent !== undefined ? read(pnlPercent, pnlShare) : null].filter(Boolean).join(', ');
63
- const meta = { fontSize: 14, lineHeight: 20 };
64
- const title = _jsx(Text, { numberOfLines: 1, style: { fontSize: 16, lineHeight: 24, fontWeight: '600', color: colors.text, ...(badge ? { flexShrink: 1 } : null) }, children: name });
65
- const surface = (pressed) => ({ flexDirection: 'row', alignItems: 'center', gap: 12, minHeight: 56, paddingVertical: 8, paddingStart: 8, paddingEnd: 16, borderRadius: 28, backgroundColor: pressed ? fills.raised : fills.well, marginTop: 16 });
66
- const parts = _jsxs(_Fragment, { children: [_jsx(View, { ...hidden, children: art }), _jsxs(View, { ...hidden, style: { flex: 1, flexShrink: 1, minWidth: 0 }, children: [badge ? _jsxs(View, { style: { direction, flexDirection: 'row', alignItems: 'center', gap: 8, minWidth: 0 }, children: [title, _jsx(View, { testID: 'manage-position-badge', style: { flexShrink: 0, borderRadius: 9999, paddingHorizontal: 8, backgroundColor: fills.raised }, children: _jsx(Text, { numberOfLines: 1, style: { fontSize: 12, lineHeight: 18, fontWeight: '500', color: colors.muted }, children: badge }) })] }) : title, _jsxs(View, { style: { direction, flexDirection: 'row', alignItems: 'center', gap: 4 }, children: [_jsx(Text, { testID: 'manage-position-side', style: { ...meta, fontWeight: '600', color: long ? colors.up : colors.down }, children: long ? up : down }), gearing ? _jsx(Text, { testID: 'manage-position-leverage', style: { ...meta, fontWeight: '600', color: long ? colors.up : colors.down }, children: gearing }) : null, gearing && held ? _jsx(Text, { style: { ...meta, color: colors.muted }, children: dot.trim() }) : null, size !== undefined ? _jsx(AnimatedNumberReadout, { value: size, options: units, tone: 'muted', testID: 'manage-position-size', style: meta }) : null] })] }), _jsxs(View, { ...hidden, style: { alignItems: 'flex-end', justifyContent: 'center' }, children: [pnl !== undefined ? _jsx(AnimatedNumberReadout, { value: pnl, options: pnlUsd, tone: known(pnl) && pnl > 0 ? 'up' : known(pnl) && pnl < 0 ? 'down' : 'text', testID: 'manage-position-pnl', style: { fontSize: 16, lineHeight: 24, fontWeight: '600' } }) : null, pnlPercent !== undefined ? _jsx(AnimatedNumberReadout, { value: pnlPercent, options: pnlShare, tone: 'muted', testID: 'manage-position-pnl-percent', style: meta }) : null] })] });
67
- const note = caption ? _jsx(Text, { testID: 'manage-position-caption', style: { marginTop: 8, paddingHorizontal: 16, color: colors.muted, fontSize: 13, lineHeight: 20 }, children: caption }) : null;
68
- if (onSelect) {
69
- // A pressable row is named by the host's label and then what it shows, so the figures are read even with hints off; the caption is its hint.
70
- return _jsxs(_Fragment, { children: [_jsx(Pressable, { testID: 'manage-position-row', accessibilityRole: 'button', accessibilityLabel: position.label ? `${position.label}, ${label}` : label, accessibilityHint: caption, onPress: onSelect, style: ({ pressed }) => surface(pressed), children: parts }), note] });
71
- }
72
- return _jsxs(_Fragment, { children: [_jsx(View, { testID: 'manage-position-row', accessible: true, accessibilityLabel: label, style: surface(false), children: parts }), note] });
73
- };
74
75
  const actionValue = (action) => {
75
76
  const figure = action.value;
76
77
  if (figure == null)
@@ -80,7 +81,7 @@ export function ManagePositionBlock({ labels, mode, side, entry, mark, liquidati
80
81
  return { value: _jsx(AnimatedNumberReadout, { ...figureProps(figure), tone: action.tone ?? 'muted', testID: `manage-action-${action.id}-value`, style: { fontSize: 16, lineHeight: 24 } }), valueLabel: figureReading(figure, locale, present(figure.options)) };
81
82
  };
82
83
  const header = _jsxs(View, { testID: 'manage-header', style: { flexDirection: 'row', alignItems: 'center', minHeight: 44 }, children: [_jsx(View, { style: { minWidth: 44, alignItems: 'flex-start' }, children: onBack ? _jsx(IconButton, { intent: 'ghost', label: t.back, suppressFeedback: true, testID: 'manage-back', onPress: onBack, children: _jsx(View, { style: { transform: [{ rotate: direction === 'rtl' ? '-90deg' : '90deg' }] }, children: _jsx(ChevronIcon, { color: colors.text }) }) }) : null }), _jsx(Text, { testID: 'manage-title', nativeID: headingId, accessibilityRole: 'header', numberOfLines: 1, style: { flex: 1, textAlign: 'center', fontSize: 17, lineHeight: 24, fontWeight: '600', color: colors.text }, children: labels.title }), _jsx(View, { style: { minWidth: 44, alignItems: 'flex-end' }, children: headerAction })] });
83
- const body = _jsxs(_Fragment, { children: [_jsxs(View, { style: { gap: 20, marginTop: 16, paddingHorizontal: 4 }, children: [_jsx(BarMark, { testID: 'manage-margin', surface: false, title: mode ?? labels.margin, elements: marginBar, description: _jsx(Sentence, { testID: 'manage-to-liquidation', template: labels.toLiquidation, text: left === null ? unknown : formatNumberReadout(left, locale, tenth).text + percent, value: left, options: tenth, suffix: percent }) }), _jsx(BarPnl, { testID: 'manage-liquidation', surface: false, compact: true, side: side, entry: entry, mark: mark, liquidation: liquidation, labels: { liquidation: labels.liquidation, mark: labels.mark, entry: labels.entry }, priceOptions: priceOptions })] }), actions.length > 0 ? _jsx(View, { testID: 'manage-actions', style: { marginTop: 16 }, children: _jsx(ListGroup, { children: actions.map(action => _jsx(ListRow, { testID: `manage-action-${action.id}`, label: action.label, disabled: action.disabled, onSelect: action.onSelect, ...actionValue(action) }, action.id)) }) }) : null, row()] });
84
+ const body = _jsxs(_Fragment, { children: [_jsxs(View, { style: { gap: 20, marginTop: 16, paddingHorizontal: 4 }, children: [_jsx(BarMark, { testID: 'manage-margin', surface: false, title: mode ?? labels.margin, elements: marginBar, description: _jsx(Sentence, { testID: 'manage-to-liquidation', template: labels.toLiquidation, text: left === null ? unknown : formatNumberReadout(left, locale, tenth).text + percent, value: left, options: tenth, suffix: percent }) }), _jsx(BarPnl, { testID: 'manage-liquidation', surface: false, compact: true, side: side, entry: entry, mark: mark, liquidation: liquidation, labels: { liquidation: labels.liquidation, mark: labels.mark, entry: labels.entry }, priceOptions: priceOptions })] }), actions.length > 0 ? _jsx(View, { testID: 'manage-actions', style: { marginTop: 16 }, children: _jsx(ListGroup, { children: actions.map(action => _jsx(ListRow, { testID: `manage-action-${action.id}`, label: action.label, disabled: action.disabled, onSelect: action.onSelect, ...actionValue(action) }, action.id)) }) }) : null, position && _jsx(PositionSummaryRow, { position: position, side: side, labels: labels, pnlOptions: pnlOptions })] });
84
85
  if (stickyHeader)
85
86
  return _jsx(StickyHeaderLayout, { testID: testID, headerTestID: 'manage-sticky-header', header: header, background: stickyHeaderBackground, scrollComponent: scrollComponent, children: body });
86
87
  return _jsxs(View, { testID: testID, style: { padding: 16 }, children: [header, body] });
@@ -0,0 +1,2 @@
1
+ /** Half the standard 44dp capsule height. */
2
+ export declare const capsuleRadius = 22;
@@ -0,0 +1,2 @@
1
+ /** Half the standard 44dp capsule height. */
2
+ export const capsuleRadius = 22;
@@ -13,14 +13,18 @@ export interface DialogProps {
13
13
  /** Custom content owns its visible heading, actions, padding and scrolling. The native Modal remains HIG-owned. */ contentMode?: 'default' | 'custom';
14
14
  /** Accessible caller heading used when custom content renders the title. Otherwise HIG keeps a visually hidden title. */ titleRef?: React.RefObject<React.ComponentRef<typeof View> | React.ComponentRef<typeof RNText> | React.ComponentRef<typeof TextInput> | null>;
15
15
  /** Custom-mode stage inside the Modal, for example GestureHandlerRootView on Android. */ stageComponent?: React.ComponentType<ViewProps>;
16
- stageStyle?: StyleProp<ViewStyle>;
16
+ /** Layout inside the modal safe area, or on the custom stage. */ stageStyle?: StyleProp<ViewStyle>;
17
17
  stageTestID?: string;
18
18
  /** Custom-mode backdrop, including the host's dismissal policy and decoration. */ backdrop?: React.ReactNode;
19
+ /** Align the standard modal surface with its inset 44dp capsule controls. Defaults to true. */
20
+ concentric?: boolean;
21
+ /** Accent label above the standard title, with a matching radial glow across the panel. */ accentEyebrow?: string;
22
+ /** Size and placement of the standard scrollable dialog inside the safe area. */ frameStyle?: StyleProp<ViewStyle>;
19
23
  /** Custom-mode surface layout; no implicit padding or scroll view is added. */ contentStyle?: StyleProp<ViewStyle>;
20
24
  /** Identifies the actual modal content surface in either mode. */ testID?: string;
21
25
  /** Native Modal animation. Reduced motion always selects `none`; the default stays `none`. */ animationType?: ModalProps['animationType'];
22
26
  }
23
- export declare function Dialog({ open, onOpenChange, title, description, children, initialFocusRef, returnFocusRef, closeLabel, contentMode, titleRef, stageComponent: Stage, stageStyle, stageTestID, backdrop, contentStyle, testID, animationType }: DialogProps): React.JSX.Element;
27
+ export declare function Dialog({ open, onOpenChange, title, description, children, initialFocusRef, returnFocusRef, closeLabel, contentMode, concentric, accentEyebrow, titleRef, stageComponent: Stage, stageStyle, stageTestID, backdrop, contentStyle, frameStyle, testID, animationType }: DialogProps): React.JSX.Element;
24
28
  export declare const Sheet: typeof Dialog;
25
29
  export declare const AlertDialog: typeof Dialog;
26
30
  export declare function Menu({ label, items, closeLabel }: {
@@ -1,4 +1,5 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { withAlpha } from '@bloxwap/hig/tokens';
2
3
  import * as en from '@bloxwap/hig/contracts/messages';
3
4
  import { Raised, useColors, useHIG } from './provider.js';
4
5
  import React, { useEffect, useRef, useId, useCallback } from 'react';
@@ -6,15 +7,17 @@ import { Modal, KeyboardAvoidingView, Platform, ScrollView, AccessibilityInfo, f
6
7
  import { SafeAreaView } from 'react-native-safe-area-context';
7
8
  import { Heading, Text, Stack } from './surface.js';
8
9
  import { Button } from './button.js';
9
- /** The panel has no stroke: it is the `overlay` fill, darker than a card, lifted by a soft shadow. Native focus requests remain best effort; host supplies a live trigger ref for restoration. */
10
+ import { capsuleRadius } from './modal-radius.js';
11
+ /** The panel has no stroke: it uses the overlay fill, darker than a card, lifted by a soft shadow. Native focus requests remain best effort; host supplies a live trigger ref for restoration. */
10
12
  /** Android TalkBack ignores the TYPE_VIEW_FOCUSED event behind setAccessibilityFocus in RN 0.81 Fabric (emulator: focus fell back to the first screen element); a hover-enter event moves its focus. */
11
13
  function focusNative(target) { if (Platform.OS === 'web' || !target)
12
14
  return; const handle = findNodeHandle(target); if (handle == null)
13
15
  return; AccessibilityInfo.setAccessibilityFocus(handle); if (Platform.OS === 'android')
14
16
  AccessibilityInfo.sendAccessibilityEvent(target, 'viewHoverEnter'); }
17
+ const dialogPadding = 24;
15
18
  /** React Native's iOS Modal defaults to portrait only; opening an overlay must not rotate a landscape host. */
16
19
  const overlayOrientations = ['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right'];
17
- export function Dialog({ open, onOpenChange, title, description, children, initialFocusRef, returnFocusRef, closeLabel, contentMode = 'default', titleRef, stageComponent: Stage = View, stageStyle, stageTestID, backdrop, contentStyle, testID, animationType = 'none' }) {
20
+ export function Dialog({ open, onOpenChange, title, description, children, initialFocusRef, returnFocusRef, closeLabel, contentMode = 'default', concentric = true, accentEyebrow, titleRef, stageComponent: Stage = View, stageStyle, stageTestID, backdrop, contentStyle, frameStyle, testID, animationType = 'none' }) {
18
21
  const { messages, reducedMotion, direction } = useHIG();
19
22
  const colors = useColors();
20
23
  const heading = useRef(null);
@@ -49,9 +52,8 @@ export function Dialog({ open, onOpenChange, title, description, children, initi
49
52
  }, [open, resolvedAnimation, restoreFocus]);
50
53
  useEffect(() => () => { if (frame.current !== undefined)
51
54
  cancelAnimationFrame(frame.current); returnPending.current = false; }, []);
52
- const modal = _jsx(Modal, { visible: open, transparent: true, animationType: resolvedAnimation, supportedOrientations: overlayOrientations, onShow: () => { if (latest.current.open)
53
- focusNative(initialFocusRef?.current ?? (contentMode === 'custom' ? titleRef?.current : null) ?? heading.current); }, onDismiss: restoreFocus, onRequestClose: () => onOpenChange(false), accessibilityViewIsModal: true, children: contentMode === 'custom' ? _jsxs(Stage, { style: [{ flex: 1, backgroundColor: '#000b', justifyContent: 'center', direction }, stageStyle], testID: stageTestID, children: [backdrop, _jsxs(View, { accessible: false, accessibilityLabel: title, accessibilityViewIsModal: true, onAccessibilityEscape: () => onOpenChange(false), collapsable: false, style: [{ direction }, contentStyle], testID: testID, children: [!titleRef && _jsx(Heading, { ref: heading, accessible: true, accessibilityLabel: title, style: { position: 'absolute', width: 1, height: 1, overflow: 'hidden' }, children: title }), _jsx(Raised, { children: children })] })] }) : _jsx(SafeAreaView, { style: { flex: 1, backgroundColor: '#000b', justifyContent: 'center' }, children: _jsx(KeyboardAvoidingView, { behavior: Platform.OS === 'ios' ? 'padding' : 'height', style: { maxHeight: '90%' }, children: _jsx(ScrollView, { testID: testID, keyboardShouldPersistTaps: 'handled', contentContainerStyle: { padding: 24, backgroundColor: colors.overlay, borderRadius: 14, boxShadow: '0 16px 48px #0008' }, children: _jsx(Raised, { children: _jsxs(Stack, { children: [_jsx(Heading, { ref: heading, children: title }), description !== undefined && _jsx(Text, { children: description }), children, _jsx(Button, { intent: 'secondary', suppressFeedback: true, style: { marginTop: 4 }, onPress: () => onOpenChange(false), children: closeLabel ?? messages.close ?? en.close })] }) }) }) }) }) });
54
- return modal;
55
+ return _jsx(Modal, { visible: open, transparent: true, animationType: resolvedAnimation, supportedOrientations: overlayOrientations, onShow: () => { if (latest.current.open)
56
+ focusNative(initialFocusRef?.current ?? (contentMode === 'custom' ? titleRef?.current : null) ?? heading.current); }, onDismiss: restoreFocus, onRequestClose: () => onOpenChange(false), accessibilityViewIsModal: true, children: contentMode === 'custom' ? _jsxs(Stage, { style: [{ flex: 1, backgroundColor: '#000b', justifyContent: 'center', direction, paddingHorizontal: 8 }, stageStyle], testID: stageTestID, children: [backdrop, _jsxs(View, { accessible: false, accessibilityLabel: title, accessibilityViewIsModal: true, onAccessibilityEscape: () => onOpenChange(false), collapsable: false, style: [{ direction }, contentStyle], testID: testID, children: [!titleRef && _jsx(Heading, { ref: heading, accessible: true, accessibilityLabel: title, style: { position: 'absolute', width: 1, height: 1, overflow: 'hidden' }, children: title }), _jsx(Raised, { children: children })] })] }) : _jsx(SafeAreaView, { style: [{ flex: 1, backgroundColor: '#000b', justifyContent: 'center', paddingHorizontal: 8 }, stageStyle], children: _jsx(KeyboardAvoidingView, { behavior: Platform.OS === 'ios' ? 'padding' : 'height', style: [{ maxHeight: '90%' }, frameStyle], children: _jsx(ScrollView, { testID: testID, keyboardShouldPersistTaps: 'handled', contentContainerStyle: { padding: dialogPadding, backgroundColor: colors.overlay, experimental_backgroundImage: accentEyebrow ? `radial-gradient(140% 80% at 50% -10%, ${withAlpha(colors.action, 0.14)}, transparent 60%)` : undefined, borderRadius: concentric ? dialogPadding + capsuleRadius : 14, boxShadow: '0 16px 48px #0008' }, children: _jsx(Raised, { children: _jsxs(Stack, { children: [accentEyebrow && _jsx(Text, { style: { color: colors.action, fontSize: 11, lineHeight: 16, fontWeight: "800", letterSpacing: 1.1, textTransform: "uppercase" }, children: accentEyebrow }), _jsx(Heading, { ref: heading, children: title }), description !== undefined && _jsx(Text, { children: description }), children, _jsx(Button, { intent: 'secondary', suppressFeedback: true, style: { marginTop: 4 }, onPress: () => onOpenChange(false), children: closeLabel ?? messages.close ?? en.close })] }) }) }) }) }) });
55
57
  }
56
58
  export const Sheet = Dialog;
57
59
  export const AlertDialog = Dialog;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { type ManagePositionBlockSummary } from './manage-position-block.js';
3
+ export interface OpenPosition extends Omit<ManagePositionBlockSummary, 'onSelect'> {
4
+ id: string;
5
+ side: 'long' | 'short';
6
+ }
7
+ export interface PositionsBlockProps {
8
+ labels: {
9
+ title: string;
10
+ all: string;
11
+ wins: string;
12
+ losses: string;
13
+ long: string;
14
+ short: string;
15
+ empty: string;
16
+ closeAll: (count: number) => string;
17
+ };
18
+ positions: readonly OpenPosition[];
19
+ onSelect: (position: OpenPosition) => void;
20
+ /** Acts on every open position, including rows hidden by the filter. */
21
+ onCloseAll: () => void;
22
+ closing?: boolean;
23
+ pnlOptions?: Intl.NumberFormatOptions;
24
+ onBack?: () => void;
25
+ headerAction?: React.ReactNode;
26
+ headingId?: string;
27
+ }
28
+ export declare function PositionsBlock({ labels, positions, onSelect, onCloseAll, closing, pnlOptions, onBack, headerAction, headingId }: PositionsBlockProps): React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { View } from 'react-native';
4
+ import { Text } from './surface.js';
5
+ import { PositionSummaryRow } from './manage-position-block.js';
6
+ import { ScreenHeader } from './screen-header.js';
7
+ import { ListGroup } from './list-group.js';
8
+ import { Button } from './button.js';
9
+ import { SegmentedControl } from './radio-group.js';
10
+ export function PositionsBlock({ labels, positions, onSelect, onCloseAll, closing, pnlOptions, onBack, headerAction, headingId }) {
11
+ const [filter, setFilter] = useState('all');
12
+ const options = [{ value: 'all', label: labels.all }, { value: 'wins', label: labels.wins }, { value: 'losses', label: labels.losses }];
13
+ const visible = positions.filter(p => filter === 'all' || (p.pnl != null && Number.isFinite(p.pnl) && (filter === 'wins' ? p.pnl > 0 : p.pnl < 0)));
14
+ return _jsxs(View, { style: { gap: 16 }, children: [_jsx(ScreenHeader, { title: labels.title, onBack: onBack, action: headerAction, headingId: headingId }), _jsx(SegmentedControl, { label: labels.title, hideLabel: true, value: filter, onValueChange: setFilter, options: options }), visible.length > 0 ? _jsx(ListGroup, { children: visible.map(position => _jsx(PositionSummaryRow, { position: { ...position, onSelect: () => onSelect(position) }, side: position.side, labels: labels, pnlOptions: pnlOptions, disclosure: true }, position.id)) }) : _jsx(Text, { tone: 'muted', children: labels.empty }), _jsx(Button, { fullWidth: true, intent: 'secondary', disabled: !positions.length, busy: closing, onPress: onCloseAll, children: labels.closeAll(positions.length) })] });
15
+ }
@@ -37,6 +37,8 @@ export interface ScreenHeaderProps {
37
37
  stickyHeaderBackground?: string;
38
38
  /** With `stickyHeader`: space kept inside the fill above the row and to each side of it, such as the blocks' 16, so the inset fills with the header once content scrolls under it. Pass the inset here, not as `style` padding: React Native moves a sticky child's `style` onto its own wrapper, outside the fill. */
39
39
  inset?: number;
40
+ /** Equal leading and trailing space when a header has multiple actions. */
41
+ sideWidth?: number;
40
42
  /** Style of the header's container. With `stickyHeader` it sits outside the fill (React Native moves it onto the sticky slot's wrapper once pinned); put an inset in `inset`. */
41
43
  style?: StyleProp<ViewStyle>;
42
44
  }
@@ -56,4 +58,4 @@ export declare function HeaderClose({ onClose, label, testID, closeProps }: {
56
58
  * edge. The settings blocks (Notifications, Signals, Sound & Haptics) draw it; the other native blocks draw a header that matches
57
59
  * it. Import it from `@bloxwap/hig/native/screen-header` for a host pane that has no block.
58
60
  */
59
- export declare function ScreenHeader({ title, onBack, backDisabled, backProps, action, testID, headingId, titleRef, badge, eyebrow, hideTitle, description, stickyHeader, scrolled, stickyHeaderBackground, inset, style }: ScreenHeaderProps): React.JSX.Element;
61
+ export declare function ScreenHeader({ title, onBack, backDisabled, backProps, action, testID, headingId, titleRef, badge, eyebrow, hideTitle, description, stickyHeader, scrolled, stickyHeaderBackground, inset, style, sideWidth }: ScreenHeaderProps): React.JSX.Element;