@vvedantb/native-ui 0.37.1 → 0.38.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 (114) hide show
  1. package/README.md +8 -7
  2. package/dist/AmbientBackground.jsx +16 -28
  3. package/dist/Avatar.jsx +2 -2
  4. package/dist/BottomSheetContainer.jsx +1 -1
  5. package/dist/BulkActionBar.jsx +1 -1
  6. package/dist/Card.jsx +4 -4
  7. package/dist/Chip.jsx +2 -2
  8. package/dist/DateTimeField.jsx +1 -1
  9. package/dist/Dialog.jsx +3 -3
  10. package/dist/DropdownMenu.jsx +3 -3
  11. package/dist/EmptyState.jsx +4 -4
  12. package/dist/FloatingTabBar.jsx +2 -2
  13. package/dist/LabeledSwitchRow.jsx +2 -2
  14. package/dist/ListRow.jsx +2 -2
  15. package/dist/PinnedBotTile.jsx +2 -2
  16. package/dist/StatGrid.jsx +1 -1
  17. package/dist/Stepper.jsx +2 -2
  18. package/dist/Toast.jsx +1 -1
  19. package/dist/ai/activity-question.jsx +2 -2
  20. package/dist/ai/card-button.jsx +2 -2
  21. package/dist/ai/choice-question.jsx +8 -8
  22. package/dist/ai/message-action-sheet.jsx +2 -2
  23. package/dist/ai/message-quote.jsx +2 -2
  24. package/dist/ai/message.jsx +2 -2
  25. package/dist/ai/reply-quote-chip.jsx +2 -2
  26. package/dist/ai/subagent-cards.jsx +6 -6
  27. package/dist/ai/tool-approval-card.jsx +1 -1
  28. package/dist/app-root/AuthGroupGate.jsx +65 -0
  29. package/dist/app-root/SsoCallbackScreen.jsx +97 -0
  30. package/dist/app-root/fonts.js +88 -0
  31. package/dist/app-root/index.js +3 -0
  32. package/dist/auth/AuthScreen.jsx +252 -74
  33. package/dist/auth/SecondFactorScreen.jsx +18 -12
  34. package/dist/auth/SignInScreen.jsx +40 -17
  35. package/dist/crash/LastCrashDialog.jsx +56 -0
  36. package/dist/crash/lastCrash.js +213 -0
  37. package/dist/entries/app-root.js +6 -0
  38. package/dist/entries/crash.js +5 -0
  39. package/dist/entries/theme.js +3 -0
  40. package/dist/examples/ParityGallery.jsx +2 -2
  41. package/dist/generative-ui/components.jsx +2 -2
  42. package/dist/index.js +3 -0
  43. package/dist/marketing/UpgradeToProCard.jsx +2 -2
  44. package/dist/media/ImageGallery.jsx +2 -2
  45. package/dist/motion.js +3 -2
  46. package/dist/neutralTheme.js +163 -0
  47. package/dist/primitives/card.jsx +2 -2
  48. package/dist/primitives/icon.jsx +0 -4
  49. package/dist/primitives/select.jsx +0 -2
  50. package/dist/primitives/text.jsx +13 -13
  51. package/dist/primitives/toast-drag-gesture.jsx +3 -2
  52. package/dist/settings/MoreFromProjectV.jsx +2 -2
  53. package/dist/settings/SettingsSection.jsx +1 -1
  54. package/dist/settings/ThemeModePicker.jsx +8 -11
  55. package/dist/themeModeStore.js +67 -0
  56. package/dist/themeModes.js +9 -0
  57. package/package.json +47 -19
  58. package/src/AmbientBackground.tsx +8 -26
  59. package/src/Avatar.tsx +2 -2
  60. package/src/BottomSheetContainer.tsx +1 -1
  61. package/src/BulkActionBar.tsx +2 -2
  62. package/src/Card.tsx +5 -5
  63. package/src/Chip.tsx +2 -2
  64. package/src/DateTimeField.tsx +2 -2
  65. package/src/Dialog.tsx +3 -3
  66. package/src/DropdownMenu.tsx +3 -3
  67. package/src/EmptyState.tsx +4 -4
  68. package/src/FloatingTabBar.tsx +2 -2
  69. package/src/LabeledSwitchRow.tsx +2 -2
  70. package/src/ListRow.tsx +2 -2
  71. package/src/PinnedBotTile.tsx +2 -2
  72. package/src/StatGrid.tsx +2 -2
  73. package/src/Stepper.tsx +2 -2
  74. package/src/Toast.tsx +2 -2
  75. package/src/ai/activity-question.tsx +1 -1
  76. package/src/ai/card-button.tsx +1 -1
  77. package/src/ai/choice-question.tsx +10 -10
  78. package/src/ai/message-action-sheet.tsx +2 -2
  79. package/src/ai/message-quote.tsx +2 -2
  80. package/src/ai/message.tsx +2 -2
  81. package/src/ai/reply-quote-chip.tsx +2 -2
  82. package/src/ai/subagent-cards.tsx +5 -5
  83. package/src/ai/tool-approval-card.tsx +4 -4
  84. package/src/app-root/AuthGroupGate.tsx +46 -0
  85. package/src/app-root/SsoCallbackScreen.tsx +62 -0
  86. package/src/app-root/fonts.ts +55 -0
  87. package/src/app-root/index.ts +6 -0
  88. package/src/auth/AuthScreen.tsx +104 -3
  89. package/src/auth/SecondFactorScreen.tsx +20 -2
  90. package/src/auth/SignInScreen.tsx +119 -53
  91. package/src/crash/LastCrashDialog.tsx +42 -0
  92. package/src/crash/lastCrash.ts +239 -0
  93. package/src/entries/app-root.ts +6 -0
  94. package/src/entries/crash.ts +16 -0
  95. package/src/entries/theme.ts +6 -0
  96. package/src/examples/ParityGallery.tsx +2 -2
  97. package/src/generative-ui/components.tsx +3 -3
  98. package/src/highlight.ts +1 -1
  99. package/src/index.ts +5 -0
  100. package/src/marketing/UpgradeToProCard.tsx +2 -2
  101. package/src/media/ImageGallery.tsx +1 -1
  102. package/src/motion.ts +3 -2
  103. package/src/neutralTheme.ts +130 -0
  104. package/src/primitives/card.tsx +3 -3
  105. package/src/primitives/icon.tsx +0 -2
  106. package/src/primitives/select.tsx +0 -2
  107. package/src/primitives/text.tsx +13 -13
  108. package/src/primitives/toast-drag-gesture.tsx +2 -2
  109. package/src/settings/MoreFromProjectV.tsx +2 -2
  110. package/src/settings/SettingsSection.tsx +3 -3
  111. package/src/settings/ThemeModePicker.tsx +11 -19
  112. package/src/themeModeStore.ts +94 -0
  113. package/src/themeModes.ts +10 -0
  114. package/types/prism-react-renderer.d.ts +22 -0
@@ -77,7 +77,7 @@ function StatusPill(t0) {
77
77
  t7 = $[19];
78
78
  }
79
79
  T0 = Text;
80
- t2 = cn(caption, "font-instrument-sans-semibold");
80
+ t2 = cn(caption, "font-instrument-sans-medium");
81
81
  t1 = sizeStyle(caption);
82
82
  $[0] = largerText;
83
83
  $[1] = scheme;
@@ -107,7 +107,7 @@ function StatusPill(t0) {
107
107
  }
108
108
  let t8;
109
109
  if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
110
- t8 = typeStyle("semibold");
110
+ t8 = typeStyle("medium");
111
111
  $[20] = t8;
112
112
  } else {
113
113
  t8 = $[20];
@@ -227,11 +227,11 @@ export function SubagentRunCard(t0) {
227
227
  } else {
228
228
  t10 = $[29];
229
229
  }
230
- const t11 = cn(body, "min-w-0 flex-1 font-instrument-sans-semibold");
230
+ const t11 = cn(body, "min-w-0 flex-1 font-instrument-sans-medium");
231
231
  const t12 = sizeStyle(body);
232
232
  let t13;
233
233
  if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
234
- t13 = typeStyle("semibold");
234
+ t13 = typeStyle("medium");
235
235
  $[30] = t13;
236
236
  } else {
237
237
  t13 = $[30];
@@ -434,11 +434,11 @@ export function SubagentResultCard(t0) {
434
434
  } else {
435
435
  t9 = $[26];
436
436
  }
437
- const t13 = cn(body, "min-w-0 flex-1 font-instrument-sans-semibold");
437
+ const t13 = cn(body, "min-w-0 flex-1 font-instrument-sans-medium");
438
438
  const t14 = sizeStyle(body);
439
439
  let t15;
440
440
  if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
441
- t15 = typeStyle("semibold");
441
+ t15 = typeStyle("medium");
442
442
  $[27] = t15;
443
443
  } else {
444
444
  t15 = $[27];
@@ -291,7 +291,7 @@ function ToolCardBase(t0) {
291
291
  } else {
292
292
  t34 = $[59];
293
293
  }
294
- return <View testID={testID} accessible={false} accessibilityLabel={`${heading}: ${toolName}`} className={t16} style={t21}><View className="flex-row items-center gap-2">{t24}<Text className={cn(caption, "font-instrument-sans-semibold")} style={[sizeStyle(caption), typeStyle("semibold"), textStyle("muted", scheme)]}>{pending ? "Sending decision\u2026" : heading}</Text></View>{showMeta ? meta ?? <Text testID={`${testID}-meta`} className={caption} style={[sizeStyle(caption), textStyle("muted", scheme)]}>{metaText}</Text> : null}{chrome}<Text testID={`${testID}-name`} numberOfLines={2} className={cn(body, "font-instrument-sans-semibold")} style={[sizeStyle(body), typeStyle("semibold"), textStyle("foreground", scheme)]}>{toolName}</Text>{target ? <Text testID={`${testID}-target`} className={small} style={[sizeStyle(small), textStyle("muted", scheme)]}>{`Target: ${target}`}</Text> : null}{hasFields ? edits ? <View testID={`${testID}-editor`} className="gap-2">{fields.map(field_2 => <View key={field_2.key} className="gap-1"><Text className={caption} style={[sizeStyle(caption), textStyle("muted", scheme)]}>{DRAFT_ROLE_LABELS[field_2.role]}</Text>{field_2.role === "body" ? <Textarea testID={`${testID}-field-${field_2.key}`} value={edits[field_2.key] ?? ""} onChangeText={value => setEdits({
294
+ return <View testID={testID} accessible={false} accessibilityLabel={`${heading}: ${toolName}`} className={t16} style={t21}><View className="flex-row items-center gap-2">{t24}<Text className={cn(caption, "font-instrument-sans-medium")} style={[sizeStyle(caption), typeStyle("medium"), textStyle("muted", scheme)]}>{pending ? "Sending decision\u2026" : heading}</Text></View>{showMeta ? meta ?? <Text testID={`${testID}-meta`} className={caption} style={[sizeStyle(caption), textStyle("muted", scheme)]}>{metaText}</Text> : null}{chrome}<Text testID={`${testID}-name`} numberOfLines={2} className={cn(body, "font-instrument-sans-medium")} style={[sizeStyle(body), typeStyle("medium"), textStyle("foreground", scheme)]}>{toolName}</Text>{target ? <Text testID={`${testID}-target`} className={small} style={[sizeStyle(small), textStyle("muted", scheme)]}>{`Target: ${target}`}</Text> : null}{hasFields ? edits ? <View testID={`${testID}-editor`} className="gap-2">{fields.map(field_2 => <View key={field_2.key} className="gap-1"><Text className={caption} style={[sizeStyle(caption), textStyle("muted", scheme)]}>{DRAFT_ROLE_LABELS[field_2.role]}</Text>{field_2.role === "body" ? <Textarea testID={`${testID}-field-${field_2.key}`} value={edits[field_2.key] ?? ""} onChangeText={value => setEdits({
295
295
  ...edits,
296
296
  [field_2.key]: value
297
297
  })} numberOfLines={8} accessibilityLabel={DRAFT_ROLE_LABELS[field_2.role]} /> : <Input testID={`${testID}-field-${field_2.key}`} value={edits[field_2.key] ?? ""} onChangeText={value_0 => setEdits({
@@ -0,0 +1,65 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useAuth } from "@clerk/expo";
3
+ import { Redirect } from "expo-router";
4
+ /**
5
+ * The layout of an `(auth)` route group: waits for Clerk when asked, sends signed-in
6
+ * users on, and renders the auth stack otherwise. The app passes its own loading UI.
7
+ */
8
+ export function AuthGroupGate(t0) {
9
+ const $ = _c(7);
10
+ const {
11
+ children,
12
+ waitForLoaded: t1,
13
+ loading: t2,
14
+ treatPendingAsSignedOut,
15
+ signedInHref: t3,
16
+ withAnchor,
17
+ skipSignedInRedirect: t4,
18
+ previewHref
19
+ } = t0;
20
+ const waitForLoaded = t1 === undefined ? true : t1;
21
+ const loading = t2 === undefined ? null : t2;
22
+ const signedInHref = t3 === undefined ? "/" : t3;
23
+ const skipSignedInRedirect = t4 === undefined ? false : t4;
24
+ let t5;
25
+ if ($[0] !== treatPendingAsSignedOut) {
26
+ t5 = treatPendingAsSignedOut === undefined ? undefined : {
27
+ treatPendingAsSignedOut
28
+ };
29
+ $[0] = treatPendingAsSignedOut;
30
+ $[1] = t5;
31
+ } else {
32
+ t5 = $[1];
33
+ }
34
+ const {
35
+ isSignedIn,
36
+ isLoaded
37
+ } = useAuth(t5);
38
+ if (waitForLoaded && !isLoaded) {
39
+ return loading;
40
+ }
41
+ if (isSignedIn && !skipSignedInRedirect) {
42
+ let t6;
43
+ if ($[2] !== signedInHref || $[3] !== withAnchor) {
44
+ t6 = <Redirect href={signedInHref} withAnchor={withAnchor} />;
45
+ $[2] = signedInHref;
46
+ $[3] = withAnchor;
47
+ $[4] = t6;
48
+ } else {
49
+ t6 = $[4];
50
+ }
51
+ return t6;
52
+ }
53
+ if (previewHref) {
54
+ let t6;
55
+ if ($[5] !== previewHref) {
56
+ t6 = <Redirect href={previewHref} />;
57
+ $[5] = previewHref;
58
+ $[6] = t6;
59
+ } else {
60
+ t6 = $[6];
61
+ }
62
+ return t6;
63
+ }
64
+ return children;
65
+ }
@@ -0,0 +1,97 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useAuth } from "@clerk/expo";
3
+ import { Redirect, useRouter } from "expo-router";
4
+ import { View } from "react-native";
5
+ import { Button } from "../Button";
6
+ import { CenteredSpinner } from "../Spinner";
7
+ const DEFAULT_LOADING = <CenteredSpinner label="Signing in" />;
8
+
9
+ /**
10
+ * The `sso-callback` route of the Google sign-in redirect. `useSSO` completes the
11
+ * session; this screen only waits for it, then opens the app.
12
+ */
13
+ export function SsoCallbackScreen(t0) {
14
+ const $ = _c(19);
15
+ const {
16
+ signedInHref: t1,
17
+ signedOutHref: t2,
18
+ withAnchor,
19
+ treatPendingAsSignedOut,
20
+ loading: t3,
21
+ backLabel,
22
+ className: t4
23
+ } = t0;
24
+ const signedInHref = t1 === undefined ? "/" : t1;
25
+ const signedOutHref = t2 === undefined ? "/sign-in" : t2;
26
+ const loading = t3 === undefined ? DEFAULT_LOADING : t3;
27
+ const className = t4 === undefined ? "flex-1 items-center justify-center gap-6 px-6" : t4;
28
+ let t5;
29
+ if ($[0] !== treatPendingAsSignedOut) {
30
+ t5 = treatPendingAsSignedOut === undefined ? undefined : {
31
+ treatPendingAsSignedOut
32
+ };
33
+ $[0] = treatPendingAsSignedOut;
34
+ $[1] = t5;
35
+ } else {
36
+ t5 = $[1];
37
+ }
38
+ const {
39
+ isLoaded,
40
+ isSignedIn
41
+ } = useAuth(t5);
42
+ const router = useRouter();
43
+ if (isLoaded && isSignedIn) {
44
+ let t6;
45
+ if ($[2] !== signedInHref || $[3] !== withAnchor) {
46
+ t6 = <Redirect href={signedInHref} withAnchor={withAnchor} />;
47
+ $[2] = signedInHref;
48
+ $[3] = withAnchor;
49
+ $[4] = t6;
50
+ } else {
51
+ t6 = $[4];
52
+ }
53
+ return t6;
54
+ }
55
+ if (backLabel === undefined) {
56
+ let t6;
57
+ if ($[5] !== isLoaded || $[6] !== loading || $[7] !== signedOutHref) {
58
+ t6 = isLoaded ? <Redirect href={signedOutHref} /> : loading;
59
+ $[5] = isLoaded;
60
+ $[6] = loading;
61
+ $[7] = signedOutHref;
62
+ $[8] = t6;
63
+ } else {
64
+ t6 = $[8];
65
+ }
66
+ return t6;
67
+ }
68
+ let t6;
69
+ if ($[9] !== router || $[10] !== signedOutHref) {
70
+ t6 = () => router.replace(signedOutHref);
71
+ $[9] = router;
72
+ $[10] = signedOutHref;
73
+ $[11] = t6;
74
+ } else {
75
+ t6 = $[11];
76
+ }
77
+ let t7;
78
+ if ($[12] !== backLabel || $[13] !== t6) {
79
+ t7 = <Button variant="ghost" fullWidth={false} onPress={t6}>{backLabel}</Button>;
80
+ $[12] = backLabel;
81
+ $[13] = t6;
82
+ $[14] = t7;
83
+ } else {
84
+ t7 = $[14];
85
+ }
86
+ let t8;
87
+ if ($[15] !== className || $[16] !== loading || $[17] !== t7) {
88
+ t8 = <View className={className}>{loading}{t7}</View>;
89
+ $[15] = className;
90
+ $[16] = loading;
91
+ $[17] = t7;
92
+ $[18] = t8;
93
+ } else {
94
+ t8 = $[18];
95
+ }
96
+ return t8;
97
+ }
@@ -0,0 +1,88 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { InstrumentSans_400Regular } from "@expo-google-fonts/instrument-sans/400Regular";
3
+ import { InstrumentSans_500Medium } from "@expo-google-fonts/instrument-sans/500Medium";
4
+ import { InstrumentSans_600SemiBold } from "@expo-google-fonts/instrument-sans/600SemiBold";
5
+ import { InstrumentSans_700Bold } from "@expo-google-fonts/instrument-sans/700Bold";
6
+ import { InstrumentSans_400Regular_Italic } from "@expo-google-fonts/instrument-sans/400Regular_Italic";
7
+ import { InstrumentSans_500Medium_Italic } from "@expo-google-fonts/instrument-sans/500Medium_Italic";
8
+ import { InstrumentSans_600SemiBold_Italic } from "@expo-google-fonts/instrument-sans/600SemiBold_Italic";
9
+ import { InstrumentSans_700Bold_Italic } from "@expo-google-fonts/instrument-sans/700Bold_Italic";
10
+ import { useFonts } from "expo-font";
11
+ import * as SplashScreen from "expo-splash-screen";
12
+ import { useEffect } from "react";
13
+
14
+ /** The font sources `useFonts` takes: family name to module. */
15
+
16
+ const UPRIGHT = {
17
+ InstrumentSans_400Regular,
18
+ InstrumentSans_500Medium,
19
+ InstrumentSans_600SemiBold,
20
+ InstrumentSans_700Bold
21
+ };
22
+ const ITALIC = {
23
+ InstrumentSans_400Regular_Italic,
24
+ InstrumentSans_500Medium_Italic,
25
+ InstrumentSans_600SemiBold_Italic,
26
+ InstrumentSans_700Bold_Italic
27
+ };
28
+
29
+ /** The Instrument Sans fonts the `font-instrument-sans*` classes use, plus any `extra`. */
30
+ export function instrumentSansFontMap({
31
+ italics = false,
32
+ extra
33
+ } = {}) {
34
+ return {
35
+ ...extra,
36
+ ...UPRIGHT,
37
+ ...(italics ? ITALIC : undefined)
38
+ };
39
+ }
40
+
41
+ /** `[loaded, error]` as `useFonts` returns them, for the Instrument Sans map. */
42
+ export function useInstrumentSansFonts(t0) {
43
+ const $ = _c(4);
44
+ let t1;
45
+ if ($[0] !== t0) {
46
+ t1 = t0 === undefined ? {} : t0;
47
+ $[0] = t0;
48
+ $[1] = t1;
49
+ } else {
50
+ t1 = $[1];
51
+ }
52
+ const options = t1;
53
+ let t2;
54
+ if ($[2] !== options) {
55
+ t2 = instrumentSansFontMap(options);
56
+ $[2] = options;
57
+ $[3] = t2;
58
+ } else {
59
+ t2 = $[3];
60
+ }
61
+ return useFonts(t2);
62
+ }
63
+
64
+ /**
65
+ * Hides the native splash once `ready` is true. Call `SplashScreen.preventAutoHideAsync()`
66
+ * at module load in the app, so the call site keeps the timing. A failed hide is ignored.
67
+ */
68
+ export function useHideSplashWhenReady(ready) {
69
+ const $ = _c(3);
70
+ let t0;
71
+ let t1;
72
+ if ($[0] !== ready) {
73
+ t0 = () => {
74
+ if (ready) {
75
+ SplashScreen.hideAsync().catch(_temp);
76
+ }
77
+ };
78
+ t1 = [ready];
79
+ $[0] = ready;
80
+ $[1] = t0;
81
+ $[2] = t1;
82
+ } else {
83
+ t0 = $[1];
84
+ t1 = $[2];
85
+ }
86
+ useEffect(t0, t1);
87
+ }
88
+ function _temp() {}
@@ -0,0 +1,3 @@
1
+ export { instrumentSansFontMap, useInstrumentSansFonts, useHideSplashWhenReady } from "./fonts";
2
+ export { AuthGroupGate } from "./AuthGroupGate";
3
+ export { SsoCallbackScreen } from "./SsoCallbackScreen";