This commit is contained in:
Eric Bailey
2024-01-15 18:52:11 -06:00
parent 4d3128aa12
commit 5e832f3f0c
5 changed files with 119 additions and 1 deletions
+19
View File
@@ -209,6 +209,25 @@ export const atoms = {
borderBottomWidth: 1, borderBottomWidth: 1,
}, },
/*
* Shadow
*/
shadow_sm: {
shadowRadius: 8,
shadowOpacity: 0.1,
elevation: 8,
},
shadow_md: {
shadowRadius: 16,
shadowOpacity: 0.1,
elevation: 16,
},
shadow_lg: {
shadowRadius: 32,
shadowOpacity: 0.1,
elevation: 24,
},
/* /*
* Padding * Padding
*/ */
+43
View File
@@ -1,5 +1,6 @@
import * as tokens from '#/alf/tokens' import * as tokens from '#/alf/tokens'
import type {Mutable} from '#/alf/types' import type {Mutable} from '#/alf/types'
import {atoms} from '#/alf/atoms'
export type ThemeName = 'light' | 'dim' | 'dark' export type ThemeName = 'light' | 'dim' | 'dark'
export type ReadonlyTheme = typeof light export type ReadonlyTheme = typeof light
@@ -156,6 +157,18 @@ export const light = {
border_contrast: { border_contrast: {
borderColor: lightPalette.contrast_400, borderColor: lightPalette.contrast_400,
}, },
shadow_sm: {
...atoms.shadow_sm,
shadowColor: lightPalette.black,
},
shadow_md: {
...atoms.shadow_md,
shadowColor: lightPalette.black,
},
shadow_lg: {
...atoms.shadow_lg,
shadowColor: lightPalette.black,
},
}, },
} }
@@ -202,6 +215,21 @@ export const dim: Theme = {
border_contrast: { border_contrast: {
borderColor: darkPalette.contrast_300, borderColor: darkPalette.contrast_300,
}, },
shadow_sm: {
...atoms.shadow_sm,
shadowOpacity: 0.7,
shadowColor: tokens.color.trueBlack,
},
shadow_md: {
...atoms.shadow_md,
shadowOpacity: 0.7,
shadowColor: tokens.color.trueBlack,
},
shadow_lg: {
...atoms.shadow_lg,
shadowOpacity: 0.7,
shadowColor: tokens.color.trueBlack,
},
}, },
} }
@@ -248,5 +276,20 @@ export const dark: Theme = {
border_contrast: { border_contrast: {
borderColor: darkPalette.contrast_300, borderColor: darkPalette.contrast_300,
}, },
shadow_sm: {
...atoms.shadow_sm,
shadowOpacity: 0.7,
shadowColor: tokens.color.trueBlack,
},
shadow_md: {
...atoms.shadow_md,
shadowOpacity: 0.7,
shadowColor: tokens.color.trueBlack,
},
shadow_lg: {
...atoms.shadow_lg,
shadowOpacity: 0.7,
shadowColor: tokens.color.trueBlack,
},
}, },
} }
+1
View File
@@ -1,6 +1,7 @@
export const color = { export const color = {
white: '#FFFFFF', white: '#FFFFFF',
black: '#080B12', black: '#080B12',
trueBlack: '#000000',
gray_25: `#FCFCFD`, gray_25: `#FCFCFD`,
gray_50: `#F9FAFB`, gray_50: `#F9FAFB`,
+53
View File
@@ -0,0 +1,53 @@
import React from 'react'
import {View} from 'react-native'
import {atoms as a, useTheme} from '#/alf'
import {H1, Text} from '#/components/Typography'
export function Shadows() {
const t = useTheme()
return (
<View style={[a.gap_md]}>
<H1>Shadows</H1>
<View style={[a.flex_row, a.gap_5xl]}>
<View
style={[
a.flex_1,
a.justify_center,
a.px_lg,
a.py_2xl,
t.atoms.bg,
t.atoms.shadow_sm,
]}>
<Text>shadow_sm</Text>
</View>
<View
style={[
a.flex_1,
a.justify_center,
a.px_lg,
a.py_2xl,
t.atoms.bg,
t.atoms.shadow_md,
]}>
<Text>shadow_md</Text>
</View>
<View
style={[
a.flex_1,
a.justify_center,
a.px_lg,
a.py_2xl,
t.atoms.bg,
t.atoms.shadow_lg,
]}>
<Text>shadow_lg</Text>
</View>
</View>
</View>
)
}
+3 -1
View File
@@ -14,6 +14,7 @@ import {Links} from './Links'
import {Forms} from './Forms' import {Forms} from './Forms'
import {Dialogs} from './Dialogs' import {Dialogs} from './Dialogs'
import {Breakpoints} from './Breakpoints' import {Breakpoints} from './Breakpoints'
import {Shadows} from './Shadows'
export function Storybook() { export function Storybook() {
const t = useTheme() const t = useTheme()
@@ -53,7 +54,6 @@ export function Storybook() {
</Button> </Button>
</View> </View>
<Dialogs />
<ThemeProvider theme="light"> <ThemeProvider theme="light">
<Theming /> <Theming />
</ThemeProvider> </ThemeProvider>
@@ -66,9 +66,11 @@ export function Storybook() {
<Typography /> <Typography />
<Spacing /> <Spacing />
<Shadows />
<Buttons /> <Buttons />
<Links /> <Links />
<Forms /> <Forms />
<Dialogs />
<Breakpoints /> <Breakpoints />
</View> </View>
</CenteredView> </CenteredView>