diff --git a/.changeset/tame-needles-fetch.md b/.changeset/tame-needles-fetch.md new file mode 100644 index 0000000..c2dbca1 --- /dev/null +++ b/.changeset/tame-needles-fetch.md @@ -0,0 +1,5 @@ +--- +'commerce-toolkit': patch +--- + +Added textColor and iconColor options for CategoryCard diff --git a/src/components/category-card/category-card.tsx b/src/components/category-card/category-card.tsx index 639b142..37a0675 100644 --- a/src/components/category-card/category-card.tsx +++ b/src/components/category-card/category-card.tsx @@ -28,6 +28,8 @@ export interface CategoryCardProps extends CategoryCardContent { textSize?: 'small' | 'medium' | 'large' | 'x-large'; textPosition?: 'inside' | 'outside'; showOverlay?: boolean; + textColor?: 'light' | 'dark'; + iconColor?: 'light' | 'dark'; } /** @@ -59,13 +61,17 @@ export function CategoryCard({ aspectRatio = '5/6', textPosition = 'outside', textSize = 'small', + textColor = 'dark', + iconColor = 'dark', showOverlay = true, }: CategoryCardProps) { return ( diff --git a/src/components/category-card/primitives/category-card-icon.tsx b/src/components/category-card/primitives/category-card-icon.tsx index c367f75..01d5ff2 100644 --- a/src/components/category-card/primitives/category-card-icon.tsx +++ b/src/components/category-card/primitives/category-card-icon.tsx @@ -17,6 +17,10 @@ export function CategoryCardIcon({ asChild = false, className, children }: Categ 'absolute right-5 top-5 z-10 size-6 text-[var(--category-card-light-icon,var(--foreground))] transition-transform duration-700 ease-out', // Group hover state 'group-hover/category-card:-translate-y-1.5 group-hover/category-card:translate-x-1.5', + // Icon color: light + 'group-data-[icon-color=light]/category-card:text-[var(--category-card-light-icon,var(--background))]', + // Icon color: dark + 'group-data-[icon-color=dark]/category-card:text-[var(--category-card-dark-icon,var(--foreground))]', className, ); diff --git a/src/components/category-card/primitives/category-card-root.tsx b/src/components/category-card/primitives/category-card-root.tsx index f2a946c..b08dc92 100644 --- a/src/components/category-card/primitives/category-card-root.tsx +++ b/src/components/category-card/primitives/category-card-root.tsx @@ -11,6 +11,8 @@ export type CategoryCardRootProps = Omit< as?: E; aspectRatio?: '5/6' | '3/4' | '1/1'; textSize?: 'small' | 'medium' | 'large' | 'x-large'; + textColor?: 'light' | 'dark'; + iconColor?: 'light' | 'dark'; showOverlay?: boolean; }; @@ -20,6 +22,8 @@ export function CategoryCardRoot({ as, aspectRatio = '5/6', textSize = 'small', + textColor = 'dark', + iconColor = 'dark', showOverlay = true, ...props }: CategoryCardRootProps) { @@ -37,8 +41,10 @@ export function CategoryCardRoot({ className, )} data-aspect-ratio={aspectRatio} + data-icon-color={iconColor} data-show-overlay={showOverlay} data-slot="category-card-root" + data-text-color={textColor} data-text-size={textSize} {...props} > diff --git a/src/components/category-card/primitives/category-card-title.tsx b/src/components/category-card/primitives/category-card-title.tsx index 6befd9b..6d92a27 100644 --- a/src/components/category-card/primitives/category-card-title.tsx +++ b/src/components/category-card/primitives/category-card-title.tsx @@ -8,7 +8,7 @@ export function CategoryCardTitle({ children, className, ...props }: CategoryCar return (

(