Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon only button - Fix color for all variants #616

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/famous-news-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@status-im/components': patch
---

updates icon color for missing compound variants
21 changes: 20 additions & 1 deletion packages/components/src/button/button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { Fragment } from 'react'

import { PlaceholderIcon } from '@status-im/icons/20'

import { Button } from './button'

import type { Meta, StoryObj } from '@storybook/react'
Expand Down Expand Up @@ -51,7 +55,22 @@ const meta: Meta<
).map(variant => (
<div key={variant} className="flex items-center gap-4">
{(['40', '32', '24'] as const).map(size => (
<Button key={size} {...args} variant={variant} size={size} />
<Fragment key={size}>
<Button {...args} variant={variant} size={size} />
{/* With icon */}
<Button
{...args}
size={size}
variant={variant}
iconBefore={<PlaceholderIcon />}
/>
<Button
aria-label="Button with icon only"
size={size}
variant={variant}
icon={<PlaceholderIcon />}
/>
</Fragment>
))}
</div>
))}
Expand Down
30 changes: 30 additions & 0 deletions packages/components/src/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,41 @@ const iconStyles = cva({
placement: 'after',
className: '-mr-0.5',
},
{
variant: 'grey',
iconOnly: true,
className: '!text-neutral-100 dark:!text-white-100',
},
{
variant: 'outline',
iconOnly: true,
className: '!text-neutral-100 dark:!text-white-100',
},
{
variant: 'darkGrey',
iconOnly: true,
className: '!text-neutral-100 dark:!text-white-100',
},
{
variant: 'ghost',
iconOnly: true,
className: '!text-neutral-100 dark:!text-white-100',
},
{
variant: 'primary',
iconOnly: true,
className: '!text-white-100',
},
{
variant: 'positive',
iconOnly: true,
className: '!text-white-100',
},
{
variant: 'danger',
iconOnly: true,
className: '!text-white-100',
},
],
})

Expand Down
Loading