@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.
- package/README.md +8 -7
- package/dist/AmbientBackground.jsx +16 -28
- package/dist/Avatar.jsx +2 -2
- package/dist/BottomSheetContainer.jsx +1 -1
- package/dist/BulkActionBar.jsx +1 -1
- package/dist/Card.jsx +4 -4
- package/dist/Chip.jsx +2 -2
- package/dist/DateTimeField.jsx +1 -1
- package/dist/Dialog.jsx +3 -3
- package/dist/DropdownMenu.jsx +3 -3
- package/dist/EmptyState.jsx +4 -4
- package/dist/FloatingTabBar.jsx +2 -2
- package/dist/LabeledSwitchRow.jsx +2 -2
- package/dist/ListRow.jsx +2 -2
- package/dist/PinnedBotTile.jsx +2 -2
- package/dist/StatGrid.jsx +1 -1
- package/dist/Stepper.jsx +2 -2
- package/dist/Toast.jsx +1 -1
- package/dist/ai/activity-question.jsx +2 -2
- package/dist/ai/card-button.jsx +2 -2
- package/dist/ai/choice-question.jsx +8 -8
- package/dist/ai/message-action-sheet.jsx +2 -2
- package/dist/ai/message-quote.jsx +2 -2
- package/dist/ai/message.jsx +2 -2
- package/dist/ai/reply-quote-chip.jsx +2 -2
- package/dist/ai/subagent-cards.jsx +6 -6
- package/dist/ai/tool-approval-card.jsx +1 -1
- package/dist/app-root/AuthGroupGate.jsx +65 -0
- package/dist/app-root/SsoCallbackScreen.jsx +97 -0
- package/dist/app-root/fonts.js +88 -0
- package/dist/app-root/index.js +3 -0
- package/dist/auth/AuthScreen.jsx +252 -74
- package/dist/auth/SecondFactorScreen.jsx +18 -12
- package/dist/auth/SignInScreen.jsx +40 -17
- package/dist/crash/LastCrashDialog.jsx +56 -0
- package/dist/crash/lastCrash.js +213 -0
- package/dist/entries/app-root.js +6 -0
- package/dist/entries/crash.js +5 -0
- package/dist/entries/theme.js +3 -0
- package/dist/examples/ParityGallery.jsx +2 -2
- package/dist/generative-ui/components.jsx +2 -2
- package/dist/index.js +3 -0
- package/dist/marketing/UpgradeToProCard.jsx +2 -2
- package/dist/media/ImageGallery.jsx +2 -2
- package/dist/motion.js +3 -2
- package/dist/neutralTheme.js +163 -0
- package/dist/primitives/card.jsx +2 -2
- package/dist/primitives/icon.jsx +0 -4
- package/dist/primitives/select.jsx +0 -2
- package/dist/primitives/text.jsx +13 -13
- package/dist/primitives/toast-drag-gesture.jsx +3 -2
- package/dist/settings/MoreFromProjectV.jsx +2 -2
- package/dist/settings/SettingsSection.jsx +1 -1
- package/dist/settings/ThemeModePicker.jsx +8 -11
- package/dist/themeModeStore.js +67 -0
- package/dist/themeModes.js +9 -0
- package/package.json +47 -19
- package/src/AmbientBackground.tsx +8 -26
- package/src/Avatar.tsx +2 -2
- package/src/BottomSheetContainer.tsx +1 -1
- package/src/BulkActionBar.tsx +2 -2
- package/src/Card.tsx +5 -5
- package/src/Chip.tsx +2 -2
- package/src/DateTimeField.tsx +2 -2
- package/src/Dialog.tsx +3 -3
- package/src/DropdownMenu.tsx +3 -3
- package/src/EmptyState.tsx +4 -4
- package/src/FloatingTabBar.tsx +2 -2
- package/src/LabeledSwitchRow.tsx +2 -2
- package/src/ListRow.tsx +2 -2
- package/src/PinnedBotTile.tsx +2 -2
- package/src/StatGrid.tsx +2 -2
- package/src/Stepper.tsx +2 -2
- package/src/Toast.tsx +2 -2
- package/src/ai/activity-question.tsx +1 -1
- package/src/ai/card-button.tsx +1 -1
- package/src/ai/choice-question.tsx +10 -10
- package/src/ai/message-action-sheet.tsx +2 -2
- package/src/ai/message-quote.tsx +2 -2
- package/src/ai/message.tsx +2 -2
- package/src/ai/reply-quote-chip.tsx +2 -2
- package/src/ai/subagent-cards.tsx +5 -5
- package/src/ai/tool-approval-card.tsx +4 -4
- package/src/app-root/AuthGroupGate.tsx +46 -0
- package/src/app-root/SsoCallbackScreen.tsx +62 -0
- package/src/app-root/fonts.ts +55 -0
- package/src/app-root/index.ts +6 -0
- package/src/auth/AuthScreen.tsx +104 -3
- package/src/auth/SecondFactorScreen.tsx +20 -2
- package/src/auth/SignInScreen.tsx +119 -53
- package/src/crash/LastCrashDialog.tsx +42 -0
- package/src/crash/lastCrash.ts +239 -0
- package/src/entries/app-root.ts +6 -0
- package/src/entries/crash.ts +16 -0
- package/src/entries/theme.ts +6 -0
- package/src/examples/ParityGallery.tsx +2 -2
- package/src/generative-ui/components.tsx +3 -3
- package/src/highlight.ts +1 -1
- package/src/index.ts +5 -0
- package/src/marketing/UpgradeToProCard.tsx +2 -2
- package/src/media/ImageGallery.tsx +1 -1
- package/src/motion.ts +3 -2
- package/src/neutralTheme.ts +130 -0
- package/src/primitives/card.tsx +3 -3
- package/src/primitives/icon.tsx +0 -2
- package/src/primitives/select.tsx +0 -2
- package/src/primitives/text.tsx +13 -13
- package/src/primitives/toast-drag-gesture.tsx +2 -2
- package/src/settings/MoreFromProjectV.tsx +2 -2
- package/src/settings/SettingsSection.tsx +3 -3
- package/src/settings/ThemeModePicker.tsx +11 -19
- package/src/themeModeStore.ts +94 -0
- package/src/themeModes.ts +10 -0
- package/types/prism-react-renderer.d.ts +22 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
|
|
3
|
+
// The last error that closed the app. A release build closes with no message
|
|
4
|
+
// and no log a phone user can read, so the global error handler saves the
|
|
5
|
+
// error here and the next launch shows it (`LastCrashDialog`), ready to copy.
|
|
6
|
+
// Moved from eva (`apps/mobile/src/logging`). Not moved: eva's native exit
|
|
7
|
+
// record (its own Expo module) and the report to its backend.
|
|
8
|
+
|
|
9
|
+
/** Where the crash is kept between launches, for example `expo-secure-store`. */
|
|
10
|
+
|
|
11
|
+
/** What a fatal error leaves behind for the next launch. */
|
|
12
|
+
|
|
13
|
+
const KEY = "v.lastCrash";
|
|
14
|
+
/** SecureStore values over 2 KB warn on iOS, so a report is cut below that. */
|
|
15
|
+
const MAX_CHARS = 1_800;
|
|
16
|
+
/** How long a fatal error waits for the save before the app closes anyway. */
|
|
17
|
+
const FATAL_SAVE_MS = 1_000;
|
|
18
|
+
|
|
19
|
+
// `expo-secure-store` and `expo-constants` are optional peers. Metro bundles a
|
|
20
|
+
// `require` placed directly in a `try` block as optional, so a missing peer
|
|
21
|
+
// does not break the bundle.
|
|
22
|
+
let secureStore;
|
|
23
|
+
function defaultStorage() {
|
|
24
|
+
if (secureStore === undefined) {
|
|
25
|
+
try {
|
|
26
|
+
const store = require("expo-secure-store");
|
|
27
|
+
secureStore = {
|
|
28
|
+
getItem: key => store.getItemAsync(key),
|
|
29
|
+
setItem: (key, value) => store.setItemAsync(key, value),
|
|
30
|
+
removeItem: key => store.deleteItemAsync(key)
|
|
31
|
+
};
|
|
32
|
+
} catch {
|
|
33
|
+
secureStore = null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return secureStore;
|
|
37
|
+
}
|
|
38
|
+
function defaultVersion() {
|
|
39
|
+
try {
|
|
40
|
+
const constants = require("expo-constants");
|
|
41
|
+
return constants.default?.expoConfig?.version ?? "?";
|
|
42
|
+
} catch {
|
|
43
|
+
return "?";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
let settings = null;
|
|
47
|
+
const current = () => settings ??= {
|
|
48
|
+
storage: defaultStorage(),
|
|
49
|
+
version: defaultVersion()
|
|
50
|
+
};
|
|
51
|
+
let last = null;
|
|
52
|
+
const listeners = new Set();
|
|
53
|
+
function publish(next) {
|
|
54
|
+
last = next;
|
|
55
|
+
for (const listener of listeners) listener();
|
|
56
|
+
}
|
|
57
|
+
const text = value => typeof value === "string" && value ? value : undefined;
|
|
58
|
+
const field = (caught, name) => typeof caught === "object" && caught !== null ? text(caught[name]) : undefined;
|
|
59
|
+
|
|
60
|
+
/** The name, message and a short stack of a thrown value. Never the value itself. */
|
|
61
|
+
export function fatalReport(caught) {
|
|
62
|
+
return {
|
|
63
|
+
name: field(caught, "name") ?? "Error",
|
|
64
|
+
message: (field(caught, "message") ?? String(caught)).slice(0, 500),
|
|
65
|
+
stack: (field(caught, "stack") ?? "").split("\n").slice(0, 15).join("\n")
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function isLastCrash(value) {
|
|
69
|
+
if (typeof value !== "object" || value === null) return false;
|
|
70
|
+
const crash = value;
|
|
71
|
+
return typeof crash.at === "number" && ["version", "name", "message", "stack"].every(key => typeof crash[key] === "string");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Saves the report for the next launch. Never throws. */
|
|
75
|
+
export async function saveLastCrash(report) {
|
|
76
|
+
try {
|
|
77
|
+
const {
|
|
78
|
+
storage,
|
|
79
|
+
version
|
|
80
|
+
} = current();
|
|
81
|
+
if (!storage) return;
|
|
82
|
+
const crash = {
|
|
83
|
+
at: Date.now(),
|
|
84
|
+
version,
|
|
85
|
+
...report
|
|
86
|
+
};
|
|
87
|
+
let json = JSON.stringify(crash);
|
|
88
|
+
if (json.length > MAX_CHARS) {
|
|
89
|
+
json = JSON.stringify({
|
|
90
|
+
...crash,
|
|
91
|
+
stack: crash.stack.slice(0, Math.max(0, MAX_CHARS - (json.length - crash.stack.length)))
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
await storage.setItem(KEY, json);
|
|
95
|
+
} catch {
|
|
96
|
+
// A crash logger must never throw.
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Reads the saved crash, so `LastCrashDialog` shows it. Never throws. */
|
|
101
|
+
export async function loadLastCrash() {
|
|
102
|
+
try {
|
|
103
|
+
const saved = await current().storage?.getItem(KEY);
|
|
104
|
+
const parsed = saved ? JSON.parse(saved) : null;
|
|
105
|
+
if (isLastCrash(parsed)) publish(parsed);
|
|
106
|
+
} catch {
|
|
107
|
+
// Nothing to show.
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Shows `crash` in `LastCrashDialog` without saving it. For the gallery. */
|
|
112
|
+
export function showLastCrash(crash) {
|
|
113
|
+
publish(crash);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Forgets the shown crash. */
|
|
117
|
+
export function dismissLastCrash() {
|
|
118
|
+
publish(null);
|
|
119
|
+
void current().storage?.removeItem(KEY).catch(() => {});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** The crash saved by the last session, or `null`. */
|
|
123
|
+
export function useLastCrash() {
|
|
124
|
+
return useSyncExternalStore(_temp, _temp2, _temp3);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** The text Copy puts on the clipboard. */
|
|
128
|
+
function _temp3() {
|
|
129
|
+
return last;
|
|
130
|
+
}
|
|
131
|
+
function _temp2() {
|
|
132
|
+
return last;
|
|
133
|
+
}
|
|
134
|
+
function _temp(listener) {
|
|
135
|
+
listeners.add(listener);
|
|
136
|
+
return () => listeners.delete(listener);
|
|
137
|
+
}
|
|
138
|
+
export function crashDetails(crash, appName) {
|
|
139
|
+
return [`${appName} ${crash.version}, ${new Date(crash.at).toISOString()}`, `${crash.name}: ${crash.message}`, crash.stack].join("\n");
|
|
140
|
+
}
|
|
141
|
+
function errorUtilsOf(env) {
|
|
142
|
+
const value = env.ErrorUtils;
|
|
143
|
+
return typeof value?.getGlobalHandler === "function" && typeof value.setGlobalHandler === "function" ? value : null;
|
|
144
|
+
}
|
|
145
|
+
function trackerOf(env) {
|
|
146
|
+
const tracker = env.HermesInternal?.enablePromiseRejectionTracker;
|
|
147
|
+
return typeof tracker === "function" ? tracker : null;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Logs name, message and a short stack, so release builds show it in logcat. Never throws. */
|
|
151
|
+
function logUncaught(kind, caught, isFatal) {
|
|
152
|
+
try {
|
|
153
|
+
const report = fatalReport(caught);
|
|
154
|
+
console.error("[uncaught]", {
|
|
155
|
+
kind,
|
|
156
|
+
isFatal,
|
|
157
|
+
errorName: report.name,
|
|
158
|
+
errorMessage: report.message.slice(0, 200),
|
|
159
|
+
stack: report.stack.split("\n").slice(0, 6).join("\n")
|
|
160
|
+
});
|
|
161
|
+
} catch {
|
|
162
|
+
// A logger must never throw.
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
let installed = false;
|
|
166
|
+
/**
|
|
167
|
+
* Call once at the top of the root layout, outside any component. It:
|
|
168
|
+
* - logs unhandled promise rejections and uncaught errors to `console.error`,
|
|
169
|
+
* which release builds otherwise swallow;
|
|
170
|
+
* - saves a fatal error before the app closes (waiting at most one second);
|
|
171
|
+
* - loads the crash the last session saved, for `LastCrashDialog`.
|
|
172
|
+
* Installs once; later calls return `false`. Never throws.
|
|
173
|
+
*/
|
|
174
|
+
export function installCrashCapture(options = {}) {
|
|
175
|
+
if (installed) return false;
|
|
176
|
+
try {
|
|
177
|
+
installed = true;
|
|
178
|
+
settings = {
|
|
179
|
+
storage: options.storage === undefined ? defaultStorage() : options.storage,
|
|
180
|
+
version: options.version ?? defaultVersion()
|
|
181
|
+
};
|
|
182
|
+
const env = options.env ?? globalThis;
|
|
183
|
+
trackerOf(env)?.({
|
|
184
|
+
allRejections: true,
|
|
185
|
+
onUnhandled: (_id, error) => logUncaught("unhandled-rejection", error)
|
|
186
|
+
});
|
|
187
|
+
const errorUtils = errorUtilsOf(env);
|
|
188
|
+
if (errorUtils) {
|
|
189
|
+
const previous = errorUtils.getGlobalHandler();
|
|
190
|
+
errorUtils.setGlobalHandler((error, isFatal) => {
|
|
191
|
+
logUncaught("uncaught-error", error, isFatal);
|
|
192
|
+
if (!isFatal) {
|
|
193
|
+
previous(error, isFatal);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
// Save first, then let the app close as before.
|
|
197
|
+
const timeout = new Promise(resolve => setTimeout(resolve, FATAL_SAVE_MS));
|
|
198
|
+
void Promise.race([saveLastCrash(fatalReport(error)), timeout]).finally(() => previous(error, isFatal));
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
void loadLastCrash();
|
|
202
|
+
return true;
|
|
203
|
+
} catch {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** For tests only. */
|
|
209
|
+
export function resetCrashCaptureForTests() {
|
|
210
|
+
installed = false;
|
|
211
|
+
settings = null;
|
|
212
|
+
publish(null);
|
|
213
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// `@vvedantb/native-ui/app-root`: the Instrument Sans font helper, the splash hide
|
|
2
|
+
// helper, `AuthGroupGate` and `SsoCallbackScreen` for Expo app shells. Apps keep their
|
|
3
|
+
// own provider trees. Not on the root entry: it imports `@clerk/expo`, `expo-router`,
|
|
4
|
+
// `expo-font`, `expo-splash-screen` and `@expo-google-fonts/instrument-sans`, and Metro
|
|
5
|
+
// does not tree-shake.
|
|
6
|
+
export * from "../app-root";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// `@vvedantb/native-ui/crash`: shows the error that closed the app last time.
|
|
2
|
+
// Call `installCrashCapture()` once at the top of the root layout and mount
|
|
3
|
+
// `<LastCrashDialog appName="…" />` inside it.
|
|
4
|
+
export { LastCrashDialog } from "../crash/LastCrashDialog";
|
|
5
|
+
export { crashDetails, dismissLastCrash, fatalReport, installCrashCapture, loadLastCrash, saveLastCrash, showLastCrash, useLastCrash } from "../crash/lastCrash";
|
package/dist/entries/theme.js
CHANGED
|
@@ -3,6 +3,9 @@ export { cn } from "../cn";
|
|
|
3
3
|
export { tokens, NativeUiProvider, useNativeUi, useLargerText, useAccentColor, DEFAULT_ACCENT } from "../theme";
|
|
4
4
|
export { palette, withAlpha } from "../palette";
|
|
5
5
|
export { configureTheme } from "../configureTheme";
|
|
6
|
+
export { NEUTRAL_PALETTE, NEUTRAL_CHANNELS, paintDarkFamily } from "../neutralTheme";
|
|
7
|
+
export { THEME_MODES, parseThemeMode } from "../themeModes";
|
|
8
|
+
export { createThemeModeStore } from "../themeModeStore";
|
|
6
9
|
export { fontClass, fontFamily } from "../typography";
|
|
7
10
|
export { PINK_50, PINK_100, PINK_600, PINK_700, NEUTRAL_100, NEUTRAL_500, NEUTRAL_900, Colors } from "../colors";
|
|
8
11
|
export { useScheme } from "../useScheme";
|
|
@@ -108,14 +108,14 @@ function Section(t0) {
|
|
|
108
108
|
} = t0;
|
|
109
109
|
let t1;
|
|
110
110
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
111
|
-
t1 = typeStyle("
|
|
111
|
+
t1 = typeStyle("medium");
|
|
112
112
|
$[0] = t1;
|
|
113
113
|
} else {
|
|
114
114
|
t1 = $[0];
|
|
115
115
|
}
|
|
116
116
|
let t2;
|
|
117
117
|
if ($[1] !== title) {
|
|
118
|
-
t2 = <GalleryText accessibilityRole="header" className="font-instrument-sans-
|
|
118
|
+
t2 = <GalleryText accessibilityRole="header" className="font-instrument-sans-medium text-lg" style={t1}>{title}</GalleryText>;
|
|
119
119
|
$[1] = title;
|
|
120
120
|
$[2] = t2;
|
|
121
121
|
} else {
|
|
@@ -29,7 +29,7 @@ const TEXT_2XS = {
|
|
|
29
29
|
const FONT_CLASS = {
|
|
30
30
|
regular: "font-instrument-sans",
|
|
31
31
|
medium: "font-instrument-sans-medium",
|
|
32
|
-
semibold: "font-instrument-sans-
|
|
32
|
+
semibold: "font-instrument-sans-medium"
|
|
33
33
|
};
|
|
34
34
|
function Line(t0) {
|
|
35
35
|
const $ = _c(18);
|
|
@@ -357,7 +357,7 @@ export function MetricElement(t0) {
|
|
|
357
357
|
let t6;
|
|
358
358
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
359
359
|
t4 = sizeStyle("text-lg", "tight");
|
|
360
|
-
t5 = typeStyle("
|
|
360
|
+
t5 = typeStyle("medium");
|
|
361
361
|
t6 = ["tabular-nums"];
|
|
362
362
|
$[3] = t4;
|
|
363
363
|
$[4] = t5;
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,9 @@ export { cn } from "./cn";
|
|
|
2
2
|
export { tokens, NativeUiProvider, useNativeUi, useLargerText, useAccentColor, DEFAULT_ACCENT } from "./theme";
|
|
3
3
|
export { palette, withAlpha } from "./palette";
|
|
4
4
|
export { configureTheme } from "./configureTheme";
|
|
5
|
+
export { NEUTRAL_PALETTE, NEUTRAL_CHANNELS, paintDarkFamily } from "./neutralTheme";
|
|
6
|
+
export { parseThemeMode } from "./themeModes";
|
|
7
|
+
export { createThemeModeStore } from "./themeModeStore";
|
|
5
8
|
export { fontClass, fontFamily } from "./typography";
|
|
6
9
|
export { FLOATING_INSET, FLOATING_TAB_BAR_HEIGHT, FLOATING_TAB_BAR_HEIGHT_LARGE, FLOATING_RADIUS, FLOATING_ROW_RADIUS, FLOATING_PILL_RADIUS, floatingShadow, floatingHairline, floatingFill, floatingSolidFill, tabBarReserve } from "./floating";
|
|
7
10
|
export { impactHaptic, notificationHaptic, selectionHaptic } from "./haptics";
|
|
@@ -92,7 +92,7 @@ export function UpgradeToProCard(t0) {
|
|
|
92
92
|
}
|
|
93
93
|
let t7;
|
|
94
94
|
if ($[16] !== titleSize) {
|
|
95
|
-
t7 = cn("min-w-0 flex-1 font-instrument-sans-
|
|
95
|
+
t7 = cn("min-w-0 flex-1 font-instrument-sans-medium", titleSize);
|
|
96
96
|
$[16] = titleSize;
|
|
97
97
|
$[17] = t7;
|
|
98
98
|
} else {
|
|
@@ -116,7 +116,7 @@ export function UpgradeToProCard(t0) {
|
|
|
116
116
|
}
|
|
117
117
|
let t10;
|
|
118
118
|
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
119
|
-
t10 = typeStyle("
|
|
119
|
+
t10 = typeStyle("medium");
|
|
120
120
|
$[22] = t10;
|
|
121
121
|
} else {
|
|
122
122
|
t10 = $[22];
|
|
@@ -238,9 +238,9 @@ function ImageGrid(t0) {
|
|
|
238
238
|
height: "100%"
|
|
239
239
|
}} />{tile_1.overflow > 0 ? <View className="absolute inset-0 items-center justify-center" style={{
|
|
240
240
|
backgroundColor: withAlpha(tokens.color.black, 0.6)
|
|
241
|
-
}}><Text className="font-instrument-sans-
|
|
241
|
+
}}><Text className="font-instrument-sans-medium text-xl" style={[{
|
|
242
242
|
color: tokens.color.white
|
|
243
|
-
}, typeStyle("
|
|
243
|
+
}, typeStyle("medium")]}>{`+${tile_1.overflow}`}</Text></View> : null}</Pressable>;
|
|
244
244
|
};
|
|
245
245
|
$[10] = images;
|
|
246
246
|
$[11] = onOpen;
|
package/dist/motion.js
CHANGED
|
@@ -15,10 +15,11 @@ export const SHEET_SPRING = {
|
|
|
15
15
|
reduceMotion: ReduceMotion.System
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
/** A dragged sheet that springs home:
|
|
18
|
+
/** A dragged sheet that springs home: critically damped, no bounce. Add the release `velocity`. */
|
|
19
19
|
export const SHEET_SNAP_SPRING = {
|
|
20
20
|
duration: 300,
|
|
21
|
-
dampingRatio:
|
|
21
|
+
dampingRatio: 1,
|
|
22
|
+
overshootClamping: true,
|
|
22
23
|
reduceMotion: ReduceMotion.System
|
|
23
24
|
};
|
|
24
25
|
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { configureTheme } from "./configureTheme";
|
|
2
|
+
import { palette, withAlpha } from "./palette";
|
|
3
|
+
import { tokens } from "./tokens";
|
|
4
|
+
|
|
5
|
+
/** The web Neutral theme (`.dark.neutral` in `@vvedantb/ui` tokens.css), as hex. */
|
|
6
|
+
export const NEUTRAL_PALETTE = {
|
|
7
|
+
background: "#222325",
|
|
8
|
+
surface: "#303134",
|
|
9
|
+
surfaceSecondary: "#3a3b3e",
|
|
10
|
+
surfaceTertiary: "#444548",
|
|
11
|
+
border: "#4e4f52",
|
|
12
|
+
muted: "#9fa0a2",
|
|
13
|
+
foreground: "#fafafa"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** The same colours as space-separated RGB channels, for NativeWind variables that take channels. */
|
|
17
|
+
export const NEUTRAL_CHANNELS = {
|
|
18
|
+
background: "34 35 37",
|
|
19
|
+
surface: "48 49 52",
|
|
20
|
+
surfaceSecondary: "58 59 62",
|
|
21
|
+
surfaceTertiary: "68 69 72",
|
|
22
|
+
border: "78 79 82",
|
|
23
|
+
muted: "159 160 162",
|
|
24
|
+
foreground: "250 250 250"
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** The kit dark-slot values that Neutral changes. */
|
|
28
|
+
|
|
29
|
+
/** The package dark values, copied at import so a Neutral pick can be undone. */
|
|
30
|
+
const DARK = {
|
|
31
|
+
color: {
|
|
32
|
+
background: tokens.color.background.dark,
|
|
33
|
+
foreground: tokens.color.foreground.dark,
|
|
34
|
+
muted: tokens.color.muted.dark,
|
|
35
|
+
border: tokens.color.border.dark,
|
|
36
|
+
separator: tokens.color.separator.dark,
|
|
37
|
+
surface: tokens.color.surface.dark,
|
|
38
|
+
surfaceSecondary: tokens.color.surfaceSecondary.dark,
|
|
39
|
+
surfaceCard: tokens.color.surfaceCard.dark,
|
|
40
|
+
fill: tokens.color.fill.dark
|
|
41
|
+
},
|
|
42
|
+
palette: {
|
|
43
|
+
default: palette.default.dark,
|
|
44
|
+
overlay: palette.overlay.dark,
|
|
45
|
+
segment: palette.segment.dark,
|
|
46
|
+
surfaceTertiary: palette.surfaceTertiary.dark,
|
|
47
|
+
fieldPlaceholder: palette.fieldPlaceholder.dark,
|
|
48
|
+
tabBarPill: palette.tabBarPill.dark
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const NEUTRAL = {
|
|
52
|
+
color: {
|
|
53
|
+
background: NEUTRAL_PALETTE.background,
|
|
54
|
+
foreground: NEUTRAL_PALETTE.foreground,
|
|
55
|
+
muted: NEUTRAL_PALETTE.muted,
|
|
56
|
+
border: NEUTRAL_PALETTE.border,
|
|
57
|
+
separator: NEUTRAL_PALETTE.surfaceSecondary,
|
|
58
|
+
surface: NEUTRAL_PALETTE.surface,
|
|
59
|
+
surfaceSecondary: NEUTRAL_PALETTE.surfaceSecondary,
|
|
60
|
+
surfaceCard: NEUTRAL_PALETTE.surface,
|
|
61
|
+
// The package glass is its dark surface at 88%; Neutral's surface the same.
|
|
62
|
+
fill: withAlpha(NEUTRAL_PALETTE.surface, 0.88)
|
|
63
|
+
},
|
|
64
|
+
palette: {
|
|
65
|
+
default: NEUTRAL_PALETTE.surfaceTertiary,
|
|
66
|
+
overlay: NEUTRAL_PALETTE.surface,
|
|
67
|
+
segment: NEUTRAL_PALETTE.surfaceTertiary,
|
|
68
|
+
surfaceTertiary: NEUTRAL_PALETTE.surfaceTertiary,
|
|
69
|
+
fieldPlaceholder: NEUTRAL_PALETTE.muted,
|
|
70
|
+
tabBarPill: NEUTRAL_PALETTE.surfaceTertiary
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** Dark-slot colours that replace the ones `paintDarkFamily` would paint. */
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Puts the Dark or Neutral colours in the kit's dark slot (`configureTheme`).
|
|
78
|
+
* Light is not changed. Kit parts under `NativeUiProvider` redraw at once.
|
|
79
|
+
* Status and accent colours stay Dark's. `overrides` replaces any painted
|
|
80
|
+
* dark-slot colour, for an app that keeps its own value.
|
|
81
|
+
*/
|
|
82
|
+
export function paintDarkFamily(family, overrides) {
|
|
83
|
+
const base = family === "neutral" ? NEUTRAL : DARK;
|
|
84
|
+
const next = {
|
|
85
|
+
color: {
|
|
86
|
+
...base.color,
|
|
87
|
+
...overrides?.color
|
|
88
|
+
},
|
|
89
|
+
palette: {
|
|
90
|
+
...base.palette,
|
|
91
|
+
...overrides?.palette
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const {
|
|
95
|
+
color
|
|
96
|
+
} = tokens;
|
|
97
|
+
configureTheme({
|
|
98
|
+
color: {
|
|
99
|
+
background: {
|
|
100
|
+
light: color.background.light,
|
|
101
|
+
dark: next.color.background
|
|
102
|
+
},
|
|
103
|
+
foreground: {
|
|
104
|
+
light: color.foreground.light,
|
|
105
|
+
dark: next.color.foreground
|
|
106
|
+
},
|
|
107
|
+
muted: {
|
|
108
|
+
light: color.muted.light,
|
|
109
|
+
dark: next.color.muted
|
|
110
|
+
},
|
|
111
|
+
border: {
|
|
112
|
+
light: color.border.light,
|
|
113
|
+
dark: next.color.border
|
|
114
|
+
},
|
|
115
|
+
separator: {
|
|
116
|
+
light: color.separator.light,
|
|
117
|
+
dark: next.color.separator
|
|
118
|
+
},
|
|
119
|
+
surface: {
|
|
120
|
+
light: color.surface.light,
|
|
121
|
+
dark: next.color.surface
|
|
122
|
+
},
|
|
123
|
+
surfaceSecondary: {
|
|
124
|
+
light: color.surfaceSecondary.light,
|
|
125
|
+
dark: next.color.surfaceSecondary
|
|
126
|
+
},
|
|
127
|
+
surfaceCard: {
|
|
128
|
+
light: color.surfaceCard.light,
|
|
129
|
+
dark: next.color.surfaceCard
|
|
130
|
+
},
|
|
131
|
+
fill: {
|
|
132
|
+
light: color.fill.light,
|
|
133
|
+
dark: next.color.fill
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
palette: {
|
|
137
|
+
default: {
|
|
138
|
+
light: palette.default.light,
|
|
139
|
+
dark: next.palette.default
|
|
140
|
+
},
|
|
141
|
+
overlay: {
|
|
142
|
+
light: palette.overlay.light,
|
|
143
|
+
dark: next.palette.overlay
|
|
144
|
+
},
|
|
145
|
+
segment: {
|
|
146
|
+
light: palette.segment.light,
|
|
147
|
+
dark: next.palette.segment
|
|
148
|
+
},
|
|
149
|
+
surfaceTertiary: {
|
|
150
|
+
light: palette.surfaceTertiary.light,
|
|
151
|
+
dark: next.palette.surfaceTertiary
|
|
152
|
+
},
|
|
153
|
+
fieldPlaceholder: {
|
|
154
|
+
light: palette.fieldPlaceholder.light,
|
|
155
|
+
dark: next.palette.fieldPlaceholder
|
|
156
|
+
},
|
|
157
|
+
tabBarPill: {
|
|
158
|
+
light: palette.tabBarPill.light,
|
|
159
|
+
dark: next.palette.tabBarPill
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
package/dist/primitives/card.jsx
CHANGED
|
@@ -98,7 +98,7 @@ const CardTitle = React.forwardRef((t0, ref) => {
|
|
|
98
98
|
}
|
|
99
99
|
let t1;
|
|
100
100
|
if ($[4] !== className) {
|
|
101
|
-
t1 = cn("font-instrument-sans-
|
|
101
|
+
t1 = cn("font-instrument-sans-medium leading-none", className);
|
|
102
102
|
$[4] = className;
|
|
103
103
|
$[5] = t1;
|
|
104
104
|
} else {
|
|
@@ -106,7 +106,7 @@ const CardTitle = React.forwardRef((t0, ref) => {
|
|
|
106
106
|
}
|
|
107
107
|
let t2;
|
|
108
108
|
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
109
|
-
t2 = typeStyle("
|
|
109
|
+
t2 = typeStyle("medium");
|
|
110
110
|
$[6] = t2;
|
|
111
111
|
} else {
|
|
112
112
|
t2 = $[6];
|
package/dist/primitives/icon.jsx
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
// Tabler, not Lucide: a Lucide icon always sets `testID` on its `Svg`, which
|
|
5
|
-
// on web is a DOM `<svg>`, so React logs it as an unknown DOM prop.
|
|
6
|
-
|
|
7
3
|
function Icon(t0) {
|
|
8
4
|
const $ = _c(6);
|
|
9
5
|
let Component;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import * as SelectPrimitive from "@rn-primitives/select";
|
|
3
|
-
// Tabler, not Lucide: a Lucide icon always sets `testID` on its `Svg`, which
|
|
4
|
-
// on web is a DOM `<svg>`, so React logs it as an unknown DOM prop.
|
|
5
3
|
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react-native";
|
|
6
4
|
import * as React from "react";
|
|
7
5
|
import { Platform, ScrollView, StyleSheet, Text, View } from "react-native";
|
package/dist/primitives/text.jsx
CHANGED
|
@@ -11,23 +11,23 @@ const textVariants = cva(cn("text-foreground text-base", Platform.select({
|
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
13
|
default: "",
|
|
14
|
-
h1: cn("text-4xl font-instrument-sans-
|
|
14
|
+
h1: cn("text-4xl font-instrument-sans-medium tracking-tight", Platform.select({
|
|
15
15
|
web: "scroll-m-20"
|
|
16
16
|
})),
|
|
17
|
-
h2: cn("text-3xl font-instrument-sans-
|
|
17
|
+
h2: cn("text-3xl font-instrument-sans-medium tracking-tight border-border border-b pb-2", Platform.select({
|
|
18
18
|
web: "scroll-m-20"
|
|
19
19
|
})),
|
|
20
|
-
h3: cn("text-2xl font-instrument-sans-
|
|
20
|
+
h3: cn("text-2xl font-instrument-sans-medium tracking-tight", Platform.select({
|
|
21
21
|
web: "scroll-m-20"
|
|
22
22
|
})),
|
|
23
|
-
h4: cn("text-xl font-instrument-sans-
|
|
23
|
+
h4: cn("text-xl font-instrument-sans-medium tracking-tight", Platform.select({
|
|
24
24
|
web: "scroll-m-20"
|
|
25
25
|
})),
|
|
26
26
|
p: "leading-7",
|
|
27
27
|
blockquote: "border-l-2 border-border pl-4 italic",
|
|
28
|
-
code: "bg-muted rounded px-[0.3rem] py-[0.2rem] text-sm font-instrument-sans-
|
|
28
|
+
code: "bg-muted rounded px-[0.3rem] py-[0.2rem] text-sm font-instrument-sans-medium",
|
|
29
29
|
lead: "text-xl text-muted-foreground",
|
|
30
|
-
large: "text-lg font-instrument-sans-
|
|
30
|
+
large: "text-lg font-instrument-sans-medium",
|
|
31
31
|
small: "text-sm font-instrument-sans-medium",
|
|
32
32
|
muted: "text-sm text-muted-foreground"
|
|
33
33
|
}
|
|
@@ -58,14 +58,14 @@ const ARIA_LEVEL = {
|
|
|
58
58
|
// The weight of each variant's `font-instrument-sans-*` class, set as a style
|
|
59
59
|
// beside it (`typeStyle`): where an app maps every one of those classes to one
|
|
60
60
|
// family, the class alone draws Regular. Headings are semibold, as the web
|
|
61
|
-
// titles; `h1` was `font-
|
|
61
|
+
// titles; `h1` was `font-medium` before 0.3.13.
|
|
62
62
|
const WEIGHT = {
|
|
63
|
-
h1: typeStyle("
|
|
64
|
-
h2: typeStyle("
|
|
65
|
-
h3: typeStyle("
|
|
66
|
-
h4: typeStyle("
|
|
67
|
-
code: typeStyle("
|
|
68
|
-
large: typeStyle("
|
|
63
|
+
h1: typeStyle("medium"),
|
|
64
|
+
h2: typeStyle("medium"),
|
|
65
|
+
h3: typeStyle("medium"),
|
|
66
|
+
h4: typeStyle("medium"),
|
|
67
|
+
code: typeStyle("medium"),
|
|
68
|
+
large: typeStyle("medium"),
|
|
69
69
|
small: typeStyle("medium")
|
|
70
70
|
};
|
|
71
71
|
const TextClassContext = React.createContext(undefined);
|
|
@@ -8,10 +8,11 @@ import { useWebClickGuard } from "./web-click-guard";
|
|
|
8
8
|
// The toast drag on Gesture Handler: the track phase and the release run as
|
|
9
9
|
// worklets on the UI thread. The rules are plain worklets in `toastDrag`.
|
|
10
10
|
|
|
11
|
-
/** Back home after a short drag:
|
|
11
|
+
/** Back home after a short drag: critically damped, no bounce. */
|
|
12
12
|
const HOME_SPRING = {
|
|
13
13
|
duration: 250,
|
|
14
|
-
dampingRatio:
|
|
14
|
+
dampingRatio: 1,
|
|
15
|
+
overshootClamping: true,
|
|
15
16
|
reduceMotion: ReduceMotion.System
|
|
16
17
|
};
|
|
17
18
|
/** Away up the screen: no overshoot back into view. */
|
|
@@ -73,14 +73,14 @@ export function FromProjectV(t0) {
|
|
|
73
73
|
}
|
|
74
74
|
let t6;
|
|
75
75
|
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
|
-
t6 = typeStyle("
|
|
76
|
+
t6 = typeStyle("medium");
|
|
77
77
|
$[10] = t6;
|
|
78
78
|
} else {
|
|
79
79
|
t6 = $[10];
|
|
80
80
|
}
|
|
81
81
|
let t7;
|
|
82
82
|
if ($[11] !== t5) {
|
|
83
|
-
t7 = <Text className="text-sm font-instrument-sans-
|
|
83
|
+
t7 = <Text className="text-sm font-instrument-sans-medium" style={[t5, t6]}>Project V</Text>;
|
|
84
84
|
$[11] = t5;
|
|
85
85
|
$[12] = t7;
|
|
86
86
|
} else {
|
|
@@ -30,7 +30,7 @@ export function SettingsSection(t0) {
|
|
|
30
30
|
}
|
|
31
31
|
let t3;
|
|
32
32
|
if ($[2] !== scheme || $[3] !== title) {
|
|
33
|
-
t3 = typeof title === "string" ? <Text accessibilityRole="header" className="text-sm font-instrument-sans-
|
|
33
|
+
t3 = typeof title === "string" ? <Text accessibilityRole="header" className="text-sm font-instrument-sans-medium" style={[textStyle("foreground", scheme), sizeStyle("text-sm"), typeStyle("medium")]}>{title}</Text> : title;
|
|
34
34
|
$[2] = scheme;
|
|
35
35
|
$[3] = title;
|
|
36
36
|
$[4] = t3;
|