From a0bd8042621e108f47e09dd096cf0d73fe1cee53 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Sat, 10 May 2025 00:06:06 +0300 Subject: Live (#8354) --- src/components/Button.tsx | 86 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) (limited to 'src/components/Button.tsx') diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 2d6ddc834..42eb64844 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -26,6 +26,7 @@ export type ButtonColor = | 'secondary' | 'secondary_inverted' | 'negative' + | 'negative_secondary' | 'gradient_primary' | 'gradient_sky' | 'gradient_midnight' @@ -336,6 +337,57 @@ export const Button = React.forwardRef( borderWidth: 1, }) + if (!disabled) { + baseStyles.push(a.border, { + borderColor: t.palette.negative_500, + }) + hoverStyles.push(a.border, { + backgroundColor: t.palette.negative_50, + }) + } else { + baseStyles.push(a.border, { + borderColor: t.palette.negative_200, + }) + } + } else if (variant === 'ghost') { + if (!disabled) { + baseStyles.push(t.atoms.bg) + hoverStyles.push({ + backgroundColor: t.palette.negative_100, + }) + } + } + } else if (color === 'negative_secondary') { + if (variant === 'solid') { + if (!disabled) { + baseStyles.push({ + backgroundColor: select(t.name, { + light: t.palette.negative_50, + dim: t.palette.negative_100, + dark: t.palette.negative_100, + }), + }) + hoverStyles.push({ + backgroundColor: select(t.name, { + light: t.palette.negative_100, + dim: t.palette.negative_200, + dark: t.palette.negative_200, + }), + }) + } else { + baseStyles.push({ + backgroundColor: select(t.name, { + light: t.palette.negative_100, + dim: t.palette.negative_50, + dark: t.palette.negative_50, + }), + }) + } + } else if (variant === 'outline') { + baseStyles.push(a.border, t.atoms.bg, { + borderWidth: 1, + }) + if (!disabled) { baseStyles.push(a.border, { borderColor: t.palette.negative_500, @@ -425,6 +477,7 @@ export const Button = React.forwardRef( secondary: tokens.gradients.sky, secondary_inverted: tokens.gradients.sky, negative: tokens.gradients.sky, + negative_secondary: tokens.gradients.sky, gradient_primary: tokens.gradients.primary, gradient_sky: tokens.gradients.sky, gradient_midnight: tokens.gradients.midnight, @@ -645,6 +698,39 @@ export function useSharedButtonTextStyles() { baseStyles.push({color: t.palette.negative_400, opacity: 0.5}) } } + } else if (color === 'negative_secondary') { + if (variant === 'solid' || variant === 'gradient') { + if (!disabled) { + baseStyles.push({ + color: select(t.name, { + light: t.palette.negative_500, + dim: t.palette.negative_950, + dark: t.palette.negative_900, + }), + }) + } else { + baseStyles.push({ + color: select(t.name, { + light: t.palette.negative_500, + dim: t.palette.negative_700, + dark: t.palette.negative_700, + }), + opacity: 0.5, + }) + } + } else if (variant === 'outline') { + if (!disabled) { + baseStyles.push({color: t.palette.negative_400}) + } else { + baseStyles.push({color: t.palette.negative_400, opacity: 0.5}) + } + } else if (variant === 'ghost') { + if (!disabled) { + baseStyles.push({color: t.palette.negative_400}) + } else { + baseStyles.push({color: t.palette.negative_400, opacity: 0.5}) + } + } } else { if (!disabled) { baseStyles.push({color: t.palette.white}) -- cgit 1.4.1