Skip to content

Commit 31dc1c0

Browse files
committed
feat(colors): add system colors full list back
1 parent e179e8c commit 31dc1c0

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

ios/extensions/Color+Parsing.swift

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,42 @@ extension Color {
7272
extension UIColor {
7373
static func systemColor(named name: String) -> UIColor? {
7474
switch name {
75-
case "systemGreen": return .systemGreen
75+
// Backgrounds
76+
case "systemBackground": return .systemBackground
77+
case "secondarySystemBackground": return .secondarySystemBackground
78+
case "tertiarySystemBackground": return .tertiarySystemBackground
79+
case "systemGroupedBackground": return .systemGroupedBackground
80+
case "secondarySystemGroupedBackground": return .secondarySystemGroupedBackground
81+
case "tertiarySystemGroupedBackground": return .tertiarySystemGroupedBackground
82+
// Labels
83+
case "label": return .label
84+
case "secondaryLabel": return .secondaryLabel
85+
case "tertiaryLabel": return .tertiaryLabel
86+
case "quaternaryLabel": return .quaternaryLabel
87+
case "placeholderText": return .placeholderText
88+
// Fill colors
89+
case "systemFill": return .systemFill
90+
case "secondarySystemFill": return .secondarySystemFill
91+
case "tertiarySystemFill": return .tertiarySystemFill
92+
case "quaternarySystemFill": return .quaternarySystemFill
93+
// Standard colors
94+
case "systemRed": return .systemRed
7695
case "systemBlue": return .systemBlue
96+
case "systemGreen": return .systemGreen
7797
case "systemOrange": return .systemOrange
78-
case "systemRed": return .systemRed
7998
case "systemYellow": return .systemYellow
80-
case "label": return .label
81-
// Add more system colors as needed
99+
case "systemPink": return .systemPink
100+
case "systemPurple": return .systemPurple
101+
case "systemTeal": return .systemTeal
102+
case "systemIndigo": return .systemIndigo
103+
// Grays
104+
case "systemGray": return .systemGray
105+
case "systemGray2": return .systemGray2
106+
case "systemGray3": return .systemGray3
107+
case "systemGray4": return .systemGray4
108+
case "systemGray5": return .systemGray5
109+
case "systemGray6": return .systemGray6
110+
// Default
82111
default: return nil
83112
}
84113
}

src/styles/buttonStyles.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { PlatformColor } from "react-native";
12
import type { NativeTextStyle } from "../types";
23

34
export const pickerButtonStyles: NativeTextStyle = {
4-
color: "label",
5-
backgroundColor: "tertiarySystemFill",
5+
color: PlatformColor("label"),
6+
backgroundColor: PlatformColor("tertiarySystemFill"),
67
paddingVertical: 7,
78
paddingHorizontal: 12,
89
borderRadius: 8,

src/types/style.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TextStyle, ViewStyle } from "react-native";
1+
import { ColorValue, TextStyle, ViewStyle } from "react-native";
22

33
export type NativeViewStyle = Pick<
44
ViewStyle,
@@ -25,9 +25,9 @@ export type NativeViewStyle = Pick<
2525
| "right"
2626
| "bottom"
2727
> & {
28-
tintColor?: string;
29-
accentColor?: string;
30-
foregroundColor?: string;
28+
tintColor?: ColorValue;
29+
accentColor?: ColorValue;
30+
foregroundColor?: ColorValue;
3131
cornerRadius?: number;
3232
preferredColorScheme?: "light" | "dark";
3333
};

0 commit comments

Comments
 (0)