@vvedantb/native-ui 0.37.2 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (385) hide show
  1. package/README.md +8 -7
  2. package/dist/Avatar.jsx +22 -19
  3. package/dist/BottomSheetContainer.jsx +0 -6
  4. package/dist/BulkActionBar.jsx +0 -24
  5. package/dist/Button.jsx +92 -116
  6. package/dist/Card.jsx +56 -50
  7. package/dist/ColorSwatches.jsx +0 -6
  8. package/dist/Dialog.jsx +0 -12
  9. package/dist/DropdownMenu.jsx +0 -10
  10. package/dist/EmptyState.jsx +0 -3
  11. package/dist/ExpoWebRoot.jsx +0 -6
  12. package/dist/Field.jsx +0 -17
  13. package/dist/FloatingSurface.jsx +95 -80
  14. package/dist/FloatingTabBar.jsx +0 -23
  15. package/dist/IconButton.jsx +0 -1
  16. package/dist/LoadingState.jsx +0 -6
  17. package/dist/PasswordInput.jsx +0 -15
  18. package/dist/PillTabs.jsx +39 -36
  19. package/dist/SearchInput.jsx +0 -13
  20. package/dist/SectionLabel.jsx +0 -1
  21. package/dist/SharedTransition.jsx +0 -3
  22. package/dist/Skeleton.jsx +0 -2
  23. package/dist/Spinner.jsx +0 -2
  24. package/dist/StatusDot.jsx +0 -5
  25. package/dist/Switch.jsx +32 -22
  26. package/dist/Tabs.jsx +27 -26
  27. package/dist/Textarea.jsx +0 -1
  28. package/dist/ThemeToggle.jsx +0 -1
  29. package/dist/Toast.jsx +80 -91
  30. package/dist/UpdateChecker.jsx +0 -1
  31. package/dist/ai/activity-question.jsx +0 -6
  32. package/dist/ai/activity-step-label.js +0 -6
  33. package/dist/ai/activity-step-types.js +0 -4
  34. package/dist/ai/activity-tasks-utils.js +0 -17
  35. package/dist/ai/activity-timeline.js +0 -8
  36. package/dist/ai/attachments.jsx +0 -2
  37. package/dist/ai/chain-of-thought.jsx +0 -3
  38. package/dist/ai/chat-text.js +0 -1
  39. package/dist/ai/chat-thread.jsx +0 -1
  40. package/dist/ai/choice-question.jsx +0 -10
  41. package/dist/ai/code-block.jsx +0 -31
  42. package/dist/ai/collapsible.jsx +0 -14
  43. package/dist/ai/conversation-context.js +0 -3
  44. package/dist/ai/conversation.jsx +2 -48
  45. package/dist/ai/file-chip.jsx +0 -2
  46. package/dist/ai/icon-button.jsx +0 -8
  47. package/dist/ai/index.js +0 -5
  48. package/dist/ai/message-context-menu.jsx +0 -7
  49. package/dist/ai/message.jsx +0 -21
  50. package/dist/ai/prompt-input-menu.jsx +0 -3
  51. package/dist/ai/prompt-input.jsx +0 -27
  52. package/dist/ai/response-text.jsx +0 -6
  53. package/dist/ai/sources.jsx +0 -1
  54. package/dist/ai/suggestion.jsx +0 -1
  55. package/dist/ai/trace.jsx +0 -11
  56. package/dist/ai/unified-diff.jsx +0 -4
  57. package/dist/app-root/AuthGroupGate.jsx +65 -0
  58. package/dist/app-root/SsoCallbackScreen.jsx +97 -0
  59. package/dist/app-root/fonts.js +88 -0
  60. package/dist/app-root/index.js +3 -0
  61. package/dist/auth/AuthScreen.jsx +250 -77
  62. package/dist/auth/GoogleSignInButton.jsx +0 -3
  63. package/dist/auth/SecondFactorScreen.jsx +18 -14
  64. package/dist/auth/SignInScreen.jsx +40 -34
  65. package/dist/auth/authErrors.js +0 -4
  66. package/dist/auth/clerkCore3.js +0 -7
  67. package/dist/auth/index.js +0 -4
  68. package/dist/auth/totp.js +0 -2
  69. package/dist/brand/GoogleMark.jsx +0 -1
  70. package/dist/brand/ProviderIcon.jsx +0 -2
  71. package/dist/brand/index.js +0 -3
  72. package/dist/brand/svg.js +0 -6
  73. package/dist/configureTheme.js +0 -9
  74. package/dist/controlStyles.js +0 -14
  75. package/dist/crash/LastCrashDialog.jsx +56 -0
  76. package/dist/crash/lastCrash.js +192 -0
  77. package/dist/entries/ai.js +0 -3
  78. package/dist/entries/ambient.js +0 -2
  79. package/dist/entries/app-root.js +1 -0
  80. package/dist/entries/auth.js +0 -4
  81. package/dist/entries/bottom-sheet.js +0 -2
  82. package/dist/entries/brand.js +0 -1
  83. package/dist/entries/button.js +0 -1
  84. package/dist/entries/crash.js +2 -0
  85. package/dist/entries/date-time.js +0 -2
  86. package/dist/entries/expo-router.js +0 -3
  87. package/dist/entries/expo-web-root.js +0 -2
  88. package/dist/entries/floating.js +0 -2
  89. package/dist/entries/generative-ui.js +0 -4
  90. package/dist/entries/gesture-handler.js +0 -3
  91. package/dist/entries/keyboard-controller.js +0 -3
  92. package/dist/entries/layout.js +0 -2
  93. package/dist/entries/markdown.js +0 -3
  94. package/dist/entries/marketing.js +0 -1
  95. package/dist/entries/page-title.js +0 -5
  96. package/dist/entries/password-input.js +0 -2
  97. package/dist/entries/paste-input.js +0 -3
  98. package/dist/entries/primitives.js +0 -6
  99. package/dist/entries/search-input.js +0 -2
  100. package/dist/entries/tab-bar.js +0 -2
  101. package/dist/entries/theme.js +4 -2
  102. package/dist/entries/toast.js +0 -3
  103. package/dist/entries/video.js +0 -2
  104. package/dist/entries/webview.js +0 -2
  105. package/dist/examples/AiChatGallery.jsx +0 -11
  106. package/dist/examples/ParityGallery.jsx +0 -12
  107. package/dist/floating.js +0 -8
  108. package/dist/generative-ui/GenerativeUiPanel.jsx +0 -2
  109. package/dist/generative-ui/components.jsx +0 -8
  110. package/dist/glass.js +55 -0
  111. package/dist/glassBlur.jsx +0 -12
  112. package/dist/highlight.js +0 -26
  113. package/dist/index.js +4 -2
  114. package/dist/loadingGrid.js +0 -13
  115. package/dist/markdown/Markdown.jsx +0 -59
  116. package/dist/markdown/MarkdownTable.jsx +0 -18
  117. package/dist/markdown/tableText.js +0 -5
  118. package/dist/marketing/UpgradeToProCard.jsx +0 -5
  119. package/dist/marketing/pricing.js +0 -3
  120. package/dist/media/ImageGallery.jsx +0 -16
  121. package/dist/media/imageZoom.js +0 -4
  122. package/dist/media/zoom-image-gesture.jsx +0 -8
  123. package/dist/media/zoomImage.js +0 -3
  124. package/dist/motion.js +0 -3
  125. package/dist/neutralTheme.js +158 -0
  126. package/dist/pagerSwipe.js +0 -16
  127. package/dist/palette.js +0 -10
  128. package/dist/primitives/button.jsx +0 -5
  129. package/dist/primitives/icon.jsx +0 -4
  130. package/dist/primitives/keyboard-controller.jsx +0 -27
  131. package/dist/primitives/native-only-animated-view.jsx +0 -5
  132. package/dist/primitives/overlay.jsx +0 -2
  133. package/dist/primitives/pager-gesture.jsx +3 -29
  134. package/dist/primitives/paste-input.jsx +0 -5
  135. package/dist/primitives/select.jsx +0 -10
  136. package/dist/primitives/sheet-drag.jsx +0 -3
  137. package/dist/primitives/sheet-gesture.jsx +0 -8
  138. package/dist/primitives/swipe-row-gesture.jsx +3 -45
  139. package/dist/primitives/text.jsx +0 -5
  140. package/dist/primitives/toast-drag-gesture.jsx +4 -24
  141. package/dist/primitives/web-click-guard.js +0 -3
  142. package/dist/primitives/window-layer.jsx +0 -14
  143. package/dist/push.js +0 -6
  144. package/dist/relativeTime.js +0 -13
  145. package/dist/settings/MoreFromProjectV.jsx +0 -5
  146. package/dist/settings/ThemeModePicker.jsx +2 -9
  147. package/dist/settings/projectVMobileApps.js +1 -6
  148. package/dist/sheetDrag.js +0 -10
  149. package/dist/swipeRow.js +0 -15
  150. package/dist/tabBarRoutes.js +0 -4
  151. package/dist/tabIndicator.js +0 -4
  152. package/dist/tailwind-preset.cjs +0 -54
  153. package/dist/tailwind-preset.d.cts +0 -8
  154. package/dist/theme.jsx +29 -21
  155. package/dist/themeModeStore.js +62 -0
  156. package/dist/themeModes.js +9 -0
  157. package/dist/toastChrome.js +0 -6
  158. package/dist/toastDrag.js +0 -14
  159. package/dist/toastStore.js +0 -4
  160. package/dist/updateCheck.js +0 -7
  161. package/dist/video/InlineVideo.jsx +0 -2
  162. package/dist/webview/htmlView.js +0 -5
  163. package/package.json +47 -19
  164. package/src/ArtifactList.tsx +0 -2
  165. package/src/Avatar.tsx +3 -3
  166. package/src/Badge.tsx +0 -1
  167. package/src/BottomSheetContainer.tsx +0 -11
  168. package/src/BulkActionBar.tsx +0 -66
  169. package/src/Button.tsx +4 -40
  170. package/src/CaptureButton.tsx +0 -1
  171. package/src/Card.tsx +3 -15
  172. package/src/Checkbox.tsx +0 -2
  173. package/src/ColorSwatches.tsx +0 -9
  174. package/src/ConfirmDialog.tsx +0 -7
  175. package/src/DateTimeField.tsx +0 -5
  176. package/src/Dialog.tsx +0 -27
  177. package/src/DividedList.tsx +0 -1
  178. package/src/DropdownMenu.tsx +0 -51
  179. package/src/EmptyState.tsx +0 -5
  180. package/src/ExpoWebRoot.tsx +0 -10
  181. package/src/Field.tsx +0 -14
  182. package/src/FloatingFAB.tsx +0 -3
  183. package/src/FloatingSurface.tsx +11 -8
  184. package/src/FloatingTabBar.tsx +0 -25
  185. package/src/IconButton.tsx +0 -5
  186. package/src/Input.tsx +0 -1
  187. package/src/Label.tsx +0 -1
  188. package/src/LabeledSwitchRow.tsx +0 -2
  189. package/src/ListRow.tsx +0 -12
  190. package/src/LoadingState.tsx +0 -12
  191. package/src/MenuSheet.tsx +0 -2
  192. package/src/PageIndicator.tsx +0 -2
  193. package/src/PageTitle.tsx +0 -15
  194. package/src/Pager.tsx +0 -9
  195. package/src/PasswordInput.tsx +0 -24
  196. package/src/PillTabs.tsx +3 -11
  197. package/src/PinnedBotTile.tsx +0 -6
  198. package/src/Progress.tsx +0 -3
  199. package/src/ReactionRow.tsx +0 -8
  200. package/src/ScreenContainer.tsx +0 -4
  201. package/src/SearchInput.tsx +0 -25
  202. package/src/SectionLabel.tsx +0 -2
  203. package/src/Select.tsx +0 -6
  204. package/src/Separator.tsx +0 -2
  205. package/src/SharedTransition.tsx +0 -7
  206. package/src/Sheet.tsx +0 -3
  207. package/src/SheetRow.tsx +0 -12
  208. package/src/Skeleton.tsx +0 -10
  209. package/src/Spinner.tsx +0 -6
  210. package/src/StackPageHeader.tsx +0 -16
  211. package/src/StatGrid.tsx +0 -1
  212. package/src/StatusDot.tsx +0 -6
  213. package/src/SurfaceRow.tsx +0 -12
  214. package/src/SwipeableRow.tsx +0 -4
  215. package/src/Switch.tsx +3 -4
  216. package/src/Tabs.tsx +3 -27
  217. package/src/Textarea.tsx +0 -2
  218. package/src/ThemeToggle.tsx +0 -1
  219. package/src/Toast.tsx +3 -19
  220. package/src/UpdateChecker.tsx +0 -46
  221. package/src/ai/activity-question.tsx +0 -8
  222. package/src/ai/activity-step-detail.tsx +0 -5
  223. package/src/ai/activity-step-label.ts +0 -5
  224. package/src/ai/activity-step-types.ts +0 -24
  225. package/src/ai/activity-step.tsx +0 -4
  226. package/src/ai/activity-tasks-utils.ts +0 -13
  227. package/src/ai/activity-timeline.ts +0 -6
  228. package/src/ai/attachments.tsx +0 -13
  229. package/src/ai/chain-of-thought.tsx +0 -5
  230. package/src/ai/chat-jump-rail.tsx +0 -2
  231. package/src/ai/chat-text.ts +0 -1
  232. package/src/ai/chat-thread.tsx +0 -9
  233. package/src/ai/choice-question.tsx +0 -36
  234. package/src/ai/code-block.tsx +0 -52
  235. package/src/ai/collapsible.tsx +0 -12
  236. package/src/ai/conversation-context.ts +0 -14
  237. package/src/ai/conversation.tsx +0 -58
  238. package/src/ai/file-chip.tsx +0 -1
  239. package/src/ai/icon-button.tsx +0 -17
  240. package/src/ai/index.ts +0 -5
  241. package/src/ai/message-action-sheet.tsx +0 -8
  242. package/src/ai/message-context-menu.tsx +0 -22
  243. package/src/ai/message-quote.tsx +0 -4
  244. package/src/ai/message.tsx +0 -66
  245. package/src/ai/prompt-input-menu.tsx +0 -19
  246. package/src/ai/prompt-input.tsx +0 -97
  247. package/src/ai/reasoning.tsx +0 -6
  248. package/src/ai/reply-quote-chip.tsx +0 -5
  249. package/src/ai/response-text.tsx +0 -8
  250. package/src/ai/shimmer.tsx +0 -2
  251. package/src/ai/sources.tsx +0 -3
  252. package/src/ai/subagent-cards.tsx +0 -13
  253. package/src/ai/suggestion.tsx +0 -4
  254. package/src/ai/tool-approval-card.tsx +0 -14
  255. package/src/ai/trace.tsx +0 -23
  256. package/src/ai/unified-diff.tsx +0 -16
  257. package/src/ai/use-streaming-disclosure.ts +0 -4
  258. package/src/app-root/AuthGroupGate.tsx +38 -0
  259. package/src/app-root/SsoCallbackScreen.tsx +52 -0
  260. package/src/app-root/fonts.ts +53 -0
  261. package/src/app-root/index.ts +6 -0
  262. package/src/auth/AccountScreens.tsx +0 -16
  263. package/src/auth/AuthProviders.tsx +0 -13
  264. package/src/auth/AuthScreen.tsx +95 -6
  265. package/src/auth/GoogleSignInButton.tsx +0 -12
  266. package/src/auth/SecondFactorScreen.tsx +17 -15
  267. package/src/auth/SignInScreen.tsx +103 -105
  268. package/src/auth/authErrors.ts +0 -6
  269. package/src/auth/clerkCore3.ts +0 -6
  270. package/src/auth/index.ts +0 -4
  271. package/src/auth/totp.ts +0 -13
  272. package/src/brand/AppIcons.tsx +0 -6
  273. package/src/brand/AppMark.tsx +0 -5
  274. package/src/brand/AppWordmark.tsx +0 -7
  275. package/src/brand/GoogleMark.tsx +0 -4
  276. package/src/brand/ProviderIcon.tsx +0 -6
  277. package/src/brand/familyApps.ts +0 -2
  278. package/src/brand/index.ts +0 -3
  279. package/src/brand/svg.ts +0 -9
  280. package/src/configureTheme.ts +0 -10
  281. package/src/controlStyles.ts +0 -12
  282. package/src/crash/LastCrashDialog.tsx +36 -0
  283. package/src/crash/lastCrash.ts +218 -0
  284. package/src/entries/ai.ts +0 -3
  285. package/src/entries/ambient.ts +0 -2
  286. package/src/entries/app-root.ts +1 -0
  287. package/src/entries/auth.ts +0 -4
  288. package/src/entries/bottom-sheet.ts +0 -2
  289. package/src/entries/brand.ts +0 -1
  290. package/src/entries/button.ts +0 -1
  291. package/src/entries/crash.ts +13 -0
  292. package/src/entries/date-time.ts +0 -2
  293. package/src/entries/expo-router.ts +0 -3
  294. package/src/entries/expo-web-root.ts +0 -2
  295. package/src/entries/floating.ts +0 -2
  296. package/src/entries/generative-ui.ts +0 -4
  297. package/src/entries/gesture-handler.ts +0 -3
  298. package/src/entries/keyboard-controller.ts +0 -3
  299. package/src/entries/layout.ts +0 -2
  300. package/src/entries/markdown.ts +0 -3
  301. package/src/entries/marketing.ts +0 -1
  302. package/src/entries/page-title.ts +0 -5
  303. package/src/entries/password-input.ts +0 -2
  304. package/src/entries/paste-input.ts +0 -3
  305. package/src/entries/primitives.ts +0 -6
  306. package/src/entries/search-input.ts +0 -2
  307. package/src/entries/tab-bar.ts +0 -2
  308. package/src/entries/theme.ts +8 -2
  309. package/src/entries/toast.ts +0 -3
  310. package/src/entries/video.ts +0 -2
  311. package/src/entries/webview.ts +0 -2
  312. package/src/examples/AiChatGallery.tsx +0 -11
  313. package/src/examples/ParityGallery.tsx +0 -25
  314. package/src/floating.ts +0 -6
  315. package/src/generative-ui/GenerativeUiPanel.tsx +0 -15
  316. package/src/generative-ui/components.tsx +0 -9
  317. package/src/generative-ui/context.ts +0 -2
  318. package/src/glass.ts +31 -0
  319. package/src/glassBlur.tsx +0 -15
  320. package/src/highlight.ts +1 -21
  321. package/src/index.ts +7 -2
  322. package/src/loadingGrid.ts +0 -12
  323. package/src/markdown/Markdown.tsx +0 -71
  324. package/src/markdown/MarkdownTable.tsx +0 -23
  325. package/src/markdown/tableText.ts +0 -3
  326. package/src/marketing/PricingModal.tsx +0 -13
  327. package/src/marketing/UpgradeToProCard.tsx +0 -14
  328. package/src/marketing/pricing.ts +0 -12
  329. package/src/media/ImageGallery.tsx +0 -18
  330. package/src/media/MediaCard.tsx +0 -8
  331. package/src/media/imageZoom.ts +0 -4
  332. package/src/media/zoom-image-gesture.tsx +0 -9
  333. package/src/media/zoomImage.ts +0 -5
  334. package/src/motion.ts +0 -3
  335. package/src/neutralTheme.ts +127 -0
  336. package/src/pagerSwipe.ts +0 -13
  337. package/src/palette.ts +0 -10
  338. package/src/pressScale.ts +0 -7
  339. package/src/primitives/button.tsx +0 -4
  340. package/src/primitives/card.tsx +0 -1
  341. package/src/primitives/icon.tsx +0 -2
  342. package/src/primitives/input.tsx +0 -4
  343. package/src/primitives/keyboard-controller.tsx +0 -25
  344. package/src/primitives/keyboard-parts.tsx +0 -27
  345. package/src/primitives/native-only-animated-view.tsx +0 -5
  346. package/src/primitives/overlay.tsx +0 -25
  347. package/src/primitives/pager-gesture.tsx +0 -20
  348. package/src/primitives/paste-input.tsx +0 -4
  349. package/src/primitives/paste-parts.tsx +0 -1
  350. package/src/primitives/select.tsx +0 -18
  351. package/src/primitives/sheet-drag.tsx +0 -19
  352. package/src/primitives/sheet-gesture.tsx +0 -22
  353. package/src/primitives/swipe-row-gesture.tsx +0 -33
  354. package/src/primitives/switch.tsx +0 -4
  355. package/src/primitives/text.tsx +0 -4
  356. package/src/primitives/toast-drag-gesture.tsx +0 -13
  357. package/src/primitives/web-click-guard.ts +0 -2
  358. package/src/primitives/window-layer.tsx +0 -18
  359. package/src/push.ts +0 -15
  360. package/src/relativeTime.ts +0 -21
  361. package/src/router/RouterStackPageHeader.tsx +0 -1
  362. package/src/settings/MoreFromProjectV.tsx +0 -8
  363. package/src/settings/SettingsEmptyState.tsx +0 -2
  364. package/src/settings/SettingsSection.tsx +0 -3
  365. package/src/settings/SettingsToggleRow.tsx +0 -4
  366. package/src/settings/ThemeModePicker.tsx +2 -16
  367. package/src/settings/projectVMobileApps.ts +0 -8
  368. package/src/sheetDrag.ts +0 -9
  369. package/src/swipeRow.ts +0 -23
  370. package/src/tabBarRoutes.ts +0 -13
  371. package/src/tabIndicator.ts +0 -5
  372. package/src/tailwind-preset.cjs +0 -54
  373. package/src/tailwind-preset.d.cts +0 -8
  374. package/src/theme.tsx +11 -2
  375. package/src/themeModeStore.ts +85 -0
  376. package/src/themeModes.ts +10 -0
  377. package/src/toastChrome.ts +0 -6
  378. package/src/toastDrag.ts +0 -13
  379. package/src/toastStore.ts +0 -7
  380. package/src/updateCheck.ts +0 -15
  381. package/src/video/InlineVideo.tsx +0 -5
  382. package/src/webview/HtmlView.tsx +0 -23
  383. package/src/webview/HtmlView.web.tsx +0 -1
  384. package/src/webview/htmlView.ts +0 -5
  385. package/types/prism-react-renderer.d.ts +22 -0
@@ -9,6 +9,7 @@ import { Input } from "../Input";
9
9
  import { PasswordInput } from "../PasswordInput";
10
10
  import { toast } from "../toastStore";
11
11
  import { useScheme } from "../useScheme";
12
+ import { SettingsField } from "../settings/SettingsField";
12
13
  import { AuthScreen, FieldError, OrDivider } from "./AuthScreen";
13
14
  import { authErrorMessage, DEFAULT_STAGE_TIMEOUT_MS, isAuthTimeoutError, logAuthFailure, withAuthTimeout } from "./authErrors";
14
15
  import { clerkCall, signInCalls } from "./clerkCore3";
@@ -130,12 +131,29 @@ export function SignInScreen({
130
131
  minPasswordLength,
131
132
  errorDisplay = "toast",
132
133
  testIDPrefix,
134
+ testIDs,
133
135
  header,
134
136
  footer,
135
137
  onIncomplete,
136
- stageTimeoutMs = DEFAULT_STAGE_TIMEOUT_MS
138
+ stageTimeoutMs = DEFAULT_STAGE_TIMEOUT_MS,
139
+ variant,
140
+ heroColor,
141
+ heroForeground,
142
+ submitLabel,
143
+ footerPrompt,
144
+ footerLinkLabel,
145
+ showFieldLabels = false,
146
+ emailPlaceholder = "Email",
147
+ passwordPlaceholder = "Password",
148
+ googleVariant,
149
+ googleSize
137
150
  }) {
138
- // Both are always defined: before Clerk loads, a call waits for it.
151
+ const heroProps = {
152
+ variant,
153
+ heroColor,
154
+ heroForeground
155
+ };
156
+ const labelled = (label, control) => showFieldLabels ? <SettingsField label={label}>{control}</SettingsField> : control;
139
157
  const signIn = signInCalls(useSignIn().signIn);
140
158
  const signUpAttempt = useSignUp().signUp;
141
159
  const router = useRouter();
@@ -165,12 +183,11 @@ export function SignInScreen({
165
183
  });
166
184
  const [error, setError] = useState("");
167
185
  const [submitting, setSubmitting] = useState(false);
168
- // The field each "next" key moves to.
169
186
  const passwordField = useRef(null);
170
187
  const confirmField = useRef(null);
171
188
  const signUp = mode === "sign-up";
172
189
  const reset = mode === "reset-password";
173
- const id = name => `${testIDPrefix ?? mode}-${name}`;
190
+ const id = name => testIDs?.[name] ?? `${testIDPrefix ?? mode}-${name}`;
174
191
  const fail = (heading, message) => {
175
192
  if (errorDisplay === "inline") setError(message);else toast.error(heading, message === heading ? undefined : {
176
193
  description: message
@@ -182,8 +199,6 @@ export function SignInScreen({
182
199
  const warnIncomplete = attempt => {
183
200
  console.warn(`[native-ui] Sign-in not complete: status=${attempt.status}, ` + `secondFactors=${JSON.stringify((attempt.supportedSecondFactors ?? []).map(f => f.strategy))}, ` + `firstFactors=${JSON.stringify((attempt.supportedFirstFactors ?? []).map(f_0 => f_0.strategy))}. ` + "Pass onIncomplete to handle it in the app.");
184
201
  };
185
-
186
- // A status the built-in UI cannot finish: the app's `onIncomplete`, or the web fallback.
187
202
  const unhandled = attempt_0 => {
188
203
  if (onIncomplete) return onIncomplete(attempt_0);
189
204
  warnIncomplete(attempt_0);
@@ -224,10 +239,7 @@ export function SignInScreen({
224
239
  setFirstFactors(list_2);
225
240
  await chooseFirstStrategy(strategy_2, list_2);
226
241
  };
227
-
228
- // Routes a sign-in attempt. `needs_first_factor` is built in only after `signIn.create`.
229
242
  const routeAttempt = async (attempt_3, afterCreate) => {
230
- // Clerk's `SignInStatus` omits `needs_client_trust`: widen before comparing.
231
243
  const status = attempt_3.status;
232
244
  if (status === "complete" && attempt_3.createdSessionId) {
233
245
  await withAuthTimeout(signIn.setActive(), "set-active", stageTimeoutMs);
@@ -283,13 +295,11 @@ export function SignInScreen({
283
295
  setError("");
284
296
  try {
285
297
  const result_0 = await withAuthTimeout(signIn.resetPassword(newPassword), "reset-password", stageTimeoutMs);
286
- // Clerk's `SignInStatus` omits `needs_client_trust`: widen before comparing.
287
298
  const afterReset = result_0.status;
288
299
  if (afterReset === "complete" && result_0.createdSessionId) {
289
300
  await withAuthTimeout(signIn.setActive(), "set-active", stageTimeoutMs);
290
301
  done();
291
302
  } else if (afterReset === "needs_second_factor" || afterReset === "needs_client_trust") {
292
- // A reset on an account with two-step verification: the code step, then the session.
293
303
  setPendingNewPassword(false);
294
304
  await startSecondFactor(result_0, afterReset === "needs_client_trust");
295
305
  } else if (onIncomplete) {
@@ -322,8 +332,6 @@ export function SignInScreen({
322
332
  setSubmitting(false);
323
333
  }
324
334
  };
325
-
326
- // Emails the reset code. Throws what the call throws.
327
335
  const requestResetCode = async () => {
328
336
  await withAuthTimeout(signIn.sendResetCode(email.trim()), "create", stageTimeoutMs);
329
337
  };
@@ -356,8 +364,6 @@ export function SignInScreen({
356
364
  setResetLoading(false);
357
365
  }
358
366
  };
359
-
360
- // Checks the emailed code. A good code gives `needs_new_password`, which `routeAttempt` shows.
361
367
  const onResetCode = async resetCode => {
362
368
  if (resetLoading) return;
363
369
  setResetLoading(true);
@@ -386,7 +392,6 @@ export function SignInScreen({
386
392
  if (result_1.ok) done();
387
393
  };
388
394
  const onSecondFactorBack = () => {
389
- // The pending attempt stays; the next `signIn.create` replaces it.
390
395
  setPendingSecondFactor(false);
391
396
  setPendingFirstFactor(false);
392
397
  setFirstError("");
@@ -406,7 +411,6 @@ export function SignInScreen({
406
411
  return fail(AUTH_MESSAGES.signUpFailed, `Use at least ${minPasswordLength} characters for the password`);
407
412
  }
408
413
  if (password !== signUpConfirm) {
409
- // Always under the confirm field, also with `errorDisplay="toast"`.
410
414
  setError("");
411
415
  setMismatch(true);
412
416
  return;
@@ -452,17 +456,17 @@ export function SignInScreen({
452
456
  const footerRow = <>
453
457
  {linkHref && !pendingVerification ? <>
454
458
  <Text className="font-instrument-sans text-sm" style={textStyle("muted", colorScheme)}>
455
- {reset ? "Remembered your password?" : signUp ? "Already have an account?" : "Don't have an account?"}
459
+ {footerPrompt ?? (reset ? "Remembered your password?" : signUp ? "Already have an account?" : "Don't have an account?")}
456
460
  </Text>
457
461
  <Button testID={id(toSignIn ? "sign-in-link" : "sign-up-link")} variant="link" size="sm" fullWidth={false} onPress={() => router.push(linkHref)}>
458
- {toSignIn ? "Sign in" : "Sign up"}
462
+ {footerLinkLabel ?? (toSignIn ? "Sign in" : "Sign up")}
459
463
  </Button>
460
464
  </> : null}
461
465
  {footer}
462
466
  </>;
463
467
  const hasFooter = Boolean(linkHref && !pendingVerification || footer);
464
468
  if (pendingNewPassword) {
465
- return <AuthScreen testID={id("new-password-screen")} title={AUTH_MESSAGES.newPasswordTitle} subtitle={reset ? AUTH_MESSAGES.resetNewPasswordDescription : AUTH_MESSAGES.newPasswordDescription} header={header}>
469
+ return <AuthScreen testID={id("new-password-screen")} title={AUTH_MESSAGES.newPasswordTitle} subtitle={reset ? AUTH_MESSAGES.resetNewPasswordDescription : AUTH_MESSAGES.newPasswordDescription} header={header} {...heroProps}>
466
470
  <PasswordInput testID={id("new-password")} accessibilityLabel={AUTH_MESSAGES.newPasswordLabel} autoCapitalize="none" autoComplete="new-password" textContentType="newPassword" autoFocus returnKeyType="next" submitBehavior="submit" onSubmitEditing={() => confirmField.current?.focus()} value={newPassword} placeholder={AUTH_MESSAGES.newPasswordLabel} onChangeText={setNewPassword} />
467
471
  <PasswordInput testID={id("confirm-password")} ref={confirmField} accessibilityLabel={AUTH_MESSAGES.confirmPasswordLabel} autoCapitalize="none" autoComplete="new-password" textContentType="newPassword" returnKeyType="go" value={confirmPassword} placeholder={AUTH_MESSAGES.confirmPasswordLabel} onChangeText={setConfirmPassword} onSubmitEditing={() => void onNewPassword()} />
468
472
  <FieldError testID={id("error")} message={error} />
@@ -477,7 +481,7 @@ export function SignInScreen({
477
481
  if (pendingResetCode && !pendingSecondFactor) {
478
482
  return <SecondFactorScreen key="reset-code" title={AUTH_MESSAGES.emailCodeTitle} description={AUTH_MESSAGES.emailCodeDescription} footer={<Button testID={id("resend")} variant="link" size="sm" fullWidth={false} disabled={resetLoading} onPress={() => void onResetResend()}>
479
483
  {AUTH_MESSAGES.resendCode}
480
- </Button>} onSubmit={onResetCode} error={resetCodeError} loading={resetLoading} onBack={onSecondFactorBack} backLabel="Use a different email" header={header} testIDPrefix={id("email-code")} />;
484
+ </Button>} onSubmit={onResetCode} error={resetCodeError} loading={resetLoading} onBack={onSecondFactorBack} backLabel="Use a different email" header={header} {...heroProps} testIDPrefix={id("email-code")} />;
481
485
  }
482
486
  if (pendingFirstFactor && !pendingSecondFactor && !pendingNewPassword) {
483
487
  const others = supportedFirstFactorStrategies(firstFactors).filter(strategy_3 => strategy_3 !== firstStrategy);
@@ -485,22 +489,21 @@ export function SignInScreen({
485
489
  const copy = secondFactorCopy(firstStrategy, false);
486
490
  return <SecondFactorScreen key={`first-${firstStrategy}`} title={copy.title} description={copy.description} footer={switchTo ? <Button testID={id("first-factor-switch")} variant="link" size="sm" fullWidth={false} disabled={firstLoading} onPress={() => void chooseFirstStrategy(switchTo, firstFactors)}>
487
491
  {METHOD_LABEL[switchTo]}
488
- </Button> : undefined} onSubmit={onFirstFactor} error={firstError} loading={firstLoading} onBack={onSecondFactorBack} backLabel="Use a different account" header={header} testIDPrefix={id("first-factor")} />;
492
+ </Button> : undefined} onSubmit={onFirstFactor} error={firstError} loading={firstLoading} onBack={onSecondFactorBack} backLabel="Use a different account" header={header} {...heroProps} testIDPrefix={id("first-factor")} />;
489
493
  }
490
494
  if (pendingSecondFactor) {
491
495
  const active = secondFactor.strategy;
492
496
  const available = supportedSecondFactorStrategies(factors);
493
497
  const others_0 = available.filter(strategy_4 => strategy_4 !== active);
494
- // From a backup code, go back to the default non-backup method. Otherwise offer a backup code.
495
498
  const switchTo_0 = active === "backup_code" ? pickSecondFactorStrategy(factors.filter(factor_1 => factor_1.strategy !== "backup_code")) : others_0.includes("backup_code") ? "backup_code" : null;
496
499
  const copy_0 = secondFactorCopy(active, clientTrust);
497
500
  const backup = active === "backup_code";
498
501
  return <SecondFactorScreen key={active} title={copy_0.title} description={copy_0.description} codeLength={backup ? 8 : 6} digitsOnly={!backup} placeholder="Backup code" footer={switchTo_0 ? <Button testID={id("second-factor-switch")} variant="link" size="sm" fullWidth={false} disabled={secondFactor.loading} onPress={() => void chooseStrategy(switchTo_0, factors)}>
499
502
  {METHOD_LABEL[switchTo_0]}
500
- </Button> : undefined} onSubmit={onSecondFactor} error={secondFactor.error} loading={secondFactor.loading} onBack={onSecondFactorBack} backLabel="Use a different account" header={header} testIDPrefix={id("second-factor")} />;
503
+ </Button> : undefined} onSubmit={onSecondFactor} error={secondFactor.error} loading={secondFactor.loading} onBack={onSecondFactorBack} backLabel="Use a different account" header={header} {...heroProps} testIDPrefix={id("second-factor")} />;
501
504
  }
502
505
  if (pendingVerification) {
503
- return <AuthScreen testID={id("screen")} title="Check your email" subtitle="Enter the code we sent to your email." header={header} footer={hasFooter ? footerRow : undefined}>
506
+ return <AuthScreen testID={id("screen")} title="Check your email" subtitle="Enter the code we sent to your email." header={header} footer={hasFooter ? footerRow : undefined} {...heroProps}>
504
507
  <Input testID={id("code")} accessibilityLabel="Verification code" value={code} placeholder="Verification code" keyboardType="number-pad" autoComplete="one-time-code" textContentType="oneTimeCode" autoFocus returnKeyType="go" onChangeText={setCode} onSubmitEditing={() => void onVerify()} />
505
508
  <FieldError testID={id("error")} message={error} />
506
509
  <Button testID={id("verify")} loading={submitting} onPress={() => void onVerify()}>
@@ -515,21 +518,25 @@ export function SignInScreen({
515
518
  </Button>
516
519
  </AuthScreen>;
517
520
  }
518
- return <AuthScreen testID={id("screen")} title={title ?? (reset ? AUTH_MESSAGES.resetTitle : signUp ? "Create account" : "Welcome back")} subtitle={subtitle ?? (reset ? AUTH_MESSAGES.resetSubtitle : signUp ? "Sign up to get started" : "Sign in to continue")} header={header} footer={hasFooter ? footerRow : undefined}>
521
+ return <AuthScreen testID={id("screen")} title={title ?? (reset ? AUTH_MESSAGES.resetTitle : signUp ? "Create account" : "Welcome back")} subtitle={subtitle ?? (reset ? AUTH_MESSAGES.resetSubtitle : signUp ? "Sign up to get started" : "Sign in to continue")} header={header} footer={hasFooter ? footerRow : undefined} {...heroProps}>
519
522
  {showGoogle && !reset ? <>
520
- <GoogleSignInButton testID={id("google")} scheme={scheme} redirectPath={redirectPath} afterAuthHref={afterAuthHref} replaceOptions={replaceOptions} onSuccess={onSuccess} onError={message_0 => fail(message_0, message_0)} label={googleLabel} disabled={submitting} />
523
+ <GoogleSignInButton testID={id("google")} scheme={scheme} redirectPath={redirectPath} afterAuthHref={afterAuthHref} replaceOptions={replaceOptions} onSuccess={onSuccess} onError={message_0 => fail(message_0, message_0)} label={googleLabel} disabled={submitting} {...googleVariant ? {
524
+ variant: googleVariant
525
+ } : null} {...googleSize ? {
526
+ size: googleSize
527
+ } : null} />
521
528
  <OrDivider />
522
529
  </> : null}
523
- <Input testID={id("email")} accessibilityLabel="Email" autoCapitalize="none" autoComplete="email" textContentType="emailAddress" keyboardType="email-address" returnKeyType={reset ? "go" : "next"} submitBehavior={reset ? undefined : "submit"} onSubmitEditing={() => reset ? void onResetRequest() : passwordField.current?.focus()} value={email} placeholder="Email" onChangeText={setEmail} />
524
- {reset ? null : <PasswordInput testID={id("password")} ref={passwordField} accessibilityLabel="Password" autoCapitalize="none" autoComplete={signUp ? "new-password" : "password"} textContentType={signUp ? "newPassword" : "password"} returnKeyType={signUp ? "next" : "go"} submitBehavior={signUp ? "submit" : undefined} value={password} placeholder="Password" onChangeText={text => {
530
+ {labelled("Email", <Input testID={id("email")} accessibilityLabel="Email" autoCapitalize="none" autoComplete="email" textContentType="emailAddress" keyboardType="email-address" returnKeyType={reset ? "go" : "next"} submitBehavior={reset ? undefined : "submit"} onSubmitEditing={() => reset ? void onResetRequest() : passwordField.current?.focus()} value={email} placeholder={emailPlaceholder} onChangeText={setEmail} />)}
531
+ {reset ? null : labelled("Password", <PasswordInput testID={id("password")} ref={passwordField} accessibilityLabel="Password" autoCapitalize="none" autoComplete={signUp ? "new-password" : "password"} textContentType={signUp ? "newPassword" : "password"} returnKeyType={signUp ? "next" : "go"} submitBehavior={signUp ? "submit" : undefined} value={password} placeholder={passwordPlaceholder} onChangeText={text => {
525
532
  setPassword(text);
526
533
  setMismatch(false);
527
- }} onSubmitEditing={() => signUp ? confirmField.current?.focus() : void onSignIn()} />}
534
+ }} onSubmitEditing={() => signUp ? confirmField.current?.focus() : void onSignIn()} />)}
528
535
  {signUp ? <>
529
- <PasswordInput testID={id("confirm-password")} ref={confirmField} accessibilityLabel={AUTH_MESSAGES.confirmSignUpPasswordLabel} autoCapitalize="none" autoComplete="new-password" textContentType="newPassword" returnKeyType="go" value={signUpConfirm} placeholder={AUTH_MESSAGES.confirmSignUpPasswordLabel} onChangeText={text_0 => {
536
+ {labelled("Confirm password", <PasswordInput testID={id("confirm-password")} ref={confirmField} accessibilityLabel={AUTH_MESSAGES.confirmSignUpPasswordLabel} autoCapitalize="none" autoComplete="new-password" textContentType="newPassword" returnKeyType="go" value={signUpConfirm} placeholder={AUTH_MESSAGES.confirmSignUpPasswordLabel} onChangeText={text_0 => {
530
537
  setSignUpConfirm(text_0);
531
538
  setMismatch(false);
532
- }} onSubmitEditing={() => void onSignUp()} />
539
+ }} onSubmitEditing={() => void onSignUp()} />)}
533
540
  <FieldError testID={id("confirm-error")} message={mismatch ? AUTH_MESSAGES.passwordMismatch : ""} />
534
541
  </> : null}
535
542
  {!signUp && !reset && forgotPasswordHref ? <View className="items-end">
@@ -539,9 +546,8 @@ export function SignInScreen({
539
546
  </View> : null}
540
547
  <FieldError testID={id("error")} message={error} />
541
548
  <Button testID={id("submit")} loading={submitting} onPress={() => void (reset ? onResetRequest() : signUp ? onSignUp() : onSignIn())}>
542
- {reset ? AUTH_MESSAGES.sendResetCode : signUp ? "Create account" : "Sign in"}
549
+ {reset ? AUTH_MESSAGES.sendResetCode : submitLabel ?? (signUp ? "Create account" : "Sign in")}
543
550
  </Button>
544
- {/* Bot protection mounts its widget here on web sign-up. */}
545
551
  {signUp ? <View nativeID="clerk-captcha" /> : null}
546
552
  </AuthScreen>;
547
553
  }
@@ -1,13 +1,9 @@
1
1
  import { isClerkAPIResponseError } from "@clerk/expo";
2
-
3
- /** Words that must not reach the user: the auth provider and stack names. */
4
2
  const PRODUCT_NAMES = /\b(clerk|convex)\b/gi;
5
3
 
6
4
  /** The only Clerk codes that mean "Invalid email or password". */
7
5
  export const CREDENTIAL_ERROR_CODES = ["form_password_incorrect", "form_identifier_not_found"];
8
6
  const asString = value => typeof value === "string" && value.length > 0 ? value : undefined;
9
-
10
- /** Reads a Clerk API error, or a plain `{ errors: [...] }` object. No `zod`. */
11
7
  function parseAuthError(error) {
12
8
  if (typeof error !== "object" || error === null) return null;
13
9
  const record = error;
@@ -1,5 +1,3 @@
1
- /** The sign-in resource of the `useSignIn` hook at the root of `@clerk/expo` 4. */
2
-
3
1
  /**
4
2
  * Awaits a call on Clerk's sign-in or sign-up resource. These calls resolve
5
3
  * with `{ error }` where the older ones rejected: this throws that error, so
@@ -32,7 +30,6 @@ export function signInCalls(signIn) {
32
30
  get supportedSecondFactors() {
33
31
  return signIn.supportedSecondFactors;
34
32
  },
35
- /** Starts a new sign-in with email and password. */
36
33
  async password(identifier, password) {
37
34
  await clerkCall(signIn.password({
38
35
  identifier,
@@ -40,7 +37,6 @@ export function signInCalls(signIn) {
40
37
  }));
41
38
  return state();
42
39
  },
43
- /** Starts a new sign-in for `identifier` and emails its password-reset code. */
44
40
  async sendResetCode(identifier) {
45
41
  await clerkCall(signIn.create({
46
42
  identifier
@@ -53,7 +49,6 @@ export function signInCalls(signIn) {
53
49
  }));
54
50
  return state();
55
51
  },
56
- /** Sets the new password. Other sessions stay signed in, as before. */
57
52
  async resetPassword(password) {
58
53
  await clerkCall(signIn.resetPasswordEmailCode.submitPassword({
59
54
  password,
@@ -83,7 +78,6 @@ export function signInCalls(signIn) {
83
78
  }));
84
79
  return state();
85
80
  },
86
- /** Sends the second-factor code. Clerk picks the phone number or email of the sign-in itself. */
87
81
  async prepareSecondFactor(params) {
88
82
  if (params.strategy === "phone_code") await clerkCall(signIn.mfa.sendPhoneCode());else await clerkCall(signIn.mfa.sendEmailCode());
89
83
  },
@@ -102,7 +96,6 @@ export function signInCalls(signIn) {
102
96
  }));
103
97
  return state();
104
98
  },
105
- /** Makes the session of a complete sign-in the active one. */
106
99
  async setActive() {
107
100
  await clerkCall(signIn.finalize());
108
101
  }
@@ -1,7 +1,3 @@
1
- // Clerk + Convex providers and the shared sign-in and sign-up screens. On
2
- // `@vvedantb/native-ui/auth` only: they import `@clerk/expo`, `convex`,
3
- // `expo-auth-session`, `expo-web-browser` and `expo-router`, and Metro does not
4
- // tree-shake.
5
1
  export { AuthProviders } from "./AuthProviders";
6
2
  export { AuthScreen, OrDivider, FieldError } from "./AuthScreen";
7
3
  export { authErrorMessage, logAuthFailure, withAuthTimeout, AuthTimeoutError, isAuthTimeoutError, AUTH_TIMEOUT_CODE, DEFAULT_STAGE_TIMEOUT_MS, CREDENTIAL_ERROR_CODES } from "./authErrors";
package/dist/auth/totp.js CHANGED
@@ -3,8 +3,6 @@ import { useState } from "react";
3
3
  import { useSignIn } from "@clerk/expo";
4
4
  import { authErrorMessage, DEFAULT_STAGE_TIMEOUT_MS, isAuthTimeoutError, logAuthFailure, withAuthTimeout } from "./authErrors";
5
5
  import { signInCalls } from "./clerkCore3";
6
-
7
- /** Logs a timed-out stage. Other failures are not logged here. */
8
6
  const logTimeout = (stage, error) => {
9
7
  if (isAuthTimeoutError(error)) logAuthFailure(stage, error);
10
8
  };
@@ -2,7 +2,6 @@ import { c as _c } from "react/compiler-runtime";
2
2
  import { Platform } from "react-native";
3
3
  import Svg, { Path } from "react-native-svg";
4
4
  import { svgA11yProps } from "../svgA11y";
5
- /** The four paths of the Google "G" on the 24 grid, each in its brand colour. */
6
5
  const GOOGLE_G = [{
7
6
  fill: "#4285F4",
8
7
  d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
@@ -4,8 +4,6 @@ import Svg, { Path, Rect } from "react-native-svg";
4
4
  import { svgA11yProps } from "../svgA11y";
5
5
  import { useScheme } from "../useScheme";
6
6
 
7
- /** A fill that follows the colour scheme, as the web `text-black dark:text-white`. */
8
-
9
7
  /** Providers with a mark. Any other provider draws the Claude mark, as the web. */
10
8
 
11
9
  /**
@@ -1,6 +1,3 @@
1
- // `svg.ts`, `familyApps.ts` and `vProAppBenefits.ts` are byte-identical copies of
2
- // `@vvedantb/ui` `src/brand/` (pure data, no imports beyond each other). A test
3
- // in this package fails when they differ: change both together.
4
1
  export { APP_ICONS, IconBee, IconEva, IconProjectV, IconVelth, IconVerve, IconVhub, IconVibot, IconVmem } from "./AppIcons";
5
2
  export { AppMark } from "./AppMark";
6
3
  export { AppWordmark } from "./AppWordmark";
package/dist/brand/svg.js CHANGED
@@ -1,6 +1,3 @@
1
- // Geometry and raw SVG strings for the family app marks. No imports, so the
2
- // asset script can load this file directly with Node.
3
-
4
1
  /** Every mark. `eva` and `bee` are marks and icons only: they are not family apps, so `FAMILY_APPS` leaves them out. */
5
2
  export const APP_NAMES = ["projectv", "vibot", "vhub", "vmem", "verve", "velth", "eva", "bee"];
6
3
 
@@ -62,7 +59,6 @@ export const APP_MARKS = {
62
59
  paths: ["M304 530.7A208.1 208.1 0 1 1 720.1 530.7A208.1 208.1 0 1 1 304 530.7", "M447.5 414.2L447.5 445.4", "M576.5 414.2L576.5 445.4", "M306.3 561.9L717.7 561.9", "M344 653.4L680 653.4", "M468.3 341.4Q455.8 291.4 420.5 260.2", "M555.7 341.4Q568.2 291.4 603.5 260.2"]
63
60
  }
64
61
  };
65
- /** Roots in (0, 1) of the derivative of a Bezier with 1D control values `v` (quadratic or cubic). */
66
62
  function bezierExtrema(v) {
67
63
  const roots = [];
68
64
  if (v.length === 3) {
@@ -86,8 +82,6 @@ function bezierAt(v, t) {
86
82
  const [p0, p1, p2, p3] = v;
87
83
  return v.length === 3 ? u * u * p0 + 2 * u * t * p1 + t * t * p2 : u ** 3 * p0 + 3 * u * u * t * p1 + 3 * u * t * t * p2 + t ** 3 * p3;
88
84
  }
89
-
90
- /** Extreme points of an SVG elliptical arc (endpoint form, no rotation), including both ends. */
91
85
  function arcPoints(from, [rx0, ry0,, large, sweep, x, y]) {
92
86
  const [x0, y0] = from;
93
87
  let rx = Math.abs(rx0);
@@ -2,17 +2,10 @@ import { palette } from "./palette";
2
2
  import { tokens } from "./tokens";
3
3
  import { fontFamily } from "./typography";
4
4
 
5
- /** `tokens` and `palette` value types with the literal hex widened to `string` and `readonly` dropped. */
6
-
7
5
  /** The `tokens.color` shape: each key a `{ light, dark }` pair, except `white` and `black`. */
8
6
 
9
7
  /** The `palette` shape: each key a `{ light, dark }` pair, except `destructive`. */
10
8
 
11
- /**
12
- * Copies each given key onto `target`. A `{ light, dark }` pair is copied into
13
- * the existing pair object, so values that hold the pair (`floatingFill`,
14
- * `floatingHairline`, `floatingSolidFill`) follow it.
15
- */
16
9
  function assignValues(target, source) {
17
10
  for (const [key, value] of Object.entries(source)) {
18
11
  if (value === undefined) continue;
@@ -22,8 +15,6 @@ function assignValues(target, source) {
22
15
  });
23
16
  }
24
17
  }
25
-
26
- /** Bumped by each `configureTheme` call; `useScheme` redraws on it. */
27
18
  let themeVersion = 0;
28
19
  const themeListeners = new Set();
29
20
 
@@ -1,12 +1,3 @@
1
- /**
2
- * Colours for `Button`, `Input`, `Textarea`, the `Select` trigger, `Switch`,
3
- * `Checkbox`, `Tabs`, `Card` and component text, taken from `palette` and
4
- * `tokens` instead of NativeWind theme keys (`bg-primary`, `bg-input`,
5
- * `text-foreground`) that apps do not define, or define without a dark value.
6
- * Also text weights and sizes as styles, the page title type, the
7
- * `SearchInput` metrics, the compact window test for dialogs and the
8
- * touch-target maths. No React Native import, so the tests can load this file.
9
- */
10
1
  import { palette, withAlpha } from "./palette";
11
2
  import { tokens } from "./tokens";
12
3
 
@@ -140,8 +131,6 @@ export function typeStyle(weight) {
140
131
  fontWeight: FONT_WEIGHT[weight]
141
132
  };
142
133
  }
143
-
144
- /** Tailwind `text-*` sizes with their default line heights, in points. */
145
134
  const TEXT_SIZE = {
146
135
  "text-xs": {
147
136
  fontSize: 12,
@@ -168,7 +157,6 @@ const TEXT_SIZE = {
168
157
  lineHeight: 32
169
158
  }
170
159
  };
171
- /** Tailwind `leading-tight`, `leading-snug` and `leading-relaxed`, as multiples of the size. */
172
160
  const LEADING = {
173
161
  tight: 1.25,
174
162
  snug: 1.375,
@@ -192,8 +180,6 @@ export function sizeStyle(size, leading) {
192
180
  lineHeight: leading ? fontSize * LEADING[leading] : lineHeight
193
181
  };
194
182
  }
195
-
196
- /** Tailwind `tracking-tight` and `tracking-wide`, in em. */
197
183
  const TRACKING = {
198
184
  tight: -0.025,
199
185
  wide: 0.025
@@ -0,0 +1,56 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { Share } from "react-native";
3
+ import { ConfirmDialog } from "../ConfirmDialog";
4
+ import { crashDetails, dismissLastCrash, useLastCrash } from "./lastCrash";
5
+ /**
6
+ * "<App> closed after an error", once at start when the last session ended in
7
+ * a fatal error saved by `installCrashCapture`: the message, and a button for
8
+ * the full details to paste into a chat. Mount it once in the root layout.
9
+ */
10
+ export function LastCrashDialog(t0) {
11
+ const $ = _c(11);
12
+ const {
13
+ appName,
14
+ onCopy,
15
+ testID: t1
16
+ } = t0;
17
+ const testID = t1 === undefined ? "last-crash" : t1;
18
+ const crash = useLastCrash();
19
+ const t2 = crash !== null;
20
+ const t3 = `${appName} closed after an error`;
21
+ const t4 = crash ? `${crash.name}: ${crash.message}` : undefined;
22
+ const t5 = onCopy ? "Copy details" : "Share details";
23
+ let t6;
24
+ if ($[0] !== appName || $[1] !== crash || $[2] !== onCopy) {
25
+ t6 = () => {
26
+ if (crash) {
27
+ const details = crashDetails(crash, appName);
28
+ (onCopy ? onCopy(details) : Share.share({
29
+ message: details
30
+ })).catch(_temp);
31
+ }
32
+ dismissLastCrash();
33
+ };
34
+ $[0] = appName;
35
+ $[1] = crash;
36
+ $[2] = onCopy;
37
+ $[3] = t6;
38
+ } else {
39
+ t6 = $[3];
40
+ }
41
+ let t7;
42
+ if ($[4] !== t2 || $[5] !== t3 || $[6] !== t4 || $[7] !== t5 || $[8] !== t6 || $[9] !== testID) {
43
+ t7 = <ConfirmDialog testID={testID} open={t2} title={t3} description={t4} cancelLabel="Dismiss" confirmLabel={t5} onCancel={dismissLastCrash} onConfirm={t6} />;
44
+ $[4] = t2;
45
+ $[5] = t3;
46
+ $[6] = t4;
47
+ $[7] = t5;
48
+ $[8] = t6;
49
+ $[9] = testID;
50
+ $[10] = t7;
51
+ } else {
52
+ t7 = $[10];
53
+ }
54
+ return t7;
55
+ }
56
+ function _temp() {}