@jaimevalasek/aioson 1.30.0 → 1.30.2
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/CHANGELOG.md +18 -0
- package/docs/design-previews/cognitive-core-ui-auth.html +95 -0
- package/docs/design-previews/cognitive-core-ui-kanban.html +231 -0
- package/docs/design-previews/cognitive-core-ui-list-detail.html +174 -0
- package/docs/design-previews/cognitive-core-ui-preview.css +1315 -0
- package/docs/design-previews/cognitive-core-ui-settings.html +142 -0
- package/docs/design-previews/cognitive-core-ui-website.html +190 -1009
- package/docs/design-previews/cognitive-core-ui.html +281 -463
- package/docs/design-previews/index.html +83 -31
- package/package.json +1 -1
- package/src/constants.js +578 -514
- package/template/.aioson/docs/integrations/dashboard-app-form-publish-mapping.md +183 -0
- package/template/.aioson/docs/play/README.md +74 -0
- package/template/.aioson/docs/play/agent-usage-guide.md +112 -0
- package/template/.aioson/docs/play/app-compatibility-guide.md +117 -0
- package/template/.aioson/docs/play/auth-services-and-testing.md +235 -0
- package/template/.aioson/docs/play/llm-data-and-bindings.md +238 -0
- package/template/.aioson/docs/play/manifest-and-runtime.md +267 -0
- package/template/.aioson/docs/play/source-map.md +104 -0
- package/template/.aioson/skills/design/aurora-command-ui/SKILL.md +266 -243
- package/template/.aioson/skills/design/aurora-command-ui/references/art-direction.md +293 -293
- package/template/.aioson/skills/design/aurora-command-ui/references/components.md +827 -827
- package/template/.aioson/skills/design/aurora-command-ui/references/dashboards.md +250 -250
- package/template/.aioson/skills/design/aurora-command-ui/references/design-tokens.md +585 -585
- package/template/.aioson/skills/design/aurora-command-ui/references/motion.md +365 -365
- package/template/.aioson/skills/design/aurora-command-ui/references/patterns.md +485 -482
- package/template/.aioson/skills/design/aurora-command-ui/references/websites.md +386 -387
- package/template/.aioson/skills/design/bold-editorial-ui/SKILL.md +228 -205
- package/template/.aioson/skills/design/bold-editorial-ui/references/art-direction.md +338 -338
- package/template/.aioson/skills/design/bold-editorial-ui/references/components.md +977 -977
- package/template/.aioson/skills/design/bold-editorial-ui/references/dashboards.md +218 -218
- package/template/.aioson/skills/design/bold-editorial-ui/references/design-tokens.md +326 -326
- package/template/.aioson/skills/design/bold-editorial-ui/references/motion.md +461 -461
- package/template/.aioson/skills/design/bold-editorial-ui/references/patterns.md +293 -293
- package/template/.aioson/skills/design/bold-editorial-ui/references/websites.md +352 -352
- package/template/.aioson/skills/design/clean-saas-ui/SKILL.md +233 -210
- package/template/.aioson/skills/design/clean-saas-ui/references/art-direction.md +319 -319
- package/template/.aioson/skills/design/clean-saas-ui/references/components.md +365 -365
- package/template/.aioson/skills/design/clean-saas-ui/references/dashboards.md +196 -196
- package/template/.aioson/skills/design/clean-saas-ui/references/design-tokens.md +244 -244
- package/template/.aioson/skills/design/clean-saas-ui/references/motion.md +235 -235
- package/template/.aioson/skills/design/clean-saas-ui/references/patterns.md +215 -215
- package/template/.aioson/skills/design/clean-saas-ui/references/websites.md +295 -295
- package/template/.aioson/skills/design/cognitive-core-ui/SKILL.md +239 -203
- package/template/.aioson/skills/design/cognitive-core-ui/references/art-direction.md +339 -339
- package/template/.aioson/skills/design/cognitive-core-ui/references/components.md +417 -407
- package/template/.aioson/skills/design/cognitive-core-ui/references/dashboards.md +289 -272
- package/template/.aioson/skills/design/cognitive-core-ui/references/design-tokens.md +525 -524
- package/template/.aioson/skills/design/cognitive-core-ui/references/motion.md +279 -279
- package/template/.aioson/skills/design/cognitive-core-ui/references/patterns.md +355 -289
- package/template/.aioson/skills/design/cognitive-core-ui/references/websites.md +443 -437
- package/template/.aioson/skills/design/glassmorphism-ui/SKILL.md +245 -222
- package/template/.aioson/skills/design/glassmorphism-ui/references/art-direction.md +159 -159
- package/template/.aioson/skills/design/glassmorphism-ui/references/components.md +498 -498
- package/template/.aioson/skills/design/glassmorphism-ui/references/dashboards.md +236 -236
- package/template/.aioson/skills/design/glassmorphism-ui/references/design-tokens.md +274 -274
- package/template/.aioson/skills/design/glassmorphism-ui/references/motion.md +355 -355
- package/template/.aioson/skills/design/glassmorphism-ui/references/patterns.md +198 -198
- package/template/.aioson/skills/design/glassmorphism-ui/references/websites.md +307 -307
- package/template/.aioson/skills/design/interface-design/SKILL.md +68 -47
- package/template/.aioson/skills/design/interface-design/references/components-and-states.md +105 -105
- package/template/.aioson/skills/design/interface-design/references/design-directions.md +101 -101
- package/template/.aioson/skills/design/interface-design/references/handoff-and-quality.md +92 -71
- package/template/.aioson/skills/design/interface-design/references/intent-and-domain.md +74 -74
- package/template/.aioson/skills/design/interface-design/references/tokens-and-depth.md +173 -173
- package/template/.aioson/skills/design/neo-brutalist-ui/SKILL.md +236 -213
- package/template/.aioson/skills/design/neo-brutalist-ui/references/art-direction.md +228 -228
- package/template/.aioson/skills/design/neo-brutalist-ui/references/components.md +855 -855
- package/template/.aioson/skills/design/neo-brutalist-ui/references/dashboards.md +334 -334
- package/template/.aioson/skills/design/neo-brutalist-ui/references/design-tokens.md +342 -342
- package/template/.aioson/skills/design/neo-brutalist-ui/references/motion.md +286 -286
- package/template/.aioson/skills/design/neo-brutalist-ui/references/patterns.md +458 -458
- package/template/.aioson/skills/design/neo-brutalist-ui/references/websites.md +723 -723
- package/template/.aioson/skills/design/premium-command-center-ui/SKILL.md +83 -62
- package/template/.aioson/skills/design/premium-command-center-ui/references/operations.md +74 -74
- package/template/.aioson/skills/design/premium-command-center-ui/references/patterns.md +116 -116
- package/template/.aioson/skills/design/premium-command-center-ui/references/validation.md +47 -47
- package/template/.aioson/skills/design/premium-command-center-ui/references/visual-system.md +215 -215
- package/template/.aioson/skills/design/pt.squarespace.com/.skill-meta.json +31 -31
- package/template/.aioson/skills/design/pt.squarespace.com/SKILL.md +94 -66
- package/template/.aioson/skills/design/pt.squarespace.com/references/components.md +366 -366
- package/template/.aioson/skills/design/pt.squarespace.com/references/design-tokens.md +150 -150
- package/template/.aioson/skills/design/pt.squarespace.com/references/motion.md +270 -270
- package/template/.aioson/skills/design/pt.squarespace.com/references/patterns.md +189 -189
- package/template/.aioson/skills/design/pt.squarespace.com/references/websites.md +161 -161
- package/template/.aioson/skills/design/warm-craft-ui/SKILL.md +232 -209
- package/template/.aioson/skills/design/warm-craft-ui/references/art-direction.md +324 -324
- package/template/.aioson/skills/design/warm-craft-ui/references/components.md +508 -508
- package/template/.aioson/skills/design/warm-craft-ui/references/dashboards.md +223 -223
- package/template/.aioson/skills/design/warm-craft-ui/references/design-tokens.md +374 -374
- package/template/.aioson/skills/design/warm-craft-ui/references/motion.md +356 -356
- package/template/.aioson/skills/design/warm-craft-ui/references/patterns.md +288 -288
- package/template/.aioson/skills/design/warm-craft-ui/references/websites.md +289 -289
|
@@ -1,407 +1,417 @@
|
|
|
1
|
-
# Components — Cognitive Core UI
|
|
2
|
-
|
|
3
|
-
Read after `design-tokens.md`. All components use CSS variables and adapt to dark/light theme automatically.
|
|
4
|
-
|
|
5
|
-
Code examples use JSX inline style notation as **design specifications** — read property-value pairs as spec, then adapt syntax to the active stack (HTML, Vue, Blade, etc.). The shorthand `TT` means `{ transition: 'var(--transition-theme)' }`.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 1. Top Navigation Bar
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
┌──────────────────────────────────────────────────────┐
|
|
13
|
-
│ [Logo] AppName Link Link Link [☀] [Badge] │
|
|
14
|
-
│ SUBTITLE │
|
|
15
|
-
└──────────────────────────────────────────────────────┘
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
- Background: `var(--bg-void)`, `position: sticky`, `top: 0`, `z-index: var(--z-sticky)`
|
|
19
|
-
- Border-bottom: `1px solid var(--border-subtle)`
|
|
20
|
-
- Logo: `36px` square, `background: var(--accent-dim)`, `border: 1px solid var(--accent)`, `border-radius: var(--radius-md)`, icon in `var(--accent)`
|
|
21
|
-
- Brand name: `font-family: var(--font-mono)`, `--weight-bold`, `--text-base`, `--text-heading`, `letter-spacing:
|
|
22
|
-
- Subtitle: mono, `--text-xs`, `--text-muted`, uppercase,
|
|
23
|
-
- Nav links: `--text-base`. Active: `var(--text-accent)`. Inactive: `var(--text-secondary)`
|
|
24
|
-
- Theme toggle: `36px` button, `var(--bg-surface)`, `1px solid var(--border-subtle)` — only include when the product supports theme switching
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## 2. Stat Card
|
|
29
|
-
|
|
30
|
-
Large numeric readout with mono label. Used in stat rows at the top of pages.
|
|
31
|
-
|
|
32
|
-
```jsx
|
|
33
|
-
<div style={{
|
|
34
|
-
background: 'var(--bg-surface)', border: '1px solid var(--border-subtle)',
|
|
35
|
-
borderRadius: 'var(--radius-lg)', padding: 'var(--space-4) var(--space-5)',
|
|
36
|
-
|
|
37
|
-
}}>
|
|
38
|
-
<div style={{ fontFamily: 'var(--font-mono)', fontSize: 'var(--text-xs)', color: 'var(--text-muted)',
|
|
39
|
-
letterSpacing:
|
|
40
|
-
marginBottom: 'var(--space-1)' }}>LABEL</div>
|
|
41
|
-
<div style={{ display: 'flex', alignItems: 'baseline', gap: 4 }}>
|
|
42
|
-
<span style={{ fontFamily: 'var(--font-display)', fontSize: 'var(--text-4xl)', fontWeight: 700,
|
|
43
|
-
color: 'var(--text-heading)', lineHeight: 1, fontVariantNumeric: 'tabular-nums' }}>42</span>
|
|
44
|
-
<span style={{ fontSize: 'var(--text-lg)', color: 'var(--text-muted)' }}>/100</span>
|
|
45
|
-
</div>
|
|
46
|
-
<div style={{ fontSize: 'var(--text-sm)', color: 'var(--text-muted)', marginTop: 'var(--space-1)' }}>
|
|
47
|
-
subtitle text
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Accent variant: replace stat number `color` with `var(--semantic-green)`, `var(--semantic-red)`, or `var(--semantic-amber)`.
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## 3. Card (base)
|
|
57
|
-
|
|
58
|
-
The fundamental container.
|
|
59
|
-
|
|
60
|
-
```jsx
|
|
61
|
-
const cardStyle = {
|
|
62
|
-
background: 'var(--bg-surface)',
|
|
63
|
-
border: '1px solid var(--border-subtle)',
|
|
64
|
-
borderRadius: 'var(--radius-lg)',
|
|
65
|
-
padding: 'var(--space-5)',
|
|
66
|
-
transition: 'var(--transition-theme), border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease',
|
|
67
|
-
};
|
|
68
|
-
// Hover: borderColor → var(--border-medium), boxShadow → var(--shadow-glow), transform → translateY(-1px)
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## 4. Info Card (icon + title + description + quote)
|
|
74
|
-
|
|
75
|
-
Used in grids for features, capabilities, items.
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
┌─────────────────────────────────┐
|
|
79
|
-
│ 📈 [icon] Badge text │ ← header row
|
|
80
|
-
│ Card Title │ ← accent color
|
|
81
|
-
│ Description text that explains │ ← secondary color
|
|
82
|
-
│ ┃ "Optional quote text" │ ← muted, left border
|
|
83
|
-
└─────────────────────────────────┘
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
- Header: `display: flex; justify-content: space-between`. Icon left, badge right (mono, `--text-xs`, muted).
|
|
87
|
-
- Title: `--text-lg`, `--weight-semibold`, `color: var(--text-accent)`
|
|
88
|
-
- Description: `--text-base`, `--text-secondary`, `line-height: 1.5`
|
|
89
|
-
- Quote: italic, `--text-muted`, `border-left: 2px solid var(--accent-dim)`, `padding-left: var(--space-3)`
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## 5. Profile Header
|
|
94
|
-
|
|
95
|
-
Entity header with avatar, name, role, badges, and stat cards.
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
┌──────────────────────────────────────────────────────────┐
|
|
99
|
-
│ [Avatar 96px] BIG NAME [Badge] [Badge] │
|
|
100
|
-
│ ID: XXX Role (italic, accent) │
|
|
101
|
-
│ ✦ TAGLINE (mono, xs, muted) │
|
|
102
|
-
│ │
|
|
103
|
-
│ ┌─StatCard─┐ ┌─StatCard─┐ ┌─StatCard─┐ │
|
|
104
|
-
└──────────────────────────────────────────────────────────┘
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
- Avatar: `96px`, `border-radius: var(--radius-lg)`, `border: 2px solid var(--border-subtle)`
|
|
108
|
-
- Name: `--text-3xl`, `--weight-bold` by default, `--weight-black` only for a deliberately dramatic hero/profile treatment,
|
|
109
|
-
- Role: `color: var(--text-accent)`, `font-style: italic`, `--text-lg`
|
|
110
|
-
- Tagline: mono, `--text-xs`, `--text-muted`,
|
|
111
|
-
- ID: mono, `--text-xs`, muted,
|
|
112
|
-
- Stat cards: same as component 2, `min-width: 130px`
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## 6. Badge / Chip
|
|
117
|
-
|
|
118
|
-
Three variants — all use mono font, uppercase, `letter-spacing:
|
|
119
|
-
|
|
120
|
-
**Accent badge** (active states, primary tags):
|
|
121
|
-
```jsx
|
|
122
|
-
{ background: 'var(--accent-dim)', color: 'var(--accent)', border: '1px solid var(--border-accent)',
|
|
123
|
-
fontFamily: 'var(--font-mono)', fontSize: 'var(--text-xs)', fontWeight: 600,
|
|
124
|
-
letterSpacing:
|
|
125
|
-
padding: '2px 10px', borderRadius: 'var(--radius-sm)' }
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**Outline badge** (neutral tags):
|
|
129
|
-
```jsx
|
|
130
|
-
{ background: 'transparent', color: 'var(--text-secondary)', border: '1px solid var(--border-medium)',
|
|
131
|
-
/* same font styles as accent */ }
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
**Semantic badges** (status — swap vars):
|
|
135
|
-
- Success: `background: var(--semantic-green-dim)`, `color: var(--semantic-green)`, `border: 1px solid rgba(22,199,132,0.3)`
|
|
136
|
-
- Danger: `var(--semantic-red-dim)`, `var(--semantic-red)`, red border
|
|
137
|
-
- Warning: `var(--semantic-amber-dim)`, `var(--semantic-amber)`, amber border
|
|
138
|
-
- Info: `var(--semantic-blue-dim)`, `var(--semantic-blue)`, blue border
|
|
139
|
-
|
|
140
|
-
Status dot: `width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; margin-right: 5px`
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## 7. Tab Navigation
|
|
145
|
-
|
|
146
|
-
```jsx
|
|
147
|
-
<div style={{ display: 'flex', gap: 2, borderBottom: '1px solid var(--border-subtle)',
|
|
148
|
-
padding: '0 var(--space-6)', overflowX: 'auto', ...TT }}>
|
|
149
|
-
<button style={{
|
|
150
|
-
fontFamily: 'var(--font-body)', fontSize: 'var(--text-base)',
|
|
151
|
-
color: isActive ? 'var(--text-accent)' : 'var(--text-secondary)',
|
|
152
|
-
background: 'none', border: 'none',
|
|
153
|
-
padding: 'var(--space-3) var(--space-4)',
|
|
154
|
-
borderBottom: `2px solid ${isActive ? 'var(--accent)' : 'transparent'}`,
|
|
155
|
-
cursor: 'pointer', display: 'flex', alignItems: 'center', gap: 'var(--space-2)',
|
|
156
|
-
transition: 'color 150ms ease, border-color 150ms ease',
|
|
157
|
-
}}>
|
|
158
|
-
<span>icon</span> Label
|
|
159
|
-
</button>
|
|
160
|
-
</div>
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
Hover (non-active): `background: var(--bg-elevated)`, `border-radius: var(--radius-md) var(--radius-md) 0 0`
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## 8. Sidebar Tree
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
┌──────────────────┐
|
|
171
|
-
│ SECTION LABEL │ ← mono, xs, muted, uppercase, tracking-
|
|
172
|
-
│ ⊞ Item Active │ ← bg-elevated, border-left: 3px solid var(--accent), text-heading
|
|
173
|
-
│ 📊 Item │ ← text-secondary, transparent bg
|
|
174
|
-
│ 💬 Item │
|
|
175
|
-
│ │
|
|
176
|
-
│ SECTION LABEL │
|
|
177
|
-
│ ○ Category │ ← text-muted (inactive)
|
|
178
|
-
│ ● Category (on) │ ← text-accent (active)
|
|
179
|
-
└──────────────────┘
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Width: `200–220px`. Items: `padding: var(--space-2) var(--space-3)`, `border-radius: var(--radius-md)`.
|
|
183
|
-
Active item: `background: var(--bg-elevated)`, `border-left: 3px solid var(--accent)`.
|
|
184
|
-
Hover: `background: var(--bg-elevated)`, `color: var(--text-primary)`.
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## 9. Section Header
|
|
189
|
-
|
|
190
|
-
```jsx
|
|
191
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 'var(--space-3)',
|
|
192
|
-
padding: 'var(--space-6) 0 var(--space-4)' }}>
|
|
193
|
-
<span style={{ color: 'var(--accent)', fontSize: 'var(--text-lg)' }}>⚡</span>
|
|
194
|
-
<h2 style={{ fontFamily: 'var(--font-display)', fontSize: 'var(--text-xl)',
|
|
195
|
-
fontWeight: 700, color: 'var(--text-heading)', margin: 0 }}>Title</h2>
|
|
196
|
-
</div>
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## 10. Progress Bar
|
|
202
|
-
|
|
203
|
-
```jsx
|
|
204
|
-
<div style={{ height: 5, background: 'var(--bg-elevated)',
|
|
205
|
-
borderRadius: 'var(--radius-full)', overflow: 'hidden' }}>
|
|
206
|
-
<div style={{ height: '100%', borderRadius: 'var(--radius-full)',
|
|
207
|
-
background: color, width: `${pct}%`,
|
|
208
|
-
transition: 'width 300ms cubic-bezier(0.16, 1, 0.3, 1)' }} />
|
|
209
|
-
</div>
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
Colors: `var(--accent)`, `var(--semantic-green)`, `var(--semantic-red)`, `var(--semantic-amber)`, `var(--semantic-purple)`.
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## 11. Mode Panel (accent feature box)
|
|
217
|
-
|
|
218
|
-
Centered panel with radial glow — for "operating mode", featured status, or a primary CTA.
|
|
219
|
-
|
|
220
|
-
```
|
|
221
|
-
┌─────────── border-accent ──────────┐
|
|
222
|
-
│ ◆ BADGE PILL │
|
|
223
|
-
│ [Icon 56px] │ ← accent border + glow shadow
|
|
224
|
-
│ MONO LABEL │
|
|
225
|
-
│ Large Title │
|
|
226
|
-
│ "Subtitle italic" │
|
|
227
|
-
│ radial-gradient glow behind │
|
|
228
|
-
└────────────────────────────────────┘
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
- Border: `1px solid var(--border-accent)`, `border-radius: var(--radius-xl)`
|
|
232
|
-
- Background: `var(--bg-surface)` with `radial-gradient(
|
|
233
|
-
- Icon: `56px`, circular, `background: var(--accent-dim)`, `border: 1px solid var(--accent)`, `color: var(--accent)`
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
## 12. DNA Panel (sliders + tags)
|
|
238
|
-
|
|
239
|
-
Combined panel with labeled progress metrics and a tag group. The "personality" card of any entity.
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
┌─────────────────────────────────────────┐
|
|
243
|
-
│ ✦ PANEL TITLE │
|
|
244
|
-
│ │
|
|
245
|
-
│ LABEL ████████████████░░░░ 72% │
|
|
246
|
-
│ LABEL ██████████░░░░░░░░░ 58% │
|
|
247
|
-
│ LABEL █████████████░░░░░░ 85% │
|
|
248
|
-
│ │
|
|
249
|
-
│ [Badge] [Badge] [Badge] [Badge] │
|
|
250
|
-
└─────────────────────────────────────────┘
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
Each metric row: `display: flex; align-items: center; gap: var(--space-3)`.
|
|
254
|
-
Label: `min-width: 80px; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted)`.
|
|
255
|
-
Bar: `
|
|
256
|
-
Value: mono, `--text-sm`, `--text-secondary`, `min-width: 40px; text-align: right`.
|
|
257
|
-
Tags: flex-wrap, `gap: var(--space-2)` (use Badge/Chip component).
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## 13. Data Table
|
|
262
|
-
|
|
263
|
-
```
|
|
264
|
-
┌────────────────────────────────────────────────────┐
|
|
265
|
-
│ NAME ▲ CATEGORY STOCK STATUS PRICE │ ← mono header
|
|
266
|
-
├────────────────────────────────────────────────────┤
|
|
267
|
-
│ Product Name Laptops 23 [●OK] R$12k │
|
|
268
|
-
│ Product Name Phones 5 [●Crit] R$8k │
|
|
269
|
-
└────────────────────────────────────────────────────┘
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
**Premium table CSS (preferred — surfaced rows with hover):**
|
|
273
|
-
|
|
274
|
-
```css
|
|
275
|
-
table {
|
|
276
|
-
width: 100%;
|
|
277
|
-
border-collapse: separate;
|
|
278
|
-
border-spacing: 0 8px;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
thead th {
|
|
282
|
-
padding: 0 16px 8px;
|
|
283
|
-
font-family: var(--font-mono);
|
|
284
|
-
font-size: var(--text-xs);
|
|
285
|
-
letter-spacing:
|
|
286
|
-
text-transform: uppercase;
|
|
287
|
-
color: var(--text-muted);
|
|
288
|
-
text-align: left;
|
|
289
|
-
font-weight: 600;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
tbody td {
|
|
293
|
-
padding: 14px 16px;
|
|
294
|
-
background: var(--bg-surface);
|
|
295
|
-
border-top: 1px solid var(--border-subtle);
|
|
296
|
-
border-bottom: 1px solid var(--border-subtle);
|
|
297
|
-
color: var(--text-primary);
|
|
298
|
-
font-size: var(--text-base);
|
|
299
|
-
transition: var(--transition-theme);
|
|
300
|
-
font-variant-numeric: tabular-nums;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
tbody td:first-child {
|
|
304
|
-
border-left: 1px solid var(--border-subtle);
|
|
305
|
-
border-top-left-radius: var(--radius-lg);
|
|
306
|
-
border-bottom-left-radius: var(--radius-lg);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
tbody td:last-child {
|
|
310
|
-
border-right: 1px solid var(--border-subtle);
|
|
311
|
-
border-top-right-radius: var(--radius-lg);
|
|
312
|
-
border-bottom-right-radius: var(--radius-lg);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
tbody tr:hover td {
|
|
316
|
-
background: var(--bg-elevated);
|
|
317
|
-
border-color: var(--border-medium);
|
|
318
|
-
}
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
**Rules:**
|
|
322
|
-
- Never use `border-collapse: collapse` with `tr` backgrounds in this visual system — hover fills look like hard painted rectangles.
|
|
323
|
-
- If the existing stack forces `collapse`, style `td` cells as the surface, not `tr`.
|
|
324
|
-
- In brownfield: check if the table should stay a table or become a list-detail surface before rewriting.
|
|
325
|
-
|
|
326
|
-
**Failure signs to fix:**
|
|
327
|
-
- Serif fallback or typography mismatch inside the table only → font scope bug
|
|
328
|
-
- Row hover painting a hard rectangle → use `border-collapse: separate` + `td` surfaces
|
|
329
|
-
- Status chips squeezed between columns → widen the lane or reduce chip padding
|
|
330
|
-
- Numbers misaligned → add `font-variant-numeric: tabular-nums`
|
|
331
|
-
|
|
332
|
-
---
|
|
333
|
-
|
|
334
|
-
## 14. Form Elements
|
|
335
|
-
|
|
336
|
-
**Input:**
|
|
337
|
-
```jsx
|
|
338
|
-
{ background: 'var(--bg-surface)', border: '1px solid var(--border-medium)',
|
|
339
|
-
borderRadius: 'var(--radius-md)', padding: 'var(--space-2) var(--space-3)',
|
|
340
|
-
color: 'var(--text-primary)', fontSize: 'var(--text-base)',
|
|
341
|
-
fontFamily: 'var(--font-body)', outline: 'none', ...TT }
|
|
342
|
-
// Focus: borderColor → var(--border-accent-strong), boxShadow → 0 0 0 3px var(--accent-glow)
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
**Label:** mono label style (xs, muted, uppercase, tracking-
|
|
346
|
-
|
|
347
|
-
**Button primary:**
|
|
348
|
-
```jsx
|
|
349
|
-
{ background: 'var(--accent)', color: 'var(--text-inverse)', border: 'none',
|
|
350
|
-
borderRadius: 'var(--radius-md)', padding: 'var(--space-2) var(--space-5)',
|
|
351
|
-
fontFamily: 'var(--font-mono)', fontSize: 'var(--text-sm)', fontWeight: 600,
|
|
352
|
-
letterSpacing:
|
|
353
|
-
transition: 'background 150ms ease' }
|
|
354
|
-
// Hover: background → var(--accent-hover)
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
**Button secondary:**
|
|
358
|
-
```jsx
|
|
359
|
-
{ background: 'transparent', color: 'var(--text-secondary)',
|
|
360
|
-
border: '1px solid var(--border-medium)',
|
|
361
|
-
/* rest same as primary */
|
|
362
|
-
}
|
|
363
|
-
// Hover: borderColor → var(--border-accent), color → var(--text-accent)
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
---
|
|
367
|
-
|
|
368
|
-
## 15. Modal / Detail Overlay
|
|
369
|
-
|
|
370
|
-
```
|
|
371
|
-
┌─────────────── backdrop (rgba, z-modal) ───────────────┐
|
|
372
|
-
│ │
|
|
373
|
-
│ ┌─ Card max-w: 700px ─────────────────────────┐ │
|
|
374
|
-
│ │ HEADER: title + close button │ │
|
|
375
|
-
│ │ ───────────────────────── │ │
|
|
376
|
-
│ │ BODY: stat cards, progress, badges, etc. │ │
|
|
377
|
-
│ └─────────────────────────────────────────────┘ │
|
|
378
|
-
│ │
|
|
379
|
-
└──────────────────────────────────────────────────────────┘
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
- Backdrop: `rgba(0,0,0,0.6)`, centered flex, `z-index: var(--z-modal)`
|
|
383
|
-
- Content card: `var(--bg-base)`, `border: 1px solid var(--border-subtle)`, `border-radius: var(--radius-xl)`, `max-width: 700px`
|
|
384
|
-
- Header: flex, space-between, `padding: var(--space-5) var(--space-6)`, `border-bottom: 1px solid var(--border-subtle)`
|
|
385
|
-
- Body: `padding: var(--space-6)` — reuse stat cards, progress bars, badges, section headers
|
|
386
|
-
- Animation: `scaleIn 300ms cubic-bezier(0.16, 1, 0.3, 1)` (see motion.md)
|
|
387
|
-
|
|
388
|
-
---
|
|
389
|
-
|
|
390
|
-
## 16. Theme Toggle
|
|
391
|
-
|
|
392
|
-
```jsx
|
|
393
|
-
<button
|
|
394
|
-
onClick={() => setTheme(t => t === 'dark' ? 'light' : 'dark')}
|
|
395
|
-
style={{
|
|
396
|
-
width: 36, height: 36, borderRadius: 'var(--radius-md)',
|
|
397
|
-
border: '1px solid var(--border-subtle)', background: 'var(--bg-surface)',
|
|
398
|
-
color: 'var(--text-secondary)', cursor: 'pointer',
|
|
399
|
-
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
400
|
-
fontSize: '1rem', ...TT,
|
|
401
|
-
}}
|
|
402
|
-
>
|
|
403
|
-
{theme === 'dark' ? '☀' : '☾'}
|
|
404
|
-
</button>
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
Hover: `borderColor → var(--border-accent)`, `color → var(--accent)`.
|
|
1
|
+
# Components — Cognitive Core UI
|
|
2
|
+
|
|
3
|
+
Read after `design-tokens.md`. All components use CSS variables and adapt to dark/light theme automatically.
|
|
4
|
+
|
|
5
|
+
Code examples use JSX inline style notation as **design specifications** — read property-value pairs as spec, then adapt syntax to the active stack (HTML, Vue, Blade, etc.). The shorthand `TT` means `{ transition: 'var(--transition-theme)' }`.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Top Navigation Bar
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌──────────────────────────────────────────────────────┐
|
|
13
|
+
│ [Logo] AppName Link Link Link [☀] [Badge] │
|
|
14
|
+
│ SUBTITLE │
|
|
15
|
+
└──────────────────────────────────────────────────────┘
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- Background: `var(--bg-void)`, `position: sticky`, `top: 0`, `z-index: var(--z-sticky)`
|
|
19
|
+
- Border-bottom: `1px solid var(--border-subtle)`
|
|
20
|
+
- Logo: `36px` square, `background: var(--accent-dim)`, `border: 1px solid var(--accent)`, `border-radius: var(--radius-md)`, icon in `var(--accent)`
|
|
21
|
+
- Brand name: `font-family: var(--font-mono)`, `--weight-bold`, `--text-base`, `--text-heading`, `letter-spacing: 0`
|
|
22
|
+
- Subtitle: mono, `--text-xs`, `--text-muted`, uppercase, `letter-spacing: 0`
|
|
23
|
+
- Nav links: `--text-base`. Active: `var(--text-accent)`. Inactive: `var(--text-secondary)`
|
|
24
|
+
- Theme toggle: `36px` button, `var(--bg-surface)`, `1px solid var(--border-subtle)` — only include when the product supports theme switching
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 2. Stat Card
|
|
29
|
+
|
|
30
|
+
Large numeric readout with mono label. Used in stat rows at the top of pages.
|
|
31
|
+
|
|
32
|
+
```jsx
|
|
33
|
+
<div style={{
|
|
34
|
+
background: 'var(--bg-surface)', border: '1px solid var(--border-subtle)',
|
|
35
|
+
borderRadius: 'var(--radius-lg)', padding: 'var(--space-4) var(--space-5)',
|
|
36
|
+
width: '100%', minWidth: 0, ...TT,
|
|
37
|
+
}}>
|
|
38
|
+
<div style={{ fontFamily: 'var(--font-mono)', fontSize: 'var(--text-xs)', color: 'var(--text-muted)',
|
|
39
|
+
letterSpacing: 0, textTransform: 'uppercase', fontWeight: 600,
|
|
40
|
+
marginBottom: 'var(--space-1)' }}>LABEL</div>
|
|
41
|
+
<div style={{ display: 'flex', alignItems: 'baseline', gap: 4 }}>
|
|
42
|
+
<span style={{ fontFamily: 'var(--font-display)', fontSize: 'var(--text-4xl)', fontWeight: 700,
|
|
43
|
+
color: 'var(--text-heading)', lineHeight: 1, fontVariantNumeric: 'tabular-nums' }}>42</span>
|
|
44
|
+
<span style={{ fontSize: 'var(--text-lg)', color: 'var(--text-muted)' }}>/100</span>
|
|
45
|
+
</div>
|
|
46
|
+
<div style={{ fontSize: 'var(--text-sm)', color: 'var(--text-muted)', marginTop: 'var(--space-1)' }}>
|
|
47
|
+
subtitle text
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Accent variant: replace stat number `color` with `var(--semantic-green)`, `var(--semantic-red)`, or `var(--semantic-amber)`.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 3. Card (base)
|
|
57
|
+
|
|
58
|
+
The fundamental top-level container. Use cards for repeated items and primary sections; use inset rows, dividers, tables, and disclosure bodies inside cards.
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
const cardStyle = {
|
|
62
|
+
background: 'var(--bg-surface)',
|
|
63
|
+
border: '1px solid var(--border-subtle)',
|
|
64
|
+
borderRadius: 'var(--radius-lg)',
|
|
65
|
+
padding: 'var(--space-5)',
|
|
66
|
+
transition: 'var(--transition-theme), border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease',
|
|
67
|
+
};
|
|
68
|
+
// Hover: borderColor → var(--border-medium), boxShadow → var(--shadow-glow), transform → translateY(-1px)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 4. Info Card (icon + title + description + quote)
|
|
74
|
+
|
|
75
|
+
Used in grids for features, capabilities, items.
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
┌─────────────────────────────────┐
|
|
79
|
+
│ 📈 [icon] Badge text │ ← header row
|
|
80
|
+
│ Card Title │ ← accent color
|
|
81
|
+
│ Description text that explains │ ← secondary color
|
|
82
|
+
│ ┃ "Optional quote text" │ ← muted, left border
|
|
83
|
+
└─────────────────────────────────┘
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- Header: `display: flex; justify-content: space-between`. Icon left, badge right (mono, `--text-xs`, muted).
|
|
87
|
+
- Title: `--text-lg`, `--weight-semibold`, `color: var(--text-accent)`
|
|
88
|
+
- Description: `--text-base`, `--text-secondary`, `line-height: 1.5`
|
|
89
|
+
- Quote: italic, `--text-muted`, `border-left: 2px solid var(--accent-dim)`, `padding-left: var(--space-3)`
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 5. Profile Header
|
|
94
|
+
|
|
95
|
+
Entity header with avatar, name, role, badges, and stat cards.
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
┌──────────────────────────────────────────────────────────┐
|
|
99
|
+
│ [Avatar 96px] BIG NAME [Badge] [Badge] │
|
|
100
|
+
│ ID: XXX Role (italic, accent) │
|
|
101
|
+
│ ✦ TAGLINE (mono, xs, muted) │
|
|
102
|
+
│ │
|
|
103
|
+
│ ┌─StatCard─┐ ┌─StatCard─┐ ┌─StatCard─┐ │
|
|
104
|
+
└──────────────────────────────────────────────────────────┘
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- Avatar: `96px`, `border-radius: var(--radius-lg)`, `border: 2px solid var(--border-subtle)`
|
|
108
|
+
- Name: `--text-3xl`, `--weight-bold` by default, `--weight-black` only for a deliberately dramatic hero/profile treatment, `letter-spacing: 0`, `--text-heading`
|
|
109
|
+
- Role: `color: var(--text-accent)`, `font-style: italic`, `--text-lg`
|
|
110
|
+
- Tagline: mono, `--text-xs`, `--text-muted`, `letter-spacing: 0`, uppercase
|
|
111
|
+
- ID: mono, `--text-xs`, muted, placed in the metadata column or under the name; never absolutely positioned below the avatar
|
|
112
|
+
- Stat cards: same as component 2, `min-width: 130px`
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 6. Badge / Chip
|
|
117
|
+
|
|
118
|
+
Three variants — all use mono font, uppercase, `letter-spacing: 0`, `font-size: var(--text-xs)`.
|
|
119
|
+
|
|
120
|
+
**Accent badge** (active states, primary tags):
|
|
121
|
+
```jsx
|
|
122
|
+
{ background: 'var(--accent-dim)', color: 'var(--accent)', border: '1px solid var(--border-accent)',
|
|
123
|
+
fontFamily: 'var(--font-mono)', fontSize: 'var(--text-xs)', fontWeight: 600,
|
|
124
|
+
letterSpacing: 0, textTransform: 'uppercase',
|
|
125
|
+
padding: '2px 10px', borderRadius: 'var(--radius-sm)' }
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Outline badge** (neutral tags):
|
|
129
|
+
```jsx
|
|
130
|
+
{ background: 'transparent', color: 'var(--text-secondary)', border: '1px solid var(--border-medium)',
|
|
131
|
+
/* same font styles as accent */ }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Semantic badges** (status — swap vars):
|
|
135
|
+
- Success: `background: var(--semantic-green-dim)`, `color: var(--semantic-green)`, `border: 1px solid rgba(22,199,132,0.3)`
|
|
136
|
+
- Danger: `var(--semantic-red-dim)`, `var(--semantic-red)`, red border
|
|
137
|
+
- Warning: `var(--semantic-amber-dim)`, `var(--semantic-amber)`, amber border
|
|
138
|
+
- Info: `var(--semantic-blue-dim)`, `var(--semantic-blue)`, blue border
|
|
139
|
+
|
|
140
|
+
Status dot: `width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; margin-right: 5px`
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 7. Tab Navigation
|
|
145
|
+
|
|
146
|
+
```jsx
|
|
147
|
+
<div style={{ display: 'flex', gap: 2, borderBottom: '1px solid var(--border-subtle)',
|
|
148
|
+
padding: '0 var(--space-6)', overflowX: 'auto', ...TT }}>
|
|
149
|
+
<button style={{
|
|
150
|
+
fontFamily: 'var(--font-body)', fontSize: 'var(--text-base)',
|
|
151
|
+
color: isActive ? 'var(--text-accent)' : 'var(--text-secondary)',
|
|
152
|
+
background: 'none', border: 'none',
|
|
153
|
+
padding: 'var(--space-3) var(--space-4)',
|
|
154
|
+
borderBottom: `2px solid ${isActive ? 'var(--accent)' : 'transparent'}`,
|
|
155
|
+
cursor: 'pointer', display: 'flex', alignItems: 'center', gap: 'var(--space-2)',
|
|
156
|
+
transition: 'color 150ms ease, border-color 150ms ease',
|
|
157
|
+
}}>
|
|
158
|
+
<span>icon</span> Label
|
|
159
|
+
</button>
|
|
160
|
+
</div>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Hover (non-active): `background: var(--bg-elevated)`, `border-radius: var(--radius-md) var(--radius-md) 0 0`
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 8. Sidebar Tree
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
┌──────────────────┐
|
|
171
|
+
│ SECTION LABEL │ ← mono, xs, muted, uppercase, tracking-normal
|
|
172
|
+
│ ⊞ Item Active │ ← bg-elevated, border-left: 3px solid var(--accent), text-heading
|
|
173
|
+
│ 📊 Item │ ← text-secondary, transparent bg
|
|
174
|
+
│ 💬 Item │
|
|
175
|
+
│ │
|
|
176
|
+
│ SECTION LABEL │
|
|
177
|
+
│ ○ Category │ ← text-muted (inactive)
|
|
178
|
+
│ ● Category (on) │ ← text-accent (active)
|
|
179
|
+
└──────────────────┘
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Width: `200–220px`. Items: `padding: var(--space-2) var(--space-3)`, `border-radius: var(--radius-md)`.
|
|
183
|
+
Active item: `background: var(--bg-elevated)`, `border-left: 3px solid var(--accent)`.
|
|
184
|
+
Hover: `background: var(--bg-elevated)`, `color: var(--text-primary)`.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 9. Section Header
|
|
189
|
+
|
|
190
|
+
```jsx
|
|
191
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 'var(--space-3)',
|
|
192
|
+
padding: 'var(--space-6) 0 var(--space-4)' }}>
|
|
193
|
+
<span style={{ color: 'var(--accent)', fontSize: 'var(--text-lg)' }}>⚡</span>
|
|
194
|
+
<h2 style={{ fontFamily: 'var(--font-display)', fontSize: 'var(--text-xl)',
|
|
195
|
+
fontWeight: 700, color: 'var(--text-heading)', margin: 0 }}>Title</h2>
|
|
196
|
+
</div>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## 10. Progress Bar
|
|
202
|
+
|
|
203
|
+
```jsx
|
|
204
|
+
<div style={{ height: 5, background: 'var(--bg-elevated)',
|
|
205
|
+
borderRadius: 'var(--radius-full)', overflow: 'hidden' }}>
|
|
206
|
+
<div style={{ height: '100%', borderRadius: 'var(--radius-full)',
|
|
207
|
+
background: color, width: `${pct}%`,
|
|
208
|
+
transition: 'width 300ms cubic-bezier(0.16, 1, 0.3, 1)' }} />
|
|
209
|
+
</div>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Colors: `var(--accent)`, `var(--semantic-green)`, `var(--semantic-red)`, `var(--semantic-amber)`, `var(--semantic-purple)`.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 11. Mode Panel (accent feature box)
|
|
217
|
+
|
|
218
|
+
Centered panel with radial glow — for "operating mode", featured status, or a primary CTA.
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
┌─────────── border-accent ──────────┐
|
|
222
|
+
│ ◆ BADGE PILL │
|
|
223
|
+
│ [Icon 56px] │ ← accent border + glow shadow
|
|
224
|
+
│ MONO LABEL │
|
|
225
|
+
│ Large Title │
|
|
226
|
+
│ "Subtitle italic" │
|
|
227
|
+
│ radial-gradient glow behind │
|
|
228
|
+
└────────────────────────────────────┘
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
- Border: `1px solid var(--border-accent)`, `border-radius: var(--radius-xl)`
|
|
232
|
+
- Background: `var(--bg-surface)` with `radial-gradient(ellipse at 50% 0%, var(--accent-glow), transparent 70%)`
|
|
233
|
+
- Icon: `56px`, circular, `background: var(--accent-dim)`, `border: 1px solid var(--accent)`, `color: var(--accent)`
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 12. DNA Panel (sliders + tags)
|
|
238
|
+
|
|
239
|
+
Combined panel with labeled progress metrics and a tag group. The "personality" card of any entity.
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
┌─────────────────────────────────────────┐
|
|
243
|
+
│ ✦ PANEL TITLE │
|
|
244
|
+
│ │
|
|
245
|
+
│ LABEL ████████████████░░░░ 72% │
|
|
246
|
+
│ LABEL ██████████░░░░░░░░░ 58% │
|
|
247
|
+
│ LABEL █████████████░░░░░░ 85% │
|
|
248
|
+
│ │
|
|
249
|
+
│ [Badge] [Badge] [Badge] [Badge] │
|
|
250
|
+
└─────────────────────────────────────────┘
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Each metric row: `display: flex; align-items: center; gap: var(--space-3)`.
|
|
254
|
+
Label: `min-width: 80px; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted)`.
|
|
255
|
+
Bar: fills the remaining row width with `min-width: 0` on the metric row (use Progress Bar component).
|
|
256
|
+
Value: mono, `--text-sm`, `--text-secondary`, `min-width: 40px; text-align: right`.
|
|
257
|
+
Tags: flex-wrap, `gap: var(--space-2)` (use Badge/Chip component).
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## 13. Data Table
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
┌────────────────────────────────────────────────────┐
|
|
265
|
+
│ NAME ▲ CATEGORY STOCK STATUS PRICE │ ← mono header
|
|
266
|
+
├────────────────────────────────────────────────────┤
|
|
267
|
+
│ Product Name Laptops 23 [●OK] R$12k │
|
|
268
|
+
│ Product Name Phones 5 [●Crit] R$8k │
|
|
269
|
+
└────────────────────────────────────────────────────┘
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Premium table CSS (preferred — surfaced rows with hover):**
|
|
273
|
+
|
|
274
|
+
```css
|
|
275
|
+
table {
|
|
276
|
+
width: 100%;
|
|
277
|
+
border-collapse: separate;
|
|
278
|
+
border-spacing: 0 8px;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
thead th {
|
|
282
|
+
padding: 0 16px 8px;
|
|
283
|
+
font-family: var(--font-mono);
|
|
284
|
+
font-size: var(--text-xs);
|
|
285
|
+
letter-spacing: 0;
|
|
286
|
+
text-transform: uppercase;
|
|
287
|
+
color: var(--text-muted);
|
|
288
|
+
text-align: left;
|
|
289
|
+
font-weight: 600;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
tbody td {
|
|
293
|
+
padding: 14px 16px;
|
|
294
|
+
background: var(--bg-surface);
|
|
295
|
+
border-top: 1px solid var(--border-subtle);
|
|
296
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
297
|
+
color: var(--text-primary);
|
|
298
|
+
font-size: var(--text-base);
|
|
299
|
+
transition: var(--transition-theme);
|
|
300
|
+
font-variant-numeric: tabular-nums;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
tbody td:first-child {
|
|
304
|
+
border-left: 1px solid var(--border-subtle);
|
|
305
|
+
border-top-left-radius: var(--radius-lg);
|
|
306
|
+
border-bottom-left-radius: var(--radius-lg);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
tbody td:last-child {
|
|
310
|
+
border-right: 1px solid var(--border-subtle);
|
|
311
|
+
border-top-right-radius: var(--radius-lg);
|
|
312
|
+
border-bottom-right-radius: var(--radius-lg);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
tbody tr:hover td {
|
|
316
|
+
background: var(--bg-elevated);
|
|
317
|
+
border-color: var(--border-medium);
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**Rules:**
|
|
322
|
+
- Never use `border-collapse: collapse` with `tr` backgrounds in this visual system — hover fills look like hard painted rectangles.
|
|
323
|
+
- If the existing stack forces `collapse`, style `td` cells as the surface, not `tr`.
|
|
324
|
+
- In brownfield: check if the table should stay a table or become a list-detail surface before rewriting.
|
|
325
|
+
|
|
326
|
+
**Failure signs to fix:**
|
|
327
|
+
- Serif fallback or typography mismatch inside the table only → font scope bug
|
|
328
|
+
- Row hover painting a hard rectangle → use `border-collapse: separate` + `td` surfaces
|
|
329
|
+
- Status chips squeezed between columns → widen the lane or reduce chip padding
|
|
330
|
+
- Numbers misaligned → add `font-variant-numeric: tabular-nums`
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## 14. Form Elements
|
|
335
|
+
|
|
336
|
+
**Input:**
|
|
337
|
+
```jsx
|
|
338
|
+
{ background: 'var(--bg-surface)', border: '1px solid var(--border-medium)',
|
|
339
|
+
borderRadius: 'var(--radius-md)', padding: 'var(--space-2) var(--space-3)',
|
|
340
|
+
color: 'var(--text-primary)', fontSize: 'var(--text-base)',
|
|
341
|
+
fontFamily: 'var(--font-body)', outline: 'none', ...TT }
|
|
342
|
+
// Focus: borderColor → var(--border-accent-strong), boxShadow → 0 0 0 3px var(--accent-glow)
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
**Label:** mono label style (xs, muted, uppercase, tracking-normal). Place above input with `margin-bottom: var(--space-1)`.
|
|
346
|
+
|
|
347
|
+
**Button primary:**
|
|
348
|
+
```jsx
|
|
349
|
+
{ background: 'var(--accent)', color: 'var(--text-inverse)', border: 'none',
|
|
350
|
+
borderRadius: 'var(--radius-md)', padding: 'var(--space-2) var(--space-5)',
|
|
351
|
+
fontFamily: 'var(--font-mono)', fontSize: 'var(--text-sm)', fontWeight: 600,
|
|
352
|
+
letterSpacing: 0, textTransform: 'uppercase', cursor: 'pointer',
|
|
353
|
+
transition: 'background 150ms ease' }
|
|
354
|
+
// Hover: background → var(--accent-hover)
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**Button secondary:**
|
|
358
|
+
```jsx
|
|
359
|
+
{ background: 'transparent', color: 'var(--text-secondary)',
|
|
360
|
+
border: '1px solid var(--border-medium)',
|
|
361
|
+
/* rest same as primary */
|
|
362
|
+
}
|
|
363
|
+
// Hover: borderColor → var(--border-accent), color → var(--text-accent)
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## 15. Modal / Detail Overlay
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
┌─────────────── backdrop (rgba, z-modal) ───────────────┐
|
|
372
|
+
│ │
|
|
373
|
+
│ ┌─ Card max-w: 700px ─────────────────────────┐ │
|
|
374
|
+
│ │ HEADER: title + close button │ │
|
|
375
|
+
│ │ ───────────────────────── │ │
|
|
376
|
+
│ │ BODY: stat cards, progress, badges, etc. │ │
|
|
377
|
+
│ └─────────────────────────────────────────────┘ │
|
|
378
|
+
│ │
|
|
379
|
+
└──────────────────────────────────────────────────────────┘
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
- Backdrop: `rgba(0,0,0,0.6)`, centered flex, `z-index: var(--z-modal)`
|
|
383
|
+
- Content card: `var(--bg-base)`, `border: 1px solid var(--border-subtle)`, `border-radius: var(--radius-xl)`, `max-width: 700px`
|
|
384
|
+
- Header: flex, space-between, `padding: var(--space-5) var(--space-6)`, `border-bottom: 1px solid var(--border-subtle)`
|
|
385
|
+
- Body: `padding: var(--space-6)` — reuse stat cards, progress bars, badges, section headers
|
|
386
|
+
- Animation: `scaleIn 300ms cubic-bezier(0.16, 1, 0.3, 1)` (see motion.md)
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## 16. Theme Toggle
|
|
391
|
+
|
|
392
|
+
```jsx
|
|
393
|
+
<button
|
|
394
|
+
onClick={() => setTheme(t => t === 'dark' ? 'light' : 'dark')}
|
|
395
|
+
style={{
|
|
396
|
+
width: 36, height: 36, borderRadius: 'var(--radius-md)',
|
|
397
|
+
border: '1px solid var(--border-subtle)', background: 'var(--bg-surface)',
|
|
398
|
+
color: 'var(--text-secondary)', cursor: 'pointer',
|
|
399
|
+
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
400
|
+
fontSize: '1rem', ...TT,
|
|
401
|
+
}}
|
|
402
|
+
>
|
|
403
|
+
{theme === 'dark' ? '☀' : '☾'}
|
|
404
|
+
</button>
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Hover: `borderColor → var(--border-accent)`, `color → var(--accent)`.
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## Component layout integrity
|
|
412
|
+
|
|
413
|
+
- Any component that can contain long names, IDs, file paths, emails, or generated labels must include `min-width: 0` on the text column and either `overflow-wrap: anywhere` or `text-overflow: ellipsis`.
|
|
414
|
+
- Icon buttons use fixed square dimensions (`--control-sm` or `--control-md`) so labels and hover states cannot resize the toolbar.
|
|
415
|
+
- Repeated cards live in responsive grids. Do not manually place 3-4 cards in a fixed row unless a media query or `auto-fit` grid is present.
|
|
416
|
+
- When a component example uses inline style notation, translate numeric widths to CSS constraints (`minmax`, `min()`, `max-width`) before building production CSS.
|
|
417
|
+
- Do not put a `.card` inside another `.card`. Use `.inset-section`, table rows, `<details>`, or a modal body.
|