@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,344 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { MaterialIcons } from "@expo/vector-icons";
3
+ import React from "react";
4
+ import { PINK_600 } from "./colors";
5
+ import { View } from "react-native";
6
+ import { Button as PrimitiveButton } from "./primitives/button";
7
+ import { Text as PrimitiveText } from "./primitives/text";
8
+ import { cn } from "./cn";
9
+ import { buttonColors, sizeStyle, typeStyle } from "./controlStyles";
10
+ import { useDialogLayout } from "./dialogLayout";
11
+ import { floatingShadow } from "./floating";
12
+ import { Spinner } from "./Spinner";
13
+ import { useLargerText } from "./theme";
14
+ import { tokens } from "./tokens";
15
+ import { useScheme } from "./useScheme";
16
+
17
+ /** `sm`, `default` and `lg` are the web names for `small`, `medium` and `large`. `icon` is a square button. */
18
+
19
+ /** The web `shape`. `"pill"` (default) is fully round; `"rounded"` is radius 16, the look before 0.6.0. */
20
+
21
+ const SIZE_ALIAS = {
22
+ small: "small",
23
+ medium: "medium",
24
+ large: "large",
25
+ sm: "small",
26
+ default: "medium",
27
+ lg: "large",
28
+ icon: "icon"
29
+ };
30
+
31
+ // `regular` is the web `Button` (`default` h-10 px-4, `lg` h-11 px-6, `icon`
32
+ // h-10 w-10), except `sm`: the web h-8 `text-xs` is a desktop size, so here it
33
+ // is 36 high with a 14 label (`text-sm`). `larger` is the larger-text step-up from
34
+ // 0.3.2. Labelled sizes are minimum heights (`h-auto` drops the primitive's
35
+ // `h-10`), so a large Dynamic Type size grows the button instead of clipping
36
+ // the label.
37
+ const HEIGHT = {
38
+ regular: {
39
+ small: "h-auto min-h-9 px-3",
40
+ medium: "h-auto min-h-10 px-4",
41
+ large: "h-auto min-h-11 px-6",
42
+ icon: "h-10 w-10 px-0"
43
+ },
44
+ larger: {
45
+ small: "h-auto min-h-14 px-5",
46
+ medium: "h-auto min-h-16 px-6",
47
+ large: "h-auto min-h-[72px] px-6",
48
+ icon: "h-14 w-14 px-0"
49
+ }
50
+ };
51
+
52
+ // Each class is also set as a style (`sizeStyle`): web `text-sm` is 14 / 20.
53
+ const TEXT = {
54
+ regular: {
55
+ small: "text-sm",
56
+ medium: "text-sm",
57
+ large: "text-sm",
58
+ icon: "text-sm"
59
+ },
60
+ larger: {
61
+ small: "text-base",
62
+ medium: "text-xl",
63
+ large: "text-2xl",
64
+ icon: "text-base"
65
+ }
66
+ };
67
+
68
+ // The web sizes are under the 44 pt touch target; the slop brings each to 44
69
+ // or more. `small` (32) slops only above and below: small buttons sit 4 apart
70
+ // in a row (Cancel and Delete), and side slop would let one steal the other's
71
+ // taps. The larger sizes are 56 or more and need none.
72
+ const HIT_SLOP = {
73
+ regular: {
74
+ small: {
75
+ top: 6,
76
+ bottom: 6,
77
+ left: 0,
78
+ right: 0
79
+ },
80
+ medium: 4,
81
+ large: 2,
82
+ icon: 4
83
+ },
84
+ larger: {
85
+ small: undefined,
86
+ medium: undefined,
87
+ large: undefined,
88
+ icon: undefined
89
+ }
90
+ };
91
+
92
+ // The web `shape` (from @vvedantb/ui 0.31.0). `pill` is `rounded-full`:
93
+ // `tokens.radius.pill` (999), far more than half the tallest minimum height
94
+ // (72), so the ends are half circles. `rounded` is `rounded-lg` (`--radius`, 16). The web
95
+ // `rounded` is `rounded-md` on `xs` and `icon-xs`, sizes native does not have,
96
+ // so here it is 16 at every size. Styles, because apps' NativeWind themes set
97
+ // their own `rounded-lg`.
98
+ const RADIUS = {
99
+ pill: tokens.radius.pill,
100
+ rounded: tokens.radius.lg
101
+ };
102
+
103
+ // Colours come from `buttonColors` as styles, except `tinted`, which keeps
104
+ // the pink classes that `outline` used before 0.3.0.
105
+ const VARIANT_CLASS = {
106
+ link: "h-auto border-0 px-0",
107
+ tinted: "border-0 bg-pink-50 dark:bg-pink-900/20"
108
+ };
109
+ const TEXT_CLASS = {
110
+ link: "underline",
111
+ tinted: "text-pink-700 dark:text-pink-300"
112
+ };
113
+ const PRIMITIVE_VARIANT = {
114
+ primary: "default",
115
+ default: "default",
116
+ outline: "outline",
117
+ secondary: "secondary",
118
+ destructive: "destructive",
119
+ ghost: "ghost",
120
+ link: "link",
121
+ tinted: "secondary"
122
+ };
123
+ export function Button(t0) {
124
+ const $ = _c(67);
125
+ let children;
126
+ let className;
127
+ let endContent;
128
+ let icon;
129
+ let leftIcon;
130
+ let loading;
131
+ let onPress;
132
+ let props;
133
+ let startContent;
134
+ let t1;
135
+ let t2;
136
+ let t3;
137
+ let t4;
138
+ let t5;
139
+ if ($[0] !== t0) {
140
+ ({
141
+ onPress,
142
+ variant: t1,
143
+ icon,
144
+ leftIcon,
145
+ startContent,
146
+ endContent,
147
+ loading,
148
+ size: t2,
149
+ shape: t3,
150
+ fullWidth: t4,
151
+ children,
152
+ shadowType: t5,
153
+ className,
154
+ ...props
155
+ } = t0);
156
+ $[0] = t0;
157
+ $[1] = children;
158
+ $[2] = className;
159
+ $[3] = endContent;
160
+ $[4] = icon;
161
+ $[5] = leftIcon;
162
+ $[6] = loading;
163
+ $[7] = onPress;
164
+ $[8] = props;
165
+ $[9] = startContent;
166
+ $[10] = t1;
167
+ $[11] = t2;
168
+ $[12] = t3;
169
+ $[13] = t4;
170
+ $[14] = t5;
171
+ } else {
172
+ children = $[1];
173
+ className = $[2];
174
+ endContent = $[3];
175
+ icon = $[4];
176
+ leftIcon = $[5];
177
+ loading = $[6];
178
+ onPress = $[7];
179
+ props = $[8];
180
+ startContent = $[9];
181
+ t1 = $[10];
182
+ t2 = $[11];
183
+ t3 = $[12];
184
+ t4 = $[13];
185
+ t5 = $[14];
186
+ }
187
+ const variant = t1 === undefined ? "primary" : t1;
188
+ const size = t2 === undefined ? "medium" : t2;
189
+ const shape = t3 === undefined ? "pill" : t3;
190
+ const fullWidth = t4 === undefined ? true : t4;
191
+ const shadowType = t5 === undefined ? "flat" : t5;
192
+ const scale = useLargerText() ? "larger" : "regular";
193
+ const scheme = useScheme();
194
+ const dialog = useDialogLayout();
195
+ const resolvedSize = SIZE_ALIAS[size];
196
+ let t6;
197
+ if ($[15] !== scheme || $[16] !== variant) {
198
+ t6 = buttonColors(variant, scheme);
199
+ $[15] = scheme;
200
+ $[16] = variant;
201
+ $[17] = t6;
202
+ } else {
203
+ t6 = $[17];
204
+ }
205
+ const colors = t6;
206
+ const contentColor = colors?.color ?? PINK_600;
207
+ const elevate = shadowType === "shadow" && (variant === "primary" || variant === "default");
208
+ const t7 = RADIUS[shape];
209
+ let t8;
210
+ if ($[18] !== t7) {
211
+ t8 = {
212
+ borderRadius: t7
213
+ };
214
+ $[18] = t7;
215
+ $[19] = t8;
216
+ } else {
217
+ t8 = $[19];
218
+ }
219
+ const t9 = elevate ? floatingShadow : null;
220
+ let t10;
221
+ if ($[20] !== colors) {
222
+ t10 = colors ? {
223
+ backgroundColor: colors.backgroundColor,
224
+ borderColor: colors.borderColor
225
+ } : null;
226
+ $[20] = colors;
227
+ $[21] = t10;
228
+ } else {
229
+ t10 = $[21];
230
+ }
231
+ let t11;
232
+ if ($[22] !== t10 || $[23] !== t8 || $[24] !== t9) {
233
+ t11 = [t8, t9, t10];
234
+ $[22] = t10;
235
+ $[23] = t8;
236
+ $[24] = t9;
237
+ $[25] = t11;
238
+ } else {
239
+ t11 = $[25];
240
+ }
241
+ const baseStyle = t11;
242
+ const callerStyle = props.style;
243
+ let t12;
244
+ if ($[26] !== contentColor || $[27] !== icon || $[28] !== leftIcon || $[29] !== loading || $[30] !== scale || $[31] !== startContent) {
245
+ t12 = loading ? <Spinner size="sm" color={contentColor} decorative={true} /> : leftIcon ?? startContent ?? (icon ? <MaterialIcons name={icon} size={scale === "larger" ? 26 : 16} color={contentColor} /> : null);
246
+ $[26] = contentColor;
247
+ $[27] = icon;
248
+ $[28] = leftIcon;
249
+ $[29] = loading;
250
+ $[30] = scale;
251
+ $[31] = startContent;
252
+ $[32] = t12;
253
+ } else {
254
+ t12 = $[32];
255
+ }
256
+ const start = t12;
257
+ const t13 = PRIMITIVE_VARIANT[variant];
258
+ const t14 = HIT_SLOP[scale][resolvedSize];
259
+ const t15 = HEIGHT[scale][resolvedSize];
260
+ const t16 = resolvedSize !== "icon" && (fullWidth || dialog.stacked ? "w-full" : "self-start");
261
+ const t17 = dialog.compact && scale === "regular" && resolvedSize !== "icon" && "min-h-11";
262
+ const t18 = VARIANT_CLASS[variant];
263
+ let t19;
264
+ if ($[33] !== className || $[34] !== t15 || $[35] !== t16 || $[36] !== t17 || $[37] !== t18) {
265
+ t19 = cn("relative border", t15, t16, t17, t18, className);
266
+ $[33] = className;
267
+ $[34] = t15;
268
+ $[35] = t16;
269
+ $[36] = t17;
270
+ $[37] = t18;
271
+ $[38] = t19;
272
+ } else {
273
+ t19 = $[38];
274
+ }
275
+ const t20 = loading || props.disabled;
276
+ const t21 = props.accessibilityState;
277
+ const t22 = Boolean(loading || props.disabled);
278
+ const t23 = Boolean(loading);
279
+ let t24;
280
+ if ($[39] !== props.accessibilityState || $[40] !== t22 || $[41] !== t23) {
281
+ t24 = {
282
+ ...t21,
283
+ disabled: t22,
284
+ busy: t23
285
+ };
286
+ $[39] = props.accessibilityState;
287
+ $[40] = t22;
288
+ $[41] = t23;
289
+ $[42] = t24;
290
+ } else {
291
+ t24 = $[42];
292
+ }
293
+ let t25;
294
+ if ($[43] !== baseStyle || $[44] !== callerStyle) {
295
+ t25 = typeof callerStyle === "function" ? state => [baseStyle, callerStyle(state)] : [baseStyle, callerStyle];
296
+ $[43] = baseStyle;
297
+ $[44] = callerStyle;
298
+ $[45] = t25;
299
+ } else {
300
+ t25 = $[45];
301
+ }
302
+ let t26;
303
+ if ($[46] !== children || $[47] !== colors || $[48] !== resolvedSize || $[49] !== scale || $[50] !== variant) {
304
+ t26 = typeof children === "string" || typeof children === "number" ? <PrimitiveText className={cn(TEXT[scale][resolvedSize], "font-instrument-sans-medium", TEXT_CLASS[variant])} style={[colors ? {
305
+ color: colors.color
306
+ } : null, sizeStyle(TEXT[scale][resolvedSize]), typeStyle("medium")]}>{children}</PrimitiveText> : children;
307
+ $[46] = children;
308
+ $[47] = colors;
309
+ $[48] = resolvedSize;
310
+ $[49] = scale;
311
+ $[50] = variant;
312
+ $[51] = t26;
313
+ } else {
314
+ t26 = $[51];
315
+ }
316
+ let t27;
317
+ if ($[52] !== endContent || $[53] !== start || $[54] !== t26) {
318
+ t27 = <View className="flex-row items-center justify-center gap-2">{start}{t26}{endContent}</View>;
319
+ $[52] = endContent;
320
+ $[53] = start;
321
+ $[54] = t26;
322
+ $[55] = t27;
323
+ } else {
324
+ t27 = $[55];
325
+ }
326
+ let t28;
327
+ if ($[56] !== onPress || $[57] !== props || $[58] !== shape || $[59] !== t13 || $[60] !== t14 || $[61] !== t19 || $[62] !== t20 || $[63] !== t24 || $[64] !== t25 || $[65] !== t27) {
328
+ t28 = <PrimitiveButton onPress={onPress} variant={t13} shape={shape} hitSlop={t14} accessibilityRole="button" className={t19} {...props} disabled={t20} accessibilityState={t24} style={t25}>{t27}</PrimitiveButton>;
329
+ $[56] = onPress;
330
+ $[57] = props;
331
+ $[58] = shape;
332
+ $[59] = t13;
333
+ $[60] = t14;
334
+ $[61] = t19;
335
+ $[62] = t20;
336
+ $[63] = t24;
337
+ $[64] = t25;
338
+ $[65] = t27;
339
+ $[66] = t28;
340
+ } else {
341
+ t28 = $[66];
342
+ }
343
+ return t28;
344
+ }
@@ -0,0 +1,104 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { Pressable, View } from "react-native";
3
+ import { cn } from "./cn";
4
+ import { withAlpha } from "./palette";
5
+ import { tokens } from "./tokens";
6
+ /** Shutter metrics: outer diameter, ring width and the gap inside the ring. */
7
+ export const CAPTURE_BUTTON = {
8
+ size: 76,
9
+ ring: 4,
10
+ gap: 4
11
+ };
12
+
13
+ /**
14
+ * A camera shutter: a 76 white ring around a white disc, for a live preview in
15
+ * light and dark alike. The disc shrinks to 90% while pressed. Larger than the
16
+ * 44 target, so it needs no hit slop. A labelled button, dimmed and ignoring
17
+ * presses when `disabled`.
18
+ */
19
+ export function CaptureButton(t0) {
20
+ const $ = _c(15);
21
+ const {
22
+ onPress,
23
+ disabled: t1,
24
+ testID,
25
+ accessibilityLabel: t2
26
+ } = t0;
27
+ const disabled = t1 === undefined ? false : t1;
28
+ const accessibilityLabel = t2 === undefined ? "Take photo" : t2;
29
+ const {
30
+ size,
31
+ ring,
32
+ gap
33
+ } = CAPTURE_BUTTON;
34
+ const inner = size - 2 * (ring + gap);
35
+ let t3;
36
+ if ($[0] !== disabled) {
37
+ t3 = {
38
+ disabled
39
+ };
40
+ $[0] = disabled;
41
+ $[1] = t3;
42
+ } else {
43
+ t3 = $[1];
44
+ }
45
+ const t4 = disabled && "opacity-50";
46
+ let t5;
47
+ if ($[2] !== t4) {
48
+ t5 = cn("items-center justify-center", t4);
49
+ $[2] = t4;
50
+ $[3] = t5;
51
+ } else {
52
+ t5 = $[3];
53
+ }
54
+ let t6;
55
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
56
+ t6 = {
57
+ width: size,
58
+ height: size,
59
+ borderRadius: size / 2,
60
+ borderWidth: ring,
61
+ borderColor: tokens.color.white,
62
+ backgroundColor: withAlpha(tokens.color.black, 0.15)
63
+ };
64
+ $[4] = t6;
65
+ } else {
66
+ t6 = $[4];
67
+ }
68
+ let t7;
69
+ if ($[5] !== disabled) {
70
+ t7 = t8 => {
71
+ const {
72
+ pressed
73
+ } = t8;
74
+ return <View style={{
75
+ width: inner,
76
+ height: inner,
77
+ borderRadius: inner / 2,
78
+ backgroundColor: tokens.color.white,
79
+ transform: [{
80
+ scale: pressed && !disabled ? 0.9 : 1
81
+ }]
82
+ }} />;
83
+ };
84
+ $[5] = disabled;
85
+ $[6] = t7;
86
+ } else {
87
+ t7 = $[6];
88
+ }
89
+ let t8;
90
+ if ($[7] !== accessibilityLabel || $[8] !== disabled || $[9] !== onPress || $[10] !== t3 || $[11] !== t5 || $[12] !== t7 || $[13] !== testID) {
91
+ t8 = <Pressable testID={testID} accessibilityRole="button" accessibilityLabel={accessibilityLabel} accessibilityState={t3} disabled={disabled} onPress={onPress} className={t5} style={t6}>{t7}</Pressable>;
92
+ $[7] = accessibilityLabel;
93
+ $[8] = disabled;
94
+ $[9] = onPress;
95
+ $[10] = t3;
96
+ $[11] = t5;
97
+ $[12] = t7;
98
+ $[13] = testID;
99
+ $[14] = t8;
100
+ } else {
101
+ t8 = $[14];
102
+ }
103
+ return t8;
104
+ }