diff --git a/.changeset/proud-dragons-sin.md b/.changeset/proud-dragons-sin.md
new file mode 100644
index 000000000..de107cea2
--- /dev/null
+++ b/.changeset/proud-dragons-sin.md
@@ -0,0 +1,5 @@
+---
+"@launchpad-ui/icons": patch
+---
+
+Change `FlairIcon` to `BadgeIcon`
diff --git a/packages/icons/__tests__/Icon.spec.tsx b/packages/icons/__tests__/Icon.spec.tsx
index 20022e11d..fffb4f303 100644
--- a/packages/icons/__tests__/Icon.spec.tsx
+++ b/packages/icons/__tests__/Icon.spec.tsx
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { render, screen } from '../../../test/utils';
-import { FlairIcon, Icon, StatusIcon } from '../src';
+import { BadgeIcon, Icon, StatusIcon } from '../src';
describe('Icon', () => {
it('renders', () => {
@@ -42,11 +42,11 @@ describe('Icon', () => {
expect(screen.getByRole('img', { hidden: true })).toHaveAttribute('aria-hidden', 'true');
});
- it('renders a flair icon', () => {
+ it('renders a badge icon', () => {
render(
-
+
- ,
+ ,
);
expect(screen.getByRole('img', { hidden: true })).toBeInTheDocument();
});
diff --git a/packages/icons/src/BadgeIcon.tsx b/packages/icons/src/BadgeIcon.tsx
new file mode 100644
index 000000000..79ec29856
--- /dev/null
+++ b/packages/icons/src/BadgeIcon.tsx
@@ -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 {}
+
+const BadgeIcon = ({
+ children,
+ className,
+ size = 'medium',
+ variant = 'default',
+ ...props
+}: BadgeIconProps) => {
+ return (
+
+ {children}
+
+ );
+};
+
+export { BadgeIcon };
+export type { BadgeIconProps };
diff --git a/packages/icons/src/FlairIcon.tsx b/packages/icons/src/FlairIcon.tsx
deleted file mode 100644
index 5f08492b6..000000000
--- a/packages/icons/src/FlairIcon.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { BoxProps } from '@launchpad-ui/box';
-
-import { Box } from '@launchpad-ui/box';
-import { cva, cx } from 'class-variance-authority';
-
-import styles from './styles/FlairIcon.module.css';
-
-const flair = cva(styles.flair);
-
-interface FlairIconProps extends BoxProps {}
-
-const FlairIcon = ({ children, className, ...props }: FlairIconProps) => {
- return (
-
- {children}
-
- );
-};
-
-export { FlairIcon };
-export type { FlairIconProps };
diff --git a/packages/icons/src/Icon.tsx b/packages/icons/src/Icon.tsx
index e9f28e94f..8d6ff844d 100644
--- a/packages/icons/src/Icon.tsx
+++ b/packages/icons/src/Icon.tsx
@@ -3,12 +3,14 @@ import type { SVGAttributes } from 'react';
import type { IconName } from './types';
import { cva } from 'class-variance-authority';
+import { createContext, useContext } from 'react';
import styles from './styles/Icon.module.css';
const icon = cva(styles.base, {
variants: {
size: {
+ tiny: styles.tiny,
small: styles.small,
medium: styles.medium,
large: styles.large,
@@ -24,6 +26,8 @@ const icon = cva(styles.base, {
},
});
+const IconContext = createContext({});
+
interface IconProps extends SVGAttributes, VariantProps {
name?: IconName;
}
@@ -38,12 +42,13 @@ const Icon = ({
variant = 'default',
...props
}: IconProps) => {
+ const ctx = useContext(IconContext);
return (