@sky.ui/mcp 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +191 -182
- package/data/chart-api-sections.json +4184 -4184
- package/data/reactivity-readme-snapshot.json +1 -1
- package/data/theme-authoring-contract.json +598 -598
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +40 -29
- package/dist/catalog.js.map +1 -1
- package/dist/cem.d.ts +1 -1
- package/dist/cem.d.ts.map +1 -1
- package/dist/cem.js +5 -11
- package/dist/cem.js.map +1 -1
- package/dist/docs-read.js +6 -6
- package/dist/docs.js +4 -4
- package/dist/framework-wrappers.d.ts.map +1 -1
- package/dist/framework-wrappers.js +4 -8
- package/dist/framework-wrappers.js.map +1 -1
- package/dist/mcp-runtime-status.js +2 -2
- package/dist/package-resolve.d.ts +10 -0
- package/dist/package-resolve.d.ts.map +1 -0
- package/dist/package-resolve.js +87 -0
- package/dist/package-resolve.js.map +1 -0
- package/dist/reactivity-info.d.ts.map +1 -1
- package/dist/reactivity-info.js +4 -11
- package/dist/reactivity-info.js.map +1 -1
- package/dist/server.js +4 -4
- package/dist/source-read.d.ts.map +1 -1
- package/dist/source-read.js +6 -10
- package/dist/source-read.js.map +1 -1
- package/dist/utils-suggestion-grounding.d.ts.map +1 -1
- package/dist/utils-suggestion-grounding.js +4 -11
- package/dist/utils-suggestion-grounding.js.map +1 -1
- package/docs/agent-recipe-example-site.md +91 -91
- package/docs/ai-design-mcp-blueprint.md +75 -75
- package/docs/cross-model-mcp-playbook.md +127 -127
- package/docs/example-site-and-mcp-training.md +82 -82
- package/docs/mcp-capability-status.md +51 -51
- package/docs/mcp-tooling-roadmap.md +36 -36
- package/docs/sky-chart-option-api.md +47 -47
- package/docs/starter-prompt.md +17 -17
- package/docs/theme-config-guide.md +178 -178
- package/docs/utils-usage-guide.md +112 -110
- package/docs/vue-wrapper-v-model.md +36 -36
- package/package.json +72 -63
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
# sky-chart — option API for AI assistants
|
|
2
|
-
|
|
3
|
-
Use this when the user needs **charts, dashboards, or ECharts-shaped configuration** on **`sky-chart`**. It complements **`get_sky_component_docs`** and **`get_chart_usage`**.
|
|
4
|
-
|
|
5
|
-
## Tool order
|
|
6
|
-
|
|
7
|
-
1. **`get_sky_component_docs`** with **`name: "sky-chart"`** (optional **`surface`**) for props, events, slots.
|
|
8
|
-
2. **`get_chart_usage`** — **`list_types`**, then **`get_type`** with **`chart_type`**, or **`option_guide`** for the compact mental model.
|
|
9
|
-
3. **`get_docs`** with **`packages/mcp/docs/sky-chart-option-api.md`** (this file) when you need prose without calling MCP again.
|
|
10
|
-
4. Example-site snippet matrices (when configured) arrive via **`get_sky_component_docs`** enrichment—not a separate tool.
|
|
11
|
-
|
|
12
|
-
## Mental model
|
|
13
|
-
|
|
14
|
-
| Input | Role |
|
|
15
|
-
|--------|------|
|
|
16
|
-
| **`type`** | Selects which **lazy-loaded renderer** runs (`bar`, `line`, `pie`, `map`, `radar`, `sankey`, `brush`, …). Must match the chart family you are building. |
|
|
17
|
-
| **`option`** | **Root chart configuration**: ECharts-style field names (`series`, `xAxis`, `tooltip`, …). The host merges theme and layout; renderers read the subset they need. |
|
|
18
|
-
| **`theme`** (attribute) | `light` \| `dark` \| `""`. Empty string follows the active **`sky-theme-provider`**. |
|
|
19
|
-
| **`option.theme`** | Optional **named palette** inside the option object (host may merge backgrounds / colors). |
|
|
20
|
-
|
|
21
|
-
**`type="brush"`** is a **range UI** (overview + detail). Use host **`start`** / **`end`** (0–100). Linked charts get their own **`option`** and usual **`type`** values.
|
|
22
|
-
|
|
23
|
-
## Root **`option`** shape (authoritative summary)
|
|
24
|
-
|
|
25
|
-
The shipped TypeScript root interface is **`EChartsOption`** in the Sky UI repo file **`components-raw/sky-chart/echarts-option.ts`**. Its **top-level keys** include:
|
|
26
|
-
|
|
27
|
-
- **`series`** (required in the type model; each entry has **`type`** for that series, e.g. `bar`, `line`, `pie`, `map`, …).
|
|
28
|
-
- **`xAxis`**, **`yAxis`**, **`grid`**, **`polar`**, **`angleAxis`**, **`radiusAxis`**, **`radar`**, **`geo`**, **`parallel`**, **`parallelAxis`**, **`calendar`** — coordinate and layout systems as needed.
|
|
29
|
-
- **`dataset`** (and optional **transform**, e.g. boxplot).
|
|
30
|
-
- **`tooltip`**, **`legend`**, **`axisPointer`**, **`dataZoom`**, **`visualMap`**, **`brush`**, **`timeline`** / **`options`** (multi-step timelines).
|
|
31
|
-
- **`color`**, **`backgroundColor`**, **`decal`**, **`graphic`**, **`fisheye`**, **`animation`** / **`animationDuration`** / related fields — presentation and motion.
|
|
32
|
-
|
|
33
|
-
Fields not listed in **`echarts-option.ts`** may still work when they match **Apache ECharts option** naming for features Sky has wired through; treat **extra fields** as **best-effort** unless confirmed in source or examples.
|
|
34
|
-
|
|
35
|
-
## Accuracy rules
|
|
36
|
-
|
|
37
|
-
1. **Prefer `get_sky_component_docs("sky-chart")`** over guessing tags or prop names.
|
|
38
|
-
2. **`type`** on the **custom element** picks the **primary renderer**; keep **`option.series`** consistent with that mode (avoid declaring an unsupported primary renderer).
|
|
39
|
-
3. **`option` is data**, not HTML: validate **untrusted** JSON before assigning (same risk class as remote config).
|
|
40
|
-
4. For **a11y**, pair charts with **text, tables, or live regions** when exact values matter; confirm keyboard/focus behavior from **`get_sky_component_docs`** events and slots.
|
|
41
|
-
|
|
42
|
-
## Repo paths (for humans / monorepo clones)
|
|
43
|
-
|
|
44
|
-
- **Root option type:** `components-raw/sky-chart/echarts-option.ts` — interface **`EChartsOption`**.
|
|
45
|
-
- **Renderer registry:** `components-raw/sky-chart/renderer/index.ts` — **`SkyChartType`** keys and lazy imports.
|
|
46
|
-
|
|
47
|
-
Published installs may not ship **`components-raw/`**; use **`get_sky_component_docs`** and this doc from **@sky.ui/mcp** instead.
|
|
1
|
+
# sky-chart — option API for AI assistants
|
|
2
|
+
|
|
3
|
+
Use this when the user needs **charts, dashboards, or ECharts-shaped configuration** on **`sky-chart`**. It complements **`get_sky_component_docs`** and **`get_chart_usage`**.
|
|
4
|
+
|
|
5
|
+
## Tool order
|
|
6
|
+
|
|
7
|
+
1. **`get_sky_component_docs`** with **`name: "sky-chart"`** (optional **`surface`**) for props, events, slots.
|
|
8
|
+
2. **`get_chart_usage`** — **`list_types`**, then **`get_type`** with **`chart_type`**, or **`option_guide`** for the compact mental model.
|
|
9
|
+
3. **`get_docs`** with **`packages/mcp/docs/sky-chart-option-api.md`** (this file) when you need prose without calling MCP again.
|
|
10
|
+
4. Example-site snippet matrices (when configured) arrive via **`get_sky_component_docs`** enrichment—not a separate tool.
|
|
11
|
+
|
|
12
|
+
## Mental model
|
|
13
|
+
|
|
14
|
+
| Input | Role |
|
|
15
|
+
|--------|------|
|
|
16
|
+
| **`type`** | Selects which **lazy-loaded renderer** runs (`bar`, `line`, `pie`, `map`, `radar`, `sankey`, `brush`, …). Must match the chart family you are building. |
|
|
17
|
+
| **`option`** | **Root chart configuration**: ECharts-style field names (`series`, `xAxis`, `tooltip`, …). The host merges theme and layout; renderers read the subset they need. |
|
|
18
|
+
| **`theme`** (attribute) | `light` \| `dark` \| `""`. Empty string follows the active **`sky-theme-provider`**. |
|
|
19
|
+
| **`option.theme`** | Optional **named palette** inside the option object (host may merge backgrounds / colors). |
|
|
20
|
+
|
|
21
|
+
**`type="brush"`** is a **range UI** (overview + detail). Use host **`start`** / **`end`** (0–100). Linked charts get their own **`option`** and usual **`type`** values.
|
|
22
|
+
|
|
23
|
+
## Root **`option`** shape (authoritative summary)
|
|
24
|
+
|
|
25
|
+
The shipped TypeScript root interface is **`EChartsOption`** in the Sky UI repo file **`components-raw/sky-chart/echarts-option.ts`**. Its **top-level keys** include:
|
|
26
|
+
|
|
27
|
+
- **`series`** (required in the type model; each entry has **`type`** for that series, e.g. `bar`, `line`, `pie`, `map`, …).
|
|
28
|
+
- **`xAxis`**, **`yAxis`**, **`grid`**, **`polar`**, **`angleAxis`**, **`radiusAxis`**, **`radar`**, **`geo`**, **`parallel`**, **`parallelAxis`**, **`calendar`** — coordinate and layout systems as needed.
|
|
29
|
+
- **`dataset`** (and optional **transform**, e.g. boxplot).
|
|
30
|
+
- **`tooltip`**, **`legend`**, **`axisPointer`**, **`dataZoom`**, **`visualMap`**, **`brush`**, **`timeline`** / **`options`** (multi-step timelines).
|
|
31
|
+
- **`color`**, **`backgroundColor`**, **`decal`**, **`graphic`**, **`fisheye`**, **`animation`** / **`animationDuration`** / related fields — presentation and motion.
|
|
32
|
+
|
|
33
|
+
Fields not listed in **`echarts-option.ts`** may still work when they match **Apache ECharts option** naming for features Sky has wired through; treat **extra fields** as **best-effort** unless confirmed in source or examples.
|
|
34
|
+
|
|
35
|
+
## Accuracy rules
|
|
36
|
+
|
|
37
|
+
1. **Prefer `get_sky_component_docs("sky-chart")`** over guessing tags or prop names.
|
|
38
|
+
2. **`type`** on the **custom element** picks the **primary renderer**; keep **`option.series`** consistent with that mode (avoid declaring an unsupported primary renderer).
|
|
39
|
+
3. **`option` is data**, not HTML: validate **untrusted** JSON before assigning (same risk class as remote config).
|
|
40
|
+
4. For **a11y**, pair charts with **text, tables, or live regions** when exact values matter; confirm keyboard/focus behavior from **`get_sky_component_docs`** events and slots.
|
|
41
|
+
|
|
42
|
+
## Repo paths (for humans / monorepo clones)
|
|
43
|
+
|
|
44
|
+
- **Root option type:** `components-raw/sky-chart/echarts-option.ts` — interface **`EChartsOption`**.
|
|
45
|
+
- **Renderer registry:** `components-raw/sky-chart/renderer/index.ts` — **`SkyChartType`** keys and lazy imports.
|
|
46
|
+
|
|
47
|
+
Published installs may not ship **`components-raw/`**; use **`get_sky_component_docs`** and this doc from **@sky.ui/mcp** instead.
|
package/docs/starter-prompt.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# Sky UI — starter prompt for assistants
|
|
2
|
-
|
|
3
|
-
Paste this at the start of a session when building with Sky UI (Cursor, Claude, Copilot, etc.).
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
You are helping build UI with Sky UI (@sky.ui/core web components, optional @sky.ui/react / @sky.ui/vue wrappers, @sky.ui/utils for layout CSS, @sky.ui/reactivity when needed).
|
|
7
|
-
|
|
8
|
-
You MUST use Sky UI MCP tools as the only source for component names, imports, props, events, slots, and theme tokens. Do not invent tags or --sky-* names.
|
|
9
|
-
|
|
10
|
-
Styling priority (pages, layouts, shells): Prefer @sky.ui/utils utility classes on elements (`class` / `className`) for layout, spacing, typography, and colors. Use get_docs with packages/mcp/docs/utils-usage-guide.md for setup; utility_classes (variant_prefixes, search_classes, check_class) to discover and validate class names; align get_theme (operation guide, then fields/field) for userTheme. Do NOT default to large hand-written plain CSS or unrelated CSS frameworks unless the user asks or a case truly cannot be expressed with utilities.
|
|
11
|
-
|
|
12
|
-
Order: (1) get_project_guide (kind installation | setup) for install/bundler (2) get_sky_component_docs with optional surface (3) get_component_usage for lit/react/vue (4) get_reactivity_layer for @sky.ui/reactivity topics (5) get_chart_usage for sky-chart types and option guide (6) theme: get_theme operation guide then fields/field (7) layout/styling: utility_classes + get_docs utils-usage-guide. For sky-chart props/events, get_sky_component_docs(name: sky-chart).
|
|
13
|
-
|
|
14
|
-
When citing MCP JSON, respect `_skyUiMcp.truthLayer` and `_skyUiMcp.agentMust` — do not treat guideline_scoring or heuristic_search as guaranteed API contracts.
|
|
15
|
-
|
|
16
|
-
If a tool returns code starting with JSON parse errors or empty arrays, say what is missing (e.g. `@sky.ui/core` not installed/built) and retry after suggesting the user fix the environment.
|
|
17
|
-
```
|
|
1
|
+
# Sky UI — starter prompt for assistants
|
|
2
|
+
|
|
3
|
+
Paste this at the start of a session when building with Sky UI (Cursor, Claude, Copilot, etc.).
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
You are helping build UI with Sky UI (@sky.ui/core web components, optional @sky.ui/react / @sky.ui/vue wrappers, @sky.ui/utils for layout CSS, @sky.ui/reactivity when needed).
|
|
7
|
+
|
|
8
|
+
You MUST use Sky UI MCP tools as the only source for component names, imports, props, events, slots, and theme tokens. Do not invent tags or --sky-* names.
|
|
9
|
+
|
|
10
|
+
Styling priority (pages, layouts, shells): Prefer @sky.ui/utils utility classes on elements (`class` / `className`) for layout, spacing, typography, and colors. Use get_docs with packages/mcp/docs/utils-usage-guide.md for setup; utility_classes (variant_prefixes, search_classes, check_class) to discover and validate class names; align get_theme (operation guide, then fields/field) for userTheme. Do NOT default to large hand-written plain CSS or unrelated CSS frameworks unless the user asks or a case truly cannot be expressed with utilities.
|
|
11
|
+
|
|
12
|
+
Order: (1) get_project_guide (kind installation | setup) for install/bundler (2) get_sky_component_docs with optional surface (3) get_component_usage for lit/react/vue (4) get_reactivity_layer for @sky.ui/reactivity topics (5) get_chart_usage for sky-chart types and option guide (6) theme: get_theme operation guide then fields/field (7) layout/styling: utility_classes + get_docs utils-usage-guide. For sky-chart props/events, get_sky_component_docs(name: sky-chart).
|
|
13
|
+
|
|
14
|
+
When citing MCP JSON, respect `_skyUiMcp.truthLayer` and `_skyUiMcp.agentMust` — do not treat guideline_scoring or heuristic_search as guaranteed API contracts.
|
|
15
|
+
|
|
16
|
+
If a tool returns code starting with JSON parse errors or empty arrays, say what is missing (e.g. `@sky.ui/core` not installed/built) and retry after suggesting the user fix the environment.
|
|
17
|
+
```
|
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
# ThemeConfig / `userTheme` field guide
|
|
2
|
-
|
|
3
|
-
This document describes **what each entry in `ThemeModeConfig` is for** when you pass **`Partial<ThemeConfig>`** as **`userTheme`** on **`sky-theme-provider`**. Names are stable; **values** change per theme/mode. The provider **deep-merges** your overrides with **`defaultTheme`** separately for **`light`** and **`dark`**.
|
|
4
|
-
|
|
5
|
-
- **Type layout**: `ThemeConfig` has `{ light: ThemeModeConfig; dark: ThemeModeConfig }`.
|
|
6
|
-
- **Override rule**: Only set what you need; omitted keys keep defaults.
|
|
7
|
-
- **CSS output**: Merged config is turned into **`--sky-*`** custom properties on `:root` and/or `:host` (see `generateVarMap` in `sky-theme-provider`).
|
|
8
|
-
- **Full variable list**: MCP **`get_theme`** with **`operation: variables`** (extracted `--sky-*` names).
|
|
9
|
-
- **For AI / programmatic authoring** (path hooks, `examplePatch`, phrase→field routing): **`get_theme`** — start with **`operation: guide`**, then **`fields`**, **`field`**, **`match_intent`**, **`compose`**. Source: `packages/mcp/data/theme-authoring-contract.json`.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Quick mental model
|
|
14
|
-
|
|
15
|
-
| Area | Role in the UI |
|
|
16
|
-
|------|----------------|
|
|
17
|
-
| **`color`** | Page background, default text, and **brand semantic** colors (active, success, warning, danger, info) that drive buttons, alerts, rings, and states. |
|
|
18
|
-
| **`glass`** | Translucent **surface fills** (cards, panels, chips): base tint + opacity ladder. |
|
|
19
|
-
| **`glassSurface`** | Optional **vertical gradient** strength for the special `sky-glass-surface` token (Sheen top → bottom). |
|
|
20
|
-
| **`glassHover`** | **Hoverwash** overlays on interactive surfaces (darkening/lightening), not full backgrounds. |
|
|
21
|
-
| **`overlay`** | **Scrim / modal / sheet** backdrops—full-screen or layered tint above content. |
|
|
22
|
-
| **`fontFamily` / mono** | Base **sans** and **mono** stacks; feed typography tokens and role tokens. |
|
|
23
|
-
| **`fontSize` / `fontWeight` / `lineHeight` / `letterSpacing`** | Scales used for **`--sky-font-size-*`**, **`--sky-text-*`** roles, and presets. |
|
|
24
|
-
| **`spacing`** | **Density**: padding/gaps as **`--sky-space-{key}`** (not `--sky-spacing-*`). |
|
|
25
|
-
| **`blur` / `radius` / `boxshadow`** | **Chrome**: elevation, corners, shadows—cards, popovers, inputs. |
|
|
26
|
-
| **`brightness` / `saturation`** | **Filter tokens** for effects layers (e.g. imagery, decorative overlays). |
|
|
27
|
-
| **`border`** | **Border styles** as complete CSS values → **`--sky-border-primary`** etc. |
|
|
28
|
-
| **`separator`** | Hairline **divider** color feeding **`--sky-border-light`**. |
|
|
29
|
-
| **`motion`** | **Transition** duration and easing → **`--sky-duration-*`**, **`--sky-ease-*`**, plus **`--sky-transition-default`**. |
|
|
30
|
-
| **`zIndex`** | **Stacking** scale → **`--sky-z-*`**. |
|
|
31
|
-
| **`opacity`** | **UI opacity** for disabled/muted/subtle → **`--sky-opacity-*`**. |
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## `color`
|
|
36
|
-
|
|
37
|
-
All keys are **source primaries**. The provider **generates** lighter/darker mixes, alpha steps (`g0`–`g2`), hover variants, and **focus rings** from these— you normally only edit the primaries.
|
|
38
|
-
|
|
39
|
-
| Field | Meaning | Main emitted tokens |
|
|
40
|
-
|-------|---------|---------------------|
|
|
41
|
-
| **`background`** | Default **page / canvas** background. | `--sky-background-color` |
|
|
42
|
-
| **`foreground`** | Default **body text** color. | `--sky-text-primary` (plus derived secondary→quinary text via `color-mix`) |
|
|
43
|
-
| **`active`** | Primary **interactive / brand** color (links, primary buttons, focus ring base). | `--sky-active-*`, `--sky-focus-ring` uses active primary |
|
|
44
|
-
| **`success`** | Positive outcomes, safe actions. | `--sky-success-*` |
|
|
45
|
-
| **`warning`** | Caution, non-blocking issues. | `--sky-warning-*` |
|
|
46
|
-
| **`danger`** | Errors, destructive actions. | `--sky-danger-*` |
|
|
47
|
-
| **`info`** | Neutral informational emphasis. | `--sky-info-*` |
|
|
48
|
-
|
|
49
|
-
Each semantic family exposes **`--sky-{name}-primary`**, stepped mixes (**secondary … quinary**), **`*-dark`** variants, **alpha** **`g0`–`g2`**, **hover** variants, and **ring** **`sky-ring-{name}-*`** utilities.
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## `glass`
|
|
54
|
-
|
|
55
|
-
**Translucent UI surfaces** (frosted panels, subtle fills): pick a **base color** and **opacity steps**.
|
|
56
|
-
|
|
57
|
-
| Subfield | Meaning | Emits |
|
|
58
|
-
|----------|---------|--------|
|
|
59
|
-
| **`baseColor`** | Tint shared by glass layers. | `--sky-glass-primary`, secondary/tertiary (via mix or **`baseShades`**) |
|
|
60
|
-
| **`baseShades.secondary` / `tertiary`** | Optional explicit shades instead of auto-mix. | `--sky-glass-secondary`, `--sky-glass-tertiary` |
|
|
61
|
-
| **`opacities`** (`primary` … `solid`) | Opacity ladder for hierarchy. | `--sky-glass-primary` … **`--sky-glass-solid`** |
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## `glassSurface`
|
|
66
|
-
|
|
67
|
-
Optional **`top`** / **`bottom`** multipliers (defaults **0.16** / **0.04**) for a **linear gradient** used as **`--sky-glass-surface`**—useful for **hero bands** or **large panels** where you want a stronger vertical sheen than flat glass tokens.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## `glassHover`
|
|
72
|
-
|
|
73
|
-
**Pointer-hover overlays** on surfaces: a single **`color`** plus **per-level opacity** (`primary` … `solid`). Emits **`--sky-hover-*`**—think **dimming** a card on hover, not replacing `glass` entirely.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## `overlay`
|
|
78
|
-
|
|
79
|
-
**Modal / drawer / loading scrim** tint: **`color`** + **opacity steps**. Emits **`--sky-overlay-*`**. Use for **blocking overlays** above page content; contrast with **`glass`** (inline translucent chrome).
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Typography: `fontFamily`, `fontFamilyMono`
|
|
84
|
-
|
|
85
|
-
| Field | Emits / effect |
|
|
86
|
-
|-------|----------------|
|
|
87
|
-
| **`fontFamily`** | `--sky-font`, `--sky-font-sans`; used in semantic **`--sky-text-body`**, **`label`**, **`caption`**, **`title`**, **`heading`**, **`display`**. |
|
|
88
|
-
| **`fontFamilyMono`** | `--sky-font-mono`; monospace presets **`--sky-font-mono-{xs…4xl}`**. |
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## `fontSize`, `fontWeight`, `lineHeight`, `letterSpacing`
|
|
93
|
-
|
|
94
|
-
Maps keyed by **design tokens** (e.g. `md`, `semibold`, `normal`). Emit:
|
|
95
|
-
|
|
96
|
-
- **`--sky-font-size-*`**, **`--sky-font-weight-*`**, **`--sky-line-height-*`**, **`--sky-letter-spacing-*`**
|
|
97
|
-
- **`--sky-font-{xs…4xl}`** and **`--sky-font-mono-{xs…4xl}`** shorthands
|
|
98
|
-
- **`--sky-text-{body|label|caption|title|heading|display}`** role strings (weight + size/line + family)
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## `spacing`
|
|
103
|
-
|
|
104
|
-
Numeric-ish keys (`"1"`, `"2"`, `"4"`, …) → **`--sky-space-{key}`**. Used for **padding, gap, inset** across components. **Override spacing here** to change global density, not border widths.
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## `blur`, `radius`, `boxshadow`
|
|
109
|
-
|
|
110
|
-
| Field | Emits | Typical use |
|
|
111
|
-
|-------|-------|-------------|
|
|
112
|
-
| **`blur`** | `--sky-blur-*` as `blur(...)` | Backdrop blur on glass, frosted headers |
|
|
113
|
-
| **`radius`** | `--sky-radius-*` | Cards, buttons, inputs |
|
|
114
|
-
| **`boxshadow`** | `--sky-box-shadow-*` | Elevation / depth |
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## `brightness`, `saturation`
|
|
119
|
-
|
|
120
|
-
Emit **`--sky-brightness-*`** / **`--sky-saturation-*`** as CSS **`brightness()`** / **`saturate()`** filters—usually for **media overlays** or **effect layers**, not raw text color.
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## `border`
|
|
125
|
-
|
|
126
|
-
Complete **border** CSS values per tier (**primary** / **secondary** / **tertiary**) → **`--sky-border-*`**. Use for **strokes around surfaces** and controls.
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## `separator`
|
|
131
|
-
|
|
132
|
-
Single **hairline** color; emits **`--sky-border-light`** (full RGBA value).
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## `motion`
|
|
137
|
-
|
|
138
|
-
| Subfield | Emits |
|
|
139
|
-
|----------|--------|
|
|
140
|
-
| **`duration`** (`instant`, `fast`, `normal`, `slow`) | `--sky-duration-*` |
|
|
141
|
-
| **`ease`** (`default`, `in`, `out`, `inOut`, `bounce`) | `--sky-ease-*` |
|
|
142
|
-
|
|
143
|
-
Also drives **`--sky-transition-default`** and **`--sky-transition-fast`** shorthands.
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## `zIndex`
|
|
148
|
-
|
|
149
|
-
Named layers (**base**, **dropdown**, **sticky**, **modal**, etc.) → **`--sky-z-*`** **numbers** for predictable stacking.
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## `opacity`
|
|
154
|
-
|
|
155
|
-
**Semantic UI opacity** (**disabled**, **muted**, **subtle**) → **`--sky-opacity-*`** as unitless multipliers for styling inactive or de-emphasized UI.
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## Derived behavior (no direct theme keys)
|
|
160
|
-
|
|
161
|
-
These are **computed** from the sections above:
|
|
162
|
-
|
|
163
|
-
- **Text hierarchy**: `--sky-text-secondary` … **`quinary`** from **`foreground`** via `color-mix`.
|
|
164
|
-
- **Semantic ramps**: full **`active` / `success` / …** scales and **hover**/**ring** tokens.
|
|
165
|
-
- **Focus**: **`--sky-focus-ring`** from **`active`** primary (not a separate color key).
|
|
166
|
-
- **`--sky-text-shadow-on-glass`**: readability helper on glass.
|
|
167
|
-
- **`--sky-text-white` / `--sky-text-black`**: fixed reference whites/blacks for compositions.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Authoring workflow
|
|
172
|
-
|
|
173
|
-
1. Start from **`defaultTheme`** or **`sky-theme-generator`** output so **`light`** and **`dark`** stay paired.
|
|
174
|
-
2. Override **`color`** primaries first for brand alignment; tune **`glass`** / **`overlay`** for surfaces vs scrims.
|
|
175
|
-
3. Adjust **`spacing`** for density; **`radius`** / **`boxshadow`** for visual weight.
|
|
176
|
-
4. Validate contrast manually—the provider **does not** enforce WCAG on **`userTheme`**.
|
|
177
|
-
|
|
178
|
-
For interactive editing, bind **`sky-theme-generator`** **`value`** / **`theme-change`** into **`userTheme`** on **`sky-theme-provider`** so tokens update live.
|
|
1
|
+
# ThemeConfig / `userTheme` field guide
|
|
2
|
+
|
|
3
|
+
This document describes **what each entry in `ThemeModeConfig` is for** when you pass **`Partial<ThemeConfig>`** as **`userTheme`** on **`sky-theme-provider`**. Names are stable; **values** change per theme/mode. The provider **deep-merges** your overrides with **`defaultTheme`** separately for **`light`** and **`dark`**.
|
|
4
|
+
|
|
5
|
+
- **Type layout**: `ThemeConfig` has `{ light: ThemeModeConfig; dark: ThemeModeConfig }`.
|
|
6
|
+
- **Override rule**: Only set what you need; omitted keys keep defaults.
|
|
7
|
+
- **CSS output**: Merged config is turned into **`--sky-*`** custom properties on `:root` and/or `:host` (see `generateVarMap` in `sky-theme-provider`).
|
|
8
|
+
- **Full variable list**: MCP **`get_theme`** with **`operation: variables`** (extracted `--sky-*` names).
|
|
9
|
+
- **For AI / programmatic authoring** (path hooks, `examplePatch`, phrase→field routing): **`get_theme`** — start with **`operation: guide`**, then **`fields`**, **`field`**, **`match_intent`**, **`compose`**. Source: `packages/mcp/data/theme-authoring-contract.json`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Quick mental model
|
|
14
|
+
|
|
15
|
+
| Area | Role in the UI |
|
|
16
|
+
|------|----------------|
|
|
17
|
+
| **`color`** | Page background, default text, and **brand semantic** colors (active, success, warning, danger, info) that drive buttons, alerts, rings, and states. |
|
|
18
|
+
| **`glass`** | Translucent **surface fills** (cards, panels, chips): base tint + opacity ladder. |
|
|
19
|
+
| **`glassSurface`** | Optional **vertical gradient** strength for the special `sky-glass-surface` token (Sheen top → bottom). |
|
|
20
|
+
| **`glassHover`** | **Hoverwash** overlays on interactive surfaces (darkening/lightening), not full backgrounds. |
|
|
21
|
+
| **`overlay`** | **Scrim / modal / sheet** backdrops—full-screen or layered tint above content. |
|
|
22
|
+
| **`fontFamily` / mono** | Base **sans** and **mono** stacks; feed typography tokens and role tokens. |
|
|
23
|
+
| **`fontSize` / `fontWeight` / `lineHeight` / `letterSpacing`** | Scales used for **`--sky-font-size-*`**, **`--sky-text-*`** roles, and presets. |
|
|
24
|
+
| **`spacing`** | **Density**: padding/gaps as **`--sky-space-{key}`** (not `--sky-spacing-*`). |
|
|
25
|
+
| **`blur` / `radius` / `boxshadow`** | **Chrome**: elevation, corners, shadows—cards, popovers, inputs. |
|
|
26
|
+
| **`brightness` / `saturation`** | **Filter tokens** for effects layers (e.g. imagery, decorative overlays). |
|
|
27
|
+
| **`border`** | **Border styles** as complete CSS values → **`--sky-border-primary`** etc. |
|
|
28
|
+
| **`separator`** | Hairline **divider** color feeding **`--sky-border-light`**. |
|
|
29
|
+
| **`motion`** | **Transition** duration and easing → **`--sky-duration-*`**, **`--sky-ease-*`**, plus **`--sky-transition-default`**. |
|
|
30
|
+
| **`zIndex`** | **Stacking** scale → **`--sky-z-*`**. |
|
|
31
|
+
| **`opacity`** | **UI opacity** for disabled/muted/subtle → **`--sky-opacity-*`**. |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## `color`
|
|
36
|
+
|
|
37
|
+
All keys are **source primaries**. The provider **generates** lighter/darker mixes, alpha steps (`g0`–`g2`), hover variants, and **focus rings** from these— you normally only edit the primaries.
|
|
38
|
+
|
|
39
|
+
| Field | Meaning | Main emitted tokens |
|
|
40
|
+
|-------|---------|---------------------|
|
|
41
|
+
| **`background`** | Default **page / canvas** background. | `--sky-background-color` |
|
|
42
|
+
| **`foreground`** | Default **body text** color. | `--sky-text-primary` (plus derived secondary→quinary text via `color-mix`) |
|
|
43
|
+
| **`active`** | Primary **interactive / brand** color (links, primary buttons, focus ring base). | `--sky-active-*`, `--sky-focus-ring` uses active primary |
|
|
44
|
+
| **`success`** | Positive outcomes, safe actions. | `--sky-success-*` |
|
|
45
|
+
| **`warning`** | Caution, non-blocking issues. | `--sky-warning-*` |
|
|
46
|
+
| **`danger`** | Errors, destructive actions. | `--sky-danger-*` |
|
|
47
|
+
| **`info`** | Neutral informational emphasis. | `--sky-info-*` |
|
|
48
|
+
|
|
49
|
+
Each semantic family exposes **`--sky-{name}-primary`**, stepped mixes (**secondary … quinary**), **`*-dark`** variants, **alpha** **`g0`–`g2`**, **hover** variants, and **ring** **`sky-ring-{name}-*`** utilities.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## `glass`
|
|
54
|
+
|
|
55
|
+
**Translucent UI surfaces** (frosted panels, subtle fills): pick a **base color** and **opacity steps**.
|
|
56
|
+
|
|
57
|
+
| Subfield | Meaning | Emits |
|
|
58
|
+
|----------|---------|--------|
|
|
59
|
+
| **`baseColor`** | Tint shared by glass layers. | `--sky-glass-primary`, secondary/tertiary (via mix or **`baseShades`**) |
|
|
60
|
+
| **`baseShades.secondary` / `tertiary`** | Optional explicit shades instead of auto-mix. | `--sky-glass-secondary`, `--sky-glass-tertiary` |
|
|
61
|
+
| **`opacities`** (`primary` … `solid`) | Opacity ladder for hierarchy. | `--sky-glass-primary` … **`--sky-glass-solid`** |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## `glassSurface`
|
|
66
|
+
|
|
67
|
+
Optional **`top`** / **`bottom`** multipliers (defaults **0.16** / **0.04**) for a **linear gradient** used as **`--sky-glass-surface`**—useful for **hero bands** or **large panels** where you want a stronger vertical sheen than flat glass tokens.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## `glassHover`
|
|
72
|
+
|
|
73
|
+
**Pointer-hover overlays** on surfaces: a single **`color`** plus **per-level opacity** (`primary` … `solid`). Emits **`--sky-hover-*`**—think **dimming** a card on hover, not replacing `glass` entirely.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## `overlay`
|
|
78
|
+
|
|
79
|
+
**Modal / drawer / loading scrim** tint: **`color`** + **opacity steps**. Emits **`--sky-overlay-*`**. Use for **blocking overlays** above page content; contrast with **`glass`** (inline translucent chrome).
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Typography: `fontFamily`, `fontFamilyMono`
|
|
84
|
+
|
|
85
|
+
| Field | Emits / effect |
|
|
86
|
+
|-------|----------------|
|
|
87
|
+
| **`fontFamily`** | `--sky-font`, `--sky-font-sans`; used in semantic **`--sky-text-body`**, **`label`**, **`caption`**, **`title`**, **`heading`**, **`display`**. |
|
|
88
|
+
| **`fontFamilyMono`** | `--sky-font-mono`; monospace presets **`--sky-font-mono-{xs…4xl}`**. |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## `fontSize`, `fontWeight`, `lineHeight`, `letterSpacing`
|
|
93
|
+
|
|
94
|
+
Maps keyed by **design tokens** (e.g. `md`, `semibold`, `normal`). Emit:
|
|
95
|
+
|
|
96
|
+
- **`--sky-font-size-*`**, **`--sky-font-weight-*`**, **`--sky-line-height-*`**, **`--sky-letter-spacing-*`**
|
|
97
|
+
- **`--sky-font-{xs…4xl}`** and **`--sky-font-mono-{xs…4xl}`** shorthands
|
|
98
|
+
- **`--sky-text-{body|label|caption|title|heading|display}`** role strings (weight + size/line + family)
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## `spacing`
|
|
103
|
+
|
|
104
|
+
Numeric-ish keys (`"1"`, `"2"`, `"4"`, …) → **`--sky-space-{key}`**. Used for **padding, gap, inset** across components. **Override spacing here** to change global density, not border widths.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## `blur`, `radius`, `boxshadow`
|
|
109
|
+
|
|
110
|
+
| Field | Emits | Typical use |
|
|
111
|
+
|-------|-------|-------------|
|
|
112
|
+
| **`blur`** | `--sky-blur-*` as `blur(...)` | Backdrop blur on glass, frosted headers |
|
|
113
|
+
| **`radius`** | `--sky-radius-*` | Cards, buttons, inputs |
|
|
114
|
+
| **`boxshadow`** | `--sky-box-shadow-*` | Elevation / depth |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## `brightness`, `saturation`
|
|
119
|
+
|
|
120
|
+
Emit **`--sky-brightness-*`** / **`--sky-saturation-*`** as CSS **`brightness()`** / **`saturate()`** filters—usually for **media overlays** or **effect layers**, not raw text color.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## `border`
|
|
125
|
+
|
|
126
|
+
Complete **border** CSS values per tier (**primary** / **secondary** / **tertiary**) → **`--sky-border-*`**. Use for **strokes around surfaces** and controls.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## `separator`
|
|
131
|
+
|
|
132
|
+
Single **hairline** color; emits **`--sky-border-light`** (full RGBA value).
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## `motion`
|
|
137
|
+
|
|
138
|
+
| Subfield | Emits |
|
|
139
|
+
|----------|--------|
|
|
140
|
+
| **`duration`** (`instant`, `fast`, `normal`, `slow`) | `--sky-duration-*` |
|
|
141
|
+
| **`ease`** (`default`, `in`, `out`, `inOut`, `bounce`) | `--sky-ease-*` |
|
|
142
|
+
|
|
143
|
+
Also drives **`--sky-transition-default`** and **`--sky-transition-fast`** shorthands.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## `zIndex`
|
|
148
|
+
|
|
149
|
+
Named layers (**base**, **dropdown**, **sticky**, **modal**, etc.) → **`--sky-z-*`** **numbers** for predictable stacking.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## `opacity`
|
|
154
|
+
|
|
155
|
+
**Semantic UI opacity** (**disabled**, **muted**, **subtle**) → **`--sky-opacity-*`** as unitless multipliers for styling inactive or de-emphasized UI.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Derived behavior (no direct theme keys)
|
|
160
|
+
|
|
161
|
+
These are **computed** from the sections above:
|
|
162
|
+
|
|
163
|
+
- **Text hierarchy**: `--sky-text-secondary` … **`quinary`** from **`foreground`** via `color-mix`.
|
|
164
|
+
- **Semantic ramps**: full **`active` / `success` / …** scales and **hover**/**ring** tokens.
|
|
165
|
+
- **Focus**: **`--sky-focus-ring`** from **`active`** primary (not a separate color key).
|
|
166
|
+
- **`--sky-text-shadow-on-glass`**: readability helper on glass.
|
|
167
|
+
- **`--sky-text-white` / `--sky-text-black`**: fixed reference whites/blacks for compositions.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Authoring workflow
|
|
172
|
+
|
|
173
|
+
1. Start from **`defaultTheme`** or **`sky-theme-generator`** output so **`light`** and **`dark`** stay paired.
|
|
174
|
+
2. Override **`color`** primaries first for brand alignment; tune **`glass`** / **`overlay`** for surfaces vs scrims.
|
|
175
|
+
3. Adjust **`spacing`** for density; **`radius`** / **`boxshadow`** for visual weight.
|
|
176
|
+
4. Validate contrast manually—the provider **does not** enforce WCAG on **`userTheme`**.
|
|
177
|
+
|
|
178
|
+
For interactive editing, bind **`sky-theme-generator`** **`value`** / **`theme-change`** into **`userTheme`** on **`sky-theme-provider`** so tokens update live.
|