Skip to content

Commit 257e39e

Browse files
authored
Add new 'base' color in themes (50) (#978)
* Add new `base` color to default themes * Update 'brand' usage to be 'base' * Update app tsx to use base * Fix linter issues
1 parent 5a3a97a commit 257e39e

36 files changed

+64
-61
lines changed

example/src/AccordionExample.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Section, { Container } from "./Section";
55

66
function AccordionExample({ theme }) {
77
return (
8-
<Container style={{ backgroundColor: theme.colors.background.brand }}>
8+
<Container style={{ backgroundColor: theme.colors.background.base }}>
99
<Section title="Basic accordion with no additional styles">
1010
<AccordionGroup label={"Basic"}>
1111
<Text>Item 1</Text>
@@ -30,7 +30,7 @@ function AccordionExample({ theme }) {
3030
<AccordionGroup
3131
openColor={theme.colors.branding.primary}
3232
closedColor={theme.colors.branding.secondary}
33-
caretColor={theme.colors.border.brand}
33+
caretColor={theme.colors.border.base}
3434
icon={"folder"}
3535
iconSize={26}
3636
style={{ fontWeight: "normal" }}

example/src/ActionSheetExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function ActionSheetExample({ theme }) {
2020
}, []);
2121

2222
return (
23-
<Container style={{ backgroundColor: theme.colors.background.brand }}>
23+
<Container style={{ backgroundColor: theme.colors.background.base }}>
2424
<Section title="Action Sheet">
2525
<ButtonSolid title="Open Action Sheet" onPress={showActionSheet} />
2626
<ActionSheet visible={visible} onClose={hideActionSheet}>

example/src/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const DarkTheme = createTheme({
183183
name: "DarkTheme",
184184
colors: {
185185
background: {
186-
brand: "#404040",
186+
base: "#404040",
187187
},
188188
text: {
189189
normal: "white",
@@ -221,14 +221,14 @@ const OtherTheme = createTheme({
221221
secondary: "#824D74",
222222
},
223223
background: {
224-
brand: "black",
224+
base: "black",
225225
},
226226
text: {
227227
strong: "white",
228228
normal: "white",
229229
},
230230
border: {
231-
brand: "#FDAF7B",
231+
base: "#FDAF7B",
232232
},
233233
},
234234
typography: {
@@ -358,7 +358,7 @@ function Example({ title, children }: ExampleProps) {
358358
hasTopSafeArea={true}
359359
hasBottomSafeArea={true}
360360
scrollable={false}
361-
style={{ backgroundColor: theme.colors.background.brand }}
361+
style={{ backgroundColor: theme.colors.background.base }}
362362
>
363363
<View
364364
style={[

example/src/DatePickerExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function DatePickerExample({ theme }) {
1212
const [date3, setDate3] = React.useState(new Date());
1313

1414
return (
15-
<Container style={{ backgroundColor: theme.colors.background.brand }}>
15+
<Container style={{ backgroundColor: theme.colors.background.base }}>
1616
<Section title="Underline">
1717
<DatePicker
1818
label="Date (without date prop)"

example/src/SliderExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function SliderExample({ theme }) {
99
const handleChange = (v) => setValue(v);
1010

1111
return (
12-
<Container style={{ backgroundColor: theme.colors.background.brand }}>
12+
<Container style={{ backgroundColor: theme.colors.background.base }}>
1313
<Section title="Uncontrolled">
1414
<Slider
1515
onValueChange={console.log}
@@ -28,7 +28,7 @@ function SliderExample({ theme }) {
2828
<Section title="Controlled">
2929
<Slider
3030
step={10}
31-
maximumTrackTintColor={theme.colors.foreground.brand}
31+
maximumTrackTintColor={theme.colors.foreground.base}
3232
minimumTrackTintColor={theme.colors.branding.primary}
3333
thumbTintColor={theme.colors.branding.primary}
3434
value={value}
@@ -43,7 +43,7 @@ function SliderExample({ theme }) {
4343
<Section title="Controlled with initial value">
4444
<Slider
4545
step={10}
46-
maximumTrackTintColor={theme.colors.foreground.brand}
46+
maximumTrackTintColor={theme.colors.foreground.base}
4747
minimumTrackTintColor={theme.colors.branding.primary}
4848
thumbTintColor={theme.colors.branding.primary}
4949
value={value2}

example/src/StarRatingExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function StarRatingExample({ theme }) {
66
const [rating, setRating] = React.useState(0.5);
77

88
return (
9-
<Container style={{ backgroundColor: theme.colors.background.brand }}>
9+
<Container style={{ backgroundColor: theme.colors.background.base }}>
1010
<Section title="Star Rating">
1111
<StarRating rating={3.5} />
1212
</Section>

example/src/StepperExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function StepperExample({ theme }) {
1010
const handleChange = (v) => setValue(v);
1111

1212
return (
13-
<Container style={{ backgroundColor: theme.colors.background.brand }}>
13+
<Container style={{ backgroundColor: theme.colors.background.base }}>
1414
<Section title="With State">
1515
<Stepper value={value} onChange={handleChange} />
1616
</Section>

example/src/SurfaceExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Section, { Container } from "./Section";
55

66
function SurfaceExample({ theme }) {
77
return (
8-
<Container style={{ backgroundColor: theme.colors.background.brand }}>
8+
<Container style={{ backgroundColor: theme.colors.background.base }}>
99
<Section title="overflow: 'hidden', backgroundColor: 'pink'">
1010
<Surface
1111
style={{

example/src/SwitchExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function SwitchExample({ theme }) {
88
const handleChange = (v) => toggle(v);
99

1010
return (
11-
<Container style={{ backgroundColor: theme.colors.background.brand }}>
11+
<Container style={{ backgroundColor: theme.colors.background.base }}>
1212
<Section title="Enabled">
1313
<Switch value={value} disabled={false} onValueChange={handleChange} />
1414
</Section>

packages/core/src/components/BottomSheet/BottomSheet.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
6767
) => {
6868
const theme = useTheme();
6969
const backgroundColor =
70-
(style as ViewStyle)?.backgroundColor || theme.colors.background.brand;
70+
(style as ViewStyle)?.backgroundColor || theme.colors.background.base;
7171

7272
const snapPoints = snapPointsProp ?? [
7373
topSnapPosition,
@@ -102,15 +102,15 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
102102
: getSnapIndexFromPosition(initialSnapPosition)
103103
}
104104
handleIndicatorStyle={[
105-
{ backgroundColor: handleColor ?? theme.colors.border.brand },
105+
{ backgroundColor: handleColor ?? theme.colors.border.base },
106106
!showHandle ? { display: "none" } : {},
107107
]}
108108
backgroundStyle={{
109109
backgroundColor,
110110
borderTopLeftRadius: topBorderRadius,
111111
borderTopRightRadius: topBorderRadius,
112112
borderWidth,
113-
borderColor: borderColor ?? theme.colors.border.brand,
113+
borderColor: borderColor ?? theme.colors.border.base,
114114
}}
115115
onChange={(index) =>
116116
// Convert bottom-sheet index to match our top-to-bottom ordering

0 commit comments

Comments
 (0)