Skip to content

Commit 7624d63

Browse files
committed
improvement(docs): neutral primary chip for nav CTA + fix cluster spacing
Align the docs navbar with the main app, which reserves green for accents/status and uses a neutral high-contrast CTA in nav. - add a canonical `primary` chip variant (inverse fill: dark in light mode, white in dark mode), mirroring the emcn chip's primary action - "Get started" and the 404 "Go home" now use variant='primary' instead of the green brand surface - retire the now-unused `brand` chip variant (no parallel path left behind) - fix navbar right-cluster spacing: gap-2 to match the landing navbar and drop the asymmetric ml-1 on the CTA
1 parent ec210be commit 7624d63

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

apps/docs/app/[lang]/not-found.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function NotFound() {
1616
<p className='text-[var(--text-muted)]'>
1717
The page you're looking for doesn't exist or has been moved.
1818
</p>
19-
<ChipLink href='/' variant='brand'>
19+
<ChipLink href='/' variant='primary'>
2020
Go home
2121
</ChipLink>
2222
</div>

apps/docs/components/navbar/navbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ export function Navbar() {
5252
<SearchTrigger />
5353
</div>
5454

55-
<div className='flex items-center gap-1'>
55+
<div className='flex items-center gap-2'>
5656
<LanguageDropdown />
5757
<ThemeToggle />
58-
<ChipLink href='https://sim.ai' variant='brand' className='ml-1'>
58+
<ChipLink href='https://sim.ai' variant='primary'>
5959
Get started
6060
</ChipLink>
6161
</div>

apps/docs/components/ui/chip.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export const chipContentIconClass = 'size-[16px] flex-shrink-0 text-[var(--text-
2626
export const chipContentLabelClass = 'min-w-0 truncate text-[var(--text-body)] text-sm'
2727
/** The filled FILL (surface only, no border) — `--surface-5` light / `--surface-4` dark. */
2828
export const chipFilledFillTokens = 'bg-[var(--surface-5)] dark:bg-[var(--surface-4)]'
29+
/** The inverse/primary FILL — dark surface + inverse text in light, white + `--bg` text in dark. */
30+
const chipPrimaryFillTokens =
31+
'bg-[var(--text-primary)] text-[var(--text-inverse)] dark:bg-white dark:text-[var(--bg)]'
2932
/** 1px `--border-1` border applied to chip triggers so they read as controls. */
3033
export const TRIGGER_BORDER_CLASS = 'border border-[var(--border-1)]'
3134

@@ -34,8 +37,9 @@ export const TRIGGER_BORDER_CLASS = 'border border-[var(--border-1)]'
3437
*
3538
* @remarks
3639
* The implicit default variant is the bare pill — transparent, `--surface-active`
37-
* on hover. `filled` adds the filled surface; `brand` is the green CTA surface
38-
* (`--brand-accent`) used for the "Get started" link.
40+
* on hover. `filled` adds the filled surface; `primary` is the canonical inverse
41+
* CTA surface (dark in light mode, white in dark mode) used for the "Get started"
42+
* link.
3943
*/
4044
const chipVariants = cva(
4145
`group cursor-pointer font-season ${chipGeometryClass} transition-colors disabled:cursor-not-allowed disabled:opacity-60`,
@@ -44,8 +48,7 @@ const chipVariants = cva(
4448
variant: {
4549
default: 'hover:bg-[var(--surface-active)]',
4650
filled: `${chipFilledFillTokens} hover:bg-[var(--surface-active)]`,
47-
brand:
48-
'bg-[var(--brand-accent)] text-white hover:bg-[var(--brand-accent-hover)] hover:text-white',
51+
primary: `${chipPrimaryFillTokens} hover:bg-[var(--text-body)] dark:hover:bg-[var(--text-secondary)]`,
4952
},
5053
fullWidth: { true: 'flex', false: 'inline-flex' },
5154
},
@@ -66,7 +69,7 @@ interface ChipBaseProps extends VariantProps<typeof chipVariants> {
6669
}
6770

6871
/**
69-
* `brand` sets text color on the chip itself — its icon and label inherit via
72+
* `primary` sets text color on the chip itself — its icon and label inherit via
7073
* `currentColor`. The default and `filled` chips use explicit icon
7174
* (`--text-icon`) and label (`--text-body`) colors.
7275
*/
@@ -76,7 +79,7 @@ function ChipContent({
7679
rightIcon: RightIcon,
7780
children,
7881
}: ChipBaseProps) {
79-
const isInverse = variant === 'brand'
82+
const isInverse = variant === 'primary'
8083
const iconClass = cn(chipContentIconClass, isInverse && 'text-current')
8184
const labelClass = cn(chipContentLabelClass, 'flex-1', isInverse && 'text-current')
8285
return (
@@ -121,7 +124,7 @@ interface ChipLinkProps
121124
ChipBaseProps {}
122125

123126
/**
124-
* @example <ChipLink href='https://sim.ai' variant='brand'>Get started</ChipLink>
127+
* @example <ChipLink href='https://sim.ai' variant='primary'>Get started</ChipLink>
125128
*/
126129
const ChipLink = forwardRef<HTMLAnchorElement, ChipLinkProps>(function ChipLink(
127130
{ className, variant, fullWidth, leftIcon, rightIcon, children, ...props },

0 commit comments

Comments
 (0)