aktion-runtime 0.5.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/README.md +1246 -0
- package/dist/aktion.iife.js +8431 -0
- package/dist/aktion.iife.js.map +1 -0
- package/dist/aktion.js +22594 -0
- package/dist/aktion.js.map +1 -0
- package/dist/aktion.umd.cjs +8431 -0
- package/dist/aktion.umd.cjs.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/system_prompt.txt +1095 -0
- package/dist/system_prompt_chat.txt +404 -0
- package/dist/types/element.d.ts +175 -0
- package/dist/types/icons/index.d.ts +45 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/language/builtins.d.ts +33 -0
- package/dist/types/language/components.d.ts +28 -0
- package/dist/types/language/grammar.d.ts +121 -0
- package/dist/types/language/index.d.ts +41 -0
- package/dist/types/language/snippets.d.ts +17 -0
- package/dist/types/library/components/_internal.d.ts +56 -0
- package/dist/types/library/components/advanced-charts.d.ts +6 -0
- package/dist/types/library/components/advanced-data.d.ts +6 -0
- package/dist/types/library/components/advanced-forms.d.ts +12 -0
- package/dist/types/library/components/advanced-patterns.d.ts +13 -0
- package/dist/types/library/components/charts.d.ts +5 -0
- package/dist/types/library/components/chat.d.ts +6 -0
- package/dist/types/library/components/content.d.ts +33 -0
- package/dist/types/library/components/data.d.ts +9 -0
- package/dist/types/library/components/editors.d.ts +5 -0
- package/dist/types/library/components/feedback.d.ts +14 -0
- package/dist/types/library/components/forms-shared.d.ts +7 -0
- package/dist/types/library/components/forms.d.ts +21 -0
- package/dist/types/library/components/helpers.d.ts +33 -0
- package/dist/types/library/components/layout.d.ts +20 -0
- package/dist/types/library/components/media.d.ts +7 -0
- package/dist/types/library/components/menu.d.ts +5 -0
- package/dist/types/library/components/navigation.d.ts +6 -0
- package/dist/types/library/components/new-components.d.ts +13 -0
- package/dist/types/library/components/patterns.d.ts +39 -0
- package/dist/types/library/components/router.d.ts +2 -0
- package/dist/types/library/components/theme.d.ts +2 -0
- package/dist/types/library/index.d.ts +5 -0
- package/dist/types/library/registry.d.ts +15 -0
- package/dist/types/library/types.d.ts +140 -0
- package/dist/types/library/utils.d.ts +73 -0
- package/dist/types/library/validate.d.ts +27 -0
- package/dist/types/parser/frontier.d.ts +65 -0
- package/dist/types/parser/index.d.ts +4 -0
- package/dist/types/parser/lexer.d.ts +46 -0
- package/dist/types/parser/parser.d.ts +2 -0
- package/dist/types/parser/types.d.ts +349 -0
- package/dist/types/prompt/generator.d.ts +33 -0
- package/dist/types/prompt/index.d.ts +1 -0
- package/dist/types/renderer/index.d.ts +1 -0
- package/dist/types/renderer/morph.d.ts +42 -0
- package/dist/types/renderer/renderer.d.ts +73 -0
- package/dist/types/runtime/builtins.d.ts +27 -0
- package/dist/types/runtime/console.d.ts +21 -0
- package/dist/types/runtime/effects.d.ts +69 -0
- package/dist/types/runtime/evaluator.d.ts +151 -0
- package/dist/types/runtime/http.d.ts +85 -0
- package/dist/types/runtime/i18n.d.ts +40 -0
- package/dist/types/runtime/index.d.ts +9 -0
- package/dist/types/runtime/router.d.ts +105 -0
- package/dist/types/runtime/state.d.ts +84 -0
- package/dist/types/runtime/storage.d.ts +50 -0
- package/dist/types/theme/index.d.ts +175 -0
- package/dist/types/theme/styles.d.ts +9 -0
- package/dist/types/tooling/codemod.d.ts +36 -0
- package/dist/types/tooling/delta.d.ts +74 -0
- package/dist/types/tooling/formatter.d.ts +8 -0
- package/dist/types/tooling/index.d.ts +29 -0
- package/dist/types/tooling/inspector.d.ts +49 -0
- package/dist/types/tooling/language-service.d.ts +57 -0
- package/package.json +63 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme tokens applied as CSS custom properties on the host element.
|
|
3
|
+
*
|
|
4
|
+
* Built-in themes:
|
|
5
|
+
* - "light" (default)
|
|
6
|
+
* - "dark"
|
|
7
|
+
* - "neon" (cyberpunk-inspired, dark with glowing accents)
|
|
8
|
+
* - "pastel" (soft, friendly, light & rounded)
|
|
9
|
+
* - "glass" (frosted glass, translucent surfaces, vivid gradient bg)
|
|
10
|
+
* - "brutalist" (neo-brutalism, hard edges, thick borders, bold colors)
|
|
11
|
+
* - "skyline" (deep navy + cyan, crisp & calm)
|
|
12
|
+
*
|
|
13
|
+
* Consumers can also pass a JSON object via the `theme` attribute, call
|
|
14
|
+
* `element.setTheme({...})`, or declare `theme = Theme({...})` inside a
|
|
15
|
+
* Aktion program. All three paths flow through `mergeTheme`
|
|
16
|
+
* so partial token maps are layered on top of the `light` defaults.
|
|
17
|
+
*
|
|
18
|
+
* Token taxonomy:
|
|
19
|
+
* - **Color** — surface, semantic, brand accents, focus ring.
|
|
20
|
+
* - **Typography** — body and heading families, sizes, weights, line
|
|
21
|
+
* heights, letter spacing, and heading text-transform. Enough surface
|
|
22
|
+
* to mirror brand systems (GitHub, Stripe, Apple, IONOS, Notion, …).
|
|
23
|
+
* - **Shape & spacing** — radii (xs/sm/md/lg/pill/button/input), border
|
|
24
|
+
* width, shadows, spacing scale.
|
|
25
|
+
* - **Buttons** — font-weight, text-transform, letter-spacing, padding.
|
|
26
|
+
* - **Charts** — six rotating series colors.
|
|
27
|
+
* - **Motion** — transition duration shared by hover / focus animations.
|
|
28
|
+
*/
|
|
29
|
+
export interface ThemeTokens {
|
|
30
|
+
colorBg: string;
|
|
31
|
+
colorBgSubtle: string;
|
|
32
|
+
colorSurface: string;
|
|
33
|
+
colorSurfaceMuted: string;
|
|
34
|
+
colorBorder: string;
|
|
35
|
+
colorBorderSubtle: string;
|
|
36
|
+
colorText: string;
|
|
37
|
+
colorTextMuted: string;
|
|
38
|
+
colorPrimary: string;
|
|
39
|
+
colorPrimaryHover: string;
|
|
40
|
+
colorPrimaryText: string;
|
|
41
|
+
/** Secondary brand accent (links, chips, callouts). Defaults to primary. */
|
|
42
|
+
colorAccent: string;
|
|
43
|
+
colorAccentHover: string;
|
|
44
|
+
colorAccentText: string;
|
|
45
|
+
/** Focus ring color (CSS color). Defaults to primary. */
|
|
46
|
+
colorFocusRing: string;
|
|
47
|
+
colorSuccess: string;
|
|
48
|
+
colorWarning: string;
|
|
49
|
+
colorDanger: string;
|
|
50
|
+
colorInfo: string;
|
|
51
|
+
fontFamily: string;
|
|
52
|
+
/** Font stack used for headings (Card title, Page header, SectionHeader…). */
|
|
53
|
+
fontFamilyHeading: string;
|
|
54
|
+
fontFamilyMono: string;
|
|
55
|
+
/** Root font size — body text defaults to this value. */
|
|
56
|
+
fontSizeBase: string;
|
|
57
|
+
fontSizeSm: string;
|
|
58
|
+
fontSizeLg: string;
|
|
59
|
+
/** Font size for Card/Section headings. */
|
|
60
|
+
fontSizeHeading: string;
|
|
61
|
+
/** Font size for page-level titles (PageHeader, Cover, Hero). */
|
|
62
|
+
fontSizeTitle: string;
|
|
63
|
+
fontWeightBody: string;
|
|
64
|
+
fontWeightHeading: string;
|
|
65
|
+
lineHeightBody: string;
|
|
66
|
+
lineHeightHeading: string;
|
|
67
|
+
/** Letter spacing applied to titles & headings (e.g. "-0.01em"). */
|
|
68
|
+
letterSpacingHeading: string;
|
|
69
|
+
/** `text-transform` applied to titles & headings (e.g. "uppercase"). */
|
|
70
|
+
headingTextTransform: string;
|
|
71
|
+
/** Micro radius (pills, dots, status chips). */
|
|
72
|
+
radiusXs: string;
|
|
73
|
+
radiusSm: string;
|
|
74
|
+
radiusMd: string;
|
|
75
|
+
radiusLg: string;
|
|
76
|
+
/** Fully-rounded radius — `999px` by default. */
|
|
77
|
+
radiusPill: string;
|
|
78
|
+
/** Button-specific radius. Falls back to `radiusSm`. */
|
|
79
|
+
radiusButton: string;
|
|
80
|
+
/** Input-specific radius. Falls back to `radiusSm`. */
|
|
81
|
+
radiusInput: string;
|
|
82
|
+
/** Width of every solid border (default 1px; brutalist uses 2px). */
|
|
83
|
+
borderWidth: string;
|
|
84
|
+
shadowSm: string;
|
|
85
|
+
shadowMd: string;
|
|
86
|
+
shadowLg: string;
|
|
87
|
+
spacingXs: string;
|
|
88
|
+
spacingS: string;
|
|
89
|
+
spacingM: string;
|
|
90
|
+
spacingL: string;
|
|
91
|
+
spacingXl: string;
|
|
92
|
+
buttonFontWeight: string;
|
|
93
|
+
buttonTextTransform: string;
|
|
94
|
+
buttonLetterSpacing: string;
|
|
95
|
+
buttonPaddingY: string;
|
|
96
|
+
buttonPaddingX: string;
|
|
97
|
+
transitionDuration: string;
|
|
98
|
+
chart1: string;
|
|
99
|
+
chart2: string;
|
|
100
|
+
chart3: string;
|
|
101
|
+
chart4: string;
|
|
102
|
+
chart5: string;
|
|
103
|
+
chart6: string;
|
|
104
|
+
}
|
|
105
|
+
export declare const lightTheme: ThemeTokens;
|
|
106
|
+
export declare const darkTheme: ThemeTokens;
|
|
107
|
+
/**
|
|
108
|
+
* Neon — cyberpunk-flavoured dark mode. Magenta/cyan glow, sharper corners,
|
|
109
|
+
* monospace headings, and high-contrast surfaces.
|
|
110
|
+
*/
|
|
111
|
+
export declare const neonTheme: ThemeTokens;
|
|
112
|
+
/**
|
|
113
|
+
* Pastel — soft, friendly, light and rounded. Larger paddings, big radii,
|
|
114
|
+
* lavender + mint palette, gentle shadows.
|
|
115
|
+
*/
|
|
116
|
+
export declare const pastelTheme: ThemeTokens;
|
|
117
|
+
/**
|
|
118
|
+
* Glass — modern glassmorphism. Vivid gradient backdrop, frosted translucent
|
|
119
|
+
* surfaces (real backdrop-filter blur applied via the stylesheet), generous
|
|
120
|
+
* radii, and a cool indigo→cyan accent. Designed for hero sections and
|
|
121
|
+
* marketing-style UIs.
|
|
122
|
+
*/
|
|
123
|
+
export declare const glassTheme: ThemeTokens;
|
|
124
|
+
/**
|
|
125
|
+
* Brutalist — neo-brutalism. Hard 2px black borders, chunky offset shadows,
|
|
126
|
+
* loud primary colors, all-caps display type, and zero gradients. Designed
|
|
127
|
+
* to look hand-built and unapologetically bold.
|
|
128
|
+
*/
|
|
129
|
+
export declare const brutalistTheme: ThemeTokens;
|
|
130
|
+
/**
|
|
131
|
+
* Skyline — enterprise cloud-console aesthetic. Deep navy primary, calm
|
|
132
|
+
* cyan accents, very pale blue page background, white surfaces with crisp
|
|
133
|
+
* 1px borders, small radii, and a clean Inter type stack. The look should
|
|
134
|
+
* feel at home in an admin panel: dense, scannable, minimal chrome.
|
|
135
|
+
*/
|
|
136
|
+
export declare const skylineTheme: ThemeTokens;
|
|
137
|
+
export declare const builtInThemes: Record<string, ThemeTokens>;
|
|
138
|
+
export type ThemeInput = string | Partial<ThemeTokens>;
|
|
139
|
+
export interface ResolvedTheme {
|
|
140
|
+
/** Built-in theme name when known, otherwise "custom". Drives `data-rui-theme`. */
|
|
141
|
+
name: string;
|
|
142
|
+
tokens: ThemeTokens;
|
|
143
|
+
}
|
|
144
|
+
export declare function resolveTheme(input: ThemeInput | null | undefined): ResolvedTheme;
|
|
145
|
+
/**
|
|
146
|
+
* Apply theme tokens to the host element. Also sets `data-rui-theme` so the
|
|
147
|
+
* shadow-DOM stylesheet can hook into theme-specific overrides (fonts,
|
|
148
|
+
* gradients, animations, etc.) that go beyond raw token values.
|
|
149
|
+
*/
|
|
150
|
+
export declare function applyTheme(host: HTMLElement, theme: ResolvedTheme | ThemeTokens): void;
|
|
151
|
+
/**
|
|
152
|
+
* Apply *only* the tokens explicitly listed in `partial`. Leaves every other
|
|
153
|
+
* CSS variable untouched, so this composes cleanly on top of whatever base
|
|
154
|
+
* theme `applyTheme(...)` last wrote. Used by the in-script `Theme(...)`
|
|
155
|
+
* construct so authors can override just a handful of tokens without
|
|
156
|
+
* wiping the rest of the active theme.
|
|
157
|
+
*
|
|
158
|
+
* Unknown keys are ignored — both for forward compatibility and to keep
|
|
159
|
+
* malformed LLM output from polluting the host's inline styles.
|
|
160
|
+
*/
|
|
161
|
+
export declare function applyPartialTheme(host: HTMLElement, partial: Partial<ThemeTokens>): ReadonlyArray<keyof ThemeTokens>;
|
|
162
|
+
/**
|
|
163
|
+
* Remove an array of token CSS variables from the host's inline style. Used
|
|
164
|
+
* to "undo" a previous `applyPartialTheme(...)` call so the next render
|
|
165
|
+
* inherits whatever the base theme provides rather than the stale override.
|
|
166
|
+
*/
|
|
167
|
+
export declare function clearTokenOverrides(host: HTMLElement, keys: ReadonlyArray<keyof ThemeTokens>): void;
|
|
168
|
+
/**
|
|
169
|
+
* Filter an arbitrary object down to the keys recognised by `ThemeTokens`,
|
|
170
|
+
* stringifying primitive values along the way. Used when an Aktion program
|
|
171
|
+
* declares `theme = Theme({...})` — the evaluator hands us
|
|
172
|
+
* a plain JS object, and we want to ignore anything that isn't a real token
|
|
173
|
+
* (LLM typo guard) before applying it.
|
|
174
|
+
*/
|
|
175
|
+
export declare function sanitiseThemeTokens(input: unknown): Partial<ThemeTokens>;
|