feat(frontend): unify control radius on one token
Buttons and inputs in the kit used rounded-md (6px) while the landing CTAs hard-coded 0.6rem (9.6px), so a form row could mix three different corners. Add --radius-ctl (10px, matching --radius-panel), point every interactive control at it via rounded-ctl and make the CTAs consume the same variable. Drop the unused ButtonAnchor helper.
This commit is contained in:
parent
7bb981b58e
commit
456366006e
11 changed files with 17 additions and 22 deletions
|
|
@ -1,10 +1,10 @@
|
|||
import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react'
|
||||
import type { ButtonHTMLAttributes } from 'react'
|
||||
import { Link, type LinkProps } from 'react-router'
|
||||
|
||||
type Variant = 'primary' | 'quiet' | 'danger'
|
||||
|
||||
const BASE =
|
||||
'inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-semibold transition-colors'
|
||||
'inline-flex items-center justify-center gap-2 rounded-ctl px-4 py-2 text-sm font-semibold transition-colors'
|
||||
|
||||
const VARIANTS: Record<Variant, string> = {
|
||||
primary: 'bg-ice text-abyss hover:bg-ice/90',
|
||||
|
|
@ -35,12 +35,3 @@ export function Button({
|
|||
export function ButtonLink({ variant = 'primary', className = '', ...rest }: LinkProps & { variant?: Variant }) {
|
||||
return <Link className={`${BASE} ${VARIANTS[variant]} ${className}`} {...rest} />
|
||||
}
|
||||
|
||||
/** Like ButtonLink but escapes to a plain <a> for external/href CTAs (e.g. GitHub downloads). */
|
||||
export function ButtonAnchor({
|
||||
variant = 'primary',
|
||||
className = '',
|
||||
...rest
|
||||
}: AnchorHTMLAttributes<HTMLAnchorElement> & { variant?: Variant }) {
|
||||
return <a className={`${BASE} ${VARIANTS[variant]} ${className}`} {...rest} />
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { ReactNode } from 'react'
|
|||
export function Notice({ tone, children }: { tone: 'info' | 'error'; children: ReactNode }) {
|
||||
const styles = tone === 'error' ? 'border-ember/60 text-ember' : 'border-shoal text-frost'
|
||||
return (
|
||||
<div role={tone === 'error' ? 'alert' : 'status'} className={`rounded-md border px-3 py-2 text-sm ${styles}`}>
|
||||
<div role={tone === 'error' ? 'alert' : 'status'} className={`rounded-ctl border px-3 py-2 text-sm ${styles}`}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export function TextField({
|
|||
id={id}
|
||||
aria-invalid={error ? true : undefined}
|
||||
aria-describedby={describedBy}
|
||||
className="rounded-md border border-shoal bg-abyss px-3 py-2 text-snow placeholder:text-frost/60 focus:border-ice aria-invalid:border-ember"
|
||||
className="rounded-ctl border border-shoal bg-abyss px-3 py-2 text-snow placeholder:text-frost/60 focus:border-ice aria-invalid:border-ember"
|
||||
{...rest}
|
||||
/>
|
||||
{error ? (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue