@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
package/dist/toastDrag.js CHANGED
@@ -1,23 +1,9 @@
1
1
  import { createContext } 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
-
14
- /** A flick up at this speed (pt/s) dismisses the toast, however short the drag. */
15
5
  const FLICK_VELOCITY = 500;
16
-
17
- /** How far ahead (s) the release velocity carries the toast when deciding to dismiss it. */
18
6
  const PROJECTION_S = 0.2;
19
-
20
- /** How far a downward pull may move the toast: it is already as low as it goes. */
21
7
  const DOWN_REACH = 24;
22
8
 
23
9
  /**
@@ -1,6 +1,3 @@
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
  /** At most this many toasts show; the oldest drop first. */
5
2
  export const MAX_TOASTS = 3;
6
3
  export const DEFAULT_TOAST_DURATION = 4000;
@@ -46,7 +43,6 @@ export const toast = Object.assign((title, options) => show("default", title, op
46
43
  warning: (title, options) => show("warning", title, options),
47
44
  info: (title, options) => show("info", title, options),
48
45
  loading: (title, options) => show("loading", title, options),
49
- /** Closes one toast, or every toast without an id. */
50
46
  dismiss(id) {
51
47
  toasts = id === undefined ? [] : toasts.filter(toast => toast.id !== id);
52
48
  emit();
@@ -1,18 +1,11 @@
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
 
7
3
  /** The fields of a GitHub release the check reads (`GET /repos/{owner}/{repo}/releases`). */
8
4
 
9
- /** `[major, minor, patch]` of "1.2.3", or null. */
10
5
  function parseVersion(version) {
11
6
  const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
12
7
  return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;
13
8
  }
14
-
15
- /** Positive when `a` is newer than `b`. */
16
9
  function compareParts(a, b) {
17
10
  return a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
18
11
  }
@@ -82,8 +82,6 @@ export function InlineVideo(t0) {
82
82
  }
83
83
  return t6;
84
84
  }
85
-
86
- /** Mounted on the first press: one player per pressed video, released when the row unmounts. */
87
85
  function Player(t0) {
88
86
  const $ = _c(3);
89
87
  const {
@@ -1,8 +1,3 @@
1
- /**
2
- * The pure half of `HtmlView`: which navigations the page may make, and the
3
- * script that reports the page's height to the app.
4
- */
5
-
6
1
  /** What `HtmlView` does with a navigation: let it load, hand it to `onOpenLink`, or drop it. */
7
2
 
8
3
  /**
package/package.json CHANGED
@@ -1,16 +1,15 @@
1
1
  {
2
2
  "name": "@vvedantb/native-ui",
3
- "version": "0.37.2",
3
+ "version": "0.39.0",
4
4
  "license": "MIT",
5
- "description": "Shared React Native / Expo UI primitives. Floating surfaces, forms, overlays, toasts, settings chrome, tab bar, AI chat parts, the family app marks, a NativeWind preset, the Expo web root and Clerk + Convex auth screens.",
5
+ "description": "Shared React Native / Expo UI primitives. Floating surfaces, forms, overlays, toasts, settings chrome, tab bar, AI chat parts, the family app marks, a NativeWind preset, the Expo web root, the app root shell helpers and Clerk + Convex auth screens.",
6
6
  "type": "module",
7
7
  "publishConfig": {
8
- "access": "public",
9
- "provenance": true
8
+ "access": "public"
10
9
  },
11
10
  "repository": {
12
11
  "type": "git",
13
- "url": "git+https://github.com/vvedantb/packages.git",
12
+ "url": "git+https://github.com/vvedantb/v.git",
14
13
  "directory": "packages/native-ui"
15
14
  },
16
15
  "exports": {
@@ -124,6 +123,11 @@
124
123
  "source": "./src/entries/date-time.ts",
125
124
  "default": "./dist/entries/date-time.js"
126
125
  },
126
+ "./crash": {
127
+ "types": "./src/entries/crash.ts",
128
+ "source": "./src/entries/crash.ts",
129
+ "default": "./dist/entries/crash.js"
130
+ },
127
131
  "./ai": {
128
132
  "types": "./src/entries/ai.ts",
129
133
  "source": "./src/entries/ai.ts",
@@ -174,6 +178,11 @@
174
178
  "source": "./src/entries/expo-web-root.ts",
175
179
  "default": "./dist/entries/expo-web-root.js"
176
180
  },
181
+ "./app-root": {
182
+ "types": "./src/entries/app-root.ts",
183
+ "source": "./src/entries/app-root.ts",
184
+ "default": "./dist/entries/app-root.js"
185
+ },
177
186
  "./tailwind-preset": {
178
187
  "types": "./src/tailwind-preset.d.cts",
179
188
  "require": "./src/tailwind-preset.cjs",
@@ -185,12 +194,14 @@
185
194
  "files": [
186
195
  "dist",
187
196
  "src",
197
+ "types/prism-react-renderer.d.ts",
188
198
  "LICENSE"
189
199
  ],
190
200
  "sideEffects": false,
191
201
  "peerDependencies": {
192
202
  "expo-paste-input": ">=0.2.0",
193
203
  "@clerk/expo": ">=4.16.0",
204
+ "@expo-google-fonts/instrument-sans": "*",
194
205
  "@expo/vector-icons": "*",
195
206
  "@json-render/core": ">=0.21.0",
196
207
  "@json-render/react-native": ">=0.21.0",
@@ -199,8 +210,8 @@
199
210
  "@rn-primitives/slot": "*",
200
211
  "@rn-primitives/switch": "*",
201
212
  "@swmansion/react-native-bottom-sheet": ">=1.1.0",
202
- "@tabler/icons-react-native": "*",
203
- "@vvedantb/server": ">=0.17.1",
213
+ "@tabler/icons-react-native": "^3.52.0",
214
+ "@vvedantb/server": ">=0.19.0",
204
215
  "class-variance-authority": ">=0.7.0",
205
216
  "clsx": ">=2.0.0",
206
217
  "convex": "*",
@@ -209,13 +220,15 @@
209
220
  "expo-blur": "*",
210
221
  "expo-constants": "*",
211
222
  "expo-device": "*",
223
+ "expo-font": "*",
212
224
  "expo-haptics": "*",
213
225
  "expo-linear-gradient": "*",
214
226
  "expo-notifications": "*",
215
227
  "expo-router": "*",
228
+ "expo-secure-store": "*",
229
+ "expo-splash-screen": "*",
216
230
  "expo-video": "*",
217
231
  "expo-web-browser": "*",
218
- "lucide-react-native": "*",
219
232
  "nativewind": ">=4.0.0",
220
233
  "prism-react-renderer": ">=2.0.0",
221
234
  "react": ">=19.0.0",
@@ -228,9 +241,18 @@
228
241
  "react-native-screens": "*",
229
242
  "react-native-svg": "*",
230
243
  "react-native-webview": "*",
231
- "tailwind-merge": ">=2.0.0"
244
+ "tailwind-merge": ">=3.0.0"
232
245
  },
233
246
  "peerDependenciesMeta": {
247
+ "@expo-google-fonts/instrument-sans": {
248
+ "optional": true
249
+ },
250
+ "expo-font": {
251
+ "optional": true
252
+ },
253
+ "expo-splash-screen": {
254
+ "optional": true
255
+ },
234
256
  "expo-paste-input": {
235
257
  "optional": true
236
258
  },
@@ -282,6 +304,9 @@
282
304
  "expo-router": {
283
305
  "optional": true
284
306
  },
307
+ "expo-secure-store": {
308
+ "optional": true
309
+ },
285
310
  "expo-video": {
286
311
  "optional": true
287
312
  },
@@ -308,35 +333,38 @@
308
333
  }
309
334
  },
310
335
  "devDependencies": {
311
- "@babel/core": "^7.29.13",
312
- "@clerk/expo": "4.17.2",
336
+ "@babel/core": "7.29.13",
337
+ "@clerk/expo": "4.17.4",
338
+ "@expo-google-fonts/instrument-sans": "^0.4.2",
313
339
  "@react-native-community/datetimepicker": "9.2.1",
314
- "@types/react": "^19.1.0",
340
+ "@types/react": "19.3.0",
315
341
  "expo": "~58.0.26",
316
342
  "expo-auth-session": "~58.0.19",
317
343
  "expo-blur": "~58.0.6",
318
344
  "expo-constants": "~58.0.16",
319
345
  "expo-device": "~58.0.5",
346
+ "expo-font": "~58.0.12",
320
347
  "expo-haptics": "~58.0.8",
321
348
  "expo-linear-gradient": "~58.0.4",
322
349
  "expo-notifications": "~58.1.9",
323
350
  "expo-router": "~58.0.32",
351
+ "expo-splash-screen": "~58.0.14",
324
352
  "expo-video": "~58.0.14",
325
353
  "expo-web-browser": "~58.1.0",
326
- "happy-dom": "18.0.1",
327
- "react": "^19.1.0",
354
+ "happy-dom": "21.0.4",
355
+ "react": "19.3.0",
328
356
  "react-native": "0.88.1",
329
- "react-native-gesture-handler": "~3.3.0",
357
+ "react-native-gesture-handler": "3.3.0",
330
358
  "react-native-keyboard-controller": "1.22.7",
331
359
  "react-native-reanimated": "4.8.0",
332
- "react-native-safe-area-context": "~5.11.1",
333
- "react-native-screens": "~4.30.1",
360
+ "react-native-safe-area-context": "5.11.1",
361
+ "react-native-screens": "4.30.1",
334
362
  "react-native-svg": "15.16.0",
335
363
  "react-native-webview": "14.0.1",
336
364
  "react-native-worklets": "0.14.0",
337
365
  "typescript": "7.0.2",
338
- "vitest": "^3.2.0",
339
- "@vvedantb/server": "0.17.1"
366
+ "vitest": "5.1.1",
367
+ "@vvedantb/server": "0.19.0"
340
368
  },
341
369
  "scripts": {
342
370
  "build": "node scripts/build-dist.mjs && node scripts/check-exports.mjs",
@@ -7,9 +7,7 @@ export type ArtifactRow = { id: string; title: string; description?: string };
7
7
 
8
8
  export type ArtifactListProps = {
9
9
  rows: ArtifactRow[];
10
- /** Called with the `id` of the pressed row. */
11
10
  onOpen: (id: string) => void;
12
- /** Shown when `rows` is empty, such as an `EmptyState`. Nothing without it. */
13
11
  empty?: ReactNode;
14
12
  className?: string;
15
13
  testID?: string;
package/src/Avatar.tsx CHANGED
@@ -16,6 +16,7 @@ import {
16
16
  } from "react-native";
17
17
  import { cn } from "./cn";
18
18
  import { typeStyle } from "./controlStyles";
19
+ import { useGlass } from "./glass";
19
20
  import { palette } from "./palette";
20
21
  import { tokens } from "./tokens";
21
22
  import { useScheme } from "./useScheme";
@@ -35,7 +36,6 @@ function useAvatar(part: string) {
35
36
  }
36
37
 
37
38
  export type AvatarProps = ViewProps & {
38
- /** Diameter in points. Default 40 (the web `h-10 w-10`). */
39
39
  size?: number;
40
40
  className?: string;
41
41
  };
@@ -43,6 +43,7 @@ export type AvatarProps = ViewProps & {
43
43
  /** Round frame for `AvatarImage` and `AvatarFallback`, as the web `Avatar`. The fallback shows until the image loads, and stays if it fails. */
44
44
  export function Avatar({ size = 40, className, style, children, ...props }: AvatarProps) {
45
45
  const scheme = useScheme();
46
+ const glass = useGlass("small");
46
47
  const [status, setStatus] = useState<ImageStatus>("idle");
47
48
  return (
48
49
  <AvatarContext.Provider value={{ size, status, setStatus }}>
@@ -56,6 +57,7 @@ export function Avatar({ size = 40, className, style, children, ...props }: Avat
56
57
  borderColor: tokens.color.border[scheme],
57
58
  backgroundColor: tokens.color.surfaceSecondary[scheme],
58
59
  },
60
+ glass,
59
61
  style,
60
62
  ]}
61
63
  {...props}
@@ -72,7 +74,6 @@ export type AvatarImageProps = Omit<ImageProps, "style"> & {
72
74
 
73
75
  export function AvatarImage({ onLoad, onError, className, ...props }: AvatarImageProps) {
74
76
  const { status, setStatus } = useAvatar("AvatarImage");
75
- // A new source gets a fresh try: back to the fallback until it loads.
76
77
  const sourceKey = JSON.stringify(props.source);
77
78
  const previousSource = useRef(sourceKey);
78
79
  useEffect(() => {
@@ -100,7 +101,6 @@ export function AvatarImage({ onLoad, onError, className, ...props }: AvatarImag
100
101
  }
101
102
 
102
103
  export type AvatarFallbackProps = ViewProps & {
103
- /** Usually initials (see `initials()`). A string is centred in Instrument Sans at 40% of the avatar size. */
104
104
  children?: ReactNode;
105
105
  className?: string;
106
106
  textClassName?: string;
package/src/Badge.tsx CHANGED
@@ -20,7 +20,6 @@ export type BadgeVariant =
20
20
  export type BadgeProps = ViewProps & {
21
21
  variant?: BadgeVariant;
22
22
  className?: string;
23
- /** Extra classes for the label when `children` is a string or number. */
24
23
  textClassName?: string;
25
24
  children?: ReactNode;
26
25
  };
@@ -13,12 +13,8 @@ import { useScheme } from "./useScheme";
13
13
 
14
14
  const SHEET_RADIUS = 20;
15
15
 
16
- // A single open detent at 40% by default. A caller can pass several detents for
17
- // multi-detent sizing. The closed detent (0) is added by the component.
18
16
  const DEFAULT_DETENTS: readonly ModalDetent[] = ["40%"];
19
17
 
20
- // A dimming scrim. The library scales this alpha to 0 at the closed detent and to
21
- // full at an open one.
22
18
  const SCRIM_COLOR = "rgba(0, 0, 0, 0.5)";
23
19
 
24
20
  /**
@@ -46,24 +42,19 @@ export function BottomSheetContainer({
46
42
  title: string;
47
43
  children: React.ReactNode;
48
44
  closeTestID?: string;
49
- /** Open detents, shortest first. The closed detent is added automatically. */
50
45
  detents?: readonly ModalDetent[];
51
46
  }) {
52
47
  const largerText = useLargerText();
53
48
  const scheme = useScheme();
54
49
  const isDark = scheme === "dark";
55
50
 
56
- // The library sheet is controlled by a detent index. The first detent is the
57
- // closed state (0); the open detents follow.
58
51
  const detentList = useMemo<ModalDetent[]>(() => [0, ...detents], [detents]);
59
52
  const [index, setIndex] = useState(0);
60
53
 
61
- // Keep the index in step with `visible`: open to the first detent, close to 0.
62
54
  useEffect(() => {
63
55
  setIndex((current) => (visible ? (current === 0 ? 1 : current) : 0));
64
56
  }, [visible]);
65
57
 
66
- // A user-driven drag to the closed detent reports here; tell the parent.
67
58
  const handleIndexChange = useCallback(
68
59
  (next: number) => {
69
60
  setIndex(next);
@@ -72,7 +63,6 @@ export function BottomSheetContainer({
72
63
  [onClose],
73
64
  );
74
65
 
75
- // A scrim tap or system Back asks the sheet to close; close it and tell the parent.
76
66
  const handleCloseRequest = useCallback(() => {
77
67
  setIndex(0);
78
68
  onClose();
@@ -88,7 +78,6 @@ export function BottomSheetContainer({
88
78
  <ModalBottomSheet
89
79
  index={index}
90
80
  detents={detentList}
91
- // Unmount the content once the sheet settles closed.
92
81
  lazy
93
82
  windowOverlay
94
83
  scrimColor={SCRIM_COLOR}
@@ -20,20 +20,11 @@ import { NativeOnlyAnimatedView } from "./primitives/native-only-animated-view";
20
20
  */
21
21
  export interface BulkBarAction {
22
22
  key: string;
23
- /** Full label: the More menu item and the accessible name. */
24
23
  label: string;
25
- /**
26
- * Shorter label shown in the bar on wide screens, and under the icon with
27
- * `placement="tabBar"` (defaults to `label`).
28
- */
29
24
  shortLabel?: string;
30
- /** A Tabler icon, drawn at 17 in the button colour. */
31
25
  icon: ComponentType<IconProps>;
32
- /** Label and icon in the danger colour. */
33
26
  destructive?: boolean;
34
- /** The web Alt-to-skip hint. No effect on a phone (no Alt key). */
35
27
  showSkipHint?: boolean;
36
- /** Native only: turns this action off even with a selection. */
37
28
  disabled?: boolean;
38
29
  onClick: () => void;
39
30
  }
@@ -46,38 +37,11 @@ export interface BulkActionBarProps {
46
37
  onSelectAll: () => void;
47
38
  onClearSelection: () => void;
48
39
  primaryActions: ReadonlyArray<BulkBarAction>;
49
- /** Behind a More (dots) button, in a `DropdownMenu`. */
50
40
  moreActions?: ReadonlyArray<BulkBarAction>;
51
- /** On the right, after a divider. */
52
41
  destructiveAction?: BulkBarAction;
53
- /** The web motion key. Here the bar's `testID`. */
54
42
  barKey?: string;
55
- /**
56
- * Space under the bar, in points, before its 12 gap. Default: the bottom
57
- * safe-area inset. Above a `FloatingTabBar`, pass
58
- * `tabBarReserve(largerText, insets.bottom)`. Not used with
59
- * `placement="tabBar"`.
60
- */
61
43
  bottomOffset?: number;
62
- /**
63
- * Native only: keep Cancel selection (X) and its divider outside the
64
- * sideways scroll, at the bar's right end, so it shows even when the bar
65
- * is wider than the screen. The rest of the bar still scrolls. Default
66
- * `false`: the X scrolls with the actions, as the web.
67
- */
68
44
  pinCancel?: boolean;
69
- /**
70
- * Native only. `"float"` (default): the web bar, floating 12 above
71
- * `bottomOffset`. `"tabBar"`: the phone contextual bar, in the slot and
72
- * shape of `FloatingTabBar` (hide the tab bar while selecting, with
73
- * `tabBarStyle: { display: "none" }` on the screen). It shows up and
74
- * leaves at once, so the two bars swap with no gap. Each action is its
75
- * icon over its `shortLabel` (12, or 14 with larger text) in a box 48 high
76
- * (56 with larger text) that shares out the spare width. There is no count
77
- * chip: the screen header shows the count, as Android's contextual action
78
- * bar, and no dividers, as the tab bar. Cancel selection (X) is pinned, as
79
- * with `pinCancel`.
80
- */
81
45
  placement?: BulkBarPlacement;
82
46
  }
83
47
 
@@ -86,12 +50,6 @@ export type BulkBarPlacement = "float" | "tabBar";
86
50
  /** The web `sm` breakpoint: below it, bar buttons are icon-only and "selected" is hidden. */
87
51
  export const BULK_BAR_LABEL_MIN_WIDTH = 640;
88
52
 
89
- /**
90
- * Web `h-9` buttons with a 17 icon and `text-sm`; with larger text 48 high, a
91
- * 22 icon and `text-lg`. In the tab bar slot: 48 high with a 20 icon over a
92
- * `text-xs` label; with larger text 56, a 24 icon and `text-sm`. `caption` is
93
- * the count chip, or the label under a docked icon.
94
- */
95
53
  function barMetrics(largerText: boolean, docked: boolean) {
96
54
  if (docked) {
97
55
  return largerText
@@ -103,8 +61,6 @@ function barMetrics(largerText: boolean, docked: boolean) {
103
61
  : { height: 36, icon: 17, text: sizeStyle("text-sm"), caption: sizeStyle("text-xs") };
104
62
  }
105
63
 
106
- // Docked at the bottom: it rises into place and sinks back out, the exit 20%
107
- // quicker.
108
64
  const BAR_ENTER = FadeInDown.duration(150).easing(EASE_OUT);
109
65
  const BAR_EXIT = FadeOutDown.duration(120).easing(EASE_OUT);
110
66
 
@@ -141,15 +97,11 @@ export function BulkActionBar({
141
97
  if (!isSelecting) return null;
142
98
  const docked = placement === "tabBar";
143
99
  const metrics = barMetrics(largerText, docked);
144
- // Docked has no X to pin: the header holds it.
145
100
  const pinned = pinCancel && !docked;
146
- // Docked, every action shows its label (under the icon).
147
101
  const labelled = docked || width >= BULK_BAR_LABEL_MIN_WIDTH;
148
102
  const hasSelection = selectedCount > 0;
149
103
  const allSelected = totalCount > 0 && selectedCount >= totalCount;
150
104
  const muted = tokens.color.muted[scheme];
151
- // Docked, the screen's header carries the close X (Android's contextual
152
- // action bar), so the bar has none: one exit, and room for every label.
153
105
  const cancel = docked ? null : (
154
106
  <>
155
107
  <BarDivider />
@@ -163,7 +115,6 @@ export function BulkActionBar({
163
115
  <NativeOnlyAnimatedView
164
116
  testID={barKey}
165
117
  pointerEvents="box-none"
166
- // Docked, the bar swaps with the tab bar at once.
167
118
  entering={docked ? undefined : BAR_ENTER}
168
119
  exiting={docked ? undefined : BAR_EXIT}
169
120
  style={
@@ -183,16 +134,13 @@ export function BulkActionBar({
183
134
  radius={docked ? FLOATING_PILL_RADIUS : tokens.radius.lg}
184
135
  style={docked ? undefined : { maxWidth: width - 32 }}
185
136
  >
186
- {/* Docked: as high as the tab bar it stands in for. */}
187
137
  <View style={{ flexDirection: "row", alignItems: "center", height: docked ? tabBarHeight(largerText) : undefined }}>
188
138
  <ScrollView
189
139
  horizontal
190
140
  bounces={false}
191
141
  showsHorizontalScrollIndicator={false}
192
- // Pinned: the scroll gives up width first, and the X part keeps the right padding.
193
142
  style={pinned || docked ? { flexShrink: 1 } : undefined}
194
143
  contentContainerStyle={{
195
- // Docked, the actions grow to fill the bar, and it scrolls only when they do not fit.
196
144
  ...(docked ? { flexGrow: 1 } : null),
197
145
  flexDirection: "row",
198
146
  alignItems: "center",
@@ -281,8 +229,6 @@ export function BulkActionBar({
281
229
  {pinned ? null : cancel}
282
230
  </ScrollView>
283
231
  {pinned ? (
284
- // The scroll's 4 gap before the divider, then the bar's end padding.
285
- // Docked, as the tab bar: no dividers and no gaps, the boxes' own padding apart.
286
232
  <View style={{ flexDirection: "row", alignItems: "center", gap: 4, paddingLeft: docked ? 0 : 4, paddingRight: docked ? 8 : 10 }}>
287
233
  {cancel}
288
234
  </View>
@@ -293,12 +239,6 @@ export function BulkActionBar({
293
239
  );
294
240
  }
295
241
 
296
- /**
297
- * A bar button box: the web `h-9 rounded-lg`, at least 44 wide and slopped to
298
- * 44 high, `surface-secondary` while pressed (a 10% danger tint for a
299
- * destructive one), faded to 30% when off. Docked: a pill (as the tab bar's
300
- * active pill), at least 48 wide.
301
- */
302
242
  function barButtonStyle(
303
243
  height: number,
304
244
  paddingX: number,
@@ -337,7 +277,6 @@ function BarPressable({
337
277
  height: number;
338
278
  paddingX: number;
339
279
  docked: boolean;
340
- /** Take a share of the bar's spare width (a docked action). */
341
280
  grow?: boolean;
342
281
  label?: string;
343
282
  disabled?: boolean;
@@ -364,10 +303,6 @@ function BarPressable({
364
303
  );
365
304
  }
366
305
 
367
- /**
368
- * One action: the icon, and on wide screens the short label beside it
369
- * (`text-sm` medium). Docked, the short label sits under the icon (`caption`).
370
- */
371
306
  function BarButton({
372
307
  action,
373
308
  disabled,
@@ -425,7 +360,6 @@ function BarButton({
425
360
  );
426
361
  }
427
362
 
428
- /** The web vertical `Separator`: `mx-1.5 h-5 bg-border`. */
429
363
  function BarDivider() {
430
364
  const scheme = useScheme();
431
365
  return (
package/src/Button.tsx CHANGED
@@ -8,15 +8,14 @@ import { cn } from "./cn";
8
8
  import { buttonColors, sizeStyle, typeStyle, type ButtonVariant } from "./controlStyles";
9
9
  import { useDialogLayout } from "./dialogLayout";
10
10
  import { floatingShadow } from "./floating";
11
+ import { useGlass } from "./glass";
11
12
  import { Spinner } from "./Spinner";
12
13
  import { useLargerText } from "./theme";
13
14
  import { tokens } from "./tokens";
14
15
  import { useScheme } from "./useScheme";
15
16
 
16
- /** `sm`, `default` (or `md`) and `lg` are the web names for `small`, `medium` and `large`. `icon` is a square button. */
17
17
  type ButtonSize = "small" | "medium" | "large" | "sm" | "md" | "default" | "lg" | "icon";
18
18
 
19
- /** The web `shape`. `"pill"` (default) is fully round; `"rounded"` is radius 16, the look before 0.6.0. */
20
19
  type ButtonShape = "pill" | "rounded";
21
20
 
22
21
  interface ButtonProps extends Omit<
@@ -27,27 +26,13 @@ interface ButtonProps extends Omit<
27
26
  variant?: ButtonVariant;
28
27
  icon?: keyof typeof MaterialIcons.glyphMap;
29
28
  leftIcon?: React.ReactNode;
30
- /** Web name for `leftIcon`. `leftIcon` wins when both are set. */
31
29
  startContent?: React.ReactNode;
32
- /** Rendered after the label. */
33
30
  endContent?: React.ReactNode;
34
31
  loading?: boolean;
35
32
  size?: ButtonSize;
36
- /**
37
- * Default `"pill"`: fully round at every size and variant, so `icon` is a
38
- * circle (web `rounded-full`). `"rounded"`: radius 16 at every size, the
39
- * look before 0.6.0 (web `shape="rounded"`, `rounded-lg`). A `style`
40
- * radius wins over either.
41
- */
42
33
  shape?: ButtonShape;
43
- /**
44
- * Default `true`. In the stacked footer of a compact dialog the button fills
45
- * the width whatever this says, as on the web.
46
- */
47
34
  fullWidth?: boolean;
48
- /** Label, or other content. Give a button with no text child an `accessibilityLabel`. */
49
35
  children?: React.ReactNode;
50
- /** `"shadow"` adds the floating shadow to `primary` and `default`. Default `"flat"`: the web button has none. */
51
36
  shadowType?: "flat" | "shadow";
52
37
  className?: string;
53
38
  }
@@ -63,12 +48,6 @@ const SIZE_ALIAS = {
63
48
  icon: "icon",
64
49
  } as const;
65
50
 
66
- // `regular` is the web `Button` (`default` h-10 px-4, `lg` h-11 px-6, `icon`
67
- // h-10 w-10), except `sm`: the web h-8 `text-xs` is a desktop size, so here it
68
- // is 36 high with a 14 label (`text-sm`). `larger` is the larger-text step-up from
69
- // 0.3.2. Labelled sizes are minimum heights (`h-auto` drops the primitive's
70
- // `h-10`), so a large Dynamic Type size grows the button instead of clipping
71
- // the label.
72
51
  const HEIGHT = {
73
52
  regular: {
74
53
  small: "h-auto min-h-9 px-3",
@@ -84,34 +63,21 @@ const HEIGHT = {
84
63
  },
85
64
  };
86
65
 
87
- // Each class is also set as a style (`sizeStyle`): web `text-sm` is 14 / 20.
88
66
  const TEXT = {
89
67
  regular: { small: "text-sm", medium: "text-sm", large: "text-sm", icon: "text-sm" },
90
68
  larger: { small: "text-base", medium: "text-xl", large: "text-2xl", icon: "text-base" },
91
69
  } as const;
92
70
 
93
- // The web sizes are under the 44 pt touch target; the slop brings each to 44
94
- // or more. `small` (32) slops only above and below: small buttons sit 4 apart
95
- // in a row (Cancel and Delete), and side slop would let one steal the other's
96
- // taps. The larger sizes are 56 or more and need none.
97
71
  const HIT_SLOP = {
98
72
  regular: { small: { top: 6, bottom: 6, left: 0, right: 0 }, medium: 4, large: 2, icon: 4 },
99
73
  larger: { small: undefined, medium: undefined, large: undefined, icon: undefined },
100
74
  };
101
75
 
102
- // The web `shape` (from @vvedantb/ui 0.31.0). `pill` is `rounded-full`:
103
- // `tokens.radius.pill` (999), far more than half the tallest minimum height
104
- // (72), so the ends are half circles. `rounded` is `rounded-lg` (`--radius`, 16). The web
105
- // `rounded` is `rounded-md` on `xs` and `icon-xs`, sizes native does not have,
106
- // so here it is 16 at every size. Styles, because apps' NativeWind themes set
107
- // their own `rounded-lg`.
108
76
  const RADIUS: Record<ButtonShape, number> = {
109
77
  pill: tokens.radius.pill,
110
78
  rounded: tokens.radius.lg,
111
79
  };
112
80
 
113
- // Colours come from `buttonColors` as styles, except `tinted` (a legacy
114
- // alias), which keeps the pink classes that `outline` used before 0.3.0.
115
81
  const VARIANT_CLASS: Partial<Record<ButtonVariant, string>> = {
116
82
  link: "h-auto border-0 px-0",
117
83
  tinted: "border-0 bg-pink-50 dark:bg-pink-900/20",
@@ -168,16 +134,17 @@ export const Button = React.forwardRef<React.ElementRef<typeof PrimitiveButton>,
168
134
  const contentColor = colors?.color ?? PINK_600;
169
135
  const elevate =
170
136
  shadowType === "shadow" && (variant === "primary" || variant === "default");
137
+ const glass = useGlass("control");
138
+ const filled = variant === "primary" || variant === "default" || variant === "secondary";
171
139
  const baseStyle = [
172
140
  { borderRadius: RADIUS[shape] },
173
141
  elevate ? floatingShadow : null,
142
+ filled ? glass : null,
174
143
  colors
175
144
  ? { backgroundColor: colors.backgroundColor, borderColor: colors.borderColor }
176
145
  : null,
177
146
  ];
178
147
  const callerStyle = props.style;
179
- // As on the web, `loading` swaps the start content for the 16 ring (`h-4
180
- // w-4`, Spinner `sm`) and keeps the label.
181
148
  const start = loading ? (
182
149
  <Spinner size="sm" color={contentColor} decorative />
183
150
  ) : (
@@ -199,10 +166,7 @@ export const Button = React.forwardRef<React.ElementRef<typeof PrimitiveButton>,
199
166
  className={cn(
200
167
  "relative border",
201
168
  HEIGHT[scale][resolvedSize],
202
- // Column flex children stretch by default (React Native Web too), so
203
- // a button that is not full width must opt out with `self-start`.
204
169
  resolvedSize !== "icon" && (fullWidth || dialog.stacked ? "w-full" : "self-start"),
205
- // The web compact dialog: labelled buttons at least 44 high (`min-h-11`).
206
170
  dialog.compact && scale === "regular" && resolvedSize !== "icon" && "min-h-11",
207
171
  VARIANT_CLASS[variant],
208
172
  className,
@@ -9,7 +9,6 @@ export type CaptureButtonProps = {
9
9
  onPress?: () => void;
10
10
  disabled?: boolean;
11
11
  testID?: string;
12
- /** Default "Take photo". */
13
12
  accessibilityLabel?: string;
14
13
  };
15
14