@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
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { IconCheck, IconCircleHalf, IconDeviceDesktop, IconMoon, IconSun } from "@tabler/icons-react-native";
|
|
3
3
|
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
4
|
-
import Svg, {
|
|
4
|
+
import Svg, { Path, Rect } from "react-native-svg";
|
|
5
5
|
import { cn } from "../cn";
|
|
6
6
|
import { sizeStyle, typeStyle } from "../controlStyles";
|
|
7
7
|
import { palette, withAlpha } from "../palette";
|
|
8
8
|
import { useLargerText } from "../theme";
|
|
9
9
|
import { tokens } from "../tokens";
|
|
10
10
|
import { useScheme } from "../useScheme";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/** Default order: light to dark, then system. */
|
|
15
|
-
export const THEME_MODES = ["light", "neutral", "dark", "system"];
|
|
11
|
+
import { THEME_MODES } from "../themeModes";
|
|
12
|
+
export { THEME_MODES };
|
|
16
13
|
const LABELS = {
|
|
17
14
|
light: "Light",
|
|
18
15
|
neutral: "Neutral",
|
|
@@ -28,7 +25,7 @@ const ICONS = {
|
|
|
28
25
|
/** Web `bg-zinc-900`. */
|
|
29
26
|
const ZINC_900 = "#18181b";
|
|
30
27
|
// Swatches and icons show the theme itself, so they use the web's fixed colours, not tokens.
|
|
31
|
-
// System has no swatch colour (it is a
|
|
28
|
+
// System has no swatch colour (it is a hard split) and a muted icon.
|
|
32
29
|
const SWATCHES = {
|
|
33
30
|
light: "#ffffff",
|
|
34
31
|
neutral: "#3f3f46",
|
|
@@ -41,12 +38,12 @@ const ICON_COLOURS = {
|
|
|
41
38
|
dark: "#93c5fd",
|
|
42
39
|
system: null
|
|
43
40
|
};
|
|
44
|
-
/** The
|
|
45
|
-
function
|
|
41
|
+
/** The System swatch: white with a hard diagonal half in zinc-900, no gradient. */
|
|
42
|
+
function SplitSwatch() {
|
|
46
43
|
const $ = _c(1);
|
|
47
44
|
let t0;
|
|
48
45
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
49
|
-
t0 = <Svg width="100%" height="100%"
|
|
46
|
+
t0 = <Svg width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none" style={StyleSheet.absoluteFill}><Rect width="1" height="1" fill="#ffffff" /><Path d="M1 0 L1 1 L0 1 Z" fill={ZINC_900} /></Svg>;
|
|
50
47
|
$[0] = t0;
|
|
51
48
|
} else {
|
|
52
49
|
t0 = $[0];
|
|
@@ -96,7 +93,7 @@ export function ThemeModePicker(t0) {
|
|
|
96
93
|
backgroundColor: active ? withAlpha(palette.primary[scheme], 0.08) : withAlpha(tokens.color.surfaceSecondary[scheme], 0.4)
|
|
97
94
|
}}><View className="mx-2 h-12 items-center justify-center self-stretch overflow-hidden rounded-2xl" style={swatch ? {
|
|
98
95
|
backgroundColor: swatch
|
|
99
|
-
} : undefined}>{swatch ? null : <
|
|
96
|
+
} : undefined}>{swatch ? null : <SplitSwatch />}<View className="absolute inset-0 items-center justify-center"><Icon size={22} color={ICON_COLOURS[mode] ?? tokens.color.muted[scheme]} /></View></View>{active ? <View className="absolute right-2 top-2 h-4 w-4 items-center justify-center rounded-full" style={{
|
|
100
97
|
backgroundColor: palette.primary[scheme]
|
|
101
98
|
}}><IconCheck size={10} strokeWidth={3} color={palette.primaryForeground[scheme]} /></View> : null}<Text numberOfLines={1} adjustsFontSizeToFit={true} className={cn("font-instrument-sans-medium", labelSize)} style={[sizeStyle(labelSize), typeStyle("medium"), {
|
|
102
99
|
color: active ? palette.primary[scheme] : tokens.color.muted[scheme]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { colorScheme } from "nativewind";
|
|
2
|
+
import { useSyncExternalStore } from "react";
|
|
3
|
+
import { paintDarkFamily } from "./neutralTheme";
|
|
4
|
+
import { parseThemeMode } from "./themeModes";
|
|
5
|
+
|
|
6
|
+
/** Where the mode is kept: SecureStore, AsyncStorage or the app's own store. Sync or async. */
|
|
7
|
+
|
|
8
|
+
function toError(error) {
|
|
9
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The appearance mode of this phone: light, neutral, dark or system, starting
|
|
14
|
+
* at "system". Neutral is the NativeWind dark scheme with the Neutral palette
|
|
15
|
+
* in the kit's dark slot (`paintDarkFamily`).
|
|
16
|
+
*/
|
|
17
|
+
export function createThemeModeStore({
|
|
18
|
+
key,
|
|
19
|
+
storage,
|
|
20
|
+
onError
|
|
21
|
+
}) {
|
|
22
|
+
let current = "system";
|
|
23
|
+
/** True once the user picked a mode: a slow restore must not undo it. */
|
|
24
|
+
let chosen = false;
|
|
25
|
+
const listeners = new Set();
|
|
26
|
+
const report = error => onError?.(toError(error));
|
|
27
|
+
|
|
28
|
+
/** Paints `mode`. The dark slot goes first, so the scheme change redraws with it. */
|
|
29
|
+
function apply(mode) {
|
|
30
|
+
current = mode;
|
|
31
|
+
paintDarkFamily(mode === "neutral" ? "neutral" : "dark");
|
|
32
|
+
colorScheme.set(mode === "neutral" ? "dark" : mode);
|
|
33
|
+
for (const listener of listeners) listener();
|
|
34
|
+
}
|
|
35
|
+
function subscribe(listener) {
|
|
36
|
+
listeners.add(listener);
|
|
37
|
+
return () => {
|
|
38
|
+
listeners.delete(listener);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const getMode = () => current;
|
|
42
|
+
async function restore() {
|
|
43
|
+
let saved = null;
|
|
44
|
+
try {
|
|
45
|
+
saved = await storage.getItem(key);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
report(error instanceof Error ? error : String(error));
|
|
48
|
+
}
|
|
49
|
+
if (chosen) return;
|
|
50
|
+
apply(parseThemeMode(saved) ?? "system");
|
|
51
|
+
}
|
|
52
|
+
function set(mode) {
|
|
53
|
+
chosen = true;
|
|
54
|
+
if (mode !== current) apply(mode);
|
|
55
|
+
Promise.resolve().then(() => storage.setItem(key, mode)).catch(report);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Server render and hydration: the mode is always "system" until `restore` runs on the client. */
|
|
59
|
+
const getServerSnapshot = () => "system";
|
|
60
|
+
return {
|
|
61
|
+
getMode,
|
|
62
|
+
subscribe,
|
|
63
|
+
restore,
|
|
64
|
+
set,
|
|
65
|
+
useMode: () => useSyncExternalStore(subscribe, getMode, getServerSnapshot)
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A theme the picker can show, as the web `ThemeModePicker`. Neutral is the dark scheme with a grey palette. */
|
|
2
|
+
|
|
3
|
+
/** Default order: light to dark, then system. */
|
|
4
|
+
export const THEME_MODES = ["light", "neutral", "dark", "system"];
|
|
5
|
+
|
|
6
|
+
/** The mode that `value` names, or `undefined` for anything else (a missing or stale stored value). */
|
|
7
|
+
export function parseThemeMode(value) {
|
|
8
|
+
return THEME_MODES.find(mode => mode === value);
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvedantb/native-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "Shared React Native / Expo UI primitives. Floating surfaces, forms, overlays, toasts, settings chrome, tab bar, AI chat parts, the family app marks, a NativeWind preset, the Expo web root and Clerk + Convex auth screens.",
|
|
5
|
+
"description": "Shared React Native / Expo UI primitives. Floating surfaces, forms, overlays, toasts, settings chrome, tab bar, AI chat parts, the family app marks, a NativeWind preset, the Expo web root, the app root shell helpers and Clerk + Convex auth screens.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
"provenance": true
|
|
8
|
+
"access": "public"
|
|
10
9
|
},
|
|
11
10
|
"repository": {
|
|
12
11
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/vvedantb/
|
|
12
|
+
"url": "git+https://github.com/vvedantb/v.git",
|
|
14
13
|
"directory": "packages/native-ui"
|
|
15
14
|
},
|
|
16
15
|
"exports": {
|
|
@@ -124,6 +123,11 @@
|
|
|
124
123
|
"source": "./src/entries/date-time.ts",
|
|
125
124
|
"default": "./dist/entries/date-time.js"
|
|
126
125
|
},
|
|
126
|
+
"./crash": {
|
|
127
|
+
"types": "./src/entries/crash.ts",
|
|
128
|
+
"source": "./src/entries/crash.ts",
|
|
129
|
+
"default": "./dist/entries/crash.js"
|
|
130
|
+
},
|
|
127
131
|
"./ai": {
|
|
128
132
|
"types": "./src/entries/ai.ts",
|
|
129
133
|
"source": "./src/entries/ai.ts",
|
|
@@ -174,6 +178,11 @@
|
|
|
174
178
|
"source": "./src/entries/expo-web-root.ts",
|
|
175
179
|
"default": "./dist/entries/expo-web-root.js"
|
|
176
180
|
},
|
|
181
|
+
"./app-root": {
|
|
182
|
+
"types": "./src/entries/app-root.ts",
|
|
183
|
+
"source": "./src/entries/app-root.ts",
|
|
184
|
+
"default": "./dist/entries/app-root.js"
|
|
185
|
+
},
|
|
177
186
|
"./tailwind-preset": {
|
|
178
187
|
"types": "./src/tailwind-preset.d.cts",
|
|
179
188
|
"require": "./src/tailwind-preset.cjs",
|
|
@@ -185,12 +194,14 @@
|
|
|
185
194
|
"files": [
|
|
186
195
|
"dist",
|
|
187
196
|
"src",
|
|
197
|
+
"types/prism-react-renderer.d.ts",
|
|
188
198
|
"LICENSE"
|
|
189
199
|
],
|
|
190
200
|
"sideEffects": false,
|
|
191
201
|
"peerDependencies": {
|
|
192
202
|
"expo-paste-input": ">=0.2.0",
|
|
193
203
|
"@clerk/expo": ">=4.16.0",
|
|
204
|
+
"@expo-google-fonts/instrument-sans": "*",
|
|
194
205
|
"@expo/vector-icons": "*",
|
|
195
206
|
"@json-render/core": ">=0.21.0",
|
|
196
207
|
"@json-render/react-native": ">=0.21.0",
|
|
@@ -199,8 +210,8 @@
|
|
|
199
210
|
"@rn-primitives/slot": "*",
|
|
200
211
|
"@rn-primitives/switch": "*",
|
|
201
212
|
"@swmansion/react-native-bottom-sheet": ">=1.1.0",
|
|
202
|
-
"@tabler/icons-react-native": "
|
|
203
|
-
"@vvedantb/server": ">=0.
|
|
213
|
+
"@tabler/icons-react-native": "^3.52.0",
|
|
214
|
+
"@vvedantb/server": ">=0.18.0",
|
|
204
215
|
"class-variance-authority": ">=0.7.0",
|
|
205
216
|
"clsx": ">=2.0.0",
|
|
206
217
|
"convex": "*",
|
|
@@ -209,13 +220,15 @@
|
|
|
209
220
|
"expo-blur": "*",
|
|
210
221
|
"expo-constants": "*",
|
|
211
222
|
"expo-device": "*",
|
|
223
|
+
"expo-font": "*",
|
|
212
224
|
"expo-haptics": "*",
|
|
213
225
|
"expo-linear-gradient": "*",
|
|
214
226
|
"expo-notifications": "*",
|
|
215
227
|
"expo-router": "*",
|
|
228
|
+
"expo-secure-store": "*",
|
|
229
|
+
"expo-splash-screen": "*",
|
|
216
230
|
"expo-video": "*",
|
|
217
231
|
"expo-web-browser": "*",
|
|
218
|
-
"lucide-react-native": "*",
|
|
219
232
|
"nativewind": ">=4.0.0",
|
|
220
233
|
"prism-react-renderer": ">=2.0.0",
|
|
221
234
|
"react": ">=19.0.0",
|
|
@@ -228,9 +241,18 @@
|
|
|
228
241
|
"react-native-screens": "*",
|
|
229
242
|
"react-native-svg": "*",
|
|
230
243
|
"react-native-webview": "*",
|
|
231
|
-
"tailwind-merge": ">=
|
|
244
|
+
"tailwind-merge": ">=3.0.0"
|
|
232
245
|
},
|
|
233
246
|
"peerDependenciesMeta": {
|
|
247
|
+
"@expo-google-fonts/instrument-sans": {
|
|
248
|
+
"optional": true
|
|
249
|
+
},
|
|
250
|
+
"expo-font": {
|
|
251
|
+
"optional": true
|
|
252
|
+
},
|
|
253
|
+
"expo-splash-screen": {
|
|
254
|
+
"optional": true
|
|
255
|
+
},
|
|
234
256
|
"expo-paste-input": {
|
|
235
257
|
"optional": true
|
|
236
258
|
},
|
|
@@ -282,6 +304,9 @@
|
|
|
282
304
|
"expo-router": {
|
|
283
305
|
"optional": true
|
|
284
306
|
},
|
|
307
|
+
"expo-secure-store": {
|
|
308
|
+
"optional": true
|
|
309
|
+
},
|
|
285
310
|
"expo-video": {
|
|
286
311
|
"optional": true
|
|
287
312
|
},
|
|
@@ -308,35 +333,38 @@
|
|
|
308
333
|
}
|
|
309
334
|
},
|
|
310
335
|
"devDependencies": {
|
|
311
|
-
"@babel/core": "
|
|
312
|
-
"@clerk/expo": "4.17.
|
|
336
|
+
"@babel/core": "7.29.13",
|
|
337
|
+
"@clerk/expo": "4.17.4",
|
|
338
|
+
"@expo-google-fonts/instrument-sans": "^0.4.2",
|
|
313
339
|
"@react-native-community/datetimepicker": "9.2.1",
|
|
314
|
-
"@types/react": "
|
|
340
|
+
"@types/react": "19.3.0",
|
|
315
341
|
"expo": "~58.0.26",
|
|
316
342
|
"expo-auth-session": "~58.0.19",
|
|
317
343
|
"expo-blur": "~58.0.6",
|
|
318
344
|
"expo-constants": "~58.0.16",
|
|
319
345
|
"expo-device": "~58.0.5",
|
|
346
|
+
"expo-font": "~58.0.12",
|
|
320
347
|
"expo-haptics": "~58.0.8",
|
|
321
348
|
"expo-linear-gradient": "~58.0.4",
|
|
322
349
|
"expo-notifications": "~58.1.9",
|
|
323
350
|
"expo-router": "~58.0.32",
|
|
351
|
+
"expo-splash-screen": "~58.0.14",
|
|
324
352
|
"expo-video": "~58.0.14",
|
|
325
353
|
"expo-web-browser": "~58.1.0",
|
|
326
|
-
"happy-dom": "
|
|
327
|
-
"react": "
|
|
354
|
+
"happy-dom": "21.0.4",
|
|
355
|
+
"react": "19.3.0",
|
|
328
356
|
"react-native": "0.88.1",
|
|
329
|
-
"react-native-gesture-handler": "
|
|
357
|
+
"react-native-gesture-handler": "3.3.0",
|
|
330
358
|
"react-native-keyboard-controller": "1.22.7",
|
|
331
359
|
"react-native-reanimated": "4.8.0",
|
|
332
|
-
"react-native-safe-area-context": "
|
|
333
|
-
"react-native-screens": "
|
|
360
|
+
"react-native-safe-area-context": "5.11.1",
|
|
361
|
+
"react-native-screens": "4.30.1",
|
|
334
362
|
"react-native-svg": "15.16.0",
|
|
335
363
|
"react-native-webview": "14.0.1",
|
|
336
364
|
"react-native-worklets": "0.14.0",
|
|
337
365
|
"typescript": "7.0.2",
|
|
338
|
-
"vitest": "
|
|
339
|
-
"@vvedantb/server": "0.
|
|
366
|
+
"vitest": "5.1.1",
|
|
367
|
+
"@vvedantb/server": "0.18.0"
|
|
340
368
|
},
|
|
341
369
|
"scripts": {
|
|
342
370
|
"build": "node scripts/build-dist.mjs && node scripts/check-exports.mjs",
|
|
@@ -1,43 +1,25 @@
|
|
|
1
1
|
import { StyleSheet, View, type ViewProps } from "react-native";
|
|
2
2
|
import { cn } from "./cn";
|
|
3
|
-
import { loadLinearGradient } from "./gradient";
|
|
4
3
|
import { tokens } from "./tokens";
|
|
5
4
|
import { useScheme } from "./useScheme";
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
const DARK = ["#1c1c1e", "#2a1820", "#1a1a1c"] as const;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* A soft gradient behind the screen. Without the optional
|
|
12
|
-
* `expo-linear-gradient` peer it draws the solid `tokens.color.background`.
|
|
13
|
-
*/
|
|
6
|
+
/** A flat `tokens.color.background` layer behind the screen. */
|
|
14
7
|
export function AmbientBackground({
|
|
15
8
|
children,
|
|
16
9
|
className,
|
|
17
10
|
...props
|
|
18
11
|
}: ViewProps & { className?: string }) {
|
|
19
12
|
const scheme = useScheme();
|
|
20
|
-
const LinearGradient = loadLinearGradient()?.LinearGradient;
|
|
21
13
|
|
|
22
14
|
return (
|
|
23
15
|
<View className={cn("flex-1", className)} {...props}>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/>
|
|
32
|
-
) : (
|
|
33
|
-
<View
|
|
34
|
-
pointerEvents="none"
|
|
35
|
-
style={{
|
|
36
|
-
...StyleSheet.absoluteFill,
|
|
37
|
-
backgroundColor: tokens.color.background[scheme],
|
|
38
|
-
}}
|
|
39
|
-
/>
|
|
40
|
-
)}
|
|
16
|
+
<View
|
|
17
|
+
pointerEvents="none"
|
|
18
|
+
style={{
|
|
19
|
+
...StyleSheet.absoluteFill,
|
|
20
|
+
backgroundColor: tokens.color.background[scheme],
|
|
21
|
+
}}
|
|
22
|
+
/>
|
|
41
23
|
{children}
|
|
42
24
|
</View>
|
|
43
25
|
);
|
package/src/Avatar.tsx
CHANGED
|
@@ -125,10 +125,10 @@ export function AvatarFallback({
|
|
|
125
125
|
{typeof children === "string" ? (
|
|
126
126
|
<Text
|
|
127
127
|
numberOfLines={1}
|
|
128
|
-
className={cn("font-instrument-sans-
|
|
128
|
+
className={cn("font-instrument-sans-medium", textClassName)}
|
|
129
129
|
style={[
|
|
130
130
|
{ fontSize: Math.round(size * 0.4), color: palette.defaultForeground[scheme] },
|
|
131
|
-
typeStyle("
|
|
131
|
+
typeStyle("medium"),
|
|
132
132
|
]}
|
|
133
133
|
>
|
|
134
134
|
{children}
|
package/src/BulkActionBar.tsx
CHANGED
|
@@ -217,8 +217,8 @@ export function BulkActionBar({
|
|
|
217
217
|
}}
|
|
218
218
|
>
|
|
219
219
|
<Text
|
|
220
|
-
className="font-instrument-sans-
|
|
221
|
-
style={[metrics.caption, typeStyle("
|
|
220
|
+
className="font-instrument-sans-medium"
|
|
221
|
+
style={[metrics.caption, typeStyle("medium"), { fontVariant: ["tabular-nums"], color: tokens.color.foreground[scheme] }]}
|
|
222
222
|
>
|
|
223
223
|
{selectedCount}
|
|
224
224
|
</Text>
|
package/src/Card.tsx
CHANGED
|
@@ -65,11 +65,11 @@ export function Card({
|
|
|
65
65
|
)}
|
|
66
66
|
{title ? (
|
|
67
67
|
<PrimitiveCardTitle
|
|
68
|
-
className={cn("font-instrument-sans-
|
|
68
|
+
className={cn("font-instrument-sans-medium leading-tight", titleSize)}
|
|
69
69
|
style={[
|
|
70
70
|
textStyle("foreground", scheme),
|
|
71
71
|
sizeStyle(titleSize, "tight"),
|
|
72
|
-
typeStyle("
|
|
72
|
+
typeStyle("medium"),
|
|
73
73
|
]}
|
|
74
74
|
>
|
|
75
75
|
{title}
|
|
@@ -112,7 +112,7 @@ export function CardHeader({ className, ...props }: PartProps) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
* Web `font-
|
|
115
|
+
* Web `font-medium leading-none` at the inherited 16. The line height is
|
|
116
116
|
* `leading-tight` (20), not 16: below the face's ascent and descent, iOS and
|
|
117
117
|
* Android can clip the glyphs.
|
|
118
118
|
*/
|
|
@@ -123,11 +123,11 @@ export function CardTitle({ className, style, ...props }: TextPartProps) {
|
|
|
123
123
|
return (
|
|
124
124
|
<Text
|
|
125
125
|
accessibilityRole="header"
|
|
126
|
-
className={cn("font-instrument-sans-
|
|
126
|
+
className={cn("font-instrument-sans-medium leading-tight", size, className)}
|
|
127
127
|
style={[
|
|
128
128
|
textStyle("foreground", scheme),
|
|
129
129
|
sizeStyle(size, "tight"),
|
|
130
|
-
typeStyle("
|
|
130
|
+
typeStyle("medium"),
|
|
131
131
|
style,
|
|
132
132
|
]}
|
|
133
133
|
{...props}
|
package/src/Chip.tsx
CHANGED
|
@@ -42,12 +42,12 @@ export function Chip({
|
|
|
42
42
|
} ${selected ? "bg-pink-100 dark:bg-pink-900/40" : "bg-secondary"}`}
|
|
43
43
|
>
|
|
44
44
|
<Text
|
|
45
|
-
className={`font-instrument-sans-
|
|
45
|
+
className={`font-instrument-sans-medium ${
|
|
46
46
|
largerText ? "text-xl" : "text-lg"
|
|
47
47
|
} ${
|
|
48
48
|
selected ? "text-pink-700 dark:text-pink-300" : ""
|
|
49
49
|
}`}
|
|
50
|
-
style={[selected ? null : textStyle("muted", scheme), typeStyle("
|
|
50
|
+
style={[selected ? null : textStyle("muted", scheme), typeStyle("medium")]}
|
|
51
51
|
>
|
|
52
52
|
{label}
|
|
53
53
|
</Text>
|
package/src/DateTimeField.tsx
CHANGED
|
@@ -100,8 +100,8 @@ export function DateTimeField({
|
|
|
100
100
|
style={{ backgroundColor: palette.default[scheme] }}
|
|
101
101
|
>
|
|
102
102
|
<Text
|
|
103
|
-
className={`${largerText ? "text-xl" : "text-lg"} font-instrument-sans-
|
|
104
|
-
style={[textColor, typeStyle("
|
|
103
|
+
className={`${largerText ? "text-xl" : "text-lg"} font-instrument-sans-medium`}
|
|
104
|
+
style={[textColor, typeStyle("medium")]}
|
|
105
105
|
>
|
|
106
106
|
{button.label}
|
|
107
107
|
</Text>
|
package/src/Dialog.tsx
CHANGED
|
@@ -193,7 +193,7 @@ export function DialogHeader({ className, ...props }: PartProps) {
|
|
|
193
193
|
// Text colours are styles (`textStyle`), so they follow the colour scheme in
|
|
194
194
|
// apps whose `text-foreground` does not. Recolour with `style`, not `className`.
|
|
195
195
|
|
|
196
|
-
/** Web `text-lg font-
|
|
196
|
+
/** Web `text-lg font-medium`. */
|
|
197
197
|
export function DialogTitle({ className, style, ...props }: TextPartProps) {
|
|
198
198
|
const largerText = useLargerText();
|
|
199
199
|
const scheme = useScheme();
|
|
@@ -201,11 +201,11 @@ export function DialogTitle({ className, style, ...props }: TextPartProps) {
|
|
|
201
201
|
<Text
|
|
202
202
|
accessibilityRole="header"
|
|
203
203
|
className={cn(
|
|
204
|
-
"font-instrument-sans-
|
|
204
|
+
"font-instrument-sans-medium",
|
|
205
205
|
largerText ? "text-2xl" : "text-lg",
|
|
206
206
|
className,
|
|
207
207
|
)}
|
|
208
|
-
style={[textStyle("foreground", scheme), typeStyle("
|
|
208
|
+
style={[textStyle("foreground", scheme), typeStyle("medium"), style]}
|
|
209
209
|
{...props}
|
|
210
210
|
/>
|
|
211
211
|
);
|
package/src/DropdownMenu.tsx
CHANGED
|
@@ -627,17 +627,17 @@ export function DropdownMenuRadioItem({ checked, ...props }: DropdownMenuRadioIt
|
|
|
627
627
|
|
|
628
628
|
export type DropdownMenuLabelProps = { children: ReactNode; className?: string };
|
|
629
629
|
|
|
630
|
-
/** A group heading: the web `text-xs font-
|
|
630
|
+
/** A group heading: the web `text-xs font-medium uppercase tracking-widest text-muted-foreground`, `px-2.5 py-1.5`. */
|
|
631
631
|
export function DropdownMenuLabel({ children, className }: DropdownMenuLabelProps) {
|
|
632
632
|
const scheme = useScheme();
|
|
633
633
|
const text = sizeStyle(useLargerText() ? "text-base" : "text-xs");
|
|
634
634
|
return (
|
|
635
635
|
<Text
|
|
636
636
|
accessibilityRole="header"
|
|
637
|
-
className={cn("font-instrument-sans-
|
|
637
|
+
className={cn("font-instrument-sans-medium uppercase", className)}
|
|
638
638
|
style={[
|
|
639
639
|
text,
|
|
640
|
-
typeStyle("
|
|
640
|
+
typeStyle("medium"),
|
|
641
641
|
{
|
|
642
642
|
letterSpacing: text.fontSize / 10,
|
|
643
643
|
color: tokens.color.muted[scheme],
|
package/src/EmptyState.tsx
CHANGED
|
@@ -33,10 +33,10 @@ function EmptyStateView({
|
|
|
33
33
|
<Icon size={largerText ? 44 : 40} color={tokens.color.muted[scheme]} />
|
|
34
34
|
<Text
|
|
35
35
|
className={cn(
|
|
36
|
-
"mt-4 text-center font-instrument-sans-
|
|
36
|
+
"mt-4 text-center font-instrument-sans-medium",
|
|
37
37
|
largerText ? "text-xl" : "text-lg",
|
|
38
38
|
)}
|
|
39
|
-
style={[textStyle("foreground", scheme), typeStyle("
|
|
39
|
+
style={[textStyle("foreground", scheme), typeStyle("medium")]}
|
|
40
40
|
>
|
|
41
41
|
{title}
|
|
42
42
|
</Text>
|
|
@@ -123,11 +123,11 @@ function Title({ className, style, ...props }: TextProps & { className?: string
|
|
|
123
123
|
return (
|
|
124
124
|
<Text
|
|
125
125
|
className={cn(
|
|
126
|
-
"text-center font-instrument-sans-
|
|
126
|
+
"text-center font-instrument-sans-medium",
|
|
127
127
|
largerText ? "text-xl" : "text-lg",
|
|
128
128
|
className,
|
|
129
129
|
)}
|
|
130
|
-
style={[textStyle("foreground", scheme), typeStyle("
|
|
130
|
+
style={[textStyle("foreground", scheme), typeStyle("medium"), style]}
|
|
131
131
|
{...props}
|
|
132
132
|
/>
|
|
133
133
|
);
|
package/src/FloatingTabBar.tsx
CHANGED
|
@@ -195,8 +195,8 @@ function TabBarItem({
|
|
|
195
195
|
// The bar has a fixed height (`tabBarReserve`), so labels
|
|
196
196
|
// scale with Dynamic Type only up to what fits in it.
|
|
197
197
|
maxFontSizeMultiplier={1.5}
|
|
198
|
-
className={`font-instrument-sans-
|
|
199
|
-
style={[{ color }, typeStyle("
|
|
198
|
+
className={`font-instrument-sans-medium ${largerText ? "text-base" : "text-sm"}`}
|
|
199
|
+
style={[{ color }, typeStyle("medium")]}
|
|
200
200
|
>
|
|
201
201
|
{label}
|
|
202
202
|
</Text>
|
package/src/LabeledSwitchRow.tsx
CHANGED
|
@@ -56,11 +56,11 @@ export function LabeledSwitchRow({
|
|
|
56
56
|
<View className="min-w-0 flex-1">
|
|
57
57
|
<Text
|
|
58
58
|
className={cn(
|
|
59
|
-
"font-instrument-sans-
|
|
59
|
+
"font-instrument-sans-medium",
|
|
60
60
|
largerText ? "text-xl" : "text-lg",
|
|
61
61
|
disabled && "opacity-70",
|
|
62
62
|
)}
|
|
63
|
-
style={[textStyle("foreground", scheme), typeStyle("
|
|
63
|
+
style={[textStyle("foreground", scheme), typeStyle("medium")]}
|
|
64
64
|
>
|
|
65
65
|
{label}
|
|
66
66
|
</Text>
|
package/src/ListRow.tsx
CHANGED
|
@@ -63,11 +63,11 @@ export function ListRow({
|
|
|
63
63
|
<Text
|
|
64
64
|
numberOfLines={2}
|
|
65
65
|
className={cn(
|
|
66
|
-
"font-instrument-sans-
|
|
66
|
+
"font-instrument-sans-medium",
|
|
67
67
|
largerText ? "text-xl" : "text-lg",
|
|
68
68
|
titleEnd != null && "min-w-0 flex-1",
|
|
69
69
|
)}
|
|
70
|
-
style={[textStyle("foreground", scheme), typeStyle("
|
|
70
|
+
style={[textStyle("foreground", scheme), typeStyle("medium")]}
|
|
71
71
|
>
|
|
72
72
|
{title}
|
|
73
73
|
</Text>
|
package/src/PinnedBotTile.tsx
CHANGED
|
@@ -49,8 +49,8 @@ export function PinnedBotTile({ title, leading, unread = false, generating = fal
|
|
|
49
49
|
{leading}
|
|
50
50
|
<Text
|
|
51
51
|
numberOfLines={2}
|
|
52
|
-
className={cn("text-center font-instrument-sans-
|
|
53
|
-
style={[textStyle("foreground", scheme), typeStyle("
|
|
52
|
+
className={cn("text-center font-instrument-sans-medium", largerText ? "text-lg" : "text-base")}
|
|
53
|
+
style={[textStyle("foreground", scheme), typeStyle("medium")]}
|
|
54
54
|
>
|
|
55
55
|
{title}
|
|
56
56
|
</Text>
|
package/src/StatGrid.tsx
CHANGED
|
@@ -58,11 +58,11 @@ export function StatGrid({ items, columns = 2, testID }: StatGridProps) {
|
|
|
58
58
|
{item.label}
|
|
59
59
|
</Text>
|
|
60
60
|
<Text
|
|
61
|
-
className={cn("font-instrument-sans-
|
|
61
|
+
className={cn("font-instrument-sans-medium", valueSize)}
|
|
62
62
|
style={[
|
|
63
63
|
textStyle("foreground", scheme),
|
|
64
64
|
sizeStyle(valueSize, "tight"),
|
|
65
|
-
typeStyle("
|
|
65
|
+
typeStyle("medium"),
|
|
66
66
|
{ fontVariant: ["tabular-nums"] },
|
|
67
67
|
]}
|
|
68
68
|
>
|
package/src/Stepper.tsx
CHANGED
|
@@ -49,8 +49,8 @@ export function Stepper({
|
|
|
49
49
|
/>
|
|
50
50
|
<Text
|
|
51
51
|
accessibilityLabel={valueLabel}
|
|
52
|
-
className={cn("min-w-8 text-center font-instrument-sans-
|
|
53
|
-
style={[textStyle("foreground", scheme), typeStyle("
|
|
52
|
+
className={cn("min-w-8 text-center font-instrument-sans-medium", largerText ? "text-3xl" : "text-2xl")}
|
|
53
|
+
style={[textStyle("foreground", scheme), typeStyle("medium")]}
|
|
54
54
|
>
|
|
55
55
|
{value}
|
|
56
56
|
</Text>
|
package/src/Toast.tsx
CHANGED
|
@@ -183,8 +183,8 @@ function ToastCard({ item }: { item: ToastItem }) {
|
|
|
183
183
|
className="rounded-full bg-secondary px-3 py-1.5 active:opacity-70"
|
|
184
184
|
>
|
|
185
185
|
<Text
|
|
186
|
-
className="font-instrument-sans-
|
|
187
|
-
style={[textStyle("foreground", scheme), typeStyle("
|
|
186
|
+
className="font-instrument-sans-medium text-sm"
|
|
187
|
+
style={[textStyle("foreground", scheme), typeStyle("medium")]}
|
|
188
188
|
>
|
|
189
189
|
{item.action.label}
|
|
190
190
|
</Text>
|
|
@@ -156,7 +156,7 @@ function RecordRow({
|
|
|
156
156
|
) : mark === "other" ? (
|
|
157
157
|
<IconPencil size={glyph} strokeWidth={3} color={markColor} />
|
|
158
158
|
) : (
|
|
159
|
-
<Text className="font-instrument-sans-
|
|
159
|
+
<Text className="font-instrument-sans-medium" style={[{ fontSize: largerText ? 13 : 10, color: markColor }, typeStyle("medium")]}>
|
|
160
160
|
{mark}
|
|
161
161
|
</Text>
|
|
162
162
|
)}
|
package/src/ai/card-button.tsx
CHANGED
|
@@ -47,7 +47,7 @@ export function CardButton({ label, variant, onPress, disabled, accessibilityLab
|
|
|
47
47
|
press.style,
|
|
48
48
|
]}
|
|
49
49
|
>
|
|
50
|
-
<Text className={cn(size, "font-instrument-sans-
|
|
50
|
+
<Text className={cn(size, "font-instrument-sans-medium")} style={[sizeStyle(size), typeStyle("medium"), { color: colors.color }]}>
|
|
51
51
|
{label}
|
|
52
52
|
</Text>
|
|
53
53
|
</AnimatedPressable>
|