Skip to content

Commit

Permalink
fix <Button /> icon only colors (#616)
Browse files Browse the repository at this point in the history
* f: adds compound variants for missing cases

* f: changeset
  • Loading branch information
marcelines authored Oct 15, 2024
1 parent f1fa827 commit e9979fd
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
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

0 comments on commit e9979fd

Please sign in to comment.