@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
@@ -0,0 +1,127 @@
1
+ import { configureTheme } from "./configureTheme";
2
+ import { palette, withAlpha } from "./palette";
3
+ import { tokens } from "./tokens";
4
+
5
+ /** The web Neutral theme (`.dark.neutral` in `@vvedantb/ui` tokens.css), as hex. */
6
+ export const NEUTRAL_PALETTE = {
7
+ background: "#222325",
8
+ surface: "#303134",
9
+ surfaceSecondary: "#3a3b3e",
10
+ surfaceTertiary: "#444548",
11
+ border: "#4e4f52",
12
+ muted: "#9fa0a2",
13
+ foreground: "#fafafa",
14
+ } as const;
15
+
16
+ /** The same colours as space-separated RGB channels, for NativeWind variables that take channels. */
17
+ export const NEUTRAL_CHANNELS = {
18
+ background: "34 35 37",
19
+ surface: "48 49 52",
20
+ surfaceSecondary: "58 59 62",
21
+ surfaceTertiary: "68 69 72",
22
+ border: "78 79 82",
23
+ muted: "159 160 162",
24
+ foreground: "250 250 250",
25
+ } as const;
26
+
27
+ type DarkFamily = {
28
+ color: Record<
29
+ | "background"
30
+ | "foreground"
31
+ | "muted"
32
+ | "border"
33
+ | "separator"
34
+ | "surface"
35
+ | "surfaceSecondary"
36
+ | "surfaceCard"
37
+ | "fill",
38
+ string
39
+ >;
40
+ palette: Record<"default" | "overlay" | "segment" | "surfaceTertiary" | "fieldPlaceholder" | "tabBarPill", string>;
41
+ };
42
+
43
+ const DARK: DarkFamily = {
44
+ color: {
45
+ background: tokens.color.background.dark,
46
+ foreground: tokens.color.foreground.dark,
47
+ muted: tokens.color.muted.dark,
48
+ border: tokens.color.border.dark,
49
+ separator: tokens.color.separator.dark,
50
+ surface: tokens.color.surface.dark,
51
+ surfaceSecondary: tokens.color.surfaceSecondary.dark,
52
+ surfaceCard: tokens.color.surfaceCard.dark,
53
+ fill: tokens.color.fill.dark,
54
+ },
55
+ palette: {
56
+ default: palette.default.dark,
57
+ overlay: palette.overlay.dark,
58
+ segment: palette.segment.dark,
59
+ surfaceTertiary: palette.surfaceTertiary.dark,
60
+ fieldPlaceholder: palette.fieldPlaceholder.dark,
61
+ tabBarPill: palette.tabBarPill.dark,
62
+ },
63
+ };
64
+
65
+ const NEUTRAL: DarkFamily = {
66
+ color: {
67
+ background: NEUTRAL_PALETTE.background,
68
+ foreground: NEUTRAL_PALETTE.foreground,
69
+ muted: NEUTRAL_PALETTE.muted,
70
+ border: NEUTRAL_PALETTE.border,
71
+ separator: NEUTRAL_PALETTE.surfaceSecondary,
72
+ surface: NEUTRAL_PALETTE.surface,
73
+ surfaceSecondary: NEUTRAL_PALETTE.surfaceSecondary,
74
+ surfaceCard: NEUTRAL_PALETTE.surface,
75
+ fill: withAlpha(NEUTRAL_PALETTE.surface, 0.88),
76
+ },
77
+ palette: {
78
+ default: NEUTRAL_PALETTE.surfaceTertiary,
79
+ overlay: NEUTRAL_PALETTE.surface,
80
+ segment: NEUTRAL_PALETTE.surfaceTertiary,
81
+ surfaceTertiary: NEUTRAL_PALETTE.surfaceTertiary,
82
+ fieldPlaceholder: NEUTRAL_PALETTE.muted,
83
+ tabBarPill: NEUTRAL_PALETTE.surfaceTertiary,
84
+ },
85
+ };
86
+
87
+ /** Dark-slot colours that replace the ones `paintDarkFamily` would paint. */
88
+ export type PaintDarkFamilyOverrides = {
89
+ color?: Partial<DarkFamily["color"]>;
90
+ palette?: Partial<DarkFamily["palette"]>;
91
+ };
92
+
93
+ /**
94
+ * Puts the Dark or Neutral colours in the kit's dark slot (`configureTheme`).
95
+ * Light is not changed. Kit parts under `NativeUiProvider` redraw at once.
96
+ * Status and accent colours stay Dark's. `overrides` replaces any painted
97
+ * dark-slot colour, for an app that keeps its own value.
98
+ */
99
+ export function paintDarkFamily(family: "dark" | "neutral", overrides?: PaintDarkFamilyOverrides): void {
100
+ const base = family === "neutral" ? NEUTRAL : DARK;
101
+ const next: DarkFamily = {
102
+ color: { ...base.color, ...overrides?.color },
103
+ palette: { ...base.palette, ...overrides?.palette },
104
+ };
105
+ const { color } = tokens;
106
+ configureTheme({
107
+ color: {
108
+ background: { light: color.background.light, dark: next.color.background },
109
+ foreground: { light: color.foreground.light, dark: next.color.foreground },
110
+ muted: { light: color.muted.light, dark: next.color.muted },
111
+ border: { light: color.border.light, dark: next.color.border },
112
+ separator: { light: color.separator.light, dark: next.color.separator },
113
+ surface: { light: color.surface.light, dark: next.color.surface },
114
+ surfaceSecondary: { light: color.surfaceSecondary.light, dark: next.color.surfaceSecondary },
115
+ surfaceCard: { light: color.surfaceCard.light, dark: next.color.surfaceCard },
116
+ fill: { light: color.fill.light, dark: next.color.fill },
117
+ },
118
+ palette: {
119
+ default: { light: palette.default.light, dark: next.palette.default },
120
+ overlay: { light: palette.overlay.light, dark: next.palette.overlay },
121
+ segment: { light: palette.segment.light, dark: next.palette.segment },
122
+ surfaceTertiary: { light: palette.surfaceTertiary.light, dark: next.palette.surfaceTertiary },
123
+ fieldPlaceholder: { light: palette.fieldPlaceholder.light, dark: next.palette.fieldPlaceholder },
124
+ tabBarPill: { light: palette.tabBarPill.light, dark: next.palette.tabBarPill },
125
+ },
126
+ });
127
+ }
package/src/pagerSwipe.ts CHANGED
@@ -1,12 +1,3 @@
1
- /**
2
- * The rules of a swiped `Pager`, as plain numbers, so they stay testable
3
- * apart from the gesture. The pager's position is in pages: 0 is the first
4
- * page, 1.5 is halfway between the second and the third. Distances are in
5
- * points and velocities in points per second (the Gesture Handler units),
6
- * positive to the right. Each rule is a worklet, so the drag runs it on the
7
- * UI thread.
8
- */
9
-
10
1
  /**
11
2
  * Sideways travel (pt) before a drag takes the pager: twice a row swipe's
12
3
  * (`SWIPE_ACTIVE_OFFSET_X`), so a swipeable row under the finger takes its
@@ -17,13 +8,10 @@ export const PAGER_ACTIVE_OFFSET_X = 24;
17
8
  /** Vertical travel (pt) that leaves the touch to the page's own scroll. */
18
9
  export const PAGER_FAIL_OFFSET_Y = 14;
19
10
 
20
- /** A sideways flick at this speed (pt/s) turns the page, however short the drag. */
21
11
  const FLICK_VELOCITY = 500;
22
12
 
23
- /** How far ahead (s) the release velocity carries the pages when deciding where they settle. */
24
13
  const PROJECTION_S = 0.2;
25
14
 
26
- /** How far the pages move past the first or last page: less and less the further the finger goes. */
27
15
  function rubberband(overshoot: number, dimension: number): number {
28
16
  "worklet";
29
17
  const constant = 0.55;
@@ -55,7 +43,6 @@ export function pagerPosition(start: number, dx: number, width: number, count: n
55
43
  export function pagerSettle(position: number, vx: number, width: number, from: number, count: number): number {
56
44
  "worklet";
57
45
  const moved = position - from;
58
- // A drag left (negative `vx`) moves toward the next page (a larger position).
59
46
  const toward = -Math.sign(vx);
60
47
  let target: number;
61
48
  if (Math.abs(vx) >= FLICK_VELOCITY && moved !== 0 && toward === Math.sign(moved)) {
package/src/palette.ts CHANGED
@@ -9,7 +9,6 @@
9
9
  * drifts, so change `tokens.css` first and then this file.
10
10
  */
11
11
  export const palette = {
12
- /** `--accent` (web `primary`): near-black in light, near-white in dark. */
13
12
  primary: { light: "#181818", dark: "#fcfcfc" },
14
13
  primaryForeground: { light: "#fcfcfc", dark: "#181818" },
15
14
  danger: { light: "#ff373c", dark: "#db3b3e" },
@@ -18,26 +17,17 @@ export const palette = {
18
17
  successForeground: { light: "#161917", dark: "#161917" },
19
18
  warning: { light: "#f5a523", dark: "#f7b750" },
20
19
  warningForeground: { light: "#1a1815", dark: "#1a1815" },
21
- /** `--default` (web `secondary`): neutral control fill. */
22
20
  default: { light: "#ebebeb", dark: "#272727" },
23
21
  defaultForeground: { light: "#181818", dark: "#fcfcfc" },
24
22
  overlay: { light: "#ffffff", dark: "#181818" },
25
23
  overlayForeground: { light: "#181818", dark: "#fcfcfc" },
26
24
  segment: { light: "#ffffff", dark: "#474747" },
27
25
  segmentForeground: { light: "#181818", dark: "#fcfcfc" },
28
- /**
29
- * The `FloatingTabBar` active pill: `--default` in light (it shows on the
30
- * near-white glass bar) and `--segment` in dark. Its own key, so an app that
31
- * themes `segment` for the segmented `Tabs` thumb keeps a pill that shows on
32
- * the dark glass bar.
33
- */
34
26
  tabBarPill: { light: "#ebebeb", dark: "#474747" },
35
27
  surfaceTertiary: { light: "#eaeaea", dark: "#282627" },
36
28
  fieldPlaceholder: { light: "#727272", dark: "#a0a0a0" },
37
29
  backdrop: { light: "rgba(0, 0, 0, 0.5)", dark: "rgba(0, 0, 0, 0.6)" },
38
- /** Web `DialogDescription` text: `--overlay-foreground` mixed 72% into `--overlay` (oklch), for 4.5:1 on the overlay. */
39
30
  overlayMuted: { light: "#505050", dark: "#b5b5b5" },
40
- /** Fill of the web destructive `Button` (`oklch(47.2% 0.195 25.7)`), the same in both schemes. */
41
31
  destructive: "#af0015",
42
32
  } as const;
43
33
 
package/src/pressScale.ts CHANGED
@@ -14,19 +14,12 @@ export const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
14
14
  cssInterop(AnimatedPressable, { className: "style" });
15
15
 
16
16
  export type PressScaleOptions = {
17
- /** Scale while pressed. Default 0.97. */
18
17
  scale?: number;
19
- /** Opacity while pressed, a light dim. Default 0.7, the dim these controls had before the scale. */
20
18
  dim?: number;
21
- /** Dim used instead under Reduce Motion. Default `dim`. */
22
19
  reducedDim?: number;
23
- /** Opacity at rest, such as 0.5 when disabled. The press dims from here. Default 1. */
24
20
  restOpacity?: number;
25
- /** Press-in duration in ms. Default 120. */
26
21
  pressInMs?: number;
27
- /** Release duration in ms. Default 160. */
28
22
  pressOutMs?: number;
29
- /** A disabled control lets go at once, so it cannot stay pressed. */
30
23
  disabled?: boolean;
31
24
  };
32
25
 
@@ -40,8 +40,6 @@ const buttonVariants = cva(
40
40
  lg: "h-11 px-6",
41
41
  icon: "h-10 w-10",
42
42
  },
43
- // The web `shape`: `pill` (default) is fully round, `rounded` the radius
44
- // before 0.6.0. `Button` also sets the radius as a style, which wins.
45
43
  shape: {
46
44
  pill: "rounded-full",
47
45
  rounded: "rounded-lg",
@@ -55,8 +53,6 @@ const buttonVariants = cva(
55
53
  },
56
54
  );
57
55
 
58
- // No weight: a class context cannot carry the `typeStyle` that a face class
59
- // needs, so `Button` sets the medium face and its weight on its label.
60
56
  const buttonTextVariants = cva("text-sm text-foreground", {
61
57
  variants: {
62
58
  variant: {
@@ -42,7 +42,6 @@ const CardTitle = React.forwardRef<
42
42
  React.ElementRef<typeof Text>,
43
43
  React.ComponentPropsWithoutRef<typeof Text> & { className?: string }
44
44
  >(({ className, style, ...props }, ref) => {
45
- // The web `font-medium`: the semibold face, with its weight as a style.
46
45
  return (
47
46
  <Text
48
47
  ref={ref}
@@ -1,8 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { IconProps as TablerIconProps } from "@tabler/icons-react-native";
3
3
 
4
- // Tabler, not Lucide: a Lucide icon always sets `testID` on its `Svg`, which
5
- // on web is a DOM `<svg>`, so React logs it as an unknown DOM prop.
6
4
  type IconProps = TablerIconProps & {
7
5
  as: React.ComponentType<TablerIconProps>;
8
6
  className?: string;
@@ -14,10 +14,6 @@ const Input = React.forwardRef<React.ElementRef<typeof TextInput>, InputProps>(
14
14
  return (
15
15
  <TextInput
16
16
  ref={ref}
17
- // A prop, not a `placeholder:` class: on native NativeWind turns that
18
- // class into `placeholderTextColor`, which beats the prop. The old
19
- // `placeholder:text-muted-foreground/50` was the light grey at half
20
- // opacity in apps that nest `dark` under `muted-foreground`.
21
17
  placeholderTextColor={placeholderTextColor ?? palette.fieldPlaceholder[scheme]}
22
18
  className={cn(
23
19
  "flex w-full flex-row items-center rounded-lg border-0 bg-secondary px-3 py-2 text-base text-foreground",
@@ -10,17 +10,6 @@ import {
10
10
  import { runOnJS } from "react-native-reanimated";
11
11
  import { COMPOSER_INPUT_ID, KeyboardPartsContext, type KeyboardParts } from "./keyboard-parts";
12
12
 
13
- // The keyboard parts on `react-native-keyboard-controller`: the keyboard's
14
- // real position, frame by frame, on the UI thread. No timing of our own, so
15
- // the composer can neither lag nor lead the keyboard; with Reduce Motion the
16
- // system shortens the keyboard's own motion and the parts follow it.
17
-
18
- /**
19
- * A drag moves the keyboard on iOS (`keyboardDismissMode="interactive"`) and
20
- * on Android 11+ (API 30, `WindowInsetsAnimation`). Android 10 and below has
21
- * no interactive keyboard: `KeyboardGestureArea` then only renders its
22
- * children, and the transcript keeps `on-drag`.
23
- */
24
13
  const INTERACTIVE = Platform.OS === "ios" || (Platform.OS === "android" && Number(Platform.Version) >= 30);
25
14
 
26
15
  function AvoidingView(props: ComponentProps<KeyboardParts["AvoidingView"]>) {
@@ -31,15 +20,6 @@ function StickyView({ bottomOffset, ...props }: ComponentProps<KeyboardParts["St
31
20
  return <KeyboardStickyView {...props} offset={{ opened: bottomOffset }} />;
32
21
  }
33
22
 
34
- /**
35
- * `always`: the content rises with the keyboard wherever the reader is, so
36
- * what sat on the composer stays there (the newest message, at the end).
37
- * Inverted, the keyboard's space is the content's top inset, the visual
38
- * bottom: iOS scrolls below offset 0 into it, so the end moves there; Android
39
- * moves the content down by it instead, so offset 0 stays the end. While the
40
- * keyboard moves, the list scrolls with it, through offsets that are not the
41
- * end on either platform.
42
- */
43
23
  function ChatScrollView({
44
24
  bottomOffset,
45
25
  inverted = false,
@@ -65,7 +45,6 @@ function ChatScrollView({
65
45
  <KeyboardChatScrollView
66
46
  {...props}
67
47
  inverted={inverted}
68
- // An overlay window (a hold menu) takes the focus on Android: its keyboard events must not scroll the list.
69
48
  freeze={freeze}
70
49
  offset={bottomOffset}
71
50
  keyboardLiftBehavior="always"
@@ -76,10 +55,6 @@ function ChatScrollView({
76
55
  );
77
56
  }
78
57
 
79
- /**
80
- * `ios`: the keyboard follows once the finger reaches the composer, then 1:1,
81
- * and a release carries the finger's velocity, on both platforms.
82
- */
83
58
  function GestureArea({ offset, style, children }: ComponentProps<KeyboardParts["GestureArea"]>) {
84
59
  return (
85
60
  <KeyboardGestureArea interpolator="ios" offset={offset} textInputNativeID={COMPOSER_INPUT_ID} style={style}>
@@ -16,24 +16,8 @@ import {
16
16
  * the peer and an app without it bundles as before.
17
17
  */
18
18
  export type KeyboardParts = {
19
- /** A `KeyboardAvoidingView` that pads frame by frame with the keyboard. */
20
19
  AvoidingView: ComponentType<KeyboardAvoidingViewProps>;
21
- /**
22
- * Moves with the keyboard (`translateY`), less `bottomOffset` while it is
23
- * open: the bottom inset the content pads, which the keyboard covers.
24
- */
25
20
  StickyView: ComponentType<ViewProps & { bottomOffset: number }>;
26
- /**
27
- * The chat transcript's scroll view (a `FlatList` `renderScrollComponent`).
28
- * Its content gains the keyboard height less `bottomOffset` at the end (at
29
- * its start when `inverted`, the visual bottom either way), and moves up
30
- * with the keyboard, so the newest message stays in view. `onInsetChange`
31
- * gets that extra space as the scroll offset sees it, which `onScroll` does
32
- * not report: past the content's end, or when `inverted` before offset 0.
33
- * `onKeyboardMove` is true from the start to the end of each keyboard
34
- * move, while the keyboard, not the reader, scrolls the list. With
35
- * `freeze`, keyboard events change nothing (an overlay window is open).
36
- */
37
21
  ChatScrollView: ComponentType<
38
22
  ScrollViewProps & {
39
23
  bottomOffset: number;
@@ -43,15 +27,7 @@ export type KeyboardParts = {
43
27
  onKeyboardMove: (moving: boolean) => void;
44
28
  }
45
29
  >;
46
- /**
47
- * Around the transcript: a drag that reaches `offset` above the keyboard
48
- * (the composer's top) moves the keyboard with the finger.
49
- */
50
30
  GestureArea: ComponentType<{ offset: number; style?: StyleProp<ViewStyle>; children: ReactNode }>;
51
- /**
52
- * Whether a drag on the transcript moves the keyboard (iOS, Android 11+).
53
- * False on Android 10 and below: there a drag lowers it at once.
54
- */
55
31
  interactive: boolean;
56
32
  };
57
33
 
@@ -83,12 +59,9 @@ export function useKeyboardParts(): KeyboardParts | null {
83
59
  export const COMPOSER_INPUT_ID = "native-ui-composer";
84
60
 
85
61
  export type KeyboardAvoidingViewProps = {
86
- /** Default `padding`, on iOS and Android: Android `height` does nothing edge-to-edge. */
87
62
  behavior?: "padding" | "height" | "position";
88
- /** Height of anything above the view's top, such as a navigation header. Default 0. */
89
63
  keyboardVerticalOffset?: number;
90
64
  enabled?: boolean;
91
- /** A style, not a class: the keyboard-controller view takes no NativeWind `className`. */
92
65
  style?: StyleProp<ViewStyle>;
93
66
  testID?: string;
94
67
  children?: ReactNode;
@@ -8,11 +8,6 @@ type NativeOnlyAnimatedViewProps = ViewProps & {
8
8
  layout?: AnimatedProps<ViewProps>["layout"];
9
9
  };
10
10
 
11
- /**
12
- * `Animated.View` with layout animations on iOS and Android, a plain `View`
13
- * on web. With Reduce Motion on, it drops the animations: sheets, toasts and
14
- * the `Select` popover appear and leave in place.
15
- */
16
11
  function NativeOnlyAnimatedView({
17
12
  children,
18
13
  entering,
@@ -53,11 +53,8 @@ export function useOverlay(part: string): OverlayContextValue {
53
53
  }
54
54
 
55
55
  export type OverlayRootProps = {
56
- /** Open state when the parent controls it. */
57
56
  open?: boolean;
58
- /** Initial open state when `open` is not set. Default `false`. */
59
57
  defaultOpen?: boolean;
60
- /** Called with the next open state (trigger, close, backdrop, Android back). */
61
58
  onOpenChange?: (open: boolean) => void;
62
59
  children?: ReactNode;
63
60
  };
@@ -82,7 +79,6 @@ export function OverlayRoot({
82
79
  }
83
80
 
84
81
  export type OverlayPressableProps = ComponentPropsWithoutRef<typeof Pressable> & {
85
- /** Merge the press handler into the single child (for example a `Button`) instead of wrapping it. */
86
82
  asChild?: boolean;
87
83
  };
88
84
 
@@ -144,7 +140,6 @@ export function OverlayModal({
144
140
  part: string;
145
141
  placement: "center" | "bottom";
146
142
  dismissible: boolean;
147
- /** Once the overlay is on screen: where to focus a field (see `DialogContent`'s `onShow`). */
148
143
  onShow?: () => void;
149
144
  children: ReactNode;
150
145
  }) {
@@ -153,7 +148,6 @@ export function OverlayModal({
153
148
  const reduceMotion = useReduceMotion();
154
149
  const slides = placement === "bottom" && !reduceMotion;
155
150
  const scales = placement === "center" && !reduceMotion;
156
- // Up while open, and after a close until a sliding sheet or a scaling dialog is out of sight.
157
151
  const [shown, setShown] = useState(open);
158
152
  if (open && !shown) setShown(true);
159
153
  if (!open && shown && !slides && !scales) setShown(false);
@@ -162,8 +156,6 @@ export function OverlayModal({
162
156
 
163
157
  if (!shown) return null;
164
158
  return (
165
- // The layer runs its own motion, so no fade; a layer loses the context
166
- // between it and the host, so the open state is provided again.
167
159
  <WindowLayer onRequestClose={close} onShow={onShow} fade={false}>
168
160
  <OverlayContext.Provider value={overlay}>
169
161
  <ModalRoot>
@@ -185,7 +177,6 @@ export function OverlayModal({
185
177
  );
186
178
  }
187
179
 
188
- /** The layer's content: mounted with each opening, so a sheet starts below the screen (or at rest). */
189
180
  function OverlayModalBody({
190
181
  part,
191
182
  placement,
@@ -211,9 +202,6 @@ function OverlayModalBody({
211
202
  const insets = useSafeAreaInsets();
212
203
  const drag = useSheetDragState(close, slides);
213
204
  const sheetBackdropStyle = useSheetBackdropStyle(drag);
214
- // A centred dialog: one 0 to 1 `progress` drives the backdrop fade and the
215
- // panel's scale and opacity. It mounts at 0 with each opening, and at 1
216
- // under Reduce Motion, so there the dialog simply appears.
217
205
  const progress = useSharedValue(scales ? 0 : 1);
218
206
  const centreBackdropStyle = useAnimatedStyle(() => ({ opacity: progress.get() }));
219
207
  const centrePanelStyle = useAnimatedStyle(() => ({
@@ -221,18 +209,11 @@ function OverlayModalBody({
221
209
  transform: [{ scale: PANEL_SCALE_FROM + (1 - PANEL_SCALE_FROM) * progress.get() }],
222
210
  }));
223
211
  const backdropStyle = placement === "center" ? centreBackdropStyle : sheetBackdropStyle;
224
- // The open state lives in React, the sheet's position on the UI thread:
225
- // each change of `open` starts the slide that matches it. The slide in on
226
- // opening starts from the sheet's first layout (`SheetDragView`).
227
212
  useEffect(() => {
228
213
  if (!slides) return;
229
214
  if (open) slideSheetIn(drag);
230
215
  else slideSheetOut(drag, onHidden);
231
- // Only a change of `open` starts a slide; `drag` and `onHidden` keep their meaning.
232
216
  }, [open, slides]);
233
- // The same for a centred dialog, from wherever `progress` is. Opened again
234
- // while it leaves, it turns back at once, and the exit callback reports
235
- // `finished` false, so the layer stays up.
236
217
  useEffect(() => {
237
218
  if (!scales) return;
238
219
  if (open) {
@@ -245,16 +226,10 @@ function OverlayModalBody({
245
226
  }),
246
227
  );
247
228
  }
248
- // As the slide: only a change of `open` starts it.
249
229
  }, [open, scales]);
250
230
  return (
251
231
  <SheetDragProvider value={drag}>
252
- {/* Android too: a modal window with `statusBarTranslucent` may not
253
- resize for the keyboard, which then covers the fields. The padding
254
- is the measured overlap, so it drops to 0 where the window does
255
- resize. Frame by frame with `KeyboardControllerProvider`. */}
256
232
  <KeyboardAvoidingView style={styles.fill}>
257
- {/* Over the app, not in the dock it opened from: the dock's lift is not for it. */}
258
233
  <KeyboardLiftContext.Provider value={false}>
259
234
  <Animated.View
260
235
  pointerEvents="box-none"
@@ -15,33 +15,21 @@ import { InsidePagerContext, type PagerProps } from "../Pager";
15
15
  import { PAGER_ACTIVE_OFFSET_X, PAGER_FAIL_OFFSET_Y, pagerPosition, pagerSettle, pagesBetween } from "../pagerSwipe";
16
16
  import { useWebClickGuard } from "./web-click-guard";
17
17
 
18
- // The pager on Gesture Handler: the track phase and the release run as
19
- // worklets on the UI thread, so the pages never lag the finger. The rules are
20
- // plain worklets in `pagerSwipe`.
21
-
22
- /** The release: springs on at the finger's speed, no bounce (an overshoot would flash the next page's edge). */
23
18
  const PAGER_SPRING = { duration: 250, dampingRatio: 1, reduceMotion: ReduceMotion.System } as const;
24
19
 
25
- /** A page set from outside (a tab press) slides there; at once with Reduce Motion. */
26
20
  const PAGER_SLIDE = { duration: 220, reduceMotion: ReduceMotion.System } as const;
27
21
 
28
22
  export function GesturePager({ index, count, onIndexChange, progress, renderPage }: PagerProps) {
29
23
  const width = useSharedValue(0);
30
- // Where the pages were when the finger caught them, and the finger's travel then.
31
24
  const start = useSharedValue(0);
32
25
  const startX = useSharedValue(0);
33
26
  const [mounted, setMounted] = useState<ReadonlySet<number>>(() => new Set([index]));
34
27
  const [shown, setShown] = useState(index);
35
- // A page reached from outside is drawn from then on, with every page the
36
- // slide there passes, so it never crosses a blank page.
37
28
  if (shown !== index) {
38
29
  setShown(index);
39
30
  setMounted(new Set([...mounted, ...pagesBetween(shown, index)]));
40
31
  }
41
- // The page a swipe settled on, until the new `index` comes back: that one must not stop the spring.
42
32
  const settling = useRef<number | null>(null);
43
- // A page set from outside slides there. An effect: a shared value is never
44
- // written in render.
45
33
  useEffect(() => {
46
34
  const fromSwipe = settling.current === index;
47
35
  settling.current = null;
@@ -52,7 +40,6 @@ export function GesturePager({ index, count, onIndexChange, progress, renderPage
52
40
  const webClicks = useWebClickGuard();
53
41
  const dragStarted = () => {
54
42
  webClicks.swallowNext();
55
- // Both neighbours, so the finger finds a page there.
56
43
  setMounted((current) => new Set([...current, index - 1, index + 1].filter((page) => page >= 0 && page < count)));
57
44
  };
58
45
  const settled = (page: number) => {
@@ -61,28 +48,22 @@ export function GesturePager({ index, count, onIndexChange, progress, renderPage
61
48
  onIndexChange(page);
62
49
  };
63
50
 
64
- // Built on each render (for `index` and `count`): the detector keeps the
65
- // same handler, and a drag in flight, and only takes the new config.
66
51
  const pan = Gesture.Pan()
67
52
  .enabled(count > 1)
68
- // Clearly sideways only: a vertical drag is the page's scroll, and a row swipe starts sooner.
69
53
  .activeOffsetX([-PAGER_ACTIVE_OFFSET_X, PAGER_ACTIVE_OFFSET_X])
70
54
  .failOffsetY([-PAGER_FAIL_OFFSET_Y, PAGER_FAIL_OFFSET_Y])
71
55
  .onStart((event) => {
72
56
  cancelAnimation(progress);
73
57
  start.set(progress.get());
74
- // Count from here, so the pages do not jump by the slop the drag needed to start.
75
58
  startX.set(event.translationX);
76
59
  runOnJS(dragStarted)();
77
60
  })
78
- // Track phase: one shared value write per frame, on the UI thread.
79
61
  .onUpdate((event) => {
80
62
  progress.set(pagerPosition(start.get(), event.translationX - startX.get(), width.get(), count));
81
63
  })
82
64
  .onEnd((event) => {
83
65
  const pageWidth = width.get();
84
66
  const target = pagerSettle(progress.get(), event.velocityX, pageWidth, Math.round(start.get()), count);
85
- // The finger's speed in pages per second, the unit of `progress`.
86
67
  const velocity = pageWidth > 0 ? -event.velocityX / pageWidth : 0;
87
68
  progress.set(withSpring(target, { ...PAGER_SPRING, velocity }));
88
69
  if (target !== index) runOnJS(settled)(target);
@@ -100,7 +81,6 @@ export function GesturePager({ index, count, onIndexChange, progress, renderPage
100
81
  {Array.from({ length: count }, (_, page) => (
101
82
  <View
102
83
  key={page}
103
- // Off-screen pages are hidden from screen readers; the tabs above switch pages for them.
104
84
  accessibilityElementsHidden={page !== index}
105
85
  importantForAccessibility={page === index ? "auto" : "no-hide-descendants"}
106
86
  style={{ width: `${100 / count}%` }}
@@ -2,10 +2,6 @@ import { TextInputWrapper, type PasteEventPayload } from "expo-paste-input";
2
2
  import type { ReactNode } from "react";
3
3
  import { PastePartsContext, type PasteParts } from "./paste-parts";
4
4
 
5
- // The image paste on `expo-paste-input`: on Android an `OnReceiveContentListener`
6
- // on the wrapped field (Paste, and the keyboard's image insert), on iOS the
7
- // field's `paste(_:)` and keyboard stickers. Text paste stays the field's own.
8
-
9
5
  const Target: PasteParts["Target"] = ({ onPasteImages, style, children }) => (
10
6
  <TextInputWrapper
11
7
  style={style}
@@ -12,7 +12,6 @@ import type { StyleProp, ViewStyle } from "react-native";
12
12
  */
13
13
  export type PasteParts = {
14
14
  Target: ComponentType<{
15
- /** The pasted images, as `file://` URIs in the app's cache. */
16
15
  onPasteImages: (uris: string[]) => void;
17
16
  style?: StyleProp<ViewStyle>;
18
17
  children: ReactNode;
@@ -1,6 +1,4 @@
1
1
  import * as SelectPrimitive from "@rn-primitives/select";
2
- // Tabler, not Lucide: a Lucide icon always sets `testID` on its `Svg`, which
3
- // on web is a DOM `<svg>`, so React logs it as an unknown DOM prop.
4
2
  import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react-native";
5
3
  import * as React from "react";
6
4
  import { Platform, ScrollView, StyleSheet, Text, View } from "react-native";
@@ -33,8 +31,6 @@ const SelectValue = React.forwardRef<
33
31
  >(({ className, style, ...props }, ref) => {
34
32
  const classes = cn("line-clamp-1 text-sm text-foreground", className);
35
33
  if (Platform.OS === "web") {
36
- // Radix `Select.Value` drops `className` and `style`, so the placeholder
37
- // took the page colour. Its span inherits them from this Text instead.
38
34
  return (
39
35
  <Text className={classes} style={style}>
40
36
  <SelectPrimitive.Value ref={ref} {...props} />
@@ -81,7 +77,6 @@ type SelectContentProps = React.ComponentPropsWithoutRef<
81
77
  portalHost?: string;
82
78
  };
83
79
 
84
- /** The popover fades in and out on the strong ease-out. */
85
80
  const SELECT_ENTER = FadeIn.duration(150).easing(EASE_OUT);
86
81
  const SELECT_EXIT = FadeOut.duration(100).easing(EASE_OUT);
87
82
 
@@ -97,9 +92,6 @@ const SelectContent = React.forwardRef<
97
92
  entering={SELECT_ENTER}
98
93
  exiting={SELECT_EXIT}
99
94
  className="z-50"
100
- // Content is absolutely positioned, so a bare wrapper has zero height
101
- // and UI tests drop its children as invisible. Fill the overlay and
102
- // let touches fall through to it.
103
95
  style={overlayFill}
104
96
  pointerEvents={Platform.select({ native: "box-none" })}
105
97
  >
@@ -134,9 +126,6 @@ const SelectContent = React.forwardRef<
134
126
  </SelectPrimitive.Overlay>
135
127
  );
136
128
 
137
- // Android: no Portal. A Modal inside a portal mounts empty, so `SelectHost`
138
- // renders the Modal directly and gates it on `open`. iOS and web keep the
139
- // Portal; `SelectHost` adds the full-window layer on iOS.
140
129
  if (Platform.OS === "android") {
141
130
  return <SelectHost>{content}</SelectHost>;
142
131
  }
@@ -166,11 +155,6 @@ const SelectLabel = React.forwardRef<
166
155
  );
167
156
  });
168
157
 
169
- /**
170
- * On web `SelectPrimitive.Item` passes these props to a Radix DOM node, not a
171
- * React Native view, so give it `aria-label` and `data-testid` there, not
172
- * `accessibilityLabel` or `testID` (`selectItemA11yProps`).
173
- */
174
158
  type SelectItemProps = React.ComponentPropsWithoutRef<
175
159
  typeof SelectPrimitive.Item
176
160
  > & {
@@ -188,7 +172,6 @@ const SelectItem = React.forwardRef<
188
172
  ref={ref}
189
173
  disabled={disabled}
190
174
  className={cn(
191
- // 44 high (56 with larger text) so a row is a full touch target.
192
175
  "relative min-h-[44px] flex-row items-center gap-2 rounded-sm py-3 pl-2 pr-8 active:opacity-70",
193
176
  largerText && "min-h-[56px]",
194
177
  disabled && "opacity-50",
@@ -203,7 +186,6 @@ const SelectItem = React.forwardRef<
203
186
  </View>
204
187
  <SelectPrimitive.ItemText
205
188
  className="select-none text-sm font-instrument-sans-medium"
206
- // One object: on web the item text is a Radix slot, which drops arrays.
207
189
  style={{ ...textStyle("foreground", scheme), ...typeStyle("medium") }}
208
190
  />
209
191
  </SelectPrimitive.Item>