mirror of
https://github.com/luxfi/design.git
synced 2026-10-30 16:58:57 +00:00
Swapping the forked token layer for the inherited one silently orphaned two names. The fork declared --border-hairline (a solid #262626) and --border-card; the substrate draws every one of those boundaries with a single alpha --border, and explains at length why alpha beats a solid hex there — a solid edge reads on the page and vanishes the moment it lands on a lifted surface. Nineteen shipped files still asked for the old names: Card, Avatar, Badge, Table, Accordion, Dialog, DropdownMenu, Sheet, Toaster, seven specimen cards, and the generation prompts. An undefined custom property in `border:1px solid var(--gone)` does not fail. The declaration is invalid at computed-value time, border-color falls back to currentColor, and every one of those surfaces draws its edge in the INK colour — a stark near-white hairline on black that reads as a bold design choice rather than as nineteen broken files. They are not re-declared as aliases. Both mapped to the substrate's --border, so keeping them would be two names for one thing — exactly the duplication this package exists to remove. The components now speak the substrate's vocabulary. check-tokens gains the check that would have caught it. Check 4 proves the STYLESHEET is internally consistent and says nothing about the components, kits, specimen cards and prompts shipped beside it — which are the files a consumer actually renders. Now every var() in all 78 of them must resolve against the sheet. Mutation-proven: pointing one card back at --border-hairline fails the build. Co-authored-by: Hanzo Dev <[email protected]>
31 lines
1.4 KiB
React
31 lines
1.4 KiB
React
import React from 'react'
|
|
|
|
export function Table({ style, children, ...rest }) {
|
|
return <table style={{width:'100%',borderCollapse:'collapse',fontSize:'var(--text-sm)',...style}} {...rest}>{children}</table>
|
|
}
|
|
export function TableHeader({ style, children, ...rest }) {
|
|
return <thead style={{background:'var(--black)',...style}} {...rest}>{children}</thead>
|
|
}
|
|
export function TableBody({ style, children, ...rest }) {
|
|
return <tbody style={style} {...rest}>{children}</tbody>
|
|
}
|
|
export function TableRow({ interactive = false, style, children, ...rest }) {
|
|
const [hover, setHover] = React.useState(false)
|
|
return (
|
|
<tr
|
|
onMouseEnter={interactive ? () => setHover(true) : undefined}
|
|
onMouseLeave={interactive ? () => setHover(false) : undefined}
|
|
style={{borderTop:'1px solid var(--border)',background: hover ? 'rgb(23 23 23 / .6)' : 'transparent',cursor: interactive ? 'pointer' : 'default',transition:'background-color var(--duration-fast) var(--ease-out)',...style}}
|
|
{...rest}
|
|
>
|
|
{children}
|
|
</tr>
|
|
)
|
|
}
|
|
export function TableHead({ align = 'left', style, children, ...rest }) {
|
|
return <th style={{padding:'12px 24px',textAlign:align,fontWeight:'var(--weight-medium)',color:'var(--text-helper)',...style}} {...rest}>{children}</th>
|
|
}
|
|
export function TableCell({ align = 'left', style, children, ...rest }) {
|
|
return <td style={{padding:'16px 24px',textAlign:align,color:'var(--foreground)',...style}} {...rest}>{children}</td>
|
|
}
|