@astralkit/mcp 1.7.1 → 1.9.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/CHANGELOG.md +27 -0
- package/README.md +8 -2
- package/dist/api.js +2 -2
- package/dist/audit.d.ts +22 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +402 -0
- package/dist/audit.js.map +1 -0
- package/dist/auth.d.ts +18 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +21 -13
- package/dist/auth.js.map +1 -1
- package/dist/browser.d.ts +1686 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +51 -0
- package/dist/browser.js.map +1 -0
- package/dist/capture.d.ts +38 -0
- package/dist/capture.d.ts.map +1 -0
- package/dist/capture.js +84 -0
- package/dist/capture.js.map +1 -0
- package/dist/data/art-direction.d.ts +2 -0
- package/dist/data/art-direction.d.ts.map +1 -0
- package/dist/data/art-direction.js +316 -0
- package/dist/data/art-direction.js.map +1 -0
- package/dist/data/crosswalk.d.ts +1 -1
- package/dist/data/crosswalk.d.ts.map +1 -1
- package/dist/data/crosswalk.js +135 -2
- package/dist/data/crosswalk.js.map +1 -1
- package/dist/data/polish.d.ts.map +1 -1
- package/dist/data/polish.js +28 -8
- package/dist/data/polish.js.map +1 -1
- package/dist/data/rules.d.ts +1 -1
- package/dist/data/rules.d.ts.map +1 -1
- package/dist/data/rules.js +55 -3
- package/dist/data/rules.js.map +1 -1
- package/dist/data/screens.d.ts.map +1 -1
- package/dist/data/screens.js +36 -4
- package/dist/data/screens.js.map +1 -1
- package/dist/data/theming.d.ts +2 -0
- package/dist/data/theming.d.ts.map +1 -0
- package/dist/data/theming.js +71 -0
- package/dist/data/theming.js.map +1 -0
- package/dist/data/visual.d.ts +7 -0
- package/dist/data/visual.d.ts.map +1 -0
- package/dist/data/visual.js +130 -0
- package/dist/data/visual.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +590 -44
- package/dist/server.js.map +1 -1
- package/package.json +6 -4
package/dist/data/crosswalk.js
CHANGED
|
@@ -9,6 +9,17 @@ const SEMANTIC = {
|
|
|
9
9
|
warning: ['amber', 'yellow', 'orange'],
|
|
10
10
|
info: ['blue', 'sky', 'cyan'],
|
|
11
11
|
primary: ['indigo', 'violet', 'purple', 'fuchsia'], // brand-accent colors → primary
|
|
12
|
+
pink: ['pink'],
|
|
13
|
+
};
|
|
14
|
+
const BARE_COLORS = {
|
|
15
|
+
'bg-white': 'bg-ak-bg',
|
|
16
|
+
'bg-black': 'bg-ak-inverse-surface',
|
|
17
|
+
'text-white': 'text-ak-text-inverse',
|
|
18
|
+
'text-black': 'text-ak-text',
|
|
19
|
+
'border-white': 'border-ak-bg',
|
|
20
|
+
'border-black': 'border-ak-text',
|
|
21
|
+
'ring-white': 'ring-ak-bg',
|
|
22
|
+
'ring-black': 'ring-ak-text',
|
|
12
23
|
};
|
|
13
24
|
// Tailwind spacing step (n × 0.25rem) → ak spacing token (matched by rem).
|
|
14
25
|
const SPACING = {
|
|
@@ -30,6 +41,9 @@ const TEXT_SIZE = {
|
|
|
30
41
|
* Returns the replacement string, or null if there's no confident mapping.
|
|
31
42
|
*/
|
|
32
43
|
export function nearestToken(cls) {
|
|
44
|
+
// Bare colors: bg-white, bg-black, text-white, text-black
|
|
45
|
+
if (BARE_COLORS[cls])
|
|
46
|
+
return BARE_COLORS[cls];
|
|
33
47
|
// Colors: <prefix>-<family>-<shade>
|
|
34
48
|
const color = cls.match(/^(bg|text|border|ring|fill|stroke|from|to|via|divide|outline|shadow|accent|caret|placeholder|decoration)-([a-z]+)-(\d{2,3})$/);
|
|
35
49
|
if (color) {
|
|
@@ -80,13 +94,100 @@ export function nearestToken(cls) {
|
|
|
80
94
|
}
|
|
81
95
|
export const CROSSWALK = `# Raw Tailwind → AstralKit Crosswalk (for tokenizing existing UI)
|
|
82
96
|
|
|
83
|
-
|
|
84
|
-
|
|
97
|
+
**Tokenization = replacing Tailwind utility CLASSES on the JSX elements, NOT writing CSS.**
|
|
98
|
+
|
|
99
|
+
When converting a non-AstralKit screen, replace raw Tailwind classes with the nearest \`ak-*\`
|
|
100
|
+
utility class directly on the \`className\` attribute. (\`validate_code\` also returns the exact
|
|
101
|
+
suggestion per flagged class — run it and apply each.)
|
|
102
|
+
|
|
103
|
+
## 🔴 What tokenization is NOT (the #1 mistake)
|
|
104
|
+
Tokenization is NOT writing CSS custom properties (\`var(--color-ak-*)\`, \`var(--spacing-ak-*)\`)
|
|
105
|
+
into a stylesheet. That creates a parallel styling system instead of using the library.
|
|
106
|
+
|
|
107
|
+
\`\`\`tsx
|
|
108
|
+
// ✅ CORRECT — utility class on the element
|
|
109
|
+
<div className="bg-ak-surface p-ak-3 rounded-ak-lg border border-ak-border">
|
|
110
|
+
|
|
111
|
+
// ❌ WRONG — CSS custom property in a stylesheet (globals.css, page.css, etc.)
|
|
112
|
+
// .my-card { background: var(--color-ak-surface); padding: var(--spacing-ak-3); }
|
|
113
|
+
// This is NOT tokenization. This is writing raw CSS that happens to reference ak variables.
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
**Rules:**
|
|
117
|
+
- NEVER create CSS/stylesheet files (.css) for tokenization — all styling belongs as
|
|
118
|
+
Tailwind utility classes on the JSX \`className\`.
|
|
119
|
+
- NEVER use \`var(--color-ak-*)\`, \`var(--spacing-ak-*)\`, \`var(--radius-ak-*)\`, etc. in
|
|
120
|
+
stylesheets — use the Tailwind class (\`bg-ak-surface\`, \`p-ak-3\`, \`rounded-ak-lg\`).
|
|
121
|
+
- NEVER add \`!important\` — if specificity is fighting you, you're in the wrong layer.
|
|
122
|
+
- **When the source already has external stylesheets** (page.css, styles.css, component.css,
|
|
123
|
+
or custom rules in globals.css): READ the stylesheet, EXTRACT each CSS property,
|
|
124
|
+
FIND the equivalent \`ak-*\` utility class using this crosswalk, APPLY those classes
|
|
125
|
+
to the JSX elements, then DELETE the stylesheet and remove its import. The goal is
|
|
126
|
+
zero custom CSS for visual styling — all of it lives on \`className\`.
|
|
127
|
+
- **globals.css should be minimal** — only AstralKit theme/utilities imports and, at most,
|
|
128
|
+
a few lines of CSS variable overrides (\`--color-ak-primary: ...\`) to customize the
|
|
129
|
+
palette. Component styling does NOT belong there.
|
|
130
|
+
|
|
131
|
+
### CSS property → ak-* class quick-reference (for extracting from stylesheets)
|
|
132
|
+
\`\`\`
|
|
133
|
+
background: var(--color-ak-surface) → bg-ak-surface
|
|
134
|
+
color: var(--color-ak-text) → text-ak-text
|
|
135
|
+
border-color: var(--color-ak-border) → border-ak-border
|
|
136
|
+
padding: var(--spacing-ak-3) → p-ak-3
|
|
137
|
+
gap: var(--spacing-ak-2) → gap-ak-2
|
|
138
|
+
border-radius: var(--radius-ak-lg) → rounded-ak-lg
|
|
139
|
+
font-size: var(--text-ak-base) → text-ak-base
|
|
140
|
+
font-size: 16px / 1rem → text-ak-base
|
|
141
|
+
font-size: 14px / 0.875rem → text-ak-sm
|
|
142
|
+
min-height: 3rem / 48px → min-h-ak-control-lg
|
|
143
|
+
width: 3rem / height: 3rem → size-ak-avatar-lg
|
|
144
|
+
\`\`\`
|
|
145
|
+
|
|
146
|
+
## What properly tokenized code looks like
|
|
147
|
+
AstralKit's own library components are the gold standard. In a properly tokenized file:
|
|
148
|
+
- Every element's \`className\` uses \`ak-*\` tokens for ALL spacing, colors, radii, typography
|
|
149
|
+
- There is NO external stylesheet — zero \`.css\` files for component styling
|
|
150
|
+
- There are NO CSS custom property references (\`var(--color-ak-*)\`) outside \`globals.css\`
|
|
151
|
+
- \`globals.css\` contains ONLY the theme/utilities imports and optional palette overrides
|
|
152
|
+
- All visual nuance lives on the markup via utility classes — the code reads as a recipe
|
|
153
|
+
|
|
154
|
+
Example of a properly tokenized stat card:
|
|
155
|
+
\`\`\`tsx
|
|
156
|
+
<div className="rounded-ak-xl border border-ak-border bg-ak-elevated p-ak-3">
|
|
157
|
+
<p className="text-ak-xs font-medium uppercase tracking-ak-wide text-ak-text-secondary">
|
|
158
|
+
Total Revenue
|
|
159
|
+
</p>
|
|
160
|
+
<p className="mt-ak-1 text-ak-3xl font-bold text-ak-text tabular-nums">$45,231</p>
|
|
161
|
+
<span className="mt-ak-0_5 inline-flex rounded-ak-full bg-ak-success-subtle px-ak-1 py-ak-0_5 text-ak-xs font-semibold text-ak-success-text">
|
|
162
|
+
+20.1%
|
|
163
|
+
</span>
|
|
164
|
+
</div>
|
|
165
|
+
\`\`\`
|
|
166
|
+
|
|
167
|
+
This is the taste level: proper hierarchy (3xl value, xs label), the ak-* rhythm, semantic
|
|
168
|
+
surfaces and status colors, no raw Tailwind, no CSS file, no inline styles.
|
|
169
|
+
|
|
170
|
+
### Example: extracting from an existing stylesheet
|
|
171
|
+
If the source has \`import './card.css'\` and \`card.css\` contains:
|
|
172
|
+
\`\`\`css
|
|
173
|
+
.stat-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 0.75rem; padding: 1rem; }
|
|
174
|
+
.stat-label { font-size: 0.75rem; color: #737373; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
175
|
+
.stat-value { font-size: 1.5rem; font-weight: 700; color: #171717; }
|
|
176
|
+
\`\`\`
|
|
177
|
+
The correct tokenization is:
|
|
178
|
+
1. Map each property → \`bg-ak-elevated\`, \`border border-ak-border\`, \`rounded-ak-lg\`, \`p-ak-2\`,
|
|
179
|
+
\`text-ak-xs text-ak-text-secondary uppercase tracking-ak-wide\`, \`text-ak-2xl font-bold text-ak-text\`
|
|
180
|
+
2. Apply those classes to the JSX elements that used \`.stat-card\`, \`.stat-label\`, \`.stat-value\`
|
|
181
|
+
3. DELETE \`card.css\` and remove the \`import './card.css'\` line
|
|
182
|
+
4. The result is zero CSS, all styling on \`className\`
|
|
85
183
|
|
|
86
184
|
## Colors
|
|
87
185
|
| Raw Tailwind | AstralKit |
|
|
88
186
|
|---|---|
|
|
89
187
|
| \`bg-white\`, \`bg-gray-50\` | \`bg-ak-bg\` |
|
|
188
|
+
| \`bg-black\` | \`bg-ak-inverse-surface\` |
|
|
189
|
+
| \`text-white\` | \`text-ak-text-inverse\` |
|
|
190
|
+
| \`text-black\` | \`text-ak-text\` |
|
|
90
191
|
| \`bg-gray-100\` / \`bg-gray-200\` | \`bg-ak-surface\` / \`bg-ak-surface-2\` |
|
|
91
192
|
| \`bg-gray-800\`/\`-900\`/\`-950\` (dark buttons) | \`bg-ak-primary\` (+ \`hover:bg-ak-primary-hover\`, \`text-ak-on-primary\`) |
|
|
92
193
|
| \`text-gray-900\` / \`-600,-500\` / \`-400\` | \`text-ak-text\` / \`text-ak-text-secondary\` / \`text-ak-text-muted\` |
|
|
@@ -105,8 +206,40 @@ When converting a non-AstralKit screen, replace raw Tailwind with the nearest \`
|
|
|
105
206
|
\`rounded-lg\`→\`rounded-ak-lg\`, \`rounded-xl\`→\`rounded-ak-xl\`, \`rounded-full\`→\`rounded-ak-full\` · \`text-sm\`→\`text-ak-sm\`, \`text-2xl\`→\`text-ak-2xl\` (body stays \`text-ak-base\` min).
|
|
106
207
|
|
|
107
208
|
## Also when tokenizing
|
|
209
|
+
- ALL styling goes on \`className\` — never write component styling to globals.css, page.css,
|
|
210
|
+
or any stylesheet. If the source has external stylesheets with visual rules, EXTRACT the
|
|
211
|
+
properties, CONVERT each to the nearest \`ak-*\` utility class, APPLY them to the JSX
|
|
212
|
+
elements, DELETE the stylesheet file, and remove the import. globals.css keeps only the
|
|
213
|
+
theme/utilities imports + optional palette overrides.
|
|
108
214
|
- Swap any icon library / inline \`<svg>\` UI icons → \`@phosphor-icons/react\` (confirm names via get_icons). Brand logos → search_logos.
|
|
109
215
|
- Raise sub-16px body text to \`text-ak-base\`; add \`focus-visible\` rings and 48px touch targets.
|
|
110
216
|
- Rebuild charts with the chart recipe (definite height + \`ak-chart-*\`). Add empty/loading/error states.
|
|
217
|
+
|
|
218
|
+
## Dark mode
|
|
219
|
+
AstralKit themes are structural — set \`data-ak-theme="dark"\` on the root (or a section)
|
|
220
|
+
and the SAME semantic tokens flip to dark values automatically. You do NOT need a separate
|
|
221
|
+
dark-mode crosswalk:
|
|
222
|
+
| Token | Light | Dark |
|
|
223
|
+
|---|---|---|
|
|
224
|
+
| \`bg-ak-bg\` | near-white | near-black |
|
|
225
|
+
| \`bg-ak-surface\` | light gray | dark gray |
|
|
226
|
+
| \`text-ak-text\` | near-black | near-white |
|
|
227
|
+
| \`border-ak-border\` | light gray | dark gray |
|
|
228
|
+
The mapping is the same: \`bg-gray-50\` → \`bg-ak-bg\` whether the source is a light or dark
|
|
229
|
+
app. The theme attribute does the flipping. **PRESERVE the source theme** — if the app is dark,
|
|
230
|
+
set \`data-ak-theme="dark"\` and use the same semantic tokens (they auto-adapt). Never map a
|
|
231
|
+
dark source to light tokens; that breaks the design.
|
|
232
|
+
|
|
233
|
+
## CSS Modules (\`*.module.css\`)
|
|
234
|
+
Treat CSS modules exactly like any other stylesheet: READ the file, EXTRACT each CSS property,
|
|
235
|
+
FIND the equivalent \`ak-*\` utility class, APPLY the classes to the JSX elements, DELETE the
|
|
236
|
+
\`.module.css\` file, and remove the import + all \`styles.*\` references. Replace
|
|
237
|
+
\`className={styles.card}\` with \`className="bg-ak-elevated rounded-ak-xl ..."\`.
|
|
238
|
+
|
|
239
|
+
## \`@apply\` directives
|
|
240
|
+
If the source uses \`@apply\` in CSS (e.g. \`@apply p-4 bg-white rounded-lg\`), extract the
|
|
241
|
+
utilities listed, convert each to its \`ak-*\` equivalent, apply them to the JSX \`className\`,
|
|
242
|
+
and delete the CSS rule. NEVER convert \`@apply p-4\` to \`@apply p-ak-2\` — the goal is zero
|
|
243
|
+
CSS for component styling. All styling belongs on the element's \`className\`.
|
|
111
244
|
`;
|
|
112
245
|
//# sourceMappingURL=crosswalk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crosswalk.js","sourceRoot":"","sources":["../../src/data/crosswalk.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,gFAAgF;AAChF,2FAA2F;AAE3F,MAAM,aAAa,GAAG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,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqJxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polish.d.ts","sourceRoot":"","sources":["../../src/data/polish.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,cAAc;IAC7B,gGAAgG;IAChG,QAAQ,EAAE,MAAM,CAAC;IACjB,kIAAkI;IAClI,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAKD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAsJxD,CAAC;AAEF,eAAO,MAAM,cAAc,UAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"polish.d.ts","sourceRoot":"","sources":["../../src/data/polish.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,cAAc;IAC7B,gGAAgG;IAChG,QAAQ,EAAE,MAAM,CAAC;IACjB,kIAAkI;IAClI,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAKD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAsJxD,CAAC;AAEF,eAAO,MAAM,cAAc,UAA6B,CAAC;AAkFzD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAuC9D"}
|
package/dist/data/polish.js
CHANGED
|
@@ -166,21 +166,37 @@ You are POLISHING an existing UI: making it look like it belongs to the AstralKi
|
|
|
166
166
|
library while KEEPING its layout, content, and app behavior. This is a revamp, not
|
|
167
167
|
a redesign, and it is more than token translation.
|
|
168
168
|
|
|
169
|
-
Run these
|
|
169
|
+
Run these 7 phases in order:
|
|
170
170
|
|
|
171
|
-
1. TOKENIZE (the floor) — replace raw Tailwind with ak-*
|
|
172
|
-
|
|
171
|
+
1. TOKENIZE (the floor) — replace raw Tailwind classes with ak-* utility classes
|
|
172
|
+
DIRECTLY ON EACH ELEMENT's className, using the crosswalk from get_design_tokens.
|
|
173
|
+
NEVER write CSS custom properties (var(--color-ak-*), var(--spacing-ak-*)) into
|
|
174
|
+
stylesheet files — that is NOT tokenization. If the source has external stylesheets
|
|
175
|
+
(page.css, component.css, or custom rules in globals.css), READ each one, EXTRACT
|
|
176
|
+
the CSS properties, FIND the equivalent ak-* utility class, APPLY them to the JSX
|
|
177
|
+
elements, then DELETE the stylesheet and remove its import. globals.css keeps only
|
|
178
|
+
theme/utilities imports + optional palette overrides. The end state is zero custom
|
|
179
|
+
CSS for visual styling. This alone is NOT polish; it is step 1.
|
|
173
180
|
2. DIAGNOSE — score the current design against the Design-Smell Rubric below. Note
|
|
174
181
|
every smell you find.
|
|
175
|
-
3. MATCH — for each major region, identify its archetype, then:
|
|
182
|
+
3. MATCH + INSTALL — for each major region, identify its archetype, then:
|
|
176
183
|
search_components(query) → get_preview(slug) → get_component(slug, mode:"recipe")
|
|
177
|
-
|
|
178
|
-
|
|
184
|
+
→ install_component(slug) → RUN the install command
|
|
185
|
+
If a library component covers the region, INSTALL it and REPLACE the bespoke code —
|
|
186
|
+
import the installed component and re-content it (swap copy, nav, data) instead of
|
|
187
|
+
hand-copying values from the recipe. The installed component IS the polish — its
|
|
188
|
+
structure, spacing, and effects are the quality bar. Only fall back to copying
|
|
189
|
+
individual values when no library component fits the region as a whole.
|
|
190
|
+
(Use the per-archetype query + rules below as your starting point.)
|
|
179
191
|
4. APPLY — copy those concrete values onto the existing markup, and make ONLY the
|
|
180
192
|
additive structural changes allowed below.
|
|
181
193
|
5. SELF-CHECK — run the Before/After Self-Check. If any item fails, go back to APPLY.
|
|
182
194
|
6. BUILD — run validate_code and fix every diff, then actually build/typecheck. The
|
|
183
|
-
output must render with identical content and intact behavior
|
|
195
|
+
output must render with identical content and intact behavior.
|
|
196
|
+
7. LOOK — call screenshot_ui on the polished route (or verify_visual with the reference
|
|
197
|
+
slug you matched in phase 3) and answer its rubric item by item. Code checks cannot
|
|
198
|
+
see a missing image, a shrunken logo, or an unloaded font — this step can. Fix every
|
|
199
|
+
FAIL and re-capture until clean.`;
|
|
184
200
|
const SMELL_RUBRIC = `## Design-Smell Rubric (diagnose, then fix to target)
|
|
185
201
|
|
|
186
202
|
| Smell | Fix → target |
|
|
@@ -201,6 +217,7 @@ ALLOWED (additive, non-destructive):
|
|
|
201
217
|
- Insert spacing/group containers to establish rhythm
|
|
202
218
|
- Swap inline <svg> / emoji UI icons for Phosphor icons (confirm names via get_icons)
|
|
203
219
|
- Promote a raw value into a badge/pill component
|
|
220
|
+
- REPLACE a bespoke region entirely with an installed library component (re-contented with the app's real data)
|
|
204
221
|
|
|
205
222
|
FORBIDDEN (that would make it a redesign, not a polish):
|
|
206
223
|
- Removing or rewording content
|
|
@@ -215,7 +232,10 @@ const SELF_CHECK = `## Before/After Self-Check (the gate — all must pass)
|
|
|
215
232
|
- [ ] Surfaces: cards/panels use border-ak-border, NOT shadow? Gradients only in hero?
|
|
216
233
|
- [ ] Accent: is the accent color ≤ ~10% of the surface (60-30-10)?
|
|
217
234
|
- [ ] Fidelity: is ALL original content present and are ALL handlers/props intact?
|
|
218
|
-
- [ ] validate_code returns clean AND the project builds/type-checks
|
|
235
|
+
- [ ] validate_code returns clean AND the project builds/type-checks.
|
|
236
|
+
- [ ] SEEN, not assumed: screenshot_ui / verify_visual was run on the final render and
|
|
237
|
+
every rubric item passed (images render, logo proportionate, no stray dark bands,
|
|
238
|
+
fonts loaded, nothing clipped).`;
|
|
219
239
|
/**
|
|
220
240
|
* Build the polish guidance string. With no archetypes, returns the full procedure +
|
|
221
241
|
* rubric + structural rules + self-check + the archetype taxonomy. With archetypes,
|
package/dist/data/polish.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polish.js","sourceRoot":"","sources":["../../src/data/polish.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wFAAwF;AACxF,EAAE;AACF,6EAA6E;AAC7E,kFAAkF;AAClF,+EAA+E;AAC/E,0CAA0C;AAa1C,oFAAoF;AACpF,iFAAiF;AACjF,oEAAoE;AACpE,MAAM,CAAC,MAAM,aAAa,GAAmC;IAC3D,IAAI,EAAE;QACJ,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI;QACxD,KAAK,EAAE;YACL,2EAA2E;YAC3E,yEAAyE;YACzE,2EAA2E;YAC3E,mEAAmE;YACnE,mEAAmE;SACpE;KACF;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa;QACvC,KAAK,EAAE;YACL,uEAAuE;YACvE,wFAAwF;YACxF,2CAA2C;SAC5C;KACF;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI;QACpD,KAAK,EAAE;YACL,2EAA2E;YAC3E,oFAAoF;YACpF,sFAAsF;YACtF,4EAA4E;YAC5E,0DAA0D;SAC3D;KACF;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,IAAI;QACnE,KAAK,EAAE;YACL,4FAA4F;YAC5F,8EAA8E;YAC9E,gEAAgE;YAChE,mEAAmE;SACpE;KACF;IACD,aAAa,EAAE;QACb,QAAQ,EAAE,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C,CAAC;YACpB,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,iDAAiD,CAAC,CAAC,CAAC,EAAE,CAAC;QACrF,MAAM,CAAC,IAAI,CACT,OAAO,GAAG,GAAG,IAAI,IAAI;YACnB,+BAA+B,KAAK,CAAC,KAAK,IAAI;YAC9C,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,qBAAqB,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9D,0DAA0D;YAC1D,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC9C,CAAC;IACJ,CAAC;IAED,IAAI,SAAS,GAAG,mCAAmC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1E,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,SAAS;YACP,8BAA8B,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;gBACtD,qFAAqF;gBACrF,gFAAgF,CAAC;IACrF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|
package/dist/data/rules.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CODING_STANDARDS = "# AstralKit Coding Standards\n\n## Setup\n- Package: `astralkit` (npm)\n- CSS: `@import \"astralkit/theme\"; @import \"astralkit/utilities\";` (after Tailwind imports)\n- Tailwind v3 plugin: `require('astralkit/tailwind.cjs')` in tailwind.config\n- Tailwind v4: `@import \"astralkit/theme-v4\"; @import \"astralkit/utilities\";`\n- Icons: `@phosphor-icons/react` exclusively. Never Lucide, Heroicons, or inline SVGs.\n- Fonts: Inter (body), DM Serif Display (display), JetBrains Mono (code)\n\n## Token-First Rule\nALWAYS use `ak-*` tokens. NEVER use arbitrary bracket values.\n```tsx\n// CORRECT\n<div className=\"p-ak-3 gap-ak-2 text-ak-base rounded-ak-lg\">\n// WRONG \u2014 arbitrary values silently collapse in Tailwind v4\n<div className=\"p-[1.5rem] gap-[1rem] text-[16px] rounded-[0.75rem]\">\n```\n\n## Semantic Colors \u2014 No Raw Tailwind\n```tsx\n// CORRECT: bg-ak-surface, text-ak-text, border-ak-border, bg-ak-primary\n// WRONG: bg-gray-50, text-gray-900, border-gray-200, bg-blue-600\n```\n\n## Typography \u2014 16px Floor\n- Body text, descriptions, nav items, table cells: `text-ak-base` (16px) minimum\n- UI text: `font-medium` minimum \u2014 `font-normal` is for long-form prose only\n- Labels/badges: `text-ak-sm` (14px) or `text-ak-xs` (12px uppercase) acceptable\n- Helper/error text: `text-ak-sm` (14px) is the only exception\n\n## Spacing \u2014 ak-* Tokens Only\n```tsx\n// CORRECT: p-ak-3, gap-ak-2, mb-ak-1_5\n// WRONG: p-6, gap-4, mb-3\n```\n\n## Icons \u2014 Phosphor Only\n```tsx\nimport { House, Gear } from '@phosphor-icons/react'\n<House size={20} aria-hidden=\"true\" />\n```\n\n## No Inline Styles\nUse Tailwind classes. `style={{}}` only for CSS variables with no Tailwind equivalent.\n\n## No Shadows on Panels/Dropdowns \u2014 Borders Only\nUse `border border-ak-border`. Reserve shadows for modals and elevated cards.\n\n## Motion \u2014 Framer Motion + CSS + Lenis (GSAP not allowed)\nFramer Motion (the MIT `motion` package) IS allowed. Prefer the AstralKit presets from\n`astralkit/motion` (tuned to the motion tokens, reduced-motion-safe). CSS animations are\nalso fine (durations/easings via `duration-ak-*`, `ease-ak-spring`/`bounce`). Use Lenis for\nsmooth scroll. ALWAYS honor `prefers-reduced-motion`. **GSAP is NOT allowed** (license).\n```tsx\nimport { motion, useReducedMotion } from 'motion/react'\nimport { fadeInUp, withReducedMotion } from 'astralkit/motion'\nconst reduced = useReducedMotion()\n<motion.div initial=\"hidden\" animate=\"show\" variants={withReducedMotion(fadeInUp, reduced)} />\n```\n\n## Premium Polish \u2014 Use the Effect Toolkit (with taste)\nAstralKit ships CSS-only premium effects \u2014 reach for them so screens feel designed, not generic:\n- Depth/glow: `ak-card-glow`, `ak-ambient-glow`, `ak-spotlight-card`, `ak-gradient-border`, `ak-text-glow`, `ak-surface-raised`\n- Backgrounds: `ak-mesh-light` / `ak-mesh-dark` / `ak-mesh-astral` (mesh gradients)\n- Motion accents (CSS): `ak-float`, `ak-scroll-fade`, `ak-section-fade`, `ak-sheen`, `ak-press` (tap feedback)\n- Color: tasteful accent (60-30-10); colorful charts use `ak-chart-1`..`ak-chart-6`; curated palettes via `astralkit/palettes`\n- Icons: Phosphor `weight=\"duotone\"` reads richer for feature/marketing icons\n\n### Effect guardrails (use the RIGHT effect on the RIGHT surface)\n- **Glows need dark surfaces.** `ak-text-glow`, `ak-ambient-glow`, and `ak-card-glow` read correctly as LIGHT-on-DARK. On a light background with dark text they look like a muddy smudge \u2014 **do NOT put text-glow on dark text / light backgrounds.**\n- **For dramatic/marketing heroes, go dark.** Add the `dark` class to the section root + `ak-mesh-dark` (tokens auto-flip to dark), light text, and a gradient accent word. This reads more premium than a light hero.\n- **Gradient text accent** (instead of glow): `<span className=\"bg-gradient-to-r from-ak-primary to-ak-info bg-clip-text text-transparent\">word</span>`.\n- Don't stack many effects on one element; one accent treatment per focal point.\n\n## Layout primitives \u2014 don't fight responsive display\n`ak-stack`, `ak-cluster`, `ak-grid`, `ak-switcher` SET `display` (flex/grid) and are unlayered, so they OVERRIDE Tailwind's responsive display utilities (`md:hidden`, `lg:block`, `sm:hidden`). Putting a responsive display toggle on the SAME element silently fails (e.g. a mobile accordion stays visible on desktop):\n```tsx\n// WRONG \u2014 ak-stack's display:flex beats md:hidden, so it never hides\n<div className=\"md:hidden ak-stack\">\u2026</div>\n// RIGHT \u2014 wrap: toggle on the outer element, primitive inside\n<div className=\"md:hidden\"><div className=\"ak-stack\">\u2026</div></div>\n// or use plain flex/grid when you need to toggle visibility\n<div className=\"md:hidden flex flex-col\">\u2026</div>\n```\n\n## Charts \u2014 readable AND rendered (recipe)\nUse the colorful `ak-chart-*` tokens with solid fills (not faint `ak-primary` tints). **Percentage bar heights only resolve if the container has a DEFINITE height** \u2014 a common bug is `min-height` + `items-end`, which collapses the bars to zero. Use this pattern:\n```tsx\n{/* DEFINITE height (h-56) + stretched columns so %-height bars resolve */}\n<div className=\"flex h-56 items-stretch gap-ak-1\">\n {data.map((v, i) => (\n <div key={i} className=\"group flex flex-1 flex-col justify-end gap-ak-1\">\n <div\n className={(i === data.length - 1 ? 'bg-ak-primary' : 'bg-ak-chart-1') + ' w-full rounded-ak-md'}\n style={{ height: `${Math.round((v / max) * 100)}%` }} /* sanctioned data-driven inline style */\n role=\"img\" aria-label={`${labels[i]}: ${v}`}\n />\n <span className=\"text-ak-xs text-ak-text-muted\">{labels[i]}</span>\n </div>\n ))}\n</div>\n```\n\n## Touch Targets \u2014 48px Minimum\n- Buttons: `min-h-[3rem]` + `cursor-pointer`\n- Form inputs: `h-14` (56px)\n\n## Empty States \u2014 Every Data Container\nEvery list, table, or feed must handle: Loading \u2192 Error \u2192 Empty \u2192 Data.\nEmpty states need: icon, title, description, CTA.\n\n## Error Handling \u2014 Never Show Raw Errors\nUser-facing errors need: title (jargon-free), description, action (Retry/Go Back).\n\n## cn() Utility\n```tsx\nimport { cn } from '@/lib/utils'\n<div className={cn(\"p-ak-3\", isActive && \"bg-ak-primary\")}>\n```\n\n## Theming Grammar \u2014 M3 Role System (60-30-10)\nEvery fill must use a ROLE, never resolve \"what color is this\" yourself:\n- **CTAs + binary on-states** (buttons, checked checkbox, toggle-ON): `bg-ak-primary text-ak-on-primary hover:bg-ak-primary-hover` \u2014 NEVER `bg-ak-text` for interactive fills.\n- **Selection-among-options** (active tab/segment/chip/nav item): `bg-ak-secondary text-ak-on-secondary`; subtle selected rows/nav: `bg-ak-secondary-container text-ak-on-secondary-container`.\n- **Selected-not-pressed cards**: `bg-ak-primary-container border-ak-primary`.\n- **Inverted/dark panels** (terminals, dark rails, dark tooltips, promo cards): `bg-ak-inverse-surface text-ak-inverse-on-surface` \u2014 NEVER `bg-ak-text`, `bg-ak-neutral-900 text-white`, or raw `bg-black`/hex.\n- **Surfaces**: page canvas `bg-ak-surface` \u2192 paper cards/inputs `bg-ak-surface-container-lowest` (or legacy `bg-ak-bg`/`bg-ak-elevated`) \u2192 wells/tracks `bg-ak-surface-container` (`-high`/`-highest` deeper). Borders: `border-ak-outline-variant` (hairline) / `border-ak-outline`.\n- **Overlays**: `bg-ak-scrim`. **Status**: `ak-error(-container)`/`ak-success`/`ak-warning`/`ak-info` + their `-text`/`on-` partners.\n- Non-interactive emphasis ink pills may keep `bg-ak-text text-ak-bg`. Opacity washes (`bg-ak-text/10`) stay neutral. Content colors (palette swatches, chart data) are exempt.\nDefault theme: primary is black, secondary falls back to primary \u2014 monochrome by default, fully colorable by any theme.\n";
|
|
1
|
+
export declare const CODING_STANDARDS = "# AstralKit Coding Standards\n\n## Rule Zero \u2014 Library-First Principle\nBefore writing ANY UI, call `search_components` to check if the library already has it. If a match\nexists: `install_component` \u2192 import \u2192 RE-CONTENT (swap placeholder copy, nav items, logo, sample\ndata for the app's real content). Hand-writing a component the library already provides is a failure\n\u2014 even if your hand-written version is token-compliant. The library sets the quality bar:\n- 3x\u20135x type size jumps between headings and body (not subtle increments)\n- Weight pairs: bold (700\u2013800) heroes, semibold (600) titles, medium (500) descriptions\n- Premium effects (`ak-card-glow`, `ak-mesh-*`, `ak-material-surface`) where appropriate\n- 60-30-10 color restraint (60% neutral, 30% secondary, 10% accent)\n- Zero external CSS \u2014 every visual property on the element's `className`\nIf NOTHING fits exactly: start from the CLOSEST recipe and modify it \u2014 never from a blank file.\n\n## Setup\n- Package: `astralkit` (npm)\n- CSS: `@import \"astralkit/theme\"; @import \"astralkit/utilities\";` (after Tailwind imports)\n- Tailwind v3 plugin: `require('astralkit/tailwind.cjs')` in tailwind.config\n- Tailwind v4: `@import \"astralkit/theme-v4\"; @import \"astralkit/utilities\";`\n- Icons: `@phosphor-icons/react` exclusively. Never Lucide, Heroicons, or inline SVGs.\n- Fonts: Inter (body), DM Serif Display (display), JetBrains Mono (code)\n\n## Token-First Rule\nALWAYS use `ak-*` tokens. NEVER use arbitrary bracket values.\n```tsx\n// CORRECT\n<div className=\"p-ak-3 gap-ak-2 text-ak-base rounded-ak-lg\">\n// WRONG \u2014 arbitrary values silently collapse in Tailwind v4\n<div className=\"p-[1.5rem] gap-[1rem] text-[16px] rounded-[0.75rem]\">\n```\n\n## Semantic Colors \u2014 No Raw Tailwind\n```tsx\n// CORRECT: bg-ak-surface, text-ak-text, border-ak-border, bg-ak-primary\n// WRONG: bg-gray-50, text-gray-900, border-gray-200, bg-blue-600\n```\n\n## \u26A0 The AI Sizing Bias \u2014 you have it; counteract it deliberately\nAI coding models systematically undersize text and icons \u2014 the training corpus is dominated by dense 12-14px admin UI and shadcn examples where text-sm is \"body\" and 16px is \"icon\". The statistical default IS the bug. Countermeasures, in order:\n1. **When uncertain, size UP one step \u2014 never down.** Your instinct to shrink is the bias talking.\n2. **Build hierarchy from the TOP down.** Set the largest text first (page title, hero display), then derive downward \u2014 body lands at 16px naturally. NEVER create hierarchy by shrinking secondary text below the floor (body 14 \u2192 meta 12 \u2192 caption 10 is the classic downward spiral).\n3. **Role ladder, not vibes:** hero/display \u2192 text-ak-5xl..7xl \u00B7 page title \u2192 text-ak-3xl/4xl semibold \u00B7 section/card title \u2192 text-ak-xl/2xl semibold \u00B7 body \u2192 text-ak-base (16px, THE FLOOR) \u00B7 secondary/meta \u2192 text-ak-sm (14px) medium \u00B7 text-ak-xs (12px) \u2192 tabular data annotations, legal, chart axes ONLY \u00B7 below 12px \u2192 almost never (it has legitimate uses, but they are rare and deliberate \u2014 dataviz tick labels, print fine-print).\n4. **Icons: 20-24px for anything meaningful** (nav, list leading icons, section markers); 16px only for inline chevrons and meta glyphs. size={14} or smaller on a standalone icon is a bug.\n5. **Measure, don't trust yourself:** audit_page reports a rendered font-size histogram \u2014 any visible text under 12px is an ERROR, 12-13px gets flagged for review. Run it; your eyes-in-code cannot feel size.\n\n## Typography \u2014 16px Floor\n- Body text, descriptions, nav items, table cells: `text-ak-base` (16px) minimum\n- UI text: `font-medium` minimum \u2014 `font-normal` is for long-form prose only\n- Labels/badges: `text-ak-sm` (14px) or `text-ak-xs` (12px uppercase) acceptable\n- Helper/error text: `text-ak-sm` (14px) is the only exception\n\n## Spacing \u2014 ak-* Tokens Only\n```tsx\n// CORRECT: p-ak-3, gap-ak-2, mb-ak-1_5\n// WRONG: p-6, gap-4, mb-3\n```\n\n## Icons \u2014 Phosphor Only\n```tsx\nimport { House, Gear } from '@phosphor-icons/react'\n<House size={20} aria-hidden=\"true\" />\n```\n**Size floor:** meaningful icons (nav items, list/row leading icons, section markers, toggles' labels) are **20-24px** \u2014 16px icons beside 16px text read as clutter and fail comfortable-viewing accessibility. 16px is only for dense inline affordances (chevrons inside a button, meta-row glyphs). When an icon anchors a row the user scans, size it 24px.\n\n## No Inline Styles, No External CSS for Styling\nUse Tailwind `ak-*` utility classes on the element's `className`. `style={{}}` only for\ngenuinely data-driven values (dynamic chart heights, computed percentages, map coordinates).\n**NEVER write visual styling to CSS files** (globals.css, page.css, component.css, etc.) \u2014\nthis includes `var(--color-ak-*)`, `var(--spacing-ak-*)`, or any other CSS custom property\nreference. If you find yourself writing `.my-card { background: var(--color-ak-surface) }`,\nyou are doing it wrong \u2014 write `className=\"bg-ak-surface\"` on the element instead.\nIf the source already has external stylesheets with visual rules, EXTRACT the properties,\nconvert each to the nearest `ak-*` utility class (see the crosswalk in get_design_tokens),\napply the classes to the JSX elements, DELETE the stylesheet, and remove the import.\n**globals.css is for theme/utilities imports + optional palette overrides only** \u2014 never\nfor component styling.\n\n## No Shadows on Panels/Dropdowns \u2014 Borders Only\nUse `border border-ak-border`. Reserve shadows for modals and elevated cards.\n\n## Motion \u2014 Framer Motion + CSS + Lenis (GSAP not allowed)\nFramer Motion (the MIT `motion` package) IS allowed. Prefer the AstralKit presets from\n`astralkit/motion` (tuned to the motion tokens, reduced-motion-safe). CSS animations are\nalso fine (durations/easings via `duration-ak-*`, `ease-ak-spring`/`bounce`). Use Lenis for\nsmooth scroll. ALWAYS honor `prefers-reduced-motion`. **GSAP is NOT allowed** (license).\n```tsx\nimport { motion, useReducedMotion } from 'motion/react'\nimport { fadeInUp, withReducedMotion } from 'astralkit/motion'\nconst reduced = useReducedMotion()\n<motion.div initial=\"hidden\" animate=\"show\" variants={withReducedMotion(fadeInUp, reduced)} />\n```\n\n## Premium Polish \u2014 Use the Effect Toolkit (with taste)\nAstralKit ships CSS-only premium effects \u2014 reach for them so screens feel designed, not generic:\n- Depth/glow: `ak-card-glow`, `ak-ambient-glow`, `ak-spotlight-card`, `ak-gradient-border`, `ak-text-glow`, `ak-surface-raised`\n- Backgrounds: `ak-mesh-light` / `ak-mesh-dark` / `ak-mesh-astral` (mesh gradients)\n- Motion accents (CSS): `ak-float`, `ak-scroll-fade`, `ak-section-fade`, `ak-sheen`, `ak-press` (tap feedback)\n- Color: tasteful accent (60-30-10); colorful charts use `ak-chart-1`..`ak-chart-6`; curated palettes via `astralkit/palettes`\n- Icons: Phosphor `weight=\"duotone\"` reads richer for feature/marketing icons\n\n### Effect guardrails (use the RIGHT effect on the RIGHT surface)\n- **Glows need dark surfaces.** `ak-text-glow`, `ak-ambient-glow`, and `ak-card-glow` read correctly as LIGHT-on-DARK. On a light background with dark text they look like a muddy smudge \u2014 **do NOT put text-glow on dark text / light backgrounds.**\n- **For dramatic/marketing heroes, go dark.** Add the `dark` class to the section root + `ak-mesh-dark` (tokens auto-flip to dark), light text, and a gradient accent word. This reads more premium than a light hero.\n- **Gradient text accent** (instead of glow): `<span className=\"bg-gradient-to-r from-ak-primary to-ak-info bg-clip-text text-transparent\">word</span>`.\n- Don't stack many effects on one element; one accent treatment per focal point.\n\n## Layout primitives \u2014 don't fight responsive display\n`ak-stack`, `ak-cluster`, `ak-grid`, `ak-switcher` SET `display` (flex/grid) and are unlayered, so they OVERRIDE Tailwind's responsive display utilities (`md:hidden`, `lg:block`, `sm:hidden`). Putting a responsive display toggle on the SAME element silently fails (e.g. a mobile accordion stays visible on desktop):\n```tsx\n// WRONG \u2014 ak-stack's display:flex beats md:hidden, so it never hides\n<div className=\"md:hidden ak-stack\">\u2026</div>\n// RIGHT \u2014 wrap: toggle on the outer element, primitive inside\n<div className=\"md:hidden\"><div className=\"ak-stack\">\u2026</div></div>\n// or use plain flex/grid when you need to toggle visibility\n<div className=\"md:hidden flex flex-col\">\u2026</div>\n```\n\n## Breakpoints \u2014 collapse where content crushes, not at arbitrary md/lg\nThe breakpoint belongs where the content STARTS to crush, which is usually EARLIER than you think. Audit at three widths (1440 / 768 / 390) \u2014 768 is where late-breakpoint bugs live: multi-column grids squeezed to unreadable, toggle columns eating label width, sidebars pinning content into a sliver. If anything is cramped at 768, move the collapse up (`lg:` instead of `md:`, or a custom `min-[960px]:`). On mobile, navigation must become a REAL mobile pattern: hamburger + Radix Dialog side-sheet, or a bottom tab bar (2-3 primary destinations + a \"More\" trigger opening a Radix Sheet) \u2014 a shrunken or vanished desktop nav is a failure.\n\n## Charts \u2014 readable AND rendered (recipe)\nUse the colorful `ak-chart-*` tokens with solid fills (not faint `ak-primary` tints). **Percentage bar heights only resolve if the container has a DEFINITE height** \u2014 a common bug is `min-height` + `items-end`, which collapses the bars to zero. Use this pattern:\n```tsx\n{/* DEFINITE height (h-56) + stretched columns so %-height bars resolve */}\n<div className=\"flex h-56 items-stretch gap-ak-1\">\n {data.map((v, i) => (\n <div key={i} className=\"group flex flex-1 flex-col justify-end gap-ak-1\">\n <div\n className={(i === data.length - 1 ? 'bg-ak-primary' : 'bg-ak-chart-1') + ' w-full rounded-ak-md'}\n style={{ height: `${Math.round((v / max) * 100)}%` }} /* sanctioned data-driven inline style */\n role=\"img\" aria-label={`${labels[i]}: ${v}`}\n />\n <span className=\"text-ak-xs text-ak-text-muted\">{labels[i]}</span>\n </div>\n ))}\n</div>\n```\n\n## Touch Targets \u2014 48px Minimum\n- Buttons: `min-h-[3rem]` + `cursor-pointer`\n- Form inputs: `h-14` (56px)\n\n## Empty States \u2014 Every Data Container\nEvery list, table, or feed must handle: Loading \u2192 Error \u2192 Empty \u2192 Data.\nEmpty states need: icon, title, description, CTA.\n\n## Error Handling \u2014 Never Show Raw Errors\nUser-facing errors need: title (jargon-free), description, action (Retry/Go Back).\n\n## cn() Utility\n```tsx\nimport { cn } from '@/lib/utils'\n<div className={cn(\"p-ak-3\", isActive && \"bg-ak-primary\")}>\n```\n\n## Theming Grammar \u2014 M3 Role System (60-30-10)\nEvery fill must use a ROLE, never resolve \"what color is this\" yourself:\n- **CTAs + binary on-states** (buttons, checked checkbox, toggle-ON): `bg-ak-primary text-ak-on-primary hover:bg-ak-primary-hover` \u2014 NEVER `bg-ak-text` for interactive fills.\n- **Selection-among-options** (active tab/segment/chip/nav item): `bg-ak-secondary text-ak-on-secondary`; subtle selected rows/nav: `bg-ak-secondary-container text-ak-on-secondary-container`.\n- **Selected-not-pressed cards**: `bg-ak-primary-container border-ak-primary`.\n- **Inverted/dark panels** (terminals, dark rails, dark tooltips, promo cards): `bg-ak-inverse-surface text-ak-inverse-on-surface` \u2014 NEVER `bg-ak-text`, `bg-ak-neutral-900 text-white`, or raw `bg-black`/hex.\n- **Surfaces**: page canvas `bg-ak-surface` \u2192 paper cards/inputs `bg-ak-surface-container-lowest` (or legacy `bg-ak-bg`/`bg-ak-elevated`) \u2192 wells/tracks `bg-ak-surface-container` (`-high`/`-highest` deeper). Borders: `border-ak-outline-variant` (hairline) / `border-ak-outline`.\n- **Overlays**: `bg-ak-scrim`. **Status**: `ak-error(-container)`/`ak-success`/`ak-warning`/`ak-info` + their `-text`/`on-` partners.\n- Non-interactive emphasis ink pills may keep `bg-ak-text text-ak-bg`. Opacity washes (`bg-ak-text/10`) stay neutral. Content colors (palette swatches, chart data) are exempt.\nDefault theme: primary is black, secondary falls back to primary \u2014 monochrome by default, fully colorable by any theme.\n\n## Gotchas \u2014 Silent Failures\nThese will NOT throw errors. The UI will silently break and you won't know unless you look:\n- **Underscore, not dot** \u2014 `ak-1_5`, NOT `ak-1.5`. Dot notation silently collapses to zero in Tailwind v4. Your spacing/padding will render as 0.\n- **No `/opacity` on ak-* tokens** \u2014 `bg-ak-warning/30` renders transparent, not faded. Use the `-subtle` variant (`bg-ak-warning-subtle`). The ONLY sanctioned opacity idiom is `inverse-on-surface/NN`.\n- **Non-existent ak-* class names render nothing** \u2014 no error, no warning, just invisible. Always verify token names exist in the token reference (get_design_tokens).\n- **Portalled overlays escape theme scope** \u2014 Radix portals mount outside your `data-ak-theme` wrapper. Wrap portalled content in a theme provider or set the attribute on the portal container.\n- **Avatar sizing** \u2014 use `size-ak-avatar-sm` / `size-ak-avatar-md` / `size-ak-avatar-lg` ONLY. `h-ak-avatar-lg` or `w-ak-avatar-md` do NOT exist.\n- **Layout primitives override display** \u2014 `ak-stack`, `ak-cluster`, `ak-grid` set display and are unlayered, so they BEAT responsive toggles (`md:hidden`) on the same element. Wrap the primitive in a toggler div instead.\n\n## Preflight Gates \u2014 validate_code Is Not a Compiler\n`validate_code` checks AstralKit conventions. It does NOT catch syntax errors, type errors, or\nruntime bugs. After validate_code passes, you MUST also run:\n1. `npx tsc --noEmit` \u2014 type-check\n2. `npm run build` (or `next build`) \u2014 full build\n3. Runtime verify \u2014 `next start` + check the actual URL renders correctly\n4. Visual verify \u2014 `verify_visual` or `screenshot_ui` (premium), or use your own browser tools\n`npm run dev` working proves nothing \u2014 it skips type-checking and many build errors.\n";
|
|
2
2
|
//# sourceMappingURL=rules.d.ts.map
|
package/dist/data/rules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/data/rules.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/data/rules.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,q+bAuL5B,CAAC"}
|
package/dist/data/rules.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
export const CODING_STANDARDS = `# AstralKit Coding Standards
|
|
2
2
|
|
|
3
|
+
## Rule Zero — Library-First Principle
|
|
4
|
+
Before writing ANY UI, call \`search_components\` to check if the library already has it. If a match
|
|
5
|
+
exists: \`install_component\` → import → RE-CONTENT (swap placeholder copy, nav items, logo, sample
|
|
6
|
+
data for the app's real content). Hand-writing a component the library already provides is a failure
|
|
7
|
+
— even if your hand-written version is token-compliant. The library sets the quality bar:
|
|
8
|
+
- 3x–5x type size jumps between headings and body (not subtle increments)
|
|
9
|
+
- Weight pairs: bold (700–800) heroes, semibold (600) titles, medium (500) descriptions
|
|
10
|
+
- Premium effects (\`ak-card-glow\`, \`ak-mesh-*\`, \`ak-material-surface\`) where appropriate
|
|
11
|
+
- 60-30-10 color restraint (60% neutral, 30% secondary, 10% accent)
|
|
12
|
+
- Zero external CSS — every visual property on the element's \`className\`
|
|
13
|
+
If NOTHING fits exactly: start from the CLOSEST recipe and modify it — never from a blank file.
|
|
14
|
+
|
|
3
15
|
## Setup
|
|
4
16
|
- Package: \`astralkit\` (npm)
|
|
5
17
|
- CSS: \`@import "astralkit/theme"; @import "astralkit/utilities";\` (after Tailwind imports)
|
|
@@ -23,6 +35,14 @@ ALWAYS use \`ak-*\` tokens. NEVER use arbitrary bracket values.
|
|
|
23
35
|
// WRONG: bg-gray-50, text-gray-900, border-gray-200, bg-blue-600
|
|
24
36
|
\`\`\`
|
|
25
37
|
|
|
38
|
+
## ⚠ The AI Sizing Bias — you have it; counteract it deliberately
|
|
39
|
+
AI coding models systematically undersize text and icons — the training corpus is dominated by dense 12-14px admin UI and shadcn examples where text-sm is "body" and 16px is "icon". The statistical default IS the bug. Countermeasures, in order:
|
|
40
|
+
1. **When uncertain, size UP one step — never down.** Your instinct to shrink is the bias talking.
|
|
41
|
+
2. **Build hierarchy from the TOP down.** Set the largest text first (page title, hero display), then derive downward — body lands at 16px naturally. NEVER create hierarchy by shrinking secondary text below the floor (body 14 → meta 12 → caption 10 is the classic downward spiral).
|
|
42
|
+
3. **Role ladder, not vibes:** hero/display → text-ak-5xl..7xl · page title → text-ak-3xl/4xl semibold · section/card title → text-ak-xl/2xl semibold · body → text-ak-base (16px, THE FLOOR) · secondary/meta → text-ak-sm (14px) medium · text-ak-xs (12px) → tabular data annotations, legal, chart axes ONLY · below 12px → almost never (it has legitimate uses, but they are rare and deliberate — dataviz tick labels, print fine-print).
|
|
43
|
+
4. **Icons: 20-24px for anything meaningful** (nav, list leading icons, section markers); 16px only for inline chevrons and meta glyphs. size={14} or smaller on a standalone icon is a bug.
|
|
44
|
+
5. **Measure, don't trust yourself:** audit_page reports a rendered font-size histogram — any visible text under 12px is an ERROR, 12-13px gets flagged for review. Run it; your eyes-in-code cannot feel size.
|
|
45
|
+
|
|
26
46
|
## Typography — 16px Floor
|
|
27
47
|
- Body text, descriptions, nav items, table cells: \`text-ak-base\` (16px) minimum
|
|
28
48
|
- UI text: \`font-medium\` minimum — \`font-normal\` is for long-form prose only
|
|
@@ -40,9 +60,20 @@ ALWAYS use \`ak-*\` tokens. NEVER use arbitrary bracket values.
|
|
|
40
60
|
import { House, Gear } from '@phosphor-icons/react'
|
|
41
61
|
<House size={20} aria-hidden="true" />
|
|
42
62
|
\`\`\`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
63
|
+
**Size floor:** meaningful icons (nav items, list/row leading icons, section markers, toggles' labels) are **20-24px** — 16px icons beside 16px text read as clutter and fail comfortable-viewing accessibility. 16px is only for dense inline affordances (chevrons inside a button, meta-row glyphs). When an icon anchors a row the user scans, size it 24px.
|
|
64
|
+
|
|
65
|
+
## No Inline Styles, No External CSS for Styling
|
|
66
|
+
Use Tailwind \`ak-*\` utility classes on the element's \`className\`. \`style={{}}\` only for
|
|
67
|
+
genuinely data-driven values (dynamic chart heights, computed percentages, map coordinates).
|
|
68
|
+
**NEVER write visual styling to CSS files** (globals.css, page.css, component.css, etc.) —
|
|
69
|
+
this includes \`var(--color-ak-*)\`, \`var(--spacing-ak-*)\`, or any other CSS custom property
|
|
70
|
+
reference. If you find yourself writing \`.my-card { background: var(--color-ak-surface) }\`,
|
|
71
|
+
you are doing it wrong — write \`className="bg-ak-surface"\` on the element instead.
|
|
72
|
+
If the source already has external stylesheets with visual rules, EXTRACT the properties,
|
|
73
|
+
convert each to the nearest \`ak-*\` utility class (see the crosswalk in get_design_tokens),
|
|
74
|
+
apply the classes to the JSX elements, DELETE the stylesheet, and remove the import.
|
|
75
|
+
**globals.css is for theme/utilities imports + optional palette overrides only** — never
|
|
76
|
+
for component styling.
|
|
46
77
|
|
|
47
78
|
## No Shadows on Panels/Dropdowns — Borders Only
|
|
48
79
|
Use \`border border-ak-border\`. Reserve shadows for modals and elevated cards.
|
|
@@ -84,6 +115,9 @@ AstralKit ships CSS-only premium effects — reach for them so screens feel desi
|
|
|
84
115
|
<div className="md:hidden flex flex-col">…</div>
|
|
85
116
|
\`\`\`
|
|
86
117
|
|
|
118
|
+
## Breakpoints — collapse where content crushes, not at arbitrary md/lg
|
|
119
|
+
The breakpoint belongs where the content STARTS to crush, which is usually EARLIER than you think. Audit at three widths (1440 / 768 / 390) — 768 is where late-breakpoint bugs live: multi-column grids squeezed to unreadable, toggle columns eating label width, sidebars pinning content into a sliver. If anything is cramped at 768, move the collapse up (\`lg:\` instead of \`md:\`, or a custom \`min-[960px]:\`). On mobile, navigation must become a REAL mobile pattern: hamburger + Radix Dialog side-sheet, or a bottom tab bar (2-3 primary destinations + a "More" trigger opening a Radix Sheet) — a shrunken or vanished desktop nav is a failure.
|
|
120
|
+
|
|
87
121
|
## Charts — readable AND rendered (recipe)
|
|
88
122
|
Use the colorful \`ak-chart-*\` tokens with solid fills (not faint \`ak-primary\` tints). **Percentage bar heights only resolve if the container has a DEFINITE height** — a common bug is \`min-height\` + \`items-end\`, which collapses the bars to zero. Use this pattern:
|
|
89
123
|
\`\`\`tsx
|
|
@@ -129,5 +163,23 @@ Every fill must use a ROLE, never resolve "what color is this" yourself:
|
|
|
129
163
|
- **Overlays**: \`bg-ak-scrim\`. **Status**: \`ak-error(-container)\`/\`ak-success\`/\`ak-warning\`/\`ak-info\` + their \`-text\`/\`on-\` partners.
|
|
130
164
|
- Non-interactive emphasis ink pills may keep \`bg-ak-text text-ak-bg\`. Opacity washes (\`bg-ak-text/10\`) stay neutral. Content colors (palette swatches, chart data) are exempt.
|
|
131
165
|
Default theme: primary is black, secondary falls back to primary — monochrome by default, fully colorable by any theme.
|
|
166
|
+
|
|
167
|
+
## Gotchas — Silent Failures
|
|
168
|
+
These will NOT throw errors. The UI will silently break and you won't know unless you look:
|
|
169
|
+
- **Underscore, not dot** — \`ak-1_5\`, NOT \`ak-1.5\`. Dot notation silently collapses to zero in Tailwind v4. Your spacing/padding will render as 0.
|
|
170
|
+
- **No \`/opacity\` on ak-* tokens** — \`bg-ak-warning/30\` renders transparent, not faded. Use the \`-subtle\` variant (\`bg-ak-warning-subtle\`). The ONLY sanctioned opacity idiom is \`inverse-on-surface/NN\`.
|
|
171
|
+
- **Non-existent ak-* class names render nothing** — no error, no warning, just invisible. Always verify token names exist in the token reference (get_design_tokens).
|
|
172
|
+
- **Portalled overlays escape theme scope** — Radix portals mount outside your \`data-ak-theme\` wrapper. Wrap portalled content in a theme provider or set the attribute on the portal container.
|
|
173
|
+
- **Avatar sizing** — use \`size-ak-avatar-sm\` / \`size-ak-avatar-md\` / \`size-ak-avatar-lg\` ONLY. \`h-ak-avatar-lg\` or \`w-ak-avatar-md\` do NOT exist.
|
|
174
|
+
- **Layout primitives override display** — \`ak-stack\`, \`ak-cluster\`, \`ak-grid\` set display and are unlayered, so they BEAT responsive toggles (\`md:hidden\`) on the same element. Wrap the primitive in a toggler div instead.
|
|
175
|
+
|
|
176
|
+
## Preflight Gates — validate_code Is Not a Compiler
|
|
177
|
+
\`validate_code\` checks AstralKit conventions. It does NOT catch syntax errors, type errors, or
|
|
178
|
+
runtime bugs. After validate_code passes, you MUST also run:
|
|
179
|
+
1. \`npx tsc --noEmit\` — type-check
|
|
180
|
+
2. \`npm run build\` (or \`next build\`) — full build
|
|
181
|
+
3. Runtime verify — \`next start\` + check the actual URL renders correctly
|
|
182
|
+
4. Visual verify — \`verify_visual\` or \`screenshot_ui\` (premium), or use your own browser tools
|
|
183
|
+
\`npm run dev\` working proves nothing — it skips type-checking and many build errors.
|
|
132
184
|
`;
|
|
133
185
|
//# sourceMappingURL=rules.js.map
|
package/dist/data/rules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/data/rules.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/data/rules.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuL/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../src/data/screens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../src/data/screens.ts"],"names":[],"mappings":"AAoLA,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQpD,CAAC;AAEF,eAAO,MAAM,YAAY,UAAiC,CAAC;AAE3D,iEAAiE;AACjE,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY/D"}
|
package/dist/data/screens.js
CHANGED
|
@@ -25,7 +25,13 @@ Global KPIs first (top-left — F/Z scan), then charts/trends, then tabular deta
|
|
|
25
25
|
## AstralKit pieces
|
|
26
26
|
- Categories: sidebars, top-bars, data-display.
|
|
27
27
|
- search_components: "analytics dashboard", "stats overview", "data table".
|
|
28
|
-
- polish_ui archetypes: stat-tile, table, sidebar, top-bar, section-header
|
|
28
|
+
- polish_ui archetypes: stat-tile, table, sidebar, top-bar, section-header.
|
|
29
|
+
|
|
30
|
+
## Asset generation
|
|
31
|
+
If you have access to image/video generation tools (e.g., Higgsfield generate_image):
|
|
32
|
+
- Generate chart placeholder imagery and empty-state illustrations BEFORE building components.
|
|
33
|
+
- Use search_logos for any brand marks in the data.
|
|
34
|
+
- Call get_art_direction("dashboard") for detailed visual direction on asset types and styles.`;
|
|
29
35
|
const NAV = `# Screen Blueprint: Navigation (top bar, mega-menu, mobile menu)
|
|
30
36
|
|
|
31
37
|
## Structure
|
|
@@ -34,6 +40,7 @@ Top bar: brand left, primary links center/left, actions (search, account, CTA) r
|
|
|
34
40
|
## Must-haves
|
|
35
41
|
- Desktop links hidden behind a hamburger on mobile: nav links 'hidden md:flex', hamburger 'md:hidden'. The mobile menu must actually exist and be reachable — desktop-only navs are the most common responsiveness bug.
|
|
36
42
|
- Mobile menu = a Radix Dialog used as a side sheet (w-[85vw] max-w-sm): traps focus, closes on Escape AND on route change.
|
|
43
|
+
- For APP screens (dashboard/settings/workspace), a bottom tab bar often beats a hamburger: the 2-3 primary destinations as fixed bottom tabs (48px+ targets, labels under icons) plus a "More" tab opening a Radix Sheet/drawer with the rest. Thumb-reachable beats top-corner hamburgers for daily-use apps.
|
|
37
44
|
- Mega-menu collapses to a stacked accordion (<details> or Radix Accordion) inside the mobile drawer.
|
|
38
45
|
- Mark the current page (aria-current="page"); keyboard-operable; visible focus rings.
|
|
39
46
|
- Sticky bars: don't trap scroll; ensure overlay menus sit above content (z-index) and over the themed surface.
|
|
@@ -44,7 +51,18 @@ Desktop-only nav (no mobile menu); a custom click-dropdown for the mobile menu i
|
|
|
44
51
|
## AstralKit pieces
|
|
45
52
|
- Categories: top-bars, sidebars, overlays.
|
|
46
53
|
- search_components: "navigation bar", "mega menu", "mobile menu".
|
|
47
|
-
- polish_ui archetypes: top-bar, sidebar-nav
|
|
54
|
+
- polish_ui archetypes: top-bar, sidebar-nav.
|
|
55
|
+
|
|
56
|
+
## Completeness check (CRITICAL)
|
|
57
|
+
After adapting a nav recipe, call get_component for the SAME slug and verify you carried over ALL of:
|
|
58
|
+
- Mobile menu (hamburger trigger + Radix Dialog side-sheet) — the #1 omission
|
|
59
|
+
- Click-outside dismiss on dropdowns (useRef + useEffect or Radix built-in)
|
|
60
|
+
- Keyboard navigation (arrow keys through nav items, Escape to close)
|
|
61
|
+
- Focus trapping inside mobile drawer and dropdown panels
|
|
62
|
+
- Active/current page indicator (aria-current="page" + visible styling)
|
|
63
|
+
- Overlay surface treatment on ALL dropdowns: bg-ak-elevated + border border-ak-border + shadow-lg
|
|
64
|
+
- Responsive breakpoints (hidden md:flex for desktop links, md:hidden for hamburger)
|
|
65
|
+
Partial extraction of a recipe is a failure — the recipe is the quality bar.`;
|
|
48
66
|
const PRICING = `# Screen Blueprint: Pricing
|
|
49
67
|
|
|
50
68
|
## Structure
|
|
@@ -81,7 +99,14 @@ Multiple competing CTAs of equal weight; a hero that buries the value prop; stoc
|
|
|
81
99
|
## AstralKit pieces
|
|
82
100
|
- Categories: footers, pricing (teaser).
|
|
83
101
|
- search_components: "hero section", "feature section", "testimonials", "footer".
|
|
84
|
-
- polish_ui archetypes: hero, section-header, footer (flagship — copy the full treatment)
|
|
102
|
+
- polish_ui archetypes: hero, section-header, footer (flagship — copy the full treatment).
|
|
103
|
+
|
|
104
|
+
## Asset generation
|
|
105
|
+
If you have access to image/video generation tools (e.g., Higgsfield generate_image):
|
|
106
|
+
- Generate hero photos, product mockups, or illustrations BEFORE building the hero section.
|
|
107
|
+
- Generate feature icons or section illustrations for alternating feature blocks.
|
|
108
|
+
- Use search_logos for trust strips and social proof sections.
|
|
109
|
+
- Call get_art_direction("hero") or get_art_direction("marketing") for detailed guidance on styles, moods, and composition.`;
|
|
85
110
|
const AUTH = `# Screen Blueprint: Auth (sign in / sign up / reset)
|
|
86
111
|
|
|
87
112
|
## Structure
|
|
@@ -100,7 +125,13 @@ Errors shown as toasts instead of inline; no loading state (double-submits); raw
|
|
|
100
125
|
## AstralKit pieces
|
|
101
126
|
- Categories: forms, overlays.
|
|
102
127
|
- search_components: "login form", "sign up form".
|
|
103
|
-
- polish_ui archetypes: form (flagship), form-field, button
|
|
128
|
+
- polish_ui archetypes: form (flagship), form-field, button.
|
|
129
|
+
|
|
130
|
+
## Asset generation
|
|
131
|
+
If you have access to image/video generation tools (e.g., Higgsfield generate_image):
|
|
132
|
+
- Generate a background image or brand illustration for the auth page.
|
|
133
|
+
- Use search_logos for social sign-in button logos (Google, GitHub, Apple, etc.).
|
|
134
|
+
- Call get_art_direction("auth") for guidance on imagery that complements a focused auth layout.`;
|
|
104
135
|
const ONBOARDING = `# Screen Blueprint: Onboarding
|
|
105
136
|
|
|
106
137
|
## Structure
|
|
@@ -127,6 +158,7 @@ Sectioned page (account, security, billing, notifications, danger zone) with a s
|
|
|
127
158
|
|
|
128
159
|
## Must-haves
|
|
129
160
|
- Group related fields; clear section headers; generous vertical rhythm.
|
|
161
|
+
- Mobile: the section sub-nav must transform — left rail becomes horizontally scrollable pill tabs at the top, or a bottom tab bar (2-3 primary sections + "More" opening a Radix Sheet). A rail that just narrows or disappears is a failure. Audit at 768 too: two-column field grids stack BEFORE labels/inputs crush.
|
|
130
162
|
- Dirty/save state: a save button that enables only on change, shows saving/saved feedback, and surfaces errors inline (not a toast for field errors). Destructive actions (delete account) sit in a clearly separated danger zone behind a confirm Dialog.
|
|
131
163
|
- Optimistic or clearly-pending toggles; success confirmation for saved changes (toast OK for global success).
|
|
132
164
|
- Each form field follows the form-field rules (label above font-medium text-ak-sm, 48px control, helper/error below, focus ring).
|
package/dist/data/screens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screens.js","sourceRoot":"","sources":["../../src/data/screens.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,2EAA2E;AAC3E,8EAA8E;AAC9E,iFAAiF;AACjF,8EAA8E;AAC9E,6EAA6E;AAC7E,EAAE;AACF,uEAAuE;AACvE,iFAAiF;AACjF,mEAAmE;AAEnE,MAAM,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"screens.js","sourceRoot":"","sources":["../../src/data/screens.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,2EAA2E;AAC3E,8EAA8E;AAC9E,iFAAiF;AACjF,8EAA8E;AAC9E,6EAA6E;AAC7E,EAAE;AACF,uEAAuE;AACvE,iFAAiF;AACjF,mEAAmE;AAEnE,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;+FAuB6E,CAAC;AAEhG,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EA8BiE,CAAC;AAE9E,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;6EAkB6D,CAAC;AAE9E,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;4HAwB0G,CAAC;AAE7H,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;iGAwBoF,CAAC;AAElG,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;qEAkBkD,CAAC;AAEtE,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;8DAkB6C,CAAC;AAE/D,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,SAAS,EAAE,SAAS;IACpB,GAAG,EAAE,GAAG;IACR,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAE3D,iEAAiE;AACjE,MAAM,UAAU,oBAAoB,CAAC,UAAkB;IACrD,MAAM,EAAE,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACzC,IAAI,EAAE,EAAE,CAAC;QACP,OAAO,CACL,EAAE;YACF,4GAA4G;YAC5G,mQAAmQ,CACpQ,CAAC;IACJ,CAAC;IACD,OAAO,CACL,qBAAqB,UAAU,8BAA8B,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACxF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const THEMING = "# AstralKit Theming \u2014 never ship default monochrome\n\nThe library ships **16 designed palettes**. A screen left on the bare default\ntheme reads as an unfinished template. UNLESS the brand is deliberately\nmonochrome, picking a palette is part of building the screen \u2014 not an optional\npolish step.\n\n## How to apply a palette (2 steps)\n\n1. Import the palette stylesheet once (globals.css or root layout):\n `@import 'astralkit/palettes';` (CSS) or `import 'astralkit/palettes'` (JS entry)\n2. Set the palette id on the root (or any container to scope it):\n `<html data-ak-theme=\"indigo-craft\">` \u2014 every ak-* token re-resolves automatically.\n\nThat's it. No class changes: bg-ak-primary, text-ak-text, borders, gradients all\nre-theme because the palette re-declares the CSS variables.\n\nFor runtime/theme-builder scenarios, `astralkit/presets` exports the same\npalettes as data (`THEME_PALETTES`, `paletteToAkVariables()` \u2192 129 vars).\n\n## The catalog \u2014 pick by brand mood\n\n### Light palettes\n| id | mood \u2014 when to pick |\n|---|---|\n| astral-default | Violet on warm paper. The house default \u2014 good for dev tools, builders. |\n| warm-earth | Teal primary, coral highlights. Friendly, human, wellness/community products. |\n| slate-pro | Professional gray + blue accent. Fintech, B2B ops, \"serious software\". |\n| indigo-craft | Warm neutral + indigo. Productivity, project management, calm focus. |\n| medtrackr | Clean white + emerald + mint washes. Healthcare, success-coded domains. |\n| periwinkle | Lavender-white + vivid periwinkle. Fitness, lifestyle, consumer SaaS. |\n| scout-cyan | Crisp white + deep sky-cyan. Analytics, referral/growth dashboards. |\n| pulse | Bone neutrals, ink CTAs, volt-lime selection. High-energy, sporty, bold. |\n| logozap | Warm paper + Zap Blue. Creative tools, brand-forward products. |\n\n### Dark palettes\n| id | mood \u2014 when to pick |\n|---|---|\n| volt-noir | True black + volt-lime CTAs. Dark sibling of pulse \u2014 gyms, gaming, energy. |\n| neon-noir | Deep violet-black + periwinkle glow. Nightlife, entertainment, web3. |\n| astral-ultraviolet | Deep violet-black, rich purple gradients, coral pulse. Premium dark SaaS. |\n| plasma-orbit | Black-blue + electric indigo/cyan/violet. Data-heavy dark dashboards. |\n| lunar-citron | Obsidian + lavender depth + citron energy. Editorial dark, portfolios. |\n| magenta-circuit | Charcoal + hot magenta + data-green hits. Dev tools, monitoring, cyber. |\n| deep-teal | Dark ocean teal + golden accent. Calm dark, finance, maritime. |\n\n## How to choose (30 seconds, not a project)\n\n1. Read the brief for mood words: \"premium\" \u2192 astral-ultraviolet/slate-pro;\n \"friendly\" \u2192 warm-earth/periwinkle; \"energetic\" \u2192 pulse/volt-noir;\n \"professional PM/productivity\" \u2192 indigo-craft/slate-pro.\n2. PRESERVE an existing app's mode \u2014 dark app gets a dark palette, never flipped.\n3. Say which palette you chose and why in one line. If the user named brand\n colors that match no palette, use the closest palette and override the\n primary tokens in globals.css \u2014 never invent a full ad-hoc color system.\n\n## Anti-patterns\n\n- Shipping the bare default theme for a branded product (\"black and white\n template syndrome\") \u2014 the single most common cold-build failure.\n- Hardcoding hexes on elements instead of applying a palette.\n- Mixing palettes across sections of one app (one palette per app; scoped\n data-ak-theme only for deliberate contrast panels).\n- Flipping a dark app to a light palette (or vice versa).\n- Forgetting the 60-30-10 rule still applies WITHIN a palette: neutral canvas\n dominates; the palette's accent belongs on CTAs and active states only.";
|
|
2
|
+
//# sourceMappingURL=theming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../src/data/theming.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,qsHAiEsD,CAAC"}
|