astralkit 0.2.0 → 0.3.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/CHANGELOG.md ADDED
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `astralkit` SDK package.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.3.1] — 2026-04-18
9
+
10
+ ### Added
11
+ - `peerDependencies` declaration: `tailwindcss >= 3.0.0`. Installing `astralkit` in a project without Tailwind now surfaces a clear peer-dep warning instead of silent breakage.
12
+ - File header comment on `astralkit-theme.css` explicitly marks it as the Tailwind v3 legacy file. Points readers at the `astralkit/theme-v3` export path and explains the v4 alternative.
13
+
14
+ ### Fixed
15
+ - No functional changes from `0.3.0` — this is a metadata + documentation patch.
16
+
17
+ ## [0.3.0] — 2026-04-18
18
+
19
+ ### Changed (breaking behavior fix)
20
+ - **`astralkit/theme` export now resolves to the Tailwind v4 file (`astralkit-theme-v4.css`).** Previously it pointed at `astralkit-theme.css` (the v3 `:root {}` file), which meant Tailwind v4 users were loading tokens that weren't registered with Tailwind's `@theme` system. Utilities like `bg-ak-primary` and `text-ak-text` were only working because the separate `astralkit-utilities.css` contains its own `@theme` blocks; the theme import was effectively dead weight.
21
+ - If you were relying on `@import "astralkit/theme"` resolving to the v3 `:root` syntax (e.g., in a Tailwind v3 project), import `astralkit/theme-v3` explicitly instead.
22
+ - If you're on Tailwind v4, no action needed — the new default is what you should have been getting all along.
23
+
24
+ ### Added
25
+ - New `astralkit/theme-v3` export — explicit path to the Tailwind v3 legacy file (`astralkit-theme.css`).
26
+ - `astralkit/theme-v4` export retained (unchanged) — still points at the v4 file. Existing imports keep working.
27
+ - v4 theme refinements across 12 commits of token architecture work (including rail/panel elevated color overrides, sidebar token tuning, avatar size/badge tokens, and Phase A token standardization).
28
+ - `primitives/.npmignore` — excludes `*.backup` and `*.pre-v4-split` scratch files from published tarballs. The `0.3.0` release removed ~220 kB of v3-migration scratch that was accidentally shipping in earlier versions.
29
+
30
+ ### Fixed
31
+ - Tailwind v3 plugin registration (via CLI init) now covers additional `plugins: [...]` formatting variants.
32
+
33
+ ## [0.2.0] — 2026-04-02
34
+
35
+ ### Added
36
+ - Initial public release on npm.
37
+ - Design tokens (theme CSS), utilities CSS, palette presets, primitives folder, `cn()` helper, Tailwind v3/v4 configs.
package/ai-rules.md CHANGED
@@ -11,6 +11,35 @@ AstralKit uses a **fluid responsive system** — typography and spacing scale co
11
11
 
12
12
  ---
13
13
 
14
+ ## DO NOT Use (Anti-Slop Rules)
15
+
16
+ These constraints prevent generic "AI slop" output. Follow them strictly.
17
+
18
+ **Never use raw Tailwind colors.** No `bg-white`, `text-gray-900`, `border-slate-200`. Always use `bg-ak-bg`, `text-ak-text`, `border-ak-border`. Raw colors break theming, dark mode, and palette switching.
19
+
20
+ **Never use Framer Motion.** CSS animations only. Use `ak-*` animation tokens (`duration-ak-base`, `ease-ak-default`) or effect primitives (`.ak-press`, `.ak-card-glow`).
21
+
22
+ **Never use shadows on containment surfaces.** No `shadow-md` on cards, panels, or dropdowns. Use `border border-ak-border` instead. Shadows are reserved for modals and floating elements only.
23
+
24
+ **Never use generic fonts.** The system fonts are DM Sans (`font-ak-sans`), DM Serif Display (`font-ak-serif`), and JetBrains Mono (`font-ak-mono`). Do not add Arial, Inter, Roboto, or system-ui.
25
+
26
+ **Never put gradients on every surface.** Gradients are for hero sections and marketing areas only (`.ak-mesh-dark`, `.ak-mesh-light`). Dashboard chrome, cards, and data views use flat semantic surfaces.
27
+
28
+ **Before generating a new component, look at existing code first.** Check the project for similar patterns. Match the exact spacing, border treatment, and typography of what already exists. Reference-based output is always better than description-based output.
29
+
30
+ ---
31
+
32
+ ## Size Hierarchy Rule
33
+
34
+ Create hierarchy through **extreme size jumps**, not subtle ones:
35
+ - **3x+ jumps create hierarchy** — 14px body → 48px heading = clear
36
+ - **1.5x jumps look muddy** — 14px body → 20px heading = unclear
37
+ - **Weight extremes work the same** — 400 vs 700 is clear, 400 vs 500 is muddy
38
+
39
+ Apply this to font sizes, spacing, and icon sizes. If two elements look similar, make one dramatically bigger or smaller — don't split the difference.
40
+
41
+ ---
42
+
14
43
  ## Token Naming
15
44
 
16
45
  All AstralKit tokens use the `ak-` prefix:
@@ -93,6 +122,51 @@ Static spacing: `*-ak-0` · `*-ak-px` · `*-ak-0_5` · `*-ak-1` · `*-ak-1_5` ·
93
122
 
94
123
  ---
95
124
 
125
+ ## The 60-30-10 Rule
126
+
127
+ Every screen must follow this color ratio:
128
+
129
+ - **60% — Neutral backgrounds** (`bg-ak-bg`, `bg-ak-surface`, `bg-ak-surface-2`). This is the dominant canvas.
130
+ - **30% — Secondary neutrals** (cards, borders, muted text, secondary surfaces). Uses `border-ak-border`, `text-ak-text-secondary`, `bg-ak-hover`.
131
+ - **10% — Accent** (`bg-ak-primary`, `text-ak-primary`, focus rings). CTAs, active states, links only.
132
+
133
+ ### Rules AI tools must follow:
134
+ 1. `bg-ak-primary` on a full-width section = rule broken. Accent should be buttons, badges, links — not backgrounds.
135
+ 2. Status colors (red/green/yellow) are NOT part of the accent budget. Keep them under 5%.
136
+ 3. One accent hue per screen. Don't mix primary blue buttons with teal links and purple icons.
137
+ 4. In dark mode, accent is MORE visible against dark surfaces — use even less.
138
+ 5. If more than 3 elements on screen use `bg-ak-primary` or `text-ak-primary`, it's too much.
139
+
140
+ ---
141
+
142
+ ## Dark Mode
143
+
144
+ AstralKit includes a complete dark mode. Add `.dark` class to `<html>` (standard with `next-themes`) or use `[data-theme="dark"]`.
145
+
146
+ All semantic tokens flip automatically — no per-component changes needed.
147
+
148
+ ### What changes:
149
+ - Backgrounds: light surfaces → dark surfaces (#111→#252)
150
+ - Text: dark text → light text (#f4f4f5)
151
+ - Borders: solid hex → alpha (`rgba(255,255,255,0.10)`) — adapts to any surface depth
152
+ - Elevation: shadows disappear → lighter surface tones indicate depth
153
+ - Accent: lightened for contrast (Tailwind 600→400 shift)
154
+ - Status colors: lightened (red gets biggest jump)
155
+ - Small shadows (`xs`, `sm`): removed. Only `md`+ for modals/sheets.
156
+
157
+ ### What stays:
158
+ - All spacing, typography, radius, layout tokens are unchanged
159
+ - Component structure is unchanged — only colors flip
160
+
161
+ ### For AI tools generating dark mode UI:
162
+ - Never use raw white (`#fff`) for body text — use `text-ak-text` (#f4f4f5)
163
+ - Reserve pure white for headings only, or trust `text-ak-text`
164
+ - Borders must be `border-ak-border` (alpha in dark mode) — never hardcode gray hex
165
+ - No `shadow-ak-sm` in dark mode — it renders as invisible. Use border instead
166
+ - Glass effects: use `bg-ak-surface-glass` (white tint in dark mode, not dark tint)
167
+
168
+ ---
169
+
96
170
  ## Semantic Colors
97
171
 
98
172
  Prefer AstralKit's semantic color tokens over raw Tailwind colors. This enables theming and dark mode.
@@ -102,14 +176,14 @@ Instead of: class="bg-white text-gray-900 border-gray-200"
102
176
  Prefer: class="bg-ak-bg text-ak-text border-ak-border"
103
177
  ```
104
178
 
105
- ### Background:
106
- `bg-ak-bg` · `bg-ak-surface` · `bg-ak-surface-2` · `bg-ak-hover` · `bg-ak-active` · `bg-ak-elevated`
107
-
108
- ### Richer surfaces:
109
- `bg-ak-surface-raised` · `bg-ak-surface-raised-soft` · `bg-ak-surface-glass` · `bg-ak-surface-glass-strong`
110
-
111
- ### Decorative highlights / loading:
112
- `ak-highlight-soft` · `ak-highlight-strong` · `ak-skeleton-base` · `ak-skeleton-shine`
179
+ ### Background:
180
+ `bg-ak-bg` · `bg-ak-surface` · `bg-ak-surface-2` · `bg-ak-hover` · `bg-ak-active` · `bg-ak-elevated`
181
+
182
+ ### Richer surfaces:
183
+ `bg-ak-surface-raised` · `bg-ak-surface-raised-soft` · `bg-ak-surface-glass` · `bg-ak-surface-glass-strong`
184
+
185
+ ### Decorative highlights / loading:
186
+ `ak-highlight-soft` · `ak-highlight-strong` · `ak-skeleton-base` · `ak-skeleton-shine`
113
187
 
114
188
  ### Text:
115
189
  `text-ak-text` · `text-ak-text-secondary` · `text-ak-text-muted` · `text-ak-text-disabled` · `text-ak-text-inverse`
@@ -149,10 +223,12 @@ Prefer: class="max-w-ak-page mx-auto px-ak-3"
149
223
 
150
224
  ### Max-widths: `max-w-ak-xs` · `sm` · `md` · `lg` · `xl` · `2xl` · `3xl` · `4xl` · `prose` · `page` (80rem)
151
225
  ### Heights: `h-ak-nav` (nav bar) · `h-ak-touch` / `w-ak-touch` (touch target)
226
+ ### Table rows: `h-ak-row-compact` (40px) · `h-ak-row-default` (48px) · `h-ak-row-comfortable` (52px)
227
+ ### Page margin: `px-ak-fl-page-margin` — fluid side padding (16px mobile → 80px desktop)
152
228
 
153
229
  ---
154
230
 
155
- ## Layout Primitives — Use Instead of Breakpoint Grids
231
+ ## Layout Primitives — Use Instead of Breakpoint Grids
156
232
 
157
233
  AstralKit provides breakpoint-free layout primitives:
158
234
 
@@ -166,94 +242,207 @@ AstralKit provides breakpoint-free layout primitives:
166
242
 
167
243
  ```
168
244
  Instead of: class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
169
- Prefer: class="ak-grid" style="--ak-grid-min: 280px"
170
- ```
171
-
172
- ---
173
-
174
- ## Visual Polish Primitives
175
-
176
- Use shared utilities for repeated surface and loading patterns instead of re-creating them in component CSS.
177
-
178
- - **`.ak-surface-raised`** — neutral elevated panel surface with border + shadow
179
- - **`.ak-surface-glass`** — translucent panel treatment with blur
180
- - **`.ak-sheen`** — reusable highlight overlay for cards/panels with pseudo-element
181
- - **`.ak-sheen-strong`** — stronger sheen variant
182
- - **`.ak-skeleton`** — shimmer loading block
183
- - **`.ak-skeleton-pill`** — pill-shaped skeleton
184
- - **`.ak-skeleton-circle`** — circular skeleton
185
- - **`.ak-card-shell`** — reusable card container primitive
186
- - **`.ak-card-shell-interactive`** — hover/focus lift for cards
187
- - **`.ak-card-shell-inner`** — internal vertical stack scaffold
188
- - **`.ak-card-shell-header`** — common card header layout with content + trailing action/badge
189
- - **`.ak-mobile-sheet-handle`** — standard grabber for bottom sheets and mobile drawers
190
-
191
- When to use shared utilities:
192
- - if the pattern is decorative and appears in multiple components
193
- - if the pattern depends on pseudo-elements or animation
194
- - if the pattern should inherit theme tokens and dark mode automatically
195
-
196
- Keep it component-local when:
197
- - the layout is unique to one component
198
- - the spacing/alignment logic is too specific to generalize cleanly
199
-
200
- ### Healthy System Language
201
-
202
- Aim for components to describe themselves with clear semantic composition:
203
-
204
- - **"This is a raised card shell"** → use `.ak-card-shell`
205
- - **"This card/panel lifts on interaction"** → add `.ak-card-shell-interactive`
206
- - **"This panel has a sheen"** → add `.ak-sheen` only when the surface should feel elevated or premium
207
- - **"This is a standard skeleton block"** → use `.ak-skeleton`
208
- - **"This bottom sheet should feel draggable"** → add `.ak-mobile-sheet-handle`
209
-
210
- This keeps visual polish reusable without making every component look overdesigned.
211
-
212
- ### Healthy Adoption Rules
213
-
214
- Use `.ak-card-shell` when:
215
- - the component is a bounded surface with border, radius, and elevation
216
- - multiple components need a consistent card/panel baseline
217
- - you want theming and dark mode to flow through shared tokens
218
-
219
- Use `.ak-sheen` when:
220
- - the surface is intentionally elevated, featured, or premium
221
- - the highlight improves depth without carrying meaning
222
- - the effect is subtle and optional
223
-
224
- Avoid `.ak-sheen` when:
225
- - the surface is already visually busy
226
- - the component is dense, data-heavy, or utilitarian enough that the effect becomes decorative noise
227
- - you would apply it to nearly every surface on the screen
228
-
229
- Use `.ak-skeleton` when:
230
- - the loading placeholder is generic and reusable
231
- - the component needs consistent loading behavior across the kit
232
- - the actual loading state is also exposed accessibly with status text or a live region
233
-
234
- Use `.ak-mobile-sheet-handle` when:
235
- - the surface is a mobile bottom sheet, drawer, or slide-up panel
236
- - the UI should communicate drag-to-dismiss affordance clearly
237
- - the handle should remain visually consistent across recurring sheet patterns
238
-
239
- Avoid `.ak-skeleton` when:
240
- - the component needs a very custom loading illustration or structure
241
- - the shimmer would interfere with readability or performance in dense contexts
242
-
243
- ### Preferred Composition Order
244
-
245
- When a component needs these patterns, compose them from broadest surface to narrowest enhancement:
246
-
247
- 1. Start with `.ak-card-shell` for the base container
248
- 2. Add `.ak-card-shell-interactive` only if hover/focus lift is meaningful
249
- 3. Add `.ak-sheen` only if the surface should feel highlighted
250
- 4. Use `.ak-skeleton` only on placeholder elements, not on the final loaded surface
251
-
252
- This preserves restraint while keeping the primitives easy to reach for.
253
-
254
- ---
255
-
256
- ## When Breakpoints ARE Acceptable
245
+ Prefer: class="ak-grid" style="--ak-grid-min: 280px"
246
+ ```
247
+
248
+ ---
249
+
250
+ ## Visual Polish Primitives
251
+
252
+ Use shared utilities for repeated surface and loading patterns instead of re-creating them in component CSS.
253
+
254
+ - **`.ak-surface-raised`** — neutral elevated panel surface with border + shadow
255
+ - **`.ak-surface-glass`** — translucent panel treatment with blur
256
+ - **`.ak-sheen`** — reusable highlight overlay for cards/panels with pseudo-element
257
+ - **`.ak-sheen-strong`** — stronger sheen variant
258
+ - **`.ak-skeleton`** — shimmer loading block
259
+ - **`.ak-skeleton-pill`** — pill-shaped skeleton
260
+ - **`.ak-skeleton-circle`** — circular skeleton
261
+ - **`.ak-card-shell`** — reusable card container primitive
262
+ - **`.ak-card-shell-interactive`** — hover/focus lift for cards
263
+ - **`.ak-card-shell-inner`** — internal vertical stack scaffold
264
+ - **`.ak-card-shell-header`** — common card header layout with content + trailing action/badge
265
+ - **`.ak-mobile-sheet-handle`** — standard grabber for bottom sheets and mobile drawers
266
+
267
+ When to use shared utilities:
268
+ - if the pattern is decorative and appears in multiple components
269
+ - if the pattern depends on pseudo-elements or animation
270
+ - if the pattern should inherit theme tokens and dark mode automatically
271
+
272
+ Keep it component-local when:
273
+ - the layout is unique to one component
274
+ - the spacing/alignment logic is too specific to generalize cleanly
275
+
276
+ ### Healthy System Language
277
+
278
+ Aim for components to describe themselves with clear semantic composition:
279
+
280
+ - **"This is a raised card shell"** → use `.ak-card-shell`
281
+ - **"This card/panel lifts on interaction"** → add `.ak-card-shell-interactive`
282
+ - **"This panel has a sheen"** → add `.ak-sheen` only when the surface should feel elevated or premium
283
+ - **"This is a standard skeleton block"** → use `.ak-skeleton`
284
+ - **"This bottom sheet should feel draggable"** → add `.ak-mobile-sheet-handle`
285
+
286
+ This keeps visual polish reusable without making every component look overdesigned.
287
+
288
+ ### Healthy Adoption Rules
289
+
290
+ Use `.ak-card-shell` when:
291
+ - the component is a bounded surface with border, radius, and elevation
292
+ - multiple components need a consistent card/panel baseline
293
+ - you want theming and dark mode to flow through shared tokens
294
+
295
+ Use `.ak-sheen` when:
296
+ - the surface is intentionally elevated, featured, or premium
297
+ - the highlight improves depth without carrying meaning
298
+ - the effect is subtle and optional
299
+
300
+ Avoid `.ak-sheen` when:
301
+ - the surface is already visually busy
302
+ - the component is dense, data-heavy, or utilitarian enough that the effect becomes decorative noise
303
+ - you would apply it to nearly every surface on the screen
304
+
305
+ Use `.ak-skeleton` when:
306
+ - the loading placeholder is generic and reusable
307
+ - the component needs consistent loading behavior across the kit
308
+ - the actual loading state is also exposed accessibly with status text or a live region
309
+
310
+ Use `.ak-mobile-sheet-handle` when:
311
+ - the surface is a mobile bottom sheet, drawer, or slide-up panel
312
+ - the UI should communicate drag-to-dismiss affordance clearly
313
+ - the handle should remain visually consistent across recurring sheet patterns
314
+
315
+ Avoid `.ak-skeleton` when:
316
+ - the component needs a very custom loading illustration or structure
317
+ - the shimmer would interfere with readability or performance in dense contexts
318
+
319
+ ### Preferred Composition Order
320
+
321
+ When a component needs these patterns, compose them from broadest surface to narrowest enhancement:
322
+
323
+ 1. Start with `.ak-card-shell` for the base container
324
+ 2. Add `.ak-card-shell-interactive` only if hover/focus lift is meaningful
325
+ 3. Add `.ak-sheen` only if the surface should feel highlighted
326
+ 4. Use `.ak-skeleton` only on placeholder elements, not on the final loaded surface
327
+
328
+ This preserves restraint while keeping the primitives easy to reach for.
329
+
330
+ ---
331
+
332
+ ## Premium Effects
333
+
334
+ Decorative CSS effects for hero sections, landing pages, and feature showcases. All are CSS-only utility classes.
335
+
336
+ ### Mesh Gradient Backgrounds
337
+ ```html
338
+ <!-- Dark hero with purple/blue/teal mesh -->
339
+ <section class="ak-mesh-dark">
340
+
341
+ <!-- Light page with subtle pastel wash -->
342
+ <section class="ak-mesh-light">
343
+
344
+ <!-- AstralKit branded (violet on deep purple) -->
345
+ <section class="ak-mesh-astral">
346
+ ```
347
+ Override colors via `--ak-mesh-color-1` through `--ak-mesh-color-4` and `--ak-mesh-base`.
348
+
349
+ ### Grain/Noise Overlay
350
+ Add film grain texture on top of gradients or solid backgrounds:
351
+ ```html
352
+ <section class="ak-mesh-dark ak-noise"> <!-- dark grain: overlay blend, 5% opacity -->
353
+ <section class="ak-mesh-light ak-noise-light"> <!-- light grain: multiply blend, 10% opacity -->
354
+ ```
355
+
356
+ ### Card Glow on Hover
357
+ ```html
358
+ <div class="ak-card-shell ak-card-glow"> <!-- accent-tinted glow -->
359
+ <div class="ak-card-shell ak-card-glow-neutral"> <!-- neutral glow, any theme -->
360
+ ```
361
+
362
+ ### Text Glow (dark backgrounds only)
363
+ ```html
364
+ <h1 class="ak-text-glow">Heading</h1> <!-- soft glow -->
365
+ <span class="ak-text-glow-intense">Accent word</span> <!-- neon, use sparingly -->
366
+ ```
367
+
368
+ ### Section Effects
369
+ ```html
370
+ <section class="ak-spotlight-section"> <!-- radial glow behind section -->
371
+ <div class="ak-section-fade"> <!-- gradient from bg to surface-2 -->
372
+ <div class="ak-section-fade-reverse"> <!-- gradient from surface-2 to bg -->
373
+ ```
374
+
375
+ ### Gradient Borders
376
+ ```html
377
+ <div class="ak-gradient-border"> <!-- static conic-gradient border -->
378
+ <div class="ak-animated-border"> <!-- rotating conic border (needs @property) -->
379
+ ```
380
+
381
+ ### Frosted Nav Bar
382
+ ```html
383
+ <nav class="ak-nav-frosted"> <!-- Apple-style backdrop-blur nav, auto dark mode -->
384
+ ```
385
+
386
+ ### Button Neon Glow
387
+ ```html
388
+ <button class="ak-btn-neon"> <!-- hover: glow + lift, active: settle -->
389
+ ```
390
+
391
+ ### Ambient Glow Behind Images
392
+ ```html
393
+ <div class="ak-ambient-glow"><img src="..." /></div>
394
+ ```
395
+
396
+ ### Spotlight Card (requires JS)
397
+ ```html
398
+ <div class="ak-spotlight-card"> <!-- cursor-following radial glow -->
399
+ ```
400
+ Needs JS to set `--ak-spotlight-x` / `--ak-spotlight-y` on mousemove.
401
+
402
+ ### Composing Effects
403
+ Layer multiple effects on a single section:
404
+ ```html
405
+ <section class="ak-mesh-dark ak-noise">
406
+ <div class="ak-card-shell ak-surface-glass ak-gradient-border ak-card-glow">
407
+ <h2 class="ak-text-glow">Feature</h2>
408
+ </div>
409
+ </section>
410
+ ```
411
+
412
+ ### Performance Rules
413
+ - Mesh gradients + noise: safe everywhere
414
+ - `backdrop-filter` (glass/frosted): limit to 1-2 per viewport
415
+ - `filter: blur()` (ambient glow): safe for 3-4 elements
416
+ - Animated border (`@property`): limit to 4-6 on screen
417
+ - `background-position` animation: one hero section only
418
+
419
+ ---
420
+
421
+ ## Density Modes
422
+
423
+ AstralKit supports three density levels. Wrap any container with the `data-ak-density` attribute to adjust spacing and control sizes inside it:
424
+
425
+ ```html
426
+ <!-- Compact: tighter spacing for data-heavy views -->
427
+ <div data-ak-density="compact">
428
+ <table>...</table>
429
+ </div>
430
+
431
+ <!-- Spacious: more breathing room for marketing/consumer -->
432
+ <section data-ak-density="spacious">
433
+ <div class="ak-grid">...</div>
434
+ </section>
435
+ ```
436
+
437
+ - **compact** — 25% tighter padding, 32px controls, 40px table rows. Best for admin tables, data grids, power-user dashboards.
438
+ - **comfortable** (default) — the base tokens. 40px controls, 48px table rows.
439
+ - **spacious** — 25% more padding, 48px controls, 56px table rows. Best for marketing pages, consumer-facing UI.
440
+
441
+ Density modes cascade — children inherit the overridden tokens automatically.
442
+
443
+ ---
444
+
445
+ ## When Breakpoints ARE Acceptable
257
446
 
258
447
  The only valid use of breakpoint prefixes is for **layout switches** that cannot be expressed fluidly:
259
448
 
@@ -281,10 +470,10 @@ These are binary layout decisions, not gradual scaling — fluid tokens can't re
281
470
  `ease-ak-default` · `ease-ak-in` · `ease-ak-out` · `ease-ak-spring` · `ease-ak-bounce`
282
471
 
283
472
  ### Line Height:
284
- `leading-ak-display` · `leading-ak-tighter` · `leading-ak-none` · `leading-ak-tight` · `leading-ak-snug` · `leading-ak-normal` · `leading-ak-relaxed` · `leading-ak-loose`
473
+ `leading-ak-display` · `leading-ak-tighter` · `leading-ak-none` · `leading-ak-tight` · `leading-ak-snug` · `leading-ak-normal` · `leading-ak-relaxed` · `leading-ak-prose` · `leading-ak-loose`
285
474
 
286
475
  ### Letter Spacing:
287
- `tracking-ak-tighter` · `tracking-ak-tight` · `tracking-ak-normal` · `tracking-ak-wide` · `tracking-ak-wider` · `tracking-ak-widest`
476
+ `tracking-ak-tighter` · `tracking-ak-tight` · `tracking-ak-subtle` · `tracking-ak-normal` · `tracking-ak-wide` · `tracking-ak-wider` · `tracking-ak-widest`
288
477
 
289
478
  ### Font Families:
290
479
  `font-ak-sans` · `font-ak-serif` · `font-ak-mono`
@@ -295,7 +484,52 @@ These are binary layout decisions, not gradual scaling — fluid tokens can't re
295
484
 
296
485
  For quick composite headings: `.ak-h1` through `.ak-h6` — sets font-size, line-height, letter-spacing, weight, and color in one class.
297
486
 
298
- Body presets: `.ak-body` · `.ak-body-secondary` · `.ak-small` · `.ak-caption` · `.ak-label`
487
+ Body presets: `.ak-body` · `.ak-body-secondary` · `.ak-small` · `.ak-caption`
488
+
489
+ Label presets (uppercase, wide tracking): `.ak-label` (default xs) · `.ak-label-xs` (10px) · `.ak-label-sm` (12px) · `.ak-label-md` (14px) · `.ak-label-lg` (16px) · `.ak-label-xl` (18px) · `.ak-label-2xl` (20px)
490
+
491
+ Display presets (hero marketing text, fluid): `.ak-display-sm` · `.ak-display-md` · `.ak-display-lg`
492
+
493
+ Dashboard presets: `.ak-kpi` (large hero number, 48px fluid, bold, tabular-nums) · `.ak-kpi-sm` (smaller stat, 30px fluid)
494
+
495
+ ---
496
+
497
+ ## Pixel-Perfect Rules
498
+
499
+ ### Nested Radius
500
+ When nesting rounded elements, inner radius = outer radius - padding gap.
501
+ ```
502
+ Container: rounded-ak-xl (16px), padding p-ak-2 (16px)
503
+ → Inner card: rounded-ak-md (8px) /* 16 - 8 ≈ 8 */
504
+
505
+ Container: rounded-ak-lg (12px), padding p-ak-1 (8px)
506
+ → Inner element: rounded-ak-sm (4px) /* 12 - 8 = 4 */
507
+ ```
508
+ If outer radius is unknown, use one step smaller from the radius scale.
509
+
510
+ ### Icon-Text Pairing
511
+ Match icon size to adjacent text for vertical alignment:
512
+ | Text size | Icon size | Classes |
513
+ |---|---|---|
514
+ | `text-ak-xs` / `text-ak-sm` | `size-ak-icon-sm` (16px) | Small UI, badges |
515
+ | `text-ak-base` | `size-ak-icon-md` (20px) | Default body, nav |
516
+ | `text-ak-lg` | `size-ak-icon-lg` (24px) | Section headers |
517
+ | `text-ak-xl`+ | `size-ak-icon-xl` (28px) | Page titles |
518
+
519
+ ### Active State
520
+ Use `.ak-press` on buttons and interactive cards for tactile feedback:
521
+ ```html
522
+ <button class="... ak-press">Click me</button>
523
+ ```
524
+ Applies `transform: scale(0.98)` on `:active`.
525
+
526
+ ### Font Weight Discipline
527
+ Use **2-3 font weights maximum** in any single view:
528
+ - **400 (Regular)** — body text, descriptions
529
+ - **500 (Medium)** — nav items, card titles, labels
530
+ - **600-700 (SemiBold/Bold)** — headings, CTAs, KPIs
531
+
532
+ Avoid using both 600 AND 700 in the same component — the difference is too subtle and creates visual noise.
299
533
 
300
534
  ---
301
535
 
@@ -311,6 +545,33 @@ Use `ak-focus-ring-inset` for elements inside panels where outward rings would c
311
545
 
312
546
  ---
313
547
 
548
+ ## Chart Colors
549
+
550
+ Six colorblind-safe chart colors (Tableau 10 derived). Use for data visualization series:
551
+
552
+ `bg-ak-chart-1` · `bg-ak-chart-2` · `bg-ak-chart-3` · `bg-ak-chart-4` · `bg-ak-chart-5` · `bg-ak-chart-6`
553
+
554
+ Also available as `text-ak-chart-*` (for SVG `stroke`/`fill` via `currentColor`) and `border-ak-chart-*`.
555
+
556
+ For single-series charts, use the primary color at decreasing opacity instead:
557
+ ```css
558
+ --chart-1: var(--color-ak-primary); /* 100% */
559
+ --chart-2: color-mix(in srgb, var(--color-ak-primary) 70%, transparent);
560
+ --chart-3: color-mix(in srgb, var(--color-ak-primary) 45%, transparent);
561
+ ```
562
+
563
+ ---
564
+
565
+ ## Numeric Typography
566
+
567
+ Use `ak-tabular-nums` on any element displaying numbers in columns (stat cards, tables, dashboards). This aligns digits vertically for easy scanning:
568
+
569
+ ```html
570
+ <span class="ak-tabular-nums text-ak-fl-2xl font-bold">$12,847.00</span>
571
+ ```
572
+
573
+ ---
574
+
314
575
  ## Quick Reference: Common Patterns
315
576
 
316
577
  ```html
@@ -337,3 +598,123 @@ Use `ak-focus-ring-inset` for elements inside panels where outward rings would c
337
598
  <nav class="fixed top-0 w-full bg-ak-bg/85 backdrop-blur-md z-(--z-ak-sticky) border-b border-ak-border">
338
599
  <div class="max-w-ak-page mx-auto px-ak-3 h-ak-nav flex items-center">
339
600
  ```
601
+
602
+ ---
603
+
604
+ ## Dashboard Component Patterns
605
+
606
+ ### Stat Card
607
+ ```html
608
+ <div class="border border-ak-border rounded-ak-lg p-ak-3 bg-ak-surface">
609
+ <p class="text-ak-sm text-ak-text-muted font-medium">Revenue</p>
610
+ <p class="text-ak-fl-2xl font-bold text-ak-text ak-tabular-nums mt-ak-0_5">$48,290</p>
611
+ <div class="flex items-center gap-ak-0_5 mt-ak-1">
612
+ <span class="text-ak-xs font-medium text-ak-success">+12.5%</span>
613
+ <span class="text-ak-xs text-ak-text-muted">vs last month</span>
614
+ </div>
615
+ </div>
616
+ ```
617
+
618
+ ### Data Table
619
+ ```html
620
+ <table class="w-full text-ak-sm">
621
+ <thead>
622
+ <tr class="border-b border-ak-border">
623
+ <th class="text-left py-ak-1_5 px-ak-2 text-ak-text-muted font-semibold text-ak-xs uppercase tracking-ak-wider">Name</th>
624
+ </tr>
625
+ </thead>
626
+ <tbody>
627
+ <tr class="border-b border-ak-border-subtle hover:bg-ak-hover transition-colors">
628
+ <td class="py-ak-1_5 px-ak-2 text-ak-text ak-tabular-nums">$1,240.00</td>
629
+ </tr>
630
+ </tbody>
631
+ </table>
632
+ ```
633
+
634
+ ### Form Input
635
+ ```html
636
+ <label class="ak-form-label mb-ak-0_5 block">Email</label>
637
+ <input type="email"
638
+ class="w-full h-ak-control-md px-ak-2 rounded-ak-md border border-ak-border bg-ak-bg text-ak-text text-ak-base placeholder:text-ak-text-placeholder ak-focus-ring" />
639
+ <p class="ak-helper mt-ak-0_5">We'll never share your email.</p>
640
+ ```
641
+
642
+ ### Badge
643
+ ```html
644
+ <span class="inline-flex items-center px-ak-1_5 py-ak-px rounded-ak-full text-ak-xs font-medium bg-ak-success-subtle text-ak-success-text">Active</span>
645
+ ```
646
+
647
+ ---
648
+
649
+ ## Curated Theme Palettes
650
+
651
+ AstralKit ships with a neutral black-and-white default. To re-theme, use preset palettes or override variables.
652
+
653
+ ### Method 1: Preset Palettes (easiest)
654
+ Import the palettes file and add a `data-ak-theme` attribute:
655
+ ```css
656
+ /* In globals.css */
657
+ @import "astralkit/palettes";
658
+ ```
659
+ ```html
660
+ <!-- On <html> or any container -->
661
+ <html data-ak-theme="ocean-blue">
662
+ ```
663
+ Available: `ocean-blue` · `forest-gold` · `minimal-violet` · `warm-earth` · `tangerine` · `slate-pro` · `emerald-saas` · `astral-violet` · `midnight` · `ember-dark` · `obsidian` · `deep-teal`
664
+
665
+ ### Method 2: Custom Override
666
+ Override these variables in your `globals.css` `@theme` block (v4) or `:root` (v3):
667
+ ```css
668
+ --color-ak-bg, --color-ak-surface, --color-ak-text, --color-ak-text-secondary,
669
+ --color-ak-primary, --color-ak-primary-hover, --color-ak-primary-active,
670
+ --color-ak-on-primary, --color-ak-border, --color-ak-border-subtle, --color-ak-border-strong
671
+ ```
672
+
673
+ ### Light Palettes
674
+
675
+ **AstralKit Default (Violet)**
676
+ `bg: #FAF9F7 · surface: #FFFFFF · text: #150A35 · primary: #6933FF · border: #E6E3EE`
677
+
678
+ **Ocean Blue** — Clean blue with coral accents
679
+ `bg: #FFFFFE · surface: #D8EEFE · text: #094067 · primary: #3DA9FC · accent: #EF4565`
680
+
681
+ **Forest & Gold** — Deep green with warm golden accents
682
+ `bg: #F2F7F5 · surface: #FFFFFF · text: #00473E · primary: #FAAE2B · accent: #FA5246`
683
+
684
+ **Minimal Violet** — Pure white with bold purple
685
+ `bg: #FFFFFE · surface: #D1D1E9 · text: #2B2C34 · primary: #6246EA · accent: #E45858`
686
+
687
+ **Warm Earth** — Teal primary with coral-red highlights
688
+ `bg: #F8F5F2 · surface: #FFFFFF · text: #232323 · primary: #078080 · accent: #F45D48`
689
+
690
+ **Tangerine** — Light gray with bold orange
691
+ `bg: #EFF0F3 · surface: #FFFFFE · text: #0D0D0D · primary: #FF8E3C · accent: #D9376E`
692
+
693
+ **Golden Sand** — Warm parchment with earthy tones
694
+ `bg: #F9F4EF · surface: #FFFFFE · text: #020826 · primary: #8C7851 · accent: #F25042`
695
+
696
+ **Lemon Breeze** — Clean white with yellow and teal
697
+ `bg: #FFFFFE · surface: #E3F6F5 · text: #272343 · primary: #FFD803 · accent: #272343`
698
+
699
+ **Slate Pro** — Professional gray with blue accent
700
+ `bg: #F8FAFC · surface: #FFFFFF · text: #0F172A · primary: #2563EB · accent: #7C3AED`
701
+
702
+ **Emerald SaaS** — Clean white with emerald green
703
+ `bg: #F9FAFB · surface: #FFFFFF · text: #111827 · primary: #059669 · accent: #F59E0B`
704
+
705
+ **Indigo Craft** — Warm neutral with indigo
706
+ `bg: #FAFAF9 · surface: #FFFFFF · text: #1C1917 · primary: #4F46E5 · accent: #EC4899`
707
+
708
+ ### Dark Palettes
709
+
710
+ **Midnight** — Deep dark with purple glow
711
+ `bg: #16161A · surface: #242629 · text: #FFFFFE · primary: #7F5AF0 · accent: #2CB67D`
712
+
713
+ **Ember Dark** — Dark with orange and pink
714
+ `bg: #0F0E17 · surface: #1A1925 · text: #FFFFFE · primary: #FF8906 · accent: #E53170`
715
+
716
+ **Deep Teal** — Dark ocean teal with golden accent
717
+ `bg: #004643 · surface: #001E1D · text: #FFFFFE · primary: #F9BC60 · accent: #E16162`
718
+
719
+ **Obsidian** — Pure dark SaaS standard
720
+ `bg: #09090B · surface: #18181B · text: #FAFAFA · primary: #3B82F6 · accent: #8B5CF6`