-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove config and tamagui from tamagui-extras export
- Loading branch information
Showing
6 changed files
with
127 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { createAnimations } from '@tamagui/animations-react-native' | ||
|
||
export const animations = createAnimations({ | ||
bouncy: { | ||
type: 'spring', | ||
damping: 10, | ||
mass: 0.9, | ||
stiffness: 100, | ||
}, | ||
lazy: { | ||
type: 'spring', | ||
damping: 20, | ||
stiffness: 60, | ||
}, | ||
quick: { | ||
type: 'spring', | ||
damping: 20, | ||
mass: 1.2, | ||
stiffness: 250, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { createTamagui } from 'tamagui' | ||
import { createInterFont } from '@tamagui/font-inter' | ||
import { shorthands } from '@tamagui/shorthands' | ||
import { themes, tokens } from '@tamagui/themes' | ||
import { createMedia } from '@tamagui/react-native-media-driver' | ||
|
||
import { animations } from './animations' | ||
|
||
const headingFont = createInterFont({ | ||
size: { | ||
6: 15, | ||
}, | ||
transform: { | ||
6: 'uppercase', | ||
7: 'none', | ||
}, | ||
weight: { | ||
6: '400', | ||
7: '700', | ||
}, | ||
color: { | ||
6: '$colorFocus', | ||
7: '$color', | ||
}, | ||
letterSpacing: { | ||
5: 2, | ||
6: 1, | ||
7: 0, | ||
8: -1, | ||
9: -2, | ||
10: -3, | ||
12: -4, | ||
14: -5, | ||
15: -6, | ||
}, | ||
face: { | ||
700: { normal: 'InterBold' }, | ||
}, | ||
}) | ||
|
||
const bodyFont = createInterFont( | ||
{ | ||
face: { | ||
700: { normal: 'InterBold' }, | ||
}, | ||
}, | ||
{ | ||
sizeSize: (size) => Math.round(size * 1.1), | ||
sizeLineHeight: (size) => Math.round(size * 1.1 + (size > 20 ? 10 : 10)), | ||
} | ||
) | ||
|
||
export const config = createTamagui({ | ||
animations, | ||
shouldAddPrefersColorThemes: true, | ||
themeClassNameOnRoot: true, | ||
shorthands, | ||
fonts: { | ||
heading: headingFont, | ||
body: bodyFont, | ||
}, | ||
themes, | ||
tokens, | ||
media: createMedia({ | ||
xs: { maxWidth: 660 }, | ||
sm: { maxWidth: 800 }, | ||
md: { maxWidth: 1020 }, | ||
lg: { maxWidth: 1280 }, | ||
xl: { maxWidth: 1420 }, | ||
xxl: { maxWidth: 1600 }, | ||
gtXs: { minWidth: 660 + 1 }, | ||
gtSm: { minWidth: 800 + 1 }, | ||
gtMd: { minWidth: 1020 + 1 }, | ||
gtLg: { minWidth: 1280 + 1 }, | ||
short: { maxHeight: 820 }, | ||
tall: { minHeight: 820 }, | ||
hoverNone: { hover: 'none' }, | ||
pointerCoarse: { pointer: 'coarse' }, | ||
}), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useThemeState } from '../state/themeState' | ||
import { LmTamaguiProvider } from './LmTamaguiProvider' | ||
import { YStack } from 'tamagui' | ||
|
||
export const StorybookDecorator = (Story, args: any) => { | ||
// The theme global we just declared | ||
const { theme: themeKey } = args.globals | ||
const name = useThemeState((state) => state.name) | ||
let theme = themeKey | ||
if (!theme && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { | ||
// dark mode | ||
theme = 'dark' | ||
} | ||
return ( | ||
<> | ||
<LmTamaguiProvider defaultTheme={name || theme}> | ||
<YStack backgroundColor={'$backgroundStrong'} padding={'$4'} flexGrow={1}> | ||
<Story /> | ||
</YStack> | ||
</LmTamaguiProvider> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
export * from 'tamagui' | ||
|
||
export * from './core/themeMappings' | ||
export * from './core/panels' | ||
export * from './core/hooks' | ||
export * from './core/form' | ||
export * from './core/content' | ||
|
||
// config | ||
export { config } from './tamagui.config' |
fc81e38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
tamagui-kitchen-sink-nextjs – ./apps/next
tamagui-kitchen-sink-nextjs-lumenmedia1.vercel.app
tamagui-kitchen-sink-nextjs.vercel.app
tamagui-kitchen-sink-nextjs-git-master-lumenmedia1.vercel.app
fc81e38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
tamagui-kitchen-sink – ./apps/storybook-react
tamagui-kitchen-sink.vercel.app
tamagui-kitchen-sink-git-master-lumenmedia1.vercel.app
tamagui-kitchen-sink-lumenmedia1.vercel.app
tamagui-extras.vercel.app