astralkit 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,34 @@
1
+ AstralKit License
2
+
3
+ Copyright (c) 2025-2026 Blue Beacon Creative LLC. All rights reserved.
4
+
5
+ This software and associated files (the "Software") are the proprietary
6
+ intellectual property of Blue Beacon Creative LLC. The Software is licensed,
7
+ not sold.
8
+
9
+ The design tokens and CSS utilities included in this package are freely usable
10
+ in any project that uses AstralKit components. Components, boosters, and
11
+ workflows installed via the AstralKit CLI are governed by the AstralKit End
12
+ User License Agreement.
13
+
14
+ PROHIBITED USES
15
+
16
+ You may NOT, without the express prior written consent of Blue Beacon Creative LLC:
17
+
18
+ 1. Use the Software's source code as training data, fine-tuning data, or input
19
+ for any artificial intelligence system, machine learning model, large language
20
+ model, neural network, or any automated system designed to generate code,
21
+ text, images, or other output.
22
+
23
+ 2. Resell, sublicense, or redistribute the Software as a standalone product,
24
+ design system, or token library.
25
+
26
+ 3. Build a competing product using the Software's design tokens, CSS
27
+ architecture, or utility system.
28
+
29
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ IMPLIED. IN NO EVENT SHALL BLUE BEACON CREATIVE LLC BE LIABLE FOR ANY CLAIM,
31
+ DAMAGES OR OTHER LIABILITY.
32
+
33
+ Full license terms: https://astralkit.com/license
34
+ Contact: hello@astralkit.com
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # astralkit
2
+
3
+ Design tokens, CSS variables, and utilities for [AstralKit](https://astralkit.com) UI components.
4
+
5
+ This package provides the foundation that all AstralKit components depend on:
6
+
7
+ - **Theme CSS** — `ak-*` design tokens (colors, spacing, typography, radius, shadows)
8
+ - **Utilities CSS** — Tailwind CSS utility class extensions
9
+ - **`cn()` helper** — Class merging utility (clsx + tailwind-merge)
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm install astralkit
15
+ ```
16
+
17
+ Or use the CLI which installs this automatically:
18
+
19
+ ```bash
20
+ npx @astralkit/cli init
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ **In your CSS:**
26
+ ```css
27
+ @import "tailwindcss";
28
+ @import "astralkit/theme";
29
+ @import "astralkit/utilities";
30
+ ```
31
+
32
+ **In your components:**
33
+ ```tsx
34
+ import { cn } from 'astralkit/utils'
35
+
36
+ export function Button({ className, ...props }) {
37
+ return <button className={cn('px-4 py-2 bg-ak-primary text-ak-on-primary', className)} {...props} />
38
+ }
39
+ ```
40
+
41
+ ## What's included
42
+
43
+ | Export | Description |
44
+ |---|---|
45
+ | `astralkit/theme` | CSS custom properties for all design tokens |
46
+ | `astralkit/utilities` | Tailwind CSS utility extensions |
47
+ | `astralkit/utils` | `cn()` class merging function |
48
+
49
+ ## Documentation
50
+
51
+ - [Getting Started](https://astralkit.com/documentation/quick-start)
52
+ - [Design Tokens](https://astralkit.com/documentation/design-tokens)
53
+ - [CSS Variables Reference](https://astralkit.com/documentation/css-variables-reference)
54
+ - [Theming & Customization](https://astralkit.com/documentation/theming-customization)
55
+
56
+ ## License
57
+
58
+ Proprietary — [AstralKit License](https://astralkit.com/license)
package/ai-rules.md ADDED
@@ -0,0 +1,339 @@
1
+ # AstralKit — AI Coding Rules
2
+
3
+ > These rules ensure AI coding tools generate correct, responsive AstralKit code.
4
+ > Drop this into your AI tool's config file, or let `astralkit init` do it for you.
5
+
6
+ ## Core Principle
7
+
8
+ AstralKit uses a **fluid responsive system** — typography and spacing scale continuously with viewport width via CSS `clamp()`. This eliminates breakpoints for most use cases.
9
+
10
+ **Prefer fluid tokens for scalable properties.** Breakpoint variants (sm:, md:, lg:, xl:) still work — but fluid tokens give you the same result in one class instead of four.
11
+
12
+ ---
13
+
14
+ ## Token Naming
15
+
16
+ All AstralKit tokens use the `ak-` prefix:
17
+ - Colors: `bg-ak-*`, `text-ak-*`, `border-ak-*`
18
+ - Spacing: `p-ak-*`, `m-ak-*`, `gap-ak-*`
19
+ - Fluid spacing: `p-ak-fl-*`, `m-ak-fl-*`, `gap-ak-fl-*`
20
+ - Fluid type: `text-ak-fl-*`
21
+ - Sizes: `size-ak-icon-*`, `size-ak-avatar-*`
22
+ - Radius: `rounded-ak-*`
23
+ - Shadows: `shadow-ak-*`
24
+ - Layout: `max-w-ak-*`, `h-ak-*`
25
+ - Z-index: `z-(--z-ak-*)`
26
+ - Animation: `duration-ak-*`, `ease-ak-*`
27
+
28
+ ---
29
+
30
+ ## Fluid Typography — `text-ak-fl-*`
31
+
32
+ For headings and body text, prefer fluid type tokens. These scale smoothly from mobile to desktop with zero breakpoints.
33
+
34
+ ```
35
+ Instead of: class="text-2xl md:text-3xl lg:text-5xl"
36
+ Prefer: class="text-ak-fl-5xl"
37
+ ```
38
+
39
+ ### Available fluid type tokens (small → large):
40
+ `text-ak-fl-xs` · `text-ak-fl-sm` · `text-ak-fl-base` · `text-ak-fl-lg` · `text-ak-fl-xl` · `text-ak-fl-2xl` · `text-ak-fl-3xl` · `text-ak-fl-4xl` · `text-ak-fl-5xl` · `text-ak-fl-6xl` · `text-ak-fl-7xl` · `text-ak-fl-8xl` · `text-ak-fl-9xl`
41
+
42
+ ### When to use static type (`text-ak-*`) instead:
43
+ - Small UI text that should NOT scale (button labels, badge text, nav links, form labels)
44
+ - Text inside compact components (cards, dropdowns, tooltips)
45
+
46
+ Static tokens: `text-ak-2xs` · `text-ak-xs` · `text-ak-sm` · `text-ak-base` · `text-ak-lg` · `text-ak-xl` · `text-ak-2xl`
47
+
48
+ ---
49
+
50
+ ## Fluid Spacing — Use `*-ak-fl-*` for Section-Level Spacing
51
+
52
+ For **section padding, large gaps, and vertical rhythm margins**, use fluid spacing tokens.
53
+
54
+ ```
55
+ Instead of: class="py-8 md:py-16 lg:py-24"
56
+ Prefer: class="py-ak-fl-xl-3xl"
57
+ ```
58
+
59
+ ### Single-step fluid spacing (scale within one size):
60
+ `*-ak-fl-3xs` · `*-ak-fl-2xs` · `*-ak-fl-xs` · `*-ak-fl-sm` · `*-ak-fl-md` · `*-ak-fl-lg` · `*-ak-fl-xl` · `*-ak-fl-2xl` · `*-ak-fl-3xl`
61
+
62
+ ### Space pairs (dramatic scaling — start small, end large):
63
+ `*-ak-fl-xs-md` · `*-ak-fl-xs-lg` · `*-ak-fl-sm-lg` · `*-ak-fl-sm-xl` · `*-ak-fl-md-xl` · `*-ak-fl-md-2xl` · `*-ak-fl-lg-2xl` · `*-ak-fl-xl-3xl`
64
+
65
+ Space pairs are ideal for section padding (e.g., `py-ak-fl-xl-3xl`), hero spacing, and large vertical gaps.
66
+
67
+ ### When to use static spacing (`*-ak-*`) instead:
68
+ - Small internal component spacing (button padding, icon gaps, card chrome)
69
+ - Spacing that should remain constant regardless of viewport
70
+
71
+ Static spacing: `*-ak-0` · `*-ak-px` · `*-ak-0_5` · `*-ak-1` · `*-ak-1_5` · `*-ak-2` · `*-ak-2_5` · `*-ak-3` · `*-ak-3_5` · `*-ak-4` · `*-ak-4_5` · `*-ak-5` · `*-ak-5_5` · `*-ak-6` · `*-ak-7` · `*-ak-8` · `*-ak-10` · `*-ak-12` · `*-ak-16` · `*-ak-20` · `*-ak-24`
72
+
73
+ ---
74
+
75
+ ## Decision Matrix: Fluid vs Static
76
+
77
+ | Element | Use Fluid | Use Static |
78
+ |---|---|---|
79
+ | Page headings (h1-h3) | `text-ak-fl-5xl` through `text-ak-fl-3xl` | — |
80
+ | Subheadings (h4-h6) | `text-ak-fl-2xl` through `text-ak-fl-lg` | — |
81
+ | Section intro paragraphs | `text-ak-fl-base` or `text-ak-fl-lg` | — |
82
+ | Section vertical padding | `py-ak-fl-xl-3xl` (space pair) | — |
83
+ | Grid gaps between sections | `gap-ak-fl-lg` or `gap-ak-fl-xl` | — |
84
+ | After-heading margins | `mb-ak-fl-sm` or `mb-ak-fl-md` | — |
85
+ | Feature card padding | `p-ak-fl-md` or `p-ak-fl-sm` | — |
86
+ | Hero/CTA inner padding | `p-ak-fl-lg-2xl` (space pair) | — |
87
+ | Button labels | — | `text-ak-base` |
88
+ | Nav link text | — | `text-ak-base` |
89
+ | Badge/tag text | — | `text-ak-xs` or `text-ak-sm` |
90
+ | Button padding | — | `px-ak-3 py-ak-1` |
91
+ | Icon gaps | — | `gap-ak-1` or `gap-ak-0_5` |
92
+ | Card internal spacing | — | `p-ak-2` or `p-ak-3` |
93
+
94
+ ---
95
+
96
+ ## Semantic Colors
97
+
98
+ Prefer AstralKit's semantic color tokens over raw Tailwind colors. This enables theming and dark mode.
99
+
100
+ ```
101
+ Instead of: class="bg-white text-gray-900 border-gray-200"
102
+ Prefer: class="bg-ak-bg text-ak-text border-ak-border"
103
+ ```
104
+
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`
113
+
114
+ ### Text:
115
+ `text-ak-text` · `text-ak-text-secondary` · `text-ak-text-muted` · `text-ak-text-disabled` · `text-ak-text-inverse`
116
+
117
+ ### Border:
118
+ `border-ak-border` · `border-ak-border-subtle` · `border-ak-border-strong` · `border-ak-border-focus`
119
+
120
+ ### Neutral scale (for decorative/data elements only):
121
+ `ak-neutral-0` through `ak-neutral-950` (11 shades)
122
+
123
+ ### Status:
124
+ `ak-success` · `ak-warning` · `ak-danger` · `ak-info` (each has base, `-subtle`, `-text` variants)
125
+
126
+ ---
127
+
128
+ ## Component Sizes — Use `size-ak-*`
129
+
130
+ ```
131
+ Instead of: class="w-6 h-6" (icon)
132
+ Prefer: class="size-ak-icon-lg"
133
+
134
+ Instead of: class="w-10 h-10" (avatar)
135
+ Prefer: class="size-ak-avatar-md"
136
+ ```
137
+
138
+ ### Icons: `size-ak-icon-xs` (12px) · `sm` (16px) · `md` (20px) · `lg` (24px) · `xl` (28px) · `2xl` (32px) · `3xl` (48px)
139
+ ### Avatars: `size-ak-avatar-sm` (32px) · `md` (40px) · `lg` (48px) · `xl` (64px) · `2xl` (96px) · `3xl` (128px)
140
+
141
+ ---
142
+
143
+ ## Layout — Use AK Layout Tokens
144
+
145
+ ```
146
+ Instead of: class="max-w-7xl mx-auto px-4"
147
+ Prefer: class="max-w-ak-page mx-auto px-ak-3"
148
+ ```
149
+
150
+ ### Max-widths: `max-w-ak-xs` · `sm` · `md` · `lg` · `xl` · `2xl` · `3xl` · `4xl` · `prose` · `page` (80rem)
151
+ ### Heights: `h-ak-nav` (nav bar) · `h-ak-touch` / `w-ak-touch` (touch target)
152
+
153
+ ---
154
+
155
+ ## Layout Primitives — Use Instead of Breakpoint Grids
156
+
157
+ AstralKit provides breakpoint-free layout primitives:
158
+
159
+ - **`ak-stack`** — Vertical spacing between children. Customize: `--ak-stack-gap`
160
+ - **`ak-cluster`** — Horizontal wrapping group (tags, nav). Customize: `--ak-cluster-gap`
161
+ - **`ak-grid`** — Auto-responsive grid (RAM pattern). Customize: `--ak-grid-min`
162
+ - **`ak-switcher`** — Horizontal → vertical at threshold. Customize: `--ak-switcher-threshold`
163
+ - **`ak-sidebar`** — Fixed sidebar + fluid main. Customize: `--ak-sidebar-width`
164
+ - **`ak-center`** — Centered content with max-width. Customize: `--ak-center-max`
165
+ - **`ak-cover`** — Viewport-height centered layout. Child: `.ak-cover-center`
166
+
167
+ ```
168
+ 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
257
+
258
+ The only valid use of breakpoint prefixes is for **layout switches** that cannot be expressed fluidly:
259
+
260
+ - `lg:grid-cols-2` — Switching between stacked and side-by-side layouts
261
+ - `md:flex` / `md:hidden` — Showing/hiding elements (mobile nav vs desktop nav)
262
+ - `sm:flex-row` — Changing flex direction at a specific point
263
+
264
+ These are binary layout decisions, not gradual scaling — fluid tokens can't replace them.
265
+
266
+ ---
267
+
268
+ ## Other Tokens
269
+
270
+ ### Border Radius:
271
+ `rounded-ak-none` · `rounded-ak-sm` · `rounded-ak-md` · `rounded-ak-lg` · `rounded-ak-xl` · `rounded-ak-2xl` · `rounded-ak-3xl` · `rounded-ak-full`
272
+
273
+ ### Shadows:
274
+ `shadow-ak-xs` · `shadow-ak-sm` · `shadow-ak-md` · `shadow-ak-lg` · `shadow-ak-xl` · `shadow-ak-2xl`
275
+
276
+ ### Z-Index (use arbitrary value syntax):
277
+ `z-(--z-ak-sticky)` · `z-(--z-ak-dropdown)` · `z-(--z-ak-overlay)` · `z-(--z-ak-modal)`
278
+
279
+ ### Animation:
280
+ `duration-ak-fast` · `duration-ak-base` · `duration-ak-slow`
281
+ `ease-ak-default` · `ease-ak-in` · `ease-ak-out` · `ease-ak-spring` · `ease-ak-bounce`
282
+
283
+ ### 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`
285
+
286
+ ### Letter Spacing:
287
+ `tracking-ak-tighter` · `tracking-ak-tight` · `tracking-ak-normal` · `tracking-ak-wide` · `tracking-ak-wider` · `tracking-ak-widest`
288
+
289
+ ### Font Families:
290
+ `font-ak-sans` · `font-ak-serif` · `font-ak-mono`
291
+
292
+ ---
293
+
294
+ ## Heading Presets (Utilities)
295
+
296
+ For quick composite headings: `.ak-h1` through `.ak-h6` — sets font-size, line-height, letter-spacing, weight, and color in one class.
297
+
298
+ Body presets: `.ak-body` · `.ak-body-secondary` · `.ak-small` · `.ak-caption` · `.ak-label`
299
+
300
+ ---
301
+
302
+ ## Focus & Accessibility
303
+
304
+ Always use `ak-focus-ring` on interactive elements instead of custom focus styles:
305
+ ```html
306
+ <button class="... ak-focus-ring">Click me</button>
307
+ <a href="#" class="... ak-focus-ring">Link</a>
308
+ ```
309
+
310
+ Use `ak-focus-ring-inset` for elements inside panels where outward rings would clip.
311
+
312
+ ---
313
+
314
+ ## Quick Reference: Common Patterns
315
+
316
+ ```html
317
+ <!-- Section -->
318
+ <section class="py-ak-fl-xl-3xl bg-ak-bg">
319
+ <div class="max-w-ak-page mx-auto px-ak-3 lg:px-ak-5">
320
+ <h2 class="text-ak-fl-4xl font-bold tracking-ak-tight leading-ak-tight mb-ak-fl-sm">
321
+ <p class="text-ak-fl-base text-ak-text-secondary leading-ak-relaxed mb-ak-fl-md">
322
+
323
+ <!-- Auto-responsive card grid -->
324
+ <div class="ak-grid" style="--ak-grid-min: 280px">
325
+ <div class="p-ak-fl-md rounded-ak-md bg-ak-surface border border-ak-border-subtle">
326
+
327
+ <!-- Button -->
328
+ <button class="bg-ak-neutral-900 text-white px-ak-3 py-ak-1 rounded-ak-full text-ak-base font-semibold hover:bg-ak-neutral-800 transition-colors ak-focus-ring">
329
+
330
+ <!-- Icon -->
331
+ <svg class="size-ak-icon-lg">
332
+
333
+ <!-- Avatar -->
334
+ <div class="size-ak-avatar-md rounded-ak-full">
335
+
336
+ <!-- Nav bar -->
337
+ <nav class="fixed top-0 w-full bg-ak-bg/85 backdrop-blur-md z-(--z-ak-sticky) border-b border-ak-border">
338
+ <div class="max-w-ak-page mx-auto px-ak-3 h-ak-nav flex items-center">
339
+ ```