-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(icons)!: change
FlairIcon
to BadgeIcon
- Loading branch information
Showing
11 changed files
with
271 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@launchpad-ui/icons": patch | ||
--- | ||
|
||
Change `FlairIcon` to `BadgeIcon` |
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,59 @@ | ||
import type { BoxProps } from '@launchpad-ui/box'; | ||
import type { VariantProps } from 'class-variance-authority'; | ||
|
||
import { Box } from '@launchpad-ui/box'; | ||
import { cva } from 'class-variance-authority'; | ||
|
||
import { IconContext } from './Icon'; | ||
import styles from './styles/BadgeIcon.module.css'; | ||
|
||
const badge = cva(styles.base, { | ||
variants: { | ||
size: { | ||
tiny: styles.tiny, | ||
small: styles.small, | ||
medium: styles.medium, | ||
large: styles.large, | ||
}, | ||
variant: { | ||
default: styles.default, | ||
blue: styles.blue, | ||
cyan: styles.cyan, | ||
purple: styles.purple, | ||
pink: styles.pink, | ||
orange: styles.orange, | ||
yellow: styles.yellow, | ||
green: styles.green, | ||
'gradient-1': styles.gradient1, | ||
'gradient-2': styles.gradient2, | ||
'gradient-3': styles.gradient3, | ||
'gradient-4': styles.gradient4, | ||
'gradient-5': styles.gradient5, | ||
'gradient-6': styles.gradient6, | ||
'gradient-7': styles.gradient7, | ||
}, | ||
}, | ||
defaultVariants: { | ||
size: 'medium', | ||
variant: 'default', | ||
}, | ||
}); | ||
|
||
interface BadgeIconProps extends BoxProps, VariantProps<typeof badge> {} | ||
|
||
const BadgeIcon = ({ | ||
children, | ||
className, | ||
size = 'medium', | ||
variant = 'default', | ||
...props | ||
}: BadgeIconProps) => { | ||
return ( | ||
<Box className={badge({ size, variant, className })} {...props}> | ||
<IconContext.Provider value={{ size }}>{children}</IconContext.Provider> | ||
</Box> | ||
); | ||
}; | ||
|
||
export { BadgeIcon }; | ||
export type { BadgeIconProps }; |
This file was deleted.
Oops, something went wrong.
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,8 +1,8 @@ | ||
export type { IconProps } from './Icon'; | ||
export type { FlairIconProps } from './FlairIcon'; | ||
export type { BadgeIconProps } from './BadgeIcon'; | ||
export type { StatusIconProps } from './StatusIcon'; | ||
export type { IconName } from './types'; | ||
|
||
export { Icon } from './Icon'; | ||
export { FlairIcon } from './FlairIcon'; | ||
export { BadgeIcon } from './BadgeIcon'; | ||
export { StatusIcon } from './StatusIcon'; |
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,110 @@ | ||
.base { | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 50%; | ||
} | ||
|
||
.default { | ||
background: var(--lp-color-bg-ui-tertiary); | ||
|
||
& [data-icon] { | ||
fill: var(--lp-color-fill-ui-secondary); | ||
} | ||
} | ||
|
||
.tiny { | ||
padding: var(--lp-size-2); | ||
} | ||
|
||
.small { | ||
padding: var(--lp-spacing-200); | ||
} | ||
|
||
.medium { | ||
padding: var(--lp-spacing-300); | ||
} | ||
|
||
.large { | ||
padding: var(--lp-spacing-400); | ||
} | ||
|
||
.blue { | ||
background: var(--lp-color-brand-blue-light); | ||
} | ||
|
||
.cyan { | ||
background: var(--lp-color-brand-cyan-base); | ||
} | ||
|
||
.purple { | ||
background: var(--lp-color-brand-purple-base); | ||
} | ||
|
||
.pink { | ||
background: var(--lp-color-brand-pink-base); | ||
} | ||
|
||
.orange { | ||
background: var(--lp-color-brand-orange-base); | ||
} | ||
|
||
.yellow { | ||
background: var(--lp-color-brand-yellow-base); | ||
} | ||
|
||
.green { | ||
background: var(--lp-color-brand-green-base); | ||
} | ||
|
||
.gradient1 { | ||
background: var(--lp-color-gradient-yellow-cyan); | ||
} | ||
|
||
.gradient2 { | ||
background: var(--lp-color-gradient-yellow-pink); | ||
} | ||
|
||
.gradient3 { | ||
background: var(--lp-color-gradient-cyan-purple); | ||
} | ||
|
||
.gradient4 { | ||
background: var(--lp-color-gradient-cyan-blue); | ||
} | ||
|
||
.gradient5 { | ||
background: var(--lp-color-gradient-purple-blue); | ||
} | ||
|
||
.gradient6 { | ||
background: var(--lp-color-gradient-purple-pink); | ||
} | ||
|
||
.gradient7 { | ||
background: var(--lp-color-gradient-yellow-blue-pale); | ||
} | ||
|
||
.blue, | ||
.cyan, | ||
.purple, | ||
.pink, | ||
.orange, | ||
.gradient1, | ||
.gradient2, | ||
.gradient3, | ||
.gradient4, | ||
.gradient5, | ||
.gradient6 { | ||
& [data-icon] { | ||
fill: var(--lp-color-white-900); | ||
} | ||
} | ||
|
||
.yellow, | ||
.green, | ||
.gradient7 { | ||
& [data-icon] { | ||
fill: var(--lp-color-black-700); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,79 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { BadgeIcon, Icon } from '../src'; | ||
|
||
const meta: Meta<typeof BadgeIcon> = { | ||
component: BadgeIcon, | ||
title: 'Foundations/Icons/BadgeIcon', | ||
parameters: { | ||
status: { | ||
type: import.meta.env.STORYBOOK_PACKAGE_STATUS__ICONS, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof BadgeIcon>; | ||
|
||
const children = <Icon name="crown" />; | ||
|
||
export const Default: Story = { | ||
args: { children }, | ||
}; | ||
|
||
export const Blue: Story = { | ||
args: { children, variant: 'blue' }, | ||
}; | ||
|
||
export const Cyan: Story = { | ||
args: { children, variant: 'cyan' }, | ||
}; | ||
|
||
export const Puple: Story = { | ||
args: { children, variant: 'purple' }, | ||
}; | ||
|
||
export const Pink: Story = { | ||
args: { children, variant: 'pink' }, | ||
}; | ||
|
||
export const Orange: Story = { | ||
args: { children, variant: 'orange' }, | ||
}; | ||
|
||
export const Yellow: Story = { | ||
args: { children, variant: 'yellow' }, | ||
}; | ||
|
||
export const Green: Story = { | ||
args: { children, variant: 'green' }, | ||
}; | ||
|
||
export const Gradient1: Story = { | ||
args: { children, variant: 'gradient-1' }, | ||
}; | ||
|
||
export const Gradient2: Story = { | ||
args: { children, variant: 'gradient-2' }, | ||
}; | ||
|
||
export const Gradient3: Story = { | ||
args: { children, variant: 'gradient-3' }, | ||
}; | ||
|
||
export const Gradient4: Story = { | ||
args: { children, variant: 'gradient-4' }, | ||
}; | ||
|
||
export const Gradient5: Story = { | ||
args: { children, variant: 'gradient-5' }, | ||
}; | ||
|
||
export const Gradient6: Story = { | ||
args: { children, variant: 'gradient-6' }, | ||
}; | ||
|
||
export const Gradient7: Story = { | ||
args: { children, variant: 'gradient-7' }, | ||
}; |
Oops, something went wrong.