@vvedantb/native-ui 0.37.1 → 0.37.2
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/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/auth/AuthScreen.jsx +2 -2
- package/dist/examples/ParityGallery.jsx +2 -2
- package/dist/generative-ui/components.jsx +2 -2
- package/dist/marketing/UpgradeToProCard.jsx +2 -2
- package/dist/media/ImageGallery.jsx +2 -2
- package/dist/motion.js +3 -2
- package/dist/primitives/card.jsx +2 -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 +6 -6
- package/package.json +1 -1
- 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/auth/AuthScreen.tsx +2 -2
- package/src/examples/ParityGallery.tsx +2 -2
- package/src/generative-ui/components.tsx +3 -3
- package/src/marketing/UpgradeToProCard.tsx +2 -2
- package/src/media/ImageGallery.tsx +1 -1
- package/src/motion.ts +3 -2
- package/src/primitives/card.tsx +3 -3
- 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 +9 -14
|
@@ -89,8 +89,8 @@ export function ChoiceQuestion({
|
|
|
89
89
|
text
|
|
90
90
|
) : (
|
|
91
91
|
<Text
|
|
92
|
-
className={`${buttonText} font-instrument-sans-
|
|
93
|
-
style={[sizeStyle(buttonText), typeStyle("
|
|
92
|
+
className={`${buttonText} font-instrument-sans-medium`}
|
|
93
|
+
style={[sizeStyle(buttonText), typeStyle("medium"), { color: buttonColors(variant, scheme)?.color }]}
|
|
94
94
|
>
|
|
95
95
|
{text}
|
|
96
96
|
</Text>
|
|
@@ -127,9 +127,9 @@ export function ChoiceQuestion({
|
|
|
127
127
|
<View style={{ gap: 16 }}>
|
|
128
128
|
<View className="flex-row items-center justify-between" style={{ gap: 8 }}>
|
|
129
129
|
<Text
|
|
130
|
-
className="flex-1 font-instrument-sans-
|
|
130
|
+
className="flex-1 font-instrument-sans-medium"
|
|
131
131
|
// Web `text-[15px] leading-snug` (15 / 20.625); larger text steps up to 18.
|
|
132
|
-
style={[{ fontSize: largerText ? 18 : 15, lineHeight: largerText ? 24 : 15 * 1.375 }, textStyle("foreground", scheme), typeStyle("
|
|
132
|
+
style={[{ fontSize: largerText ? 18 : 15, lineHeight: largerText ? 24 : 15 * 1.375 }, textStyle("foreground", scheme), typeStyle("medium")]}
|
|
133
133
|
>
|
|
134
134
|
{question.question}
|
|
135
135
|
</Text>
|
|
@@ -229,7 +229,7 @@ export function ChoiceQuestion({
|
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
231
|
* The question's topic, the web `Badge variant="secondary"` with Eva's
|
|
232
|
-
* `text-3xs font-
|
|
232
|
+
* `text-3xs font-medium` (10 / 14, 600) in a `px-2.5 py-0.5` pill. Drawn here
|
|
233
233
|
* because `Badge` sets its own size and weight.
|
|
234
234
|
*/
|
|
235
235
|
export function TopicBadge({ children }: { children: string }) {
|
|
@@ -243,10 +243,10 @@ export function TopicBadge({ children }: { children: string }) {
|
|
|
243
243
|
>
|
|
244
244
|
<Text
|
|
245
245
|
numberOfLines={1}
|
|
246
|
-
className="font-instrument-sans-
|
|
246
|
+
className="font-instrument-sans-medium"
|
|
247
247
|
style={[
|
|
248
248
|
{ fontSize, lineHeight: largerText ? 20 : 14, color: palette.defaultForeground[scheme] },
|
|
249
|
-
typeStyle("
|
|
249
|
+
typeStyle("medium"),
|
|
250
250
|
]}
|
|
251
251
|
>
|
|
252
252
|
{children}
|
|
@@ -373,13 +373,13 @@ function ChoiceRow({
|
|
|
373
373
|
) : mark === "other" ? (
|
|
374
374
|
<IconPencil size={glyph} color={muted} />
|
|
375
375
|
) : (
|
|
376
|
-
// Web `text-2xs font-
|
|
376
|
+
// Web `text-2xs font-medium tracking-wide`, at semibold: native-ui draws no bold face.
|
|
377
377
|
<Text
|
|
378
|
-
className="font-instrument-sans-
|
|
378
|
+
className="font-instrument-sans-medium"
|
|
379
379
|
style={[
|
|
380
380
|
{ fontSize: markText, lineHeight: largerText ? 20 : 16, color: muted },
|
|
381
381
|
trackingStyle(markText, "wide"),
|
|
382
|
-
typeStyle("
|
|
382
|
+
typeStyle("medium"),
|
|
383
383
|
]}
|
|
384
384
|
>
|
|
385
385
|
{mark}
|
|
@@ -149,8 +149,8 @@ export function MessageActionSheet({
|
|
|
149
149
|
}}
|
|
150
150
|
>
|
|
151
151
|
<Text
|
|
152
|
-
className={cn(body, "font-instrument-sans-
|
|
153
|
-
style={[sizeStyle(body), typeStyle("
|
|
152
|
+
className={cn(body, "font-instrument-sans-medium")}
|
|
153
|
+
style={[sizeStyle(body), typeStyle("medium"), textStyle("foreground", scheme)]}
|
|
154
154
|
>
|
|
155
155
|
{cancelLabel}
|
|
156
156
|
</Text>
|
package/src/ai/message-quote.tsx
CHANGED
|
@@ -49,8 +49,8 @@ export function MessageQuote({
|
|
|
49
49
|
<>
|
|
50
50
|
<Text
|
|
51
51
|
numberOfLines={1}
|
|
52
|
-
className={cn(caption, "font-instrument-sans-
|
|
53
|
-
style={[sizeStyle(caption), typeStyle("
|
|
52
|
+
className={cn(caption, "font-instrument-sans-medium")}
|
|
53
|
+
style={[sizeStyle(caption), typeStyle("medium"), { color: withAlpha(color, 0.75) }]}
|
|
54
54
|
>
|
|
55
55
|
{author}
|
|
56
56
|
</Text>
|
package/src/ai/message.tsx
CHANGED
|
@@ -287,8 +287,8 @@ export function MessageBotLabel({ name, avatar, className, testID = "message-bot
|
|
|
287
287
|
{avatar}
|
|
288
288
|
<Text
|
|
289
289
|
numberOfLines={1}
|
|
290
|
-
className={cn(size, "font-instrument-sans-
|
|
291
|
-
style={[sizeStyle(size), typeStyle("
|
|
290
|
+
className={cn(size, "font-instrument-sans-medium")}
|
|
291
|
+
style={[sizeStyle(size), typeStyle("medium"), { color: tokens.color.muted[scheme] }]}
|
|
292
292
|
>
|
|
293
293
|
{name}
|
|
294
294
|
</Text>
|
|
@@ -61,8 +61,8 @@ export function ReplyQuoteChip({
|
|
|
61
61
|
<View className="min-w-0 flex-1 py-2">
|
|
62
62
|
<Text
|
|
63
63
|
numberOfLines={1}
|
|
64
|
-
className={cn(caption, "font-instrument-sans-
|
|
65
|
-
style={[sizeStyle(caption), typeStyle("
|
|
64
|
+
className={cn(caption, "font-instrument-sans-medium")}
|
|
65
|
+
style={[sizeStyle(caption), typeStyle("medium"), textStyle("muted", scheme)]}
|
|
66
66
|
>
|
|
67
67
|
{author}
|
|
68
68
|
</Text>
|
|
@@ -56,7 +56,7 @@ function StatusPill({ status, testID }: { status: SubagentStatus; testID: string
|
|
|
56
56
|
className="rounded-full border px-2.5 py-0.5"
|
|
57
57
|
style={{ borderColor: colors.borderColor, backgroundColor: colors.backgroundColor }}
|
|
58
58
|
>
|
|
59
|
-
<Text className={cn(caption, "font-instrument-sans-
|
|
59
|
+
<Text className={cn(caption, "font-instrument-sans-medium")} style={[sizeStyle(caption), typeStyle("medium"), { color: colors.color }]}>
|
|
60
60
|
{STATUS_LABEL[status]}
|
|
61
61
|
</Text>
|
|
62
62
|
</View>
|
|
@@ -114,8 +114,8 @@ export function SubagentRunCard({
|
|
|
114
114
|
)}
|
|
115
115
|
<Text
|
|
116
116
|
numberOfLines={2}
|
|
117
|
-
className={cn(body, "min-w-0 flex-1 font-instrument-sans-
|
|
118
|
-
style={[sizeStyle(body), typeStyle("
|
|
117
|
+
className={cn(body, "min-w-0 flex-1 font-instrument-sans-medium")}
|
|
118
|
+
style={[sizeStyle(body), typeStyle("medium"), textStyle("foreground", scheme)]}
|
|
119
119
|
>
|
|
120
120
|
{title}
|
|
121
121
|
</Text>
|
|
@@ -218,8 +218,8 @@ export function SubagentResultCard({
|
|
|
218
218
|
{avatar}
|
|
219
219
|
<Text
|
|
220
220
|
numberOfLines={2}
|
|
221
|
-
className={cn(body, "min-w-0 flex-1 font-instrument-sans-
|
|
222
|
-
style={[sizeStyle(body), typeStyle("
|
|
221
|
+
className={cn(body, "min-w-0 flex-1 font-instrument-sans-medium")}
|
|
222
|
+
style={[sizeStyle(body), typeStyle("medium"), textStyle("foreground", scheme)]}
|
|
223
223
|
>
|
|
224
224
|
{title}
|
|
225
225
|
</Text>
|
|
@@ -157,8 +157,8 @@ function ToolCardBase({
|
|
|
157
157
|
<View className="flex-row items-center gap-2">
|
|
158
158
|
<IconTool size={largerText ? 20 : 16} color={tokens.color.muted[scheme]} />
|
|
159
159
|
<Text
|
|
160
|
-
className={cn(caption, "font-instrument-sans-
|
|
161
|
-
style={[sizeStyle(caption), typeStyle("
|
|
160
|
+
className={cn(caption, "font-instrument-sans-medium")}
|
|
161
|
+
style={[sizeStyle(caption), typeStyle("medium"), textStyle("muted", scheme)]}
|
|
162
162
|
>
|
|
163
163
|
{pending ? "Sending decision…" : heading}
|
|
164
164
|
</Text>
|
|
@@ -174,8 +174,8 @@ function ToolCardBase({
|
|
|
174
174
|
<Text
|
|
175
175
|
testID={`${testID}-name`}
|
|
176
176
|
numberOfLines={2}
|
|
177
|
-
className={cn(body, "font-instrument-sans-
|
|
178
|
-
style={[sizeStyle(body), typeStyle("
|
|
177
|
+
className={cn(body, "font-instrument-sans-medium")}
|
|
178
|
+
style={[sizeStyle(body), typeStyle("medium"), textStyle("foreground", scheme)]}
|
|
179
179
|
>
|
|
180
180
|
{toolName}
|
|
181
181
|
</Text>
|
package/src/auth/AuthScreen.tsx
CHANGED
|
@@ -69,8 +69,8 @@ export function AuthScreen({ title, subtitle, children, header, footer, testID,
|
|
|
69
69
|
<View className="gap-2">
|
|
70
70
|
<Text
|
|
71
71
|
accessibilityRole="header"
|
|
72
|
-
className="font-instrument-sans-
|
|
73
|
-
style={[textStyle("foreground", scheme), typeStyle("
|
|
72
|
+
className="font-instrument-sans-medium text-2xl"
|
|
73
|
+
style={[textStyle("foreground", scheme), typeStyle("medium")]}
|
|
74
74
|
>
|
|
75
75
|
{title}
|
|
76
76
|
</Text>
|
|
@@ -215,8 +215,8 @@ function Section({ title, children }: { title: string; children: ReactNode }) {
|
|
|
215
215
|
<View className="gap-3">
|
|
216
216
|
<GalleryText
|
|
217
217
|
accessibilityRole="header"
|
|
218
|
-
className="font-instrument-sans-
|
|
219
|
-
style={typeStyle("
|
|
218
|
+
className="font-instrument-sans-medium text-lg"
|
|
219
|
+
style={typeStyle("medium")}
|
|
220
220
|
>
|
|
221
221
|
{title}
|
|
222
222
|
</GalleryText>
|
|
@@ -27,7 +27,7 @@ const TEXT_2XS = { fontSize: 11, lineHeight: 14 };
|
|
|
27
27
|
const FONT_CLASS = {
|
|
28
28
|
regular: "font-instrument-sans",
|
|
29
29
|
medium: "font-instrument-sans-medium",
|
|
30
|
-
semibold: "font-instrument-sans-
|
|
30
|
+
semibold: "font-instrument-sans-medium",
|
|
31
31
|
} as const;
|
|
32
32
|
|
|
33
33
|
function Line({
|
|
@@ -154,12 +154,12 @@ export function MetricElement({ element }: ComponentRenderProps<GenerativeUiProp
|
|
|
154
154
|
return (
|
|
155
155
|
<View className="min-w-0 gap-0.5" accessible accessibilityLabel={`${label}, ${value}`}>
|
|
156
156
|
<Line size="text-xs" color={tokens.color.muted[scheme]} text={label} />
|
|
157
|
-
{/* The web `text-lg font-
|
|
157
|
+
{/* The web `text-lg font-medium tabular-nums leading-tight`. */}
|
|
158
158
|
<Text
|
|
159
159
|
className={FONT_CLASS.semibold}
|
|
160
160
|
style={[
|
|
161
161
|
sizeStyle("text-lg", "tight"),
|
|
162
|
-
typeStyle("
|
|
162
|
+
typeStyle("medium"),
|
|
163
163
|
{ fontVariant: ["tabular-nums"], color: toneText(tone, scheme) },
|
|
164
164
|
]}
|
|
165
165
|
>
|
|
@@ -93,8 +93,8 @@ export function UpgradeToProCard({
|
|
|
93
93
|
>
|
|
94
94
|
<Text
|
|
95
95
|
numberOfLines={1}
|
|
96
|
-
className={cn("min-w-0 flex-1 font-instrument-sans-
|
|
97
|
-
style={[textStyle("foreground", scheme), sizeStyle(titleSize), typeStyle("
|
|
96
|
+
className={cn("min-w-0 flex-1 font-instrument-sans-medium", titleSize)}
|
|
97
|
+
style={[textStyle("foreground", scheme), sizeStyle(titleSize), typeStyle("medium")]}
|
|
98
98
|
>
|
|
99
99
|
{title}
|
|
100
100
|
</Text>
|
|
@@ -119,7 +119,7 @@ function ImageGrid({ images, onOpen }: { images: GalleryImage[]; onOpen: (index:
|
|
|
119
119
|
<Image source={{ uri: image.url }} resizeMode="cover" style={{ width: "100%", height: "100%" }} />
|
|
120
120
|
{tile.overflow > 0 ? (
|
|
121
121
|
<View className="absolute inset-0 items-center justify-center" style={{ backgroundColor: withAlpha(tokens.color.black, 0.6) }}>
|
|
122
|
-
<Text className="font-instrument-sans-
|
|
122
|
+
<Text className="font-instrument-sans-medium text-xl" style={[{ color: tokens.color.white }, typeStyle("medium")]}>
|
|
123
123
|
{`+${tile.overflow}`}
|
|
124
124
|
</Text>
|
|
125
125
|
</View>
|
package/src/motion.ts
CHANGED
|
@@ -15,10 +15,11 @@ export const SHEET_SPRING = {
|
|
|
15
15
|
reduceMotion: ReduceMotion.System,
|
|
16
16
|
} as const;
|
|
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
|
} as const;
|
|
24
25
|
|
package/src/primitives/card.tsx
CHANGED
|
@@ -42,14 +42,14 @@ const CardTitle = React.forwardRef<
|
|
|
42
42
|
React.ElementRef<typeof Text>,
|
|
43
43
|
React.ComponentPropsWithoutRef<typeof Text> & { className?: string }
|
|
44
44
|
>(({ className, style, ...props }, ref) => {
|
|
45
|
-
// The web `font-
|
|
45
|
+
// The web `font-medium`: the semibold face, with its weight as a style.
|
|
46
46
|
return (
|
|
47
47
|
<Text
|
|
48
48
|
ref={ref}
|
|
49
49
|
role="heading"
|
|
50
50
|
aria-level={3}
|
|
51
|
-
className={cn("font-instrument-sans-
|
|
52
|
-
style={[typeStyle("
|
|
51
|
+
className={cn("font-instrument-sans-medium leading-none", className)}
|
|
52
|
+
style={[typeStyle("medium"), style]}
|
|
53
53
|
{...props}
|
|
54
54
|
/>
|
|
55
55
|
);
|
package/src/primitives/text.tsx
CHANGED
|
@@ -17,26 +17,26 @@ const textVariants = cva(
|
|
|
17
17
|
variant: {
|
|
18
18
|
default: "",
|
|
19
19
|
h1: cn(
|
|
20
|
-
"text-4xl font-instrument-sans-
|
|
20
|
+
"text-4xl font-instrument-sans-medium tracking-tight",
|
|
21
21
|
Platform.select({ web: "scroll-m-20" }),
|
|
22
22
|
),
|
|
23
23
|
h2: cn(
|
|
24
|
-
"text-3xl font-instrument-sans-
|
|
24
|
+
"text-3xl font-instrument-sans-medium tracking-tight border-border border-b pb-2",
|
|
25
25
|
Platform.select({ web: "scroll-m-20" }),
|
|
26
26
|
),
|
|
27
27
|
h3: cn(
|
|
28
|
-
"text-2xl font-instrument-sans-
|
|
28
|
+
"text-2xl font-instrument-sans-medium tracking-tight",
|
|
29
29
|
Platform.select({ web: "scroll-m-20" }),
|
|
30
30
|
),
|
|
31
31
|
h4: cn(
|
|
32
|
-
"text-xl font-instrument-sans-
|
|
32
|
+
"text-xl font-instrument-sans-medium tracking-tight",
|
|
33
33
|
Platform.select({ web: "scroll-m-20" }),
|
|
34
34
|
),
|
|
35
35
|
p: "leading-7",
|
|
36
36
|
blockquote: "border-l-2 border-border pl-4 italic",
|
|
37
|
-
code: "bg-muted rounded px-[0.3rem] py-[0.2rem] text-sm font-instrument-sans-
|
|
37
|
+
code: "bg-muted rounded px-[0.3rem] py-[0.2rem] text-sm font-instrument-sans-medium",
|
|
38
38
|
lead: "text-xl text-muted-foreground",
|
|
39
|
-
large: "text-lg font-instrument-sans-
|
|
39
|
+
large: "text-lg font-instrument-sans-medium",
|
|
40
40
|
small: "text-sm font-instrument-sans-medium",
|
|
41
41
|
muted: "text-sm text-muted-foreground",
|
|
42
42
|
},
|
|
@@ -69,14 +69,14 @@ const ARIA_LEVEL: Partial<Record<TextVariant, string>> = {
|
|
|
69
69
|
// The weight of each variant's `font-instrument-sans-*` class, set as a style
|
|
70
70
|
// beside it (`typeStyle`): where an app maps every one of those classes to one
|
|
71
71
|
// family, the class alone draws Regular. Headings are semibold, as the web
|
|
72
|
-
// titles; `h1` was `font-
|
|
72
|
+
// titles; `h1` was `font-medium` before 0.3.13.
|
|
73
73
|
const WEIGHT: Partial<Record<TextVariant, ReturnType<typeof typeStyle>>> = {
|
|
74
|
-
h1: typeStyle("
|
|
75
|
-
h2: typeStyle("
|
|
76
|
-
h3: typeStyle("
|
|
77
|
-
h4: typeStyle("
|
|
78
|
-
code: typeStyle("
|
|
79
|
-
large: typeStyle("
|
|
74
|
+
h1: typeStyle("medium"),
|
|
75
|
+
h2: typeStyle("medium"),
|
|
76
|
+
h3: typeStyle("medium"),
|
|
77
|
+
h4: typeStyle("medium"),
|
|
78
|
+
code: typeStyle("medium"),
|
|
79
|
+
large: typeStyle("medium"),
|
|
80
80
|
small: typeStyle("medium"),
|
|
81
81
|
};
|
|
82
82
|
|
|
@@ -21,8 +21,8 @@ import { useWebClickGuard } from "./web-click-guard";
|
|
|
21
21
|
// The toast drag on Gesture Handler: the track phase and the release run as
|
|
22
22
|
// worklets on the UI thread. The rules are plain worklets in `toastDrag`.
|
|
23
23
|
|
|
24
|
-
/** Back home after a short drag:
|
|
25
|
-
const HOME_SPRING = { duration: 250, dampingRatio:
|
|
24
|
+
/** Back home after a short drag: critically damped, no bounce. */
|
|
25
|
+
const HOME_SPRING = { duration: 250, dampingRatio: 1, overshootClamping: true, reduceMotion: ReduceMotion.System } as const;
|
|
26
26
|
/** Away up the screen: no overshoot back into view. */
|
|
27
27
|
const AWAY_SPRING = { duration: 250, dampingRatio: 1, overshootClamping: true, reduceMotion: ReduceMotion.System } as const;
|
|
28
28
|
|
|
@@ -49,8 +49,8 @@ export function FromProjectV({ className, testID }: FromProjectVProps) {
|
|
|
49
49
|
</Text>
|
|
50
50
|
<ProjectVMark size={14} color={muted} />
|
|
51
51
|
<Text
|
|
52
|
-
className="text-sm font-instrument-sans-
|
|
53
|
-
style={[textStyle("muted", scheme), typeStyle("
|
|
52
|
+
className="text-sm font-instrument-sans-medium"
|
|
53
|
+
style={[textStyle("muted", scheme), typeStyle("medium")]}
|
|
54
54
|
>
|
|
55
55
|
Project V
|
|
56
56
|
</Text>
|
|
@@ -33,11 +33,11 @@ export function SettingsSection({
|
|
|
33
33
|
<View className="flex-row items-start justify-between gap-4 px-4">
|
|
34
34
|
<View className="min-w-0 flex-1">
|
|
35
35
|
{typeof title === "string" ? (
|
|
36
|
-
// Web `text-sm font-
|
|
36
|
+
// Web `text-sm font-medium`: 14 / 20, 600.
|
|
37
37
|
<Text
|
|
38
38
|
accessibilityRole="header"
|
|
39
|
-
className="text-sm font-instrument-sans-
|
|
40
|
-
style={[textStyle("foreground", scheme), sizeStyle("text-sm"), typeStyle("
|
|
39
|
+
className="text-sm font-instrument-sans-medium"
|
|
40
|
+
style={[textStyle("foreground", scheme), sizeStyle("text-sm"), typeStyle("medium")]}
|
|
41
41
|
>
|
|
42
42
|
{title}
|
|
43
43
|
</Text>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconCheck, IconCircleHalf, IconDeviceDesktop, IconMoon, IconSun } from "@tabler/icons-react-native";
|
|
2
2
|
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
3
|
-
import Svg, {
|
|
3
|
+
import Svg, { Path, Rect } from "react-native-svg";
|
|
4
4
|
import { cn } from "../cn";
|
|
5
5
|
import { sizeStyle, typeStyle } from "../controlStyles";
|
|
6
6
|
import { palette, withAlpha } from "../palette";
|
|
@@ -19,7 +19,7 @@ const ICONS = { light: IconSun, neutral: IconCircleHalf, dark: IconMoon, system:
|
|
|
19
19
|
/** Web `bg-zinc-900`. */
|
|
20
20
|
const ZINC_900 = "#18181b";
|
|
21
21
|
// Swatches and icons show the theme itself, so they use the web's fixed colours, not tokens.
|
|
22
|
-
// System has no swatch colour (it is a
|
|
22
|
+
// System has no swatch colour (it is a hard split) and a muted icon.
|
|
23
23
|
const SWATCHES: Record<ThemeMode, string | null> = {
|
|
24
24
|
light: "#ffffff",
|
|
25
25
|
neutral: "#3f3f46",
|
|
@@ -44,18 +44,13 @@ export type ThemeModePickerProps = {
|
|
|
44
44
|
testID?: string;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
/** The
|
|
48
|
-
function
|
|
47
|
+
/** The System swatch: white with a hard diagonal half in zinc-900, no gradient. */
|
|
48
|
+
function SplitSwatch() {
|
|
49
49
|
return (
|
|
50
50
|
// Sized by props: an unsized Svg is 300 wide and widens the tile.
|
|
51
|
-
<Svg width="100%" height="100%" style={StyleSheet.absoluteFill}>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
<Stop offset="0" stopColor="#ffffff" />
|
|
55
|
-
<Stop offset="1" stopColor={ZINC_900} />
|
|
56
|
-
</LinearGradient>
|
|
57
|
-
</Defs>
|
|
58
|
-
<Rect width="100%" height="100%" fill="url(#theme-mode-system)" />
|
|
51
|
+
<Svg width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none" style={StyleSheet.absoluteFill}>
|
|
52
|
+
<Rect width="1" height="1" fill="#ffffff" />
|
|
53
|
+
<Path d="M1 0 L1 1 L0 1 Z" fill={ZINC_900} />
|
|
59
54
|
</Svg>
|
|
60
55
|
);
|
|
61
56
|
}
|
|
@@ -96,8 +91,8 @@ export function ThemeModePicker({ value, onChange, modes = THEME_MODES, classNam
|
|
|
96
91
|
className="mx-2 h-12 items-center justify-center self-stretch overflow-hidden rounded-2xl"
|
|
97
92
|
style={swatch ? { backgroundColor: swatch } : undefined}
|
|
98
93
|
>
|
|
99
|
-
{swatch ? null : <
|
|
100
|
-
{/* Positioned, so the web build paints it over the positioned
|
|
94
|
+
{swatch ? null : <SplitSwatch />}
|
|
95
|
+
{/* Positioned, so the web build paints it over the positioned swatch. */}
|
|
101
96
|
<View className="absolute inset-0 items-center justify-center">
|
|
102
97
|
<Icon size={22} color={ICON_COLOURS[mode] ?? tokens.color.muted[scheme]} />
|
|
103
98
|
</View>
|