Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions web/src/components/ui/button.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { render, screen } from '@testing-library/react'
import { describe, expect, it } from 'vitest'

import { Button } from './button'

describe('Button', () => {
it('uses the login gradient for the default primary action', () => {
render(<Button>Primary action</Button>)

expect(screen.getByRole('button', { name: 'Primary action' })).toHaveClass(
'[background:var(--silo-gradient)]',
'hover:opacity-90',
)
})

it('keeps the explicit solid brand variant available', () => {
render(<Button variant="brandSolid">Solid action</Button>)

expect(screen.getByRole('button', { name: 'Solid action' })).toHaveClass(
'bg-brand-500',
'hover:bg-brand-600',
)
})
})
3 changes: 2 additions & 1 deletion web/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const buttonVariants = cva(
{
variants: {
variant: {
default: "bg-brand-500 text-white shadow-theme-xs hover:bg-brand-600",
default: "[background:var(--silo-gradient)] text-white shadow-theme-xs hover:opacity-90",
brandSolid: "bg-brand-500 text-white shadow-theme-xs hover:bg-brand-600",
outline:
"border-gray-300 bg-white text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 dark:hover:border-gray-600 dark:hover:bg-gray-700 dark:hover:text-white",
secondary:
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/auth/setup-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function SetupPage() {
</label>
</div>
{error ? <p className="setup-error">{error}</p> : null}
<Button className="w-full" type="submit" disabled={pending}>
<Button className="w-full" variant="brandSolid" type="submit" disabled={pending}>
<Icon name={pending ? 'loader' : 'arrowRight'} className={pending ? 'animate-spin' : ''} />
{pending ? t('common.working') : t('setup.finish')}
</Button>
Expand Down