@hanzo/design 0.3.5 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/components/core/Avatar.jsx +1 -1
- package/components/core/Badge.jsx +10 -7
- package/components/core/Button.jsx +1 -2
- package/components/core/Card.jsx +1 -1
- package/components/core/Progress.jsx +1 -1
- package/components/core/Table.jsx +2 -2
- package/components/forms/Checkbox.jsx +1 -1
- package/components/forms/Input.jsx +4 -4
- package/components/forms/Select.jsx +3 -3
- package/components/forms/Slider.jsx +1 -1
- package/components/forms/Textarea.jsx +3 -3
- package/components/navigation/Accordion.jsx +2 -2
- package/components/navigation/navigation.card.html +1 -1
- package/components/overlays/Dialog.jsx +1 -1
- package/components/overlays/DropdownMenu.jsx +3 -3
- package/components/overlays/Sheet.jsx +3 -3
- package/components/overlays/Toaster.jsx +1 -1
- package/dist/tokens.gen.d.ts +92 -60
- package/dist/tokens.gen.d.ts.map +1 -1
- package/dist/tokens.gen.js +92 -60
- package/package.json +11 -11
- package/scripts/check-tokens.mjs +64 -1
- package/scripts/gen-tokens.mjs +79 -0
- package/src/tokens.gen.ts +92 -60
- package/styles.css +313 -81
- package/tailwind.css +787 -0
- package/tokens/base.css +125 -22
- package/tokens/colors.css +121 -52
- package/tokens/spacing.css +46 -7
- package/tokens/typography.css +21 -0
package/README.md
CHANGED
|
@@ -127,3 +127,28 @@ Tokens track `hanzo.ai` (`app/globals.css`, `tailwind.config.ts`, `DESIGN.md`) a
|
|
|
127
127
|
## License
|
|
128
128
|
|
|
129
129
|
BSD-3-Clause. Brand marks (the Hanzo logo, partner and provider logos) are the property of their respective owners and are provided for identification.
|
|
130
|
+
|
|
131
|
+
## Using it in a Tailwind app
|
|
132
|
+
|
|
133
|
+
One import, after Tailwind's:
|
|
134
|
+
|
|
135
|
+
```css
|
|
136
|
+
@import "tailwindcss";
|
|
137
|
+
@import "@hanzo/design/tailwind.css";
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
That carries the tokens **and** maps them onto Tailwind's namespace, so
|
|
141
|
+
`bg-background`, `text-muted-foreground` and `border-border` resolve to the
|
|
142
|
+
system's values. There is no `@theme` block to hand-write and keep in sync.
|
|
143
|
+
|
|
144
|
+
Not using Tailwind? `@import "@hanzo/design/styles.css"` is the same tokens
|
|
145
|
+
without the bridge.
|
|
146
|
+
|
|
147
|
+
### Two rules, and the build enforces both
|
|
148
|
+
|
|
149
|
+
- **Import it after `tailwindcss`.** `@theme` extends the framework, so it has
|
|
150
|
+
to follow it.
|
|
151
|
+
- **Don't re-declare tokens in your app.** An app that states its own palette
|
|
152
|
+
drifts from every other surface, and any token it forgets resolves to nothing
|
|
153
|
+
— `border-border` becomes `currentColor`, which paints a white hairline on
|
|
154
|
+
black and reads as a design choice rather than a missing line.
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
export function Avatar({ size = 32, style, children, ...rest }) {
|
|
4
4
|
return (
|
|
5
|
-
<span style={{position:'relative',display:'inline-flex',alignItems:'center',justifyContent:'center',width:size,height:size,flexShrink:0,borderRadius:'var(--radius-full)',overflow:'hidden',border:'1px solid var(--border
|
|
5
|
+
<span style={{position:'relative',display:'inline-flex',alignItems:'center',justifyContent:'center',width:size,height:size,flexShrink:0,borderRadius:'var(--radius-full)',overflow:'hidden',border:'1px solid var(--border)',background:'linear-gradient(to bottom right,var(--muted-foreground),var(--surface-3))',...style}} {...rest}>
|
|
6
6
|
{children}
|
|
7
7
|
</span>
|
|
8
8
|
)
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
/** Rank is carried by
|
|
3
|
+
/** Rank is carried by lift, never by hue (DESIGN.md §2.3).
|
|
4
|
+
The rungs come off the SURFACE ladder and --glass, not off --white-*: the
|
|
5
|
+
opacity ladder is white-on-white in the light theme, so a tier2 pill drawn
|
|
6
|
+
from --white-15 was an invisible chip the moment a surface went light. */
|
|
4
7
|
const V = {
|
|
5
|
-
default:{background:'var(--
|
|
8
|
+
default:{background:'var(--glass-strong)',color:'var(--text-primary)',border:'1px solid var(--border)'},
|
|
6
9
|
secondary:{background:'var(--secondary)',color:'var(--secondary-foreground)',border:'1px solid transparent'},
|
|
7
|
-
outline:{background:'transparent',color:'var(--text-secondary)',border:'1px solid var(--border
|
|
8
|
-
tier1:{background:'var(--
|
|
9
|
-
tier2:{background:'var(--
|
|
10
|
-
tier3:{background:'var(--
|
|
10
|
+
outline:{background:'transparent',color:'var(--text-secondary)',border:'1px solid var(--border)'},
|
|
11
|
+
tier1:{background:'var(--glass)',color:'var(--text-tertiary)',border:'1px solid var(--border)'},
|
|
12
|
+
tier2:{background:'var(--surface-2)',color:'var(--text-secondary)',border:'1px solid var(--border)'},
|
|
13
|
+
tier3:{background:'var(--surface-3)',color:'var(--text-primary)',border:'1px solid var(--border-strong)'},
|
|
11
14
|
error:{background:'var(--state-error-bg)',color:'var(--state-error-text)',border:'1px solid transparent'},
|
|
12
15
|
}
|
|
13
16
|
|
|
@@ -31,7 +34,7 @@ export function Badge({ variant = 'default', pill = true, style, children, ...re
|
|
|
31
34
|
/** The eyebrow pill above a hero headline. */
|
|
32
35
|
export function EyebrowBadge({ children, style, ...rest }) {
|
|
33
36
|
return (
|
|
34
|
-
<span style={{display:'inline-flex',alignItems:'center',gap:8,padding:'8px 16px',borderRadius:'var(--radius-full)',border:'1px solid var(--border
|
|
37
|
+
<span style={{display:'inline-flex',alignItems:'center',gap:8,padding:'8px 16px',borderRadius:'var(--radius-full)',border:'1px solid var(--border)',background:'var(--glass)',fontSize:'var(--text-sm)',color:'var(--text-secondary)',...style}} {...rest}>{children}</span>
|
|
35
38
|
)
|
|
36
39
|
}
|
|
37
40
|
|
|
@@ -14,7 +14,7 @@ const SZ = {
|
|
|
14
14
|
lg:{height:44,padding:'0 24px',fontSize:'var(--text-sm)'},
|
|
15
15
|
icon:{height:36,width:36,padding:0},
|
|
16
16
|
}
|
|
17
|
-
const HOVER = { primary:'primary', secondary:'
|
|
17
|
+
const HOVER = { primary:'primary', secondary:'primary', outline:'accent', ghost:'accent', destructive:'destructive', link:'link' }
|
|
18
18
|
|
|
19
19
|
export function Button({ variant = 'primary', size = 'default', pill = false, disabled, style, children, ...rest }) {
|
|
20
20
|
const [hover, setHover] = React.useState(false)
|
|
@@ -23,7 +23,6 @@ export function Button({ variant = 'primary', size = 'default', pill = false, di
|
|
|
23
23
|
const h = HOVER[variant]
|
|
24
24
|
const hoverStyle = !hover || disabled ? null
|
|
25
25
|
: h === 'primary' || h === 'destructive' ? { opacity: 0.9 }
|
|
26
|
-
: h === 'secondary' ? { background: 'var(--neutral-800)' }
|
|
27
26
|
: h === 'accent' ? { background: 'var(--accent)', color: 'var(--text-primary)' }
|
|
28
27
|
: { textDecoration: 'underline' }
|
|
29
28
|
return (
|
package/components/core/Card.jsx
CHANGED
|
@@ -16,7 +16,7 @@ export function Card({ variant = 'default', sheen = false, interactive = false,
|
|
|
16
16
|
style={{
|
|
17
17
|
position:'relative',overflow:'hidden',
|
|
18
18
|
borderRadius:'var(--radius-lg)',
|
|
19
|
-
border:'1px solid ' + (hover ? 'var(--border-strong)' : 'var(--border
|
|
19
|
+
border:'1px solid ' + (hover ? 'var(--border-strong)' : 'var(--border)'),
|
|
20
20
|
background:FILL[variant] || FILL.default,
|
|
21
21
|
transition:'border-color var(--duration-fast) var(--ease-out)',
|
|
22
22
|
...style,
|
|
@@ -4,7 +4,7 @@ export function Progress({ value = 0, max = 100, height = 6, style, ...rest }) {
|
|
|
4
4
|
const pct = Math.max(0, Math.min(100, (value / max) * 100))
|
|
5
5
|
return (
|
|
6
6
|
<div role="progressbar" aria-valuenow={value} aria-valuemin={0} aria-valuemax={max}
|
|
7
|
-
style={{position:'relative',width:'100%',height,borderRadius:'var(--radius-full)',background:'var(--
|
|
7
|
+
style={{position:'relative',width:'100%',height,borderRadius:'var(--radius-full)',background:'var(--glass-strong)',overflow:'hidden',...style}} {...rest}>
|
|
8
8
|
<div style={{height:'100%',width:pct+'%',background:'var(--primary)',borderRadius:'var(--radius-full)',transition:'width var(--duration-base) var(--ease-out)'}} />
|
|
9
9
|
</div>
|
|
10
10
|
)
|
|
@@ -4,7 +4,7 @@ export function Table({ style, children, ...rest }) {
|
|
|
4
4
|
return <table style={{width:'100%',borderCollapse:'collapse',fontSize:'var(--text-sm)',...style}} {...rest}>{children}</table>
|
|
5
5
|
}
|
|
6
6
|
export function TableHeader({ style, children, ...rest }) {
|
|
7
|
-
return <thead style={{background:'var(--
|
|
7
|
+
return <thead style={{background:'var(--surface-2)',...style}} {...rest}>{children}</thead>
|
|
8
8
|
}
|
|
9
9
|
export function TableBody({ style, children, ...rest }) {
|
|
10
10
|
return <tbody style={style} {...rest}>{children}</tbody>
|
|
@@ -15,7 +15,7 @@ export function TableRow({ interactive = false, style, children, ...rest }) {
|
|
|
15
15
|
<tr
|
|
16
16
|
onMouseEnter={interactive ? () => setHover(true) : undefined}
|
|
17
17
|
onMouseLeave={interactive ? () => setHover(false) : undefined}
|
|
18
|
-
style={{borderTop:'1px solid var(--border
|
|
18
|
+
style={{borderTop:'1px solid var(--border)',background: hover ? 'var(--glass)' : 'transparent',cursor: interactive ? 'pointer' : 'default',transition:'background-color var(--duration-fast) var(--ease-out)',...style}}
|
|
19
19
|
{...rest}
|
|
20
20
|
>
|
|
21
21
|
{children}
|
|
@@ -15,7 +15,7 @@ export function Checkbox({ checked, defaultChecked, onChange, disabled, label, s
|
|
|
15
15
|
onKeyDown={(e)=>{if(e.key===' '||e.key==='Enter'){e.preventDefault();toggle()}}}
|
|
16
16
|
style={{
|
|
17
17
|
display:'inline-flex',alignItems:'center',justifyContent:'center',width:16,height:16,flexShrink:0,
|
|
18
|
-
borderRadius:4,border:'1px solid ' + (on ? 'var(--primary)' : 'var(--border-
|
|
18
|
+
borderRadius:4,border:'1px solid ' + (on ? 'var(--primary)' : 'var(--border-control)'),
|
|
19
19
|
background: on ? 'var(--primary)' : 'transparent',
|
|
20
20
|
cursor: disabled ? 'not-allowed' : 'pointer', opacity: disabled ? 0.5 : 1,
|
|
21
21
|
transition:'background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out)',
|
|
@@ -8,10 +8,10 @@ export function Input({ invalid = false, style, ...rest }) {
|
|
|
8
8
|
onBlur={(e)=>{setFocus(false);rest.onBlur&&rest.onBlur(e)}}
|
|
9
9
|
style={{
|
|
10
10
|
width:'100%',height:36,padding:'0 12px',
|
|
11
|
-
fontFamily:'var(--font-sans)',fontSize:'var(--text-
|
|
12
|
-
background:'var(--
|
|
13
|
-
border:'1px solid ' + (invalid ? 'var(--state-error)' : focus ? 'var(--
|
|
14
|
-
borderRadius:'var(--radius-sm)',
|
|
11
|
+
fontFamily:'var(--font-sans)',fontSize:'var(--text-control)',color:'var(--foreground)',
|
|
12
|
+
background:'var(--surface-2)',
|
|
13
|
+
border:'1px solid ' + (invalid ? 'var(--state-error)' : focus ? 'var(--border-focus)' : 'var(--border-control)'),
|
|
14
|
+
borderRadius:'var(--radius-sm)',
|
|
15
15
|
transition:'border-color var(--duration-fast) var(--ease-out)',
|
|
16
16
|
...style,
|
|
17
17
|
}}
|
|
@@ -11,9 +11,9 @@ export function Select({ options = [], value, onChange, placeholder, style, chil
|
|
|
11
11
|
onFocus={()=>setFocus(true)} onBlur={()=>setFocus(false)}
|
|
12
12
|
style={{
|
|
13
13
|
appearance:'none',width:'100%',height:36,padding:'0 32px 0 12px',
|
|
14
|
-
fontFamily:'var(--font-sans)',fontSize:'var(--text-
|
|
15
|
-
background:'var(--
|
|
16
|
-
borderRadius:'var(--radius-sm)',
|
|
14
|
+
fontFamily:'var(--font-sans)',fontSize:'var(--text-control)',color:'var(--foreground)',
|
|
15
|
+
background:'var(--surface-2)',border:'1px solid ' + (focus ? 'var(--border-focus)' : 'var(--border-control)'),
|
|
16
|
+
borderRadius:'var(--radius-sm)',cursor:'pointer',
|
|
17
17
|
transition:'border-color var(--duration-fast) var(--ease-out)',
|
|
18
18
|
...style,
|
|
19
19
|
}}
|
|
@@ -10,7 +10,7 @@ export function Slider({ min = 0, max = 100, step = 1, value, defaultValue = 0,
|
|
|
10
10
|
onChange={(e) => { const n = Number(e.target.value); if (value === undefined) setInner(n); onChange && onChange(n) }}
|
|
11
11
|
style={{
|
|
12
12
|
appearance:'none',WebkitAppearance:'none',width:'100%',height:16,background:'transparent',cursor:'pointer',
|
|
13
|
-
backgroundImage:'linear-gradient(var(--primary),var(--primary)),linear-gradient(var(--
|
|
13
|
+
backgroundImage:'linear-gradient(var(--primary),var(--primary)),linear-gradient(var(--glass-strong),var(--glass-strong))',
|
|
14
14
|
backgroundSize: pct + '% 4px, 100% 4px',
|
|
15
15
|
backgroundPosition:'left center, left center',
|
|
16
16
|
backgroundRepeat:'no-repeat',
|
|
@@ -9,9 +9,9 @@ export function Textarea({ rows = 4, style, ...rest }) {
|
|
|
9
9
|
onBlur={(e)=>{setFocus(false);rest.onBlur&&rest.onBlur(e)}}
|
|
10
10
|
style={{
|
|
11
11
|
width:'100%',padding:'8px 12px',resize:'vertical',
|
|
12
|
-
fontFamily:'var(--font-sans)',fontSize:'var(--text-
|
|
13
|
-
background:'var(--
|
|
14
|
-
borderRadius:'var(--radius-sm)',
|
|
12
|
+
fontFamily:'var(--font-sans)',fontSize:'var(--text-control)',lineHeight:'var(--leading-relaxed)',color:'var(--foreground)',
|
|
13
|
+
background:'var(--surface-2)',border:'1px solid ' + (focus ? 'var(--border-focus)' : 'var(--border-control)'),
|
|
14
|
+
borderRadius:'var(--radius-sm)',
|
|
15
15
|
transition:'border-color var(--duration-fast) var(--ease-out)',
|
|
16
16
|
...style,
|
|
17
17
|
}}
|
|
@@ -11,7 +11,7 @@ export function Accordion({ type = 'single', defaultValue = null, style, childre
|
|
|
11
11
|
const isOpen = (v) => (type === 'multiple' ? open.includes(v) : open === v)
|
|
12
12
|
return (
|
|
13
13
|
<Ctx.Provider value={{ isOpen, toggle }}>
|
|
14
|
-
<div style={{borderTop:'1px solid var(--border
|
|
14
|
+
<div style={{borderTop:'1px solid var(--border)',...style}} {...rest}>{children}</div>
|
|
15
15
|
</Ctx.Provider>
|
|
16
16
|
)
|
|
17
17
|
}
|
|
@@ -20,7 +20,7 @@ export function AccordionItem({ value, title, style, children, ...rest }) {
|
|
|
20
20
|
const { isOpen, toggle } = React.useContext(Ctx)
|
|
21
21
|
const on = isOpen(value)
|
|
22
22
|
return (
|
|
23
|
-
<div style={{borderBottom:'1px solid var(--border
|
|
23
|
+
<div style={{borderBottom:'1px solid var(--border)',...style}} {...rest}>
|
|
24
24
|
<button
|
|
25
25
|
onClick={() => toggle(value)} aria-expanded={on}
|
|
26
26
|
style={{display:'flex',width:'100%',alignItems:'center',justifyContent:'space-between',gap:16,padding:'18px 0',background:'transparent',border:'none',cursor:'pointer',textAlign:'left',fontFamily:'var(--font-sans)',fontSize:'var(--text-base)',fontWeight:'var(--weight-medium)',color:'var(--text-primary)'}}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.development.js" integrity="sha384-u6aeetuaXnQ38mYT8rp6sbXaQe3NL9t+IBXmnYxwkUI2Hw4bsp2Wvmx4yRQF1uAm" crossorigin="anonymous"></script>
|
|
6
6
|
<script src="https://unpkg.com/@babel/standalone@7.29.0/babel.min.js" integrity="sha384-m08KidiNqLdpJqLq95G/LEi8Qvjl/xUYll3QILypMoQ65QorJ9Lvtp2RXYGBFj1y" crossorigin="anonymous"></script>
|
|
7
7
|
<script src="../../_ds_bundle.js"></script>
|
|
8
|
-
<style>body{margin:0;padding:20px;background:#000;font-family:var(--font-sans)}pre{margin:0;padding:16px;background:var(--card);border:1px solid var(--border
|
|
8
|
+
<style>body{margin:0;padding:20px;background:#000;font-family:var(--font-sans)}pre{margin:0;padding:16px;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg);font-size:12px;line-height:1.7;color:var(--neutral-300);overflow:auto}</style></head>
|
|
9
9
|
<body><div id="root"></div>
|
|
10
10
|
<script type="text/babel">
|
|
11
11
|
const { Tabs, TabsList, TabsTrigger, TabsContent, Accordion, AccordionItem } = window.HanzoDesignSystem_0a9445;
|
|
@@ -22,7 +22,7 @@ export function DialogContent({ width = 480, style, children, ...rest }) {
|
|
|
22
22
|
return (
|
|
23
23
|
<div
|
|
24
24
|
role="dialog" aria-modal="true" onClick={(e) => e.stopPropagation()}
|
|
25
|
-
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
|
|
25
|
+
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}}
|
|
26
26
|
{...rest}
|
|
27
27
|
>{children}</div>
|
|
28
28
|
)
|
|
@@ -19,7 +19,7 @@ export function DropdownMenu({ align = 'right', hover = false, trigger, style, c
|
|
|
19
19
|
<span onClick={() => setOpen((v) => !v)} style={{display:'inline-flex'}}>{trigger}</span>
|
|
20
20
|
{open && (
|
|
21
21
|
<div style={{position:'absolute',top:'100%',[align]:0,paddingTop:12,zIndex:'var(--z-dropdown)',minWidth:208}}>
|
|
22
|
-
<div style={{display:'flex',flexDirection:'column',padding:8,background:'var(--surface-overlay)',border:'1px solid var(--border
|
|
22
|
+
<div style={{display:'flex',flexDirection:'column',padding:8,background:'var(--surface-overlay)',border:'1px solid var(--border)',borderRadius:'var(--radius-xl)',boxShadow:'var(--shadow-floating)',backdropFilter:'blur(16px)',animation:'hanzo-fade-down var(--duration-fast) var(--ease-out)'}}>
|
|
23
23
|
{children}
|
|
24
24
|
</div>
|
|
25
25
|
</div>
|
|
@@ -33,7 +33,7 @@ export function DropdownMenuItem({ desc, style, children, ...rest }) {
|
|
|
33
33
|
return (
|
|
34
34
|
<a
|
|
35
35
|
onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)}
|
|
36
|
-
style={{display:'block',padding: desc ? '10px 12px' : '8px 12px',borderRadius:'var(--radius-sm)',background: hover ? 'var(--
|
|
36
|
+
style={{display:'block',padding: desc ? '10px 12px' : '8px 12px',borderRadius:'var(--radius-sm)',background: hover ? 'var(--glass)' : 'transparent',cursor:'pointer',textDecoration:'none',transition:'background-color var(--duration-fast) var(--ease-out)',...style}}
|
|
37
37
|
{...rest}
|
|
38
38
|
>
|
|
39
39
|
<span style={{display:'block',fontSize:'var(--text-sm)',fontWeight:'var(--weight-medium)',color:'var(--neutral-100)'}}>{children}</span>
|
|
@@ -45,5 +45,5 @@ export function DropdownMenuLabel({ style, children, ...rest }) {
|
|
|
45
45
|
return <span style={{padding:'6px 12px',fontSize:'var(--text-xs)',fontWeight:'var(--weight-medium)',textTransform:'uppercase',letterSpacing:'var(--tracking-wide)',color:'var(--neutral-500)',...style}} {...rest}>{children}</span>
|
|
46
46
|
}
|
|
47
47
|
export function DropdownMenuSeparator({ style }) {
|
|
48
|
-
return <span style={{height:1,margin:'6px 4px',background:'var(--border
|
|
48
|
+
return <span style={{height:1,margin:'6px 4px',background:'var(--border)',...style}} />
|
|
49
49
|
}
|
|
@@ -9,8 +9,8 @@ export function Sheet({ open, onOpenChange, side = 'right', width = 380, childre
|
|
|
9
9
|
}, [open, onOpenChange])
|
|
10
10
|
if (!open) return null
|
|
11
11
|
const pos = side === 'left'
|
|
12
|
-
? { left: 0, top: 0, bottom: 0, width, borderRight: '1px solid var(--border
|
|
13
|
-
: { right: 0, top: 0, bottom: 0, width, borderLeft: '1px solid var(--border
|
|
12
|
+
? { left: 0, top: 0, bottom: 0, width, borderRight: '1px solid var(--border)' }
|
|
13
|
+
: { right: 0, top: 0, bottom: 0, width, borderLeft: '1px solid var(--border)' }
|
|
14
14
|
return (
|
|
15
15
|
<div onClick={() => onOpenChange && onOpenChange(false)} style={{position:'fixed',inset:0,zIndex:'var(--z-modal)',background:'var(--surface-scrim)'}}>
|
|
16
16
|
<div
|
|
@@ -21,7 +21,7 @@ export function Sheet({ open, onOpenChange, side = 'right', width = 380, childre
|
|
|
21
21
|
)
|
|
22
22
|
}
|
|
23
23
|
export function SheetHeader({ style, children, ...rest }) {
|
|
24
|
-
return <div style={{padding:'20px 24px',borderBottom:'1px solid var(--border
|
|
24
|
+
return <div style={{padding:'20px 24px',borderBottom:'1px solid var(--border)',display:'flex',flexDirection:'column',gap:4,...style}} {...rest}>{children}</div>
|
|
25
25
|
}
|
|
26
26
|
export function SheetTitle({ style, children, ...rest }) {
|
|
27
27
|
return <h2 style={{fontSize:'var(--text-base)',fontWeight:'var(--weight-semibold)',color:'var(--text-primary)',...style}} {...rest}>{children}</h2>
|
|
@@ -33,7 +33,7 @@ export function Toaster({ duration = 3500, position = 'bottom-right' }) {
|
|
|
33
33
|
{items.map((i) => (
|
|
34
34
|
<div key={i.id} style={{
|
|
35
35
|
minWidth:260,maxWidth:380,padding:'12px 14px',display:'flex',alignItems:'flex-start',gap:10,
|
|
36
|
-
background:'var(--surface-overlay)',border:'1px solid ' + (i.tone === 'error' ? 'var(--state-error)' : 'var(--border
|
|
36
|
+
background:'var(--surface-overlay)',border:'1px solid ' + (i.tone === 'error' ? 'var(--state-error)' : 'var(--border)'),
|
|
37
37
|
borderRadius:'var(--radius-lg)',boxShadow:'var(--shadow-floating)',backdropFilter:'blur(16px)',
|
|
38
38
|
fontSize:'var(--text-sm)',color:'var(--neutral-100)',animation:'hanzo-slide-up-fade var(--duration-base) var(--ease-out)',
|
|
39
39
|
}}>
|
package/dist/tokens.gen.d.ts
CHANGED
|
@@ -16,37 +16,50 @@ export declare const colors: {
|
|
|
16
16
|
readonly 'hanzo-black': "#0A0A0B";
|
|
17
17
|
readonly 'hanzo-white': "#FFFFFF";
|
|
18
18
|
readonly 'white-05': "rgb(255 255 255 / .05)";
|
|
19
|
+
readonly 'white-06': "rgb(255 255 255 / .06)";
|
|
20
|
+
readonly 'white-08': "rgb(255 255 255 / .08)";
|
|
19
21
|
readonly 'white-10': "rgb(255 255 255 / .10)";
|
|
20
22
|
readonly 'white-15': "rgb(255 255 255 / .15)";
|
|
23
|
+
readonly 'white-16': "rgb(255 255 255 / .16)";
|
|
21
24
|
readonly 'white-20': "rgb(255 255 255 / .20)";
|
|
25
|
+
readonly 'white-22': "rgb(255 255 255 / .22)";
|
|
22
26
|
readonly 'white-30': "rgb(255 255 255 / .30)";
|
|
23
27
|
readonly 'white-40': "rgb(255 255 255 / .40)";
|
|
28
|
+
readonly 'white-55': "rgb(255 255 255 / .55)";
|
|
24
29
|
readonly 'white-60': "rgb(255 255 255 / .60)";
|
|
30
|
+
readonly 'white-78': "rgb(255 255 255 / .78)";
|
|
25
31
|
readonly 'white-80': "rgb(255 255 255 / .80)";
|
|
26
|
-
readonly background: "#
|
|
27
|
-
readonly foreground: "#
|
|
28
|
-
readonly card: "#
|
|
29
|
-
readonly 'card-foreground': "#
|
|
30
|
-
readonly popover: "#
|
|
31
|
-
readonly 'popover-foreground': "#
|
|
32
|
-
readonly primary: "#
|
|
33
|
-
readonly 'primary-
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
32
|
+
readonly background: "#0a0a0a";
|
|
33
|
+
readonly foreground: "#fafafa";
|
|
34
|
+
readonly card: "#0f0f0f";
|
|
35
|
+
readonly 'card-foreground': "#fafafa";
|
|
36
|
+
readonly popover: "#0f0f0f";
|
|
37
|
+
readonly 'popover-foreground': "#fafafa";
|
|
38
|
+
readonly primary: "#fafafa";
|
|
39
|
+
readonly 'primary-hover': "#d4d4d4";
|
|
40
|
+
readonly 'primary-foreground': "#0a0a0a";
|
|
41
|
+
readonly secondary: "#262626";
|
|
42
|
+
readonly 'secondary-foreground': "#fafafa";
|
|
43
|
+
readonly muted: "#171717";
|
|
44
|
+
readonly 'muted-foreground': "#a3a3a3";
|
|
45
|
+
readonly accent: "#262626";
|
|
46
|
+
readonly 'accent-foreground': "#fafafa";
|
|
40
47
|
readonly destructive: "#666666";
|
|
41
|
-
readonly 'destructive-foreground': "#
|
|
42
|
-
readonly border: "
|
|
43
|
-
readonly
|
|
48
|
+
readonly 'destructive-foreground': "#fafafa";
|
|
49
|
+
readonly border: "var(--white-10)";
|
|
50
|
+
readonly 'border-strong': "var(--white-16)";
|
|
51
|
+
readonly 'border-control': "var(--neutral-500)";
|
|
52
|
+
readonly 'border-focus': "var(--neutral-400)";
|
|
53
|
+
readonly input: "var(--border-control)";
|
|
44
54
|
readonly ring: "var(--neutral-500)";
|
|
45
55
|
readonly brand: "#e4e4e7";
|
|
46
56
|
readonly 'brand-foreground': "#09090b";
|
|
47
57
|
readonly 'brand-muted': "#a3a3a3";
|
|
48
58
|
readonly black: "#000000";
|
|
49
|
-
readonly white: "#
|
|
59
|
+
readonly white: "#fafafa";
|
|
60
|
+
readonly selection: "var(--white-20)";
|
|
61
|
+
readonly glass: "var(--white-05)";
|
|
62
|
+
readonly 'glass-strong': "var(--white-08)";
|
|
50
63
|
readonly 'surface-page': "var(--background)";
|
|
51
64
|
readonly 'surface-card': "rgb(23 23 23 / .5)";
|
|
52
65
|
readonly 'surface-card-emphasis': "rgb(23 23 23 / .8)";
|
|
@@ -54,16 +67,13 @@ export declare const colors: {
|
|
|
54
67
|
readonly 'surface-overlay': "rgb(10 10 10 / .95)";
|
|
55
68
|
readonly 'surface-header': "rgb(0 0 0 / .7)";
|
|
56
69
|
readonly 'surface-scrim': "rgb(0 0 0 / .8)";
|
|
57
|
-
readonly 'border-hairline': "var(--neutral-800)";
|
|
58
|
-
readonly 'border-card': "var(--white-10)";
|
|
59
|
-
readonly 'border-strong': "var(--neutral-500)";
|
|
60
70
|
readonly 'surface-0': "var(--background)";
|
|
61
71
|
readonly 'surface-1': "var(--card)";
|
|
62
72
|
readonly 'surface-2': "var(--muted)";
|
|
63
73
|
readonly 'surface-3': "var(--secondary)";
|
|
64
|
-
readonly 'text-primary': "
|
|
65
|
-
readonly 'text-secondary': "var(--white-
|
|
66
|
-
readonly 'text-tertiary': "var(--white-
|
|
74
|
+
readonly 'text-primary': "#fafafa";
|
|
75
|
+
readonly 'text-secondary': "var(--white-78)";
|
|
76
|
+
readonly 'text-tertiary': "var(--white-55)";
|
|
67
77
|
readonly 'text-helper': "var(--muted-foreground)";
|
|
68
78
|
readonly 'text-disabled': "var(--white-30)";
|
|
69
79
|
readonly 'state-error': "#ef4444";
|
|
@@ -116,6 +126,7 @@ export declare const typography: {
|
|
|
116
126
|
readonly 'font-size-7xl': "var(--text-7xl)";
|
|
117
127
|
readonly 'font-size-8xl': "var(--text-8xl)";
|
|
118
128
|
readonly 'font-size-9xl': "var(--text-9xl)";
|
|
129
|
+
readonly 'text-control': "var(--text-sm)";
|
|
119
130
|
readonly 'weight-normal': "400";
|
|
120
131
|
readonly 'weight-medium': "500";
|
|
121
132
|
readonly 'weight-semibold': "600";
|
|
@@ -169,14 +180,19 @@ export declare const spacing: {
|
|
|
169
180
|
readonly 'container-max': "80rem";
|
|
170
181
|
readonly 'container-prose': "48rem";
|
|
171
182
|
readonly 'container-wide': "72rem";
|
|
172
|
-
readonly gutter: "1rem";
|
|
183
|
+
readonly gutter: "max(1rem,var(--safe-left),var(--safe-right))";
|
|
173
184
|
readonly 'gutter-sm': "1.5rem";
|
|
174
185
|
readonly 'gutter-lg': "2rem";
|
|
175
|
-
readonly 'section-y': "
|
|
176
|
-
readonly 'section-y-lg': "
|
|
177
|
-
readonly 'hero-y': "
|
|
178
|
-
readonly 'hero-y-lg': "
|
|
179
|
-
readonly 'header-height': "
|
|
186
|
+
readonly 'section-y': "2.5rem";
|
|
187
|
+
readonly 'section-y-lg': "3.5rem";
|
|
188
|
+
readonly 'hero-y': "3rem";
|
|
189
|
+
readonly 'hero-y-lg': "4.5rem";
|
|
190
|
+
readonly 'header-height': "3.5rem";
|
|
191
|
+
readonly 'tap-target': "44px";
|
|
192
|
+
readonly 'safe-top': "env(safe-area-inset-top,0px)";
|
|
193
|
+
readonly 'safe-right': "env(safe-area-inset-right,0px)";
|
|
194
|
+
readonly 'safe-bottom': "env(safe-area-inset-bottom,0px)";
|
|
195
|
+
readonly 'safe-left': "env(safe-area-inset-left,0px)";
|
|
180
196
|
};
|
|
181
197
|
/** grid tokens (from tokens/grid.css). Values are raw CSS. */
|
|
182
198
|
export declare const grid: {
|
|
@@ -277,37 +293,50 @@ export declare const cssVars: {
|
|
|
277
293
|
readonly '--hanzo-black': "#0A0A0B";
|
|
278
294
|
readonly '--hanzo-white': "#FFFFFF";
|
|
279
295
|
readonly '--white-05': "rgb(255 255 255 / .05)";
|
|
296
|
+
readonly '--white-06': "rgb(255 255 255 / .06)";
|
|
297
|
+
readonly '--white-08': "rgb(255 255 255 / .08)";
|
|
280
298
|
readonly '--white-10': "rgb(255 255 255 / .10)";
|
|
281
299
|
readonly '--white-15': "rgb(255 255 255 / .15)";
|
|
300
|
+
readonly '--white-16': "rgb(255 255 255 / .16)";
|
|
282
301
|
readonly '--white-20': "rgb(255 255 255 / .20)";
|
|
302
|
+
readonly '--white-22': "rgb(255 255 255 / .22)";
|
|
283
303
|
readonly '--white-30': "rgb(255 255 255 / .30)";
|
|
284
304
|
readonly '--white-40': "rgb(255 255 255 / .40)";
|
|
305
|
+
readonly '--white-55': "rgb(255 255 255 / .55)";
|
|
285
306
|
readonly '--white-60': "rgb(255 255 255 / .60)";
|
|
307
|
+
readonly '--white-78': "rgb(255 255 255 / .78)";
|
|
286
308
|
readonly '--white-80': "rgb(255 255 255 / .80)";
|
|
287
|
-
readonly '--background': "#
|
|
288
|
-
readonly '--foreground': "#
|
|
289
|
-
readonly '--card': "#
|
|
290
|
-
readonly '--card-foreground': "#
|
|
291
|
-
readonly '--popover': "#
|
|
292
|
-
readonly '--popover-foreground': "#
|
|
293
|
-
readonly '--primary': "#
|
|
294
|
-
readonly '--primary-
|
|
295
|
-
readonly '--
|
|
296
|
-
readonly '--secondary
|
|
297
|
-
readonly '--
|
|
298
|
-
readonly '--muted
|
|
299
|
-
readonly '--
|
|
300
|
-
readonly '--accent
|
|
309
|
+
readonly '--background': "#0a0a0a";
|
|
310
|
+
readonly '--foreground': "#fafafa";
|
|
311
|
+
readonly '--card': "#0f0f0f";
|
|
312
|
+
readonly '--card-foreground': "#fafafa";
|
|
313
|
+
readonly '--popover': "#0f0f0f";
|
|
314
|
+
readonly '--popover-foreground': "#fafafa";
|
|
315
|
+
readonly '--primary': "#fafafa";
|
|
316
|
+
readonly '--primary-hover': "#d4d4d4";
|
|
317
|
+
readonly '--primary-foreground': "#0a0a0a";
|
|
318
|
+
readonly '--secondary': "#262626";
|
|
319
|
+
readonly '--secondary-foreground': "#fafafa";
|
|
320
|
+
readonly '--muted': "#171717";
|
|
321
|
+
readonly '--muted-foreground': "#a3a3a3";
|
|
322
|
+
readonly '--accent': "#262626";
|
|
323
|
+
readonly '--accent-foreground': "#fafafa";
|
|
301
324
|
readonly '--destructive': "#666666";
|
|
302
|
-
readonly '--destructive-foreground': "#
|
|
303
|
-
readonly '--border': "
|
|
304
|
-
readonly '--
|
|
325
|
+
readonly '--destructive-foreground': "#fafafa";
|
|
326
|
+
readonly '--border': "var(--white-10)";
|
|
327
|
+
readonly '--border-strong': "var(--white-16)";
|
|
328
|
+
readonly '--border-control': "var(--neutral-500)";
|
|
329
|
+
readonly '--border-focus': "var(--neutral-400)";
|
|
330
|
+
readonly '--input': "var(--border-control)";
|
|
305
331
|
readonly '--ring': "var(--neutral-500)";
|
|
306
332
|
readonly '--brand': "#e4e4e7";
|
|
307
333
|
readonly '--brand-foreground': "#09090b";
|
|
308
334
|
readonly '--brand-muted': "#a3a3a3";
|
|
309
335
|
readonly '--black': "#000000";
|
|
310
|
-
readonly '--white': "#
|
|
336
|
+
readonly '--white': "#fafafa";
|
|
337
|
+
readonly '--selection': "var(--white-20)";
|
|
338
|
+
readonly '--glass': "var(--white-05)";
|
|
339
|
+
readonly '--glass-strong': "var(--white-08)";
|
|
311
340
|
readonly '--surface-page': "var(--background)";
|
|
312
341
|
readonly '--surface-card': "rgb(23 23 23 / .5)";
|
|
313
342
|
readonly '--surface-card-emphasis': "rgb(23 23 23 / .8)";
|
|
@@ -315,16 +344,13 @@ export declare const cssVars: {
|
|
|
315
344
|
readonly '--surface-overlay': "rgb(10 10 10 / .95)";
|
|
316
345
|
readonly '--surface-header': "rgb(0 0 0 / .7)";
|
|
317
346
|
readonly '--surface-scrim': "rgb(0 0 0 / .8)";
|
|
318
|
-
readonly '--border-hairline': "var(--neutral-800)";
|
|
319
|
-
readonly '--border-card': "var(--white-10)";
|
|
320
|
-
readonly '--border-strong': "var(--neutral-500)";
|
|
321
347
|
readonly '--surface-0': "var(--background)";
|
|
322
348
|
readonly '--surface-1': "var(--card)";
|
|
323
349
|
readonly '--surface-2': "var(--muted)";
|
|
324
350
|
readonly '--surface-3': "var(--secondary)";
|
|
325
|
-
readonly '--text-primary': "
|
|
326
|
-
readonly '--text-secondary': "var(--white-
|
|
327
|
-
readonly '--text-tertiary': "var(--white-
|
|
351
|
+
readonly '--text-primary': "#fafafa";
|
|
352
|
+
readonly '--text-secondary': "var(--white-78)";
|
|
353
|
+
readonly '--text-tertiary': "var(--white-55)";
|
|
328
354
|
readonly '--text-helper': "var(--muted-foreground)";
|
|
329
355
|
readonly '--text-disabled': "var(--white-30)";
|
|
330
356
|
readonly '--state-error': "#ef4444";
|
|
@@ -374,6 +400,7 @@ export declare const cssVars: {
|
|
|
374
400
|
readonly '--font-size-7xl': "var(--text-7xl)";
|
|
375
401
|
readonly '--font-size-8xl': "var(--text-8xl)";
|
|
376
402
|
readonly '--font-size-9xl': "var(--text-9xl)";
|
|
403
|
+
readonly '--text-control': "var(--text-sm)";
|
|
377
404
|
readonly '--weight-normal': "400";
|
|
378
405
|
readonly '--weight-medium': "500";
|
|
379
406
|
readonly '--weight-semibold': "600";
|
|
@@ -424,14 +451,19 @@ export declare const cssVars: {
|
|
|
424
451
|
readonly '--container-max': "80rem";
|
|
425
452
|
readonly '--container-prose': "48rem";
|
|
426
453
|
readonly '--container-wide': "72rem";
|
|
427
|
-
readonly '--gutter': "1rem";
|
|
454
|
+
readonly '--gutter': "max(1rem,var(--safe-left),var(--safe-right))";
|
|
428
455
|
readonly '--gutter-sm': "1.5rem";
|
|
429
456
|
readonly '--gutter-lg': "2rem";
|
|
430
|
-
readonly '--section-y': "
|
|
431
|
-
readonly '--section-y-lg': "
|
|
432
|
-
readonly '--hero-y': "
|
|
433
|
-
readonly '--hero-y-lg': "
|
|
434
|
-
readonly '--header-height': "
|
|
457
|
+
readonly '--section-y': "2.5rem";
|
|
458
|
+
readonly '--section-y-lg': "3.5rem";
|
|
459
|
+
readonly '--hero-y': "3rem";
|
|
460
|
+
readonly '--hero-y-lg': "4.5rem";
|
|
461
|
+
readonly '--header-height': "3.5rem";
|
|
462
|
+
readonly '--tap-target': "44px";
|
|
463
|
+
readonly '--safe-top': "env(safe-area-inset-top,0px)";
|
|
464
|
+
readonly '--safe-right': "env(safe-area-inset-right,0px)";
|
|
465
|
+
readonly '--safe-bottom': "env(safe-area-inset-bottom,0px)";
|
|
466
|
+
readonly '--safe-left': "env(safe-area-inset-left,0px)";
|
|
435
467
|
readonly '--grid-columns': "12";
|
|
436
468
|
readonly '--grid-gap': "var(--space-6)";
|
|
437
469
|
readonly '--grid-gap-tight': "var(--space-4)";
|
package/dist/tokens.gen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.gen.d.ts","sourceRoot":"","sources":["../src/tokens.gen.ts"],"names":[],"mappings":"AAIA,kEAAkE;AAClE,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"tokens.gen.d.ts","sourceRoot":"","sources":["../src/tokens.gen.ts"],"names":[],"mappings":"AAIA,kEAAkE;AAClE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFT,CAAA;AAEV,0EAA0E;AAC1E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Db,CAAA;AAEV,oEAAoE;AACpE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CV,CAAA;AAEV,8DAA8D;AAC9D,eAAO,MAAM,IAAI;;;;;;;;;;;;CAYP,CAAA;AAEV,kEAAkE;AAClE,eAAO,MAAM,MAAM;;;;;;;;;CAST,CAAA;AAEV,wEAAwE;AACxE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAiBZ,CAAA;AAEV,kEAAkE;AAClE,eAAO,MAAM,MAAM;;;;;;;;;;;CAWT,CAAA;AAEV,6DAA6D;AAC7D,eAAO,MAAM,MAAM;;;;;;;;;;;;CAYT,CAAA;AAEV,gEAAgE;AAChE,eAAO,MAAM,KAAK;;;;;;CAMR,CAAA;AAEV,8DAA8D;AAC9D,eAAO,MAAM,IAAI,IAEP,CAAA;AAEV,sFAAsF;AACtF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyPV,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAA"}
|