@vvedantb/native-ui 0.17.2 → 0.18.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 (220) hide show
  1. package/dist/AlertDialog.jsx +123 -0
  2. package/dist/AmbientBackground.jsx +73 -0
  3. package/dist/ArtifactList.jsx +59 -0
  4. package/dist/Avatar.jsx +285 -0
  5. package/dist/Badge.jsx +154 -0
  6. package/dist/BottomSheetContainer.jsx +208 -0
  7. package/dist/BulkActionBar.jsx +717 -0
  8. package/dist/Button.jsx +344 -0
  9. package/dist/CaptureButton.jsx +104 -0
  10. package/dist/Card.jsx +371 -0
  11. package/dist/Checkbox.jsx +177 -0
  12. package/dist/Chip.jsx +79 -0
  13. package/dist/ColorSwatches.jsx +159 -0
  14. package/dist/ConfirmDialog.jsx +157 -0
  15. package/dist/DateTimeField.jsx +204 -0
  16. package/dist/Dialog.jsx +614 -0
  17. package/dist/DividedList.jsx +120 -0
  18. package/dist/DropdownMenu.jsx +849 -0
  19. package/dist/EmptyState.jsx +434 -0
  20. package/dist/ExpoWebRoot.jsx +134 -0
  21. package/dist/FloatingFAB.jsx +95 -0
  22. package/dist/FloatingSurface.jsx +226 -0
  23. package/dist/FloatingTabBar.jsx +403 -0
  24. package/dist/HeaderIconButton.jsx +53 -0
  25. package/dist/IconButton.jsx +157 -0
  26. package/dist/Input.jsx +96 -0
  27. package/dist/Label.jsx +96 -0
  28. package/dist/LabeledSwitchRow.jsx +170 -0
  29. package/dist/LiquidGlass.jsx +2 -0
  30. package/dist/ListRow.jsx +281 -0
  31. package/dist/LoadingState.jsx +205 -0
  32. package/dist/PageIndicator.jsx +128 -0
  33. package/dist/PageTitle.jsx +205 -0
  34. package/dist/Pager.jsx +105 -0
  35. package/dist/PasswordInput.jsx +120 -0
  36. package/dist/PillTabs.jsx +300 -0
  37. package/dist/PinnedBotTile.jsx +212 -0
  38. package/dist/Progress.jsx +147 -0
  39. package/dist/SafeAreaContainer.jsx +38 -0
  40. package/dist/ScreenContainer.jsx +117 -0
  41. package/dist/SearchInput.jsx +150 -0
  42. package/dist/SectionLabel.jsx +128 -0
  43. package/dist/Select.jsx +223 -0
  44. package/dist/Separator.jsx +95 -0
  45. package/dist/Sheet.jsx +343 -0
  46. package/dist/SheetRow.jsx +198 -0
  47. package/dist/Skeleton.jsx +311 -0
  48. package/dist/Spinner.jsx +195 -0
  49. package/dist/StackPageHeader.jsx +160 -0
  50. package/dist/StatGrid.jsx +74 -0
  51. package/dist/StatusDot.jsx +129 -0
  52. package/dist/SurfaceRow.jsx +143 -0
  53. package/dist/SwipeableRow.jsx +50 -0
  54. package/dist/Switch.jsx +130 -0
  55. package/dist/Tabs.jsx +385 -0
  56. package/dist/Textarea.jsx +103 -0
  57. package/dist/ThemeToggle.jsx +78 -0
  58. package/dist/Toast.jsx +396 -0
  59. package/dist/ai/activity-step-detail.jsx +179 -0
  60. package/dist/ai/activity-step-label.js +816 -0
  61. package/dist/ai/activity-step-types.js +14 -0
  62. package/dist/ai/activity-step.jsx +98 -0
  63. package/dist/ai/activity-tasks-utils.js +172 -0
  64. package/dist/ai/activity-timeline.js +47 -0
  65. package/dist/ai/attachments.jsx +258 -0
  66. package/dist/ai/card-button.jsx +188 -0
  67. package/dist/ai/chain-of-thought.jsx +459 -0
  68. package/dist/ai/chat-jump-rail.jsx +57 -0
  69. package/dist/ai/chat-text.js +44 -0
  70. package/dist/ai/chat-thread.jsx +135 -0
  71. package/dist/ai/choice-question.jsx +925 -0
  72. package/dist/ai/code-block.jsx +574 -0
  73. package/dist/ai/collapsible.jsx +275 -0
  74. package/dist/ai/conversation.jsx +723 -0
  75. package/dist/ai/file-chip.jsx +198 -0
  76. package/dist/ai/icon-button.jsx +179 -0
  77. package/dist/ai/index.js +37 -0
  78. package/dist/ai/message-action-sheet.jsx +408 -0
  79. package/dist/ai/message-quote.jsx +241 -0
  80. package/dist/ai/message.jsx +739 -0
  81. package/dist/ai/prompt-input-menu.jsx +365 -0
  82. package/dist/ai/prompt-input.jsx +626 -0
  83. package/dist/ai/reasoning.jsx +446 -0
  84. package/dist/ai/reply-quote-chip.jsx +278 -0
  85. package/dist/ai/response-text.jsx +130 -0
  86. package/dist/ai/shimmer.jsx +149 -0
  87. package/dist/ai/sources.jsx +260 -0
  88. package/dist/ai/subagent-cards.jsx +645 -0
  89. package/dist/ai/suggestion.jsx +186 -0
  90. package/dist/ai/tool-approval-card.jsx +359 -0
  91. package/dist/ai/trace.jsx +728 -0
  92. package/dist/ai/unified-diff.jsx +280 -0
  93. package/dist/ai/use-streaming-disclosure.js +70 -0
  94. package/dist/auth/AuthProviders.jsx +27 -0
  95. package/dist/auth/AuthScreen.jsx +292 -0
  96. package/dist/auth/GoogleSignInButton.jsx +188 -0
  97. package/dist/auth/SecondFactorScreen.jsx +133 -0
  98. package/dist/auth/SignInScreen.jsx +482 -0
  99. package/dist/auth/authErrors.js +131 -0
  100. package/dist/auth/index.js +11 -0
  101. package/dist/auth/totp.js +378 -0
  102. package/dist/blur.js +36 -0
  103. package/dist/brand/AppIcons.jsx +118 -0
  104. package/dist/brand/AppMark.jsx +128 -0
  105. package/dist/brand/AppWordmark.jsx +138 -0
  106. package/dist/brand/GoogleMark.jsx +71 -0
  107. package/dist/brand/ProviderIcon.jsx +192 -0
  108. package/dist/brand/familyApps.js +33 -0
  109. package/dist/brand/index.js +11 -0
  110. package/dist/brand/svg.js +252 -0
  111. package/dist/brand/vProAppBenefits.js +19 -0
  112. package/dist/cn.js +5 -0
  113. package/dist/colors.js +15 -0
  114. package/dist/configureTheme.js +72 -0
  115. package/dist/controlStyles.js +520 -0
  116. package/dist/definiteSize.js +12 -0
  117. package/dist/dialogLayout.js +18 -0
  118. package/dist/entries/ai.js +4 -0
  119. package/dist/entries/ambient.js +3 -0
  120. package/dist/entries/auth.js +5 -0
  121. package/dist/entries/bottom-sheet.js +2 -0
  122. package/dist/entries/brand.js +2 -0
  123. package/dist/entries/button.js +2 -0
  124. package/dist/entries/date-time.js +3 -0
  125. package/dist/entries/expo-router.js +4 -0
  126. package/dist/entries/expo-web-root.js +3 -0
  127. package/dist/entries/floating.js +7 -0
  128. package/dist/entries/gesture-handler.js +4 -0
  129. package/dist/entries/keyboard-controller.js +4 -0
  130. package/dist/entries/layout.js +16 -0
  131. package/dist/entries/markdown.js +4 -0
  132. package/dist/entries/marketing.js +3 -0
  133. package/dist/entries/page-title.js +7 -0
  134. package/dist/entries/password-input.js +3 -0
  135. package/dist/entries/primitives.js +57 -0
  136. package/dist/entries/search-input.js +3 -0
  137. package/dist/entries/tab-bar.js +4 -0
  138. package/dist/entries/theme.js +7 -0
  139. package/dist/entries/toast.js +5 -0
  140. package/dist/entries/video.js +3 -0
  141. package/dist/entries/webview.js +4 -0
  142. package/dist/examples/AiChatGallery.jsx +509 -0
  143. package/dist/examples/ParityGallery.jsx +1307 -0
  144. package/dist/floating.js +62 -0
  145. package/dist/glassBlur.jsx +145 -0
  146. package/dist/gradient.js +17 -0
  147. package/dist/haptics.js +44 -0
  148. package/dist/highlight.js +382 -0
  149. package/dist/index.js +85 -0
  150. package/dist/initials.js +4 -0
  151. package/dist/loadingGrid.js +81 -0
  152. package/dist/markdown/Markdown.jsx +515 -0
  153. package/dist/markdown/MarkdownTable.jsx +443 -0
  154. package/dist/markdown/tableText.js +68 -0
  155. package/dist/marketing/PricingModal.jsx +608 -0
  156. package/dist/marketing/UpgradeToProCard.jsx +164 -0
  157. package/dist/marketing/pricing.js +34 -0
  158. package/dist/media/ImageGallery.jsx +580 -0
  159. package/dist/media/MediaCard.jsx +162 -0
  160. package/dist/media/imageGrid.js +54 -0
  161. package/dist/motion.js +33 -0
  162. package/dist/pagerSwipe.js +104 -0
  163. package/dist/palette.js +104 -0
  164. package/dist/primitives/button.jsx +127 -0
  165. package/dist/primitives/card.jsx +249 -0
  166. package/dist/primitives/icon.jsx +37 -0
  167. package/dist/primitives/input.jsx +56 -0
  168. package/dist/primitives/keyboard-controller.jsx +207 -0
  169. package/dist/primitives/keyboard-parts.jsx +75 -0
  170. package/dist/primitives/native-only-animated-view.jsx +68 -0
  171. package/dist/primitives/overlay.jsx +391 -0
  172. package/dist/primitives/pager-gesture.jsx +131 -0
  173. package/dist/primitives/select-host.jsx +103 -0
  174. package/dist/primitives/select.jsx +555 -0
  175. package/dist/primitives/sheet-drag.jsx +420 -0
  176. package/dist/primitives/sheet-gesture.jsx +219 -0
  177. package/dist/primitives/swipe-row-gesture.jsx +341 -0
  178. package/dist/primitives/switch.jsx +105 -0
  179. package/dist/primitives/text.jsx +145 -0
  180. package/dist/primitives/toast-drag-gesture.jsx +94 -0
  181. package/dist/primitives/use-controllable-state.js +40 -0
  182. package/dist/primitives/web-click-guard.js +69 -0
  183. package/dist/push.js +166 -0
  184. package/dist/relativeTime.js +70 -0
  185. package/dist/router/RouterStackPageHeader.jsx +53 -0
  186. package/dist/selectA11y.js +32 -0
  187. package/dist/settings/MoreFromProjectV.jsx +168 -0
  188. package/dist/settings/SettingsEmptyState.jsx +102 -0
  189. package/dist/settings/SettingsField.jsx +49 -0
  190. package/dist/settings/SettingsSection.jsx +101 -0
  191. package/dist/settings/SettingsStack.jsx +17 -0
  192. package/dist/settings/SettingsToggleRow.jsx +163 -0
  193. package/dist/settings/projectVMobileApps.js +126 -0
  194. package/dist/settings/relaxedSizeStyle.js +11 -0
  195. package/dist/sheetDrag.js +76 -0
  196. package/dist/svgA11y.js +46 -0
  197. package/dist/swipeRow.js +161 -0
  198. package/dist/tabBarRoutes.js +41 -0
  199. package/dist/tabIndicator.js +139 -0
  200. package/dist/tailwind-preset.cjs +255 -0
  201. package/dist/tailwind-preset.d.cts +55 -0
  202. package/dist/theme.jsx +62 -0
  203. package/dist/toastChrome.js +110 -0
  204. package/dist/toastDrag.js +51 -0
  205. package/dist/toastStore.js +54 -0
  206. package/dist/tokens.js +70 -0
  207. package/dist/typography.js +40 -0
  208. package/dist/useReduceMotion.js +32 -0
  209. package/dist/useReduceTransparency.js +27 -0
  210. package/dist/useScheme.js +15 -0
  211. package/dist/video/InlineVideo.jsx +115 -0
  212. package/dist/webview/HtmlView.jsx +169 -0
  213. package/dist/webview/HtmlView.web.jsx +63 -0
  214. package/dist/webview/htmlView.js +43 -0
  215. package/package.json +70 -33
  216. package/src/DropdownMenu.tsx +28 -16
  217. package/src/FloatingTabBar.tsx +78 -41
  218. package/src/ai/conversation.tsx +12 -8
  219. package/src/glassBlur.tsx +47 -22
  220. package/src/primitives/swipe-row-gesture.tsx +11 -2
@@ -0,0 +1,44 @@
1
+ /** Type and copy shared by the AI chat parts. */
2
+ import { Platform } from "react-native";
3
+ /**
4
+ * `body` is message text: `text-sm` (14 / 20), as the web `MessageContent`.
5
+ * `small` is the secondary text of triggers, trace lines and sources: also
6
+ * `text-sm` (the web sources trigger is `text-xs`). `caption` is `text-xs`
7
+ * (12 / 16): step descriptions, file chips and code headers. Larger text
8
+ * steps each up, as `Textarea` does.
9
+ */
10
+ export function chatTextSize(kind, largerText) {
11
+ if (kind === "body") return largerText ? "text-xl" : "text-sm";
12
+ if (kind === "small") return largerText ? "text-lg" : "text-sm";
13
+ return largerText ? "text-base" : "text-xs";
14
+ }
15
+
16
+ /**
17
+ * The web `text-2xs` token (11 / 16, tracking 0.01em) as a style, for
18
+ * `MessageMeta size="2xs"` and an app's own small labels. React Native has no
19
+ * `em`, so the tracking is in points.
20
+ */
21
+ export const META_TEXT_STYLE = {
22
+ fontSize: 11,
23
+ lineHeight: 16,
24
+ letterSpacing: 0.11
25
+ };
26
+
27
+ /** The system monospace face, for code and reasoning text (web `font-mono`). */
28
+ export const MONO_FONT = Platform.select({
29
+ ios: "Menlo",
30
+ default: "monospace"
31
+ });
32
+
33
+ /**
34
+ * Elapsed time for "Thought for 12s" and "Worked for 1m 5s": whole seconds
35
+ * under a minute, minutes and seconds above. Negative and fractional values
36
+ * round to whole seconds, from 0.
37
+ */
38
+ export function formatElapsed(seconds) {
39
+ const total = Math.max(0, Math.round(seconds));
40
+ if (total < 60) return `${total}s`;
41
+ const minutes = Math.floor(total / 60);
42
+ const rest = total % 60;
43
+ return rest === 0 ? `${minutes}m` : `${minutes}m ${rest}s`;
44
+ }
@@ -0,0 +1,135 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { StyleSheet, View } from "react-native";
3
+ import { cn } from "../cn";
4
+ import { KeyboardAvoidingView, KeyboardLiftContext } from "../primitives/keyboard-parts";
5
+ import { Conversation, ConversationContent, ConversationScrollButton } from "./conversation";
6
+
7
+ /**
8
+ * The least `ChatThread` reads from a message: an id and a role. The `ai` SDK
9
+ * `UIMessage` fits it, so the package takes no `ai` dependency.
10
+ */
11
+
12
+ /** Index of the last message with `role`, or -1. A loop, not `findLastIndex` (Hermes). */
13
+ function lastIndexOfRole(messages, role) {
14
+ for (let index = messages.length - 1; index >= 0; index -= 1) {
15
+ if (messages[index].role === role) return index;
16
+ }
17
+ return -1;
18
+ }
19
+
20
+ /**
21
+ * The chat column as one piece: `Conversation`, `ConversationContent`, the
22
+ * messages, a `thinking` row right after the last user message while
23
+ * `working`, `ConversationScrollButton` and the `footer` last. The whole
24
+ * column sits in a `KeyboardAvoidingView` (`padding`, as `PromptInput`; frame
25
+ * by frame with `KeyboardControllerProvider`), which also lifts the footer on
26
+ * Android edge-to-edge, where the window does not resize. A `PromptInput`
27
+ * footer and the scroll button add no lift of their own (`KeyboardLiftContext`).
28
+ */
29
+ export function ChatThread(t0) {
30
+ const $ = _c(29);
31
+ const {
32
+ messages,
33
+ working,
34
+ renderMessage,
35
+ thinking,
36
+ emptyState,
37
+ footer,
38
+ contentContainerClassName,
39
+ keyboardVerticalOffset: t1,
40
+ className,
41
+ testID
42
+ } = t0;
43
+ const keyboardVerticalOffset = t1 === undefined ? 0 : t1;
44
+ let t2;
45
+ if ($[0] !== messages || $[1] !== working) {
46
+ t2 = working ? lastIndexOfRole(messages, "user") : -1;
47
+ $[0] = messages;
48
+ $[1] = working;
49
+ $[2] = t2;
50
+ } else {
51
+ t2 = $[2];
52
+ }
53
+ const lastUser = t2;
54
+ let t3;
55
+ if ($[3] !== messages || $[4] !== working) {
56
+ t3 = working ? lastIndexOfRole(messages, "assistant") : -1;
57
+ $[3] = messages;
58
+ $[4] = working;
59
+ $[5] = t3;
60
+ } else {
61
+ t3 = $[5];
62
+ }
63
+ const streaming = t3;
64
+ let t4;
65
+ if ($[6] !== className) {
66
+ t4 = cn("flex-1", className);
67
+ $[6] = className;
68
+ $[7] = t4;
69
+ } else {
70
+ t4 = $[7];
71
+ }
72
+ let t5;
73
+ if ($[8] !== emptyState || $[9] !== lastUser || $[10] !== messages || $[11] !== renderMessage || $[12] !== streaming || $[13] !== thinking) {
74
+ t5 = messages.length === 0 ? emptyState : messages.map((message, index) => <View key={message.id}>{renderMessage(message, index === streaming)}{index === lastUser && thinking != null ? <View className="mt-4">{thinking}</View> : null}</View>);
75
+ $[8] = emptyState;
76
+ $[9] = lastUser;
77
+ $[10] = messages;
78
+ $[11] = renderMessage;
79
+ $[12] = streaming;
80
+ $[13] = thinking;
81
+ $[14] = t5;
82
+ } else {
83
+ t5 = $[14];
84
+ }
85
+ let t6;
86
+ if ($[15] !== contentContainerClassName || $[16] !== t5) {
87
+ t6 = <ConversationContent contentContainerClassName={contentContainerClassName}>{t5}</ConversationContent>;
88
+ $[15] = contentContainerClassName;
89
+ $[16] = t5;
90
+ $[17] = t6;
91
+ } else {
92
+ t6 = $[17];
93
+ }
94
+ let t7;
95
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
96
+ t7 = <ConversationScrollButton testID="chat-thread-scroll-bottom" />;
97
+ $[18] = t7;
98
+ } else {
99
+ t7 = $[18];
100
+ }
101
+ let t8;
102
+ if ($[19] !== t6) {
103
+ t8 = <Conversation>{t6}{t7}</Conversation>;
104
+ $[19] = t6;
105
+ $[20] = t8;
106
+ } else {
107
+ t8 = $[20];
108
+ }
109
+ let t9;
110
+ if ($[21] !== footer || $[22] !== t4 || $[23] !== t8) {
111
+ t9 = <KeyboardLiftContext.Provider value={true}><View className={t4}>{t8}{footer}</View></KeyboardLiftContext.Provider>;
112
+ $[21] = footer;
113
+ $[22] = t4;
114
+ $[23] = t8;
115
+ $[24] = t9;
116
+ } else {
117
+ t9 = $[24];
118
+ }
119
+ let t10;
120
+ if ($[25] !== keyboardVerticalOffset || $[26] !== t9 || $[27] !== testID) {
121
+ t10 = <KeyboardAvoidingView testID={testID} keyboardVerticalOffset={keyboardVerticalOffset} style={styles.fill}>{t9}</KeyboardAvoidingView>;
122
+ $[25] = keyboardVerticalOffset;
123
+ $[26] = t9;
124
+ $[27] = testID;
125
+ $[28] = t10;
126
+ } else {
127
+ t10 = $[28];
128
+ }
129
+ return t10;
130
+ }
131
+ const styles = StyleSheet.create({
132
+ fill: {
133
+ flex: 1
134
+ }
135
+ });