@bloxwap/hig 0.7.0 → 0.8.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 (246) hide show
  1. package/README.md +2 -2
  2. package/chart/README.md +13 -2
  3. package/chart/dist/altimeter-burst.d.ts +4 -0
  4. package/chart/dist/altimeter-burst.js +43 -0
  5. package/chart/dist/altimeter-chart.d.ts +52 -0
  6. package/chart/dist/altimeter-chart.js +275 -0
  7. package/chart/dist/altimeter-model.d.ts +43 -0
  8. package/chart/dist/altimeter-model.js +148 -0
  9. package/chart/dist/altimeter-targets.d.ts +33 -0
  10. package/chart/dist/altimeter-targets.js +88 -0
  11. package/chart/dist/bitcoin-price.d.ts +8 -0
  12. package/chart/dist/bitcoin-price.js +41 -0
  13. package/chart/dist/champions-league.d.ts +19 -0
  14. package/chart/dist/champions-league.js +104 -0
  15. package/chart/dist/index.d.ts +6 -0
  16. package/chart/dist/index.js +5 -0
  17. package/chart/dist/outcome-chart.d.ts +37 -0
  18. package/chart/dist/outcome-chart.js +212 -0
  19. package/chart/dist/outcome-model.d.ts +43 -0
  20. package/chart/dist/outcome-model.js +71 -0
  21. package/chart/dist/plus-grid.d.ts +6 -0
  22. package/chart/dist/plus-grid.js +29 -0
  23. package/contracts/README.md +1 -1
  24. package/contracts/dist/avatar.d.ts +68 -0
  25. package/contracts/dist/avatar.js +93 -0
  26. package/contracts/dist/confetti.d.ts +174 -0
  27. package/contracts/dist/confetti.js +138 -0
  28. package/contracts/dist/decimal.d.ts +7 -0
  29. package/contracts/dist/decimal.js +35 -0
  30. package/contracts/dist/index.d.ts +29 -2
  31. package/contracts/dist/index.js +123 -4
  32. package/contracts/dist/invariants.d.ts +17 -0
  33. package/contracts/dist/invariants.js +24 -0
  34. package/contracts/dist/messages.d.ts +56 -2
  35. package/contracts/dist/messages.js +20 -2
  36. package/contracts/dist/number-flow.d.ts +90 -0
  37. package/contracts/dist/number-flow.js +150 -0
  38. package/contracts/dist/qr.d.ts +151 -0
  39. package/contracts/dist/qr.js +581 -0
  40. package/contracts/dist/toast.d.ts +168 -0
  41. package/contracts/dist/toast.js +171 -0
  42. package/feedback/README.md +1 -1
  43. package/feedback/dist/contract.js +1 -1
  44. package/feedback/dist/react.js +2 -4
  45. package/native/README.md +6 -1
  46. package/native/dist/account-block.d.ts +10 -1
  47. package/native/dist/account-block.js +17 -7
  48. package/native/dist/animated-number-model.d.ts +41 -1
  49. package/native/dist/animated-number-model.js +201 -23
  50. package/native/dist/animated-number.d.ts +39 -1
  51. package/native/dist/animated-number.js +161 -16
  52. package/native/dist/announce.d.ts +2 -0
  53. package/native/dist/announce.js +10 -0
  54. package/native/dist/asset-balance-row.d.ts +3 -1
  55. package/native/dist/asset-balance-row.js +15 -4
  56. package/native/dist/assets-block.d.ts +115 -0
  57. package/native/dist/assets-block.js +87 -0
  58. package/native/dist/async-result.d.ts +2 -0
  59. package/native/dist/async-result.js +11 -0
  60. package/native/dist/avatar-frame.d.ts +29 -0
  61. package/native/dist/avatar-frame.js +56 -0
  62. package/native/dist/avatar.d.ts +21 -0
  63. package/native/dist/avatar.js +31 -0
  64. package/native/dist/bar-mark.d.ts +2 -0
  65. package/native/dist/bar-mark.js +4 -2
  66. package/native/dist/bar-pnl.js +2 -1
  67. package/native/dist/blocks.d.ts +6 -1
  68. package/native/dist/blocks.js +5 -0
  69. package/native/dist/brand.js +2 -1
  70. package/native/dist/button.d.ts +7 -2
  71. package/native/dist/button.js +13 -3
  72. package/native/dist/checkbox.js +2 -1
  73. package/native/dist/confetti.d.ts +33 -0
  74. package/native/dist/confetti.js +143 -0
  75. package/native/dist/confirm-block.d.ts +98 -0
  76. package/native/dist/confirm-block.js +48 -0
  77. package/native/dist/data.js +2 -0
  78. package/native/dist/explainer-block.d.ts +91 -0
  79. package/native/dist/explainer-block.js +34 -0
  80. package/native/dist/field.d.ts +5 -1
  81. package/native/dist/field.js +27 -6
  82. package/native/dist/gesture-sheet-model.d.ts +50 -0
  83. package/native/dist/gesture-sheet-model.js +105 -0
  84. package/native/dist/gesture-sheet-next.d.ts +82 -0
  85. package/native/dist/gesture-sheet-next.js +315 -0
  86. package/native/dist/gesture-sheet.d.ts +5 -1
  87. package/native/dist/gesture-sheet.js +13 -6
  88. package/native/dist/icons.d.ts +9 -6
  89. package/native/dist/icons.js +25 -24
  90. package/native/dist/language-block.d.ts +10 -1
  91. package/native/dist/language-block.js +11 -4
  92. package/native/dist/list-group.d.ts +3 -1
  93. package/native/dist/list-group.js +26 -13
  94. package/native/dist/manage-position-block.d.ts +8 -1
  95. package/native/dist/manage-position-block.js +7 -2
  96. package/native/dist/market-row.js +19 -8
  97. package/native/dist/navigation.js +5 -3
  98. package/native/dist/number-format.d.ts +6 -0
  99. package/native/dist/number-format.js +9 -0
  100. package/native/dist/pickers.d.ts +8 -0
  101. package/native/dist/pickers.js +3 -3
  102. package/native/dist/position-block.d.ts +5 -5
  103. package/native/dist/preset-group.d.ts +31 -0
  104. package/native/dist/preset-group.js +39 -0
  105. package/native/dist/preset-picker-block.d.ts +107 -0
  106. package/native/dist/preset-picker-block.js +43 -0
  107. package/native/dist/profile-block.d.ts +10 -1
  108. package/native/dist/profile-block.js +8 -3
  109. package/native/dist/provider.d.ts +5 -2
  110. package/native/dist/provider.js +27 -5
  111. package/native/dist/qr-code.d.ts +33 -0
  112. package/native/dist/qr-code.js +29 -0
  113. package/native/dist/radio-group.d.ts +19 -7
  114. package/native/dist/radio-group.js +39 -10
  115. package/native/dist/reward-block.d.ts +10 -7
  116. package/native/dist/reward-block.js +9 -4
  117. package/native/dist/screen-header.d.ts +13 -3
  118. package/native/dist/screen-header.js +12 -4
  119. package/native/dist/select.js +4 -2
  120. package/native/dist/selection.d.ts +2 -1
  121. package/native/dist/selection.js +1 -0
  122. package/native/dist/setting-switch.d.ts +1 -1
  123. package/native/dist/setting-switch.js +7 -3
  124. package/native/dist/slider.js +5 -1
  125. package/native/dist/sound-haptics-block.js +1 -1
  126. package/native/dist/status.d.ts +41 -9
  127. package/native/dist/status.js +34 -17
  128. package/native/dist/sticky-header.js +9 -1
  129. package/native/dist/swap-amount-card.d.ts +57 -0
  130. package/native/dist/swap-amount-card.js +31 -0
  131. package/native/dist/swap-panel-block.d.ts +9 -3
  132. package/native/dist/swap-panel-block.js +59 -33
  133. package/native/dist/swap-parts.d.ts +3 -10
  134. package/native/dist/swap-parts.js +22 -24
  135. package/native/dist/swap-shared.d.ts +2 -2
  136. package/native/dist/swap-shared.js +10 -6
  137. package/native/dist/swap-views.js +1 -1
  138. package/native/dist/target-block.d.ts +7 -1
  139. package/native/dist/target-block.js +13 -6
  140. package/native/dist/toast.d.ts +47 -0
  141. package/native/dist/toast.js +386 -0
  142. package/native/dist/token-action-block.d.ts +10 -1
  143. package/native/dist/token-action-block.js +9 -4
  144. package/native/dist/trade-history-list-block.js +7 -4
  145. package/native/dist/wallet-address-core.js +6 -3
  146. package/native-fonts/README.md +1 -1
  147. package/og-fonts/README.md +1 -1
  148. package/package.json +111 -2
  149. package/react/README.md +3 -1
  150. package/react/dist/animated-number-flow.d.ts +72 -0
  151. package/react/dist/animated-number-flow.js +316 -0
  152. package/react/dist/animated-number-model.d.ts +18 -0
  153. package/react/dist/animated-number-model.js +75 -5
  154. package/react/dist/animated-number.d.ts +45 -1
  155. package/react/dist/animated-number.js +137 -6
  156. package/react/dist/asset-balance-row.d.ts +3 -1
  157. package/react/dist/asset-balance-row.js +10 -4
  158. package/react/dist/async-result.d.ts +2 -0
  159. package/react/dist/async-result.js +11 -0
  160. package/react/dist/avatar.d.ts +25 -0
  161. package/react/dist/avatar.js +50 -0
  162. package/react/dist/blocks/account-block.d.ts +5 -1
  163. package/react/dist/blocks/account-block.js +11 -6
  164. package/react/dist/blocks/assets-block.d.ts +106 -0
  165. package/react/dist/blocks/assets-block.js +135 -0
  166. package/react/dist/blocks/confirm-block.d.ts +91 -0
  167. package/react/dist/blocks/confirm-block.js +31 -0
  168. package/react/dist/blocks/explainer-block.d.ts +80 -0
  169. package/react/dist/blocks/explainer-block.js +20 -0
  170. package/react/dist/blocks/install-command.js +3 -1
  171. package/react/dist/blocks/language-block.d.ts +5 -1
  172. package/react/dist/blocks/language-block.js +4 -3
  173. package/react/dist/blocks/manage-position-block.d.ts +3 -1
  174. package/react/dist/blocks/manage-position-block.js +2 -2
  175. package/react/dist/blocks/market-row.js +8 -3
  176. package/react/dist/blocks/notifications-block.d.ts +3 -1
  177. package/react/dist/blocks/notifications-block.js +2 -2
  178. package/react/dist/blocks/pickers.d.ts +9 -0
  179. package/react/dist/blocks/pickers.js +4 -2
  180. package/react/dist/blocks/position-block.d.ts +3 -3
  181. package/react/dist/blocks/preset-picker-block.d.ts +85 -0
  182. package/react/dist/blocks/preset-picker-block.js +19 -0
  183. package/react/dist/blocks/profile-block.d.ts +5 -1
  184. package/react/dist/blocks/profile-block.js +12 -13
  185. package/react/dist/blocks/reward-block.d.ts +13 -8
  186. package/react/dist/blocks/reward-block.js +7 -4
  187. package/react/dist/blocks/screen-header.d.ts +10 -2
  188. package/react/dist/blocks/screen-header.js +7 -4
  189. package/react/dist/blocks/setting-switch.js +6 -3
  190. package/react/dist/blocks/signals-block.d.ts +3 -1
  191. package/react/dist/blocks/signals-block.js +4 -3
  192. package/react/dist/blocks/sound-haptics-block.d.ts +3 -1
  193. package/react/dist/blocks/sound-haptics-block.js +2 -2
  194. package/react/dist/blocks/sticky-header.d.ts +14 -4
  195. package/react/dist/blocks/sticky-header.js +68 -8
  196. package/react/dist/blocks/swap/settings.js +2 -1
  197. package/react/dist/blocks/swap/shared.d.ts +22 -22
  198. package/react/dist/blocks/swap/shared.js +30 -28
  199. package/react/dist/blocks/swap-panel-block.d.ts +10 -3
  200. package/react/dist/blocks/swap-panel-block.js +71 -36
  201. package/react/dist/blocks/target-block.d.ts +7 -1
  202. package/react/dist/blocks/target-block.js +10 -4
  203. package/react/dist/blocks/token-action-block.d.ts +5 -1
  204. package/react/dist/blocks/token-action-block.js +2 -2
  205. package/react/dist/blocks/trade-history-detail-block.d.ts +3 -1
  206. package/react/dist/blocks/trade-history-detail-block.js +2 -2
  207. package/react/dist/blocks/trade-history-list-block.d.ts +3 -1
  208. package/react/dist/blocks/trade-history-list-block.js +7 -4
  209. package/react/dist/blocks.d.ts +5 -1
  210. package/react/dist/blocks.js +4 -0
  211. package/react/dist/brand.js +2 -1
  212. package/react/dist/button.d.ts +9 -3
  213. package/react/dist/button.js +8 -3
  214. package/react/dist/confetti.d.ts +27 -0
  215. package/react/dist/confetti.js +240 -0
  216. package/react/dist/data.js +8 -1
  217. package/react/dist/field.d.ts +6 -1
  218. package/react/dist/field.js +18 -9
  219. package/react/dist/gesture-sheet.d.ts +15 -1
  220. package/react/dist/gesture-sheet.js +53 -8
  221. package/react/dist/list-group.js +11 -7
  222. package/react/dist/navigation.js +11 -3
  223. package/react/dist/overlay.d.ts +28 -3
  224. package/react/dist/overlay.js +29 -3
  225. package/react/dist/preset-group.d.ts +30 -0
  226. package/react/dist/preset-group.js +13 -0
  227. package/react/dist/provider.d.ts +2 -2
  228. package/react/dist/provider.js +23 -6
  229. package/react/dist/qr-code.d.ts +32 -0
  230. package/react/dist/qr-code.js +28 -0
  231. package/react/dist/select.js +10 -3
  232. package/react/dist/selection.d.ts +13 -5
  233. package/react/dist/selection.js +13 -8
  234. package/react/dist/slider.js +5 -1
  235. package/react/dist/status.d.ts +14 -10
  236. package/react/dist/status.js +17 -9
  237. package/react/dist/styles.css +238 -163
  238. package/react/dist/toast.d.ts +19 -12
  239. package/react/dist/toast.js +29 -7
  240. package/react/dist/wallet-address-core.d.ts +8 -4
  241. package/react/dist/wallet-address-core.js +10 -5
  242. package/tokens/README.md +2 -2
  243. package/tokens/dist/index.d.ts +16 -0
  244. package/tokens/dist/index.js +16 -0
  245. package/tokens/dist/manifest.json +8 -0
  246. package/tokens/dist/tokens.css +6 -0
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { forwardRef, useId, useRef } from 'react';
3
- import { ActivityIndicator, Pressable, Linking, Platform, View } from 'react-native';
3
+ import { ActivityIndicator, Pressable, Linking, Platform, View, processColor } from 'react-native';
4
4
  import * as en from '@bloxwap/hig/contracts/messages';
5
5
  import { useColors, useFills, useHIG } from './provider.js';
6
6
  import { Text } from './surface.js';
@@ -18,16 +18,26 @@ function labelRuns(children) { const runs = []; for (const child of React.Childr
18
18
  const touchSlop = { top: 2, bottom: 2 };
19
19
  /** An icon button is 44dp both ways, so its 48dp target reaches out on every side. */
20
20
  const iconSlop = { top: 2, bottom: 2, left: 2, right: 2 };
21
+ /** `fill` at `alpha` of its own opacity: `#rrggbb` gains an alpha byte; any other React Native colour string (`#rgb`, `rgb()`, `hsl()`, a named colour, as `HIGProvider marketColors` may pass) is parsed with processColor into `rgba()`. A platform colour object has no channels to read and gets none. */
22
+ function translucent(fill, alpha) { if (/^#[0-9a-f]{6}$/i.test(fill))
23
+ return `${fill}${Math.round(alpha * 255).toString(16).padStart(2, '0')}`; const argb = processColor(fill); if (typeof argb !== 'number')
24
+ return undefined; const n = argb >>> 0; return `rgba(${(n >> 16) & 255},${(n >> 8) & 255},${n & 255},${Number(((n >>> 24) / 255 * alpha).toFixed(3))})`; }
25
+ const halo = (fill) => { const near = translucent(fill, .45), far = translucent(fill, .2); return near && far ? `0 0 60px 8px ${near}, 0 0 120px 20px ${far}` : undefined; };
21
26
  /** Android appends its localized busy state; including the suffix there would speak it twice. */
22
27
  export function busyAccessibilityLabel(text, busyText, os = Platform.OS) { return text ? (busyText && os !== 'android' ? `${text} · ${busyText}` : text) : undefined; }
23
- export const Button = /* @__PURE__ */ forwardRef(function Button({ children, contentMode = 'default', intent = 'primary', disabled, busy, busyLabel, maxFontSizeMultiplier, script, fullWidth, suppressFeedback, onPress, style, ...props }, ref) { const env = useHIG(); const colors = useColors(); const fills = useFills(); const id = useId(); const sequence = useRef(0); const busyText = busyLabel ?? env.messages.busy ?? en.busy; const filled = intent === 'primary' || intent === 'destructive'; /* Unavailable is neutral: a well fill and muted text. Busy keeps the intent colour under its spinner. */ /* Unavailable is neutral: a well fill and muted text. Busy keeps the intent colour under its spinner. */ const inert = !!disabled && !busy; const label = plainText(children); const accessibleLabel = props.accessibilityLabel ?? (busy ? busyAccessibilityLabel(label, busyText) : undefined); const labelStyle = { color: inert ? (intent === 'ghost' ? colors.faint : colors.muted) : intent === 'destructive' ? colors.background : intent === 'primary' ? colors.onAction : intent === 'ghost' ? colors.muted : colors.text, fontSize: 16, fontWeight: '600', textAlign: 'center' }; return _jsx(Pressable, { ...props, ref: ref, disabled: disabled || busy, accessibilityRole: 'button', accessibilityLabel: accessibleLabel, accessibilityState: { ...props.accessibilityState, disabled: !!disabled || !!busy, busy: !!busy }, "aria-busy": !!busy, onPress: e => { if (disabled || busy)
28
+ export const Button = /* @__PURE__ */ forwardRef(function Button({ children, contentMode = 'default', intent = 'primary', disabled, busy, busyLabel, maxFontSizeMultiplier, script, fullWidth, suppressFeedback, onPress, style, href, onError, glow, ...props }, ref) { const link = href !== undefined; const web = Platform.OS === 'web'; const env = useHIG(); const colors = useColors(); const fills = useFills(); const id = useId(); const sequence = useRef(0); const busyText = busyLabel ?? env.messages.busy ?? en.busy; const dark = intent === 'destructive' || intent === 'up' || intent === 'down' || intent === 'warning'; const filled = intent === 'primary' || dark; /* Market-direction and warning fills take the dark label destructive uses; market fills follow HIGProvider marketColors. */ /* Market-direction and warning fills take the dark label destructive uses; market fills follow HIGProvider marketColors. */ const fill = intent === 'destructive' ? colors.negative : intent === 'up' ? colors.up : intent === 'down' ? colors.down : intent === 'warning' ? colors.warning : colors.action; /* Unavailable is neutral: a well fill and muted text. Busy keeps the intent colour under its spinner. */ /* Unavailable is neutral: a well fill and muted text. Busy keeps the intent colour under its spinner. */ const inert = !!disabled && !busy; const label = plainText(children); const runs = labelRuns(children); /* A glyph beside the label (an action icon) stays on the label's last line: the row does not wrap and the label shrinks to wrap its own words instead. A text-only label keeps the wrapping row. */ /* A glyph beside the label (an action icon) stays on the label's last line: the row does not wrap and the label shrinks to wrap its own words instead. A text-only label keeps the wrapping row. */ const withNode = runs.some(child => typeof child !== 'string'); const accessibleLabel = props.accessibilityLabel ?? (busy ? busyAccessibilityLabel(label, busyText) : undefined); const labelStyle = { color: inert ? (intent === 'ghost' ? colors.faint : colors.muted) : dark ? colors.background : intent === 'primary' ? colors.onAction : intent === 'ghost' ? colors.muted : colors.text, fontSize: 16, fontWeight: '600', textAlign: 'center' }; return _jsx(Pressable, { ...props, ...(web && link && !disabled && !busy ? { href } : {}), ref: ref, disabled: disabled || busy, accessibilityRole: link ? 'link' : 'button', accessibilityLabel: accessibleLabel, accessibilityState: { ...props.accessibilityState, disabled: !!disabled || !!busy, busy: !!busy }, "aria-busy": !!busy, onPress: e => { if (disabled || busy)
24
29
  return; e.stopPropagation(); onPress?.(e); if (!e.isDefaultPrevented() && !disabled && !busy && !suppressFeedback) {
25
30
  try {
26
31
  env.onAccepted?.(id);
27
32
  env.feedback?.emit({ id: `${id}/${++sequence.current}`, source: id, intent: 'activate', origin: 'native' });
28
33
  }
29
34
  catch { /* Best effort only. */ }
30
- } }, hitSlop: props.hitSlop ?? touchSlop, style: state => [{ minHeight: 44, paddingHorizontal: 20, paddingVertical: 10, borderRadius: 9999, alignItems: 'center', justifyContent: 'center', backgroundColor: inert ? (intent === 'ghost' ? 'transparent' : fills.well) : filled ? (intent === 'destructive' ? colors.negative : colors.action) : intent === 'ghost' && !state.pressed ? 'transparent' : colors.nested, opacity: busy ? 0.7 : state.pressed && !inert ? 0.85 : 1, alignSelf: fullWidth ? 'stretch' : 'flex-start' }, typeof style === 'function' ? style(state) : style], children: contentMode === 'custom' ? children : _jsxs(View, { style: { direction: env.direction, flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center', gap: 8 }, children: [busy ? _jsx(ActivityIndicator, { size: 'small', color: labelStyle.color, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' }) : null, labelRuns(children).map((child, i) => typeof child === 'string' ? _jsx(Text, { script: script, maxFontSizeMultiplier: maxFontSizeMultiplier, style: labelStyle, children: child }, `label-${i}`) : child)] }) }); });
35
+ } /* Like Link: host navigation replaces Linking, and the web anchor never navigates on its own as well. */ /* Like Link: host navigation replaces Linking, and the web anchor never navigates on its own as well. */ if (link) {
36
+ if (!onPress)
37
+ void Linking.openURL(href).catch(onError ?? (() => { }));
38
+ if (web)
39
+ e.preventDefault();
40
+ } }, hitSlop: props.hitSlop ?? touchSlop, style: state => [{ minHeight: 44, paddingHorizontal: 20, paddingVertical: 10, borderRadius: 9999, alignItems: 'center', justifyContent: 'center', backgroundColor: inert ? (intent === 'ghost' ? 'transparent' : fills.well) : filled ? fill : intent === 'ghost' && !state.pressed ? 'transparent' : colors.nested, opacity: busy ? 0.7 : state.pressed && !inert ? 0.85 : 1, alignSelf: fullWidth ? 'stretch' : 'flex-start', ...(glow && filled && !inert ? { boxShadow: halo(fill) } : null) }, typeof style === 'function' ? style(state) : style], children: contentMode === 'custom' ? children : _jsxs(View, { style: { direction: env.direction, flexDirection: 'row', flexWrap: withNode ? 'nowrap' : 'wrap', alignItems: 'center', justifyContent: 'center', gap: 8 }, children: [busy ? _jsx(ActivityIndicator, { size: 'small', color: labelStyle.color, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' }) : null, runs.map((child, i) => typeof child === 'string' ? _jsx(Text, { script: script, maxFontSizeMultiplier: maxFontSizeMultiplier, style: withNode ? [labelStyle, { flexShrink: 1 }] : labelStyle, children: child }, `label-${i}`) : child)] }) }); });
31
41
  /** While busy, the spinner takes the icon's place. */
32
42
  export function IconButton({ label, children, style, ...props }) { return _jsx(Button, { ...props, hitSlop: props.hitSlop ?? iconSlop, accessibilityLabel: label, style: state => [{ minWidth: 44, paddingHorizontal: 10 }, typeof style === 'function' ? style(state) : style], children: props.busy && props.contentMode !== 'custom' ? null : children }); }
33
43
  export const Link = /* @__PURE__ */ forwardRef(function Link({ href, children, onError, onPress, contentMode = 'default', disabled, style, ...props }, ref) { const colors = useColors(); const web = Platform.OS === 'web', webHref = web && !disabled ? { href } : {}; return _jsx(Pressable, { ...props, ...webHref, ref: ref, accessibilityRole: 'link', disabled: disabled, accessibilityState: { ...props.accessibilityState, disabled: !!disabled }, "aria-busy": props.accessibilityState?.busy, onPress: event => { if (disabled)
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Check } from '@bloxwap/icons/native/check';
2
3
  import { Pressable, View } from 'react-native';
3
4
  import { nativeMetrics as tokens } from '@bloxwap/hig/tokens';
4
5
  import { useColors, useControllable, useHIG } from './provider.js';
@@ -7,5 +8,5 @@ export function Checkbox({ label, checked, defaultChecked = false, disabled, onC
7
8
  const [current, set] = useControllable(checked, defaultChecked, onCheckedChange);
8
9
  const colors = useColors(), env = useHIG();
9
10
  return _jsxs(Pressable, { accessibilityRole: 'checkbox', "aria-checked": current, "aria-disabled": !!disabled, accessibilityLabel: label, accessibilityState: { checked: current, disabled: !!disabled }, disabled: disabled, onPress: () => { if (!disabled)
10
- set(!current); }, style: { direction: env.direction, minHeight: 48, flexDirection: 'row', alignItems: 'center', gap: tokens.space.sm, opacity: disabled ? .5 : 1 }, children: [_jsx(View, { pointerEvents: 'none', accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants', "aria-hidden": true, style: { width: 20, height: 20, flexShrink: 0, borderWidth: 1.5, borderColor: current ? colors.action : colors.muted, borderRadius: tokens.radius.sm, backgroundColor: current ? colors.action : colors.surface, alignItems: 'center', justifyContent: 'center' }, children: current && _jsx(View, { style: { width: 10, height: 6, borderLeftWidth: 2, borderBottomWidth: 2, borderColor: colors.onAction, transform: [{ translateY: -1 }, { rotate: '-45deg' }] } }) }), _jsx(Text, { style: { flexShrink: 1, minWidth: 0 }, children: label })] });
11
+ set(!current); }, style: { direction: env.direction, minHeight: 48, flexDirection: 'row', alignItems: 'center', gap: tokens.space.sm, opacity: disabled ? .5 : 1 }, children: [_jsx(View, { pointerEvents: 'none', accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants', "aria-hidden": true, style: { width: 20, height: 20, flexShrink: 0, borderWidth: 1.5, borderColor: current ? colors.action : colors.muted, borderRadius: tokens.radius.sm, backgroundColor: current ? colors.action : colors.surface, alignItems: 'center', justifyContent: 'center' }, children: current && _jsx(Check, { size: 14, color: colors.onAction }) }), _jsx(Text, { style: { flexShrink: 1, minWidth: 0 }, children: label })] });
11
12
  }
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle } from 'react-native';
3
+ import { type ConfettiOptions } from '@bloxwap/hig/contracts/confetti';
4
+ export { mirrorConfetti, type ConfettiOptions, type ConfettiShape } from '@bloxwap/hig/contracts/confetti';
5
+ export interface ConfettiFire {
6
+ /** Fires one burst in the most recently mounted `Confetti` and resolves when it has finished, or at once when nothing is drawn: no `Confetti` is mounted, reduced motion is on (unless `disableForReducedMotion` is false) or the burst has no pieces. */
7
+ (options?: ConfettiOptions): Promise<void>;
8
+ /** Stops every burst now, also one still waiting for its layer, removes its views and resolves their promises. */
9
+ reset(): void;
10
+ }
11
+ /** Fires a burst of confetti. Call it from an event handler or an effect; mount `Confetti` once first. */
12
+ export declare const confetti: ConfettiFire;
13
+ export interface ConfettiProps {
14
+ /** Fires `options` whenever it is truthy: on mount, and each time it changes to another truthy value. A win count or an order id works. Leave it out to fire only through `confetti()`. */
15
+ trigger?: unknown;
16
+ /** The burst `trigger` fires, or several fired together. Read when `trigger` changes, so it need not be a stable object. */
17
+ options?: ConfettiOptions | readonly ConfettiOptions[];
18
+ /** Merged over the layer, which fills its parent and takes no touches. */
19
+ style?: StyleProp<ViewStyle>;
20
+ /** Test ID of the layer. */
21
+ testID?: string;
22
+ }
23
+ /**
24
+ * The confetti layer. Mount it once, last inside the screen root and inside HIGProvider, so it covers what it should rain
25
+ * over. Bursts follow the provider's `reducedMotion` and paint its `action`, `info`, `down`, `warning` and `up` colours
26
+ * (Display P3 on an iOS host that paints P3) unless the call names its own. The layer is hidden from assistive technology
27
+ * and stays left-to-right, because confetti is physical: `origin.x` 0 is the left edge in both text directions.
28
+ *
29
+ * HIGProvider learns the system's reduced motion setting a moment after it mounts. So a burst asked for while this layer
30
+ * mounts (a truthy `trigger`, or `confetti()` in a mount effect) waits until the layer has asked the system too, and is
31
+ * then drawn only if the provider says motion is wanted.
32
+ */
33
+ export declare function Confetti({ trigger, options, style, testID }: ConfettiProps): React.JSX.Element;
@@ -0,0 +1,143 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
+ import { AccessibilityInfo, Dimensions, StyleSheet, View } from 'react-native';
4
+ import Reanimated, { cancelAnimation, Easing, ReduceMotion, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
5
+ import { CONFETTI_FIRST_TICK, confettiBox, confettiBursts, confettiDuration, confettiOpacity, confettiPose, confettiSkipped, confettiStarWedge, createConfettiBurst } from '@bloxwap/hig/contracts/confetti';
6
+ import { useColors, useHIG } from './provider.js';
7
+ export { mirrorConfetti } from '@bloxwap/hig/contracts/confetti';
8
+ const hosts = [];
9
+ let sequence = 0;
10
+ // The sides of a star's triangles that must not show. Android Fabric reads colour 0 ('transparent') as unset and would draw
11
+ // them in the default colour; clear white is non-zero there and still invisible.
12
+ const clear = '#ffffff00';
13
+ const fifths = [0, 1, 2, 3, 4];
14
+ /**
15
+ * A star without an SVG package: the five triangles of `confettiStarWedge`, each a view with no size whose bottom border
16
+ * is the triangle, turned about the middle of its base, which is the star's centre. They never change after mount.
17
+ */
18
+ function starWedges(size, color) {
19
+ const width = confettiStarWedge.width * size, height = confettiStarWedge.height * size;
20
+ return fifths.map(fifth => ({ position: 'absolute', left: height - width / 2, top: 0, width: 0, height: 0, borderLeftWidth: width / 2, borderRightWidth: width / 2, borderBottomWidth: height, borderLeftColor: clear, borderRightColor: clear, borderBottomColor: color, transform: [{ translateY: height / 2 }, { rotate: `${fifth * 72}deg` }, { translateY: -height / 2 }] }));
21
+ }
22
+ const Piece = React.memo(function Piece({ particle, physics, clock, left, top, color }) {
23
+ const box = confettiBox(particle.shape, physics), half = box / 2;
24
+ // Transform and opacity only: the view keeps its layout for the whole flight.
25
+ const motion = useAnimatedStyle(() => {
26
+ 'worklet';
27
+ const pose = confettiPose(particle, physics, clock.value);
28
+ return { opacity: confettiOpacity(physics, clock.value), transform: [{ translateX: left + pose.x - half }, { translateY: top + pose.y - half }, { rotate: `${pose.rotate}rad` }, { scaleX: pose.scaleX }, { scaleY: pose.scaleY }] };
29
+ });
30
+ // The triangles overlap at the centre, so the star fades as one picture, not triangle by triangle.
31
+ if (particle.shape === 'star')
32
+ return _jsx(Reanimated.View, { needsOffscreenAlphaCompositing: true, style: [styles.piece, { width: box, height: box }, motion], children: starWedges(physics.size, color).map((wedge, fifth) => _jsx(View, { style: wedge }, fifth)) });
33
+ return _jsx(Reanimated.View, { style: [styles.piece, { width: box, height: box, borderRadius: particle.shape === 'circle' ? half : 0, backgroundColor: color }, motion] });
34
+ });
35
+ const Burst = React.memo(function Burst({ run, onEnd }) {
36
+ const { id, burst, left, top } = run, { physics, particles, colors } = burst;
37
+ const clock = useSharedValue(CONFETTI_FIRST_TICK);
38
+ useEffect(() => {
39
+ const end = () => onEnd(id);
40
+ // One clock moves every piece. It is linear because the physics holds the easing, and it ignores the system's reduced
41
+ // motion setting because the host has already decided whether this burst is drawn.
42
+ clock.value = withTiming(physics.ticks, { duration: confettiDuration(physics), easing: Easing.linear, reduceMotion: ReduceMotion.Never }, finished => {
43
+ 'worklet';
44
+ if (finished)
45
+ runOnJS(end)();
46
+ });
47
+ return () => cancelAnimation(clock);
48
+ }, [clock, id, onEnd, physics]);
49
+ return _jsx(_Fragment, { children: particles.map((particle, index) => _jsx(Piece, { particle: particle, physics: physics, clock: clock, left: left, top: top, color: colors[particle.color] }, index)) });
50
+ });
51
+ /** Fires a burst of confetti. Call it from an event handler or an effect; mount `Confetti` once first. */
52
+ export const confetti = Object.assign((options) => { const host = hosts[hosts.length - 1]; return host ? host.fire(options) : Promise.resolve(); }, { reset: () => { for (const host of hosts.slice())
53
+ host.reset(); } });
54
+ /**
55
+ * The confetti layer. Mount it once, last inside the screen root and inside HIGProvider, so it covers what it should rain
56
+ * over. Bursts follow the provider's `reducedMotion` and paint its `action`, `info`, `down`, `warning` and `up` colours
57
+ * (Display P3 on an iOS host that paints P3) unless the call names its own. The layer is hidden from assistive technology
58
+ * and stays left-to-right, because confetti is physical: `origin.x` 0 is the left edge in both text directions.
59
+ *
60
+ * HIGProvider learns the system's reduced motion setting a moment after it mounts. So a burst asked for while this layer
61
+ * mounts (a truthy `trigger`, or `confetti()` in a mount effect) waits until the layer has asked the system too, and is
62
+ * then drawn only if the provider says motion is wanted.
63
+ */
64
+ export function Confetti({ trigger, options, style, testID }) {
65
+ const colors = useColors();
66
+ const { reducedMotion } = useHIG();
67
+ const [runs, setRuns] = useState([]);
68
+ const [settled, setSettled] = useState(false);
69
+ const room = useRef(null), pending = useRef(new Map()), waiting = useRef([]), ready = useRef(false), palette = useRef([]), motion = useRef(reducedMotion), latest = useRef(options), fired = useRef(undefined);
70
+ palette.current = useMemo(() => [colors.action, colors.info, colors.down, colors.warning, colors.up], [colors]);
71
+ motion.current = reducedMotion;
72
+ latest.current = options;
73
+ const settle = useCallback(() => { const over = [...waiting.current.splice(0).map(wait => wait.resolve), ...pending.current.values()]; pending.current.clear(); for (const resolve of over)
74
+ resolve(); }, []);
75
+ const end = useCallback((id) => {
76
+ setRuns(current => current.some(run => run.id === id) ? current.filter(run => run.id !== id) : current);
77
+ const resolve = pending.current.get(id);
78
+ if (resolve) {
79
+ pending.current.delete(id);
80
+ resolve();
81
+ }
82
+ }, []);
83
+ const launch = useCallback((burstOptions) => {
84
+ if (pending.current.size >= 8 || confettiSkipped(burstOptions, motion.current))
85
+ return Promise.resolve();
86
+ const burst = createConfettiBurst(burstOptions, palette.current);
87
+ if (burst.particles.length === 0)
88
+ return Promise.resolve();
89
+ // Before the layer has been laid out the window stands in for it.
90
+ const { width, height } = room.current ?? Dimensions.get('window'), id = ++sequence;
91
+ return new Promise(resolve => { pending.current.set(id, resolve); setRuns(current => [...current, { id, burst, left: burst.origin.x * width, top: burst.origin.y * height }]); });
92
+ }, []);
93
+ // Until the layer can answer for reduced motion a burst waits, a moment at most.
94
+ const fire = useCallback((burstOptions) => ready.current ? launch(burstOptions) : new Promise(resolve => { if (waiting.current.length >= 8) {
95
+ resolve();
96
+ return;
97
+ } waiting.current.push({ options: burstOptions, resolve }); }), [launch]);
98
+ const begin = useCallback(() => { ready.current = true; for (const wait of waiting.current.splice(0))
99
+ void launch(wait.options).then(wait.resolve); }, [launch]);
100
+ const reset = useCallback(() => { setRuns(current => current.length ? [] : current); settle(); }, [settle]);
101
+ // One host for the life of the component, so a burst it holds survives React running the effects twice in development.
102
+ const host = useMemo(() => ({ fire, reset, stop: settle }), [fire, reset, settle]);
103
+ useEffect(() => {
104
+ hosts.push(host);
105
+ // Only a host that stays out is gone; its promises then resolve.
106
+ return () => { const index = hosts.indexOf(host); if (index >= 0)
107
+ hosts.splice(index, 1); void Promise.resolve().then(() => { if (!hosts.includes(host))
108
+ host.stop(); }); };
109
+ }, [host]);
110
+ useEffect(() => {
111
+ if (ready.current)
112
+ return;
113
+ // Asked after the provider's own question, so the answer comes after the provider's. Without a system request for
114
+ // reduced motion the provider has nothing left to learn. With one, the update below is rendered no sooner than the
115
+ // provider's, and the effect after it sees what the provider decided.
116
+ let alive = true;
117
+ const known = (reduced) => { if (!alive)
118
+ return; if (reduced)
119
+ setSettled(true);
120
+ else
121
+ begin(); };
122
+ void Promise.resolve().then(() => AccessibilityInfo.isReduceMotionEnabled()).then(known, () => known(false));
123
+ return () => { alive = false; };
124
+ }, [begin]);
125
+ useEffect(() => { if (settled)
126
+ begin(); }, [settled, begin]);
127
+ useEffect(() => {
128
+ // Each truthy value fires once, also when React runs the effect twice in development.
129
+ if (Object.is(fired.current, trigger))
130
+ return;
131
+ fired.current = trigger;
132
+ if (!trigger)
133
+ return;
134
+ for (const burst of confettiBursts(latest.current))
135
+ void fire(burst);
136
+ }, [trigger, fire]);
137
+ const measure = useCallback((event) => { const { width, height } = event.nativeEvent.layout; room.current = { width, height }; }, []);
138
+ return _jsx(View, { testID: testID, pointerEvents: 'none', accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants', onLayout: measure, style: [styles.layer, style], children: runs.map(run => _jsx(Burst, { run: run, onEnd: end }, run.id)) });
139
+ }
140
+ const styles = StyleSheet.create({
141
+ layer: { position: 'absolute', left: 0, right: 0, top: 0, bottom: 0, direction: 'ltr' },
142
+ piece: { position: 'absolute', left: 0, top: 0 },
143
+ });
@@ -0,0 +1,98 @@
1
+ import React from 'react';
2
+ import { type ScrollViewProps } from 'react-native';
3
+ import { type ScreenHeaderControlProps } from './screen-header.js';
4
+ /** One more line under Network, such as a fee: host text on both edges. */
5
+ export interface ConfirmDetail {
6
+ label: string;
7
+ value: React.ReactNode;
8
+ /** What a `value` that is not text reads as. */
9
+ valueLabel?: string;
10
+ }
11
+ /** A full-width action under Cancel and Confirm, such as "Delete anyway": a ghost button, in the negative colour with `tone='destructive'`. */
12
+ export interface ConfirmTertiaryAction {
13
+ label: string;
14
+ onSelect: () => void;
15
+ tone?: 'destructive';
16
+ disabled?: boolean;
17
+ /** The button's test ID, in place of `<testID>-tertiary`. */
18
+ testID?: string;
19
+ }
20
+ export interface ConfirmBlockProps {
21
+ /** The amount being sent, in token units. `null` reads as unknown. Leave it out, with `symbol`, `address` and `network`, for a confirmation that is not a send, such as signing out: the block then draws only the header, `children`, the notice and the actions. */
22
+ amount?: number | null;
23
+ /** The token's ticker, after the amount: HYPE. */
24
+ symbol?: string;
25
+ /** Format of the amount; default `{maximumFractionDigits:6}`. */
26
+ amountOptions?: Intl.NumberFormatOptions;
27
+ /** What the amount is read as before the figure, such as "Amount" ("Amount: 2.5", then the ticker). Without it the figure is read alone. */
28
+ amountLabel?: string;
29
+ /** The destination address, shown in full beside "To", always as two rows, with the first 4 characters (6 with a `0x` prefix) and the last 4 emphasised and the rest muted. */
30
+ address?: string;
31
+ /** The network the send moves on: HyperEVM. */
32
+ network?: string;
33
+ /** What is being confirmed, drawn as given under the header (and under the amount and lines of a send): usually a muted `Text`, an `Alert` or a `ListGroup`. */
34
+ children?: React.ReactNode;
35
+ /** A bulleted list under `children`, in the muted colour, such as what deleting an account loses. */
36
+ points?: readonly React.ReactNode[];
37
+ /** The confirming action's intent: `primary` (the default), `destructive`, for an action that deletes or ends something, or `warning`, the warning role's fill, for an action that goes ahead despite a caution, such as confirming past a `warning`. */
38
+ confirmIntent?: 'primary' | 'destructive' | 'warning';
39
+ /** A full-width action under Cancel and Confirm, such as "Delete anyway". Unavailable while `busy`, unless `cancelWhileBusy` is set. */
40
+ tertiaryAction?: ConfirmTertiaryAction;
41
+ /** More lines under Network, such as a fee. */
42
+ details?: readonly ConfirmDetail[];
43
+ /** Draws the Network line and each of `details` on one line: the label keeps its width and the value truncates with an ellipsis instead of wrapping (the whole line is still read in full). A value that is not text is set inside that one line of text, so pass inline text content, such as a Text. The address keeps its two rows. Off by default. */
44
+ oneLineDetails?: boolean;
45
+ /** Heading. Defaults to the built-in "Confirm Send". */
46
+ title?: string;
47
+ /** Heading of the warning. Defaults to the built-in "Double-check the address." */
48
+ warningTitle?: string;
49
+ /** Body of the warning. Defaults to the built-in sentence naming the token and network when `address` is given, and to none otherwise; `null` or `false` draws no warning. */
50
+ warning?: React.ReactNode;
51
+ /** A notice between the warning and the actions, drawn as given, such as an error `Alert` when a fee cannot be read or the send failed. Nothing by default. */
52
+ notice?: React.ReactNode;
53
+ /** Called when the user confirms. The host signs and sends. */
54
+ onConfirm: () => void;
55
+ /** Text of the confirming action. Defaults to the built-in "Confirm Send". */
56
+ confirmLabel?: string;
57
+ /** The send is in progress: the confirming action shows a spinner and ignores presses, and Back, Cancel and the tertiary action are unavailable. */
58
+ busy?: boolean;
59
+ /** Draws the confirming action unavailable, for example while a quote refreshes. */
60
+ confirmDisabled?: boolean;
61
+ /** Keeps Back, Cancel and the tertiary action available while `busy`, for a wait the user may walk away from, such as a wallet signature the host can abandon. Off by default. */
62
+ cancelWhileBusy?: boolean;
63
+ /** Keeps only Back available while `busy`: the user may leave the pane while the action finishes, but Cancel and the tertiary action stay held, since they cannot stop it. Off by default; `cancelWhileBusy` frees Back as well. */
64
+ backWhileBusy?: boolean;
65
+ /** Shows Cancel on the leading side of the confirming action, the two sharing the row equally. Without it the confirming action takes the full width. */
66
+ onCancel?: () => void;
67
+ /** Text of Cancel. Defaults to the built-in "Cancel". */
68
+ cancelLabel?: string;
69
+ /** Draws Cancel unavailable without `busy`, for example while the host's own work runs and the confirming action is a step that does not show a spinner. */
70
+ cancelDisabled?: boolean;
71
+ /** The confirming action's test ID, in place of `<testID>-confirm`. */
72
+ confirmTestID?: string;
73
+ /** Cancel's test ID, in place of `<testID>-cancel`. */
74
+ cancelTestID?: string;
75
+ /** Shows Back on the leading edge of the header. */
76
+ onBack?: () => void;
77
+ /** Pressable props for the header's Back, such as `{android_disableSound: true}` when the host plays its own sound, as `ScreenHeader` takes them. */
78
+ backProps?: ScreenHeaderControlProps;
79
+ /** A control on the trailing edge of the header, usually an IconButton. */
80
+ headerAction?: React.ReactNode;
81
+ /** Keeps the header pinned while the rest scrolls: the block becomes its own scroll view with the header as its sticky first child, transparent at rest and filled once content scrolls under it. Place it in a bounded container, such as a sheet body. */
82
+ stickyHeader?: boolean;
83
+ /** With `stickyHeader`: the header's fill once content is under it. Defaults to the background role; in a sheet pass the sheet's fill. */
84
+ stickyHeaderBackground?: string;
85
+ /** The scroll view used with `stickyHeader`, such as a sheet library's own. Defaults to React Native's ScrollView. */
86
+ scrollComponent?: React.ComponentType<ScrollViewProps>;
87
+ /** `nativeID` of the title, so a sheet around the block can name itself with `accessibilityLabelledBy` (Android). */
88
+ headingId?: string;
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
+ testID?: string;
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
+ }[][];
97
+ /** 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
+ 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;
@@ -0,0 +1,48 @@
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';
4
+ import { withAlpha } from '@bloxwap/hig/tokens';
5
+ import { useColors, useHIG, useMessages } from './provider.js';
6
+ import { Text } from './surface.js';
7
+ import { Button } from './button.js';
8
+ import { AnimatedNumberReadout } from './animated-number.js';
9
+ import { ScreenHeader } from './screen-header.js';
10
+ import { StickyHeaderLayout } from './sticky-header.js';
11
+ 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
+ /** 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
+ 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
+ // 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
+ const held = !!busy && !cancelWhileBusy;
28
+ const backHeld = held && !backWhileBusy;
29
+ const colors = useColors(), t = useMessages(), { direction, monoFontFamily } = useHIG();
30
+ const id = (part) => `${testID}-${part}`;
31
+ const note = warning === undefined ? (address !== undefined ? t.sendWarning(symbol ?? '', network ?? '') : null) : warning;
32
+ // Read-only lines, each read as one: "To, 0x…".
33
+ // With oneLineDetails every line but the address is one line: the label keeps its width, the value truncates.
34
+ // A value that is not text is set inside the one-line Text too, so its text content truncates with an ellipsis as on web.
35
+ const line = (part, label, value, spoken) => {
36
+ const one = !!oneLineDetails && part !== toPart, lines = one ? 1 : undefined;
37
+ 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
+ };
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))];
40
+ const header = _jsx(ScreenHeader, { title: title ?? t.confirmSend, onBack: onBack, backDisabled: backHeld, backProps: backProps, action: headerAction, headingId: headingId, testID: testID });
41
+ const hasBody = (children != null && children !== false) || !!points?.length;
42
+ const tertiaryInert = held || !!tertiaryAction?.disabled;
43
+ const body = _jsxs(_Fragment, { children: [amount !== undefined ? _jsxs(View, { style: { direction, flexDirection: 'row', alignItems: 'baseline', justifyContent: 'center', flexWrap: 'wrap', columnGap: 8 }, children: [_jsx(AnimatedNumberReadout, { testID: id('amount'), value: amount, options: amountOptions, label: amountLabel, style: { fontSize: 44, lineHeight: 50, fontWeight: '700', letterSpacing: -0.9, textAlign: 'center' } }), symbol ? _jsx(Text, { testID: id('symbol'), style: { fontSize: 24, lineHeight: 32, fontWeight: '600', color: colors.muted }, children: symbol }) : null] }) : null, lines.length ? _jsx(View, { testID: id('details'), style: { gap: 12, paddingHorizontal: 4 }, children: lines }) : null, hasBody ? _jsxs(View, { testID: id('body'), style: { gap: 12 }, children: [children, points?.length ? _jsx(View, { style: { gap: 8 }, children: points.map((point, index) => _jsxs(View, { testID: id(`point-${index}`), accessible: true, style: { direction, flexDirection: 'row', gap: 8, paddingStart: 4 }, children: [_jsx(Text, { "aria-hidden": true, accessibilityElementsHidden: true, importantForAccessibility: 'no', style: { fontSize: 16, lineHeight: 24, color: colors.muted }, children: '•' }), _jsx(Text, { style: { flexShrink: 1, fontSize: 16, lineHeight: 24, color: colors.muted }, children: point })] }, index)) }) : null] }) : null, note != null && note !== false ? _jsxs(View, { testID: id('warning'), accessible: true, style: { gap: 8, paddingVertical: 20, paddingHorizontal: 20, borderRadius: 20, backgroundColor: withAlpha(colors.warning, 0.16) }, children: [_jsx(Text, { testID: id('warning-title'), style: { fontSize: 24, lineHeight: 30, fontWeight: '700', color: colors.warning }, children: warningTitle ?? t.sendWarningTitle }), _jsx(Text, { testID: id('warning-body'), style: { fontSize: 16, lineHeight: 24, color: colors.text }, children: note })] }) : null, notice, _jsxs(View, { testID: id('actions'), style: { direction, flexDirection: 'row', gap: 8 }, children: [onCancel ? _jsx(Button, { testID: cancelTestID ?? id('cancel'), intent: 'secondary', disabled: held || !!cancelDisabled, onPress: onCancel, style: { flex: 1, alignSelf: 'auto' }, children: cancelLabel ?? t.cancel }) : null, _jsx(Button, { testID: confirmTestID ?? id('confirm'), intent: confirmIntent, busy: busy, disabled: confirmDisabled, onPress: onConfirm, style: { flex: 1, alignSelf: 'auto' }, children: confirmLabel ?? t.confirmSend })] }), tertiaryAction ? _jsx(Button, { testID: tertiaryAction.testID ?? id('tertiary'), intent: 'ghost', fullWidth: true, disabled: tertiaryInert, onPress: tertiaryAction.onSelect, accessibilityLabel: tertiaryAction.label, contentMode: 'custom', style: { marginTop: -8 }, children: _jsx(Text, { style: { fontSize: 16, fontWeight: '600', textAlign: 'center', color: tertiaryInert ? colors.faint : tertiaryAction.tone === 'destructive' ? colors.negative : colors.muted }, children: tertiaryAction.label }) }) : null] });
44
+ // The sticky layout puts the header and the body in separate views, so the body's first gap is its top padding.
45
+ if (stickyHeader)
46
+ return _jsx(StickyHeaderLayout, { testID: testID, headerTestID: id('sticky-header'), header: header, background: stickyHeaderBackground, scrollComponent: scrollComponent, bodyStyle: { direction, gap: 16, paddingTop: 16 }, children: body });
47
+ return _jsxs(View, { testID: testID, style: { direction, padding: 16, gap: 16 }, children: [header, body] });
48
+ }
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { assertUniqueKeys } from '@bloxwap/hig/contracts';
2
3
  import React from 'react';
3
4
  import { FlatList, Platform, View, StyleSheet } from 'react-native';
4
5
  import { formatNumberReadout } from './animated-number-model.js';
@@ -25,6 +26,7 @@ export function Metric({ label, value }) { return _jsxs(Surface, { children: [_j
25
26
  export const Stat = Metric;
26
27
  export function Row({ children }) { return _jsx(View, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: 12, paddingVertical: 12 }, children: children }); }
27
28
  export function List({ items, keyFor, render, empty, label, loading = false, error, onRetry, onLoadMore }) {
29
+ assertUniqueKeys(items, keyFor, 'List');
28
30
  const { messages } = useHIG();
29
31
  return _jsx(FlatList, { data: items, accessibilityLabel: label, accessibilityState: { busy: loading }, keyExtractor: keyFor, renderItem: ({ item }) => _jsx(View, { children: render(item) }), ItemSeparatorComponent: Separator, ListEmptyComponent: !loading && !error ? _jsx(Text, { children: empty ?? messages.noItems ?? en.noItems }) : null, ListFooterComponent: _jsxs(View, { style: { gap: 12, paddingTop: loading || error || onLoadMore ? 12 : 0 }, children: [loading && _jsx(Text, { accessibilityLiveRegion: 'polite', children: messages.loadingItems ?? en.loadingItems }), error && _jsxs(View, { style: { gap: 12 }, children: [_jsx(Text, { accessibilityRole: 'alert', children: error }), onRetry && _jsx(Button, { disabled: loading, onPress: onRetry, children: messages.retry ?? en.retry })] }), onLoadMore && _jsx(Button, { disabled: loading, onPress: onLoadMore, children: messages.loadMore ?? en.loadMore })] }) });
30
32
  }
@@ -0,0 +1,91 @@
1
+ import React from 'react';
2
+ import { View, type ScrollViewProps } from 'react-native';
3
+ import { type ScreenHeaderControlProps } from './screen-header.js';
4
+ /** The colour of a section: its tint, its icon disc and its heading. */
5
+ export type ExplainerTone = 'up' | 'down' | 'positive' | 'negative' | 'warning';
6
+ /** One titled part of the explanation. Every field is optional, so a section can be a heading and a sentence, an icon row, or host media with a caption. */
7
+ export interface ExplainerSection {
8
+ /** Stable key, also used in the test IDs. */
9
+ id: string;
10
+ /** The section's heading: Up. */
11
+ title?: string;
12
+ /** Muted text after the heading on the same line, such as what the heading means: → Momentum is rising. */
13
+ meaning?: string;
14
+ /** A glyph on the leading edge in a 40dp disc, such as an icon drawn in `useColors()[tone]`. Decorative: hidden from assistive technology. */
15
+ icon?: React.ReactNode;
16
+ /** Tints the section, its disc and its heading. Without it the section sits on the neutral fill. */
17
+ tone?: ExplainerTone;
18
+ /** Host content under the heading and before the body, centred, such as an example card and its caption. */
19
+ media?: React.ReactNode;
20
+ /** The section's text, muted. A string is drawn as Text; anything else as given. */
21
+ body?: React.ReactNode;
22
+ /** A small note at the end of the section. A string is drawn as Text; anything else as given. */
23
+ caveat?: React.ReactNode;
24
+ /** The section's test ID, in place of `<testID>-section-<id>`. */
25
+ testID?: string;
26
+ }
27
+ /** One action at the foot of the block. */
28
+ export interface ExplainerAction {
29
+ label: string;
30
+ onSelect: () => void;
31
+ /** Defaults to `primary` for `primaryAction` and `secondary` for `secondaryAction`. */
32
+ intent?: 'primary' | 'secondary' | 'destructive' | 'ghost';
33
+ disabled?: boolean;
34
+ busy?: boolean;
35
+ /** The button's test ID, in place of `<testID>-primary` or `<testID>-secondary`. */
36
+ testID?: string;
37
+ /** Pressable props for the button (native), such as `{android_disableSound: true}` when the host plays its own sound. HIG keeps its own name, role, state and press. */
38
+ pressProps?: ScreenHeaderControlProps;
39
+ /** A glyph after the label, such as an arrow for an action that opens something outside the app (test ID `<button test ID>-icon`). Decorative: hidden from assistive technology, so the label alone names the button. */
40
+ icon?: React.ReactNode;
41
+ }
42
+ export interface ExplainerBlockProps {
43
+ /** Heading of the header. Leave it out inside a host sheet that draws its own title. */
44
+ title?: string;
45
+ /** A kicker above the title in small muted capitals: Builder fee. With `title` it is centred in the header over the heading (`<testID>-eyebrow`); without one it is the block's first line (`<testID>-eyebrow` too). Host text. */
46
+ eyebrow?: string;
47
+ /** Short host text in a badge beside the title, as `ScreenHeader` `badge` (needs `title`): Demo. */
48
+ badge?: string;
49
+ /** A ref to the header's title (the title and badge as one header with `badge`), for example to move accessibility focus to it when the sheet opens. Needs `title`. */
50
+ titleRef?: React.Ref<React.ComponentRef<typeof View>>;
51
+ /** A large figure or host media centred under the header and before the lead (`<testID>-hero`), such as a 68pt “4% off” or a donut. Drawn as given; the host sets its size and colour, and hides decorative media from assistive technology. */
52
+ hero?: React.ReactNode;
53
+ /** A lead paragraph under the header, muted. A string is drawn as Text; anything else as given. */
54
+ description?: React.ReactNode;
55
+ /** The titled sections, in order. */
56
+ sections?: readonly ExplainerSection[];
57
+ /** Numbered steps after the sections, such as how to finish a task. A string is drawn as Text; anything else as given. */
58
+ steps?: readonly React.ReactNode[];
59
+ /** A small note after the sections and steps. */
60
+ caveat?: React.ReactNode;
61
+ /** Host content after the sections, steps and closing note and before the actions, such as a field, a link or a share card. Drawn as given. */
62
+ children?: React.ReactNode;
63
+ /** The main action: Got it, Copy link. */
64
+ primaryAction?: ExplainerAction;
65
+ /** A second action on the leading side of the main one, the two sharing the row equally: Not now. */
66
+ secondaryAction?: ExplainerAction;
67
+ /** Keeps the provider's feedback off the actions, for a host that plays its own cue. */
68
+ suppressFeedback?: boolean;
69
+ /** Shows Back on the leading edge of the header (needs `title`). */
70
+ onBack?: () => void;
71
+ /** Pressable props for Back, such as `{android_disableSound: true}`. */
72
+ backProps?: ScreenHeaderControlProps;
73
+ /** A control on the trailing edge of the header, such as a Close IconButton. */
74
+ headerAction?: React.ReactNode;
75
+ /** `nativeID` of the title, so a sheet can name itself with `accessibilityLabelledBy` (Android). */
76
+ headingId?: string;
77
+ /** Keeps the header pinned while the rest scrolls: the block becomes its own scroll view with the header as its sticky first child. Needs `title`; place it in a bounded container. */
78
+ stickyHeader?: boolean;
79
+ /** With `stickyHeader`: the header's fill once content is under it. Defaults to the background role; in a sheet pass the sheet's fill. */
80
+ stickyHeaderBackground?: string;
81
+ /** The scroll view used with `stickyHeader`, such as a sheet library's own. */
82
+ scrollComponent?: React.ComponentType<ScrollViewProps>;
83
+ /** Prefix of the test IDs: `<testID>-header`, `-back`, `-title`, `-description`, `-section-<id>` (with `-icon`, `-title`, `-media`, `-body` and `-caveat` after it), `-step-<index>`, `-caveat`, `-actions`, `-secondary` and `-primary`. Defaults to `explainer`. */
84
+ testID?: string;
85
+ }
86
+ /**
87
+ * How something works, or how to finish a task, as a screen: an optional header, a lead paragraph, titled sections (each with an optional
88
+ * icon and tone, a heading, media, a body and a caveat), numbered steps, a closing note, then one or two actions. Draws the "How Swing
89
+ * works" and "How Trend works" sheets and short task dialogs such as inviting a friend.
90
+ */
91
+ export declare function ExplainerBlock({ title, eyebrow, badge, titleRef, hero, description, sections, steps, caveat, children, primaryAction, secondaryAction, suppressFeedback, onBack, backProps, headerAction, headingId, stickyHeader, stickyHeaderBackground, scrollComponent, testID }: ExplainerBlockProps): React.JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ import { withAlpha } from '@bloxwap/hig/tokens';
4
+ import { useColors, useFills, useHIG } from './provider.js';
5
+ import { Text } from './surface.js';
6
+ import * as en from '@bloxwap/hig/contracts/messages';
7
+ import { Button, busyAccessibilityLabel } from './button.js';
8
+ import { ScreenHeader } from './screen-header.js';
9
+ import { StickyHeaderLayout } from './sticky-header.js';
10
+ const hidden = { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' };
11
+ /** Test ID parts, which double as the actions' default intents. */
12
+ const primaryPart = 'primary', secondaryPart = 'secondary', descriptionPart = 'description', caveatPart = 'caveat';
13
+ /**
14
+ * How something works, or how to finish a task, as a screen: an optional header, a lead paragraph, titled sections (each with an optional
15
+ * icon and tone, a heading, media, a body and a caveat), numbered steps, a closing note, then one or two actions. Draws the "How Swing
16
+ * works" and "How Trend works" sheets and short task dialogs such as inviting a friend.
17
+ */
18
+ export function ExplainerBlock({ title, eyebrow, badge, titleRef, hero, description, sections = [], steps = [], caveat, children, primaryAction, secondaryAction, suppressFeedback, onBack, backProps, headerAction, headingId, stickyHeader, stickyHeaderBackground, scrollComponent, testID = 'explainer' }) {
19
+ const colors = useColors(), fills = useFills(), { direction, messages } = useHIG();
20
+ const id = (part) => `${testID}-${part}`;
21
+ const muted = { fontSize: 14, lineHeight: 20, color: colors.muted };
22
+ // Host text is drawn as muted Text; host nodes are drawn as given.
23
+ const prose = (content, part) => typeof content === 'string' || typeof content === 'number' ? _jsx(Text, { testID: id(part), style: muted, children: content }) : _jsx(View, { testID: id(part), children: content });
24
+ const shown = (content) => content != null && content !== false;
25
+ const action = (entry, fallback) => { const button = entry.testID ?? id(fallback); /* With an icon, the label alone names the button (and its busy reading), so a Text glyph is never read into it. */ /* With an icon, the label alone names the button (and its busy reading), so a Text glyph is never read into it. */ const named = shown(entry.icon) ? { accessibilityLabel: entry.busy ? busyAccessibilityLabel(entry.label, messages.busy ?? en.busy) : entry.label } : {}; return _jsxs(Button, { ...entry.pressProps, ...named, testID: button, intent: entry.intent ?? fallback, disabled: entry.disabled, busy: entry.busy, suppressFeedback: suppressFeedback, onPress: entry.onSelect, style: { flex: 1, alignSelf: 'auto' }, children: [entry.label, shown(entry.icon) ? _jsx(View, { ...hidden, testID: `${button}-icon`, children: entry.icon }, 'icon') : null] }); };
26
+ const header = title !== undefined ? _jsx(ScreenHeader, { title: title, eyebrow: eyebrow, badge: badge, titleRef: titleRef, onBack: onBack, backProps: backProps, action: headerAction, headingId: headingId, testID: testID }) : null;
27
+ const body = _jsxs(_Fragment, { children: [header === null && eyebrow ? _jsx(Text, { testID: id('eyebrow'), style: { fontSize: 12, lineHeight: 16, letterSpacing: 1.5, textTransform: 'uppercase', color: colors.muted }, children: eyebrow }) : null, shown(hero) ? _jsx(View, { testID: id('hero'), style: { alignItems: 'center' }, children: hero }) : null, shown(description) ? prose(description, descriptionPart) : null, sections.length > 0 ? _jsx(View, { testID: id('sections'), style: { gap: 12 }, children: sections.map(section => {
28
+ const part = `section-${section.id}`, bodyPart = `${part}-body`, sectionCaveatPart = `${part}-caveat`, tone = section.tone ? colors[section.tone] : undefined;
29
+ return _jsxs(View, { testID: section.testID ?? id(part), style: { direction, flexDirection: 'row', alignItems: section.icon != null ? 'flex-start' : 'center', gap: 12, padding: 12, borderRadius: section.icon != null ? 32 : 16, backgroundColor: tone ? withAlpha(tone, 0.1) : fills.well }, children: [section.icon != null ? _jsx(View, { ...hidden, testID: id(`${part}-icon`), style: { width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center', backgroundColor: withAlpha(tone ?? colors.text, 0.15) }, children: section.icon }) : null, _jsxs(View, { style: { flex: 1, minWidth: 0, gap: 4 }, children: [section.title !== undefined ? _jsxs(Text, { testID: id(`${part}-title`), accessibilityRole: 'header', style: { fontSize: 16, lineHeight: 24, fontWeight: '700', color: tone ?? colors.text }, children: [section.title, section.meaning ? _jsx(Text, { style: { color: colors.muted }, children: ` ${section.meaning}` }) : null] }) : null, section.media != null ? _jsx(View, { testID: id(`${part}-media`), style: { alignItems: 'center', gap: 8, marginVertical: 12 }, children: section.media }) : null, shown(section.body) ? prose(section.body, bodyPart) : null, shown(section.caveat) ? prose(section.caveat, sectionCaveatPart) : null] })] }, section.id);
30
+ }) }) : null, steps.length > 0 ? _jsx(View, { testID: id('steps'), style: { gap: 8 }, children: steps.map((step, index) => _jsxs(View, { testID: id(`step-${index}`), accessible: typeof step === 'string' || typeof step === 'number', style: { direction, flexDirection: 'row', gap: 8 }, children: [_jsx(Text, { style: { ...muted, minWidth: 16, fontVariant: ['tabular-nums'] }, children: `${index + 1}.` }), typeof step === 'string' || typeof step === 'number' ? _jsx(Text, { style: { ...muted, flexShrink: 1 }, children: step }) : _jsx(View, { style: { flexShrink: 1 }, children: step })] }, index)) }) : null, shown(caveat) ? prose(caveat, caveatPart) : null, children, primaryAction || secondaryAction ? _jsxs(View, { testID: id('actions'), style: { direction, flexDirection: 'row', gap: 8 }, children: [secondaryAction ? action(secondaryAction, secondaryPart) : null, primaryAction ? action(primaryAction, primaryPart) : null] }) : null] });
31
+ if (stickyHeader && header)
32
+ return _jsx(StickyHeaderLayout, { testID: testID, headerTestID: id('sticky-header'), header: header, background: stickyHeaderBackground, scrollComponent: scrollComponent, bodyStyle: { direction, gap: 16, paddingTop: 16 }, children: body });
33
+ return _jsxs(View, { testID: testID, style: { direction, padding: 16, gap: 16 }, children: [header, body] });
34
+ }
@@ -12,7 +12,11 @@ export interface FieldProps {
12
12
  export declare function Field({ label, description, descriptionTone, error, required, disabled, children }: React.PropsWithChildren<FieldProps>): React.JSX.Element;
13
13
  export declare const Label: typeof Text;
14
14
  /** No resting stroke: the fill separates the field (one step lighter inside a Surface, Dialog or sheet). The ring appears only for focus and for an invalid value. */
15
- export declare const Input: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<React.ComponentRef<typeof TextInput>>>;
15
+ export interface InputProps extends TextInputProps {
16
+ /** Host text on the leading edge inside the field, before what is typed, such as `@` for a handle or `$` for an amount (test ID `<testID>-prefix`). Drawn muted and not part of the value; it leads the input's accessibility hint, before the field's description and error, so it is read after the label. The text starts after it. */
17
+ prefix?: string;
18
+ }
19
+ export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<React.ComponentRef<typeof TextInput>>>;
16
20
  export declare const TextArea: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<React.ComponentRef<typeof TextInput>>>;
17
21
  export interface SearchInputProps extends TextInputProps {
18
22
  /** Host content on the trailing edge inside the field, such as a filter button. The text stops 48dp short of the edge; wider content sets the input's end padding through `style`. */