Skip to content

Commit b438447

Browse files
fix(mobile): use selected theme across input forms and controls (#10239)
1 parent eee0557 commit b438447

27 files changed

Lines changed: 184 additions & 116 deletions

‎apps/mobile/generated-uniwind-default-theme-variables.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"--color-switch-active-thumb": "#ffffff",
2929
"--color-switch-inactive-track": "rgba(0, 0, 0, 0.08)",
3030
"--color-switch-inactive-thumb": "#8e8e93",
31+
"--color-warning": "#fffbeb",
32+
"--color-warning-border": "#fde68a",
33+
"--color-warning-foreground": "#b45309",
3134
"--color-danger": "#fef2f2",
3235
"--color-danger-border": "rgba(239, 68, 68, 0.12)",
3336
"--color-danger-foreground": "#dc2626",
@@ -95,6 +98,9 @@
9598
"--color-switch-active-thumb": "#ffffff",
9699
"--color-switch-inactive-track": "rgba(255, 255, 255, 0.06)",
97100
"--color-switch-inactive-thumb": "#8e8e93",
101+
"--color-warning": "rgba(69, 26, 3, 0.4)",
102+
"--color-warning-border": "rgba(120, 53, 15, 0.6)",
103+
"--color-warning-foreground": "#fcd34d",
98104
"--color-danger": "rgba(239, 68, 68, 0.14)",
99105
"--color-danger-border": "rgba(248, 113, 113, 0.18)",
100106
"--color-danger-foreground": "#fca5a5",

‎apps/mobile/generated-uniwind-themes.css‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@
150150
--color-switch-active-thumb: #ffffff;
151151
--color-switch-inactive-track: #f1c4e6;
152152
--color-switch-inactive-thumb: #8d1255;
153+
--color-warning: #fcf0ea;
154+
--color-warning-border: rgba(245, 158, 11, 0.32);
155+
--color-warning-foreground: #b05109;
153156
--color-danger: #fde4f1;
154157
--color-danger-border: rgba(247, 8, 108, 0.32);
155158
--color-danger-foreground: #9d174d;
@@ -275,6 +278,9 @@
275278
--color-switch-active-thumb: #fbd0e8;
276279
--color-switch-inactive-track: #362d3d;
277280
--color-switch-inactive-thumb: #e7d0dd;
281+
--color-warning: #412f20;
282+
--color-warning-border: rgba(245, 158, 11, 0.32);
283+
--color-warning-foreground: #fbbf24;
278284
--color-danger: #331a2b;
279285
--color-danger-border: rgba(157, 23, 77, 0.32);
280286
--color-danger-foreground: #fbd0e8;
@@ -400,6 +406,9 @@
400406
--color-switch-active-thumb: #fffaff;
401407
--color-switch-inactive-track: #e2ede7;
402408
--color-switch-inactive-thumb: #6e696f;
409+
--color-warning: #f4f0e1;
410+
--color-warning-border: rgba(254, 154, 0, 0.32);
411+
--color-warning-foreground: #b64a00;
403412
--color-danger: #f4e7e5;
404413
--color-danger-border: rgba(251, 44, 54, 0.32);
405414
--color-danger-foreground: #c10007;
@@ -525,6 +534,9 @@
525534
--color-switch-active-thumb: #241523;
526535
--color-switch-inactive-track: #2a4b39;
527536
--color-switch-inactive-thumb: #9da5a2;
537+
--color-warning: #3f3a1c;
538+
--color-warning-border: rgba(254, 154, 0, 0.32);
539+
--color-warning-foreground: #ffb900;
528540
--color-danger: #3f2c28;
529541
--color-danger-border: rgba(251, 65, 74, 0.32);
530542
--color-danger-foreground: #ff6668;
@@ -650,6 +662,9 @@
650662
--color-switch-active-thumb: #fffaff;
651663
--color-switch-inactive-track: #e4ecf2;
652664
--color-switch-inactive-thumb: #6f6873;
665+
--color-warning: #f6efe4;
666+
--color-warning-border: rgba(254, 154, 0, 0.32);
667+
--color-warning-foreground: #b74b00;
653668
--color-danger: #f5e6e9;
654669
--color-danger-border: rgba(251, 44, 54, 0.32);
655670
--color-danger-foreground: #c10007;
@@ -775,6 +790,9 @@
775790
--color-switch-active-thumb: #241523;
776791
--color-switch-inactive-track: #293f52;
777792
--color-switch-inactive-thumb: #969ca6;
793+
--color-warning: #3c3424;
794+
--color-warning-border: rgba(254, 154, 0, 0.32);
795+
--color-warning-foreground: #ffb900;
778796
--color-danger: #3c2630;
779797
--color-danger-border: rgba(251, 65, 74, 0.32);
780798
--color-danger-foreground: #ff6467;
@@ -900,6 +918,9 @@
900918
--color-switch-active-thumb: #fffaff;
901919
--color-switch-inactive-track: #f3eae5;
902920
--color-switch-inactive-thumb: #74686f;
921+
--color-warning: #f9efe2;
922+
--color-warning-border: rgba(254, 154, 0, 0.32);
923+
--color-warning-foreground: #b84b00;
903924
--color-danger: #f9e7e6;
904925
--color-danger-border: rgba(251, 44, 54, 0.32);
905926
--color-danger-foreground: #c10007;
@@ -1025,6 +1046,9 @@
10251046
--color-switch-active-thumb: #241523;
10261047
--color-switch-inactive-track: #513728;
10271048
--color-switch-inactive-thumb: #a59996;
1049+
--color-warning: #4b3215;
1050+
--color-warning-border: rgba(254, 154, 0, 0.32);
1051+
--color-warning-foreground: #ffb900;
10281052
--color-danger: #4a2321;
10291053
--color-danger-border: rgba(251, 65, 74, 0.32);
10301054
--color-danger-foreground: #ff6467;
@@ -1150,6 +1174,9 @@
11501174
--color-switch-active-thumb: #fffaff;
11511175
--color-switch-inactive-track: #edeaf4;
11521176
--color-switch-inactive-thumb: #726874;
1177+
--color-warning: #f8efe5;
1178+
--color-warning-border: rgba(254, 154, 0, 0.32);
1179+
--color-warning-foreground: #b84b00;
11531180
--color-danger: #f8e6ea;
11541181
--color-danger-border: rgba(251, 44, 54, 0.32);
11551182
--color-danger-foreground: #c10007;
@@ -1275,6 +1302,9 @@
12751302
--color-switch-active-thumb: #241523;
12761303
--color-switch-inactive-track: #362d51;
12771304
--color-switch-inactive-thumb: #9690a1;
1305+
--color-warning: #412e23;
1306+
--color-warning-border: rgba(254, 154, 0, 0.32);
1307+
--color-warning-foreground: #ffb900;
12781308
--color-danger: #40202e;
12791309
--color-danger-border: rgba(251, 65, 74, 0.32);
12801310
--color-danger-foreground: #ff6467;

‎apps/mobile/global.css‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@
5252
--color-switch-inactive-track: rgba(0, 0, 0, 0.08);
5353
--color-switch-inactive-thumb: #8e8e93;
5454

55+
/* Warning */
56+
--color-warning: #fffbeb;
57+
--color-warning-border: #fde68a;
58+
--color-warning-foreground: #b45309;
59+
5560
/* Danger */
5661
--color-danger: #fef2f2;
5762
--color-danger-border: rgba(239, 68, 68, 0.12);
@@ -151,6 +156,11 @@
151156
--color-switch-inactive-track: rgba(255, 255, 255, 0.06);
152157
--color-switch-inactive-thumb: #8e8e93;
153158

159+
/* Warning */
160+
--color-warning: rgba(69, 26, 3, 0.4);
161+
--color-warning-border: rgba(120, 53, 15, 0.6);
162+
--color-warning-foreground: #fcd34d;
163+
154164
/* Danger */
155165
--color-danger: rgba(239, 68, 68, 0.14);
156166
--color-danger-border: rgba(248, 113, 113, 0.18);

‎apps/mobile/src/components/AppText.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export function AppTextInput({ className, ref, ...props }: AppTextInputProps) {
3535
className,
3636
)}
3737
placeholderTextColorClassName="accent-placeholder"
38+
selectionColorClassName="accent-foreground-secondary"
39+
cursorColorClassName="accent-foreground-secondary"
3840
{...props}
3941
/>
4042
);

‎apps/mobile/src/components/ComposerAttachmentStrip.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function ComposerAttachmentContent(props: ComposerAttachmentThumbnailProps) {
195195
<SymbolView
196196
name="doc.text"
197197
size={props.compact ? 15 : 22}
198-
tintColor="#a3a3a3"
198+
tintColorClassName="accent-icon-subtle"
199199
type="monochrome"
200200
/>
201201
{!props.compact ? (

‎apps/mobile/src/components/ErrorBanner.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { View } from "react-native";
33
import { AppText as Text } from "./AppText";
44
export function ErrorBanner(props: { readonly message: string }) {
55
return (
6-
<View className="rounded-2xl border border-adaptive-rose-300-a70-400-a28 bg-adaptive-rose-100-a80-500-a12 px-3.5 py-3">
7-
<Text className="font-t3-medium text-sm text-adaptive-rose-700-300">{props.message}</Text>
6+
<View className="rounded-2xl border border-danger-border bg-danger px-3.5 py-3">
7+
<Text className="font-t3-medium text-sm text-danger-foreground">{props.message}</Text>
88
</View>
99
);
1010
}

‎apps/mobile/src/features/connection/CloudEnvironmentRows.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ function CloudEnvironmentRowShell(props: {
299299
traceId: props.connectionErrorTraceId,
300300
});
301301
const statusClassName = props.connectionError
302-
? "text-adaptive-rose-500-400"
302+
? "text-danger-foreground"
303303
: "text-foreground-muted";
304304
const [errorMeasurement, setErrorMeasurement] = useState<{
305305
readonly text: string;

‎apps/mobile/src/features/connection/ConnectionEnvironmentRow.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function ConnectionEnvironmentRow(props: {
9696
<Text
9797
className={cn(
9898
"text-xs",
99-
hasConnectionFailure ? "text-adaptive-rose-500-400" : "text-foreground-muted",
99+
hasConnectionFailure ? "text-danger-foreground" : "text-foreground-muted",
100100
)}
101101
numberOfLines={props.expanded ? undefined : 1}
102102
selectable={props.expanded}

‎apps/mobile/src/features/connection/connectionTone.ts‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,32 @@ export function connectionTone(state: RemoteClientConnectionState): StatusTone {
1212
case "reconnecting":
1313
return {
1414
label: "Reconnecting",
15-
pillClassName: "bg-adaptive-amber-500-a12-a16",
16-
textClassName: "text-adaptive-amber-700-300",
15+
pillClassName: "bg-warning",
16+
textClassName: "text-warning-foreground",
1717
};
1818
case "connecting":
1919
return {
2020
label: "Connecting",
21-
pillClassName: "bg-adaptive-sky-500-a12-a16",
22-
textClassName: "text-adaptive-sky-700-300",
21+
pillClassName: "bg-primary/10",
22+
textClassName: "text-foreground-secondary",
2323
};
2424
case "error":
2525
return {
2626
label: "Connection failed",
27-
pillClassName: "bg-adaptive-rose-500-a12-a16",
28-
textClassName: "text-adaptive-rose-700-300",
27+
pillClassName: "bg-danger",
28+
textClassName: "text-danger-foreground",
2929
};
3030
case "offline":
3131
return {
3232
label: "Offline",
33-
pillClassName: "bg-adaptive-rose-500-a12-a16",
34-
textClassName: "text-adaptive-rose-700-300",
33+
pillClassName: "bg-danger",
34+
textClassName: "text-danger-foreground",
3535
};
3636
case "available":
3737
return {
3838
label: "Available",
39-
pillClassName: "bg-adaptive-neutral-500-a10-a16",
40-
textClassName: "text-adaptive-neutral-600-300",
39+
pillClassName: "bg-subtle",
40+
textClassName: "text-foreground-secondary",
4141
};
4242
}
4343
}

‎apps/mobile/src/features/files/ThreadFilesRouteScreen.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ function FileContent(props: {
190190
return (
191191
<View className="flex-1 bg-sheet">
192192
{props.truncated ? (
193-
<View className="border-b border-adaptive-amber-200-900-a60 bg-adaptive-amber-50-950-a40 px-4 py-2">
194-
<Text className="text-2xs font-t3-bold uppercase text-adaptive-amber-700-300">
193+
<View className="border-b border-warning-border bg-warning px-4 py-2">
194+
<Text className="text-2xs font-t3-bold uppercase text-warning-foreground">
195195
Partial file
196196
</Text>
197-
<Text className="text-xs leading-snug text-adaptive-amber-800-200">
197+
<Text className="text-xs leading-snug text-warning-foreground">
198198
Preview limited to the first 1 MB of a truncated file.
199199
</Text>
200200
</View>

0 commit comments

Comments
 (0)