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]>
42 lines
2.0 KiB
React
42 lines
2.0 KiB
React
import React from 'react'
|
|
|
|
export function Dialog({ open, onOpenChange, children }) {
|
|
React.useEffect(() => {
|
|
if (!open) return
|
|
const onKey = (e) => { if (e.key === 'Escape') onOpenChange && onOpenChange(false) }
|
|
document.addEventListener('keydown', onKey)
|
|
return () => document.removeEventListener('keydown', onKey)
|
|
}, [open, onOpenChange])
|
|
if (!open) return null
|
|
return (
|
|
<div
|
|
onClick={() => onOpenChange && onOpenChange(false)}
|
|
style={{position:'fixed',inset:0,zIndex:80,display:'flex',alignItems:'center',justifyContent:'center',padding:24,background:'rgb(0 0 0 / .8)',backdropFilter:'blur(4px)',animation:'lux-fade-up var(--duration-fast) var(--ease-out)'}}
|
|
>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export function DialogContent({ width = 480, style, children, ...rest }) {
|
|
return (
|
|
<div
|
|
role="dialog" aria-modal="true" onClick={(e) => e.stopPropagation()}
|
|
style={{width:'100%',maxWidth:width,maxHeight:'85vh',overflowY:'auto',padding:24,display:'flex',flexDirection:'column',gap:16,background:'var(--popover)',color:'var(--popover-foreground)',border:'1px solid var(--border)',borderRadius:'var(--radius-xl)',boxShadow:'var(--shadow-floating)',...style}}
|
|
{...rest}
|
|
>{children}</div>
|
|
)
|
|
}
|
|
export function DialogHeader({ style, children, ...rest }) {
|
|
return <div style={{display:'flex',flexDirection:'column',gap:6,...style}} {...rest}>{children}</div>
|
|
}
|
|
export function DialogTitle({ style, children, ...rest }) {
|
|
return <h2 style={{fontSize:'var(--text-lg)',fontWeight:'var(--weight-semibold)',color:'var(--text-primary)',...style}} {...rest}>{children}</h2>
|
|
}
|
|
export function DialogDescription({ style, children, ...rest }) {
|
|
return <p style={{fontSize:'var(--text-sm)',lineHeight:'var(--leading-relaxed)',color:'var(--text-helper)',...style}} {...rest}>{children}</p>
|
|
}
|
|
export function DialogFooter({ style, children, ...rest }) {
|
|
return <div style={{display:'flex',justifyContent:'flex-end',gap:8,...style}} {...rest}>{children}</div>
|
|
}
|