Add `<Button />` blur subvariants (#499)

* upgrade storybook

* add blur variants

* Create breezy-mangos-fry.md
This commit is contained in:
Pavel 2023-10-27 09:33:22 +02:00 committed by GitHub
parent 4b93ecb357
commit 9d66ba076b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 606 additions and 573 deletions

View File

@ -0,0 +1,5 @@
---
"@status-im/components": patch
---
Add `<Button />` blur subvariants

View File

@ -55,20 +55,20 @@
}, },
"devDependencies": { "devDependencies": {
"@status-im/eslint-config": "*", "@status-im/eslint-config": "*",
"@storybook/addon-essentials": "7.4.3", "@storybook/addon-essentials": "7.5.1",
"@storybook/addon-interactions": "7.4.3", "@storybook/addon-interactions": "7.5.1",
"@storybook/addon-links": "7.4.3", "@storybook/addon-links": "7.5.1",
"@storybook/blocks": "7.4.3", "@storybook/blocks": "7.5.1",
"@storybook/react": "7.4.3", "@storybook/react": "7.5.1",
"@storybook/react-vite": "7.4.3", "@storybook/react-vite": "7.5.1",
"@storybook/testing-library": "^0.1.0", "@storybook/testing-library": "^0.2.2",
"@tamagui/vite-plugin": "1.74.21", "@tamagui/vite-plugin": "1.74.21",
"@vitejs/plugin-react-swc": "^3.2.0", "@vitejs/plugin-react-swc": "^3.2.0",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-native-svg": "^13.8.0", "react-native-svg": "^13.8.0",
"react-native-web": "^0.19.5", "react-native-web": "^0.19.5",
"storybook": "7.4.3", "storybook": "7.5.1",
"storybook-addon-designs": "7.0.0-beta.1", "storybook-addon-designs": "7.0.0-beta.1",
"storybook-dark-mode": "^3.0.0", "storybook-dark-mode": "^3.0.0",
"vite": "^4.2.1" "vite": "^4.2.1"

View File

@ -122,13 +122,27 @@ export const PrimaryIconOnlyCirlce: Story = {
}, },
} }
export const Success: Story = { export const Positive: Story = {
args: { args: {
variant: 'positive', variant: 'positive',
children: 'Click me', children: 'Click me',
}, },
} }
export const Grey: Story = {
args: {
variant: 'grey',
children: 'Click me',
},
}
export const GreyBlur: Story = {
args: {
variant: 'blur_grey',
children: 'Click me',
},
}
export const Outline: Story = { export const Outline: Story = {
args: { args: {
variant: 'outline', variant: 'outline',
@ -136,6 +150,13 @@ export const Outline: Story = {
}, },
} }
export const OutlineBlur: Story = {
args: {
variant: 'blur_outline',
children: 'Click me',
},
}
export const Ghost: Story = { export const Ghost: Story = {
args: { args: {
variant: 'ghost', variant: 'ghost',

View File

@ -46,6 +46,10 @@ const textColors: MapVariant<typeof Base, 'variant'> = {
// dark theme // dark theme
dark_darkGrey: '$white-100', dark_darkGrey: '$white-100',
// blur variants
blur_grey: '$neutral-100',
blur_outline: '$neutral-100',
} }
const textSizes: Record<NonNullable<Props['size']>, TextProps['size']> = { const textSizes: Record<NonNullable<Props['size']>, TextProps['size']> = {
@ -230,6 +234,30 @@ const Base = styled(View, {
hoverStyle: { backgroundColor: '$neutral-60' }, hoverStyle: { backgroundColor: '$neutral-60' },
pressStyle: { backgroundColor: '$neutral-50' }, pressStyle: { backgroundColor: '$neutral-50' },
}, },
// FIXME proper subvariant support
blur_grey: {
backgroundColor: '$neutral-80/5',
hoverStyle: { backgroundColor: '$neutral-80/10' },
pressStyle: { backgroundColor: '$neutral-80/20' },
'$platform-web': {
backdropFilter: 'blur(20px)',
// Tamagui does not accept this property even though it is valid (and works)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as unknown as any,
},
blur_outline: {
borderWidth: 1,
borderColor: '$neutral-80/10',
hoverStyle: { borderColor: '$neutral-80/20' },
pressStyle: { borderColor: '$neutral-80/30' },
'$platform-web': {
backdropFilter: 'blur(20px)',
// Tamagui does not accept this property even though it is valid (and works)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as unknown as any,
},
}, },
disabled: { disabled: {

1107
yarn.lock

File diff suppressed because it is too large Load Diff