@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,408 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useEffect } from "react";
3
+ import { Modal, Pressable, StyleSheet, Text, View } from "react-native";
4
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
5
+ import { cn } from "../cn";
6
+ import { MIN_TOUCH_TARGET, sizeStyle, textStyle, touchSlop, typeStyle } from "../controlStyles";
7
+ import { selectionHaptic } from "../haptics";
8
+ import { palette } from "../palette";
9
+ import { useLargerText } from "../theme";
10
+ import { tokens } from "../tokens";
11
+ import { useReduceMotion } from "../useReduceMotion";
12
+ import { useScheme } from "../useScheme";
13
+ import { chatTextSize } from "./chat-text";
14
+
15
+ /** One row of `MessageActionSheet`. */
16
+
17
+ /** The sheet's default title, also the message's `longpress` action label. */
18
+ export const MESSAGE_ACTIONS_TITLE = "Message actions";
19
+ /**
20
+ * The sheet that opens on a long press of a chat message: a bottom sheet in
21
+ * an RN `Modal` (no `@gorhom/bottom-sheet`) with one pressable row per action
22
+ * and a Cancel row. It closes on the backdrop, Cancel, Android back and after
23
+ * an action. A `selectionHaptic()` fires when it opens (`expo-haptics` is an
24
+ * optional peer). Row testIDs are `{testID}-action-{key}`.
25
+ */
26
+ export function MessageActionSheet(t0) {
27
+ const $ = _c(112);
28
+ const {
29
+ open,
30
+ onClose,
31
+ actions,
32
+ title: t1,
33
+ cancelLabel: t2,
34
+ testID: t3
35
+ } = t0;
36
+ const title = t1 === undefined ? MESSAGE_ACTIONS_TITLE : t1;
37
+ const cancelLabel = t2 === undefined ? "Cancel" : t2;
38
+ const testID = t3 === undefined ? "message-action-sheet" : t3;
39
+ const scheme = useScheme();
40
+ const largerText = useLargerText();
41
+ const insets = useSafeAreaInsets();
42
+ const reduceMotion = useReduceMotion();
43
+ let t4;
44
+ let t5;
45
+ if ($[0] !== open) {
46
+ t4 = () => {
47
+ if (open) {
48
+ selectionHaptic();
49
+ }
50
+ };
51
+ t5 = [open];
52
+ $[0] = open;
53
+ $[1] = t4;
54
+ $[2] = t5;
55
+ } else {
56
+ t4 = $[1];
57
+ t5 = $[2];
58
+ }
59
+ useEffect(t4, t5);
60
+ let T0;
61
+ let T1;
62
+ let T2;
63
+ let T3;
64
+ let T4;
65
+ let t10;
66
+ let t11;
67
+ let t12;
68
+ let t13;
69
+ let t14;
70
+ let t15;
71
+ let t16;
72
+ let t17;
73
+ let t18;
74
+ let t19;
75
+ let t20;
76
+ let t21;
77
+ let t22;
78
+ let t23;
79
+ let t24;
80
+ let t25;
81
+ let t26;
82
+ let t27;
83
+ let t28;
84
+ let t29;
85
+ let t6;
86
+ let t7;
87
+ let t8;
88
+ let t9;
89
+ if ($[3] !== actions || $[4] !== cancelLabel || $[5] !== insets.bottom || $[6] !== largerText || $[7] !== onClose || $[8] !== open || $[9] !== reduceMotion || $[10] !== scheme || $[11] !== testID || $[12] !== title) {
90
+ const caption = chatTextSize("caption", largerText);
91
+ const body = chatTextSize("body", largerText);
92
+ const minHeight = largerText ? 56 : MIN_TOUCH_TARGET + 4;
93
+ T4 = Modal;
94
+ t24 = open;
95
+ t25 = true;
96
+ t26 = reduceMotion ? "none" : "fade";
97
+ t27 = true;
98
+ t28 = onClose;
99
+ const t30 = `${testID}-backdrop`;
100
+ let t31;
101
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
102
+ t31 = touchSlop(MIN_TOUCH_TARGET);
103
+ $[42] = t31;
104
+ } else {
105
+ t31 = $[42];
106
+ }
107
+ const t32 = palette.backdrop[scheme];
108
+ let t33;
109
+ if ($[43] !== t32) {
110
+ t33 = [StyleSheet.absoluteFill, {
111
+ backgroundColor: t32
112
+ }];
113
+ $[43] = t32;
114
+ $[44] = t33;
115
+ } else {
116
+ t33 = $[44];
117
+ }
118
+ if ($[45] !== onClose || $[46] !== t30 || $[47] !== t33) {
119
+ t29 = <Pressable testID={t30} accessibilityRole="button" accessibilityLabel="Close" onPress={onClose} hitSlop={t31} style={t33} />;
120
+ $[45] = onClose;
121
+ $[46] = t30;
122
+ $[47] = t33;
123
+ $[48] = t29;
124
+ } else {
125
+ t29 = $[48];
126
+ }
127
+ T3 = View;
128
+ t22 = "box-none";
129
+ t23 = styles.anchor;
130
+ T2 = View;
131
+ t15 = testID;
132
+ t16 = true;
133
+ t17 = title;
134
+ t18 = onClose;
135
+ t19 = "w-full self-center px-2";
136
+ const t34 = insets.bottom + 8;
137
+ if ($[49] !== t34) {
138
+ t20 = {
139
+ maxWidth: 480,
140
+ paddingBottom: t34
141
+ };
142
+ $[49] = t34;
143
+ $[50] = t20;
144
+ } else {
145
+ t20 = $[50];
146
+ }
147
+ const t35 = tokens.color.surface[scheme];
148
+ let t36;
149
+ if ($[51] !== t35) {
150
+ t36 = {
151
+ backgroundColor: t35,
152
+ borderRadius: tokens.radius.card
153
+ };
154
+ $[51] = t35;
155
+ $[52] = t36;
156
+ } else {
157
+ t36 = $[52];
158
+ }
159
+ const t37 = cn(caption, "px-4 pb-1 pt-3 font-instrument-sans-medium");
160
+ const t38 = sizeStyle(caption);
161
+ let t39;
162
+ if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
163
+ t39 = typeStyle("medium");
164
+ $[53] = t39;
165
+ } else {
166
+ t39 = $[53];
167
+ }
168
+ let t40;
169
+ if ($[54] !== scheme) {
170
+ t40 = textStyle("muted", scheme);
171
+ $[54] = scheme;
172
+ $[55] = t40;
173
+ } else {
174
+ t40 = $[55];
175
+ }
176
+ let t41;
177
+ if ($[56] !== t38 || $[57] !== t40) {
178
+ t41 = [t38, t39, t40];
179
+ $[56] = t38;
180
+ $[57] = t40;
181
+ $[58] = t41;
182
+ } else {
183
+ t41 = $[58];
184
+ }
185
+ let t42;
186
+ if ($[59] !== t37 || $[60] !== t41 || $[61] !== title) {
187
+ t42 = <Text accessibilityRole="header" numberOfLines={1} className={t37} style={t41}>{title}</Text>;
188
+ $[59] = t37;
189
+ $[60] = t41;
190
+ $[61] = title;
191
+ $[62] = t42;
192
+ } else {
193
+ t42 = $[62];
194
+ }
195
+ t21 = <View className="overflow-hidden" style={t36}>{t42}{actions.map((action, index) => {
196
+ const Icon = action.icon;
197
+ const color = action.destructive ? palette.danger[scheme] : tokens.color.foreground[scheme];
198
+ return <Pressable key={action.key} testID={`${testID}-action-${action.key}`} accessibilityRole="button" accessibilityLabel={action.label} hitSlop={touchSlop(MIN_TOUCH_TARGET)} onPress={() => {
199
+ onClose();
200
+ action.onPress();
201
+ }} className="flex-row items-center gap-3 px-4" style={[{
202
+ minHeight
203
+ }, index > 0 && {
204
+ borderTopWidth: StyleSheet.hairlineWidth,
205
+ borderTopColor: tokens.color.separator[scheme]
206
+ }]}>{Icon ? <Icon size={largerText ? 22 : 20} color={color} /> : null}<Text numberOfLines={1} className={cn(body, "min-w-0 flex-1 font-instrument-sans-medium")} style={[sizeStyle(body), typeStyle("medium"), {
207
+ color
208
+ }]}>{action.label}</Text></Pressable>;
209
+ })}</View>;
210
+ T1 = Pressable;
211
+ t8 = `${testID}-cancel`;
212
+ t9 = "button";
213
+ t10 = cancelLabel;
214
+ t11 = onClose;
215
+ if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
216
+ t12 = touchSlop(MIN_TOUCH_TARGET);
217
+ $[63] = t12;
218
+ } else {
219
+ t12 = $[63];
220
+ }
221
+ t13 = "mt-2 items-center justify-center";
222
+ const t43 = tokens.color.surface[scheme];
223
+ if ($[64] !== minHeight || $[65] !== t43) {
224
+ t14 = {
225
+ minHeight,
226
+ backgroundColor: t43,
227
+ borderRadius: tokens.radius.card
228
+ };
229
+ $[64] = minHeight;
230
+ $[65] = t43;
231
+ $[66] = t14;
232
+ } else {
233
+ t14 = $[66];
234
+ }
235
+ T0 = Text;
236
+ t7 = cn(body, "font-instrument-sans-semibold");
237
+ t6 = sizeStyle(body);
238
+ $[3] = actions;
239
+ $[4] = cancelLabel;
240
+ $[5] = insets.bottom;
241
+ $[6] = largerText;
242
+ $[7] = onClose;
243
+ $[8] = open;
244
+ $[9] = reduceMotion;
245
+ $[10] = scheme;
246
+ $[11] = testID;
247
+ $[12] = title;
248
+ $[13] = T0;
249
+ $[14] = T1;
250
+ $[15] = T2;
251
+ $[16] = T3;
252
+ $[17] = T4;
253
+ $[18] = t10;
254
+ $[19] = t11;
255
+ $[20] = t12;
256
+ $[21] = t13;
257
+ $[22] = t14;
258
+ $[23] = t15;
259
+ $[24] = t16;
260
+ $[25] = t17;
261
+ $[26] = t18;
262
+ $[27] = t19;
263
+ $[28] = t20;
264
+ $[29] = t21;
265
+ $[30] = t22;
266
+ $[31] = t23;
267
+ $[32] = t24;
268
+ $[33] = t25;
269
+ $[34] = t26;
270
+ $[35] = t27;
271
+ $[36] = t28;
272
+ $[37] = t29;
273
+ $[38] = t6;
274
+ $[39] = t7;
275
+ $[40] = t8;
276
+ $[41] = t9;
277
+ } else {
278
+ T0 = $[13];
279
+ T1 = $[14];
280
+ T2 = $[15];
281
+ T3 = $[16];
282
+ T4 = $[17];
283
+ t10 = $[18];
284
+ t11 = $[19];
285
+ t12 = $[20];
286
+ t13 = $[21];
287
+ t14 = $[22];
288
+ t15 = $[23];
289
+ t16 = $[24];
290
+ t17 = $[25];
291
+ t18 = $[26];
292
+ t19 = $[27];
293
+ t20 = $[28];
294
+ t21 = $[29];
295
+ t22 = $[30];
296
+ t23 = $[31];
297
+ t24 = $[32];
298
+ t25 = $[33];
299
+ t26 = $[34];
300
+ t27 = $[35];
301
+ t28 = $[36];
302
+ t29 = $[37];
303
+ t6 = $[38];
304
+ t7 = $[39];
305
+ t8 = $[40];
306
+ t9 = $[41];
307
+ }
308
+ let t30;
309
+ if ($[67] === Symbol.for("react.memo_cache_sentinel")) {
310
+ t30 = typeStyle("semibold");
311
+ $[67] = t30;
312
+ } else {
313
+ t30 = $[67];
314
+ }
315
+ let t31;
316
+ if ($[68] !== scheme) {
317
+ t31 = textStyle("foreground", scheme);
318
+ $[68] = scheme;
319
+ $[69] = t31;
320
+ } else {
321
+ t31 = $[69];
322
+ }
323
+ let t32;
324
+ if ($[70] !== t31 || $[71] !== t6) {
325
+ t32 = [t6, t30, t31];
326
+ $[70] = t31;
327
+ $[71] = t6;
328
+ $[72] = t32;
329
+ } else {
330
+ t32 = $[72];
331
+ }
332
+ let t33;
333
+ if ($[73] !== T0 || $[74] !== cancelLabel || $[75] !== t32 || $[76] !== t7) {
334
+ t33 = <T0 className={t7} style={t32}>{cancelLabel}</T0>;
335
+ $[73] = T0;
336
+ $[74] = cancelLabel;
337
+ $[75] = t32;
338
+ $[76] = t7;
339
+ $[77] = t33;
340
+ } else {
341
+ t33 = $[77];
342
+ }
343
+ let t34;
344
+ if ($[78] !== T1 || $[79] !== t10 || $[80] !== t11 || $[81] !== t12 || $[82] !== t13 || $[83] !== t14 || $[84] !== t33 || $[85] !== t8 || $[86] !== t9) {
345
+ t34 = <T1 testID={t8} accessibilityRole={t9} accessibilityLabel={t10} onPress={t11} hitSlop={t12} className={t13} style={t14}>{t33}</T1>;
346
+ $[78] = T1;
347
+ $[79] = t10;
348
+ $[80] = t11;
349
+ $[81] = t12;
350
+ $[82] = t13;
351
+ $[83] = t14;
352
+ $[84] = t33;
353
+ $[85] = t8;
354
+ $[86] = t9;
355
+ $[87] = t34;
356
+ } else {
357
+ t34 = $[87];
358
+ }
359
+ let t35;
360
+ if ($[88] !== T2 || $[89] !== t15 || $[90] !== t16 || $[91] !== t17 || $[92] !== t18 || $[93] !== t19 || $[94] !== t20 || $[95] !== t21 || $[96] !== t34) {
361
+ t35 = <T2 testID={t15} accessibilityViewIsModal={t16} accessibilityLabel={t17} onAccessibilityEscape={t18} className={t19} style={t20}>{t21}{t34}</T2>;
362
+ $[88] = T2;
363
+ $[89] = t15;
364
+ $[90] = t16;
365
+ $[91] = t17;
366
+ $[92] = t18;
367
+ $[93] = t19;
368
+ $[94] = t20;
369
+ $[95] = t21;
370
+ $[96] = t34;
371
+ $[97] = t35;
372
+ } else {
373
+ t35 = $[97];
374
+ }
375
+ let t36;
376
+ if ($[98] !== T3 || $[99] !== t22 || $[100] !== t23 || $[101] !== t35) {
377
+ t36 = <T3 pointerEvents={t22} style={t23}>{t35}</T3>;
378
+ $[98] = T3;
379
+ $[99] = t22;
380
+ $[100] = t23;
381
+ $[101] = t35;
382
+ $[102] = t36;
383
+ } else {
384
+ t36 = $[102];
385
+ }
386
+ let t37;
387
+ if ($[103] !== T4 || $[104] !== t24 || $[105] !== t25 || $[106] !== t26 || $[107] !== t27 || $[108] !== t28 || $[109] !== t29 || $[110] !== t36) {
388
+ t37 = <T4 visible={t24} transparent={t25} animationType={t26} statusBarTranslucent={t27} onRequestClose={t28}>{t29}{t36}</T4>;
389
+ $[103] = T4;
390
+ $[104] = t24;
391
+ $[105] = t25;
392
+ $[106] = t26;
393
+ $[107] = t27;
394
+ $[108] = t28;
395
+ $[109] = t29;
396
+ $[110] = t36;
397
+ $[111] = t37;
398
+ } else {
399
+ t37 = $[111];
400
+ }
401
+ return t37;
402
+ }
403
+ const styles = StyleSheet.create({
404
+ anchor: {
405
+ flex: 1,
406
+ justifyContent: "flex-end"
407
+ }
408
+ });
@@ -0,0 +1,241 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useContext } from "react";
3
+ import { Pressable, Text, View } from "react-native";
4
+ import { cn } from "../cn";
5
+ import { MIN_TOUCH_TARGET, sizeStyle, textStyle, touchSlop, typeStyle } from "../controlStyles";
6
+ import { withAlpha } from "../palette";
7
+ import { useLargerText } from "../theme";
8
+ import { useScheme } from "../useScheme";
9
+ import { chatTextSize } from "./chat-text";
10
+ import { ChatTextColorContext } from "./response-text";
11
+ /** Lines of the quoted text before it is cut with an ellipsis. */
12
+ export const QUOTE_MAX_LINES = 2;
13
+
14
+ /**
15
+ * A compact quote inside a message bubble, above the message text: a left
16
+ * border, the author in the caption size and the quoted text on up to two
17
+ * lines. It takes its colour from the enclosing `MessageContent`, so it reads
18
+ * on the primary user bubble as well as on the tint and assistant ones. With
19
+ * `onPress` it is a button (44 point minimum height).
20
+ */
21
+ export function MessageQuote(t0) {
22
+ const $ = _c(62);
23
+ const {
24
+ author,
25
+ text,
26
+ onPress,
27
+ accessibilityLabel,
28
+ className,
29
+ testID
30
+ } = t0;
31
+ const scheme = useScheme();
32
+ const largerText = useLargerText();
33
+ const inherited = useContext(ChatTextColorContext);
34
+ let t1;
35
+ if ($[0] !== inherited || $[1] !== scheme) {
36
+ t1 = inherited ?? textStyle("foreground", scheme).color;
37
+ $[0] = inherited;
38
+ $[1] = scheme;
39
+ $[2] = t1;
40
+ } else {
41
+ t1 = $[2];
42
+ }
43
+ const color = t1;
44
+ let T0;
45
+ let t2;
46
+ let t3;
47
+ let t4;
48
+ let t5;
49
+ if ($[3] !== author || $[4] !== color || $[5] !== largerText) {
50
+ const caption = chatTextSize("caption", largerText);
51
+ const body = chatTextSize("small", largerText);
52
+ const t6 = cn(caption, "font-instrument-sans-semibold");
53
+ const t7 = sizeStyle(caption);
54
+ let t8;
55
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
56
+ t8 = typeStyle("semibold");
57
+ $[11] = t8;
58
+ } else {
59
+ t8 = $[11];
60
+ }
61
+ let t9;
62
+ if ($[12] !== color) {
63
+ t9 = withAlpha(color, 0.75);
64
+ $[12] = color;
65
+ $[13] = t9;
66
+ } else {
67
+ t9 = $[13];
68
+ }
69
+ let t10;
70
+ if ($[14] !== t9) {
71
+ t10 = {
72
+ color: t9
73
+ };
74
+ $[14] = t9;
75
+ $[15] = t10;
76
+ } else {
77
+ t10 = $[15];
78
+ }
79
+ let t11;
80
+ if ($[16] !== t10 || $[17] !== t7) {
81
+ t11 = [t7, t8, t10];
82
+ $[16] = t10;
83
+ $[17] = t7;
84
+ $[18] = t11;
85
+ } else {
86
+ t11 = $[18];
87
+ }
88
+ if ($[19] !== author || $[20] !== t11 || $[21] !== t6) {
89
+ t5 = <Text numberOfLines={1} className={t6} style={t11}>{author}</Text>;
90
+ $[19] = author;
91
+ $[20] = t11;
92
+ $[21] = t6;
93
+ $[22] = t5;
94
+ } else {
95
+ t5 = $[22];
96
+ }
97
+ T0 = Text;
98
+ t3 = QUOTE_MAX_LINES;
99
+ t4 = cn(body, "font-instrument-sans");
100
+ t2 = sizeStyle(body);
101
+ $[3] = author;
102
+ $[4] = color;
103
+ $[5] = largerText;
104
+ $[6] = T0;
105
+ $[7] = t2;
106
+ $[8] = t3;
107
+ $[9] = t4;
108
+ $[10] = t5;
109
+ } else {
110
+ T0 = $[6];
111
+ t2 = $[7];
112
+ t3 = $[8];
113
+ t4 = $[9];
114
+ t5 = $[10];
115
+ }
116
+ let t6;
117
+ if ($[23] !== color) {
118
+ t6 = withAlpha(color, 0.9);
119
+ $[23] = color;
120
+ $[24] = t6;
121
+ } else {
122
+ t6 = $[24];
123
+ }
124
+ let t7;
125
+ if ($[25] !== t6) {
126
+ t7 = {
127
+ color: t6
128
+ };
129
+ $[25] = t6;
130
+ $[26] = t7;
131
+ } else {
132
+ t7 = $[26];
133
+ }
134
+ let t8;
135
+ if ($[27] !== t2 || $[28] !== t7) {
136
+ t8 = [t2, t7];
137
+ $[27] = t2;
138
+ $[28] = t7;
139
+ $[29] = t8;
140
+ } else {
141
+ t8 = $[29];
142
+ }
143
+ let t9;
144
+ if ($[30] !== T0 || $[31] !== t3 || $[32] !== t4 || $[33] !== t8 || $[34] !== text) {
145
+ t9 = <T0 numberOfLines={t3} className={t4} style={t8}>{text}</T0>;
146
+ $[30] = T0;
147
+ $[31] = t3;
148
+ $[32] = t4;
149
+ $[33] = t8;
150
+ $[34] = text;
151
+ $[35] = t9;
152
+ } else {
153
+ t9 = $[35];
154
+ }
155
+ let t10;
156
+ if ($[36] !== t5 || $[37] !== t9) {
157
+ t10 = <>{t5}{t9}</>;
158
+ $[36] = t5;
159
+ $[37] = t9;
160
+ $[38] = t10;
161
+ } else {
162
+ t10 = $[38];
163
+ }
164
+ const content = t10;
165
+ let t11;
166
+ if ($[39] !== color) {
167
+ t11 = withAlpha(color, 0.45);
168
+ $[39] = color;
169
+ $[40] = t11;
170
+ } else {
171
+ t11 = $[40];
172
+ }
173
+ let t12;
174
+ if ($[41] !== t11) {
175
+ t12 = {
176
+ borderLeftWidth: 3,
177
+ borderLeftColor: t11,
178
+ borderRadius: 4
179
+ };
180
+ $[41] = t11;
181
+ $[42] = t12;
182
+ } else {
183
+ t12 = $[42];
184
+ }
185
+ const style = t12;
186
+ if (!onPress) {
187
+ const t13 = `Quoted message from ${author}: ${text}`;
188
+ let t14;
189
+ if ($[43] !== className) {
190
+ t14 = cn("min-w-0 gap-0.5 py-0.5 pl-2.5", className);
191
+ $[43] = className;
192
+ $[44] = t14;
193
+ } else {
194
+ t14 = $[44];
195
+ }
196
+ let t15;
197
+ if ($[45] !== content || $[46] !== style || $[47] !== t13 || $[48] !== t14 || $[49] !== testID) {
198
+ t15 = <View testID={testID} accessible={true} accessibilityLabel={t13} className={t14} style={style}>{content}</View>;
199
+ $[45] = content;
200
+ $[46] = style;
201
+ $[47] = t13;
202
+ $[48] = t14;
203
+ $[49] = testID;
204
+ $[50] = t15;
205
+ } else {
206
+ t15 = $[50];
207
+ }
208
+ return t15;
209
+ }
210
+ const t13 = accessibilityLabel ?? `Go to quoted message from ${author}`;
211
+ let t14;
212
+ if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
213
+ t14 = touchSlop(MIN_TOUCH_TARGET);
214
+ $[51] = t14;
215
+ } else {
216
+ t14 = $[51];
217
+ }
218
+ let t15;
219
+ if ($[52] !== className) {
220
+ t15 = cn("min-h-11 min-w-0 justify-center gap-0.5 py-0.5 pl-2.5", className);
221
+ $[52] = className;
222
+ $[53] = t15;
223
+ } else {
224
+ t15 = $[53];
225
+ }
226
+ let t16;
227
+ if ($[54] !== content || $[55] !== onPress || $[56] !== style || $[57] !== t13 || $[58] !== t15 || $[59] !== testID || $[60] !== text) {
228
+ t16 = <Pressable testID={testID} accessibilityRole="button" accessibilityLabel={t13} accessibilityHint={text} onPress={onPress} hitSlop={t14} className={t15} style={style}>{content}</Pressable>;
229
+ $[54] = content;
230
+ $[55] = onPress;
231
+ $[56] = style;
232
+ $[57] = t13;
233
+ $[58] = t15;
234
+ $[59] = testID;
235
+ $[60] = text;
236
+ $[61] = t16;
237
+ } else {
238
+ t16 = $[61];
239
+ }
240
+ return t16;
241
+ }