Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(Button): border update to match Secondary button dimensions #689

Merged
merged 8 commits into from
Jun 26, 2024
15 changes: 12 additions & 3 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ import type { ComponentProps } from 'react';
type ButtonProperties = ComponentProps<typeof ButtonDSR>;

/* Handles new secondary styling */

const newSecondaryStyle =
'cursor-pointer border-[1px] border-solid border-pacific bg-white text-pacific disabled:cursor-not-allowed disabled:border-none';

/* Handles increasing the dimensions of non-secondary buttons to match the new secondary style */
// TODO: Fix in the DS and DSR
// https://github.com/cfpb/design-system-react/issues/365
const newPrimaryBorderStyle =
'border-solid border-[1px] border-pacific focus:border-pacificDark hover:border-pacificDark disabled:border-[#d2d3d5]';

export function Button({
children,
className,
className = '',
appearance,
...rest
}: ButtonProperties): JSX.Element {
Expand All @@ -19,7 +24,11 @@ export function Button({
{...rest}
appearance={appearance}
className={`${
appearance === 'secondary' ? newSecondaryStyle : ''
appearance === 'secondary'
? newSecondaryStyle
: appearance === 'primary'
? newPrimaryBorderStyle
: ''
} ${className}`}
>
{children}
Expand Down