-
-
-
+ {intents.map(intent => (
+
+
+
+ ))}
-
+
diff --git a/packages/components/icon/src/Icon.tsx b/packages/components/icon/src/Icon.tsx
index b25d2b14a..69a4001d6 100644
--- a/packages/components/icon/src/Icon.tsx
+++ b/packages/components/icon/src/Icon.tsx
@@ -15,13 +15,20 @@ export interface IconProps extends IconVariantsProps, React.SVGProps
label?: string
}
-export function Icon({ label, className, size = 'md', children, ...others }: IconProps) {
+export function Icon({
+ label,
+ className,
+ size = 'current',
+ intent = 'current',
+ children,
+ ...others
+}: IconProps) {
const child = React.Children.only(children)
return (
<>
{React.cloneElement(child as React.ReactElement, {
- className: iconVariants({ className, size }),
+ className: iconVariants({ className, size, intent }),
'aria-hidden': 'true',
focusable: 'false',
...others,
diff --git a/packages/components/icon/src/Icon.variants.tsx b/packages/components/icon/src/Icon.variants.tsx
index 0c8491270..56c360f51 100644
--- a/packages/components/icon/src/Icon.variants.tsx
+++ b/packages/components/icon/src/Icon.variants.tsx
@@ -3,7 +3,18 @@ import { cva, VariantProps } from 'class-variance-authority'
export const iconVariants = cva(['fill-current'], {
variants: {
+ intent: makeVariants<'intent'>({
+ current: ['text-current'],
+ primary: ['text-primary'],
+ secondary: ['text-secondary'],
+ success: ['text-success'],
+ alert: ['text-alert'],
+ error: ['text-error'],
+ info: ['text-info'],
+ neutral: ['text-neutral'],
+ }),
size: makeVariants<'size'>({
+ current: ['w-current', 'h-current'],
sm: ['w-sz-16', 'h-sz-16'],
md: ['w-sz-24', 'h-sz-24'],
lg: ['w-sz-32', 'h-sz-32'],