diff --git a/src/core/Button.tsx b/src/core/Button.tsx index 89dbbc27..1d5d9b14 100644 --- a/src/core/Button.tsx +++ b/src/core/Button.tsx @@ -2,6 +2,7 @@ import React, { PropsWithChildren } from "react"; import { IconName } from "./Icon/types"; import Icon from "./Icon"; import cn from "./utils/cn"; +import { ColorClass, ColorThemeSet } from "./styles/colors/types"; export type ButtonType = "priority" | "primary" | "secondary"; @@ -28,6 +29,10 @@ export type ButtonPropsBase = { * Optional classes to add to the button element. */ className?: string; + /** + * Optional color to apply to the icon on either left and/or right side of the button. + */ + iconColor?: ColorClass | ColorThemeSet; }; type ButtonProps = ButtonPropsBase & @@ -81,12 +86,16 @@ export const commonButtonProps = (props: ButtonPropsBase) => { export const commonButtonInterior = ( props: PropsWithChildren, ) => { - const { leftIcon, rightIcon, children } = props; + const { leftIcon, rightIcon, iconColor, children } = props; return ( <> - {leftIcon ? : null} + {leftIcon ? ( + + ) : null} {children} - {rightIcon ? : null} + {rightIcon ? ( + + ) : null} ); }; diff --git a/src/core/LinkButton.tsx b/src/core/LinkButton.tsx index bb54a90e..168923fb 100644 --- a/src/core/LinkButton.tsx +++ b/src/core/LinkButton.tsx @@ -5,10 +5,12 @@ import { commonButtonProps, } from "./Button"; import cn from "./utils/cn"; +import { ColorClass, ColorThemeSet } from "./styles/colors/types"; export type LinkButtonProps = ButtonPropsBase & { disabled?: boolean; onClick?: (event: React.MouseEvent) => void; + iconColor?: ColorClass | ColorThemeSet; } & React.AnchorHTMLAttributes; const LinkButton: React.FC = ({ @@ -20,6 +22,7 @@ const LinkButton: React.FC = ({ className, disabled, onClick, + iconColor, ...rest }) => { const handleClick = (e: React.MouseEvent) => { @@ -46,7 +49,7 @@ const LinkButton: React.FC = ({ onClick={handleClick} {...(rest as React.AnchorHTMLAttributes)} > - {commonButtonInterior({ leftIcon, rightIcon, children })} + {commonButtonInterior({ leftIcon, rightIcon, iconColor, children })} ); }; diff --git a/src/core/Pricing/PricingCards.tsx b/src/core/Pricing/PricingCards.tsx index 2b05d162..82559918 100644 --- a/src/core/Pricing/PricingCards.tsx +++ b/src/core/Pricing/PricingCards.tsx @@ -192,6 +192,8 @@ const PricingCards = ({ data, delimiter }: PricingCardsProps) => { href={cta.url} onClick={cta.onClick} disabled={cta.disabled} + rightIcon="icon-gui-arrow-right" + iconColor={cta.iconColor} > {cta.text} diff --git a/src/core/Pricing/data.tsx b/src/core/Pricing/data.tsx index 360e0b6c..9dacfa22 100644 --- a/src/core/Pricing/data.tsx +++ b/src/core/Pricing/data.tsx @@ -14,7 +14,11 @@ export const planData: PricingDataFeature[] = [ color: "text-neutral-800 dark:text-neutral-500", }, price: { amount: "$0" }, - cta: { text: "Start for free", url: "/sign-up" }, + cta: { + text: "Start for free", + url: "/sign-up", + iconColor: "text-neutral-700 dark:text-neutral-600", + }, sections: [ { title: "Limits", @@ -69,6 +73,7 @@ export const planData: PricingDataFeature[] = [ cta: { text: "Get started", url: "/users/paid_sign_up?package=standard", + iconColor: "text-blue-600 dark:text-blue-400", }, sections: [ { @@ -120,7 +125,11 @@ export const planData: PricingDataFeature[] = [ ), }, - cta: { text: "Get started", url: "/users/paid_sign_up?package=pro" }, + cta: { + text: "Get started", + url: "/users/paid_sign_up?package=pro", + iconColor: "text-blue-600 dark:text-blue-400", + }, sections: [ { title: "Limits", diff --git a/src/core/Pricing/types.ts b/src/core/Pricing/types.ts index c25a668c..6eee9bd0 100644 --- a/src/core/Pricing/types.ts +++ b/src/core/Pricing/types.ts @@ -14,6 +14,7 @@ type PricingDataFeatureCta = { className?: string; disabled?: boolean; onClick?: () => void; + iconColor?: ColorClass | ColorThemeSet; }; export type PricingDataFeatureSection = {