Skip to content

Commit

Permalink
Merge pull request #460 from department-of-veterans-affairs/CU/454-Re…
Browse files Browse the repository at this point in the history
…moveWhiteButtonVariant

[Code Upkeep] Remove White Button Variant
  • Loading branch information
TimRoe authored Sep 4, 2024
2 parents fa40507 + 08c3319 commit 046f134
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 91 deletions.
10 changes: 0 additions & 10 deletions packages/components/src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,3 @@ export const _____Destructive: Story = {
a11yHint: 'A brief description of the result of pressing this Button',
},
}

export const ______White: Story = {
name: 'White',
args: {
buttonType: ButtonVariants.White,
label: 'Button text',
a11yLabel: 'Alternate a11y text',
a11yHint: 'A brief description of the result of pressing this Button',
},
}
74 changes: 0 additions & 74 deletions packages/components/src/components/Button/Button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,80 +341,6 @@ describe('Button', () => {
})
})

describe('White Variant', () => {
it('should render White variant', async () => {
render(<Button {...commonProps} buttonType={ButtonVariants.White} />)

expect(screen.root).toHaveStyle({
backgroundColor: '#f0f0f0',
borderColor: 'none',
borderWidth: 0,
})

expect(getButtonText()).toHaveStyle({
color: '#000000',
})
})

it('should render White variant pressed state', async () => {
render(
<Button
{...commonProps}
buttonType={ButtonVariants.White}
testOnlyPressed={true}
/>,
)

expect(screen.root).toHaveStyle({
backgroundColor: '#adadad',
borderColor: 'none',
borderWidth: 0,
})

expect(getButtonText()).toHaveStyle({
color: '#000000',
})
})

describe('Dark mode', () => {
beforeEach(() => mockedColorScheme.mockImplementationOnce(() => 'dark'))

it('should render White variant in dark mode', async () => {
render(<Button {...commonProps} buttonType={ButtonVariants.White} />)

expect(screen.root).toHaveStyle({
backgroundColor: '#f0f0f0',
borderColor: 'none',
borderWidth: 0,
})

expect(getButtonText()).toHaveStyle({
color: '#000000',
})
})

it('should render White variant pressed state in dark mode', async () => {
render(
<Button
{...commonProps}
buttonType={ButtonVariants.White}
testOnlyPressed={true}
/>,
)

expect(screen.root).toHaveStyle({
backgroundColor: '#adadad',
borderColor: 'none',
borderWidth: 0,
})

expect(getButtonText()).toHaveStyle({
color: '#000000',
})
})
})
})

describe('BaseSecondary Variant', () => {
it('should render BaseSecondary variant', async () => {
render(
Expand Down
7 changes: 0 additions & 7 deletions packages/components/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export enum ButtonVariants {
Destructive = 'Destructive',
Primary = 'Primary',
Secondary = 'Secondary',
White = 'White',
}

export type ButtonProps = {
Expand Down Expand Up @@ -85,12 +84,6 @@ export const Button: React.FC<ButtonProps> = ({
textColorPressed = theme.vadsColorActionForegroundDefaultActive
borderWidth = 2
break
case ButtonVariants.White:
bgColor = theme.vadsColorBaseLightest
bgColorPressed = theme.uswdsSystemColorGray30
textColor = theme.vadsColorBlack
textColorPressed = theme.vadsColorBlack
break
default:
bgColor = theme.vadsColorActionSurfaceDefault
bgColorPressed = theme.vadsColorActionSurfaceDefaultActive
Expand Down

0 comments on commit 046f134

Please sign in to comment.