@vvedantb/native-ui 0.38.0 → 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 (373) hide show
  1. package/dist/Avatar.jsx +22 -19
  2. package/dist/BottomSheetContainer.jsx +0 -6
  3. package/dist/BulkActionBar.jsx +0 -24
  4. package/dist/Button.jsx +92 -116
  5. package/dist/Card.jsx +56 -50
  6. package/dist/ColorSwatches.jsx +0 -6
  7. package/dist/Dialog.jsx +0 -12
  8. package/dist/DropdownMenu.jsx +0 -10
  9. package/dist/EmptyState.jsx +0 -3
  10. package/dist/ExpoWebRoot.jsx +0 -6
  11. package/dist/Field.jsx +0 -17
  12. package/dist/FloatingSurface.jsx +95 -80
  13. package/dist/FloatingTabBar.jsx +0 -23
  14. package/dist/IconButton.jsx +0 -1
  15. package/dist/LoadingState.jsx +0 -6
  16. package/dist/PasswordInput.jsx +0 -15
  17. package/dist/PillTabs.jsx +39 -36
  18. package/dist/SearchInput.jsx +0 -13
  19. package/dist/SectionLabel.jsx +0 -1
  20. package/dist/SharedTransition.jsx +0 -3
  21. package/dist/Skeleton.jsx +0 -2
  22. package/dist/Spinner.jsx +0 -2
  23. package/dist/StatusDot.jsx +0 -5
  24. package/dist/Switch.jsx +32 -22
  25. package/dist/Tabs.jsx +27 -26
  26. package/dist/Textarea.jsx +0 -1
  27. package/dist/ThemeToggle.jsx +0 -1
  28. package/dist/Toast.jsx +80 -91
  29. package/dist/UpdateChecker.jsx +0 -1
  30. package/dist/ai/activity-question.jsx +0 -6
  31. package/dist/ai/activity-step-label.js +0 -6
  32. package/dist/ai/activity-step-types.js +0 -4
  33. package/dist/ai/activity-tasks-utils.js +0 -17
  34. package/dist/ai/activity-timeline.js +0 -8
  35. package/dist/ai/attachments.jsx +0 -2
  36. package/dist/ai/chain-of-thought.jsx +0 -3
  37. package/dist/ai/chat-text.js +0 -1
  38. package/dist/ai/chat-thread.jsx +0 -1
  39. package/dist/ai/choice-question.jsx +0 -10
  40. package/dist/ai/code-block.jsx +0 -31
  41. package/dist/ai/collapsible.jsx +0 -14
  42. package/dist/ai/conversation-context.js +0 -3
  43. package/dist/ai/conversation.jsx +2 -48
  44. package/dist/ai/file-chip.jsx +0 -2
  45. package/dist/ai/icon-button.jsx +0 -8
  46. package/dist/ai/index.js +0 -5
  47. package/dist/ai/message-context-menu.jsx +0 -7
  48. package/dist/ai/message.jsx +0 -21
  49. package/dist/ai/prompt-input-menu.jsx +0 -3
  50. package/dist/ai/prompt-input.jsx +0 -27
  51. package/dist/ai/response-text.jsx +0 -6
  52. package/dist/ai/sources.jsx +0 -1
  53. package/dist/ai/suggestion.jsx +0 -1
  54. package/dist/ai/trace.jsx +0 -11
  55. package/dist/ai/unified-diff.jsx +0 -4
  56. package/dist/auth/AuthScreen.jsx +0 -5
  57. package/dist/auth/GoogleSignInButton.jsx +0 -3
  58. package/dist/auth/SecondFactorScreen.jsx +0 -2
  59. package/dist/auth/SignInScreen.jsx +0 -17
  60. package/dist/auth/authErrors.js +0 -4
  61. package/dist/auth/clerkCore3.js +0 -7
  62. package/dist/auth/index.js +0 -4
  63. package/dist/auth/totp.js +0 -2
  64. package/dist/brand/GoogleMark.jsx +0 -1
  65. package/dist/brand/ProviderIcon.jsx +0 -2
  66. package/dist/brand/index.js +0 -3
  67. package/dist/brand/svg.js +0 -6
  68. package/dist/configureTheme.js +0 -9
  69. package/dist/controlStyles.js +0 -14
  70. package/dist/crash/lastCrash.js +3 -24
  71. package/dist/entries/ai.js +0 -3
  72. package/dist/entries/ambient.js +0 -2
  73. package/dist/entries/app-root.js +0 -5
  74. package/dist/entries/auth.js +0 -4
  75. package/dist/entries/bottom-sheet.js +0 -2
  76. package/dist/entries/brand.js +0 -1
  77. package/dist/entries/button.js +0 -1
  78. package/dist/entries/crash.js +0 -3
  79. package/dist/entries/date-time.js +0 -2
  80. package/dist/entries/expo-router.js +0 -3
  81. package/dist/entries/expo-web-root.js +0 -2
  82. package/dist/entries/floating.js +0 -2
  83. package/dist/entries/generative-ui.js +0 -4
  84. package/dist/entries/gesture-handler.js +0 -3
  85. package/dist/entries/keyboard-controller.js +0 -3
  86. package/dist/entries/layout.js +0 -2
  87. package/dist/entries/markdown.js +0 -3
  88. package/dist/entries/marketing.js +0 -1
  89. package/dist/entries/page-title.js +0 -5
  90. package/dist/entries/password-input.js +0 -2
  91. package/dist/entries/paste-input.js +0 -3
  92. package/dist/entries/primitives.js +0 -6
  93. package/dist/entries/search-input.js +0 -2
  94. package/dist/entries/tab-bar.js +0 -2
  95. package/dist/entries/theme.js +1 -2
  96. package/dist/entries/toast.js +0 -3
  97. package/dist/entries/video.js +0 -2
  98. package/dist/entries/webview.js +0 -2
  99. package/dist/examples/AiChatGallery.jsx +0 -11
  100. package/dist/examples/ParityGallery.jsx +0 -12
  101. package/dist/floating.js +0 -8
  102. package/dist/generative-ui/GenerativeUiPanel.jsx +0 -2
  103. package/dist/generative-ui/components.jsx +0 -8
  104. package/dist/glass.js +55 -0
  105. package/dist/glassBlur.jsx +0 -12
  106. package/dist/highlight.js +0 -26
  107. package/dist/index.js +1 -2
  108. package/dist/loadingGrid.js +0 -13
  109. package/dist/markdown/Markdown.jsx +0 -59
  110. package/dist/markdown/MarkdownTable.jsx +0 -18
  111. package/dist/markdown/tableText.js +0 -5
  112. package/dist/marketing/UpgradeToProCard.jsx +0 -5
  113. package/dist/marketing/pricing.js +0 -3
  114. package/dist/media/ImageGallery.jsx +0 -16
  115. package/dist/media/imageZoom.js +0 -4
  116. package/dist/media/zoom-image-gesture.jsx +0 -8
  117. package/dist/media/zoomImage.js +0 -3
  118. package/dist/motion.js +0 -3
  119. package/dist/neutralTheme.js +0 -5
  120. package/dist/pagerSwipe.js +0 -16
  121. package/dist/palette.js +0 -10
  122. package/dist/primitives/button.jsx +0 -5
  123. package/dist/primitives/keyboard-controller.jsx +0 -27
  124. package/dist/primitives/native-only-animated-view.jsx +0 -5
  125. package/dist/primitives/overlay.jsx +0 -2
  126. package/dist/primitives/pager-gesture.jsx +3 -29
  127. package/dist/primitives/paste-input.jsx +0 -5
  128. package/dist/primitives/select.jsx +0 -8
  129. package/dist/primitives/sheet-drag.jsx +0 -3
  130. package/dist/primitives/sheet-gesture.jsx +0 -8
  131. package/dist/primitives/swipe-row-gesture.jsx +3 -45
  132. package/dist/primitives/text.jsx +0 -5
  133. package/dist/primitives/toast-drag-gesture.jsx +4 -24
  134. package/dist/primitives/web-click-guard.js +0 -3
  135. package/dist/primitives/window-layer.jsx +0 -14
  136. package/dist/push.js +0 -6
  137. package/dist/relativeTime.js +0 -13
  138. package/dist/settings/MoreFromProjectV.jsx +0 -5
  139. package/dist/settings/ThemeModePicker.jsx +0 -4
  140. package/dist/settings/projectVMobileApps.js +1 -6
  141. package/dist/sheetDrag.js +0 -10
  142. package/dist/swipeRow.js +0 -15
  143. package/dist/tabBarRoutes.js +0 -4
  144. package/dist/tabIndicator.js +0 -4
  145. package/dist/tailwind-preset.cjs +0 -54
  146. package/dist/tailwind-preset.d.cts +0 -8
  147. package/dist/theme.jsx +29 -21
  148. package/dist/themeModeStore.js +0 -5
  149. package/dist/toastChrome.js +0 -6
  150. package/dist/toastDrag.js +0 -14
  151. package/dist/toastStore.js +0 -4
  152. package/dist/updateCheck.js +0 -7
  153. package/dist/video/InlineVideo.jsx +0 -2
  154. package/dist/webview/htmlView.js +0 -5
  155. package/package.json +3 -3
  156. package/src/ArtifactList.tsx +0 -2
  157. package/src/Avatar.tsx +3 -3
  158. package/src/Badge.tsx +0 -1
  159. package/src/BottomSheetContainer.tsx +0 -11
  160. package/src/BulkActionBar.tsx +0 -66
  161. package/src/Button.tsx +4 -40
  162. package/src/CaptureButton.tsx +0 -1
  163. package/src/Card.tsx +3 -15
  164. package/src/Checkbox.tsx +0 -2
  165. package/src/ColorSwatches.tsx +0 -9
  166. package/src/ConfirmDialog.tsx +0 -7
  167. package/src/DateTimeField.tsx +0 -5
  168. package/src/Dialog.tsx +0 -27
  169. package/src/DividedList.tsx +0 -1
  170. package/src/DropdownMenu.tsx +0 -51
  171. package/src/EmptyState.tsx +0 -5
  172. package/src/ExpoWebRoot.tsx +0 -10
  173. package/src/Field.tsx +0 -14
  174. package/src/FloatingFAB.tsx +0 -3
  175. package/src/FloatingSurface.tsx +11 -8
  176. package/src/FloatingTabBar.tsx +0 -25
  177. package/src/IconButton.tsx +0 -5
  178. package/src/Input.tsx +0 -1
  179. package/src/Label.tsx +0 -1
  180. package/src/LabeledSwitchRow.tsx +0 -2
  181. package/src/ListRow.tsx +0 -12
  182. package/src/LoadingState.tsx +0 -12
  183. package/src/MenuSheet.tsx +0 -2
  184. package/src/PageIndicator.tsx +0 -2
  185. package/src/PageTitle.tsx +0 -15
  186. package/src/Pager.tsx +0 -9
  187. package/src/PasswordInput.tsx +0 -24
  188. package/src/PillTabs.tsx +3 -11
  189. package/src/PinnedBotTile.tsx +0 -6
  190. package/src/Progress.tsx +0 -3
  191. package/src/ReactionRow.tsx +0 -8
  192. package/src/ScreenContainer.tsx +0 -4
  193. package/src/SearchInput.tsx +0 -25
  194. package/src/SectionLabel.tsx +0 -2
  195. package/src/Select.tsx +0 -6
  196. package/src/Separator.tsx +0 -2
  197. package/src/SharedTransition.tsx +0 -7
  198. package/src/Sheet.tsx +0 -3
  199. package/src/SheetRow.tsx +0 -12
  200. package/src/Skeleton.tsx +0 -10
  201. package/src/Spinner.tsx +0 -6
  202. package/src/StackPageHeader.tsx +0 -16
  203. package/src/StatGrid.tsx +0 -1
  204. package/src/StatusDot.tsx +0 -6
  205. package/src/SurfaceRow.tsx +0 -12
  206. package/src/SwipeableRow.tsx +0 -4
  207. package/src/Switch.tsx +3 -4
  208. package/src/Tabs.tsx +3 -27
  209. package/src/Textarea.tsx +0 -2
  210. package/src/ThemeToggle.tsx +0 -1
  211. package/src/Toast.tsx +3 -19
  212. package/src/UpdateChecker.tsx +0 -46
  213. package/src/ai/activity-question.tsx +0 -8
  214. package/src/ai/activity-step-detail.tsx +0 -5
  215. package/src/ai/activity-step-label.ts +0 -5
  216. package/src/ai/activity-step-types.ts +0 -24
  217. package/src/ai/activity-step.tsx +0 -4
  218. package/src/ai/activity-tasks-utils.ts +0 -13
  219. package/src/ai/activity-timeline.ts +0 -6
  220. package/src/ai/attachments.tsx +0 -13
  221. package/src/ai/chain-of-thought.tsx +0 -5
  222. package/src/ai/chat-jump-rail.tsx +0 -2
  223. package/src/ai/chat-text.ts +0 -1
  224. package/src/ai/chat-thread.tsx +0 -9
  225. package/src/ai/choice-question.tsx +0 -36
  226. package/src/ai/code-block.tsx +0 -52
  227. package/src/ai/collapsible.tsx +0 -12
  228. package/src/ai/conversation-context.ts +0 -14
  229. package/src/ai/conversation.tsx +0 -58
  230. package/src/ai/file-chip.tsx +0 -1
  231. package/src/ai/icon-button.tsx +0 -17
  232. package/src/ai/index.ts +0 -5
  233. package/src/ai/message-action-sheet.tsx +0 -8
  234. package/src/ai/message-context-menu.tsx +0 -22
  235. package/src/ai/message-quote.tsx +0 -4
  236. package/src/ai/message.tsx +0 -66
  237. package/src/ai/prompt-input-menu.tsx +0 -19
  238. package/src/ai/prompt-input.tsx +0 -97
  239. package/src/ai/reasoning.tsx +0 -6
  240. package/src/ai/reply-quote-chip.tsx +0 -5
  241. package/src/ai/response-text.tsx +0 -8
  242. package/src/ai/shimmer.tsx +0 -2
  243. package/src/ai/sources.tsx +0 -3
  244. package/src/ai/subagent-cards.tsx +0 -13
  245. package/src/ai/suggestion.tsx +0 -4
  246. package/src/ai/tool-approval-card.tsx +0 -14
  247. package/src/ai/trace.tsx +0 -23
  248. package/src/ai/unified-diff.tsx +0 -16
  249. package/src/ai/use-streaming-disclosure.ts +0 -4
  250. package/src/app-root/AuthGroupGate.tsx +0 -8
  251. package/src/app-root/SsoCallbackScreen.tsx +0 -10
  252. package/src/app-root/fonts.ts +0 -2
  253. package/src/auth/AccountScreens.tsx +0 -16
  254. package/src/auth/AuthProviders.tsx +0 -13
  255. package/src/auth/AuthScreen.tsx +0 -12
  256. package/src/auth/GoogleSignInButton.tsx +0 -12
  257. package/src/auth/SecondFactorScreen.tsx +0 -16
  258. package/src/auth/SignInScreen.tsx +0 -68
  259. package/src/auth/authErrors.ts +0 -6
  260. package/src/auth/clerkCore3.ts +0 -6
  261. package/src/auth/index.ts +0 -4
  262. package/src/auth/totp.ts +0 -13
  263. package/src/brand/AppIcons.tsx +0 -6
  264. package/src/brand/AppMark.tsx +0 -5
  265. package/src/brand/AppWordmark.tsx +0 -7
  266. package/src/brand/GoogleMark.tsx +0 -4
  267. package/src/brand/ProviderIcon.tsx +0 -6
  268. package/src/brand/familyApps.ts +0 -2
  269. package/src/brand/index.ts +0 -3
  270. package/src/brand/svg.ts +0 -9
  271. package/src/configureTheme.ts +0 -10
  272. package/src/controlStyles.ts +0 -12
  273. package/src/crash/LastCrashDialog.tsx +0 -6
  274. package/src/crash/lastCrash.ts +0 -21
  275. package/src/entries/ai.ts +0 -3
  276. package/src/entries/ambient.ts +0 -2
  277. package/src/entries/app-root.ts +0 -5
  278. package/src/entries/auth.ts +0 -4
  279. package/src/entries/bottom-sheet.ts +0 -2
  280. package/src/entries/brand.ts +0 -1
  281. package/src/entries/button.ts +0 -1
  282. package/src/entries/crash.ts +0 -3
  283. package/src/entries/date-time.ts +0 -2
  284. package/src/entries/expo-router.ts +0 -3
  285. package/src/entries/expo-web-root.ts +0 -2
  286. package/src/entries/floating.ts +0 -2
  287. package/src/entries/generative-ui.ts +0 -4
  288. package/src/entries/gesture-handler.ts +0 -3
  289. package/src/entries/keyboard-controller.ts +0 -3
  290. package/src/entries/layout.ts +0 -2
  291. package/src/entries/markdown.ts +0 -3
  292. package/src/entries/marketing.ts +0 -1
  293. package/src/entries/page-title.ts +0 -5
  294. package/src/entries/password-input.ts +0 -2
  295. package/src/entries/paste-input.ts +0 -3
  296. package/src/entries/primitives.ts +0 -6
  297. package/src/entries/search-input.ts +0 -2
  298. package/src/entries/tab-bar.ts +0 -2
  299. package/src/entries/theme.ts +2 -2
  300. package/src/entries/toast.ts +0 -3
  301. package/src/entries/video.ts +0 -2
  302. package/src/entries/webview.ts +0 -2
  303. package/src/examples/AiChatGallery.tsx +0 -11
  304. package/src/examples/ParityGallery.tsx +0 -25
  305. package/src/floating.ts +0 -6
  306. package/src/generative-ui/GenerativeUiPanel.tsx +0 -15
  307. package/src/generative-ui/components.tsx +0 -9
  308. package/src/generative-ui/context.ts +0 -2
  309. package/src/glass.ts +31 -0
  310. package/src/glassBlur.tsx +0 -15
  311. package/src/highlight.ts +0 -20
  312. package/src/index.ts +2 -2
  313. package/src/loadingGrid.ts +0 -12
  314. package/src/markdown/Markdown.tsx +0 -71
  315. package/src/markdown/MarkdownTable.tsx +0 -23
  316. package/src/markdown/tableText.ts +0 -3
  317. package/src/marketing/PricingModal.tsx +0 -13
  318. package/src/marketing/UpgradeToProCard.tsx +0 -14
  319. package/src/marketing/pricing.ts +0 -12
  320. package/src/media/ImageGallery.tsx +0 -18
  321. package/src/media/MediaCard.tsx +0 -8
  322. package/src/media/imageZoom.ts +0 -4
  323. package/src/media/zoom-image-gesture.tsx +0 -9
  324. package/src/media/zoomImage.ts +0 -5
  325. package/src/motion.ts +0 -3
  326. package/src/neutralTheme.ts +0 -3
  327. package/src/pagerSwipe.ts +0 -13
  328. package/src/palette.ts +0 -10
  329. package/src/pressScale.ts +0 -7
  330. package/src/primitives/button.tsx +0 -4
  331. package/src/primitives/card.tsx +0 -1
  332. package/src/primitives/input.tsx +0 -4
  333. package/src/primitives/keyboard-controller.tsx +0 -25
  334. package/src/primitives/keyboard-parts.tsx +0 -27
  335. package/src/primitives/native-only-animated-view.tsx +0 -5
  336. package/src/primitives/overlay.tsx +0 -25
  337. package/src/primitives/pager-gesture.tsx +0 -20
  338. package/src/primitives/paste-input.tsx +0 -4
  339. package/src/primitives/paste-parts.tsx +0 -1
  340. package/src/primitives/select.tsx +0 -16
  341. package/src/primitives/sheet-drag.tsx +0 -19
  342. package/src/primitives/sheet-gesture.tsx +0 -22
  343. package/src/primitives/swipe-row-gesture.tsx +0 -33
  344. package/src/primitives/switch.tsx +0 -4
  345. package/src/primitives/text.tsx +0 -4
  346. package/src/primitives/toast-drag-gesture.tsx +0 -13
  347. package/src/primitives/web-click-guard.ts +0 -2
  348. package/src/primitives/window-layer.tsx +0 -18
  349. package/src/push.ts +0 -15
  350. package/src/relativeTime.ts +0 -21
  351. package/src/router/RouterStackPageHeader.tsx +0 -1
  352. package/src/settings/MoreFromProjectV.tsx +0 -8
  353. package/src/settings/SettingsEmptyState.tsx +0 -2
  354. package/src/settings/SettingsSection.tsx +0 -3
  355. package/src/settings/SettingsToggleRow.tsx +0 -4
  356. package/src/settings/ThemeModePicker.tsx +0 -11
  357. package/src/settings/projectVMobileApps.ts +0 -8
  358. package/src/sheetDrag.ts +0 -9
  359. package/src/swipeRow.ts +0 -23
  360. package/src/tabBarRoutes.ts +0 -13
  361. package/src/tabIndicator.ts +0 -5
  362. package/src/tailwind-preset.cjs +0 -54
  363. package/src/tailwind-preset.d.cts +0 -8
  364. package/src/theme.tsx +11 -2
  365. package/src/themeModeStore.ts +0 -9
  366. package/src/toastChrome.ts +0 -6
  367. package/src/toastDrag.ts +0 -13
  368. package/src/toastStore.ts +0 -7
  369. package/src/updateCheck.ts +0 -15
  370. package/src/video/InlineVideo.tsx +0 -5
  371. package/src/webview/HtmlView.tsx +0 -23
  372. package/src/webview/HtmlView.web.tsx +0 -1
  373. package/src/webview/htmlView.ts +0 -5
@@ -33,7 +33,6 @@ export function SettingsSection({
33
33
  <View className="flex-row items-start justify-between gap-4 px-4">
34
34
  <View className="min-w-0 flex-1">
35
35
  {typeof title === "string" ? (
36
- // Web `text-sm font-medium`: 14 / 20, 600.
37
36
  <Text
38
37
  accessibilityRole="header"
39
38
  className="text-sm font-instrument-sans-medium"
@@ -46,7 +45,6 @@ export function SettingsSection({
46
45
  )}
47
46
  {description != null ? (
48
47
  typeof description === "string" ? (
49
- // Web `text-sm leading-relaxed`: 14 / 22.75, muted.
50
48
  <Text
51
49
  className="mt-0.5 text-sm leading-relaxed font-instrument-sans"
52
50
  style={[textStyle("muted", scheme), relaxedSizeStyle("text-sm")]}
@@ -62,7 +60,6 @@ export function SettingsSection({
62
60
  </View>
63
61
 
64
62
  {hasCard ? (
65
- // The web section card (`rounded-lg bg-surface-card`): flat, no shadow.
66
63
  <View className="overflow-hidden" style={cardStyle(scheme)}>
67
64
  {hasBody ? (
68
65
  <View
@@ -28,12 +28,9 @@ export function SettingsToggleRow({
28
28
  title: React.ReactNode;
29
29
  description?: React.ReactNode;
30
30
  action: React.ReactNode;
31
- /** The switch state, for the row's `switch` role. */
32
31
  checked?: boolean;
33
- /** Makes the whole row toggle `checked`. */
34
32
  onCheckedChange?: (checked: boolean) => void;
35
33
  disabled?: boolean;
36
- /** The row's name when `title` is not a string. */
37
34
  accessibilityLabel?: string;
38
35
  className?: string;
39
36
  }) {
@@ -70,7 +67,6 @@ export function SettingsToggleRow({
70
67
  <View
71
68
  className="shrink-0 items-center justify-center"
72
69
  style={{ minHeight: MIN_TOUCH_TARGET }}
73
- // The row is the accessible switch, so the one inside is hidden from assistive tech.
74
70
  accessibilityElementsHidden={onCheckedChange != null}
75
71
  importantForAccessibility={onCheckedChange ? "no-hide-descendants" : "auto"}
76
72
  >
@@ -13,10 +13,7 @@ export { THEME_MODES, type ThemeMode };
13
13
 
14
14
  const LABELS: Record<ThemeMode, string> = { light: "Light", neutral: "Neutral", dark: "Dark", system: "System" };
15
15
  const ICONS = { light: IconSun, neutral: IconCircleHalf, dark: IconMoon, system: IconDeviceDesktop };
16
- /** Web `bg-zinc-900`. */
17
16
  const ZINC_900 = "#18181b";
18
- // Swatches and icons show the theme itself, so they use the web's fixed colours, not tokens.
19
- // System has no swatch colour (it is a hard split) and a muted icon.
20
17
  const SWATCHES: Record<ThemeMode, string | null> = {
21
18
  light: "#ffffff",
22
19
  neutral: "#3f3f46",
@@ -31,20 +28,15 @@ const ICON_COLOURS: Record<ThemeMode, string | null> = {
31
28
  };
32
29
 
33
30
  export type ThemeModePickerProps = {
34
- /** The stored choice, not the resolved scheme. */
35
31
  value: string | undefined;
36
32
  onChange: (mode: ThemeMode) => void;
37
- /** Themes to show, in order. Default `THEME_MODES`. */
38
33
  modes?: readonly ThemeMode[];
39
34
  className?: string;
40
- /** Each tile gets `${testID}-${mode}`. */
41
35
  testID?: string;
42
36
  };
43
37
 
44
- /** The System swatch: white with a hard diagonal half in zinc-900, no gradient. */
45
38
  function SplitSwatch() {
46
39
  return (
47
- // Sized by props: an unsized Svg is 300 wide and widens the tile.
48
40
  <Svg width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none" style={StyleSheet.absoluteFill}>
49
41
  <Rect width="1" height="1" fill="#ffffff" />
50
42
  <Path d="M1 0 L1 1 L0 1 Z" fill={ZINC_900} />
@@ -89,12 +81,10 @@ export function ThemeModePicker({ value, onChange, modes = THEME_MODES, classNam
89
81
  style={swatch ? { backgroundColor: swatch } : undefined}
90
82
  >
91
83
  {swatch ? null : <SplitSwatch />}
92
- {/* Positioned, so the web build paints it over the positioned swatch. */}
93
84
  <View className="absolute inset-0 items-center justify-center">
94
85
  <Icon size={22} color={ICON_COLOURS[mode] ?? tokens.color.muted[scheme]} />
95
86
  </View>
96
87
  </View>
97
- {/* After the swatch, so it draws over the swatch corner. */}
98
88
  {active ? (
99
89
  <View
100
90
  className="absolute right-2 top-2 h-4 w-4 items-center justify-center rounded-full"
@@ -103,7 +93,6 @@ export function ThemeModePicker({ value, onChange, modes = THEME_MODES, classNam
103
93
  <IconCheck size={10} strokeWidth={3} color={palette.primaryForeground[scheme]} />
104
94
  </View>
105
95
  ) : null}
106
- {/* On a narrow phone at a large font scale, "Neutral" shrinks to fit, not wraps. */}
107
96
  <Text
108
97
  numberOfLines={1}
109
98
  adjustsFontSizeToFit
@@ -5,15 +5,10 @@ export type ProjectVMobileAppId = "vibot" | "verve" | "velth" | "vmem" | "vstore
5
5
 
6
6
  export type ProjectVMobileApp = {
7
7
  id: ProjectVMobileAppId;
8
- /** Display name. */
9
8
  name: string;
10
- /** One line for a settings row. */
11
9
  description: string;
12
- /** Android application id. */
13
10
  androidPackage: string;
14
- /** The app's URL scheme, without `://`. */
15
11
  scheme: string;
16
- /** Home page of the app: the fallback when neither the app nor V Store is installed. */
17
12
  website: string;
18
13
  };
19
14
 
@@ -24,8 +19,6 @@ export type ProjectVMobileApp = {
24
19
  */
25
20
  export const VSTORE_HOME_URL = "vstore://";
26
21
 
27
- // Names and sites come from `FAMILY_APPS` where it has the app. V Store is not
28
- // a family app there (that file is a byte-identical copy of `@vvedantb/ui`).
29
22
  const vibot = familyApp("vibot");
30
23
  const verve = familyApp("verve");
31
24
  const velth = familyApp("velth");
@@ -138,7 +131,6 @@ export async function openProjectVApp(
138
131
  await linking.openURL(step.url);
139
132
  return step.target;
140
133
  } catch {
141
- // Not installed, or no handler: try the next URL.
142
134
  }
143
135
  }
144
136
  return null;
package/src/sheetDrag.ts CHANGED
@@ -1,14 +1,5 @@
1
- /**
2
- * The rules of a bottom sheet's drag to dismiss, as plain numbers, so they
3
- * stay testable apart from the gesture. Distances are in points, `vy` in
4
- * points per millisecond (the React Native `PanResponder` unit). Each is a
5
- * worklet, so the Gesture Handler drag runs them on the UI thread.
6
- */
7
-
8
- /** How far ahead (ms) the release velocity carries the sheet when deciding to close. */
9
1
  const PROJECTION_MS = 200;
10
2
 
11
- /** A flick down at this speed (pt/ms, so 1000 pt/s) closes the sheet however short the drag. */
12
3
  const FLICK_VELOCITY = 1;
13
4
 
14
5
  /** How far an upward pull may lift the sheet: less than the corner radius hidden below the screen. */
package/src/swipeRow.ts CHANGED
@@ -1,32 +1,13 @@
1
1
  import type { IconProps } from "@tabler/icons-react-native";
2
2
  import type { ComponentType } from "react";
3
3
 
4
- /**
5
- * The rules of a swipeable list row (`SwipeableRow`), as plain numbers, so
6
- * they stay testable apart from the gesture. The offset is in points:
7
- * positive when the row moves right (it reveals the leading actions),
8
- * negative when it moves left (the trailing actions). Velocities are in
9
- * points per second, the Gesture Handler unit. Each rule is a worklet, so the
10
- * drag runs it on the UI thread.
11
- */
12
-
13
4
  /** One action a swipe reveals behind a row. */
14
5
  export type SwipeAction = {
15
- /** Unique in the row; also the accessibility action name. */
16
6
  key: string;
17
- /** What the action does ("Archive"): the accessibility label of its button and of its row action. */
18
7
  label: string;
19
- /** A Tabler icon, drawn in the tone's foreground. */
20
8
  icon: ComponentType<IconProps>;
21
- /** The fill: `default` the primary fill, `warning` (such as Archive), `danger` for a destructive action. */
22
9
  tone?: "default" | "warning" | "danger";
23
- /**
24
- * Runs the action. With `exits`, a returned promise that settles while
25
- * the row is still on screen (it failed, or the row stays) brings the row
26
- * back.
27
- */
28
10
  onPress: () => void | Promise<unknown>;
29
- /** The action takes the row out of the list (Archive): a full swipe slides it out. Else the row springs back. */
30
11
  exits?: boolean;
31
12
  };
32
13
 
@@ -57,16 +38,13 @@ export function swipeRowActivation(
57
38
  if (!insidePager || (sides.leading > 0 && sides.trailing > 0)) {
58
39
  return { activeOffsetX: [-SWIPE_ACTIVE_OFFSET_X, SWIPE_ACTIVE_OFFSET_X] };
59
40
  }
60
- // Left (negative) reveals the trailing actions; right the leading ones.
61
41
  return sides.trailing > 0
62
42
  ? { activeOffsetX: -SWIPE_ACTIVE_OFFSET_X, failOffsetX: SWIPE_ACTIVE_OFFSET_X }
63
43
  : { activeOffsetX: SWIPE_ACTIVE_OFFSET_X, failOffsetX: -SWIPE_ACTIVE_OFFSET_X };
64
44
  }
65
45
 
66
- /** How far ahead (s) the release velocity carries the row when deciding where it settles. */
67
46
  const PROJECTION_S = 0.2;
68
47
 
69
- /** How far a row moves past its reach: less and less the further the finger goes. */
70
48
  function rubberband(overshoot: number): number {
71
49
  "worklet";
72
50
  const constant = 0.55;
@@ -116,7 +94,6 @@ export function swipeRowSettle(x: number, vx: number, sides: SwipeSides): SwipeS
116
94
  const side: SwipeSide = x > 0 ? "leading" : "trailing";
117
95
  const reveal = sides[side];
118
96
  if (reveal === 0) return { kind: "close" };
119
- // The projected travel toward this side: negative after a flick back past rest.
120
97
  const reach = Math.sign(x) * (x + vx * PROJECTION_S);
121
98
  if (Math.abs(x) > reveal && reach >= swipeFullAt(reveal, sides.width)) return { kind: "commit", side };
122
99
  if (reach > reveal / 2) return { kind: "open", side };
@@ -1,5 +1,3 @@
1
- // Which routes `FloatingTabBar` draws. No React Native runtime import, so the
2
- // tests can load this file.
3
1
  import type { ReactNode } from "react";
4
2
  import type { ColorValue, StyleProp, ViewStyle } from "react-native";
5
3
 
@@ -19,22 +17,11 @@ export type FloatingTabOptions = {
19
17
  tabBarInactiveTintColor?: ColorValue;
20
18
  tabBarButtonTestID?: string;
21
19
  tabBarAccessibilityLabel?: string;
22
- /** Expo Router's `href`. `null` hides the tab. */
23
20
  href?: string | null;
24
- /** Only `display: "none"` is read: it hides the tab, as in React Navigation's own bar. */
25
21
  tabBarItemStyle?: StyleProp<ViewStyle>;
26
- /**
27
- * Only `display: "none"` is read: on the focused route it hides the whole
28
- * bar, as in React Navigation's own bar (for example while a screen is in
29
- * select mode and shows its `BulkActionBar` in the bar's place). Typed
30
- * loosely: Expo Router's own type is an animated style, each member of
31
- * which is an object, a falsy value or `void` (a mapped animated field).
32
- * `displayOf` reads only `display`.
33
- */
34
22
  tabBarStyle?: object | false | "" | null | void;
35
23
  };
36
24
 
37
- /** The `display` a style resolves to: in an array the last one set wins, as in `StyleSheet.flatten`. */
38
25
  function displayOf(style: unknown): unknown {
39
26
  if (Array.isArray(style)) {
40
27
  let display: unknown;
@@ -3,9 +3,6 @@ import { useState } from "react";
3
3
  import type { LayoutChangeEvent } from "react-native";
4
4
  import Animated, { interpolate, interpolateColor, useAnimatedStyle, type SharedValue } from "react-native-reanimated";
5
5
 
6
- // The tab labels are `Animated.Text`s (their colour follows `progress`).
7
- // NativeWind maps `className` only for components it knows, so it is told
8
- // about this one, or the labels lose their font and size classes.
9
6
  cssInterop(Animated.Text, { className: "style" });
10
7
 
11
8
  /** A tab's box in its row, from its layout. */
@@ -21,7 +18,6 @@ export type TabBox = { x: number; y: number; width: number; height: number };
21
18
  * measured (with or without `progress`), else empty.
22
19
  */
23
20
  export function useTabIndicator(progress: SharedValue<number> | undefined, count: number) {
24
- // Each tab's box, measured on layout (not per frame).
25
21
  const [layouts, setLayouts] = useState<ReadonlyArray<TabBox | undefined>>([]);
26
22
  const found = layouts.slice(0, count).filter((box) => box !== undefined);
27
23
  const boxes = found.length === count ? found : [];
@@ -40,7 +36,6 @@ export function useTabIndicator(progress: SharedValue<number> | undefined, count
40
36
  transform: [{ translateX: at((box) => box.x) }],
41
37
  };
42
38
  });
43
- /** The `onLayout` of tab `index`. */
44
39
  const onLayout = (index: number) => (event: LayoutChangeEvent) => {
45
40
  const box = event.nativeEvent.layout;
46
41
  setLayouts((current) => {
@@ -1,41 +1,12 @@
1
- /**
2
- * `@vvedantb/native-ui/tailwind-preset`: the NativeWind / Tailwind preset the
3
- * Expo apps share. CommonJS, because `tailwind.config.js` `require`s it and
4
- * Tailwind loads it outside Metro.
5
- *
6
- * const { nativeUiPreset, nativeUiContent } = require("@vvedantb/native-ui/tailwind-preset");
7
- * module.exports = {
8
- * content: ["./app/**\/*.{js,ts,tsx}", nativeUiContent()],
9
- * presets: [nativeUiPreset()],
10
- * };
11
- *
12
- * It nests `nativewind/preset`, so callers pass only this one. It sets
13
- * `darkMode`, the `font-instrument-sans*` font classes (Instrument Sans unless
14
- * `font` names other families), the colour keys native-ui
15
- * classes use, `borderWidth.hairline` and, when asked, `borderRadius` from
16
- * `--radius`.
17
- * App colours, display fonts, keyframes and font-weight plugins stay in the
18
- * app config.
19
- *
20
- * `color` maps a CSS variable name (without `--`) to a Tailwind colour, as the
21
- * web `tokensPreset({ color })` of `@vvedantb/ui`. With `injectCssVariables`,
22
- * the preset also writes those variables (light and dark) from `tokens.ts` and
23
- * `palette.ts`, as space-separated RGB channels, and the default `color` is
24
- * `rgbAlpha`.
25
- */
26
1
  "use strict";
27
2
 
28
3
  const fs = require("node:fs");
29
4
  const path = require("node:path");
30
5
 
31
- /** `var(--name)`. */
32
6
  const cssVar = (name) => `var(--${name})`;
33
- /** `hsl(var(--name))`, for variables that hold `h s% l%` channels. */
34
7
  const hslVar = (name) => `hsl(var(--${name}))`;
35
- /** `rgb(var(--name) / <alpha-value>)`, for variables that hold `r g b` channels. Keeps opacity modifiers. */
36
8
  const rgbAlpha = (name) => `rgb(var(--${name}) / <alpha-value>)`;
37
9
 
38
- /** The default families of the four font classes, as `fontFamily` in `typography.ts`. */
39
10
  const INSTRUMENT_SANS = {
40
11
  regular: "InstrumentSans_400Regular",
41
12
  medium: "InstrumentSans_500Medium",
@@ -43,16 +14,10 @@ const INSTRUMENT_SANS = {
43
14
  bold: "InstrumentSans_700Bold",
44
15
  };
45
16
 
46
- /** The glob Tailwind scans for native-ui class names: this package's `src`, at its real path (pnpm symlinks resolve). */
47
17
  function nativeUiContent() {
48
18
  return path.join(__dirname, "**/*.{js,ts,tsx}").split(path.sep).join("/");
49
19
  }
50
20
 
51
- /**
52
- * Reads one `export const name = { … } as const;` object from a sibling
53
- * `.ts` file. Plain object literals only, so no TypeScript loader is needed:
54
- * `tokens.ts` and `palette.ts` stay the single source of the colours.
55
- */
56
21
  function readConst(file, name) {
57
22
  const source = fs.readFileSync(path.join(__dirname, file), "utf8");
58
23
  const match = source.match(new RegExp(`export const ${name} = (\\{[\\s\\S]*?\\n\\}) as const;`));
@@ -62,7 +27,6 @@ function readConst(file, name) {
62
27
 
63
28
  let cachedSchemeColors = null;
64
29
 
65
- /** CSS variable name → `{ light, dark }` hex, from `tokens.ts` and `palette.ts`. */
66
30
  function schemeColors() {
67
31
  if (cachedSchemeColors) return cachedSchemeColors;
68
32
  const tokens = readConst("tokens.ts", "tokens");
@@ -110,25 +74,21 @@ function schemeColors() {
110
74
  return cachedSchemeColors;
111
75
  }
112
76
 
113
- /** `#rrggbb` as `r g b`. */
114
77
  function channels(hex) {
115
78
  const n = Number.parseInt(hex.slice(1, 7), 16);
116
79
  return `${(n >> 16) & 255} ${(n >> 8) & 255} ${n & 255}`;
117
80
  }
118
81
 
119
- /** `--name: r g b` for every colour in one scheme. */
120
82
  function cssVariables(scheme) {
121
83
  return Object.fromEntries(
122
84
  Object.entries(schemeColors()).map(([name, value]) => [`--${name}`, channels(value[scheme])]),
123
85
  );
124
86
  }
125
87
 
126
- /** `--radius` from `tokens.radius.lg` (16), so `rounded-lg`, `-md` and `-sm` are 16, 14 and 12 as in `tokens.radius`. */
127
88
  function radiusVariable() {
128
89
  return { "--radius": `${readConst("tokens.ts", "tokens").radius.lg}px` };
129
90
  }
130
91
 
131
- /** The Tailwind colour keys native-ui classes and the apps share. */
132
92
  function themeColors(v) {
133
93
  return {
134
94
  background: v("background"),
@@ -160,7 +120,6 @@ function themeColors(v) {
160
120
  };
161
121
  }
162
122
 
163
- /** `nativewind/preset`, or none where NativeWind is not installed (this repository's tests). */
164
123
  function nestedPresets() {
165
124
  try {
166
125
  return [require("nativewind/preset")];
@@ -169,7 +128,6 @@ function nestedPresets() {
169
128
  }
170
129
  }
171
130
 
172
- /** `{ hairline: hairlineWidth() }` from `nativewind/theme`, or none without NativeWind. */
173
131
  function hairlineBorder() {
174
132
  try {
175
133
  const { hairlineWidth } = require("nativewind/theme");
@@ -179,7 +137,6 @@ function hairlineBorder() {
179
137
  }
180
138
  }
181
139
 
182
- /** A Tailwind plugin that writes the colour variables: `:root` (light) and the dark set for `darkMode`. */
183
140
  function cssVariablesPlugin(darkMode) {
184
141
  return function nativeUiCssVariables({ addBase }) {
185
142
  const dark = cssVariables("dark");
@@ -197,17 +154,6 @@ function cssVariablesPlugin(darkMode) {
197
154
  };
198
155
  }
199
156
 
200
- /**
201
- * The preset. Options:
202
- * - `darkMode`: `"class"` (default; `ThemeToggle` and `setColorScheme` need it) or `"media"`.
203
- * - `color`: CSS variable name → colour value. Default `cssVar`, or `rgbAlpha` with `injectCssVariables`.
204
- * - `injectCssVariables`: write the colour variables and `--radius` from `tokens.ts` and `palette.ts`. Default `false`.
205
- * - `radiusVariable`: `rounded-lg`, `-md` and `-sm` from `var(--radius)`, as vibot and Velth. Default: on with
206
- * `injectCssVariables`, else off, so an app without `--radius` keeps the Tailwind radii.
207
- * - `font`: `{ regular, medium, semibold, bold }` family names for `sans` and the four `font-instrument-sans*`
208
- * classes. Keys not given keep Instrument Sans. Pass the same names to `configureTheme({ font })`, which sets
209
- * the JS styles; the app loads the font files.
210
- */
211
157
  function nativeUiPreset(options = {}) {
212
158
  const darkMode = options.darkMode === "media" ? "media" : "class";
213
159
  const font = { ...INSTRUMENT_SANS };
@@ -6,18 +6,10 @@ type CssDeclarations = Record<string, string>;
6
6
  type AddBase = (base: Record<string, CssDeclarations | Record<string, CssDeclarations>>) => void;
7
7
 
8
8
  export interface NativeUiPresetOptions {
9
- /** Default `"class"`: `ThemeToggle` and NativeWind `setColorScheme` need it. */
10
9
  darkMode?: "class" | "media";
11
- /** Default `cssVar`, or `rgbAlpha` with `injectCssVariables`. */
12
10
  color?: ColorFn;
13
- /** Write the colour variables (as `r g b` channels) and `--radius` from `tokens.ts` and `palette.ts`. Default `false`. */
14
11
  injectCssVariables?: boolean;
15
- /** `rounded-lg`, `-md` and `-sm` from `var(--radius)`. Default: the value of `injectCssVariables`. */
16
12
  radiusVariable?: boolean;
17
- /**
18
- * Family names for `sans` and the four `font-instrument-sans*` classes. Keys not given keep Instrument Sans.
19
- * Pass the same names to `configureTheme({ font })`; the app loads the font files.
20
- */
21
13
  font?: { regular?: string; medium?: string; semibold?: string; bold?: string };
22
14
  }
23
15
 
package/src/theme.tsx CHANGED
@@ -5,29 +5,34 @@ import { ThemeVersionContext } from "./useScheme";
5
5
 
6
6
  export const DEFAULT_ACCENT = "#db2777";
7
7
 
8
+ export type NativeUiSurface = "glass" | "flat";
9
+
8
10
  export type NativeUiTheme = {
9
11
  largerText: boolean;
10
12
  accentColor: string;
13
+ surface: NativeUiSurface;
11
14
  };
12
15
 
13
16
  const NativeUiContext = createContext<NativeUiTheme>({
14
17
  largerText: false,
15
18
  accentColor: DEFAULT_ACCENT,
19
+ surface: "glass",
16
20
  });
17
21
 
18
22
  export function NativeUiProvider({
19
23
  largerText = false,
20
24
  accentColor = DEFAULT_ACCENT,
25
+ surface = "glass",
21
26
  children,
22
27
  }: {
23
28
  largerText?: boolean;
24
29
  accentColor?: string;
30
+ surface?: NativeUiSurface;
25
31
  children: ReactNode;
26
32
  }) {
27
- // Each `configureTheme` call redraws every part below that reads the scheme.
28
33
  const themeVersion = useSyncExternalStore(subscribeTheme, getThemeVersion, getThemeVersion);
29
34
  return (
30
- <NativeUiContext.Provider value={{ largerText, accentColor }}>
35
+ <NativeUiContext.Provider value={{ largerText, accentColor, surface }}>
31
36
  <ThemeVersionContext.Provider value={themeVersion}>{children}</ThemeVersionContext.Provider>
32
37
  </NativeUiContext.Provider>
33
38
  );
@@ -41,6 +46,10 @@ export function useLargerText() {
41
46
  return useContext(NativeUiContext).largerText;
42
47
  }
43
48
 
49
+ export function useSurface() {
50
+ return useContext(NativeUiContext).surface;
51
+ }
52
+
44
53
  export function useAccentColor() {
45
54
  return useContext(NativeUiContext).accentColor;
46
55
  }
@@ -10,22 +10,16 @@ export type ThemeModeStorage = {
10
10
  };
11
11
 
12
12
  export type ThemeModeStoreOptions = {
13
- /** The storage key. Keep the app's existing key so a saved pick survives the update. */
14
13
  key: string;
15
14
  storage: ThemeModeStorage;
16
- /** Called when a read or write of `storage` fails. Without it the failure is ignored. */
17
15
  onError?: (error: Error) => void;
18
16
  };
19
17
 
20
18
  export type ThemeModeStore = {
21
- /** The current mode, "system" included (NativeWind reports only the resolved scheme). */
22
19
  getMode: () => ThemeMode;
23
20
  subscribe: (listener: () => void) => () => void;
24
- /** Reads the saved mode and paints it. A pick made before the read ends wins. Never rejects. */
25
21
  restore: () => Promise<void>;
26
- /** Paints `mode` at once and saves it. */
27
22
  set: (mode: ThemeMode) => void;
28
- /** React hook for the current mode. */
29
23
  useMode: () => ThemeMode;
30
24
  };
31
25
 
@@ -40,12 +34,10 @@ function toError(error: Error | string | number | boolean | object | null | unde
40
34
  */
41
35
  export function createThemeModeStore({ key, storage, onError }: ThemeModeStoreOptions): ThemeModeStore {
42
36
  let current: ThemeMode = "system";
43
- /** True once the user picked a mode: a slow restore must not undo it. */
44
37
  let chosen = false;
45
38
  const listeners = new Set<() => void>();
46
39
  const report = (error: Error | string | number | boolean | object | null | undefined) => onError?.(toError(error));
47
40
 
48
- /** Paints `mode`. The dark slot goes first, so the scheme change redraws with it. */
49
41
  function apply(mode: ThemeMode) {
50
42
  current = mode;
51
43
  paintDarkFamily(mode === "neutral" ? "neutral" : "dark");
@@ -81,7 +73,6 @@ export function createThemeModeStore({ key, storage, onError }: ThemeModeStoreOp
81
73
  .catch(report);
82
74
  }
83
75
 
84
- /** Server render and hydration: the mode is always "system" until `restore` runs on the client. */
85
76
  const getServerSnapshot = (): ThemeMode => "system";
86
77
 
87
78
  return {
@@ -1,9 +1,3 @@
1
- /**
2
- * The `Toaster` look, from the web `SonnerToaster` at its default density
3
- * (`createToasterClassNames` in `sonner.tsx`) with `toastIcons="filled24"`
4
- * (`sonner-icons.tsx`). No React Native import, so the tests can load this
5
- * file.
6
- */
7
1
  import { palette, withAlpha } from "./palette";
8
2
  import { tokens } from "./tokens";
9
3
 
package/src/toastDrag.ts CHANGED
@@ -1,23 +1,12 @@
1
1
  import { createContext, type ComponentType, type ReactNode } from "react";
2
2
 
3
- /**
4
- * The rules of a toast's drag to dismiss, as plain numbers, so they stay
5
- * testable apart from the gesture. A toast enters down from the top edge, so
6
- * it leaves the same way: up. `dy` is the drag's travel in points (up
7
- * negative) and `vy` the finger's speed in points per second (the Gesture
8
- * Handler unit). Each rule is a worklet, so the drag runs it on the UI thread.
9
- */
10
-
11
3
  /** Vertical travel (pt) before a drag takes the toast: a tap still presses it. */
12
4
  export const TOAST_DRAG_ACTIVE_OFFSET_Y = 8;
13
5
 
14
- /** A flick up at this speed (pt/s) dismisses the toast, however short the drag. */
15
6
  const FLICK_VELOCITY = 500;
16
7
 
17
- /** How far ahead (s) the release velocity carries the toast when deciding to dismiss it. */
18
8
  const PROJECTION_S = 0.2;
19
9
 
20
- /** How far a downward pull may move the toast: it is already as low as it goes. */
21
10
  const DOWN_REACH = 24;
22
11
 
23
12
  /**
@@ -43,9 +32,7 @@ export function toastDragDismisses(dy: number, vy: number, height: number): bool
43
32
  }
44
33
 
45
34
  export type ToastDragProps = {
46
- /** The drag dismissed the toast: it has left the screen. */
47
35
  onDismiss: () => void;
48
- /** A finger is on the toast (`true`), or has lifted: the toast's timer pauses meanwhile. */
49
36
  onHoldChange: (held: boolean) => void;
50
37
  children: ReactNode;
51
38
  };
package/src/toastStore.ts CHANGED
@@ -1,15 +1,9 @@
1
- // Module-level toast queue behind `toast()` and `<Toaster />`. No React Native
2
- // imports, so it runs anywhere (tests, non-component code).
3
-
4
1
  export type ToastVariant = "default" | "success" | "error" | "warning" | "info" | "loading";
5
2
 
6
3
  export type ToastOptions = {
7
- /** Reuse an id to replace a toast in place, for example a `loading` toast with its result. */
8
4
  id?: string;
9
5
  description?: string;
10
- /** Milliseconds before it closes. Default 4000; `loading` stays until replaced or dismissed. `Infinity` keeps any toast open. */
11
6
  duration?: number;
12
- /** One text button. A press runs `onPress` and closes the toast. */
13
7
  action?: { label: string; onPress: () => void };
14
8
  };
15
9
 
@@ -77,7 +71,6 @@ export const toast = Object.assign(
77
71
  warning: (title: string, options?: ToastOptions) => show("warning", title, options),
78
72
  info: (title: string, options?: ToastOptions) => show("info", title, options),
79
73
  loading: (title: string, options?: ToastOptions) => show("loading", title, options),
80
- /** Closes one toast, or every toast without an id. */
81
74
  dismiss(id?: string) {
82
75
  toasts = id === undefined ? [] : toasts.filter((toast) => toast.id !== id);
83
76
  emit();
@@ -1,7 +1,3 @@
1
- // The update check behind `UpdateChecker`: for an app that ships its Android
2
- // APK as GitHub releases tagged `<tagPrefix><version>`, with no store and no
3
- // over-the-air updates. Plain functions, no React and no native module.
4
-
5
1
  /** A newer version to offer. `url` is what Download opens: the APK itself, else its release page. */
6
2
  export type AvailableUpdate = { version: string; url: string };
7
3
 
@@ -15,21 +11,17 @@ export type GitHubRelease = {
15
11
  };
16
12
 
17
13
  export type GitHubReleaseSource = {
18
- /** `"owner/name"` of a public repository. */
19
14
  repo: string;
20
- /** Tag prefix before the version, for example `"myapp-apk-"` for the tag `myapp-apk-1.2.3`. */
21
15
  tagPrefix: string;
22
16
  };
23
17
 
24
18
  type VersionParts = [number, number, number];
25
19
 
26
- /** `[major, minor, patch]` of "1.2.3", or null. */
27
20
  function parseVersion(version: string): VersionParts | null {
28
21
  const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
29
22
  return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;
30
23
  }
31
24
 
32
- /** Positive when `a` is newer than `b`. */
33
25
  function compareParts(a: VersionParts, b: VersionParts): number {
34
26
  return a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
35
27
  }
@@ -110,15 +102,8 @@ export async function fetchGitHubUpdate(
110
102
  export const V_STORE_SITE_URL = "https://blessed-porcupine-303.eu-west-1.convex.site";
111
103
 
112
104
  export type VStoreSource = {
113
- /** The app's Android package, as V Store lists it. */
114
105
  packageName: string;
115
- /**
116
- * What Download opens for a version: the APK, or its release page. Leave it
117
- * out when the APK has no public link (a private repository). Download is
118
- * then hidden, and "Install from V Store" is the one way to update.
119
- */
120
106
  downloadUrl?: (version: string) => string;
121
- /** Default `V_STORE_SITE_URL`. */
122
107
  siteUrl?: string;
123
108
  };
124
109
 
@@ -11,13 +11,9 @@ import { useScheme } from "../useScheme";
11
11
  export const INLINE_VIDEO_ASPECT = 16 / 9;
12
12
 
13
13
  export type InlineVideoProps = {
14
- /** An http(s) or local video URL. */
15
14
  url: string;
16
- /** Width over height of the box, fixed so nothing moves when the video loads. Default 16:9. */
17
15
  aspectRatio?: number;
18
- /** An image to show before playback. Without it the box is black with the play button. */
19
16
  posterUrl?: string;
20
- /** Names the play button. Default "Play video". */
21
17
  accessibilityLabel?: string;
22
18
  testID?: string;
23
19
  };
@@ -72,7 +68,6 @@ export function InlineVideo({ url, aspectRatio = INLINE_VIDEO_ASPECT, posterUrl,
72
68
  );
73
69
  }
74
70
 
75
- /** Mounted on the first press: one player per pressed video, released when the row unmounts. */
76
71
  function Player({ url }: { url: string }) {
77
72
  const player = useVideoPlayer(url, (created) => {
78
73
  created.loop = false;